Noobs Raspberry Pi not working with example Python/ OpenCV CV2 Error

  1. Where did you get the camera module(s)? Amazon

  2. Model number of the product(s)? Arducam 1MP OV9281, SKU: UB0232

  3. What hardware/platform were you working on? Raspberry Pi

  4. Instructions you have followed. (link/manual/etc.)
    UVC Cameras on Linux - Command Line Operations - Arducam

and

  1. Problems you were having?
    Open CV issues
  2. The dmesg log from your hardware?
    ***@raspberrypi:~ $ dmesg
    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 5.15.61-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1579 SMP Fri Aug 26 11:10:59 BST 2022
    [ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
    [ 0.000000] CPU: div instructions available: patching division code
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] OF: fdt: Machine model: Raspberry Pi 3 Model B Rev 1.2

    18.720203] Bluetooth: RFCOMM socket layer initialized
    [ 18.720247] Bluetooth: RFCOMM ver 1.11
    [ 30.478830] logitech-hidpp-device 0003:046D:1025.0006: HID++ 1.0 device connected.
    [ 33.111983] cam-dummy-reg: disabling
    [ 434.807947] usb 1-1.4: USB disconnect, device number 6
    [ 437.154660] usb 1-1.4: new high-speed USB device number 8 using dwc_otg
    [ 437.301007] usb 1-1.4: New USB device found, idVendor=0c45, idProduct=6366, bcdDevice= 1.00
    [ 437.301059] usb 1-1.4: New USB device strings: Mfr=2, Product=1, SerialNumber=3
    [ 437.301081] usb 1-1.4: Product: Arducam OV9281 USB Camera
    [ 437.301098] usb 1-1.4: Manufacturer: Arducam Technology Co., Ltd.
    [ 437.301115] usb 1-1.4: SerialNumber: UC762
    [ 437.306517] usb 1-1.4: Found UVC 1.00 device Arducam OV9281 USB Camera (0c45:6366)
    [ 437.335276] input: Arducam OV9281 USB Camera: Ardu as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/input/input18

***@raspberrypi:~$

  1. Troubleshooting attempts you’ve made?
    Solved-
  2. What help do you need?
    No help- just providing feedback to maybe help someone else.

New NOOBS install on RPi on 11/1/2022

did sudo install of v4l utility as described at:
UVC Cameras on Linux - Command Line Operations - Arducam

Plugged in Arducam UVC Cam OVC9281 into USB port

Verified the camera shows up in listed devices and detailed informaiton as described in the above page (video0)

Followed directions at:

to install openCV (CV2) libraries, i.e. in terminal:
$ pip install OpenCV-python

Copied simple python program from above web page into Thonny IDE and ran the code-
Get error-

%Run ArducamTest.py
Traceback (most recent call last):
File “/home/pi/PythonPrograms/ArducamTest.py”, line 1, in
import cv2
File “/home/pi/.local/lib/python3.9/site-packages/cv2/init.py”, line 181, in
bootstrap()
File “/home/pi/.local/lib/python3.9/site-packages/cv2/init.py”, line 153, in bootstrap
native_module = importlib.import_module(“cv2”)
File “/usr/lib/python3.9/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libcblas.so.3: cannot open shared object file: No such file or directory

Did some websearching… Need to install couple other items from terminal:
$ sudo apt-get install libjasper-dev
$ sudo apt-get install libatlas-base-dev

Again ran the ArducamTest.py code, progressed further, but get new error related to numpy:

RuntimeError: module compiled against API version 0xf but this version of numpy is 0xd
Traceback (most recent call last):
File “/home/pi/PythonPrograms/ArducamTest.py”, line 2, in
import cv2
File “/home/pi/.local/lib/python3.9/site-packages/cv2/init.py”, line 181, in
bootstrap()
File “/home/pi/.local/lib/python3.9/site-packages/cv2/init.py”, line 153, in bootstrap
native_module = importlib.import_module(“cv2”)
File “/usr/lib/python3.9/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: numpy.core.multiarray failed to import

So did update of Numpy library:
$ sudo pip3 install numpy --upgrade

Running the Python code now works!

The program runs OK (With washed out/too bright image) but generally fine.

Hope this can save someone some time.