-2

Facing error in image segmentation using meanshift algorithm in following line:

import cv2
(segmented_image, labels_image, number_regions) = cv2.meanShift.segment(im, spatial_radius=6, range_radius=4.5, min_density=50)

complete traceback is:

Traceback (most recent call last):
  File "image_processing.py", line 16, in <module>
    (segmented_image, labels_image, number_regions) = cv2.meanShift.segment(im,
spatial_radius=6,
AttributeError: 'builtin_function_or_method' object has no attribute 'segment'
Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
Amrit
  • 2,115
  • 1
  • 21
  • 41
  • You forgot to tell us which part of the error message you don't understand. – timgeb Dec 21 '17 at 13:31
  • I want to use meanshift algorithm and I am unable to find this 'segment ' function....can u tell me which package contain this function in python? – Amrit Dec 21 '17 at 13:35

1 Answers1

-1

This error is telling you cv2.meanShift does not refer to a property, but rather a function/method. You're calling it as if it's a property. Look at the API for cv2 and make sure you are calling meanShift as a function with the proper arguments.

bedwyr
  • 5,774
  • 4
  • 31
  • 49