Using UDOO camera with OpenCV's VideoCapture class

Discussion in 'General Programming Discussion' started by toussa, Sep 1, 2014.

  1. toussa

    toussa New Member

    Joined:
    Aug 29, 2014
    Messages:
    4
    Likes Received:
    0
    Hello everyone,

    I tried (since last week) to use VideoCapture class of OpenCV (version 2.4.8) in order to read the stream of the UDOO Camera, with no success.

    I'm using UDOObuntu, last version.

    I know there is a trick with the gstream loopback, but I do'nt understand the point.

    So, my question: How to read from UDOO camera with VideoCapture?

    For information, I tried my code with an USB camera with no problems.

    Code with USB camera (working properly) set on /dev/video3
    Code:
     Mat frame;
    VideoCapture capture(3);
    if(!capture)
      return -1;
    capture >> frame;
    cv::namedWindow("test");
    imshow("test", frame);
    
    I tried to replace capture(3) by capture(0) or even capture(7) but here are the errors:

    for capture(0), I get:
    and for capture(7):
    I also tried a lot of other things by despair,like using gstreamer with appsink directly in the VideoCapture constructor (I followed this answer:http://stackoverflow.com/a/23795492 ):
    Code:
    VideoCapture capture("mfw_v4lsrc ! ffmpegcolorspace ! video/x-raw-rgb ! appsink"); 
    Or using a named pipe as suggested here: http://stackoverflow.com/a/7084081 (option3)

    What do I do wrong ?

    I know it may be possible to do it using other class instead of VideoCapture, but it's not the point.

    Thanks for your help
     
  2. extream96

    extream96 New Member

    Joined:
    Jun 27, 2014
    Messages:
    48
    Likes Received:
    0
    Hi,
    I have the same problem, i'm trying to find a solution. Gstream is a solution, but it has some problems with arm.
     
  3. toussa

    toussa New Member

    Joined:
    Aug 29, 2014
    Messages:
    4
    Likes Received:
    0
    Hello,
    did you find a solution ?

    I am still looking for any way to do it by VideoCapture, even if it includes Gstreamer pipeline..

    What do you mean by "some problems with arm" ?
     
  4. mikelangeloz

    mikelangeloz Member

    Joined:
    Jul 9, 2013
    Messages:
    129
    Likes Received:
    1
    Using a loopback device is the only way you can access the camera on /dev/video7. So, just activate the camera driver with UDOO Configuration Tool (it just creates the loopback device on video7 at startup). Then configure your script accordingly...
     
  5. toussa

    toussa New Member

    Joined:
    Aug 29, 2014
    Messages:
    4
    Likes Received:
    0
    Hello mikelangeloz,

    I already enabled the camera video driver with Udoo Configuration Tool.
    Even with the loopback device, I get the following error:

    And I'm still incapable of doing anything with the VideoCapture class... :cry:
     
  6. extream96

    extream96 New Member

    Joined:
    Jun 27, 2014
    Messages:
    48
    Likes Received:
    0
    Hi, sorry i'm late!
    I tolked with udoo team! and there is a solution!
    In the new udoo realise, there is a udoo configuration tool, starts it, and select enable UDOO Camera Module.
    Now you can use udoo camera with openCV!

    try and tell my!
     
  7. pmjorge

    pmjorge New Member

    Joined:
    Jan 22, 2015
    Messages:
    1
    Likes Received:
    0
    Hello
    I'm new with UDOO and I'm trying to acquire frames from the UDOO camera from python programs with opencv and I’m facing this problem. I already use the ‘udoo configuration tool’ to activate the UDOO camera and it is working with ‘gst-launch-0.10 mfw_v4lsrc ! …’ commands.
    Has anyone already solved this issue?
    Thank you for feedbacks.
    pmjorge
     
  8. Uriel

    Uriel New Member

    Joined:
    Sep 20, 2015
    Messages:
    1
    Likes Received:
    0
    I solved the problem only writing in the instruction "cap=cv2.VideoCapture()" the number 7 like this cap=cv2.VideoCapture(7)
     

Share This Page