37 #if CV_MAJOR_VERSION > 3 38 #include <opencv2/videoio/videoio_c.h> 56 Camera(imageRate, localTransform),
61 if ( CV_MAJOR_VERSION < 3 || ( CV_MAJOR_VERSION > 3 && CV_MINOR_VERSION < 1 ))
63 UERROR(
" OpenCV %d.%d detected, Minimum OpenCV 3.2 Required ", CV_MAJOR_VERSION,CV_MINOR_VERSION);
84 capture_.set(CV_CAP_PROP_FOURCC, CV_FOURCC(
'Y',
'1',
'6',
' '));
86 capture_.set(CV_CAP_PROP_FRAME_WIDTH, 752);
87 capture_.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
88 capture_.set(CV_CAP_PROP_CONVERT_RGB,
false);
95 unsigned int guid = (
unsigned int)
capture_.get(CV_CAP_PROP_GUID);
96 if (guid != 0 && guid != 0xffffffff)
103 if(!calibrationFolder.empty() && !
cameraName_.empty())
107 UWARN(
"Missing calibration files for camera \"%s\" in \"%s\" folder, you should calibrate the camera!",
112 UINFO(
"Stereo parameters: fx=%f cx=%f cy=%f baseline=%f",
123 UERROR(
"Parameter \"rectifyImages\" is set, but no stereo model is loaded or valid.");
145 cv::Mat img, leftImage, interLeavedFrame, rightImage;
146 std::vector<cv::Mat> StereoFrames;
147 interLeavedFrame.create(480, 752, CV_8UC2);
154 interLeavedFrame.data = img.data;
155 split(interLeavedFrame, StereoFrames);
156 leftImage=StereoFrames[0].clone();
157 rightImage=StereoFrames[1].clone();
175 ULOGGER_WARN(
"The camera must be initialized before requesting an image.");
cv::VideoCapture capture_
bool isValidForProjection() const
StereoCameraModel stereoModel_
virtual ~CameraStereoTara()
Some conversion functions.
bool isValidForRectification() const
#define ULOGGER_DEBUG(...)
bool isValidForRectification() const
CameraStereoTara(int device, bool rectifyImages=false, float imageRate=0.0f, const Transform &localTransform=Transform::getIdentity())
virtual bool init(const std::string &calibrationFolder=".", const std::string &cameraName="")
const Transform & getLocalTransform() const
bool load(const std::string &directory, const std::string &cameraName, bool ignoreStereoTransform=true)
virtual bool isCalibrated() const
cv::Mat rectifyImage(const cv::Mat &raw, int interpolation=cv::INTER_LINEAR) const
#define ULOGGER_WARN(...)
virtual SensorData captureImage(CameraInfo *info=0)
virtual std::string getSerial() const
void setLocalTransform(const Transform &transform)
void setImageSize(const cv::Size &size)
std::string UTILITE_EXP uFormat(const char *fmt,...)
const CameraModel & right() const
const CameraModel & left() const