Commit b6a50e72 authored by xolodilnik's avatar xolodilnik

HoughPoint2Line: fixed unsuccessful build

parent a02af4a1
...@@ -141,10 +141,10 @@ CV_EXPORTS_W void FastHoughTransform( InputArray src, ...@@ -141,10 +141,10 @@ CV_EXPORTS_W void FastHoughTransform( InputArray src,
* @brief Calculates coordinates of line segment corresponded by point in Hough space. * @brief Calculates coordinates of line segment corresponded by point in Hough space.
* @param houghPoint Point in Hough space. * @param houghPoint Point in Hough space.
* @param srcImgInfo The source (input) image of Hough transform. * @param srcImgInfo The source (input) image of Hough transform.
* @param line Coordinates of line segment corresponded by point in Hough space.
* @param angleRange The part of Hough space where point is situated, see cv::AngleRangeOption * @param angleRange The part of Hough space where point is situated, see cv::AngleRangeOption
* @param makeSkew Specifies to do or not to do image skewing, see cv::HoughDeskewOption * @param makeSkew Specifies to do or not to do image skewing, see cv::HoughDeskewOption
* @param rules Specifies strictness of line segment calculating, see cv::RulesOption * @param rules Specifies strictness of line segment calculating, see cv::RulesOption
* @retval [Vec4i] Coordinates of line segment corresponded by point in Hough space.
* @remarks If rules parameter set to RO_STRICT * @remarks If rules parameter set to RO_STRICT
then returned line cut along the border of source image. then returned line cut along the border of source image.
* @remarks If rules parameter set to RO_WEAK then in case of point, which belongs * @remarks If rules parameter set to RO_WEAK then in case of point, which belongs
...@@ -152,9 +152,8 @@ CV_EXPORTS_W void FastHoughTransform( InputArray src, ...@@ -152,9 +152,8 @@ CV_EXPORTS_W void FastHoughTransform( InputArray src,
* *
* The function calculates coordinates of line segment corresponded by point in Hough space. * The function calculates coordinates of line segment corresponded by point in Hough space.
*/ */
CV_EXPORTS_W void HoughPoint2Line( const Point &houghPoint, CV_EXPORTS_W Vec4i HoughPoint2Line(const Point &houghPoint,
InputArray srcImgInfo, InputArray srcImgInfo,
Vec4i &line,
int angleRange = ARO_315_135, int angleRange = ARO_315_135,
int makeSkew = HDO_DESKEW, int makeSkew = HDO_DESKEW,
int rules = RO_IGNORE_BORDERS ); int rules = RO_IGNORE_BORDERS );
......
...@@ -194,9 +194,7 @@ bool getLocalExtr(vector<Vec4i> &lines, ...@@ -194,9 +194,7 @@ bool getLocalExtr(vector<Vec4i> &lines,
for (size_t i = 0; i < weightedPoints.size(); ++i) for (size_t i = 0; i < weightedPoints.size(); ++i)
{ {
Vec4i houghLine(0, 0, 0, 0); lines.push_back(HoughPoint2Line(weightedPoints[i].second, src));
HoughPoint2Line(weightedPoints[i].second, src, houghLine);
lines.push_back(houghLine);
} }
return true; return true;
} }
......
...@@ -835,9 +835,8 @@ static void crossSegments(Point &point, ...@@ -835,9 +835,8 @@ static void crossSegments(Point &point,
point.y = cvRound(line1.u.y + mul * (line1.v.y - line1.u.y)); point.y = cvRound(line1.u.y + mul * (line1.v.y - line1.u.y));
} }
void HoughPoint2Line(const Point &houghPoint, Vec4i HoughPoint2Line(const Point &houghPoint,
InputArray srcImgInfo, InputArray srcImgInfo,
Vec4i &line,
int angleRange, int angleRange,
int makeSkew, int makeSkew,
int rules) int rules)
...@@ -907,8 +906,7 @@ void HoughPoint2Line(const Point &houghPoint, ...@@ -907,8 +906,7 @@ void HoughPoint2Line(const Point &houghPoint,
if (!ret) if (!ret)
{ {
line = Vec4i(dstLine.v.x, dstLine.v.y, dstLine.u.x, dstLine.u.y); return Vec4i(dstLine.v.x, dstLine.v.y, dstLine.u.x, dstLine.u.y);
return;
} }
if (rules & RO_IGNORE_BORDERS) if (rules & RO_IGNORE_BORDERS)
...@@ -933,8 +931,7 @@ void HoughPoint2Line(const Point &houghPoint, ...@@ -933,8 +931,7 @@ void HoughPoint2Line(const Point &houghPoint,
break; break;
} }
line = Vec4i(dstLine.v.x, dstLine.v.y, dstLine.u.x, dstLine.u.y); return Vec4i(dstLine.v.x, dstLine.v.y, dstLine.u.x, dstLine.u.y);
return;
} }
Point minIntersectPoint(0, 0); Point minIntersectPoint(0, 0);
...@@ -1020,7 +1017,7 @@ void HoughPoint2Line(const Point &houghPoint, ...@@ -1020,7 +1017,7 @@ void HoughPoint2Line(const Point &houghPoint,
break; break;
} }
line = Vec4i(dstLine.v.x, dstLine.v.y, dstLine.u.x, dstLine.u.y); return Vec4i(dstLine.v.x, dstLine.v.y, dstLine.u.x, dstLine.u.y);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -286,8 +286,7 @@ int TestFHT::validate_line(Mat const& fht, ...@@ -286,8 +286,7 @@ int TestFHT::validate_line(Mat const& fht,
{ {
Point fht_max(-1, -1); Point fht_max(-1, -1);
minMaxLoc(fht_channels[ch], 0, 0, 0, &fht_max); minMaxLoc(fht_channels[ch], 0, 0, 0, &fht_max);
Vec4i src_line; Vec4i src_line = HoughPoint2Line(fht_max, src,
HoughPoint2Line(fht_max, src, src_line,
ARO_315_135, HDO_DESKEW, RO_STRICT); ARO_315_135, HDO_DESKEW, RO_STRICT);
double const a = src_line[1] - src_line[3]; double const a = src_line[1] - src_line[3];
......
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