Filter löschen
Filter löschen

convert matrix coordenates at cartesian coordenate

1 Ansicht (letzte 30 Tage)
Jesus Luevano
Jesus Luevano am 27 Aug. 2012
Hello, when I use the function in matlab centroids, the latter gives me coordinates matrix, and when I want to represent objects in a plane, this is like the Cartesian coordinates, my question is how I can change the source for my flat matlab, or represent objects in a plane ij.

Antworten (1)

Walter Roberson
Walter Roberson am 27 Aug. 2012
Ycoords = interp1( [1 size(YourMatrix,1)], [TopY BottomY], CentroidRowValues );
Xcoords = interp1( [1 size(YourMatrix,2)], [LeftX RightX], CentroidColumnValues );
Note: you need to be careful about whether the coordinates are considered to be at the edge of pixels or at the center of pixels.
  1 Kommentar
Walter Roberson
Walter Roberson am 27 Aug. 2012
TopY is the Y coordinate corresponding to the top of the matrix (lowest row index.) BottomY is the Y coordinate corresponding to the bottom of the matrix (greatest row index.) LeftX is the X coordinate corresponding to the left of the matrix (lowest column index.) RightX is the X coordinate corresponding to the right of the matrix (greatest column index).

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Language Fundamentals finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by