Package gov.nih.mipav.model.algorithms
Class AlgorithmBRISK
- java.lang.Object
- 
- java.lang.Thread
- 
- gov.nih.mipav.model.algorithms.AlgorithmBase
- 
- gov.nih.mipav.model.algorithms.AlgorithmBRISK
 
 
 
- 
- All Implemented Interfaces:
- java.awt.event.ActionListener,- java.awt.event.WindowListener,- java.lang.Runnable,- java.util.EventListener
 
 public class AlgorithmBRISK extends AlgorithmBase BRISK - Binary Robust Invariant Scalable Keypoints Reference implementation of [1] Stefan Leutenegger,Margarita Chli and Roland Siegwart, BRISK: Binary Robust Invariant Scalable Keypoints, in Proceedings of the IEEE International Conference on Computer Vision (ICCV2011). Copyright (C) 2011 The Autonomous Systems Lab (ASL), ETH Zurich, Stefan Leutenegger, Simon Lynen and Margarita Chli. This file is part of BRISK. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the ASL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Reference for counting number of bits set in a byte: Anatomy of High-Performance 2D Similarity Calculations by Imran S. Haque, Vijay S. Pande, and W. Patrick Walters
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description private classAlgorithmBRISK.BriskLayerprivate classAlgorithmBRISK.BriskLongPairprivate classAlgorithmBRISK.BriskPatternPointprivate classAlgorithmBRISK.BriskShortPairprivate classAlgorithmBRISK.KeyPoint
 - 
Field SummaryFields Modifier and Type Field Description private static doublebasicSizeprivate doubledMaxprivate doubledMinprivate static intHALFSAMPLEprivate intHammingDistanceThresholdprivate java.util.Vector<java.lang.Integer>indexChangeprivate intlayersprivate AlgorithmBRISK.BriskLongPair[]longPairsprivate intn_rotprivate java.util.Vector<java.lang.Integer>numberListprivate intnumLongPairsprivate intnumShortPairsprivate intoctavesprivate AlgorithmBRISK.BriskPatternPoint[]patternPointsprivate doublepatternScaleprivate intpointsprivate java.util.Vector<AlgorithmBRISK.BriskLayer>pyramidprivate java.util.Vector<java.lang.Double>radiusListprivate booleanrotationInvariantprivate intsafeThresholdprivate doublesafetyFactorprivate booleanscaleInvariantprivate double[]scaleListprivate static doublescaleRangeprivate static intscalesprivate AlgorithmBRISK.BriskShortPair[]shortPairsprivate int[]sizeListprivate intstringsprivate intthresholdprivate static intTWOTHIRDSAMPLEprivate booleanwholeImageFlag- 
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBasedestFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
 
- 
 - 
Constructor SummaryConstructors Constructor Description AlgorithmBRISK()AlgorithmBRISK - default constructor.AlgorithmBRISK(ModelImage srcImg)AlgorithmBRISK(ModelImage destImage, ModelImage srcImg, boolean wholeImageFlag, int threshold, int HammingDistanceThreshold, int octaves, boolean rotationInvariant, boolean scaleInvariant, double patternScale, java.util.Vector<java.lang.Double> radiusList, java.util.Vector<java.lang.Integer> numberList, double dMax, double dMin, java.util.Vector<java.lang.Integer> indexChange)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidBriskDescriptorExtractor()private voidbriskScaleSpace()private byte[][]computeImpl(ModelImage image, java.util.Vector<AlgorithmBRISK.KeyPoint> keypoints)private voidconstructPyramid(ModelImage image)voiddetectImpl(ModelImage image, java.util.Vector<AlgorithmBRISK.KeyPoint> keypoints, java.util.BitSet mask)voidfinalize()finalize -private voidgenerateKernel()private voidgetKeypoints(java.util.Vector<AlgorithmBRISK.KeyPoint> keypoints)private doublegetScoreMaxAbove(int layer, int x_layer, int y_layer, int threshold, boolean[] ismax, double[] dx, double[] dy)private doublegetScoreMaxBelow(int layer, int x_layer, int y_layer, int threshold, boolean[] ismax, double[] dx, double[] dy)private doublerefine1D(double s_05, double s0, double s05, double[] max)private doublerefine1D_1(double s_05, double s0, double s05, double[] max)private doublerefine1D_2(double s_05, double s0, double s05, double[] max)private doublerefine3D(int layer, int x_layer, int y_layer, double[] x, double[] y, double[] scale, boolean[] ismax)private booleanRoiPredicate(double minX, double minY, double maxX, double maxY, AlgorithmBRISK.KeyPoint keyPt)voidrunAlgorithm()Starts the program.private intsmoothedIntensity(ModelImage image, ModelImage integral, double key_x, double key_y, int scale, int rot, int point)private doublesubpixel2D(int s_0_0, int s_0_1, int s_0_2, int s_1_0, int s_1_1, int s_1_2, int s_2_0, int s_2_1, int s_2_2, double[] delta_x, double[] delta_y)- 
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBaseactionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, 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.ThreadactiveCount, 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- 
wholeImageFlagprivate boolean wholeImageFlag 
 - 
thresholdprivate int threshold 
 - 
HammingDistanceThresholdprivate int HammingDistanceThreshold 
 - 
octavesprivate int octaves 
 - 
rotationInvariantprivate boolean rotationInvariant 
 - 
scaleInvariantprivate boolean scaleInvariant 
 - 
