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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedImagePyramidBase(ImageType<T> imageType, boolean saveOriginalReference) Specifies input image size and behavior of top most layer.protectedImagePyramidBase(ImagePyramidBase<T> orig) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidUsed to internally check that the provided scales are valid.intgetHeight(int layer) Returns the height of an image at ths specified layer.The type of image.intHeight of input image.intWidth of input image.getLayer(int layerNum) Returns a layer in the pyramid.intgetWidth(int layer) Returns the width of an image at ths specified layer.voidinitialize(int width, int height) Initializes internal data structures based on the input image's size.booleanChecks to see if the pyramid has been initialized or notbooleanvoidsetFirstLayer(T image) voidsetSaveOriginalReference(boolean save) voidsetTo(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, waitMethods 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:
initializein interfaceImagePyramid<T extends ImageBase<T>>- Parameters:
width- Image widthheight- Image height
-
isInitialized
public boolean isInitialized()Description copied from interface:ImagePyramidChecks to see if the pyramid has been initialized or not- Specified by:
isInitializedin interfaceImagePyramid<T extends ImageBase<T>>
-
checkScales
protected void checkScales()Used to internally check that the provided scales are valid. -
setTo
Description copied from interface:ImagePyramidSet'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:
setToin interfaceImagePyramid<T extends ImageBase<T>>- Parameters:
input- Input pyramid. Not modified.
-
getLayer
Description copied from interface:ImagePyramidReturns a layer in the pyramid.- Specified by:
getLayerin 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:ImagePyramidReturns the width of an image at ths specified layer.- Specified by:
getWidthin 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:ImagePyramidReturns the height of an image at ths specified layer.- Specified by:
getHeightin interfaceImagePyramid<T extends ImageBase<T>>- Parameters:
layer- The layer being requested.- Returns:
- The layer's height.
-
getImageType
Description copied from interface:ImagePyramidThe type of image.- Specified by:
getImageTypein interfaceImagePyramid<T extends ImageBase<T>>- Returns:
- Image type.
-
getInputWidth
public int getInputWidth()Description copied from interface:ImagePyramidWidth of input image.- Specified by:
getInputWidthin interfaceImagePyramid<T extends ImageBase<T>>
-
getInputHeight
public int getInputHeight()Description copied from interface:ImagePyramidHeight of input image.- Specified by:
getInputHeightin interfaceImagePyramid<T extends ImageBase<T>>
-
isSaveOriginalReference
public boolean isSaveOriginalReference() -
setSaveOriginalReference
public void setSaveOriginalReference(boolean save)
-