Ask Your Question
0

How to avoid compreesion artifacts on segmentation?

asked 2017-11-16 06:26:36 -0600

Tarcisioflima gravatar image

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.

Example

Therefore, I tried to use threshold to remove them without success as showing in the described attachment. I got the better result with THRESH_TOZERO_INV; however, I lost part of the leaf.

image description

Any help on how to keep only the Leaf without false positives?

edit retag flag offensive close merge delete

Comments

Save as PNG, no compression?

sjhalayka gravatar imagesjhalayka ( 2017-11-16 14:28:05 -0600 )edit

@sjhalayka I cannot control it.

Tarcisioflima gravatar imageTarcisioflima ( 2017-12-05 10:53:04 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-11-17 10:11:20 -0600

kbarni gravatar image

The compression artifacts have a low amplitude. Therefore you can use a less severe threshold to get a correct mask. Here's the result of a segmentation of the attached image with a threshold of 210 (after transforming it to grayscale):

image description

This is valid also for segmentation: by using another value, you can obtain a correctly segmented image; no need for thresholding. Note that for compressed/noisy images, if you want to segment the hue channel, you should use the saturation channel, too (as the hue can vary a lot in low-saturation zones).

edit flag offensive delete link more

Comments

@Kbarnin, I'm trying to use the S and V from HSV domain to train my EM algorithm; however, due to greenish shadows, it is returning false positives

Tarcisioflima gravatar imageTarcisioflima ( 2017-12-04 12:51:52 -0600 )edit

The S threshold of 30 gives quite good results, but still a bit worse than the L thresholding. As I said in an earlier answer, the H channel should never be used alone for thresholding (especially noisy or compressed images).

kbarni gravatar imagekbarni ( 2017-12-05 10:38:35 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-11-16 06:26:36 -0600

Seen: 625 times

Last updated: Nov 17 '17