a very quick question

조회 수: 1 (최근 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