![]() |
SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
|
Manages automatic camera tuning for optimal image quality. More...
#include <camera_tuner.hpp>
Public Member Functions | |
| CameraTuner (CameraTunerSettings settings={}) | |
| Construct a camera tuner with specified settings. | |
| absl::Status | SetVideoSource (std::shared_ptr< VideoSource > source) |
| Set the video source to tune. | |
| std::shared_ptr< VideoSource > | GetVideoSource () |
| Get shared pointer to the video source. | |
| absl::Status | StartTuning () |
| Start the tuning process. | |
| bool | IsTuning () const |
| Check if tuning is currently in progress. | |
| TuningStage | GetCurrentStage () const |
| Get the current tuning stage. | |
| absl::Status | ProcessFrame (presage::physiology::StatusCode status_code, int64_t frame_timestamp) |
| Process a frame during tuning (synchronous mode). | |
| absl::StatusOr< double > | GetTunedExposure () const |
| Get the tuned exposure value. | |
| absl::StatusOr< double > | GetTunedGain () const |
| Get the tuned gain value. | |
| absl::StatusOr< double > | GetTunedWhiteBalance () const |
| Get the tuned white balance value. | |
| cv::Mat | ProcessFrameForDisplay (const cv::Mat &frame) const |
| Process a frame for display with optional camera tuning overlay. | |
Manages automatic camera tuning for optimal image quality.
The CameraTuner wraps a VideoSource instance and adjusts its exposure, gain, and optionally white balance settings based on feedback from the physiology graph's status codes. It uses binary search algorithms for efficient convergence to optimal settings.
Usage:
|
explicit |
Construct a camera tuner with specified settings.
| settings | Configuration parameters for tuning process |
| TuningStage presage::smartspectra::video_source::CameraTuner::GetCurrentStage | ( | ) | const |
Get the current tuning stage.
| absl::StatusOr< double > presage::smartspectra::video_source::CameraTuner::GetTunedExposure | ( | ) | const |
Get the tuned exposure value.
| absl::StatusOr< double > presage::smartspectra::video_source::CameraTuner::GetTunedGain | ( | ) | const |
Get the tuned gain value.
| absl::StatusOr< double > presage::smartspectra::video_source::CameraTuner::GetTunedWhiteBalance | ( | ) | const |
Get the tuned white balance value.
| std::shared_ptr< VideoSource > presage::smartspectra::video_source::CameraTuner::GetVideoSource | ( | ) |
Get shared pointer to the video source.
Returns the shared video source that can be used for frame capture while the tuner adjusts settings.
| bool presage::smartspectra::video_source::CameraTuner::IsTuning | ( | ) | const |
Check if tuning is currently in progress.
| absl::Status presage::smartspectra::video_source::CameraTuner::ProcessFrame | ( | presage::physiology::StatusCode | status_code, |
| int64_t | frame_timestamp ) |
Process a frame during tuning (synchronous mode).
Analyzes the status code from the physiology graph and adjusts camera parameters accordingly. Should be called once per frame during tuning.
| status_code | Status code from physiology graph |
| frame_timestamp | Frame timestamp in microseconds |
| cv::Mat presage::smartspectra::video_source::CameraTuner::ProcessFrameForDisplay | ( | const cv::Mat & | frame | ) | const |
Process a frame for display with optional camera tuning overlay.
If camera tuning is in progress and render_calibrating_overlay is enabled, renders a semi-transparent overlay with "Tuning camera..." text on the frame.
| frame | Input frame (RGB format) |
| absl::Status presage::smartspectra::video_source::CameraTuner::SetVideoSource | ( | std::shared_ptr< VideoSource > | source | ) |
Set the video source to tune.
Shares ownership of the video source with the tuner and validates that it supports the required controls (exposure and gain at minimum).
| source | Shared pointer to the video source |
| absl::Status presage::smartspectra::video_source::CameraTuner::StartTuning | ( | ) |
Start the tuning process.
Initializes tuning state and begins Stage 0 (auto white balance) or Stage 1 (exposure search) depending on white balance support.