course content

Course Content

Python for Data Science: Image Handling

Arithmetic ProcessingArithmetic Processing

In OpenCV, arithmetical functions are a set of operations that can be performed on images, such as addition, subtraction, multiplication, and division. These functions are used to manipulate the pixel values of an image and can be used for image processing tasks such as image enhancement and thresholding.

Some examples of arithmetical functions in OpenCV include:

  • cv2.add(): adds two images together element-wise;
  • cv2.subtract(): subtracts one image from another element-wise;
  • cv2.multiply(): multiplies two images together element-wise;
  • cv2.divide(): divides one image by another element-wise;
  • cv2.addWeighted(): performs a weighted sum of two images;
  • cv2.absdiff(): computes the absolute difference between two images element-wise.


  1. Read two images;
  2. Add two images together;
  3. Show the image.

Everything was clear?

Section 1. Chapter 4