Computer Vision : OpenCV command to read image, cv2.imread(path, 0)

Computer Vision : How to read image using OpenCV command cv2.imread(path, 0)

OpenCV


  • To Install the opencv-python library  pip install opencv-python
  • To import the cv2 module import cv2
  • To read image from disk, we use cv2.imread function, in below method, img = cv2.imread("geeksforgeeks.png", cv2.IMREAD_COLOR)
  • Creating GUI window to display an image on screen first Parameter is windows title (should be in string format) and Second Parameter is image array. cv2.imshow("image", img)
  • To hold the window on screen, we use cv2.waitKey method, Once it detected the close input, it will release the control To the next line. First Parameter is for holding screen for specified milliseconds and It should be positive integer. If 0 pass an parameter, then it will hold the screen until user close it. cv2.waitKey(0)
  • It is for removing/deleting created GUI window from screen and memory cv2.destroyAllWindows()

FILL THIS FORM, WE WILL CONTACT YOU BACK

FOR ONLINE TUITION (WEB DESIGN, O-LEVEL, A-LEVEL) on MEET, CONTACT US ON WHATSAPP : 9871174749

SUBSCRIBE YOUTUBE CHANNEL

JOIN TELEGRAM CHANNEL

Post a Comment

0 Comments