You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.markdown
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ The goal of this tutorial is to learn how to calibrate a camera given a set of c
5
5
6
6
*Test data*: use images in your data/chess folder.
7
7
8
-
- Compile opencv with samples by setting BUILD_EXAMPLES to ON in cmake configuration.
8
+
- Compile OpenCV with samples by setting BUILD_EXAMPLES to ON in cmake configuration.
9
9
10
10
- Go to bin folder and use imagelist_creator to create an XML/YAML list of your images.
11
11
@@ -14,32 +14,32 @@ The goal of this tutorial is to learn how to calibrate a camera given a set of c
14
14
Pose estimation
15
15
---------------
16
16
17
-
Now, let us write a code that detects a chessboard in a new image and finds its distance from the
18
-
camera. You can apply the same method to any object with known 3D geometry that you can detect in an
17
+
Now, let us write code that detects a chessboard in an image and finds its distance from the
18
+
camera. You can apply this method to any object with known 3D geometry; which you detect in an
19
19
image.
20
20
21
21
*Test data*: use chess_test\*.jpg images from your data folder.
22
22
23
-
- Create an empty console project. Load a test image: :
23
+
- Create an empty console project. Load a test image :
24
24
25
25
Mat img = imread(argv[1], IMREAD_GRAYSCALE);
26
26
27
-
- Detect a chessboard in this image using findChessboard function. :
27
+
- Detect a chessboard in this image using findChessboard function :
28
28
29
29
bool found = findChessboardCorners( img, boardSize, ptvec, CALIB_CB_ADAPTIVE_THRESH );
30
30
31
31
- Now, write a function that generates a vector\<Point3f\> array of 3d coordinates of a chessboard
32
32
in any coordinate system. For simplicity, let us choose a system such that one of the chessboard
33
-
corners is in the origin and the board is in the plane *z = 0*.
33
+
corners is in the origin and the board is in the plane *z = 0*
34
34
35
-
- Read camera parameters from XML/YAML file: :
35
+
- Read camera parameters from XML/YAML file :
36
36
37
-
FileStorage fs(filename, FileStorage::READ);
37
+
FileStorage fs(filename, FileStorage::READ);
38
38
Mat intrinsics, distortion;
39
39
fs["camera_matrix"] >> intrinsics;
40
40
fs["distortion_coefficients"] >> distortion;
41
41
42
-
- Now we are ready to find chessboard pose by running \`solvePnP\`: :
42
+
- Now we are ready to find a chessboard pose by running \`solvePnP\` :
43
43
44
44
vector<Point3f> boardPoints;
45
45
// fill the array
@@ -51,4 +51,5 @@ image.
51
51
- Calculate reprojection error like it is done in calibration sample (see
52
52
opencv/samples/cpp/calibration.cpp, function computeReprojectionErrors).
53
53
54
-
Question: how to calculate the distance from the camera origin to any of the corners?
54
+
Question: how would you calculate distance from the camera origin to any one of the corners?
55
+
Answer: As our image lies in a 3D space, firstly we would calculate the relative camera pose. This would give us 3D to 2D correspondences. Next, we can apply a simple L2 norm to calculate distance between any point (end point for corners).
Although we got most of our images in a 2D format they do come from a 3D world. Here you will learn
5
-
how to find out from the 2D images information about the 3D world.
4
+
Although we get most of our images in a 2D format they do come from a 3D world. Here you will learn how to find out 3D world information from 2D images.
Copy file name to clipboardExpand all lines: doc/tutorials/gpu/gpu-basics-similarity/gpu_basics_similarity.markdown
+33-33Lines changed: 33 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,14 @@ Goal
6
6
----
7
7
8
8
In the @ref tutorial_video_input_psnr_ssim tutorial I already presented the PSNR and SSIM methods for checking
9
-
the similarity between the two images. And as you could see there performing these takes quite some
10
-
time, especially in the case of the SSIM. However, if the performance numbers of an OpenCV
9
+
the similarity between the two images. And as you could see, the execution process takes quite some
10
+
time, especially in the case of the SSIM. However, if the performance numbers of an OpenCV
11
11
implementation for the CPU do not satisfy you and you happen to have an NVidia CUDA GPU device in
12
-
your system all is not lost. You may try to port or write your algorithm for the video card.
12
+
your system, all is not lost. You may try to port or write your owm algorithm for the video card.
13
13
14
14
This tutorial will give a good grasp on how to approach coding by using the GPU module of OpenCV. As
15
15
a prerequisite you should already know how to handle the core, highgui and imgproc modules. So, our
16
-
goals are:
16
+
main goals are:
17
17
18
18
- What's different compared to the CPU?
19
19
- Create the GPU code for the PSNR and SSIM
@@ -22,8 +22,8 @@ goals are:
22
22
The source code
23
23
---------------
24
24
25
-
You may also find the source code and these video file in the
26
-
`samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity`folder of the OpenCV
25
+
You may also find the source code and the video file in the
26
+
`samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity`directory of the OpenCV
27
27
source library or download it from [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity.cpp).
28
28
The full source code is quite long (due to the controlling of the application via the command line
29
29
arguments and performance measurement). Therefore, to avoid cluttering up these sections with those
0 commit comments