Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7427

Beginners • warning message when reading .jpg file on RPi4b with cv2

$
0
0
I've been learning about cv2 and openCV.
I've been doing tests on my PC, as it's easier to work with.
I'm trying to implement some of the simple programs on the RPi4 now. I tried the following simple program:

Code:

import cv2img_bgr = cv2.imread('img.jpg')# BGR to grayscaleimg_gray = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2GRAY)cv2.imshow("Original Image", img_bgr)cv2.imshow('Grayscale Image', img_gray)cv2.waitKey(0)cv2.destroyAllWindows()
While the images are displayed correctly, I get a warning message:

libpng warning: iCCP: known incorrect sRGB profile

This repeats 4 or 5 times but doesn't seem to keep the images from being loaded correctly.
I tried to search for this warning message but everything seems to be related to cameras or other stuff.

How do I stop/correct this warning message?

Thanks.

Statistics: Posted by starfire151a — Sun Oct 20, 2024 4:07 pm — Replies 1 — Views 46



Viewing all articles
Browse latest Browse all 7427

Trending Articles