Class BackgroundModelMoving<T extends ImageBase,MotionModel extends InvertibleTransform<MotionModel>>
- java.lang.Object
-
- boofcv.alg.background.BackgroundModel<T>
-
- boofcv.alg.background.BackgroundModelMoving<T,MotionModel>
-
- Direct Known Subclasses:
- BackgroundMovingBasic, BackgroundMovingGaussian
public abstract class BackgroundModelMoving<T extends ImageBase,MotionModel extends InvertibleTransform<MotionModel>> extends BackgroundModel<T>
Base class for classifying pixels and background based on the apparent motion of pixels when the camera is moving. The camera motion is provided externally.
There are three coordinate systems.- World is the background model's coordinate system.
- Home is the image which all the camera motion is relative to
- Current is the location of the current image.
The background model is composed of a single fixed sized image. The background image size is specified in the
initialize(int, int, InvertibleTransform)function. After that the background model is updated by callingupdateBackground(InvertibleTransform, ImageBase). To flag pixels as background/motion callsegment(InvertibleTransform, ImageBase, GrayU8).If a pixel in the current frame has no corresponding pixel in the background or the background pixel hasn't been observed yet then it will be assigned a special value, which is user configurable. The default value is 0, which is a background pixel. See
BackgroundModel.setUnknownValue(int)}
-
-
Constructor Summary
Constructors Constructor and Description BackgroundModelMoving(PointTransformModel_F32<MotionModel> transform, ImageType<T> imageType)Constructor which provides the motion model and image type
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract voidinitialize(int backgroundWidth, int backgroundHeight, MotionModel homeToWorld)Initializes background model.voidsegment(MotionModel homeToCurrent, T frame, GrayU8 segmented)Invoke to use the background image to segment the current frame into background and foreground pixelsvoidupdateBackground(MotionModel homeToCurrent, T frame)Updates the background with new image information.-
Methods inherited from class boofcv.alg.background.BackgroundModel
getImageType, getUnknownValue, reset, setUnknownValue
-
-
-
-
Constructor Detail
-
BackgroundModelMoving
public BackgroundModelMoving(PointTransformModel_F32<MotionModel> transform, ImageType<T> imageType)
Constructor which provides the motion model and image type- Parameters:
transform- Point transform which can be used to apply the motion modelimageType- Type of input image
-
-
Method Detail
-
initialize
public abstract void initialize(int backgroundWidth, int backgroundHeight, MotionModel homeToWorld)Initializes background model. Specifies the size of the background image and transform from the "home" image to the background "world"- Parameters:
backgroundWidth- Width of backgroundbackgroundHeight- Height of backgroundhomeToWorld- Transform from home to world.
-
updateBackground
public void updateBackground(MotionModel homeToCurrent, T frame)
Updates the background with new image information.- Parameters:
homeToCurrent- Transform from home image to the current imageframe- The current image in the sequence
-
segment
public void segment(MotionModel homeToCurrent, T frame, GrayU8 segmented)
Invoke to use the background image to segment the current frame into background and foreground pixels- Parameters:
homeToCurrent- Transform from home image to the current imageframe- current imagesegmented- Segmented image. 0 = background, 1 = foreground/moving
-
-
DataMelt 3.0 © DataMelt by jWork.ORG