Skip to content

Commit 9df5d66

Browse files
committed
Revise all while editing slides
1 parent fb4b9b6 commit 9df5d66

10 files changed

Lines changed: 27 additions & 25 deletions

msvs/3dv_tutorial.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "video_stabilization", "vide
77
EndProject
88
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "visual_odometry_epipolar", "visual_odometry_epipolar\visual_odometry_epipolar.vcxproj", "{5549C427-BA0F-48AF-B3A0-029A8B57E71F}"
99
EndProject
10-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "image_generation", "image_generation\image_generation.vcxproj", "{27C07F93-22C6-4ACD-A55B-B449F2212937}"
10+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "image_formation", "image_formation\image_formation.vcxproj", "{27C07F93-22C6-4ACD-A55B-B449F2212937}"
1111
EndProject
1212
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "camera_calibration", "camera_calibration\camera_calibration.vcxproj", "{8FE6C6CB-6D5D-4745-A4CE-0621BC8633B9}"
1313
EndProject

msvs/image_generation/image_generation.vcxproj renamed to msvs/image_formation/image_formation.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
</Link>
8585
</ItemDefinitionGroup>
8686
<ItemGroup>
87-
<ClCompile Include="..\..\src\image_generation.cpp" />
87+
<ClCompile Include="..\..\src\image_formation.cpp" />
8888
</ItemGroup>
8989
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
9090
<ImportGroup Label="ExtensionTargets">

msvs/image_generation/image_generation.user renamed to msvs/image_formation/image_formation.vcxproj.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
99
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
1010
</PropertyGroup>
11-
</Project>
11+
</Project>

src/bundle_adjustment.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ int main(void)
88
int n_views = 5;
99

1010
// Load multiple views of 'box.xyz'
11-
// c.f. You need to run 'image_generation%02d.cpp' to generate point observation.
11+
// c.f. You need to run 'image_formation%02d.cpp' to generate point observation.
1212
// You can apply Gaussian noise by change value of 'camera_noise' if necessay.
1313
std::vector<std::vector<cv::Point2d> > xs;
1414
for (int i = 0; i < n_views; i++)
1515
{
16-
FILE* fin = fopen(cv::format("image_generation%d.xyz", i).c_str(), "rt");
16+
FILE* fin = fopen(cv::format("image_formation%d.xyz", i).c_str(), "rt");
1717
if (fin == NULL) return -1;
1818
std::vector<cv::Point2d> pts;
1919
while (!feof(fin))
@@ -26,6 +26,8 @@ int main(void)
2626
xs.push_back(pts);
2727
if (xs.front().size() != xs.back().size()) return -1;
2828
}
29+
30+
// Assume that all feature points are visible
2931
std::vector<int> visible_all(xs.front().size(), 1);
3032
std::vector<std::vector<int> > visibility(n_views, visible_all);
3133

@@ -37,7 +39,7 @@ int main(void)
3739
Rs.push_back(cv::Mat::eye(3, 3, CV_64F)); // R for the first camera (index: 0)
3840
ts.push_back(cv::Mat::zeros(3, 1, CV_64F)); // t for the first camera (index: 0)
3941

40-
// Esitmate relative pose of the inital two views
42+
// Estimate relative pose of the inital two views (epipolar geometry)
4143
cv::Mat F = cv::findFundamentalMat(xs[0], xs[1], cv::FM_8POINT);
4244
cv::Mat E = K.t() * F * K;
4345
cv::Mat R, t;

src/distortion_correction.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ int main(void)
3131
cv::imshow("3DV Tutorial: Distortion Correction", image);
3232
int key = cv::waitKey(1);
3333
if (key == 27) break; // 'ESC' key: Exit
34-
else if (key == 9) show_rectify = !show_rectify; // 'Tab' key: Toggle rectificaiton
34+
else if (key == 9) show_rectify = !show_rectify; // 'Tab' key: Toggle rectification
3535
else if (key == 32) // 'Space' key: Pause
3636
{
3737
key = cv::waitKey();
3838
if (key == 27) break; // 'ESC' key: Exit
39-
else if (key == 9) show_rectify = !show_rectify; // 'Tab' key: Toggle rectificaiton
39+
else if (key == 9) show_rectify = !show_rectify; // 'Tab' key: Toggle rectification
4040
}
4141
}
4242

4343
video.release();
4444
return 0;
45-
}
45+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int main(void)
4343
cv::hconcat(Rc.t(), -Rc.t() * tc, Rt);
4444
cv::Mat P = K * Rt;
4545

