SlideShare a Scribd company logo
Institute of Informatics
E¨otv¨os Lor´and University
Budapest, Hungary
Basic Algorithms for Digital Image Analysis:
a course
Dmitrij Csetverikov
with help of Attila Lerch, Judit Verest´oy, Zolt´an Megyesi, Zsolt Jank´o
and Levente Hajder
http://visual.ipan.sztaki.hu
Lecture 8: Corner detection
• Zero-crossing edge detector
• Summary of edge detection
• Corner detection in greyscale images
• The local structure matrix
• The KLT corner detector
• The Harris corner detector
• Comparison of the two corner detectors
2
Zero-crossing edge detector
2
f(x)
___
Double edge
Zero crossing
Blurred edgeSteep edge
__
dx
df
_
2
d f
dx
-
00
00
+ +
+ +
-
--
Left: Principles of zero-crossing edge detector.
Right: Simple masks for detection of zero-crossings.
3
Implementation of the zero crossing filter: Gaussian smoothing followed by
Laplacian filtering.
• Using commutativity and associativity of linear filters and rotation symmetry of
Gaussian filter, we obtain the convolution mask of the zero-crossing operator,
called Laplacian-of-Gaussian (LoG):
wZ(r) = C
r2
σ2
− 1 exp
−r2
2σ2
◦ C: normalisation constant
◦ r2
= x2
+ y2
: square distance from centre of mask
◦ σ is scale parameter: the smaller the σ the finer the edges obtained
• Discrete zero-crossing mask: Threshold wZ(r) at a small level.
⇒ Larger mask obtained for larger σ: For example, when σ = 4 the size of the
mask is about 40 pixels.
4
• Another, more efficient but approximate, implementation of the zero-crossing
filter is the difference of two separable Gaussian filters, called DoG.
• Localising the zero-crossings corresponds to edge localisation in gradient-type
edge detectors.
◦ For more precise localisation, one can locally approximate output of LoG filter
by facets (flat patches), then find zero-crossings analytically.
LoG absolute LoG zero DoG zero
Examples of edge detection by 15 × 15 LoG and DoG operators. ‘LoG absolute’ is
absolute value of filter output: dark lines are contours. ‘LoG zero’ was obtained
with removal of weak edges, ‘DoG zero’ without removal.
5
Properties of zero crossing edge detector
• The continuous zero-crossing edge detector always gives closed contours.
◦ Reason: Cross-sections of continuous surface at zero level
◦ In principle, this may help in contour following
◦ In practice, many spurious loops appear
• Controlled operator size σ ⇒ Natural edge hierarchy within a scale-space.
◦ Edges may only merge or disappear at rougher scales (larger σ)
◦ This tree-like data structure facilitates structural analysis of image
• Does not provide edge orientation.
◦ Non-maxima suppression and hysteresis threshoding are not applicable
◦ Other ways of post-processing to remove unrealiable edges can be used
6
Prewitt 3 × 3 M´er˝o-Vassy 7 × 7 LoG 21 × 21
Canny 3 × 3 Canny 7 × 7 Canny 25 × 25
Examples of edge detection by different operators. The LoG result was obtained
with removal of weak edges. M´er˝o-Vassy is a non-gradient edge detector.
7
Summary of edge detection
• 3 × 3 gradient operators (Prewitt, Sobel) are simple and fast. Used when
◦ Fine edges are only needed
◦ Noise level is low
• By varying the σ parameter, the Canny operator can be used
◦ to detect fine as well as rough edges
◦ at different noise levels
• All gradient operators
◦ Provide edge orientation
◦ Need localisation: non-maxima suppression, hysteresis threshoding
• The zero-crossing edge detector
◦ Is supported by neurophysiological experiments
◦ Was popular in the 1980’s
◦ Today, less frequently used in practice
8
Corner detection in greyscale images
A reminder:
• Corners are used in shape analysis and motion analysis
◦ Motion is ambiguous at an edge, unambiguous at a corner
◦ Shapes can be approximately reconstructed from their corners
• Two different operations although related operations are called corner detection:
◦ Detection of corners in greyscale images
∗ does not assume extracted contours
◦ Detection of corners in digital curves
∗ assumes extracted contours
This lecture deals with corner detection in greyscale images. Corner detection in
contours will be discussed later.
9
Corners, edges, and derivatives of intensity function
Diference between greyscale corners and edges:
• Corners are local image features characterised by locations where variations of
intensity function f(x, y) in both X and Y directions are high.
⇒ Both partial derivatives fx and fy are large
• Edges are locations where the variation of f(x, y) in a certain direction is high,
while the variation in the orthogonal direction is low.
⇒ In an edge oriented along the Y axis, fx is large, while is fy small
Y
X
Y
X
EdgeCorner
A corner and an edge.
10
Two selected corner detectors
Different corner detectors exist, but we will only consider two of them:
• The Kanade-Lucas-Tomasi (KLT) operator
• The Harris operator
Reasons:
• Most frequently used: Harris in Europe, KLT in US.
• Can select corners and other interest points.
• Have many application areas, for example:
◦ motion tracking, stereo matching, image database retrieval
• Are relatively simple but still efficient and reliable.
The two operators are closely related and based on the local structure matrix.
11
The local structure matrix Cstr
Definition of the local structure matrix (tensor):
Cstr = wG(r; σ) ∗
f2
x fxfy
fxfy f2
y
(1)
Explanation of the definition:
• The derivatives of the intensity function f(x, y) are first calculated in each point.
◦ If necessary, the image is smoothed before taking the derivatives
• Then, the entries of the matrix (f2
x, etc.) are obtained.
• Finally, each of the entries is smoothed (integrated) by Gaussian filter wG(r; σ)
of selected size σ.
◦ Often, a simple box (averaging) filter is used instead of the Gaussian.
12
Properties of the local structure matrix
Denoting in (1) the smoothing by ff, we have
Cstr =
f2
x fxfy
fxfy f2
y
The local structure matrix Cstr is
• Symmetric
⇒ It can be diagonalised by rotation of the coordinate axes. The diagonal entries
will be the two eigenvalues λ1 and λ2:
Cstr =
λ1 0
0 λ2
• Positive definite
⇒ The eigenvalues are nonnegative. Assume λ1 ≥ λ2 ≥ 0.
13
The meaning of the eigenvalues of Cstr
The geometric interpretation of λ1 and λ2:
• For a perfectly uniform image: Cstr = 0 and λ1 = λ2 = 0.
• For a perfectly black-and-white step edge: λ1 > 0, λ2 = 0, where the eigenvector
associated with λ1 is orthogonal to the edge.
• For a corner of black square against a white background: λ1 ≥ λ2 > 0.
◦ The higher the contrast in that direction, the larger the eigenvalue
Basic observations:
• The eigenvectors encode edge directions, the eigenvectors edge magnitudes.
• A corner is identified by two strong edges ⇒ A corner is a location where the
smaller eigenvalue, λ2, is large enough.
14
The KLT corner detector has two parameters: the threshold on λ2, denoted by
λthr, and the linear size of a square window (neighbourhood) D.
Algorithm 1: The KLT Corner Detector
1. Compute fx and fy over the entire image f(x, y).
2. For each image point p:
(a) form the matrix Cstr over a D × D neighbourhood of p;
(b) compute λ2, the smaller eigenvalue of Cstr;
(c) if λ2 > λthr, save the p into a list, L.
3. Sort L in decreasing order of λ2.
4. Scan the sorted list from top to bottom. For each current point, p, delete all
points apperaring further in the list which belong to the neighbourhood of p.
15
The output is a list of feature points with the following properties:
• In these points, λ2 > λthr.
• The D-neighbourhoods of these points do not overlap.
Selection of the parameters λthr and D:
• The threshold λthr can be estimated from the histogram of λ2: usually, there is
an obvious valley near zero.
◦ Unfortunately, such valley is not always present
• There is no simple criterion for the window size D. Values between 2 and 10
are adequate in most practical cases.
◦ For large D, the detected corner tends to move away from its actual position
◦ Some corners which are close to each other may be lost
16
Example of corner detection by the KLT operator.
17
The Harris corner detector
The Harris corner detector (1988) appeared earlier than KLT. KLT is a different
interpretation of the original Harris idea.
Harris defined a measure of corner strength:
H(x, y) = det Cstr − α (trace Cstr)
2
,
where α is a parameter and H ≥ 0 if 0 ≤ α ≤ 0.25.
A corner is detected when
H(x, y) > Hthr,
where Hthr is another parameter, a threshold on corner strength.
Similar to the KLT, the Harris corner detector uses D-neighbourhoods to discard
weak corners in the neighbourhood of a strong corner.
18
Parameter of Harris operator and relation to KLT
Assume as before that λ1 ≥ λ2 ≥ 0. Introduce λ1 = λ, λ2 = κλ, 0 ≤ κ ≤ 1.
Using the relations between eigenvalues, determinant and trace of a matrix A
det A =
i
λi
trace A =
i
λi,
we obtain that
H = λ1λ2 − α(λ1 + λ2)2
= λ2
κ − α(1 + κ)2
Assuming that H ≥ 0, we have
0 ≤ α ≤
k
(1 + κ)2
≤ 0.25 and, for small κ, H ≈ λ2
(κ − α) , α κ
19
In the Harris operator, α plays a role similar to that of λthr in the KLT operator.
• Larger α ⇒ smaller H ⇒ less sensitive detector: less corners detected.
• Smaller α ⇒ larger H ⇒ more sensitive detector: more corners detected.
Usually, Hthr is set close to zero and fixed, while α is a variable parameter.
original image α = 0.05 α = 0.10
α = 0.20 α = 0.22 α = 0.24
Corner detection by Harris operator: influence of α. (Hthr = 0.)
20
Example of corner detection by the Harris operator.
21
KLT 40 corners Harris α = 0.2
Comparison of the two operators.
22
Summary of corner detection
• The KLT and the Harris corner detectors are conceptually related.
◦ Based on local structure matrix Cstr
◦ Search for points where variations in two orthogonal directions are large
• Difference between the two detectors:
◦ KLT sets explicit threshold on the diagonalised Cstr
◦ Harris sets implicit threshold via corner magnitude H(x, y)
• The KLT detector
◦ usually gives results which are closer to human perception of corners;
◦ is often used for motion tracking in the wide-spread KLT Tracker.
• The Harris detector
◦ provides good repeatability under varying rotation and illumination;
◦ if often used in stereo matching and image database retrieval.
• Both operators may detect interest points other than corners.
23

