Log in or register to post comments

Very slow frame rate

July 18, 2013 - 7:10am #1

Hi everyone,

After spending some time, i managed to capture a specific part of the target from the camera screen. I am achieving that by calculating four corners of the target on renderFrame() and then sending those pixels ,width and height to android part. 

Everything is working as i want till then. But then when i want to do somethings with the pixels i get from JNI, things started going down...

When i want to create a bitmap and put the captured target image to the screen (bitmap sizes are like 320x240, not big at all) , or when i want to send that btimap to OCR for text recognition(tess-two), the camera frame rate is slowing increadibly down. It is literally like becoming frame by frame, and i tried it even with Samsung galaxy s4 and still the result is the same.

I tried to use AsyncTask for bitmap creation, or OCR but still didnt do an change. The actions are hapening in the GL thread since i call the java method from renderFrame(). EVen i tried the main thread , but expectedly it doesnt do anything good for me too.

Can someone help me about it?

Thanks

 

Very slow frame rate

July 18, 2013 - 8:28am #4

A certain (limited) slow down can be expected when capturing the full camera image, as the copy from JNI to Java and the bitmap creation cna take a bit of time;

however, for the subsequent operations (such as displaying or processing the bitmap in Android), few things to keep in mind:

- don't create a new Bitmap each time, but consider updating the content of the same bitmap (create once, re-use many times), as Bitmap creation can be time-consuming 

- do not perform Bitmap operations in the OpenGL rendering thread; also, the idea of using an AsyncTask is good, but perhaps you need to double check your implementation... (but this is not really in the scope of Vuforia, so here you need to find your own way)

I hope this helps.

Very slow frame rate

July 18, 2013 - 7:39am #3

Hi ,

The problem is, even when i want to do just a normal capturing image with the description on the support page, the frame rate slows down. 

i am doing the things in this link :

https://developer.vuforia.com/forum/faq/android-how-can-i-access-camera-image

 

And still when i want to put the image that is captured to the screen, as a small ImageView on the corner, it slows down a lot, and i am not doing anythig else but that, not anther computation

Very slow frame rate

July 18, 2013 - 7:24am #2

Hi, probably the pixel processing of the bitmap that you have captured is performing some heavy / time-consuming work, which is putting too much load on your CPU.

Maybe worth experimenting with some simple custom-made algorithms to process your bitmap, and incrementally increase the algorithm complexity in a few tests; this would allow you to observe at which point the frame rate starts getting significantly degraded...

 

Log in or register to post comments