0

I am working on a project on image processing. I need to segment only the required object from the image and make the background white. For this I am detecting the edges in the image and then finding contours. I then draw the contour with the maximum area and finally copy it to a white background image.

But the issue with it is that while detecting edges, the edges are broken. On observing I realized that it is showing broken edges at that point where the intensity of foreground and background is the same. It doesn't find any change, thus no edge is detected. How do I fix this?

Actually, for this I am calculating the histogram of the image, and then finding the median from the histogram, but I am unable to find this.

Miki
  • 40,887
  • 13
  • 123
  • 202
shreya
  • 39
  • 1
  • 5
  • Same intensity -> no gradient -> no edge. That's pretty obvious. If you post an example image, probably we can help you with a different (and more robust) approach instead of edge detection – Miki Sep 06 '16 at 14:09
  • @Miki i have edited the post. i have attached the image.please check it out and help me. – shreya Sep 06 '16 at 18:05
  • Which is the _required_ object? How do you know that? – Miki Sep 06 '16 at 19:08
  • @Miki it is just an example image to show you that edge detection doesn't work . – shreya Sep 06 '16 at 19:27
  • can u suggest me,a better way. – shreya Sep 06 '16 at 19:35
  • These objects will be easier to segment by colour than by edge detection. –  Sep 16 '16 at 08:32

0 Answers0