More Image Processing Operations - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

More Image Processing Operations

Description:

Compute two Gx and Gy. Using some derivative estimation filter. Determining edge locations. We are interested in the magnitude of the gradient at each pixel. For ... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 19
Provided by: cbo4
Category:

less

Transcript and Presenter's Notes

Title: More Image Processing Operations


1
More Image Processing Operations
  • Some operations we want to cover
  • Edge detection, enhancement, etc.
  • Region growing

2
Edge Detection
  • We want to find the boundary between two regions
    abrupt change
  • Were looking for derivatives
  • A derivative is a type of high-pass filter
  • Whats a derivative in 2D?

3
Gradients
  • An image gradient consists of the horizontal and
    vertical partial derivatives

4
Derivative Estimators
  • Most trivial Simple difference
  • Note All must add to zero
  • Problems
  • Derivatives enhance noise
  • We desire some filtering
  • We prefer odd sized filters, not even
  • Note relation to high-pass filtering

Horz
Vert
5
Better Derivative Estimators
  • Prewitt operator
  • Sobel operator

Horz
Vert
Horz
Vert
TT
6
Steps (so far)
  • Compute two Gx and Gy
  • Using some derivative estimation filter

7
Determining edge locations
  • We are interested in the magnitude of the
    gradient at each pixel
  • For each pixel
  • Determine magnitude based on gradient images
  • Test against a threshold

8
Example code
// Filter that returns absolute values
Filter3x3A(inImg, hfilt, sobelH)
Filter3x3A(inImg, vfilt, sobelV) //
Determine where the edges are for(int r0
rltouImg.Height() r) for(int
c0 cltouImg.Width() 3 c)
double p1 hfiltrc double
p2 vfiltrc if(sqrt(p1 p1
p2 p2) gt m_threshold)
ouImg.Set(c/3, r, 255, 0, 0)

9
Improving Efficiency
  • Square root per pixel is very expensive
  • We can approximate using absolute values

if(abs(hfiltrc) abs(vfiltrc) gt
m_threshold)
ouImg.Set(c/3, r, 255, 0, 0)
TT
10
Region Growing
  • Given a point in the image
  • Use color at point as region color
  • Flag point as in region
  • Push point onto stack
  • While(stack not empty)
  • t lt- Pop stack
  • For each neighbor of t
  • if similar color and not visited before
  • Flag point as in region
  • push point onto stack

TT
11
Keeping track of the visited
  • Dummy image
  • Specific values in output image
  • Destroying input image

12
Comparing Colors
  • Vector distance
  • Manhattan distance
  • Maximum in any dimension

13
Alternative color systems and myths
  • RGB is a poor perceptual system
  • HLS is better for human color selection
  • H Hue the color
  • S Saturation How pure the color is
  • L Luminance the Brightness
  • HLS can be a poor choice for region growing (or
    other color comparisons)
  • If S 0, H does not matter
  • If L 0 or 100, H and S do not matter

14
The RGB color cube
Blu
What do our distance measures mean here?
Grn
Red
15
RGB Color cube looking down the gray line
Blu
Magenta
Cyan
Grn
Red
Yellow
16
The Hexacone HLS model
  • Parameters
  • H Angle relative to red
  • L Height from black
  • S Percentage of way from center

TT
17
Combining region growing and edge detection
  • Assume an image of only detected edges
  • What if I click on a non-edge pixel?
  • What if I click on an edge pixel?

18
Edge linking
  • Following edges to decide which are contiguous
    and the paths
  • How can we describe a path?
Write a Comment
User Comments (0)
About PowerShow.com