MCPcopy Create free account
hub / github.com/creatale/node-dv / buildFeatureList

Method buildFeatureList

deps/opencv/modules/imgproc/src/generalized_hough.cpp:943–991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

941 }
942
943 void GHT_Guil_Full::buildFeatureList(const Mat& edges, const Mat& dx, const Mat& dy, vector< vector<Feature> >& features, Point2d center)
944 {
945 CV_Assert(levels > 0);
946
947 const double maxDist = sqrt((double) templSize.width * templSize.width + templSize.height * templSize.height) * maxScale;
948
949 const double alphaScale = levels / 360.0;
950
951 vector<ContourPoint> points;
952 getContourPoints(edges, dx, dy, points);
953
954 features.resize(levels + 1);
955 for_each(features.begin(), features.end(), mem_fun_ref(&vector<Feature>::clear));
956 for_each(features.begin(), features.end(), bind2nd(mem_fun_ref(&vector<Feature>::reserve), maxSize));
957
958 for (size_t i = 0; i < points.size(); ++i)
959 {
960 ContourPoint p1 = points[i];
961
962 for (size_t j = 0; j < points.size(); ++j)
963 {
964 ContourPoint p2 = points[j];
965
966 if (angleEq(p1.theta - p2.theta, xi, angleEpsilon))
967 {
968 const Point2d d = p1.pos - p2.pos;
969
970 Feature f;
971
972 f.p1 = p1;
973 f.p2 = p2;
974
975 f.alpha12 = clampAngle(fastAtan2((float)d.y, (float)d.x) - p1.theta);
976 f.d12 = norm(d);
977
978 if (f.d12 > maxDist)
979 continue;
980
981 f.r1 = p1.pos - center;
982 f.r2 = p2.pos - center;
983
984 const int n = cvRound(f.alpha12 * alphaScale);
985
986 if (features[n].size() < static_cast<size_t>(maxSize))
987 features[n].push_back(f);
988 }
989 }
990 }
991 }
992
993 void GHT_Guil_Full::getContourPoints(const Mat& edges, const Mat& dx, const Mat& dy, vector<ContourPoint>& points)
994 {

Callers

nothing calls this directly

Calls 11

sqrtFunction · 0.85
angleEqFunction · 0.85
clampAngleFunction · 0.85
fastAtan2Function · 0.85
cvRoundFunction · 0.85
normFunction · 0.50
resizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected