3
$\begingroup$

This is a example of documentation about InverseDistanceTransform. enter image description here

But this is my picture

enter image description here

But it doesn't work:

InverseDistanceTransform[pic, DistanceFunction -> EuclideanDistance]

enter image description here

$\endgroup$
3
  • $\begingroup$ If you evaluate Max[ImageData[pic]] with the image in the documentation, you get 13, i.e. the values of the white pixels are larger than 1, namely the disk radii in pixels. I'm guessing your image contains values between 0 and 1, so InverseDistanceTransform creates disks with radii between 0 and 1 $\endgroup$ Feb 6, 2016 at 13:52
  • 3
    $\begingroup$ Try e.g. InverseDistanceTransform[ImageMultiply[pic, 10]] to get disks with radius 10 $\endgroup$ Feb 6, 2016 at 13:54
  • $\begingroup$ @nikie Oh,Thanks a lot.I think you should post a answer about this to help the reader.And I'll accept it. $\endgroup$
    – yode
    Feb 6, 2016 at 16:26

1 Answer 1

8
$\begingroup$

If you evaluate Max[ImageData[pic]] with the image in the documentation, you get 13, i.e. the values of the white pixels are larger than 1, namely the disk radii in pixels. I'm guessing your image contains values between 0 and 1, so InverseDistanceTransform creates disks with radii between 0 and 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.