⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guidegrade.m

📁 dip函数 hough houghpeaks
💻 M
📖 第 1 页 / 共 3 页
字号:

%Storing the modified image for redo
assignin('base', 'originalimgredo', originalimgredo);

%Storing the old image as current image
assignin('base', 'originalimg', originalimgundo);

%Displaying the old image
axes(handles.axisoriginalimg);
imshow(real(originalimgundo));

%Enabling the Redo & Disabling Undo menu item
set(handles.EditRedo, 'Enable', 'on');
set(handles.EditUndo, 'Enable', 'off');

set(gcf,'pointer','arrow');
set(handles.lblstatus, 'String', 'Status: Ready', 'Foregroundcolor', 'Black');


% ----------------------
function EditRedo_Callback(hObject, eventdata, handles)
% hObject    handle to EditRedo (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.lblstatus, 'Foregroundcolor', 'Red');
set(handles.lblstatus, 'String', 'Status: Busy');
set(gcf,'pointer','watch');

%Reading the old image for redo
originalimgredo = evalin('base', 'originalimgredo');

%Storing the modified image as current image
assignin('base', 'originalimg', originalimgredo);

%Displaying the old image
axes(handles.axisoriginalimg);
imshow(real(originalimgredo));

%Diabling the Redo & Enabling Undo menu item
set(handles.EditRedo, 'Enable', 'off');
set(handles.EditUndo, 'Enable', 'on');

set(gcf,'pointer','arrow');
set(handles.lblstatus, 'String', 'Status: Ready', 'Foregroundcolor', 'Black');


