create image from timeseries data
10 views (last 30 days)
Show older comments
Turbulence Analysis
on 24 Jan 2024
Commented: Mathieu NOE
on 2 Feb 2024
Hi,
I have time stamp (in microseconds) of the image data stored in array AA and arrays x,y and I contains x,y co-ordinats and intensity. I need to accumulate the data over 200 microseconds to create each image.
x pixel size - 1280;
y pixel size - 720;
2 Comments
Accepted Answer
Mathieu NOE
on 25 Jan 2024
hum , maybe it's because image processing is not my everyday activity but unless I have misunderstood the project you want to create images of size 1280 * 720 (= 921600 pixels) but only specifying the intensity for 200 of them for each image.
so the remaining portion of the image is what ? I decided to init each image with zero valued array , but I may be completely off topic
this is what I can offer, if that makes sense to you
load('matlab1.mat')
data = cd_data.AA;
x = cd_data.x;
y = cd_data.y;
intensity = cd_data.I;
samples = numel(data);
x = x+1 ; % x range must be changed from (0:1279) to (1:1280)
y = y+1 ; % x range must be changed from (0:719) to (1:720)
dt = 1; % sample rate (micro s)
t = dt*(0:samples-1); % time vector
%% home made solution (you choose the amount of overlap)
buffer_size = 200; % how many samples
overlap = 0; % overlap expressed in samples
shift = buffer_size-overlap; % nb of samples between 2 contiguous buffers
nb_of_loops = fix((samples-buffer_size)/shift +1);
im_empty = zeros(1280,720);
for k=1:nb_of_loops
start_index = 1+(k-1)*shift;
stop_index = min(start_index+ buffer_size-1,samples);
xx = x(start_index:stop_index);
yy = y(start_index:stop_index);
Intens = intensity(start_index:stop_index);
im = im_empty; % init im with zeros
% now use the data
for m = 1:buffer_size
im(xx(m),yy(m),k) = Intens(m);
end
% display (optionnal)
imshow(im(:,:,k))
end
5 Comments
Mathieu NOE
on 25 Jan 2024
ok , first I was not aware that on your side the time index start at 844304 , on my side it will be 1
so running my code only for the first iteration will generate this image (attached also)
for k=1:1%nb_of_loops
start_index = 1+(k-1)*shift;
stop_index = min(start_index+ buffer_size-1,samples);
xx = x(start_index:stop_index);
yy = y(start_index:stop_index);
Intens = intensity(start_index:stop_index);
im = im_empty; % init im with zeros
% now use the data
for m = 1:buffer_size
im(xx(m),yy(m),k) = Intens(m);
end
% display (optionnal)
imshow(im(:,:,k))
end
it's not completely blank , the non zero elements are exactly 200 in this first iteration (buffer), but only 200 for 921600 pixels that is only 0.0217 % of the entire image
More Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!