Commit 92a89bce authored by Davis King's avatar Davis King

Allow point and dpoint use for hough_transform stuff.

parent 746af7f8
...@@ -40,9 +40,10 @@ numpy_image<T> py_equalize_histogram ( ...@@ -40,9 +40,10 @@ numpy_image<T> py_equalize_histogram (
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template <typename T>
line ht_get_line ( line ht_get_line (
const hough_transform& ht, const hough_transform& ht,
const point& p const dlib::vector<T,2>& p
) )
{ {
DLIB_CASSERT(get_rect(ht).contains(p)); DLIB_CASSERT(get_rect(ht).contains(p));
...@@ -50,18 +51,20 @@ line ht_get_line ( ...@@ -50,18 +51,20 @@ line ht_get_line (
return line(temp.first, temp.second); return line(temp.first, temp.second);
} }
template <typename T>
double ht_get_line_angle_in_degrees ( double ht_get_line_angle_in_degrees (
const hough_transform& ht, const hough_transform& ht,
const point& p const dlib::vector<T,2>& p
) )
{ {
DLIB_CASSERT(get_rect(ht).contains(p)); DLIB_CASSERT(get_rect(ht).contains(p));
return ht.get_line_angle_in_degrees(p); return ht.get_line_angle_in_degrees(p);
} }
template <typename T>
py::tuple ht_get_line_properties ( py::tuple ht_get_line_properties (
const hough_transform& ht, const hough_transform& ht,
const point& p const dlib::vector<T,2>& p
) )
{ {
DLIB_CASSERT(get_rect(ht).contains(p)); DLIB_CASSERT(get_rect(ht).contains(p));
...@@ -191,7 +194,8 @@ ensures \n\ ...@@ -191,7 +194,8 @@ ensures \n\
.def(py::init<unsigned long>(), doc_constr, py::arg("size_")) .def(py::init<unsigned long>(), doc_constr, py::arg("size_"))
.def_property_readonly("size", &hough_transform::size, .def_property_readonly("size", &hough_transform::size,
"returns the size of the Hough transforms generated by this object. In particular, this object creates Hough transform images that are size by size pixels in size.") "returns the size of the Hough transforms generated by this object. In particular, this object creates Hough transform images that are size by size pixels in size.")
.def("get_line", &ht_get_line, py::arg("p"), .def("get_line", &ht_get_line<long>, py::arg("p"))
.def("get_line", &ht_get_line<double>, py::arg("p"),
"requires \n\ "requires \n\
- rectangle(0,0,size-1,size-1).contains(p) == true \n\ - rectangle(0,0,size-1,size-1).contains(p) == true \n\
(i.e. p must be a point inside the Hough accumulator array) \n\ (i.e. p must be a point inside the Hough accumulator array) \n\
...@@ -209,7 +213,8 @@ ensures \n\ ...@@ -209,7 +213,8 @@ ensures \n\
- The returned points are inside rectangle(0,0,size-1,size-1). - The returned points are inside rectangle(0,0,size-1,size-1).
!*/ !*/
.def("get_line_angle_in_degrees", &ht_get_line_angle_in_degrees, py::arg("p"), .def("get_line_angle_in_degrees", &ht_get_line_angle_in_degrees<long>, py::arg("p"))
.def("get_line_angle_in_degrees", &ht_get_line_angle_in_degrees<double>, py::arg("p"),
"requires \n\ "requires \n\
- rectangle(0,0,size-1,size-1).contains(p) == true \n\ - rectangle(0,0,size-1,size-1).contains(p) == true \n\
(i.e. p must be a point inside the Hough accumulator array) \n\ (i.e. p must be a point inside the Hough accumulator array) \n\
...@@ -226,7 +231,8 @@ ensures \n\ ...@@ -226,7 +231,8 @@ ensures \n\
!*/ !*/
.def("get_line_properties", &ht_get_line_properties, py::arg("p"), .def("get_line_properties", &ht_get_line_properties<long>, py::arg("p"))
.def("get_line_properties", &ht_get_line_properties<double>, py::arg("p"),
"requires \n\ "requires \n\
- rectangle(0,0,size-1,size-1).contains(p) == true \n\ - rectangle(0,0,size-1,size-1).contains(p) == true \n\
(i.e. p must be a point inside the Hough accumulator array) \n\ (i.e. p must be a point inside the Hough accumulator array) \n\
......
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