Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
朴素贝叶斯最近邻(NBNN)在MATLAB中的实现_Matlab_Image Processing_Computer Vision_Matlab Cvst_Knn - Fatal编程技术网

朴素贝叶斯最近邻(NBNN)在MATLAB中的实现

朴素贝叶斯最近邻(NBNN)在MATLAB中的实现,matlab,image-processing,computer-vision,matlab-cvst,knn,Matlab,Image Processing,Computer Vision,Matlab Cvst,Knn,几天前我把这篇文章贴在了简历上,但论坛基本上没有注意到。我试图在MATLAB中实现在CIFAR-10图像数据集上进行图像分类。该算法非常简单,我对它的正确性很有信心,但是,我收到了22-28%的可怕的准确率。我不确定为什么,我希望有图像分类或算法经验的人能给我指出正确的方向。该算法学习了SIFT图像描述符,这可能是其性能不佳的原因之一。Matlab只有一个SURF特征检测器。据我所知,SURF/SIFT基本上是等效的。我一直在使用从下面的函数中获得的功能来训练我的模型 points = dete

几天前我把这篇文章贴在了简历上,但论坛基本上没有注意到。我试图在MATLAB中实现在CIFAR-10图像数据集上进行图像分类。该算法非常简单,我对它的正确性很有信心,但是,我收到了22-28%的可怕的准确率。我不确定为什么,我希望有图像分类或算法经验的人能给我指出正确的方向。该算法学习了SIFT图像描述符,这可能是其性能不佳的原因之一。Matlab只有一个SURF特征检测器。据我所知,SURF/SIFT基本上是等效的。我一直在使用从下面的函数中获得的
功能来训练我的模型

points = detectSURFFeatures(rgb2gray(image));
[features,valid_points] = extractFeatures(image,points);
CIFAR数据集和这种方法的另一个可能问题是图像的小尺寸。每个图像都是32 x 32的图像,我相信这使得特征检测非常困难。我在
detectSURFFeatures()
中使用了不同的倍频程设置,但没有任何东西使我的准确度超过28%

该方法的注释代码如下所示。这很难理解,但可能还是有帮助的

希望有人能帮我

for i = 3001:4000 %Train on the first 3000 instances and test on the remaining 1000.
    closeness = [];
    for j = 1:10 %loop over the 10 catergories
        class = train(trainLabel==j,:); % Pull out all descriptors that belong to class j
        descriptor = test(test_id==i,:); % Pull out all descriptors for image i
        [idx,dist] = knnsearch(class,descriptor,'K',1); % Find the distance between the descriptors and the closest labeled descriptor in class j.
        total = sum(dist); % sum up distances
        closeness = [closeness,sum(total)]; % append a vector of the image-to-class distances.
    end
    [val,cat] = min(closeness); % Find choose the class that resulted in the lowest, summed distance.
    predLabel = [predLabel;cat]; % Append to a vector of labels.
    i
end

如果您的图像是32x32像素,那么尝试检测兴趣点不是一个好主意。正如您所观察到的,您将获得很少的特性(如果有的话)。对图像进行上采样是一种选择。另一个选项是使用全局描述符,如HOG(
extractHOGFeatures
)。

使用灰度图像检测冲浪特征,但从原始RGB图像提取特征。这能像你期望的那样工作吗?如果在灰度图像上使用
提取特征
,结果如何?因此,检测特征对我来说一直是一个不确定的领域。我尝试在32x32图像上检测冲浪特征,但收到的输出非常稀疏。仅检测到一个或两个特征,在某些情况下未检测到特征。在玩过调整大小之后,我意识到图像越大,我接收到的功能就越多,因此在对图像运行功能检测之前,我最终将图像调整为256x256。下面是我用来提取特征的两行代码<代码>点=检测特征(I)
然后
[功能,有效的\u点]=提取功能(I,点)
。迪玛,你似乎对图像处理感兴趣-你能帮我们打开这个专门的小组吗:只需对不到10票的问题进行投票。谢谢