The image data in which the numeric data is written is 2d.
(3404 * 2403 size) images want to save 60 images by cutting to 340 * 40 size. That is, 340 * 60 sizes should be stored in 60 dimensions.
What method should I use?

답변 (2개)

Walter Roberson
Walter Roberson 2018년 11월 23일
편집: Walter Roberson 2018년 11월 23일

0 개 추천

reshape(Image(1:340,1:2400),340,40,60)

댓글 수: 2

sw park
sw park 2018년 11월 23일
Thank you for Answer But It does not work properly.
I want this
example
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32
(2*2) cutting
1 2
9 10 (:,:,1)
3 4
11 12 (:,:,2)
5 6
13 14 (:,:,3)
7 8
15 16(:,:,4)
17 18
25 26 (:,:,5)
Your answer will reshape the original 2D form to something other than what I want.
Walter Roberson
Walter Roberson 2018년 11월 23일
see mat2cell

댓글을 달려면 로그인하십시오.

Andrei Bobrov
Andrei Bobrov 2018년 11월 23일
편집: Andrei Bobrov 2018년 11월 23일

0 개 추천

Let A - your image with size [3400 x 2400],
size of small image -> [340 x 40].
p = 340;
n = 40;
[q,w] = size(A);
out = squeeze(permute(reshape(A,p,q/p,n,[]),[1,3,4,2]));
or with mat2cell:
p = 340;
n = 40;
[q,w] = size(A);
C = mat2cell(A,p*ones(q/p,1),n*ones(w/n,1))';
out = cat(3,C{:});

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

질문:

2018년 11월 23일

편집:

2018년 11월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by