function varargout = toneCure(varargin)
cur = cd;
addpath(genpath(cur));
warning off;
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @toneCure_OpeningFcn, ...
'gui_OutputFcn', @toneCure_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 toneCure is made visible.
function toneCure_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 toneCure (see VARARGIN)
% Choose default command line output for toneCure
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
cla(handles.axes2,'reset'); % 重置清空动态axes1的数据
cla(handles.axes3,'reset'); % 重置清空动态axes1的数据
cla(handles.axes4,'reset'); % 重置清空动态axes1的数据
clear global points; %%每次启动清空全局变量
global points; % 自定义数组
clear global Num;
global Num;
Num = 1;
points(1,1:2)=0.0;
points(2,1:2)=0.2;
points(3,1:2)=0.4;
points(4,1:2)=0.6;
points(5,1:2)=0.8;
points(6,1:2)=1;
% axes(handles.axes2);
%% y = P(1)*X^N + P(2)*X^(N-1) +...+ P(N)*X + P(N+1);
%% p是参数, N是指数位置
p1 = polyfit(points(:,1), points(:,2), 5); %% y = x + b;
x=0:0.01:1;
y = polyval(p1, x);
% hold on;
y2 = x ;
plot(x, y2, 'k-.', 'LineWidth', 1, 'parent', handles.axes2);
hold on;
plot(x, y, 'r-', points(:,1), points(:,2), 'b*', 'LineWidth', 1.25, 'parent', handles.axes2) ;
legend('y = x', 'y = f(x)', 'Location', 'northwest');
grid on;
global idx
idx=0;
guidata(hObject, handles);
% UIWAIT makes toneCure wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = toneCure_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)
% 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
%% 针对不同通道进行提取处理后的曲线工具
clear global Num;
global Num;
switch(get(handles.popupmenu1,'Value'))
case 1
Num =1;
case 2
Num =2;
case 3
Num =3;
case 4
Num =4;
case 5
Num = 5;
case 6
Num =6;
case 7
Num =7;
case 8
Num =8;
case 9
Num = 9;
case 10
Num =10;
case 11
Num =11;
case 12
Num =12;
end
guidata(hObject,handles );
% --- 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
% --- Executes on selection change in popupmenu4.
function popupmenu4_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu4 (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 popupmenu4 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu4
%% 直方图显示选项
global DealIMG;
global ImgOri;
if (get(handles.popupmenu4,'Value') > 0)
switch(get(handles.popupmenu4,'Value'))
case 1
cla(handles.axes3,'reset');
axes(handles.axes3);
histogram(ImgOri);
hold on;
histogram(DealIMG);
grid on
legend('原图', '处理图')
case 2
cla(handles.axes3,'reset');
axes(handles.axes3);
histogram(ImgOri);
grid on
legend('原图');
case 3
cla(handles.axes3,'reset');
axes(handles.axes3);
histogram(DealIMG);
grid on
legend('处理图');
end
end
guidata(hObject,handles );
% --- Executes during object creation, after setting all properties.
function popupmenu4_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu4 (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
% --- 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)
%% 打开图像
guidata(hObject, handles); %更新数据
cla(handles.axes2,'reset'); % 重置清空动态axes2的数据
cla(handles.axes3,'reset');
cla(handles.axes4,'reset');
set(handles.popupmenu1,'Value', 1) ;
set(handles.popupmenu4,'Value', 1) ;
clear global Str;
clear global points; %%每次启动清空全局变量
clear global Num;
global Str;
global ImgOri;
global Num;
global points; % 自定义数组
global idx
idx=0;
Num = 1;
points(1,1:2)=0.0;
points(2,1:2)=0.2;
points(3,1:2)=0.4;
points(4,1:2)=0.6;
points(5,1:2)=0.8;
points(6,1:2)=1;
% axes(handles.axes2);
%% y = P(1)*X^N + P(2)*X^(N-1) +...+ P(N)*X + P(N+1);
%% p是参数, N是指数位置
p1 = polyfit(points(:,1), points(:,2), 5); %% y = x + b;
x=0:0.01:1;
y = polyval(p1, x);
% hold on;
y2 = x ;
plot(x,
通过MATLAB实现图像曲线调整功能,能够调理局部的亮度
版权申诉
191 浏览量
2022-10-31
23:18:52
上传
评论 1
收藏 3.87MB RAR 举报
![avatar](https://profile-avatar.csdnimg.cn/6534a49295004b5796c3956cb3f87481_ccsss22.jpg!1)
![avatar-vip](https://csdnimg.cn/release/downloadcmsfe/public/img/user-vip.1c89f3c5.png)
fpga和matlab
- 粉丝: 16w+
- 资源: 2583
最新资源
- zbar libiconv.so libzbarjni.so 32 64位的配置包
- 基于stm32的家庭湿度控制系统的设计与实现源码+文档说明(高分项目)
- 一个简单的Python程序,它使用socket库来实现一个UDP服务器,该服务器接收UDP消息,然后通过TCP连接将消息转发给T
- OpenVINO CSharp 异步推理接口部署YOLOv8 代码
- 问题解决教程.docx
- Matlab箱线图教程.txt
- 基于树莓派的智能小车:自动避障,实时图像传输,目标检测,网球追踪
- 百度AI-语音合成练习
- 操作系统复习(极速版)
- 一个数字信号处理的例子,包括信号的采样、带噪信号的生成、使用低通滤波器滤波,并绘制结果
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)