Professional Documents
Culture Documents
Or simply by the numpy operation res = img1 + img2. Both images should
be of same depth and type, or the second image can just be a scalar value.
cv2.add(img1, img2)
Warning:
But adding the pixels is not an ideal situation. So, we use cv2.addweighted().
Remember, both images should be of equal size and depth.
Syntax:
cv2.addWeighted(img1, wt1, img2, wt2, gammaValue)
Parameters:
Input Images:
image1 image2
OutPut:
cv2.subtract(image1, image2)
Input Code:
Input Images:
Image 01 Image 02
Pixel Values:
Each of the pixels that represents an image stored inside a computer has a pixel value
which describes how bright that pixel is, and/or what color it should be. In the simplest case
of binary images, the pixel value is a 1-bit number indicating either foreground or
background.Mean is most basic of all statistical measure.
Means are often used in geometry and analysis; a wide range of means have been
developed for these purposes. In contest of image processing filtering using mean is
classified as spatial filtering and used for noise reduction.This function is used to find the
mean value of each channel (RGB), there the output is three numbers.
ImageStat.Stat(Image)
Input Code:
Input Images:
OutPut:
Conclusion: