Inverse problem: 2D convolution
2 次查看(过去 30 天)
显示 更早的评论
I have this exercise. I need to find a matrix G based on d = Gm with a point spread function and an image. The task says I can find the kth column of g. But not sure whether to set up a for loop function?
My attempt is here, but here is G = D, which I don't think it should be:
%Loading data
Data = load('wavedata.txt'); %observed data
P = load('pointspread.txt'); %point spreading
%Creating a random subset of the data, 50x50 = 2500 elements
New_data = Data(randi(numel(Data),50,50));
%Make a convolution
%Image M
M = zeros(50);
one = [1];
for k = 1 : length(one)
index = randi(numel(M),1);
M(index) = one(k);
end
%2D convolution
D = conv(M,P,'same');
g = D(:);
G = reshape(g,50,50); %inverse of g to the G matrix
The exercise description is uploaded as a png here:
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!