0

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.

Delani_92
  • 21
  • 2
  • 3
  • This is way too broad of a question. You should focus on one aspect of your question, provide the code you've tried and clearly explain what's not working. I'd suggest taking the [Tour](http://stackoverflow.com/tour) and reviewing [How to Ask](http://stackoverflow.com/help/how-to-ask) – Tchotchke Jan 27 '17 at 17:22
  • 1
    Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation. [on topic](http://stackoverflow.com/help/on-topic) and [how to ask](http://stackoverflow.com/help/how-to-ask) apply here. StackOverflow is not a coding or tutorial service. – Prune Jan 27 '17 at 17:54

1 Answers1

1

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.

cprakashagr
  • 751
  • 11
  • 28
  • Thank you very much for the concern. linear_svm means that it is one-to-one classification right ? I would be grateful if you can guide with me many-to-many. – Delani_92 Jan 30 '17 at 07:06
  • Please refer https://en.wikipedia.org/wiki/Support_vector_machine#Linear_SVM for more on linear svm. I could see that you want a multi class classifications, multiclass svm is possible. Please refer for more here: https://en.wikipedia.org/wiki/Support_vector_machine#Extensions. FYI, its not exactly one-to-one or many-to-many, its always like data to classes. All you need is data with a class associated with it (https://github.com/cprakashagr/hog-svm-tf/blob/master/src/feature_engineering.py#L43) and then proceed with training. – cprakashagr Jan 31 '17 at 08:14