1.57k likes | 1.68k Views
Edges. Edges = jumps in brightness/color. Brightness jumps marked in white. Edges. Edges = jumps in brightness/color Important! Give object outlines and shapes. Brightness jumps marked in white. Edges. Edges = jumps in brightness/color Important! Give object outlines and shapes
E N D
Edges • Edges = jumps in brightness/color Brightness jumps marked in white
Edges • Edges = jumps in brightness/color • Important! • Give object outlines and shapes Brightness jumps marked in white
Edges • Edges = jumps in brightness/color • Important! • Give object outlines and shapes • Relatively robust not so affected by changes in lighting, camera, viewpoint… Brightness jumps marked in white
Edges not so affected by lighting Face outline persists, despite very different lighting
What do “edges” look like? Brightness Brightness Row number Column number “Jumps” can be gradual or jagged
Brightness jumps are not always obvious when you look at the brightness profile
Detecting edges • Want to detect jumps brightness profiles at a jump (ideally)
Detecting edges • Want to detect jumps brightness profiles at a jump (ideally) Of course should detect jumps in any orientation!
Detecting edges • Want to detect jumps brightness profiles at a jump (ideally) Off course should detect jumps in any orientation!
Detecting edges • Want to detect jumps • Filters detect themselves brightness profiles at a jump (ideally) Eye detection: Convolve with eye filter
Detecting edges • Want to detect jumps • Filters detect themselves To detect jumps, convolve image with jumps brightness profiles at a jump (ideally) Eye detection: Convolve with eye filter
Detecting edges • To detect jumps, convolve with jumps
Detecting edges • To detect jumps, convolve with jumps • If image has no jump, convolving should give zero (convolving a constant image should give 0) Filter weights should sum to 0 In equations:
Detecting edges • To detect jumps, convolve with jumps • Mask weights should sum to 0 • To detect all jumps (dark-to-bright and bright-to-dark)…
Detecting edges • To detect jumps, convolve with jumps • Mask weights should sum to 0 • To detect all jumps (dark-to-bright and bright-to-dark)… Use magnitude(absolute value) of convolution result
Edge detection • To detect jumps along x Convolve with [1, -1] • To detect jumps along y Convolve with Horizontal jumps Vertical jumps After taking absolute value of convolution result, only jumps stand out as bright spots. Smooth image regions, where the brightness changes slowly, are dark.
Edge Detection • To “detect edges”, decide how big a jump must be to qualify • Choose threshold T • If magnitude of convolution is >T at some pixel, mark it as edge pixel (“edgel”) Horizontal edges Marked (white) pixels have T is about 15% of
Edge detection • How to detect edges in any orientation? • Answer: compute remember:
Edgels: T = 6% of Edgels: T = 12% of Edgels: T = 25% of
Edgels: T = 6% of Higher threshold: cleaner but more fragmented Edgels: T = 12% of Edgels: T = 25% of
Edge detection • Many questions • We’re convolving with [-1 1]
Edge detection (Overall sign isn’t important…) • Many questions • We’re convolving with [-1 1]
Edge detection • Many questions • We’re convolving with [-1 1] = [... 0 0 0 -1 1 0 0 …]
Edge detection • Many questions • We’re convolving with [-1 1]… Should we use [-1 -1 -1 -1 1 1 1 1 ] instead? (This would detect jumps between large bright areas next to large dark areas)
Edge detection • Many questions • We’re convolving with [-1 1]… Should we use [-1 -1 -1 -1 1 1 1 1 ] instead? (This would detect jumps between large bright areas next to large dark areas) But not so good for
Edge detection • Many questions • We’re convolving with [-1 1] • Should we look for smoother, more gradual change? • [-0.02 -0.08 -0.06 0.06 0.08 0.02]
Edge detection • Many questions • We’re convolving with [-1 1] • Should we look for smoother, more gradual change? • [-0.02 -0.08 -0.06 0.06 0.08 0.02] Recall smooth brightness profile for car image edge
Edge detection • Many questions • We’re convolving with [-1 1] • To detect long boundary, should we average along it?
Edge detection • Many questions • We’re convolving with [-1 1] • To detect long boundary, should we average along it? 0 1 -1 0 0 -1 0 1 0 -1 0 1 Detects jumps along x direction averages over y direction
Edge detection • Many questions • We’re convolving with [-1 1] • To detect long boundary, should we average along it? 0 1 -1 0 0 -1 0 1 0 -1 0 1 Detects jumps along x direction averages over y direction Good for long low contrast boundaries, accurate orientation measurement
Note: edge detection and derivative Original image: Blurry brightness transition derivative has maximum at point of steepest rise First derivative
Note: edge detection and derivative Original image: Blurry brightness transition derivative has maximum at point of steepest rise First derivative • To detect fast change in image, compute derivative.
Note: edge detection and derivative Original image: Blurry brightness transition derivative has maximum at point of steepest rise First derivative • To detect fast change, compute derivative. same as convolving with [1 -1] !
Note: edge detection and derivative Original image: Blurry brightness transition derivative has maximum at point of steepest rise First derivative • To detect fast change, compute derivative. same as convolving with [1 -1] !
Note: edge detection and derivative Original image: Blurry brightness transition derivative has maximum at point of steepest rise First derivative • To detect fast change, compute derivative. same as convolving with [1 -1] !
Note: edge detection and derivative Original image: Blurry brightness transition derivative has maximum at point of steepest rise First derivative • To detect fast change, compute derivative. same as convolving with [1 -1] ! Remember the flip in convolution
Convolution and Derivatives • Convolving I with [1, -1] gives • Convolving I with gives Approximate derivatives in x and y
Convolution and Derivatives • Convolving I with [1, -1] gives • Convolving I with gives • Define gradient of I Approximate derivatives in x and y
Convolution and Derivatives • Convolving I with [1, -1] gives • Convolving I with gives • Define gradient of I • From calculus: Approximate derivatives in x and y
Convolution and Derivatives • Convolving I with [1, -1] gives • Convolving I with gives • Define gradient of I • From calculus: • Approximate image gradient Approximate derivatives in x and y
What is the gradient? Change
What is the gradient? Change
What is the gradient? Less Change More Change
What is the gradient? Less Change More Change Gradient direction is perpendicular to edge
What is the gradient? Less Change More Change Gradient Magnitude gives size of brightness jump Gradient direction is perpendicular to edge
Gradient • Brightness change in direction Chain rule:
Gradient • Brightness change in direction Chain rule:
Gradient • Brightness change in direction Chain rule: