Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Open CV
  • scikit-image
  • pycairo
  • Pyglet
  • Python
  • Numpy
  • Pandas
  • Python Database
  • Data Analysis
  • ML Math
  • Machine Learning
  • NLP
  • Deep Learning
  • Deep Learning Interview Questions
  • ML Projects
  • ML Interview Questions
  • 100 Days of Machine Learning
Open In App
Next Article:
What is OpenCV Library?
Next article icon

OpenCV Tutorial in Python

Last Updated : 07 Nov, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

OpenCV, short for Open Source Computer Vision Library, is an open-source computer vision and machine learning software library. Originally developed by Intel, it is now maintained by a community of developers under the OpenCV Foundation.

OpenCV
is a huge open-source library for computer vision, machine learning, and image processing. OpenCV supports a wide variety of programming languages like Python, C++, Java, etc. It can process images and videos to identify objects, faces, or even the handwriting of a human. When it is integrated with various libraries, such as

Numpy

which is a highly optimized library for numerical operations, then the number of weapons increases in your Arsenal i.e. whatever operations one can do in Numpy can be combined with OpenCV. This OpenCV tutorial will help you learn Image-processing from Basics to advanced, like operations on Images and videos using a huge set of Programs and projects.

OpenCV Tutorial in Python

OpenCV Tutorial in Python

Table of Content

  • 1. Getting Started
  • 2. Working with Images
    • 2.1 Getting Started
    • 2.2 Image Processing
    • 2.3 Feature Detection and Description
    • 2.4 Drawing Functions
  • 3. Working with Videos
    • 3.1 Getting Started
    • 3.2 Video Processing
  • 4. Applications and Projects
  • Further Learning

1. Getting Started

Learn how to set up and get started with OpenCV:

  • OpenCV – Overview
  • Introduction to OpenCV
  • Install OpenCV for Python on Windows
  • Install OpenCV for Python on Linux
  • Set up Opencv with anaconda environment

2. Working with Images

>> 2.1 Getting Started

  • Reading an image in OpenCV using Python
  • Display an image in OpenCV using Python
  • Writing an image in OpenCV using Python
  • OpenCV | Saving an Image
  • Color Spaces
  • Arithmetic operations on Images
  • Bitwise Operations on Binary Images

>> 2.2 Image Processing

  • Image Resizing
  • Eroding an Image
  • Blurring an Image
  • Create Border around Images
  • Grayscaling of Images
  • Scaling, Rotating, Shifting and Edge Detection
  • Erosion and Dilation of images
  • Analyze an image using Histogram
  • Histograms Equalization
  • Simple Thresholding
  • Adaptive Thresholding
  • Otsu Thresholding
  • Segmentation using Thresholding
  • Convert an image from one color space to another
  • Filter Color with OpenCV
  • Denoising of colored images
  • Visualizing image in different color spaces
  • Find Co-ordinates of Contours
  • Bilateral Filtering
  • Image Inpainting using OpenCV
  • Intensity Transformation Operations on Images
  • Image Registration
  • Background subtraction
  • Background Subtraction in an Image using Concept of Running Average
  • Foreground Extraction in an Image using Grabcut Algorithm
  • Morphological Operations in Image Processing (Opening)
  • Morphological Operations in Image Processing (Closing)
  • Morphological Operations in Image Processing (Gradient)
  • Image segmentation using Morphological operations
  • Image Translation
  • Image Pyramid

>> 2.3 Feature Detection and Description

  • Line detection using Houghline method
  • Circle Detection
  • Detect corner of an image
  • Corner Detection with Shi-Tomasi method
  • Corner detection with Harris Corner Detection
  • Find Circles and Ellipses in an Image
  • Document field detection
  • Smile detection

>> 2.4 Drawing Functions

  • Draw a line
  • Draw arrow segment
  • Draw an ellipse
  • Draw a circle
  • Draw a rectangle
  • Draw a text string
  • Find and Draw Contours
  • Draw a triangle with centroid

3. Working with Videos

>> 3.1 Getting Started

  • Play a video using OpenCV

>> 3.2 Video Processing

  • Create video using multiple images
  • Extract images from video

4. Applications and Projects

  • Extract frames using OpenCV
  • Displaying the coordinates of the points clicked on the image using Python-OpenCV
  • White and black dot detection
  • OpenCV BGR color palette with trackbars
  • Draw rectangular shape and extract objects
  • Invisible Cloak using OpenCV
  • Unsupervised Face Clustering Pipeline
  • Saving Operated Video from a webcam
  • Face Detection using Python and OpenCV with webcam
  • Opening multiple color windows
  • Play a video in reverse mode
  • Template matching using OpenCV in Python
  • Cartooning an Image using OpenCV – Python
  • Vehicle detection in a Video frame using Python – OpenCV
  • Count number of Faces using Python – OpenCV
  • Live Webcam Drawing using OpenCV
  • Detect and Recognize Car License Plate from a video in real time

