Ask Your Question

aidih's profile - activity

2016-11-18 03:47:44 -0600 asked a question How to count the edges in a cropped 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 = Image.open('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