MITK-IGT
IGT Extension of MITK
|
Converts a Time-of-Flight (ToF) distance image to a 3D surface using the pinhole camera model for coordinate computation. The intrinsic parameters of the camera (FocalLength, PrincipalPoint, InterPixelDistance) are set via SetCameraIntrinsics(). The measured distance for each pixel corresponds to the distance between the object point and the corresponding image point on the image plane. More...
#include <mitkToFDistanceImageToSurfaceFilter.h>
Public Types | |
enum | ReconstructionModeType { WithOutInterPixelDistance = 1 , WithInterPixelDistance = 2 , Kinect = 3 } |
The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect. More... | |
Public Member Functions | |
mitkClassMacro (ToFDistanceImageToSurfaceFilter, SurfaceSource) | |
itkFactorylessNewMacro (Self) | |
itkCloneMacro (Self) | |
itkSetMacro (CameraIntrinsics, mitk::CameraIntrinsics::Pointer) | |
itkGetMacro (CameraIntrinsics, mitk::CameraIntrinsics::Pointer) | |
itkSetMacro (InterPixelDistance, ToFProcessingCommon::ToFPoint2D) | |
itkGetMacro (InterPixelDistance, ToFProcessingCommon::ToFPoint2D) | |
itkSetMacro (TextureIndex, int) | |
void | SetTriangulationThreshold (double triangulationThreshold) |
SetTriangulationThreshold Sets a triangulation threshold in order to remove unusually huge faces from the surface. If this value is set, the filter will check whether the distance between two neighboring vertices exceeds the triangulation threshold. If yes, there vertices will not be triangulated (connected with lines). The vertices will still be added to the surface, but only as single point (if they have no other neighbors). | |
itkGetMacro (TriangulationThreshold, double) | |
itkSetMacro (VertexIdList, vtkSmartPointer< vtkIdList >) | |
itkGetMacro (VertexIdList, vtkSmartPointer< vtkIdList >) | |
itkSetMacro (GenerateTriangularMesh, bool) | |
itkGetMacro (GenerateTriangularMesh, bool) | |
itkSetEnumMacro (ReconstructionMode, ReconstructionModeType) | |
itkGetEnumMacro (ReconstructionMode, ReconstructionModeType) | |
void | SetScalarImage (IplImage *iplScalarImage) |
Set scalar image used as texture of the surface. | |
IplImage * | GetScalarImage () |
Set scalar image used as texture of the surface. | |
void | SetTextureImageWidth (int width) |
Set width of the scalar image used for texturing the surface. | |
void | SetTextureImageHeight (int height) |
Set height of the scalar image used for texturing the surface. | |
virtual void | SetInput (Image *distanceImage) |
Sets the input of this filter. | |
virtual void | SetInput (Image *distanceImage, mitk::CameraIntrinsics::Pointer cameraIntrinsics) |
Sets the input of this filter and the intrinsic parameters. | |
virtual void | SetInput (unsigned int idx, Image *distanceImage) |
Sets the input of this filter at idx. | |
virtual void | SetInput (unsigned int idx, Image *distanceImage, mitk::CameraIntrinsics::Pointer cameraIntrinsics) |
Sets the input of this filter at idx and the intrinsic parameters. | |
Image * | GetInput () |
Returns the input of this filter. | |
Image * | GetInput (unsigned int idx) |
Returns the input with id idx of this filter. | |
Protected Member Functions | |
ToFDistanceImageToSurfaceFilter () | |
Standard constructor. | |
~ToFDistanceImageToSurfaceFilter () override | |
Standard destructor. | |
void | GenerateOutputInformation () override |
void | GenerateData () override |
Method generating the output of this filter. Called in the updated process of the pipeline. This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points. | |
void | CreateOutputsForAllInputs () |
Create an output for each input. | |
Protected Attributes | |
IplImage * | m_IplScalarImage |
Scalar image used for surface texturing. | |
mitk::CameraIntrinsics::Pointer | m_CameraIntrinsics |
Specifies the intrinsic parameters. | |
int | m_TextureImageWidth |
Width (x-dimension) of the texture image. | |
int | m_TextureImageHeight |
Height (y-dimension) of the texture image. | |
ToFProcessingCommon::ToFPoint2D | m_InterPixelDistance |
distance in mm between two adjacent pixels on the ToF camera chip | |
int | m_TextureIndex |
Index of the input used as texture image when no scalar image was set via SetIplScalarImage(). 0 = Distance, 1 = Amplitude, 2 = Intensity. | |
bool | m_GenerateTriangularMesh |
ReconstructionModeType | m_ReconstructionMode |
The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect. | |
vtkSmartPointer< vtkIdList > | m_VertexIdList |
Make a vtkIdList to save the ID's of the polyData corresponding to the image pixel ID's. This can be accessed after generate data to obtain the mapping. | |
double | m_TriangulationThreshold |
Converts a Time-of-Flight (ToF) distance image to a 3D surface using the pinhole camera model for coordinate computation. The intrinsic parameters of the camera (FocalLength, PrincipalPoint, InterPixelDistance) are set via SetCameraIntrinsics(). The measured distance for each pixel corresponds to the distance between the object point and the corresponding image point on the image plane.
The coordinate conversion follows the model of a common pinhole camera where the origin of the camera coordinate system (world coordinates) is at the pinhole
The definition of the image plane and its coordinate systems (pixel and mm) is depicted in the following image
Definition at line 46 of file mitkToFDistanceImageToSurfaceFilter.h.
The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect.
Enumerator | |
---|---|
WithOutInterPixelDistance | |
WithInterPixelDistance | |
Kinect |
Definition at line 84 of file mitkToFDistanceImageToSurfaceFilter.h.
|
protected |
Standard constructor.
Definition at line 31 of file mitkToFDistanceImageToSurfaceFilter.cpp.
|
overrideprotected |
Standard destructor.
Definition at line 43 of file mitkToFDistanceImageToSurfaceFilter.cpp.
|
protected |
Create an output for each input.
This Method sets the number of outputs to the number of inputs and creates missing outputs objects.
Definition at line 310 of file mitkToFDistanceImageToSurfaceFilter.cpp.
|
overrideprotected |
Method generating the output of this filter. Called in the updated process of the pipeline. This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points.
Here we have to incorporate spacing and origin to allow processing of cropped/resampled images Usually origin will be [0, 0, 0] and spacing will be [1, 1, 1], but just in case the image is moved due to cropping or the spacing differes due to up- or downsampling.
Definition at line 88 of file mitkToFDistanceImageToSurfaceFilter.cpp.
|
overrideprotected |
Definition at line 322 of file mitkToFDistanceImageToSurfaceFilter.cpp.
mitk::Image * mitk::ToFDistanceImageToSurfaceFilter::GetInput | ( | ) |
Returns the input of this filter.
Definition at line 74 of file mitkToFDistanceImageToSurfaceFilter.cpp.
mitk::Image * mitk::ToFDistanceImageToSurfaceFilter::GetInput | ( | unsigned int | idx | ) |
Returns the input with id idx of this filter.
Definition at line 79 of file mitkToFDistanceImageToSurfaceFilter.cpp.
IplImage * mitk::ToFDistanceImageToSurfaceFilter::GetScalarImage | ( | ) |
Set scalar image used as texture of the surface.
Definition at line 335 of file mitkToFDistanceImageToSurfaceFilter.cpp.
mitk::ToFDistanceImageToSurfaceFilter::itkCloneMacro | ( | Self | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkFactorylessNewMacro | ( | Self | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkGetEnumMacro | ( | ReconstructionMode | , |
ReconstructionModeType | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkGetMacro | ( | CameraIntrinsics | , |
mitk::CameraIntrinsics::Pointer | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkGetMacro | ( | GenerateTriangularMesh | , |
bool | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkGetMacro | ( | InterPixelDistance | , |
ToFProcessingCommon::ToFPoint2D | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkGetMacro | ( | TriangulationThreshold | , |
double | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkGetMacro | ( | VertexIdList | , |
vtkSmartPointer< vtkIdList > | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkSetEnumMacro | ( | ReconstructionMode | , |
ReconstructionModeType | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkSetMacro | ( | CameraIntrinsics | , |
mitk::CameraIntrinsics::Pointer | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkSetMacro | ( | GenerateTriangularMesh | , |
bool | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkSetMacro | ( | InterPixelDistance | , |
ToFProcessingCommon::ToFPoint2D | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkSetMacro | ( | TextureIndex | , |
int | ) |
mitk::ToFDistanceImageToSurfaceFilter::itkSetMacro | ( | VertexIdList | , |
vtkSmartPointer< vtkIdList > | ) |
mitk::ToFDistanceImageToSurfaceFilter::mitkClassMacro | ( | ToFDistanceImageToSurfaceFilter | , |
SurfaceSource | ) |
|
virtual |
Sets the input of this filter.
distanceImage | input is the distance image of e.g. a ToF camera |
Definition at line 59 of file mitkToFDistanceImageToSurfaceFilter.cpp.
|
virtual |
Sets the input of this filter and the intrinsic parameters.
distanceImage | input is the distance image of e.g. a ToF camera |
cameraIntrinsics |
Definition at line 47 of file mitkToFDistanceImageToSurfaceFilter.cpp.
|
virtual |
Sets the input of this filter at idx.
idx | number of the current input |
distanceImage | input is the distance image of e.g. a ToF camera |
Definition at line 64 of file mitkToFDistanceImageToSurfaceFilter.cpp.
|
virtual |
Sets the input of this filter at idx and the intrinsic parameters.
idx | number of the current input |
distanceImage | input is the distance image of e.g. a ToF camera |
cameraIntrinsics | This is the camera model which holds parameters like focal length, pixel size, etc. which are needed for the reconstruction of the surface. |
Definition at line 53 of file mitkToFDistanceImageToSurfaceFilter.cpp.
void mitk::ToFDistanceImageToSurfaceFilter::SetScalarImage | ( | IplImage * | iplScalarImage | ) |
Set scalar image used as texture of the surface.
iplScalarImage | OpenCV image for texturing |
Definition at line 329 of file mitkToFDistanceImageToSurfaceFilter.cpp.
void mitk::ToFDistanceImageToSurfaceFilter::SetTextureImageHeight | ( | int | height | ) |
Set height of the scalar image used for texturing the surface.
height | height (y-dimension) of the texture image |
Definition at line 345 of file mitkToFDistanceImageToSurfaceFilter.cpp.
void mitk::ToFDistanceImageToSurfaceFilter::SetTextureImageWidth | ( | int | width | ) |
Set width of the scalar image used for texturing the surface.
width | width (x-dimension) of the texture image |
Definition at line 340 of file mitkToFDistanceImageToSurfaceFilter.cpp.
void mitk::ToFDistanceImageToSurfaceFilter::SetTriangulationThreshold | ( | double | triangulationThreshold | ) |
SetTriangulationThreshold Sets a triangulation threshold in order to remove unusually huge faces from the surface. If this value is set, the filter will check whether the distance between two neighboring vertices exceeds the triangulation threshold. If yes, there vertices will not be triangulated (connected with lines). The vertices will still be added to the surface, but only as single point (if they have no other neighbors).
triangulationThreshold | The triangulationThreshold in mm. (not mm*mm!) |
Definition at line 351 of file mitkToFDistanceImageToSurfaceFilter.cpp.
|
protected |
Specifies the intrinsic parameters.
Definition at line 175 of file mitkToFDistanceImageToSurfaceFilter.h.
|
protected |
Definition at line 182 of file mitkToFDistanceImageToSurfaceFilter.h.
|
protected |
distance in mm between two adjacent pixels on the ToF camera chip
Definition at line 179 of file mitkToFDistanceImageToSurfaceFilter.h.
|
protected |
Scalar image used for surface texturing.
Definition at line 173 of file mitkToFDistanceImageToSurfaceFilter.h.
|
protected |
The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect.
Definition at line 184 of file mitkToFDistanceImageToSurfaceFilter.h.
|
protected |
Height (y-dimension) of the texture image.
Definition at line 178 of file mitkToFDistanceImageToSurfaceFilter.h.
|
protected |
Width (x-dimension) of the texture image.
Definition at line 177 of file mitkToFDistanceImageToSurfaceFilter.h.
|
protected |
Index of the input used as texture image when no scalar image was set via SetIplScalarImage(). 0 = Distance, 1 = Amplitude, 2 = Intensity.
Definition at line 181 of file mitkToFDistanceImageToSurfaceFilter.h.
|
protected |
Definition at line 188 of file mitkToFDistanceImageToSurfaceFilter.h.
|
protected |
Make a vtkIdList to save the ID's of the polyData corresponding to the image pixel ID's. This can be accessed after generate data to obtain the mapping.
Definition at line 186 of file mitkToFDistanceImageToSurfaceFilter.h.