在目标检测文献中,通常使用分类器和滑动窗口方法来检测图像中目标的存在,该方法返回一组检测窗口,并且使用非最大抑制来解决检测重叠。
谁能解释一下在这些检测窗口上执行非最大值抑制的算法。
谢谢
发布于 2013-04-03 18:58:34
引用http://www.di.ens.fr/willow/events/cvml2012/materials/practical-detection/
扫描窗口样式的图像补丁分类通常会导致目标对象周围的多个响应。处理这种情况的标准做法是删除具有局部最大置信度分数(非最大值抑制或NMS)的检测邻域中的任何检测器响应。NMS通常应用于图像中的所有检测,置信度高于某个阈值。在不同的阈值和不同的图像中尝试NMS人脸检测:
另外,在这里http://www.ens-lyon.fr/LIP/Arenaire/ERVision/detection_exercise_solution.m你可以找到一个matlab程序,它可以做所有的事情-检测和检测窗口上的网管
对检测窗口执行非最大抑制的代码是
%%%%%%%%%%%%%%% **************************************************************
%%%%%%%%%%%%%%% **************************************************************
%%%%%%%%%%%%%%% * *
%%%%%%%%%%%%%%% * EXERCISE 3: *
%%%%%%%%%%%%%%% * *
%%%%%%%%%%%%%%% * Non-maxima suppression of multiple responses *
%%%%%%%%%%%%%%% * *
%%%%%%%%%%%%%%% **************************************************************
%%%%%%%%%%%%%%% **************************************************************
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%% Scanning-window style classification of image patches typically
%%%%%%%%%%%%%%% results in many multiple responses around the target object.
%%%%%%%%%%%%%%% A standard practice to deal with this is to remove any detector
%%%%%%%%%%%%%%% responses in the neighborhood of detections with locally maximal
%%%%%%%%%%%%%%% confidence scores (non-maxima suppression or NMS). NMS is
%%%%%%%%%%%%%%% usually applied to all detections in the image with confidence
%%%%%%%%%%%%%%% above certain threshold.
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%% TODO:
%%%%%%%%%%%%%%% 3.1 Try out different threshold values to pre-selected windows
%%%%%%%%%%%%%%% passed to the NMS stage, see parameter 'confthresh' below.
%%%%%%%%%%%%%%% 3.2 Try out different threshold values for NMS detections,
%%%%%%%%%%%%%%% see parameter 'confthreshnms'
%%%%%%%%%%%%%%% 3.3 Try detection and with different thresholds for different
%%%%%%%%%%%%%%% included images: 'img1.jpg', 'img2.jpg', 'img3.jpg', 'img4.jpg'
%%%%%%%%%%%%%%%
confthresh=0;
indsel=find(conf>confthresh);
[nmsbbox,nmsconf]=prunebboxes(bbox(indsel,:),conf(indsel),0.2);
%%%%%%%%%%%%%%% display detections above threshold after non-max suppression
%%%%%%%%%%%%%%%
confthreshnms=1;
clf, showimage(img)
indsel=find(nmsconf>confthreshnms);
showbbox(nmsbbox(indsel,:),[1 1 0],regexp(num2str(nmsconf(indsel)'),'\d+\.\d+','match'));
title(sprintf('%d NMS detections above threshold %1.3f',size(nmsbbox,1),confthreshnms),'FontSize',14)
fprintf('press a key...'), pause, fprintf('\n')你可以在第一个链接中找到所有相关的函数。
https://stackoverflow.com/questions/15785350
复制相似问题