how to segment hand from an image with non uniform lighting?

7 ビュー (過去 30 日間)
H
H 2014 年 7 月 12 日
コメント済み: Image Analyst 2020 年 11 月 14 日
I'm trying to segment the hand from the image but due to the non uniform lighting the result come out like this
the result in uniform lighting
how to solve this problem?

採用された回答

Image Analyst
Image Analyst 2014 年 7 月 12 日
Just fix the lighting - it's so simple! It's almost always easier to prevent the problem than to fix it with software and that is definitely the case here.
If you don't want to get the job done in the most sensible, easy, straightforward, and best way (by fixing the illumination), then there are more complicated ways that you can do it, but you have to make some assumptions, like on the size of the hand, or its color, or on the smoothness of the background, or things like that. Some fix you make for one situation might not work for another. Like if you have that picture and then another where the hand is in front of a flesh colored screen, or a screen with a paisley background - those may all take different algorithms.
For what it's worth, I attach a background correction demo.
  4 件のコメント
H
H 2014 年 7 月 14 日
Thanks for your help
Image Analyst
Image Analyst 2014 年 7 月 14 日
If you know your background is always neutral colored and your hands are not, then you can convert to hsv color space and threshold for reddish pixels. See my demo : http://www.mathworks.com/matlabcentral/fileexchange/28512-simple-color-detection-by-hue

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

その他の回答 (3 件)

Laila Kazemi
Laila Kazemi 2014 年 7 月 12 日
You need adaptive threshold since the background changes. I have not yet found a good code in matlab for this. you might have to find your own algorithm and code it.
  1 件のコメント
H
H 2014 年 7 月 14 日
Here I used graythresh(). but I also tried many different levels for the shareholding other than this level but it didn't work. I also used diifferent segmentation techniques and the result is the same. I think the first step should be fixing the illumination.

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


Prasad Kalane
Prasad Kalane 2014 年 7 月 14 日
% Do some image illumination correction.
background = imopen(I,strel('disk',15));
I = I - backgroundbackground
I = imadjust(I);
% level = graythresh(I);
bw = im2bw(I,0.3*level);

Milion Negewo
Milion Negewo 2020 年 11 月 14 日
background = imopen(I,strel('disk',15));
I = I - backgroundbackground
I = imadjust(I);
% level = graythresh(I);
bw = im2bw(I,0.3*level);
  1 件のコメント
Image Analyst
Image Analyst 2020 年 11 月 14 日
Here is your algorithm:
I = imread('hands.png');
% Display original image.
subplot(2, 3, 1);
imshow(I);
title('Original Image');
% Convert to gray scale so we can call imopen().
I = rgb2gray(I);
% Display original image.
subplot(2, 3, 2);
imshow(I);
title('Gray Scale Image');
background = imopen(I, strel('disk',15));
% Display image.
subplot(2, 3, 3);
imshow(background);
title('Background Image');
I = mat2gray(double(I) - double(background));
I = imadjust(I);
% Display image.
subplot(2, 3, 4);
imshow(I);
title('Background Subtracted Image');
level = graythresh(I);
bw = im2bw(I, 0.3*level);
% Display image.
subplot(2, 3, 5:6);
imshow(bw);
title('Final Binary Image');
The final image doesn't look so good. I think you need to work on it some more.

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

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by