Hummingboard Pro USB Webcam Opencv Trouble

This forum is for supported devices using an ARMv7 Freescale SoC.

Hummingboard Pro USB Webcam Opencv Trouble

Postby scales11 » Fri Aug 05, 2016 7:31 pm

Hi all. I am having a hard time getting the following "test" code(python) from opencv to run on the hummingboard under archarm. The funny thing is that it worked absolutely fine under debian with the same exact hardware. Does anyone have any ideas?

I did try modprobe uvcvideo with the modprobe.d uvcvideo.conf comments noted in the archwiki (webcam setup) but that did not help.

Code:
$this->bbcode_second_pass_code('', 'import numpy as np
import cv2

cap = cv2.VideoCapture(0)

while(True):
# Capture frame-by-frame
ret, frame = cap.read()

# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

# Display the resulting frame
cv2.imshow('frame',gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()')

Output:
$this->bbcode_second_pass_code('', '[alarm@alarm ~]$ python nf-test1.py | cat > post3.txt
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file
/build/opencv/src/opencv-3.1.0/modules/imgproc/src/color.cpp, line 8000
Traceback (most recent call last):
File "nf-test1.py", line 16, in <module>
gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
cv2.error:
/build/opencv/src/opencv-3.1.0/modules/imgproc/src/color.cpp:8000:
error: (-215) scn == 3 || scn == 4 in function cvtColor')

A few other things that may help troubleshoot:

lsmod:
$this->bbcode_second_pass_code('', '[alarm@alarm ~]$ lsmod
Module Size Used by
snd_usb_audio 131522 0
uvcvideo 77538 0
snd_usbmidi_lib 25370 1 snd_usb_audio
snd_rawmidi 27311 1 snd_usbmidi_lib
videobuf2_vmalloc 13211 1 uvcvideo
videobuf2_memops 13365 1 videobuf2_vmalloc
joydev 17772 0
caam_jr 24418 0
spidev 13626 0
caam 18015 0
galcore 220615 0
ir_mce_kbd_decoder 12990 0
ir_sanyo_decoder 12702 0
gpio_ir_recv 13139 0
sch_fq_codel 17646 2
ir_sony_decoder 12699 0
ir_rc6_decoder 12696 0
ir_rc5_sz_decoder 12705 0
ir_rc5_decoder 12696 0
ir_nec_decoder 12696 0
ir_jvc_decoder 12696 0
ir_lirc_codec 13150 0
lirc_dev 20297 1 ir_lirc_codec')

dmesg(snippit):
$this->bbcode_second_pass_code('', '[ 14.834893] imx-ipuv3 2400000.ipu: WARNING: adapt panel end blank
lines
[ 15.027176] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full
[ 17.193019] imx-ipuv3 2400000.ipu: WARNING: adapt panel end blank
lines
[ 18.217873] mxc_hdmi 20e0000.hdmi_video: same edid
[ 18.222770] mxc_hdmi 20e0000.hdmi_video: mxc_hdmi_cable_connected
reports DVI mode
[ 39.456255] usb 2-1.1: new high-speed USB device number 3 using
ci_hdrc
[ 40.641630] usb 2-1.1: New USB device found, idVendor=046d,
idProduct=082d
[ 40.648675] usb 2-1.1: New USB device strings: Mfr=0, Product=2,
SerialNumber=1
[ 40.656094] usb 2-1.1: Product: HD Pro Webcam C920
[ 40.660966] usb 2-1.1: SerialNumber: 6973DB1F
[ 40.714406] uvcvideo: Found UVC 1.00 device HD Pro Webcam C920
(046d:082d)
[ 40.723719] input: HD Pro Webcam C920 as
/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb2/2-1/2-1.1/2-1.1:1.0/input/input5
[ 40.736582] usbcore: registered new interface driver uvcvideo
[ 40.742395] USB Video Class driver (1.1.1)
[ 40.927619] usbcore: registered new interface driver snd-usb-audio')

lsusb:
$this->bbcode_second_pass_code('', '[alarm@alarm ~]$ lsusb
Bus 002 Device 003: ID 046d:082d Logitech, Inc. HD Pro Webcam C920
Bus 002 Device 002: ID 04b4:6570 Cypress Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 045e:0745 Microsoft Corp. Nano Transceiver v1.0
for Bluetooth
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub')
scales11
 
Posts: 6
Joined: Thu Feb 14, 2013 4:33 pm

Return to Freescale

Who is online

Users browsing this forum: No registered users and 9 guests