Class SoRotateProcessing2d

  • All Implemented Interfaces:
    SafeDisposable

    public class SoRotateProcessing2d
    extends SoImageVizEngine
    SoRotateProcessing2d image filter. 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:

    • Take the grey level of the nearest neighbor. For the above example would be given the intensity of
    • Take into account the four nearest neighbors and calculate the grey level based on the average of the four points, weighted by their distance, as in:

    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.

    File format/default:

    RotateProcessing2d {

      inImage NULL
      rotationCenter 0 0
      rotationAngle 10.0f
      precisionMode NEARBY_PIXEL
    }


    Library references: rotate

    • Constructor Detail

      • SoRotateProcessing2d

        public SoRotateProcessing2d()
        Constructor.