21 MITK_TEST_BEGIN(
"ToFProcessingCommon");
25 float distance = 1000;
26 float focalLength = 10;
27 mitk::Point2D focalLength_XY;
28 focalLength_XY[0] = 200;
29 focalLength_XY[1] = 200;
30 mitk::Point2D interPixelDistance;
31 interPixelDistance[0] = 0.05;
32 interPixelDistance[1] = 0.05;
33 mitk::Point2D principalPoint;
34 principalPoint[0] = 100;
35 principalPoint[1] = 100;
38 expectedCoordinate[0] = -400.0988;
39 expectedCoordinate[1] = -222.2771;
40 expectedCoordinate[2] = 889.1084;
43 MITK_TEST_CONDITION_REQUIRED(
mitk::Equal(expectedCoordinate,resultingCoordinate,1e-3),
"Testing IndexToCartesianCoordinates()");
47 MITK_TEST_CONDITION_REQUIRED(
mitk::Equal(expectedCoordinate,resultingCoordinateInterpix,1e-3),
"Testing IndexToCartesianCoordinatesWithInterpixdist()");
52 expectedIndex[2] = 1000;
54 MITK_TEST_CONDITION_REQUIRED(
mitk::Equal(expectedIndex,resultingIndex,1e-3),
"Testing CartesianToIndexCoordinates()");
57 MITK_TEST_CONDITION_REQUIRED(
mitk::Equal(expectedIndex,resultingIndexInterpix,1e-3),
"Testing CartesianToIndexCoordinatesWithInterpixdist()");
61 expectedKinectCoordinate[0] = -450.0;
62 expectedKinectCoordinate[1] = -250.0;
63 expectedKinectCoordinate[2] = 1000.0;
71 MITK_TEST_CONDITION_REQUIRED(
mitk::Equal(expectedKinectCoordinate,kinectReconstructionResult),
"Compare the expected result with the result of reconstruction from KinectIndexToCartesianCoordinates()");
75 MITK_TEST_CONDITION_REQUIRED(
mitk::Equal(expectedIndex,kinectReconstructionResultBackward),
"Transform everything back to distance image and compare it to the original input");
77 mitk::Point2D continuousIndex;
78 continuousIndex[0] = i;
79 continuousIndex[1] = j;
82 MITK_TEST_CONDITION_REQUIRED(
mitk::Equal(expectedKinectCoordinate,continuousKinectReconstructionResult),
"Compare the expected result with the result of reconstruction from ContinuousKinectIndexToCartesianCoordinates(). Since the index is not continuous, the result has to be the same like for KinectIndexToCartesianCoordinates().");
static ToFPoint3D CartesianToKinectIndexCoordinates(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY, ToFScalarType cartesianPointZ, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY, bool calculateDistance=true)
CartesianCoordinatesToKinectIndexCoordinates Transform a 3D world point back to distance image pixel ...
static ToFPoint3D CartesianToIndexCoordinatesWithInterpixdist(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY, ToFScalarType cartesianPointZ, ToFScalarType focalLength, ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY, ToFScalarType principalPointX, ToFScalarType principalPointY, bool calculateDistance=true)
Convert cartesian coordinates to index based distances.
static ToFPoint3D CartesianToIndexCoordinates(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY, ToFScalarType cartesianPointZ, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY, bool calculateDistance=true)
Convert cartesian coordinates to index based distances.
static ToFPoint3D IndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY)
Convert index based distances to cartesian coordinates.
static ToFProcessingCommon::ToFPoint3D ContinuousKinectIndexToCartesianCoordinates(mitk::Point2D continuousIndex, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY)
ContinuousKinectIndexToCartesianCoordinates This method is escpially meant for reconstructing a Kinec...
static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength, ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY, ToFScalarType principalPointX, ToFScalarType principalPointY)
Convert index based distances to cartesian coordinates.
static ToFProcessingCommon::ToFPoint3D KinectIndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY)
KinectIndexToCartesianCoordinates Convert a pixel (i,j) with value d to a 3D world point....
MITKIGTBASE_EXPORT bool Equal(const mitk::NavigationData &leftHandSide, const mitk::NavigationData &rightHandSide, ScalarType eps=mitk::eps, bool verbose=false)
Equal A function comparing two navigation data objects for beeing equal in meta- and imagedata.