Commit 5dc91858 authored by Davis King's avatar Davis King

updated docs

parent f24b0816
...@@ -190,35 +190,35 @@ ensures \n\ ...@@ -190,35 +190,35 @@ ensures \n\
py::class_<hough_transform>(m, "hough_transform", class_docs) py::class_<hough_transform>(m, "hough_transform", class_docs)
.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, 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\
ensures \n\ ensures \n\
- returns the line segment in the original image space corresponding \n\ - returns the line segment in the original image space corresponding \n\
to Hough transform point p. \n\ to Hough transform point p. \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).")
/*! /*!
requires requires
- rectangle(0,0,size()-1,size()-1).contains(p) == true - rectangle(0,0,size-1,size-1).contains(p) == true
(i.e. p must be a point inside the Hough accumulator array) (i.e. p must be a point inside the Hough accumulator array)
ensures ensures
- returns the line segment in the original image space corresponding - returns the line segment in the original image space corresponding
to Hough transform point p. to Hough transform point p.
- 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, 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\
ensures \n\ ensures \n\
- returns the angle, in degrees, of the line corresponding to the Hough \n\ - returns the angle, in degrees, of the line corresponding to the Hough \n\
transform point p.") transform point p.")
/*! /*!
requires requires
- rectangle(0,0,size()-1,size()-1).contains(p) == true - rectangle(0,0,size-1,size-1).contains(p) == true
(i.e. p must be a point inside the Hough accumulator array) (i.e. p must be a point inside the Hough accumulator array)
ensures ensures
- returns the angle, in degrees, of the line corresponding to the Hough - returns the angle, in degrees, of the line corresponding to the Hough
...@@ -228,7 +228,7 @@ ensures \n\ ...@@ -228,7 +228,7 @@ ensures \n\
.def("get_line_properties", &ht_get_line_properties, py::arg("p"), .def("get_line_properties", &ht_get_line_properties, 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\
ensures \n\ ensures \n\
- Converts a point in the Hough transform space into an angle, in degrees, \n\ - Converts a point in the Hough transform space into an angle, in degrees, \n\
...@@ -237,11 +237,11 @@ ensures \n\ ...@@ -237,11 +237,11 @@ ensures \n\
transform point p. Moreover: -90 <= ANGLE_IN_DEGREES < 90. \n\ transform point p. Moreover: -90 <= ANGLE_IN_DEGREES < 90. \n\
- RADIUS == the distance from the center of the input image, measured in \n\ - RADIUS == the distance from the center of the input image, measured in \n\
pixels, and the line corresponding to the Hough transform point p. \n\ pixels, and the line corresponding to the Hough transform point p. \n\
Moreover: -sqrt(size()*size()/2) <= RADIUS <= sqrt(size()*size()/2) \n\ Moreover: -sqrt(size*size/2) <= RADIUS <= sqrt(size*size/2) \n\
- returns a tuple of (ANGLE_IN_DEGREES, RADIUS)" ) - returns a tuple of (ANGLE_IN_DEGREES, RADIUS)" )
/*! /*!
requires requires
- rectangle(0,0,size()-1,size()-1).contains(p) == true - rectangle(0,0,size-1,size-1).contains(p) == true
(i.e. p must be a point inside the Hough accumulator array) (i.e. p must be a point inside the Hough accumulator array)
ensures ensures
- Converts a point in the Hough transform space into an angle, in degrees, - Converts a point in the Hough transform space into an angle, in degrees,
...@@ -250,14 +250,14 @@ ensures \n\ ...@@ -250,14 +250,14 @@ ensures \n\
transform point p. Moreover: -90 <= ANGLE_IN_DEGREES < 90. transform point p. Moreover: -90 <= ANGLE_IN_DEGREES < 90.
- RADIUS == the distance from the center of the input image, measured in - RADIUS == the distance from the center of the input image, measured in
pixels, and the line corresponding to the Hough transform point p. pixels, and the line corresponding to the Hough transform point p.
Moreover: -sqrt(size()*size()/2) <= RADIUS <= sqrt(size()*size()/2) Moreover: -sqrt(size*size/2) <= RADIUS <= sqrt(size*size/2)
- returns a tuple of (ANGLE_IN_DEGREES, RADIUS) - returns a tuple of (ANGLE_IN_DEGREES, RADIUS)
!*/ !*/
.def("get_best_hough_point", &ht_get_best_hough_point, py::arg("p"), py::arg("himg"), .def("get_best_hough_point", &ht_get_best_hough_point, py::arg("p"), py::arg("himg"),
"requires \n\ "requires \n\
- himg has size() rows and columns. \n\ - himg has size rows and columns. \n\
- rectangle(0,0,size()-1,size()-1).contains(p) == true \n\ - rectangle(0,0,size-1,size-1).contains(p) == true \n\
ensures \n\ ensures \n\
- This function interprets himg as a Hough image and p as a point in the \n\ - This function interprets himg as a Hough image and p as a point in the \n\
original image space. Given this, it finds the maximum scoring line that \n\ original image space. Given this, it finds the maximum scoring line that \n\
...@@ -267,8 +267,8 @@ ensures \n\ ...@@ -267,8 +267,8 @@ ensures \n\
- returns a point X such that get_rect(himg).contains(X) == true") - returns a point X such that get_rect(himg).contains(X) == true")
/*! /*!
requires requires
- himg has size() rows and columns. - himg has size rows and columns.
- rectangle(0,0,size()-1,size()-1).contains(p) == true - rectangle(0,0,size-1,size-1).contains(p) == true
ensures ensures
- This function interprets himg as a Hough image and p as a point in the - This function interprets himg as a Hough image and p as a point in the
original image space. Given this, it finds the maximum scoring line that original image space. Given this, it finds the maximum scoring line that
...@@ -289,8 +289,8 @@ ensures \n\ ...@@ -289,8 +289,8 @@ ensures \n\
.def("__call__", &compute_ht<float>, py::arg("img"), py::arg("box")) .def("__call__", &compute_ht<float>, py::arg("img"), py::arg("box"))
.def("__call__", &compute_ht<double>, py::arg("img"), py::arg("box"), .def("__call__", &compute_ht<double>, py::arg("img"), py::arg("box"),
"requires \n\ "requires \n\
- box.width() == size() \n\ - box.width() == size \n\
- box.height() == size() \n\ - box.height() == size \n\
ensures \n\ ensures \n\
- Computes the Hough transform of the part of img contained within box. \n\ - Computes the Hough transform of the part of img contained within box. \n\
In particular, we do a grayscale version of the Hough transform where any \n\ In particular, we do a grayscale version of the Hough transform where any \n\
...@@ -301,7 +301,7 @@ ensures \n\ ...@@ -301,7 +301,7 @@ ensures \n\
pixels in img are 0 or 1 then this routine performs a normal Hough \n\ pixels in img are 0 or 1 then this routine performs a normal Hough \n\
transform. However, if some pixels have larger values then they will be \n\ transform. However, if some pixels have larger values then they will be \n\
weighted correspondingly more in the resulting Hough transform. \n\ weighted correspondingly more in the resulting Hough transform. \n\
- The returned hough transform image will be size() rows by size() columns. \n\ - The returned hough transform image will be size rows by size columns. \n\
- The returned image is the Hough transform of the part of img contained in \n\ - The returned image is the Hough transform of the part of img contained in \n\
box. Each point in the Hough image corresponds to a line in the input box. \n\ box. Each point in the Hough image corresponds to a line in the input box. \n\
In particular, the line for hough_image[y][x] is given by get_line(point(x,y)). \n\ In particular, the line for hough_image[y][x] is given by get_line(point(x,y)). \n\
...@@ -311,8 +311,8 @@ ensures \n\ ...@@ -311,8 +311,8 @@ ensures \n\
obtained by calling get_line_properties()." ) obtained by calling get_line_properties()." )
/*! /*!
requires requires
- box.width() == size() - box.width() == size
- box.height() == size() - box.height() == size
ensures ensures
- Computes the Hough transform of the part of img contained within box. - Computes the Hough transform of the part of img contained within box.
In particular, we do a grayscale version of the Hough transform where any In particular, we do a grayscale version of the Hough transform where any
...@@ -323,7 +323,7 @@ ensures \n\ ...@@ -323,7 +323,7 @@ ensures \n\
pixels in img are 0 or 1 then this routine performs a normal Hough pixels in img are 0 or 1 then this routine performs a normal Hough
transform. However, if some pixels have larger values then they will be transform. However, if some pixels have larger values then they will be
weighted correspondingly more in the resulting Hough transform. weighted correspondingly more in the resulting Hough transform.
- The returned hough transform image will be size() rows by size() columns. - The returned hough transform image will be size rows by size columns.
- The returned image is the Hough transform of the part of img contained in - The returned image is the Hough transform of the part of img contained in
box. Each point in the Hough image corresponds to a line in the input box. box. Each point in the Hough image corresponds to a line in the input box.
In particular, the line for hough_image[y][x] is given by get_line(point(x,y)). In particular, the line for hough_image[y][x] is given by get_line(point(x,y)).
...@@ -356,10 +356,10 @@ ensures \n\ ...@@ -356,10 +356,10 @@ ensures \n\
.def("find_pixels_voting_for_lines", &ht_find_pixels_voting_for_lines<float>, py::arg("img"), py::arg("box"), py::arg("hough_points"), py::arg("angle_window_size")=1, py::arg("radius_window_size")=1) .def("find_pixels_voting_for_lines", &ht_find_pixels_voting_for_lines<float>, py::arg("img"), py::arg("box"), py::arg("hough_points"), py::arg("angle_window_size")=1, py::arg("radius_window_size")=1)
.def("find_pixels_voting_for_lines", &ht_find_pixels_voting_for_lines<double>, py::arg("img"), py::arg("box"), py::arg("hough_points"), py::arg("angle_window_size")=1, py::arg("radius_window_size")=1, .def("find_pixels_voting_for_lines", &ht_find_pixels_voting_for_lines<double>, py::arg("img"), py::arg("box"), py::arg("hough_points"), py::arg("angle_window_size")=1, py::arg("radius_window_size")=1,
"requires \n\ "requires \n\
- box.width() == size() \n\ - box.width() == size \n\
- box.height() == size() \n\ - box.height() == size \n\
- for all valid i: \n\ - for all valid i: \n\
- rectangle(0,0,size()-1,size()-1).contains(hough_points[i]) == true \n\ - rectangle(0,0,size-1,size-1).contains(hough_points[i]) == true \n\
(i.e. hough_points must contain points in the output Hough transform \n\ (i.e. hough_points must contain points in the output Hough transform \n\
space generated by this object.) \n\ space generated by this object.) \n\
- angle_window_size >= 1 \n\ - angle_window_size >= 1 \n\
...@@ -377,7 +377,7 @@ ensures \n\ ...@@ -377,7 +377,7 @@ ensures \n\
pixels in the input image belong to those lines. \n\ pixels in the input image belong to those lines. \n\
- This routine returns a vector, CONSTITUENT_POINTS, with the following \n\ - This routine returns a vector, CONSTITUENT_POINTS, with the following \n\
properties: \n\ properties: \n\
- CONSTITUENT_POINTS.size() == hough_points.size() \n\ - CONSTITUENT_POINTS.size == hough_points.size \n\
- for all valid i: \n\ - for all valid i: \n\
- Let HP[i] = centered_rect(hough_points[i], angle_window_size, radius_window_size) \n\ - Let HP[i] = centered_rect(hough_points[i], angle_window_size, radius_window_size) \n\
- Any point in img with a non-zero value that lies on a line \n\ - Any point in img with a non-zero value that lies on a line \n\
...@@ -386,7 +386,7 @@ ensures \n\ ...@@ -386,7 +386,7 @@ ensures \n\
#CONSTITUENT_POINTS[i] will contain all the points in img that \n\ #CONSTITUENT_POINTS[i] will contain all the points in img that \n\
voted for the lines associated with the Hough accumulator bins in \n\ voted for the lines associated with the Hough accumulator bins in \n\
HP[i]. \n\ HP[i]. \n\
- #CONSTITUENT_POINTS[i].size() == the number of points in img that \n\ - #CONSTITUENT_POINTS[i].size == the number of points in img that \n\
voted for any of the lines HP[i] in Hough space. Note, however, \n\ voted for any of the lines HP[i] in Hough space. Note, however, \n\
that if angle_window_size or radius_window_size are made so large \n\ that if angle_window_size or radius_window_size are made so large \n\
that HP[i] overlaps HP[j] for i!=j then the overlapping regions \n\ that HP[i] overlaps HP[j] for i!=j then the overlapping regions \n\
...@@ -396,10 +396,10 @@ ensures \n\ ...@@ -396,10 +396,10 @@ ensures \n\
CONSTITUENT_POINTS." ) CONSTITUENT_POINTS." )
/*! /*!
requires requires
- box.width() == size() - box.width() == size
- box.height() == size() - box.height() == size
- for all valid i: - for all valid i:
- rectangle(0,0,size()-1,size()-1).contains(hough_points[i]) == true - rectangle(0,0,size-1,size-1).contains(hough_points[i]) == true
(i.e. hough_points must contain points in the output Hough transform (i.e. hough_points must contain points in the output Hough transform
space generated by this object.) space generated by this object.)
- angle_window_size >= 1 - angle_window_size >= 1
...@@ -417,7 +417,7 @@ ensures \n\ ...@@ -417,7 +417,7 @@ ensures \n\
pixels in the input image belong to those lines. pixels in the input image belong to those lines.
- This routine returns a vector, CONSTITUENT_POINTS, with the following - This routine returns a vector, CONSTITUENT_POINTS, with the following
properties: properties:
- CONSTITUENT_POINTS.size() == hough_points.size() - CONSTITUENT_POINTS.size == hough_points.size
- for all valid i: - for all valid i:
- Let HP[i] = centered_rect(hough_points[i], angle_window_size, radius_window_size) - Let HP[i] = centered_rect(hough_points[i], angle_window_size, radius_window_size)
- Any point in img with a non-zero value that lies on a line - Any point in img with a non-zero value that lies on a line
...@@ -426,7 +426,7 @@ ensures \n\ ...@@ -426,7 +426,7 @@ ensures \n\
#CONSTITUENT_POINTS[i] will contain all the points in img that #CONSTITUENT_POINTS[i] will contain all the points in img that
voted for the lines associated with the Hough accumulator bins in voted for the lines associated with the Hough accumulator bins in
HP[i]. HP[i].
- #CONSTITUENT_POINTS[i].size() == the number of points in img that - #CONSTITUENT_POINTS[i].size == the number of points in img that
voted for any of the lines HP[i] in Hough space. Note, however, voted for any of the lines HP[i] in Hough space. Note, however,
that if angle_window_size or radius_window_size are made so large 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 that HP[i] overlaps HP[j] for i!=j then the overlapping regions
......
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