001/*******************************************************************************
002 * This software is provided as a supplement to the authors' textbooks on digital
003 * image processing published by Springer-Verlag in various languages and editions.
004 * Permission to use and distribute this software is granted under the BSD 2-Clause
005 * "Simplified" License (see http://opensource.org/licenses/BSD-2-Clause).
006 * Copyright (c) 2006-2023 Wilhelm Burger, Mark J. Burge. All rights reserved.
007 * Visit https://imagingbook.com for additional details.
008 ******************************************************************************/
009package imagingbook.common.sift;
010
011import imagingbook.common.ij.DialogUtils.DialogHide;
012import imagingbook.common.ij.DialogUtils.DialogLabel;
013import imagingbook.common.sift.SiftDetector.NeighborhoodType3D;
014import imagingbook.common.util.ParameterBundle;
015
016/**
017 * Default parameters; a (usually modified) instance of this class may be passed to the constructor of
018 * {@link SiftDetector}.
019 */
020public class SiftParameters implements ParameterBundle<SiftDetector> {
021        
022        /** Set true to output debug information. */
023        @DialogHide
024        public boolean DEBUG = false;
025        
026        /** Type of neigborhood used for peak detection in 3D scale space. */
027        @DialogLabel("Neighborhood for 3D peak detection")
028        public NeighborhoodType3D nhType = NeighborhoodType3D.NH18;
029        
030        /** Sampling scale (nominal smoothing level of the input image). */
031        @DialogLabel("Nominal sampling scale (sigmaS)")
032        public double sigmaS = 0.5;
033        
034        /** Base scale at level 0 (base smoothing). */
035        @DialogLabel("Base scale at level 0 (sigma0)")
036        public double sigma0 = 1.6;
037        
038        /** Number of octaves in Gaussian/DoG scale space. */
039        @DialogLabel("Number of scale space octaves (P)")
040        public int P = 4;
041        
042        /** Scale steps (levels) per octave. */
043        @DialogLabel("Scale levels per octaves (Q)")
044        public int Q = 3;
045        
046        /** Minimum magnitude required in DoG peak detection (abs. value). */
047        @DialogLabel("Minimum detection magnitude (tMag)")
048        public double tMag = 0.01;
049        
050        
051        /** Minimum DoG magnitude required for extrapolated peaks (abs. value). */
052        @DialogLabel("Minimum peak magnitude (tPeak)")
053        public double tPeak = tMag;
054        
055        /** Minimum difference to all neighbors in DoG peak detection (max. 0.0005). */
056        @DialogLabel("Minimum neigborhood difference (tExtrm)")
057        public double tExtrm = 0.0;
058        
059        /** Maximum number of iterations for refining the position of a key point. */
060        @DialogLabel("Maximum position refinement steps (nRefine)")
061        public int nRefine = 5;
062        
063        /** Maximum principal curvature ratio used to eliminate line-like structures (3..10). */
064        @DialogLabel("Maximum principal curvature ratio (rhoMax=3..10)")
065        public double rhoMax = 10.0;
066        
067        /** Number of orientation bins in the feature descriptor (angular resolution). */
068        @DialogLabel("Number of orientation bins (nOrient)")
069        public int nOrient = 36;
070        
071        /** Number of smoothing steps applied to the orientation histogram. */
072        @DialogLabel("Histogram smoothing steps (nSmooth)")
073        public int nSmooth = 2;
074        
075        /** Minimum value in orientation histogram for dominant orientations (rel. to max. entry). */
076        @DialogLabel("Minimum value in orientation histogram (tDomOr)")
077        public double tDomOr = 0.8;
078        
079        /** Number of spatial descriptor bins along each x/y axis. */
080        @DialogLabel("Number of spatial descriptor bins (nSpat)")
081        public int nSpat = 4;
082        
083        /** Number of angular descriptor bins. */
084        @DialogLabel("Number of angular descriptor bins (nAngl)")
085        public int nAngl = 8;
086        
087        /** Maximum value in normalized feature vector (0.2 recommended by Lowe). */
088        @DialogLabel("Maximum normalized feature value (tFclip)")
089        public double tFclip = 0.2;
090        
091        /** Scale factor for converting normalized features to byte values in [0,255]. */
092        @DialogLabel("Feature integer conversion scale (sFscale)")
093        public double sFscale = 512.0;
094        
095        /** Spatial size factor of descriptor (relative to feature scale). */
096        @DialogLabel("Descriptor display size factor (sDesc)")
097        public double sDesc = 10.0;
098        
099//      /** Set true to sort detected keypoints by response magnitude. */
100//      @DialogLabel("Sort keypoints by score magnitude")
101//      public boolean sortKeyPoints = true;
102}