Skip to main content

Computer Vision-OpenCV

 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.

Popular posts from this blog

CRACK INTERVIEW OF STATISTICIAN

CRACKING THE INTERVIEW OF DATA SCIENTIST AND STATISTICIAN IS NOT A PIECE OF CAKE. TO BECOME A DATA SCIENTIST IT IS NECESSARY TO UNDERSTAND THE STATISTICS CONCEPT. We all know that Statistics is the base of Machine Learning and is also one of the favorite topics for the research field and for mathematicians. For any Machine Learning and Data Science Interviews,  Statistics plays a big role to show your understandings of ML Algorithms.  So, We have prepared the list of Most Commonly Asked Interview Questions of Statistics. We've broken the statistics interview questions into three parts. BASIC MEDIUM ADVANCE BASICS(1)-STATS INTERVIEW QUESTIONS    Q1.What is Data?  Q2.What is Big Data?   Q3.What is Data analysis?   Q4. What is the Line?   Q5. What is a plane, hyperplane?   Q6.What is Stats?   Q7.What is quantitative data and qualitative data?   Q8.What are the types of stats?   Q9.What is the descriptive stats?   Q10.What i...

Computer Vision-OpenCV(PART2)

OpenCV-PYTHON MAGICAL LIBRARY In this blog, we will study the rescaling of the image  and resolution of the video. As discussed in the previous tutorial about reading and display of the image, we'll continue with other features of OpenCV. RESCALING OF THE IMAGE In this section, we are going to discuss our second OpenCV example. We will see how to rescale the image. RESCALE THE IMAGE import cv2 as cv def rescaleFrame (frame,scale = 0.75 ): width = int(frame . shape[ 1 ] * scale) height = int(frame . shape[ 0 ] * scale) dimensions = (width,height) return cv . resize(frame,dimensions,interpolation = cv . INTER_AREA) img = cv . imread( "D:\Downloads\luisa-azevedo-h8cUkYFZrzI-unsplash (1).jpg" ) image_resized = rescaleFrame(img,scale = 0.40 ) cv . imshow( "image" ,img) cv . imshow( "image resized" ,image_resized) rescaleFrame= This is the function of rescaling. cv.INTER_AREA=This is used for shrinkin g. RESOLUTION OF ...