matlab显示下一张图,修改一下程序使图像能够一张一张的显示出来

本文档演示如何使用Total Variation(TV)方法恢复模糊并带有噪声的图像。首先读取并显示原始图像,然后对图像进行高斯模糊并添加噪声。接着,通过迭代计算和Roe上风差分方案来应用TV恢复算法。最后,展示经过600次迭代后的恢复图像。
摘要由CSDN通过智能技术生成

%% Restore an degraded Image (noising and blurring) by TV method.

%% The numerical implementation is based on Roe upwind schema

clear all;

close all;

clc;

Img = imread('lenna.bmp');

Img = double(Img);

figure(1); imshow(uint8(Img));

[nrow, ncol] = size(Img);

% blurring image

Img = gauss(Img,7,3);

% add noise to the blurred image

I0=Img+10*randn([nrow, ncol]);

figure(2); imshow(uint8(I0));

lamda=0.2;        % This is a important parameter to get a better result

timestep=0.01;

I_temp=I0;        % Initialization

%Iteration begin

for n=1:600

Ix = 0.5*(I_temp(:,[2:ncol,ncol])-I_temp(:,[1,1:ncol-1]));

Iy = 0.5*(I_temp([2:nrow,nrow],:)-I_temp([1,1:nrow-1],:));

Ix_back = I_temp-I_temp(:,[1,1:ncol-1]);

Ix_fo

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值