I am using the OpenCV library for an image processing project for hand detection. I initialized the image in iplimage , colored it, and then converted it to HSV using cvCvtColor(imageHand,imageHand,CV_BGR2HSV ); I do not know an effective algorithm to my problem. Check out my code:
for( int row = 0; row < imageHand->height; row++ ) { for ( int col = 0; col < imageHand->width; col++ ) { h =(imageHand->imageData[imageHand->widthStep * row + col * 3]) ; s = (imageHand->imageData[imageHand->widthStep * row + col * 3 + 1]); v = (imageHand->imageData[imageHand->widthStep * row + col * 3 + 2]); if( h>85) { imageHand->imageData[imageHand->widthStep * row + col * 3 ] = 0 ; imageHand->imageData[imageHand->widthStep * row + col * 3 + 1 ] =0 ; imageHand->imageData[imageHand->widthStep * row + col * 3 + 2 ] = 0 ; } else { imageHand->imageData[imageHand->widthStep * row + col * 3 ] = 255 ; imageHand->imageData[imageHand->widthStep * row + col * 3 + 1 ] = 255 ; imageHand->imageData[imageHand->widthStep * row + col * 3 + 2 ] = 255 ; } } }
I think the search range h is > 85 !? If you know a better algorithm than be guided by me.
c ++ image-processing opencv computer-vision
Mohamed kamal
source share