Skip to content

izmanaveed/OpenCV-Shape-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

OpenCV-Shape-Detection

Detecting objects

The first step is to detect the objects under observation and locate their boundaries. The laptop webcam is used for streaming the video and detecting objects in real time. The objects are detected using the HSV color space. Trackbars are created to change and track the color values in real time.

Finding contours

Next, we need to find contours of the objects and use the blur property on the frame to remove background noise and get clean contours. The HSV trackbar levels will determine which color you are able to detect.

Detecting shapes

To identify the shape, we simply count the number of contour sides. Then we define a name for each category. To remove small noise and dots from the background, we choose the contours for greater than 400 pixels. Finally, we count the sides of the contours and give a name accordingly. • For 3 sides, we have a triangle. • For 4 sides, we have a rectangle. • For 5-10 sides, we have a circle.

image image image image

About

Computer Vision Project (2021)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published