Class SoObjectToRegionProcessing2d
- 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.imagesegmentation.labeling.SoObjectToRegionProcessing2d
-
- All Implemented Interfaces:
SafeDisposable
public class SoObjectToRegionProcessing2d extends SoImageVizEngine
SoObjectToRegionProcessing2d
engine. TheSoObjectToRegionProcessing2d
engine transforms an object image into a region image.A region image is a label image where each pixel has a value greater than zero.
The
SoObjectToRegionProcessing2d
engine scans the image from top to bottom and left to right. This engine extracts all connected entities (Regions). Two pixels are in the same regions if they have the same gray level value and if there is path between them with only this gray level value. Each pixel of the same region takes the same value, and each object is assigned a different value, starting from value 1. The assigned gray level depends on the location of the object in the image. The maximum gray level value gives the total number of regions in the original image. The algorithm works in three steps:- The first scan detects the starting location of each object.
- The second scan gives the same gray level to all the pixels belonging to the same object.
- The third optional scan checks that there is no hole in the numbers, i.e.: that all objects have consecutive indices.
BEFORE:
AFTER:
-
-
Nested Class Summary
-
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
inObjectImage
The input object label image.SoImageVizEngineOutput<SoSFImageDataAdapter,SoImageDataAdapter>
outRegionImage
The output region label image.-
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 SoObjectToRegionProcessing2d()
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
-
inObjectImage
public final SoSFImageDataAdapter inObjectImage
The input object label image. Default value is NULL. Supported types include: label color image.
-
outRegionImage
public final SoImageVizEngineOutput<SoSFImageDataAdapter,SoImageDataAdapter> outRegionImage
The output region label image. Default value is NULL. Supported types include: grayscale binary label color image.
-
-