The last section introduced image blending by implementing the algorithm introduced by the OpenCV document. As you can see from the result in Figure from previous post, the image looks a little bit faded out, and both original images become transparent to some extent. It depends on what effects you...
Sunday, October 29, 2023
Thursday, October 26, 2023
OpenCV and Image Processing - Blend Image
Blending images refers to the process of combining two images to create a single image that has the characteristics of both original images. The result is a combination of the corresponding pixel values of the two original images with weights.The blending process involves specifying a weight for each...
Monday, October 23, 2023
OpenCV and Image Processing - Adjust Hue, Saturation and Value
We have already explained a color image can be split not only to BGR channels but also HSV channels, the former represents blue, green and red channels, the latter represents hue, saturation and value. The hue represents the color of the image, different hue values have different colors; saturation...
Friday, October 20, 2023
OpenCV and Image Processing - Adjust Contrast and Brightness of an Image
We already saw how to adjust the brightness and contrast for a webcam, however unfortunately OpenCV doesn’t provide functions to adjust the brightness and contrast for an image. But OpenCV official document recommends an alternative way to do it, see the link at:https://docs.opencv.org/4.7.0/d3/dc1/tutorial_basic_linear_transform.htmlWe...
Monday, October 16, 2023
OpenCV and Image Processing - Resize, Crop and Rotate an Image continued...
Now the class can perform the resize, crop and rotate operations. In the source codes of ResizeCropRotate.py the class is imported in Line 2, this is a typical way to include another Python file for reference.1 import cv22 import common.ImageProcessing as ip34 if __name__ == "__main__":5 # Create an...
Friday, October 13, 2023
OpenCV and Image Processing - Resize, Crop and Rotate an Image
Python is an excellent language to support object-oriented programming, this post will start to use object-oriented techniques to write the codes. We will create classes to include properties and functions, then instantiate the classes and invoke their functions.Now create a class called ImageProcessing,...
Monday, October 9, 2023
OpenCV and Image Processing - Conversion of Color Spaces (Convert BGR to HSV and vice versa)
As explained earlier, an image can be represented not only in BGR but also in HSV color spaces, OpenCV can easily convert the image between BGR and HSV. Like converting it to grayscale, the same function cv2.cvtColor() is used but the second parameter is different, cv2.COLOR_BGR2HSV in this case.The...
Friday, October 6, 2023
OpenCV and Image Processing - Conversion of Color Spaces (Convert Grayscale to BGR)
A grayscale image can also be converted to BGR color space, in this case the source is a grayscale image which only has one channel and does not have any color information, therefore the result BGR image looks the same as the original grayscale one. But the difference is the BGR image has three channels...
Monday, October 2, 2023
OpenCV and Image Processing - Conversion of Color Spaces
Image processing is a technique to apply some mathematical algorithms and use various functions and techniques to manipulate digital images in order to get the desired outcomes with enhanced effects, such as improving their quality or extracting useful information from them.OpenCV provides a number...