Re: The performance of android-opencv

3,197 views
Skip to first unread message

Kirill Kornyakov

unread,
Jul 6, 2011, 7:24:52 AM7/6/11
to android...@googlegroups.com
I don't know your parameters, so check the following:
1. Do you use LBP cascade? It is located in opencv_trunk/data/lbpcascades/lbpcascade_frontalface.xml. It runs 3 times faster than Haar cascade. But the quality is a bit worse...
2. Try bigger minFaceSize. Downscaling of the image doesn't help because OpenCV implementation makes scaling by itself. The key parameters is MinFace.

You can also implement some face tracking algorithm and skip frames or do a local search with periodic rerun on the full frame...

On Wed, Jul 6, 2011 at 7:07 AM, shwing <clair...@gmail.com> wrote:
Hi

Right now I am trying to run the face detection by

android-opencv, but it is hard to do in real time.

So I tested the frame rate on camera only.

The frame rate of camera in 320*240 is 15fps
in 640*480 is 10 fps

The frame rate is pretty low, I am wordering whether

there is some method to improve the frame rate up to

30 fps in 320*240 or I miss some setting ...

Thanks for any respose

shwing

unread,
Jul 6, 2011, 9:52:33 PM7/6/11
to android-opencv
Hi

Thanks for your respones

But I test the frame rate of camera without face detection , I think
the problem is not about detection

The frame rate I get is only run the camera and show the image without
doing any image processing

Even just show the camera image the frame rate is low

I think the frame rate of camera can be imporved but I don't know how

Thank you for your respones



On 7月6日, 下午7時24分, Kirill Kornyakov <kirill.kornya...@itseez.com>
wrote:
> I don't know your parameters, so check the following:
> 1. Do you use LBP cascade? It is located
> in opencv_trunk/data/lbpcascades/lbpcascade_frontalface.xml. It runs 3 times
> faster than Haar cascade. But the quality is a bit worse...
> 2. Try *bigger *minFaceSize. Downscaling of the image doesn't help because

Oren Bengigi

unread,
Jul 6, 2011, 10:10:33 PM7/6/11
to android...@googlegroups.com
You can change the default camera frame rate using Android's camera API
--
Best Regards,
Oren Bengigi

Kirill Kornyakov

unread,
Jul 7, 2011, 2:19:50 AM7/7/11
to android...@googlegroups.com
In our experiments Android Java camera with empty processing loop shows ~20fps. So, OpenCV has native camera support and it runs much faster. If your application has C++ code, you can try VideoCapture class to retrieve frames from camera.

shwing

unread,
Jul 7, 2011, 5:19:59 AM7/7/11
to android-opencv
Hello

I am a little bit confuse about why opencv camera would faster than
the android java camera

Since opencv get the camera through android system

And the other question is

I have test the Opencv_sample it shows the fps

in 320*240 the fps is also 15

does anybody test the frame rate of camera on android-opencv ?

Thank you for answering the question



On 7月7日, 下午2時19分, Kirill Kornyakov <kirill.kornya...@itseez.com>
wrote:

Kirill Kornyakov

unread,
Jul 7, 2011, 6:42:02 AM7/7/11
to android...@googlegroups.com
OpenCV_SAMPLE use the same usual slow Android Java camera. And it will not give you any speedup.

But I'm talking about native camera (OpenCV C++ VideoCapture class). Of course OpenCV uses the same system API, but the speed of a native routines is much faster than Java.

shwing

unread,
Jul 7, 2011, 11:21:41 PM7/7/11
to android-opencv
Hi
I had follow the instruction step by step and run the CVCamera sample

As you mention, CVCamera and opencv_sample all use the slow android
java camera

And if I want to speedup the camera should I change to use the native
camera (OpenCV C++ VideoCapture class) in

CVCamera.

But CVCamera have deal with all the camera process the only things I
did is to get the image form image pool.

How can I change to using native camera?

Thank you for your answer


On 7月7日, 下午6時42分, Kirill Kornyakov <kirill.kornya...@itseez.com>
wrote:
> OpenCV_SAMPLE use the same usual slow Android Java camera. And it will not
> give you any speedup.
>
> But I'm talking about *native* camera (OpenCV C++ VideoCapture class). Of

Andrey Pavlenko

unread,
Jul 18, 2012, 10:21:24 AM7/18/12
to android...@googlegroups.com
Look at the face-detection sample: it loads XML cascade from resources in Java, stores as a file and reads it in native code.
Reply all
Reply to author
Forward
0 new messages