SlideShare une entreprise Scribd logo
1  sur  56
Digital Image Processing
Asst.Prof.Ms M B Mulik
1
Image Segmentation
2
Image segmentation is the operation of partitioning an
image into a collection of connected sets of pixels.
1. into regions, which usually cover the image
2. into linear structures, such as
- line segments
- curve segments
3. into 2D shapes, such as
- circles
- ellipses
- ribbons (long, symmetric regions)
Example 1: Regions
3
Example 2:
Straight Lines
4
Example 3:
Lines and Circular Arcs
5
Region Segmentation:
Segmentation Criteria
6
From Pavlidis
A segmentation is a partition of an image I into
a set of regions S satisfying:
1.  Si = S Partition covers the whole image.
2. Si  Sj = , i  j No regions intersect.
3.  Si, P(Si) = true Homogeneity predicate is
satisfied by each region.
4. P(Si  Sj) = false, Union of adjacent regions
i  j, Si adjacent Sj does not satisfy it.
So
7
So all we have to do is define and implement the
similarity predicate.
But, what do we want to be similar in each region?
Is there any property that will cause the regions to
be meaningful objects?
Main Methods of Region
Segmentation
8
1. Region Growing
2. Clustering
3. Split and Merge
Region Growing
9
Region growing techniques start with one pixel of a
potential region and try to grow it by adding adjacent
pixels till the pixels being compared are too disimilar.
• The first pixel selected can be just the first unlabeled
pixel in the image or a set of seed pixels can be chosen
from the image.
• Usually a statistical test is used to decide which pixels
can be added to a region.
The RGGROW Algorithm
10
• Let R be the N pixel region so far and P be a neighboring
pixel with gray tone y.
• Define the mean X and scatter S (sample variance) by
X = 1/N  I(r,c)
S = 1/N  (I(r,c) - X)
2
2
(r,c)  R
(r,c)  R
2
The RGGROW Statistical Test
11
The T statistic is defined by
(N-1) * N
T = -------------- (y - X) / S
(N+1)
22
1/2
It has a T distribution if all the pixels in R and the
test pixel y are independent and identically distributed
normals (IID assumption) .
N-1
Decision and Update
12
• For the T distribution, statistical tables give us the
probability Pr(T  t) for a given degrees of freedom
and a confidence level. From this, pick suitable
threshold t.
• If the computed T  t for desired confidence level,
add y to region R and update X and S .
• If T is too high, the value y is not likely to have arisen
from the population of pixels in R. Start a new region.
2
RGGROW Example
13
image
segmentation
Not great!
What do you think this would
do on wallpaper texture?
Clustering
14
• There are K clusters C1,…, CK with means m1,…, mK.
• The least-squares error is defined as
• Out of all possible partitions into K clusters,
choose the one that minimizes D.
Why don’t we just do this?
If we could, would we get meaningful objects?
D =   || xi - mk || .
k=1 xi  Ck
K
2
Some Clustering Methods
15
• K-means Clustering and Variants
• Isodata Clustering
• Histogram-Based Clustering and Recursive Variant
• Graph-Theoretic Clustering
K-Means Example 1
16
K-Means Example 2
17
Meng-Hee Heng’s K-means Variant
18
1. Pick 2 points Y and Z that are furthest apart in the
measurement space and make them initial cluster means.
2. Assign all points to the cluster whose mean they are
closest to and recompute means.
3. Let d be the max distance from each point to its cluster mean
and let X be the point with this distance.
4. Let q be the average distance between each pair of means.
5. If d > q / 2, make X a new cluster mean.
6. If a new cluster was formed, repeat from step 2.
Illustration of Heng Clustering
19
Y
D>q/2
q
X
1 2 3
We used this for segmentation of textured scenes.
Z
Heng Clustering with Texture Feature
20
Isodata Clustering
21
1. Select several cluster means and form clusters.
2. Split any cluster whose variance is too large.
3. Group together clusters that are too small.
4. Recompute means.
5. Repeat till 2 and 3 cannot be applied.
We used this to cluster normal vectors in 3D data.
Comparison
22
Original
K-means, K=6
Isodata, K became 5
Ohlander’s Recursive Histogram-Based
Clustering
23
• color images of real indoor and outdoor scenes
• starts with the whole image
• selects the R, G, or B histogram with largest peak
and finds clusters from that histogram
• converts to regions on the image and creates masks for each
• pushes each mask onto a stack for further clustering
Ohlander’s Method
24
sky
tree2
tree1
Ohta suggested using
(R+G+B)/3, (R-B)/2
and (2G-R-B)/4 instead
of (R, G, B).
separate
R, G, B
Jianbo Shi’s Graph-Partitioning
25
• An image is represented by a graph whose nodes
are pixels or small groups of pixels.
• The goal is to partition the vertices into disjoint sets so
that the similarity within each set is high and
across different sets is low.
Minimal Cuts
26
• Let G = (V,E) be a graph. Each edge (u,v) has a weight w(u,v)
that represents the similarity between u and v.
• Graph G can be broken into 2 disjoint graphs with node sets
A and B by removing edges that connect these sets.
• Let cut(A,B) =  w(u,v).
• One way to segment G is to find the minimal cut.
uA, vB
Cut(A,B)
27
w1
w2
A
B
cut(A,B) =  w(u,v).
uA, vB
Normalized Cut
28
Minimal cut favors cutting off small node groups,
so Shi proposed the normalized cut.
cut(A, B) cut(A,B)
Ncut(A,B) = ------------- + -------------
asso(A,V) asso(B,V)
asso(A,V) =  w(u,t)
uA, tV
How much is A connected
to the graph as a whole.
normalized
cut
Example Normalized Cut
29
2
2 2
2 2
41 3
2
2 2
3
2
2
2
1
3 3
Ncut(A,B) = ------- + ------
21 16
A B
30
How Shi used the procedure
31
Shi defined the edge weights w(i,j) by
w(i,j) = e *
e if ||X(i)-X(j)||2 < r
0 otherwise
||F(i)-F(j)||2 / I
||X(i)-X(j)||2 / X
where X(i) is the spatial location of node i
F(i) is the feature vector for node I
which can be intensity, color, texture, motion…
The formula is set up so that w(i,j) is 0 for nodes that
are too far apart.
Examples of
Shi Clustering
32
See Shi’s Web Page
http://www-2.cs.cmu.edu/~jshi
Lines and Arcs
Segmentation
33
In some image sets, lines, curves, and circular arcs
are more useful than regions or helpful in addition
to regions.
Lines and arcs are often used in
• object recognition
• stereo matching
• document analysis
Edge Detection
34
Basic idea: look for a neighborhood with strong signs
of change.
81 82 26 24
82 33 25 25
81 82 26 24
Problems:
• neighborhood size
• how to detect change
Differential Operators
35
Differential operators
• attempt to approximate the gradient at a pixel via masks
• threshold the gradient to select the edge pixels
Example: Sobel Operator
36
-1 0 1 1 2 1
Sx = -2 0 2 Sy = 0 0 0
-1 0 1 -1 -2 -1
On a pixel of the image
• let gx be the response to Sx
• let gy be the response to Sy
Then g = (gx + gy ) is the gradient magnitude.
 = atan2(gy,gx) is the gradient direction.
