MCPcopy Create free account
hub / github.com/DeepLabCut/DeepLabCut / contains_points

Method contains_points

deeplabcut/core/trackingutils.py:119–127  ·  view source on GitHub ↗
(self, xy, tol=0.1)

Source from the content-addressed store, hash-verified

117 return 0.8 * cost1 + 0.2 * cost2 * cost1
118
119 def contains_points(self, xy, tol=0.1):
120 ca = math.cos(self.theta)
121 sa = math.sin(self.theta)
122 x_demean = xy[:, 0] - self.x
123 y_demean = xy[:, 1] - self.y
124 return (
125 ((ca * x_demean + sa * y_demean) ** 2 / (0.5 * self.width) ** 2)
126 + ((sa * x_demean - ca * y_demean) ** 2 / (0.5 * self.height) ** 2)
127 ) <= 1 + tol
128
129 def draw(self, show_axes=True, ax=None, **kwargs):
130 import matplotlib.pyplot as plt

Callers 2

on_selectMethod · 0.80
test_ellipseFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_ellipseFunction · 0.64