I have an image F of size 1044*1408, it only has 3 integer values 0, 2, and 3.
I want to shrink it to 360*480. Now I am using Z= cv2.resize(F,(480,380)). But Z is interpolated, it has many unique values, more than just 0, 2 and 3. I can't just round up the interpolated values to the closest integer, because I will get some 1s.
F is read from a tif file and manipulated, it is an ndarray now. So I can't use PIL: F = F.resize((new_width, new_height)) as F is not from F = Image.open(*).