Effacer les filtres
Effacer les filtres

How to create a gray scale image where the intensty is based on the distance from a set of X and Y coordinates

3 vues (au cours des 30 derniers jours)
I have an array of X and Y coordinates. I want to create an image where the pixel value is the distance (Sqrt( X**2 + Y**2 ) ) to the closest point in the array. I would like a bwdist( 'Euclidian' ) type function that can take in subpixel accuracy on the X and Y position.
  1 commentaire
Mikhail
Mikhail le 21 Nov 2014
"intensity is proportional to the distance to the closest point" - what does it mean? May be you want to create an image where intensity is proportional to the distance to a certain point (say, the origin of xy plane, center point of the image, etc). Explain your problem better.

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
Image Analyst le 21 Nov 2014
Not sure why you don't think bwdist() can return fractional numbers. It's right there in the help as the very first example. It gives double results. Perhaps you need to cast your image to double first before calling it.
  2 commentaires
Hans Dohse
Hans Dohse le 21 Nov 2014
It does return fractional numbers but the input points have to be an on pixel in the input BW image. I am currently oversampling the BW image to get better input precision.
Image Analyst
Image Analyst le 21 Nov 2014
So use the oversampled image then. Why can't you do that?

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by