Squeeze Command - RGB
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Pedro Minsk
am 5 Nov. 2015
Kommentiert: Pedro Minsk
am 5 Nov. 2015
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)

.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 5 Nov. 2015
The row of a matrix is its Y coordinate, and the column is its X coordinate. You need to look at a(107,205,:)
Weitere Antworten (1)
John D'Errico
am 5 Nov. 2015
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.
Siehe auch
Kategorien
Mehr zu Matrix Indexing 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!