HXLDCont.h 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. /***********************************************************
  2. * File generated by the HALCON-Compiler hcomp version 22.05
  3. * Usage: Interface to C++
  4. *
  5. * Software by: MVTec Software GmbH, www.mvtec.com
  6. ***********************************************************/
  7. #ifndef HCPP_HXLDCONT
  8. #define HCPP_HXLDCONT
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of an XLD contour object(-array).
  12. class LIntExport HXLDCont : public HXLD
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HXLDCont():HXLD() {}
  17. // Copy constructor
  18. HXLDCont(const HXLDCont& source) : HXLD(source) {}
  19. // Copy constructor
  20. HXLDCont(const HObject& object);
  21. // Create HXLDCont from object id. For copy=false takes
  22. // over management of input key. Type of key must match!
  23. explicit HXLDCont(Hkey key, bool copy=true);
  24. // Access of object tuple element
  25. const HXLDCont operator [] (Hlong index) const;
  26. // Deep copy of all data represented by this object instance
  27. HXLDCont Clone() const;
  28. /*****************************************************************************
  29. * Operator-based class constructors
  30. *****************************************************************************/
  31. // gen_contour_region_xld: Generate XLD contours from regions.
  32. explicit HXLDCont(const HRegion& Regions, const HString& Mode);
  33. // gen_contour_region_xld: Generate XLD contours from regions.
  34. explicit HXLDCont(const HRegion& Regions, const char* Mode);
  35. #ifdef _WIN32
  36. // gen_contour_region_xld: Generate XLD contours from regions.
  37. explicit HXLDCont(const HRegion& Regions, const wchar_t* Mode);
  38. #endif
  39. // gen_contour_polygon_xld: Generate an XLD contour from a polygon (given as tuples).
  40. explicit HXLDCont(const HTuple& Row, const HTuple& Col);
  41. /***************************************************************************
  42. * Operators *
  43. ***************************************************************************/
  44. // Compute the union of cotangential contours.
  45. HXLDCont UnionCotangentialContoursXld(double FitClippingLength, const HTuple& FitLength, double MaxTangAngle, double MaxDist, double MaxDistPerp, double MaxOverlap, const HString& Mode) const;
  46. // Compute the union of cotangential contours.
  47. HXLDCont UnionCotangentialContoursXld(double FitClippingLength, double FitLength, double MaxTangAngle, double MaxDist, double MaxDistPerp, double MaxOverlap, const HString& Mode) const;
  48. // Compute the union of cotangential contours.
  49. HXLDCont UnionCotangentialContoursXld(double FitClippingLength, double FitLength, double MaxTangAngle, double MaxDist, double MaxDistPerp, double MaxOverlap, const char* Mode) const;
  50. #ifdef _WIN32
  51. // Compute the union of cotangential contours.
  52. HXLDCont UnionCotangentialContoursXld(double FitClippingLength, double FitLength, double MaxTangAngle, double MaxDist, double MaxDistPerp, double MaxOverlap, const wchar_t* Mode) const;
  53. #endif
  54. // Transform a contour in polar coordinates back to Cartesian coordinates
  55. HXLDCont PolarTransContourXldInv(const HTuple& Row, const HTuple& Column, double AngleStart, double AngleEnd, const HTuple& RadiusStart, const HTuple& RadiusEnd, Hlong WidthIn, Hlong HeightIn, Hlong Width, Hlong Height) const;
  56. // Transform a contour in polar coordinates back to Cartesian coordinates
  57. HXLDCont PolarTransContourXldInv(double Row, double Column, double AngleStart, double AngleEnd, double RadiusStart, double RadiusEnd, Hlong WidthIn, Hlong HeightIn, Hlong Width, Hlong Height) const;
  58. // Transform a contour in an annular arc to polar coordinates.
  59. HXLDCont PolarTransContourXld(const HTuple& Row, const HTuple& Column, double AngleStart, double AngleEnd, const HTuple& RadiusStart, const HTuple& RadiusEnd, Hlong Width, Hlong Height) const;
  60. // Transform a contour in an annular arc to polar coordinates.
  61. HXLDCont PolarTransContourXld(double Row, double Column, double AngleStart, double AngleEnd, double RadiusStart, double RadiusEnd, Hlong Width, Hlong Height) const;
  62. // Transform a NURBS curve into an XLD contour.
  63. void GenContourNurbsXld(const HTuple& Rows, const HTuple& Cols, const HTuple& Knots, const HTuple& Weights, Hlong Degree, const HTuple& MaxError, const HTuple& MaxDistance);
  64. // Transform a NURBS curve into an XLD contour.
  65. void GenContourNurbsXld(const HTuple& Rows, const HTuple& Cols, const HString& Knots, const HString& Weights, Hlong Degree, double MaxError, double MaxDistance);
  66. // Transform a NURBS curve into an XLD contour.
  67. void GenContourNurbsXld(const HTuple& Rows, const HTuple& Cols, const char* Knots, const char* Weights, Hlong Degree, double MaxError, double MaxDistance);
  68. #ifdef _WIN32
  69. // Transform a NURBS curve into an XLD contour.
  70. void GenContourNurbsXld(const HTuple& Rows, const HTuple& Cols, const wchar_t* Knots, const wchar_t* Weights, Hlong Degree, double MaxError, double MaxDistance);
  71. #endif
  72. // Compute the union of closed contours.
  73. HXLDCont Union2ClosedContoursXld(const HXLDCont& Contours2) const;
  74. // Compute the symmetric difference of closed contours.
  75. HXLDCont SymmDifferenceClosedContoursXld(const HXLDCont& Contours2) const;
  76. // Compute the difference of closed contours.
  77. HXLDCont DifferenceClosedContoursXld(const HXLDCont& Sub) const;
  78. // Intersect closed contours.
  79. HXLDCont IntersectionClosedContoursXld(const HXLDCont& Contours2) const;
  80. // Compute the union of contours that belong to the same circle.
  81. HXLDCont UnionCocircularContoursXld(const HTuple& MaxArcAngleDiff, const HTuple& MaxArcOverlap, const HTuple& MaxTangentAngle, const HTuple& MaxDist, const HTuple& MaxRadiusDiff, const HTuple& MaxCenterDist, const HString& MergeSmallContours, Hlong Iterations) const;
  82. // Compute the union of contours that belong to the same circle.
  83. HXLDCont UnionCocircularContoursXld(double MaxArcAngleDiff, double MaxArcOverlap, double MaxTangentAngle, double MaxDist, double MaxRadiusDiff, double MaxCenterDist, const HString& MergeSmallContours, Hlong Iterations) const;
  84. // Compute the union of contours that belong to the same circle.
  85. HXLDCont UnionCocircularContoursXld(double MaxArcAngleDiff, double MaxArcOverlap, double MaxTangentAngle, double MaxDist, double MaxRadiusDiff, double MaxCenterDist, const char* MergeSmallContours, Hlong Iterations) const;
  86. #ifdef _WIN32
  87. // Compute the union of contours that belong to the same circle.
  88. HXLDCont UnionCocircularContoursXld(double MaxArcAngleDiff, double MaxArcOverlap, double MaxTangentAngle, double MaxDist, double MaxRadiusDiff, double MaxCenterDist, const wchar_t* MergeSmallContours, Hlong Iterations) const;
  89. #endif
  90. // Crop an XLD contour.
  91. HXLDCont CropContoursXld(const HTuple& Row1, const HTuple& Col1, const HTuple& Row2, const HTuple& Col2, const HString& CloseContours) const;
  92. // Crop an XLD contour.
  93. HXLDCont CropContoursXld(double Row1, double Col1, double Row2, double Col2, const HString& CloseContours) const;
  94. // Crop an XLD contour.
  95. HXLDCont CropContoursXld(double Row1, double Col1, double Row2, double Col2, const char* CloseContours) const;
  96. #ifdef _WIN32
  97. // Crop an XLD contour.
  98. HXLDCont CropContoursXld(double Row1, double Col1, double Row2, double Col2, const wchar_t* CloseContours) const;
  99. #endif
  100. // Generate one XLD contour in the shape of a cross for each input point.
  101. void GenCrossContourXld(const HTuple& Row, const HTuple& Col, const HTuple& Size, double Angle);
  102. // Generate one XLD contour in the shape of a cross for each input point.
  103. void GenCrossContourXld(double Row, double Col, double Size, double Angle);
  104. // Sort contours with respect to their relative position.
  105. HXLDCont SortContoursXld(const HString& SortMode, const HString& Order, const HString& RowOrCol) const;
  106. // Sort contours with respect to their relative position.
  107. HXLDCont SortContoursXld(const char* SortMode, const char* Order, const char* RowOrCol) const;
  108. #ifdef _WIN32
  109. // Sort contours with respect to their relative position.
  110. HXLDCont SortContoursXld(const wchar_t* SortMode, const wchar_t* Order, const wchar_t* RowOrCol) const;
  111. #endif
  112. // Merge XLD contours from successive line scan images.
  113. HXLDCont MergeContLineScanXld(const HXLDCont& PrevConts, HXLDCont* PrevMergedConts, Hlong ImageHeight, const HTuple& Margin, const HString& MergeBorder, Hlong MaxImagesCont) const;
  114. // Merge XLD contours from successive line scan images.
  115. HXLDCont MergeContLineScanXld(const HXLDCont& PrevConts, HXLDCont* PrevMergedConts, Hlong ImageHeight, double Margin, const HString& MergeBorder, Hlong MaxImagesCont) const;
  116. // Merge XLD contours from successive line scan images.
  117. HXLDCont MergeContLineScanXld(const HXLDCont& PrevConts, HXLDCont* PrevMergedConts, Hlong ImageHeight, double Margin, const char* MergeBorder, Hlong MaxImagesCont) const;
  118. #ifdef _WIN32
  119. // Merge XLD contours from successive line scan images.
  120. HXLDCont MergeContLineScanXld(const HXLDCont& PrevConts, HXLDCont* PrevMergedConts, Hlong ImageHeight, double Margin, const wchar_t* MergeBorder, Hlong MaxImagesCont) const;
  121. #endif
  122. // Read XLD contours to a file in ARC/INFO generate format.
  123. void ReadContourXldArcInfo(const HString& FileName);
  124. // Read XLD contours to a file in ARC/INFO generate format.
  125. void ReadContourXldArcInfo(const char* FileName);
  126. #ifdef _WIN32
  127. // Read XLD contours to a file in ARC/INFO generate format.
  128. void ReadContourXldArcInfo(const wchar_t* FileName);
  129. #endif
  130. // Write XLD contours to a file in ARC/INFO generate format.
  131. void WriteContourXldArcInfo(const HString& FileName) const;
  132. // Write XLD contours to a file in ARC/INFO generate format.
  133. void WriteContourXldArcInfo(const char* FileName) const;
  134. #ifdef _WIN32
  135. // Write XLD contours to a file in ARC/INFO generate format.
  136. void WriteContourXldArcInfo(const wchar_t* FileName) const;
  137. #endif
  138. // Compute the parallel contour of an XLD contour.
  139. HXLDCont GenParallelContourXld(const HString& Mode, const HTuple& Distance) const;
  140. // Compute the parallel contour of an XLD contour.
  141. HXLDCont GenParallelContourXld(const HString& Mode, double Distance) const;
  142. // Compute the parallel contour of an XLD contour.
  143. HXLDCont GenParallelContourXld(const char* Mode, double Distance) const;
  144. #ifdef _WIN32
  145. // Compute the parallel contour of an XLD contour.
  146. HXLDCont GenParallelContourXld(const wchar_t* Mode, double Distance) const;
  147. #endif
  148. // Create an XLD contour in the shape of a rectangle.
  149. void GenRectangle2ContourXld(const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2);
  150. // Create an XLD contour in the shape of a rectangle.
  151. void GenRectangle2ContourXld(double Row, double Column, double Phi, double Length1, double Length2);
  152. // Compute the distances of all contour points to a rectangle.
  153. HTuple DistRectangle2ContourPointsXld(Hlong ClippingEndPoints, double Row, double Column, double Phi, double Length1, double Length2) const;
  154. // Fit rectangles to XLD contours.
  155. void FitRectangle2ContourXld(const HString& Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, HTuple* Row, HTuple* Column, HTuple* Phi, HTuple* Length1, HTuple* Length2, HTuple* PointOrder) const;
  156. // Fit rectangles to XLD contours.
  157. void FitRectangle2ContourXld(const HString& Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, double* Row, double* Column, double* Phi, double* Length1, double* Length2, HString* PointOrder) const;
  158. // Fit rectangles to XLD contours.
  159. void FitRectangle2ContourXld(const char* Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, double* Row, double* Column, double* Phi, double* Length1, double* Length2, HString* PointOrder) const;
  160. #ifdef _WIN32
  161. // Fit rectangles to XLD contours.
  162. void FitRectangle2ContourXld(const wchar_t* Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, double* Row, double* Column, double* Phi, double* Length1, double* Length2, HString* PointOrder) const;
  163. #endif
  164. // Segment XLD contour parts whose local attributes fulfill given conditions.
  165. HXLDCont SegmentContourAttribXld(const HTuple& Attribute, const HString& Operation, const HTuple& Min, const HTuple& Max) const;
  166. // Segment XLD contour parts whose local attributes fulfill given conditions.
  167. HXLDCont SegmentContourAttribXld(const HString& Attribute, const HString& Operation, double Min, double Max) const;
  168. // Segment XLD contour parts whose local attributes fulfill given conditions.
  169. HXLDCont SegmentContourAttribXld(const char* Attribute, const char* Operation, double Min, double Max) const;
  170. #ifdef _WIN32
  171. // Segment XLD contour parts whose local attributes fulfill given conditions.
  172. HXLDCont SegmentContourAttribXld(const wchar_t* Attribute, const wchar_t* Operation, double Min, double Max) const;
  173. #endif
  174. // Segment XLD contours into line segments and circular or elliptic arcs.
  175. HXLDCont SegmentContoursXld(const HString& Mode, Hlong SmoothCont, double MaxLineDist1, double MaxLineDist2) const;
  176. // Segment XLD contours into line segments and circular or elliptic arcs.
  177. HXLDCont SegmentContoursXld(const char* Mode, Hlong SmoothCont, double MaxLineDist1, double MaxLineDist2) const;
  178. #ifdef _WIN32
  179. // Segment XLD contours into line segments and circular or elliptic arcs.
  180. HXLDCont SegmentContoursXld(const wchar_t* Mode, Hlong SmoothCont, double MaxLineDist1, double MaxLineDist2) const;
  181. #endif
  182. // Approximate XLD contours by circles.
  183. void FitCircleContourXld(const HString& Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, HTuple* Row, HTuple* Column, HTuple* Radius, HTuple* StartPhi, HTuple* EndPhi, HTuple* PointOrder) const;
  184. // Approximate XLD contours by circles.
  185. void FitCircleContourXld(const HString& Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, double* Row, double* Column, double* Radius, double* StartPhi, double* EndPhi, HString* PointOrder) const;
  186. // Approximate XLD contours by circles.
  187. void FitCircleContourXld(const char* Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, double* Row, double* Column, double* Radius, double* StartPhi, double* EndPhi, HString* PointOrder) const;
  188. #ifdef _WIN32
  189. // Approximate XLD contours by circles.
  190. void FitCircleContourXld(const wchar_t* Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, double* Row, double* Column, double* Radius, double* StartPhi, double* EndPhi, HString* PointOrder) const;
  191. #endif
  192. // Approximate XLD contours by line segments.
  193. void FitLineContourXld(const HString& Algorithm, Hlong MaxNumPoints, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, HTuple* RowBegin, HTuple* ColBegin, HTuple* RowEnd, HTuple* ColEnd, HTuple* Nr, HTuple* Nc, HTuple* Dist) const;
  194. // Approximate XLD contours by line segments.
  195. void FitLineContourXld(const HString& Algorithm, Hlong MaxNumPoints, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, double* RowBegin, double* ColBegin, double* RowEnd, double* ColEnd, double* Nr, double* Nc, double* Dist) const;
  196. // Approximate XLD contours by line segments.
  197. void FitLineContourXld(const char* Algorithm, Hlong MaxNumPoints, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, double* RowBegin, double* ColBegin, double* RowEnd, double* ColEnd, double* Nr, double* Nc, double* Dist) const;
  198. #ifdef _WIN32
  199. // Approximate XLD contours by line segments.
  200. void FitLineContourXld(const wchar_t* Algorithm, Hlong MaxNumPoints, Hlong ClippingEndPoints, Hlong Iterations, double ClippingFactor, double* RowBegin, double* ColBegin, double* RowEnd, double* ColEnd, double* Nr, double* Nc, double* Dist) const;
  201. #endif
  202. // Compute the distances of all contour points to an ellipse.
  203. HTuple DistEllipseContourPointsXld(const HString& DistanceMode, Hlong ClippingEndPoints, double Row, double Column, double Phi, double Radius1, double Radius2) const;
  204. // Compute the distances of all contour points to an ellipse.
  205. HTuple DistEllipseContourPointsXld(const char* DistanceMode, Hlong ClippingEndPoints, double Row, double Column, double Phi, double Radius1, double Radius2) const;
  206. #ifdef _WIN32
  207. // Compute the distances of all contour points to an ellipse.
  208. HTuple DistEllipseContourPointsXld(const wchar_t* DistanceMode, Hlong ClippingEndPoints, double Row, double Column, double Phi, double Radius1, double Radius2) const;
  209. #endif
  210. // Compute the distance of contours to an ellipse.
  211. void DistEllipseContourXld(const HString& Mode, Hlong MaxNumPoints, Hlong ClippingEndPoints, double Row, double Column, double Phi, double Radius1, double Radius2, HTuple* MinDist, HTuple* MaxDist, HTuple* AvgDist, HTuple* SigmaDist) const;
  212. // Compute the distance of contours to an ellipse.
  213. void DistEllipseContourXld(const HString& Mode, Hlong MaxNumPoints, Hlong ClippingEndPoints, double Row, double Column, double Phi, double Radius1, double Radius2, double* MinDist, double* MaxDist, double* AvgDist, double* SigmaDist) const;
  214. // Compute the distance of contours to an ellipse.
  215. void DistEllipseContourXld(const char* Mode, Hlong MaxNumPoints, Hlong ClippingEndPoints, double Row, double Column, double Phi, double Radius1, double Radius2, double* MinDist, double* MaxDist, double* AvgDist, double* SigmaDist) const;
  216. #ifdef _WIN32
  217. // Compute the distance of contours to an ellipse.
  218. void DistEllipseContourXld(const wchar_t* Mode, Hlong MaxNumPoints, Hlong ClippingEndPoints, double Row, double Column, double Phi, double Radius1, double Radius2, double* MinDist, double* MaxDist, double* AvgDist, double* SigmaDist) const;
  219. #endif
  220. // Approximate XLD contours by ellipses or elliptic arcs.
  221. void FitEllipseContourXld(const HString& Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong VossTabSize, Hlong Iterations, double ClippingFactor, HTuple* Row, HTuple* Column, HTuple* Phi, HTuple* Radius1, HTuple* Radius2, HTuple* StartPhi, HTuple* EndPhi, HTuple* PointOrder) const;
  222. // Approximate XLD contours by ellipses or elliptic arcs.
  223. void FitEllipseContourXld(const HString& Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong VossTabSize, Hlong Iterations, double ClippingFactor, double* Row, double* Column, double* Phi, double* Radius1, double* Radius2, double* StartPhi, double* EndPhi, HString* PointOrder) const;
  224. // Approximate XLD contours by ellipses or elliptic arcs.
  225. void FitEllipseContourXld(const char* Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong VossTabSize, Hlong Iterations, double ClippingFactor, double* Row, double* Column, double* Phi, double* Radius1, double* Radius2, double* StartPhi, double* EndPhi, HString* PointOrder) const;
  226. #ifdef _WIN32
  227. // Approximate XLD contours by ellipses or elliptic arcs.
  228. void FitEllipseContourXld(const wchar_t* Algorithm, Hlong MaxNumPoints, double MaxClosureDist, Hlong ClippingEndPoints, Hlong VossTabSize, Hlong Iterations, double ClippingFactor, double* Row, double* Column, double* Phi, double* Radius1, double* Radius2, double* StartPhi, double* EndPhi, HString* PointOrder) const;
  229. #endif
  230. // Create XLD contours corresponding to circles or circular arcs.
  231. void GenCircleContourXld(const HTuple& Row, const HTuple& Column, const HTuple& Radius, const HTuple& StartPhi, const HTuple& EndPhi, const HTuple& PointOrder, double Resolution);
  232. // Create XLD contours corresponding to circles or circular arcs.
  233. void GenCircleContourXld(double Row, double Column, double Radius, double StartPhi, double EndPhi, const HString& PointOrder, double Resolution);
  234. // Create XLD contours corresponding to circles or circular arcs.
  235. void GenCircleContourXld(double Row, double Column, double Radius, double StartPhi, double EndPhi, const char* PointOrder, double Resolution);
  236. #ifdef _WIN32
  237. // Create XLD contours corresponding to circles or circular arcs.
  238. void GenCircleContourXld(double Row, double Column, double Radius, double StartPhi, double EndPhi, const wchar_t* PointOrder, double Resolution);
  239. #endif
  240. // Create an XLD contour that corresponds to an elliptic arc.
  241. void GenEllipseContourXld(const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Radius1, const HTuple& Radius2, const HTuple& StartPhi, const HTuple& EndPhi, const HTuple& PointOrder, double Resolution);
  242. // Create an XLD contour that corresponds to an elliptic arc.
  243. void GenEllipseContourXld(double Row, double Column, double Phi, double Radius1, double Radius2, double StartPhi, double EndPhi, const HString& PointOrder, double Resolution);
  244. // Create an XLD contour that corresponds to an elliptic arc.
  245. void GenEllipseContourXld(double Row, double Column, double Phi, double Radius1, double Radius2, double StartPhi, double EndPhi, const char* PointOrder, double Resolution);
  246. #ifdef _WIN32
  247. // Create an XLD contour that corresponds to an elliptic arc.
  248. void GenEllipseContourXld(double Row, double Column, double Phi, double Radius1, double Radius2, double StartPhi, double EndPhi, const wchar_t* PointOrder, double Resolution);
  249. #endif
  250. // Add noise to XLD contours.
  251. HXLDCont AddNoiseWhiteContourXld(Hlong NumRegrPoints, double Amp) const;
  252. // Approximate XLD contours by polygons.
  253. HXLDPoly GenPolygonsXld(const HString& Type, const HTuple& Alpha) const;
  254. // Approximate XLD contours by polygons.
  255. HXLDPoly GenPolygonsXld(const HString& Type, double Alpha) const;
  256. // Approximate XLD contours by polygons.
  257. HXLDPoly GenPolygonsXld(const char* Type, double Alpha) const;
  258. #ifdef _WIN32
  259. // Approximate XLD contours by polygons.
  260. HXLDPoly GenPolygonsXld(const wchar_t* Type, double Alpha) const;
  261. #endif
  262. // Apply a projective transformation to an XLD contour.
  263. HXLDCont ProjectiveTransContourXld(const HHomMat2D& HomMat2D) const;
  264. // Apply an arbitrary affine 2D transformation to XLD contours.
  265. HXLDCont AffineTransContourXld(const HHomMat2D& HomMat2D) const;
  266. // Close an XLD contour.
  267. HXLDCont CloseContoursXld() const;
  268. // Clip the end points of an XLD contour.
  269. HXLDCont ClipEndPointsContoursXld(const HString& Mode, const HTuple& Length) const;
  270. // Clip the end points of an XLD contour.
  271. HXLDCont ClipEndPointsContoursXld(const HString& Mode, double Length) const;
  272. // Clip the end points of an XLD contour.
  273. HXLDCont ClipEndPointsContoursXld(const char* Mode, double Length) const;
  274. #ifdef _WIN32
  275. // Clip the end points of an XLD contour.
  276. HXLDCont ClipEndPointsContoursXld(const wchar_t* Mode, double Length) const;
  277. #endif
  278. // Clip an XLD contour.
  279. HXLDCont ClipContoursXld(Hlong Row1, Hlong Column1, Hlong Row2, Hlong Column2) const;
  280. // Select XLD contours with a local maximum of gray values.
  281. HXLDCont LocalMaxContoursXld(const HImage& Image, const HTuple& MinPercent, Hlong MinDiff, Hlong Distance) const;
  282. // Select XLD contours with a local maximum of gray values.
  283. HXLDCont LocalMaxContoursXld(const HImage& Image, Hlong MinPercent, Hlong MinDiff, Hlong Distance) const;
  284. // Compute the union of neighboring straight contours that have a similar distance from a given line.
  285. HXLDCont UnionStraightContoursHistoXld(HXLDCont* SelectedContours, Hlong RefLineStartRow, Hlong RefLineStartColumn, Hlong RefLineEndRow, Hlong RefLineEndColumn, Hlong Width, Hlong MaxWidth, Hlong FilterSize, HTuple* HistoValues) const;
  286. // Compute the union of neighboring straight contours that have a similar direction.
  287. HXLDCont UnionStraightContoursXld(double MaxDist, double MaxDiff, double Percent, const HString& Mode, const HTuple& Iterations) const;
  288. // Compute the union of neighboring straight contours that have a similar direction.
  289. HXLDCont UnionStraightContoursXld(double MaxDist, double MaxDiff, double Percent, const HString& Mode, const HString& Iterations) const;
  290. // Compute the union of neighboring straight contours that have a similar direction.
  291. HXLDCont UnionStraightContoursXld(double MaxDist, double MaxDiff, double Percent, const char* Mode, const char* Iterations) const;
  292. #ifdef _WIN32
  293. // Compute the union of neighboring straight contours that have a similar direction.
  294. HXLDCont UnionStraightContoursXld(double MaxDist, double MaxDiff, double Percent, const wchar_t* Mode, const wchar_t* Iterations) const;
  295. #endif
  296. // Compute the union of collinear contours (operator with extended functionality).
  297. HXLDCont UnionCollinearContoursExtXld(double MaxDistAbs, double MaxDistRel, double MaxShift, double MaxAngle, double MaxOverlap, double MaxRegrError, double MaxCosts, double WeightDist, double WeightShift, double WeightAngle, double WeightLink, double WeightRegr, const HString& Mode) const;
  298. // Compute the union of collinear contours (operator with extended functionality).
  299. HXLDCont UnionCollinearContoursExtXld(double MaxDistAbs, double MaxDistRel, double MaxShift, double MaxAngle, double MaxOverlap, double MaxRegrError, double MaxCosts, double WeightDist, double WeightShift, double WeightAngle, double WeightLink, double WeightRegr, const char* Mode) const;
  300. #ifdef _WIN32
  301. // Compute the union of collinear contours (operator with extended functionality).
  302. HXLDCont UnionCollinearContoursExtXld(double MaxDistAbs, double MaxDistRel, double MaxShift, double MaxAngle, double MaxOverlap, double MaxRegrError, double MaxCosts, double WeightDist, double WeightShift, double WeightAngle, double WeightLink, double WeightRegr, const wchar_t* Mode) const;
  303. #endif
  304. // Unite approximately collinear contours.
  305. HXLDCont UnionCollinearContoursXld(double MaxDistAbs, double MaxDistRel, double MaxShift, double MaxAngle, const HString& Mode) const;
  306. // Unite approximately collinear contours.
  307. HXLDCont UnionCollinearContoursXld(double MaxDistAbs, double MaxDistRel, double MaxShift, double MaxAngle, const char* Mode) const;
  308. #ifdef _WIN32
  309. // Unite approximately collinear contours.
  310. HXLDCont UnionCollinearContoursXld(double MaxDistAbs, double MaxDistRel, double MaxShift, double MaxAngle, const wchar_t* Mode) const;
  311. #endif
  312. // Compute the union of contours whose end points are close together.
  313. HXLDCont UnionAdjacentContoursXld(double MaxDistAbs, double MaxDistRel, const HString& Mode) const;
  314. // Compute the union of contours whose end points are close together.
  315. HXLDCont UnionAdjacentContoursXld(double MaxDistAbs, double MaxDistRel, const char* Mode) const;
  316. #ifdef _WIN32
  317. // Compute the union of contours whose end points are close together.
  318. HXLDCont UnionAdjacentContoursXld(double MaxDistAbs, double MaxDistRel, const wchar_t* Mode) const;
  319. #endif
  320. // Select XLD contours according to several features.
  321. HXLDCont SelectContoursXld(const HString& Feature, double Min1, double Max1, double Min2, double Max2) const;
  322. // Select XLD contours according to several features.
  323. HXLDCont SelectContoursXld(const char* Feature, double Min1, double Max1, double Min2, double Max2) const;
  324. #ifdef _WIN32
  325. // Select XLD contours according to several features.
  326. HXLDCont SelectContoursXld(const wchar_t* Feature, double Min1, double Max1, double Min2, double Max2) const;
  327. #endif
  328. // Return XLD contour parameters.
  329. HTuple GetRegressParamsXld(HTuple* Nx, HTuple* Ny, HTuple* Dist, HTuple* Fpx, HTuple* Fpy, HTuple* Lpx, HTuple* Lpy, HTuple* Mean, HTuple* Deviation) const;
  330. // Calculate the parameters of a regression line to an XLD contour.
  331. HXLDCont RegressContoursXld(const HString& Mode, Hlong Iterations) const;
  332. // Calculate the parameters of a regression line to an XLD contour.
  333. HXLDCont RegressContoursXld(const char* Mode, Hlong Iterations) const;
  334. #ifdef _WIN32
  335. // Calculate the parameters of a regression line to an XLD contour.
  336. HXLDCont RegressContoursXld(const wchar_t* Mode, Hlong Iterations) const;
  337. #endif
  338. // Calculate the direction of an XLD contour for each contour point.
  339. HTuple GetContourAngleXld(const HString& AngleMode, const HString& CalcMode, Hlong Lookaround) const;
  340. // Calculate the direction of an XLD contour for each contour point.
  341. HTuple GetContourAngleXld(const char* AngleMode, const char* CalcMode, Hlong Lookaround) const;
  342. #ifdef _WIN32
  343. // Calculate the direction of an XLD contour for each contour point.
  344. HTuple GetContourAngleXld(const wchar_t* AngleMode, const wchar_t* CalcMode, Hlong Lookaround) const;
  345. #endif
  346. // Smooth an XLD contour.
  347. HXLDCont SmoothContoursXld(Hlong NumRegrPoints) const;
  348. // Return the number of points in an XLD contour.
  349. HTuple ContourPointNumXld() const;
  350. // Return the names of the defined global attributes of an XLD contour.
  351. HTuple QueryContourGlobalAttribsXld() const;
  352. // Return global attributes values of an XLD contour.
  353. HTuple GetContourGlobalAttribXld(const HTuple& Name) const;
  354. // Return global attributes values of an XLD contour.
  355. HTuple GetContourGlobalAttribXld(const HString& Name) const;
  356. // Return global attributes values of an XLD contour.
  357. HTuple GetContourGlobalAttribXld(const char* Name) const;
  358. #ifdef _WIN32
  359. // Return global attributes values of an XLD contour.
  360. HTuple GetContourGlobalAttribXld(const wchar_t* Name) const;
  361. #endif
  362. // Return the names of the defined attributes of an XLD contour.
  363. HTuple QueryContourAttribsXld() const;
  364. // Return point attribute values of an XLD contour.
  365. HTuple GetContourAttribXld(const HString& Name) const;
  366. // Return point attribute values of an XLD contour.
  367. HTuple GetContourAttribXld(const char* Name) const;
  368. #ifdef _WIN32
  369. // Return point attribute values of an XLD contour.
  370. HTuple GetContourAttribXld(const wchar_t* Name) const;
  371. #endif
  372. // Return the coordinates of an XLD contour.
  373. void GetContourXld(HTuple* Row, HTuple* Col) const;
  374. // Generate an XLD contour with rounded corners from a polygon (given as tuples).
  375. void GenContourPolygonRoundedXld(const HTuple& Row, const HTuple& Col, const HTuple& Radius, const HTuple& SamplingInterval);
  376. // Generate an XLD contour with rounded corners from a polygon (given as tuples).
  377. void GenContourPolygonRoundedXld(const HTuple& Row, const HTuple& Col, const HTuple& Radius, double SamplingInterval);
  378. // Generate an XLD contour from a polygon (given as tuples).
  379. void GenContourPolygonXld(const HTuple& Row, const HTuple& Col);
  380. // Calculate the difference of two object tuples.
  381. HXLDCont ObjDiff(const HXLDCont& ObjectsSub) const;
  382. // Copy an iconic object in the HALCON database.
  383. HXLDCont CopyObj(Hlong Index, Hlong NumObj) const;
  384. // Concatenate two iconic object tuples.
  385. HXLDCont ConcatObj(const HXLDCont& Objects2) const;
  386. // Select objects from an object tuple.
  387. HXLDCont SelectObj(const HTuple& Index) const;
  388. // Select objects from an object tuple.
  389. HXLDCont SelectObj(Hlong Index) const;
  390. // Compare iconic objects regarding equality.
  391. Hlong CompareObj(const HXLDCont& Objects2, const HTuple& Epsilon) const;
  392. // Compare iconic objects regarding equality.
  393. Hlong CompareObj(const HXLDCont& Objects2, double Epsilon) const;
  394. // Compare image objects regarding equality.
  395. Hlong TestEqualObj(const HXLDCont& Objects2) const;
  396. // Create a region from an XLD contour.
  397. HRegion GenRegionContourXld(const HString& Mode) const;
  398. // Create a region from an XLD contour.
  399. HRegion GenRegionContourXld(const char* Mode) const;
  400. #ifdef _WIN32
  401. // Create a region from an XLD contour.
  402. HRegion GenRegionContourXld(const wchar_t* Mode) const;
  403. #endif
  404. // Prepare an anisotropically scaled shape model for matching from XLD contours.
  405. HShapeModel CreateAnisoShapeModelXld(const HTuple& NumLevels, double AngleStart, double AngleExtent, const HTuple& AngleStep, double ScaleRMin, double ScaleRMax, const HTuple& ScaleRStep, double ScaleCMin, double ScaleCMax, const HTuple& ScaleCStep, const HTuple& Optimization, const HString& Metric, Hlong MinContrast) const;
  406. // Prepare an anisotropically scaled shape model for matching from XLD contours.
  407. HShapeModel CreateAnisoShapeModelXld(Hlong NumLevels, double AngleStart, double AngleExtent, double AngleStep, double ScaleRMin, double ScaleRMax, double ScaleRStep, double ScaleCMin, double ScaleCMax, double ScaleCStep, const HString& Optimization, const HString& Metric, Hlong MinContrast) const;
  408. // Prepare an anisotropically scaled shape model for matching from XLD contours.
  409. HShapeModel CreateAnisoShapeModelXld(Hlong NumLevels, double AngleStart, double AngleExtent, double AngleStep, double ScaleRMin, double ScaleRMax, double ScaleRStep, double ScaleCMin, double ScaleCMax, double ScaleCStep, const char* Optimization, const char* Metric, Hlong MinContrast) const;
  410. #ifdef _WIN32
  411. // Prepare an anisotropically scaled shape model for matching from XLD contours.
  412. HShapeModel CreateAnisoShapeModelXld(Hlong NumLevels, double AngleStart, double AngleExtent, double AngleStep, double ScaleRMin, double ScaleRMax, double ScaleRStep, double ScaleCMin, double ScaleCMax, double ScaleCStep, const wchar_t* Optimization, const wchar_t* Metric, Hlong MinContrast) const;
  413. #endif
  414. // Prepare an isotropically scaled shape model for matching from XLD contours.
  415. HShapeModel CreateScaledShapeModelXld(const HTuple& NumLevels, double AngleStart, double AngleExtent, const HTuple& AngleStep, double ScaleMin, double ScaleMax, const HTuple& ScaleStep, const HTuple& Optimization, const HString& Metric, Hlong MinContrast) const;
  416. // Prepare an isotropically scaled shape model for matching from XLD contours.
  417. HShapeModel CreateScaledShapeModelXld(Hlong NumLevels, double AngleStart, double AngleExtent, double AngleStep, double ScaleMin, double ScaleMax, double ScaleStep, const HString& Optimization, const HString& Metric, Hlong MinContrast) const;
  418. // Prepare an isotropically scaled shape model for matching from XLD contours.
  419. HShapeModel CreateScaledShapeModelXld(Hlong NumLevels, double AngleStart, double AngleExtent, double AngleStep, double ScaleMin, double ScaleMax, double ScaleStep, const char* Optimization, const char* Metric, Hlong MinContrast) const;
  420. #ifdef _WIN32
  421. // Prepare an isotropically scaled shape model for matching from XLD contours.
  422. HShapeModel CreateScaledShapeModelXld(Hlong NumLevels, double AngleStart, double AngleExtent, double AngleStep, double ScaleMin, double ScaleMax, double ScaleStep, const wchar_t* Optimization, const wchar_t* Metric, Hlong MinContrast) const;
  423. #endif
  424. // Prepare a shape model for matching from XLD contours.
  425. HShapeModel CreateShapeModelXld(const HTuple& NumLevels, double AngleStart, double AngleExtent, const HTuple& AngleStep, const HTuple& Optimization, const HString& Metric, Hlong MinContrast) const;
  426. // Prepare a shape model for matching from XLD contours.
  427. HShapeModel CreateShapeModelXld(Hlong NumLevels, double AngleStart, double AngleExtent, double AngleStep, const HString& Optimization, const HString& Metric, Hlong MinContrast) const;
  428. // Prepare a shape model for matching from XLD contours.
  429. HShapeModel CreateShapeModelXld(Hlong NumLevels, double AngleStart, double AngleExtent, double AngleStep, const char* Optimization, const char* Metric, Hlong MinContrast) const;
  430. #ifdef _WIN32
  431. // Prepare a shape model for matching from XLD contours.
  432. HShapeModel CreateShapeModelXld(Hlong NumLevels, double AngleStart, double AngleExtent, double AngleStep, const wchar_t* Optimization, const wchar_t* Metric, Hlong MinContrast) const;
  433. #endif
  434. // Prepare a deformable model for local deformable matching from XLD contours.
  435. HDeformableModel CreateLocalDeformableModelXld(const HTuple& NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AngleStep, double ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, const HTuple& ScaleCStep, const HTuple& Optimization, const HString& Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  436. // Prepare a deformable model for local deformable matching from XLD contours.
  437. HDeformableModel CreateLocalDeformableModelXld(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const HString& Optimization, const HString& Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  438. // Prepare a deformable model for local deformable matching from XLD contours.
  439. HDeformableModel CreateLocalDeformableModelXld(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const char* Optimization, const char* Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  440. #ifdef _WIN32
  441. // Prepare a deformable model for local deformable matching from XLD contours.
  442. HDeformableModel CreateLocalDeformableModelXld(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const wchar_t* Optimization, const wchar_t* Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  443. #endif
  444. // Prepare a deformable model for planar calibrated matching from XLD contours.
  445. HDeformableModel CreatePlanarCalibDeformableModelXld(const HCamPar& CamParam, const HPose& ReferencePose, const HTuple& NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AngleStep, double ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, const HTuple& ScaleCStep, const HTuple& Optimization, const HString& Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  446. // Prepare a deformable model for planar calibrated matching from XLD contours.
  447. HDeformableModel CreatePlanarCalibDeformableModelXld(const HCamPar& CamParam, const HPose& ReferencePose, Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const HString& Optimization, const HString& Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  448. // Prepare a deformable model for planar calibrated matching from XLD contours.
  449. HDeformableModel CreatePlanarCalibDeformableModelXld(const HCamPar& CamParam, const HPose& ReferencePose, Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const char* Optimization, const char* Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  450. #ifdef _WIN32
  451. // Prepare a deformable model for planar calibrated matching from XLD contours.
  452. HDeformableModel CreatePlanarCalibDeformableModelXld(const HCamPar& CamParam, const HPose& ReferencePose, Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const wchar_t* Optimization, const wchar_t* Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  453. #endif
  454. // Prepare a deformable model for planar uncalibrated matching from XLD contours.
  455. HDeformableModel CreatePlanarUncalibDeformableModelXld(const HTuple& NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AngleStep, double ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, const HTuple& ScaleCStep, const HTuple& Optimization, const HString& Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  456. // Prepare a deformable model for planar uncalibrated matching from XLD contours.
  457. HDeformableModel CreatePlanarUncalibDeformableModelXld(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const HString& Optimization, const HString& Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  458. // Prepare a deformable model for planar uncalibrated matching from XLD contours.
  459. HDeformableModel CreatePlanarUncalibDeformableModelXld(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const char* Optimization, const char* Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  460. #ifdef _WIN32
  461. // Prepare a deformable model for planar uncalibrated matching from XLD contours.
  462. HDeformableModel CreatePlanarUncalibDeformableModelXld(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const wchar_t* Optimization, const wchar_t* Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  463. #endif
  464. // Compute the mapping between the distorted image and the rectified image based upon the points of a regular grid.
  465. HImage GenGridRectificationMap(const HImage& Image, HXLDCont* Meshes, Hlong GridSpacing, const HTuple& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const;
  466. // Compute the mapping between the distorted image and the rectified image based upon the points of a regular grid.
  467. HImage GenGridRectificationMap(const HImage& Image, HXLDCont* Meshes, Hlong GridSpacing, const HString& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const;
  468. // Compute the mapping between the distorted image and the rectified image based upon the points of a regular grid.
  469. HImage GenGridRectificationMap(const HImage& Image, HXLDCont* Meshes, Hlong GridSpacing, const char* Rotation, const HTuple& Row, const HTuple& Column, const char* MapType) const;
  470. #ifdef _WIN32
  471. // Compute the mapping between the distorted image and the rectified image based upon the points of a regular grid.
  472. HImage GenGridRectificationMap(const HImage& Image, HXLDCont* Meshes, Hlong GridSpacing, const wchar_t* Rotation, const HTuple& Row, const HTuple& Column, const wchar_t* MapType) const;
  473. #endif
  474. // Interactive modification of a NURBS curve using interpolation.
  475. void DrawNurbsInterpMod(const HWindow& WindowHandle, const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, const HString& Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& TangentsIn, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents);
  476. // Interactive modification of a NURBS curve using interpolation.
  477. void DrawNurbsInterpMod(const HWindow& WindowHandle, const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, const char* Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& TangentsIn, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents);
  478. #ifdef _WIN32
  479. // Interactive modification of a NURBS curve using interpolation.
  480. void DrawNurbsInterpMod(const HWindow& WindowHandle, const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, const wchar_t* Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& TangentsIn, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents);
  481. #endif
  482. // Interactive drawing of a NURBS curve using interpolation.
  483. void DrawNurbsInterp(const HWindow& WindowHandle, const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, Hlong Degree, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents);
  484. // Interactive drawing of a NURBS curve using interpolation.
  485. void DrawNurbsInterp(const HWindow& WindowHandle, const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, Hlong Degree, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents);
  486. #ifdef _WIN32
  487. // Interactive drawing of a NURBS curve using interpolation.
  488. void DrawNurbsInterp(const HWindow& WindowHandle, const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, Hlong Degree, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents);
  489. #endif
  490. // Interactive modification of a NURBS curve.
  491. void DrawNurbsMod(const HWindow& WindowHandle, const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, const HString& Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& WeightsIn, HTuple* Rows, HTuple* Cols, HTuple* Weights);
  492. // Interactive modification of a NURBS curve.
  493. void DrawNurbsMod(const HWindow& WindowHandle, const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, const char* Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& WeightsIn, HTuple* Rows, HTuple* Cols, HTuple* Weights);
  494. #ifdef _WIN32
  495. // Interactive modification of a NURBS curve.
  496. void DrawNurbsMod(const HWindow& WindowHandle, const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, const wchar_t* Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& WeightsIn, HTuple* Rows, HTuple* Cols, HTuple* Weights);
  497. #endif
  498. // Interactive drawing of a NURBS curve.
  499. void DrawNurbs(const HWindow& WindowHandle, const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights);
  500. // Interactive drawing of a NURBS curve.
  501. void DrawNurbs(const HWindow& WindowHandle, const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights);
  502. #ifdef _WIN32
  503. // Interactive drawing of a NURBS curve.
  504. void DrawNurbs(const HWindow& WindowHandle, const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights);
  505. #endif
  506. // Interactive modification of a contour.
  507. HXLDCont DrawXldMod(const HWindow& WindowHandle, const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, const HString& Edit) const;
  508. // Interactive modification of a contour.
  509. HXLDCont DrawXldMod(const HWindow& WindowHandle, const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, const char* Edit) const;
  510. #ifdef _WIN32
  511. // Interactive modification of a contour.
  512. HXLDCont DrawXldMod(const HWindow& WindowHandle, const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, const wchar_t* Edit) const;
  513. #endif
  514. // Interactive drawing of a contour.
  515. void DrawXld(const HWindow& WindowHandle, const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio);
  516. // Interactive drawing of a contour.
  517. void DrawXld(const HWindow& WindowHandle, const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio);
  518. #ifdef _WIN32
  519. // Interactive drawing of a contour.
  520. void DrawXld(const HWindow& WindowHandle, const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio);
  521. #endif
  522. // Calculate the pointwise distance from one contour to another.
  523. HXLDCont DistanceContoursXld(const HXLDCont& ContourTo, const HString& Mode) const;
  524. // Calculate the pointwise distance from one contour to another.
  525. HXLDCont DistanceContoursXld(const HXLDCont& ContourTo, const char* Mode) const;
  526. #ifdef _WIN32
  527. // Calculate the pointwise distance from one contour to another.
  528. HXLDCont DistanceContoursXld(const HXLDCont& ContourTo, const wchar_t* Mode) const;
  529. #endif
  530. // Calculate the minimum distance between two contours.
  531. HTuple DistanceCcMin(const HXLDCont& Contour2, const HString& Mode) const;
  532. // Calculate the minimum distance between two contours.
  533. HTuple DistanceCcMin(const HXLDCont& Contour2, const char* Mode) const;
  534. #ifdef _WIN32
  535. // Calculate the minimum distance between two contours.
  536. HTuple DistanceCcMin(const HXLDCont& Contour2, const wchar_t* Mode) const;
  537. #endif
  538. // Calculate the distance between two contours.
  539. void DistanceCc(const HXLDCont& Contour2, const HString& Mode, HTuple* DistanceMin, HTuple* DistanceMax) const;
  540. // Calculate the distance between two contours.
  541. void DistanceCc(const HXLDCont& Contour2, const HString& Mode, double* DistanceMin, double* DistanceMax) const;
  542. // Calculate the distance between two contours.
  543. void DistanceCc(const HXLDCont& Contour2, const char* Mode, double* DistanceMin, double* DistanceMax) const;
  544. #ifdef _WIN32
  545. // Calculate the distance between two contours.
  546. void DistanceCc(const HXLDCont& Contour2, const wchar_t* Mode, double* DistanceMin, double* DistanceMax) const;
  547. #endif
  548. // Calculate the distance between a line segment and one contour.
  549. void DistanceSc(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DistanceMin, HTuple* DistanceMax) const;
  550. // Calculate the distance between a line segment and one contour.
  551. void DistanceSc(double Row1, double Column1, double Row2, double Column2, double* DistanceMin, double* DistanceMax) const;
  552. // Calculate the distance between a line and one contour.
  553. void DistanceLc(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DistanceMin, HTuple* DistanceMax) const;
  554. // Calculate the distance between a line and one contour.
  555. void DistanceLc(double Row1, double Column1, double Row2, double Column2, double* DistanceMin, double* DistanceMax) const;
  556. // Calculate the distance between a point and one contour.
  557. void DistancePc(const HTuple& Row, const HTuple& Column, HTuple* DistanceMin, HTuple* DistanceMax) const;
  558. // Calculate the distance between a point and one contour.
  559. void DistancePc(double Row, double Column, double* DistanceMin, double* DistanceMax) const;
  560. // Deserialize a serialized XLD object.
  561. void DeserializeXld(const HSerializedItem& SerializedItemHandle);
  562. // Serialize an XLD object.
  563. HSerializedItem SerializeXld() const;
  564. // Read XLD contours from a DXF file.
  565. HTuple ReadContourXldDxf(const HString& FileName, const HTuple& GenParamName, const HTuple& GenParamValue);
  566. // Read XLD contours from a DXF file.
  567. HString ReadContourXldDxf(const HString& FileName, const HString& GenParamName, double GenParamValue);
  568. // Read XLD contours from a DXF file.
  569. HString ReadContourXldDxf(const char* FileName, const char* GenParamName, double GenParamValue);
  570. #ifdef _WIN32
  571. // Read XLD contours from a DXF file.
  572. HString ReadContourXldDxf(const wchar_t* FileName, const wchar_t* GenParamName, double GenParamValue);
  573. #endif
  574. // Write XLD contours to a file in DXF format.
  575. void WriteContourXldDxf(const HString& FileName) const;
  576. // Write XLD contours to a file in DXF format.
  577. void WriteContourXldDxf(const char* FileName) const;
  578. #ifdef _WIN32
  579. // Write XLD contours to a file in DXF format.
  580. void WriteContourXldDxf(const wchar_t* FileName) const;
  581. #endif
  582. // Choose all contours or polygons containing a given point.
  583. HXLDCont SelectXldPoint(const HTuple& Row, const HTuple& Column) const;
  584. // Choose all contours or polygons containing a given point.
  585. HXLDCont SelectXldPoint(double Row, double Column) const;
  586. // Select contours or polygons using shape features.
  587. HXLDCont SelectShapeXld(const HTuple& Features, const HString& Operation, const HTuple& Min, const HTuple& Max) const;
  588. // Select contours or polygons using shape features.
  589. HXLDCont SelectShapeXld(const HString& Features, const HString& Operation, double Min, double Max) const;
  590. // Select contours or polygons using shape features.
  591. HXLDCont SelectShapeXld(const char* Features, const char* Operation, double Min, double Max) const;
  592. #ifdef _WIN32
  593. // Select contours or polygons using shape features.
  594. HXLDCont SelectShapeXld(const wchar_t* Features, const wchar_t* Operation, double Min, double Max) const;
  595. #endif
  596. // Transform the shape of contours or polygons.
  597. HXLDCont ShapeTransXld(const HString& Type) const;
  598. // Transform the shape of contours or polygons.
  599. HXLDCont ShapeTransXld(const char* Type) const;
  600. #ifdef _WIN32
  601. // Transform the shape of contours or polygons.
  602. HXLDCont ShapeTransXld(const wchar_t* Type) const;
  603. #endif
  604. // Calibrate the radial distortion.
  605. HXLDCont RadialDistortionSelfCalibration(Hlong Width, Hlong Height, double InlierThreshold, Hlong RandSeed, const HString& DistortionModel, const HString& DistortionCenter, double PrincipalPointVar, HCamPar* CameraParam) const;
  606. // Calibrate the radial distortion.
  607. HXLDCont RadialDistortionSelfCalibration(Hlong Width, Hlong Height, double InlierThreshold, Hlong RandSeed, const char* DistortionModel, const char* DistortionCenter, double PrincipalPointVar, HCamPar* CameraParam) const;
  608. #ifdef _WIN32
  609. // Calibrate the radial distortion.
  610. HXLDCont RadialDistortionSelfCalibration(Hlong Width, Hlong Height, double InlierThreshold, Hlong RandSeed, const wchar_t* DistortionModel, const wchar_t* DistortionCenter, double PrincipalPointVar, HCamPar* CameraParam) const;
  611. #endif
  612. // Transform an XLD contour into the plane z=0 of a world coordinate system.
  613. HXLDCont ContourToWorldPlaneXld(const HTuple& CameraParam, const HPose& WorldPose, const HTuple& Scale) const;
  614. // Transform an XLD contour into the plane z=0 of a world coordinate system.
  615. HXLDCont ContourToWorldPlaneXld(const HTuple& CameraParam, const HPose& WorldPose, const HString& Scale) const;
  616. // Transform an XLD contour into the plane z=0 of a world coordinate system.
  617. HXLDCont ContourToWorldPlaneXld(const HTuple& CameraParam, const HPose& WorldPose, const char* Scale) const;
  618. #ifdef _WIN32
  619. // Transform an XLD contour into the plane z=0 of a world coordinate system.
  620. HXLDCont ContourToWorldPlaneXld(const HTuple& CameraParam, const HPose& WorldPose, const wchar_t* Scale) const;
  621. #endif
  622. // Change the radial distortion of contours.
  623. HXLDCont ChangeRadialDistortionContoursXld(const HCamPar& CamParamIn, const HCamPar& CamParamOut) const;
  624. // Calculate the minimum distance between two contours and the points used for the calculation.
  625. HTuple DistanceCcMinPoints(const HXLDCont& Contour2, const HString& Mode, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2) const;
  626. // Calculate the minimum distance between two contours and the points used for the calculation.
  627. double DistanceCcMinPoints(const HXLDCont& Contour2, const HString& Mode, double* Row1, double* Column1, double* Row2, double* Column2) const;
  628. // Calculate the minimum distance between two contours and the points used for the calculation.
  629. double DistanceCcMinPoints(const HXLDCont& Contour2, const char* Mode, double* Row1, double* Column1, double* Row2, double* Column2) const;
  630. #ifdef _WIN32
  631. // Calculate the minimum distance between two contours and the points used for the calculation.
  632. double DistanceCcMinPoints(const HXLDCont& Contour2, const wchar_t* Mode, double* Row1, double* Column1, double* Row2, double* Column2) const;
  633. #endif
  634. // Insert objects into an iconic object tuple.
  635. HXLDCont InsertObj(const HXLDCont& ObjectsInsert, Hlong Index) const;
  636. // Remove objects from an iconic object tuple.
  637. HXLDCont RemoveObj(const HTuple& Index) const;
  638. // Remove objects from an iconic object tuple.
  639. HXLDCont RemoveObj(Hlong Index) const;
  640. // Replaces one or more elements of an iconic object tuple.
  641. HXLDCont ReplaceObj(const HXLDCont& ObjectsReplace, const HTuple& Index) const;
  642. // Replaces one or more elements of an iconic object tuple.
  643. HXLDCont ReplaceObj(const HXLDCont& ObjectsReplace, Hlong Index) const;
  644. // Train a shape model for matching.
  645. void TrainGenericShapeModel(const HShapeModel& ModelID) const;
  646. private:
  647. // Verify matching semantic type ('xld_cont')!
  648. void AssertObjectClass();
  649. };
  650. }
  651. #endif