adrivg
Don't point the camera at the bright window, it throws off the AE.
Set lens position manually with -rlp {position 0-255}
'-rlp', '--rgbLensPosition', nargs='*', action=ParseKwargs, required=False, default={} , help="Set the manual lens position of the camera for calibration. Example -rlp rgb=135 night=135")

Thanks
Jaka

I will try it and give you a respond.

What do you mean by "set lens position manually"?. I do not understand what that number between 0-255 refers to.

Thanks

Adrian

    adrivg
    by setting the -rlp argument (when running the calibrate.py), you can set the value of lens position (same value that is changed using autofocus). It can be 0-255, 0 being close to the glass, 255 being the farthest away.

    It will change the focus of the image.

    Thanks,
    Jaka

    I tried to calibrate again. I used python3 calibrate.py -s 3.9 -nx 15 -ny 8 -brd OAK-FFC-4P.json -dst calib_3_7_C -ep 2 -rlp right=135 left=135.

    I tested different rlp values to focus a distance of 90/100 cm from the cameras and the example values were the ones that gave me the best results. The reprojection error was reduced a bit but the epipolar error is still too high (1.06)

    I send you the setup for the new calibration: https://drive.google.com/drive/folders/1wITNra_xuafv5RCj7222uhPM0IfPHbqV?usp=drive_link

      4 days later

      adrivg adrivg
      The calibration looks fine now.
      What script are you using to create stereo depth? Can you show left and right rectified frames and the depth created from them?

      Thanks,
      Jaka

      adrivg
      Cameras are not on the same horizontal axis.. Stereo matching won't work in this case.

      it is also not accounted for in the extrinsics (nether translation, nor rotation).

      Please keep them on the same axis.

      Thanks,
      Jaka

      the distribution is the one shown in the harware mounting, They should be in the same horizontal... I am going to check if there is any slack

        adrivg
        We checked the dump and recreated depth.. works ok. I think the only issue now is that sockets are switched.

        Though I would advise you to correct the camera positions 🙂

        Thanks,
        Jaka

        I swapped the sockets based on your previous comment:

        Try switching the left and right when performing stereo.

        Linking
        monoLeft.out.link(depth.right)
        monoRight.out.link(depth.left)
        depth.disparity.link(xout.input)
        or switch sockets for left and right.

        Thanks,
        Jaka

        Should I change them back?
        I am trying to correct camera positions, not sure why I have such slack using OAK-FFC 4P

          adrivg
          I know, I was suggesting you try switching it in case it improves the depth. Since it did not solve the issue, yes, revert it back.

          Thanks,
          Jaka

          Hi Jakaskerl,

          I realised that I had the cameras swapped on OAK-FFC-4P.json.

          I also discovered that there is an inconsistency when you add the parameter -rlp.
          As you can see from the images below. When you are capturing the images, you get the name mapping your camId (the socket name). However, when you set the calibration, you get the name mapping the cam_info(from json file)


          If you change the mapping when capturing the images from camIdmapping to cam_infoshould work fine.

          That being said, I have redefined the workflow and uploaded it here There are different calibration folders name as calib_Xbeing X the horizontal distance between cameras

          I have added more info than before:

          • The stereo pair images rectified (I am getting high errors in some pictures and I cannot figure out why. Can you take a look?)
          • I have also realised that the fov has changed (When I run disparity.py the images are zoomed in compared to when I run cam_test.py from the depthai_python repository. It also seems that the autofocus is still set even after using -rlp when calibrating


          These are the depth and disparity results for calib_5. The epipolar error I am getting is still too high (2.81) and there is a big difference between right and left reprojection error (almost double, I am not sure if that is normal)

          Thank you in advance
          Adrián

            adrivg
            Change left.setResolution(dai.ColorCameraProperties.SensorResolution.THE_4_K) and scale it using Isp scale rather than setVideoSize. I think there is a bug and the wrong intrinsics are taken.

            Thanks,
            Jaka

            I have changed those attributes:

            However, when I run te script the windows are frozen:

            At least, the left frame where it hangs up seems to be fixed.
            Any idea?

            I set setIspScale to (1,3) to meet the restrictions and now it works:

            PD: Do you have any module/script for color correction?