完成结果.zip

  • hurrys
    了解作者
  • matlab
    开发工具
  • 138KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2020-05-11 09:59
    上传日期
使用matlab 的GUI界面,添加多种图像增强函数,进行交互式操作
完成结果.zip
  • 完成结果
  • image_enhance.m
    7.6KB
  • image_enhance.fig
    38.7KB
  • imageMoon.jpg
    109.1KB
内容介绍
function varargout = image_enhance(varargin) % IMAGE_ENHANCE MATLAB code for image_enhance.fig % IMAGE_ENHANCE, by itself, creates a new IMAGE_ENHANCE or raises the existing % singleton*. % % H = IMAGE_ENHANCE returns the handle to a new IMAGE_ENHANCE or the handle to % the existing singleton*. % % IMAGE_ENHANCE('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in IMAGE_ENHANCE.M with the given input arguments. % % IMAGE_ENHANCE('Property','Value',...) creates a new IMAGE_ENHANCE or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before image_enhance_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to image_enhance_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 image_enhance % Last Modified by GUIDE v2.5 09-May-2020 09:32:40 % Begin initialization code - DO NOT EDIT %%%初始化 clc; global original; original = imread('imageMoon.jpg'); gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @image_enhance_OpeningFcn, ... 'gui_OutputFcn', @image_enhance_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 image_enhance is made visible. function image_enhance_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 image_enhance (see VARARGIN) % Choose default command line output for image_enhance handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes image_enhance wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = image_enhance_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 original; axes(handles.axes1); % 取整张图的三维尺寸 [m,n,l] = size(original); % 通过判断对象类型来决定是否转化为灰度图 if l>1 original = rgb2gray(original); end imshow(original) numb=get(handles.popupmenu1,'value'); % BW=edge(I,'sobel',thresh,direction) % 根据指定的敏感阈值thresh用Sobel算子对图像进行边缘检测, % edge函数忽略了所有小于阈值的边缘,如果没有指定阈值thresh或为空,函数自动选择参数值, % direction指定Sobel算子边缘检测的方向,其参数值为'horizontal','vertical'或'both'(默认)。 % [BW,thresh]=edge(I,'sobel');?? % %返回当前Sobel算子边缘检测的阈值 axes(handles.axes3); switch numb case 1% m = 255; H = histeq(original,m); imshow(H) case 2% new = StretchFunc(original, 0, 50, 0, 150 ); imshow(new) case 3% I=mat2gray(original); %对数变换不支持uint8类型的数据,将一个矩阵归一化为灰度图像的数据格式 new =log(I+1.2); imshow(new) case 4% J=imcomplement(original); imshow(J) case 5% transformed = LinearTransformFunc(original, 1, 150); imshow(transformed) case 6% %%%%%同态滤波 I3=homo_filter(original); imshow(I3,[]); end function LIST_SELECT_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on selection change in popupmenu1. function popupmenu1_Callback(hObject, eventdata, handles) % hObject handle to popupmenu1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array % contents{get(hObject,'Value')} returns selected item from popupmenu1 % --- Executes during object creation, after setting all properties. function popupmenu1_CreateFcn(hObject, eventdata, handles) % hObject handle to popupmenu1 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit1_Callback(hObject, eventdata, handles) % hObject handle to edit1 (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 edit1 as text % str2double(get(hObject,'String')) returns contents of edit1 as a double % --- Executes during object creation, after setting all properties. function edit1_CreateFcn(hObject, eventdata, handles) % hObject handle to edit1 (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 [ new ] = StretchFunc(original, x1, y1, x2, y2 ) % 分段线性变换 new = original; [w,h,l]=size(new); % w = size(new, 1); % h = size(new, 2); k1 = y1 / x1; dk1 = (y2 - y1) / (x2 - x1); dk2 = (255 - y2) / (255 - x2); for i = 1 : w for j = 1 : h x = new(i, j); if x < x1 new(i, j) = k1 * x; elseif x < x2 new(i, j) = dk1 * (x - x1) + y1; else new(i, j) = dk2 * (x - x2) + y2; end end end function new = homo_filter(original ) %%%%%同态滤波 I=double(original); [M,N]=size(I); rL=0.5; rH=4.7;%可根据需要效果调整参数 c=2; d0=10; I1=log(I+1);%取对数 FI=fft2(I1);%傅里叶变换 n1=floor(M/2); n2=floor(N/2); H = ones(M, N); for i=1:M for j=1:N D(i,j)=((i-n1).^2+(j-n2).^2); H(i,j)=(rH-rL).*(exp(c*(-D(i,j)./(d0^2))))+rL;%高斯同态滤波 end end I2=ifft2(H.*FI);%傅里叶逆变换 new=real(exp(I2)); function [ new ] = LinearTransformFunc( original, k, b ) % 线性变换 new = original * k + b;
评论
    相关推荐
    • 图像增强.zip
      利用卷积对图像进行增强处理,其中选择编选检测算子等
    • 图像增强.rar
      可以将图像增加清晰度,实现图像的清晰化,直接加载图像就可以用。
    • MATLAB GUI图像处理.zip
      图像处理基本功能MATLAB GUI界面设计,包括功能有图像去噪,图像增强,边缘检测,人脸检测等等......包括设计报告
    • MATLAB 图像增强.zip
      本程序时用matlab 软件编写的图像增强程序
    • MATLAB增强GUI
      包含拉普拉斯增强,直方图增强及SOBER增强
    • matlabgui源码--MATLAB-GUI-:基于MATLAB的图像处理GUI软件
      本资源为基于MATLAB设计的数字图像处理软件源码,有自己设计的GUI、移植于MATLAB官网的标签页设计方法,实现基础的数字图像处理任务,包含各种图像加噪、去噪、空间变换、边缘检测、尺度变换、图像增强、图像分析的...
    • 数字图像处理大作————图像算法gui
      开始\图像类型变换\图形几何运算\图像变换\图像添加噪声\图像复原\图像增强\图像分割
    • matlab数字图像处理gui设计.rar
      通过GUI界面对图像进行一些简单的处理,有图像复原、压缩、增强、滤波、裁剪、亮度调节、添加滤镜等等基本图像算法实现的功能。需要的可以下载,不懂可以私信我。
    • 基于MATLAB的图像处理GUI软件设计
      本资源为基于MATLAB设计的数字图像处理软件源码,有自己设计的GUI、移植于MATLAB官网的标签页设计方法,实现基础的数字图像处理任务,包含各种图像加噪、去噪、空间变换、边缘检测、尺度变换、图像增强、图像分析的...
    • MATLAB GUI摄像头视频图像增强系统
      使用前在matlab的主页附件功能中搜索安装Image Acquisition Toolbox Support Package for OS Generic Video Interface-------调用电脑摄像头拍摄视频进行视频图像增强,然后在GUI界面播放