read images from multiple image tif file

조회 수: 8 (최근 30일)
Turbulence Analysis
Turbulence Analysis 2020년 10월 7일
답변: Mann Baidi 2024년 4월 3일 6:48
Hi,
I am having the single .tif file which contains three image file. However, while reading it shows only teh first image. For instance, I if would like to read 2, 3 image from the single .tif file, how to do this ???
  댓글 수: 2
KSSV
KSSV 2020년 10월 7일
Check the dimensions of the image read. Is it a geotiff file?
Turbulence Analysis
Turbulence Analysis 2020년 10월 7일
It got three images of size 706 x 775.. Above is the link to donload the file..

댓글을 달려면 로그인하십시오.

답변 (1개)

Mann Baidi
Mann Baidi 2024년 4월 3일 6:48
Hi,
As per the understanding of the question, you would like to read multiple images from a multi-frame tiff file.
Assuming you are reading the file using the 'imread' function in MATLAB. This by defualt reads the first frame of the tiff image. For reading the other frames, you have to pass the frame number as parameter to the "imread" function as mentioned below:
imread("path/to/image",<frameNumber>);
Here is an example for reading a multi-level tiff file:
tiffFilePath = 'path/to/image.tiff';
% Read the multiple frames TIFF file
tiffInfo = imfinfo(tiffFilePath);
% Loop through each frame and save it as a JPEG image
for frame = 1:numel(tiffInfo)
% Read the current frame
imageData = imread(tiffFilePath, frame);
imshow(imageData)
end
Hope this will help in resolving your query!

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by