Using "imread" to process multiple images
4 次查看(过去 30 天)
显示 更早的评论
Hi guys,
I plan to develop a code to process a series of combustion images from a GDI engine captured by a high speed camera.
I have written a code to process multiple images but it seems that the matlab only presents the last data of "for" loop even though the code succesfully loaded all the images in an array form.
Each cycle consists of 400 frames and there are 10 cycles to be analysed. However, I always omit the first frame as the image is blurred. Therefore, I tried to process the following frames for each cycel: 2~400, 402~800, 802~1200 etc. until 3602~4000. Nevertheless, I found out that the array size increases as I increased the number of 'n' for the "for" loop e.g. If I do for n=402:800, the arry size becomes 800 and it shows 401 blank cells within the array.
Is there any clever way to process the data? I would like to plot a 2d-line (continuous) curve for each data set (399 frames per cycle).
Your help is greatly appreciated.
Many Thanks!
0 个评论
采纳的回答
Geoff Hayes
2022-4-4
@Dongsu Kim - from your code
for n=2:400 %Load image file
images{n} = imread(sprintf('C1S0076%08d.tif',n));
end
Im1 = mat2gray(images{n}, [0 255]); %Convert matrix to grayscale image
% etec.
Note how the loop reads in each image, but the first line outside of the loop only considers the last image. You would need to include that line (and all that which follows) within the loop so that the code gets processed for each image (though you may not want to create a figure for each image...).
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!