Skip to content

serttasbugrahan/shape-detection-opencv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Contour Detection and Shape Detection OpenCV

This project is Contour Detection and Shape Detection using C++ and OpenCV.

Steps

1- Preprocessing(binary image): BGR2GRAY, Gaussian Blur, Canny Edge Detection, Dilation
2- Find the contours using findContours() in binary Image
3- Add threshold condition to get contour if the size of the contour is matched
4- Calculate perimeter using arclenth() & approximate the contour with polygon
5- Calculate the bounding rectangle for the polygon & determine the no. of corners of a polygon
6- Classify the shape based on no. of corners & check the aspect ratio in order to differentiate between square & rectangle
7- Draw the contour and bounding rectangle on the original image

Conclusion

Ekran görüntüsü 2024-02-20 182256

Installation

1- Download & Install OpenCV onto your computer from http://www.opencv.org/
2- Git Clone this project onto your computer.
3- Add the Environment Variable ' OPENCV_DIR ' into your System Environment Variables pointing to the OpenCV installation directory.

About

Contour Detection and Shape Detection using OpenCV in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages