@ALDAOperator(genericExecutionMode=ALL, level=APPLICATION) public class DetectMSERs extends MTBOperator
For details about the implementation and its parameters please refer to the corresponding documentation pages in the ImgLib2 Javadoc API.
Please note that currently only gray-scale images are supported. The implementation handles data up to 3D, i.e. x/y/z. Multiple channels and time steps are ignored, i.e. only the first channel and the first time step of an image is taken into account.
Related paper: Matas et al., Robust wide-baseline stereo from maximally stable extremal regions, Image and Vision Computing, vol. 22, no. 10, pp. 761-767, 2004.
Modifier and Type | Class and Description |
---|---|
static class |
DetectMSERs.Thresholding_Direction
Modes for direction of intensity thresholding.
|
Modifier and Type | Field and Description |
---|---|
private MTBImageByte |
binaryMasks
(Optinal) stack with binary segmentation masks.
|
private boolean |
createMasks
Flag to enable binary mask creation.
|
private double |
delta
Difference between threshold levels to compare.
|
private int |
iDepth
Depth of input image, i.e. dimension in z or third axis.
|
private int |
iHeight
Height of input image, i.e. dimension in y or second axis.
|
private MTBImage |
inImg
Input image to process.
|
private int |
iTimeDim
Time dimensionality of input image, i.e. dimension in t or time line.
|
private int |
iWidth
Width of input image, i.e. dimension in x or first axis.
|
private long |
maxSize
Maximum size of regions.
|
private double |
maxVar
Maximum instability score, should be in the interval of [0,1].
|
private double |
minDiversity
Minimum diversity score, should be in the interval of [0,1].
|
private long |
minSize
Minimum size of regions.
|
private int |
mserCount
Count of detected MSERs.
|
private MTBRegionSetInterface |
resultMSERs
Set of detected MSER regions.
|
private DetectMSERs.Thresholding_Direction |
tDirection
Thresholding direction.
|
Constructor and Description |
---|
DetectMSERs()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
private <T extends net.imglib2.type.numeric.RealType<T>> |
extractMSERs(net.imglib2.img.Img<T> img)
Method to calculate MSERs from given image.
|
MTBRegionSetInterface |
getMSERs()
Returns set of detected MSERs.
|
int |
getNumberOfMSERs()
Returns number of detected MSERs.
|
protected void |
operate()
This method does the actual work.
|
void |
setCreateBinaryMasks(boolean b)
Enable/disable creation of binary masks.
|
void |
setDelta(double d)
Set distance between threshold images to be compared.
|
void |
setInputImage(MTBImage img)
Set input image to process.
|
void |
setMaximalInstabilityScore(double ms)
Set maximal instability score.
|
void |
setMaximalSize(long ms)
Set maximal size of valid regions.
|
void |
setMinimalDiversity(double md)
Set minimal diversity.
|
void |
setMinimalSize(long ms)
Set minimal size of valid regions.
|
void |
setThresholdingDirection(DetectMSERs.Thresholding_Direction td)
Set direction of threshold compuations.
|
readResolve
addOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getDocumentation, getHidingMode, getInactiveParameterNames, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterDescriptorUnconditioned, getParameterNames, getParameterUnconditioned, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, hasInOutParameters, hasParameter, isAnnotatedParameter, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, removeParameter, runOp, runOp, runOp, setConstructionMode, setConstructionMode, setConstructionMode, setHidingMode, setName, setParameter, setParameterUnconditioned, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory
@Parameter(label="Input Image", required=true, dataIOOrder=0, direction=IN, description="Input image") private transient MTBImage inImg
@Parameter(label="Delta Threshold", required=true, dataIOOrder=1, direction=IN, description="Threshold delta for computing instability score.") private double delta
This difference is to be specified as an absolute intensity difference.
@Parameter(label="Minimum Region Size", required=true, dataIOOrder=2, direction=IN, description="Minimum size (in pixels) of accepted MSERs.") private long minSize
@Parameter(label="Maximum Region Size", required=true, dataIOOrder=3, direction=IN, description="Maximum size (in pixels) of accepted MSERs.") private long maxSize
@Parameter(label="Maximum Instability Score", required=true, dataIOOrder=4, direction=IN, description="Maximum instability score of accepted MSERs, should lie between 0 and 1.") private double maxVar
The score is defined as $s(R_i) = \frac{|R_i \backslash R_{i-\Delta}|}{|R_i|}$.
The values of the score range from a minimum of 0 for a region of size 0 to a maximum of 1. The MSER algorithms discards regions with an instability score exceeding the given maximum instability score. Accordingly, the maximum score should be set to a value within the range of [0,1]. If the score is set to 0, all regions are discarded, if it is set to 1, all regions are kept.
@Parameter(label="Minimal Diversity", required=true, dataIOOrder=5, direction=IN, description="Minimal diversity of adjacent accepted MSERs, should lie between 0 and 1.") private double minDiversity
The diversity of two regions A and B is defined as $\frac{|B \backslash A|}{|B|}$.
A region A is discarded if the diversity with regard to B is less or equal to the given minimal diversity. The values of the diversity score range from 0 to 1, i.e., the minimal diversity value should be chosen from this range. A value of 1 discards all regions overlapping with their parents, a value of 0 keeps all regions regardless of any existing overlap.
@Parameter(label="Thresholding Direction", required=true, dataIOOrder=6, direction=IN, description="If to apply thresholds from dark to bright or vice versa.") private DetectMSERs.Thresholding_Direction tDirection
DetectMSERs.Thresholding_Direction
@Parameter(label="Create Binary Masks", required=false, dataIOOrder=1, direction=IN, description="Turn on mask creation.") private transient boolean createMasks
@Parameter(label="Number of MSERs", required=true, dataIOOrder=0, direction=OUT, description="Number of MSERs.") private transient int mserCount
@Parameter(label="Resulting MSER regions", required=true, dataIOOrder=1, direction=OUT, description="Result regions.") private transient MTBRegionSetInterface resultMSERs
@Parameter(label="Binary Masks of Segmentation", dataIOOrder=2, direction=OUT, description="Binary masks.") private transient MTBImageByte binaryMasks
Only created if createMasks
is set to true.
private int iWidth
private int iHeight
private int iDepth
private int iTimeDim
public DetectMSERs() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setInputImage(MTBImage img)
img
- Image to process.public void setDelta(double d)
d
- Distance to be applied.public void setMinimalSize(long ms)
Regions smaller than the given threshold are discarded.
ms
- Minimal region size.public void setMaximalSize(long ms)
Regions larger than the given threshold are discarded.
ms
- Maximal region size.public void setMaximalInstabilityScore(double ms)
ms
- Maximal instability score.public void setMinimalDiversity(double md)
ms
- Minimal diversity allowed for valid regions.public void setThresholdingDirection(DetectMSERs.Thresholding_Direction td)
ms
- Direction of thresholding.public void setCreateBinaryMasks(boolean b)
b
- If true, masks are created, otherwise not.public int getNumberOfMSERs()
public MTBRegionSetInterface getMSERs()
Depending on the dimension of the input image either a set of 2D
or 3D regions is returned, i.e. the object is either of type
MTBRegion2DSet
or MTBRegion3DSet
.
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
private <T extends net.imglib2.type.numeric.RealType<T>> void extractMSERs(net.imglib2.img.Img<T> img)
img
- Image to process.Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.