OpenCV equivalent to PIL.Image.ANTIALIAS [closed]
Hi,
I want to mimic behavior of PIL.Image.resize(...,interpolation=PIL.Image.ANTIALIAS). What I would like to expect, is to have matching pixel vales (~99.9% exact match should be fine) . How can I do this with OpenCV ? I tried Opencv resize with available interpolation methods (including LANCZOS4) , but result does differ from the one I got from PIL.
Why I'm doing this? Well I 'm developing machine learning program in C that is using (infer) pre-trained model (done in Python+PIL with PIL.Image.ANTIALIAS). Even small differences in preprocessing of images has an impact on how machine learning model behave. So either I find a way to achieve same resize behavior in OpenCV as used in PIL.Image.ANTIALIAS or how to use PIL in C .
Thanks in advance for answering my question
Please advice
"but result does differ from the one I got from PIL. " -- not the same library, different purpose.
and no, we cannot help you with any problem using PIL.
"Even small differences in preprocessing of images has an impact on how machine learning model behave."
In my small knowledge of deep learning topic, small deviation in input can produce different output value (e.g. different classification probability) but should not change the output (e.g. classification class). In other words, the great thing of deep learning is that they can generalize very well to the type of problem to solve. If the resize method produces a slightly different result, it should not matter since you should have trained a network able to cope with very different inputs.