manipulating contrast point operations n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Manipulating contrast/point operations PowerPoint Presentation
Download Presentation
Manipulating contrast/point operations

Loading in 2 Seconds...

play fullscreen
1 / 26

Manipulating contrast/point operations - PowerPoint PPT Presentation


  • 85 Views
  • Uploaded on

Manipulating contrast/point operations. Examples of point operations:. Threshold (demo) Invert (demo) Out[ x,y ] = max – In[ x,y ] RGB  gray conversion Gamma correction Other methods histogram equalization color to gray scaling. Gray to binary. Thresholding G  B

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Manipulating contrast/point operations' - siran


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
examples of point operations
Examples of point operations:
  • Threshold (demo)
  • Invert (demo)

Out[x,y] = max – In[x,y]

  • RGB  gray conversion
  • Gamma correction
  • Other methods
    • histogram equalization
    • color to gray
    • scaling
gray to binary
Gray to binary
  • Thresholding
    • G  B

const int t=200;

if (G[r][c]>t) B[r][c]=1;

else B[r][c]=0;

How do we choose t?

    • Interactively
    • Automatically
histogram equalization1
Histogram equalization
  • For many images we observe that it only uses a few different gray values.
  • Often these gray values are close together.
histogram equalization2
Histogram equalization
  • Histogram equalization goals:
    • Output image should use all gray values.
    • Output image has same number of pixels of each gray value.
      • Which distribution is then preferred? (normal or uniform)
    • (While maintaining the relationship (order) among gray values. - George’s rule.)
histogram equalization3
Histogram equalization

from http://en.wikipedia.org/wiki/Histogram_equalization

histo eq example from http www cs utah edu jfishbau improc project2 images crowd hist compare png
Histoeq example(from http://www.cs.utah.edu/~jfishbau/improc/project2/images/crowd_hist_compare.png)
histogram equalization4
Histogram equalization
  • Histogram equalization attempts to remap the input gray values to output gray values s.t. the histogram of the output achieves goals 1 and 2 (and 3) as best as possible.
slide11
Histoeq example(from http://web2.clarkson.edu/class/image_process/qa1/Histogram%20Equalization%20Example_files/img92.gif)
histogram
Histogram
  • Step 1: Estimate probability of a given gray value in an image.
    • h(g) = count of pixels w/ gray value equal to g.
      • histogram
    • p(g) = h(g) / (w*h)
      • w*h = # of pixels in entire image
  • Demo histogram.
histogram equalization5
Histogram equalization
  • Step 2: Estimate c.d.f. (cumulative distribution function).
histogram equalization6
Histogram equalization
  • Step 3: Use c.d.f. to map an input gray value g to “equalized” gray value, g’.
    • Note: Since cdf(g) is in [0..1], we need to multiply by the max gray value so the result is in [0..max].
    • Note: Calculate above only once for each gray value, save in a (lookup) table, and then let g’=lut[g].
histogram equalization7
Histogram equalization
  • Only gray eq discussed so far.
  • What about color?
    • Create 3 separate histograms for R, G, and B, and then equalize each individually (same as gray).
    • Better way is to convert RGB to color space with luminance (e.g., CIE XYZ, YIQ, YUV, HSL, or HSV), equalize luminance (same as gray), then convert back to RGB.
histogram equalization algorithm
Histogram equalization algorithm
  • Do Exercise 5.2 for homework.
what about gray data that is less than 8 bits
What about gray data that is less than 8 bits?
  • Linearly map input [0,K] to [0,255].
what about gray data that is less than 8 bits1
What about gray data that is less than 8 bits?
  • What if our minimum input value is something other than 0?
what about gray data that is more than 8 bits
What about gray data that is more than 8 bits?
  • Linearly map input min to 0 and input max to 255.
    • But we then compress (lose) our dynamic range, i.e., lose details.
  • Map subranges of gray data to [0..255].
    • A.K.A. window width and level.
from http www netterimages com images vpv 000 000 061 61653 0550x0475 jpg
from http://www.netterimages.com/images/vpv/000/000/061/61653-0550x0475.jpg
window width and level
Window width and level
  • Map subranges of gray data to [0..255].
    • A.K.A. window width and level.
window width and level1
Window width and level
  • Map subranges of gray data to [0..255].
    • A.K.A. window width and level.
from https www imt liu se people dafor visualization files image001 png
from https://www.imt.liu.se/people/dafor/visualization_files/image001.png
standard conversion from r g b to g ray
Standard conversion from rgb to gray
  • NTSC luminance

int luminance = (int)(0.30*r + 0.59*g + 0.11*b + 0.5);

if (luminance<0) luminance = 0;

if (luminance>255) luminance = 255;

http://www.tektronix.com/Measurement/cgi-bin/framed.pl?Document=/Measurement/App_Notes/NTSC_Video_Msmt/colorbars.html&FrameSet=television