Image processing 检测窗口上的非最大抑制

Image processing 检测窗口上的非最大抑制,image-processing,object-detection,sliding-window,Image Processing,Object Detection,Sliding Window,在目标检测文献中,通常使用分类器和滑动窗口方法来检测图像中是否存在目标,该方法返回一组检测窗口,并使用非最大抑制来解决检测重叠 有人能解释一下在这些检测窗口上执行非最大值抑制的算法吗 谢谢你引用我的话 图像面片的扫描窗口样式分类通常会导致目标对象周围出现多个响应。处理这一问题的标准做法是移除具有局部最大置信度得分(非最大值抑制或NMS)的检测附近的任何检测器响应。NMS通常应用于图像中的所有检测,置信度高于某一阈值。在不同的阈值和图像中尝试NMS人脸检测: 在这里,您还可以找到一个matlab程

在目标检测文献中,通常使用分类器和滑动窗口方法来检测图像中是否存在目标,该方法返回一组检测窗口,并使用非最大抑制来解决检测重叠

有人能解释一下在这些检测窗口上执行非最大值抑制的算法吗

谢谢你引用我的话

图像面片的扫描窗口样式分类通常会导致目标对象周围出现多个响应。处理这一问题的标准做法是移除具有局部最大置信度得分(非最大值抑制或NMS)的检测附近的任何检测器响应。NMS通常应用于图像中的所有检测,置信度高于某一阈值。在不同的阈值和图像中尝试NMS人脸检测:

在这里,您还可以找到一个matlab程序,它可以执行所有操作—检测和检测窗口上的NMS

对检测窗口执行非最大抑制的代码为

%%%%%%%%%%%%%%% **************************************************************
%%%%%%%%%%%%%%% **************************************************************
%%%%%%%%%%%%%%% *                                                            *
%%%%%%%%%%%%%%% *                       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')

您可以在第一个链接中找到所有相关函数

因此,下面提供的代码没有回答您的问题?@Entropiece抱歉,由于某些原因,当人们发表评论或帖子时,我的收件箱没有更新我,但是是的,我一直在使用opencv,但我设法获得了下面matlab代码的要点,所以谢谢,我排除了答案。无需担心,希望我能帮助您!干杯感谢有用的链接。在第二个链接中,我找不到函数
pruneboxs
,您有它的代码吗?您好,我添加了它作为要点,以便您可以在这里查看谢谢!但是仍然缺少另外两个函数:
bboxoverlaval
indfree
,它们在
prunebox
中调用,我认为它们都包含在我提供的第一个链接的zip中。看看那里