HXLDCont.h 55 KB

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