2 2 1/2
Java Toolkit’s Sobel Operator
37
original image gradient thresholded
magnitude gradient
magnitude
Zero Crossing Operators
38
Motivation: The zero crossings of the second derivative
of the image function are more precise than
the peaks of the first derivative.
step edge
smoothed
1st derivative
2nd derivativezero crossing
Marr/Hildreth Operator
39
• First smooth the image via a Gaussian convolution
• Apply a Laplacian filter (estimate 2nd derivative)
• Find zero crossings of the Laplacian of the Gaussian
This can be done at multiple resolutions.
Haralick Operator
40
• Fit the gray-tone intensity surface to a piecewise
cubic polynomail approximation.
• Use the approximation to find zero crossings of the
second directional derivative in the direction that
maximizes the first directional derivative.
The derivatives here are calculated from direct
mathematical expressions wrt the cubic polynomial.
Canny Edge Detector
41
• Smooth the image with a Gaussian filter.
• Compute gradient magnitude and direction at each pixel of
the smoothed image.
• Zero out any pixel response  the two neighboring pixels
on either side of it, along the direction of the gradient.
• Track high-magnitude contours.
• Keep only pixels along these contours, so weak little
segments go away.
Canny Examples
42
Best Canny on Kidney from Hw1
43
Best Canny on Blocks from Hw1
44
Finding Line and Curve Segments
from Edge Images
45
Given an edge image, how do we find line and arc segments?
Method 1: Tracking
Use masks to identify the following events:
1. start of a new segment
2. interior point continuing a segment
3. end of a segment
4. junction between multiple segments
5. corner that breaks a segment into two
junction
corner
Edge Tracking Procedure
46
for each edge pixel P {
classify its pixel type using masks
case
1. isolated point : ignore it
2. start point : make a new segment
3. interior point : add to current segment
4. end point : add to current segment and finish it
5. junction or corner : add to incoming segment
finish incoming segment
make new outgoing segment(s)
The ORT package uses a fancier corner finding approach.
Hough Transform
47
• The Hough transform is a method for detecting
lines or curves specified by a parametric function.
• If the parameters are p1, p2, … pn, then the Hough
procedure uses an n-dimensional accumulator array
in which it accumulates votes for the correct parameters
of the lines or curves found on the image.
y = mx + b
image
m
b
accumulator
Finding Straight Line Segments
48
• y = mx + b is not suitable (why?)
• The equation generally used is: d = r sin  + c cos 
d

r
c
d is the distance from the line to origin
 is the angle the perpendicular makes
with the column axis
Procedure to Accumulate Lines
49
• Set accumulator array A to all zero.
Set point list array PTLIST to all NIL.
• For each pixel (R,C) in the image {
• compute gradient magnitude GMAG
• if GMAG > gradient_threshold {
• compute quantized tangent angle THETAQ
• compute quantized distance to origin DQ
• increment A(DQ,THETAQ)
• update PTLIST(DQ,THETAQ) } }
Example
50
0 0 0 100 100
0 0 0 100 100
0 0 0 100 100
100 100 100 100 100
100 100 100 100 100
- - 0 0 -
- - 0 0 -
90 90 40 20 -
90 90 90 40 -
- - - - -
- - 3 3 -
- - 3 3 -
3 3 3 3 -
3 3 3 3 -
- - - - -
360
.
6
3
0
- - - - - - -
- - - - - - -
- - - - - - -
4 - 1 - 2 - 5
- - - - - - -
0 10 20 30 40 …90
360
.
6
3
0
- - - - - - -
- - - - - - -
- - - - - - -
* - * - * - *
- - - - - - -
(1,3)(1,4)(2,3)(2,4)
(3,1)
(3,2)
(4,1)
(4,2)
(4,3)
gray-tone image DQ THETAQ
Accumulator A PTLIST
distance
angle
How do you extract the line segments
from the accumulators?
51
pick the bin of A with highest value V
while V > value_threshold {
order the corresponding pointlist from PTLIST
merge in high gradient neighbors within 10 degrees
create line segment from final point list
zero out that bin of A
pick the bin of A with highest value V }
Finding Circles
52
Equations:
r = r0 + d sin 
c = c0 + d cos 
r, c, d are parameters
Main idea: The gradient vector at an edge pixel points
to the center of the circle.
*(r,c)
d
Why it works
53
Filled Circle:
Outer points of circle have gradient
direction pointing to center.
Circular Ring:
Outer points gradient towards center.
Inner points gradient away from center.
The points in the away direction don’t
accumulate in one bin!
Procedure to Accumulate Circles
54
• Set accumulator array A to all zero.
Set point list array PTLIST to all NIL.
• For each pixel (R,C) in the image {
For each possible value of D {
- compute gradient magnitude GMAG
- if GMAG > gradient_threshold {
. Compute THETA(R,C,D)
. R0 := R - D*cos(THETA)
. C0 := C - D* sin(THETA)
. increment A(R0,C0,D)
. update PTLIST(R0,C0,D) }}
The Burns Line Finder
55
1. Compute gradient magnitude and direction at each pixel.
2. For high gradient magnitude points, assign direction labels
to two symbolic images for two different quantizations.
3. Find connected components of each symbolic image.
1
23
4
5
6 7
8
1
23
4
5
6 7 8
• Each pixel belongs to 2 components, one for each symbolic image.
• Each pixel votes for its longer component.
• Each component receives a count of pixels who voted for it.
• The components that receive majority support are selected.
-22.5
+22.5
0
45
56
See Transparencies

Contenu connexe

Tendances

Threshold Selection for Image segmentation
Threshold Selection for Image segmentationThreshold Selection for Image segmentation
Threshold Selection for Image segmentation
Parijat Sinha
 
Comparative study on image segmentation techniques
Comparative study on image segmentation techniquesComparative study on image segmentation techniques
Comparative study on image segmentation techniques
gmidhubala
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation ppt
Gichelle Amon
 
Image processing
Image processingImage processing
Image processing
abuamo
 
Ajay ppt region segmentation new copy
Ajay ppt region segmentation new   copyAjay ppt region segmentation new   copy
Ajay ppt region segmentation new copy
Ajay Kumar Singh
 
Image representation
Image representationImage representation
Image representation
Rahul Dadwal
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
Mukul Jindal
 

Tendances (20)

Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Threshold Selection for Image segmentation
Threshold Selection for Image segmentationThreshold Selection for Image segmentation
Threshold Selection for Image segmentation
 
Comparison of image segmentation
Comparison of image segmentationComparison of image segmentation
Comparison of image segmentation
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Comparative study on image segmentation techniques
Comparative study on image segmentation techniquesComparative study on image segmentation techniques
Comparative study on image segmentation techniques
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Im seg04
Im seg04Im seg04
Im seg04
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation ppt
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Image processing
Image processingImage processing
Image processing
 
Ajay ppt region segmentation new copy
Ajay ppt region segmentation new   copyAjay ppt region segmentation new   copy
Ajay ppt region segmentation new copy
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Dip Image Segmentation
Dip Image SegmentationDip Image Segmentation
Dip Image Segmentation
 
Edge linking in image processing
Edge linking in image processingEdge linking in image processing
Edge linking in image processing
 
Graph Image Segmentation
Graph Image SegmentationGraph Image Segmentation
Graph Image Segmentation
 
Image representation
Image representationImage representation
Image representation
 
Segmentation Techniques -I
Segmentation Techniques -ISegmentation Techniques -I
Segmentation Techniques -I
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Image segmentation ajal
Image segmentation ajalImage segmentation ajal
Image segmentation ajal
 
Image parts and segmentation
Image parts and segmentation Image parts and segmentation
Image parts and segmentation
 

Similaire à Image segmentation

ImageSegmentation (1).ppt
ImageSegmentation (1).pptImageSegmentation (1).ppt
ImageSegmentation (1).ppt
NoorUlHaq47
 

Similaire à Image segmentation (20)

ImageSegmentation (1).ppt
ImageSegmentation (1).pptImageSegmentation (1).ppt
ImageSegmentation (1).ppt
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
 
regions
regionsregions
regions
 
Module-5-1_230523_171754 (1).pdf
Module-5-1_230523_171754 (1).pdfModule-5-1_230523_171754 (1).pdf
Module-5-1_230523_171754 (1).pdf
 
Image segmentation using normalized graph cut
Image segmentation using normalized graph cutImage segmentation using normalized graph cut
Image segmentation using normalized graph cut
 
Two Dimensional Shape and Texture Quantification - Medical Image Processing
Two Dimensional Shape and Texture Quantification - Medical Image ProcessingTwo Dimensional Shape and Texture Quantification - Medical Image Processing
Two Dimensional Shape and Texture Quantification - Medical Image Processing
 
Lect14 lines+circles
Lect14 lines+circlesLect14 lines+circles
Lect14 lines+circles
 
Metric dimesion of circulsnt graphs
Metric dimesion of circulsnt graphsMetric dimesion of circulsnt graphs
Metric dimesion of circulsnt graphs
 
image segmentation image segmentation.pptx
image segmentation image segmentation.pptximage segmentation image segmentation.pptx
image segmentation image segmentation.pptx
 
Math behind the kernels
Math behind the kernelsMath behind the kernels
Math behind the kernels
 
K-means Clustering Algorithm with Matlab Source code
K-means Clustering Algorithm with Matlab Source codeK-means Clustering Algorithm with Matlab Source code
K-means Clustering Algorithm with Matlab Source code
 
ImSeg04.ppt
ImSeg04.pptImSeg04.ppt
ImSeg04.ppt
 
ImSeg04 (2).ppt
ImSeg04 (2).pptImSeg04 (2).ppt
ImSeg04 (2).ppt
 
Visualization of general defined space data
Visualization of general defined space dataVisualization of general defined space data
Visualization of general defined space data
 
image segmentation by ppres.pptx
image segmentation by ppres.pptximage segmentation by ppres.pptx
image segmentation by ppres.pptx
 
Chapter10_Segmentation.ppt
Chapter10_Segmentation.pptChapter10_Segmentation.ppt
Chapter10_Segmentation.ppt
 
Scale Invariant Feature Tranform
Scale Invariant Feature TranformScale Invariant Feature Tranform
Scale Invariant Feature Tranform
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingr
 

Dernier

Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 

Dernier (20)

Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 

Image segmentation

  • 2. Image Segmentation 2 Image segmentation is the operation of partitioning an image into a collection of connected sets of pixels. 1. into regions, which usually cover the image 2. into linear structures, such as - line segments - curve segments 3. into 2D shapes, such as - circles - ellipses - ribbons (long, symmetric regions)
  • 5. Example 3: Lines and Circular Arcs 5
  • 6. Region Segmentation: Segmentation Criteria 6 From Pavlidis A segmentation is a partition of an image I into a set of regions S satisfying: 1.  Si = S Partition covers the whole image. 2. Si  Sj = , i  j No regions intersect. 3.  Si, P(Si) = true Homogeneity predicate is satisfied by each region. 4. P(Si  Sj) = false, Union of adjacent regions i  j, Si adjacent Sj does not satisfy it.
  • 7. So 7 So all we have to do is define and implement the similarity predicate. But, what do we want to be similar in each region? Is there any property that will cause the regions to be meaningful objects?
  • 8. Main Methods of Region Segmentation 8 1. Region Growing 2. Clustering 3. Split and Merge
  • 9. Region Growing 9 Region growing techniques start with one pixel of a potential region and try to grow it by adding adjacent pixels till the pixels being compared are too disimilar. • The first pixel selected can be just the first unlabeled pixel in the image or a set of seed pixels can be chosen from the image. • Usually a statistical test is used to decide which pixels can be added to a region.
  • 10. The RGGROW Algorithm 10 • Let R be the N pixel region so far and P be a neighboring pixel with gray tone y. • Define the mean X and scatter S (sample variance) by X = 1/N  I(r,c) S = 1/N  (I(r,c) - X) 2 2 (r,c)  R (r,c)  R 2
  • 11. The RGGROW Statistical Test 11 The T statistic is defined by (N-1) * N T = -------------- (y - X) / S (N+1) 22 1/2 It has a T distribution if all the pixels in R and the test pixel y are independent and identically distributed normals (IID assumption) . N-1
  • 12. Decision and Update 12 • For the T distribution, statistical tables give us the probability Pr(T  t) for a given degrees of freedom and a confidence level. From this, pick suitable threshold t. • If the computed T  t for desired confidence level, add y to region R and update X and S . • If T is too high, the value y is not likely to have arisen from the population of pixels in R. Start a new region. 2
  • 13. RGGROW Example 13 image segmentation Not great! What do you think this would do on wallpaper texture?
  • 14. Clustering 14 • There are K clusters C1,…, CK with means m1,…, mK. • The least-squares error is defined as • Out of all possible partitions into K clusters, choose the one that minimizes D. Why don’t we just do this? If we could, would we get meaningful objects? D =   || xi - mk || . k=1 xi  Ck K 2
  • 15. Some Clustering Methods 15 • K-means Clustering and Variants • Isodata Clustering • Histogram-Based Clustering and Recursive Variant • Graph-Theoretic Clustering
  • 18. Meng-Hee Heng’s K-means Variant 18 1. Pick 2 points Y and Z that are furthest apart in the measurement space and make them initial cluster means. 2. Assign all points to the cluster whose mean they are closest to and recompute means. 3. Let d be the max distance from each point to its cluster mean and let X be the point with this distance. 4. Let q be the average distance between each pair of means. 5. If d > q / 2, make X a new cluster mean. 6. If a new cluster was formed, repeat from step 2.
  • 19. Illustration of Heng Clustering 19 Y D>q/2 q X 1 2 3 We used this for segmentation of textured scenes. Z
  • 20. Heng Clustering with Texture Feature 20
  • 21. Isodata Clustering 21 1. Select several cluster means and form clusters. 2. Split any cluster whose variance is too large. 3. Group together clusters that are too small. 4. Recompute means. 5. Repeat till 2 and 3 cannot be applied. We used this to cluster normal vectors in 3D data.
  • 23. Ohlander’s Recursive Histogram-Based Clustering 23 • color images of real indoor and outdoor scenes • starts with the whole image • selects the R, G, or B histogram with largest peak and finds clusters from that histogram • converts to regions on the image and creates masks for each • pushes each mask onto a stack for further clustering
  • 24. Ohlander’s Method 24 sky tree2 tree1 Ohta suggested using (R+G+B)/3, (R-B)/2 and (2G-R-B)/4 instead of (R, G, B). separate R, G, B
  • 25. Jianbo Shi’s Graph-Partitioning 25 • An image is represented by a graph whose nodes are pixels or small groups of pixels. • The goal is to partition the vertices into disjoint sets so that the similarity within each set is high and across different sets is low.
  • 26. Minimal Cuts 26 • Let G = (V,E) be a graph. Each edge (u,v) has a weight w(u,v) that represents the similarity between u and v. • Graph G can be broken into 2 disjoint graphs with node sets A and B by removing edges that connect these sets. • Let cut(A,B) =  w(u,v). • One way to segment G is to find the minimal cut. uA, vB
  • 27. Cut(A,B) 27 w1 w2 A B cut(A,B) =  w(u,v). uA, vB
  • 28. Normalized Cut 28 Minimal cut favors cutting off small node groups, so Shi proposed the normalized cut. cut(A, B) cut(A,B) Ncut(A,B) = ------------- + ------------- asso(A,V) asso(B,V) asso(A,V) =  w(u,t) uA, tV How much is A connected to the graph as a whole. normalized cut
  • 29. Example Normalized Cut 29 2 2 2 2 2 41 3 2 2 2 3 2 2 2 1 3 3 Ncut(A,B) = ------- + ------ 21 16 A B
  • 30. 30
  • 31. How Shi used the procedure 31 Shi defined the edge weights w(i,j) by w(i,j) = e * e if ||X(i)-X(j)||2 < r 0 otherwise ||F(i)-F(j)||2 / I ||X(i)-X(j)||2 / X where X(i) is the spatial location of node i F(i) is the feature vector for node I which can be intensity, color, texture, motion… The formula is set up so that w(i,j) is 0 for nodes that are too far apart.
  • 32. Examples of Shi Clustering 32 See Shi’s Web Page http://www-2.cs.cmu.edu/~jshi
  • 33. Lines and Arcs Segmentation 33 In some image sets, lines, curves, and circular arcs are more useful than regions or helpful in addition to regions. Lines and arcs are often used in • object recognition • stereo matching • document analysis
  • 34. Edge Detection 34 Basic idea: look for a neighborhood with strong signs of change. 81 82 26 24 82 33 25 25 81 82 26 24 Problems: • neighborhood size • how to detect change
  • 35. Differential Operators 35 Differential operators • attempt to approximate the gradient at a pixel via masks • threshold the gradient to select the edge pixels
  • 36. Example: Sobel Operator 36 -1 0 1 1 2 1 Sx = -2 0 2 Sy = 0 0 0 -1 0 1 -1 -2 -1 On a pixel of the image • let gx be the response to Sx • let gy be the response to Sy Then g = (gx + gy ) is the gradient magnitude.  = atan2(gy,gx) is the gradient direction. 2 2 1/2
  • 37. Java Toolkit’s Sobel Operator 37 original image gradient thresholded magnitude gradient magnitude
  • 38. Zero Crossing Operators 38 Motivation: The zero crossings of the second derivative of the image function are more precise than the peaks of the first derivative. step edge smoothed 1st derivative 2nd derivativezero crossing
  • 39. Marr/Hildreth Operator 39 • First smooth the image via a Gaussian convolution • Apply a Laplacian filter (estimate 2nd derivative) • Find zero crossings of the Laplacian of the Gaussian This can be done at multiple resolutions.
  • 40. Haralick Operator 40 • Fit the gray-tone intensity surface to a piecewise cubic polynomail approximation. • Use the approximation to find zero crossings of the second directional derivative in the direction that maximizes the first directional derivative. The derivatives here are calculated from direct mathematical expressions wrt the cubic polynomial.
  • 41. Canny Edge Detector 41 • Smooth the image with a Gaussian filter. • Compute gradient magnitude and direction at each pixel of the smoothed image. • Zero out any pixel response  the two neighboring pixels on either side of it, along the direction of the gradient. • Track high-magnitude contours. • Keep only pixels along these contours, so weak little segments go away.
  • 43. Best Canny on Kidney from Hw1 43
  • 44. Best Canny on Blocks from Hw1 44
  • 45. Finding Line and Curve Segments from Edge Images 45 Given an edge image, how do we find line and arc segments? Method 1: Tracking Use masks to identify the following events: 1. start of a new segment 2. interior point continuing a segment 3. end of a segment 4. junction between multiple segments 5. corner that breaks a segment into two junction corner
  • 46. Edge Tracking Procedure 46 for each edge pixel P { classify its pixel type using masks case 1. isolated point : ignore it 2. start point : make a new segment 3. interior point : add to current segment 4. end point : add to current segment and finish it 5. junction or corner : add to incoming segment finish incoming segment make new outgoing segment(s) The ORT package uses a fancier corner finding approach.
  • 47. Hough Transform 47 • The Hough transform is a method for detecting lines or curves specified by a parametric function. • If the parameters are p1, p2, … pn, then the Hough procedure uses an n-dimensional accumulator array in which it accumulates votes for the correct parameters of the lines or curves found on the image. y = mx + b image m b accumulator
  • 48. Finding Straight Line Segments 48 • y = mx + b is not suitable (why?) • The equation generally used is: d = r sin  + c cos  d  r c d is the distance from the line to origin  is the angle the perpendicular makes with the column axis
  • 49. Procedure to Accumulate Lines 49 • Set accumulator array A to all zero. Set point list array PTLIST to all NIL. • For each pixel (R,C) in the image { • compute gradient magnitude GMAG • if GMAG > gradient_threshold { • compute quantized tangent angle THETAQ • compute quantized distance to origin DQ • increment A(DQ,THETAQ) • update PTLIST(DQ,THETAQ) } }
  • 50. Example 50 0 0 0 100 100 0 0 0 100 100 0 0 0 100 100 100 100 100 100 100 100 100 100 100 100 - - 0 0 - - - 0 0 - 90 90 40 20 - 90 90 90 40 - - - - - - - - 3 3 - - - 3 3 - 3 3 3 3 - 3 3 3 3 - - - - - - 360 . 6 3 0 - - - - - - - - - - - - - - - - - - - - - 4 - 1 - 2 - 5 - - - - - - - 0 10 20 30 40 …90 360 . 6 3 0 - - - - - - - - - - - - - - - - - - - - - * - * - * - * - - - - - - - (1,3)(1,4)(2,3)(2,4) (3,1) (3,2) (4,1) (4,2) (4,3) gray-tone image DQ THETAQ Accumulator A PTLIST distance angle
  • 51. How do you extract the line segments from the accumulators? 51 pick the bin of A with highest value V while V > value_threshold { order the corresponding pointlist from PTLIST merge in high gradient neighbors within 10 degrees create line segment from final point list zero out that bin of A pick the bin of A with highest value V }
  • 52. Finding Circles 52 Equations: r = r0 + d sin  c = c0 + d cos  r, c, d are parameters Main idea: The gradient vector at an edge pixel points to the center of the circle. *(r,c) d
  • 53. Why it works 53 Filled Circle: Outer points of circle have gradient direction pointing to center. Circular Ring: Outer points gradient towards center. Inner points gradient away from center. The points in the away direction don’t accumulate in one bin!
  • 54. Procedure to Accumulate Circles 54 • Set accumulator array A to all zero. Set point list array PTLIST to all NIL. • For each pixel (R,C) in the image { For each possible value of D { - compute gradient magnitude GMAG - if GMAG > gradient_threshold { . Compute THETA(R,C,D) . R0 := R - D*cos(THETA) . C0 := C - D* sin(THETA) . increment A(R0,C0,D) . update PTLIST(R0,C0,D) }}
  • 55. The Burns Line Finder 55 1. Compute gradient magnitude and direction at each pixel. 2. For high gradient magnitude points, assign direction labels to two symbolic images for two different quantizations. 3. Find connected components of each symbolic image. 1 23 4 5 6 7 8 1 23 4 5 6 7 8 • Each pixel belongs to 2 components, one for each symbolic image. • Each pixel votes for its longer component. • Each component receives a count of pixels who voted for it. • The components that receive majority support are selected. -22.5 +22.5 0 45