Are there any methods to remove/reduce shadows in this image?

In this image, the leaves are on a piece of white paper. I wonder in this particular case if there are any effective methods for shadow removal or reduction using Matlab. If it's not possible to completely remove the shadows, reducing them is also OK. Thank you!

Answers (1)

Try the Color Thresholder on the Apps tab of the tool ribbon. Use HSV colorspace and find regions with saturation less than about 0.2 - that will be the white and gray regions.

4 Comments

Thanks, but it does not work well. Simple thresholding methods will not work well because the leaves have big dynamic range in each channel. Below is what I can get with the Color Thresholder by thresholding the saturation channel. As you can see, shadows still remain.
You may have to adjust the thresholds some more. Or you may need to combine it with morphological methods like hole filling or bwareaopen. Or you may have to combine it with stdfilt to find the smooth areas and then mask those out. I don't have time now to try those things but try them yourself and I'll check back tomorrow to see if you still need help.
Thank you for your time, I have tried all you mentioned, including entropyfilt. Also tried entropyfilt-stdfilt (to get rid of shadow margins) and then imopen, but the shadows persist. I'm at my wits end. I'd appreciate it if you could give me more ideas.

Sign in to comment.

Products

Release

R2022b

Asked:

on 21 Jan 2025

Commented:

on 25 Jan 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!