Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Member Functions | List of all members
dai::node::Warp Class Reference

Warp node. Capability to crop, resize, warp, ... incoming image frames. More...

#include <Warp.hpp>

Inheritance diagram for dai::node::Warp:
Inheritance graph
[legend]

Public Member Functions

std::vector< int > getHwIds () const
 Retrieve which hardware warp engines to use. More...
 
dai::Interpolation getInterpolation () const
 Retrieve which interpolation method to use. More...
 
void setHwIds (std::vector< int > ids)
 
void setInterpolation (dai::Interpolation interpolation)
 
void setMaxOutputFrameSize (int maxFrameSize)
 
void setNumFramesPool (int numFramesPool)
 
void setOutputSize (int width, int height)
 
void setOutputSize (std::tuple< int, int > size)
 
void setWarpMesh (const std::vector< Point2f > &meshData, int width, int height)
 
void setWarpMesh (const std::vector< std::pair< float, float >> &meshData, int width, int height)
 
 Warp (const std::shared_ptr< PipelineImpl > &par, int64_t nodeId)
 
 Warp (const std::shared_ptr< PipelineImpl > &par, int64_t nodeId, std::unique_ptr< Properties > props)
 
- Public Member Functions inherited from dai::NodeCRTP< Node, Warp, WarpProperties >
std::unique_ptr< Nodeclone () const override
 
const char * getName () const override
 
- Public Member Functions inherited from dai::Node
virtual std::unique_ptr< Nodeclone () const =0
 Deep copy the node. More...
 
AssetManagergetAssetManager ()
 Get node AssetManager as a reference. More...
 
const AssetManagergetAssetManager () const
 Get node AssetManager as a const reference. More...
 
std::vector< Input * > getInputRefs ()
 Retrieves reference to node inputs. More...
 
std::vector< const Input * > getInputRefs () const
 Retrieves reference to node inputs. More...
 
std::vector< InputgetInputs ()
 Retrieves all nodes inputs. More...
 
virtual const char * getName () const =0
 Retrieves nodes name. More...
 
std::vector< Output * > getOutputRefs ()
 Retrieves reference to node outputs. More...
 
std::vector< const Output * > getOutputRefs () const
 Retrieves reference to node outputs. More...
 
std::vector< OutputgetOutputs ()
 Retrieves all nodes outputs. More...
 
Pipeline getParentPipeline ()
 
const Pipeline getParentPipeline () const
 
 Node (const std::shared_ptr< PipelineImpl > &p, Id nodeId, std::unique_ptr< Properties > props)
 Constructs Node. More...
 
virtual ~Node ()=default
 

Public Attributes

Input inputImage {*this, "inputImage", Input::Type::SReceiver, true, 8, true, {{DatatypeEnum::ImgFrame, true}}}
 
Output out {*this, "out", Output::Type::MSender, {{DatatypeEnum::ImgFrame, true}}}
 
- Public Attributes inherited from dai::NodeCRTP< Node, Warp, WarpProperties >
Propertiesproperties
 Underlying properties. More...
 
- Public Attributes inherited from dai::Node
const Id id
 Id of node. More...
 
Propertiesproperties
 

Static Public Attributes

constexpr static const char * NAME = "Warp"
 

Protected Member Functions

PropertiesgetProperties ()
 
- Protected Member Functions inherited from dai::Node
virtual tl::optional< OpenVINO::VersiongetRequiredOpenVINOVersion ()
 
void setInputMapRefs (InputMap *inMapRef)
 
void setInputMapRefs (std::initializer_list< InputMap * > l)
 
void setInputRefs (Input *inRef)
 
void setInputRefs (std::initializer_list< Input * > l)
 
void setOutputMapRefs (OutputMap *outMapRef)
 
void setOutputMapRefs (std::initializer_list< OutputMap * > l)
 
void setOutputRefs (Output *outRef)
 
void setOutputRefs (std::initializer_list< Output * > l)
 

Private Member Functions

void setWarpMesh (const float *meshData, int numMeshPoints, int width, int height)
 

Additional Inherited Members

- Public Types inherited from dai::NodeCRTP< Node, Warp, WarpProperties >
using Properties = WarpProperties
 
- Public Types inherited from dai::Node
using Id = std::int64_t
 Node identificator. Unique for every node on a single Pipeline. More...
 
