I have an avi-video-file. I would like to represent a frame from this video as 3 matrices (because colors are parameterized by 3 number ([red,green,blue] or [hue,saturation,value] or something else).
At the moment I have this code:
videoObject = mmreader(fname);
imageData = read(videoObject, [1 5])
So, as far as I understand I extract the first 5 frames from the video. But I do not understand in what format the imageData
is given. For example, how can I get the green component of the color of the pixel from the third frame located at the row number 17 and column number 32?
Can anybody, please, help me with that?
As far as I understand it can be done in the following way. A particular frame can be reached in this way:
% Take frame number 7:
imageData = read(videoObject, 7);
Now if we want to know the read, green, blue component of the pixel in the column 1 and row 2 we need to do that:
impixel(imageData,1,2)
It will return 3 numbers (RGB component of the color of the pixel).