Inverse problem: 2D convolution

3 visualizzazioni (ultimi 30 giorni)
Jonas Damsbo
Jonas Damsbo il 4 Dic 2019
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:

Risposte (0)

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by