visrec.ri.ml.detection

## Class AbstractObjectDetector<IMAGE_CLASS>

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

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

Direct Known Subclasses:
  SimpleObjectDetector

    public abstract class AbstractObjectDetector<IMAGE_CLASS>
    extends Object
    implements javax.visrec.ml.detection.ObjectDetector<IMAGE_CLASS>

Abstract object detector which implements `ObjectDetector` to return the positions of an object within the given image.

Author:
  Zoran Sevarac

### Constructor Summary

Constructors
Constructor and Description
`AbstractObjectDetector(javax.visrec.AbstractImageClassifier<IMAGE_CLASS,Boolean> imageClassifier)` Creates an instance of the object detector

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`Map<String,List<javax.visrec.util.BoundingBox>>` `detect(File file)` Detect the object based on the given `File`.
`Map<String,List<javax.visrec.util.BoundingBox>>` `detect(InputStream inStream)` Detect the object based on the given `InputStream`.
`abstract Map<String,List<javax.visrec.util.BoundingBox>>` `detectObject(IMAGE_CLASS image)` Scan entire image and return positions where object is detected
`javax.visrec.AbstractImageClassifier<IMAGE_CLASS,Boolean>` `getImageClassifier()` Subclasses should use ths method to use the underlying image classifier

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

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

### Constructor Detail

#### AbstractObjectDetector

    public AbstractObjectDetector(javax.visrec.AbstractImageClassifier<IMAGE_CLASS,Boolean> imageClassifier)

Creates an instance of the object detector

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

### Method Detail

#### detectObject

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

Scan entire image and return positions where object is detected

Specified by:
  `detectObject` in interface `javax.visrec.ml.detection.ObjectDetector<IMAGE_CLASS>`
Parameters:
  `image` - `IMAGE_CLASS` image
Returns:
  `Map` of `BoundingBox` of where the object has been detected.

#### detect

    public Map<String,List<javax.visrec.util.BoundingBox>> detect(File file)
                                                           throws IOException

Detect the object based on the given `File`.

Parameters:
  `file` - Image file.
Returns:
  `Map` of `BoundingBox` of where the object has been detected.
Throws:
  `IOException` - if the image couldn't be retrieved from storage.

#### detect

    public Map<String,List<javax.visrec.util.BoundingBox>> detect(InputStream inStream)
                                                           throws IOException

Detect the object based on the given `InputStream`.

Parameters:
  `inStream` - `InputStream` of the image
Returns:
  `Map` of `BoundingBox` of where the object has been detected.
Throws:
  `IOException` - if the image couldn't be retrieved from storage.

#### getImageClassifier

    public javax.visrec.AbstractImageClassifier<IMAGE_CLASS,Boolean> getImageClassifier()

Subclasses should use ths method to use the underlying image classifier

Returns:
  configured `AbstractImageClassifier` of the `AbstractObjectDetector`