Commit 746af7f8 authored by Davis King's avatar Davis King

Made the hough_transform's functions for getting line coordinates use dpoint

instead of point.
parent cd8411a8
......@@ -68,12 +68,12 @@ namespace dlib
long nc(
) const { return _size; }
std::pair<point, point> get_line (
const point& p
std::pair<dpoint, dpoint> get_line (
const dpoint& p
) const
{
DLIB_ASSERT(rectangle(0,0,size()-1,size()-1).contains(p) == true,
"\t pair<point,point> hough_transform::get_line(point)"
"\t pair<dpoint,dpoint> hough_transform::get_line(dpoint)"
<< "\n\t Invalid arguments given to this function."
<< "\n\t p: " << p
<< "\n\t size(): " << size()
......@@ -90,8 +90,8 @@ namespace dlib
const dpoint cent = center(box);
dpoint v1 = cent + dpoint(size()+1000,0) + dpoint(0,radius);
dpoint v2 = cent - dpoint(size()+1000,0) + dpoint(0,radius);
point p1 = rotate_point(cent, v1, theta);
point p2 = rotate_point(cent, v2, theta);
dpoint p1 = rotate_point(cent, v1, theta);
dpoint p2 = rotate_point(cent, v2, theta);
clip_line_to_rectangle(box, p1, p2);
......@@ -99,7 +99,7 @@ namespace dlib
}
double get_line_angle_in_degrees (
const point& p
const dpoint& p
) const
{
double angle, radius;
......@@ -108,7 +108,7 @@ namespace dlib
}
void get_line_properties (
const point& p,
const dpoint& p,
double& angle_in_degrees,
double& radius
) const
......
......@@ -65,8 +65,8 @@ namespace dlib
- returns size()
!*/
std::pair<point, point> get_line (
const point& p
std::pair<dpoint, dpoint> get_line (
const dpoint& p
) const;
/*!
requires
......@@ -79,7 +79,7 @@ namespace dlib
!*/
double get_line_angle_in_degrees (
const point& p
const dpoint& p
) const;
/*!
requires
......@@ -91,7 +91,7 @@ namespace dlib
!*/
void get_line_properties (
const point& p,
const dpoint& p,
double& angle_in_degrees,
double& radius
) const;
......@@ -107,6 +107,10 @@ namespace dlib
- #radius == the distance from the center of the input image, measured in
pixels, and the line corresponding to the Hough transform point p.
Moreover: -sqrt(size()*size()/2) <= #radius <= sqrt(size()*size()/2)
- Note that the line properties are calculated to sub-pixel accuracy. That
is, p doesn't have to contain integer values, it can reference locations
between pixels and the appropriate calculation will be done to find the
corresponding line.
!*/
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