0% found this document useful (0 votes)
8 views3 pages

Exp 6 - Saw

The document outlines the implementation of the Speeded-Up Robust Features (SURF) algorithm, which enhances speed and efficiency compared to the SIFT algorithm while maintaining robustness. Key steps include integral image calculation, keypoint detection using the Hessian matrix, and descriptor generation. SURF is particularly advantageous for real-time applications due to its faster computations and simpler descriptors.

Uploaded by

acc.ai.trial
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Exp 6 - Saw

The document outlines the implementation of the Speeded-Up Robust Features (SURF) algorithm, which enhances speed and efficiency compared to the SIFT algorithm while maintaining robustness. Key steps include integral image calculation, keypoint detection using the Hessian matrix, and descriptor generation. SURF is particularly advantageous for real-time applications due to its faster computations and simpler descriptors.

Uploaded by

acc.ai.trial
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Alok Mevawala SAW ET21BTEC037

EXP 6

Aim: Implementation of SURF algorithm

Theory:
Speeded-Up Robust Features (SURF) is an algorithm introduced by Herbert Bay in 2006. SURF builds on
the concepts of SIFT but aims to improve speed and efficiency while maintaining robustness.

Key Steps in SURF:

● Integral Images: Use integral images to quickly compute the sum of image intensities over rectangular
regions, enhancing speed.
● Fast Hessian Matrix-Based Detector: Detect keypoints using the determinant of the Hessian matrix,
which provides a measure of local changes in the image.
● Keypoint Localization and Orientation: Similar to SIFT, keypoints are localized and an orientation is
assigned based on Haar wavelet responses within a circular region around the keypoint.
● Keypoint Descriptor: Construct a descriptor by considering the Haar wavelet responses in the horizontal
and vertical directions within a square region around the keypoint, resulting in a 64-dimensional vector.

How SURF is Different from SIFT?

Speed and Efficiency: SURF is designed to be faster than SIFT, making it more suitable for real-time
applications and large-scale image processing tasks.
Hessian Matrix: SURF leverages the Hessian matrix for keypoint detection, which simplifies computations
and speeds up the process compared to the DoG approach used in SIFT.
Descriptor Robustness: Although SURF descriptors are more compact, they may be less descriptive than
SIFT descriptors, potentially affecting performance in scenarios requiring high precision.

Why is SURF considered faster than SIFT?


SURF is considered faster than SIFT because it uses an approximation of the Hessian matrix, called the
Fast-Hessian Detector, for keypoint detection. This method leverages integral images to speed up the
computation process significantly. Additionally, SURF uses 64-dimensional descriptors, which are simpler
and less computationally intensive compared to SIFT’s 128-dimensional descriptors. These optimizations
make SURF suitable for real-time applications where speed is critical.

Algorithm:
1. Input Image:
o Read the grayscale image.
2. Integral Image Calculation: o Create an integral image to compute convolutions quickly.
3. Keypoint Detection: o Use box filters to approximate the Laplacian of Gaussian and
detect keypoints.
4. Keypoint Localization: o Filter out unstable keypoints based on their contrast and edge
response.
Alok Mevawala SAW ET21BTEC037

5. Orientation Assignment: o Calculate Haar wavelet responses in a local region to assign


orientations to keypoints.
6. Descriptor Calculation:
o Generate a 64-dimensional descriptor by summing the Haar wavelet responses.
7. Keypoint Matching:
o Match keypoints between images using the Euclidean distance between their descriptors.
8. Output: o Display the matched keypoints between images.

Code:
import cv2 import
numpy as np import
os

# Load the image (make sure to replace with the correct path)
image_path = 'tesla1 (1).jpg' # Change this to the correct path image
= cv2.imread(image_path)

if image is None:
print("Error: Image not found.")
else:
# Convert the image to grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

# Create SURF Feature Detector object


hessian_threshold = 500 # Set the Hessian threshold
surf = cv2.xfeatures2d.SURF_create(hessianThreshold=hessian_threshold)

# Detect keypoints and compute descriptors


keypoints, descriptors = surf.detectAndCompute(gray, None)
print("Number of keypoints Detected: ", len(keypoints))

# Draw keypoints on the grayscale image


image_with_keypoints = cv2.drawKeypoints(gray, keypoints, None,
flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)

# Display the result in grayscale


cv2.imshow('Feature Method - SURF',
image_with_keypoints) cv2.waitKey(0)
cv2.destroyAllWindows()

Output:
Alok Mevawala SAW ET21BTEC037

Conclusion:

SURF provides a faster alternative to SIFT while still offering robust performance in image matching and
object detection. It is particularly useful when speed is critical without a significant loss of accuracy.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy