Warp
Warp node is used for image warping and dewarping, which can be used to undistort images from wide FOV cameras. The node can also be used to apply a perspective transform to the image.Compared to ImageManip node (thesetWarpMesh()
function):Warp node uses underlyting warp HW block (additional docs here), with no extra resources (SHAVE/cmx cores). HW limitation: width must be divisible by 16.ImageManip node combines the power of warp HW block together the efficiency of CMX memory to achieve higher throughput (e.g. 4k@30 fps). Scheduling of the HW block is done by SHAVE cores which also do color space conversion, type conversion (YUV420 to NV12), etc. The downside of using ImageManip node is extra RAM and SHAVE usage.How to place it
Python
C++
Python
Python
1pipeline = dai.Pipeline()
2warp = pipeline.create(dai.node.Warp)
Inputs and Outputs
Usage
Python
C++
Python
Python
1pipeline = dai.Pipeline()
2
3warp = pipeline.create(dai.node.Warp)
4# Create a custom warp mesh
5p1 = dai.Point2f(20, 20)
6p2 = dai.Point2f(460, 20)
7p3 = dai.Point2f(20, 460)
8p4 = dai.Point2f(460, 460)
9warp.setWarpMesh([p1,p2,p3,p4], 2, 2)
10warp.setOutputSize((512,512))
11warp.setMaxOutputFrameSize(512 * 512 * 3)
12# Warp engines to be used (0,1,2)
13warp.setHwIds([1])
14# Warp interpolation mode, choose between BILINEAR, BICUBIC, BYPASS
15warp.setInterpolation(dai.Interpolation.NEAREST_NEIGHBOR)
Examples of functionality
Reference
class
depthai.node.Warp(depthai.Node)
method
getHwIds(self) -> list[int]: list[int]
Retrieve which hardware warp engines to use
method
getInterpolation(self) -> depthai.Interpolation: depthai.Interpolation
Retrieve which interpolation method to use
method
setHwIds(self, arg0: list
[
int
])
Specify which hardware warp engines to use Parameter ``ids``: Which warp engines to use (0, 1, 2)
method
setInterpolation(self, arg0: depthai.Interpolation)
Specify which interpolation method to use Parameter ``interpolation``: type of interpolation
method
setMaxOutputFrameSize(self, arg0: int)
Specify maximum size of output image. Parameter ``maxFrameSize``: Maximum frame size in bytes
method
setNumFramesPool(self, arg0: int)
Specify number of frames in pool. Parameter ``numFramesPool``: How many frames should the pool have
method
method
property
inputImage
Input image to be modified Default queue is blocking with size 8
property
out
Outputs ImgFrame message that carries warped image.
Need assistance?
Head over to Discussion Forum for technical support or any other questions you might have.