Professional Documents
Culture Documents
Exp 8 To 12
Exp 8 To 12
Histogram Equalization
Date:06/11/2023
Aim:
1. Plot the histogram of: (a) Dark image (b) Bright image (c) Gray level image
2. Perform the histogram equalization of these images and plot the equalized histogram
plt.subplot(234), plt.plot(hist_dark)
plt.title('Histogram of Dark Image')
plt.subplot(235), plt.plot(hist_bright)
plt.title('Histogram of Bright Image')
plt.subplot(236), plt.plot(hist_gray)
plt.title('Histogram of Gray Image')
plt.show()
Histogram Equalization
plt.show()
exp9
EXPERIMENT NO:9
KRONECKER PRODUCT OF TWO MATRCES
Aim: Find the kronecker product of two 2*2 matrix
Kronecker Product:
[[ 2 4 4 8]
[10 12 20 24]
[ 3 6 6 12]
[15 18 30 36]]
Kroneckerproduct( A , B );
2 4 4 8
10 12 20 24
3 6 6 12
15 18 30 36
Result:
Found the kronecker product of two 2*2 matrix
localhost:8888/nbconvert/html/exp10.ipynb?download=false
EXPERIMENT NO:10
EXPERIMENT NO:11
Morphological Operations
Aim:
1. To perform morphological dilation and erosion using different structuring elements.
2. To perform morphological opening and closing on binary images.
EXPERIMENT NO:11
Segmentation Thresholding
Aim:
1. To perform morphological dilation and erosion using different structuring elements.
2. To perform morphological opening and closing on binary images.
In [20]:
import cv2
import matplotlib.pyplot as plt
import numpy as np
def segment(x):
ret, bin_img = cv2.threshold(img, x, 255, cv2.THRESH_BINARY)
plt.figure(figsize=(11, 8))
plt.subplot(121)
plt.imshow(img, cmap="gray")
plt.title('Original Image')
plt.xticks([]), plt.yticks([])
plt.subplot(122)
plt.imshow(bin_img, cmap='gray')
plt.title('Segmented Image')
plt.xticks([]), plt.yticks([])
plt.show()
segment(63)
segment(90)
segment(127)