Thank you very much for both of your responses.  I will take a look at the 
code you both suggested.

In response to Matthew, the ODroid so far has proven to be great at almost 
everything.  I have already turned off auto exposure and auto focus.  The 
platform I have the camera on moves often near and far from objects as well 
as vibrates, so these of course caused issues.

The webcam seems to get the higher frame rate with no issue when I use 
external applications, such as Cheese.  I even used framegrabber and 
another application someone made for the BBB to test and was able to get 30 
fps.  The problem seems to be directly related to OpenCV and how it uses 
v4l.  Even if the resolution (in OpenCV) is set to the lowest resolution, 
the fps still maxes at 15fps.  This rate is found with just image capture, 
so no other processing is performed.  This seems like a hard limit that 
OpenCV is causing specifically on the ODroid setup.


On Wednesday, January 29, 2014 8:41:54 PM UTC-5, Matthew Witherwax wrote:
>
> To piggy back on Mike's response, when we were testing the capture rate of 
> the BBB, we used a modified version of framegrabber that is attached to 
> this article 
> http://blog.lemoneerlabs.com/post/bbb-optimized-opencv-mjpeg-stream
>
> It allows you to set all the parameters the regular framegrabber accepts 
> but converts each frame to an OpenCV Mat.  It is C code and as another word 
> of warning, I won't say the code is any less sloppy than Mike's :) It was 
> written for testing purposes.
>
> The article itself details how to compile OpenCV to use NEON and 
> libjpeg-turbo courtesy of Mike.
>
> I am surprised to hear the ODroid has trouble capturing higher than 15 
> fps.  I recently bought a Wanboard Quad, but the ODroid was on my short 
> list.
>
> A few things to consider:
>
> Have you tested with framegrabber to see if you can capture the raw frames 
> at a speed greater than 15 fps?  It could be that OpenCV is the bottle neck 
> and perhaps you should recompile it per Mike's instructions.
>
> Is auto exposure turned off?  Even with the frame rate set to 30 fps, in 
> low light conditions, the camera increases exposure time to compensate 
> leading to about 15 fps.
>
> Good luck, and as Mike said, if you need help, we will do out best.
>
>
> On Wed, Jan 29, 2014 at 4:02 PM, Michael Darling 
> <fndrpl...@gmail.com<javascript:>
> > wrote:
>
>> All you have to do is adapt the frame grabber code for your needs.  I 
>> actually went ahead and rewrote the capture code to be object oriented so 
>> that I could conveniently use it with OpenCV's C++ interface.  You might 
>> find some of my code helpful as an example to work from.  It is in a public 
>> git repo:
>> https://github.com/mdarling39/LinuxVision/blob/master/
>>
>> I think you would primarily be interested in taking a look at CamObj.hpp, 
>> CamObj.cpp, and v4l2Cap.h, v4l2Cap.cpp, and/or v4l2_c.h and v4l2_c.c.  As a 
>> word of warning, my code is sloppy and specific for my needs, but it does 
>> what I need it to do.  Feel free to borrow from it and modify it to your 
>> heart's content.
>>
>> I actually don't remember how all of this stuff works anymore, but you 
>> can look at main_threaded.cpp to see how I am using v4l2_c.h to get frames 
>> into a cv::Mat object.  If I remember right, I had to abandon the 
>> object-oriented approach for some reason so that later so that I could 
>> implement multi-threading using pthreads. I think the magic you are looking 
>> for is in the function v4l2_process_image(cv::Mat, const void), where the 
>> frame buffer is actually decoded and saved to a cv::Mat object. Once you 
>> have that, you're home free and can just deal with OpenCV.
>>
>> static void v4l2_process_image(cv::Mat &img, const void *p)
>>
>> {
>>         cv::Mat buff(img.cols, img.rows, CV_8UC3, (void*)p);
>>
>>         img = cv::imdecode(buff,CV_LOAD_IMAGE_COLOR);
>>
>> }
>>
>>
>> I hope that helps you to get started.  If you need any help, just ask. 
>>  I'll do my best to help where I can.
>>
>> Good luck,
>> Mike
>>
>>
>>
>> On Wed, Jan 29, 2014 at 11:52 AM, Learning Opencv 
>> <epsilo...@gmail.com<javascript:>
>> > wrote:
>>
>>> I am working with the C920 on an ODroid, similar to the BBB.  I am also 
>>> having a problem capturing more than 15fps in OpenCV, however, I need to 
>>> use OpenCV for doing processing on the video.  Since I am not just grabbing 
>>> frames, I can't do something like framegrabber.  Is there anyone who has 
>>> done this and have a solution.  I have tried changing settings on v4l 
>>> before running my code, but have had no luck.
>>>
>>> Thanks.
>>>
>>>
>>> On Monday, November 4, 2013 7:07:58 AM UTC-5, Matthew Witherwax wrote:
>>>
>>>> Glad to hear our work is helping others.  Let us know how your 
>>>> endeavors go.
>>>> -Matthew
>>>>
>>>>
>>>> On Sun, Nov 3, 2013 at 3:22 PM, <josiasina...@gmail.com> wrote:
>>>>
>>>>> Excellent, excellent thread! I just purchased my BBB yesterday for a 
>>>>> personal project, and I've been reading for many many hours how and what 
>>>>> would be the best way to stream video from the BBB to a PC over WiFi with 
>>>>> the lowest latency as I could get. This thread, including all the links 
>>>>> that users posted here, were really helpful in understand the steps I 
>>>>> should take.
>>>>>
>>>>> I'm just running to the store in a few minutes to buy a C920 and start 
>>>>> trying stuff :) I'm glad I've waited and read a lot before buying the PS3 
>>>>> Eye... Thanks guys. I will update any results I achieve.
>>>>>  
>>>>> -- 
>>>>> For more options, visit http://beagleboard.org/discuss
>>>>> --- 
>>>>> You received this message because you are subscribed to a topic in the 
>>>>> Google Groups "BeagleBoard" group.
>>>>> To unsubscribe from this topic, visit https://groups.google.com/d/
>>>>> topic/beagleboard/G5Xs2JuwD_4/unsubscribe.
>>>>>  To unsubscribe from this group and all its topics, send an email to 
>>>>> beagleboard...@googlegroups.com.
>>>>>
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>
>>>>  -- 
>>> For more options, visit http://beagleboard.org/discuss
>>> --- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "BeagleBoard" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/beagleboard/G5Xs2JuwD_4/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> beagleboard...@googlegroups.com <javascript:>.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  -- 
>> For more options, visit http://beagleboard.org/discuss
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "BeagleBoard" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/beagleboard/G5Xs2JuwD_4/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> beagleboard...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to