oCam-1CGN-U and OpenCV

Moderators: mdrjr, odroid

oCam-1CGN-U and OpenCV

Unread postby JonathanG » Thu Oct 26, 2017 5:29 am

I needed a high frame rate high resolution (e.g, 50FPS, 720p) camera where I could control the white balance well. I want to use it for object tracking of a fast moving object using OpenCV in C++ (or Python). I bought the 1CGN-U without realizing that the Color output on the 1CGN-U is Bayer GRBG. If I understand things correctly, that’s not a format recognized by OpenCV so I can’t read the video from the camera using OpenCV’s imread() method. Is there any way to read a video file from the camera using OpenCV? Thanks.
JonathanG
 
Posts: 3
Joined: Thu Oct 26, 2017 5:21 am
languages_spoken: english
ODROIDs: XU4
oCam CGN-U

Re: oCam-1CGN-U and OpenCV

Unread postby WITHROBOT » Thu Oct 26, 2017 11:20 am

For a sample code in Python, you may want to review this thread.

viewtopic.php?f=119&t=25360
WITHROBOT
 
Posts: 105
Joined: Mon Mar 14, 2016 1:54 pm
languages_spoken: english
ODROIDs: Odroid-C2

Re: oCam-1CGN-U and OpenCV

Unread postby JonathanG » Thu Oct 26, 2017 12:24 pm

Thanks for the link. I will take a look at it tomorrow. But, I would very much prefer to use C++. Is there no solution for that?

Assuming I have no problem with a rolling shutter for my application, I assume I could buy an oCam : 5MP USB 3.0 Camera and it would allow me 1280x720@45fps and I could use imread() with no issue. Am I missing anything other than the global v rolling shutter that I should think about? Thank you!
JonathanG
 
Posts: 3
Joined: Thu Oct 26, 2017 5:21 am
languages_spoken: english
ODROIDs: XU4
oCam CGN-U

Re: oCam-1CGN-U and OpenCV

Unread postby WITHROBOT » Thu Oct 26, 2017 1:52 pm

Yes, it seems the only significant difference between them for you is the type of shutters.

Also, please find attached a sample code in C++ for oCam-1CGN-U running on Linux.
Attachments
opencv-basic_1CGN.tar.gz
(17.1 KiB) Downloaded 20 times
WITHROBOT
 
Posts: 105
Joined: Mon Mar 14, 2016 1:54 pm
languages_spoken: english
ODROIDs: Odroid-C2

Re: oCam-1CGN-U and OpenCV

Unread postby JonathanG » Wed Nov 01, 2017 12:49 am

Thank you for the sample code. That is super helpful. Stepping back from my immediate question for a moment, since you are with Withrobot and are familiar with vision systems for robots, I'd love to ask you a question regarding camera and software selection. I am building a differential drive robot that will chase one or two rolling tennis balls. It may be two balls that are different colors. They could be rolling quickly and the balls will be as far as 2-3 meters away from the robot. I am wondering what (i) camera, (ii) pixel format and (iii) computer vision software could handle that. I want a low latency solution to prevent the robot from oscillating as it follows the ball. I know C++ well and have gotten pretty far with OpenCV. Python and MatLab shouldn't be a problem, but the rest of the application is in C++, so some work would be involved in switching. I know nothing about ROS but can try it out if it will be materially advantageous (over other options) to do so. So given all of that, I have two questions please: 1) what camera, pixel format and computer vision software do you think would definitely work for this? (If I can get by with OpenCV in Python or C++, that would definitely be my preference) and 2) will an Odroid XU4 work for this specific application or will I need something more robust? Thanks so much!
JonathanG
 
Posts: 3
Joined: Thu Oct 26, 2017 5:21 am
languages_spoken: english
ODROIDs: XU4
oCam CGN-U


Return to oCAM USB 3.0 Camera

Who is online

Users browsing this forum: No registered users and 1 guest