Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

24
Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech

Transcript of Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Page 1: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Pixels

Last updated 2015. 03. 22

Heejune Ahn, SeoulTech

Page 2: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Outline What is Pixel-level processing? Pixel level Operations Transform

Histogram HE (Histogram Equalization) HA (histogram Matching)

Trhesholding

Page 3: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

1. Pixel Processing in pixel level

Not using information of neighbor pixels

Information of pixel level visual color/intensity : camera data IR (infrared) : emission from heat object, night-vision,

surveillance Medical image : density of tissue, CT (computed

tomography), MRI (magnetic resonance imaging), 3D (stack of 2Ds)

Ladar/sonar 3-D imaging: 3D scanning, depth map Scientific image

Page 4: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.
Page 5: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

2. Operations upon pixels Individual, pixel-by-pixel

Iout (n,m) = f (Iin(n,m))

E.g. Iin(n,m) + IB(n,m) or Iin(n,m) + C

Arithmetic operation contrast adjustment : imadd(I, const)

Page 6: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Blending(mixing): imadd(I1, I2)

Substraction: imsubstract(I1, I2) Difference : imabsdiff(I1, I2)

Page 7: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Multiplication, division : immultiply(I, const), imdivide(I, const)

Saturation issue Overflow & underflow problem in range [0, 255] matlab “im” functions handle the saturation

Page 8: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Logical operations Mostly for binary image NOT: imcomplement(I) OR, XOR, AND, NAND, NOR, NXOR

Thresholding Gray scale to binary image : im2bw(I, thres) Io = 1 if Iin > T or 0 o.w. Used for extract fg from bg variations

Page 9: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Thresholding for simple and complex image

Page 10: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

4. transform Mostly for improving the contrast of images

(dynamic range) Logarithmic transform

Increase the contrast in “low” values

Page 11: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Exponential transform Increase contrast in high values

Page 12: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Gamma (power)

flexible r < 1 : log-style r > 1 : exp-style

Page 13: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

4. Histograms Histogram

h(x) = # of pixels whose value is x. pmf (x) = h(x) / # of pixels

Page 14: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Thresholding Global Threshold selection

Bi-modal distribution (F3.12, previous slide) : easy to select

Multi-modal/complicated (F3.13) : not easy

Page 15: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Otsu’s Method: global optimal algorithm Threshold that minimizes the intra class standard

variance (a clustering algorithm)

level =graythresth(Img) in MATLAB

Intra-class variances

Inter-class variances

Minimizing

Maximizing

Page 16: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Adaptive thresholding Reason: Illumination is not uniform, multiple objects T(n, m) = f ( W[n,m] )

Threashold value “adapts” neighbors of pixel (n,m), W. E.g of function

mean, median, floor((max – min/2) +C

orignal

f

median

T

+ margin

still noise

Page 17: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Contrast Control To enhance visual perception Linear contrast stretching

Tips: outlier problem Use c at 5%, d at 95%

[c, d] [b= 0, a = 255] (value – c) (a-b)/(c-d) + a

Page 18: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Histogram equalization Equalization

Resultant histogram is flat/equal Nonlinear & dependent image histogram

Global method proof: Iout ~ py(y)Iin ~ px(x)

y = f(x)

Page 19: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Example Not exactly flat (in discrete values)

Page 20: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Histogram Matching Generalization of histogram equalization map output image’s histogram to a specific

function.

Iout ~ py(y) ~ Cy(y)

Iin ~ px(x) ~ Cx(x) y = f(x)

f(x) = C-1z[Cx(x)]

Page 21: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Adaptive histogram equalizer Similar reason as adaptive thresholding Local histogram generation

Sliding windows method Tile-based method

Low computation Blocking effects

inner window

outter window

Page 22: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Pizer’s approach Weighted histogram

Page 23: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

Contrast limiting Not to over-amplificate noise pixels Concept

MATLAB J = adapthisteq

(I, [param1,val1]...) Params

ClipLimit : [0:1] (0.01) NumTiles: (8) Distribution

Target distist. (uniform)

Rayleigh

exponential uniform

Page 24: Pixels Last updated 2015. 03. 22 Heejune Ahn, SeoulTech.

A Real Application Budapest Castle (Hungary)

Taken by Galaxy S5 in the evening

gray/hsv

GHE

AHE

rgb