31 #if CV_MAJOR_VERSION > 3 32 #include <opencv2/videoio/videoio_c.h> 33 #if CV_MAJOR_VERSION > 4 34 #include <opencv2/videoio/legacy/constants_c.h> 46 Camera(imageRate, localTransform),
47 _rectifyImages(rectifyImages),
49 _usbDevice(usbDevice),
57 const std::string & filePath,
61 Camera(imageRate, localTransform),
76 bool CameraVideo::init(
const std::string & calibrationFolder,
const std::string & cameraName)
108 unsigned int guid = (
unsigned int)
_capture.get(CV_CAP_PROP_GUID);
109 if (guid != 0 && guid != 0xffffffff)
116 if(!calibrationFolder.empty() && !
_guid.empty())
120 UWARN(
"Missing calibration files for camera \"%s\" in \"%s\" folder, you should calibrate the camera!",
121 _guid.c_str(), calibrationFolder.c_str());
125 UINFO(
"Camera parameters: fx=%f fy=%f cx=%f cy=%f",
148 UERROR(
"Parameter \"rectifyImages\" is set, but no camera model is loaded or valid.");
189 UERROR(
"Camera has been disconnected!");
194 ULOGGER_WARN(
"The camera must be initialized before requesting an image.");
void setLocalTransform(const Transform &transform)
virtual SensorData captureImage(CameraInfo *info=0)
void setImageSize(const cv::Size &size)
cv::VideoCapture _capture
virtual std::string getSerial() const
bool load(const std::string &filePath)
Some conversion functions.
virtual bool isCalibrated() const
CameraVideo(int usbDevice=0, bool rectifyImages=false, float imageRate=0, const Transform &localTransform=Transform::getIdentity())
#define ULOGGER_DEBUG(...)
bool isValidForRectification() const
const Transform & getLocalTransform() 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="")
#define ULOGGER_WARN(...)
#define ULOGGER_ERROR(...)
std::string UTILITE_EXP uFormat(const char *fmt,...)
bool isValidForProjection() const