Is it possible to open hdf5 (.h5) images in MATLAB?
조회 수: 14 (최근 30일)
이전 댓글 표시
I am trying to open a .h5 image in MATLAB but IMREAD does not support this format.
채택된 답변
MathWorks Support Team
2009년 11월 2일
An image ingestion tool is not available for hdf5 images.
A possible workaround is to use HDF5INFO and HDF5READ functions to query the hdf5 database and extract image data. This can be done by loading the file into the MATLAB workspace with the HDF5INFO function then manually searching for the image data inside the resulting structure. Then query the database for the data with the HDF5READ function. Image data can then been processed or plotted with the IMAGESC function.
%%Read an hdf5 image and plot in MATLAB
%%Load the hdf5 file in MATLAB
info = hdf5info('hdf5_test.h5');
%%Find the addres of the image
% The operation must be done manually and the position inside the structure
% could be variable depending on the structure itself
address_data_1 = info.GroupHierarchy.Groups(3).Datasets(5).Name;
%%Query the database
image1 =hdf5read('hdf5_test.h5',address_data_1);
%%Plot the image
figure
imagesc(image1)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Acquisition Using Image Acquisition Explorer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!