| 28 | (0, 128, 255), (128, 255, 0), (0, 255, 128), (255, 128, 0), (255, 0, 128), (128, 128, 255), (128, 255, 128), (255, 128, 128), (128, 128, 0), (128, 0, 128)] |
| 29 | |
| 30 | class detect_rect: |
| 31 | def __init__(self): |
| 32 | self.curr_frame = 0 |
| 33 | self.curr_rect = np.array([0, 0, 1, 1]) |
| 34 | self.next_rect = np.array([0, 0, 1, 1]) |
| 35 | self.conf = 0 |
| 36 | self.id = 0 |
| 37 | |
| 38 | @property |
| 39 | def position(self): |
| 40 | x = (self.curr_rect[0] + self.curr_rect[2])/2 |
| 41 | y = (self.curr_rect[1] + self.curr_rect[3])/2 |
| 42 | return np.array([x, y]) |
| 43 | |
| 44 | @property |
| 45 | def size(self): |
| 46 | w = self.curr_rect[2] - self.curr_rect[0] |
| 47 | h = self.curr_rect[3] - self.curr_rect[1] |
| 48 | return np.array([w, h]) |
| 49 | |
| 50 | class tracklet: |
| 51 | def __init__(self, det_rect): |
no outgoing calls