More Related Content

What's hot

Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determinationPatel Punit
 
Computer Graphics (Hidden surfaces and line removal, Curves and surfaces, Sur...
Computer Graphics (Hidden surfaces and line removal, Curves and surfaces, Sur...Computer Graphics (Hidden surfaces and line removal, Curves and surfaces, Sur...
Computer Graphics (Hidden surfaces and line removal, Curves and surfaces, Sur...
rohitjasudkar
 
Rendering Curves and Surfaces
Rendering Curves and SurfacesRendering Curves and Surfaces
Rendering Curves and Surfaces
Syed Zaid Irshad
 
hidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithmhidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithmrajivagarwal23dei
 
Visible Surface Detection
Visible Surface DetectionVisible Surface Detection
Visible Surface Detection
AmitBiswas99
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphicanku2266
 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
Punyajoy Saha
 
Clipping
ClippingClipping
Clipping
AMIT VIRAMGAMI
 
Hidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferHidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-buffer
Raj Sikarwar
 
Curves and Surfaces
Curves and SurfacesCurves and Surfaces
Curves and Surfaces
Syed Zaid Irshad
 
Computer Graphics: Visible surface detection methods
Computer Graphics: Visible surface detection methodsComputer Graphics: Visible surface detection methods
Computer Graphics: Visible surface detection methods
Joseph Charles
 
Parametric equations
Parametric equationsParametric equations
Parametric equationsTarun Gehlot
 
Polygons - Computer Graphics - Notes
Polygons - Computer Graphics - NotesPolygons - Computer Graphics - Notes
Polygons - Computer Graphics - Notes
Omprakash Chauhan
 
rural marketing ppt
rural marketing pptrural marketing ppt
rural marketing pptelaya1984
 
CS 354 Bezier Curves
CS 354 Bezier Curves CS 354 Bezier Curves
CS 354 Bezier Curves
Mark Kilgard
 
Invariant Generalised Hough Transform
Invariant Generalised Hough TransformInvariant Generalised Hough Transform
Invariant Generalised Hough TransformShashank Dhariwal
 
图像分割算法基础
 图像分割算法基础 图像分割算法基础
图像分割算法基础
Bill Chauvet
 
Hidden lines & surfaces
Hidden lines & surfacesHidden lines & surfaces
Hidden lines & surfaces
Ankur Kumar
 

What's hot (20)

Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determination
 
Computer Graphics (Hidden surfaces and line removal, Curves and surfaces, Sur...
Computer Graphics (Hidden surfaces and line removal, Curves and surfaces, Sur...Computer Graphics (Hidden surfaces and line removal, Curves and surfaces, Sur...
Computer Graphics (Hidden surfaces and line removal, Curves and surfaces, Sur...
 
Rendering Curves and Surfaces
Rendering Curves and SurfacesRendering Curves and Surfaces
Rendering Curves and Surfaces
 
testpang
testpangtestpang
testpang
 
hidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithmhidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithm
 
Visible Surface Detection
Visible Surface DetectionVisible Surface Detection
Visible Surface Detection
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
 
visible surface detection
visible surface detectionvisible surface detection
visible surface detection
 
Clipping
ClippingClipping
Clipping
 
Hidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferHidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-buffer
 
Curves and Surfaces
Curves and SurfacesCurves and Surfaces
Curves and Surfaces
 
Computer Graphics: Visible surface detection methods
Computer Graphics: Visible surface detection methodsComputer Graphics: Visible surface detection methods
Computer Graphics: Visible surface detection methods
 
Parametric equations
Parametric equationsParametric equations
Parametric equations
 
Polygons - Computer Graphics - Notes
Polygons - Computer Graphics - NotesPolygons - Computer Graphics - Notes
Polygons - Computer Graphics - Notes
 
rural marketing ppt
rural marketing pptrural marketing ppt
rural marketing ppt
 
CS 354 Bezier Curves
CS 354 Bezier Curves CS 354 Bezier Curves
CS 354 Bezier Curves
 
Invariant Generalised Hough Transform
Invariant Generalised Hough TransformInvariant Generalised Hough Transform
Invariant Generalised Hough Transform
 
图像分割算法基础
 图像分割算法基础 图像分割算法基础
图像分割算法基础
 
Hidden lines & surfaces
Hidden lines & surfacesHidden lines & surfaces
Hidden lines & surfaces
 

Similar to Klt

image segmentation image segmentation.pptx
image segmentation image segmentation.pptximage segmentation image segmentation.pptx
image segmentation image segmentation.pptx
NaveenKumar5162
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
asodariyabhavesh
 
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
vikasmittal92
 
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb) IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
Charles Deledalle
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
Md Shabir Alam
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
Wael Sharba
 
Clustering of graphs and search of assemblages
Clustering of graphs and search of assemblagesClustering of graphs and search of assemblages
Clustering of graphs and search of assemblages
Data-Centric_Alliance
 
Basic Calculussssssssssssssssssssss.pptx
Basic Calculussssssssssssssssssssss.pptxBasic Calculussssssssssssssssssssss.pptx
Basic Calculussssssssssssssssssssss.pptx
MeryAnnMAlday
 
IVR - Chapter 6 - Sparsity, shrinkage and wavelets
IVR - Chapter 6 - Sparsity, shrinkage and waveletsIVR - Chapter 6 - Sparsity, shrinkage and wavelets
IVR - Chapter 6 - Sparsity, shrinkage and wavelets
Charles Deledalle
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
MadhuriMulik1
 
ImageSegmentation (1).ppt
ImageSegmentation (1).pptImageSegmentation (1).ppt
ImageSegmentation (1).ppt
NoorUlHaq47
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
AVUDAI1
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
DEEPUKUMARR
 
Understanding High-dimensional Networks for Continuous Variables Using ECL
Understanding High-dimensional Networks for Continuous Variables Using ECLUnderstanding High-dimensional Networks for Continuous Variables Using ECL
Understanding High-dimensional Networks for Continuous Variables Using ECL
HPCC Systems
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingr
kumarankit06875
 
columbus15_cattaneo.pdf
columbus15_cattaneo.pdfcolumbus15_cattaneo.pdf
columbus15_cattaneo.pdf
AhmadM65
 
Automatic Visualization - Leland Wilkinson, Chief Scientist, H2O.ai
Automatic Visualization - Leland Wilkinson, Chief Scientist, H2O.aiAutomatic Visualization - Leland Wilkinson, Chief Scientist, H2O.ai
Automatic Visualization - Leland Wilkinson, Chief Scientist, H2O.ai
Sri Ambati
 
Image formation
Image formationImage formation
Image formation
potaters
 
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjteUnit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
pournima055
 

Similar to Klt (20)

image segmentation image segmentation.pptx
image segmentation image segmentation.pptximage segmentation image segmentation.pptx
image segmentation image segmentation.pptx
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
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
 
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb) IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
Clustering of graphs and search of assemblages
Clustering of graphs and search of assemblagesClustering of graphs and search of assemblages
Clustering of graphs and search of assemblages
 
Basic Calculussssssssssssssssssssss.pptx
Basic Calculussssssssssssssssssssss.pptxBasic Calculussssssssssssssssssssss.pptx
Basic Calculussssssssssssssssssssss.pptx
 
IVR - Chapter 6 - Sparsity, shrinkage and wavelets
IVR - Chapter 6 - Sparsity, shrinkage and waveletsIVR - Chapter 6 - Sparsity, shrinkage and wavelets
IVR - Chapter 6 - Sparsity, shrinkage and wavelets
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
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
 
Edge detection
Edge detectionEdge detection
Edge detection
 
Understanding High-dimensional Networks for Continuous Variables Using ECL
Understanding High-dimensional Networks for Continuous Variables Using ECLUnderstanding High-dimensional Networks for Continuous Variables Using ECL
Understanding High-dimensional Networks for Continuous Variables Using ECL
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingr
 
columbus15_cattaneo.pdf
columbus15_cattaneo.pdfcolumbus15_cattaneo.pdf
columbus15_cattaneo.pdf
 
Automatic Visualization - Leland Wilkinson, Chief Scientist, H2O.ai
Automatic Visualization - Leland Wilkinson, Chief Scientist, H2O.aiAutomatic Visualization - Leland Wilkinson, Chief Scientist, H2O.ai
Automatic Visualization - Leland Wilkinson, Chief Scientist, H2O.ai
 
Image formation
Image formationImage formation
Image formation
 
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjteUnit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
 

Recently uploaded

Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
top1002
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Steel & Timber Design according to British Standard
Steel & Timber Design according to British StandardSteel & Timber Design according to British Standard
Steel & Timber Design according to British Standard
AkolbilaEmmanuel1
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
The Role of Electrical and Electronics Engineers in IOT Technology.pdf
The Role of Electrical and Electronics Engineers in IOT Technology.pdfThe Role of Electrical and Electronics Engineers in IOT Technology.pdf
The Role of Electrical and Electronics Engineers in IOT Technology.pdf
Nettur Technical Training Foundation
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 

Recently uploaded (20)

Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Steel & Timber Design according to British Standard
Steel & Timber Design according to British StandardSteel & Timber Design according to British Standard
Steel & Timber Design according to British Standard
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
The Role of Electrical and Electronics Engineers in IOT Technology.pdf
The Role of Electrical and Electronics Engineers in IOT Technology.pdfThe Role of Electrical and Electronics Engineers in IOT Technology.pdf
The Role of Electrical and Electronics Engineers in IOT Technology.pdf
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 

Klt

  • 1. Institute of Informatics E¨otv¨os Lor´and University Budapest, Hungary Basic Algorithms for Digital Image Analysis: a course Dmitrij Csetverikov with help of Attila Lerch, Judit Verest´oy, Zolt´an Megyesi, Zsolt Jank´o and Levente Hajder http://visual.ipan.sztaki.hu
  • 2. Lecture 8: Corner detection • Zero-crossing edge detector • Summary of edge detection • Corner detection in greyscale images • The local structure matrix • The KLT corner detector • The Harris corner detector • Comparison of the two corner detectors 2
  • 3. Zero-crossing edge detector 2 f(x) ___ Double edge Zero crossing Blurred edgeSteep edge __ dx df _ 2 d f dx - 00 00 + + + + - -- Left: Principles of zero-crossing edge detector. Right: Simple masks for detection of zero-crossings. 3
  • 4. Implementation of the zero crossing filter: Gaussian smoothing followed by Laplacian filtering. • Using commutativity and associativity of linear filters and rotation symmetry of Gaussian filter, we obtain the convolution mask of the zero-crossing operator, called Laplacian-of-Gaussian (LoG): wZ(r) = C r2 σ2 − 1 exp −r2 2σ2 ◦ C: normalisation constant ◦ r2 = x2 + y2 : square distance from centre of mask ◦ σ is scale parameter: the smaller the σ the finer the edges obtained • Discrete zero-crossing mask: Threshold wZ(r) at a small level. ⇒ Larger mask obtained for larger σ: For example, when σ = 4 the size of the mask is about 40 pixels. 4
  • 5. • Another, more efficient but approximate, implementation of the zero-crossing filter is the difference of two separable Gaussian filters, called DoG. • Localising the zero-crossings corresponds to edge localisation in gradient-type edge detectors. ◦ For more precise localisation, one can locally approximate output of LoG filter by facets (flat patches), then find zero-crossings analytically. LoG absolute LoG zero DoG zero Examples of edge detection by 15 × 15 LoG and DoG operators. ‘LoG absolute’ is absolute value of filter output: dark lines are contours. ‘LoG zero’ was obtained with removal of weak edges, ‘DoG zero’ without removal. 5
  • 6. Properties of zero crossing edge detector • The continuous zero-crossing edge detector always gives closed contours. ◦ Reason: Cross-sections of continuous surface at zero level ◦ In principle, this may help in contour following ◦ In practice, many spurious loops appear • Controlled operator size σ ⇒ Natural edge hierarchy within a scale-space. ◦ Edges may only merge or disappear at rougher scales (larger σ) ◦ This tree-like data structure facilitates structural analysis of image • Does not provide edge orientation. ◦ Non-maxima suppression and hysteresis threshoding are not applicable ◦ Other ways of post-processing to remove unrealiable edges can be used 6
  • 7. Prewitt 3 × 3 M´er˝o-Vassy 7 × 7 LoG 21 × 21 Canny 3 × 3 Canny 7 × 7 Canny 25 × 25 Examples of edge detection by different operators. The LoG result was obtained with removal of weak edges. M´er˝o-Vassy is a non-gradient edge detector. 7
  • 8. Summary of edge detection • 3 × 3 gradient operators (Prewitt, Sobel) are simple and fast. Used when ◦ Fine edges are only needed ◦ Noise level is low • By varying the σ parameter, the Canny operator can be used ◦ to detect fine as well as rough edges ◦ at different noise levels • All gradient operators ◦ Provide edge orientation ◦ Need localisation: non-maxima suppression, hysteresis threshoding • The zero-crossing edge detector ◦ Is supported by neurophysiological experiments ◦ Was popular in the 1980’s ◦ Today, less frequently used in practice 8
  • 9. Corner detection in greyscale images A reminder: • Corners are used in shape analysis and motion analysis ◦ Motion is ambiguous at an edge, unambiguous at a corner ◦ Shapes can be approximately reconstructed from their corners • Two different operations although related operations are called corner detection: ◦ Detection of corners in greyscale images ∗ does not assume extracted contours ◦ Detection of corners in digital curves ∗ assumes extracted contours This lecture deals with corner detection in greyscale images. Corner detection in contours will be discussed later. 9
  • 10. Corners, edges, and derivatives of intensity function Diference between greyscale corners and edges: • Corners are local image features characterised by locations where variations of intensity function f(x, y) in both X and Y directions are high. ⇒ Both partial derivatives fx and fy are large • Edges are locations where the variation of f(x, y) in a certain direction is high, while the variation in the orthogonal direction is low. ⇒ In an edge oriented along the Y axis, fx is large, while is fy small Y X Y X EdgeCorner A corner and an edge. 10
  • 11. Two selected corner detectors Different corner detectors exist, but we will only consider two of them: • The Kanade-Lucas-Tomasi (KLT) operator • The Harris operator Reasons: • Most frequently used: Harris in Europe, KLT in US. • Can select corners and other interest points. • Have many application areas, for example: ◦ motion tracking, stereo matching, image database retrieval • Are relatively simple but still efficient and reliable. The two operators are closely related and based on the local structure matrix. 11
  • 12. The local structure matrix Cstr Definition of the local structure matrix (tensor): Cstr = wG(r; σ) ∗ f2 x fxfy fxfy f2 y (1) Explanation of the definition: • The derivatives of the intensity function f(x, y) are first calculated in each point. ◦ If necessary, the image is smoothed before taking the derivatives • Then, the entries of the matrix (f2 x, etc.) are obtained. • Finally, each of the entries is smoothed (integrated) by Gaussian filter wG(r; σ) of selected size σ. ◦ Often, a simple box (averaging) filter is used instead of the Gaussian. 12
  • 13. Properties of the local structure matrix Denoting in (1) the smoothing by ff, we have Cstr = f2 x fxfy fxfy f2 y The local structure matrix Cstr is • Symmetric ⇒ It can be diagonalised by rotation of the coordinate axes. The diagonal entries will be the two eigenvalues λ1 and λ2: Cstr = λ1 0 0 λ2 • Positive definite ⇒ The eigenvalues are nonnegative. Assume λ1 ≥ λ2 ≥ 0. 13
  • 14. The meaning of the eigenvalues of Cstr The geometric interpretation of λ1 and λ2: • For a perfectly uniform image: Cstr = 0 and λ1 = λ2 = 0. • For a perfectly black-and-white step edge: λ1 > 0, λ2 = 0, where the eigenvector associated with λ1 is orthogonal to the edge. • For a corner of black square against a white background: λ1 ≥ λ2 > 0. ◦ The higher the contrast in that direction, the larger the eigenvalue Basic observations: • The eigenvectors encode edge directions, the eigenvectors edge magnitudes. • A corner is identified by two strong edges ⇒ A corner is a location where the smaller eigenvalue, λ2, is large enough. 14
  • 15. The KLT corner detector has two parameters: the threshold on λ2, denoted by λthr, and the linear size of a square window (neighbourhood) D. Algorithm 1: The KLT Corner Detector 1. Compute fx and fy over the entire image f(x, y). 2. For each image point p: (a) form the matrix Cstr over a D × D neighbourhood of p; (b) compute λ2, the smaller eigenvalue of Cstr; (c) if λ2 > λthr, save the p into a list, L. 3. Sort L in decreasing order of λ2. 4. Scan the sorted list from top to bottom. For each current point, p, delete all points apperaring further in the list which belong to the neighbourhood of p. 15
  • 16. The output is a list of feature points with the following properties: • In these points, λ2 > λthr. • The D-neighbourhoods of these points do not overlap. Selection of the parameters λthr and D: • The threshold λthr can be estimated from the histogram of λ2: usually, there is an obvious valley near zero. ◦ Unfortunately, such valley is not always present • There is no simple criterion for the window size D. Values between 2 and 10 are adequate in most practical cases. ◦ For large D, the detected corner tends to move away from its actual position ◦ Some corners which are close to each other may be lost 16
  • 17. Example of corner detection by the KLT operator. 17
  • 18. The Harris corner detector The Harris corner detector (1988) appeared earlier than KLT. KLT is a different interpretation of the original Harris idea. Harris defined a measure of corner strength: H(x, y) = det Cstr − α (trace Cstr) 2 , where α is a parameter and H ≥ 0 if 0 ≤ α ≤ 0.25. A corner is detected when H(x, y) > Hthr, where Hthr is another parameter, a threshold on corner strength. Similar to the KLT, the Harris corner detector uses D-neighbourhoods to discard weak corners in the neighbourhood of a strong corner. 18
  • 19. Parameter of Harris operator and relation to KLT Assume as before that λ1 ≥ λ2 ≥ 0. Introduce λ1 = λ, λ2 = κλ, 0 ≤ κ ≤ 1. Using the relations between eigenvalues, determinant and trace of a matrix A det A = i λi trace A = i λi, we obtain that H = λ1λ2 − α(λ1 + λ2)2 = λ2 κ − α(1 + κ)2 Assuming that H ≥ 0, we have 0 ≤ α ≤ k (1 + κ)2 ≤ 0.25 and, for small κ, H ≈ λ2 (κ − α) , α κ 19
  • 20. In the Harris operator, α plays a role similar to that of λthr in the KLT operator. • Larger α ⇒ smaller H ⇒ less sensitive detector: less corners detected. • Smaller α ⇒ larger H ⇒ more sensitive detector: more corners detected. Usually, Hthr is set close to zero and fixed, while α is a variable parameter. original image α = 0.05 α = 0.10 α = 0.20 α = 0.22 α = 0.24 Corner detection by Harris operator: influence of α. (Hthr = 0.) 20
  • 21. Example of corner detection by the Harris operator. 21
  • 22. KLT 40 corners Harris α = 0.2 Comparison of the two operators. 22
  • 23. Summary of corner detection • The KLT and the Harris corner detectors are conceptually related. ◦ Based on local structure matrix Cstr ◦ Search for points where variations in two orthogonal directions are large • Difference between the two detectors: ◦ KLT sets explicit threshold on the diagonalised Cstr ◦ Harris sets implicit threshold via corner magnitude H(x, y) • The KLT detector ◦ usually gives results which are closer to human perception of corners; ◦ is often used for motion tracking in the wide-spread KLT Tracker. • The Harris detector ◦ provides good repeatability under varying rotation and illumination; ◦ if often used in stereo matching and image database retrieval. • Both operators may detect interest points other than corners. 23