Unblock main thread in Android samples (Patch #2090)


Added by Kirill Kornyakov over 12 years ago. Updated over 12 years ago.


Status:Done Start date:2012-06-25
Priority:Normal Due date:
Assignee:Alexander Smorkalov % Done:

0%

Category:android
Target version:2.4.3
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Alexander, could you please consider this change for 2.4.2?

Hi Kirill,

Are the NDK sample programs (Sample 3 "Native" and Sample 4 "Mixed") that come with OpenCV4Android still the recommended way to write Android OpenCV apps (for regular users), or are they being deprecated? For my book I have written an Android app that is based on Sample 3, and since my app is very slow (around 0.3 FPS), I realized that the NDK samples block the main UI thread while the background processing is being done (even though it has a background thread!). This doesn't matter for fast apps but if someone wants to do some heavy processing on the camera feed, then it is a problem. I modified "SampleViewBase.java" so that it doesn't block the main thread while the image is processing, and I'm happy to submit it to you guys to replace the one in Sample 3 and Sample 4. But since I'm not too familiar with the Android Camera, someone with more experience of the camera system should verify that my code is OK.

-Shervin.


SampleViewBase.java (8.5 kB) Kirill Kornyakov, 2012-06-25 06:02 pm


History

Updated by Kirill Kornyakov over 12 years ago

  • File SampleViewBase.java added

Updated by Kirill Kornyakov over 12 years ago

  • Target version set to 2.4.3

Updated by Alexander Smorkalov over 12 years ago

Nothing to do. All samples have already processed data in a separate thread.

  • Status changed from Open to Done

Also available in: Atom PDF