Ask Your Question

Revision history [back]

How to detect overlapping objects in python.

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.

click to hide/show revision 2
None

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

berak gravatar image

How to detect overlapping objects in python.

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)

iterations=2)

Thank you in advance for your help.