一、簡介
基于matlab 影像RGB三色的合成、分離
二、源代碼
function varargout = rgb1(varargin)
% RGB1 M-file for rgb1.fig
% RGB1, by itself, creates a new RGB1 or raises the existing
% singleton*.
%
% H = RGB1 returns the handle to a new RGB1 or the handle to
% the existing singleton*.
%
% RGB1('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in RGB1.M with the given input arguments.
%
% RGB1('Property','Value',...) creates a new RGB1 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before rgb1_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to rgb1_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
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help rgb1
% Last Modified by GUIDE v2.5 17-Dec-2008 10:31:18
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @rgb1_OpeningFcn, ...
'gui_OutputFcn', @rgb1_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 rgb1 is made visible.
function rgb1_OpeningFcn(hObject, eventdata, handles, varargin)
A=imread('aa.jpg');
axes(handles.axes1);
imshow(A);
% 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 rgb1 (see VARARGIN)
% Choose default command line output for rgb1
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes rgb1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = rgb1_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 selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
global A;
val=get(hObject,'value');
if(val==1)
A=imread('aa.jpg');
elseif(val==2)
A=imread('a.jpg');
elseif(val==3)
A=imread('b.jpg');
end
axes(handles.axes1);
imshow(A);
% 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 = 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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
三、運行結果



四、備注
完整代碼或者代寫添加QQ 1564658423
往期回顧>>>>>>
【信號處理】基于matlab HMM的睡眠狀態檢測【含Matlab原始碼 050期】
【信號處理】基于matlab CDR噪聲和混響抑制【含Matlab原始碼 051期】
【信號處理】基于matlab最小二乘法解決稀疏信號恢復問題【含Matlab原始碼 052期】
【信號處理】基于matlab小波變換的音頻水印嵌入提取【含Matlab原始碼 053期】
【信號處理】基于matlab ICA演算法信號分離【含Matlab原始碼 054期】
【信號處理】基于matlab GUI界面的脈搏信號之脈率存檔【含Matlab原始碼 237期】
【信號處理】基于matlab GUI界面的虛擬信號發生器(各種波形)【含Matlab原始碼 271期】
【信號處理】基于matlab GUI界面信號發生器之電子琴【含Matlab原始碼 272期】
【信號處理】基于matlab的數字電子琴設計與實作【含Matlab原始碼 273期】
【雷達通信】基于matlab的雷達數字信號處理【含Matlab原始碼 281期】
【雷達通信】基于matlab線性調頻(LFM)脈沖壓縮雷達仿真【含Matlab原始碼 283期】
【雷達通信】基于mtatlab距離多普勒(RD)、CS、RM演算法的機載雷達成像【含Matlab原始碼 284期】
【雷達通信】《現代雷達系統分析與設計》大作業【含Matlab原始碼 285期】
【信號處理】基于matlab GUI語音信號綜合處理平臺【含Matlab原始碼 290期】
【信號處理】基于matlab GUI語音信號采集【含Matlab原始碼 291期】
【信號處理】基于matlab GUI語音幅度調制【含Matlab原始碼 292期】
【信號處理】基于matlab GUI語音合成【含Matlab原始碼 293期】
【信號處理】基于matlab GUI語音基頻識別【含Matlab原始碼 294期】
【信號處理】基于matlab GUI語音信號加密解密【含Matlab原始碼 295期】
【信號處理】基于matlab小波變換的語音增強【含Matlab原始碼 296期】
【信號處理】基于matlab GUI語音傅立葉變換降噪混頻【含Matlab原始碼 297期】
【信號處理】基于matlab GUI維納濾波之語音增強【含Matlab原始碼 298期】
【音頻處理】基于matlab GUI語音信號處理2【含Matlab原始碼 299期】
【雷達通信】基于matlab GUI雷達定位【含Matlab原始碼 302期】
【雷達通信】基于matlab GUI雷達脈沖壓縮【含Matlab原始碼 303期】
【雷達通信】基于matlab GUI雷達定位模擬【含Matlab原始碼 304期】
【雷達通信】基于matlab SVM識別雷達資料【含Matlab原始碼 305期】## 標題
【邊緣檢測】基于matlab插值法亞像素邊緣檢測【含Matlab原始碼 306期】
【模式識別】基于matlab GUI貝葉斯最小錯誤率手寫數字識別【含Matlab原始碼 308期】
【模式識別】基于matlab PCA手寫數字識別【含Matlab原始碼 309期】
【模式識別】基于matlab 特征匹配的英文印刷字符識別【含Matlab原始碼 310期】
【模式識別】基于matlab知識庫的手寫體數字識別【含Matlab原始碼 311期】
【模式識別】基于matlab之銀行卡數字識別【含Matlab原始碼 312期】
【影像識別】基于matlab表情檢測【含Matlab原始碼 317期】
【影像檢測】基于matlab LSD直線檢測【含Matlab原始碼 318期】
【影像融合】紅外與可見光的融合與配準演算法【含Matlab原始碼 319期】
【影像識別】基于matlab幀差法跌倒檢測【含Matlab原始碼 320期】
【影像識別】基于matlab組合BCOSFIRE過濾器進行墻體裂縫識別【含Matlab原始碼 321期】
【模式識別】基于matlab中值濾波和二值化的跌倒檢測【含Matlab原始碼 344期】
【影像隱寫】基于matlab DCT的影像隱寫【含Matlab原始碼 365期】
【影像隱寫】基于matlab LSB的影像隱寫提取【含Matlab原始碼 366期】
【影像隱寫】基于matlab高斯模型的JPEG影像隱寫【含Matlab原始碼 367期】
【影像隱寫】基于matlab影像自適應隱寫演算法wow【含Matlab原始碼 368期】
【模式識別】基于matlab GUI SVM和PCA的人臉識別【含Matlab原始碼 369期】
【視頻識別】基于matlab軌跡方法行為識別【含Matlab原始碼 375期】
【模式識別】基于matlab GUI HSV和RGB模型水果分類【含Matlab原始碼 380期】
【影像處理】基于matlab GUI數字影像處理平臺【含Matlab原始碼 381期】
【影像分割】基于matlab的視網膜影像分割【含Matlab原始碼 382期】
【模式識別】基于matlab k-means聚類的手勢識別【含Matlab原始碼 386期】
【影像處理】基于Hough變換的人眼虹膜定位【含Matlab原始碼 387期】
【影像處理】基于matlab Kalman濾波的目標跟蹤【含Matlab原始碼 388期】
【影像分割】基于matlab GAC水平集方法實作影像分割【含Matlab原始碼 389期】
【影像分割】基于matlab 分水嶺演算法的影像分割【含Matlab原始碼 390期】
【影像去噪】基于小波變換的影像去噪【含Matlab原始碼 391期】
【影像融合】基于matlab小波變換的影像融合【含Matlab原始碼 392期】
【影像識別】基于matlab影像識別物體計數【含Matlab原始碼 393期】
【影像增強】基于matlab模糊集的影像增強【含Matlab原始碼 394期】
【影像檢索】基于matlab GUI綜合特征的影像檢索【含Matlab原始碼 395期】
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/264156.html
標籤:其他
