This repository contains a Python implementation for applying Harris Corner Detection to images, detecting corners, and highlighting them with a visual effect. The project uses OpenCV for image processing and is intended to be run in a Python environment, such as Google Colab.
Corner Detection: Detects corners in images using the Harris Corner Detection method.
Corner Highlighting: Highlights the detected corners by marking them in red on the original image.
Edge Detection Preprocessing: Applies Gaussian blur to reduce noise and enhance corner detection accuracy.
Corner Counting: Counts the number of corners detected in each image.
Visualization: Displays the images with the highlighted corners in Google Colab using matplotlib.
Flexible Image Input: Works with a list of images by providing file paths.
1 Clone the repository or copy the code.
2 Provide the paths to your images by replacing the image_paths list:
image_paths = '/path/to/image1.jpg', # Replace with your image file path '/path/to/image2.jpg', # Replace with your image file path '/path/to/image3.jpg' # Replace with your image file path
3 Run the code in your Python environment (e.g., Google Colab). 4 The script will output: 5 Displayed images with highlighted corners. 6 Printed number of corners detected in each image.
Corner Detection:
1 Detects corners in images using the Harris Corner Detection method.
2 Enhances corner points by applying dilation.
1 Compares the detected corners between two images.
2 Computes a match score based on the intersection of detected corners.
3 Match Thresholding:
Allows setting a threshold to categorize images based on their match score.
4 Visualization:
Displays images with detected corners highlighted.
5 Console Output:
Prints the match score and determines whether images are good matches or not based on the threshold.
5 Edge Highlighting (Optional):
Enhances corner visibility by coloring the detected edges distinctly.
File Output:
Currently outputs match scores in the console.
Set the image paths:
Replace the paths in the script below with your image paths:
original_image_path = '/path/to/original/image.png' image_paths = '/path/to/rotated/image1.jpg', '/path/to/rotated/image2.jpg', '/path/to/another/image.jpg'
Python 3.x
OpenCV
NumPy
Matplotlib
Google Colab (optional, but preferred for displaying images)