13 #ifndef mitkToFProcessingCommon_h
14 #define mitkToFProcessingCommon_h
16 #include <MitkToFProcessingExports.h>
19 #include <vnl/vnl_math.h>
73 return IndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
87 return IndexToCartesianCoordinates(index[0],index[1],distance,focalLength[0],focalLength[1],principalPoint[0], principalPoint[1]);
101 return IndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
117 static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(
unsigned int i,
unsigned int j, ToFScalarType distance, ToFScalarType focalLength,
118 ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY, ToFScalarType principalPointX, ToFScalarType principalPointY);
133 return IndexToCartesianCoordinatesWithInterpixdist(i,j,distance,focalLength,interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1]);
147 return IndexToCartesianCoordinatesWithInterpixdist(index[0],index[1],distance,focalLength,interPixelDistance[0], interPixelDistance[1],principalPoint[0], principalPoint[1]);
162 return IndexToCartesianCoordinatesWithInterpixdist(i,j,distance,focalLength,interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1]);
178 static ToFPoint3D CartesianToIndexCoordinates(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY,ToFScalarType cartesianPointZ,
179 ToFScalarType focalLengthX, ToFScalarType focalLengthY,
180 ToFScalarType principalPointX, ToFScalarType principalPointY,
bool calculateDistance=
true);
191 ToFScalarType principalPoint[2],
bool calculateDistance=
true)
193 return CartesianToIndexCoordinates(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength[0], focalLength[1],
194 principalPoint[0],principalPoint[1],calculateDistance);
205 ToFPoint2D principalPoint,
bool calculateDistance=
true)
207 return CartesianToIndexCoordinates(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength[0], focalLength[1],
208 principalPoint[0],principalPoint[1],calculateDistance);
225 static ToFPoint3D CartesianToIndexCoordinatesWithInterpixdist(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY,ToFScalarType cartesianPointZ,
226 ToFScalarType focalLength, ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY,
227 ToFScalarType principalPointX, ToFScalarType principalPointY,
bool calculateDistance=
true);
240 bool calculateDistance=
true)
242 return CartesianToIndexCoordinatesWithInterpixdist(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength,
243 interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1],calculateDistance);
257 return CartesianToIndexCoordinatesWithInterpixdist(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength,
258 interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1],calculateDistance);
272 static ToFProcessingCommon::ToFPoint3D KinectIndexToCartesianCoordinates(
unsigned int i,
unsigned int j, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY);
277 return KinectIndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
283 return KinectIndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
288 return KinectIndexToCartesianCoordinates(index[0],index[1],distance,focalLength[0],focalLength[1],principalPoint[0], principalPoint[1]);
303 static ToFPoint3D CartesianToKinectIndexCoordinates(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY,
304 ToFScalarType cartesianPointZ, ToFScalarType focalLengthX,
305 ToFScalarType focalLengthY, ToFScalarType principalPointX,
306 ToFScalarType principalPointY,
bool calculateDistance=
true);
310 return CartesianToKinectIndexCoordinates( cartesianPoint[0], cartesianPoint[1], cartesianPoint[2], focalLength[0], focalLength[1], principalPoint[0], principalPoint[1], calculateDistance);
326 static ToFProcessingCommon::ToFPoint3D ContinuousKinectIndexToCartesianCoordinates(
mitk::Point2D continuousIndex, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY);
335 static ToFScalarType CalculateViewAngle(mitk::CameraIntrinsics::Pointer intrinsics,
unsigned int dimX);