Results 1 to 9 of 9

Thread: Raspberry Pi2 and USB Webcam

  1. Raspberry Pi2 and USB Webcam

    After making some modifications to the Darwin 1.6 code so that I could compile it on the Intel NUC system I have with Ubuntu Server 14.4 32 bit, I was able to compile everything and test the camera_vision. Everything worked flawlessly on that portion of it, crystal clear image and it was able to highlight all red objects for the tracking.

    Yesterday I just received a Raspberry Pi 2 and loaded it with Raspbian Wheezy. I installed all of the dependencies as I did with the NUC, plugged in the same exact USB camera into the raspberry Pi, built all of the modules with no issues and ran the same tests. When I looked at the video image from the raspberry pi as I did with the NUC, the image was dark and in fact, the system was outlining every object red.

    Both tests were in the same room, using the same camera with the same lighting. Has anyone else run into this issue? Could it be the Raspberry Pi 2 is underpowered? I read that some USB webcams had poor video quality when plugged into the Raspberry Pi and needed a powered USB hub so, I plugged one in, powered it up and plugged the webcam into the hub to get power from it. Same quality.

    I guess the next step would be to test the "native" webcam that they make for the Pi and plug it directly into the ribbon cable connector built into the board.

  2. #2

    Re: Raspberry Pi2 and USB Webcam

    Check the output voltage with a voltmeter.

    Also, maybe the USB webcam drivers are different, and treat white balance, shutter speed, and other things differently?

    I power my RPi and RPi 2 with a 5V input on the GPIO pins, and when I have a weak power supply, that does cause issues. A 2A supply is not just a suggestion, I'd say it's a requirement.

  3. Re: Raspberry Pi2 and USB Webcam

    Here's the latest: Not only was the color all off and everything being highlighted red but the image was upside-down. Rather than fool around with the Raspbian OS I switched over to using Ubuntu on the Pi2. I ran the Camera tutorial and the image was crystal clear and right side up. Awesome! I did the color test tutorial and... The image went right back to be dark and everything being highlighted red. I stopped the tutorial and went back to the camera one and the image went from being clear to back to being dark and all objects being highlighted red. I don't have these issues using the same camera and code base on my NUC. Hopefully when my Odroid-XU3 comes in I won't have the same issues.

    There is one more thing I just thought of to try. I do have a wireless keyboard dangle plugged into the Pi and remember reading somewhere some people having some weird issues with the USB on the Pi with one plugged in. I'll try taking that out tonight when I get home.
    Last edited by dmcman73; 03-23-2015 at 12:03 PM.

  4. #4

    Re: Raspberry Pi2 and USB Webcam

    That sounds like a data format issue, more than anything else.
    Are you enumerating and printing the video formats available?
    Which format are you actually getting?
    Do you try to force a particular format?

  5. #5
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,289
    Images
    27
    Rep Power
    276

    Re: Raspberry Pi2 and USB Webcam

    It sounds more like the auto-calibration is getting messed up and/or the example programs are loading bad values from the config.ini in each project folder (usually just contain the 'reset' value to trigger auto-calibration). If it is already available for your OS, then try testing the camera with guvcview. It should let you change all relevant image parameters to verify that it is not the camera, driver conflicts, and/or power issues.

    If you are getting errors with the camera code, you may need to add fix in '/Linux/build/LinuxCamera.cpp' where it somehow gets its buffer size messed up at line ~386. It happened after an upgrade, but cannot remember what it was that caused it or if it was only my systems.
    Code:
        for(int i = 0; i < fbuffer->m_YUVFrame->m_ImageSize; i++) 
        { 
            if (i >= buffers[buf.index].length)        // WTF!? Why break now? 
                break; 
     
            fbuffer->m_YUVFrame->m_ImageData[i] = ((unsigned char*)buffers[buf.index].start)[i]; 
        }
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh

  6. Re: Raspberry Pi2 and USB Webcam

    Thanks for the info tican.

    After doing a lot of research, it seems like I'm not the only one having issues with a USB camera attached to the Raspberry Pi. Other users have posted issues similar to mine with either weird artifacts, very poor video quality, etc. I tried using a powered USB as many have suggested (so that it's not drawing power from the Pi's USB ports) but that didn't work either.

    I know it's not the camera because it works great with the Intel NUC system I have.

    I may just leave the Pi alone and wait from my Odroid to come in and test with that as I am leaning more towards using the Odroid. I would use the NUC but, I don't think it would be wise if I am using the AX-12A servos since the NUC is a bit heavier and will need a bit more power.

  7. #7

    Re: Raspberry Pi2 and USB Webcam

    Yes, I have found the same issues, oddly enough if you compile the opencv and run facedetect or smiledetect, every thing runs correctly on the webcam.

  8. #8

    Re: Raspberry Pi2 and USB Webcam

    if you compile the opencv and run facedetect or smiledetect, every thing runs correctly
    What does that tell you about possible solutions, and about possible sources of the problem?

  9. #9

    Re: Raspberry Pi2 and USB Webcam

    Seems there is a bug in the code for web cams. Looks like they will fix it in next release. I see a fix out there just not tried it out myself yet.
    Digging around various forums I found the following links to information which may be of help:

    https://bugzilla.kernel.org/show_bug.cgi?id=81611
    https://bugs.launchpad.net/ubuntu/+sour ... ug/1362358
    http://www.mail-archive.com/linux-media ... 80158.html

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Raspberry Pi
    By Robonaut in forum Robot Computers
    Replies: 20
    Last Post: 07-07-2013, 11:46 AM
  2. About to give up on the Raspberry Pi
    By jwatte in forum Software and Programming
    Replies: 5
    Last Post: 01-14-2013, 11:57 AM
  3. Just For Fun My Raspberry PI
    By rebel in forum Arbotix, Microcontrollers, Arduino
    Replies: 0
    Last Post: 12-31-2012, 06:57 PM
  4. Question(s) how to see through my webcam from some place else?
    By animeunplugged in forum Software and Programming
    Replies: 2
    Last Post: 09-08-2010, 01:03 AM
  5. Just For Fun R2-D2 Wireless Webcam
    By trey3670 in forum Off Topic
    Replies: 0
    Last Post: 09-02-2008, 07:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •