8 #include <opencv2/opencv.hpp>
26 Line() : point_(0.0, 0.0, 0.0), direction_(1.0, 0.0, 0.0) {};
27 Line(
const cv::Vec3d& point,
const cv::Vec3d& direction);
40 cv::Vec3d
getPoint(
const double t)
const;
46 void getIntersection(
double& t,
const Plane& plane)
const;
47 cv::Vec3d getIntersection(
const Plane& plane)
const;
72 Plane(
const cv::Vec3d& normal,
const double lambda);
73 Plane(
const cv::Vec3d& direction1,
74 const cv::Vec3d& direction2,
75 const cv::Vec3d& point);
76 cv::Vec3d getIntersection(
const Line& line)
const;
77 Line getIntersection(
const Plane& plane)
const;
78 const cv::Vec3d& getNormal()
const;
79 double getLambda()
const;
98 bool contains(cv::Point2d& point)
100 double dx2 = point.x - center_.x;
101 double dy2 = point.y - center_.y;
103 double rx2 = radius_.x * radius_.x;
104 double ry2 = radius_.y * radius_.y;
106 return dx2 / rx2 + dy2 / ry2 <= 1.0;
115 template <
typename T>
int sgn(T val) {
116 return (T(0) < val) - (val < T(0));
124 int adaptedNewtonsMethod(cv::Vec3d& depth,
double* residuum,
125 double p_L,
double p_R,
double p_M,
126 double q_LR,
double q_LM,
double q_RM,
127 double d_LR,
double d_LM,
double d_RM,
131 cv::Vec3d adaptedNewtonsMethodForBC(
const cv::Vec3d& F_O,
const cv::Vec3d& F_A,
const cv::Vec3d& F_U,
132 double rq,
const cv::Vec3d& start,
double epsilon);
143 cv::Vec<double, n> SP(
const cv::Vec<double, n>& p,
const cv::Vec<double, n>& v,
const cv::Vec<double, n>& w)
145 double t = (p - v).dot(w) / w.dot(w);
160 int calcLineCircleIntersections (
double& result1,
double& result2,
161 const cv::Vec2d& linePoint,
const cv::Vec2d& lineDirection,
const cv::Vec2d& center,
const double radius);
172 int calcLineCircleIntersections (cv::Vec2d& result1, cv::Vec2d& result2,
173 const cv::Vec2d& linePoint,
const cv::Vec2d& lineDirection,
const cv::Vec2d& center,
const double radius);
185 int calcLineSphereIntersections (cv::Vec3d& result1, cv::Vec3d& result2,
186 const cv::Vec3d& linePoint,
const cv::Vec3d& lineDirection,
const cv::Vec3d& center,
const double radius);
199 bool getPlaneNormalForm(cv::Vec3d& normal,
201 const cv::Vec3d& direction1,
202 const cv::Vec3d& direction2,
203 const cv::Vec3d& planePoint);
213 void calcLinePlaneIntersection(
double& result,
214 const cv::Vec3d& linePoint,
const cv::Vec3d& lineDirection,
215 const cv::Vec3d& planeNormal,
const double lambda);
225 cv::Vec3d calcLinePlaneIntersection(
const cv::Vec3d& linePoint,
const cv::Vec3d& lineDirection,
226 const cv::Vec3d& planeNormal,
const double lambda);
238 cv::Vec3d calcLineIntersection(
239 const cv::Vec2d& line1Point1,
const cv::Vec2d& line1Point2,
240 const cv::Vec2d& line2Point1,
const cv::Vec2d& line2Point2);
242 void calcLineIntersection(cv::Vec2d& result,
243 const cv::Vec2d& line1Point1,
const cv::Vec2d& line1Point2,
244 const cv::Vec2d& line2Point1,
const cv::Vec2d& line2Point2);
251 inline double deg2rad(
double deg) {
252 return (deg * CV_PI / 180.0);
261 inline double rad2deg(
double rad) {
262 return (rad * 180.0 / CV_PI);
273 inline bool IsPointInEllipse(
const cv::Point2d p,
274 const cv::Point2d& center,
const cv::Point2d& radius)
276 double dx2 = p.x - center.x;
277 double dy2 = p.y - center.y;
282 double rx2 = radius.x * radius.x;
283 double ry2 = radius.y * radius.y;
285 return dx2 / rx2 + dy2 / ry2 <= 1.0;
double normalize()
normalisiert den Richtungsvektor und gibt den alten Betrag zurück.
Definition: algorithms.cpp:247
Achsenparallele Ellipse.
Definition: algorithms.h:93
const cv::Vec3d & getPoint() const
gibt den Ankerpunkt zurück
Definition: algorithms.cpp:261
cv::Vec3d operator()(const double t) const
wie getPoint(), nur konziser
Definition: algorithms.cpp:271
const cv::Vec3d & getDirection() const
gibt den Richtungsvektor zurück.
Definition: algorithms.cpp:256
void getNearestPoint(double &t, const Line &line) const
*this und line sind windschiefe Geraden.
Definition: algorithms.cpp:276
Ebene.
Definition: algorithms.h:68
Gerade im Raum.
Definition: algorithms.h:22