Demosaic VS ReturnedColorspace bayer
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a 1920 x 1080 color camera that uses a bayer filter. I get the image with a NI camera link frame grabber.
If I get the image my taking a snap shot and applying a demosaic, the resulting image is correct.
If I try to set the .ReturnedColorspace = 'bayer', I get an image that has two additonal ghosts images (one above, one below) and the image appears to have an internlace misalignment.
Can anyone tell me why these give different results? Better yet, can anyone tell me how to set the videoinput properties to allow the ReturnedColorspace to work? I want the ReturnedColorspace technique to work since I would then be able to use the Preview command on the videoinput, vid.
clear all;
clc;
%%Demosaic
vid = videoinput('ni', 2, 'img0_Port1');
I = getsnapshot(vid);
J = demosaic(I, 'grbg');
figure;
imshow(J);
delete(vid);
clear vid;
%%Bayer Filter
vid = videoinput('ni', 2, 'img0_Port1');
vid.ReturnedColorspace = 'bayer';
vid.BayerSensorAlignment = 'grbg';
K = getsnapshot(vid);
figure;
imshow(K);
delete(vid);
clear vid;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/145977/image.jpeg)
2 Kommentare
Walter Roberson
am 23 Sep. 2011
Maybe asking for bayer makes the camera shake??
(I would add a wink to show I'm not serious, but... well, it _could_ happen.)
Antworten (2)
Image Analyst
am 23 Sep. 2011
Is the image monochrome? Is it possible that it's giving you the separate (raw) images? If it's color, maybe it's doing that but tinting the green image green, the red image red, and the blue image blue so that it looks color even though it's not - it's just the raw mosaiced image. Just guessing... Is it possible you could upload an image somewhere? Sorry I don't have a web cam on this computer or else I'd try your code.
6 Kommentare
Siehe auch
Kategorien
Mehr zu National Instruments Frame Grabbers finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!