- Protected Attributes inherited from dai::Node
AssetManager assetManager
 
std::unordered_map< std::string, InputMap * > inputMapRefs
 
std::unordered_map< std::string, Input * > inputRefs
 
std::unordered_map< std::string, OutputMap * > outputMapRefs
 
std::unordered_map< std::string, Output * > outputRefs
 
std::weak_ptr< PipelineImplparent
 
copyable_unique_ptr< PropertiespropertiesHolder
 

Detailed Description

Warp node. Capability to crop, resize, warp, ... incoming image frames.

Definition at line 16 of file Warp.hpp.

Constructor & Destructor Documentation

◆ Warp() [1/2]

dai::node::Warp::Warp ( const std::shared_ptr< PipelineImpl > &  par,
int64_t  nodeId 
)

Definition at line 5 of file Warp.cpp.

◆ Warp() [2/2]

dai::node::Warp::Warp ( const std::shared_ptr< PipelineImpl > &  par,
int64_t  nodeId,
std::unique_ptr< Properties props 
)

Definition at line 6 of file Warp.cpp.

Member Function Documentation

◆ getHwIds()

std::vector< int > dai::node::Warp::getHwIds ( ) const

Retrieve which hardware warp engines to use.

Definition at line 85 of file Warp.cpp.

◆ getInterpolation()

dai::Interpolation dai::node::Warp::getInterpolation ( ) const

Retrieve which interpolation method to use.

Definition at line 93 of file Warp.cpp.

◆ getProperties()

Warp::Properties & dai::node::Warp::getProperties ( )
protectedvirtual

Reimplemented from dai::Node.

Definition at line 12 of file Warp.cpp.

◆ setHwIds()

void dai::node::Warp::setHwIds ( std::vector< int >  ids)

Specify which hardware warp engines to use

Parameters
idsWhich warp engines to use (0, 1, 2)

Definition at line 81 of file Warp.cpp.

◆ setInterpolation()

void dai::node::Warp::setInterpolation ( dai::Interpolation  interpolation)

Specify which interpolation method to use

Parameters
interpolationtype of interpolation

Definition at line 89 of file Warp.cpp.

◆ setMaxOutputFrameSize()

void dai::node::Warp::setMaxOutputFrameSize ( int  maxFrameSize)

Specify maximum size of output image.

Parameters
maxFrameSizeMaximum frame size in bytes

Definition at line 30 of file Warp.cpp.

◆ setNumFramesPool()

void dai::node::Warp::setNumFramesPool ( int  numFramesPool)

Specify number of frames in pool.

Parameters
numFramesPoolHow many frames should the pool have

Definition at line 26 of file Warp.cpp.

◆ setOutputSize() [1/2]

void dai::node::Warp::setOutputSize ( int  width,
int  height 
)

Definition at line 22 of file Warp.cpp.

◆ setOutputSize() [2/2]

void dai::node::Warp::setOutputSize ( std::tuple< int, int >  size)

Sets output frame size in pixels

Parameters
sizewidth and height in pixels

Definition at line 17 of file Warp.cpp.

◆ setWarpMesh() [1/3]

void dai::node::Warp::setWarpMesh ( const float *  meshData,
int  numMeshPoints,
int  width,
int  height 
)
private

Definition at line 34 of file Warp.cpp.

◆ setWarpMesh() [2/3]

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

Set a custom warp mesh

Parameters
meshData2D plane of mesh points, starting from top left to bottom right
widthWidth of mesh
heightHeight of mesh

Definition at line 73 of file Warp.cpp.

◆ setWarpMesh() [3/3]

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

Definition at line 77 of file Warp.cpp.

Member Data Documentation

◆ inputImage

Input dai::node::Warp::inputImage {*this, "inputImage", Input::Type::SReceiver, true, 8, true, {{DatatypeEnum::ImgFrame, true}}}

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

Definition at line 45 of file Warp.hpp.

◆ NAME

constexpr static const char* dai::node::Warp::NAME = "Warp"
staticconstexpr

Definition at line 18 of file Warp.hpp.

◆ out

Output dai::node::Warp::out {*this, "out", Output::Type::MSender, {{DatatypeEnum::ImgFrame, true}}}

Outputs ImgFrame message that carries warped image.

Definition at line 50 of file Warp.hpp.


The documentation for this class was generated from the following files:


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20