vrcore  0.45
visuReal Messkern
 All Classes Files Functions Variables
ContourTools.h
1 
2 /*Platz fuer Funktionen, die sich mit Konturen befassen und stateless sind.*/
3 
4 void contour3dToCMat (cv::Mat& xy, const Vec3dVector &cont, const double offset [2]);
5 void contourMToContour3d (Vec3dVector &cont, const cv::Mat &xy, const double offset [3]);
6 /*Von 2d nach 2d.*/
7 void contourToMat (cv::Mat &xy, const Contour &contour, const double offset [2]) ;
8 /*Wuenschenswert, aber: Konvertierung des Parameters 1 von 'ContourVector' in 'std::vector<_Ty> &' nicht möglich:
9 template <typename type> int
10  cutStraightParts (std::vector< std::vector<type> > &cutContours
11  , const std::vector<type> &contour, const double cosine, const int minLength);// = 7);
12 */
13 int cutStraightParts (DoubleContourSPtrVector &cutContours
14  , const DoubleContour &contour, const double cosine, const int minLength);// = 7);
15 
16 int cutStraightParts (ContourVector &cutContours, const Contour &contour, const double cosine, const int minLength/* = 7*/);
17 int cutBackForth (ContourVector &cutContours, const Contour &contour);
24 int findLineSegmentIntersection( cv::Point2d& intersection,
25  const cv::Vec2d& paramIntervalLine,
26  const cv::Vec2d& paramIntervalSegment,
27  const cv::Vec2d& dir, const cv::Vec2d& approxPt,
28  const cv::Vec2d& firstPt, const cv::Vec2d& secondPt);
29 
30 int findContourLineIntersections( std::vector<cv::Point2d>& intersections,
31  const bool closed, const double m, const double b,const DoubleContour& contour);
34 //spaeter template<class T1 >
35 int findContourYXLineIntersections( std::vector<cv::Point2d>& intersections,
36  const bool closed, const double m, const double b,const DoubleContour& contour);
37 
41 int findLineContoursCut(std::vector<cv::Vec2d>& cuts, std::vector<int>& contIdx,
42  const cv::Vec2d& paramIntervalLine,
43  const cv::Vec2d& dir, const cv::Vec2d& approxPt,
44  const ContourDataVector& contDatas);
45 
46 void smoothContour (DoubleContour &smoothed, const DoubleContour &dblContour, const int halfGauss /* = 2 */);
47 void smoothContourVector (DoubleContourVector &smoothedContours, const DoubleContourVector &dblContours);
48 /*fast komplette kopie von smoothContour, es wird aber von ausgegangen, dass die Kontur einmal rund geht und der letzte und erste Punkt nachbarn sind.
49 Optionales Rueckgabeargument - smoothingDefect := Sum(norm(x_i,smoothed - x_i,orig)),
50 sagt aus, wie weit die Konturen beim Glaetten sich biegen u damit, wie glatt sie sind.
51 Ist aber auch von m Mass der Luecken beeinflusst.
52 Gedacht zum Speichern in Combination::criteria[COMBICRIT_SMOOTHING_DEFECT]*/
53 void smoothClosedContour (DoubleContour &smoothed, double* smoothingDefect/*=0x0*/, const DoubleContour &dblContour, const int halfGauss /*= 2*/);
54 
55 void convertContour2DoubleContour (DoubleContour &dblContour, const Contour &contour);
56 void convertContourVector2DoubleContourVector (DoubleContourVector &dblContours, const ContourVector &contours);
57 void convertContourVector2DoubleContourSPtrVector (DoubleContourSPtrVector &dblContours, const ContourVector &contours);
58 void convertContourVecVec2DoubleContourVecVec (DoubleContourVecVec &dblContoursVec, const ContourVecVec &contoursVec);
59 
60 void convertDoubleContour2Contour (Contour &contour, const DoubleContour &dblContour);
61 void convertDoubleContourVector2ContourVector (ContourVector &contours, const DoubleContourVector &dblContours);
62 void convertDoubleContourVecVec2ContourVecVec (ContourVecVec &contoursVec, const DoubleContourVecVec &dblContoursVec);
63 
64 void appendContours (ContourVector &contours, const ContourVector &toAppend);
65 void appendContours (ContourVector &contours, const ContourVecVec &toAppendVec);
66 
67 void appendContours (DoubleContourVector &dblCcontours, const DoubleContourVector &toAppend);
68 void appendContours (DoubleContourVector &dblContours, const DoubleContourVecVec &toAppendVec);
69 
70 void shiftOffs (Contour &contour, const cv::Point &offs);
71 void shiftOffs (ContourVector &contours, const cv::Point &offs);
72 
73 void shiftOffs (DoubleContour &dblContour, const DoublePoint &offs);
74 void shiftOffs (DoubleContourVector &dblContours, const DoublePoint &offs);
75 void shiftOffs (DoubleContourSPtrVector &dblContours, const DoublePoint &offs);