Info

This question is closed. Reopen it to edit or answer.

What does the number digits represent when i adjust the brightness and contrast of the image? what does the lower and upper limit values do to the images? when the limit increases, what does it mean?

1 view (last 30 days)
Contrast:
function LLC_Callback(hObject, eventdata, handles) % hObject handle to LLC (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of LLC as text % str2double(get(hObject,'String')) returns contents of LLC as a double LLC = str2num(get(handles.LLC,'String')); handles.LLC = LLC; % Update handles structure guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function LLC_CreateFcn(hObject, eventdata, handles) % hObject handle to LLC (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function ULC_Callback(hObject, eventdata, handles) % hObject handle to ULB (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of ULB as text % str2double(get(hObject,'String')) returns contents of ULB as a double ULC = str2num(get(handles.ULC,'String')); handles.ULC = ULC; % Update handles structure guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function ULC_CreateFcn(hObject, eventdata, handles) % hObject handle to ULB (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in pushbutton13. function adjust_contrast_Callback(hObject, eventdata, handles) % hObject handle to pushbutton13 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) AFMimage = handles.AFM_Adjust; LLC = handles.LLC; ULC = handles.ULC; adjimage = imadjust(AFMimage,[LLC ULC],[]); handles.AFM_Adjust = adjimage; axes(handles.axes1); imshow(adjimage); axes(handles.axes4); imhist(adjimage); % Update handles structure guidata(hObject, handles); Brightness:
function LLB_Callback(hObject, eventdata, handles) % hObject handle to LLC (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of LLC as text % str2double(get(hObject,'String')) returns contents of LLC as a double LLB = str2num(get(handles.LLC,'String')); handles.LLB = LLB; % Update handles structure guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function LLB_CreateFcn(hObject, eventdata, handles) % hObject handle to LLC (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function ULB_Callback(hObject, eventdata, handles) % hObject handle to ULB (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of ULB as text % str2double(get(hObject,'String')) returns contents of ULB as a double ULB = str2num(get(handles.ULB,'String')); handles.ULB = ULB; % Update handles structure guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function ULB_CreateFcn(hObject, eventdata, handles) % hObject handle to ULB (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in adjust_brightness. function adjust_brightness_Callback(hObject, eventdata, handles) % hObject handle to adjust_brightness (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) AFMimage = handles.AFM_Adjust; LLB = handles.LLB; ULB = handles.ULB; adjimage = imadd(AFMimage, [LLB ULB]); handles.AFM_Adjust = adjimage; axes(handles.axes1); imshow(adjimage); axes(handles.axes4); imhist(adjimage); % Update handles structure guidata(hObject, handles);

Answers (0)

Community Treasure Hunt

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

Start Hunting!