Further Learning

If you’re interested in more recent articles and updates on OpenCV, explore the latest content here: 

Recent Articles on OpenCV !!



Next Article
What is OpenCV Library?
author
abhishek1
Improve
Article Tags :
  • AI-ML-DS
  • Python
  • OpenCV
  • Python-OpenCV
Practice Tags :
  • python

Similar Reads

  • OpenCV Tutorial in Python
    OpenCV, short for Open Source Computer Vision Library, is an open-source computer vision and machine learning software library. Originally developed by Intel, it is now maintained by a community of developers under the OpenCV Foundation. OpenCVis a huge open-source library for computer vision, machi
    3 min read
  • Getting Started

    • What is OpenCV Library?
      OpenCV, short for Open Source Computer Vision Library, is an open-source computer vision and machine learning software library. Originally developed by Intel, it is now maintained by a community of developers under the OpenCV Foundation. In this article, we delve into OpenCV, exploring its functiona
      5 min read

    • Introduction to OpenCV
      OpenCV is one of the most popular computer vision libraries. If you want to start your journey in the field of computer vision, then a thorough understanding of the concepts of OpenCV is of paramount importance.  In this article, to understand the basic functionalities of Python OpenCV module, we wi
      4 min read

    • How to Install OpenCV for Python on Windows?
      Prerequisite: Python Language Introduction   OpenCV is the huge open-source library for computer vision, machine learning, and image processing and now it plays a major role in real-time operation which is very important in today’s systems. By using it, one can process images and videos to identify
      4 min read

    • How to Install OpenCV for Python in Linux?
      Prerequisite: Python Language Introduction OpenCV is the huge open-source library for computer vision, machine learning, and image processing and now it plays a major role in real-time operation which is very important in today’s systems. By using it, one can process images and videos to identify ob
      2 min read

    • Set up Opencv with anaconda environment
      If you love working on image processing and video analysis using python then you have come to the right place. Python is one of the major languages that can be used to process images or videos. Requirements for OpenCV and Anaconda - 32- or a 64-bit computer. - For Miniconda—400 MB disk space. - For
      3 min read

    Working with Images - Getting Started

    • Reading an image in OpenCV using Python
      Prerequisite: Basics of OpenCV In this article, we'll try to open an image by using OpenCV (Open Source Computer Vision) library.  Following types of files are supported in OpenCV library: Windows bitmaps - *.bmp, *.dibJPEG files - *.jpeg, *.jpgPortable Network Graphics - *.png WebP - *.webp Sun ras
      6 min read

    • Python OpenCV | cv2.imshow() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.imshow() method is used to display an image in a window. The window automatically fits the image size.  Syntax: cv2.imshow(window_name, image)Parameters: window_name: A string representing the name of the w
      3 min read

    • Python OpenCV | cv2.imwrite() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.imwrite() method is used to save an image to any storage device. This will save the image according to the specified format in current working directory. Syntax: cv2.imwrite(filename, image) Parameters:file
      2 min read

    • OpenCV | Saving an Image
      This article aims to learn how to save an image from one location to any other desired location on your system in CPP using OpenCv. Using OpenCV, we can generate a blank image with any colour one wishes to. So, let us dig deep into it and understand the concept with the complete explanation. Code :
      3 min read

    • Color Spaces in OpenCV | Python
      Color spaces are a way to represent the color channels present in the image that gives the image that particular hue. There are several different color spaces and each has its own significance. Some of the popular color spaces are RGB (Red, Green, Blue), CMYK (Cyan, Magenta, Yellow, Black), HSV (Hue
      2 min read

    • Arithmetic Operations on Images using OpenCV | Set-1 (Addition and Subtraction)
      Arithmetic Operations like Addition, Subtraction, and Bitwise Operations(AND, OR, NOT, XOR) can be applied to the input images. These operations can be helpful in enhancing the properties of the input images. The Image arithmetics are important for analyzing the input image properties. The operated
      3 min read

    • Bitwise Operations on Binary Images in OpenCV2
      Bitwise operations are used in image manipulation and used for extracting essential parts in the image. In this article, Bitwise operations used are : ANDORXORNOTAlso, Bitwise operations helps in image masking. Image creation can be enabled with the help of these operations. These operations can be
      4 min read

    Working with Images - Image Processing

    • Image Resizing using OpenCV | Python
      Image resizing refers to the scaling of images. Scaling comes in handy in many image processing as well as machine learning applications. It helps in reducing the number of pixels from an image and that has several advantages e.g. It can reduce the time of training of a neural network as the more th
      4 min read

    • Python OpenCV | cv2.erode() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.erode() method is used to perform erosion on the image. The basic idea of erosion is just like soil erosion only, it erodes away the boundaries of foreground object (Always try to keep foreground in white).
      2 min read

    • Python | Image blurring using OpenCV
      Image Blurring refers to making the image less clear or distinct. It is done with the help of various low pass filter kernels. Advantages of blurring: It helps in Noise removal. As noise is considered as high pass signal so by the application of low pass filter kernel we restrict noise. It helps in
      2 min read

    • Python OpenCV | cv2.copyMakeBorder() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.copyMakeBorder() method is used to create a border around the image like a photo frame. Syntax: cv2.copyMakeBorder(src, top, bottom, left, right, borderType, value) Parameters: src: It is the source image.
      2 min read

    • Python | Grayscaling of Images using OpenCV
      Grayscaling is the process of converting an image from other color spaces e.g. RGB, CMYK, HSV, etc. to shades of gray. It varies between complete black and complete white. Importance of grayscaling Dimension reduction: For example, In RGB images there are three color channels and three dimensions wh
      5 min read

    • Image Processing in Python
      Image processing involves analyzing and modifying digital images using computer algorithms. It is widely used in fields like computer vision, medical imaging, security and artificial intelligence. Python with its vast libraries simplifies image processing, making it a valuable tool for researchers a
      7 min read

    • Erosion and Dilation of images using OpenCV in python
      Morphological operations are a set of operations that process images based on shapes. They apply a structuring element to an input image and generate an output image. The most basic morphological operations are two: Erosion and Dilation Basics of Erosion: Erodes away the boundaries of the foreground
      2 min read

    • OpenCV Python Program to analyze an image using Histogram
      In this article, image analysis using Matplotlib and OpenCV is discussed. Let's first understand how to experiment image data with various styles and how to represent with Histogram. Prerequisites: OpenCVmatplotlibImporting image data import matplotlib.pyplot as plt #importing matplotlib The image s
      4 min read

    • Histograms Equalization in OpenCV
      Prerequisite : Analyze-image-using-histogramHistogram equalization is a method in image processing of contrast adjustment using the image's histogram. This method usually increases the global contrast of many images, especially when the usable data of the image is represented by close contrast value
      1 min read

    • Python | Thresholding techniques using OpenCV | Set-1 (Simple Thresholding)
      Thresholding is a technique in OpenCV, which is the assignment of pixel values in relation to the threshold value provided. In thresholding, each pixel value is compared with the threshold value. If the pixel value is smaller than the threshold, it is set to 0, otherwise, it is set to a maximum valu
      3 min read

    • Python | Thresholding techniques using OpenCV | Set-2 (Adaptive Thresholding)
      Prerequisite: Simple Thresholding using OpenCV In the previous post, Simple Thresholding was explained with different types of thresholding techniques. Another Thresholding technique is Adaptive Thresholding. In Simple Thresholding, a global value of threshold was used which remained constant throug
      2 min read

    • Python | Thresholding techniques using OpenCV | Set-3 (Otsu Thresholding)
      In the previous posts, Simple Thresholding and Adaptive Thresholding were explained. In Simple Thresholding, the global value of threshold was used which remained constant throughout. In Adaptive thresholding, the threshold value is calculated for smaller regions with different threshold values for
      2 min read

    • OpenCV: Segmentation using Thresholding
      In this article, a basic technique for object segmentation called Thresholding. But before moving into anymore detail, below is a brief overview of OpenCV. OpenCV (Open Source Computer Vision) is a cross platform, open-source library of programming functions, aimed at performing real-time computer v
      5 min read

    • Python OpenCV | cv2.cvtColor() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.cvtColor() method is used to convert an image from one color space to another. There are more than 150 color-space conversion methods available in OpenCV. We will use some of color space conversion codes be
      4 min read

    • Filter Color with OpenCV
      Colour segmentation or color filtering is widely used in OpenCV for identifying specific objects/regions having a specific color. The most widely used color space is RGB color space, it is called an additive color space as the three color shades add up to give color to the image. To identify a regio
      2 min read

    • Python | Denoising of colored images using opencv
      Denoising of an image refers to the process of reconstruction of a signal from noisy images. Denoising is done to remove unwanted noise from image to analyze it in better form. It refers to one of the major pre-processing steps. There are four functions in opencv which is used for denoising of diffe
      1 min read

    • Python | Visualizing image in different color spaces
      OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on pictures or videos. It was originally developed by Intel but was later maintained by Willow Garage and is now maintained by Itseez. This library is cross-platform that is it is
      4 min read

    • Find Co-ordinates of Contours using OpenCV | Python
      In this article, we will learn how to find the co-ordinates of Contours with the help of OpenCV. Contours are defined as the line joining all the points along the boundary of an image that are having the same intensity. Contours come handy in shape analysis, finding the size of the object of interes
      3 min read

    • Python | Bilateral Filtering
      A bilateral filter is used for smoothening images and reducing noise, while preserving edges. This article explains an approach using the averaging filter, while this article provides one using a median filter. However, these convolutions often result in a loss of important edge information, since t
      2 min read

    • Image Inpainting using OpenCV
      Image inpainting is the process of removing damage, such as noises, strokes or text, on images. It is particularly useful in the restoration of old photographs which might have scratched edges or ink spots on them. These can be digitally removed through this method. Image inpainting works by replaci
      3 min read

    • Python | Intensity Transformation Operations on Images
      Intensity transformations are applied on images for contrast manipulation or image thresholding. These are in the spatial domain, i.e. they are performed directly on the pixels of the image at hand, as opposed to being performed on the Fourier transform of the image. The following are commonly used
      5 min read

    • Python | Image Registration using OpenCV
      Image registration is a digital image processing technique that helps us align different images of the same scene. For instance, one may click the picture of a book from various angles. Below are a few instances that show the diversity of camera angles.Now, we may want to "align" a particular image
      3 min read

    • Python | Background subtraction using OpenCV
      Background Subtraction has several use cases in everyday life, It is being used for object segmentation, security enhancement, pedestrian tracking, counting the number of visitors, number of vehicles in traffic etc. It is able to learn and identify the foreground mask.As the name suggests, it is abl
      2 min read

    • Background Subtraction in an Image using Concept of Running Average
      Background subtraction is a technique for separating out foreground elements from the background and is done by generating a foreground mask. This technique is used for detecting dynamically moving objects from static cameras. Background subtraction technique is important for object tracking. There
      4 min read

    • Python | Foreground Extraction in an Image using Grabcut Algorithm
      In this article we'll discuss an efficient method of foreground extraction from the background in an image. The idea here is to find the foreground, and remove the background.  GrabCut Algorithm for Image SegmentationGrabCut is an interactive image segmentation algorithm that was introduced by Carst
      8 min read

    • Python | Morphological Operations in Image Processing (Opening) | Set-1
      Morphological operations are used to extract image components that are useful in the representation and description of region shape. Morphological operations are some basic tasks dependent on the picture shape. It is typically performed on binary images. It needs two data sources, one is the input i
      3 min read

    • Python | Morphological Operations in Image Processing (Closing) | Set-2
      In the previous article, the Opening operator was specified which was applying the erosion operation after dilation. It helps in removing the internal noise in the image. Closing is similar to the opening operation. In closing operation, the basic premise is that the closing is opening performed in
      2 min read

    • Python | Morphological Operations in Image Processing (Gradient) | Set-3
      In the previous articles, the Opening operation and the Closing operations were specified. In this article, another morphological operation is elaborated that is Gradient. It is used for generating the outline of the image. There are two types of gradients, internal and external gradient. The intern
      2 min read

    • Image segmentation using Morphological operations in Python
      If we want to extract or define something from the rest of the image, eg. detecting an object from a background, we can break the image up into segments in which we can do more processing on. This is typically called Segmentation. Morphological operations are some simple operations based on the imag
      3 min read

    • Image Translation using OpenCV | Python
      Translation refers to the rectilinear shift of an object i.e. an image from one location to another. If we know the amount of shift in horizontal and the vertical direction, say (tx, ty) then we can make a transformation matrix e.g. [Tex] \begin{bmatrix} 1 & 0 & tx \\ 0 & 1 & ty \end
      2 min read

    • Image Pyramid using OpenCV | Python
      Image Pyramids are one of the most beautiful concept of image processing.Normally, we work with images with default resolution but many times we need to change the resolution (lower it) or resize the original image in that case image pyramids comes handy. The pyrUp() function increases the size to d
      1 min read

    Working with Images - Feature Detection and Description

    • Line detection in python with OpenCV | Houghline method
      The Hough Transform is a method that is used in image processing to detect any shape, if that shape can be represented in mathematical form. It can detect the shape even if it is broken or distorted a little bit.We will see how Hough transform works for line detection using the HoughLine transform m
      6 min read

    • Circle Detection using OpenCV | Python
      Circle detection finds a variety of uses in biomedical applications, ranging from iris detection to white blood cell segmentation. The technique followed is similar to the one used to detect lines, as discussed in this article. Basics of Circle Detection A circle can be described by the following eq
      3 min read

    • Python | Detect corner of an image using OpenCV
      OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. OpenCV library can be used to perform multiple operations on videos. Let's see how to detect the corner in the image. cv2.goodFeaturesToTrack() method finds N
      2 min read

    • Python | Corner Detection with Shi-Tomasi Corner Detection Method using OpenCV
      What is a Corner? A corner can be interpreted as the junction of two edges (where an edge is a sudden change in image brightness). Shi-Tomasi Corner Detection - Shi-Tomasi Corner Detection was published by J.Shi and C.Tomasi in their paper 'Good Features to Track'. Here the basic intuition is that c
      3 min read

    • Python | Corner detection with Harris Corner Detection method using OpenCV
      Harris Corner detection algorithm was developed to identify the internal corners of an image. The corners of an image are basically identified as the regions in which there are variations in large intensity of the gradient in all possible dimensions and directions. Corners extracted can be a part of
      2 min read

    • Find Circles and Ellipses in an Image using OpenCV | Python
      To identify circles, ellipses, or in general, any shape in which the pixels are connected we use the SimpleBlobDetector() function of OpenCV. In non-technical terms, a blob is understood as a thick liquid drop. Here, we are going to call all shapes a blob. Our task is to detect and recognize whether
      2 min read

    • Python | Document field detection using Template Matching
      Template matching is an image processing technique which is used to find the location of small-parts/template of a large image. This technique is widely used for object detection projects, like product quality, vehicle tracking, robotics etc. In this article, we will learn how to use template matchi
      2 min read

    • Python | Smile detection using OpenCV
      Emotion detectors are used in many industries, one being the media industry where it is important for the companies to determine the public reaction to their products. In this article, we are going to build a smile detector using OpenCV which takes in live feed from webcam. The smile/happiness detec
      3 min read

    Working with Images - Drawing Functions

    • Python OpenCV | cv2.line() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.line() method is used to draw a line on any image. Syntax: cv2.line(image, start_point, end_point, color, thickness) Parameters: image: It is the image on which line is to be drawn.  start_point: It is the
      3 min read

    • Python OpenCV | cv2.arrowedLine() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.arrowedLine() method is used to draw arrow segment pointing from the start point to the end point. Syntax: cv2.arrowedLine(image, start_point, end_point, color, thickness, line_type, shift, tipLength)Parame
      3 min read

    • Python OpenCV | cv2.ellipse() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.ellipse() method is used to draw a ellipse on any image. Syntax: cv2.ellipse(image, centerCoordinates, axesLength, angle, startAngle, endAngle, color [, thickness[, lineType[, shift]]]) Parameters: image: I
      3 min read

    • Python OpenCV | cv2.circle() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.circle() method is used to draw a circle on any image. The syntax of cv2.circle() method is: Syntax: cv2.circle(image, center_coordinates, radius, color, thickness) Parameters: image: It is the image on whi
      3 min read

    • Python OpenCV | cv2.rectangle() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.rectangle() method is used to draw a rectangle on any image. Syntax: cv2.rectangle(image, start_point, end_point, color, thickness) Parameters:image: It is the image on which rectangle is to be drawn. start
      4 min read

    • Python OpenCV | cv2.putText() method
      OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.putText() method is used to draw a text string on any image. Syntax: cv2.putText(image, text, org, font, fontScale, color[, thickness[, lineType[, bottomLeftOrigin]]]) Parameters:image: It is the image on w
      5 min read

    • Find and Draw Contours using OpenCV - Python
      Contours are edges or outline of a objects in a image and is used in image processing to identify shapes, detect objects or measure their size. We use OpenCV's findContours() function that works best for binary images. There are three important arguments of this function: Source Image: This is the i
      3 min read

    • Draw a triangle with centroid using OpenCV
      Prerequisite: Geometric shapes using OpenCV Given three vertices of a triangle, write a Python program to find the centroid of the triangle and then draw the triangle with its centroid on a black window using OpenCV. Examples: Input: (100, 200) (50, 50) (300, 100) Output: (150, 116) Libraries Needed
      2 min read

    Working with Videos

    • Python | Play a video using OpenCV
      OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. OpenCV library can be used to perform multiple operations on videos.  Let’s see how to play a video using the OpenCV Python. To capture a video, we need to cre
      2 min read

    • Python | Create video using multiple images using OpenCV
      Creating videos from multiple images is a great way for creating time-lapse videos. In this tutorial, we’ll explore how to create a video from multiple images using Python and OpenCV. Creating a video from images involves combining multiple image frames, each captured at a specific moment in time, i
      5 min read

    • Extract images from video in Python
      OpenCV comes with many powerful video editing functions. In current scenario, techniques such as image scanning, face recognition can be accomplished using OpenCV. Image Analysis is a very common field in the area of Computer Vision. It is the extraction of meaningful information from videos or imag
      2 min read

    • Python OpenCV: Capture Video from Camera
      Python provides various libraries for image and video processing. One of them is OpenCV. OpenCV is a vast library that helps in providing various functions for image and video operations. With OpenCV, we can capture a video from the camera. It lets you create a video capture object which is helpful
      4 min read

    • Python - Process images of a video using OpenCV
      Processing a video means, performing operations on the video frame by frame. Frames are nothing but just the particular instance of the video in a single point of time. We may have multiple frames even in a single second. Frames can be treated as similar to an image.So, whatever operations we can pe
      4 min read

    • Python - Writing to video with OpenCV
      In this article, we will discuss how to write to a video using OpenCV in Python. ApproachImport the required libraries into the working space.Read the video on which you have to write. Syntax: cap = cv2.VideoCapture("path")Create a output file using cv2.VideoWriter_fourcc() method Syntax: output = c
      1 min read

    • Python OpenCv: Write text on video
      OpenCV is the huge open-source library for computer vision, machine learning, and image processing and now it plays a major role in real-time operation which is very important in today’s systems. By using it, one can process images and videos to identify objects, faces, or even the handwriting of a
      2 min read

    • Python | Create video using multiple images using OpenCV
      Creating videos from multiple images is a great way for creating time-lapse videos. In this tutorial, we’ll explore how to create a video from multiple images using Python and OpenCV. Creating a video from images involves combining multiple image frames, each captured at a specific moment in time, i
      5 min read

    • Saving Operated Video from a webcam using OpenCV
      OpenCV is a vast library that helps in providing various functions for image and video operations. With OpenCV, we can perform operations on the input video. OpenCV also allows us to save that operated video for further usage. For saving images, we use cv2.imwrite() which saves the image to a specif
      4 min read

    Applications and Projects

    • Python | Program to extract frames using OpenCV
      OpenCV comes with many powerful video editing functions. In the current scenario, techniques such as image scanning and face recognition can be accomplished using OpenCV. OpenCV library can be used to perform multiple operations on videos. Let’s try to do something interesting using CV2. Take a vide
      2 min read

    • Displaying the coordinates of the points clicked on the image using Python-OpenCV
      OpenCV helps us to control and manage different types of mouse events and gives us the flexibility to operate them. There are many types of mouse events. These events can be displayed by running the following code segment : import cv2 [print(i) for i in dir(cv2) if 'EVENT' in i] Output : EVENT_FLAG_
      3 min read

    • White and black dot detection using OpenCV | Python
      Image processing using Python is one of the hottest topics in today's world. But image processing is a bit complex and beginners get bored in their first approach. So in this article, we have a very basic image processing python program to count black dots in white surface and white dots in the blac
      4 min read

    • Python | OpenCV BGR color palette with trackbars
      OpenCV is a library of programming functions mainly aimed at real-time computer vision. In this article, Let's create a window which will contain RGB color palette with track bars. By moving the trackbars the value of RGB Colors will change b/w 0 to 255. So using the same, we can find the color with
      2 min read

    • Draw a rectangular shape and extract objects using Python's OpenCV
      OpenCV is an open-source computer vision and machine learning software library. Various image processing operations such as manipulating images and applying tons of filters can be done with the help of it. It is broadly used in Object detection, Face Detection, and other Image processing tasks. Let'
      4 min read

    • Invisible Cloak using OpenCV | Python Project
      Have you ever seen Harry Potter's Invisible Cloak; Was it wonderful? Have you ever wanted to wear that cloak? If Yes!! then in this post, we will build the same cloak which Harry Potter uses to become invisible. Yes, we are not building it in a real way but it is all about graphics trickery. In this
      4 min read

    • ML | Unsupervised Face Clustering Pipeline
      Live face-recognition is a problem that automated security division still face. With the advancements in Convolutions Neural Networks and specifically creative ways of Region-CNN, it’s already confirmed that with our current technologies, we can opt for supervised learning options such as FaceNet, Y
      15+ min read

    • Saving Operated Video from a webcam using OpenCV
      OpenCV is a vast library that helps in providing various functions for image and video operations. With OpenCV, we can perform operations on the input video. OpenCV also allows us to save that operated video for further usage. For saving images, we use cv2.imwrite() which saves the image to a specif
      4 min read

    • Face Detection using Python and OpenCV with webcam
      Face detection is a important application of computer vision that involves identifying human faces in images or videos. In this Article, we will see how to build a simple real-time face detection application using Python and OpenCV where webcam will be used as the input source. Step 1: Installing Op
      3 min read

    • Opening multiple color windows to capture using OpenCV in Python
      OpenCV is an open source computer vision library that works with many programming languages and provides a vast scope to understand the subject of computer vision.In this example we will use OpenCV to open the camera of the system and capture the video in two different colors. Approach: With the lib
      2 min read

    • Python | Play a video in reverse mode using OpenCV
      OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. OpenCV's application areas include : 1) Facial recognition system 2) motion tracking 3) Artificial neural network 4) Deep neural network 5) video streaming etc
      3 min read

    • Template matching using OpenCV in Python
      Template matching is a technique for finding areas of an image that are similar to a patch (template). A patch is a small image with certain features. The goal of template matching is to find the patch/template in an image. To find it, the user has to give two input images: Source Image (S) - The im
      6 min read

    • Cartooning an Image using OpenCV - Python
      Instead of sketching images by hand we can use OpenCV to convert a image into cartoon image. In this tutorial you'll learn how to turn any image into a cartoon. We will apply a series of steps like: Smoothing the image (like a painting)Detecting edges (like a sketch)Combining both to get a cartoon e
      2 min read

    • Vehicle detection using OpenCV Python
      Object Detection means identifying the objects in a video or image. In this article, we will learn how to detect vehicles using the Haar Cascade classifier and OpenCV. We will implement the vehicle detection on an image and as a result, we will get a video in which vehicles will be detected and it w
      3 min read

    • Count number of Faces using Python - OpenCV
      Prerequisites: Face detection using dlib and openCV In this article, we will use image processing to detect and count the number of faces. We are not supposed to get all the features of the face. Instead, the objective is to obtain the bounding box through some methods i.e. coordinates of the face i
      3 min read

    • Live Webcam Drawing using OpenCV
      Let us see how to draw the movement of objects captured by the webcam using OpenCV. Our program takes the video input from the webcam and tracks the objects we are moving. After identifying the objects, it will make contours precisely. After that, it will print all your drawing on the output screen.
      3 min read

    • Detect and Recognize Car License Plate from a video in real time
      Recognizing a Car License Plate is a very important task for a camera surveillance-based security system. We can extract the license plate from an image using some computer vision techniques and then we can use Optical Character Recognition to recognize the license number. Here I will guide you thro
      11 min read

  • Essential OpenCV Functions to Get Started into Computer Vision
    Computer vision is a process by which we can understand the images and videos how they are stored and how we can manipulate and retrieve data from them. Computer Vision is the base or mostly used for Artificial Intelligence. Computer-Vision is playing a major role in self-driving cars, robotics as w
    7 min read
  • OpenCV Projects

    • Build GUI Application Pencil Sketch from Photo in Python
      In this article, we will cover how to convert images to watercolor sketches and pencil sketch Linux. Sketching and painting are used by artists of many disciplines to preserve ideas, recollections, and thoughts. Experiencing art from painting and sculpting to visiting an art museum—provides a variet
      5 min read

    • Python OpenCV - Drowsiness Detection
      The number of fatalities on the road due to drowsiness is very high. Thus python allows the model of deep learning algorithm via including the use of OpenCV. Drowsiness Detection is the detection of a person to check whether the person is feeling sleepy while performing a significant task. This dete
      9 min read

    • Face Alignment with OpenCV and Python
      Face Alignment is the technique in which the image of the person is rotated according to the angle of the eyes.  This technique is actually used as a part of the pipeline process in which facial detection is done using the image. This implementation of face alignment can be easily done with the help
      6 min read

    • Age Detection using Deep Learning in OpenCV
      The task of age prediction might sound simple at first but it's quite challenging in real-world applications. While predicting age is typically seen as a regression problem this approach faces many uncertainties like camera quality, brightness, climate condition, background, etc. In this article we'
      5 min read

    • Right and Left Hand Detection Using Python
      In this article, we are going to see how to Detect Hands using Python. We will use mediapipe and OpenCV libraries in python to detect the Right Hand and Left Hand. We will be using the Hands model from mediapipe solutions to detect hands, it is a palm detection model that operates on the full image
      5 min read

    • OpenCV Python: How to detect if a window is closed?
      OpenCV in Python provides a method cv2.getWindowProperty() to detect whether a window is closed or open. getWindowProperty() returns -1 if all windows are closed. This is one of the main problems we face while using the OpenCV package, sometimes it's hard to detect whether the window is open or clos
      2 min read

    • Save frames of live video with timestamps - Python OpenCV
      Images are very important data nowadays from which we can obtain a lot of information which will helpful for analysis. Sometimes data to be processed can be in the form of video. To process this kind of data we have to read video extract frames and save them as images. Security camera videos we have
      3 min read

    • Detecting low contrast images with OpenCV, scikit-image, and Python
      In this article, we are going to see how to detect low contrast images with OpenCV, scikit-image using Python A low contrast image has the minimal distinction between light and dark parts, making it difficult to tell where an object's boundary begins and the scene's background begins. For example Th
      2 min read

    • Animate image using OpenCV in Python
      In this article, we will discuss how to animate an image using python's OpenCV module. Let's suppose we have one image. Using that single image we will animate it in such a way it will appear continuous array of the same image. This is useful in animating the background in certain games. For example
      3 min read

    • Drawing a cross on an image with OpenCV
      In this article, we are going to discuss how to draw a cross on an image using OpenCV-Python. We can draw an overlay of two lines one above another to make a cross on an image.   To draw a line on OpenCV, the below function is used. Syntax: cv2.line(image, starting Point, ending Point, color, thickn
      5 min read

    • Blur and anonymize faces with OpenCV and Python
      In this article, we are going to see how to Blur and anonymize faces with OpenCV and Python. For this, we will be using Cascade Classifier to detect the faces. Make sure to download the same, from this link: haarcascade_frontalface_default.xml ApproachFirstly, we use a built face detection algorithm
      4 min read

    • Face Detection using Cascade Classifier using OpenCV - Python
      Face detection is a important task in computer vision and Haar Cascade classifiers play an important role in making this process fast and efficient. Haar Cascades are used for detecting faces and other objects by training a classifier on positive and negative images. Positive Images: These images co
      3 min read

    • Real time object color detection using OpenCV
      In this article, we will discuss how to detect a monochromatic colour object using python and OpenCV. Monochromatic color means light of a single wavelength. We will use the video, captured using a webcam as input and try to detect objects of a single color, especially Blue. But you can detect any c
      4 min read

    • Python - Writing to video with OpenCV
      In this article, we will discuss how to write to a video using OpenCV in Python. ApproachImport the required libraries into the working space.Read the video on which you have to write. Syntax: cap = cv2.VideoCapture("path")Create a output file using cv2.VideoWriter_fourcc() method Syntax: output = c
      1 min read

    • Add image to a live camera feed using OpenCV-Python
      In this article, we are going to learn how to insert an image in your live camera feed using OpenCV in Python. Stepwise ImplementationStep 1: Importing the libraries CV reads and stores all the images as a NumPy array. We need the NumPy library to manipulate the image and as expected we need the cv2
      4 min read

    • Face and Hand Landmarks Detection using Python - Mediapipe, OpenCV
      In this article, we will use mediapipe python library to detect face and hand landmarks. We will be using a Holistic model from mediapipe solutions to detect all the face and hand landmarks. We will be also seeing how we can access different landmarks of the face and hands which can be used for diff
      4 min read

    • Emotion Based Music Player - Python Project
      In this article, we will be discussing how can we recommend music based on expressions or say dominant expressions on someone's face. This is a basic project in which we will be using OpenCV, Matplotlib, DeepFace, and Spotify API. Import Packages and ModulesOpenCV: OpenCV is a Python open-source pac
      6 min read

    • Realtime Distance Estimation Using OpenCV - Python
      Prerequisite: Introduction to OpenCV In this article, we are going to see how to calculate the distance with a webcam using OpenCV in Python. By using it, one can process images and videos to identify objects, faces, or even the handwriting of a human. This article focuses on detecting objects. We w
      5 min read

    • Webcam QR code scanner using OpenCV
      In this article, we're going to see how to perform QR code scanning using a webcam.  Before starting, You need to know how this process is going to work. Firstly you need to open your webcam, and you've to run your python program to make it ready to scan the QR code. You can take the Qr code picture
      3 min read

    • Color Identification in Images using Python - OpenCV
      An open-source library in Python, OpenCV is basically used for image and video processing. Not only supported by any system, such as Windows, Linux, Mac, etc. but also it can be run in any programming language like Python, C++, Java, etc. OpenCV also allows you to identify color in images. Don’t you
      3 min read

    • Real-Time Edge Detection using OpenCV in Python | Canny edge detection method
      Edge detection is one of the fundamental image-processing tasks used in various Computer Vision tasks to identify the boundary or sharp changes in the pixel intensity. It plays a crucial role in object detection, image segmentation and feature extraction from the image. In Real-time edge detection,
      5 min read

    • Opencv Python program for Face Detection
      The objective of the program given is to detect object of interest(face) in real time and to keep tracking of the same object.This is a simple example of how to detect face in Python. You can try to use training samples of any other object of your choice to be detected by training the classifier on
      2 min read

geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences