Skin Color Detection on ROI Image on Android
Hi There, I Need your help to get solution. I have a source code that can detect right hand using Android. I work it with original source from android sample "face detector". with simple work, i can change that face detector to become right hand detector. this is android source to detect desired object :
@Override
protected Bitmap processFrame(VideoCapture capture) {
capture.retrieve(mRgba, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA);
capture.retrieve(mGray, Highgui.CV_CAP_ANDROID_GREY_FRAME);
if (mCascade != null) {
int height = mGray.rows();
int handSize = Math.round(height * Isign.minHandSize);
List<Rect> hand = new LinkedList<Rect>();
mCascade.detectMultiScale(mGray, hand, 1.1, 2, 2 // TODO: objdetect.CV_HAAR_SCALE_IMAGE
,new Size(handSize, handSize));
for (Rect r : hand)
Core.rectangle(mRgba, r.tl(), r.br(), new Scalar(255, 255, 255, 255), 3);
}
Bitmap bmp = Bitmap.createBitmap(mRgba.cols(), mRgba.rows(), Bitmap.Config.ARGB_8888);
if (Utils.matToBitmap(mRgba, bmp))
return bmp;
bmp.recycle();
return null;
}
So with this code :
for (Rect r : hand)
Core.rectangle(mRgba, r.tl(), r.br(), new Scalar(255, 255, 255, 255), 3);
I can get ROI Image at every frame from video capture.
My Problem is :
How can i process that ROI Images (actually frame on the rect area) to real time skin detection and preview in android screen realtime also. so, maybe this image can descibe clearly what i want to do : (second picture edited by photoshop)
This Original Hand Detect
This My Edited Picture from PS : I want this
Thank you So Much for Your Answer... :)
Finally it's done, thank you so much all member here and stackoverflow forum. this reference to get it done :
http://stackoverflow.com/questions/9443377/android-color-detection-using-opencv-how-to
Hey! I am working on a similar project- making a gesture recognition app. Is it possible for you to share the source code of your application with me? It would really be a big help! Thanks :)
Can you pls share your xml for hand haar classifier? It'll be a big help for my above mentioned project :)
@Niharika A : you can grab it here : http://www.mediafire.com/?2e8n8evm820peri