How can i adjust brightness of a live video in image acquisition?

조회 수: 6 (최근 30일)
Sanjay Yadav
Sanjay Yadav 2017년 1월 20일
댓글: Rena Berman 2021년 5월 6일
I am using the Image Acquisition Toolbox to create a simple interactive GUI that should allow the user to preview the image and dynamically adjust the brightness of the video feed.
I'm using a slider to adjust the value of brightness between(-64 to 64), code looks like this:
vid = videoinput('winvideo',1);
src = getselectedsource(vid);
preview(vid);
bri = get(handles.BrightnessSlider,'Value');
if(bri > -65 || bri < 65 )
stoppreview(vid);
src.Brightness = bri;
preview(vid);
end
Problem here is that brightness isn't changing when I move the slider, the value on slider does change.
Please help me solving this error. Thanks in advance.

답변 (1개)

Walter Roberson
Walter Roberson 2017년 1월 20일
MATLAB does not use {} for code blocks.
  댓글 수: 1
Sanjay Yadav
Sanjay Yadav 2017년 1월 20일
Thanks, I didn't notice that. But there is still a problem. Maybe in logic this time.

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

카테고리

Help CenterFile Exchange에서 Logical (Boolean) Operations에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by