-
-
Notifications
You must be signed in to change notification settings - Fork 56.3k
Closed
Description
System information (version)
- OpenCV => 4.5.4
- Language=> python/cpp
- Operating System / Platform => Windows
- Compiler => MSVC 19.32.31332.0
I am trying to replicate PIL and scikit-image nearest-neighbor o/p in OpenCV but getting INTER_NEAREST o/p.
cv2.resize(x,(0,0),fx=0.5,fy=0.5,interpolation=cv2.INTER_NEAREST)
cv2.resize(x,(0,0),fx=0.5,fy=0.5,interpolation=cv2.INTER_NEAREST)
x1=Image.fromarray(img)
x1.thumbnail((256,256),Image.Resampling.NEAREST)
rescale(x,0.5,order=0,preserve_range=True, anti_aliasing=False)
As it can be seen, OpenCV INTER_NEAREST and OpenCV INTER_NEAREST_EXACT are matching, which is not expected.
The expected was that the OpenCV INTER_NEAREST_EXACT should match PIL and scikit-image o/p, but I am getting this difference:
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found any solution - I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc