Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc

    UNSOLVED VEYE IMX 327S video streaming on pi zero with opencv

    VEYE MIPI camera
    2
    6
    587
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      Nathan Sinclair last edited by Nathan Sinclair

      Hello,
      We are looking to use some image manipulation with opencv to write some text onto the image and display on hdmi as part of a system that accepts a numpy array for displaying on a headless pi zero. So it requires this camera to be streaming real time, at preferably 60fps, but 30fps is fine.

      For this to work we need a fast video stream display with the IMX327S. I looked at the opencv example which says "displaying a YUV stream with opencv" however the frame rate is very slow. It's only getting a frame probably every 3 seconds.

      Here is the code that I have used.

      camera = Dcam.mipi_camera()
              print("Open camera...")
              camera.init_camera()
      
              while LiveCamera.running:
                  height = int(align_up(1080, 16))
                  width = int(align_up(1920, 32))
                  if LiveCamera.first is False:
                      LiveCamera.first = True
                      print("-----live------")
                      print("height:" + str(height))
                      print("width:" + str(width))
                      print("frame is read")
                      print("------------------")
                  frame = camera.capture(encoding='i420')
                  #3133440
      
                  image = frame.as_array.reshape(int(height*1.5), width)
                  image = cv2.cvtColor(image, cv2.COLOR_YUV2BGR_I420)
                  dst = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
      
                  LiveCamera.frame = dst
                  camera.release_buffer(frame)
                  del frame
                  sleep(0)
      

      If the camera could be used with the picamera library, that would be ideal, though i didn't find any information for setting it up with picamera.
      Or if there is a way to place overlays on the imx327S this would be a solution as well
      Quick update...
      Sometimes the camera loads at start up, other times it reports a select time out and segmentation fault. We are running an additional camera with the system and unsure at this stage if it is a result of this other camera. will do more testing on it.

      veye_xumm 1 Reply Last reply Reply Quote 0
      • veye_xumm
        veye_xumm @Nathan Sinclair last edited by

        @nathan-sinclair

        • Caputre function
          capture function is very slow,suitable for low frame rate capture needs. In this function, the mipi receive channel is reinitialized, a frame is fetched from the stream, then the mipi receive channel is closed, data format conversion (cpu operation) is performed, and then returned.
          If you need to preview, we recommend using the preview function. Or refer to veye_raspcam's C code. This function will bind the data input channel to the display channel at the mmal level.
        • Text overlay
          Pls refer to this topic:
          http://forum.veye.cc/topic/23/text-overlay-in-veye_raspivid/7?_=1632362473244
        N 1 Reply Last reply Reply Quote 0
        • N
          Nathan Sinclair @veye_xumm last edited by

          @veye_xumm
          Is there source code for raspivid?

          veye_xumm 1 Reply Last reply Reply Quote 0
          • veye_xumm
            veye_xumm @Nathan Sinclair last edited by

            @nathan-sinclair https://github.com/veyeimaging/raspberrypi

            N 1 Reply Last reply Reply Quote 0
            • N
              Nathan Sinclair @veye_xumm last edited by

              @veye_xumm This is new territory for me...
              Libcairo says it works on x window systems. Is it possible to use libcairo on pi zero headless?

              veye_xumm 1 Reply Last reply Reply Quote 0
              • veye_xumm
                veye_xumm @Nathan Sinclair last edited by

                @nathan-sinclair said in VEYE IMX 327S video streaming on pi zero with opencv:

                headless

                Sorry, I'm not sure.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post