用matlab怎样产生运动模糊图像,运动图像包括匀速直线运动,匀加速运动,高频运动

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用matlab怎样产生运动模糊图像,运动图像包括匀速直线运动,匀加速运动,高频运动相关的知识,希望对你有一定的参考价值。

根据物理公式,求代码

[I1,map]=imread('fenj-mf.jpg'); %读入运动模糊图像
figure(1);
imshow(I1);
len=30;
theta=45;
initpsf=fspecial('motion',len,theta); %建立复原点扩散函数
[J,P]=deconvblind(I1,initpsf,30); %去卷积
figure(2);
imshow(J); %显示结果图像如图4-7c(所示)
figure(3);
imshow(P,[],'notruesize');
参考技术A 一种位移时间图像的位移的大小和时间的函数,而水平轴表示时间,垂直轴表示的位移,如果该对象是一个离开从原点位置时的定时,即t = 0时, s = 0时。 ,在定时的时间,如果该对象已不在原点,从原点在一定的距离,即t = 0时,s = 5,此图像,但坐标原点。
2,而轨迹是不同的时间位置的连接,上面是没有时间。
3与ST的图像的轨迹不是唯一的。实施例中,从A右匀速运动到B,它是日图像对象是不是唯一的一个。与您所选择的正方向,与零的位置,你选择。如果你选择了左边的是积极的,立场是零位时,开始计时,T = 0,S = 0,此后T> 0,s为负值,ST t轴下面的图片。
???如果你采取正确的为阳性,T,s是一个正值,ST上图中的T-轴。

春猎狼英]团队为您解答追问

哥,我是求代码

图像修复图像运动模糊消除(逆滤波)matlab源码

一、简介

基于matlab GUI运动模糊消除(逆滤波)

二、源代码

function varargout = motion_remove(varargin)
% MOTION_REMOVE M-file for motion_remove.fig
%      MOTION_REMOVE, by itself, creates a new MOTION_REMOVE or raises the existing
%      singleton*.
%
%      H = MOTION_REMOVE returns the handle to a new MOTION_REMOVE or the handle to
%      the existing singleton*.
%
%      MOTION_REMOVE('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MOTION_REMOVE.M with the given input arguments.
%
%      MOTION_REMOVE('Property','Value',...) creates a new MOTION_REMOVE or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before motion_remove_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to motion_remove_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 motion_remove

% Last Modified by GUIDE v2.5 27-Apr-2021 17:53:02

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @motion_remove_OpeningFcn, ...
                   'gui_OutputFcn',  @motion_remove_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin & isstr(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 motion_remove is made visible.
function motion_remove_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 motion_remove (see VARARGIN)
axes(handles.axes1);
img = imread('lena1.bmp');
imshow(img);
LEN = 30;
THETA = 45;
PSF = fspecial('motion',LEN,THETA);
MF = imfilter(img,PSF,'circular','conv');
axes(handles.axes2);
imshow(MF);
INITPSF = fspecial('motion',LEN,THETA);
[J,P] = deconvblind(MF,INITPSF,30);
axes(handles.axes3);
imshow(J);
set(handles.len_edit,'string',30);
set(handles.theta_edit,'string',45);
% Choose default command line output for motion_remove
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = motion_remove_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 during object creation, after setting all properties.
function len_edit_CreateFcn(hObject, eventdata, handles)
% hObject    handle to len_edit (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'));
end



function len_edit_Callback(hObject, eventdata, handles)
% hObject    handle to len_edit (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 len_edit as text
%        str2double(get(hObject,'String')) returns contents of len_edit as a double


% --- Executes during object creation, after setting all properties.
function theta_edit_CreateFcn(hObject, eventdata, handles)
% hObject    handle to theta_edit (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'));
end



function theta_edit_Callback(hObject, eventdata, handles)
% hObject    handle to theta_edit (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 theta_edit as text
%        str2double(get(hObject,'String')) returns contents of theta_edit as a double


% --- Executes on button press in apply_button.
function apply_button_Callback(hObject, eventdata, handles)
% hObject    handle to apply_button (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
LEN = str2num(get(handles.len_edit,'string'));
THETA = str2num(get(handles.theta_edit,'string'));
img = getimage(handles.axes1);
PSF = fspecial('motion',LEN,THETA);
MF = imfilter(img,PSF,'circular','conv');
axes(handles.axes2);
imshow(MF);
INITPSF = fspecial('motion',LEN,THETA);
[J,P] = deconvblind(MF,INITPSF,30);
axes(handles.axes3);
imshow(J);

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

% --- Executes during object creation, after setting all properties.
function image_pop_menu_CreateFcn(hObject, eventdata, handles)
% hObject    handle to image_pop_menu (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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'));
end


% --- Executes on selection change in image_pop_menu.
function image_pop_menu_Callback(hObject, eventdata, handles)
% hObject    handle to image_pop_menu (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
LEN = str2num(get(handles.len_edit,'string'));
THETA = str2num(get(handles.theta_edit,'string'));
val = get(hObject,'value');
str = get(hObject,'string');
switch str{val}

三、运行结果

在这里插入图片描述

四、备注

版本:2014a

以上是关于用matlab怎样产生运动模糊图像,运动图像包括匀速直线运动,匀加速运动,高频运动的主要内容,如果未能解决你的问题,请参考以下文章

基于维纳滤波的图像运动模糊还原matlab仿真

运动学matlab模拟匀变速直线运动规律

运动图像序列增强重建的matlab设计和仿真

匀加速系统模式开发匀加速系统模式详解

图像运动去模糊(Motion Deblurring)代码

目标跟踪基于matlab光流法运动视频跟踪含Matlab源码 1357期