peterbraden / node-opencv

OpenCV Bindings for node.js
MIT License
4.37k stars 858 forks source link

Does interpolation work when using resize()? #683

Open aaronlsilber opened 2 years ago

aaronlsilber commented 2 years ago

I'm trying to upscale an image using the INTER_NEAREST interpolation and it doesn't seem to be working when compared to the results of an identical python script.

image.resize(4, 4, cv.Constants.INTER_NEAREST);

produces

test-large

whereas in python, this

cv2.resize(image, (4, 4), interpolation=cv2.INTER_NEAREST)

produces

Screen Shot 2021-11-05 at 8 18 26 AM

Am I using this api incorrectly, or does this not work as intended? Thanks!

Also, my package-lock.json reports using; "opencv": { "version": "github:peterbraden/node-opencv#f0a03a4be7064ca4d75ff2f16f8cf206fe982456", "from": "github:peterbraden/node-opencv", "requires": { "buffers": "^0.1.1", "nan": "^2.14.0" } },