check image's info (PIL, skimage, opencv)
Code:
from PIL import Image
import numpy as np
from skimage import io
import cv2
png_file = './Screenshot.png'
# PIL
print('==========PIL==========')
img = Image.open(png_file)
print(img)
arr = np.array(img)
print(arr)
# from skimage import io
print('\n')
print('==========skimage==========')
img = io.imread(png_file)
print(img)
#import cv2
print('\n')
print('==========cv2==========')
img = cv2.imread(png_file)
print(img)
print(img.shape)
print(img.size)
print(img.dtype)
#
if __name__ == '__main__':
print('finishing to check the image\'s info')
浙公网安备 33010602011771号