Skip to content

Files

Failed to load latest commit information.

Latest commit

 Cannot retrieve latest commit at this time.

History

History

ArithmeticOperations

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Arithmetic Operations on Images

We can carry out arithmetic operations like adding and subtracting images using OpenCV Python.

Requirement

pip install opencv-python

Addition of Images

We can add two images using the function cv2.addWeighted().
It takes 5 arguments image1, image2, weight of image1, weight of image2 and light value of final image.

The final output image after addition is:

Subtraction of Images

To subtract two images, use the function cv2.subtract(image1,image2).

The final Output image obtained after subtracting is: