MATLAB camera gives dark image.?

clear all;clc
a = imaqhwinfo;
[camera_name, camera_id, format] = getCameraInfo(a);
vid = videoinput(camera_name, camera_id, format);
set(vid, 'ReturnedColorSpace', 'RGB');
%vid = videoinput('winvideo',1, 'YUV2_1280x720')
img = getsnapshot(vid);
When i capture image from this writtern code, it captures image immediately, and not giving time for camera to set its resolution and image seems black and dark.
How to give some time to camera for waiting to capture good image..?

답변 (1개)

Image Analyst
Image Analyst 2016년 4월 5일

1 개 추천

Either set the exposure:
src = getselectedsource(vidobj);
src.Exposure = newValue; % Make it higher for brighter images.
Or open up the iris diaphragm, if the camera lens has one.

댓글 수: 4

I am not getting any Exposure Option, I am getting only following options. I tried to set
Framerate = 90.
But still image being captured immediately, and camera not getting good exposure time to clear image.
General Settings:
Parent = [1x1 videoinput]
Selected = on
SourceName = input1
Tag =
Type = videosource
Device Specific Properties:
BacklightCompensation = on
Brightness = 0
Contrast = 33
FrameRate = 30.0000
Gamma = 100
Hue = 0
Saturation = 62
Sharpness = 3
WhiteBalance = 4000
WhiteBalanceMode = auto
Image Analyst
Image Analyst 2016년 4월 7일
Maybe try reducing the frame rate to collect more light. Or bump up the brightness value to add an offset to the image. Or change the Gamma to 240 or something.
Nimisha
Nimisha 2016년 4월 23일
i did not know what is the code syntax to change frame rate
Try
src.FrameRate = 10;
or whatever you used. Maybe you called it input1 instead of src, if so use input1.FrameRate = 10.

댓글을 달려면 로그인하십시오.

질문:

2016년 4월 5일

댓글:

2016년 4월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by