public abstract class MotionEstimator extends VideoAnalyser<FImage>
This class deals with the buffering of frames from the video which to pass
to the motion estimation. The class is abstract and the method
estimateMotionField(MotionEstimatorAlgorithm, VideoFrame, VideoFrame[])
must be overridden by an implementing class to provide the field over which
the motion estimation will take place. This field may, for example, be a grid
or an overlapping grid. This overridden method must also determine the appropriate
way to call the motion estimation algorithm while returning a map which maps
a point to a displacement vector.
Modifier and Type | Field and Description |
---|---|
Map<Point2d,Point2d> |
motionVectors
The estimated motion vectors for the last analysed frame
|
Constructor and Description |
---|
MotionEstimator(MotionEstimatorAlgorithm alg)
Constructor a new motion estimator using the given algorithm.
|
MotionEstimator(Video<FImage> v,
MotionEstimatorAlgorithm alg)
Create a chainable motion estimator.
|
Modifier and Type | Method and Description |
---|---|
void |
analyseFrame(FImage frame)
Analyse the given frame and make no changes to the frame.
|
protected abstract Map<Point2d,Point2d> |
estimateMotionField(MotionEstimatorAlgorithm estimator,
VideoFrame<FImage> frame,
VideoFrame<FImage>[] array)
This method needs to be overridden for specific layouts of motion
field within the image.
|
Map<Point2d,Point2d> |
getMotionVectors()
Return the estimated motion vectors for the last processed frame.
|
processFrame
countFrames, getCurrentFrame, getFPS, getHeight, getNextFrame, getTimeStamp, getWidth, hasNextFrame, process, process, processingComplete, reset
close, getCurrentFrameIndex, iterator, seek, setCurrentFrameIndex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public Map<Point2d,Point2d> motionVectors
public MotionEstimator(MotionEstimatorAlgorithm alg)
alg
- The algorithm to use to estimate motion.public MotionEstimator(Video<FImage> v, MotionEstimatorAlgorithm alg)
v
- The video to chain toalg
- The algorithm to use to estimate motionpublic void analyseFrame(FImage frame)
analyseFrame
in class VideoAnalyser<FImage>
frame
- The video frame to analyseVideoAnalyser.analyseFrame(org.openimaj.image.Image)
public Map<Point2d,Point2d> getMotionVectors()
protected abstract Map<Point2d,Point2d> estimateMotionField(MotionEstimatorAlgorithm estimator, VideoFrame<FImage> frame, VideoFrame<FImage>[] array)
frame
- The current framearray
- The list of previous frames (based on the estimator)