How to get a matrix which acquires a pixel values along a spiral trajectory of Image.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ajay Gunalan
le 29 Juil 2022
Modifié(e) : Ajay Gunalan
le 3 Août 2022
Hi, I'm working on compressive sensing for laser scanning applications. I want to sample the image along a continuous trajectory and get the pixel values. I'm able to get the pixel values along a continuous trajectory. In this case, a spiral trajectory. However, I don't know how to obtain the sampling matric C in y = Cx, where x is the input vector image, C is the sampling matrix which, on multiplying, gives values along the defined trajectory and y is the pixel values along that trajectory.
clear all;
clc;
%% Goal is to acuqire a pixel values along a spiral trajectory of Image (X).
% i.e y = Cx;
% where y is a m*1 measument matrix
% C is a m*N sampling matrix
% X is a N by 1 vectorized Image.
% N = n1*n2 where n1, n2 are size of the image
% Paramters for Spiral
dSpirals = 30;
nSpirals = 20;
CompresRatio = 0.4;
InputImage = imread('barbara1.png');
[height width] = size(InputImage);
N = height*width;
m = round(CompresRatio*N);
nPoints = m;
theta = linspace(0,360*nSpirals, nPoints);
% Define Spiral
x = round(((width/2)+1) +(theta/dSpirals).*cosd(theta));
y = round(((height/2)+1) +(theta/dSpirals).*sind(theta));
plot(x,y);
axis([0 width 0 height]);
grid on;
%% Measure the pixel values along the spiral trajectory
Measure = zeros(m,1);
for i = 1:m
Measure(m) = InputImage(x(i),y(i));
end
%% How to find C in y = CX where:
% y = Measure
% X = InputImageV %i.e., InputImageV = InputImage(:);
4 commentaires
Matt J
le 29 Juil 2022
Modifié(e) : Matt J
le 29 Juil 2022
I don't see how you'd be able to solve for x, because C is non-square. If C were square and invertible, it would be a permutation matrix. You don't need the matrix form of C to solve an equation which is just a permutation.
In any case, if you are certain that C is what you want, you will hopefully consider Accept-clicking my answer below.
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) 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!