getsnapshot - Dark image compared to Fly Cap
4 次查看(过去 30 天)
显示 更早的评论
I've got a problem while using getsnapshot to automatize my image acquisition instead of using PointGrey FlyCap.
All I do is intializing my device and setting all the cam settings I want to have.
This is the Image that is provided by Fly Cap:![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/867490/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/867490/image.jpeg)
And it is of course the image I want to have. When i try to get a picture, with the same device and the same setting via Matlab getsnapshot, this will be the result:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/867495/image.jpeg)
Do I miss any settings?
The values i modify are: Brightness, Exposure, Sharpness, Gain, Gamma, FrameRate(15) and Shutter. But as I said i modify them to be smiliar to Fly Cap. Of course I change the Mode to 'manual' for every of the mentioned settings.
Anybody who could help?
回答(1 个)
Bhanu Prakash
2024-1-23
编辑:Bhanu Prakash
2024-1-23
Hi Pascal,
As per my understanding, you are facing an issue when you capture an image using the ‘getsnapshot’ function in MATLAB.
This is likely because of a digital artifact with your hardware. The first couple of frames provided by some hardware devices, especially webcams and video cards, may be of low quality and may appear as a dark image .
This artifact can be a result of the image sensor not having warmed up or the device just being started.
You can try the following options while capturing the image:
- When using the ‘getsnapshot’ function, keep the preview window running to avoid starting up the device and to maintain an active image stream.
- You can skip the starting frames (appearing as a dark image) after the device is triggered, using the ‘TriggerFrameDelay’ function in MATLAB as follows:
% Number of image frames to acquire.
N = 10;
% Access the device.
vid = videoinput('winvideo');
% Skip the first few frames after the device is %triggered.
set(vid, 'TriggerFrameDelay', 3);
% Configure the number of frames to acquire.
set(vid, 'FramesPerTrigger', N);
% Start the acquisition and have it trigger %immediately. Then access the data.
triggerconfig(vid, 'Immediate');
start(vid)
data = getdata(vid);
For more information on the ‘TriggerFrameDelay’ function, kindly refer to the following documentation:
Hope this helps!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!