8#include <cvb/driver/stream.hpp>
9#include <cvb/device_factory.hpp>
11#include <cvb/spectral/spectral.hpp>
12#include <cvb/spectral/cube.hpp>
13#include <cvb/spectral/wrapped_cube.hpp>
19 imgVec.reserve(numImg);
21 driverPath = Cvb::ExpandPath(driverPath);
24 auto stream = device->Stream();
29 for (
int i = 0; i < numImg; ++i)
37 imgVec.push_back(img);
50 int numberOfImages = 100;
51 Cvb::String vinDriverPath(Cvb::ExpandPath(Cvb::InstallPath() + CVB_LIT(
"drivers/GenICam.vin")));
52 std::cout <<
"Start acquiring " << numberOfImages <<
" images from:\n\t" << vinDriverPath << std::endl;
58 auto metaData = stackedCube->MetaData();
62 for (
int i = 0; i < bandsOut; ++i)
63 wavelengths.at(i) = 400 + i;
66 Cvb::String enviHeaderFile(Cvb::ExpandPath(CVB_LIT(
"StackedCube.hdr")));
67 Cvb::String enviBinaryFile(Cvb::ExpandPath(CVB_LIT(
"StackedCube.bin")));
68 stackedCube->Save(enviHeaderFile, enviBinaryFile);
70 << enviHeaderFile <<
"\n\t"
71 << enviBinaryFile << std::endl;
static std::shared_ptr< T > Open(const String &provider, AcquisitionStack acquisitionStack=AcquisitionStack::PreferVin)
Opens a device with the given provider with its default board and port (if applicable).
Definition: decl_device_factory.hpp:50
static std::unique_ptr< Cube > FromImages(const std::vector< ImagePtr > &images, CubeEncoding bufferLayout)
Initializes a stacked cube using an array of images.
Definition: cube.hpp:106
@ Bands
The number of bands.
@ Wavelength
Array of wavelengths with the unit given in FieldID::WavelengthUnit.
WaitStatus
Status after waiting for an image to be returned.
Definition: global.hpp:351
@ Timeout
A timeout occurred, no image buffer has been returned.