Re: [OpenCV4Android] how to detect eyes and face

177 views
Skip to first unread message
Message has been deleted
Message has been deleted

Putria Febriana

unread,
Sep 28, 2012, 10:01:26 AM9/28/12
to android...@googlegroups.com
i need tutorial for detect iris

2012/9/28 fathallah sondes <sondes....@gmail.com>
Is there any one who can help me please i'm really blocked here and i need a solution
thanks in advance

--
 
 
 



--
hari ini adalah milik anda?
aku hanya akan hidup untuk hari ini


Andrey Pavlenko

unread,
Sep 28, 2012, 10:49:14 AM9/28/12
to android...@googlegroups.com
Don't you forget to add the same code lines for your cascade file as the following ones:

 InputStream is = context.getResources().openRawResource(R.raw.haarcascade_profileface);
 FileOutputStream os = new FileOutputStream(mCascadeFile);
 byte[] buffer = new byte[4096];
 int bytesRead;
 while ((bytesRead = is.read(buffer)) != -1) {
     os.write(buffer, 0, bytesRead);
}
is.close();
os.close();

This code reads the cascade XML from resources and saves it as a file.
In the sample it's done for the face cascade, so you need to do it for the eye cascade as well.

Then, when you find a face rectangle you can use the 2nd cascade to find eyes inside it.

bob

unread,
Sep 30, 2012, 5:57:46 AM9/30/12
to
hi Andrey
i'm really grateful thannnnnnnnnnnnnnnnnnnnnnnnnnnnks 

Roman

unread,
Oct 2, 2012, 3:42:22 PM10/2/12
to android...@googlegroups.com
Hi, I tried some methods for eye detection (template matching, diff matrix + contours, eyemap) and get good result with - get face from lbp casscade (faster than haar) extract area where eyes should be, detect eyes in this area via haar casscade for eye and use this image as actual template for template matching.

I will put some samples on my blog soon.

Roman

Dne pátek, 28. září 2012 22:43:30 UTC+2 bob napsal(a):
Reply all
Reply to author
Forward
0 new messages