训练数据集群的BOW预测 [英] BOW prediction of cluster for training data

查看:271
本文介绍了训练数据集群的BOW预测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为视频分类创建了一袋视觉词。我不使用SURF描述符,这就是为什么我不能使用OpenCV的 BOWImgDescriptorExtractor 为此目的。
我提取了我的描述符,我自己集中他们。我现在有词汇量(大小为4000)。我应该做的是将我的训练描述符分配给这些集群,并为后续步骤创建可视直方图。我应该如何做这个预测和创建我的训练数据从创建的字典的视觉直方图?

I am creating a bag of visual words for classification of videos. I am not using SURF descriptors and that is why I couldn't use OpenCV's BOWImgDescriptorExtractor for this purpose. I extracted my descriptors and I cluster them by myself. I have my vocabulary now (of size 4000). what I should do is to assign my training descriptors to these cluster and create visual histogram for next steps. how should I do this prediction and create visual histogram for my training data from the created dictionary ?

推荐答案

为了分配描述符到集群,你必须选择一个距离度量。一个简单的选择是欧氏距离。然后,您需要计算从训练描述符到每个聚类中心的距离,并将它们分配到其质心比任何其他聚类的质心更接近描述符的聚类。

In order to assign the descriptors to clusters, you have to choose a distance metric. A simple choice would be the Euclidean distance. Then you need to compute the distance from the training descriptors to each cluster centroid, and assign them to the cluster whose centroid is closer to the descriptor than the centroids of any other cluster.

为图像上的所有训练描述符完成此操作后,您将计算分配给每个集群的描述符的数量,然后构建一个直方图。然而,必须对训练集中的所有图像重复该过程。由于描述符的数量可能随图像而变化,所以直方图通常在被馈入分类器之前被归一化为用于训练的特征向量。

After you've done that for all training descriptors on the image, you count the number of descriptors assigned to each cluster, and then build a histogram. The procedure must be repeated for all images in the training set, though. Since the number of descriptors might vary with the image, the histograms are usually normalized before being fed into the classifier as feature vectors for training.

这篇关于训练数据集群的BOW预测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