MYNT EYE SDK  v1.8
https://www.slightech.com/camera
mynteye::Camera Class Reference

The main class to use the MYNT EYE camera. More...

Public Member Functions

 Camera ()
 Constructor. More...
 
 ~Camera ()
 Destructor. More...
 
void SetMode (const Mode &mode)
 Sets mode. More...
 
void SetScale (float scale)
 Sets scale factor to the grabbed images. More...
 
ErrorCode Open (const InitParameters &params)
 Opens the MYNE EYE camera. More...
 
bool IsOpened ()
 Tests if the camera is opened. More...
 
ErrorCode SetRate (const Rate &rate)
 Sets framerate & IMU frequency. More...
 
std::string GetHardWareVersion ()
 Gets hard ware version. More...
 
std::int32_t GetControlProperty (const ControlProperty &prop)
 Gets control property value. More...
 
ErrorCode SetControlProperty (const ControlProperty &prop, std::int32_t value)
 Sets control property value. More...
 
ErrorCode RequestEraseChip ()
 Requests erase chip. More...
 
ErrorCode RequestZeroDriftCalibration ()
 Requests zero drift calibration. More...
 
void ActivateAsyncGrabFeature (bool keep_imu_frequency=false)
 Activates async grap feature. More...
 
void DeactivateAsyncGrabFeature ()
 Deactivates async grap feature.
 
bool IsAsyncGrabFeatureActivated ()
 Tests if the async grap feature is activated. More...
 
void ActivateDepthMapFeature ()
 Activates depth map feature.
 
void DeactivateDepthMapFeature ()
 Deactivates depth map feature.
 
bool IsDepthMapFeatureActivated ()
 Tests if the depth map feature is activated. More...
 
void ActivatePointCloudFeature ()
 Activates point cloud feature.
 
void DeactivatePointCloudFeature ()
 Deactivates point cloud feature.
 
bool IsPointCloudFeatureActivated ()
 Tests if the point cloud feature is activated. More...
 
void SetGrabErrorCallback (GrabErrorCallback callback)
 Sets grab error callback.
 
void SetGrabProcessCallbacks (GrabPreProcessCallback pre_callback, GrabPostProcessCallback post_callback)
 Sets process grab callbacks.
 
void SetRectifyProcessCallbacks (RectifyPreProcessCallback pre_callback, RectifyPostProcessCallback post_callback)
 Sets process rectification callbacks.
 
void SetDepthMapProcessCallbacks (DepthMapPreProcessCallback pre_callback, DepthMapPostProcessCallback post_callback)
 Sets process depth map callbacks.
 
void SetPointCloudProcessCallbacks (PointCloudPreProcessCallback pre_callback, PointCloudPostProcessCallback post_callback)
 Sets process point cloud callbacks.
 
ErrorCode Grab ()
 Grabs the new image, and process it. More...
 
ErrorCode RetrieveImage (cv::Mat &mat, const View &view=View::VIEW_LEFT)
 Retrieves a image of wanted type. More...
 
ErrorCode RetrieveIMUData (std::vector< IMUData > &imudatas)
 Retrieves the IMU datas. More...
 
ErrorCode RetrieveIMUData (std::vector< IMUData > &imudatas, std::uint32_t &timestamp)
 Retrieves the IMU datas. More...
 
std::uint32_t GetTimestamp ()
 Returns the lastest hardware timestamp which indicates when retrieved. More...
 
std::uint16_t GetExposureTime ()
 Returns the exposure time. More...
 
Resolution GetResolution ()
 Returns the current image size. More...
 
CameraInformation GetCameraInformation ()
 Returns the camera informations. More...
 
CalibrationParameters GetCalibrationParameters ()
 Returns the calibration parameters. More...
 
std::uint64_t GetDroppedCount (const Process &proc)
 Returns the dropped count in some process. More...
 
void Close ()
 Closes the camera and free the memory.
 
void ActivatePlugin (const std::string &libpath)
 Activates plugin. More...
 
void DeactivatePlugin ()
 Deactivates plugin.
 
bool IsPluginActivated ()
 Tests if plugin is activated. More...
 
bool IsFirmwareLatest ()
 Tests if firmware is latest. More...
 

Static Public Member Functions

static std::string GetSDKRoot ()
 Returns the SDK root directory. More...
 
static std::string GetSDKVersion ()
 Returns the SDK version. More...
 

Detailed Description

The main class to use the MYNT EYE camera.

Constructor & Destructor Documentation

◆ Camera()

mynteye::Camera::Camera ( )

Constructor.

◆ ~Camera()

mynteye::Camera::~Camera ( )

Destructor.

Member Function Documentation

◆ ActivateAsyncGrabFeature()

void mynteye::Camera::ActivateAsyncGrabFeature ( bool  keep_imu_frequency = false)

Activates async grap feature.

Parameters
keep_imu_frequencywhether keep imu frequency or not.

◆ ActivatePlugin()

void mynteye::Camera::ActivatePlugin ( const std::string &  libpath)

Activates plugin.

Parameters
libpaththe plugin library path.

◆ GetCalibrationParameters()

CalibrationParameters mynteye::Camera::GetCalibrationParameters ( )

Returns the calibration parameters.

Returns
the calibration parameters.

◆ GetCameraInformation()

CameraInformation mynteye::Camera::GetCameraInformation ( )

Returns the camera informations.

Returns
the camera informations.

◆ GetControlProperty()

std::int32_t mynteye::Camera::GetControlProperty ( const ControlProperty prop)

Gets control property value.

Parameters
propthe control property, see ControlProperty.
Returns
the control property value, -1 means failed.
Note
Only supported on Linux now.

