My camera is the Raspberry Pi NolR camera V2, and the camera is connected to the Raspberry Pi through the CSI interface.
I get the following error when I run the python code:
import cv2
cap = cv2.VideoCapture(10)
cap.set(3,1920)
cap.set(4,1080)
cap.release()
cv2.destroyAllWindows()
[ WARN:0] global /build/opencv/src/opencv-4.4.0/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ WARN:0] global /build/opencv/src/opencv-4.4.0/modules/videoio/src/cap_v4l.cpp (893) open VIDEOIO(V4L2:/dev/video10): can't open camera by index
The contents of my /dev directory are as follows:
autofs dri input loop7 null ram14 raw tty tty18 tty28 tty38 tty48 tty58 ttyprintk vcs3 vcsm-cma video10
block fb0 kmsg loop-control port ram15 rfkill tty0 tty19 tty29 tty39 tty49 tty59 uhid vcs4 vcsu video11
btrfs-control fd kvm mapper ppp ram2 rpivid-h264mem tty1 tty2 tty3 tty4 tty5 tty6 uinput vcs5 vcsu1 video12
bus full log media0 ptmx ram3 rpivid-hevcmem tty10 tty20 tty30 tty40 tty50 tty60 urandom vcs6 vcsu2 video13
cachefiles fuse loop0 media1 pts ram4 rpivid-intcmem tty11 tty21 tty31 tty41 tty51 tty61 v4l vcsa vcsu3 video14
char gpiochip0 loop1 mem ram0 ram5 rpivid-vp9mem tty12 tty22 tty32 tty42 tty52 tty62 vchiq vcsa1 vcsu4 video15
console gpiochip1 loop2 mmcblk0 ram1 ram6 shm tty13 tty23 tty33 tty43 tty53 tty63 vcio vcsa2 vcsu5 video16
cpu_dma_latency gpiomem loop3 mmcblk0p1 ram10 ram7 snd tty14 tty24 tty34 tty44 tty54 tty7 vc-mem vcsa3 vcsu6 watchdog
cuse hidraw0 loop4 mmcblk0p2 ram11 ram8 stderr tty15 tty25 tty35 tty45 tty55 tty8 vcs vcsa4 vga_arbiter watchdog0
disk hidraw1 loop5 mqueue ram12 ram9 stdin tty16 tty26 tty36 tty46 tty56 tty9 vcs1 vcsa5 vhci zero
dma_heap hwrng loop6 net ram13 random stdout tty17 tty27 tty37 tty47 tty57 ttyAMA0 vcs2 vcsa6 vhost-net zram0
What should I do to make the camera work properly?