ImageManipConfig
This message can is used for cropping, warping, rotating, resizing, etc. an image in runtime. It can be sent from host/Script node to either ColorCamera or ImageManip.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
Reference
class
depthai.ImageManipConfig(depthai.Buffer)
method
method
get(self) -> RawImageManipConfig: RawImageManipConfigRetrieve configuration data for ImageManip. Returns: config for ImageManip
method
getColormap(self) -> Colormap: ColormapReturns: specified colormap
method
getCropConfig(self) -> RawImageManipConfig.CropConfig: RawImageManipConfig.CropConfigReturns: Crop configuration
method
getCropXMax(self) -> float: floatReturns: Bottom right X coordinate of crop region
method
getCropXMin(self) -> float: floatReturns: Top left X coordinate of crop region
method
getCropYMax(self) -> float: floatReturns: Bottom right Y coordinate of crop region
method
getCropYMin(self) -> float: floatReturns: Top left Y coordinate of crop region
method
getFormatConfig(self) -> RawImageManipConfig.FormatConfig: RawImageManipConfig.FormatConfigReturns: Format configuration
method
getInterpolation(self) -> Interpolation: InterpolationRetrieve which interpolation method to use
method
getResizeConfig(self) -> RawImageManipConfig.ResizeConfig: RawImageManipConfig.ResizeConfigReturns: Resize configuration
method
getResizeHeight(self) -> int: intReturns: Output image height
method
getResizeWidth(self) -> int: intReturns: Output image width
method
isResizeThumbnail(self) -> bool: boolReturns: True if resize thumbnail mode is set, false otherwise
method
set(self, config: RawImageManipConfig) -> ImageManipConfig: ImageManipConfigSet explicit configuration. Parameter ``config``: Explicit configuration
method
setCenterCrop(self, ratio: float, whRatio: float = 1.0) -> ImageManipConfig: ImageManipConfigSpecifies 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, ...
method
method
method
setCropRotatedRect(self, rr: RotatedRect, normalizedCoords: bool = True) -> ImageManipConfig: ImageManipConfigSpecifies 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
method
setFrameType(self, type: RawImgFrame.Type) -> ImageManipConfig: ImageManipConfigSpecify output frame type. Parameter ``name``: Frame type
method
setHorizontalFlip(self, flip: bool) -> ImageManipConfig: ImageManipConfigSpecify horizontal flip Parameter ``flip``: True to enable flip, false otherwise
method
setInterpolation(self, interpolation: Interpolation) -> ImageManipConfig: ImageManipConfigSpecify which interpolation method to use Parameter ``interpolation``: type of interpolation
method
setKeepAspectRatio(self, keep: bool) -> ImageManipConfig: ImageManipConfigSpecifies to whether to keep aspect ratio or not
method
method
method
setReusePreviousImage(self, reuse: bool) -> ImageManipConfig: ImageManipConfigInstruct ImageManip to not remove current image from its queue and use the same for next message. Parameter ``reuse``: True to enable reuse, false otherwise
method
setRotationDegrees(self, deg: float) -> ImageManipConfig: ImageManipConfigSpecifies clockwise rotation in degrees Parameter ``deg``: Rotation in degrees
method
setRotationRadians(self, rad: float) -> ImageManipConfig: ImageManipConfigSpecifies clockwise rotation in radians Parameter ``rad``: Rotation in radians
method
setSkipCurrentImage(self, skip: bool) -> ImageManipConfig: ImageManipConfigInstructs ImageManip to skip current image and wait for next in queue. Parameter ``skip``: True to skip current image, false otherwise
method
setVerticalFlip(self, flip: bool)Specify vertical flip Parameter ``flip``: True to enable vertical flip, false otherwise
method
setWarpBorderFillColor(self, red: int, green: int, blue: int) -> ImageManipConfig: ImageManipConfigSpecifies 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
method
setWarpBorderReplicatePixels(self) -> ImageManipConfig: ImageManipConfigSpecifies that warp replicates border pixels
method
setWarpTransformFourPoints(self, pt: list
[
Point2f
], normalizedCoords: bool) -> ImageManipConfig: ImageManipConfigSpecifies 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
method
setWarpTransformMatrix3x3(self, mat: list
[
float
]) -> ImageManipConfig: ImageManipConfigSpecifies warp with a 3x3 matrix Parameter ``mat``: 3x3 matrix
Need assistance?
Head over to Discussion Forum for technical support or any other questions you might have.