I want to adjust the brightness of an image using slider.What can I do to make the slider start at middle position. What function should I use to make the image brighter if slider moved to the right and darker to the left?
2 ビュー (過去 30 日間)
古いコメントを表示
%this is my current slider callback
axes(handles.axes2);
hChildAxes2 = get(handles.axes2,'Children');
a=get(hChildAxes2(1),'CData');
b=get(hObject,'Value');
c=imadd(a,b);
imshow(c);
0 件のコメント
回答 (1 件)
SCOTT LIM
2017 年 2 月 24 日
In the GUIDE builder there is a slider icon. You can adjust the settings of the slider when you double click on the slider. You can change: 'Value' which is the starting position. 'Max' ' Min' which are your boundaries.
Im = imread('mypic.jpg');
offset = get(hObject,'Value');
Im = Im + offset ; %but u have to change the offset values to the correct data type as Im. e.g. uint8 or uint16(offset)
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!