Skip to content

Commit cdab27b

Browse files
author
tsing
committed
Added design graph (dia)
1 parent e6ce4ff commit cdab27b

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

doc/setup.dia

2.17 KB
Binary file not shown.

src/lib/core/Camera.h

+16-4
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ class Camera
8080
// The threshold is used filter out invalid pixels
8181
std::vector<unsigned char> thresholds_; //!< Threshold for each pixel with in [0,255],
8282
public:
83+
8384
Camera() = delete;
85+
8486
/*
8587
* Construction of a camera, it takes the name and the resolution
8688
* of the camera.
@@ -98,16 +100,22 @@ class Camera
98100

99101
// Get a mask by index
100102
bool queryMask(const size_t &idx){return shadowMask_.getBit(idx);}
103+
101104
// Set the value of mask to one at given index
102105
void setMask(const size_t &idx){ shadowMask_.setBit(idx);}
106+
103107
// Clear the value of mask to one at given index
104108
void clearMask(const size_t &idx){ shadowMask_.clearBit(idx);}
109+
105110
uchar getWhiteThreshold() const {return whiteThreshold_;}
111+
106112
uchar getblackThreshold() const {return blackThreshold_;}
113+
107114
virtual const cv::Mat& getColorFrame() const
108115
{
109116
return litImage_;
110117
}
118+
111119
glm::vec3 getColor(size_t x, size_t y) const
112120
{
113121
auto color = litImage_.at<cv::Vec3b>(y, x);
@@ -117,26 +125,30 @@ class Camera
117125
float r = (float)color.val[2];
118126
return vec3(r, g, b);
119127
}
128+
120129
glm::vec3 getColor(size_t idx) const
121130
{
122131
return getColor(idx/resY_, idx%resY_);
123132
}
124133

125134
// Interfaces
126135
/**
127-
* @brief Get a ray in world space by given pixel
136+
*! Get a ray in world space by given pixel
128137
*
129-
* @param x x coordinate of pixel
130-
* @param y y coordinate of pixel
138+
* \param x x coordinate of pixel
139+
* \param y y coordinate of pixel
131140
*
132-
* @return Ray shot from camera to this pixel
141+
* \return Ray shot from camera to this pixel
133142
*/
134143

135144
// Reconstruction relies on find intersection of two rays at the same point
136145
// from two cameras. The rays can be get from the following functions.
137146
virtual Ray getRay(const size_t &x, const size_t &y)=0;
147+
138148
virtual Ray getRay(const size_t &idx)=0;
149+
139150
virtual void setResolution(const size_t &x, const size_t &y) {resX_ = x; resY_ = y;}
151+
140152
virtual ~Camera(){}
141153

142154
// Load camera intrinsic/extrinsic parameters and distortion from file

src/lib/core/Reconstructor.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
namespace SLS
2424
{
2525
/**
26-
* @brief Reconstructor
26+
*! Reconstructor
2727
* Reconstructor takes images from cameras to
2828
* reconstruct objects into the point cloud
2929
*/
@@ -32,8 +32,6 @@ class Reconstructor
3232
protected:
3333
std::vector<Camera*> cameras_;
3434
Projector* projector_;
35-
//std::vector<float> pointCloud_;
36-
//PointCloud pointCloud_;
3735
std::vector<uint> idx_;
3836
public:
3937
Reconstructor():projector_{nullptr}{};

0 commit comments

Comments
 (0)