Skip to content Skip to sidebar Skip to footer

Shape Recognition Using Hu Moments From Opencv In Python

I have a problem using the Hu moments for shape recognition. The goal is to be able to recognize the two white circles and the two white squares on the left in the picture. http://

Solution 1:

You can create a template image of the squares and implement a template matching technique in order to detect it on the image.

You can also detect the contour of the template image and use the function cv2.matchshapes . However this function is used in order to compare two images. So, I guess you will have to make a window with the same size with you template and run it through you original image in order to detect which part is the best match (minimum value for the function matchshape).

Post a Comment for "Shape Recognition Using Hu Moments From Opencv In Python"