SlideShare a Scribd company logo
SHARP
A shape recognition system and its parallel implementation
Leonardo Arcari
leonardo1.arcari@gmail.com
Politecnico di Milano
Agenda
● Theoretical aspects of Hough transformation
● Algorithm description
● Implementation considerations
● Expected results
Theoretical aspects of Hough Transformation
Shape recognition problem
● Fundamental aspect problem of computer vision.
● Defined as the problem of determining whether the test image contains one of the
available reference shapes or not.
● SHARP algorithm takes into account the problem of shape recognition in binary
images.
Shape representation: Hough transformation (1)
● An arbitrary shape can be considered as
composed of small tangent straight line
segments.
● In cartesian coordinates, a line is
commonly represented by the equation
● The Hough transformation represents
lines in polar coordinates.
Shape representation: Hough transformation (2)
● The dimension is given by the angle of the normal
of the line.
● The r dimension is the distance of the line from the
origin.
● Value of is restricted to the interval [0, π] and r
is restricted to the interval
Shape representation: Hough transformation (3)
● Representing a line back in the cartesian plane, after the considerations made:
● In general, for each point (x0
, y0
), we can define a family of lines that goes
through that point as:
● This means that each pair ( , r) represents each line that passes through (x0
, y0
)
Key point
Two curves intersecting in the Hough space
determine a ( , r) pair , i.e. a straight line,
on which the two points that generated
those curves lie on.
Hough space (1)
● Discretized and represented as a two-dimensional accumulator array.
● In general, Hough transform implementations accumulate in each array cell the
number of pixels lying on the same line in the cartesian plane.
● This does not preserve the information of which pixel belongs to a particular line.
X
X
X
X
Same as
Hough space (2)
● SHARP prefers to adopt a modified version known as Straight-line Hough
Transform (SLHT).
● According to this variant, pixels mapped to the same ( , r) are grouped in lines of
adjacent points.
● This way, we can identify dominant segments based on their length instead of the
number of points that eventually lie on the same line.
Algorithm description
Algorithm outline
In order to recognize a shape, three macro-steps are required:
1. Computation of SLHT for the test image.
2. Computation of the STIRS signature of the test image.
3. Matching the test signature with that of the reference shapes.
STIRS Signature
● Distances between pairs of parallel tangential lines to a curve C.
● Basically a feature of a shape.
Has the following properties:
● It is invariant to the translation of the shape.
● Rotation of the shape corresponds to a circular-shift of its signature in the ( , r)
space.
● If the shape is scaled by a factor S, then the signature is also scaled by the same
factor.
Therefore named: scalable translation-invariant rotation-to-shifting (STIRS) signature.
Parallelization scheme (1)
● Assuming a distributed-memory, multiple instruction, multiple data (MIMD)
computational model.
● The SLHT array is divided over the space into p partitions, number of
processors.
● Each processor i computes the SLHT and the (partial) STIRS signature for angles
in range
Parallelization scheme (2)
● Each processor i also applies the matching algorithm to the test image and the
reference image for the angles in range Ai
for all the m orientations of the
reference shape.
● The matching procedure produces a matching score, which is partial for the range
of angles taken into account.
● A merging step is carried out by adding the partial scores, using a binary-tree
reduction procedure
SHARP Algorithm in details (2)
Complexity
O(n2
l * m /p)
SHARP Algorithm in details (3)
Complexity
O(mr
2
* m /p)
SHARP Algorithm in details (4)
Complexity
O(mr
* m 2
/p)
SHARP Algorithm in details (5)
Complexity
O(m * log2
p + tcomm
)
SHARP Algorithm in details (1)
Implementation considerations
Input data
Generating input shapes (both test and reference)
● Manually drawn
● Perform edge detection on samples (e.g. with Canny algorithm) to build a binary
image. We could exploit OpenCV library.
Communication among threads
● Given the adoption of OpenMP framework, we can exploit locking APIs on a
mutex for each processor, as well as a pointer to the local data structure to merge
for each processor. Like a std::unique_ptr so that we enforce use of efficient move
semantics.
Parameters
The SHARP paper suggests the following parameters, as they are those showed in their
results:
1. Shape size: n = 256
2. 0 ≤ ≤
3. -363 ≤ r ≤ 363
4. = 5° i.e. m = 37
5. r
= 1 i.e. mr
= 727
6. Line length threshold = 2.0
Reference shapes
Test shapes
Expected results
Ideal speedup of SHARP algorithm
Parallel time
Sequential time
Speedup
Experimental results
Run time [ms] with # of
threads:
1 2 4 8
pentagon_35_degrees.jpg 22.90 12.70 12.40 8.20
tr_oval.jpg 42.20 23.30 16.80 14.40
duck_scaled_15_degrees.jpg 18.70 11.70 6.80 13.50
duck_scaled_50_degrees.jpg 18.80 12.60 5.90 13.60
oval_45_degrees.jpg 28.00 15.20 10.90 9.80
oval_90_degrees.jpg 24.20 12.80 10.40 8.20
stewie_135_degrees.jpg 49.60 27.70 27.50 16.20
hexagon_135_degrees.jpg 23.10 13.90 11.60 10.70
Experimental results
Experimental results
Experimental results
Experimental results

