Python OpenCV |cv2.imread()method

OpenCV-Python is a library of Python bindings designed to solve computer vision problems.

cv2.imread() method loads an image from the specified file.

import cv2
image = cv2.imread("jg.png")
cv2.imshow("Image",image)
cv2.waitKey(0)
cv2.destroyAllWindows()
                

OUTPUT

output

http://openCV-Python If the image cannot be read (because of the missing file, improper permissions , or unsupported or invalid format) then this method returns an empty matrix.

Parameters:

  1. file name
  2. flag
  3. cv2.IMREAD_COLOR
  4. cv2.IMREAD_UNCHANGED
  5. cv2.IMREAD_GRAYSCALE
  6. Return Value

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top