UnitreeCameraSDK
1.0.1
unitree stereo camra apis
|
this class integrate camera control and stereo vision algorithm More...
#include <StereoCameraCommon.hpp>
Public Member Functions | |
StereoCamera (void) | |
StereoCamera. More... | |
StereoCamera (std::string fileName) | |
StereoCamera (int deviceNode) | |
virtual | ~StereoCamera () |
StereoCamera destructor. More... | |
virtual bool | isOpened (void) |
get stereo camera running status More... | |
virtual bool | setLogLevel (int level) |
set stereo camera ouput log level More... | |
virtual bool | setPosNumber (int posNumber) |
set stereo camera position number More... | |
virtual bool | setSerialNumber (int serialNumber) |
set stereo camera serial number More... | |
virtual bool | setRawFrameRate (int frameRate) |
set stereo camera FPS (Frames Per Seconds) More... | |
virtual bool | setRawFrameSize (cv::Size frameSize) |
set stereo camera frame size More... | |
virtual bool | setRectFrameSize (cv::Size frameSize) |
set rectification image size More... | |
virtual bool | setCalibParams (std::vector< cv::Mat > paramsArray, bool flag=false) |
set stereo camera calibration parameters More... | |
virtual int | getLogLevel (void) const |
get log system output level More... | |
virtual int | getDeviceNode (void) const |
get camera device node More... | |
virtual int | getPosNumber (void) const |
get stereo camera device node More... | |
virtual int | getSerialNumber (void) const |
get stereo camera serial number More... | |
virtual float | getRawFrameRate (void) const |
get stereo camera capture frame rate More... | |
virtual cv::Size | getRawFrameSize (void) const |
get stereo camera frame size More... | |
virtual bool | getRawFrame (cv::Mat &frame, std::chrono::microseconds &timeStamp) |
get stereo camera raw frame More... | |
virtual bool | getStereoFrame (cv::Mat &left, cv::Mat &right, std::chrono::microseconds &timeStamp) |
get stereo camera left and right image More... | |
virtual bool | getDepthFrame (cv::Mat &depth, bool color, std::chrono::microseconds &timeStamp) |
get stereo camera depth image More... | |
virtual bool | getPointCloud (std::vector< cv::Vec3f > &pcl, std::chrono::microseconds &timeStamp) |
virtual bool | getPointCloud (std::vector< PCLType > &pcl, std::chrono::microseconds &timeStamp) |
virtual bool | getCalibParams (std::vector< cv::Mat > ¶msArray, bool flag=false) |
get stereo camera calibration paramerters More... | |
virtual bool | getRectStereoFrame (cv::Mat &left, cv::Mat &right, cv::Mat &feim) |
virtual bool | getRectStereoFrame (cv::Mat &left, cv::Mat &right, cv::Mat &feim, std::chrono::microseconds &timeStamp) |
virtual bool | loadConfig (std::string fileName) |
load stereo camera config parameters More... | |
virtual bool | loadCalibParams (std::string fileName) |
load stereo camera calibration params More... | |
virtual bool | saveConfig (std::string fileName="stereo_camera_config.yaml") |
save stereo camera settings to config file More... | |
virtual bool | saveCalibParams (std::string fileName="stereo_camera_calibparams.yaml") |
save stereo camera calibration parameters to file More... | |
virtual bool | startCapture (bool udpFlag=false, bool shmFlag=false) |
start stereo camera capture thread More... | |
virtual bool | startStereoCompute (void) |
start stereo camera computing disparity thread More... | |
virtual bool | stopStereoCompute (void) |
stop stereo camera computing disparity thread More... | |
virtual bool | stopCapture (void) |
stop stereo camera capture thread More... | |
this class integrate camera control and stereo vision algorithm
this class is the base of UnitreeCameraSDK, it includes many functions, such as camera frame capturing, image rectification, disparity computation, generating point cloud and etc.
StereoCamera::StereoCamera | ( | void | ) |
StereoCamera constructor overload.
default constructor
[in] | None | |
[out] | None |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
use camera config file to init stereo camera
[in] | fileName | camera config file, include file path, for example: ~/test/stereoConfig.yaml |
[out] | None |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
use camera device node number to init stereo camera
[in] | deviceNode | camera device node, for example: /dev/video0, camera device node: 0 |
[out] | None |
|
virtual |
StereoCamera destructor.
release all stereo camera resource
[in] | None | |
[out] | None |
|
virtual |
get stereo camera calibration paramerters
calibration paramerters include: camera intrinsic matrix, camera distortion coefficient, xi(mei model), rotation matrix, translation vector, rectification image intrinsic matrix
[in] | flag | default false, false: get left camera parameters, true: get right camera parameters. |
[out] | paramsArray | arrange Array element as follows: intrinsic,distortion,xi,rotation,translation,kfe |
|
virtual |
get stereo camera depth image
[in] | color | true: depth is color image, false:depth is gray image |
[out] | depth | left image |
[out] | timeStamp | frame time stamp |
|
virtual |
get camera device node
[in] | None | |
[out] | None |
|
virtual |
get log system output level
[in] | None | |
[out] | None |
|
virtual |
get stereo camera device node
[in] | None | |
[out] | None |
|
virtual |
get stereo camera raw frame
[in] | None | |
[out] | frame | raw frame, include left and right image |
[out] | timeStamp | raw frame time stamp |
|
virtual |
get stereo camera capture frame rate
[in] | None | |
[out] | None |
|
virtual |
get stereo camera frame size
[in] | None | |
[out] | None |
|
virtual |
get stereo camera serial number
this number is same as robot serial number
[in] | None | |
[out] | None |
|
virtual |
get stereo camera left and right image
[in] | None | |
[out] | left | left image |
[out] | right | right image |
[out] | timeStamp | frame time stamp |
|
virtual |
get stereo camera running status
detect camera is opened or closed
[in] | None | |
[out] | None |
|
virtual |
load stereo camera calibration params
calibration paramerters include: camera intrinsic matrix, camera distortion coefficient, xi(mei model), rotation matrix, translation vector, rectification image intrinsic matrix, etc.
[in] | fileName | calibration file name: include file path, for example: "path_to/calib.yaml" |
[out] | None |
|
virtual |
load stereo camera config parameters
parameters include: LogLevel,Threshold,Algorithm,IpLastSegment, DeviceNode,FrameSize,RectifyFrameSize,FrameRate, etc.
[in] | fileName | config name: include config path, for example: "path_to/config.yaml" |
[out] | None |
|
virtual |
save stereo camera calibration parameters to file
[in] | fileName | default name: stereo_camera_calibparams.yaml, output file: include file path, for example: "path_to/calib.yaml" |
[out] | None |
|
virtual |
save stereo camera settings to config file
[in] | fileName | default name: stereo_camera_config.yaml, output config file: include file path, for example: "path_to/config.yaml" |
[out] | None |
|
virtual |
set stereo camera calibration parameters
calibration paramerters include: camera intrinsic matrix, camera distortion coefficient, xi(mei model), rotation matrix, translation vector, rectification image intrinsic matrix
[in] | paramsArray | arrange Array element as follows: intrinsic,distortion,xi,rotation,translation,kfe |
[in] | flag | false: set left camera params, true: right camera params |
[out] | None |
|
virtual |
set stereo camera ouput log level
log level means that different kind of information will be output
[in] | level | |
[out] | None |
|
virtual |
set stereo camera position number
position number means that the number of camera location in robot body
[in] | posNumber | |
[out] | None |
|
virtual |
set stereo camera FPS (Frames Per Seconds)
for 1856X800 FPS:30, for 928x400 FPS:30 or 60
[in] | frameRate | |
[out] | None |
|
virtual |
set stereo camera frame size
There are two choise: 1856X800,928x400.
[in] | frameSize | |
[out] | None |
|
virtual |
set rectification image size
this size should keep ratio as camera raw image size, for example: raw single frame size: 928x800 rectification image size: 464x400 or 232x200
[in] | frameSize | |
[out] | None |
|
virtual |
set stereo camera serial number
serial number same as robot serial number
[in] | serialNumber | |
[out] | None |
|
virtual |
start stereo camera capture thread
[in] | udpFlag | default false, true: enable using H264 encode camera frame and send it by gstream udp command |
[in] | shmFlag | default false, true: enable using share memory to share camera frame |
[out] | None |
|
virtual |
start stereo camera computing disparity thread
[in] | None | |
[out] | None |
|
virtual |
stop stereo camera capture thread
[in] | None | |
[out] | None |
|
virtual |
stop stereo camera computing disparity thread
[in] | None | |
[out] | None |