Video Compression

VideoNerd

Histogram Equalization is a basic image processing technique to boost contrasts, the histogram equalization is often used in the pre-processing phase to make video more plausible.

However, a straight way of histogram equalization can incur strong contouring effects (and consequently an encoder would consume more bits for retention of these superfluous edges). Moreover, by boosting of contrasts we might make camera noise visible.

The histogram equalization technique maps actual histogram of pixel intensities in an input grayscale/single-channel image to uniform:

 

 

 

One of the problems – boosting the contrast can boost the noise in the image and make contouring:

To reduce contouring a special method CLAHE of adaptive histogram equalization is commonly applied:

 

Fortunately OpenCV contains CLAHE histogram equalization method (cv2.createCLAHE), the following python script demonstrates how to apply CLAHE:

img = cv2.imread(jpgfile)     # assumed JPEG is in BGR format

          gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)   # convert BGR to gray

          equalized = cv2.equalizeHist(gray)   # apply straightforward histogram equalization

clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))   # init CLAHE method

adaptequalized = clahe.apply(gray)     # apply CLAHE method

cv2.imshow(“Original”, gray)

cv2.imshow(‘HistEqualized’, equalized)

cv2.imshow(‘AdaptHistEqualized’, adaptequalized)

14 Responses

  1. Thanks for revealing your ideas. A very important factor is that learners have an option between national student loan along with a private education loan where it is easier to decide on student loan consolidating debts than over the federal student loan.

  2. Great beat ! Iwould liike too appdentice while you amend your website, howw
    could i subscribe for a bog site? The account aided me a acceptsble deal.
    I had been tiby bitt acquainted oof thus your broadcast provided briht cleaqr idea

  3. Aw, this was a really nice post. In concept I want to put in writing like this moreover – taking time and actual effort to make an excellent article… however what can I say… I procrastinate alot and under no circumstances appear to get something done.

  4. I do agree with all the ideas you’ve presented in your post. They’re very convincing and will definitely work. Still, the posts are very short for newbies. Could you please extend them a little from next time? Thanks for the post.

Leave a Reply

Your email address will not be published. Required fields are marked *