◆ GetDroppedCount()

std::uint64_t mynteye::Camera::GetDroppedCount ( const Process proc)

Returns the dropped count in some process.

Returns
the dropped count in some process.

◆ GetExposureTime()

std::uint16_t mynteye::Camera::GetExposureTime ( )

Returns the exposure time.

Note
The value range is [1,480]. It means the [min,max] of different frame rates.
ratemaxthe exposure time
10 fps14.99 msGetExposureTime() * 14.99 / 480 ms
25 fps18.03 msGetExposureTime() * 18.03 / 480 ms
50 fps17.81 msGetExposureTime() * 17.81 / 480 ms
Returns
the exposure time.

◆ GetHardWareVersion()

std::string mynteye::Camera::GetHardWareVersion ( )

Gets hard ware version.

Returns
::hard ware version.
Note
Only supported on Linux now.

◆ GetResolution()

Resolution mynteye::Camera::GetResolution ( )

Returns the current image size.

Returns
the current image size.

◆ GetSDKRoot()

static std::string mynteye::Camera::GetSDKRoot ( )
static

Returns the SDK root directory.

Returns
the SDK root directory.

◆ GetSDKVersion()

static std::string mynteye::Camera::GetSDKVersion ( )
static

Returns the SDK version.

Returns
the SDK version.

◆ GetTimestamp()

std::uint32_t mynteye::Camera::GetTimestamp ( )

Returns the lastest hardware timestamp which indicates when retrieved.

the raw images and imu datas. It's the elapsed time after camera working, in unit 0.1ms.

Returns
the hardware timestamp.

◆ Grab()

ErrorCode mynteye::Camera::Grab ( )

Grabs the new image, and process it.

Note
The grabbing function is typically called in the main loop.
If ActivateAsyncGrabFeature(), you should SetGrabErrorCallback() to listen the grab error. And this method only return ERROR_CAMERA_GRAB_FAILED if there is not a new frame (it will block a moment to wait for grabbing).
Returns
SUCCESS if ok, otherwise error.

◆ IsAsyncGrabFeatureActivated()

bool mynteye::Camera::IsAsyncGrabFeatureActivated ( )

Tests if the async grap feature is activated.

Returns
true if activated.

◆ IsDepthMapFeatureActivated()

bool mynteye::Camera::IsDepthMapFeatureActivated ( )

Tests if the depth map feature is activated.

Returns
true if activated.

◆ IsFirmwareLatest()

bool mynteye::Camera::IsFirmwareLatest ( )

Tests if firmware is latest.

Returns
true if latest.

◆ IsOpened()

bool mynteye::Camera::IsOpened ( )

Tests if the camera is opened.

Returns
true if opened.

◆ IsPluginActivated()

bool mynteye::Camera::IsPluginActivated ( )

Tests if plugin is activated.

Returns
true if activated.

◆ IsPointCloudFeatureActivated()

bool mynteye::Camera::IsPointCloudFeatureActivated ( )

Tests if the point cloud feature is activated.

Returns
true if activated.

◆ Open()

ErrorCode mynteye::Camera::Open ( const InitParameters params)

Opens the MYNE EYE camera.

Returns
SUCCESS if ok, otherwise error.

◆ RequestEraseChip()

ErrorCode mynteye::Camera::RequestEraseChip ( )

Requests erase chip.

Returns
SUCCESS if ok, otherwise failed.
Note
Only supported on Linux now.

◆ RequestZeroDriftCalibration()

ErrorCode mynteye::Camera::RequestZeroDriftCalibration ( )

Requests zero drift calibration.

Returns
SUCCESS if ok, otherwise failed.
Note
Only supported on Linux now.

◆ RetrieveImage()

ErrorCode mynteye::Camera::RetrieveImage ( cv::Mat &  mat,
const View view = View::VIEW_LEFT 
)

Retrieves a image of wanted type.

Parameters
matthe Mat to store the image.
viewdefines the image type wanted, see View.
Returns
SUCCESS if ok, otherwise error.
Note
The retrieve function should be called after the function Camera::Grab.

◆ RetrieveIMUData() [1/2]

ErrorCode mynteye::Camera::RetrieveIMUData ( std::vector< IMUData > &  imudatas)

Retrieves the IMU datas.

Parameters
imudatasthe given IMU datas.
Returns
SUCCESS if ok, otherwise error.

◆ RetrieveIMUData() [2/2]

ErrorCode mynteye::Camera::RetrieveIMUData ( std::vector< IMUData > &  imudatas,
std::uint32_t &  timestamp 
)

Retrieves the IMU datas.

Parameters
imudatasthe given IMU datas.
timestampthe hardware timestamp which elapsed after camera working, in unit 0.1ms.
Returns
SUCCESS if ok, otherwise error.
Deprecated:

◆ SetControlProperty()

ErrorCode mynteye::Camera::SetControlProperty ( const ControlProperty prop,
std::int32_t  value 
)

Sets control property value.

Parameters
propthe control property, see ControlProperty.
valuethe control property value.
Returns
SUCCESS if ok, otherwise failed.
Note
Only supported on Linux now.

◆ SetMode()

void mynteye::Camera::SetMode ( const Mode mode)

Sets mode.

default: MODE_AUTO_DETECT

Parameters
modethe compute mode.
See also
Mode

◆ SetRate()

ErrorCode mynteye::Camera::SetRate ( const Rate rate)

Sets framerate & IMU frequency.

Returns
SUCCESS if ok, otherwise failed.
Note
Only supported on Linux now.

◆ SetScale()

void mynteye::Camera::SetScale ( float  scale)

Sets scale factor to the grabbed images.

Parameters
scalethe scale factor.