MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / display

Function display

simulation/tools/sim_test_performance.cpp:171–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void
172display()
173{
174 float* reference =
175 new float[range_likelihood_->getRowHeight() * range_likelihood_->getColWidth()];
176 const float* depth_buffer = range_likelihood_->getDepthBuffer();
177 // Copy one image from our last as a reference.
178 for (int i = 0, n = 0; i < range_likelihood_->getRowHeight(); ++i) {
179 for (int j = 0; j < range_likelihood_->getColWidth(); ++j) {
180 reference[n++] = depth_buffer
181 [(i + range_likelihood_->getRowHeight() * range_likelihood_->getRows() / 2) *
182 range_likelihood_->getWidth() +
183 j + range_likelihood_->getColWidth() * range_likelihood_->getCols() / 2];
184 }
185 }
186
187 float* reference_vis = new float[range_likelihood_visualization_->getRowHeight() *
188 range_likelihood_visualization_->getColWidth()];
189 const float* depth_buffer_vis = range_likelihood_visualization_->getDepthBuffer();
190 // Copy one image from our last as a reference.
191 for (int i = 0, n = 0; i < range_likelihood_visualization_->getRowHeight(); ++i) {
192 for (int j = 0; j < range_likelihood_visualization_->getColWidth(); ++j) {
193 reference_vis[n++] =
194 depth_buffer_vis[i * range_likelihood_visualization_->getWidth() + j];
195 }
196 }
197
198 std::vector<Eigen::Isometry3d, Eigen::aligned_allocator<Eigen::Isometry3d>> poses;
199 std::vector<float> scores;
200
201 // Render a single pose for visualization
202 poses.clear();
203 poses.push_back(camera_->getPose());
204 range_likelihood_visualization_->computeLikelihoods(reference_vis, poses, scores);
205
206 glDrawBuffer(GL_BACK);
207 glReadBuffer(GL_BACK);
208
209 // Draw the resulting images from the range_likelihood
210 glViewport(range_likelihood_visualization_->getWidth(),
211 0,
212 range_likelihood_visualization_->getWidth(),
213 range_likelihood_visualization_->getHeight());
214 glMatrixMode(GL_PROJECTION);
215 glLoadIdentity();
216 glMatrixMode(GL_MODELVIEW);
217 glLoadIdentity();
218
219 // Draw the color image
220 glColorMask(true, true, true, true);
221 glClearColor(0, 0, 0, 0);
222 glClearDepth(1);
223 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
224 glDisable(GL_DEPTH_TEST);
225
226 glRasterPos2i(-1, -1);
227 glDrawPixels(range_likelihood_visualization_->getWidth(),
228 range_likelihood_visualization_->getHeight(),

Callers

nothing calls this directly

Calls 15

getDepthBufferMethod · 0.80
getRowsMethod · 0.80
getColsMethod · 0.80
computeLikelihoodsMethod · 0.80
getColorBufferMethod · 0.80
ticMethod · 0.80
tocMethod · 0.80
toc_printMethod · 0.80
getXMethod · 0.80
getYMethod · 0.80
getScoreBufferMethod · 0.80
display_depth_imageFunction · 0.70

Tested by

no test coverage detected