开发者

how convert gray image to n-by-3 array

开发者 https://www.devze.com 2023-02-22 23:37 出处:网络
Hi I use imread for gray image reading. It gives me a x-by-y matrix (contains gray level in every cells)but i need it in n-b开发者_StackOverflowy-3 (x,y, and gray level) array of image points.

Hi I use imread for gray image reading. It gives me a x-by-y matrix (contains gray level in every cells) but i need it in n-b开发者_StackOverflowy-3 (x,y, and gray level) array of image points.

How i can convert imread result to n-by-3 array.

Thanks


[height, width] = size(image);
[X, Y] = meshgrid(1:width, 1:height);
points = [X(:) Y(:) image(:)]
0

精彩评论

暂无评论...
验证码 换一张
取 消