Skip to content

OpenCV Python script that uses a bunch of filters to detect objects on a plain background.

Notifications You must be signed in to change notification settings

benersuay/contourfind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contour Find

An OpenCV script for object detection on a plain background. The script optionally uses SURF, dilation, erosion, smoothing, and adaptive thresholding to convert detected contours into blobs so we can extract them. Found features are also shown on separate images as well as all together in one image.

Dependency

Tested on Ubuntu 12.04 with OpenCV 2.4.6.

Example

To run the script, simply

python find_objects.py

This will pop up several windows showing found features and processed images.

In this image below 3 objects are detected. Yellow rectangles show the bounding boxes for detected objects. It is possible to adjust the amount of smoothing, or eroding applied to this image and it will remarkably change the object detection rate. Depending on the surface of the object(s) you are trying to detect, you may want to use SURF (e.g. if there are patterns) or not. You can somewhat control the behavior of the script by adjusting the find_surf, dilation, erosion, adaptive_threshold and smooth variables.

The script also outputs found region of interest properties in a txt file: ROI properties.txt.

countourfind

About

OpenCV Python script that uses a bunch of filters to detect objects on a plain background.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages