Package boofcv.alg.distort
Interface ImageDistort<Input extends ImageBase,Output extends ImageBase>
- All Known Implementing Classes:
ImageDistortBasic
,ImageDistortBasic_IL
,ImageDistortBasic_IL_MT
,ImageDistortBasic_SB
,ImageDistortBasic_SB_MT
,ImageDistortCache_SB
,ImageDistortCache_SB_MT
,ImplImageDistort_PL
Copies an image onto another image while applying a transform to the pixel coordinates.
Pixels outside the source image can be handled using the interpolations border or by simply skipping them. This
behavior is set by calling the
setRenderAll(boolean)
flag. By Default it will render the entire image,
even if pixel is outside the source image.-
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.getModel()
Returns the distortion model.boolean
Returns the render all flagvoid
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.
-
Method Details
-
setModel
Specifies how pixel coordinates are transformed from the destination to source images.- Parameters:
dstToSrc
- Pixel coordinate transformation.
-
apply
Applies the transform to the entire destination image.- Parameters:
srcImg
- (Input) Original image.dstImg
- (Output) Distorted image.
-
apply
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- Parameters:
srcImg
- (Input) Original image.dstImg
- (Output) Distorted image.mask
- (Output) Mask of inside pixels. Automatically resized to match dstImg.
-
apply
Applies the transform to only the specified region inside the destination image.- 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.
-
setRenderAll
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.- Parameters:
renderAll
- true to render all pixels. If false then only pixels inside the source image
-
getRenderAll
boolean getRenderAll()Returns the render all flag- Returns:
- render all flag
-
getModel
PixelTransform<Point2D_F32> getModel()Returns the distortion model.- Returns:
- model dst to src
-