Friendly use of processor intensive operations? Not greedy function calls?

47 views
Skip to first unread message

Richard

unread,
Apr 23, 2012, 12:01:32 PM4/23/12
to android...@googlegroups.com
Is there any way to set some of the more processor intensive functions of OpenCV to use only resources that are left over?  For example, If I had an application that would scan a video stream with a SURF Feature Detector/Extractor and use a Bruteforce matcher it takes at least a dozen to several dozen seconds to process the image data for matching against a reference image.  My question is can I specify the UI and video capture/display process as the most important process that gets first dibs to system resources for the best user experience then create another process for the evaluation of these images to do things like throw out poor quality images and select only the images that would be most likely to contain match-able information and give this process second rights to system resources. Then have a third process that would only run on available leftover system resources that would take all the time it needs to match the data against reference images.  Does anyone know if there is anyway to do this?

Roman

unread,
Apr 23, 2012, 5:12:22 PM4/23/12
to android...@googlegroups.com
My friend use this for speeding up app on dual/quad cores processors - have threads for some operations.
http://www.brokenteapotstudios.com/android-game-development-blog/2011/07/posix-threads-on-android.html
But I dont know if it is usable with opencv, as Im not developing in native C++ level. Maybe could help you.

Roman

Dne pondělí, 23. dubna 2012 18:01:32 UTC+2 Richard napsal(a):

Stefano Fossati

unread,
Apr 24, 2012, 8:55:05 AM4/24/12
to android...@googlegroups.com
In our project (opencv with android api) we are using threads to start heavy work

new Thread(new Runnable() {

    public void run() {

    Thread t = Thread.currentThread();  
    t
.setPriority(Thread.NORM_PRIORITY);

    //code here

}).start();

Richard

unread,
Apr 24, 2012, 11:27:08 AM4/24/12
to android...@googlegroups.com
Perfect! This is exactly what I was looking for. Thanks!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages