-1

I'm using imfreehand in my program, and when I came to erosion, I got the following error (I didn't paste the whole error):

Error using imerode
Expected input number 1, IM, to be one of these types:

numeric, logical

Instead its type was imfreehand.

It seems then that the region I extract will be of type imfreehand? Is there a way to convert to the above data types? Or, there is some way to deal with such issue?

Thanks.

Simplicity
  • 47,404
  • 98
  • 256
  • 385

1 Answers1

0

You can take a look at the examples in this post. My interpretation is that you create a mask using the handle associated with the generated freehand object,

hFH = imfreehand();
binaryImage = hFH.createMask();

then use the mask for additional purposes.

Buck Thorn
  • 5,024
  • 2
  • 17
  • 27