My team is trying to use our Microsoft Lifecam USB camera with our Raspberry Pi 3. We’ve been able to plug it into the Raspberry Pi and run mjpg-streamer with it, but every few seconds the stream will freeze for short periods of time. Is there a way to stop the camera from freezing?
The Microsoft Lifecam 3000 and VX-6000 have some registers buried in the USB layer implementation that cause them to have white balance issues that reduce the frame rate. The OmniVision CMOS sensor they use is high end but you do not talk directly to it. It usually appears as dropped content when light sources or reflections move in the image during video analysis but it happens as well when used as a webcam (the image shudders because of the reduced capture rate).
Added to this, if you put those camera on Windows with the Microsoft driver you will get slightly better results than the generic Linux drivers via V4L and GSPCA/UVA. This again is because Microsoft has not been forthcoming with the required information as I have contacted the relevant package maintainer in the past but it would help if Microsoft could provide direction on what they did.
The retroreflective tape works best with IR light sources. If you use an IR light source and turn down the sensitivity to visible light it sticks out like a sore thumb and the sunglass tint helps reduce the visible light even more because you can not adjust the registers.
If you had say a Logitech C930 you’d get good drivers on Linux and Windows and I know they operate correctly with GRIP, V4L directly and OpenCV. It works on all embedded boards I have tried: Kangaroo, ODroid, Raspberry PI and the BeagleBone. I see no reason it would not work on the NVidia boards. It definitely works on the RoboRIO. Of course in Linux be sure to install the relevant sources/packages. With the Logitech C930 no sunglasses are required.
There are a number of detailed posts on this subject if you search the forums. I contributed to several in the past.
I will also mention if you want a lot of frames, but less resolution, you might consider the Playstation 3 Eye USB camera. It is still available used at GameStop.
The PS3Eye reduces the color depth and resolution to 640x480, still has sensitivity in the IR range, but can fully flood a USB2 port to 100+ frames a second. This makes it ideal for capturing quick movements (like a ball in the air) with good close range and degrading distance accuracy. There are good propreitary Windows drivers that support multiple cameras at the same time and recognition. There are adequate Linux drivers through V4L and GSPCA, but getting GSPCA on your Linux platform for some embedded platforms requires source/packages. It works fine on the Kangaroo, ODroid, BeagleBones and Raspberry Pis. I hear it works on the NVidia embedded platforms. I know if you get the GSPCA stuff on the RoboRio it works with a reduced frame rate.
In the past FRC11 considered mixing a 1080p webcam and PS3Eye to do certain tasks. The PS3Eye being good to track projectiles and the Logitech webcam being used to line up on fixed targets and avoid some collisions. Keep in mind we were using a full laptop on the robot at the time stripped down to just the base and at less than the $400 cost requirement, so we had multiple USB2 ports and 2 CPU cores. Could also be done with multiple co-processors.
At the moment I know of no other cheap webcam that can achieve this framerate. There are more expensive (> $120) options but remember it is on the robot in harms way.
For how long is the camera image freezing for? Is it possible you’re getting a USB disconnect (in software) and having to restart the camera session? Do you have any fault reporting to tell you what the camera/Pi is doing during this time?
The camera freezes for about 5 seconds before the stream resumes. Also, I don’t think it is disconnecting because the pi always reports that it is connected when the stream freezes. Would it be possible to connect it to the RIO, send the data to the pi, and have that kind of a back-and-forth connection?
Well, if you mean stream the video from the RoboRio to the Raspberry Pi that would involve still running a stream on the RoboRio. I suppose that is better than sending the steam over the WiFi as you don’t get all the inherited field bandwidth limits and the like.
Still - is the cost of a more compatible camera for the Raspberry Pi a big thing?
Cause it would seem easier (time has a cost) to get you a camera that works than dig into this design.
Could you try a different webcam for some testing and see if your situation improves?