Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

matlab extract features in matfile

I have images of 30 different leaves in white background numbered 1-30. I'm working on a project in image processing where the user can load a new leaf image with white background and the program will compare it with the images on the database and show the most similar. I'm new to matlab.

How can I extract the features and store it to a database (mat file) in double format?

like image 766
Mary Ann Avatar asked Jan 23 '12 04:01

Mary Ann


1 Answers

You need a feature detection part in your project for extracting the features set. That will be a matlab function generating an output array or matrix with the features. In order to know which leave generates those features you will need to label the data with strings. Matlab has structures for storing data and text like the one in this example taken from PRtools:

> struct(A)
ans = 
        data: [100x3 double]
     lablist: {2x4 cell}
        nlab: [100x1 double]
     labtype: 'leave1'
     targets: []
     featlab: [3x2 char]
     featdom: {[]  []  []}
       prior: []
        cost: []
     objsize: 100
    featsize: 3
       ident: [100x1 struct]
     version: {[1x1 struct]  '21-Jul-2007 15:16:57'}
        name: []
        user: []

The features can be pixel values, for example, so they will be stored inside an array. It is a simple task but you first need to read a little about the topic.

The main problem will be selecting a training set and test set (of features) for the classifier you choose. That will depend on how many features you use, how similar they are, and a lot of things that you can't know a priori so you will have to experiment with different training/test sets and feature configurations.

There is a toolbox in matlab design for this purpose, so give it a try: PRtoolbox.

Good luck.

like image 109
Jav_Rock Avatar answered Oct 20 '22 01:10

Jav_Rock