How can I remove shadows in image segmentation?

5 ビュー (過去 30 日間)
emmegi
emmegi 2015 年 4 月 25 日
コメント済み: hoyzer24 2015 年 9 月 17 日
I'm a beginner user of MATLAB. I'm working on a project about fruit segmentation. I took pictures of different fruits with a white background. I used HSV thresholding, then morphologic operations. My problem is that i'm not be able to remove shadows in inferior part so this makes the object bigger than real and my results are not so accurate.
Do you have ave any suggestions? Should I use different threshold?
I = imread('limone_prova.jpg');
if true
clc;
clear all;
close all;
workspace;
I = imread('limone_prova2.jpg'); figure(1); imshow (I,'InitialMagnification',17)
%crop I_crop=imcrop(I, [873.5 411.5 2910 2232]);
I_HSV=rgb2hsv(I_crop); H=I_HSV(:,:,1); %Hue S=I_HSV(:,:,2); %Saturation V=I_HSV(:,:,3); %Value
thr_S=(S > 0.20);
open_S = bwareaopen(thr_S, 6000);
se = strel('disk',15); closeMask = imclose(open_S, se);
mask = uint8(closeMask); mask = cast(mask, class(I_crop)); mask_R = mask .* I_crop(:,:,1); mask_G = mask .* I_crop(:,:,2); mask_B = mask .* I_crop(:,:,3); mask_RGB = cat(3, mask_R, mask_G, mask_B);
figure; imshow(mask_RGB) end

採用された回答

Payam Ahmadvand
Payam Ahmadvand 2015 年 5 月 3 日
Shadow removing is a challenging topics and you cannot remove the shadow just by a threshold!
A method base on segmentation "The Shadow Meets the Mask: Pyramid-Based Shadow Removal" www.cs.huji.ac.il/~danix/ShadowRemoval/shadow_eg08.pdf
A method based on entropy minimization "Recovery of Chromaticity Image Free from Shadows via Illumination Invariance" https://www.cs.sfu.ca/~mark/ftp/Iccv03ColorWkshp/iccv03wkshp.pdf
  2 件のコメント
emmegi
emmegi 2015 年 5 月 3 日
Thank you for your suggestions, I'll study this papers and I'll try to fix the problem.
hoyzer24
hoyzer24 2015 年 9 月 17 日
You found some answers concerning this? I would also be interested ;)

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by