Project-MONAI / MONAILabel

MONAI Label is an intelligent open source image labeling and learning tool.
https://docs.monai.io/projects/label
Apache License 2.0
595 stars 191 forks source link

Fix cv2 #1688

Closed tangy5 closed 4 months ago

tangy5 commented 4 months ago

remove cv2 usage base.

use skimage find contour, note skimage uses subpixel interpolation for contour detection, boundaries can be subpixel-wise (0.5 accurate).

Unit tests and local tests passed.

One unit test case is changed because of the subpixel accuracy of skimage changed from cv2.

SachidanandAlle commented 4 months ago

Let me verify the impact..

otherwise let's keep a fallback to skmeasure if cv2 import is not found... That way we can still keep the original accuracy and functionality if user installs opencv himself

SachidanandAlle commented 4 months ago

Yes.. I agree.. we. Need to mention it.. or add optional dependency logic for installation

pip install monailabel [opencv]

@tangy5