Package boofcv.struct.pyramid
Class ImagePyramidBase<T extends ImageBase<T>>
java.lang.Object
boofcv.struct.pyramid.ImagePyramidBase<T>
- All Implemented Interfaces:
ImagePyramid<T>
- Direct Known Subclasses:
PyramidDiscrete
,PyramidFloat
public abstract class ImagePyramidBase<T extends ImageBase<T>>
extends Object
implements ImagePyramid<T>
Base class for image pyramids. Provides common functionality and data structures. The scale
is defined in its children PyramidDiscrete
and PyramidFloat
. This allows
it to be either integer or floating point and strongly typed.
When updating the pyramid, if the top most layer is at the same resolution as the original image then a reference can optionally be saved, avoiding an unnecessary image copy. This is done by setting the saveOriginalReference to true.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
ImagePyramidBase
(ImageType<T> imageType, boolean saveOriginalReference) Specifies input image size and behavior of top most layer.protected
ImagePyramidBase
(ImagePyramidBase<T> orig) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Used to internally check that the provided scales are valid.int
getHeight
(int layer) Returns the height of an image at ths specified layer.The type of image.int
Height of input image.int
Width of input image.getLayer
(int layerNum) Returns a layer in the pyramid.int
getWidth
(int layer) Returns the width of an image at ths specified layer.void
initialize
(int width, int height) Initializes internal data structures based on the input image's size.boolean
Checks to see if the pyramid has been initialized or notboolean
void
setFirstLayer
(T image) void
setSaveOriginalReference
(boolean save) void
setTo
(ImagePyramid<T> input) Set's this pyramid to be the same as input.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface boofcv.struct.pyramid.ImagePyramid
copyStructure, getNumLayers, getSampleOffset, getScale, getSigma, process
-
Field Details
-
bottomWidth
protected int bottomWidth -
bottomHeight
protected int bottomHeight -
layers
-
saveOriginalReference
protected boolean saveOriginalReference
-
-
Constructor Details
-
ImagePyramidBase
Specifies input image size and behavior of top most layer.- Parameters:
imageType
- Type of image which is processedsaveOriginalReference
- If a reference to the full resolution image should be saved instead of copied.
-
ImagePyramidBase
-
-
Method Details
-
initialize
public void initialize(int width, int height) Initializes internal data structures based on the input image's size. Should be called each time a new image is processed.- Specified by:
initialize
in interfaceImagePyramid<T extends ImageBase<T>>
- Parameters:
width
- Image widthheight
- Image height
-
isInitialized
public boolean isInitialized()Description copied from interface:ImagePyramid
Checks to see if the pyramid has been initialized or not- Specified by:
isInitialized
in interfaceImagePyramid<T extends ImageBase<T>>
-
checkScales
protected void checkScales()Used to internally check that the provided scales are valid. -
setTo
Description copied from interface:ImagePyramid
Set's this pyramid to be the same as input. The two pyramids must have the same structure or else an exception will be thrown.- Specified by:
setTo
in interfaceImagePyramid<T extends ImageBase<T>>
- Parameters:
input
- Input pyramid. Not modified.
-
getLayer
Description copied from interface:ImagePyramid
Returns a layer in the pyramid.- Specified by:
getLayer
in interfaceImagePyramid<T extends ImageBase<T>>
- Parameters:
layerNum
- which image is to be returned.- Returns:
- The image in the pyramid.
-
setFirstLayer
-
getWidth
public int getWidth(int layer) Description copied from interface:ImagePyramid
Returns the width of an image at ths specified layer.- Specified by:
getWidth
in interfaceImagePyramid<T extends ImageBase<T>>
- Parameters:
layer
- The layer being requested.- Returns:
- The layer's width.
-
getHeight
public int getHeight(int layer) Description copied from interface:ImagePyramid
Returns the height of an image at ths specified layer.- Specified by:
getHeight
in interfaceImagePyramid<T extends ImageBase<T>>
- Parameters:
layer
- The layer being requested.- Returns:
- The layer's height.
-
getImageType
Description copied from interface:ImagePyramid
The type of image.- Specified by:
getImageType
in interfaceImagePyramid<T extends ImageBase<T>>
- Returns:
- Image type.
-
getInputWidth
public int getInputWidth()Description copied from interface:ImagePyramid
Width of input image.- Specified by:
getInputWidth
in interfaceImagePyramid<T extends ImageBase<T>>
-
getInputHeight
public int getInputHeight()Description copied from interface:ImagePyramid
Height of input image.- Specified by:
getInputHeight
in interfaceImagePyramid<T extends ImageBase<T>>
-
isSaveOriginalReference
public boolean isSaveOriginalReference() -
setSaveOriginalReference
public void setSaveOriginalReference(boolean save)
-