
How can I separate hand from forearm after skin segmentation?
    3 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
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.

0 commentaires
Réponses (2)
  Cedric
      
      
 le 2 Août 2015
        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 commentaires
  Cedric
      
      
 le 2 Août 2015
				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.
Voir également
Catégories
				En savoir plus sur Detection dans Help Center et File Exchange
			
	Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