46-
// Project the points (c.f. OpenCV provide 'cv::projectPoints' with consideration of distortion.)
46+
// Project the points (c.f. OpenCV provide 'cv::projectPoints()' with consideration of distortion.)
4747
cv::Mat x = P * X;
4848
x.row(0) = x.row(0) / x.row(2);
4949
x.row(1) = x.row(1) / x.row(2);
@@ -61,9 +61,9 @@ int main(void)
6161
if (p.x >= 0 && p.x < camera_res.width && p.y >= 0 && p.y < camera_res.height)
6262
cv::circle(image, p, 2, 255, -1);
6363
}
64-
cv::imshow(cv::format("3DV_Tutorial: Image Generation %d", i), image);
64+
cv::imshow(cv::format("3DV_Tutorial: Image Formation %d", i), image);
6565

66-
FILE* fout = fopen(cv::format("image_generation%d.xyz", i).c_str(), "wt");
66+
FILE* fout = fopen(cv::format("image_formation%d.xyz", i).c_str(), "wt");
6767
if (fout == NULL) return -1;
6868
for (int c = 0; c < x.cols; c++)
6969
fprintf(fout, "%f %f 1\n", x.at<double>(0, c), x.at<double>(1, c));

src/image_stitching.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int main(void)
1919
gray1 = image1.clone();
2020
gray2 = image2.clone();
2121
}
22-
cv::Ptr<cv::FeatureDetector> detector = cv::xfeatures2d::SURF::create(); // SURF features
22+
cv::Ptr<cv::FeatureDetector> detector = cv::xfeatures2d::SURF::create(); // SURF features
2323
std::vector<cv::KeyPoint> keypoint1, keypoint2;
2424
detector->detect(gray1, keypoint1);
2525
detector->detect(gray2, keypoint2);
@@ -48,4 +48,4 @@ int main(void)
4848
printf("Press any key to terminate tihs program!\n");
4949
cv::waitKey(0);
5050
return 0;
51-
}
51+
}

src/perspective_correction.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ void MouseEventHandler(int event, int x, int y, int flags, void* param)
55
if (event == cv::EVENT_LBUTTONDOWN)
66
{
77
// Add the point to the given vector
8-
std::vector<cv::Point> *points = (std::vector<cv::Point> *)param;
9-
points->push_back(cv::Point(x, y));
10-
printf("A point (index: %d) is selectd at (%d, %d).\n", points->size() - 1, x, y);
8+
std::vector<cv::Point> *points_src = (std::vector<cv::Point> *)param;
9+
points_src->push_back(cv::Point(x, y));
10+
printf("A point (index: %d) is selectd at (%d, %d).\n", points_src->size() - 1, x, y);
1111
}
1212
}
1313

@@ -51,4 +51,4 @@ int main(void)
5151
printf("Press any key to terminate tihs program!\n");
5252
cv::waitKey(0);
5353
return 0;
54-
}
54+
}

src/pose_estimation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ int main(void)
2727
for (int r = 0; r < board_pattern.height; r++)
2828
for (int c = 0; c < board_pattern.width; c++)
2929
object_points.push_back(cv::Point3f(board_cellsize * c, board_cellsize * r, 0));
30-
while (true)
30+
while (true)
3131
{
3232
// Grab an image from the video
3333
cv::Mat image;
3434
video >> image;
3535
if (image.empty()) break;
3636

37-
// Esimate camera pose
37+
// Estimate camera pose
3838
std::vector<cv::Point2f> image_points;
3939
bool complete = cv::findChessboardCorners(image, board_pattern, image_points, cv::CALIB_CB_ADAPTIVE_THRESH + cv::CALIB_CB_NORMALIZE_IMAGE + cv::CALIB_CB_FAST_CHECK);
4040
if (complete)
@@ -69,4 +69,4 @@ int main(void)
6969

7070
video.release();
7171
return 0;
72-
}
72+
}

src/triangulation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ int main(void)
66
cv::Point2d camera_center(320, 240);
77

88
// Load two views of 'box.xyz'
9-
// c.f. You need to run 'image_generation%02d.cpp' to generate point observation.
10-
// You can apply Gaussian noise by change value of 'camera_noise' if necessay.
9+
// c.f. You need to run 'image_formation%02d.cpp' to generate point observation.
10+
// You can apply Gaussian noise by change value of 'camera_noise' if necessary.
1111
std::vector<cv::Point2d> points0, points1;
12-
FILE* fin0 = fopen("image_generation0.xyz", "rt");
13-
FILE* fin1 = fopen("image_generation1.xyz", "rt");
12+
FILE* fin0 = fopen("image_formation0.xyz", "rt");
13+
FILE* fin1 = fopen("image_formation1.xyz", "rt");
1414
if (fin0 == NULL || fin1 == NULL) return -1;
1515
while (!feof(fin0) || !feof(fin1))
1616
{

0 commit comments

Comments
 (0)