I'm using step function to read frames from a video (using vision.VideoFileReader
), the image result is a Bayer one and three dimensions, the problem is that I can't move from Bayer to grayscale using 'demosaic' function.
The image that I obtained is from 0-1.
to explain more :
When I show size of image I obtain [1024 1024 3], normally I use demosaic
to move from Bayer to RGB and then from RGB to grayscale. The demosaic
function is apllied on an image 2D.
Code :
function obj = setupSystemObjects2()
obj.reader = vision.VideoFileReader(video);
obj.videoPlayer = vision.VideoPlayer('Position', [20, 400, 700, 400]);
end
function frame = readFrame()
frame = obj.reader.step();
end
Thanks for help.