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!");
87 if(!calibrationFolder.empty() && !cameraName.empty())
91 UWARN(
"Missing calibration files for camera \"%s\" in \"%s\" folder, you should calibrate the camera!",
92 cameraName.c_str(), calibrationFolder.c_str());
96 UINFO(
"Stereo parameters: fx=%f cx=%f cy=%f baseline=%f",
108 UERROR(
"Parameter \"rectifyImages\" is set, but no stereo model is loaded or valid.");
116 bool success =
false;
130 UERROR(
"Cameras don't have the same number of images (%d vs %d)",
136 UERROR(
"Cannot initialize the second camera.");
178 cv::Mat leftImage = left.
imageRaw();
179 cv::Mat rightImage = right.
imageRaw();
180 if(rightImage.type() != CV_8UC1)
183 cv::cvtColor(rightImage, tmp, CV_BGR2GRAY);
void setPath(const std::string &dir)
StereoCameraModel stereoModel_
void setImagesRectified(bool enabled)
const Transform & getLocalTransform() const
virtual SensorData captureImage(CameraInfo *info=0)
virtual bool init(const std::string &calibrationFolder=".", const std::string &cameraName="")
virtual SensorData captureImage(CameraInfo *info=0)
unsigned int imagesCount() const
const LaserScan & laserScanRaw() const
const Transform & groundTruth() const
const cv::Mat & imageRaw() const
bool uStrContains(const std::string &string, const std::string &substring)
std::list< std::string > uSplit(const std::string &str, char separator= ' ')
SensorData takeImage(CameraInfo *info=0)
Wrappers of STL for convenient functions.
CameraStereoImages(const std::string &pathLeftImages, const std::string &pathRightImages, bool rectifyImages=false, float imageRate=0.0f, const Transform &localTransform=CameraModel::opticalRotation())
bool isValidForProjection() const
const CameraModel & left() const
void setBayerMode(int mode)
virtual ~CameraStereoImages()
cv::Mat rectifyImage(const cv::Mat &raw, int interpolation=cv::INTER_LINEAR) const
std::vector< V > uListToVector(const std::list< V > &list)
bool load(const std::string &directory, const std::string &cameraName, bool ignoreStereoTransform=true)
bool isValidForRectification() const
const CameraModel & right() const
virtual std::string getSerial() 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")
virtual bool isCalibrated() const
void setGroundTruth(const Transform &pose)
void setLocalTransform(const Transform &transform)
void setImageSize(const cv::Size &size)
bool isImagesRectified() const
const std::string & name() const