RoboCup-SSL / ssl-vision

Shared Vision System For The RoboCup Small Size League
GNU General Public License v3.0
93 stars 112 forks source link

Extended support for USB3 Vision #59

Closed bobismijnnaam closed 6 years ago

bobismijnnaam commented 8 years ago

Hi all,

I'm currently trying to get the TIS DFK 23UX174 to work nicely with SSL-Vision. I'm running into quite a lot of troubles, however. Sometimes I can get ssl-vision to display the camera image, but it's ofcourse all warped and purple/green because the camera's image is bayer encoded. I tried integrating the debayering code from the firewire capture code into V4L, but now I get segfaults every time (at bool GlobalV4Linstance::getImageRgb(GlobalV4Linstance::yuyv *pSrc, int width, int height, GlobalV4Linstance::rgb **rgbbuf), line 531) I try to show the camera in SSL-Vision so that's not really working out. I'm not sure if this is entirely SSL-Vision's fault because the camera's example programs are not working great either, but ssl-vision does not seems to support cameras like these well enough.

So are there any plans to "extend" usb camera support a bit? Or will it remain a gimmick feature for testing with webcams only? Or are there maybe USB cameras that are known to work well with SSL-Vision?

andre-ryll commented 8 years ago

Hi Bob, I recently integrated Matrix-Vision BlueFox2 cameras into the vision. These are USB2.0 cameras. They have their own linux driver which is quite fast and well documented. Thereby, I could circumvent the messy V4L image path. I think V4L is fine for webcams but for industrial cameras you should check if there is a specialized driver. Such drivers usually also allow you to fully control the camera and parameters. You may checkout my code for the BlueFox2 here. Cheers, Andre

Bluearrow commented 8 years ago

@asctec-andre Hi Andre, I'm seeking to replace AVT cameras with USB cameras too. Can BlueFox2 cameras capture images in SSL-Vision as good as AVT Stringray cameras do? It seems only MLC200w has max frame rate more than 60fps. By the way, which lens do you use with BlueFox2?

andre-ryll commented 8 years ago

From a performance and price point of view the BlueFox2 cameras are great. Nevertheless, they are smaller than the Stingray. The Stingray has a larger image chip and larger optics which results in better light sensitivity. You need good lighting to push the BlueFox beyond 60fps. I use this lens on my BlueFox2: http://www.lensation.de/product/BT3620C/ My camera is mounted at 2.5m height and covers an area of approx. 3.4x2.2m. If you mount them at 4m this lens should be good: http://www.lensation.de/product/BT6020V2/ (not tested).

I am very happy with the BlueFox and with the AOI feature you can crop the image and even go beyond 100fps. Anyway, you should not get used to this frame rate. Competition frame rate is usually around 60fps. My subjective opinion is that the BlueFox is great and detection of robots/balls works as fine as with the Stingray. I did not find any point where the BlueFox is inferior to the Stingray.

Bluearrow commented 8 years ago

@asctec-andre Hi Andre, This combination seems to be awesome. Thank you very much for your information! Did you measure the illumination BlueFox2+BT360C need to reach 60fps? Is 1000 lux enough?

andre-ryll commented 8 years ago

I don't have equipment to measure the illumination. I am using four fluorescent tubes (T8, 1200mm, 36W) on the above mentioned area. If my quick calculation is correct that should actually be around 1000 lux. I can set my exposure time to 5ms with that setup, so getting beyond 60fps is no problem.

g3force commented 6 years ago

For completeness: I added a section about the recommended hardware for BlueFox to the wiki: https://github.com/RoboCup-SSL/ssl-vision/wiki/requirements