Can't open OS08A10 MIPI camera by OpenCV

Dear team,

Which Khadas SBC do you use?

VIM3 Basic

Which system do you use? Android, Ubuntu, OOWOW or others?\


Which version of system do you use? Khadas official images, self built images, or others?


Please describe your issue below:

I try to open the MIPI camera using opencv on VIM3: $python3, but I always get this error:
[ WARN:0] global …/modules/videoio/src/cap_v4l.cpp (887) open VIDEOIO(V4L2:/dev/video0): can’t open camera by index

I followed the example and we can use v4l2_test and guvcview to open the camera. I see this solution in our community: $sudo apt remove opencv3, $pip3 uninstall opencv-python, $sudo apt update, $sudo apt install libopencv-dev python3-opencv. But it doesn’t work.

Do you have any information about OpenCV support for the mipi camera?
@Frank @numbqq

I found this problem too.

@Jirat_Srisabye @JJ1997 It work for me.

  1. Burn with 220725 Ubuntu Image.
  2. Update & upgrade your system.
$ sudo apt update && sudo apt upgrade
  1. Install OpenCV.
sudo apt install libopencv-dev python3-opencv
  1. Test

Are you sure your camera is connected correctly?

Thanks for your reply @Frank.
I reconfigured a new VIM3 board following your steps and it works.
But after installing ksnn, the error of " can’t open camera by index" reproduced, because ksnn requires opencv-python== and it install it automatically. And I can’t find the same version opencv 4.2.0 in pip. How I can use the MIPI camera with KSNN ?

And here are the versions of opencv-python in python:
Could not find a version that satisfies the requirement opencv-python==4.2.0 (from versions:,,,,,,,,,,,,,,,,,,,,,,,,,,

I found this works for me but not very smart. I can create a virtual python environment and remove opencv-python== after installing ksnn:

python3.8 -m venv --system-site-packages venv
source venv/bin/activate
pip install ksnn-1.3-py3-none-any.whl
pip uninstall opencv-python==