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. We could follow the below given steps to implement probabilistic Hough Transform on an image- Import the required library. In all the following examples, the required Python library is OpenCV. Make sure you have already installed it. Read an input image using cv2.imread(). The RGB image read using ... Read More
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, one could follow the steps given below − Import the required libraries. In all below Python examples the required Python libraries are OpenCV, Numpy and Matplotlib. Make sure you have already installed them. Define a Gaussian or a Laplacian Filter. Apply Fourier transform on the above defined ... Read More
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 find Fourier transforms of an input image, one could follow the steps given below − Import the required libraries. In all below Python examples the required Python libraries are OpenCV, Numpy and Matplotlib. Make sure you have already installed them. Load the input image as a grayscale image ... Read More
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 for regions to examine in the original input image and the black color in the mask image is for regions to ignore. Now we calculate the histogram passing this mask as a parameter to the function. Steps To compute and plot the histograms of a region of the image, one ... Read More
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 time- Red & Green (or Green & Red), Green & Blue (or Blue & Green) and Blue & Red (or Red & Blue). Steps To compute and plot 2D histograms of an input image, one could follow the steps given below − Import required libraries OpenCV and matplotlib. ... Read More
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 image to a binary image- Import the required library. In all the following examples, the required Python library is OpenCV. Make sure you have already installed it. Read an the input image using cv2.imread(). The RGB image read using this method is in BGR format. Optionally assign the read ... Read More
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 distance between a given point and a contour of an object in an image- Import the required library. In all the following Python examples, the required Python library is OpenCV. Make sure you have already installed it. Read an input image using cv2.imread(). The RGB image read using ... Read More
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 following examples, the required Python library is OpenCV. Make sure you have already installed it. Read the input image as a grayscale image using cv2.imread() method. Specify the full path of the image with the image type (i.e. png or jpg). Compute the bitwise NOT on the input image using ... Read More
In the digital era, where mindless scrolling, speaking for hours on the phone, binge-watching series on various OTT platforms, and continuous texting and snapping with your friends are the trend, effective time management may seem nearly impossible. When everything is available to us with just a click and an infinite load of information is available on the internet, time actually flies. All we do is mindlessly gaze at the data provided to us on different social media platforms like Facebook, Instagram, WhatsApp, Snapchat, Amazon Prime, gaming applications, and others. For us, the cost of these platforms is not their annual ... Read More
Being in the same meeting room and discussing the issues concerned is not how a business operates in this day and age. For engaging with the best talent, companies are hiring across the globe. Digital communication platforms like Slack, Trello, or others are how employees engage with each other nowadays irrespective of their geographical location. Online, secure, and fast channel for communication is the need of the hour. In this article, we will be discussing which application is better for you (Slack or Trello) and why. Slack Application – Instant Messaging System Slack is a work-together online space for employees ... Read More