Ask Your Question

How to remove shadows from foreground after segmentation?

asked 2019-12-05 08:21:01 -0500

Tarcisioflima gravatar image

I am developing an algorithm in Python, which is supposed to identify the area of a leaf that contains spots to report the severity of a disease.

Therefore to be able to achieve the goal, I need to segment the image on foreground (leaf) and background.

During my research, I found out about LeafSnap (State of the Art) and follow the paper to segment the leaf on the image using OpenCV Expectation Maximization, which is trained using S and V form HSV color space; however, it still returns some false positives due to reflection or shadow.

Leaf Segmented

So, I'm trying to figure out a way to avoid or decrease the incidence of false positives. Any hint on it?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2019-12-08 07:30:22 -0500

Greydel gravatar image

updated 2019-12-08 18:30:02 -0500

Searching for the better way to do what you need y try inRange función after converting image to hsv, i use all hue and saturation range from 0 to 255 and value from 0 to 90.

I work in Java but is almost the same. My code is here and the result image is here:image description

edit flag offensive delete link more


Thank you Greydel. I will take a look on your approach

Tarcisioflima gravatar imageTarcisioflima ( 2019-12-08 07:38:12 -0500 )edit

Question Tools

1 follower


Asked: 2019-12-05 08:21:01 -0500

Seen: 910 times

Last updated: Dec 08 '19