The most efficient way is of course always dependent on the situation. What resources are available, how large are the data sets, are all the images the same size, etc. etc. Your remark about using a camera suggests that all images are of the same size. To test the performance of some methods I timed the performance using tic toc for four situations. For the purpose of testing I used 44 jpeg images (1080x1920) names 1.jpg to 44.jpg.
Situation 1. Your situation, using an array without memory pre-allocation:
Elapsed time is 5.466675 seconds.
clear all
num_images=44;
tic
for ii = 1:num_images
filename = strcat(num2str(ii),'.jpg');
temp_img = imread(filename);
image_arr(ii,:,:) = rgb2gray(temp_img);
clear temp_img;
%Reads in i'th .jpg image, converts it to grayscale,
% then moves that into the i'th member of image_array
end
toc
Situation 2 Situation described by seb, using cell with memory pre-allocation:
Elapsed time is 2.388686 seconds.
clear all
num_images=44;
tic
images{num_images} = []; % alocate memory for the cell array header
for ii = 1:num_images
images{ii} = rgb2gray(imread(strcat(num2str(ii),'.jpg')));
% Reads in i'th .jpg image, converts it to grayscale,
end
toc
Situation 3 Since all the pictures have the same dimensions create an array of size [num_images,1080,1920], memory pre-allocation should help performance.
Elapsed time is 3.617463 seconds.
clear all
num_images=44;
tic
images = zeros(num_images,1080,1920); % pre-alocate memory for array
for ii = 1:num_images
images(ii,:,:) = rgb2gray(imread(strcat(num2str(ii),'.jpg')));
% Reads in i'th .jpg image, converts it to grayscale,
end
toc
Situation 4 The same as situation 3 but now pre-allocating space slightly different: [1080,1920,num_images].
Elapsed time is 2.826266 seconds.
clear all
num_images=44;
tic
images = zeros(num_images,1080,1920); % pre-alocate memory for array
for ii = 1:num_images
images(ii,:,:) = rgb2gray(imread(strcat(num2str(ii),'.jpg')));
% Reads in i'th .jpg image, converts it to grayscale,
end
toc
Conclusion
The conclusion is that cells are the fastest when handling full hd images, also it should be noted that it appears that when pre-allocating space the iterator should be used as third index instead of the first.
Note
I you wonder about the performance of the code use the command profile viewer
and run your code from there to see potential bottlenecks. Make sure you split commands over several lines since evaluation performance is reported per line.