split video to bocks

조회 수: 3 (최근 30일)
nadia naji
nadia naji 2013년 3월 4일
hi i have a video and i want to split video to some block which each frame split to 16x16 blocks and each 30 frame i have the treatment of these blocks so i want to split video to 16x16x30 blocks that 30 shows the number of frames i consider the blocks how can i do this? if i want these blocks have overlap to each other in temporal how can i do this? please help me?

답변 (1개)

Walter Roberson
Walter Roberson 2013년 3월 4일
Is your video grayscale or RGB? If it is RGB then your 16x16x30 would need a "x3" somewhere in there to account for the color.
If it is grayscale and all of the images are the same size, then save the 30 images into an array, such as
for FrameNumber = 1 : 30
Images(:,:,FrameNumber) = getsnapshot(videoobject);
end
Then afterwards,
SplitImages = mat2cell(Images, 16 * ones(1, size(Images,1) / 16), 16 * ones(1, size(Images,2) / 16), size(Images,3));
If you want the frames to overlap temporally, you will need to indicate how much overlap you want.
  댓글 수: 1
nadia naji
nadia naji 2013년 3월 5일
thanks for your answer but if i want to do some process on every cell how can i do this for example when i want to imshow the cell 16x16x30 it cant and show error. do i use cell2mat for working on each cell? for overlapping i need 15 frame overlap can you help me?

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by