001/**
002 * Copyright (c) 2011, The University of Southampton and the individual contributors.
003 * All rights reserved.
004 *
005 * Redistribution and use in source and binary forms, with or without modification,
006 * are permitted provided that the following conditions are met:
007 *
008 *   *  Redistributions of source code must retain the above copyright notice,
009 *      this list of conditions and the following disclaimer.
010 *
011 *   *  Redistributions in binary form must reproduce the above copyright notice,
012 *      this list of conditions and the following disclaimer in the documentation
013 *      and/or other materials provided with the distribution.
014 *
015 *   *  Neither the name of the University of Southampton nor the names of its
016 *      contributors may be used to endorse or promote products derived from this
017 *      software without specific prior written permission.
018 *
019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
020 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
021 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
022 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
023 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
024 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
025 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
026 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
027 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
028 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
029 */
030package org.openimaj.image.objectdetection;
031
032import org.openimaj.image.Image;
033import org.openimaj.image.objectdetection.filtering.DetectionFilter;
034import org.openimaj.math.geometry.shape.Rectangle;
035
036/**
037 * Interface describing a multi-scale object detector. Optional methods are
038 * provided for controlling the detection size.
039 * <p>
040 * Any type of Java object can be used to represent a detection; this could be
041 * something as simple as a {@link Rectangle} representing the spatial location
042 * of the detection, or it could be much more complex.
043 * <p>
044 * The interface allows for multiple detections to be returned from the input
045 * image. If required, these detections could be filtered by a
046 * {@link DetectionFilter} as a post-processing operation.
047 *
048 * @see ObjectDetector
049 *
050 * @author Jonathon Hare (jsh2@ecs.soton.ac.uk)
051 *
052 * @param <IMAGE>
053 *            The image on which to perform the detection
054 * @param <DETECTED_OBJECT>
055 *            the type of object representing a detection.
056 */
057public interface MultiScaleObjectDetector<IMAGE extends Image<?, IMAGE>, DETECTED_OBJECT>
058                extends
059ObjectDetector<IMAGE, DETECTED_OBJECT>
060{
061        /**
062         * (Optional operation).
063         * <p>
064         * Set the minimum detection size.
065         *
066         * @param size
067         *            the minimum detection size.
068         */
069        public void setMinimumDetectionSize(int size);
070
071        /**
072         * (Optional operation).
073         * <p>
074         * Set the maximum detection size. A size less than or equal to 0 indicates
075         * there is no maximum size.
076         *
077         * @param size
078         *            the maximum detection size.
079         */
080        public void setMaximumDetectionSize(int size);
081
082        /**
083         * (Optional operation).
084         * <p>
085         * Get the minimum detection size.
086         *
087         * @return the minimum detection size.
088         *
089         */
090        public int getMinimumDetectionSize();
091
092        /**
093         * (Optional operation).
094         * <p>
095         * Get the maximum detection size. A size less than or equal to 0 indicates
096         * there is no maximum size.
097         *
098         * @return the maximum detection size.
099         */
100        public int getMaximumDetectionSize();
101}