@@ -80,7 +80,9 @@ class Camera
80
80
// The threshold is used filter out invalid pixels
81
81
std::vector<unsigned char > thresholds_; // !< Threshold for each pixel with in [0,255],
82
82
public:
83
+
83
84
Camera () = delete ;
85
+
84
86
/*
85
87
* Construction of a camera, it takes the name and the resolution
86
88
* of the camera.
@@ -98,16 +100,22 @@ class Camera
98
100
99
101
// Get a mask by index
100
102
bool queryMask (const size_t &idx){return shadowMask_.getBit (idx);}
103
+
101
104
// Set the value of mask to one at given index
102
105
void setMask (const size_t &idx){ shadowMask_.setBit (idx);}
106
+
103
107
// Clear the value of mask to one at given index
104
108
void clearMask (const size_t &idx){ shadowMask_.clearBit (idx);}
109
+
105
110
uchar getWhiteThreshold () const {return whiteThreshold_;}
111
+
106
112
uchar getblackThreshold () const {return blackThreshold_;}
113
+
107
114
virtual const cv::Mat& getColorFrame () const
108
115
{
109
116
return litImage_;
110
117
}
118
+
111
119
glm::vec3 getColor (size_t x, size_t y) const
112
120
{
113
121
auto color = litImage_.at <cv::Vec3b>(y, x);
@@ -117,26 +125,30 @@ class Camera
117
125
float r = (float )color.val [2 ];
118
126
return vec3 (r, g, b);
119
127
}
128
+
120
129
glm::vec3 getColor (size_t idx) const
121
130
{
122
131
return getColor (idx/resY_, idx%resY_);
123
132
}
124
133
125
134
// Interfaces
126
135
/* *
127
- * @brief Get a ray in world space by given pixel
136
+ *! Get a ray in world space by given pixel
128
137
*
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
131
140
*
132
- * @ return Ray shot from camera to this pixel
141
+ * \ return Ray shot from camera to this pixel
133
142
*/
134
143
135
144
// Reconstruction relies on find intersection of two rays at the same point
136
145
// from two cameras. The rays can be get from the following functions.
137
146
virtual Ray getRay (const size_t &x, const size_t &y)=0;
147
+
138
148
virtual Ray getRay (const size_t &idx)=0;
149
+
139
150
virtual void setResolution (const size_t &x, const size_t &y) {resX_ = x; resY_ = y;}
151
+
140
152
virtual ~Camera (){}
141
153
142
154
// Load camera intrinsic/extrinsic parameters and distortion from file
0 commit comments