2019-11-29 19:33:07 +00:00
|
|
|
function F=getEdgeAngleHist(mag_img, angle_img, bins, threshold)
|
2019-11-09 13:03:08 +00:00
|
|
|
|
|
|
|
dimensions = size(angle_img);
|
|
|
|
rows = dimensions(1);
|
|
|
|
columns = dimensions(2);
|
|
|
|
|
|
|
|
vals = [];
|
|
|
|
for i = 1:rows
|
|
|
|
for j = 1:columns
|
|
|
|
if mag_img(i, j) > threshold
|
|
|
|
|
|
|
|
bin_value = angle_img(i, j) / (2 * pi);
|
2019-11-29 19:33:07 +00:00
|
|
|
bin_value = floor(bin_value * bins);
|
2019-11-09 13:03:08 +00:00
|
|
|
|
|
|
|
vals = [vals bin_value];
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-11-29 19:33:07 +00:00
|
|
|
if size(vals, 2) == 0
|
2019-11-30 17:56:27 +00:00
|
|
|
F = zeros(1, bins);
|
2019-11-29 19:33:07 +00:00
|
|
|
else
|
|
|
|
F= histogram(vals, bins, 'Normalization', 'probability').Values;
|
|
|
|
end
|
2019-11-12 16:27:04 +00:00
|
|
|
return;
|