Query on NEScale
Hi, I am executing NEScale for down scaling an image with area interpolation. when I compared the output with OpenVX scale image(https://www.khronos.org/registry/OpenVX/specs/1.2/html/d1/d26/group__group__vision__function__scale__image.html#ga065754e616b553a39c13c16b4b8de45a) for the same input, output mismatches.
A sample code for scaling the image and a log for the outputs are attached here. Other than area interpolation case, all outputs are matching for NEScale and vx_scaleimage. Is the algorithm used for area interpolation different from the explained algorithm in the link? acl_scale_test.txt scaleimage_issue_on_downscale.txt
Hi team, any update on the above issue?
I've managed to reproduce that one, you can see what policy is used in our implementation here
Hi @JijiG
What version of openvx are you using? Could you please share the vx code to generate the reference?
My openvx code to scale the image doesn't match your results.
Hi @JijiG
I think I found the problem, see below the OpenVX 1.2 code. It comes with AREA interpolation mode disabled and it runs NEAREST_NEIGHBOUR instead even when the VX Node is setup to use AREA.
In your test, acl_scale_test.txt, if you set interpolation = InterpolationPolicy::NEAREST_NEIGHBOR; you'll see no mismatches.
/* Specification 1.0, on AREA interpolation method: "The details of this
- sampling method are implementation defined. The implementation should
- perform enough sampling to avoid aliasing, but there is no requirement
- that the sample areas for adjacent output pixels be disjoint, nor that
- the pixels be weighted evenly." *
- The existing implementation of AREA can use too much heap in certain
- circumstances, so disabling for now, and using NEAREST_NEIGHBOR instead,
- as it also passes conformance for AREA interpolation. / #define AREA_SCALE_ENABLE 0 / TODO enable this again after changing implementation in sample/targets/vx_scale.c */