13#include <cvb/device_factory.hpp>
14#include <cvb/driver/driver.hpp>
15#include <cvb/image.hpp>
16#include <cvb/utilities/utilities.hpp>
17#include <cvb/composite.hpp>
18#include <cvb/driver/multi_part_image.hpp>
19#include <cvb/plane_enumerator.hpp>
20#include <cvb/point_cloud.hpp>
28 const constexpr auto numElemsToAcquire = 10;
39 auto device = Cvb::DeviceFactory::Open<Cvb::GenICamDevice>(infoList[0].AccessToken(), Cvb::AcquisitionStack::GenTL);
48 const auto numStreams = device->StreamCount();
55 for (
auto i = 0; i < numElemsToAcquire; i++)
63 std::cout <<
"wait status not ok: " <<
static_cast<int>(waitStatus) << std::endl;
71 if (composite->Purpose() == Cvb::CompositePurpose::PointCloud)
73 const auto numberOfElements = composite->ItemCount();
74 std::cout <<
"Found " << numberOfElements <<
" point cloud parts" << std::endl;
77 auto xyz = Cvb::get<Cvb::PlaneEnumeratorPtr>(composite->ItemAt(0));
80 std::cout <<
"Composite xyz is not a plane enumerator" << std::endl;
84 if (!Cvb::holds_alternative<Cvb::PlanePtr>(composite->ItemAt(1)))
86 std::cout <<
"Composite confidence is not a plane" << std::endl;
90 if (!Cvb::holds_alternative<Cvb::ImagePtr>(composite->ItemAt(2)))
92 std::cout <<
"Composite image is not an image" << std::endl;
106 auto rgbImage = Cvb::get<Cvb::ImagePtr>(composite->ItemAt(2));
112 composite->InsertItemAt(composite->ItemCount(), rPlane);
113 composite->InsertItemAt(composite->ItemCount(), gPlane);
114 composite->InsertItemAt(composite->ItemCount(), bPlane);
117 pointCloud->Save(
"xyzrgb.pcd");
123 std::cout <<
"The composite contains something unexpected" << std::endl;
static CompositePtr FromObject(std::shared_ptr< T > object)
Returns a composite object from the given composite compatible object.
A dense Cartesian 3D point cloud object.
Definition: decl_dense_point_cloud.hpp:31
static std::vector< DiscoveryInformation > Discover()
Discovers available devices (not vins) with a default time span of 300ms.
Definition: decl_device_factory.hpp:221
void Start() override
Starts the acquisition.
Definition: decl_composite_stream_base.hpp:349
Streams point clouds.
Definition: point_cloud_stream.hpp:20
Lazy enumeration of node maps.
Definition: node_map_enumerator.hpp:31
static PlanePtr FromImagePlane(const ImagePlane &imagePlane, PlaneRole role=PlaneRole::Undefined)
Creates a plane from an image plane.
Definition: decl_plane.hpp:69
WaitStatus
Status after waiting for an image to be returned.
Definition: global.hpp:376
@ Ok
Everything is fine, a new image arrived.
@ PixRGB_R
Red channel value.
@ PixRGB_B
Blue channel value.
@ PixRGB_G
Green channel value.