How to create images database in matlab to store 5 images.

I want to make a database of 5 images I have, which are img1,img2,img3,img4,img5. I will will use this for template matching which is part of my research. please any body can help me in this regard to provide me the source code?

3 Kommentare

Define what "database" means to you. Like an actual database, or just a folder of images, or something else. Also, do you have the Database Toolbox?
Sadiq Shah
Sadiq Shah am 23 Okt. 2014
Bearbeitet: Sadiq Shah am 23 Okt. 2014
I have all these images in a folder. I want to store all these in workspace to be avalable for me to use it in my code for matching purposes.And want that its .mat file is also formed.
for i=1:5
dataBase(i,:)=['Images/Database/' int2str(i) '.jpg '];
end
save theDatabase
I have this code but cannot use it for my images. It make theDatabase.mat
Sir may u please explain me ,how this actually works.I am not getting from where to give path of images & what that int2str function stands for.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Mohammad Abouali
Mohammad Abouali am 22 Okt. 2014
load them into separate cell array
imageDB{1}=imread('img1.jpg');
imageDB{2}=imread('img2.jpg');

7 Kommentare

Thanks Muhammad... See my problem in my comment above and help me.
dataBase=cell(5,1);
for i=1:5
dataBase{i}=imread(['Images/Database/' int2str(i) '.jpg ']);
end
save dataBase dataBase
Thanks Muhammad,thanks for your help... I have made it. It works well. Now please tell me that how read all these images by using a single imread function after loading it using the 'load dataBase' function in my code?
See the FAQ entry in my answer. It gives you sample code for doing that.
Mohammad Abouali
Mohammad Abouali am 24 Okt. 2014
Bearbeitet: Mohammad Abouali am 24 Okt. 2014
Yes,
typing load dataBase would do. You can access each image by typing dataBase{i}.
Also make sure to read the link that ImageAnalyst has given you. It contains a lot of useful information.
Thank you very very much sir!!
I have created Database shown above, now I want to import(read) an image from the created database to the other application(program), so please suggest me the code to do?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (4)

Image Analyst
Image Analyst am 23 Okt. 2014

0 Stimmen

1 Kommentar

Dear " Image Analyst" i need your help.
problem: let say i have 5 images of 300x300 and these images are simple color images, say; ist image is red color image, 2nd is blue, 3rd is yellow, 4th is white and 5th is black color image. so first i have to save all 5 images like a database then i can input one image from the above image and find out the correct image from my database (just like correlation) i-e my input image is the ist image from my database or my input image is the 2nd image from my database or my input image is the 3rd image from my database... and so on...
and we can choose the correct image from our database on the basis of color...
kindly send the code of above stated problem "Image Analyst", if possible.
thankyou.

Melden Sie sich an, um zu kommentieren.

Dima Lisin
Dima Lisin am 24 Okt. 2014

0 Stimmen

The imageSet class in the Computer Vision System Toolbox gives you an easy way to create a collection of images.
seenu Ramdoss
seenu Ramdoss am 10 Feb. 2015

0 Stimmen

Sir, i need create one food database and i compare my input food image with the data base....in matlab ,,,how to i do this...

1 Kommentar

There are many aspects of that: image capture (cameras, lighting, etc.), data storage, image analysis, feature vector comparison, what to do based on the results, etc. It's too much to ask us to layout an entire turnkey system for you. Can you ask a much smaller, simpler, more targeted question?

Melden Sie sich an, um zu kommentieren.

Muntaha Saleem
Muntaha Saleem am 10 Jun. 2021

0 Stimmen

i need to import mmu iris scans images in matlab kindly guide me how to do it

1 Kommentar

Use imread() if you can.
theImage = imread(fullFileName);
For a full demo, see my Image Segmentation Tutorial:

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Image Processing and Computer Vision finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by