Camera Calibration in less than 5 Minutes with OpenCV

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ม.ค. 2025

ความคิดเห็น • 49

  • @NicolaiAI
    @NicolaiAI  ปีที่แล้ว +2

    Camera Calibration Software and High Precision Calibration Boards: camera-calibrator.com/

  • @lilyshytle393
    @lilyshytle393 ปีที่แล้ว +2

    Hello! When I run the code, I am getting the error message: [ WARN:0] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (438) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
    Any advice?

  • @aswinsanthanam2566
    @aswinsanthanam2566 9 หลายเดือนก่อน +2

    I took the chessboard pic from my phone which is 8x8, and the frame WxH was 480x270, hence i updated these infos in the calibration.py. I get the below error
    (-215:Assertion failed) nimages > 0 in function 'calibrateCameraRO' on the line
    ret, cameraMatrix, dist, rvecs, tvecs = cv.calibrateCamera(objpoints, imgpoints, frameSize, None, None).
    Any idea ?

    • @NicolaiAI
      @NicolaiAI  9 หลายเดือนก่อน

      Images are not loaded in correctly

    • @malghaddcap
      @malghaddcap 2 หลายเดือนก่อน

      Make sure the checkerboard dimensions are correct. It should match the number of inner corners (not squares) along the rows and columns. For example, a 7x9 (7 horizontal squares and 9 vertical squares) is actually 6x8 (6 horizontal inner corners and 8 vertical inner corners).

  • @maddiebender1413
    @maddiebender1413 6 หลายเดือนก่อน

    Can you show a link to the calibration image you used? Also, is the frame size in mm?

  • @HASOOO54
    @HASOOO54 ปีที่แล้ว +2

    1. don't you have to take into account the pixel density on each device when creating a checkerboard pattern? Or what do you have to take into account?
    2. where can one create a suitable checkerboard pattern?

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว +2

      No the pixel density doesn’t really matter. Just make sure u are able to detect the corners correctly and maybe use some sub pixel/corner refinement.
      U can just download checkerboards on google. There are some generators

    • @luisjomen2aS
      @luisjomen2aS ปีที่แล้ว +1

      Wouldn't it mean that you zooming in would alter the size of the checkerboard and thus biased the tangential distortion ?@@NicolaiAI

  • @FassiaOuanre
    @FassiaOuanre 8 หลายเดือนก่อน +1

    good evening how are you? I'm studying on a school project and I need to calibrate the camera I'm using. So I followed your tutorial then I retrieved your script from your git account, now I have a problem when I execute the code. I have an error regarding this part:
    img = cv.imread('cali5.png')
    h, w = img.shape[:2]
    newCameraMatrix, king = cv.getOptimalNewCameraMatrix(cameraMatrix, dist, (w,h), 1, (w,h))
    Here is the error that appears:
    AttributeError: 'NoneType' object has no attribute 'shape'
    I'm asking for your help.
    Good evening.

    • @alessandramenezes4813
      @alessandramenezes4813 8 หลายเดือนก่อน

      Did you solve this problem? how?

    • @rangowang9432
      @rangowang9432 7 หลายเดือนก่อน

      img = cv.imread('cali5.png')
      you should use your existing picture and make sure the path is right.
      like: "img = cv.imread('xxx/xxx.png')"

  • @cyberhard
    @cyberhard ปีที่แล้ว +1

    What is the link for the longer calibration video? Does a camera need to be calibrated? What is the value in calibration?

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว +1

      This is the link for the longer video: Camera Calibration in Python with OpenCV - Python Script with Images
      th-cam.com/video/3h7wgR5fYik/w-d-xo.html
      U don’t have to calibrate it but can be used to remove distortion and get the intrinsic parameters of the camera which can be used for many things

    • @cyberhard
      @cyberhard ปีที่แล้ว +1

      @@NicolaiAI Thanks for the response.

  • @bellomayowa6993
    @bellomayowa6993 ปีที่แล้ว +1

    Hello, How often do we need to do camera calibration. once per camera or for everytime you move the camera

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว +1

      Just once per camera if u are only interested in the intrinsic parameters

    • @bellomayowa6993
      @bellomayowa6993 ปีที่แล้ว +1

      @@NicolaiAI thank you so much. I really appreciate it

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      @@bellomayowa6993 ur welcome

    • @kevinwoodrobotics
      @kevinwoodrobotics ปีที่แล้ว +1

      It depends on your application. If your camera is under extreme environment conditions or if you want very precise accuracy, you may need to calibrate your camera more frequently since your intrinsic camera parameters could potentially change over time. Temperature changes can often cause physical changes to your camera. But if you are using it in very controlled environment and accuracy is not super important, you may get away with only calibrating once.

  • @saadsaad17
    @saadsaad17 ปีที่แล้ว +4

    Should not the chessboardSize be equal to (10,7)?

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Nope u should specify the number of corners in the chessboard in each row and column

    • @saadsaad17
      @saadsaad17 ปีที่แล้ว +1

      @@NicolaiAI The chessboard displayed on the tablet screen has 10 corners and 7 corners in each row and column respectively. Great work on your videos btw, they are helpful and well organized, keep it up :D

  • @MatthewJohnSinoCruz
    @MatthewJohnSinoCruz ปีที่แล้ว +1

    is it really required to have the chessboard? I have been trying other images, the code just not work with other images

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Nope this specific code needs to be with a chessboard and is also the easiest by far. You can just print a chessboard or even just try out with one in your phone or tablet

  • @ArvindKumar-qh8sg
    @ArvindKumar-qh8sg ปีที่แล้ว +1

    what is the unit of the mean error given in the result? Thanks!

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว +1

      It’s pixels from the reprojection

  • @rangowang9432
    @rangowang9432 7 หลายเดือนก่อน

    Hi, bro . I have tried your code with about 15 pictures and everything is going well. But the total error is too much high, my error is 0.236623....!
    It;s just so much high and I think the cameramtx and dist are not accurate enough in this way. Can you give me some suggestions about how can I have the same small error like you have showed in your video. Thanks.

    • @rayanelahmadi3543
      @rayanelahmadi3543 6 หลายเดือนก่อน

      Same issue here

    • @nursenmaranc4659
      @nursenmaranc4659 27 วันที่ผ่านมา

      did u find any way to decrease the error

  • @shortylikeamelody
    @shortylikeamelody ปีที่แล้ว +1

    Hi, thanks for the video. I'm trying to run your program on my dataset (11 photos taken from a GoPro MAX) but the 'ret' boolean always stays at false so the chessboard is never detected. The images are well read by the program, any clue why this problem occurs ?

    • @kevinwoodrobotics
      @kevinwoodrobotics ปีที่แล้ว

      You may want to play around with how close or far your chessboard is to your camera

  • @paweskrzypczak1650
    @paweskrzypczak1650 ปีที่แล้ว +1

    What is the camera?

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Just a standard cheap webcam haha

  • @JReinhoud
    @JReinhoud ปีที่แล้ว +1

    Just curious, isnt ChArUco a better pattern for calibration?

  • @kanangurbanov8282
    @kanangurbanov8282 ปีที่แล้ว

    Could you please explain how to do it with 24 color card? I need to calibrate it with these 24 colors , not with chessboard

    • @notnotalwen4891
      @notnotalwen4891 ปีที่แล้ว

      if the pattern is checkered, count the size of the board, so if your board is like 24x24 the chess size is 23x23, or if your board is 24x20 the chess size is 23x19, hope you see the pattern here

  • @0xc026
    @0xc026 ปีที่แล้ว

    what is img = cv.imread('cali5.png')?

    • @ScottFoust
      @ScottFoust ปีที่แล้ว

      I was stuck on this for a while as well. If you watch his video closely, you'll notice that is just the name of one of his calibration images. Just rename it to one of your own.

    • @gokcesenahocaoglu8631
      @gokcesenahocaoglu8631 ปีที่แล้ว

      @@ScottFoust Hello, I am also having the same problem. Can you tell me how to get the calibration images?

  • @cpuwolf
    @cpuwolf ปีที่แล้ว +1

    it was a headache where to get chessboard, iPad is definitely a easy way to go

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว +1

      Yeah for sure! Or u can also just print out one

  • @engchoontan8483
    @engchoontan8483 ปีที่แล้ว

    Target = objective-purpose
    For each objective-purpose
    = Audio soft-limit(min-max) hard-limit(min-max) slope(min-max)
    = Video focus hunt-track(min-max) gradation-slope(min-max), focus(min-max) gradation-slope(min-max)
    Nowadays, digital rubbish looks really bad on TV, even professional camera and professional studio. Digital camera with old manual lens with hands-brains for those missing parameters should make the hunting-focus less zombie-jumping lousy.

    • @engchoontan8483
      @engchoontan8483 ปีที่แล้ว

      There is the gimbal and record at 2k to post-process to 1080p as digital-stabilization. There is no optical stabilization in my books. I am not a zombie. For military, hunt and track and other layers should be drag drop priority-table.

    • @engchoontan8483
      @engchoontan8483 ปีที่แล้ว

      Real time with - it's complicated, I don't know, anything, ... Apply to men.

    • @engchoontan8483
      @engchoontan8483 ปีที่แล้ว

      Apache helmet with Lidar and artillery calculator and construction civil engineering 3D modelling and range-finder scope tech is useless to such people. Add helmet with Range(min-max), slope(min-max), if you think millennials are smarter.

    • @engchoontan8483
      @engchoontan8483 ปีที่แล้ว

      2 rectangle is keystone compensation for data discard shift. Bellows in old-school terminology.

    • @engchoontan8483
      @engchoontan8483 ปีที่แล้ว

      Baseline target-board
      = old cartoon for analog paper tune
      = Japanese anime for color proofing
      = China MMonline games for response-time of processor and pixels
      = Korean MMo for bandwidth and network of smart TV-monitor
      = Movies CGI titanic for the point when SGI lot to Linix-beowulf-culsters
      = American animation movies for DVD and Blu ray
      = Focusing issues not present in cartoons for kids before-after year ... Always...

  • @resh0tka
    @resh0tka 3 หลายเดือนก่อน

    why the fuck do you make code dark?