Simulink "From Multimedia File" only supports 256 gray levels?

조회 수: 1 (최근 30일)
Evan Slatyer
Evan Slatyer 2015년 3월 15일
편집: Evan Slatyer 2015년 3월 15일
Could someone confirm for me that the intensity resolution on Simulink's "From Multimedia File" block is limited to 8-bit (ie 256 gray levels), regardless of the input and output format?
I've been converting Matlab code (using VideoReader objects for reading video files) to Simulink (using the From Multimedia File block to read the same video files). The files in question are monochrome 16-bit lossless MJPEG2000, which were written using a Matlab VideoWriter object (so they're definitely something that can be handled by Matlab). I'm reading them in as uint16, which is the same format used to write them.
The files in question only have 14-bit intensity resolution (ie bottom two bits in each 16-bit value are always zero). When read in with a VideoReader object this works as expected; if I do mod(frame,4) then I get all zeros and if I do mod(frame,256) then I get lots of non-zero values. However, when read in with the Simulink From Multimedia File block, I find that actually the bottom eight bits are zero; so the top eight bits contain all the data and there are only 256 possible gray levels (compared to 16384 possible gray levels when using a VideoReader object). If I do mod(frame,256) on a frame from the From Multimedia File block then the result is all zeros. I'm guessing that somewhere the block drops everything down to 8-bit intensity resolution and then converts it to the requested format for output.
Confirmation of that, and ideas for working around it would be much appreciated. At the moment I'm planning to try a Video From Workspace block and let a VideoReader object do the work.
Thanks
Edit: Matlab 2013A 32-bit, Windows 7 x64.
The Video From Workspace block seems to do the job fine, except that I can't process the whole video because it doesn't all fit in the workspace.

답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by