Hello, I am attempting to modify and distort a 12MP image obtained from the ColorCamera ISP output. My current pipeline consists of the following pipeline: ColorCamera.isp -> ImageManip -> H.264 encoder -> XlinkOut.

My objective is to resize the 12MP image to a resolution of 2016x1520 and then apply distortion correction using the setWarpMesh function. As per a Github issue I came across, the ImageManip component should perform the resizing operation before any other operations.

(the resize is done as part of of first step in current updated ImageManip impl)

In the code snippet from the Github gist, I've noticed that it crops the image instead of resizing it, resulting in a loss of image data. Specifically, the ImageManip node seems to take only a 2160x1520 portion of the 12MP image.

Interestingly, when I adjust the ispScale to (1,2), ensuring that the input and output resolutions of the ImageManip node match, the process works as intended.

Do you know where could be a problem? Thanks

  • erik replied to this.

    Hi oto313 ,
    That's expected - as Warp will actually crop if your mesh is created with 2160x1520 size in mind (which you have specified here).
    Thoughts?

    But when I create mesh for 4032x3040. and call setResize(4032,2040) on ImageManip node then I get following image

    So what is the proper way to resize and warp?

    So how does ImageManip node works if it performs multiple operations? It would be nice to have that in documentation. Thanks.

    • erik replied to this.

      Hi @erik

      I already saw the documentation, but i wasnt able to find order of operations in ImageManip.
      It yields varying results depending on whether warping or resizing is performed first. I think that information is not in documentation. I already successfuly warped and resized image using 2 ImageManip nodes, but i wanted to do it in single ImageManip node.

      5 days later

      Also I would like to resize crop rotate and then warp the image in a single Image manip node. Help would be appreciated, because I have no more free memory on OAK-FFC-3P

      • erik replied to this.

        Hi oto313 ,
        Sorry about the delay. Operations are as following:

        (color conversion) -> crop/warp -> resize -> color conversion

        All of this stages can be set separately. First color conversion only happens if we are using warp-unsupported types (eg, NV12). Crop will dictate what input to take into consideration, and resize will dictate to what size to scale the before mentioned input. I hope this helps!