Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

How to offload imaging processing to worker

$
0
0
Hi All! I've run into a little predicament. I'm trying to: 1. Use CameraBridgeViewBase in my main activity to grab images 2. Use a Worker class to process the images 3. Draw the processed images back in my main activity The reason I'm using a worker class is because I thought it would be more efficient. However the way I've implemented it so far: 1. onCameraFrame() begins a new thread to run the Worker class 2. the Worker class finishes and disposes the thread 3. Repeat. This is quite inefficient since I recreate a thread each frame I process. Is there a better way to offload the processing to the Worker? I've thought about just letting the Worker thread take callBacks from CameraBridgeViewBase but I'm not sure how that would work out. Doing this would make more sense if you could request/grab picture frames instead of wait on a callBack from CameraBridgeViewBase. I believe using VideoCapture allows you to request/grab frames instead of wait on a callBack, but I think the usage of that class has changed in the new OpenCV versions (the old tutorial doesn't work) and I can't find any new tutorials on using it. Cheers! Kevin

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>