Class ImageManip

Inheritance Relationships

Base Type

Class Documentation

class ImageManip : public dai::NodeCRTP<Node, ImageManip, ImageManipProperties>

ImageManip node. Capability to crop, resize, warp, … incoming image frames.

Public Functions

ImageManip(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId)
ImageManip(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId, std::unique_ptr<Properties> props)
void setCropRect(float xmin, float ymin, float xmax, float ymax)
void setCenterCrop(float ratio, float whRatio = 1.0f)
void setResize(int w, int h)
void setResizeThumbnail(int w, int h, int bgRed = 0, int bgGreen = 0, int bgBlue = 0)
void setFrameType(ImgFrame::Type name)
void setHorizontalFlip(bool flip)
void setKeepAspectRatio(bool keep)
void setWaitForConfigInput(bool wait)

Specify whether or not wait until configuration message arrives to inputConfig Input.

Parameters:

wait – True to wait for configuration message, false otherwise.

bool getWaitForConfigInput() const

Returns:

True if wait for inputConfig message, false otherwise

void setNumFramesPool(int numFramesPool)

Specify number of frames in pool.

Parameters:

numFramesPool – How many frames should the pool have

void setMaxOutputFrameSize(int maxFrameSize)

Specify maximum size of output image.

Parameters:

maxFrameSize – Maximum frame size in bytes

void setWarpMesh(const std::vector<Point2f> &meshData, int width, int height)

Set a custom warp mesh

Parameters:
  • meshData – 2D plane of mesh points, starting from top left to bottom right

  • width – Width of mesh

  • height – Height of mesh

void setWarpMesh(const std::vector<std::pair<float, float>> &meshData, int width, int height)

Public Members

ImageManipConfig initialConfig

Initial config to use when manipulating frames

Input inputConfig = {*this, "inputConfig", Input::Type::SReceiver, true, 8, {{DatatypeEnum::ImageManipConfig, true}}}

Input ImageManipConfig message with ability to modify parameters in runtime Default queue is blocking with size 8

Input inputImage = {*this, "inputImage", Input::Type::SReceiver, true, 8, true, {{DatatypeEnum::ImgFrame, true}}}

Input image to be modified Default queue is blocking with size 8

Output out = {*this, "out", Output::Type::MSender, {{DatatypeEnum::ImgFrame, true}}}

Outputs ImgFrame message that carries modified image.

Public Static Attributes

static constexpr const char *NAME = "ImageManip"

Protected Functions

virtual Properties &getProperties()