How can I separate hand from forearm after skin segmentation?

4 ビュー (過去 30 日間)
M
M 2015 年 7 月 27 日
コメント済み: M 2015 年 8 月 5 日
I'm working on a gesture recognition project. I've carried out skin segmentation and I'm now trying to separate the hand from the forearm before the feature extraction phase. I'm wondering how I would go about achieving this? I've attached an image for reference.
Thanks.

回答 (2 件)

Cedric
Cedric 2015 年 8 月 2 日
This could be a start. This is not as solid/stable as what ImageAnalyst proposes though. In French we would call that "bricolage" ;-)
I = im2bw( imread( 'hand.jpg' )) ;
% - Crop white frame.
I = I(~all(I,2),~all(I,1)) ;
% - Crop 10px border to eliminate glitches at the border.
I = I(10:end-10,10:end-10) ;
[nRow, nCol] = size( I ) ;
% - Find first horizontal transition 0->1 from left.
D = diff( I, 1, 2 ) == 1 ;
% - Find first column per row where D is 1.
[~, colId] = max( D, [], 2 ) ;
% - Smoothen colId.
kerSize = round( nCol /10 ) ;
colId_smz = conv( colId, ones( 1, kerSize )/kerSize, 'same' ) ;
figure() ;
set( gcf, 'Units', 'normalized', 'Position', [0.1,0.1,0.8,0.8] ) ;
% - Plot cropped image.
subplot( 2, 2, 1 ) ;
imshow( I ) ;
title( 'Cropped image' ) ;
% - Plot left profile.
subplot( 2, 2, 2 ) ;
imshow( D ) ;
title( 'Left profile' ) ;
% - Plot left profile + smoothen.
subplot( 2, 2, 3 ) ;
y_colId = colId ; y_colId(colId==1) = NaN ;
y_smz = colId_smz ; y_smz(colId==1) = NaN ;
plot( 1:nRow, y_colId, 'b', 1:nRow, y_smz, 'r' ) ;
grid on ; title( 'Profile + smoothen' ) ;
% - Plot difference + smoothen.
subplot( 2, 2, 4 ) ;
dif = diff( y_smz ) ;
dif_smz = conv( dif, ones( 1, kerSize )/kerSize, 'same' ) ;
plot( 1:nRow-1, dif, 'b', 1:nRow-1, dif_smz, 'r' ) ;
ylim( prctile( dif_smz, [5, 95] )) ;
grid on ; title( 'Diff + smoothen' ) ;
With that you get:
Then you have to detect the from the right the point where the smoothen derivative changes significantly.
  3 件のコメント
Cedric
Cedric 2015 年 8 月 2 日
I will really have to dig in this Image Processing Toolbox! I am currently doing a lot of operations using a combination of MATLAB and ArcGIS for GIS operations, and I am pretty sure that a lot of these operations could be done with the Image Proc. Tbx only.
M
M 2015 年 8 月 5 日
Thank you for your help. I have decided to make things simple and avoid forearm skin detection.

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


Image Analyst
Image Analyst 2015 年 7 月 27 日
  4 件のコメント
M
M 2015 年 8 月 4 日
Thanks for the ideas, but implementing it is probably out of my reach. I have decided to just eliminate the forearm skin detection (by wearing long sleeve shirts).
Image Analyst
Image Analyst 2015 年 8 月 4 日
If you can do that, that is a far simpler solution.

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

カテゴリ

Help Center および File ExchangeDetection についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by