More Related Content

What's hot (19)

PDF
Computer Graphics and Multimedia Techniques Paper (RTU VI Semester)
FellowBuddy.com
 
PDF
Another Simple but Faster Method for 2D Line Clipping
ijcga
 
PDF
Computer graphics curves and surfaces (1)
RohitK71
 
PPTX
Clipping
AMIT VIRAMGAMI
 
PPT
Rendering Curves and Surfaces
Syed Zaid Irshad
 
PDF
Curves
Ketan Jani
 
PDF
AGV PATH PLANNING BASED ON SMOOTHING A* ALGORITHM
ijseajournal
 
PPTX
Cohen sutherland line clipping
Mani Kanth
 
PPT
Robot motion planning
AJAL A J
 
PPTX
Lect 5 2d clipping
majicyoung
 
PDF
A Run Length Smoothing-Based Algorithm for Non-Manhattan Document Segmentation
University of Bari (Italy)
 
PPTX
Application Of Graph Data Structure
Gaurang Dobariya
 
PDF
A Run Length Smoothing-Based Algorithm for Non-Manhattan Document Segmentation
University of Bari (Italy)
 
PPT
signal flow graph
Rajput Manthan
 
PPT
Knowledge Based Genetic Algorithm for Robot Path Planning
Tarundeep Dhot
 
PDF
Robust and Real Time Detection of Curvy Lanes (Curves) Having Desired Slopes ...
csandit
 
PPTX
CAD
ravikumarmrk
 
PDF
facility layout paper
Saurabh Tiwary
 
PPTX
Implicit Interpolation Analytical Curves
Sharath Kumar
 
Computer Graphics and Multimedia Techniques Paper (RTU VI Semester)
FellowBuddy.com
 
Another Simple but Faster Method for 2D Line Clipping
ijcga
 
Computer graphics curves and surfaces (1)
RohitK71
 
Clipping
AMIT VIRAMGAMI
 
Rendering Curves and Surfaces
Syed Zaid Irshad
 
Curves
Ketan Jani
 
AGV PATH PLANNING BASED ON SMOOTHING A* ALGORITHM
ijseajournal
 
Cohen sutherland line clipping
Mani Kanth
 
Robot motion planning
AJAL A J
 
Lect 5 2d clipping
majicyoung
 
A Run Length Smoothing-Based Algorithm for Non-Manhattan Document Segmentation
University of Bari (Italy)
 
Application Of Graph Data Structure
Gaurang Dobariya
 
A Run Length Smoothing-Based Algorithm for Non-Manhattan Document Segmentation
University of Bari (Italy)
 
signal flow graph
Rajput Manthan
 
Knowledge Based Genetic Algorithm for Robot Path Planning
Tarundeep Dhot
 
Robust and Real Time Detection of Curvy Lanes (Curves) Having Desired Slopes ...
csandit
 
facility layout paper
Saurabh Tiwary
 
