Class SoRotateProcessing2d
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.engines.SoEngine
-
- com.openinventor.imageviz.engines.SoImageVizEngine
-
- com.openinventor.imageviz.engines.geometryandmatching.geometrictransforms.SoRotateProcessing2d
-
- All Implemented Interfaces:
SafeDisposable
public class SoRotateProcessing2d extends SoImageVizEngine
SoRotateProcessing2d
image filter. TheSoRotateProcessing2d
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. 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoRotateProcessing2d.PrecisionModes
Method used to calculate the intensity of each result pixel.-
Nested classes/interfaces inherited from class com.openinventor.imageviz.engines.SoImageVizEngine
SoImageVizEngine.ComputeModes, SoImageVizEngine.EventArg, SoImageVizEngine.Neighborhood3ds
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFImageDataAdapter
inImage
The input image.SoImageVizEngineOutput<SoSFImageDataAdapter,SoImageDataAdapter>
outImage
The output image.SoSFEnum<SoRotateProcessing2d.PrecisionModes>
precisionMode
Select the interpolation mode.SoSFFloat
rotationAngle
The angle of the rotation in degrees (not radians).SoSFVec2i32
rotationCenter
The rotation center coordinates.-
Fields inherited from class com.openinventor.imageviz.engines.SoImageVizEngine
onBegin, onEnd, onProgress
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoRotateProcessing2d()
Constructor.
-
Method Summary
-
Methods inherited from class com.openinventor.imageviz.engines.SoImageVizEngine
abortEvaluate, isEvaluating, startEvaluate, waitEvaluate
-
Methods inherited from class com.openinventor.inventor.engines.SoEngine
copy, getByName, getOutput, getOutputName
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable, touch
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
inImage
public final SoSFImageDataAdapter inImage
The input image. Default value is NULL. Supported types include: grayscale binary label color image.
-
rotationCenter
public final SoSFVec2i32 rotationCenter
The rotation center coordinates. Default value isSbVec2i32(0,0)
.
-
rotationAngle
public final SoSFFloat rotationAngle
The angle of the rotation in degrees (not radians). Default value is 10.0f.
-
precisionMode
public final SoSFEnum<SoRotateProcessing2d.PrecisionModes> precisionMode
Select the interpolation mode. . Default is NEARBY_PIXEL
-
outImage
public final SoImageVizEngineOutput<SoSFImageDataAdapter,SoImageDataAdapter> outImage
The output image. Default value is NULL. Supported types include: grayscale binary label color image.
-
-