Skip to content

Commit 8c96c4f

Browse files
author
tsing
committed
Docs
1 parent 5982af6 commit 8c96c4f

File tree

5 files changed

+50
-50
lines changed

5 files changed

+50
-50
lines changed

src/app/App.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int main(int argc, char** argv)
6565
// Initialize a reconstruct
6666
SLS::ReconstructorCPU reconstruct;
6767

68-
// Run reconstructio and get the point cloud
68+
// Run reconstruction and get the point cloud
6969
auto pointCloud = reconstruct.reconstruct(bucketsVec);
7070

7171
// Get extension of output file

src/app/CalibrateCamera.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ int main(int argc, char** argv)
1111
ImageFileProcessor cam("calibCam");
1212

1313
// Calibrator takes a camera as input and output camera configuration.
14-
std::cout<<"Input param: "<<p.get<std::string>("images")<<std::endl;
15-
Calibrator::Calibrate(&cam, "../../data/alexander/rightCam/calib", p.get<std::string>("output"));
14+
Calibrator::Calibrate(&cam, p.get<std::string>("images"), p.get<std::string>("output"));
1615
return 0;
1716
}

src/lib/core/ImageProcessor.h

+36-18
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@ using Buckets = std::vector<Bucket>;
3232

3333
/*! Base class of image processor
3434
*
35-
* The camera defined here is a specific image input device for reconstruction
36-
* which includes the full acquisition pipeline.
37-
*
35+
* The image processor includes the full acquisition pipeline.
3836
* ```
39-
* +-------+ +-----------+ +--------+ +--------+
40-
* | Get | |Undistort | |Compute | |Cast |
41-
* | Image +-->Image +->Mask +--->Ray |
42-
* +-------+ +-----------+ +--------+ +--------+
37+
* +-------+ +-----------+ +--------+ +--------+ +--------+
38+
* | Get | |Undistort | |Compute | |Cast | |Genearte|
39+
* | Image +-->Image +->Mask +--->Ray +--->Buckets |
40+
* +-------+ +-----------+ +--------+ +--------+ +--------+
4341
* ```
4442
*
4543
* * The image acquisition is implemented as a forward iterator (getNextFrame)
@@ -53,9 +51,26 @@ using Buckets = std::vector<Bucket>;
5351
* than a threshold, the pixel is considered invalid and would be `0` in the
5452
* mask.
5553
*
56-
* * The camera can also cast a ray into the 3D space based on the intrinsic
54+
* * The camera casts a ray into the 3D space based on the intrinsic
5755
* parameters.
5856
*
57+
* * A buckets of rays is generated to pass to reconstructor.
58+
*
59+
* The Buckets is the data structure to hash the ray into projector pixel indices.
60+
*
61+
* ```
62+
* ProjPixels(Buckets) Rays
63+
* +------------------+ +---+---+---+
64+
* | 0 +->+R0 |R1 |R2 |
65+
* +------------------+ +-------+---+
66+
* | 1 +->+R3 |
67+
* +------------------+ +----
68+
*
69+
* +------------------+ +---+
70+
* | n +->+Rm |
71+
* +------------------+ +---+
72+
*
73+
* ```
5974
*/
6075
class ImageProcessor {
6176
protected:
@@ -103,7 +118,7 @@ class ImageProcessor {
103118
y = resY_;
104119
}
105120

106-
const unsigned char &getThreashold(const size_t &idx)
121+
const unsigned char &getThreshold(const size_t &idx)
107122
{
108123
return thresholds_[idx];
109124
}
@@ -134,18 +149,21 @@ class ImageProcessor {
134149

135150
// Interfaces
136151
/**
137-
*! Get a ray in world space by given pixel
152+
*! Get a ray in world space by given pixel
153+
* \param x x coordinate of pixel
154+
* \param y y coordinate of pixel
155+
*
156+
* \return Ray shot from camera to this pixel
157+
*/
158+
virtual Ray getRay(const size_t &x, const size_t &y) = 0;
159+
160+
/**
161+
* ! Get a ray by pixel index.
138162
*
139-
* \param x x coordinate of pixel
140-
* \param y y coordinate of pixel
163+
* \param idx pixel index
141164
*
142-
* \return Ray shot from camera to this pixel
165+
* \returns Ray shot from the pixel.
143166
*/
144-
145-
// Reconstruction relies on find intersection of two rays at the same point
146-
// from two cameras. The rays can be get from the following functions.
147-
virtual Ray getRay(const size_t &x, const size_t &y) = 0;
148-
149167
virtual Ray getRay(const size_t &idx) = 0;
150168

151169
virtual void setResolution(const size_t &x, const size_t &y)

src/lib/core/ReconstructorCPU.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ std::array<glm::vec3, 2> ReconstructorCPU::intersectionOfBucketMinDist_(
5050
}
5151

5252
PointCloud ReconstructorCPU::reconstruct(
53-
const std::vector<Buckets>& multiBuckets)
53+
const std::vector<Buckets>& bucketsArray)
5454
{
5555
PointCloud res;
5656
LOG::startTimer();
57-
for (size_t i = 0; i < multiBuckets[0].size(); i++) {
57+
for (size_t i = 0; i < bucketsArray[0].size(); i++) {
5858
std::array<glm::vec3, 2> point =
59-
intersectionOfBucket_(multiBuckets[0][i], multiBuckets[1][i]);
59+
intersectionOfBucket_(bucketsArray[0][i], bucketsArray[1][i]);
6060
if (glm::all(glm::equal(point[0], glm::vec3(0.0))) &&
6161
glm::all(glm::equal(point[1], glm::vec3(0.0))))
6262
continue;

src/lib/core/ReconstructorCPU.h

+9-26
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,7 @@
66
namespace SLS {
77

88
// CPU reconstructor
9-
/*! Reconstruction buckets of cameras
10-
*
11-
* In the reconstruction, camera pixels are assigned to different projector
12-
* pixels.
13-
* Generally, one projector pixels contains more than one camera pixel. For each
14-
* camera, we assign
15-
* pixels to projector pixels, and call those projector pixels buckets.
16-
* ```
17-
* ProjPixels(Buckets) Camera pixels
18-
* +------------------+ +---+---+---+
19-
* | 0 +->+ | | |
20-
* +------------------+ +-------+---+
21-
* | 1 +->+ |
22-
* +------------------+ +----
23-
*
24-
* +------------------+ +---+---+
25-
* | n +->+ | |
26-
* +------------------+ +---+---+
27-
*
28-
* ```
29-
* The camera pixels in the same bucket of two different cameras are considered
30-
* correspondent pixels,
31-
* depth then can be extracted from those pixels.
9+
/*! Reconstruct point cloud from buckets provided by image processor.
3210
*/
3311
class ReconstructorCPU : public Reconstructor {
3412
private:
@@ -60,8 +38,13 @@ class ReconstructorCPU : public Reconstructor {
6038

6139
public:
6240

63-
// Interfaces
64-
//! Reconstruct point cloud.
65-
PointCloud reconstruct(const std::vector<Buckets>& multiBuckets) override;
41+
/**
42+
* !Synopsis
43+
*
44+
* \param bucketsArray buckets for reconstruction
45+
*
46+
* \returns Point cloud
47+
*/
48+
PointCloud reconstruct(const std::vector<Buckets>& bucketsArray) override;
6649
};
6750
} // namespace SLS

0 commit comments

Comments
 (0)