?? srdemo.m
字號(hào):
LR = handles.LR;
[X,Y]=meshgrid(1:size(LR, 2), 1:size(LR, 1));
for i=1:size(LR, 3)
LR(:,:,i)=interp2(X+Dr(i,1), Y+Dr(i,2), LR(:,:,i), X, Y, '*nearest');
end
catch
err = lasterror;
errordlg(err.message,'Parsing error');
end
function txtResFactor_Callback(hObject, eventdata, handles)
% hObject handle to txtResFactor (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 txtResFactor as text
% str2double(get(hObject,'String')) returns contents of txtResFactor as a double
% --- Executes during object creation, after setting all properties.
function txtResFactor_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtResFactor (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 txtPsfSize_Callback(hObject, eventdata, handles)
% hObject handle to txtPsfSize (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 txtPsfSize as text
% str2double(get(hObject,'String')) returns contents of txtPsfSize as a double
% --- Executes during object creation, after setting all properties.
function txtPsfSize_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtPsfSize (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 txtAlpha_Callback(hObject, eventdata, handles)
% hObject handle to txtAlpha (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 txtAlpha as text
% str2double(get(hObject,'String')) returns contents of txtAlpha as a double
% --- Executes during object creation, after setting all properties.
function txtAlpha_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtAlpha (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 txtBeta_Callback(hObject, eventdata, handles)
% hObject handle to txtBeta (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 txtBeta as text
% str2double(get(hObject,'String')) returns contents of txtBeta as a double
% --- Executes during object creation, after setting all properties.
function txtBeta_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtBeta (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 txtLambda_Callback(hObject, eventdata, handles)
% hObject handle to txtLambda (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 txtLambda as text
% str2double(get(hObject,'String')) returns contents of txtLambda as a double
% --- Executes during object creation, after setting all properties.
function txtLambda_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtLambda (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 txtP_Callback(hObject, eventdata, handles)
% hObject handle to txtP (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 txtP as text
% str2double(get(hObject,'String')) returns contents of txtP as a double
% --- Executes during object creation, after setting all properties.
function txtP_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtP (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 txtIterNum_Callback(hObject, eventdata, handles)
% hObject handle to txtIterNum (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 txtIterNum as text
% str2double(get(hObject,'String')) returns contents of txtIterNum as a double
% --- Executes during object creation, after setting all properties.
function txtIterNum_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtIterNum (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 txtPsfSig_Callback(hObject, eventdata, handles)
% hObject handle to txtPsfSig (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 txtPsfSig as text
% str2double(get(hObject,'String')) returns contents of txtPsfSig as a double
% --- Executes during object creation, after setting all properties.
function txtPsfSig_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtPsfSig (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 DisplayHRImage(hObject, handles)
axes(handles.axesHR);
if get(handles.cbSelectHR, 'Value')
imagesc(handles.HR);
else
imagesc(handles.prevHR);
end
colormap('gray')
axis(handles.axesHR,'off');
% --- Executes on button press in cbSelectHR.
function cbSelectHR_Callback(hObject, eventdata, handles)
% hObject handle to cbSelectHR (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of cbSelectHR
DisplayHRImage(hObject, handles)
if get(handles.cbSelectHR, 'Value')
set(handles.cbSelectHR, 'String', 'Displaying Current Image');
else
set(handles.cbSelectHR, 'String', 'Displaying Previous Image');
end
% Update handles structure
guidata(hObject, handles);
% --- Executes on button press in cmdSaveLR.
function cmdSaveLR_Callback(hObject, eventdata, handles)
% hObject handle to cmdSaveLR (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[FileName,PathName] = uiputfile('*.jpg','Save image file');
if FileName ~= 0
imwrite(uint8(handles.LR(:,:,handles.LRDisplayI)), [PathName FileName]);
end
% --- Executes on button press in cbShowReg.
function cbShowReg_Callback(hObject, eventdata, handles)
% hObject handle to cbShowReg (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of cbShowReg
UpdateLRDisplay(hObject, handles)
if get(handles.cbShowReg, 'Value')
set(handles.cbShowReg, 'String', 'Displaying Unregistered Images');
else
set(handles.cbShowReg, 'String', 'Displaying Registered Images');
end
% Update handles structure
guidata(hObject, handles);
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -