0

I am using OpenCV EM to segment a image on the HSV domain. Therefore, the segmentation detect some false positives [Highlights in Yellow]. Below, you can see the input image.

Input Image

And below, the image segmented with false positives.

False Positives

I try to remove it by using threshold as you can see without success.

Otsu's Example Threshold Example

Any help on how to keep only the Leaf will be appreciated!

Tarcisiofl
  • 123
  • 1
  • 4
  • 16

1 Answers1

2

The "false positives" you see are compression artefacts caused by JPEG compression.

https://en.wikipedia.org/wiki/JPEG

You cannot segment this perfectly in Hue or Saturation channel.

Ideally process uncompressed images or use brightness information which usually is preserved in higher frequencies than colour.

Unfortunately you did not provide the actual input image so I cannot help you any further.

Piglet
  • 27,501
  • 3
  • 20
  • 43
  • The actual image is the one in the first attachment. However, I will add it separately. – Tarcisiofl Nov 14 '17 at 12:04
  • @Tarcisiofl can you tell me why you have to segment it in the first place? I mean the background is perfectly white and the leaf is not. Actually you already have what you want? or do I miss something here? – Piglet Nov 14 '17 at 14:07
  • I need to calculate the area of the leaf; however, if I use cv2.findContours(), it also gets the "false positives" – Tarcisiofl Nov 14 '17 at 16:47