-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
Also see the title, I did the test following the code.
import cv2
from PIL import Image
import matplotlib.pyplot as plt
img = cv2.imread("./ILSVRC2012/ILSVRC2012_val_00000001.JPEG")
img = img[:, :, ::-1]
cv_img = cv2.resize( img, (224,224), interpolation=cv2.INTER_LINEAR).astype( np.float32 )
pil_image = Image.fromarray( img )
pil_image = pil_image.resize((224, 224), Image.BILINEAR)
pil_image = np.array(pil_image).astype( np.float32 )
print( cv_img.dtype, pil_image.dtype )
diff = np.sum( np.abs(cv_img-pil_image) )
print( diff )The diff s 397057.0 under the same mode. The PIL version is 6.2.1, opencv version is 4.1.1, so is it always different here?
Reactions are currently unavailable