SoRotateProcessing2d Class Reference
[GeometricTransforms]

ImageViz SoRotateProcessing2d image filter More...

#include <ImageViz/Engines/GeometryAndMatching/GeometricTransforms/SoRotateProcessing2d.h>

Inheritance diagram for SoRotateProcessing2d:
SoImageVizEngine SoEngine SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

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

Detailed Description

ImageViz SoRotateProcessing2d image filter

The SoRotateProcessing2d filter performs a rotation of an image by a user-defined angle $\theta$ and an origin $O$. The new coordinates $(x', y')$ can be expressed as a function of the old coordinates $(x, y)$:

\[\left\{\begin{matrix}x'&=&(x-x_0)\cdot\cos\theta - (y-y_0)\cdot\sin\theta + x_0\\ y'&=&(x-x_0)\cdot\sin\theta + (y-y_0)\cdot\cos\theta + y_0\end{matrix}\right\}\]

where $(x_0,y_0)$ are the coordinates of the center of the rotation. Or in a matrix notation:

\[\begin{bmatrix}x'\\y'\end{bmatrix} = \begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix} \cdot\begin{bmatrix}x-x_0\\y-y_0\end{bmatrix} + \begin{bmatrix}x_0\\y_0\end{bmatrix}\]

Once again, destination pixels may be outside the image, and normally these pixels are ignored. Furthermore, the $(x, y)$ 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 $M'$ being a pixel in this image. The points are generated from the rotation of the original image and do not fit on the grid.

SoRotateProcessing2d01.png

Figure 1: Rotation

To calculate the intensity of each pixel $M'$, two methods are possible:

If $d_j$ denotes the distance $M'_j M'$, $f_i$ is defined as:

\[f_i=\prod_{\substack{j=1\\j\neq i}}^{j=4}d_j\]

e.g. $f_1=d_2d_3d_4$.

The choice of the $f_i$'s ensures that the interpolated value is equal to $g'_j$ if $M'$ matches $M'_j$. 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


Library references: rotate


Member Enumeration Documentation

Method used to calculate the intensity of each result pixel.

Enumerator:
NEARBY_PIXEL 

Take the grey level of the nearest pixel.

INTERPOLATION 

Take the bilinear interpolation from the four nearest pixels.


Constructor & Destructor Documentation

SoRotateProcessing2d::SoRotateProcessing2d (  ) 

Constructor.


Member Data Documentation

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).


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/