a very quick question

1 Ansicht (letzte 30 Tage)
Ahmed Abdulla
Ahmed Abdulla am 14 Jun. 2019
Kommentiert: dpb am 14 Jun. 2019
i wanted to ask if matlab is reading RGB values of pixels from rows and columns. i wanted to ask does it for rows does it go from top to bottom of an image or from bottom to top and for the columns does it go from left to right or from right to left
for i = 1:rows
for j = 1:columns
red = myImage(i,j,1);
green = myImage(i,j,2);
blue = myImage(i,j,3);
rgb = red*256*256 + green*256 + blue;
compressed(i,j) = rgb;
end
end
  1 Kommentar
dpb
dpb am 14 Jun. 2019
Array data are column major as any other array.
If you use the high-level version of image to display an array, then the displayed axes has Y in the 'reverse' mode and view [0 90] but the low-level version (if use CData) doesn't make those changes.
So, what you see depends on how displayed but "memory is memory"

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by