Is it possible to opencv (using python) as default read an image as order of RGB ? in the opencv documentation imread method return image as order of BGR but in code imread methods return the image as RGB order ? I am not doing any converting process. Just used imread methods and show on the screen. It shows as on windows image viewer. is it possible ?
EDIT 1: my code is below. left side cv.imshow() methods and the other one plt.imshow() methods.
cv2.imshow() methods shows image as RGB and plt show it as opencv read (BGR) the image.
image_file = 'image/512-2-1001-18-RGB.jpg'
# img = imp.get_image(image_file)
img = cv2.imread(image_file)
plt.imshow(img)
plt.show()
cv2.imshow('asd', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
EDIT 2 : Some how opencv imshow methods is showing the image as RGB below I have attached the first pixel's value of image and next image is photoshop pixel values
EDIT 3 : below just reading image and with imshow and second image is original RGB image.
after imshow method image looks same as original image and this confused me
Original image in order of RGB.
cv2.imread()
reads image in RGB format. I think the default format is BGR only. You can always usecv2.cvtColor(img, cv2.COLOR_BGR2RGB)
after reading the image to convert the image to RGB. – ZdaRRGB = cv2.imread('image.png')[...,::-1]
– Mark Setchell