Using "imread" to process multiple images
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dongsu Kim
el 31 de Mzo. de 2022
Comentada: Dongsu Kim
el 5 de Abr. de 2022
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 comentarios
Respuesta aceptada
Geoff Hayes
el 4 de Abr. de 2022
@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...).
Más respuestas (0)
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!