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++)
60 std::cout <<
"wait status not ok: " <<
static_cast<int>(waitStatus) << std::endl;
68 if (composite->Purpose() == Cvb::CompositePurpose::PointCloud)
70 const auto numberOfElements = composite->ItemCount();
71 std::cout <<
"Found " << numberOfElements <<
" point cloud parts" << std::endl;
74 auto xyz = Cvb::get<Cvb::PlaneEnumeratorPtr>(composite->ItemAt(0));
77 std::cout <<
"Composite xyz is not a plane enumerator" << std::endl;
81 if (!Cvb::holds_alternative<Cvb::PlanePtr>(composite->ItemAt(1)))
83 std::cout <<
"Composite confidence is not a plane" << std::endl;
87 if (!Cvb::holds_alternative<Cvb::ImagePtr>(composite->ItemAt(2)))
89 std::cout <<
"Composite image is not an image" << std::endl;
103 auto rgbImage = Cvb::get<Cvb::ImagePtr>(composite->ItemAt(2));
109 composite->InsertItemAt(composite->ItemCount(), rPlane);
110 composite->InsertItemAt(composite->ItemCount(), gPlane);
111 composite->InsertItemAt(composite->ItemCount(), bPlane);
114 pointCloud->Save(
"xyzrgb.pcd");
120 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
static PlanePtr FromImagePlane(const ImagePlane &imagePlane, PlaneRole role=PlaneRole::Undefined)
Creates a plane from an image plane.
Definition: decl_plane.hpp:69
@ Ok
Everything is fine, a new image arrived.
@ PixRGB_R
Red channel value.
@ PixRGB_B
Blue channel value.
@ PixRGB_G
Green channel value.