visrec.ri.ml.detection

## Class SimpleObjectDetector

- java.lang.Object
- - visrec.ri.ml.detection.AbstractObjectDetector<BufferedImage>
  - - visrec.ri.ml.detection.SimpleObjectDetector

All Implemented Interfaces:
  javax.visrec.ml.detection.ObjectDetector<BufferedImage>

    public class SimpleObjectDetector
    extends AbstractObjectDetector<BufferedImage>

A simple object detector

Author:
  Zoran Sevarac

### Constructor Summary

Constructors
Constructor and Description
`SimpleObjectDetector(javax.visrec.AbstractImageClassifier<BufferedImage,Boolean> classifier)` Creates an instance

### Method Summary

All Methods Instance Methods Concrete Methods
`Map<String,List<javax.visrec.util.BoundingBox>>` `detectObject(BufferedImage image)` Scan image using brute force sliding window and return positions where classifier returns score greater then threshold.
`double` `getThreshold()` Get the threshold
`void` `setThreshold(double threshold)` Set the threshold

### Methods inherited from class visrec.ri.ml.detection.AbstractObjectDetector

`detect, detect, getImageClassifier`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SimpleObjectDetector

    public SimpleObjectDetector(javax.visrec.AbstractImageClassifier<BufferedImage,Boolean> classifier)

Creates an instance

Parameters:
  `classifier` - A `AbstractImageClassifier` which may not be null

### Method Detail

#### detectObject

    public Map<String,List<javax.visrec.util.BoundingBox>> detectObject(BufferedImage image)

Scan image using brute force sliding window and return positions where classifier returns score greater then threshold. get width and height of the image and scan image with classifier - apply classifier to each position This is trivial implementation and should be replaced with something better

Specified by:
  `detectObject` in interface `javax.visrec.ml.detection.ObjectDetector<BufferedImage>`
Specified by:
  `detectObject` in class `AbstractObjectDetector<BufferedImage>`
Parameters:
  `image` - `BufferedImage` to scan
Returns:
  A `Map` of `BoundingBox` which contain the positions of the detected object.

#### getThreshold

    public double getThreshold()

Get the threshold

Returns:
  theshold as `double`

#### setThreshold

    public void setThreshold(double threshold)

Set the threshold

Parameters:
  `threshold` - as `double`