Ask Your Question

native opencv camera for LBP based detection

asked 2012-07-17 15:04:19 -0600

Ayan Acharya gravatar image

updated 2012-07-18 02:48:47 -0600

Kirill Kornyakov gravatar image


I am working on a real time application and would expect to get at least 20 fps camera frame rate for object detection using LBP cascade classifier. I explored the tutorials of opencv and realized that access using java android camera is pretty slow (~10fps). However, the primary problem using native code for object detection seems to be the trained classifier file .xml as, apparently, there is no obvious way of reading the file from the native code. Can someone please provide some guideline?

edit retag flag offensive close merge delete


To clarify things a bit more, what I am looking for is a way to read the .xml file from java only once and pass it somehow to the C++ native code, capture the video using native camera and detect and display objects from inside the native code.

Ayan Acharya gravatar imageAyan Acharya ( 2012-07-17 15:39:31 -0600 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2012-07-18 02:43:57 -0600

Kirill Kornyakov gravatar image

And what is wrong with the Android face-detection sample? It seems to me that it already does almost everything you want... It uses native camera, it supports detection on the native level (DetectionBasedTracker), it reads cascade file from application resources using Java.

edit flag offensive delete link more

answered 2012-07-18 03:00:34 -0600

Ayan Acharya gravatar image

From the discussion posted here and also from other online forums, I was under the impression that the face-detection sample does not use the native camera which might have been the primary reason of its low frame rate. So, I am not sure if this is the most optimal implementation or improvements can be made using the videocapture class (or some other technique) -- for which no example implementation is available for android devices.

@Shervin, I already tried the route and reading from sdcard significantly reduces framerate (~0.5fps). I realized that reading the xml file once in java and then passing the cascade classifier as an object through the JNI function would be faster. But I have not yet implemented that and don't know if this is feasible at all. Any more suggestion?

edit flag offensive delete link more

Question Tools


Asked: 2012-07-17 15:04:19 -0600

Seen: 1,558 times

Last updated: Jul 18 '12