A few years ago, tried to run face detection on BBB. This time trying it on the more powerful UDOO platform. Some minor code changes:
- Move from Python module cv to cv2
- OpenCV 3.x
My UDOO is running Arch Linux with kernel 4.9. Note that the libGL included in "imx-gpu-viv-fb" doesn't work properly with OpenCV. Switching to "mesa-libgl" solved the issue.
$ sudo pacman -Sy mesa-libgl opencv python2-numpy
A Logitech C200 USB web camera is plugged in and detected automatically.
Bus 001 Device 003: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 004: ID 046d:0802 Logitech, Inc. Webcam C200
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ lsusb -s 001:004 -v | egrep "Width|Height"
Couldn't open device, some information will be missing
The camera supports maximum resolution of 640x480. But reducing the capture to 320x240 (line 9-10) produces a smoother video on UDOO.
The refresh rate is approximately 30fps. Change the waitKey parameter (line 58) to adjust it.