- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 184 Articles for OpenCV
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
13K+ Views
OpenCV provides us with different types of mouse events. There are different types of muse events such as left or right button click, mouse move, left button double click etc. A mouse event returns the coordinates (x, y) of the mouse event. To perform an action when an event is performed we define a mouse callback function. We use left button click (cv2.EVENT_LBUTTONDOWN) and right button click (cv2.EVENT_RBUTTONDOWN) to display the coordinates of the points clicked on the image. Steps To display the coordinates of points clicked on the input image, you can follow the steps given below − ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
4K+ Views
We detect a face in an image using a haar cascade classifier. A haar cascade classifier is an effective machine learning based approach for object detection. We can train our own haar cascade for training data but here we use already trained haar cascades for face detection. We will use haarcascade_frontalface_alt.xml as a "haar cascade" XML file for face detection. How to Download Haarcascades? You can find different haarcascades following the GitHub website address − https://github.com/opencv/opencv/tree/master/data/haarcascades To download the haar cascade for face detection, click on the haarcascade_frontalface_alt.xml file. Open it in raw format, right click and save. ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
2K+ Views
In OpenCV, the image is NumPy ndarray. The image transpose operation in OpenCV is performed as the transpose of a NumPy 2D array (matrix). A matrix is transposed along its major diagonal. A transposed image is a flipped image over its diagonal. We use cv2.transpose() to transpose an image. Steps We could use the following steps to transpose an input image − Import required libraries OpenCV and Matplotlib. Make sure you have already installed them. Read the input image using cv2.imread(). Specify the full path of the image. Assign the image to a variable img. Transpose the input ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
2K+ Views
In the process of Color Quantization the number of colors used in an image is reduced. One reason to do so is to reduce the memory. Sometimes, some devices can produce only a limited number of colors. In these cases, color quantization is performed. We use cv2.kmeans() to apply k-means clustering for color quantization. Steps To implement color quantization in an image using K-means clustering, you could follow the steps given below − Import required libraries OpenCV and NumPy. Make sure you have already installed them. Read two input images using cv2.imread() method. Specify the full path of the ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
9K+ Views
A depth map can be created using stereo images. To construct a depth map from the stereo images, we find the disparities between the two images. For this we create an object of the StereoBM class using cv2.StereoBM_create() and compute the disparity using stereo.comput(). Where stereo is the created StereoBM object. Steps To create a depth map from the stereo images, you could follow the steps given below − Import the required libraries OpenCV, Matplotlib and NumPy. Make sure you have already installed them. Read two input images using cv2.imread()method as grayscale images. Specify the full path of ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
4K+ Views
We implement feature matching between two images using Scale Invariant Feature Transform (SIFT) and FLANN (Fast Library for Approximate Nearest Neighbors). The SIFT is used to find the feature keypoints and descriptors. A FLANN based matcher with knn is used to match the descriptors in both images. We use cv2.FlannBasedMatcher() as the FLANN based matcher. Steps To implement feature matching between two images using the SIFT feature detector and FLANN based matcher, you could follow the steps given below: Import required libraries OpenCV, Matplotlib and NumPy. Make sure you have already installed them. Read two input images ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
7K+ Views
We use Scale Invariant Feature Transform (SIFT) feature descriptor and Brute Force feature matcher to implement feature matching between two images. The SIFT is used to find the feature keypoints and descriptors in the images. A Brute Force matcher is used to match the descriptors in both images. Steps To implement feature matching between two images using the SIFT feature detector and Brute Force matcher, you could follow the steps given below − Import required libraries OpenCV, Matplotlib and NumPy. Make sure you have already installed them. Read two input images using cv2.imread() method as grayscale images. Specify the ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
3K+ Views
To match the keypoints of two images, we use ORB (Oriented FAST and Rotated BRIEF) to detect and compute the feature keypoints and descriptors and Brute Force matcher to match the descriptors in both images. Steps To match keypoints of two images using the ORB feature detector and Brute Force matcher, you could follow the steps given below − Import the required libraries OpenCV, Matplotlib and NumPy. Make sure you have already installed them. Read two input images using cv2.imread() method as grayscale images. Specify the full path of the image. Initiate ORB object orb with default ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
2K+ Views
To blur faces in an image first we detect the faces using a haar cascade classifier. OpenCV provides us with different types of trained haarcascades for object detection. We use haarcascade_frontalface_alt.xml as a haarcascade xml file. To blur the face area, we apply the cv2.GaussianBlur(). How to Download Haarcascade? You can find different haarcascades following the GitHub website address − https://github.com/opencv/opencv/tree/master/data/haarcascades To download a haarcascade for face detection, click the haarcascade_frontalface_alt.xml file. Open it in raw format, right click and save. Steps You could follow the steps given below to blur faces in an image − Import ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
4K+ Views
ORB (Oriented FAST and Rotated BRIEF) is a fusion of FAST keypoint detector and BRIEF descriptors with many changes to enhance the performance. To implement ORB feature detector and descriptors, you could follow the steps given below Import the required libraries OpenCV and NumPy. Make sure you have already installed them. Read the input image using cv2.imread() method. Specify the full path of the image. Convert the input image to grayscale image using cv2.cvtColor() method. Initiate the ORB object with default values using orb=cv2.ORB_create(). Detect and compute the feature keypoints 'kp' and descriptor 'des' in the ... Read More