Inverse problem: 2D convolution
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!