필터 지우기
필터 지우기

How to store images and its labels in a struct array?

조회 수: 12 (최근 30일)
Jes
Jes 2017년 9월 11일
편집: OCDER 2017년 9월 11일
I am doing Image classification task. I have total 500 folders and under each folder i have three image files as nifti file format. My first target here is store all the images in a single cell array (1*1500) in a simplest way. Next is to create a structure array together this original image files and the labels. Any help is appreciated!
Thanks
  댓글 수: 3
OCDER
OCDER 2017년 9월 11일
How about starting directly from a structure? Saves you from using a cell2struct command.
S(1:1500) = struct('Image', [], 'Label', '')
for j = 1:length(S)
S(j).Image = %Read the jth image
S(j).Label = 'some kind of label';
end
OCDER
OCDER 2017년 9월 11일
편집: OCDER 2017년 9월 11일
Maybe Jes is trying to do a lot of image-to-image comparisons for classification purposes? Hope you have enough memory!

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by