Presentation is loading. Please wait.

Presentation is loading. Please wait.

Point Operations – Chapter 5. Definition Some of the things we do to an image involve performing the same operation on each and every pixel (point) –We.

Similar presentations


Presentation on theme: "Point Operations – Chapter 5. Definition Some of the things we do to an image involve performing the same operation on each and every pixel (point) –We."— Presentation transcript:

1 Point Operations – Chapter 5

2 Definition Some of the things we do to an image involve performing the same operation on each and every pixel (point) –We apply some function f to all pixels for all pixels If the function is independent of (u,v), the pixel coordinates, it is called homogeneous

3 Usage Image enhancement –Contrast, brightness Applying a look-up table (LUT) Changing the color space others

4 The alternative If the function involves not only the current pixel value but also it’s location it is a nonhomogeneous operation These are good for local, adaptive processes

5 Histogram All of these operations will modify the histogram!

6 Contrast enhancement This is basically a stretch (or compress – but not typically) of the histogram It’s nothing more than a multiplication but…remember you have to clamp to the intensity range a > 1 stretches the histogram,a < 1 compresses the histogram

7 Contrast enhancement

8

9 Note the introduction of gaps (multiply) and spikes (divide) in the histogram –Bins are either vacated or combined Process is reversible except when pixels become saturated (dark or light)

10 Brightness enhancement This is basically a shift (left or right) of the histogram It’s nothing more than an addition but…remember you have to clamp to the intensity range a > 0 shifts the histogram right, a < 0 shifts the histogram left

11 Brightness enhancement

12

13 Histogram will retain it’s original shape (no gaps or spikes) except when pixels become saturated (dark or light) Process is reversible except when pixels become saturated (dark or light) Operation is linear until clamping comes into play

14 Auto-contrast enhance The operations are typically combined into a single operation called “auto-contrast enhancement” Recall the definition of contrast is the “effective used of histogram bins” To utilize bins to the left of the original distribution a subtraction is performed To utilized bins to the right of the original distribution a multiplication is performed

15 Auto-contrast enhance I min is typically 0 I max is the maximum range (e.g. 255 for an 8- bit image) I low is the lowest value of the actual distribution I high is the largest value of the actual distribution

16 Contrast/Brightness enhance

17 Auto-contrast enhance In a typical image (e.g. the snake) there may be only a few pixels at I low and I high so the enhancement is not “dramatic” (or even noticeable)

18 Auto-contrast enhance The solution is to not use the actual min and max values but to specify them instead This is typically done by specifying some percentage of pixels to saturate at the dark (low) and light (high) ends of the histogram

19 Contrast/Brightness enhance

20 Contrast and brightness Note that in all the previous point operations histogram bins may be combined but a single bin is never split

21 ImageJ Process->Math->Add or Subtract – Brightness Process->Math->Multiply or Divide – Contrast Process->Enhance Contrast –Set the % of saturated pixels – the system will try to evenly distribute the percentage to the dark and light ends of the histogram –Check Normalize to actually modify the pixel values (otherwise only the display is modified) If you don’t check Normalize the histogram will not change

22 Histogram Equalization Recall the smooth gradient image that I showed previously

23 Histogram Equalization Aside from the good contrast, dynamic range, exposure, etc. another interesting point is the shape of the histogram and cumulative histogram The histogram is uniform (intensities form a uniform distribution) The cumulative histogram is a linear ramp

24 Histogram Equalization One theory is that converting the histogram of any image to an approximately uniform histogram will create a good picture “approximately” because we can’t always get “perfectly” uniform Why? –Because we can only merge bins, we cannot split them

25 Histogram Equalization Without going through the derivation (which is about 3 pages in another classic image processing book), the point operation to achieve the desired distribution is └ ┘is the floor operation (integer truncation) MxN is the size of the image K-1 is the largest possible intensity value

26 Histogram Equalization Unfortunately, theory is not always correct

27 Histogram Equalization Note that the gaps in the histogram are not uniformly spaced Note that the cumulative histogram is nearly perfectly uniform Note that the resultant image looked really bad

28 Histogram specification An alternative approach… Rather than go for the [arbitrarily chosen] uniform histogram, try to match the histogram to an given histogram But first, some definitions…

29 Normalized histogram Also known as the probability density function (probability distribution)

30 Normalized cumulative histogram Also known as the discrete distribution function (cumulative distribution function)

31 Histogram specification The goal is to apply a point operation to the image causing it’s cumulative distribution function (P A ) to match a given cdf P R Again, without going through a long derivation

32 Histogram specification P A (i)P R (i) I(u,v)I’(u,v)

33 Histogram specification

34

35 The resulting cdf’s are of comparable shape

36 Histogram specification The resulting images have a similar “look”

37 Histogram specification And yet again, the resultant image looks awful That’s because I matched two arbitrarily selected images –Normally you would use this on sets of images of which you want to give the impression that the exposures were similar or were taken in similar lighting conditions

38 Histogram specification You have to watch the implementation in the event that the reference histogram has bins with no pixels in them The book gives those details if you’re interested


Download ppt "Point Operations – Chapter 5. Definition Some of the things we do to an image involve performing the same operation on each and every pixel (point) –We."

Similar presentations


Ads by Google