Shahid Akhtar Khan has Published 216 Articles

How to detect eyes in an image using OpenCV Python?

Shahid Akhtar Khan

Shahid Akhtar Khan

Updated on 05-Dec-2022 11:06:08

8K+ Views

A "haar cascade classifier" is an effective machine learning based approach for object detection. To train a haar cascade classifier for eye detection, the algorithm initially needs a lot of positive images (images of eyes) and negative images (images without eyes). Then the classifier is trained from these positive and ... Read More

Opencv Python – How to display the coordinates of points clicked on an image?

Shahid Akhtar Khan

Shahid Akhtar Khan

Updated on 05-Dec-2022 11:01:44

12K+ 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 ... Read More

How to detect a face and draw a bounding box around it using OpenCV Python?

Shahid Akhtar Khan

Shahid Akhtar Khan

Updated on 05-Dec-2022 10:59:10

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 ... Read More

How to perform image transpose using OpenCV Python?

Shahid Akhtar Khan

Shahid Akhtar Khan

Updated on 05-Dec-2022 10:56:29

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. ... Read More

Color quantization in an image using K-means in OpenCV Python?

Shahid Akhtar Khan

Shahid Akhtar Khan

Updated on 05-Dec-2022 10:54:13

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 ... Read More

How to create a depth map from stereo images in OpenCV Python?

Shahid Akhtar Khan

Shahid Akhtar Khan

Updated on 05-Dec-2022 10:51:10

8K+ 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 ... Read More

How to implement FLANN based feature matching in OpenCV Python?

Shahid Akhtar Khan

Shahid Akhtar Khan

Updated on 05-Dec-2022 10:49:01

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() ... Read More

OpenCV Python – Implementing feature matching between two images using SIFT

Shahid Akhtar Khan

Shahid Akhtar Khan

Updated on 05-Dec-2022 10:47:08

6K+ 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 ... Read More

OpenCV Python – Matching the key points of two images using ORB and BFmatcher

Shahid Akhtar Khan

Shahid Akhtar Khan

Updated on 05-Dec-2022 10:44:54

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 ... Read More

How to blur faces in an image using OpenCV Python?

Shahid Akhtar Khan

Shahid Akhtar Khan

Updated on 05-Dec-2022 10:42:14

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 ... Read More

Advertisements