Skip to content

This is showing you how you can count number of objects in image. For explanation I have taken one file as input called input_file_find_objects.png. This image contains some fruits and we are suppose to count number of fruits on it.

Notifications You must be signed in to change notification settings

Data-Science-Machine-Learning/FindObjectsByContours

Repository files navigation

FindObjectsByContours

This is showing you how you can count number of objects in image. For explanation I have taken one file as input called input_file_find_objects.png. This image contains some fruits and we are suppose to count number of fruits on it. Here, find_objects.py is main script for us which will do all process for finding out number of objects. So, in find_objects.py first we loaded our input file and then converted into gray scale image. Then we applied threshold of type THRESH_BINARY_INV. In last we applied dilation for removing black distortion from image with kernal size of 2x2. Now our image is ready for getting number of contours inside image. Contours are like close shapes which we are going to count with findContours method. So, the count of contours is number of objects found in image which we displaying on image via putText method. The imshow method is used to show all changes in images gradually, the last image 3_Dilation_image.png is our area of interest image.

About

This is showing you how you can count number of objects in image. For explanation I have taken one file as input called input_file_find_objects.png. This image contains some fruits and we are suppose to count number of fruits on it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages