a very quick question

2 次查看(过去 30 天)
Ahmed Abdulla
Ahmed Abdulla 2019-6-14
评论: dpb 2019-6-14
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 个评论
dpb
dpb 2019-6-14
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"

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by