How to train and predict using bag of words?

前端 未结 1 604
野性不改
野性不改 2021-01-31 11:36

I have a folder of images of a car from every angle. I want to use the bag of words approach to train the system in recognizing the car. Once the training is done, I want that i

相关标签:
1条回答
  • 2021-01-31 12:14

    Your next step is to extract the actual bag of word descriptors. You can do this using the compute function from the BOWImgDescriptorExtractor. Something like

     bowDE.compute(img, keypoints, bow_descriptor);
    

    Using this function you create descriptors which you then gather into a matrix which serves as the input for the classifier functions. Maybe this tutorial can guide you a little bit.

    Another thing I would like to mention is, that for classification you usually need at least 2 classes. So you also need some images which do not contain cars to train a classifier.

    0 讨论(0)
提交回复
热议问题