0% found this document useful (0 votes)
7 views

Computer Vision - Session 2

Uploaded by

ahmed shawki
Copyright
© © All Rights Reserved
Available Formats
Download as ODP, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Computer Vision - Session 2

Uploaded by

ahmed shawki
Copyright
© © All Rights Reserved
Available Formats
Download as ODP, PDF, TXT or read online on Scribd
You are on page 1/ 59

Image Processing

Agenda
- Definition and Goals of Edge detection
- Modeling intensity changes.
- Steps in edge detection.
- Criteria for optimal edge detection.
- Methods of Edge Detection.
- Segmentation and its types.
- Image Segmentation Techniques.
-
-
• Edge Detection:

Is a technique of image processing used to identify points in a digital image with


discontinuities, simply to say, sharp changes in the image brightness. These
points where the image brightness varies sharply are called the edges (or
boundaries) of the image.

• What causes intensity changes?

•discontinuities in depth,
•discontinuities in surface orientation,
•changes in material properties and
•variations in scene illumination.
How to benefit from Edge Detection?
Goal of edge detection:

1- useful technique in computer vision is edge detection, where the boundaries between
objects are automatically identified. Having these boundaries makes it easy to segment
the image ,which can then be recognized separately.

2- Important features can be extracted from the edges of an image (e.g., corners, lines, curves).

2- These features are used by higher-level computer vision algorithms (e.g., recognition).
• Modeling intensity changes:
- Edges can be modeled according to their intensity profiles.
- Their some models such as :

1- Step edge.
2- Ramp edge.
3- Ridge edge.
4- Roof edge.
-
Step edge:
the image intensity abruptly changes from one value to one side of the discontinuity to a
different value on the opposite side.

Ramp edge:
a step edge where the intensity change is not instantaneous but occur over finite distance.

Roof edge:
a ridge edge where the intensity change is not instantaneous but occur over finite distance
(generated usually by the intersection of surfaces).
why we use Derivatives in Edge Detection?

Because Derivative filters provide a


quantitative measurement for the rate
of change in pixel brightness
information present in a digital image

1- first derivative is at a local extrema.

2- second derivative is a zero Crossings.


What is the extent of the addition added by Zero-Crossing over the about local extrema?
Steps in edge detection:

(1) Smoothing.
(2) Detection
(3) Localization
(1) Smoothing:
suppress as much noise as possible, without destroying
the true edges.

(2) Detection:
determine which edge pixels should be discarded as
noise and which should be retained (usually, thresholding
provides the criterion used for detection).

(3) Localization:
determine the exact location of an edge Edge thinning
and linking are usually required in this step.
Criteria for optimal edge detection:

(1) Good detection:


the optimal detector must minimize the probability
of false positives (detecting spurious edges caused by
noise), as well as that of false negatives (missing real
edges).

(2) Good localization:


the edges detected must be as close as possible to
the true edges.
(3) Single response constraint:

the detector must return one point only for each true edge point; that is,
minimize the number of local maxima around the true edge (created by noise).
Methods of Edge Detection:

•Operator depend on 1’st Derivatives such as:

1- Prewitt Operator.
2- Sobel Operator.
3- Robert Operator.
4- Canny.

•Operator depend on 2’st Derivatives such as:

1- Laplace Operator
What is the extent of the addition added by Zero-Crossing over the about local extrema?
Robert operator:

The Roberts cross operator is one of the first edge detectors. It’s is to approximate the
gradient of an image through discrete differentiation which is achieved by computing
the sum of the squares of the differences between diagonally adjacent pixels.

Primary disadvantages: High sensitivity to outliers


Approximation

For Example, calculate the magnitude of edge?


1 ●
5

1 ●
5
Prewitt Operator:

Note:
Robert use a four direction to determine the change.
Prewitt use an eight direction to determine the change.
Sobel Operator:
- use only two filters one in horizontal and another in vertical.
- Solve the problem of sensitivity to outliers (which used in Robert operator).
- Solve the problem of multiple mask (which used in Prewitt operator).
Sobel Operator:
Canny Operator:

- Convert to Gray scale

- Sobel X and Y
Smoothing using Gaussian and compute magnitude
NON-Maximum Suppression
The effect of NON-Maximum Suppression
hysteresis thresholding
1- if the gradient at a pixel is above ‘high’ declare it an ‘edge pixel’,
2- if the gradient at a pixel is below ‘Low’ declare it an ‘non-edge pixel’,
1- if the gradient at a pixel is between ‘Low’ and ‘high’ declare it an ‘edge pixel’, if and
only if it is connected to ‘edge pixel
The Effect of hysteresis thresholding
segmentation
Image segmentation is a method of dividing a digital image
into subgroups called image segments, reducing the
complexity of the image and enabling further processing or
analysis of each image segment.
Segmentation may be:
Complete segmentation:
set of disjoint regions uniquely corresponding with objects in the input image.

Partial segmentation:
regions do not correspond directly to image objects.
Types of Image Segmentation:
▪ Semantic segmentation:
Label all pixels into a semantic class.
▪ Instance segmentation:
Label pixels belonging to individual objects in the scene. Only objects are segmented.
▪ Panoptic segmentation:
Find pixels belonging to individual object in the scene and group the remaining pixels

according to semantic labels


Image Segmentation Techniques:

1- Edge-Based Segmentation

2- Threshold-Based Segmentation

3- Region-Based Segmentation

4- Cluster-Based Segmentation
Threshold-Based Segmentation:
is the simplest image segmentation method, dividing pixels based on
their intensity relative to a given value or threshold. It is suitable for
segmenting objects with higher intensity than other objects or
backgrounds.

In general, image segmentation can be


done via:

1- Pixel-based thresholding methods


2- Cell-based thresholding methods
Pixel-based Thresholding

Here thresholding is applied based on the value of the pixel itself independent from its
neighbors by means of a histogram of pixel intensities in the image.

The goal is to split the histogram of the grayscale image into two clusters dark and
bright.
This can be done either:

– Manually
– Automatically via:

Histogram centroid calculation (Average pixel intensity)

Optimal threshold algorithm

Otsu threshold algorithm
Manual Thresholding
Here we manually select threshold that best splits the two clusters.

Manual Thresholding
Here we manually select threshold that best splits the two clusters.

Manual Thresholding
Histogram Centroid
Algorithm:

Histogram Centroid

Here this automatically obtained mask requires a lot of manual postprocessing to get it
closer to the one obtained via manual thresholding, so it wouldn’t be so “automatic”
afterall.
Take the maximum
Cluster-Based Segmentation:

It is a method to perform Image Segmentation of pixel-wise


segmentation. In this type of segmentation, we try to cluster the
pixels that are together. There are two approaches for
performing the Segmentation by clustering.
• Clustering by Merging .
• Clustering by Divisive .

•Example: K-mean
K-mean:

Step 1: Select the Number of Clusters, k. ...


Step 2: Select k Points at Random. ...
Step 3: Make k Clusters. ...
Step 4: Compute New Centroid of Each Cluster.
Step 5: Assess the Quality of Each Cluster. ...
Step 6: Repeat Steps 3–5.
What is the disadvantages of k-mean and what is the alternatives?
K-mean:

1- We should determine the number of clusters which sometimes


Don’t know it.(The alternative is DB-SCAN)

2- Sensitive to outliers (The alternative is DB-SCAN and K mediod).


Assignment:

search about the development of that


Optimal threshold algorithm
Thank you

You might also like