Hello,
I've uploaded a video to matlab with the following code and I got this on workspace:
I want to know more about the meaning of "4-D uint8", what does it mean? what are the 4 dimentions , what is uint8 ?
what is the dimentions of the variable "frames"? How can I extract one column from the 4-D table?
Thank you
video = VideoReader("measurment.mp4");
for(i = 1: video.NumberOfFrames)
frames(:,:,:,i) = read(video, i);
end

 採用された回答

Stephan
Stephan 2020 年 12 月 7 日
編集済み: Stephan 2020 年 12 月 7 日

1 投票

There is a 2D for height and width of the video, which shows the resolution, the 3rd D is for example is of size 3 for RGB or of size 1 for grayscale.
This 3 dimensions would describe one image. Since you have a video, there are all those single frames in the 4th dimension one after eachother.
What you want i guess is readFrame since you use a for loop. What you did is reading the whole video into one 4D array. This would not need a loop.

5 件のコメント

John D'Errico
John D'Errico 2020 年 12 月 7 日
And uint8 means this is an array of integers that lies between 0 and 255.
semicolon
semicolon 2020 年 12 月 7 日
unit8 means 8bits for each number in the fields of the 4-D line: [h,w,color,time] ?
Stephan
Stephan 2020 年 12 月 7 日
Yes, you cant have arrays with mixed types - except for cell arrays or tables.
Stephan
Stephan 2020 年 12 月 7 日
semicolon's answer moved here:
thank you.
so my last question is how can I extract one column (colors, or more specifically- the red color) from the values that I've mesured ?
Stephan
Stephan 2020 年 12 月 7 日
You can access the red color channel with using index = 1 on the third dimension:
AllRedFromFrame42 = frames(:,:,1,42)
TheFirst_10_x_10_RedFromFrame13(1:10,10:,1,13)

サインインしてコメントする。

その他の回答 (0 件)

質問済み:

2020 年 12 月 7 日

コメント済み:

2020 年 12 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by