@AmunTimilsina
To letterbox the frames before passing them to the object detector node, you can use the ImageManip node with the setResizeThumbnail(x,y)
method. For example, if you're using a 640 YOLO model, you would use setResizeThumbnail(640,640)
. This will resize the frame to fit the model and pad the rest with black pixels, preserving the full field of view (FOV).
However, keep in mind that this method might decrease the neural network accuracy because the actual image will be smaller, and some features might not be preserved.
Here is an example of how to use the ImageManip node:
manip = pipeline.create(dai.node.ImageManip)
manip.setResizeThumbnail(640, 640)
Thanks,
Jaka