Commit 49e6002d authored by Davis King's avatar Davis King

Fixed hough_transform::find_pixels_voting_for_lines(). It would sometimes

include a pixel multiple times in the output lists.
parent d0fc6023
......@@ -365,7 +365,11 @@ namespace dlib
{
auto idx = hmap(hough_point.y(), hough_point.x());
if (idx < constituent_points.size())
constituent_points[idx].push_back(img_point);
{
// don't add img_point if it's already in the list.
if (constituent_points[idx].size() == 0 || constituent_points[idx].back() != img_point)
constituent_points[idx].push_back(img_point);
}
};
perform_generic_hough_transform(img, box, record_hit);
......
......@@ -240,9 +240,9 @@ namespace dlib
that if angle_window_size or radius_window_size are made so large
that HP[i] overlaps HP[j] for i!=j then the overlapping regions
of Hough space are assigned to HP[i] or HP[j] arbitrarily.
Therefore, all points in CONSTITUENT_POINTS are unique, that is,
there is no overlap in points between any two elements of
CONSTITUENT_POINTS.
That is, we treat HP[i] and HP[j] as disjoint even if their boxes
overlap. In this case, the overlapping region is assigned to
either HP[i] or HP[j] in an arbitrary manner.
!*/
template <
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment