Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear
- % %%%%%读取图像(视频) %导入视频
- video = VideoReader("视频素材")
- img = read(video,1);
- %%%%%分开RGB通道进行傅里叶变换
- for i = 1:3
- colour = img(:,:,i); %提取颜色数据
- fcolour = fft2(colour); %傅里叶变换
- fcolour_centre = fftshift(fcolour); %频谱移到中心
- T=angle(fcolour_centre)*180/pi; %对相位谱进行增强
- fcolour_centre(abs(fcolour_centre)<2000)=0; %减少细节
- out_colour = ifft2(fcolour); %傅里叶逆变换
- out(:,:,i) = real(out_colour);
- subplot(3,3,i);imshow(log(fcolour_centre)+eps,[]);colormap("gray"); %频谱展示
- subplot(3,3,i+3);imshow(T);colormap("gray"); %相位图展示
- colour = zeros;
- end
- out = uint8(out); %恢复图像
- %%%%%画图
- subplot(3,3,7);imshow(img);
- subplot(3,3,8);imshow(out);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement