MCPcopy Create free account
hub / github.com/Smorodov/Multitarget-tracker / IsInsideArea

Method IsInsideArea

src/Tracker/track.cpp:460–469  ·  view source on GitHub ↗

\brief CTrack::IsInsideArea If result <= 1 then center of the object is inside ellipse with prediction and velocity \param pt \return

Source from the content-addressed store, hash-verified

458/// \return
459///
460track_t CTrack::IsInsideArea(const Point_t& pt, const cv::RotatedRect& rrect) const
461{
462 Point_t pt_(pt.x - rrect.center.x, pt.y - rrect.center.y);
463 track_t r = sqrtf(sqr(pt_.x) + sqr(pt_.y));
464 track_t t = (r > 1) ? acosf(pt_.x / r) : 0;
465 track_t t_ = t - rrect.angle;
466 Point_t pt_rotated(r * cosf(t_), r * sinf(t_));
467
468 return sqr(pt_rotated.x) / sqr(rrect.size.width) + sqr(pt_rotated.y) / sqr(rrect.size.height);
469}
470
471///
472/// \brief CTrack::WidthDist

Callers 1

GetEllipseDistMethod · 0.80

Calls 1

sqrFunction · 0.85

Tested by

no test coverage detected