function varargout = untitled(varargin)
% UNTITLED MATLAB code for untitled.fig
% UNTITLED, by itself, creates a new UNTITLED or raises the existing
% singleton*.
%
% H = UNTITLED returns the handle to a new UNTITLED or the handle to
% the existing singleton*.
%
% UNTITLED('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in UNTITLED.M with the given input arguments.
%
% UNTITLED('Property','Value',...) creates a new UNTITLED or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before untitled_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to untitled_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 untitled
% Last Modified by GUIDE v2.5 06-Jun-2012 10:20:06
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @untitled_OpeningFcn, ...
'gui_OutputFcn', @untitled_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 untitled is made visible.
function untitled_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 untitled (see VARARGIN)
% Choose default command line output for untitled
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes untitled wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = untitled_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;
% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Untitled_3_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Untitled_11_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=imread('1.jpg');%读图
figure,subplot(131),imshow(I);title('原图');
I=double(I);
I_moveresult=zeros(size(I));
H=size(I);
Move_x=0;
Move_y=150;
I_moveresult(Move_x+1:H(1),Move_y+1:H(2),1:H(3))=I(1:H(1)-Move_x,1:H(2)-Move_y,1:H(3));% ***平移模块****
subplot(132),imshow(uint8(I_moveresult));title('水平左平移');
I_moveresult1=zeros(size(I));
H=size(I);
Move_x=150;
Move_y=0;
I_moveresult1(Move_x+1:H(1),Move_y+1:H(2),1:H(3))=I(1:H(1)-Move_x,1:H(2)-Move_y,1:H(3));
subplot(133),imshow(uint8(I_moveresult1));title('垂直下平移');
% --------------------------------------------------------------------
function Untitled_12_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Untitled_13_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=imread('6.jpg');
BW=im2bw(I,0.37);
figure,subplot(121),imshow(I);title('原图');
subplot(122),imshow(BW);title('二值图');
% --------------------------------------------------------------------
function Untitled_14_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=imread('6.jpg');
BW=im2bw(I,0.37);
figure,subplot(121),imshow(BW);title('二值图');
BW=~BW,
subplot(122),imshow(BW),title('反色图');
% --------------------------------------------------------------------
function Untitled_4_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=imread('1.jpg');%读图
figure,subplot(121),imshow(I);title('原图'); % ***水平镜像****
I=double(I);
H=size(I);
I_flipud(1:H(1),1:H(2),1:H(3))=I(1:H(1),H(2):-1:1,1:H(3));
subplot(122),imshow(uint8(I_flipud));title('镜像后的图');
% --------------------------------------------------------------------
function Untitled_5_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=imread('1.jpg');%读图
figure,subplot(121),imshow(I);title('原图'); % ***垂直镜像***
I=double(I);
H=size(I);
I_flipud(1:H(1),1:H(2),1:H(3))=I(H(1):-1:1,1:H(2),1:H(3));
subplot(122),imshow(uint8(I_flipud));title('镜像后的图');
% --------------------------------------------------------------------
function Untitled_6_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A= imread('1.jpg');
figure,subplot(121),imshow(A);title('原图');
tform = maketform('affine',[2 0 0; 0 1 0 ; 0 0 1]); % ***水平拉伸****
B = imtransform(A,tform);
subplot(122),imshow(B);title('水平拉伸后的图');
% --------------------------------------------------------------------
function Untitled_7_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A= imread('1.jpg');
figure,subplot(121),imshow(A);title('原图');
tform = maketform('affine',[1 0 0; 0 2 0 ; 0 0 1]); % ***垂直拉伸***
B = imtransform(A,tform);
subplot(122),imshow(B);title('垂直拉伸后的图');
% --------------------------------------------------------------------
function Untitled_8_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=imread('1.jpg');
J1=imrotate(I,-45);
J2=i
tuxiangchuli.rar_matlab 图像处理
版权申诉
167 浏览量
2022-09-23
13:00:28
上传
评论
收藏 144KB RAR 举报
寒泊
- 粉丝: 76
- 资源: 1万+
最新资源
- 疯狂吃月饼游戏小程序前端源码
- 开源光谱分析仪博客的代码
- 基于深度学习的工业缺陷检测(续篇)
- 大创项目编程示例开发案列优质学习资料资源工具与案列应用场景开发文档教程资料.txt
- 树莓派智能车编程实例开发案列优质学习资料资源工具与案列应用场景开发文档教程资料.txt
- 电子设计竞赛(Electronic Design Contest) 开发案列优质学习资料资源工具与案列应用场景开发文档教程资料
- Cpu-Z 是一款计算机的CPU检测软件
- 美国大学生数学建模竞赛 开发案列优质学习资料资源工具与案列应用场景开发文档教程资料.txt
- 最新版点微同城源码34.7+全套插件+小程序前后端附图片
- 计算机二级 开发案列优质学习资料资源工具与案列应用场景开发文档教程资料.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0