Inverse problem: 2D convolution

조회 수: 1 (최근 30일)
Jonas Damsbo
Jonas Damsbo 2019년 12월 4일
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개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by