• DepthAI-v2Hardware
  • No distortion coefficient and rectification matrix generated by calibration.py

ShivamSharma
Are you sure the correct board config is used? This should not happen, unless this is some other calibration file.

Thanks,
Jaka

It may be possible that I am providing incorrect camera name such as CAM_A and CAM_B in the board file. I will paste the board file I am using at the end. I am using the left and right socket of OAK FFC 3P. When I run ros2 launch depthai_ros_driver camera.launch.py it says -

[component_container-1] [14442C10E14FCBD600] [1.2.1] [2.336] [MonoCamera(3)] [error] Camera not detected on socket: 0

It is using the board file that I am passing to it because I can see HFOV and baseline is what I entered in the board file.

The board file is :

{
    "board_config": {
        "name": "OAK-FFC-3P",
        "revision": "R3M0E3",
        "cameras": {
            "CAM_A": {
                "name": "right",
                "hfov": 75,
                "type": "mono",
                "extrinsics": {
                    "to_cam": "CAM_B",
                    "specTranslation": {
                        "x": 14.5,
                        "y": 0,
                        "z": 0
                    },
                    "rotation": {
                        "r": 0,
                        "p": 0,
                        "y": 0
                    }
                }
            },
            "CAM_B": {
                "name": "left",
                "hfov": 75,
                "type": "mono"
            }
        },
        "stereo_config": {
            "left_cam": "CAM_B",
            "right_cam": "CAM_A"
        }
    }
}

The command is :
python3 calibrate.py -s 3.8 -brd OAK-FFC-3P.json -nx 13 -ny 7 -m process -dsb rgb

Hi @ShivamSharma
If you are running with ROS, perhaps the config you are using is wrong? You need to specify the params_file and pass in a config file that doesn't use the RGB camera.
Examples: luxonis/depthai-rostree/humble/depthai_ros_driver/config

If you want to test the accuracy of depth, I'd suggest using some raw-depthai examples from depthai-python or depthai-core repository.

Thanks,
Jaka

When I used depthai python to see the disparity, the results were bad. I flashed the device with the board file in my reply above. I still have question about why the calibration file saved has 3 sockets when I am using -dsb rgb and I am using two mono camera with Oak FFC 3P. I will paste my command and result below:
python3 calibrate.py -s 3.8 -brd OAK-FFC-3P.json -nx 13 -ny 7 -m process -dsb rgb
python3 depth_preview_sr.py

Can you please help me understand why the disparity is so bad?

The following is the settings for the depth_preview file:

#!/usr/bin/env python3

import cv2
import depthai as dai
import numpy as np

# Closer-in minimum depth, disparity range is doubled (from 95 to 190):
extendedDisparity = False
# Better accuracy for longer distance, fractional disparity 32-levels:
subpixel = True
# Better handling for occlusions:
lrCheck = True

enableRectified = True

# Create pipeline
pipeline = dai.Pipeline()

# Define sources and outputs
left = pipeline.create(dai.node.ColorCamera)
right = pipeline.create(dai.node.ColorCamera)

# Create stereo
stereo = pipeline.create(dai.node.StereoDepth)
xoutDepth = pipeline.create(dai.node.XLinkOut)
xoutDepth.setStreamName("disparity")

# Properties
left.setResolution(dai.ColorCameraProperties.SensorResolution.THE_800_P)
left.setCamera("left")

right.setResolution(dai.ColorCameraProperties.SensorResolution.THE_800_P)
right.setCamera("right")

stereo.setDefaultProfilePreset(dai.node.StereoDepth.PresetMode.HIGH_DENSITY)
stereo.initialConfig.setMedianFilter(dai.MedianFilter.KERNEL_7x7)
stereo.setLeftRightCheck(lrCheck)
stereo.setExtendedDisparity(extendedDisparity)
stereo.setSubpixel(subpixel)


