image to an array
이전 댓글 표시
채택된 답변
추가 답변 (3개)
Harshit
2012년 11월 8일
0 개 추천
Why do you wanna write an image into an array. Use reshape if you really want.
Walter Roberson
2012년 11월 8일
0 개 추천
get() the CData property of the image; that will be an array.
Mohammed Manna
2012년 11월 8일
편집: Mohammed Manna
2012년 11월 8일
Simply do this
targetImg = imread("path");
targetImg = targetImg(:); % You can take a transpose too if you like
If you need to convert it to one of the primitive types, you can do so by
targetImg = double(targetImg);
targetImg = float(targetImg);
% etc.
If you have performance/speed/parallel processing related issues. I suggest you also look into get() CDATA property of the image. I am not sure why you need the array of an image. I must say that I cannot remember if about the float(). But the point is proven. Hope this helps you.
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!