Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc
    1. Home
    2. w88121446
    3. Posts
    W
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 22
    • Best 0
    • Groups 0

    Posts made by w88121446

    • RE: 获取图像的测试代码,依赖opencv4.2的动态库,测试可以正常出图,用opencv4.6的库出现cap.isOpened()返回false

      @nb 您好,我遇到了类似的问题,请问一下您的解决方案就是将4.6的opencv更换成4.2的opencv吗?

      posted in Machine Vision camera
      W
      w88121446
    • 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的配置问题是吧!

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 可以使用下面这个命令拍照,图片正常

      ./yavta -c1 -Fy81-2048x1544.raw --skip 0 -f Y8 -s 2048x1544 /dev/video0
      
      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 我使用您发给我的命令还是不能打开caramer,再次确认了是I2C-2没有错
      8edbc1da-117c-40ac-b30b-685045e7dc65-image.png

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm这样调用的

      python3 v4l2dev_2_opencv_show_grey.py

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm
      我是这么写的,我的I2C用的I2C2,产品分辨率2048*1544

      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 {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)
      
      posted in VEYE MIPI camera
      W
      w88121446
    • 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)
      

      报错如下
      23ca28c19180d09616cfb3508239726.jpg

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 我用《v4l2dev_2_opencv_show_grey.py》这个文件,报错camera open failed.
      麻烦指导一下

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 用C++调用OPENCV也可以预览到正常的图像把。

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 好的,感谢您的帮助。

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 暂时没有python环境,我尝试使用gstreamer里的脚本预览
      设置成这样:media-ctl -d /dev/media0 --set-v4l2 '"m00_b_mvcam 2-003b":0[fmt:Y8_1X8/2048x1544@1/30]'
      然后再预览:gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! queue ! video/x-raw,format=NV12,width=2048,height=1544,framerate=30/1 ! glimagesink
      出来的图颜色不对,有时绿有时粉,方向也不时我想要的,该如何旋转。

      如果设置成这样:media-ctl -d /dev/media0 --set-v4l2 '"m00_b_mvcam 2-003b":0[fmt:UYVY8_2X8/2048x1544@1/30]'
      然后再预览:gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! queue ! video/x-raw,format=NV12,width=2048,height=1544,framerate=30/1 ! glimagesink
      不出图。

      麻烦您指导一下,我的模块是MV-IMX265

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 图像可以采集出来了,想实时预览的话有什么办法吗?

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 您好,我现在在5.10的内核中可以正确发现MV-IMX265了。目前遇到两个问题
      1.是发送《v4l2-ctl -L》
      回复如下图,不回复FPS等信息了
      4c3f0dd1-de83-4ec7-a8f0-68d28ca64862-image.png

      2.是发送《v4l2-ctl --set-ctrl frame_rate=10》设置帧率是会报错
      30822052-67c6-4d50-abce-11a30a1029ae-image.png

      请您指点一下

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 我先弄个5.10试试,不过对我这边很麻烦,还关系到其他同事。4.19还有抢救的希望吗?

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm
      1.我给3568接了鼠标和键盘,调用操作系统的终端dmesg,未发现报错,打印信息和串口卡住之前的一样。
      我看了一下mipi_clk信号,频率是740MHZ,峰峰值只有26mv左右。这个会不会有问题,我的OV5695的mipi_clk峰峰值大概有46mv。

      2.关于link_freq和pixel_freq我有一个疑问
      我的0v2710:OV2710_PIXEL_RATE=80 M
      OV2710_LINK_FREQ=400M
      我的ov5695:OV5695_PIXEL_RATE=180M
      OV5695_LINK_FREQ=420M
      这俩都满足这个公式
      pixel_rate = link_freq * 2 * lanes / bits_per_pixel

      mv-imx265的驱动中:MV_CAM_PIXEL_RATE=750M
      MVCAM_DEFAULT_LINK_FREQ =742.5M
      明显是不满足公式
      pixel_rate=link_freq * 2 * lanes / bits_per_pixel

      在这里有没有可能有问题?

      afdb161a38c4eefe53b98b25c288c6f.jpg=

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm
      运行取图指令卡死,串口不能和RK3568通讯了。但是屏幕那边是正常的,可以正常触屏以及打开文件等操作,证明3568没有死机。
      供电方面,3568的12V和265的5V我用线性电源供电的,电压显示正常。
      抓图命令后,MIPI有信号了,5V那边电流会变成0.21A左右。
      目前来看,只要MIPI有信号,串口那边就会卡住,就不能和3568通讯了。
      344fdc810ed8685d093a41d5defe041.jpg

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 硬件原理图检查出过了,可以对的上。用示波器也可以看到MIPI信号。

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      设备数按照这个写的

      &csi2_dphy0 {
      	status = "okay";
      
      	ports {
      		#address-cells = <1>;
      		#size-cells = <0>;
      		port@0 {
      			reg = <0>;
      			#address-cells = <1>;
      			#size-cells = <0>;
      
      			mipi_in_ucam3: endpoint@4 {
      				reg = <4>;
      				remote-endpoint = <&mvcam_out>;
      				data-lanes = <1 2>;
      			};
      		};
      		port@1 {
      			reg = <1>;
      			#address-cells = <1>;
      			#size-cells = <0>;
      
      			csidphy_out: endpoint@0 {
      				reg = <0>;
      				remote-endpoint = <&isp0_in>;
      			};
      		};
      	};
      };
      
      &csi2_dphy1 {
      	status = "disabled";
      };
      
      &csi2_dphy2 {
      	status = "disabled";
      };
      
      &rkisp_vir0 {
      	status = "okay";
      
      	port {
      		#address-cells = <1>;
      		#size-cells = <0>;
      
      		isp0_in: endpoint@0 {
      			reg = <0>;
      			remote-endpoint = <&csidphy_out>;
      		};
      	};
      };
      
      &rkisp_vir1 {
      	status = "disabled";
      };
      
      &i2c4 {
      	status = "okay";
      	clock-frequency = <400000>;
      
      	mvcam: mvcam@3b{
              status = "okay";
              compatible = "veye,mvcam";
              reg = <0x3b>;
              clocks = <&cru CLK_CIF_OUT>;
              clock-names = "xvclk";
              //avdd-supply = <&vcc_mipi>;
              power-domains = <&power RK3568_PD_VI>;
              pinctrl-names = "default";
              pinctrl-0 = <&cif_clk>;
      
              //power-gpios = <&pca9555 PCA_IO0_4 GPIO_ACTIVE_HIGH>;
              reset-gpios = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>;
              pwdn-gpios = <&gpio4 RK_PB7 GPIO_ACTIVE_HIGH>;
      
              firefly,clkout-enabled-index = <0>;
              rockchip,camera-module-index = <0>;
              rockchip,camera-module-facing = "back";
              rockchip,camera-module-name = "NC";
              rockchip,camera-module-lens-name = "NC";
              port {
      			mvcam_out: endpoint {
      				remote-endpoint = <&mipi_in_ucam3>;
                      data-lanes = <1 2>;
                  };
              };
          };
      };
      
      
      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 卡死在这里了,输入命令不管用,dmesg也不行,看不了。

      posted in VEYE MIPI camera
      W
      w88121446
    • RE: 移植MV-IMX265驱动程序到迅为RK3568抓图卡死

      @veye_xumm 上面不支持GREY的问题我解决了,因为我用的4.19内核,是用不到/cif/capture.c的,而是需要在/isp/capture.c和/isp1/capture.c中增加对Y8 Y10 Y12的支持。
      接下来我发送命令《v4l2-ctl --set-fmt-video=width=2048,height=1544,pixelformat=GREY》配置尺寸和色彩格式,然后发送《./yavta -c1 -Fy8-2048x1544.raw --skip 0 -f Y8 -s 2048x1544 /dev/video0》。
      接下来如下图,想显示一些内存相关信息,然后会卡死在这里,ctrl+c也不管用。
      c5489a4d-96a8-4c1f-beeb-5fa88171c134-image.png
      重启后我是用命令《find / -name "y8-2048x1544.raw" 2>/dev/null》搜索.raw文件搜不到,表明没有成功抓图。
      希望大神帮忙解决一下。

      posted in VEYE MIPI camera
      W
      w88121446