projectdir = 'C:\Where\The\Folder\is';
dinfo = dir( fullfile(projectdir, '*.jpg') );
num_img = length(dinfo);
img_files = {dinfo.name};
full_names = fullfile( projectdir, img_files );
img_titles = cell(num_img, 1);
num_pixel = zeros(num_img, 1);
for K = 1 : num_img
[~, img_titles{K}, ~] = fileparts( img_files{K} );
stats = imfinfo( full_names{K} );
num_pixel(K) = stats.Width * stats.Height;
end
result = table(img_titles, num_pixel, 'VariableNames', {'Title', 'NumberOfPixels'});
Best Answer