What does a colon followed by comma do to an image?
조회 수: 1 (최근 30일)
이전 댓글 표시
I don't quite understand what the following code is doing.
numFolder=fullfile('NumberZero/','Zero/');
for i=1:10;
numName=sprintf('%d.bmp',i);
image1=imread([numFolder, numName]);
im1(:,:,i)=image1; % what is this line doing?
end
댓글 수: 0
채택된 답변
Adam
2016년 3월 9일
편집: Adam
2016년 3월 9일
im1(:,:,i)
means take all elements of your 3d array in the first and 2nd dimensions and only the i'th value in the 3rd dimension.
So basically it turns your data from 3d to 2d in this case by extracting just one slice from the 3rd dimension of a volume.
doc colon
The comma is just the standard syntax for separating the dimensions of your matrix which is why in your case I could easily see that im1 is 3d.
댓글 수: 10
Adam
2016년 3월 14일
I'm not really familiar with neural networks so I'm not sure I would be able to help with that.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!