% ----------------------
function EditCrop_Callback(hObject, eventdata, handles)
% hObject    handle to EditCrop (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
axes(handles.axisoriginalimg);
global comein;

%Enter only if image is opened first
if evalin('base', 'degimstatus') >= 1 & comein >= 1
    set(handles.lbleditstatus, 'Visible', 'on');
    set(gcf,'pointer','crosshair');
    set(handles.lblstatus, 'Foregroundcolor', 'Red');
    set(handles.lblstatus, 'String', 'Status: Starting Point');
    status = waitforbuttonpress;
    if status==0
        point1 = get(gca, 'CurrentPoint');
        point1 = round(point1(1,1:2)); % extract x1 and y1
        
        set(handles.lblstatus, 'String', 'Status: Ending Point');
        status = waitforbuttonpress;
        if status==0
            point2 = get(gca, 'CurrentPoint');
            point2 = round(point2(1,1:2)); % extract x2 and y2

            set(handles.lblstatus, 'String', 'Status: Busy');
            set(gcf,'pointer','watch');

            %Reading the original image
            originalimg = evalin('base', 'originalimg');

            %Storing the start and the end points irrespective of the
            %actual positions on the image
            startx = min(point1(2), point2(2));
            endx   = max(point1(2), point2(2));
            starty = min(point1(1), point2(1));
            endy   = max(point1(1), point2(1));
            
            %Cropping the image
            croppedimg = originalimg(startx:endx, starty:endy);

            %Backingup the old original image for Undo
            assignin('base', 'originalimgundo', originalimg);

            %Storing the cropped image
            assignin('base', 'originalimg', croppedimg);
            imshow(real(croppedimg));

            %Enabling the Undo menu item
            set(handles.EditUndo, 'Enable', 'on');
        end
    end
else
    uiwait(errordlg('Please open a file first.', 'Error', 'modal'));
end
set(handles.lbleditstatus, 'Visible', 'off');
set(gcf,'pointer','arrow');
set(handles.lblstatus, 'String', 'Status: Ready', 'Foregroundcolor', 'Black');


% ----------------------
function EditZoom_Callback(hObject, eventdata, handles)
% hObject    handle to EditZoom (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% ----------------------
function Filter_Callback(hObject, eventdata, handles)% hObject    handle to Filter (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% ----------------------
function FilterDegrade_Callback(hObject, eventdata, handles)% hObject    handle to FilterDegrade (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% ----------------------
function FilterRestore_Callback(hObject, eventdata, handles)% hObject    handle to FilterRestore (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% ----------------------
function RestoreInverse_Callback(hObject, eventdata, handles)% hObject    handle to RestoreInverse (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
%Closing the Degrade GUI & Opening the Restore GUI
assignin('base', 'algo', 1);
delete(gcf);
GUIRestore;
% ----------------------
function RestoreWiener_Callback(hObject, eventdata, handles)% hObject    handle to RestoreWiener (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
%Closing the Degrade GUI & Opening the Restore GUI
assignin('base', 'algo', 2);
delete(gcf);
GUIRestore;
% ----------------------
function RestoreLucyRichardson_Callback(hObject, eventdata, handles)% hObject    handle to RestoreLucyRichardson (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)%Closing the Degrade GUI & Opening the Restore GUI
assignin('base', 'algo', 3);
delete(gcf);
GUIRestore;

% ----------------------
function RestoreCompare_Callback(hObject, eventdata, handles)
% hObject    handle to RestoreCompare (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

%Closing the Degrade GUI & Opening the Compare GUI
delete(gcf);
GUICompare;


% ----------------------
function Help_Callback(hObject, eventdata, handles)% hObject    handle to Help (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% ----------------------
function HelpHelp_Callback(hObject, eventdata, handles)% hObject    handle to HelpHelp (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)set(handles.lblstatus, 'Foregroundcolor', 'Red');
set(handles.lblstatus, 'String', 'Status: Busy');
set(gcf,'pointer','watch');
web ([cd '\Help\Home.html'], '-browser');
set(gcf,'pointer','arrow');
set(handles.lblstatus, 'String', 'Status: Ready', 'Foregroundcolor', 'Black');
% ----------------------
function HelpAboutUs_Callback(hObject, eventdata, handles)% hObject    handle to HelpAboutUs (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)set(handles.lblstatus, 'Foregroundcolor', 'Red');
set(handles.lblstatus, 'String', 'Status: Busy');
set(gcf,'pointer','watch');
web ([cd '\Help\About Us.html'], '-browser');
set(gcf,'pointer','arrow');
set(handles.lblstatus, 'String', 'Status: Ready', 'Foregroundcolor', 'Black');

% ----------------------- End of GUIDegrade --------------------------
% --- Executes during object creation, after setting all properties.function sldlength_CreateFcn(hObject, eventdata, handles)% hObject    handle to sldlength (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: slider controls usually have a light gray background, change%       'usewhitebg' to 0 to use default.  See ISPC and COMPUTER.usewhitebg = 1;if usewhitebg    set(hObject,'BackgroundColor',[.9 .9 .9]);else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on slider movement.function sldlength_Callback(hObject, eventdata, handles)% hObject    handle to sldlength (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,'Value') returns position of slider%        get(hObject,'Min') and get(hObject,'Max') to determine range of sliderstr = sprintf('%.0f', get(handles.sldlength, 'Value'));
set(handles.txtlength, 'String', str);
% --- Executes during object creation, after setting all properties.function sldtheta_CreateFcn(hObject, eventdata, handles)% hObject    handle to sldtheta (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: slider controls usually have a light gray background, change%       'usewhitebg' to 0 to use default.  See ISPC and COMPUTER.usewhitebg = 1;if usewhitebg    set(hObject,'BackgroundColor',[.9 .9 .9]);else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on slider movement.function sldtheta_Callback(hObject, eventdata, handles)% hObject    handle to sldtheta (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,'Value') returns position of slider%        get(hObject,'Min') and get(hObject,'Max') to determine range of sliderstr = sprintf('%.0f', get(handles.sldtheta, 'Value'));
set(handles.txttheta, 'String', str);
% --- Executes during object creation, after setting all properties.function txtlength_CreateFcn(hObject, eventdata, handles)% hObject    handle to txtlength (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction txtlength_Callback(hObject, eventdata, handles)% hObject    handle to txtlength (see GCBO)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -