# ImageManipConfig

This message can is used for cropping, warping, rotating, resizing, etc. an image in runtime. It can be sent from
host/[Script](https://docs.luxonis.com/software/depthai-components/nodes/script.md) node to either
[ColorCamera](https://docs.luxonis.com/software/depthai-components/nodes/color_camera.md) or
[ImageManip](https://docs.luxonis.com/software/depthai-components/nodes/image_manip.md).

> This message will reconfigure the whole config of the node, meaning you need to set all settings, not just the setting you want
to change.

## Examples of functionality

 * [RGB Camera Control](https://docs.luxonis.com/software/depthai/examples/rgb_camera_control.md)
 * [RGB Rotate Warp](https://docs.luxonis.com/software/depthai/examples/rgb_rotate_warp.md)

## Reference

### depthai.ImageManipConfig(depthai.Buffer)

Kind: Class

ImageManipConfig message. Specifies image manipulation options like:

- Crop

- Resize

- Warp

- ...

#### __init__(self)

Kind: Method

#### get(self) -> RawImageManipConfig: RawImageManipConfig

Kind: Method

Retrieve configuration data for ImageManip.

Returns:
config for ImageManip

#### getColormap(self) -> Colormap: Colormap

Kind: Method

Returns:
specified colormap

#### getCropConfig(self) -> RawImageManipConfig.CropConfig: RawImageManipConfig.CropConfig

Kind: Method

Returns:
Crop configuration

#### getCropXMax(self) -> float: float

Kind: Method

Returns:
Bottom right X coordinate of crop region

#### getCropXMin(self) -> float: float

Kind: Method

Returns:
Top left X coordinate of crop region

#### getCropYMax(self) -> float: float

Kind: Method

Returns:
Bottom right Y coordinate of crop region

#### getCropYMin(self) -> float: float

Kind: Method

Returns:
Top left Y coordinate of crop region

#### getFormatConfig(self) -> RawImageManipConfig.FormatConfig: RawImageManipConfig.FormatConfig

Kind: Method

Returns:
Format configuration

#### getInterpolation(self) -> Interpolation: Interpolation

Kind: Method

Retrieve which interpolation method to use

#### getResizeConfig(self) -> RawImageManipConfig.ResizeConfig: RawImageManipConfig.ResizeConfig

Kind: Method

Returns:
Resize configuration

#### getResizeHeight(self) -> int: int

Kind: Method

Returns:
Output image height

#### getResizeWidth(self) -> int: int

Kind: Method

Returns:
Output image width

#### isResizeThumbnail(self) -> bool: bool

Kind: Method

Returns:
True if resize thumbnail mode is set, false otherwise

#### set(self, config: RawImageManipConfig) -> ImageManipConfig: ImageManipConfig

Kind: Method

Set explicit configuration.

Parameter ``config``:
Explicit configuration

#### setCenterCrop(self, ratio: typing.SupportsFloat, whRatio: typing.SupportsFloat = 1.0) -> ImageManipConfig: ImageManipConfig

Kind: Method

Specifies a centered crop.

Parameter ``ratio``:
Ratio between input image and crop region (0..1)

Parameter ``whRatio``:
Crop region aspect ratio - 1 equals to square, 1.7 equals to 16:9, ...

#### setColormap()

Kind: Method

#### setCropRect()

Kind: Method

#### setCropRotatedRect(self, rr: RotatedRect, normalizedCoords: bool = True) -> ImageManipConfig: ImageManipConfig

Kind: Method

Specifies crop with rotated rectangle. Optionally as non normalized coordinates

Parameter ``rr``:
Rotated rectangle which specifies crop

Parameter ``normalizedCoords``:
If true coordinates are in normalized range (0..1) otherwise absolute

#### setFrameType(self, type: RawImgFrame.Type) -> ImageManipConfig: ImageManipConfig

Kind: Method

Specify output frame type.

Parameter ``name``:
Frame type

#### setHorizontalFlip(self, flip: bool) -> ImageManipConfig: ImageManipConfig

Kind: Method

Specify horizontal flip

Parameter ``flip``:
True to enable flip, false otherwise

#### setInterpolation(self, interpolation: Interpolation) -> ImageManipConfig: ImageManipConfig

Kind: Method

Specify which interpolation method to use

Parameter ``interpolation``:
type of interpolation

#### setKeepAspectRatio(self, keep: bool) -> ImageManipConfig: ImageManipConfig

Kind: Method

Specifies to whether to keep aspect ratio or not

#### setResize()

Kind: Method

#### setResizeThumbnail()

Kind: Method

#### setReusePreviousImage(self, reuse: bool) -> ImageManipConfig: ImageManipConfig

Kind: Method

Instruct ImageManip to not remove current image from its queue and use the same
for next message.

Parameter ``reuse``:
True to enable reuse, false otherwise

#### setRotationDegrees(self, deg: typing.SupportsFloat) -> ImageManipConfig: ImageManipConfig

Kind: Method

Specifies clockwise rotation in degrees

Parameter ``deg``:
Rotation in degrees

#### setRotationRadians(self, rad: typing.SupportsFloat) -> ImageManipConfig: ImageManipConfig

Kind: Method

Specifies clockwise rotation in radians

Parameter ``rad``:
Rotation in radians

#### setSkipCurrentImage(self, skip: bool) -> ImageManipConfig: ImageManipConfig

Kind: Method

Instructs ImageManip to skip current image and wait for next in queue.

Parameter ``skip``:
True to skip current image, false otherwise

#### setVerticalFlip(self, flip: bool)

Kind: Method

Specify vertical flip

Parameter ``flip``:
True to enable vertical flip, false otherwise

#### setWarpBorderFillColor(self, red: typing.SupportsInt, green: typing.SupportsInt, blue: typing.SupportsInt) ->
ImageManipConfig: ImageManipConfig

Kind: Method

Specifies fill color for border pixels. Example:

- setWarpBorderFillColor(255,255,255) -> white

- setWarpBorderFillColor(0,0,255) -> blue

Parameter ``red``:
Red component

Parameter ``green``:
Green component

Parameter ``blue``:
Blue component

#### setWarpBorderReplicatePixels(self) -> ImageManipConfig: ImageManipConfig

Kind: Method

Specifies that warp replicates border pixels

#### setWarpTransformFourPoints(self, pt: collections.abc.Sequence [ Point2f ], normalizedCoords: bool) -> ImageManipConfig:
ImageManipConfig

Kind: Method

Specifies warp by supplying 4 points in either absolute or normalized
coordinates

Parameter ``pt``:
4 points specifying warp

Parameter ``normalizedCoords``:
If true pt is interpreted as normalized, absolute otherwise

#### setWarpTransformMatrix3x3(self, mat: collections.abc.Sequence [ typing.SupportsFloat ]) -> ImageManipConfig: ImageManipConfig

Kind: Method

Specifies warp with a 3x3 matrix

Parameter ``mat``:
3x3 matrix

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
