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$
  • $\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$ – Niki Estner Feb 6 '16 at 13:52
  • 3
    $\begingroup$ Try e.g. InverseDistanceTransform[ImageMultiply[pic, 10]] to get disks with radius 10 $\endgroup$ – Niki Estner Feb 6 '16 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 '16 at 16:26
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, privacy policy and cookie policy

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