IMAGE
- Type of image in which the detection happensPIXEL
- Type of pixel of the image in which the detection happensDETECTED_OBJECT
- The type of object emitted by the inner detectorpublic class RotationSimulationObjectDetector<IMAGE extends Image<PIXEL,IMAGE> & SinglebandImageProcessor.Processable<Float,FImage,IMAGE>,PIXEL,DETECTED_OBJECT> extends Object implements ObjectDetector<IMAGE,TransformedDetection<DETECTED_OBJECT>>
ObjectDetector
that wraps another ObjectDetector
and
performs rotation simulations on the images it passes to the internal
detector. This allows a non rotation invariant detector to be able to detect
rotated objects.
This implementation allows the input image to be scaled in order to reduce computational complexity, and control over the simulated angles.
Constructor and Description |
---|
RotationSimulationObjectDetector(ObjectDetector<IMAGE,DETECTED_OBJECT> detector,
float[] simulationAngles,
float scalefactor)
Construct with the given inner detector, simulation angles and scale
factor.
|
RotationSimulationObjectDetector(ObjectDetector<IMAGE,DETECTED_OBJECT> detector,
int numRotations)
Construct with the given inner detector and number of rotations.
|
RotationSimulationObjectDetector(ObjectDetector<IMAGE,DETECTED_OBJECT> detector,
int numRotations,
float scalefactor)
Construct with the given inner detector, number of rotations and scale
factor.
|
Modifier and Type | Method and Description |
---|---|
List<TransformedDetection<DETECTED_OBJECT>> |
detect(IMAGE image)
Detect objects in the given image and return representations of them.
|
ObjectDetector<IMAGE,DETECTED_OBJECT> |
getInnerDetector()
Get the internal detector
|
void |
setROI(Rectangle roi)
(Optional operation).
|
public RotationSimulationObjectDetector(ObjectDetector<IMAGE,DETECTED_OBJECT> detector, int numRotations)
detector
- the internal detectornumRotations
- the number of rotationspublic RotationSimulationObjectDetector(ObjectDetector<IMAGE,DETECTED_OBJECT> detector, int numRotations, float scalefactor)
detector
- the internal detectornumRotations
- the number of rotationsscalefactor
- the amount by which to scale the input image prior to passing
to the inner detectorpublic RotationSimulationObjectDetector(ObjectDetector<IMAGE,DETECTED_OBJECT> detector, float[] simulationAngles, float scalefactor)
detector
- the internal detectorsimulationAngles
- the rotation angles to simulatescalefactor
- the amount by which to scale the input image prior to passing
to the inner detectorpublic List<TransformedDetection<DETECTED_OBJECT>> detect(IMAGE image)
ObjectDetector
If no objects are detected, null
or an empty list may be
returned.
detect
in interface ObjectDetector<IMAGE extends Image<PIXEL,IMAGE> & SinglebandImageProcessor.Processable<Float,FImage,IMAGE>,TransformedDetection<DETECTED_OBJECT>>
image
- the image to detect the object in.null
if none are found.public void setROI(Rectangle roi)
ObjectDetector
Set the region of interest within the image to search for objects.
Setting to null
means to search the whole image.
setROI
in interface ObjectDetector<IMAGE extends Image<PIXEL,IMAGE> & SinglebandImageProcessor.Processable<Float,FImage,IMAGE>,TransformedDetection<DETECTED_OBJECT>>
roi
- the region of interestpublic ObjectDetector<IMAGE,DETECTED_OBJECT> getInnerDetector()