Analysis class P2
Show older comments
HSI, CMY e imagens em RGB separado
function varargout = guidep2(varargin)
% GUIDEP2 MATLAB code for guidep2.fig
% GUIDEP2, by itself, creates a new GUIDEP2 or raises the existing
% singleton*.
%
% H = GUIDEP2 returns the handle to a new GUIDEP2 or the handle to
% the existing singleton*.
%
% GUIDEP2('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUIDEP2.M with the given input arguments.
%
% GUIDEP2('Property','Value',...) creates a new GUIDEP2 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before guidep2_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to guidep2_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 guidep2
% Last Modified by GUIDE v2.5 07-Dec-2022 11:01:27
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @guidep2_OpeningFcn, ...
'gui_OutputFcn', @guidep2_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 guidep2 is made visible.
function guidep2_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 guidep2 (see VARARGIN)
% Choose default command line output for guidep2
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes guidep2 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = guidep2_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 im1
im1 = imread(uigetfile('.jpg;.gif;.tif;.png')); %abrir imagem
axes(handles.axes1);%direcionar para o eixo 1
imshow(im1);%mostrar a imagem
% --- 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)
global im1
cmy = imcomplement (im1);
axes(handles.axes2);%direcionar para o eixo 2
imshow(cmy)
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global im1
hsi = rgb2hsv(im1);
axes(handles.axes3);%direcionar para o eixo 3
imshow(hsi);
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global im1 Red Green Blue
%criar componentes em RGB separadas
R= im1 (:,:,1);
G= im1 (:,:,2);
B= im1 (:,:,3);
Red = cat(3,R,G*0,B*0);
Green = cat (3,R*0,G,B*0);
Blue = cat (3,R*0,G*0,B);
axes (handles.axes2);%direciona pro eixo 2
imshow(Red);
axes (handles.axes3);%direcionar pro eixo 3
imshow(Green);
axes (handles.axes4);%direcionar eixo 4
imshow(Blue);
cor = cat(2, Red, Green, Blue);%mostra as 3 imaegens juntas
axes(handles.axes5);%direciona pro eixo 5
imshow(cor)
Accepted Answer
More Answers (14)
Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Ronald Mcdonald
on 21 Dec 2022
0 votes

Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!