|
我对lena图像利用simulink和sysgen进行仿真,将图像转换成数据流后滤波缩放再转换成图像,但是图像有问题,如图00和11圈定范围所示,是sysgen中滤波器延迟的原因,但不知道怎么处理。比如,对图像进行列向四倍的放大,数据读入程序为
a=imread('D:\CFliu\cfl\FIR\cfliu\lena512.bmp');
row1=512;
col1=512;
count=0;
for row=1:row1,
for col=1:col1,
if count == row1*col1,
break;
else
count=count+1;
A(count)=a(row,col,1);
end
end
end
im_signal=double(A');
中间仿真后转成图像程序为
row2=512;
col2=2048;
count=0;
for row=1:row2,
for col=1:col2,
if count==row2*col2,
break;
else
count=count+1;
B(row,col)=out_array(count);
end
end
end
figure
subplot(1 2 1),imshow(a)
subplot(1 2 2),imshow(uint8(B))
|
|