how to archive highest fps at high res on multiple MT9J001 using usb3 shield

Published by sokoryujin on

Home Forums Arducam USB Camera Shields how to archive highest fps at high res on multiple MT9J001 using usb3 shield

Viewing 23 reply threads
  • Author
    Posts
    • #26290
      sokoryujin
      Participant

      hi ArduCam developers,

      i have some problem with this usb shield

      when I run single camera with single usb hub. i run example from the github can archive frame speed 6-7 fps @10MP the problem when i use multiple camera with multiple usb hub

      like this image

      multiple camera accessed using multiple application

      i can archive 6-7fps @10MP but sometimes got some frame error   and many of usb timeout error.

      and i already try using single application access multiple camera with the same hardware configuration but still have very slower camera roughly 2 fps when i should switch between the camera ie. should open-close the camera  each time switch the camera.

      do you have any clue/suggestion about this problem?

      thanks,

      diriga

    • #26379
      bin
      Keymaster

      Hi,

      Don’t worry and I will try my best to help you.

      Please attach me you hardare connection and give us the config file you are using. Our engineer will help you test it and reply you.

       

    • #26388
      sokoryujin
      Participant
    • #26390
      sokoryujin
      Participant

      I connected to my notebook

      Realimage

    • #26452
      bin
      Keymaster

      Hi,

      Thanks for your detail hardware information. We have tested it

      After our test, two USB3.0+MT9J001, using the configuration specified by the customer, can run normally at the same time, 6-7fps.

      Analyze the customer’s usage scenarios, and the following points need to be confirmed:
      ① Check whether the About of the two upper computers display Device3 Interface3;
      ②Confirm whether both HUBs are connected to USB3.0;
      ③If the notebook has only one 3.0, connect it to a 3.0 HUB and try again.

       

      Let me know if you need more help.

       

    • #26462
      sokoryujin
      Participant

      ub transfer timeout

      use usb3

      that screen shot from my pc and somehow other camera still got usb transfer error or sometime bad frame image

    • #26465
      sokoryujin
      Participant

      and from device manager i got this connection configuration

      have another clue or idea bin?

    • #26607
      bin
      Keymaster

      Hi,

      There is indeed a problem with using the hub. It seems that the hub will affect the USB bandwidth. Please try to remove the hub, connect the camera directly to the computer

      and restart it.

    • #26630
      sokoryujin
      Participant

      hi bin

      after i try to connect direct to usb this solve the usb timeout problem

      but there are still some issue when i press stop and play again show bad frame received like in this image

      bad frame when stop and start again

      and another problem when we use c++ streaming example and modified this with sequence

      1. open camera 1

      2. request capture camera 1

      3.  wait image ready when not ready jump to 2

      4. read the image on camera 1

      5. close camera 1

      and then repeat for other camera i only can archive 2-3 fps.

      when i do

      •  open all camera

      for each camera do :

      1.  request capture camera 1
      2.  wait image ready when not ready jump to 1
      3. read the image on camera 1

      from this scenario i got some bad frame received and some usb timeout and speed cannot reach 7 fps. still got 3 fps

      are u have any idea bin?

       

       

       

    • #26631
      sokoryujin
      Participant

      hi bin

      sory forgot fyi after i read image i delete the buffer

    • #26657
      wong
      Moderator

      Hello @sokeryujin ,

      Can you provide the relevant C++ code? I am not sure what you did in the “request capture”.

    • #26661
      bin
      Keymaster

      Hi  sokoryujin,

      Regarding the bad frame you mentioned, does it keep appearing after clicking stop and open or does it return to normal after a few bad frames? I test it on my computer, When I click the stop and open it also appear bad frames but after a few bad frames it will return to normal.Even if I use one camera , the same result.  When I click close and open it will not appear bad frame. You can try it.

      About the bad frame when click stop and open, it is due to When we click click , we do not have clear the data buffer.

      About the  c++ streaming example, our engineer will help you check it. Please attach us your whole code.

       

    • #26735
      sokoryujin
      Participant

      hi bin and wong

      you correct bin in my pc happen like your explain “When I click the stop and open it also appear bad frames but after a few bad frames it will return to normal”

      then because of that the frame rate is going slow after start(begin capture)+capture

      for wong

      “request capture” is at first call is begin capture dan ArduCam_captureImage

      the second call is only ArduCam_captureImage

      like below

      Uint32 rtn_val = ArduCam_beginCaptureImage(handle);
      if (rtn_val == USB_CAMERA_USB_TASK_ERROR) {
      std::cout << “Error beginning capture, rtn_val = ” << rtn_val << std::endl;
      return;
      }
      else {
      std::cout << “Capture began, rtn_val = ” << rtn_val << std::endl;
      }

      while ((ArduCam_availableImage(handle) > 0)!=true)
      {
      rtn_val = ArduCam_captureImage(handle);
      if (rtn_val == USB_CAMERA_USB_TASK_ERROR) {
      std::cout << “Error capture image, rtn_val = ” << rtn_val << std::endl;
      break;
      }
      else if (rtn_val > 0xFF) {
      std::cout <<“device id= “<<idxcam <<” Error capture image, rtn_val = ” << rtn_val << std::endl;
      }
      }

      and this working link runnable code but the frame rate cannot reach 7fps only 3 or 4fps

       

       

       

    • #26781
      wong
      Moderator

      Hi @sokoryujin ,

      Since no threads are opened inside the SDK, we need ArduCam_captureImage to read data from usb in a loop. If you do a time-consuming operation between two ArduCam_captureImage calls, some data will be lost and the frame rate will drop. Therefore we recommend using a separate thread to call ArduCam_captureImage.

    • #26790
      sokoryujin
      Participant

      hi wong

      after several trial using you recomendation

      not easy to using separate thread for ArduCam_captureImage

      from last i trial to separate this the rough fps only reach 2 fps, are u have more example when multiple camera wong?

      are u sure ArduCam_captureImage is to read data from usb ? not from camera sensor to usb shield?

      read data from usb shield are not ArduCam_readImage?

      thanks

       

       

    • #26805
      wong
      Moderator

      Hi @sokoryujin ,

      The streaming_demo example uses two threads. What is the frame rate used directly without modifying it?

       

    • #26809
      sokoryujin
      Participant

      Hi @wong

      From current example without modified only handle 1 camera so the frame rate is 6-7fps

      When i run multiple example to access camera sometime frame len not enough and sometime usb timeout

      The problem when example to use camera more than 1 the code should modified when code running in single app or process. In mya modified version like on your manual follow this step for each camera

      open camera

      Process where the proses is begin capture, capture,read image, endcapture

      Close camera

      This make the frame drop to 2-3fps

      Are u have example when multiple camera running accessed using single process

      And arducam camera sdk for python have the same handling? Should be multiple process (not thread)?

       

    • #26904
      wong
      Moderator

      Hi @sokoryujin ,

      I wrote a simple example, it can make both cameras reach 6-7fps, the code is here:

      https://github.com/glddiv/Arducam_Opencv_Demo/releases/download/v0.1/Arducam_Opencv_Demo.zip

    • #26962
      sokoryujin
      Participant

      hi @wong

      thanks for the example. i already try your example  here the result

      multiplecam running mostly when i run several time i got the right get frame 6 or 7 fps and sometime when error i only got 3fps or 4 fps

      and for image capture always get delay  175 millisecond

      delayed image

      thanks

    • #27042
      wong
      Moderator

      Hi @sokoryujin ,

      The 175 millisecond delay should be caused by the display.

      sometime when error i only got 3fps or 4 fps

      Are there any errors at this time?

    • #27267
      vk4tnt
      Participant

      Have you tried to bin pixels and therefore have a smaller frame size?

    • #27417
      wong
      Moderator

      Hi @vk4tnt ,

      I didn’t understand what you mean, can you elaborate on it?

    • #27423
      vk4tnt
      Participant

      Binning is the feature where 2×2 pixels are combined and are read out as one. As per specifications, using that method you should still get a resolution of 1928×1374 at 30fps.

      See: https://www.arducam.com/docs/camera-breakout-board/10mp-mt9j001-mt9j003/

    • #28061
      bin
      Keymaster

      Hello,

      Our engineer has helped you solved your issue. Let me know if you need more help.

Viewing 23 reply threads
  • You must be logged in to reply to this topic.