48 return point - plane_normal * d;
60 const cv::Vec2d& line_start,
61 const cv::Vec2d& line_end,
62 const cv::Vec2d& point)
66 (point[0] - proj[0]) * (point[0] - proj[0]) +
67 (point[1] - proj[1]) * (point[1] - proj[1]));
90 return line_start + (t / b) * v;
95 const cv::Vec2d& line_start,
96 const cv::Vec2d& line_end,
97 const cv::Vec2d& point)
99 cv::Point2d v(line_end - line_start);
100 cv::Point2d r(point - line_start);
116 return line_start + cv::Vec2d(v.x * (t / b), v.y * (t / b));
120 const std::vector<cv::Vec2d>& polygon,
121 const cv::Vec2d& point)
123 if (polygon.size() < 2)
128 bool is_inside =
false;
129 if (((polygon.front()[1] > point[1]) != (polygon.back()[1] > point[1])) &&
130 (point[0] < (polygon.back()[0] - polygon.front()[0]) * (point[1] - polygon.front()[1]) /
131 (polygon.back()[1] - polygon.front()[1]) + polygon.front()[0]))
133 is_inside = !is_inside;
136 for (
size_t i = 1; i < polygon.size(); i++)
138 if (((polygon[i][1] > point[1]) != (polygon[i - 1][1] > point[1])) &&
139 (point[0] < (polygon[i - 1][0] - polygon[i][0]) * (point[1] - polygon[i][1]) /
140 (polygon[i - 1][1] - polygon[i][1]) + polygon[i][0]))
142 is_inside = !is_inside;
150 const std::vector<cv::Vec2d>& polygon,
151 const cv::Vec2d& point)
159 for (
size_t i = 1; i < polygon.size(); i++)
bool PointInPolygon(const std::vector< cv::Vec2d > &polygon, const cv::Vec2d &point)
double DistanceFromPolygon(const std::vector< cv::Vec2d > &polygon, const cv::Vec2d &point)
TFSIMD_FORCE_INLINE tfScalar distance(const Vector3 &v) const
TFSIMD_FORCE_INLINE const tfScalar & y() const
TFSIMD_FORCE_INLINE Vector3 cross(const Vector3 &v) const
TFSIMD_FORCE_INLINE tfScalar dot(const Vector3 &v) const
tf::Vector3 ProjectPointToPlane(const tf::Vector3 &plane_normal, const tf::Vector3 &plane_point, const tf::Vector3 &point)
TFSIMD_FORCE_INLINE Vector3 normalized() const
tf::Vector3 ProjectToLineSegment(const tf::Vector3 &line_start, const tf::Vector3 &line_end, const tf::Vector3 &point)
TFSIMD_FORCE_INLINE const tfScalar & x() const
double DistanceFromPlane(const tf::Vector3 &plane_normal, const tf::Vector3 &plane_point, const tf::Vector3 &point)
TFSIMD_FORCE_INLINE const tfScalar & w() const
bool ClosestPointToLines(const tf::Vector3 &a1, const tf::Vector3 &a2, const tf::Vector3 &b1, const tf::Vector3 &b2, tf::Vector3 &point)
double DistanceFromLineSegment(const tf::Vector3 &line_start, const tf::Vector3 &line_end, const tf::Vector3 &point)
TFSIMD_FORCE_INLINE tfScalar length() const