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.mser;
010
011import ij.gui.GenericDialog;
012import imagingbook.common.ij.DialogUtils;
013import imagingbook.common.ij.DialogUtils.DialogHide;
014import imagingbook.common.ij.DialogUtils.DialogLabel;
015import imagingbook.common.mser.components.ComponentTree.Method;
016import imagingbook.common.util.ParameterBundle;
017
018/**
019 * Parameters for MSER detection. Instances of this class may be placed inside a {@link GenericDialog} using
020 * {@link DialogUtils#addToDialog(ParameterBundle, ij.gui.GenericDialog)}.
021 */
022public class MserParameters implements ParameterBundle<MserDetector> {
023        //{@link DialogUtils#addToDialog(ParameterBundle<?>, GenericDialog)}
024        @DialogLabel("Component tree method")
025        public Method method = Method.LinearTime;
026        
027        @DialogLabel("Delta")
028        public int delta = 5;                                                   // = \Delta
029        
030        @DialogLabel("Min component size (pixels)")
031        public int minAbsComponentArea = 3;
032        
033        @DialogLabel("Min rel. component size")
034        public double minRelCompSize = 0.0001;          // = \alpha_{\min}
035        
036        @DialogLabel("Max rel. component size")
037        public double maxRelCompSize = 0.25;            // = \alpha_{\max}
038        
039        @DialogLabel("Max component size variation")
040        public double maxSizeVariation = 0.25;
041        
042        @DialogLabel("Min component diversity")
043        public double minDiversity = 0.50;
044        
045        @DialogLabel("Constrain ellipse size")
046        public boolean constrainEllipseSize = true;
047        
048        @DialogLabel("Min region compactness")
049        public double minCompactness = 0.2;
050        
051        @DialogLabel("Validate component tree")@DialogHide
052        public boolean validateComponentTree = false;
053}