0

I have a task where I have to find the size of the given shape , I have applied Canny edge detector to locate the edges, now how I can fill inside the edge so that I can calculate the white pixels (to find the height and width )?

enter image description here

zack
  • 53
  • 1
  • 11
  • 2
    Better to threshold the image, then get the contour and draw a filled contour. Trying to fill edges is not always a good approach since they can have gaps. The gaps would have to be filled. In your case, you can fill the gaps with some morphology close. But then you would have to either get the contour and draw it filled or do a flood fill. So might as well just threshold and get the contour. – fmw42 Jun 06 '20 at 00:36
  • Please always the input image by itself so that others can test with it. – fmw42 Jun 06 '20 at 02:04

0 Answers0