Why do I receive a black preview window with videoinput preview?

Technical Source
2 min readJan 7, 2022

I am using a Hamamatsu C8484–05C camera with the Image Acquisition Toolbox. I have created a VIDEOINPUT object by making use of the Hamamatsu adaptor as follows:

vid = videoinput('hamamatsu',1)

However, when I try to preview the video feed from my camera using the PREVIEW functionality:

preview(vid)

The preview window opens but all I see is a black image.

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

This is a common issue since many cameras (including the Hamamatsu C8484–05C) do not return 16-bit data and so they do not send a frame that spans the full range of a 16-bit frame.

For example, if the camera’s sensor is 12-bit, the frame data in a 16-bit mode can range as high as 2¹⁶-1=65535 but the camera will only return 12-bit data which will be limited to 2¹²-1=4095. Therefore, the maximum pixel value from the camera is 4095. However, the maximum value for the data type is 65535 and so the pixels appear black or dark blue.

If using MATLAB R2008b or later, a possible workaround is to use the following command before creating the videoinput object:

imaqmex('feature', '-previewFullBitDepth', true);

You can also configure the preview axes CDataMapping and CLim properties.

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.