how can make a dataset of images?

조회 수: 4 (최근 30일)
jack nn
jack nn 2015년 6월 14일
댓글: Walter Roberson 2017년 2월 18일
I provided a code that gets an initial image as input and gives me 4 images as result. I should run this code as loop that user enters an initial images. in this loop every time I should save all the results because I want to make a dataset of these images and then do feature extraction. how can I do this? Can I use structure for this? I think that we can imagine every image as a matrix but I don't how we can do this .I think I should have a dataset of images like this:
but I dont know how can make this.do you think this idea is rational?or I should change my approach.
I appreciate your helps and supports in advanced.

채택된 답변

Walter Roberson
Walter Roberson 2015년 6월 14일
A struct is fine.
datastruct = struct('IMG1', [], 'IMG2', [], 'IMG3', [], 'IMG4', []);
while true
[filename, pathstr] = uigetfile('Select an image');
if ~ischar(filename) %user canceled
break;
end
fullname = fullfile(pathstr, filename); %it might not be in current directory
... process file named by fullname
datastruct(end+1).IMG1 = image1;
datastruct(end).IMG2 = image2;
datastruct(end).IMG3 = image3;
datastruct(end).IMG4 = image4;
end
  댓글 수: 1
jack nn
jack nn 2015년 6월 15일
thanks dear Walter Roberson .

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

추가 답변 (2개)

Image Analyst
Image Analyst 2015년 6월 15일
Why can't you do feature extraction immediately after you create them, and not worry about saving these intermediate images? Why do you have to save them all? If, for some reason you do, then I'd just save them in .mat files until you need them at some later time.
  댓글 수: 7
Bheki Ngobe
Bheki Ngobe 2015년 12월 14일
Hi
I am trying out this code, but how I tell matlab the location of my images ? (I am them stored in a folder). Thanks in advance
Image Analyst
Image Analyst 2015년 12월 14일
Alternatively, see this to get up to speed quickly with a nice GUI: http://www.mathworks.com/matlabcentral/fileexchange/24224-magic-matlab-generic-imaging-component

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


mukul jain
mukul jain 2017년 2월 18일
algorithm for identifying near surface/sub surface targets using hyperspectral image through Matlab. please guide me

카테고리

Help CenterFile Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by