# Linking
left.isp.link(stereo.left)
right.isp.link(stereo.right)
if enableRectified:
    xoutRectR = pipeline.create(dai.node.XLinkOut)
    xoutRectL = pipeline.create(dai.node.XLinkOut)
    xoutRectR.setStreamName("rectifiedRight")
    xoutRectL.setStreamName("rectifiedLeft")
    stereo.rectifiedLeft.link(xoutRectL.input)
    stereo.rectifiedRight.link(xoutRectR.input)
stereo.disparity.link(xoutDepth.input)

maxDisp = stereo.initialConfig.getMaxDisparity()

# Connect to device and start pipeline
with dai.Device(pipeline) as device:
    while not device.isClosed():
        queueNames = device.getQueueEvents()
        for q in queueNames:
            message = device.getOutputQueue(q).get()
            # Display arrived frames
            if type(message) == dai.ImgFrame:
                frame = message.getCvFrame()
                if 'disparity' in q:
                    disp = (frame * (255.0 / maxDisp)).astype(np.uint8)
                    disp = cv2.applyColorMap(disp, cv2.COLORMAP_JET)
                    cv2.imshow(q, disp)
                else:
                    cv2.imshow(q, frame)
        if cv2.waitKey(1) == ord('q'):
            break

Hi @ShivamSharma
Yes, that is a bad calibration.

