30 #include <opencv2/imgproc/types_c.h> 41 const std::string & pathLeftImages,
42 const std::string & pathRightImages,
53 const std::string & pathLeftRightImages,
73 UERROR(
"The path is empty!");
86 UINFO(
"Calibration folder: \"%s\", name=\"%s\"", calibrationFolder.c_str(), cameraName.c_str());
89 if(!calibrationFolder.empty() && !cameraName.empty())
93 UWARN(
"Missing calibration files for camera \"%s\" in \"%s\" folder, you should calibrate the camera!",
94 cameraName.c_str(), calibrationFolder.c_str());
98 UINFO(
"Stereo parameters: fx=%f cx=%f cy=%f baseline=%f",
110 UWARN(
"Parameter \"rectifyImages\" is set, but no stereo model is loaded or valid for rectification. This can be ignored if input images are already rectified.");
117 bool success =
false;
131 UERROR(
"Cameras don't have the same number of images (%d vs %d)",
137 UERROR(
"Cannot initialize the second camera.");
180 cv::Mat leftImage = left.
imageRaw();
181 cv::Mat rightImage = right.
imageRaw();
182 if(rightImage.type() != CV_8UC1)
185 cv::cvtColor(rightImage, tmp, CV_BGR2GRAY);
void setPath(const std::string &dir)
StereoCameraModel stereoModel_
bool isValidForProjection() const
void setImagesRectified(bool enabled)
virtual SensorData captureImage(CameraInfo *info=0)
bool isImagesRectified() const
virtual std::string getSerial() const
virtual bool isCalibrated() const
virtual bool init(const std::string &calibrationFolder=".", const std::string &cameraName="")
virtual SensorData captureImage(CameraInfo *info=0)
bool isValidForRectification() const
bool uStrContains(const std::string &string, const std::string &substring)
const std::string & name() const
SensorData takeImage(CameraInfo *info=0)
Wrappers of STL for convenient functions.
std::list< std::string > uSplit(const std::string &str, char separator=' ')
void setBayerMode(int mode)
virtual ~CameraStereoImages()
const cv::Mat & imageRaw() const
CameraStereoImages(const std::string &pathLeftImages, const std::string &pathRightImages, bool rectifyImages=false, float imageRate=0.0f, const Transform &localTransform=Transform::getIdentity())
unsigned int imagesCount() const
const Transform & getLocalTransform() const
std::vector< V > uListToVector(const std::list< V > &list)
bool load(const std::string &directory, const std::string &cameraName, bool ignoreStereoTransform=true)
const Transform & groundTruth() const
const LaserScan & laserScanRaw() const
cv::Mat rectifyImage(const cv::Mat &raw, int interpolation=cv::INTER_LINEAR) const
virtual bool init(const std::string &calibrationFolder=".", const std::string &cameraName="")
void setName(const std::string &name, const std::string &leftSuffix="left", const std::string &rightSuffix="right")
void setGroundTruth(const Transform &pose)
void setLocalTransform(const Transform &transform)
void setImageSize(const cv::Size &size)
const CameraModel & right() const
const CameraModel & left() const