gc_pointcloud.cc
Go to the documentation of this file.
1 /*
2  * This file is part of the rc_genicam_api package.
3  *
4  * Copyright (c) 2017 Roboception GmbH
5  * All rights reserved
6  *
7  * Author: Heiko Hirschmueller
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  *
19  * 3. Neither the name of the copyright holder nor the names of its contributors
20  * may be used to endorse or promote products derived from this software without
21  * specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #include <rc_genicam_api/system.h>
38 #include <rc_genicam_api/device.h>
39 #include <rc_genicam_api/stream.h>
40 #include <rc_genicam_api/buffer.h>
41 #include <rc_genicam_api/image.h>
43 #include <rc_genicam_api/config.h>
44 
46 
47 #include <Base/GCException.h>
48 
49 #include <iostream>
50 #include <fstream>
51 #include <iomanip>
52 #include <cmath>
53 #include <algorithm>
54 
55 #ifdef _WIN32
56 #undef min
57 #undef max
58 #endif
59 
60 namespace
61 {
62 
63 /*
64  Print help text on standard output.
65 */
66 
67 void printHelp(const char *prgname)
68 {
69  // show help
70 
71  std::cout << prgname << " -h | [-o <output-filename>] [<interface-id>:]<device-id>" << std::endl;
72  std::cout << std::endl;
73  std::cout << "Gets the first synchronized image set of the Roboception rc_visard, consisting of left, disparity, confidence and error image, creates a point cloud and stores it in ply ascii format." << std::endl;
74  std::cout << std::endl;
75  std::cout << "Options:" << std::endl;
76  std::cout << "-h Prints help information and exits" << std::endl;
77  std::cout << "-o <file> Set name of output file (default is 'rc_visard_<timestamp>.ply')" << std::endl;
78  std::cout << std::endl;
79  std::cout << "Parameters:" << std::endl;
80  std::cout << "<interface-id> Optional GenICam ID of interface for connecting to the device" << std::endl;
81  std::cout << "<device-id> GenICam device ID, serial number or user defined name of device" << std::endl;
82 }
83 
84 /*
85  Get the i-th 16 bit value.
86 
87  @param p Pointer to first byte of array of 16 bit values.
88  @param bigendian True if values are given as big endian. Otherwise, litte
89  endian is assumed.
90  @param i Index of 16 bit inside the given array.
91 */
92 
93 inline uint16_t getUint16(const uint8_t *p, bool bigendian, size_t i)
94 {
95  uint16_t ret;
96 
97  if (bigendian)
98  {
99  size_t j=i<<1;
100  ret=static_cast<uint16_t>(((p[j]<<8)|p[j+1]));
101  }
102  else
103  {
104  size_t j=i<<1;
105  ret=static_cast<uint16_t>(((p[j+1]<<8)|p[j]));
106  }
107 
108  return ret;
109 }
110 
111 /*
112  Computes a point cloud from the given synchronized left and disparity image
113  pair and stores it in ply ascii format.
114 
115  @param name Name of output file. If empty, a standard file name with
116  timestamp is used.
117  @param f Focal length factor (to be multiplicated with image width).
118  @param t Baseline in m.
119  @param scale Disparity scale factor.
120  @param left Left camera image. The image must have format Mono8 or
121  YCbCr411_8.
122  @param disp Corresponding disparity image, possibly downscaled by an integer
123  factor. The image must be in format Coord3D_C16.
124  @param conf Optional corresponding confidence image in the same size as
125  disp. The image must be in format Confidence8.
126  @param error Optional corresponding error image in the same size as disp. The
127  image must be in format Error8.
128 */
129 
130 void storePointCloud(std::string name, double f, double t, double scale,
131  std::shared_ptr<const rcg::Image> left,
132  std::shared_ptr<const rcg::Image> disp,
133  std::shared_ptr<const rcg::Image> conf=0,
134  std::shared_ptr<const rcg::Image> error=0)
135 {
136  // get size and scale factor between left image and disparity image
137 
138  size_t width=disp->getWidth();
139  size_t height=disp->getHeight();
140  bool bigendian=disp->isBigEndian();
141  size_t ds=(left->getWidth()+disp->getWidth()-1)/disp->getWidth();
142 
143  // convert focal length factor into focal length in (disparity) pixels
144 
145  f*=width;
146 
147  // get pointer to disparity data and size of row in bytes
148 
149  const uint8_t *dps=disp->getPixels();
150  size_t dstep=disp->getWidth()*sizeof(uint16_t)+disp->getXPadding();
151 
152  // count number of valid disparities and store vertice index in a temporary
153  // index image
154 
155  size_t vi=0;
156  const uint32_t vinvalid=0xffffffff;
157  std::vector<uint32_t> vindex(width*height);
158 
159  uint32_t n=0;
160  for (size_t k=0; k<height; k++)
161  {
162  int j=0;
163  for (size_t i=0; i<width; i++)
164  {
165  vindex[vi]=vinvalid;
166  if ((dps[j]|dps[j+1]) != 0) vindex[vi]=n++;
167 
168  j+=2;
169  vi++;
170  }
171 
172  dps+=dstep;
173  }
174 
175  dps=disp->getPixels();
176 
177  // count number of triangles
178 
179  const uint16_t vstep=static_cast<uint16_t>(std::ceil(2/scale));
180 
181  int tn=0;
182  for (size_t k=1; k<height; k++)
183  {
184  for (size_t i=1; i<width; i++)
185  {
186  uint16_t v[4];
187  v[0]=getUint16(dps, bigendian, i-1);
188  v[1]=getUint16(dps, bigendian, i);
189  v[2]=getUint16(dps+dstep, bigendian, i-1);
190  v[3]=getUint16(dps+dstep, bigendian, i);
191 
192  uint16_t vmin=65535;
193  uint16_t vmax=0;
194  int valid=0;
195 
196  for (int jj=0; jj<4; jj++)
197  {
198  if (v[jj])
199  {
200  vmin=std::min(vmin, v[jj]);
201  vmax=std::max(vmax, v[jj]);
202  valid++;
203  }
204  }
205 
206  if (valid >= 3 && vmax-vmin <= vstep)
207  {
208  tn+=valid-2;
209  }
210  }
211 
212  dps+=dstep;
213  }
214 
215  dps=disp->getPixels();
216 
217  // get pointer to optional confidence and error data and size of row in bytes
218 
219  const uint8_t *cps=0, *eps=0;
220  size_t cstep=0, estep=0;
221 
222  if (conf)
223  {
224  cps=conf->getPixels();
225  cstep=conf->getWidth()*sizeof(uint8_t)+conf->getXPadding();
226  }
227 
228  if (error)
229  {
230  eps=error->getPixels();
231  estep=error->getWidth()*sizeof(uint8_t)+error->getXPadding();
232  }
233 
234  // open output file and write ASCII PLY header
235 
236  if (name.size() == 0)
237  {
239  double timestamp=left->getTimestampNS()/1000000000.0;
240  os << "rc_visard_" << std::setprecision(16) << timestamp << ".ply";
241  name=os.str();
242  }
243 
244  std::ofstream out(name);
245 
246  out << "ply" << std::endl;
247  out << "format ascii 1.0" << std::endl;
248  out << "comment Created with gc_pointcloud from Roboception GmbH" << std::endl;
249  out << "comment Camera [1 0 0; 0 1 0; 0 0 1] [0 0 0]" << std::endl;
250  out << "element vertex " << n << std::endl;
251  out << "property float32 x" << std::endl;
252  out << "property float32 y" << std::endl;
253  out << "property float32 z" << std::endl;
254  out << "property float32 scan_size" << std::endl; // i.e. size of 3D point
255 
256  if (cps != 0)
257  {
258  out << "property float32 scan_conf" << std::endl; // optional confidence
259  }
260 
261  if (eps != 0)
262  {
263  out << "property float32 scan_error" << std::endl; // optional error in 3D along line of sight
264  }
265 
266  out << "property uint8 diffuse_red" << std::endl;
267  out << "property uint8 diffuse_green" << std::endl;
268  out << "property uint8 diffuse_blue" << std::endl;
269  out << "element face " << tn << std::endl;
270  out << "property list uint8 uint32 vertex_indices" << std::endl;
271  out << "end_header" << std::endl;
272 
273  // create colored point cloud
274 
275  for (size_t k=0; k<height; k++)
276  {
277  for (size_t i=0; i<width; i++)
278  {
279  // convert disparity from fixed comma 16 bit integer into float value
280 
281  double d=scale*getUint16(dps, bigendian, i);
282 
283  // if disparity is valid and color can be obtained
284 
285  if (d)
286  {
287  // reconstruct 3D point from disparity value
288 
289  double x=(i+0.5-0.5*width)*t/d;
290  double y=(k+0.5-0.5*height)*t/d;
291  double z=f*t/d;
292 
293  // compute size of reconstructed point
294 
295  double x2=(i-0.5*width)*t/d;
296  double size=2*1.4*std::abs(x2-x);
297 
298  // get corresponding color value
299 
300  uint8_t rgb[3];
301  rcg::getColor(rgb, left, static_cast<uint32_t>(ds), static_cast<uint32_t>(i),
302  static_cast<uint32_t>(k));
303 
304  // store colored point, optionally with confidence and error
305 
306  out << x << " " << y << " " << z << " " << size << " ";
307 
308  if (cps != 0)
309  {
310  out << cps[i]/255.0 << " ";
311  }
312 
313  if (eps != 0)
314  {
315  out << eps[i]*scale*f*t/(d*d) << " ";
316  }
317 
318  out << static_cast<int>(rgb[0]) << " ";
319  out << static_cast<int>(rgb[1]) << " ";
320  out << static_cast<int>(rgb[2]) << std::endl;
321  }
322  }
323 
324  dps+=dstep;
325  cps+=cstep;
326  eps+=estep;
327  }
328 
329  dps=disp->getPixels();
330 
331  // create triangles
332 
333  uint32_t *ips=vindex.data();
334  for (size_t k=1; k<height; k++)
335  {
336  for (size_t i=1; i<width; i++)
337  {
338  uint16_t v[4];
339  v[0]=getUint16(dps, bigendian, i-1);
340  v[1]=getUint16(dps, bigendian, i);
341  v[2]=getUint16(dps+dstep, bigendian, i-1);
342  v[3]=getUint16(dps+dstep, bigendian, i);
343 
344  uint16_t vmin=65535;
345  uint16_t vmax=0;
346  int valid=0;
347 
348  for (int jj=0; jj<4; jj++)
349  {
350  if (v[jj])
351  {
352  vmin=std::min(vmin, v[jj]);
353  vmax=std::max(vmax, v[jj]);
354  valid++;
355  }
356  }
357 
358  if (valid >= 3 && vmax-vmin <= vstep)
359  {
360  int j=0;
361  uint32_t fc[4];
362 
363  if (ips[i-1] != vinvalid)
364  {
365  fc[j++]=ips[i-1];
366  }
367 
368  if (ips[width+i-1] != vinvalid)
369  {
370  fc[j++]=ips[width+i-1];
371  }
372 
373  if (ips[width+i] != vinvalid)
374  {
375  fc[j++]=ips[width+i];
376  }
377 
378  if (ips[i] != vinvalid)
379  {
380  fc[j++]=ips[i];
381  }
382 
383  out << "3 " << fc[0] << ' ' << fc[1] << ' ' << fc[2] << std::endl;
384 
385  if (j == 4)
386  {
387  out << "3 " << fc[2] << ' ' << fc[3] << ' ' << fc[0] << std::endl;
388  }
389  }
390  }
391 
392  ips+=width;
393  dps+=dstep;
394  }
395 
396  out.close();
397 }
398 
399 }
400 
401 int main(int argc, char *argv[])
402 {
403  int ret=0;
404 
405  try
406  {
407  // optional parameters
408 
409  std::string name="";
410 
411  int i=1;
412 
413  while (i+1 < argc)
414  {
415  if (std::string(argv[i]) == "-o")
416  {
417  i++;
418  name=argv[i++];
419  }
420  else
421  {
422  std::cout << "Unknown parameter: " << argv[i] << std::endl;
423  std::cout << std::endl;
424 
425  printHelp(argv[0]);
426 
427  return 1;
428  }
429  }
430 
431  if (i >= argc || std::string(argv[i]) == "-h")
432  {
433  printHelp(argv[0]);
434  return 1;
435  }
436 
437  // find specific device accross all systems and interfaces and open it
438 
439  std::shared_ptr<rcg::Device> dev=rcg::getDevice(argv[i]);
440 
441  if (dev)
442  {
443  dev->open(rcg::Device::CONTROL);
444  std::shared_ptr<GenApi::CNodeMapRef> nodemap=dev->getRemoteNodeMap();
445 
446  // get chunk adapter (this switches chunk mode on if possible and
447  // returns a null pointer if this is not possible)
448 
449  std::shared_ptr<GenApi::CChunkAdapter> chunkadapter=rcg::getChunkAdapter(nodemap, dev->getTLType());
450 
451  // get focal length, baseline and disparity scale factor
452 
453  double f=rcg::getFloat(nodemap, "FocalLengthFactor", 0, 0, false);
454  double t=rcg::getFloat(nodemap, "Baseline", 0, 0, true);
455  double scale=rcg::getFloat(nodemap, "Scan3dCoordinateScale", 0, 0, true);
456 
457  // check for special exposure alternate mode of rc_visard and
458  // corresponding filter and set tolerance accordingly
459 
460  // (The exposure alternate mode is typically used with a random dot
461  // projector connected to Out1. Alternate means that Out1 is high for
462  // every second image. The rc_visard calculates disparities from images
463  // with Out1=High. However, if the alternate filter is set to OnlyLow,
464  // then it is gueranteed that Out1=Low (i.e. projector off) for all
465  // rectified images. Thus, rectified images and disparity images are
466  // always around 40 ms appart, which must be taken into account for
467  // synchronization.)
468 
469  uint64_t tol=0;
470 
471  try
472  {
473  rcg::setEnum(nodemap, "LineSelector", "Out1", true);
474  std::string linesource=rcg::getEnum(nodemap, "LineSource", true);
475  std::string filter=rcg::getEnum(nodemap, "AcquisitionAlternateFilter", true);
476 
477  if (linesource == "ExposureAlternateActive" && filter == "OnlyLow")
478  {
479  tol=50*1000*1000; // set tolerance to 50 ms
480  }
481  }
482  catch (const std::exception &)
483  {
484  // ignore possible errors
485  }
486 
487  // sanity check of some parameters
488 
489  rcg::checkFeature(nodemap, "Scan3dOutputMode", "DisparityC");
490  rcg::checkFeature(nodemap, "Scan3dCoordinateOffset", "0");
491  rcg::checkFeature(nodemap, "Scan3dInvalidDataFlag", "1");
492  rcg::checkFeature(nodemap, "Scan3dInvalidDataValue", "0");
493 
494  // set to color format if available
495 
496  rcg::setEnum(nodemap, "PixelFormat", "YCbCr411_8", false);
497 
498  // enable left image, disparity, confidence and error image and disable
499  // all others
500 
501  {
502  std::vector<std::string> component;
503 
504  rcg::getEnum(nodemap, "ComponentSelector", component, true);
505 
506  for (size_t k=0; k<component.size(); k++)
507  {
508  rcg::setEnum(nodemap, "ComponentSelector", component[k].c_str(), true);
509 
510  bool enable=(component[k] == "Intensity" || component[k] == "Disparity" ||
511  component[k] == "Confidence" || component[k] == "Error");
512  rcg::setBoolean(nodemap, "ComponentEnable", enable, true);
513  }
514  }
515 
516  // try getting synchronized data (which only has an effect if the device
517  // and GenTL producer support multipart)
518 
519  rcg::setString(nodemap, "AcquisitionMultiPartMode", "SynchronizedComponents");
520 
521  // open image stream
522 
523  std::vector<std::shared_ptr<rcg::Stream> > stream=dev->getStreams();
524 
525  if (stream.size() > 0)
526  {
527  // opening first stream
528 
529  stream[0]->open();
530  stream[0]->startStreaming();
531 
532  // prepare buffers for time synchronization of images (buffer at most
533  // 25 images in each list)
534 
535  rcg::ImageList left_list(50);
536  rcg::ImageList disp_list(25);
537  rcg::ImageList conf_list(25);
538  rcg::ImageList error_list(25);
539 
540  bool run=true;
541  int async=0, maxasync=50; // maximum number of asynchroneous images before giving up
542 
543  while (run && async < maxasync)
544  {
545  async++;
546 
547  // grab next image with timeout
548 
549  const rcg::Buffer *buffer=stream[0]->grab(5000);
550  if (buffer != 0)
551  {
552  // check for a complete image in the buffer
553 
554  if (!buffer->getIsIncomplete())
555  {
556  // attach buffer to nodemap for accessing chunk data if possible
557 
558  if (chunkadapter)
559  {
560  chunkadapter->AttachBuffer(
561  reinterpret_cast<std::uint8_t *>(buffer->getGlobalBase()),
562  static_cast<int64_t>(buffer->getSizeFilled()));
563  }
564 
565  // go through all parts in case of multi-part buffer
566 
567  size_t partn=buffer->getNumberOfParts();
568  for (uint32_t part=0; part<partn; part++)
569  {
570  if (buffer->getImagePresent(part))
571  {
572  // store image in the corresponding list
573 
574  uint64_t left_tol=0;
575  uint64_t disp_tol=0;
576 
577  std::string component=rcg::getComponetOfPart(nodemap, buffer, part);
578 
579  if (component == "Intensity")
580  {
581  left_list.add(buffer, part);
582  disp_tol=tol;
583  }
584  else if (component == "Disparity")
585  {
586  disp_list.add(buffer, part);
587  left_tol=tol;
588  }
589  else if (component == "Confidence")
590  {
591  conf_list.add(buffer, part);
592  left_tol=tol;
593  }
594  else if (component == "Error")
595  {
596  error_list.add(buffer, part);
597  left_tol=tol;
598  }
599 
600  // get corresponding left and disparity images
601 
602  uint64_t timestamp=buffer->getTimestampNS();
603  std::shared_ptr<const rcg::Image> left=left_list.find(timestamp, left_tol);
604  std::shared_ptr<const rcg::Image> disp=disp_list.find(timestamp, disp_tol);
605 
606  // get confidence and error images that correspond to the
607  // disparity image
608 
609  std::shared_ptr<const rcg::Image> conf;
610  std::shared_ptr<const rcg::Image> error;
611 
612  if (disp)
613  {
614  conf=conf_list.find(disp->getTimestampNS());
615  error=error_list.find(disp->getTimestampNS());
616  }
617 
618  if (left && disp && conf && error)
619  {
620  // compute and store point cloud from synchronized image pair
621 
622  storePointCloud(name, f, t, scale, left, disp, conf, error);
623 
624  // remove all images from the buffer with the current or an
625  // older time stamp
626 
627  async=0;
628  left_list.removeOld(timestamp);
629  disp_list.removeOld(timestamp);
630  conf_list.removeOld(timestamp);
631  error_list.removeOld(timestamp);
632 
633  // in this example, we exit the grabbing loop after receiving
634  // the first synchronized image pair
635 
636  run=false;
637  }
638  }
639  }
640 
641  // detach buffer from nodemap
642 
643  if (chunkadapter) chunkadapter->DetachBuffer();
644  }
645  }
646  else
647  {
648  std::cerr << "Cannot grab images" << std::endl;
649  break;
650  }
651  }
652 
653  // report if synchronization failed
654 
655  if (async >= maxasync && run)
656  {
657  std::cerr << "Cannot grab synchronized left and disparity image" << std::endl;
658  ret=1;
659  }
660 
661  // stopping and closing image stream
662 
663  stream[0]->stopStreaming();
664  stream[0]->close();
665  }
666  else
667  {
668  std::cerr << "No streams available" << std::endl;
669  ret=1;
670  }
671 
672  // closing the communication to the device
673 
674  dev->close();
675  }
676  else
677  {
678  std::cerr << "Device '" << argv[1] << "' not found!" << std::endl;
679  ret=1;
680  }
681  }
682  catch (const std::exception &ex)
683  {
684  std::cerr << ex.what() << std::endl;
685  ret=2;
686  }
687  catch (const GENICAM_NAMESPACE::GenericException &ex)
688  {
689  std::cerr << "Exception: " << ex.what() << std::endl;
690  ret=2;
691  }
692  catch (...)
693  {
694  std::cerr << "Unknown exception!" << std::endl;
695  ret=2;
696  }
697 
699 
700  return ret;
701 }
std::shared_ptr< Device > getDevice(const char *id)
Searches across all transport layers and interfaces for a device.
Definition: device.cc:469
size_t getSizeFilled() const
Returns the number of bytes written into the buffer last time it has been filled. ...
Definition: buffer.cc:252
std::shared_ptr< GenApi::CChunkAdapter > getChunkAdapter(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const std::string &tltype)
Sets ChunkModeActive to 1, creates a chunk adapter for the specified transport layer and attaches it ...
Definition: config.cc:871
std::shared_ptr< const Image > find(uint64_t timestamp) const
Returns the image that has the given timestamp.
Definition: imagelist.cc:97
std::string str()
An object of this class manages a limited number of images.
Definition: imagelist.h:53
bool setEnum(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, const char *value, bool exception)
Set the value of an enumeration of the given nodemap.
Definition: config.cc:294
static void clearSystems()
Clears the internal list of systems.
Definition: system.cc:213
void removeOld(uint64_t timestamp)
Removes all images that have a timestamp that is older or equal than the given timestamp.
Definition: imagelist.cc:68
The buffer class encapsulates a Genicam buffer that is provided by a stream.
Definition: buffer.h:115
void * getGlobalBase() const
Returns the global base address of the buffer memory.
Definition: buffer.cc:164
void checkFeature(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, const char *value, bool igncache)
Checks the value of given feature and throws an exception in case of a mismatch.
Definition: config.cc:858
LOG4CPP_EXPORT CategoryStream & left(CategoryStream &os)
left manipulator
std::string getEnum(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, bool exception)
Get the value of an enumeration of the given nodemap.
Definition: config.cc:644
double abs(double x)
Definition: PolyReference.h:61
void add(const std::shared_ptr< const Image > &image)
Adds the given image to the internal list.
Definition: imagelist.cc:48
bool setString(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, const char *value, bool exception)
Set the value of a feature of the given nodemap.
Definition: config.cc:351
void getColor(uint8_t rgb[3], const std::shared_ptr< const rcg::Image > &img, uint32_t ds, uint32_t i, uint32_t k)
Expects an image in Mono8 or YCbCr411_8 format and returns the color as RGB value at the given pixel ...
Definition: image.cc:132
bool setBoolean(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, bool value, bool exception)
Set the value of a boolean feature of the given nodemap.
Definition: config.cc:99
double getFloat(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, double *vmin, double *vmax, bool exception, bool igncache)
Get the value of a double feature of the given nodemap.
Definition: config.cc:593
uint64_t getTimestampNS() const
Returns the acquisition timestamp of the data in this buffer in ns.
Definition: buffer.cc:489
bool getImagePresent(std::uint32_t part) const
Returns if a 2D, 3D or confidence image is present in the specified part.
Definition: buffer.cc:346
bool getIsIncomplete() const
Signals if the buffer is incomplete due to an error.
Definition: buffer.cc:242
GenICam&#39;s exception class.
Definition: GCException.h:62
int main(int argc, char *argv[])
std::string getComponetOfPart(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const rcg::Buffer *buffer, uint32_t ipart)
Definition: config.cc:895
virtual const char * what() const
Get error description (overwrite from std:exception)
std::uint32_t getNumberOfParts() const
Returns the number of parts, excluding chunk data.
Definition: buffer.cc:142


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:54