- 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
Shahid Akhtar Khan has Published 216 Articles
Shahid Akhtar Khan
991 Views
We can perform the distance transform using the method cv2.distanceTransform(). Following is the syntax of this method. Syntax cv2.distanceTransform(src, distanceType, maskSize) This method accepts the following parameters − src − 8-bit, single-channel (binary) source image. distanceType − Type of the distance. maskSize − Size of the distance transform ... Read More
Shahid Akhtar Khan
2K+ Views
Probabilistic Hough Transform is an optimization of the Hough Transform. The hough transform takes a lot of computation even for a line with two arguments. Probabilistic Hough Transform doesn't take all the points into consideration, it takes only a random subset of points and that is sufficient for line detection. ... Read More
Shahid Akhtar Khan
875 Views
We apply Fourier Transform to analyze the frequency characteristics of various filters. We can apply Fourier transform on the Gaussian and Laplacian filters using np.fft.fft2(). We use np.fft.fftshift() to shift the zero-frequency component to the center of the spectrum. Steps To find Fourier transforms of the Gaussian or Laplacian filters, ... Read More
Shahid Akhtar Khan
3K+ Views
The Discrete Fourier Transform (DFT) and Inverse Discrete Fourier Transform (IDFT) are applied on images to find the frequency domain. To find the Fourier transforms of an image we use the functions cv2.dft() and cv2.idft(). We can apply Fourier Transform to analyze the frequency characteristics of various filters. Steps To ... Read More
Shahid Akhtar Khan
3K+ Views
In OpenCV, We use the cv2.calcHist() function to compute the histogram of an image. We can use this function to compute the histogram of a region of the image. To compute a histogram of a region in the image first we define a mask. The white color in the maskis ... Read More
Shahid Akhtar Khan
562 Views
We can apply the cv2.calcHist() function to compute a 2D histogram of an image. The color image has three channels- Red, Green and Blue. We can compute the 2D histograms for two color channels at a time. So we have three combinations of the color channels taking two at a ... Read More
Shahid Akhtar Khan
21K+ Views
We use cv2.threshold() to convert a grayscale image to binary image. To convert a color image to binary image, we first convert the color image to grayscale image using cv2.cvtColor() then apply cv2.threshold() on the grayscale image. Steps One could follow the below given steps to convert a color ... Read More
Shahid Akhtar Khan
3K+ Views
We could compute the shortest distance between a point and a contour on the image using cv2.pointPolygonTest() passing the contour points coordinates and the point coordinate as arguments. Before applying cv2.pointPolygonTest() we need to compute the contours in the image. We could follow the below given steps to find shortest ... Read More
Shahid Akhtar Khan
1K+ Views
We can perform bitwise NOT operation on an image using cv2.bitwise_not(). Here is the syntax to perform bitwise NOT operation on an image - cv2.bitwise_not(img) Steps To compute bitwise NOT on an image, you can follow the steps given below − Import the required library. In all the ... Read More
Shahid Akhtar Khan
1K+ Views
There are different types of muse events such as left or right button click, mouse move, left button double click etc. OpenCV provides us with different types of mouse events such as cv2.EVENT_LBUTTONDOWN for mouse left button down, cv2.EVENT_LBUTTONDBLCLK for left button double click and others. A mouse event returns ... Read More