필터 지우기
필터 지우기

I want to make a double type matrix into an image

조회 수: 1 (최근 30일)
ys
ys 2022년 4월 15일
답변: DGM 2022년 4월 15일
I have a matrix of [175,50,432] in a numerical matrix, but I want to make one image of [50,432]. What should I do?
  댓글 수: 2
John D'Errico
John D'Errico 2022년 4월 15일
You can want to do all sorts of things. But only you have an idea what that means.
What would you do to form the (1,1) element of that image? You have 175 pieces of information. That is, 175 distinct pieces of information for EVERY pixel in the new image.
ys
ys 2022년 4월 15일
There are 175 numeric matrices with 50 vertical and 432 horizontal. I want to put it in the image input layer for classification by cnn, so I want to make 175 images with 50 vertical and 432 horizontal.

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

답변 (1개)

DGM
DGM 2022년 4월 15일
Maybe this is a start.
A = rand(175,50,432); % some array
A = permute(A,[2 3 1]); % now it's oriented as specified
% do whatever you need to do with the pages of the image
for f = 1:size(A,3)
R = mymagicalfunction(A(:,:,f));
end
Also note that many tools that handle images expect the data to be in a nominal range, which depends on the numeric class. For 'double', the data should be in [0 1]. If it's not, you'll have to decide how you want to scale it such that it is.

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by