How to count the edges in a cropped image

asked 2016-11-18 03:47:44 -0500

aidih gravatar image

updated 2016-11-18 03:57:11 -0500

berak gravatar image

0.png screenshot.png

I have a car park model image and wish to test the capture of an irregular cropped portion to detail how many edges exist. The idea being to advise if a space contains a vehicle in it. Everytime I try this, I just get various errors relating to the image not having the right attributes. The code is below,

        im ='0.png')
        bay1 = image.edge(10,300)
        image_matrix = bay1.getNumpy().flatten()
        image_pixel_count = cv2.countNonZero(image_matrix)
        canny_count[iCol] += image_pixel_count

Any help would be appreciated on how to get an edge count of 0.png

edit retag flag offensive close merge delete