Delani_92
Delani_92

Reputation: 21

How to use SVM in Object recognition

I am working in a project about recognizing the indoor environment objects (e.g. chair , table ). I am new to the machine leaning with opencv (using c++). My plan is to use SURF feature detection method and then categorize the objects using SVM classification.

I have seen many example codes and still I could not figure out how to provide the data , label them 1 or 0 , how to make a model and use that to train ..etc. I would be appreciate is anyone can help me with the clear steps. Its really confusing to me.

Upvotes: 0

Views: 3687

Answers (1)

cprakashagr
cprakashagr

Reputation: 761

You can use feature descriptors as a part of training your machine learning model. I have worked with SURF but haven't used this for training my models.

I can help you out with a project example where I have used HOG and uses SVM for training. Please check this repository. I know you have demanded for C++, and my examples being in Python, you can this repository as an example and used them alike in your preferred language.

There are mainly these steps involved:

  1. Get the samples of positive and negative images for which you can mark 1 and -1 (or 0) respectively for classification. If you think, you have enough data, you can proceed with the feature engineering part. Or, you can take the help sample_create.py from the repository and create much bigger data sets.

  2. Do the feature engineering with the sample. i.e, find feature descriptors and store them somewhere which you can use later to train your model. You can take help from the file feature_engineering.py from the repository which reads all the images, creates HOG descriptors and save them to a file.

  3. And the last step is passing the training data to the training model. I have used SVM in my example. This is shown is file linear_svm.py. I have used TensorFlow libraries for it.

  4. The model will be dumped and saved, which can be used for further object detection by passing the images directly to it. I am going to post this use very soon.

Upvotes: 1

Related Questions