Borrar filtros
Borrar filtros

Non maximal suppression in object detection

4 visualizaciones (últimos 30 días)
FARHAD
FARHAD el 4 de Jul. de 2014
Comentada: Image Analyst el 4 de Jul. de 2014
Hi, what is the difference between y2 = boxes(:,4) and s = boxes(:,end) in the following nms code?
function top = nms(boxes, overlap) % top = nms_fast(boxes, overlap) % Non-maximum suppression. (FAST VERSION) % Greedily select high-scoring detections and skip detections % that are significantly covered by a previously selected % detection. % NOTE: This is adapted from Pedro Felzenszwalb's version (nms.m), % but an inner loop has been eliminated to significantly speed it % up in the case of a large number of boxes % Tomasz Malisiewicz (<mailto:tomasz@cmu.edu tomasz@cmu.edu>)
if isempty(boxes) top = []; return; end
x1 = boxes(:,1); y1 = boxes(:,2); x2 = boxes(:,3); y2 = boxes(:,4); s = boxes(:,end);
area = (x2-x1+1) .* (y2-y1+1); [vals, I] = sort(s);
pick = s*0; counter = 1; while ~isempty(I)
last = length(I);
i = I(last);
pick(counter) = i;
counter = counter + 1;
xx1 = max(x1(i), x1(I(1:last-1)));
yy1 = max(y1(i), y1(I(1:last-1)));
xx2 = min(x2(i), x2(I(1:last-1)));
yy2 = min(y2(i), y2(I(1:last-1)));
w = max(0.0, xx2-xx1+1);
h = max(0.0, yy2-yy1+1);
o = w.*h ./ area(I(1:last-1));
I([last; find(o>overlap)]) = [];
end
pick = pick(1:(counter-1)); top = boxes(pick,:);

Respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by