MATLAB code for non-maximum suppression
44 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I have a set of bounding boxes with score. Now I want to apply non-maximum suppression on that set for my detection task. Could you kindly give me matlab code for non-maximum suppression? Thanks in advances.
Reserveboxes=[score box] % Reserveboxes is a 5920x5 array
0 Commenti
Risposte (1)
Manuel Dominguez
il 27 Nov 2019
%% Nonmaxmimum Suppression
function imgResult = nonmaxsup2d(imgHough)
imgResult = zeros(size(imgHough));
for y = 2:size(imgHough, 1)-1
for x = 2:size(imgHough, 2)-1
offx = [1 1 0 -1 -1 -1 0 1];
offy = [0 1 1 1 0 -1 -1 -1];
val = imgHough(y, x);
is_max = true;
for i=1:8
if y == 2 && offy(i) == -1
continue
end
if y ==size(imgHough,1)-1 && offy(i) == 1
continue
end
if x ==2 && offx(i) == -1
continue
end
if x ==size(imgHough,2)-1 && offx(i) == 1
continue
end
if val < imgHough(y+offy(i), x+offx(i))
is_max = false;
break;
end
end
if is_max
imgResult(y, x) = val;
end
end
end
end
0 Commenti
Vedere anche
Categorie
Scopri di più su Computer Vision Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!