16 # include <mexplus/mxarray.h>
34 hasImageDisparity( iplImageDisparity!=NULL ),
35 hasImageRight( iplImageRight!=NULL )
38 ownMemory ? imageLeft.setFromIplImage(iplImageLeft) : imageLeft.loadFromIplImage(iplImageLeft);
40 ownMemory ? imageRight.setFromIplImage(iplImageRight) : imageRight.loadFromIplImage(iplImageRight);
41 if (iplImageDisparity)
42 ownMemory ? imageDisparity.setFromIplImage(iplImageDisparity) : imageDisparity.loadFromIplImage(iplImageDisparity);
49 hasImageDisparity(false),
190 const char* fields[] = {
"class",
193 "poseL",
"poseLR",
"poseR",
194 "paramsL",
"paramsR"};
195 mexplus::MxArray obs_struct( mexplus::MxArray::Struct(
sizeof(fields)/
sizeof(fields[0]),fields) );
200 obs_struct.set(
"imageL", this->
imageLeft);
207 return obs_struct.release();
259 o <<
"Homogeneous matrix for the sensor's 3D pose, relative to robot base:\n";
280 else o <<
" : No.\n";
282 o <<
" Disparity image";
288 else o <<
" : No.\n";
struct mxArray_tag mxArray
Forward declaration for mxArray (avoid #including as much as possible to speed up compiling)
#define IMPLEMENTS_MEXPLUS_FROM(complete_type)
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
This class is a "CSerializable" wrapper for "CMatrixFloat".
A quaternion, which can represent a 3D rotation as pair , with a real part "r" and a 3D vector ,...
Declares a class that represents any robot's observation.
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
std::string sensorLabel
An arbitrary label that can be used to identify the sensor.
mrpt::system::TTimeStamp timestamp
The associated UTC time-stamp. Where available, this should contain the accurate satellite-based time...
void swap(CObservation &o)
Swap with another observation, ONLY the data defined here in the base class CObservation....
Observation class for either a pair of left+right or left+disparity images from a stereo camera.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
mrpt::poses::CPose3DQuat cameraPose
The pose of the LEFT camera, relative to the robot.
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const
Returns information about the class of an object in runtime.
bool hasImageRight
Whether imageRight actually contains data (Default upon construction: true)
mrpt::utils::CImage imageRight
Image from the right camera, only contains a valid image if hasImageRight == true.
void setStereoCameraParams(const mrpt::utils::TStereoCamera &in_params)
Sets leftCamera, rightCamera and rightCameraPose from a TStereoCamera structure.
bool hasImageDisparity
Whether imageDisparity actually contains data (Default upon construction: false)
mrpt::utils::CImage imageDisparity
Disparity image, only contains a valid image if hasImageDisparity == true.
mrpt::utils::TCamera leftCamera
Parameters for the left/right cameras: individual intrinsic and distortion parameters of the cameras.
CObservationStereoImages()
Default Constructor.
~CObservationStereoImages()
Destructor.
mrpt::utils::TCamera rightCamera
mrpt::utils::CImage imageLeft
Image from the left camera (this image will be ALWAYS present)
mrpt::poses::CPose3DQuat rightCameraPose
The pose of the right camera, relative to the left one: Note that using the conventional reference co...
void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
void getStereoCameraParams(mrpt::utils::TStereoCamera &out_params) const
Populates a TStereoCamera structure with the parameters in leftCamera, rightCamera and rightCameraPos...
void swap(CObservationStereoImages &o)
Do an efficient swap of all data members of this object with "o".
bool areImagesRectified() const
This method only checks whether ALL the distortion parameters in leftCamera are set to zero,...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,...
mrpt::math::CMatrixDouble44 getHomogeneousMatrixVal() const
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (t...
std::string getExternalStorageFile() const MRPT_NO_THROWS
< Only if isExternallyStored() returns true.
bool isOriginTopLeft() const
Returns true if the coordinates origin is top-left, or false if it is bottom-left
bool isExternallyStored() const MRPT_NO_THROWS
See setExternalStorage().
void swap(CImage &o)
Very efficient swap of two images (just swap the internal pointers)
size_t getHeight() const MRPT_OVERRIDE
Returns the height of the image in pixels.
size_t getWidth() const MRPT_OVERRIDE
Returns the width of the image in pixels.
const char * getChannelsOrder() const
Returns a string of the form "BGR","RGB" or "GRAY" indicating the channels ordering.
virtual mxArray * writeToMatlab() const
Introduces a pure virtual method responsible for writing to a mxArray Matlab object,...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
double focalLengthMeters
The focal length of the camera, in meters (can be used among 'intrinsicParams' to determine the pixel...
mrpt::math::CArrayDouble< 5 > dist
[k1 k2 t1 t2 k3] -> k_i: parameters of radial distortion, t_i: parameters of tangential distortion (d...
mrpt::math::CMatrixDouble33 intrinsicParams
Matrix of intrinsic parameters (containing the focal length and principal point coordinates)
Structure to hold the parameters of a pinhole stereo camera model.
mrpt::poses::CPose3DQuat rightCameraPose
Pose of the right camera with respect to the coordinate origin of the left camera.
TCamera rightCamera
Intrinsic and distortion parameters of the left and right cameras.
std::string dumpAsText() const
Dumps all the parameters as a multi-line string, with the same format than saveToConfigFile.
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This base provides a set of functions for maths stuff.
CMatrixFixedNumeric< double, 3, 3 > CMatrixDouble33
This namespace contains representation of robot actions and observations.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values,...
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.