MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / CpuDepthPacketProcessorImpl

Class CpuDepthPacketProcessorImpl

src/cpu_depth_packet_processor.cpp:270–804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270class CpuDepthPacketProcessorImpl: public WithPerfLogging
271{
272public:
273 Mat<uint16_t> p0_table0, p0_table1, p0_table2;
274 Mat<float> x_table, z_table;
275
276 int16_t lut11to16[2048];
277
278 float trig_table0[512*424][6];
279 float trig_table1[512*424][6];
280 float trig_table2[512*424][6];
281
282 bool enable_bilateral_filter, enable_edge_filter;
283 DepthPacketProcessor::Parameters params;
284
285 Frame *ir_frame, *depth_frame;
286
287 bool flip_ptables;
288
289 CpuDepthPacketProcessorImpl()
290 {
291 newIrFrame();
292 newDepthFrame();
293
294 enable_bilateral_filter = true;
295 enable_edge_filter = true;
296
297 flip_ptables = true;
298 }
299
300 /** Allocate a new IR frame. */
301 void newIrFrame()
302 {
303 ir_frame = new Frame(512, 424, 4);
304 ir_frame->format = Frame::Float;
305 //ir_frame = new Frame(512, 424, 12);
306 }
307
308 ~CpuDepthPacketProcessorImpl()
309 {
310 delete ir_frame;
311 delete depth_frame;
312 }
313
314 /** Allocate a new depth frame. */
315 void newDepthFrame()
316 {
317 depth_frame = new Frame(512, 424, 4);
318 depth_frame->format = Frame::Float;
319 }
320
321 int32_t decodePixelMeasurement(unsigned char* data, int sub, int x, int y)
322 {
323 if (x < 1 || y < 0 || 510 < x || 423 < y)
324 {
325 return lut11to16[0];
326 }
327

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected