Package boofcv.alg.distort
Class ImageDistortCache_SB<Input extends ImageGray<Input>,Output extends ImageGray<Output>>
java.lang.Object
boofcv.alg.distort.ImageDistortCache_SB<Input,Output>
- All Implemented Interfaces:
ImageDistort<Input,
Output>
- Direct Known Subclasses:
ImageDistortCache_SB_MT
public class ImageDistortCache_SB<Input extends ImageGray<Input>,Output extends ImageGray<Output>>
extends Object
implements ImageDistort<Input,Output>
Except for very simple functions, computing the per pixel distortion is an expensive operation.
To overcome this problem the distortion is computed once and cached. Then when the image is distorted
again the save results are simply recalled and not computed again.
-
Field Summary
Modifier and TypeFieldDescriptionprotected AssignPixelValue_SB<Output>
protected boolean
protected Output
protected PixelTransform<Point2D_F32>
protected int
protected InterpolatePixelS<Input>
protected Point2D_F32[]
protected boolean
protected Input
protected int
protected int
protected int
protected int
protected int
-
Constructor Summary
ConstructorDescriptionImageDistortCache_SB
(AssignPixelValue_SB<Output> assigner, InterpolatePixelS<Input> interp) Specifies configuration parameters -
Method Summary
Modifier and TypeMethodDescriptionvoid
Applies the transform to the entire destination image.void
Applies the transform to only the specified region inside the destination image.void
Applies the transform, but marks pixels in the mask as 1 = inside, 0 = outside.protected void
protected void
applyOnlyInside
(GrayU8 mask) getMap()
getModel()
Returns the distortion model.boolean
Returns the render all flagprotected void
protected void
protected void
void
setModel
(PixelTransform<Point2D_F32> dstToSrc) Specifies how pixel coordinates are transformed from the destination to source images.void
setRenderAll
(boolean renderAll) Specifies if the entire output image should be rendered, even if mapping to the source image is outside the source image.
-
Field Details
-
assigner
-
width
protected int width -
height
protected int height -
map
-
interp
-
dstToSrc
-
x0
protected int x0 -
y0
protected int y0 -
x1
protected int x1 -
y1
protected int y1 -
renderAll
protected boolean renderAll -
srcImg
-
dstImg
-
dirty
protected boolean dirty
-
-
Constructor Details
-
ImageDistortCache_SB
Specifies configuration parameters- Parameters:
interp
- Interpolation algorithm
-
-
Method Details
-
setModel
Description copied from interface:ImageDistort
Specifies how pixel coordinates are transformed from the destination to source images. -
apply
Description copied from interface:ImageDistort
Applies the transform to the entire destination image. -
apply
Description copied from interface:ImageDistort
Applies the transform, but marks pixels in the mask as 1 = inside, 0 = outside. Where inside pixels are pixels in the dst image with an equivalent pixel in the src image's bounds -
apply
Description copied from interface:ImageDistort
Applies the transform to only the specified region inside the destination image.- Specified by:
apply
in interfaceImageDistort<Input extends ImageGray<Input>,
Output extends ImageGray<Output>> - Parameters:
srcImg
- (Input) Original image.dstImg
- (Output) Distorted image.dstX0
- Left most crop boundary. Inclusive.dstY0
- Top most crop boundary. Inclusive.dstX1
- Right most crop boundary. Exclusive.dstY1
- Bottom most crop boundary. Exclusive.
-
init
-
renderAll
protected void renderAll() -
renderAll
-
applyOnlyInside
protected void applyOnlyInside() -
applyOnlyInside
-
getMap
-
getInterp
-
getDstToSrc
-
setRenderAll
public void setRenderAll(boolean renderAll) Description copied from interface:ImageDistort
Specifies if the entire output image should be rendered, even if mapping to the source image is outside the source image.- Specified by:
setRenderAll
in interfaceImageDistort<Input extends ImageGray<Input>,
Output extends ImageGray<Output>> - Parameters:
renderAll
- true to render all pixels. If false then only pixels inside the source image
-
getRenderAll
public boolean getRenderAll()Description copied from interface:ImageDistort
Returns the render all flag- Specified by:
getRenderAll
in interfaceImageDistort<Input extends ImageGray<Input>,
Output extends ImageGray<Output>> - Returns:
- render all flag
-
getModel
Description copied from interface:ImageDistort
Returns the distortion model.
-