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:
ActionListener,WindowListener,Runnable,EventListener
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 Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate classprivate classprivate classprivate classNested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleprivate doubleprivate doubleprivate static final intprivate intprivate intprivate AlgorithmBRISK.BriskLongPair[]private final intprivate intprivate intprivate intprivate AlgorithmBRISK.BriskPatternPoint[]private doubleprivate intprivate Vector<AlgorithmBRISK.BriskLayer> private booleanprivate intprivate final doubleprivate booleanprivate double[]private static final doubleprivate static final intprivate AlgorithmBRISK.BriskShortPair[]private int[]private intprivate intprivate static final intprivate booleanFields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmBRISK - default constructor.AlgorithmBRISK(ModelImage srcImg) AlgorithmBRISK(ModelImage destImage, ModelImage srcImg, boolean wholeImageFlag, int threshold, int HammingDistanceThreshold, int octaves, boolean rotationInvariant, boolean scaleInvariant, double patternScale, Vector<Double> radiusList, Vector<Integer> numberList, double dMax, double dMin, Vector<Integer> indexChange) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidprivate byte[][]computeImpl(ModelImage image, Vector<AlgorithmBRISK.KeyPoint> keypoints) private voidconstructPyramid(ModelImage image) voiddetectImpl(ModelImage image, Vector<AlgorithmBRISK.KeyPoint> keypoints, BitSet mask) voidfinalize()finalize -private voidprivate voidgetKeypoints(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) voidStarts 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.AlgorithmBase
actionPerformed, 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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
wholeImageFlag
private boolean wholeImageFlag -
threshold
private int threshold -
HammingDistanceThreshold
private int HammingDistanceThreshold -
octaves
private int octaves -
rotationInvariant
private boolean rotationInvariant -
scaleInvariant
private boolean scaleInvariant -
patternScale
private double patternScale -
radiusList
-
numberList
-
dMax
private double dMax -
dMin
private double dMin -
indexChange
-
basicSize
private static final double basicSize- See Also:
-
scales
private static final int scales- See Also:
-
scaleRange
private static final double scaleRange- See Also:
-
n_rot
private final int n_rot- See Also:
-
safetyFactor
private final double safetyFactor- See Also:
-
points
private int points -
patternPoints
-
scaleList
private double[] scaleList -
sizeList
private int[] sizeList -
shortPairs
-
longPairs
-
numShortPairs
private int numShortPairs -
numLongPairs
private int numLongPairs -
strings
private int strings -
layers
private int layers -
pyramid
-
HALFSAMPLE
private static final int HALFSAMPLE- See Also:
-
TWOTHIRDSAMPLE
private static final int TWOTHIRDSAMPLE- See Also:
-
safeThreshold
private int safeThreshold
-
-
Constructor Details
-
AlgorithmBRISK
public AlgorithmBRISK()AlgorithmBRISK - default constructor. -
AlgorithmBRISK
-
AlgorithmBRISK
public AlgorithmBRISK(ModelImage destImage, ModelImage srcImg, boolean wholeImageFlag, int threshold, int HammingDistanceThreshold, int octaves, boolean rotationInvariant, boolean scaleInvariant, double patternScale, Vector<Double> radiusList, Vector<Integer> numberList, double dMax, double dMin, Vector<Integer> indexChange) - Parameters:
destImage-srcImg- Source imagewholeImageFlag-threshold- FAST/AGAST detection thresholdHammingDistanceThreshold-octaves- Number of octaves for the detectionrotationInvariant-scaleInvariant-patternScale- Scale factor for the BRISK pattern.radiusList-numberList-dMax- Short pair maximum distancedMin- Long pair maximum distanceindexChange-
-
-
Method Details
-
finalize
public void finalize()finalize -- Overrides:
finalizein classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()Starts the program.- Specified by:
runAlgorithmin classAlgorithmBase
-
BriskDescriptorExtractor
private void BriskDescriptorExtractor() -
generateKernel
private void generateKernel() -
smoothedIntensity
private int smoothedIntensity(ModelImage image, ModelImage integral, double key_x, double key_y, int scale, int rot, int point) -
RoiPredicate
private boolean RoiPredicate(double minX, double minY, double maxX, double maxY, AlgorithmBRISK.KeyPoint keyPt) -
computeImpl
-
detectImpl
-
briskScaleSpace
private void briskScaleSpace() -
constructPyramid
-
getKeypoints
-
refine3D
private double refine3D(int layer, int x_layer, int y_layer, double[] x, double[] y, double[] scale, boolean[] ismax) -
refine1D
private double refine1D(double s_05, double s0, double s05, double[] max) -
refine1D_1
private double refine1D_1(double s_05, double s0, double s05, double[] max) -
refine1D_2
private double refine1D_2(double s_05, double s0, double s05, double[] max) -
getScoreMaxBelow
private double getScoreMaxBelow(int layer, int x_layer, int y_layer, int threshold, boolean[] ismax, double[] dx, double[] dy) -
getScoreMaxAbove
private double getScoreMaxAbove(int layer, int x_layer, int y_layer, int threshold, boolean[] ismax, double[] dx, double[] dy) -
subpixel2D
private 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)
-