Demosaic VS ReturnedColorspace bayer
Mostrar comentarios más antiguos
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;

2 comentarios
Walter Roberson
el 23 de Sept. de 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.)
Jeff
el 28 de Sept. de 2011
Respuestas (2)
Image Analyst
el 23 de Sept. de 2011
0 votos
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 comentarios
Jeff
el 23 de Sept. de 2011
Image Analyst
el 23 de Sept. de 2011
Can you try another sensor alignment, such as rggb? Maybe you picked the wrong arrangement. See what happens.
Jeff
el 23 de Sept. de 2011
Image Analyst
el 23 de Sept. de 2011
I don't know. How did you even find out about setting those properties? I don't see them in the help for videoinput(). Each video adapter can have special properties that are specific/unique to each camera. Unless your adapter is the generic "winvideo" I suggest you contact your camera manufacturer for an explanation of those properties.
Jeff
el 27 de Sept. de 2011
Jeff
el 27 de Sept. de 2011
Jeff
el 30 de Sept. de 2011
0 votos
Categorías
Más información sobre National Instruments Frame Grabbers en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!