Implicit Interpolation Analytical Curves
Sharath Kumar
 

Similar to SHARP - A parallel algorithm for shape recognition (20)

PDF
FACE RECOGNITION ALGORITHM BASED ON ORIENTATION HISTOGRAM OF HOUGH PEAKS
ijaia
 
PDF
Local binary pattern
International Islamic University
 
PDF
Geometric model & curve
sai surendra veerla
 
PDF
A Method to Determine End-Points ofStraight Lines Detected Using the Hough Tr...
IJERA Editor
 
PDF
AN EFFICIENT LINE CLIPPING ALGORITHM FOR CIRCULAR WINDOWS USING VECTOR CALCUL...
ijcga
 
PDF
AN EFFICIENT LINE CLIPPING ALGORITHM FOR CIRCULAR WINDOWS USING VECTOR CALCUL...
ijcga
 
PDF
Two Dimensional Shape and Texture Quantification - Medical Image Processing
Chamod Mune
 
PDF
N045077984
IJERA Editor
 
PDF
Final Project Report Nadar
Maher Nadar
 
PDF
Graph-based SLAM
Pranav Srinivas Kumar
 
PDF
Algorithmic Techniques for Parametric Model Recovery
CurvSurf
 
PDF
Contour Line Tracing Algorithm for Digital Topographic Maps
CSCJournals
 
PDF
Analytic parametric equations of log-aesthetic curves in terms of incomplete ...
Rushan Ziatdinov
 
PDF
Reconfigurable Design of Rectangular to Polar Converter using Linear Convergence
AnuragVijayAgrawal
 
PDF
Synthetic Curves.pdf
MehulMunshi3
 
PDF
The Geometric Characteristics of the Linear Features in Close Range Photogram...
IJERD Editor
 
PPTX
Image feature extraction
Rushin Shah
 
PDF
Design and Implementation of Model Reference Adaptive Controller using Coeffi...
IOSR Journals
 
PDF
Algorithmic optimizations for Dynamic Monolithic PageRank (from STICD) : SHOR...
Subhajit Sahu
 
PPTX
feature matching and model fitting .pptx
demepa1337
 
FACE RECOGNITION ALGORITHM BASED ON ORIENTATION HISTOGRAM OF HOUGH PEAKS
ijaia
 
Local binary pattern
International Islamic University
 
Geometric model & curve
sai surendra veerla
 
A Method to Determine End-Points ofStraight Lines Detected Using the Hough Tr...
IJERA Editor
 
AN EFFICIENT LINE CLIPPING ALGORITHM FOR CIRCULAR WINDOWS USING VECTOR CALCUL...
ijcga
 
AN EFFICIENT LINE CLIPPING ALGORITHM FOR CIRCULAR WINDOWS USING VECTOR CALCUL...
ijcga
 
Two Dimensional Shape and Texture Quantification - Medical Image Processing
Chamod Mune
 
N045077984
IJERA Editor
 
Final Project Report Nadar
Maher Nadar
 
Graph-based SLAM
Pranav Srinivas Kumar
 
Algorithmic Techniques for Parametric Model Recovery
CurvSurf
 
Contour Line Tracing Algorithm for Digital Topographic Maps
CSCJournals
 
Analytic parametric equations of log-aesthetic curves in terms of incomplete ...
Rushan Ziatdinov
 
Reconfigurable Design of Rectangular to Polar Converter using Linear Convergence
AnuragVijayAgrawal
 
Synthetic Curves.pdf
MehulMunshi3
 
The Geometric Characteristics of the Linear Features in Close Range Photogram...
IJERD Editor
 
Image feature extraction
Rushin Shah
 
Design and Implementation of Model Reference Adaptive Controller using Coeffi...
IOSR Journals
 
Algorithmic optimizations for Dynamic Monolithic PageRank (from STICD) : SHOR...
Subhajit Sahu
 
feature matching and model fitting .pptx
demepa1337
 
Ad

Recently uploaded (20)

PDF
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
 
PDF
lesson4-occupationalsafetyandhealthohsstandards-240812020130-1a7246d0.pdf
arvingallosa3
 
