17 #ifndef MITKTOFPROCESSINGCOMMON_H
18 #define MITKTOFPROCESSINGCOMMON_H
20 #include <MitkToFProcessingExports.h>
23 #include <vnl/vnl_math.h>
62 static ToFPoint3D IndexToCartesianCoordinates(
unsigned int i,
unsigned int j, ToFScalarType distance,
63 ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY);
75 ToFPoint2D focalLength, ToFPoint2D principalPoint)
77 return IndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
89 ToFPoint2D focalLength, ToFPoint2D principalPoint)
91 return IndexToCartesianCoordinates(index[0],index[1],distance,focalLength[0],focalLength[1],principalPoint[0], principalPoint[1]);
103 ToFScalarType focalLength[2], ToFScalarType principalPoint[2])
105 return IndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
121 static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(
unsigned int i,
unsigned int j, ToFScalarType distance, ToFScalarType focalLength,
122 ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY, ToFScalarType principalPointX, ToFScalarType principalPointY);
135 ToFPoint2D interPixelDistance, ToFPoint2D principalPoint)
137 return IndexToCartesianCoordinatesWithInterpixdist(i,j,distance,focalLength,interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1]);
149 ToFPoint2D interPixelDistance, ToFPoint2D principalPoint)
151 return IndexToCartesianCoordinatesWithInterpixdist(index[0],index[1],distance,focalLength,interPixelDistance[0], interPixelDistance[1],principalPoint[0], principalPoint[1]);
164 ToFScalarType interPixelDistance[2], ToFScalarType principalPoint[2])
166 return IndexToCartesianCoordinatesWithInterpixdist(i,j,distance,focalLength,interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1]);
182 static ToFPoint3D CartesianToIndexCoordinates(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY,ToFScalarType cartesianPointZ,
183 ToFScalarType focalLengthX, ToFScalarType focalLengthY,
184 ToFScalarType principalPointX, ToFScalarType principalPointY,
bool calculateDistance=
true);
195 ToFScalarType principalPoint[2],
bool calculateDistance=
true)
197 return CartesianToIndexCoordinates(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength[0], focalLength[1],
198 principalPoint[0],principalPoint[1],calculateDistance);
209 ToFPoint2D principalPoint,
bool calculateDistance=
true)
211 return CartesianToIndexCoordinates(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength[0], focalLength[1],
212 principalPoint[0],principalPoint[1],calculateDistance);
229 static ToFPoint3D CartesianToIndexCoordinatesWithInterpixdist(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY,ToFScalarType cartesianPointZ,
230 ToFScalarType focalLength, ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY,
231 ToFScalarType principalPointX, ToFScalarType principalPointY,
bool calculateDistance=
true);
243 ToFScalarType interPixelDistance[2], ToFScalarType principalPoint[2],
244 bool calculateDistance=
true)
246 return CartesianToIndexCoordinatesWithInterpixdist(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength,
247 interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1],calculateDistance);
259 ToFPoint2D interPixelDistance, ToFPoint2D principalPoint,
bool calculateDistance=
true)
261 return CartesianToIndexCoordinatesWithInterpixdist(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength,
262 interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1],calculateDistance);
278 static ToFProcessingCommon::ToFPoint3D KinectIndexToCartesianCoordinates(
unsigned int i,
unsigned int j, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY);
281 ToFScalarType focalLength[2], ToFScalarType principalPoint[2])
283 return KinectIndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
287 ToFPoint2D focalLength, ToFPoint2D principalPoint)
289 return KinectIndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
294 return KinectIndexToCartesianCoordinates(index[0],index[1],distance,focalLength[0],focalLength[1],principalPoint[0], principalPoint[1]);
310 static ToFPoint3D CartesianToKinectIndexCoordinates(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY,
311 ToFScalarType cartesianPointZ, ToFScalarType focalLengthX,
312 ToFScalarType focalLengthY, ToFScalarType principalPointX,
313 ToFScalarType principalPointY,
bool calculateDistance=
true);
317 return CartesianToKinectIndexCoordinates( cartesianPoint[0], cartesianPoint[1], cartesianPoint[2], focalLength[0], focalLength[1], principalPoint[0], principalPoint[1], calculateDistance);
333 static ToFProcessingCommon::ToFPoint3D ContinuousKinectIndexToCartesianCoordinates(
mitk::Point2D continuousIndex, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY);
itk::Vector< ToFScalarType, 3 > ToFVector3D
itk::SmartPointer< Self > Pointer
static ToFPoint3D IndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance, ToFPoint2D focalLength, ToFPoint2D principalPoint)
Convert index based distances to cartesian coordinates.
static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(itk::Index< 3 > index, ToFScalarType distance, ToFScalarType focalLength, ToFPoint2D interPixelDistance, ToFPoint2D principalPoint)
Convert index based distances to cartesian coordinates.
DataCollection - Class to facilitate loading/accessing structured data.
static ToFPoint3D KinectIndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength[2], ToFScalarType principalPoint[2])
KinectIndexToCartesianCoordinates Convert a pixel (i,j) with value d to a 3D world point...
static ToFPoint3D KinectIndexToCartesianCoordinates(itk::Index< 3 > index, ToFScalarType distance, ToFPoint2D focalLength, ToFPoint2D principalPoint)
KinectIndexToCartesianCoordinates Convert a pixel (i,j) with value d to a 3D world point...
static ToFPoint3D IndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength[2], ToFScalarType principalPoint[2])
Convenience method to convert index based distances to cartesian coordinates using array as input...
itk::Point< ToFScalarType, 2 > ToFPoint2D
itk::Point< ToFScalarType, 3 > ToFPoint3D
static ToFPoint3D CartesianToIndexCoordinates(ToFScalarType cartesianPoint[3], ToFScalarType focalLength[2], ToFScalarType principalPoint[2], bool calculateDistance=true)
Convenience method to convert cartesian coordinates to index based distances using arrays...
Helper class providing functions which are useful for multiple usage.
static ToFPoint3D CartesianToIndexCoordinatesWithInterpixdist(ToFPoint3D cartesianPoint, ToFScalarType focalLength, ToFPoint2D interPixelDistance, ToFPoint2D principalPoint, bool calculateDistance=true)
Convert cartesian coordinates to index based distances.
static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength, ToFScalarType interPixelDistance[2], ToFScalarType principalPoint[2])
Convenience method to convert index based distances to cartesian coordinates using array as input...
static ToFPoint3D KinectIndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance, ToFPoint2D focalLength, ToFPoint2D principalPoint)
KinectIndexToCartesianCoordinates Convert a pixel (i,j) with value d to a 3D world point...
itk::Vector< ToFScalarType, 2 > ToFVector2D
static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength, ToFPoint2D interPixelDistance, ToFPoint2D principalPoint)
Convert index based distances to cartesian coordinates.
static ToFProcessingCommon::ToFPoint3D CartesianToKinectIndexCoordinates(ToFPoint3D cartesianPoint, ToFPoint2D focalLength, ToFPoint2D principalPoint, bool calculateDistance=true)
CartesianCoordinatesToKinectIndexCoordinates Transform a 3D world point back to distance image pixel ...
static ToFPoint3D IndexToCartesianCoordinates(itk::Index< 3 > index, ToFScalarType distance, ToFPoint2D focalLength, ToFPoint2D principalPoint)
Convert index based distances to cartesian coordinates.
static ToFPoint3D CartesianToIndexCoordinatesWithInterpixdist(ToFScalarType cartesianPoint[3], ToFScalarType focalLength, ToFScalarType interPixelDistance[2], ToFScalarType principalPoint[2], bool calculateDistance=true)
Convenience method to convert cartesian coordinates to index based distances using arrays...
static ToFPoint3D CartesianToIndexCoordinates(ToFPoint3D cartesianPoint, ToFPoint2D focalLength, ToFPoint2D principalPoint, bool calculateDistance=true)
Convert cartesian coordinates to index based distances.