Professional Documents
Culture Documents
DIP Lab1
DIP Lab1
Objective:
To read image, display image and perform algebraic operations addition, multiplication
and subtraction.
Introduction:
The aim of this experiment is to explore basic image processing techniques using the
OpenCV library in Python. The primary objectives include reading an image, displaying it,
and performing simple algebraic operations to manipulate the pixel values.
cv2.imshow("image", img1)
cv2.imshow("image",img2)
a = cv2.resize(img2,(400,400))
b= cv2.resize(img1,(400,400))
add= cv2.add(a,b)
mull = cv2.multiply(a,b)
sub = cv2.subtract(a,b)
div = cv2.divide(b,a)
cv2.imshow("image",add)
cv2.waitKey(0)
Result:
The original image was successfully read and displayed. Algebraic operations (addition,
multiplication, subtraction) were performed on the image, resulting in modified images with
adjusted pixel values.