PDF
Plant Control_EST_85520-01_en_AllChanges_20220127.pdf
DarshanaChathuranga4
 
PPTX
Computer network Computer network Computer network Computer network
Shrikant317689
 
PPTX
Functions in Python Programming Language
BeulahS2
 
PDF
Rapid Prototyping for XR: Lecture 3 - Video and Paper Prototyping
Mark Billinghurst
 
PPTX
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
 
PPTX
Kel.3_A_Review_on_Internet_of_Things_for_Defense_v3.pptx
Endang Saefullah
 
PPTX
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
SAMEER VISHWAKARMA
 
PDF
Rapid Prototyping for XR: Lecture 4 - High Level Prototyping.
Mark Billinghurst
 
PPTX
CST413 KTU S7 CSE Machine Learning Neural Networks and Support Vector Machine...
resming1
 
PPTX
Work at Height training for workers .pptx
cecos12
 
PPTX
Introduction to Python Programming Language
merlinjohnsy
 
PPTX
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
 
PDF
Designing for Tomorrow – Architecture’s Role in the Sustainability Movement
BIM Services
 
PPTX
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
 
PDF
Decision support system in machine learning models for a face recognition-bas...
TELKOMNIKA JOURNAL
 
PDF
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
PDF
PRIZ Academy - Process functional modelling
PRIZ Guru
 
PDF
Generative AI & Scientific Research : Catalyst for Innovation, Ethics & Impact
AlqualsaDIResearchGr
 
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
 
lesson4-occupationalsafetyandhealthohsstandards-240812020130-1a7246d0.pdf
arvingallosa3
 
Plant Control_EST_85520-01_en_AllChanges_20220127.pdf
DarshanaChathuranga4
 
Computer network Computer network Computer network Computer network
Shrikant317689
 
Functions in Python Programming Language
BeulahS2
 
Rapid Prototyping for XR: Lecture 3 - Video and Paper Prototyping
Mark Billinghurst
 
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
 
Kel.3_A_Review_on_Internet_of_Things_for_Defense_v3.pptx
Endang Saefullah
 
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
SAMEER VISHWAKARMA
 
Rapid Prototyping for XR: Lecture 4 - High Level Prototyping.
Mark Billinghurst
 
CST413 KTU S7 CSE Machine Learning Neural Networks and Support Vector Machine...
resming1
 
Work at Height training for workers .pptx
cecos12
 
Introduction to Python Programming Language
merlinjohnsy
 
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
 
Designing for Tomorrow – Architecture’s Role in the Sustainability Movement
BIM Services
 
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
 
Decision support system in machine learning models for a face recognition-bas...
TELKOMNIKA JOURNAL
 
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
PRIZ Academy - Process functional modelling
PRIZ Guru
 
Generative AI & Scientific Research : Catalyst for Innovation, Ethics & Impact
AlqualsaDIResearchGr
 
Ad

