SoRotateProcessing2d image filter More...
#include <ImageViz/Engines/GeometryAndMatching/GeometricTransforms/SoRotateProcessing2d.h>
Public Types | |
enum | PrecisionMode { NEARBY_PIXEL = 0, INTERPOLATION = 1 } |
Public Member Functions | |
SoRotateProcessing2d () | |
Public Attributes | |
SoSFImageDataAdapter | inImage |
SoSFVec2i32 | rotationCenter |
SoSFFloat | rotationAngle |
SoSFEnum | precisionMode |
SoImageVizEngineOutput < SoSFImageDataAdapter, SoImageDataAdapter * > | outImage |
The SoRotateProcessing2d filter performs a rotation of an image by a user-defined angle and an origin . The new coordinates can be expressed as a function of the old coordinates :
where are the coordinates of the center of the rotation. Or in a matrix notation:
Once again, destination pixels may be outside the image, and normally these pixels are ignored. Furthermore, the coordinates obtained are not always integers, even though an image is a discrete space. The figure below illustrates the grid of the resultant image, the point being a pixel in this image. The points are generated from the rotation of the original image and do not fit on the grid.
Figure 1: Rotation
To calculate the intensity of each pixel , two methods are possible:
If denotes the distance , is defined as:
e.g. .
The choice of the 's ensures that the interpolated value is equal to if matches . This method gives better results but requires more computation time.
NOTE: In SoRotateProcessing2d filter, the image is perceived as a cylinder, where the information outside the image area wraps around and is placed in the blank part.
inImage | NULL |
rotationCenter | 0 0 |
rotationAngle | 10.0f |
precisionMode | NEARBY_PIXEL |
SoRotateProcessing2d::SoRotateProcessing2d | ( | ) |
Constructor.
The input image.
Default value is NULL. Supported types include: grayscale binary label color image.
The output image.
Default value is NULL. Supported types include: grayscale binary label color image.
Select the interpolation mode.
Use enum PrecisionMode. Default is NEARBY_PIXEL
The angle of the rotation in degrees (not radians).
Default value is 10.0f.
The rotation center coordinates.
Default value is SbVec2i32(0,0).