How to detect overlapping objects in python.

asked 2018-11-14 08:02:41 -0500

Jerol gravatar image

updated 2018-11-14 08:08:32 -0500

berak gravatar image

Hello everyone,

Currently, I am using the below code for edge detection, but it only detects the object if I have some gaps between them. However, I would like to detect the objects separately when they overlap. i.e making sperate boxes for the overlap objects.

kernel = np.ones((5,5))
edged = cv2.Canny(gray, 20, 40)
edged = cv2.dilate(edged, kernel, iterations=2)
edged = cv2.erode(edged, kernel, iterations=2)

Thank you in advance for your help.

edit retag flag offensive close merge delete