How to resize an image into size 256*256
조회 수: 4 (최근 30일)
이전 댓글 표시
I used the following code
J = J(1:256,1:256,:)
[r c]=size(J);
display(r); display(c);
But the value of c is displayed as 768.But the resized size is 256.What would be the error.And I cant use the command imresize since I need the third coordinate also.
댓글 수: 0
답변 (2개)
Image Analyst
2015년 5월 27일
Never use size like that for a color image. Use
[rows, columns, numberOfColorChannels] = size(J);
For more info, see Steve's blog: http://blogs.mathworks.com/steve/2011/03/22/too-much-information-about-the-size-function/
댓글 수: 0
Thorsten
2015년 5월 27일
편집: Thorsten
2015년 5월 27일
Use
r = size(J, 1); c = size(J, 2);
If J is a color image, c returns the columns*3. See also my answer to your first question http://www.mathworks.com/matlabcentral/answers/218747-how-to-divide-an-image-into-blocks-and-find-the-rgb-values-of-each-pixels-in-a-block
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!