Squeeze Command - RGB

조회 수: 6 (최근 30일)
Pedro Minsk
Pedro Minsk 2015년 11월 5일
댓글: Pedro Minsk 2015년 11월 5일
I am trying to use the Squeeze command to determine the RGB value of a point, but I keep getting the wrong results. For the point (205, 107) the squeeze command returns the RGB value (57 133 95), but the Image Tool shows for the same point the RGB value (108 164 137)
.

채택된 답변

Walter Roberson
Walter Roberson 2015년 11월 5일
The row of a matrix is its Y coordinate, and the column is its X coordinate. You need to look at a(107,205,:)
  댓글 수: 1
Pedro Minsk
Pedro Minsk 2015년 11월 5일
Thank you very much! I hadn't realized this.

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

추가 답변 (1개)

John D'Errico
John D'Errico 2015년 11월 5일
This has ABSOLUTELY nothing to do with squeeze, UNLESS you have created your own squeeze function by accident. It is not at all uncommon for new users to do something like that.
What is a(205,107,:)? Then tell us what is a(107,205,:). As I recall, MATLAB uses the first index for the horizontal coordinate with an image. So you may be getting that index swapped in what you have done.
  댓글 수: 1
Pedro Minsk
Pedro Minsk 2015년 11월 5일
a(205, 107, :) are the coordinates of the pixel in the image. That was exactly what was happening. The index was inverted. Thank you so much!

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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by