a very quick question
2 views (last 30 days)
Show older comments
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 Comment
dpb
on 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"
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!