RANSAC
Introduction
• RANSAC (Random Sample Consensus) is an
iterative method to estimate the parameters
of a mathematical model from a set of
observed data that contains outliers.
• In computer vision, it's often used for tasks
like estimating the fundamental matrix,
homography, or any fitting problem with noisy
data.
Algorithm
• 1. Sample (randomly) the number of points
required to fit the model
• 2. Solve for model parameters using samples
3. Score by the fraction of inliers within a
preset threshold of the model
• Repeat 1-3 until the best model is found with
high confidence
Hough Transform
• The Hough Transform is a popular technique
in computer vision and image processing, used
for detecting geometric shapes like lines,
circles, and other parametric curves.
• Hough transform in its simplest from can be
used to detect straight lines in an image.
Hough Transform
• The Hough Transform is a feature extraction
method that converts the representation of
shapes from the spatial domain to the
parameter space.
• It creates an accumulator array (Parameter
space) where each point corresponds to a
potential shape in the image.
Purpose
• The Hough transform is needed because traditional
image processing techniques like edge detection and
thresholding are not always effective at detecting
simple geometric shapes in images.
• These techniques can be particularly ineffective
when the shapes are distorted, incomplete, or
partially obscured.
• The Hough transform can detect these shapes by
transforming the image space into a parameter space
where the shapes can be more easily identified.
Edge Detection Technique Hough Transform Technique
Algorithm
• A straight line is the simplest boundary we can
recognize in an image. Multiple straight lines
can form a much complex boundary.
• Transform the image space into hough space.
Convert a line in image space to a point on
hough space (Parameter space).
• The equation of the line in the image space is
of the form y = mx + c where m is the slope
and c is the y-intercept of the line.
• This line will be transformed to a point of the
form (m, c) in the hough space.
Polar Coordinates
• Polar coordinates are a two-dimensional
coordinate system that represents a point in a
plane using a distance and an angle.
Steps
• Preprocess the image: Before applying the Hough transform, it is
recommended to preprocess the image to reduce noise, enhance
edges, and improve contrast. Common preprocessing techniques
include filtering, thresholding, and edge detection.
• Choose the appropriate variant: The Hough transform has several
variants, and the choice of variant depends on the shape being
detected, the level of noise in the image, and the computational
resources available. It is important to choose the appropriate variant of
the Hough transform for the specific application.
• Select parameters carefully: The Hough transform involves selecting
several parameters, such as the threshold value, the minimum line
length, and the maximum gap between line segments. It is important to
select these parameters carefully to achieve the desired level of
accuracy and efficiency.
• Use multiple scales: If the shape being detected varies in size,
it may be useful to use a multi-scale Hough transform that
detects shapes at different scales.
• Combine with other techniques: The Hough transform can be
combined with other image processing techniques, such as
template matching, machine learning, or feature extraction, to
improve the accuracy and efficiency of shape detection.
• Validate the results: The Hough transform can sometimes
produce false positives or false negatives, especially in noisy or
complex images. It is important to validate the results of the
Hough transforms using additional techniques, such as human
inspection or additional image analysis methods.