Initializes camera and logs various feature values.
19{
22
25
27 auto mode = cam.
getParam<std::string>(
"AcquisitionMode");
29
30 auto fpsEnable = cam.
getParam<
bool>(
"AcquisitionFrameRateEnable");
31 auto fps = cam.
getParam<
double>(
"AcquisitionFrameRate");
34
37
39
40 auto newExposure = std::chrono::microseconds(15000);
41 auto actualNewExposure = cam.
setExposure(newExposure);
43 "New exposure set to: {}, actual value now: {}",
46
47
48 auto newAcquisitionFrameRateEnable = true;
49 auto actualAcquisitionFrameRateEnable =
50 cam.
setParam(
"AcquisitionFrameRateEnable", newAcquisitionFrameRateEnable);
52 "New acquisition frame rate enablement set to: {}, actual value now: {}",
53 newAcquisitionFrameRateEnable,
54 actualAcquisitionFrameRateEnable);
55 auto newAcquisitionFrameRate = 12.5;
56 auto actualAcquisitionFrameRate = cam.
setParam(
"AcquisitionFrameRate", newAcquisitionFrameRate);
58 "New acquisition frame rate set to: {}, actual value now: {}",
59 newAcquisitionFrameRate,
60 actualAcquisitionFrameRate);
61
62
63 cam.
setParam(
"AcquisitionMode",
"SingleFrame");
65
66
68 {"OffsetX", 0},
69 {"OffsetY", 0},
70 {"Height", 124},
71 });
73
76 if(image.IsEmpty()) {
78 } else {
80 "Captured image: {}x{} ({} bytes)", image.GetHeight(), image.GetWidth(), image.GetSize());
81 }
82
87
90}
std::string cameraStatusAsString() const
Get current camera status.
image_t captureImage(std::optional< irsol::types::duration_t > timeout=std::nullopt)
Capture a single image from the camera.
T setParam(const std::string ¶m, T value)
Set a camera parameter of arbitrary type T.
T getParam(const std::string ¶m) const
Retrieve a camera parameter of arbitrary type T.
irsol::types::duration_t setExposure(irsol::types::duration_t exposure)
Set the exposure time of the camera.
void setMultiParam(const std::unordered_map< std::string, camera_param_t > ¶ms)
Set multiple parameters in one call.
irsol::types::duration_t getExposure() const
Get the current exposure time from the camera.
#define IRSOL_LOG_INFO(...)
Logs an info-level message using the default logger.
#define IRSOL_LOG_WARN(...)
Logs a warning-level message using the default logger.
std::string discoverCameraFeatures(Interface &cam)
Discovers all camera features and their permissions.
std::string durationToString(irsol::types::duration_t dr)
Converts a duration to a human-readable string.