Define a curve in terms of (X,Y) values

2 vues (au cours des 30 derniers jours)
Ashkan Javadzadegan
Ashkan Javadzadegan le 15 Avr 2015
Dear all,
I detected an artery borderline (Image B) on a grayscale image (image A). Now I would like to define the detected borderline in terms of (X,Y) values.
Would be much appreciated if any body could give me a hint. Ashkan

Réponses (1)

pfb
pfb le 15 Avr 2015
I assume that B is in a single matrix. The light point should then correspond to matrix elements above some threshold. If this is the case, it should be sufficient to do this
[y x] = find(B>t);
  5 commentaires
pfb
pfb le 15 Avr 2015
Modifié(e) : pfb le 16 Avr 2015
Well, that should not be that hard.
[Y,X] = size(B);
Gives you the size of the image in the vertical and horizontal direction (in pixels). You should know what that is in mm.
The "origin" is then
o = [X/2 Y/2];
Use round() if your matrix has odd dimensions and you want integer numbers.
Then
x = x-o;
y = y-o;
Again, these coordinates are "in pixels", but if you know the scale of the image it is easy to get the correct values. If Sx and Sy are the dimensions of the image in mms then
x = Sx/X*x;
y = Sy/Y*y;
Why your 3D model design software should care about where the origin of the axes is?
Ashkan Javadzadegan
Ashkan Javadzadegan le 16 Avr 2015
Thanks, I will try this and will let you know ...

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