patternScaleprivate double patternScale 
 - 
radiusListprivate java.util.Vector<java.lang.Double> radiusList 
 - 
numberListprivate java.util.Vector<java.lang.Integer> numberList 
 - 
dMaxprivate double dMax 
 - 
dMinprivate double dMin 
 - 
indexChangeprivate java.util.Vector<java.lang.Integer> indexChange 
 - 
basicSizeprivate static final double basicSize - See Also:
- Constant Field Values
 
 - 
scalesprivate static final int scales - See Also:
- Constant Field Values
 
 - 
scaleRangeprivate static final double scaleRange - See Also:
- Constant Field Values
 
 - 
n_rotprivate final int n_rot - See Also:
- Constant Field Values
 
 - 
safetyFactorprivate final double safetyFactor - See Also:
- Constant Field Values
 
 - 
pointsprivate int points 
 - 
patternPointsprivate AlgorithmBRISK.BriskPatternPoint[] patternPoints 
 - 
scaleListprivate double[] scaleList 
 - 
sizeListprivate int[] sizeList 
 - 
shortPairsprivate AlgorithmBRISK.BriskShortPair[] shortPairs 
 - 
longPairsprivate AlgorithmBRISK.BriskLongPair[] longPairs 
 - 
numShortPairsprivate int numShortPairs 
 - 
numLongPairsprivate int numLongPairs 
 - 
stringsprivate int strings 
 - 
layersprivate int layers 
 - 
pyramidprivate java.util.Vector<AlgorithmBRISK.BriskLayer> pyramid 
 - 
HALFSAMPLEprivate static final int HALFSAMPLE - See Also:
- Constant Field Values
 
 - 
TWOTHIRDSAMPLEprivate static final int TWOTHIRDSAMPLE - See Also:
- Constant Field Values
 
 - 
safeThresholdprivate int safeThreshold 
 
- 
 - 
Constructor Detail- 
AlgorithmBRISKpublic AlgorithmBRISK() AlgorithmBRISK - default constructor.
 - 
AlgorithmBRISKpublic AlgorithmBRISK(ModelImage srcImg) 
 - 
AlgorithmBRISKpublic AlgorithmBRISK(ModelImage destImage, ModelImage srcImg, boolean wholeImageFlag, int threshold, int HammingDistanceThreshold, int octaves, boolean rotationInvariant, boolean scaleInvariant, double patternScale, java.util.Vector<java.lang.Double> radiusList, java.util.Vector<java.lang.Integer> numberList, double dMax, double dMin, java.util.Vector<java.lang.Integer> indexChange) - Parameters:
- destImage-
- srcImg- Source image
- wholeImageFlag-
- threshold- FAST/AGAST detection threshold
- HammingDistanceThreshold-
- octaves- Number of octaves for the detection
- rotationInvariant-
- scaleInvariant-
- patternScale- Scale factor for the BRISK pattern.
- radiusList-
- numberList-
- dMax- Short pair maximum distance
- dMin- Long pair maximum distance
- indexChange-
 
 
- 
 - 
Method Detail- 
finalizepublic void finalize() finalize -- Overrides:
- finalizein class- AlgorithmBase
 
 - 
runAlgorithmpublic void runAlgorithm() Starts the program.- Specified by:
- runAlgorithmin class- AlgorithmBase
 
 - 
BriskDescriptorExtractorprivate void BriskDescriptorExtractor() 
 - 
generateKernelprivate void generateKernel() 
 - 
smoothedIntensityprivate int smoothedIntensity(ModelImage image, ModelImage integral, double key_x, double key_y, int scale, int rot, int point) 
 - 
RoiPredicateprivate boolean RoiPredicate(double minX, double minY, double maxX, double maxY, AlgorithmBRISK.KeyPoint keyPt)
 - 
computeImplprivate byte[][] computeImpl(ModelImage image, java.util.Vector<AlgorithmBRISK.KeyPoint> keypoints) 
 - 
detectImplpublic void detectImpl(ModelImage image, java.util.Vector<AlgorithmBRISK.KeyPoint> keypoints, java.util.BitSet mask) 
 - 
briskScaleSpaceprivate void briskScaleSpace() 
 - 
constructPyramidprivate void constructPyramid(ModelImage image) 
 - 
getKeypointsprivate void getKeypoints(java.util.Vector<AlgorithmBRISK.KeyPoint> keypoints) 
 - 
refine3Dprivate double refine3D(int layer, int x_layer, int y_layer, double[] x, double[] y, double[] scale, boolean[] ismax)
 - 
refine1Dprivate double refine1D(double s_05, double s0, double s05, double[] max)
 - 
refine1D_1private double refine1D_1(double s_05, double s0, double s05, double[] max)
 - 
refine1D_2private double refine1D_2(double s_05, double s0, double s05, double[] max)
 - 
getScoreMaxBelowprivate double getScoreMaxBelow(int layer, int x_layer, int y_layer, int threshold, boolean[] ismax, double[] dx, double[] dy)
 - 
getScoreMaxAboveprivate double getScoreMaxAbove(int layer, int x_layer, int y_layer, int threshold, boolean[] ismax, double[] dx, double[] dy)
 - 
subpixel2Dprivate double subpixel2D(int s_0_0, int s_0_1, int s_0_2, int s_1_0, int s_1_1, int s_1_2, int s_2_0, int s_2_1, int s_2_2, double[] delta_x, double[] delta_y)
 
- 
 
-