Few things to try:

  • swap left and right sockets, then view the preview again, hopefully only the sockets are swapped in calibration:

    right.setCamera("left")
    left.setCamera("right")
  • You are using OV9282 which is basically the same as OV9782, so the 3P can sometimes confuse them. Edit the calibration json to manually set the sensor model:

    "CAM_B": {
                    "model": "OV9282",
                    "name": "left",
                    ....
                    "type": "mono",

    for both. Make sure that you are running on the updated develop branch of depthai repo.

I see you are using an altered depth preview script where the camera nodes are ColorCamera. How come? 9282 is mono.

Thanks,
Jaka

Thanks!

I changed the sockets as you suggested and now the following are the results which look better as compared to before but I am not sure how accurate should I expect it to be.

I am using the depth_preview.py file. I can see the curtains in the disparity and the bed but I am also sitting in front of the camera and it is showing me as black.

Can the performance be improved further? Also, should I switch the sockets when I run the ros2 driver or I can just switch the calib file for each camera?

I was using the OV9282 model name in the board file before.

    Hi @ShivamSharma
    14.5cm baseline is quite large, are you sure you are not sitting too close to the cameras?

    ShivamSharma Can the performance be improved further? Also, should I switch the sockets when I run the ros2 driver or I can just switch the calib file for each camera?

    A good recalibration is the only way to improve the depth. You can alter the calibration file (with the examples we have for doing it) and just swap the sockets.

    Thanks,
    Jaka

    Yes, I am sitting close to the camera. I am still not getting good depth in ROS 2 from the cameras. I swapped the sockets in ROS2.

      ShivamSharma
      Could you send over the dataset you have used (should be stored in the dataset folder)? Also left and right (not rectified) image for scene where the depth doesn't look ok, and a calibration dump. We'll try to reproduce the results to see what is wrong.

      Thanks,
      Jaka

      Hi @ShivamSharma
      The coverage during calibration is very poor. In order to properly calibrate the cameras, make sure to cover the full FOV of the camera.

      Board config file might not be flashed properly, since the calibration_dump actually has three cameras (one seems to be duplicated.

      It should look more like this:

      {
          "batchName": "",
          "batchTime": 1679712500,
          "boardConf": "IR-C00M05-00",
          "boardCustom": "",
          "boardName": "DM1090",
          "boardOptions": 0,
          "boardRev": "R3M0E3",
          "cameraData": [
              [
                  2,
                  {
                      "cameraType": 0,
                      "distortionCoeff": [
                          -2.396423578262329,
                          -10.477461814880371,
                          -0.0004928055568598211,
                          0.0011145062744617462,
                          26.935871124267578,
                          -2.4506843090057373,
                          -10.170122146606445,
                          26.494205474853516,
                          0.0,
                          0.0,
                          0.0,
                          0.0,
                          0.0,
                          0.0
                      ],
                      "extrinsics": {
                          "rotationMatrix": [
                              [
                                  0.997919499874115,
                                  0.05123051628470421,
                                  -0.03914157673716545
                              ],
                              [
                                  -0.051841288805007935,
                                  0.9985463619232178,
                                  -0.014751287177205086
                              ],
                              [
                                  0.03832896426320076,
                                  0.016749747097492218,
                                  0.9991247653961182
                              ]
                          ],
                          "specTranslation": {
                              "x": -14.5,
                              "y": -0.0,
                              "z": -0.0
                          },
                          "toCameraSocket": 1,
                          "translation": {
                              "x": -14.075519561767578,
                              "y": 0.5210347771644592,
                              "z": -0.29575979709625244
                          }
                      },
                      "height": 800,
                      "intrinsicMatrix": [
                          [
                              909.0518188476563,
                              0.0,
                              644.2517700195313
                          ],
                          [
                              0.0,
                              909.3357543945313,
                              383.7008972167969
                          ],
                          [
                              0.0,
                              0.0,
                              1.0
                          ]
                      ],
                      "lensPosition": 0,
                      "specHfovDeg": 75.0,
                      "width": 1280
                  }
              ],
              [
                  1,
                  {
                      "cameraType": 0,
                      "distortionCoeff": [
                          -3.9288971424102783,
                          -3.196507692337036,
                          -0.00022527640976477414,
                          0.0015712999738752842,
                          19.68087387084961,
                          -3.980436325073242,
                          -2.887248992919922,
                          19.199928283691406,
                          0.0,
                          0.0,
                          0.0,
                          0.0,
                          0.0,
                          0.0
                      ],
                      "extrinsics": {
                          "rotationMatrix": [
                          [
                              0.0,
                              0.0,
                              0.0
                          ],
                          [
                              0.0,
                              0.0,
                              0.0
                          ],
                          [
                              0.0,
                              0.0,
                              0.0
                          ]
                          ],
                          "specTranslation": {
                          "x": -0.0,
                          "y": -0.0,
                          "z": -0.0
                          },
                          "toCameraSocket": -1,
                          "translation": {
                          "x": 0.0,
                          "y": 0.0,
                          "z": 0.0
                          }
                      },
                      "height": 800,
                      "intrinsicMatrix": [
                          [
                              906.0726318359375,
                              0.0,
                              625.2752685546875
                          ],
                          [
                              0.0,
                              906.3057861328125,
                              399.464599609375
                          ],
                          [
                              0.0,
                              0.0,
                              1.0
                          ]
                      ],
                      "lensPosition": 0,
                      "specHfovDeg": 75.0,
                      "width": 1280
                  }
              ]
          ],
          "deviceName": "",
          "hardwareConf": "F0-FV00-BC000",
          "housingExtrinsics": {
              "rotationMatrix": [],
              "specTranslation": {
                  "x": 0.0,
                  "y": 0.0,
                  "z": 0.0
              },
              "toCameraSocket": -1,
              "translation": {
                  "x": 0.0,
                  "y": 0.0,
                  "z": 0.0
              }
          },
          "imuExtrinsics": {
              "rotationMatrix": [
                  [
                      0.0,
                      0.0,
                      0.0
                  ],
                  [
                      0.0,
                      0.0,
                      0.0
                  ],
                  [
                      0.0,
                      0.0,
                      0.0
                  ]
              ],
              "specTranslation": {
                  "x": 0.0,
                  "y": 0.0,
                  "z": 0.0
              },
              "toCameraSocket": -1,
              "translation": {
                  "x": 0.0,
                  "y": 0.0,
                  "z": 0.0
              }
          },
          "miscellaneousData": [],
          "productName": "OAK-FFC-3P",
          "stereoEnableDistortionCorrection": false,
          "stereoRectificationData": {
              "leftCameraSocket": 1,
              "rectifiedRotationLeft": [
                  [
                      0.9990953207015991,
                      -0.03698360174894333,
                      0.020993344485759735
                  ],
                  [
                      0.036815181374549866,
                      0.9992871880531311,
                      0.008353326469659805
                  ],
                  [
                      -0.02128731645643711,
                      -0.007572895381599665,
                      0.999744713306427
                  ]
              ],
              "rectifiedRotationRight": [
                  [
                      0.9997386932373047,
                      0.014605958014726639,
                      -0.017585638910531998
                  ],
                  [
                      -0.014745572581887245,
                      0.9998605847358704,
                      -0.007835760712623596
                  ],
                  [
                      0.017468737438321114,
                      0.008093023672699928,
                      0.9998146295547485
                  ]
              ],
              "rightCameraSocket": 2
          },
          "stereoUseSpecTranslation": true,
          "version": 7,
          "verticalCameraSocket": -1
      }

      Thanks,
      Jaka

      Okay, I will work on using the full FOV. But why are there 3 cameras in the calibration file? Is it because of poor calibration or bad board file. I shared my board file in the replies above. Is everything correct in my board file? Also, if calibration is incorrect then why does it give better disparity outside of ROS 2?

      Edit:
      It is difficult to cover the Full FOV because charuco board goes out of frame if I move the other camera to border. The cable length is also limited so I can't go far from the screen . The following are the result outside of ROS 2 with 10cm baseline

      There is still old data in the saved calib file from previous calibration. Still three sockets even though I am using two.

      Please help me get good depth, fps and synchronization in ROS 2. I have created another discussion for fps and synchronization but I think these two issues are related. Thank you for your help so far!

      I also want to discuss hard coding by Luxonis in ROS 2 driver. I see some hard coding of focal length and baseline in the code.

      The following is the depth I am getting in ROS 2 after calibration and hardcoding the correct focal length and baseline.

      Hi @ShivamSharma
      You don't need to keep the whole charuco in the frame, it's fine if some squares are missed. It's more important that the whole FOV is covered.

      And I think it should work if you omit the -dsb rgb, the script should still work if correct (2 camera) calib file is provided.

      As for ROS, @DaniloPejovic is looking into it.

      Thanks,
      Jaka

      I omitted the -dsb rgb flag and made sure to cover all the fields of view of both cameras. I am attaching the dataset again. If you think calibration is still wrong, let me know so I can do it again. I will also attach a link to the board file I used and the calibration result. Could it be possible that I am using the wrong values from the calibration file? I have double-checked that I am using the values for the right and left sockets. I will update the answer with the ROS2 results. There are still three sockets in the calibration result.

      Link

      Update: Still bad depth in ROS 2 after re-calibration, and still 3 sockets in the calibration result. One socket that doesn't have a camera attached has data from previous calibrations.

      I also uploaded the right and left calibration files in ROS 2 to the link above.

      Hi @ShivamSharma
      Could be a bug in the calibration script, would have to check that...
      Could you run it with -nic so no existing calibration is used? That would make sure the cameras are not restacked.

      Thanks,
      Jaka

      When I use -nic I get the following error:

      Flashing Calibration data into 
      EEPROM VERSION being flashed is  -> 7
      EEPROM VERSION being flashed is  -> 7
      Device closed in exception..
      No PROTECTED permissions to override protected EEPROM fields
      Traceback (most recent call last):
        File "/home/shivam157/depthai/calibrate.py", line 1124, in calibrate
          self.device.flashCalibration2(calibration_handler)
      RuntimeError: No PROTECTED permissions to override protected EEPROM fields

      Also, now I also get the following error when I run cam_test.py:

      shivam157@ubuntu:~/depthai-python/utilities$ python3 cam_test.py --cameras left,m right,m
      DepthAI version: 2.21.2.0
      DepthAI path: /home/shivam157/.local/lib/python3.10/site-packages/depthai.cpython-310-aarch64-linux-gnu.so
      Traceback (most recent call last):
        File "/home/shivam157/depthai-python/utilities/cam_test.py", line 186, in <module>
          '1012': dai.ColorCameraProperties.SensorResolution.THE_1352X1012,
      AttributeError: type object 'depthai.SensorResolution' has no attribute 'THE_1352X1012'

      I was not getting this error before. After flashing without
      Update: Not getting the second error above probably because I flashed without -nic.

      @jakaskerl A correct calibration flash will most probably solve the bad depth in ROS2. I might just need to switch sockets in config. I checked the camera information topics and saw that the projection matrix was wrong. So if the baseline is being calculated from the projection matrix, then the depth will be bad. This is the calibration it is getting from device. Please fix the calibration.py file so that I can flash it, or tell me how to not use the device calibration data and use the external files in the camera. yaml. Right now, if I use the external files, then both of the calibration sources are publishing to the same info topic.

      Btw, this time the saved calibration file with -nic looks correct, it is just not flashed because of the error I pasted above.
      The calibration file saved:

      
      {
          "batchName": "",
          "batchTime": 0,
          "boardConf": "",
          "boardCustom": "",
          "boardName": "Custom FFC",
          "boardOptions": 0,
          "boardRev": "R1M0E3",
          "cameraData": [
              [
                  1,
                  {
                      "cameraType": 0,
                      "distortionCoeff": [
                          -1.8108996152877808,
                          0.5892674922943115,
                          0.00020837810006923974,
                          0.0008147237240336835,
                          -0.4694308340549469,
                          -1.8531672954559326,
                          0.7104603052139282,
                          -0.5547073483467102,
                          0.0,
                          0.0,
                          0.0,
                          0.0,
                          0.0,
                          0.0
                      ],
                      "extrinsics": {
                          "rotationMatrix": [],
                          "specTranslation": {
                              "x": 0.0,
                              "y": 0.0,
                              "z": 0.0
                          },
                          "toCameraSocket": -1,
                          "translation": {
                              "x": 0.0,
                              "y": 0.0,
                              "z": 0.0
                          }
                      },
                      "height": 800,
                      "intrinsicMatrix": [
                          [
                              906.6533813476563,
                              0.0,
                              625.2329711914063
                          ],
                          [
                              0.0,
                              906.753662109375,
                              399.9358825683594
                          ],
                          [
                              0.0,
                              0.0,
                              1.0
                          ]
                      ],
                      "lensPosition": 0,
                      "specHfovDeg": 75.0,
                      "width": 1280
                  }
              ],
              [
                  2,
                  {
                      "cameraType": 0,
                      "distortionCoeff": [
                          -1.1144567728042603,
                          0.4457603096961975,
                          -0.00030109440558589995,
                          0.000643925741314888,
                          1.2683645486831665,
                          -1.1590780019760132,
                          0.5456246733665466,
                          1.2029682397842407,
                          0.0,
                          0.0,
                          0.0,
                          0.0,
                          0.0,
                          0.0
                      ],
                      "extrinsics": {
                          "rotationMatrix": [
                              [
                                  0.9946930408477783,
                                  0.10237327218055725,
                                  -0.010269088670611382
                              ],
                              [
                                  -0.1015079990029335,
                                  0.9927471876144409,
                                  0.06441415846347809
                              ],
                              [
                                  0.016788896173238754,
                                  -0.06302992254495621,
                                  0.9978703856468201
                              ]
                          ],
                          "specTranslation": {
                              "x": 9.0,
                              "y": 0.0,
                              "z": 0.0
                          },
                          "toCameraSocket": 1,
                          "translation": {
                              "x": -8.774820327758789,
                              "y": 0.4384150207042694,
                              "z": -0.33474013209342957
                          }
                      },
                      "height": 800,
                      "intrinsicMatrix": [
                          [
                              910.39697265625,
                              0.0,
                              646.8530883789063
                          ],
                          [
                              0.0,
                              910.701904296875,
                              386.07025146484375
                          ],
                          [
                              0.0,
                              0.0,
                              1.0
                          ]
                      ],
                      "lensPosition": 0,
                      "specHfovDeg": 75.0,
                      "width": 1280
                  }
              ]
          ],
          "hardwareConf": "",
          "imuExtrinsics": {
              "rotationMatrix": [],
              "specTranslation": {
                  "x": 0.0,
                  "y": 0.0,
                  "z": 0.0
              },
              "toCameraSocket": -1,
              "translation": {
                  "x": 0.0,
                  "y": 0.0,
                  "z": 0.0
              }
          },
          "miscellaneousData": [],
          "productName": "",
          "stereoRectificationData": {
              "leftCameraSocket": 1,
              "rectifiedRotationLeft": [
                  [
                      0.9980300664901733,
                      -0.049864426255226135,
                      0.03807265684008598
                  ],
                  [
                      0.051083534955978394,
                      0.9981896281242371,
                      -0.03174852952361107
                  ],
                  [
                      -0.036420609802007675,
                      0.03363087400794029,
                      0.9987704753875732
                  ]
              ],
              "rectifiedRotationRight": [
                  [
                      0.9984344244003296,
                      0.05026911944150925,
                      0.024530746042728424
                  ],
                  [
                      -0.05104481801390648,
                      0.998180627822876,
                      0.03209204599261284
                  ],
                  [
                      -0.02287287451326847,
                      -0.03329396992921829,
                      0.9991838335990906
                  ]
              ],
              "rightCameraSocket": 2
          },
          "version": 7
      }

        ShivamSharma DepthAI version: 2.21.2.0

        Update depthai to latest version. Use install_requirements.py.

        ShivamSharma Update: Not getting the second error above probably because I flashed without -nic.

        -nic will try to flash protected fields in eeprom. Will be fixed on our side.

        ShivamSharma Btw, this time the saved calibration file with -nic looks correct, it is just not flashed because of the error I pasted above.

        Great! You can try to swap the calibration values (not the board config/board name/etc.. fields) on the non working config and try the calibration by loading it first: https://docs.luxonis.com/software/depthai/examples/calibration_load/.

        Thanks,
        Jaka

          jakaskerl

          I did python3 install_requirements.py on the develop branch, but still, the version is same and this script installed numpy 2 which was just released so I will have to downgrade numpy now.

          (venv) shivam157@ubuntu:~/depthai$ python3 install_requirements.py
          pip 24.0 from /home/shivam157/depthai-python/venv/lib/python3.10/site-packages/pip (python 3.10)
          Requirement already satisfied: pip in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (24.0)
          Collecting pip
            Using cached pip-24.1-py3-none-any.whl.metadata (3.6 kB)
          Using cached pip-24.1-py3-none-any.whl (1.8 MB)
          Installing collected packages: pip
            Attempting uninstall: pip
              Found existing installation: pip 24.0
              Uninstalling pip-24.0:
                Successfully uninstalled pip-24.0
          Successfully installed pip-24.1
          WARNING: Skipping opencv-python as it is not installed.
          Found existing installation: opencv-contrib-python 4.5.5.62
          Uninstalling opencv-contrib-python-4.5.5.62:
            Successfully uninstalled opencv-contrib-python-4.5.5.62
          Found existing installation: depthai 2.24.0.0
          Uninstalling depthai-2.24.0.0:
            Successfully uninstalled depthai-2.24.0.0
          Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/wheels/, https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/
          Ignoring pyqt5: markers 'platform_machine != "armv6l" and platform_machine != "armv7l" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
          Requirement already satisfied: requests==2.26.0 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements.txt (line 1)) (2.26.0)
          Requirement already satisfied: numpy>=1.21.4 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements.txt (line 3)) (1.26.4)
          Collecting numpy>=1.21.4 (from -r requirements.txt (line 3))
            Using cached numpy-2.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (62 kB)
          Collecting opencv-contrib-python==4.5.5.62 (from -r requirements.txt (line 4))
            Using cached opencv_contrib_python-4.5.5.62-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (18 kB)
          Requirement already satisfied: depthai-sdk==1.9.4 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements.txt (line 5)) (1.9.4)
          Collecting depthai==2.21.2.0 (from -r requirements.txt (line 9))
            Using cached depthai-2.21.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (8.7 kB)
          Requirement already satisfied: Qt.py in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements.txt (line 10)) (1.4.1)
          Requirement already satisfied: scipy in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements.txt (line 11)) (1.13.1)
          Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from requests==2.26.0->-r requirements.txt (line 1)) (1.26.18)
          Requirement already satisfied: certifi>=2017.4.17 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from requests==2.26.0->-r requirements.txt (line 1)) (2024.6.2)
          Requirement already satisfied: charset-normalizer~=2.0.0 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from requests==2.26.0->-r requirements.txt (line 1)) (2.0.12)
          Requirement already satisfied: idna<4,>=2.5 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from requests==2.26.0->-r requirements.txt (line 1)) (3.7)
          Requirement already satisfied: blobconverter>=1.2.8 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from depthai-sdk==1.9.4->-r requirements.txt (line 5)) (1.4.3)
          Requirement already satisfied: pytube>=12.1.0 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from depthai-sdk==1.9.4->-r requirements.txt (line 5)) (15.0.0)
          Requirement already satisfied: PyTurboJPEG==1.6.4 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from depthai-sdk==1.9.4->-r requirements.txt (line 5)) (1.6.4)
          Requirement already satisfied: marshmallow==3.17.0 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from depthai-sdk==1.9.4->-r requirements.txt (line 5)) (3.17.0)
          Requirement already satisfied: distinctipy in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from depthai-sdk==1.9.4->-r requirements.txt (line 5)) (1.3.4)
          Requirement already satisfied: xmltodict in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from depthai-sdk==1.9.4->-r requirements.txt (line 5)) (0.13.0)
          Requirement already satisfied: packaging>=17.0 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from marshmallow==3.17.0->depthai-sdk==1.9.4->-r requirements.txt (line 5)) (24.0)
          Requirement already satisfied: types-PySide2 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from Qt.py->-r requirements.txt (line 10)) (5.15.2.1.7)
          Requirement already satisfied: PyYAML in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from blobconverter>=1.2.8->depthai-sdk==1.9.4->-r requirements.txt (line 5)) (6.0.1)
          Using cached opencv_contrib_python-4.5.5.62-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (44.8 MB)
          Using cached depthai-2.21.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (10.3 MB)
          Using cached numpy-2.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.9 MB)
          Installing collected packages: numpy, depthai, opencv-contrib-python
            Attempting uninstall: numpy
              Found existing installation: numpy 1.26.4
              Uninstalling numpy-1.26.4:
                Successfully uninstalled numpy-1.26.4
          Successfully installed depthai-2.21.2.0 numpy-2.0.0 opencv-contrib-python-4.5.5.62
          Ignoring open3d: markers 'platform_machine != "armv6l" and platform_machine != "armv7l" and python_version < "3.9" and platform_machine != "aarch64"' don't match your environment
          Requirement already satisfied: ffmpy3==0.2.4 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements-optional.txt (line 2)) (0.2.4)
          Requirement already satisfied: pyusb==1.2.1 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements-optional.txt (line 3)) (1.2.1)
          Requirement already satisfied: sentry-sdk==1.5.1 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements-optional.txt (line 4)) (1.5.1)
          Requirement already satisfied: mcap>=0.0.10 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements-optional.txt (line 7)) (1.1.1)
          Requirement already satisfied: mcap-ros1-support==0.0.8 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements-optional.txt (line 8)) (0.0.8)
          Requirement already satisfied: rosbags==0.9.11 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from -r requirements-optional.txt (line 9)) (0.9.11)
          Requirement already satisfied: urllib3>=1.10.0 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from sentry-sdk==1.5.1->-r requirements-optional.txt (line 4)) (1.26.18)
          Requirement already satisfied: certifi in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from sentry-sdk==1.5.1->-r requirements-optional.txt (line 4)) (2024.6.2)
          Requirement already satisfied: lz4 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from rosbags==0.9.11->-r requirements-optional.txt (line 9)) (4.3.3)
          Requirement already satisfied: numpy in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from rosbags==0.9.11->-r requirements-optional.txt (line 9)) (2.0.0)
          Requirement already satisfied: ruamel.yaml in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from rosbags==0.9.11->-r requirements-optional.txt (line 9)) (0.18.6)
          Requirement already satisfied: zstandard in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from rosbags==0.9.11->-r requirements-optional.txt (line 9)) (0.22.0)
          Requirement already satisfied: ruamel.yaml.clib>=0.2.7 in /home/shivam157/depthai-python/venv/lib/python3.10/site-packages (from ruamel.yaml->rosbags==0.9.11->-r requirements-optional.txt (line 9)) (0.2.8)
          (venv) shivam157@ubuntu:~/depthai$ python3 calibrate.py -s 3.8 -brd OAK-FFC-3P.json -nx 13 -ny 7 -m process -nic
          
          A module that was compiled using NumPy 1.x cannot be run in
          NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
          versions of NumPy, modules must be compiled with NumPy 2.0.
          Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
          
          If you are a user of the module, the easiest solution will be to
          downgrade to 'numpy<2' or try to upgrade the affected module.
          We expect that some modules will need time to support NumPy 2.
          
          Traceback (most recent call last):  File "/home/shivam157/depthai/calibrate.py", line 17, in <module>
              import cv2
            File "/home/shivam157/depthai-python/venv/lib/python3.10/site-packages/cv2/__init__.py", line 8, in <module>
              from .cv2 import *
          AttributeError: _ARRAY_API not found
          Traceback (most recent call last):
            File "/home/shivam157/depthai/calibrate.py", line 17, in <module>
              import cv2
            File "/home/shivam157/depthai-python/venv/lib/python3.10/site-packages/cv2/__init__.py", line 8, in <module>
              from .cv2 import *
          ImportError: numpy.core.multiarray failed to import
          (venv) shivam157@ubuntu:~/depthai$ 

          Also, how to fix the following after installing OpenCV again to work with Numpy2:

          Installing collected packages: opencv-python
          Successfully installed opencv-python-4.10.0.84
          (venv) shivam157@ubuntu:~/depthai$ python3 calibrate.py -s 3.8 -brd OAK-FFC-3P.json -nx 13 -ny 7 -m process -nic
          Traceback (most recent call last):
            File "/home/shivam157/depthai/calibrate.py", line 1207, in <module>
              Main().run()
            File "/home/shivam157/depthai/calibrate.py", line 351, in __init__
              self.aruco_dictionary = cv2.aruco.Dictionary_get(
          AttributeError: module 'cv2.aruco' has no attribute 'Dictionary_get'. Did you mean: 'Dictionary'?
          (venv) shivam157@ubuntu:~/depthai$ 

          Update:
          The develop branch install_requirements.py uses the 2.21.20 depth AI version. So I edited it to 2.24.0.0, removed Numpy 2 because it was giving an error, and installed Numpy 1.21.4. You should fix this file as well.

          Edit 1:

          Still, after loading the calibration from the script in depthai-python, the flashed calibration is incorrect when I run the calibration reader file. How will loading calibration help me? The problem is in ROS 2 calibration info and depth.