(self, pnt, width)
| 19 | self.im = None |
| 20 | |
| 21 | def CropPatch(self, pnt, width): |
| 22 | [x_c,y_c] = pnt |
| 23 | w = width / 2.0 |
| 24 | x1 = int(np.clip(x_c - w, 0, self.img_size - 1)) |
| 25 | y1 = int(np.clip(y_c - w, 0, self.img_size - 1)) |
| 26 | x2 = int(np.clip(x_c + w, 0, self.img_size - 1)) |
| 27 | y2 = int(np.clip(y_c + w, 0, self.img_size - 1)) |
| 28 | return [x1,y1,x2,y2] |
| 29 | |
| 30 | def AddPoint(self, pos, im): |
| 31 | x_c = int(np.round(pos.x()/self.scale)) |