This class serves as the primary interface between the camera and the various features provided by the SDK. More...
Functions | |
CameraOne () | |
Default constructor. More... | |
~CameraOne () | |
Class destructor. More... | |
ERROR_CODE | open (const InitParametersOne init_parameters=InitParametersOne()) |
Opens the camera from the provided InitParametersOne. More... | |
bool | isOpened () |
Reports if the camera has been successfully opened. More... | |
InitParametersOne | getInitParameters () |
Returns the InitParameters used. More... | |
CameraOneInformation | getCameraInformation (Resolution image_size=Resolution(0, 0)) |
Returns the CameraOneInformation associated the camera being used. More... | |
ERROR_CODE | close () |
Close an opened camera. More... | |
float | getCurrentFPS () |
Returns the current framerate at which the grab() method is successfully called. More... | |
Timestamp | getTimestamp (TIME_REFERENCE reference_time) |
Returns the timestamp in the requested TIME_REFERENCE. More... | |
ERROR_CODE | grab () |
This method will grab the latest images from the camera. This method is meant to be called frequently in the main loop of your application. More... | |
ERROR_CODE | retrieveImage (Mat &oMat, VIEW view=VIEW::LEFT, sl::MEM mem=sl::MEM::CPU, Resolution image_size=sl::Resolution(0, 0)) |
Retrieves images from the camera. More... | |
ERROR_CODE | getSensorsData (SensorsData &oData, const TIME_REFERENCE reference_time) |
Retrieves the SensorsData (IMU) at a specific time reference. More... | |
ERROR_CODE | getCameraSettings (VIDEO_SETTINGS settings, int &setting) |
Returns the current value of the requested camera setting (gain, brightness, hue, exposure, etc.). More... | |
ERROR_CODE | getCameraSettings (VIDEO_SETTINGS settings, int &min_val, int &max_val) |
Fills the current values of the requested settings for VIDEO_SETTINGS that supports two values (min/max). More... | |
ERROR_CODE | getCameraSettings (VIDEO_SETTINGS settings, Rect &roi) |
Overloaded method for VIDEO_SETTINGS::AEC_AGC_ROI which takes a Rect as parameter. More... | |
ERROR_CODE | setCameraSettings (VIDEO_SETTINGS settings, int value=VIDEO_SETTINGS_VALUE_AUTO) |
Sets the value of the requested camera setting (gain, brightness, hue, exposure, etc.). More... | |
ERROR_CODE | setCameraSettings (VIDEO_SETTINGS settings, int min, int max) |
Sets the value of the requested camera setting that supports two values (min/max). More... | |
ERROR_CODE | setCameraSettings (VIDEO_SETTINGS settings, Rect roi, bool reset=false) |
Overloaded method for VIDEO_SETTINGS::AEC_AGC_ROI which takes a Rect as parameter. More... | |
ERROR_CODE | getCameraSettingsRange (VIDEO_SETTINGS settings, int &min, int &max) |
Get the range for the specified camera settings VIDEO_SETTINGS as min/max value. More... | |
bool | isCameraSettingSupported (VIDEO_SETTINGS setting) |
Test if the video setting is supported by the camera. More... | |
ERROR_CODE | enableRecording (RecordingParameters recording_parameters) |
Creates an SVO file to be filled by enableRecording() and disableRecording(). More... | |
RecordingStatus | getRecordingStatus () |
Get the recording information. More... | |
void | pauseRecording (bool status) |
Pauses or resumes the recording. More... | |
void | disableRecording () |
Disables the recording initiated by enableRecording() and closes the generated file. More... | |
unsigned int | getFrameDroppedCount () |
Returns the number of frames dropped since grab() was called for the first time. More... | |
int | getSVOPosition () |
Returns the current playback position in the SVO file. More... | |
int | getSVOPositionAtTimestamp (const sl::Timestamp ×tamp) |
Retrieves the frame index within the SVO file corresponding to the provided timestamp. More... | |
void | setSVOPosition (int frame_number) |
Sets the playback cursor to the desired frame number in the SVO file. More... | |
int | getSVONumberOfFrames () |
Returns the number of frames in the SVO file. More... | |
ERROR_CODE | enableStreaming (StreamingParameters streaming_parameters=StreamingParameters()) |
Creates a streaming pipeline. More... | |
void | disableStreaming () |
Disables the streaming initiated by enableStreaming(). More... | |
bool | isStreamingEnabled () |
Tells if the streaming is running. More... | |
StreamingParameters | getStreamingParameters () |
Returns the StreamingParameters used. More... | |
Static Functions | |
static ERROR_CODE | reboot () |
Performs a hardware reset of the CameraOne. More... | |
static std::vector< sl::DeviceProperties > | getDeviceList (void) |
List all the connected devices with their associated information. More... | |
This class serves as the primary interface between the camera and the various features provided by the SDK.
CameraOne | ( | ) |
Default constructor.
Creates an empty CameraOne object. Its parameters will be set when calling open() with (optional) desired InitParametersOne.
~CameraOne | ( | ) |
Class destructor.
The destructor will call the close() function and clear the memory previously allocated by the object.
ERROR_CODE open | ( | const InitParametersOne | init_parameters = InitParametersOne() | ) |
Opens the camera from the provided InitParametersOne.
init_parameters | : A structure containing all the initial parameters. Default: a preset of InitParametersOne. |
bool isOpened | ( | ) |
Reports if the camera has been successfully opened.
It has the same behavior as checking if open() returns ERROR_CODE::SUCCESS.
InitParametersOne getInitParameters | ( | ) |
Returns the InitParameters used.
It corresponds to the structure given as argument to the open() method.
CameraOneInformation getCameraInformation | ( | Resolution | image_size = Resolution(0, 0) | ) |
Returns the CameraOneInformation associated the camera being used.
To ensure accurate calibration, it is possible to specify a custom resolution as a parameter when obtaining scaled information, as calibration parameters are resolution-dependent.
When reading an SVO file, the parameters will correspond to the camera used for recording.
image_size | : You can specify a size different from the default image size to get the scaled camera information. Default = (0,0) meaning original image size (given by getCameraInformation().camera_configuration.resolution). |
ERROR_CODE close | ( | ) |
Close an opened camera.
If open() has been called, this method will close the connection to the camera (or the SVO file) and free the corresponding memory.
If open() wasn't called or failed, this method won't have any effects.
float getCurrentFPS | ( | ) |
Returns the current framerate at which the grab() method is successfully called.
The returned value is based on the difference of camera timestamps between two successful grab() calls.
Timestamp getTimestamp | ( | TIME_REFERENCE | reference_time | ) |
Returns the timestamp in the requested TIME_REFERENCE.
This function can also be used when playing back an SVO file.
reference_time | : The selected TIME_REFERENCE. |
ERROR_CODE grab | ( | ) |
This method will grab the latest images from the camera. This method is meant to be called frequently in the main loop of your application.
ERROR_CODE retrieveImage | ( | Mat & | oMat, |
VIEW | view = VIEW::LEFT , |
||
sl::MEM | mem = sl::MEM::CPU , |
||
Resolution | image_size = sl::Resolution(0, 0) |
||
) |
Retrieves images from the camera.
oMat | : The sl::Mat to store the image. The method will create the Mat if necessary at the proper resolution. If already created, it will just update its data. |
view | the desired view, currently ZED X One only provide two view, VIEW::LEFT (lens distortion free) and VIEW::LEFT_UNRECTIFIED (with the lens distortion) |
mem | the desired memory type for your output image |
image_size | : If specified, define the resolution of the output sl::Mat. If set to Resolution(0,0), the camera resolution will be taken. Default: (0,0). |
ERROR_CODE getSensorsData | ( | SensorsData & | oData, |
const TIME_REFERENCE | reference_time | ||
) |
Retrieves the SensorsData (IMU) at a specific time reference.
The delta time between previous and current values can be calculated using data.imu.timestamp
data[out] | : The SensorsData variable to store the data. |
reference_frame[in] | Defines the reference from which you want the data to be expressed. Default: REFERENCE_FRAME::WORLD. |
ERROR_CODE getCameraSettings | ( | VIDEO_SETTINGS | settings, |
int & | setting | ||
) |
Returns the current value of the requested camera setting (gain, brightness, hue, exposure, etc.).
Possible values (range) of each setting are available here.
settings | : The requested setting. |
setting | : The setting variable to fill. |
ERROR_CODE getCameraSettings | ( | VIDEO_SETTINGS | settings, |
int & | min_val, | ||
int & | max_val | ||
) |
Fills the current values of the requested settings for VIDEO_SETTINGS that supports two values (min/max).
This method only works with the following VIDEO_SETTINGS:
Possible values (range) of each setting are available here.
settings | : The requested setting. |
min_val | : The setting minimum variable to fill. |
max_val | : The setting maximum variable to fill. |
ERROR_CODE getCameraSettings | ( | VIDEO_SETTINGS | settings, |
Rect & | roi | ||
) |
Overloaded method for VIDEO_SETTINGS::AEC_AGC_ROI which takes a Rect as parameter.
setting | : Must be set at VIDEO_SETTINGS::AEC_AGC_ROI, otherwise the method will have no impact. |
roi | : Roi that will be filled. |
side | : SIDE on which to get the ROI from. |
ERROR_CODE setCameraSettings | ( | VIDEO_SETTINGS | settings, |
int | value = VIDEO_SETTINGS_VALUE_AUTO |
||
) |
Sets the value of the requested camera setting (gain, brightness, hue, exposure, etc.).
This method only applies for VIDEO_SETTINGS that require a single value.
Possible values (range) of each setting are available here.
settings | : The setting to be set. |
value | : The value to set. Default: auto mode |
ERROR_CODE setCameraSettings | ( | VIDEO_SETTINGS | settings, |
int | min, | ||
int | max | ||
) |
Sets the value of the requested camera setting that supports two values (min/max).
This method only works with the following VIDEO_SETTINGS:
Possible values (range) of each setting are available here.
settings | : The setting to be set. |
min | : The minimum value that can be reached (-1 or 0 gives full range). |
max | : The maximum value that can be reached (-1 or 0 gives full range). |
ERROR_CODE setCameraSettings | ( | VIDEO_SETTINGS | settings, |
Rect | roi, | ||
bool | reset = false |
||
) |
Overloaded method for VIDEO_SETTINGS::AEC_AGC_ROI which takes a Rect as parameter.
setting | : Must be set at VIDEO_SETTINGS::AEC_AGC_ROI, otherwise the method will have no impact. |
roi | : Rect that defines the target to be applied for AEC/AGC computation. Must be given according to camera resolution. |
side | : SIDE on which to be applied for AEC/AGC computation. |
reset | : Cancel the manual ROI and reset it to the full image. |
ERROR_CODE getCameraSettingsRange | ( | VIDEO_SETTINGS | settings, |
int & | min, | ||
int & | max | ||
) |
Get the range for the specified camera settings VIDEO_SETTINGS as min/max value.
setting | : Must be set at a valid VIDEO_SETTINGS that accepts a min/max range and available for the current camera model. |
bool isCameraSettingSupported | ( | VIDEO_SETTINGS | setting | ) |
Test if the video setting is supported by the camera.
setting | : The video setting to test |
ERROR_CODE enableRecording | ( | RecordingParameters | recording_parameters | ) |
Creates an SVO file to be filled by enableRecording() and disableRecording().
SVO files are custom video files containing the un-rectified images from the camera along with some meta-data like timestamps or IMU orientation (if applicable).
They can be used to simulate a live ZED and test a sequence with various SDK parameters.
Depending on the application, various compression modes are available. See SVO_COMPRESSION_MODE.
recording_parameters | : A structure containing all the specific parameters for the recording such as filename and compression mode. Default: a reset of RecordingParameters . |
RecordingStatus getRecordingStatus | ( | ) |
Get the recording information.
void pauseRecording | ( | bool | status | ) |
Pauses or resumes the recording.
status | : If true, the recording is paused. If false, the recording is resumed. |
void disableRecording | ( | ) |
Disables the recording initiated by enableRecording() and closes the generated file.
unsigned int getFrameDroppedCount | ( | ) |
Returns the number of frames dropped since grab() was called for the first time.
A dropped frame corresponds to a frame that never made it to the grab method.
This can happen if two frames were extracted from the camera when grab() is called. The older frame will be dropped so as to always use the latest (which minimizes latency).
int getSVOPosition | ( | ) |
Returns the current playback position in the SVO file.
The position corresponds to the number of frames already read from the SVO file, starting from 0 to n.
Each grab() call increases this value by one (except when using InitParameters::svo_real_time_mode).
int getSVOPositionAtTimestamp | ( | const sl::Timestamp & | timestamp | ) |
Retrieves the frame index within the SVO file corresponding to the provided timestamp.
timestamp | The target timestamp for which the frame index is to be determined. |
void setSVOPosition | ( | int | frame_number | ) |
Sets the playback cursor to the desired frame number in the SVO file.
This method allows you to move around within a played-back SVO file. After calling, the next call to grab() will read the provided frame number.
frame_number | : The number of the desired frame to be decoded. |
int getSVONumberOfFrames | ( | ) |
Returns the number of frames in the SVO file.
ERROR_CODE enableStreaming | ( | StreamingParameters | streaming_parameters = StreamingParameters() | ) |
Creates a streaming pipeline.
streaming_parameters | : A structure containing all the specific parameters for the streaming. Default: a reset of StreamingParameters . |
void disableStreaming | ( | ) |
Disables the streaming initiated by enableStreaming().
See enableStreaming() for an example.
bool isStreamingEnabled | ( | ) |
Tells if the streaming is running.
StreamingParameters getStreamingParameters | ( | ) |
Returns the StreamingParameters used.
It corresponds to the structure given as argument to the enableStreaming() method.
|
static |
Performs a hardware reset of the CameraOne.
|
static |
List all the connected devices with their associated information.
This method lists all the cameras available and provides their serial number, models and other information.