This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision |
documentation:vision:camera_calibration [2023/01/22 21:44] – pontusr | documentation:vision:camera_calibration [2023/01/25 05:49] (current) – marcusn |
---|
===== OpenCV ===== | ===== OpenCV ===== |
| |
This approach is based on the opencv documentation for camera calibration in the following [[https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html | link]]. The repository in the following [[https://git.cs.lth.se/robotlab/camera_calibration | link]] implements camera calibration with as well as picture taking with realsense cameras. This repository was written by Pontus Rosqvist, Josefin Gustafsson, Markus Nagy and Martin Lyrå. | This approach is based on the opencv documentation for camera calibration in the following [[https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html | link]]. The repository in the following [[https://git.cs.lth.se/robotlab/camera_calibration | link]] implements camera calibration with as well as picture taking with realsense cameras. This repository was written by Pontus Rosqvist, Josefin Gustafsson, Marcus Nagy and Martin Lyrå. |
| |
The code for camera calibration expects images of checkerboards taken with the camera for which we need to compute the instrinsic camera parameters. The size of the checkerboard needs to be supplied since the opencv function [[https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#ga93efa9b0aa890de240ca32b11253dd4a | findChessboardCorners]] needs to know how many points it is looking for and the entire chessboard needs to be visible in every image. The height and width of the chessboard which needs to be specified is not the height and width of the chessboard in squares but rather the heigth and width of the inner corners (points between squares). For example a normal chessboard is 8 by 8 if you count the squares but if we count the inner corners it is 7 by 7 so we would supply 7 by 7 to the function. | The code for camera calibration expects images of checkerboards taken with the camera for which we need to compute the instrinsic camera parameters. The size of the checkerboard needs to be supplied since the opencv function [[https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#ga93efa9b0aa890de240ca32b11253dd4a | findChessboardCorners]] needs to know how many points it is looking for and the entire chessboard needs to be visible in every image. The height and width of the chessboard which needs to be specified is not the height and width of the chessboard in squares but rather the heigth and width of the inner corners (points between squares). For example a normal chessboard is 8 by 8 if you count the squares but if we count the inner corners it is 7 by 7 so we would supply 7 by 7 to the function. |
<code>RuntimeError: Frame didn't arrive within 5000</code> | <code>RuntimeError: Frame didn't arrive within 5000</code> |
| |
In which case one should check that the camera works and sends frames to the compute with realsense-viewer. | In which case one should check that the camera works and sends frames to the computer with realsense-viewer. |
| |
It is very important to check if the camera is recognized as a USB2 device or USB3 device since USB2 supports a smaller sets of resolution than USB3. If a resolution that is not possible is requested (for example if the camera is detected as a USB2 device and the expected resolution is too big) the pipeline throws the following error: | It is very important to check if the camera is recognized as a USB2 device or USB3 device since USB2 supports a smaller sets of resolution than USB3. If a resolution that is not possible is requested (for example if the camera is detected as a USB2 device and the expected resolution is too big) the pipeline throws the following error: |