OpenCV-PYTHON MAGICAL LIBRARY
This open-source library plays a very important role in computer vision, machine learning, and image processing. It supports multiple programming languages like Python, C++, Java, etc. It is used to detect and identify objects, faces, or even handwriting.
APPLICATIONS
- Vision-guided robotics surgery
- Follow eye movements
- Detect motion of the human
- Detect and recognize faces
- Track camera movements
- Autonomous Vehicle
READ AND SHOW THE IMAGE
In this section, we are going to discuss our first OpenCV example. We will see how to read and display the image.
READ THE IMAGE
1 2 | import cv2 as cv img=cv.imread("path of image") |
imread=This method returns an image that is loaded from the specified file.
DISPLAY THE IMAGE
1 | cv.imshow('name',img) |
imshow= This method displays an image.
READ AND SHOW THE VIDEO
In this section, we are going to discuss our second OpenCV example. We will see how to read and display the video.
READ and DISPLAY THE VIDEO- FRAME BY FRAME
1 2 3 4 5 6 7 8 9 10 | import cv2 as cv capture=cv.VideoCapture("Path of the video") while True: isTrue,frame=capture.read() cv.imshow('Video',frame) if cv.waitKey(20) & 0xFF==ord('d'): break capture.release() cv.destroAllWindows() |
Thank You!
Keep Learning!
Share with your mates.
Follow us for more amazing content.
