There are two ways to compute and display histograms. First, OpenCV provides cv2.calcHist() function to compute a histogram for an image, second, use matplotlib to plot the histogram diagram, matplotlib is a Python library for creating static, animated, and interactive visualizations.Figure 7 shows...
Monday, November 27, 2023
Thursday, November 23, 2023
OpenCV and Image Processing - Histogram
A histogram is a graphical representation of the distribution of pixel values in an image. In image processing, a histogram can be used to analyze the brightness, contrast, and overall intensity of an image. It is plotted in a x-y chart, the x-axis of a histogram represents the pixel values ranging...
Sunday, November 19, 2023
OpenCV and Image Processing - Blur Image (Median Blur)
Same as Gaussian Blur, the Median Blur is also widely used in image processing, it is often used for noise reduction purposes. Similar to the Gaussian Blur filter, instead of applying Gaussian formula, the Median Blur calculates the median of all the pixels inside the kernel filter and the central pixel...
Thursday, November 16, 2023
OpenCV and Image Processing - Blur Image (Gaussian Blur)
Now we add the Gaussian blur function to the ImageProcessing class.1 def blur(self, ksize=(1,1), image=None):2 if image is None:3 image = self.image4 if ksize[0] % 2 == 0:5 ksize = (ksize[0] + 1, ksize[1])6 if ksize[1] % 2 == 0:7 ksize = (ksize[0], ksize[1] + 1)8 result = cv2.GaussianBlur(image,ksize,...
Sunday, November 12, 2023
OpenCV and Image Processing - Blur Image
Blurring an image is a common image processing technique used to reduce noises, smooth out edges, and simplify the image. This post will introduce two types of image blurring techniques, Gaussian Blur and Median Blur. Gaussian BlurGaussian Blur is a widely used effect for image processing and is...
Friday, November 10, 2023
OpenCV and Image Processing - Warp Image contd...
In this post, as an example in Figure shown below, the left picture is taken by a tablet camera from the homepage of OpenCV.org, the picture looks distorted, the perspective warping will be used to correct it and make it aligned properly, the result will be shown in the right side of Figure shown below.OpenCV...
Monday, November 6, 2023
OpenCV and Image Processing - Warp Image
Warp image refers to the process of geometrically transforming an image into different shapes. It involves applying a perspective or affine transformation to the image, which can change its size, orientation, and shape.This post introduces perspective warping, also known as perspective transformation,...
Thursday, November 2, 2023
OpenCV and Image Processing - Bitwise Operation contd....
Next is to create (1 – mask), technically this is 255 – mask, because the mask is created in a grayscale channel, which has values ranging from 0 to 255. However, in this case we deal it with the binary channel, the values are either 0 or 255, meaning either 100% opacity or 100% transparency, no other...