64 - MVL - Exp 2
64 - MVL - Exp 2
cv.merge (mv,
dst) Parameters
mv input vector of matrices to be merged; all the matrices in mv must have the same
the same depth.
dst output array of the same size and the same depth as mv[0]; The number of chann
be the total number of channels in the matrix array.
Program :
Converting between different color spaces
import cv2
import numpy as np
path = r'C:\Users\Admin\Desktop\saturn.jfif'
img =
cv2.imread(path,cv2.IMREAD_COLOR)
gray =
cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
cv2.imshow('BGR',img)
cv2.imshow('Gray',gray)
cv2.waitKey(0)
cv2.destroyAllWindows(
)
Img=cv2.imread('ear2.jpg',
0) f= np.fft.fft2(img)
fshift =
np.fft.fftshift(f) rows,
cols = img.shape
crow,ccol = int(rows/2), int(cols/2)
fshift[crow-30:crow+30, ccol-30:ccol+30] =
0 ishift = np.fft.ifftshift(fshift)
iimg =
np.fft.ifft2(ishift) iimg
= np.abs(img)
plt.subplot(121),plt.imshow(img, cmap =
'gray') plt.title('original'),plt.axis('off')
plt.subplot(122), plt.imshow(iimg, cmap =
'gray') plt.title('img'),plt.axis('off')
plt.show()
Output :
Converting between different color spaces
Aldel Education Trust’s
St. John College of Engineering and Management, Palghar
(A Christian Religious Minority Institution)
Approved by AICTE and DTE, Affiliated to University of Mumbai/MSBTE
St. John Technical Campus, Vevoor, Manor Road, Palghar (E), Dist. Palghar, Maharashtra-401404
NAAC Accredited with Grade ‘A+’
DEPARTMENT OF COMPUTER ENGINEERING
The Fourier Transform
Conclusion : Hence, we have successfully studied the Converting between different color
spaces,The Fourier Transform, High pass filter, Low pass filter.