14 bit grayscale movie/image acquisition
Show older comments
I have a camera which has 8-14 bit-depth. I want to get a grayscale movie and then convert the movie to 14-bit grayscale images. I want to use image acquisition toolbox of MATLAB to acquire the movie and then convert the movie to 14-bit images. My questions are: 1) Do I need to set any parameter in the camera to get 14-bit movie (and subsequently images) or 14 bit parameter should be set when I want to convert the movie to images?
2)How can I convert a movie to 14-bit images in MATLAB?
Answers (2)
Image Analyst
on 3 Oct 2013
0 votes
Look at the parameters in imaqtool. Do you see anything there about selecting 14 bit mode?
15 Comments
Ronaldo
on 4 Oct 2013
Image Analyst
on 4 Oct 2013
read() can give you one color frame from the video. Just specify what frame number you want. Then use imshow() to display it. Or read the whole gigantic video like you did, if you have enough memory
oneFrame = vidFrames(:,:,:, 1); % Extract frame #1.
imshow(oneFrame);
Ronaldo
on 4 Oct 2013
Edited: Walter Roberson
on 7 Aug 2017
Image Analyst
on 4 Oct 2013
That might be determined by the Video Mode rather than the Returned color space. Call them and ask them. I haven't played around with trying to capture and save live video as gray scale so I can't say for sure. What video modes show up as options to select?
Ronaldo
on 4 Oct 2013
Image Analyst
on 4 Oct 2013
And did you pick the grayscale option?
Ronaldo
on 4 Oct 2013
Image Analyst
on 4 Oct 2013
Let me see your line that says something like:
vidobj = videoinput('winvideo', 1, 'grayscale');
What does your videoinput line look like?
Ronaldo
on 4 Oct 2013
Edited: Walter Roberson
on 7 Aug 2017
Image Analyst
on 4 Oct 2013
The line
vid = videoinput('winvideo', 1, 'MJPG_1024x768');
does not say grayscale. What shows up in the imagqtool command window when you connect a video to the gray scale adapter? That's the line you want to copy to your program.
Ronaldo
on 4 Oct 2013
Image Analyst
on 4 Oct 2013
I'm confused. I thought you said these modes were listed: "rgb, grayscale, YCbCr." Is that not correct?
Ronaldo
on 4 Oct 2013
Image Analyst
on 5 Oct 2013
This is what it says about that:
Setting the Color Space
Use Color Space on the General tabto set the color space for the selected device format. The ReturnedColor Space field has three options: rgb, YCbCr,and grayscale. The setting that is your deviceformat's default color space is shown as the default. You can usethe arrow to select another setting.
Additionally, if the default color space is grayscale,a value of bayer will be available in the ReturnedColor Space field for some devices, and the BayerSensor Alignment field will also be displayed. Use thedrop-down list to select one of the four possible sensor alignments.This feature allows the tool to demosaic Bayer patterns returned bythe hardware and interpolate them into standard RGB color images.For more information about this feature, see the BayerSensorAlignment propertyreference page.
So it appears that if you say grayscale it should be grayscale. If it's not then you'll have to call them. I don't have a camera on this computer so I can't try anything to help you.
The following post shows a relevant example:
Categories
Find more on Matrox Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!