Closed nick-sebasco closed 5 months ago
Critical piece of code added to handle pixel scaling: ((contours[(contours[..., 0] > -1) & (contours[..., 1] > -1)]) * self._pixel_scale).astype(np.float32)
((contours[(contours[..., 0] > -1) & (contours[..., 1] > -1)]) * self._pixel_scale).astype(np.float32)
Doing this before computing the moments/ hu_moments/ ellipse fit features ensures that the units are correct.
Closing because changes were applied in https://github.com/KumarLabJax/JABS-behavior-classifier/pull/22
Critical piece of code added to handle pixel scaling:
((contours[(contours[..., 0] > -1) & (contours[..., 1] > -1)]) * self._pixel_scale).astype(np.float32)
Doing this before computing the moments/ hu_moments/ ellipse fit features ensures that the units are correct.