SHARP - A parallel algorithm for shape recognition

  • 1. SHARP A shape recognition system and its parallel implementation Leonardo Arcari [email protected] Politecnico di Milano
  • 2. Agenda ● Theoretical aspects of Hough transformation ● Algorithm description ● Implementation considerations ● Expected results
  • 3. Theoretical aspects of Hough Transformation
  • 4. Shape recognition problem ● Fundamental aspect problem of computer vision. ● Defined as the problem of determining whether the test image contains one of the available reference shapes or not. ● SHARP algorithm takes into account the problem of shape recognition in binary images.
  • 5. Shape representation: Hough transformation (1) ● An arbitrary shape can be considered as composed of small tangent straight line segments. ● In cartesian coordinates, a line is commonly represented by the equation ● The Hough transformation represents lines in polar coordinates.
  • 6. Shape representation: Hough transformation (2) ● The dimension is given by the angle of the normal of the line. ● The r dimension is the distance of the line from the origin. ● Value of is restricted to the interval [0, π] and r is restricted to the interval
  • 7. Shape representation: Hough transformation (3) ● Representing a line back in the cartesian plane, after the considerations made: ● In general, for each point (x0 , y0 ), we can define a family of lines that goes through that point as: ● This means that each pair ( , r) represents each line that passes through (x0 , y0 )
  • 8. Key point Two curves intersecting in the Hough space determine a ( , r) pair , i.e. a straight line, on which the two points that generated those curves lie on.
  • 9. Hough space (1) ● Discretized and represented as a two-dimensional accumulator array. ● In general, Hough transform implementations accumulate in each array cell the number of pixels lying on the same line in the cartesian plane. ● This does not preserve the information of which pixel belongs to a particular line. X X X X Same as
  • 10. Hough space (2) ● SHARP prefers to adopt a modified version known as Straight-line Hough Transform (SLHT). ● According to this variant, pixels mapped to the same ( , r) are grouped in lines of adjacent points. ● This way, we can identify dominant segments based on their length instead of the number of points that eventually lie on the same line.
  • 12. Algorithm outline In order to recognize a shape, three macro-steps are required: 1. Computation of SLHT for the test image. 2. Computation of the STIRS signature of the test image. 3. Matching the test signature with that of the reference shapes.
  • 13. STIRS Signature ● Distances between pairs of parallel tangential lines to a curve C. ● Basically a feature of a shape. Has the following properties: ● It is invariant to the translation of the shape. ● Rotation of the shape corresponds to a circular-shift of its signature in the ( , r) space. ● If the shape is scaled by a factor S, then the signature is also scaled by the same factor. Therefore named: scalable translation-invariant rotation-to-shifting (STIRS) signature.
  • 14. Parallelization scheme (1) ● Assuming a distributed-memory, multiple instruction, multiple data (MIMD) computational model. ● The SLHT array is divided over the space into p partitions, number of processors. ● Each processor i computes the SLHT and the (partial) STIRS signature for angles in range
  • 15. Parallelization scheme (2) ● Each processor i also applies the matching algorithm to the test image and the reference image for the angles in range Ai for all the m orientations of the reference shape. ● The matching procedure produces a matching score, which is partial for the range of angles taken into account. ● A merging step is carried out by adding the partial scores, using a binary-tree reduction procedure
  • 16. SHARP Algorithm in details (2) Complexity O(n2 l * m /p)
  • 17. SHARP Algorithm in details (3) Complexity O(mr 2 * m /p)
  • 18. SHARP Algorithm in details (4) Complexity O(mr * m 2 /p)
  • 19. SHARP Algorithm in details (5) Complexity O(m * log2 p + tcomm )
  • 20. SHARP Algorithm in details (1)
  • 22. Input data Generating input shapes (both test and reference) ● Manually drawn ● Perform edge detection on samples (e.g. with Canny algorithm) to build a binary image. We could exploit OpenCV library. Communication among threads ● Given the adoption of OpenMP framework, we can exploit locking APIs on a mutex for each processor, as well as a pointer to the local data structure to merge for each processor. Like a std::unique_ptr so that we enforce use of efficient move semantics.
  • 23. Parameters The SHARP paper suggests the following parameters, as they are those showed in their results: 1. Shape size: n = 256 2. 0 ≤ ≤ 3. -363 ≤ r ≤ 363 4. = 5° i.e. m = 37 5. r = 1 i.e. mr = 727 6. Line length threshold = 2.0
  • 27. Ideal speedup of SHARP algorithm Parallel time Sequential time Speedup
  • 28. Experimental results Run time [ms] with # of threads: 1 2 4 8 pentagon_35_degrees.jpg 22.90 12.70 12.40 8.20 tr_oval.jpg 42.20 23.30 16.80 14.40 duck_scaled_15_degrees.jpg 18.70 11.70 6.80 13.50 duck_scaled_50_degrees.jpg 18.80 12.60 5.90 13.60 oval_45_degrees.jpg 28.00 15.20 10.90 9.80 oval_90_degrees.jpg 24.20 12.80 10.40 8.20 stewie_135_degrees.jpg 49.60 27.70 27.50 16.20 hexagon_135_degrees.jpg 23.10 13.90 11.60 10.70