matrix Dimension Must Agree
1 次查看(过去 30 天)
显示 更早的评论
please some suggest me Where I am going wrong, I want to add periodic noise in my Image
if true
tw=imread('twins.tif');
t=rgb2gray(tw);
%Creating Periodic noise
s=size(t);
[x,y]=meshgrid(1:s(1),1:s(2));
p=(sin(x/3+y/5)+1);
t_pn=(im2double(t)+(p/2)/2);
imshow(t),figure,imshow(t_pn);
% code
end
2 个评论
采纳的回答
Wayne King
2013-3-10
Without more information about your image size, which you don't provide, it's hard to say, but try transposing the p matrix as I've done below:
tw=imread('twins.tif');
t=rgb2gray(tw);
%Creating Periodic noise
s=size(t);
[x,y]=meshgrid(1:s(1),1:s(2));
p=(sin(x/3+y/5)+1)';
t_pn=(im2double(t)+(p/2)/2);
3 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!