can anyone explain this code? this code is related to my project crowd density estimation

for a = 1:size(video,4)
imagesc(video(:,:,:,a));
axis image off
drawnow;
end;

3 件のコメント

Jan
Jan 2017 年 3 月 27 日
I've closed this question, because there is an accepted answer in the duplicate thread already. This thread will be deleted soon.

回答 (1 件)

Jan
Jan 2017 年 3 月 27 日
編集済み: Jan 2017 年 3 月 27 日

0 投票

This is very basic Matlab code. Please read the Getting Started chapters of the documentation and https://matlabacademy.mathworks.com/ . It would not be efficient to explain the absolute basics in the forum, when there are very good tutorials available already.
So only for a quick start:
You code is a loop over the indices along the 4th dimension of the variable "video". This is a 4D-array and the RGB images can be accessed using video(:, :, :, frameNumber). Then the axes is set to the "image" format (upside down) and mad invisible by the 'off'. Finally drawnow gives Matlab time to perform an update of the screen. Then the "end" closes the loop and the processing proceeds in the for line.

この質問は閉じられています。

質問済み:

2017 年 3 月 27 日

コメント済み:

Jan
2017 年 3 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by