@nb 您好,我遇到了类似的问题,请问一下您的解决方案就是将4.6的opencv更换成4.2的opencv吗?
W
Latest posts made by w88121446
-
RE: 获取图像的测试代码,依赖opencv4.2的动态库,测试可以正常出图,用opencv4.6的库出现cap.isOpened()返回false
-
RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死
@veye_xumm said in 移植MV-IMX265驱动程序到迅为RK3568抓图卡死:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=GRAY8,width=2048,height=1544 ! autovideosink
用您发的这个命令的话,我要把format=GRAY8改成format=NV12才能预览。
关于GStreamer 可能没有正确配置,导致 OpenCV 无法通过 GStreamer 打开视频设备。这个事情,我就查一查GStreamer的配置问题是吧!
-
RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死
@veye_xumm 可以使用下面这个命令拍照,图片正常
./yavta -c1 -Fy81-2048x1544.raw --skip 0 -f Y8 -s 2048x1544 /dev/video0
-
RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死
@veye_xumm 我使用您发给我的命令还是不能打开caramer,再次确认了是I2C-2没有错
-
RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死
@veye_xumm这样调用的
python3 v4l2dev_2_opencv_show_grey.py
-
RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死
@veye_xumm
我是这么写的,我的I2C用的I2C2,产品分辨率2048*1544import sys import argparse import subprocess import cv2 def read_cam(width, height, fps,i2c): v4l2_cmd = f'media-ctl -d /dev/media0 --set-v4l2 \'"m00_b_mvcam {i2c}-003b":0[fmt:Y8_1X8/{width}x{height}@1/{fps} field:none]\'' subprocess.run(v4l2_cmd, shell=True) cap = cv2.VideoCapture(f"v4l2src io-mode=dmabuf device=/dev/video0 ! video/x-raw, format=(string)GRAY8, width=(int){width}, height=(int){height} ! appsink") if cap.isOpened(): cv2.namedWindow("demo", cv2.WINDOW_AUTOSIZE) while True: ret_val, img = cap.read(); cv2.imshow('demo',img) cv2.waitKey(1) else: print ("camera open failed"); cv2.destroyAllWindows() if __name__ == '__main__': parser = argparse.ArgumentParser(description='Read camera video stream') parser.add_argument('--width', type=int, default=2048, help='width of the video stream') parser.add_argument('--height', type=int, default=1544, help='height of the video stream') parser.add_argument('--fps', type=int, default=30, help='fps of the video stream') parser.add_argument('--i2c', type=int, default=2, help='i2c bus number') args = parser.parse_args() read_cam(args.width, args.height, args.fps, args.i2c)
-
RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死
@veye_xumm /dev/video0确认存在的,用的下面这个PY脚本
import sys import argparse import subprocess import cv2 def read_cam(width, height, fps,i2c): v4l2_cmd = f'media-ctl -d /dev/media0 --set-v4l2 \'"m00_b_mvcam 2-003b":0[fmt:Y8_1X8/{width}x{height}@1/{fps} field:none]\'' subprocess.run(v4l2_cmd, shell=True) cap = cv2.VideoCapture(f"v4l2src io-mode=dmabuf device=/dev/video0 ! video/x-raw, format=(string)GRAY8, width=(int){width}, height=(int){height} ! appsink") if cap.isOpened(): cv2.namedWindow("demo", cv2.WINDOW_AUTOSIZE) while True: ret_val, img = cap.read(); cv2.imshow('demo',img) cv2.waitKey(1) else: print ("camera open failed"); cv2.destroyAllWindows() if __name__ == '__main__': parser = argparse.ArgumentParser(description='Read camera video stream') parser.add_argument('--width', type=int, default=1080, help='width of the video stream') parser.add_argument('--height', type=int, default=1080, help='height of the video stream') parser.add_argument('--fps', type=int, default=30, help='fps of the video stream') parser.add_argument('--i2c', type=int, default=7, help='i2c bus number') args = parser.parse_args() read_cam(args.width, args.height, args.fps, args.i2c)
报错如下
-
RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死
@veye_xumm 我用《v4l2dev_2_opencv_show_grey.py》这个文件,报错camera open failed.
麻烦指导一下