Module2 All Slides
Module2 All Slides
1. Good Detection: Find all the real edges and ignoring noise or artifacts.
3. Single Response: Return one point only for each true edge point.
Gradient Magnitude
High Threshold
(H)
4. Hysteresis Thresholding.
If M > H: Low Threshold
(L)
Edge
elif L< M<H:
Check is it connected with strong or weak edge
else:
No edge 2
Canny Edge Detector Example
Laplacian of Gaussian Canny Edge Detector Laplacian of Gaussian Canny Edge Detector
3
Comparison of all Edge Detector
Laplacian of
Feature Prewitt Sobel Gaussian (LOG) Canny
Gradient Operator Simple difference Weighted difference (more Second derivative (finds zero Optimized gradient &
robust) crossings) sophisticated criteria
Noise Sensitivity High Moderate High (but Gaussian blur helps) Low (due to Gaussian blur)
Computational Cost Low Slightly higher than Prewitt Higher (due to convolution) Highest
Implementation Simple Relatively simple More complex (Gaussian + More complex (multiple
Laplacian) stages)
Typical Use Cases Simple image analysis, basic General-purpose edge Images with low noise, blob High-quality edge detection,
edge detection detection detection computer vision
4
Harris Corner Detector
•Image Stitching: Finding corresponding corners in multiple images to align and stitch them together.
•Object Tracking: Tracking objects in videos by identifying and following their corners.
•3D Reconstruction: Using corners as features to reconstruct 3D models from multiple images.
5
Harris Corner Detector
6
Here M is Harris Matrix
Harris Corner Detector
0 0 1 4 9
1 0 5 7 11
1 4 9 12 16
3 8 11 14 16
8 10 15 16 20
Change in X direction
-1 0 1
-1
Change in Y direction 0
1
4 7 6 4 8 8
8 8 7 8 6 7
8 6 5 6 6 4
Ix = 4^2+7^2+6^2+8^2+8^2+8^2+7^2+8^2+6^2+5^2 = 403
Iy = 4^2+8^2+8^2+8^2+6^2+7^2+6^2+6^2+4^2 = 381
9
Hough Transforms: Line Detection
Point in Image Space will be a line in Parameter Space.
c
y Line from a non colinear point.
x m
Image Space Parameter Space c = -mx+y
Y = mx+c
m = slope
c = Intercept
c
1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1
0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0
0 0 1 0 0 0 0 1 0 0 1 1 1 1 1 1 1 3 1 1
0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0
0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1
11
m
Hough Transforms: Line Detection:
Working Example:
c
Point (1,2) and (2,3) are they colinear ?
For (1,2) –
12
Hough Transforms: Line Detection: Polar form
Issues:
Solution:
Polar form. Ro (rho) is distance from origin and theta is the angle for the same.
13
Hough Transforms: Circle Detection
y b
x a
Image Plane Parameter Plane
For each circle point in the image plane their will be a Accumulator Array filing will be circular
circle in the parameter space. b
0 1 1 1 0
(x-a)^2 + (y-b)^2 = r^2 1 0 0 0 1
1 0 3 0 1
a,b = centre of the circle.
r = radius of the circle. 1 0 0 0 1
1 1 1 1 0
If r is known then parameter space contains 2
parameters a and b. a
14
Problems with Hough Transform
1.Computational Cost:
2.Parameter Sensitivity:
3.Memory Usage
15
Morphological Operations
1. Morphological operations are a set of techniques used in image processing to analyze and modify the shape and
structure of objects within an image.
2. Morphological operations are defined in terms of sets. Specifically in Image Processing, Morphology uses two types of
set of pixels. Structuring element can be specified in terms of both foreground and background pixels.
16
Dilation
Dilation generally grow or increase thickness. Full match = 1
Partial match = 1
No match = 0
For Example
0 0 0 0 0 0 0 0 1 1 0 0
0 0 1 1 0 0 1 0 1 1 1 1 0
0 1 1 1 1 0 1 0 1 1 1 1 0
0 0 1 1 0 0 1 0 1 1 1 1 0
0 0 0 0 0 0 0 0 1 1 0 0
17
Dilation Examples
Application of dilation
18
Erosion
Erosion generally shrink or decrease thickness. Full match = 1
Partial match = 0
No match = 0
For Example
1 1 1 1 1 1 0 0 0 0 0 0
1 1 0 0 1 1 1 1 0 0 0 0 1
1 0 0 0 0 1 1 1 0 0 0 0 1
1 1 0 0 1 1 1 1 0 0 0 0 1
1 1 1 1 1 1 0 0 0 0 0 0
19
Erosion Examples
Application of erosion
1. Noise Removal.
2. Object Separation and feature extraction
20
Opening
Erosion followed by Dilation
0 0 0 0 0 0 0
0 1 0 0 0 1 0
0 0 0 0 0 0 0
For Example
Erosion
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 0 1 1 1
1 1 1 0 1 1 1 1 1 1
1 1 1 0 1 1 1
22
CSET344/CMCA544
Image and Video Processing
24
Hit or Miss Transform – (HMT)
Detecting a shape D
Structuring element
completely fits on
several locations.
25
Hit or Miss Transform – (HMT)
Q. Instead of going for two structuring elements. Can we detect the same shape by using a single structuring element ?
Solution. Use a structuring element B which is exactly same shape as D with additional border of background elements
with a width of one pixel thick.
26
Hit or Miss Transform – (HMT)
One Structuring Element
29
Basic Morphological Algorithms
X0 X1 X2 X3
1 1 1 1 1 1 1
1 1 1 1 1
1
1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1
X6 X7 X8 X8 U A 30
Basic Morphological Algorithms
Connected Components – It generally used to extract all the connected components in original image A.
Erosion Shrinking - Make the objects much thinner or highlight the core part of object.
Remove Noise – Eliminates noise along the edge of the objects.
Texture Analysis
Statistical Approaches or Spectral Approaches or
Techniques Techniques
1 7 2 1
2 3 4 5
7 2 1 7
8 2 1 7
GLCM Example
Construct a GLCM matrix for the below matrix
Assigning Colors to grey scale intensity Image Acquired using a full color sensor like
or range of intensities. digital camera or color scanner.
Color Fundamentals
1. Basically the color human and other animal perceive in an object is determined by the nature of the light
reflected from the target.
2. Chromatic Light spans the electromagnetic spectrum from approximately 400nm to 700nm.
Three basic quantities used to describe the quality of chromatic light source are :
Radiance.
Luminance.
Brightness.
Color Fundamentals
Radiance: Total amount of energy flows from a light source. It is measured in Watt.
Luminance: Total amount of energy that an observer perceive from the light source. It is measured
in lumens (lm). For example infrared.
Cones are the sensors in the human eye responsible for color vision.
Example :
High Saturation: Lets say, if you are using pure red paint then its fully
saturated.
Low Saturation: If you are gradually mixing white paint inside the red then it
changed from pure red to faded red or pink.
Brightness : it always refer how light and dark color will appear.
Tristimulus Values – The amount of red green and blue required to form any particular color is known as tristimulus values
and it is denoted by X, Y, Z.
2. There should be a subspace within system, such that each color in the model is represented by a single point contained
in it.
Color Model Application Domain(s) Key Characteristics
Computer displays, digital cameras, Additive color model (combining light);
RGB image scanners device-dependent
Older printing technologies (less Subtractive color model (absorbing
CMY common now) light); device-dependent
Subtractive color model; handles black
CMYK Color printing (magazines, books, etc.) ink; device-dependent
Image editing, color analysis, computer Hue, Saturation, Intensity; more
HSI vision intuitive for color adjustments
Image editing, color picking, computer Hue, Saturation, Value; similar to HSI,
HSV graphics slightly different brightness
representation
Digital video (DVDs, Blu-ray, digital TV), Separates luminance (brightness) from
YCbCr JPEG compression chrominance (color) for efficient
compression
Color Models: RGB
Color Models RGB 1. RGB model based on cartesian coordinate system.
Motivation: Human can differentiate between different colors and intensities as compared to different shades of grey.
Color Image
Pseudo Image Processing
Intensity Slicing and Color Coding
Grey Scale Image Intensity Slicing using 8 Color coded image of the weld,
colors X-ray image of the weld where one color assign to 255
intensity levels and another color
to all other intensity levels.
Regions that appear of constant intensity in grey
scale is quite variable in the color sliced image.
It will make the quality inspector job easy, as a result
low error rate.
Pseudo Image Processing
Intensity to color transformations : it is better than the simple slicing techniques.
NIR of Landsat RGB Color Composite using IR,G,B RGB Color composite using R,IR,B
Basics of Full Color Image Processing
Full Color Image Processing
Process each Grey scale color Process or work with the color pixel
image components individually directly.
and then form a composite color
image
Color Transformations
Tone Correction
Image Negative
Color Complements