Class AlgorithmGuidedFilter
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.AlgorithmGuidedFilter
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmGuidedFilter extends AlgorithmBase
The MIT License (MIT) Copyright (c) 2014 Atilim Cetin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Reference: K.He, J.Sun, and X.Tang. Guided Image Filtering. TPAMI'12. Original C++ source code by Atilim Cetin
-
-
Field Summary
Fields Modifier and Type Field Description int
BORDER_CONSTANT
int
BORDER_DEFAULT
int
BORDER_REFLECT
int
BORDER_REFLECT_101
int
BORDER_REPLICATE
int
BORDER_WRAP
private double
eps
private ModelImage
guidedImage
private double[][]
I
private double[][][]
Ichannels
private double[][]
invbb
private double[][]
invgb
private double[][]
invgg
private double[][]
invrb
private double[][]
invrg
private double[][]
invrr
private int
length
private double[][]
mean_I
private double[][]
mean_I_b
private double[][]
mean_I_g
private double[][]
mean_I_r
private int
r
private double[][]
var_I
private int
xDim
private int
yDim
-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmGuidedFilter()
AlgorithmGuidedFilter(ModelImage destImg, ModelImage srcImg, ModelImage guidedImage, int r, double eps)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double[][]
add(double[][] a, double b)
private double[][]
add(double[][] a, double[][] b)
private double[][]
boxfilter(double[][] img, int r)
double[][]
copyMakeBorder(double[][] src, int top, int bottom, int left, int right, int borderType, double borderValue)
private double[][]
div(double[][] a, double[][] b)
private double[][]
filterSingleChannel(double[][] p)
private double[][]
filterSingleColorChannel(double[][] p)
void
GuidedFilterColor()
void
GuidedFilterMono()
private double[][]
mul(double[][] a, double[][] b)
void
runAlgorithm()
Actually runs the algorithm.private double[][]
sub(double[][] a, double[][] b)
-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
BORDER_CONSTANT
public final int BORDER_CONSTANT
- See Also:
- Constant Field Values
-
BORDER_REPLICATE
public final int BORDER_REPLICATE
- See Also:
- Constant Field Values
-
BORDER_REFLECT
public final int BORDER_REFLECT
- See Also:
- Constant Field Values
-
BORDER_WRAP
public final int BORDER_WRAP
- See Also:
- Constant Field Values
-
BORDER_REFLECT_101
public final int BORDER_REFLECT_101
- See Also:
- Constant Field Values
-
BORDER_DEFAULT
public final int BORDER_DEFAULT
- See Also:
- Constant Field Values
-
guidedImage
private ModelImage guidedImage
-
yDim
private int yDim
-
xDim
private int xDim
-
length
private int length
-
r
private int r
-
eps
private double eps
-
I
private double[][] I
-
mean_I
private double[][] mean_I
-
var_I
private double[][] var_I
-
Ichannels
private double[][][] Ichannels
-
mean_I_r
private double[][] mean_I_r
-
mean_I_g
private double[][] mean_I_g
-
mean_I_b
private double[][] mean_I_b
-
invrr
private double[][] invrr
-
invrg
private double[][] invrg
-
invrb
private double[][] invrb
-
invgg
private double[][] invgg
-
invgb
private double[][] invgb
-
invbb
private double[][] invbb
-
-
Constructor Detail
-
AlgorithmGuidedFilter
public AlgorithmGuidedFilter()
-
AlgorithmGuidedFilter
public AlgorithmGuidedFilter(ModelImage destImg, ModelImage srcImg, ModelImage guidedImage, int r, double eps)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
GuidedFilterMono
public void GuidedFilterMono()
-
filterSingleChannel
private double[][] filterSingleChannel(double[][] p)
-
GuidedFilterColor
public void GuidedFilterColor()
-
filterSingleColorChannel
private double[][] filterSingleColorChannel(double[][] p)
-
mul
private double[][] mul(double[][] a, double[][] b)
-
sub
private double[][] sub(double[][] a, double[][] b)
-
add
private double[][] add(double[][] a, double b)
-
add
private double[][] add(double[][] a, double[][] b)
-
div
private double[][] div(double[][] a, double[][] b)
-
copyMakeBorder
public double[][] copyMakeBorder(double[][] src, int top, int bottom, int left, int right, int borderType, double borderValue)
-
boxfilter
private double[][] boxfilter(double[][] img, int r)
-
-