@ALDAOperator(genericExecutionMode=ALL, level=STANDARD, allowBatchMode=false) @ALDDerivedClass public class FeatureCalculatorLBPOriginal extends FeatureCalculator
This operator is based on the original publication of LBPs:
Ojala, Pietikaeinen, Harwood, "A Comparative Study of Texture
Measures with Classification based on Feature Distributions",
Pattern Recognition, Vol. 29, No. 1, pp. 51-59, 1996
In addition to the original method here optionally not only the 8
direct neighbors of a pixel are considered for local LBP code generation,
but also the next 16 or 24 surrounding pixels (corresponding to R=1,
R=2 and R=3):
3 3 3 3 3 3 3
3 2 2 2 2 2 3
3 2 1 1 1 2 3
3 2 1 1 1 2 3
3 2 1 1 1 2 3
3 2 2 2 2 2 3
3 3 3 3 3 3 3
All three calculated LBP codes are each binned in a corresponding histogram which is calculated over the whole image. All three histograms are then concatenated and returned as result. According to the chosen neighborhood context the dimensionality of this result varies naturally.
Note that this class is not optimized for efficiency!
Modifier and Type | Class and Description |
---|---|
static class |
FeatureCalculatorLBPOriginal.NeighborhoodSelection
Kind of neighborhood to be considered for code calculation.
|
Modifier and Type | Field and Description |
---|---|
protected MTBImageInt |
codeStack
Additional code stack.
|
private int |
indexR1
Channel index of code image for R = 1.
|
private int |
indexR2
Channel index of code image for R = 2.
|
private int |
indexR3
Channel index of code image for R = 3.
|
protected FeatureCalculatorLBPOriginal.NeighborhoodSelection |
nbMode
Neighborhood(s) to be considered.
|
protected boolean |
showCodeStack
Show additional result image.
|
inImg, resultObj
Constructor and Description |
---|
FeatureCalculatorLBPOriginal()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected int[] |
extractFeatures()
Method to extract code histogram from the given image.
|
private int |
getLPB16(int x,
int y,
double center)
Extract codes for 16-pixel neighborhood with r=2.
|
private int |
getLPB24(int x,
int y,
double center)
Extract codes for 24-pixel neighborhood with r=3.
|
private int |
getLPB8(int x,
int y,
double center)
Extract codes for 8-pixel neighborhood with r=1.
|
protected FeatureCalculatorLBPResult |
getResultDataObjectInvalid(int dim)
Helper method to allow for requesting invalid dummy results.
|
void |
operate() |
getResultData, setInputImage
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="Neighborhood", direction=IN, description="Neighborhood(s) to consider.") protected FeatureCalculatorLBPOriginal.NeighborhoodSelection nbMode
@Parameter(label="Show Code Stack?", direction=IN, supplemental=true, description="Enable/disable display of code images in a stack.") protected boolean showCodeStack
@Parameter(label="Result Code Stack", direction=OUT, supplemental=true, description="Stack with LBP code images.") protected MTBImageInt codeStack
private int indexR1
private int indexR2
private int indexR3
public FeatureCalculatorLBPOriginal() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of failure.public void operate()
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
protected FeatureCalculatorLBPResult getResultDataObjectInvalid(int dim)
FeatureCalculator
getResultDataObjectInvalid
in class FeatureCalculator
dim
- Desired dimension of output object.protected int[] extractFeatures()
private int getLPB8(int x, int y, double center)
x
- x-coordinate of center pixel to consider.y
- y-coordinate of center pixel to consider.center
- Intensity of center pixel.private int getLPB16(int x, int y, double center)
x
- x-coordinate of center pixel to consider.y
- y-coordinate of center pixel to consider.center
- Intensity of center pixel.private int getLPB24(int x, int y, double center)
x
- x-coordinate of center pixel to consider.y
- y-coordinate of center pixel to consider.center
- Intensity of center pixel.Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.