Getting the maximum value of several matrices loaded from image files.
이전 댓글 표시
I have troubles with the max command applied to images files.
I have N=108 image files tif. Each file corresponds to a matrix. I need to load all the matrix/images and compute a matrix containing the maximum values among the 108 matrices.
My script to read the N=108 files is as follows:
imagelist = dir('*.tif');
N = numel(imagelist);
imdata = cell(1, numel(imagelist));
for k = 1: N
imdata{k} = imread(imagelist(k).name);
end
I don’t know to compute the “maximum matrix” since imdata contains matrices as cells.
Using
M=max(imdata{k})
indeed I obtain a row vector containing only the maximum values of the first cell.
채택된 답변
추가 답변 (1개)
Doug Hull
2013년 11월 12일
1 개 추천
Do not store the images in cells. Just load each in turn, get the maximum value. Compare this maximum value to the previously found maximum value. Keep the maximum of those two. Repeat until all have been done.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!