Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc
    1. Home
    2. sjchen
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 8
    • Best 0
    • Groups 0

    sjchen

    @sjchen

    0
    Reputation
    2
    Profile views
    8
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Email 40644936@qq.com

    sjchen Follow

    Latest posts made by sjchen

    • 树莓派CM4+CS-MIPI-SC132 x2 运行python opencv报错

      由于CS-MIPI-SC132最大支持1280x1080,故修改capture2opencv脚本如下:

      import D_mipicamera as Dcam
      import time
      import cv2 #sudo apt-get install python-opencv
      
      def align_down(size, align):
          return (size & ~((align)-1))
      
      def align_up(size, align):
          return align_down(size + align - 1, align)
      
      if __name__ == "__main__":
          try:
              camera = Dcam.mipi_camera()
              print("Open camera...")
              camera.init_camera()
              while cv2.waitKey(10) != 27:
                  frame = camera.capture(encoding = 'i420')
                  height = int(align_up(1080, 16))
                  width = int(align_up(1280, 32)) #修改了分辨率
                  image = frame.as_array.reshape(int(height * 1.5), width)
                  image = cv2.cvtColor(image, cv2.COLOR_YUV2BGR_I420)
                  cv2.imshow("D-Cam", image)
                  # Release memory
                  camera.release_buffer(frame)
                  del frame
              
              print("Close camera...")
              camera.close_camera()
          except Exception as e:
              print(e)
      

      运行后报错:QQ截图20211217141752.jpg

      posted in VEYE MIPI camera
      S
      sjchen
    • RE: 树莓派CM4+imx327S MIPI x2 运行python opencv脚本如何达到30fps

      @veye_xumm 谢谢回复。我看到里面有一个python 的封装叫“start_yuv_stream”,但是没有demo可参考。能否给一个简单的example说明回调函数func有哪些参数,另外userdata参数具体是什么?我要怎样使用?
      谢谢!

      posted in VEYE MIPI camera
      S
      sjchen
    • 树莓派CM4+imx327S MIPI x2 运行python opencv脚本如何达到30fps

      树莓派CM4+imx327S MIPI x2,使用如下脚本测试帧率只有13.4FPS,如何提高到30FPS?谢谢

      import D_mipicamera as Dcam
      import cv2
      import time
      
      frame_width = 1920
      frame_length = 1080
      
      def align_down(size, align):
          return (size & ~((align)-1))
      
      def align_up(size, align):
          return align_down(size + align - 1, align)
      
      camera_L = Dcam.mipi_camera()
      camera_R = Dcam.mipi_camera()
      print("Open camera 0...\n")
      camera_L.init_camera((0,0,(0,0),(0,0)))
      print("Open camera 1...\n")
      camera_R.init_camera((1,1,(1,1),(1,1)))
      
      framecnt = 0
      starttime = round(time.time() * 1000)
      
      while(True):
          image_L = camera_L.capture(encoding = 'i420')
          image_R = camera_R.capture(encoding = 'i420')
          height = int(align_up(frame_length, 16))
          width = int(align_up(frame_width, 32))
          frame_L = image_L.as_array.reshape(int(height * 1.5), width)
          frame_L = cv2.cvtColor(frame_L, cv2.COLOR_YUV2BGR_I420)
          frame_R = image_R.as_array.reshape(int(height * 1.5), width)
          frame_R = cv2.cvtColor(frame_R, cv2.COLOR_YUV2BGR_I420)
          
          # Release memory
          camera_L.release_buffer(image_L)
          del image_L
          camera_R.release_buffer(image_R)
          del image_R
      
          framecnt = framecnt+1
          if framecnt == 100:
              break
      
      print("Close camera...")
      camera_L.close_camera()
      camera_R.close_camera()
      
      endtime = round(time.time() * 1000)
      
      timedelta = endtime - starttime
      
      print("frame rate: %f" %(100/timedelta*1000))
      
      posted in VEYE MIPI camera
      S
      sjchen
    • RE: 树莓派CM4+imx327S MIPI x2 运行python demo如何同时打开两个摄像头

      @veye_xumm 谢谢,现在传入(0,0,(0,0),(0,0)) 和 (1,1,(1,1),(1,1)) 就可以了。

      posted in VEYE MIPI camera
      S
      sjchen
    • RE: 树莓派CM4+imx327S MIPI x2 运行python demo如何同时打开两个摄像头

      @veye_xumm 我理解要传入类似(0,0,(0,0),(0,0))这样的参数对吧,那么sda_pins和scl_pins这两个参数的具体含义是什么(注释没看懂)能否解释一下?谢谢

      posted in VEYE MIPI camera
      S
      sjchen
    • 树莓派CM4+imx327S MIPI x2 运行python demo如何同时打开两个摄像头

      我将 capture2opencv.py 中 camera.init_camera() 添加参数0或1,即 camera.init_camera(0) 或 camera.init_camera(1),始终报错:"Invalid camera_interface "

      posted in VEYE MIPI camera
      S
      sjchen
    • RE: 树莓派CM4+imx327S MIPI 运行python如何屏蔽大量的终端log

      @veye_xumm 可以了,谢谢!

      posted in VEYE MIPI camera
      S
      sjchen
    • 树莓派CM4+imx327S MIPI 运行python如何屏蔽大量的终端log

      你好,我在用树莓派CM4+imx327S MIPI,运行capture2opencv.py的时候会有很多这样的log在终端打印出来:mmal: capture_buffer_callback data len is 3133440,想问一下如何屏蔽 ?谢谢

      posted in VEYE MIPI camera
      S
      sjchen