Using Matlab Image Labeler app to work with other image formats (NITF)

조회 수: 4 (최근 30일)
Aswathnarayan Radhakrishnan
Aswathnarayan Radhakrishnan 2019년 8월 12일
댓글: mohd akmal masud 2021년 8월 24일
I need to label a dataset containing imagery in NITF format. Is there a way to directly load the NITF files for labeling instead of converting all of them to PNGs before labeling? Matlab has a function to read NITF image files into arrays. Is there any kind of custom scripting available that can be added to the Image Labeler tool to automatically preprocess and convert the NITF image to a format that can be loaded by the image labeler tool?

답변 (1개)

Kojiro Saito
Kojiro Saito 2019년 8월 13일
As this document says,
The Image Labeler app supports all image file formats supported by imread. To add additional file formats to imread, use imformats.
In order to let Image Labeler load NITF formats without converting file formats, we can use imformats.
Here is a sample code of .ntf format.
%% Add NITF(.ntf) to
formatStruct = struct('ext', 'ntf', 'isa',@isnitf,...
'info',@nitfinfo,'read',@customreader, 'write','',...
'alpha',0,'description','NITF formats for imread');
registry = imformats('add', formatStruct);
%% Then, you can launch imageLabeler by specifying image datastore
imds = imageDatastore('nitfData', 'FileExtensions', '.ntf', 'ReadFcn',@customreader);
%imshow(preview(imds))
imageLabeler(imds)
%% Or, by specifying a folder which contains .ntf files
imageLabeler('nitfDataFolder')
Here is reader function which was used in imformats and imageDatastore.
customreader.m
function [data, map] = customreader(filename)
data = nitfread(filename);
map = [];
end
  댓글 수: 1
mohd akmal masud
mohd akmal masud 2021년 8월 24일
Sorry interrupt, after label the image, can save in dicom format? Because all the labeled image save in png, when I used dicom format as pictures for labeled

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

Community Treasure Hunt

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

Start Hunting!

Translated by