필터 지우기
필터 지우기

Resizing an image and dividing it into blocks

조회 수: 1 (최근 30일)
Monsij Biswal
Monsij Biswal 2018년 5월 20일
댓글: Monsij Biswal 2018년 5월 20일
%matlab code
I = imread(image);
[x y] = size(I);
x,y
[m n] = size(I);
J = imresize(I, [256 256]);
[x1 y1] = size(J);
x1,y1
I'm getting the output in the first case as x=400, y=2100 and in the second case as x1=256(expected), y1=768(unexpected). Additionally, I need to divide this image into 4 blocks of 128 x 128 pixels each. Can anyone please help me out?

채택된 답변

Walter Roberson
Walter Roberson 2018년 5월 20일
Read the documentation about what the output of size() is when the number of output arguments is not the same as the number of dimensions of the array.
To divide the image into so few pieces, just index it as needed.
More generally see mat2cell

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

태그

제품


릴리스

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by