Skip to content Skip to sidebar Skip to footer

Making A Laser Detector Have An Error In My Code

I am making a program that detects lasers and circles and numbers then with the opencv library. This is my first time using ros indigo and I don't really know what I am doing but I

Solution 1:

It is correct to not have the self in there, as convert_image() is a regular function. The real error is that measure has no label attribute/function. Except, (depending on the version), skimage.measure.label exists as you say.

Based on other SO solutions to this (no attribute in module) problem, try checking that the version of skimage you're using has measure.label, try deleting any .pyc files, and make sure you have no naming conflicts or modules with the same name as what you're trying to import.

Edit: skimage v0.9.x has the label function under the morphology module: skimage.morphology.label. It was moved to measure at a later date.

Solution 2:

If the function convert_image is a method of a class, then you would normally do

# instantiate the class
my_obj = my_class()

# call the class' method
my_obj.convert_image(paramaters)

so cv_image2 = self.convert_image(cv_image) should be cv_image2 = my_obj.convert_image(cv_image)

If you aren't instantiating a class, and just calling a function, then you can just get rid of the self - cv_image2 = convert_image(cv_image)

Post a Comment for "Making A Laser Detector Have An Error In My Code"