Demosaic VS ReturnedColorspace bayer
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Walter Roberson
2011-9-23
Maybe asking for bayer makes the camera shake??
(I would add a wink to show I'm not serious, but... well, it _could_ happen.)
回答(2 个)
Image Analyst
2011-9-23
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 National Instruments Frame Grabbers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!