After obtaining the pixel values of an image..how to store those pixel values in an array?
4 次查看(过去 30 天)
显示 更早的评论
After obtaining the pixel values of an image..how to store those pixel values in an array?
4 个评论
Guillaume
2018-12-18
Kamali, you have to explain better what it is you want to do. As commented you already have the pixels in an array. It's the my_image array
采纳的回答
madhan ravi
2018-12-18
pixel = cell(1,rows);
ctr = 1;
for R=1:rows
for C=1:columns
pixel{ctr}=my_image(R,C);
disp (R)
end
ctr = ctr+1;
end
celldisp(pixel)
[pixel{:}] % double array
6 个评论
madhan ravi
2018-12-18
编辑:madhan ravi
2018-12-18
@kamali see sir Walter's answer this is not the correct approach as mentioned by the peers.
更多回答(3 个)
Walter Roberson
2018-12-18
The pixel values are already stored in my_image and do not need to be stored again .
0 个评论
Kamali M
2018-12-18
1 个评论
Walter Roberson
2018-12-18
What data type do you need as output? What array size do you need as output? What difference do you intend between "pixel values" that you want stored, compared to what is already in my_array ?
Saipraveen
2019-9-30
For the information of other users, In this file exchange - https://www.mathworks.com/matlabcentral/fileexchange/72535-image-to-c-c-array-converter, I have written a script to generate an array from an image. I convert the input image to monochrome and store the pixel values in hex format in a different file. It could be modified to suit your needs.
Hope that helps.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!