I am trying to use cv2.distanceTransform()
method in Python. And I am getting an error when running the following line of code:
dist_transform = cv2.distanceTransform(opening,cv2.DIST_L2,5)
I get the following error when running this code:
AttributeError: 'module' object has no attribute 'DIST_L2'
Similar questions have been asked before, and i know that this problem occurs when you import 'something' when your python file name is 'something.py'. However, my python file name is segment3.py.
Can anyone please help me with this? I am trying to do segmentation using watershed algorithm. I am working on Fedora20. Thanks in advance!
DIST_LT2
. Are you sure the thing you're looking for exists and has this name? – Adeleadelheidcv2.DIST_L2
instead ofcv2.DIST_LT2
? – Dry