I used 2 library (matplotlib & cv2) to read 1 image.
But, why the value of same pixel is different.
import matplotlib.pyplot as plt
import numpy as np
import cv2
file = 'C:/Users/Admin/Pictures/Untitled.png'
mpl_img = plt.imread(file)
cv2_img = cv2.imread(file)
print(mpl_img[100,100])
print(cv2_img[100,100])
As I know, cv2 use color space BGR, matplotlib use RGB
Thus, the result must be:
[ 255 245 0 ]
[ 0 245 255 ]
Below is actual result when I run this code to find the value of pixel (100,100):
PS E:\Document\python> python test_color.py
[1. 0.9607843 0. ]
[ 0 245 255 ]