A list,

Based on MATLAB GUI image watershed segmentation + gray geometric correction + motion image restoration

Ii. Source code

 function varargout = finalwork(varargin)
% FINALWORK M-file for finalwork.fig
%      FINALWORK, by itself, creates a new FINALWORK or raises the existing
%      singleton*.
%
%      H = FINALWORK returns the handle to a new FINALWORK or the handle to
%      the existing singleton*.
%
%      FINALWORK('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in FINALWORK.M with the given input arguments.
%
%      FINALWORK('Property'.'Value',...). creates anew FINALWORK or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before finalwork_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to finalwork_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one % instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help finalwork
 

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @finalwork_OpeningFcn, ...
                   'gui_OutputFcn',  @finalwork_OutputFcn, ...
                   'gui_LayoutFcn', [],...'gui_Callback'[]);if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before finalwork is made visible.
function finalwork_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to finalwork (see VARARGIN)

% Choose default command line output for finalwork
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes finalwork wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = finalwork_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global img 
global info
[filename,pathname]=uigetfile({'*.bmp';'*.tif';'*.jpg';'*.gif';'*. *'},'Select picture');
if pathname == 0
    return;
end
str=[pathname filename];
info=imfinfo(str);
img=imread(str);
axes(handles.axes1);
imshow(img);

% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
clc;
clear;
close(gcbf);

% --- Executes during object creation, after setting all properties.
function axes1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to axes1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'xTick'[]),;
set(hObject,'ytick'[]);set(hObject,'box'.'on');
% Hint: place code in OpeningFcn to populate axes1


% --- Executes during object creation, after setting all properties.
function axes2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to axes2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'xTick'[]),;
set(hObject,'ytick'[]);set(hObject,'box'.'on');
% Hint: place code in OpeningFcn to populate axes2


% --- Executes when selected object is changed in uipanel1.
function uipanel1_SelectionChangeFcn(hObject, eventdata, handles)
% hObject    handle to the selected object in uipanel1 
% eventdata  structure with the following fields (see UIBUTTONGROUP)
%	EventName: string 'SelectionChanged' (read only)
%	OldValue: handle of the previously selected object or empty if none was selected
%	NewValue: handle of the currently selected object
% handles    structure with handles and user data (see GUIDATA)
global img
global info
str=get(hObject,'String');
[m n]=size(img);
axes(handles.axes2);
switch str
    case 'Result reset'
        cla ;
    case 'Watershed division'
       
        img_watershed=graywatershed(img);
        waitbar(1,h,'ok! ');
        pause(0.6);
        delete(h);
        imshow(img_watershed);
    case 'Geometric correction'
        
        waitbar(1/m*n*2,h,'ok! ');
        pause(0.6);
        delete(h); imshow(IMG); figure ,imshow(B); title('Hough's transformed image');
        xlabel('\theta'), ylabel('\rho');
        axis on, axis normal, hold on;


    
end
clear;

% --- Executes during object creation, after setting all properties.
function uipanel1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to uipanel1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles notCreated until after all CreateFcns called % Calculates the size of the new image, as well as the 1 of the new image, exact registration point IMGXY1=[im1X,im1Y]*rotmatrix;
IMGXY2=[im1X,1]*rotmatrix;
IMGXY3=[1.1]*rotmatrix;
IMGXY4=[1,im1Y]*rotmatrix;
IMGp11=[min([IMGXY1(1),IMGXY2(1),IMGXY3(1),IMGXY4(1)]),min([IMGXY1(2),IMGXY2(2),IMGXY3(2),IMGXY4(2)])];
IMGX=round(max([IMGXY1(1),IMGXY2(1),IMGXY3(1),IMGXY4(1)])-IMGp11(1));
IMGY=round(max([IMGXY1(2),IMGXY2(2),IMGXY3(2),IMGXY4(2)])-IMGp11(2)); % Create a new imageif (info.BitDepth)==8
IMG=uint8(zeros(IMGX,IMGY))+255; % grayscale imageelse IMG=(zeros(IMGX,IMGY))+255; % binary image endCopy the code

3. Operation results





Fourth, note

Version: 2014 a