Quick,dumb question with imshow

조회 수: 5 (최근 30일)
Brian
Brian 2016년 8월 29일
댓글: Brian 2016년 8월 29일
Hello, thanks for answering,
I have a question about imshow, and how it processes the greyscale image matrix.
In these pictures I have a DICOM image loaded. I'm using in picture a data cursor to find the pixel intensity at a point [311,297], and it was 699. When I try to find the actual pixel value in my img matrix (X), though, X(311,297) it is not 699, its something else. However, X(297,311) is 699. This can be seen in the second pic. Is there a reason this happens, the image gets rotated?
I don't care that it does particularly, but I would like to be able to tell when and if the rotation happens, and if its arbitrary always supposed to happen
Thanks!

채택된 답변

Walter Roberson
Walter Roberson 2016년 8월 29일
(1,1) (1,2) (1,3) (1,4)
(2,1) (2,2) (2,3) (2,4)
(3,1) (3,2) (3,3) (3,4)
In the above diagram, the (A,B) pair shows the MATLAB indices to that position in the array. The first index is the row number and the second index is the column number. But if you now take that array and put it on a standard cartesian axis, changes in height correspond to Y coordinates and changes in width correspond to X coordinates. So the first coordinate of a MATLAB array corresponds to Y and the second to X. The datatip is showing the (X,Y) pair because that is what people are accustomed to seeing labels as, but (X,Y) pair is not the indexing scheme that MATLAB uses.
The image is not rotated: the datatip is not showing the index order.
  댓글 수: 1
Brian
Brian 2016년 8월 29일
Thanks, I've been using matlab for a while but to be honest this threw me through a loop trying to get it straight in my head.
As long as its consistent I'm happy. Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by