Extracting max intensity coordinates from image sequence
20 vues (au cours des 30 derniers jours)
Hello, I'm a complete beginner and I'm currently trying to extract maximum intensity pixel coordinates from multiple images at one time (I have about 2500 images) and store them in a matrix with slice number that correspond. After doing some research here I came up with this code :
filedir = '...';
imds = imageDatastore(filedir);
imgs = readall(imds);
max_int = max(imgs(:));
I understand how to do it for one image but doing it in a loop for multiple images is quite difficult for me.
Can someone give me some hint or solution on how to modify this loop to have what I want ?
Thank you very much.
yanqi liu le 22 Juin 2022
yes，sir，may be use some index to transfer，such as
im = imread('rice.png');
[max_p, ~] = max(im(:));
ind = find(im(:)==max_p);
% use ind2sub
[r,c] = ind2sub([size(im,1) size(im,2)], ind);
for i = 1 : length(r)
fprintf('(%d, %d) is max value %d\n', r(i), c(i), im(r(i), c(i)));