Differences
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:30] – pontusr | documentation:vision:camera_calibration [2023/01/25 05:49] (current) – marcusn | ||
---|---|---|---|
Line 5: | Line 5: | ||
===== OpenCV ===== | ===== OpenCV ===== | ||
- | This approach is based on the opencv documentation for camera calibration in the following [[https:// | + | This approach is based on the opencv documentation for camera calibration in the following [[https:// |
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:// | 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:// | ||
Line 19: | Line 19: | ||
< | < | ||
- | In which case one should check that the camera works and sends frames to the compute | + | In which case one should check that the camera works and sends frames to the computer |
- | 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 | + | 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 |
< | < | ||
Line 33: | Line 33: | ||
The intrinsic camera parameters for a specific camera can be computed from a set of images of checkerboards taken by that camera, this is implemented in [[https:// | The intrinsic camera parameters for a specific camera can be computed from a set of images of checkerboards taken by that camera, this is implemented in [[https:// | ||
- | ^ Argument Name ^ Description | + | ^ Argument Name ^ Description |
- | | -height | + | | -height |
- | | -width | + | | -width |
- | | -size | Length of checkerboard squares in millimeters. | + | | -size | Length of checkerboard squares in millimeters. |
- | | -f | name of folder where images are stored. Camera parameters are also saved in this folder. True or False. | + | | -f | name of folder where images are stored. Camera parameters are also saved in this folder. True or False. |
- | | -pause | + | | -pause |
The script prints the result for each image wether it was able to detect a checkerboard or not, if the wrong height and width are supplied the checkerboard might still be detected in 1 in 10 images depending on how incorrect the values are. If the values are correct, however, the checkerboard should be detected in all but the blurriest pictures as long as the whole checkerboard is in the image. | The script prints the result for each image wether it was able to detect a checkerboard or not, if the wrong height and width are supplied the checkerboard might still be detected in 1 in 10 images depending on how incorrect the values are. If the values are correct, however, the checkerboard should be detected in all but the blurriest pictures as long as the whole checkerboard is in the image. | ||
Line 48: | Line 48: | ||
| 2 | distort | $k_1$, $k_2$, $p_1$, $p_2$, $k_3$ | | | 2 | distort | $k_1$, $k_2$, $p_1$, $p_2$, $k_3$ | | ||
- | The first tuple, calib, contains the intrinstic camera matrix where $f_x$ and $f_y$ are the focal lengths in the $x$- and $y$-direction and ($c_x$, $c_y$) is the location of the pixel center. | + | The first tuple, calib, contains the intrinstic camera matrix where $f_x$ and $f_y$ are the focal lengths in the $x$- and $y$-direction and ($c_x$, $c_y$) is the location of the pixel center. The distortion parameters $k_1$, $k_2$, $p_1$, $p_2$ and $k_3$ are parameters which estimate how much straight lines captured by the camera are bent. This bending effect can be removed with the help of opencv' |
- | + | ||
- | The distortion parameters $k_1$, $k_2$, $p_1$, $p_2$ and $k_3$ are parameters which estimate how much straight lines captured by the camera are bent. This bending effect can be removed with the help of opencv' | + | |
===== SkiROS ===== | ===== SkiROS ===== |