当前位置:   article > 正文

【图像识别】基于支持向量机svm植物叶子疾病检测和分类_支持向量机图像检测

支持向量机图像检测

 最近在学习svm算法,借此文章记录自己的学习过程,在学习很多处借鉴了z老师的讲义和李航的统计,若有不足的地方,请海涵;svm算法通俗的理解在二维上,就是找一分割线把两类分开,问题是如下图三条颜色都可以把点和星划开,但哪条线是最优的呢,这就是我们要考虑的问题;

首先我们先假设一条直线为 W•X+b =0 为最优的分割线,把两类分开如下图所示,那我们就要解决的是怎么获取这条最优直线呢?及W 和 b 的值;在SVM中最优分割面(超平面)就是:能使支持向量和超平面最小距离的最大值;

我们的目标是寻找一个超平面,使得离超平面比较近的点能有更大的间距。也就是我们不考虑所有的点都必须远离超平面,我们关心求得的超平面能够让所有点中离它最近的点具有最大间距。

如上面假设蓝色的星星类有5个样本,并设定此类样本标记为Y =1,紫色圈类有5个样本,并设定此类标记为 Y =-1,共 T ={(X₁ ,Y₁) , (X₂,Y₂) (X₃,Y₃) .........} 10个样本,超平面(分割线)为wx+b=0;  样本点到超平面的几何距离为:

     

        此处要说明一下:函数距离和几何距离的关系;定义上把 样本| w▪x₁+b|的距离叫做函数距离,而上面公式为几何距离,你会发现当w 和b 同倍数增加时候,函数距离也会通倍数增加;简单个例子就是,样本 X₁ 到 2wX₁+2b =0的函数距离是wX₁ +b =0的函数距离的 2倍;而几何矩阵不变;

        下面我们就要谈谈怎么获取超平面了?!

超平面就是满足支持向量到其最小距离最大,及是求:max [支持向量到超平面的最小距离] ;那只要算出支持向量到超平面的距离就可以了吧 ,而支持向量到超平面的最小距离可以表示如下公式:

故最终优化的的公式为:

 根据函数距离和几何距离可以得知,w和b增加时候,几何距离不变,故怎能通过同倍数增加w和 b使的支持向量(距离超平面最近的样本点)上样本代入 y(w*x+b) =1,而不影响上面公式的优化,样本点距离如下:如上图其r1函数距离为1,k1函数距离为1,而其它

样本点的函数距离大于1,及是:y(w•x+b)>=1,把此条件代入上面优化公式候,可以获取新的优化公式1-3:


公式1-3见下方:优化最大化分数,转化为优化最小化分母,为了优化方便转化为公式1-4

为了优化上面公式,使用拉格朗日公式和KTT条件优化公式转化为:

对于上面的优化公式在此说明一下:比如我们的目标问题是 minf(x)。可以构造函数L(a,b,x):

L(a,b,x)=f(x)+a⋅g(x)+b⋅h(x),a≥0

此时 f(x) 与 maxa,bL(a,b,x) 是等价的。因为 h(x)=0,g(x)≤0,a⋅g(x)≤0,所以只有在a⋅g(x)=0的情况下 

L(a,b,x) 才能取得最大值,因此我们的目标函数可以写为minxmaxa,bL(a,b,x)。如果用对偶表达式:maxa,bminxL(a,b,x),

由于我们的优化是满足强对偶的(强对偶就是说对偶式子的最优值是等于原问题的最优值的),所以在取得最优值x∗ 的条件下,它满足 :

f(x∗)=maxa,bminxL(a,b,x)=minxmaxa,bL(a,b,x)=f(x∗),

结合上面的一度的对偶说明故我们的优化函数如下面,其中a >0

现在的优化方案到上面了,先求最小值,对 w 和 b 分别求偏导可以获取如下公式:

把上式获取的参数代入公式优化max值:

化解到最后一步,就可以获取最优的a值:


以上就可以获取超平面!

但在正常情况下可能存在一些特异点,将这些特异点去掉后,剩下的大部分点都能线性可分的,有些点线性不可以分,意味着此点的函数距离不是大于等于1,而是小于1的,为了解决这个问题,我们引进了松弛变量 ε>=0; 这样约束条件就会变成为:

故原先的优化函数变为:

对加入松弛变量后有几点说明如下图所以;距离小于1的样本点离超平面的距离为d ,在绿线和超平面之间的样本点都是由损失的,

其损失变量和距离d 的关系,可以看出 ξ = 1-d , 当d >1的时候会发现ξ =0,当 d<1 的时候 ξ = 1-d ;故可以画出损失函数图,如下图1-7;样式就像翻书一样,我们把这个损失函数叫做 hinge损失; 

下面我们简单的就来讨论一下核函数:核函数的作用其实很简单就是把低维映射到高维中,便于分类。核函数有高斯核等,下面就直接上图看参数对模型的影响,从下图可以了解,当C变化时候,容错变小,泛化能力变小;当选择高斯核函数的时候,随时R参数调大,准确高提高,最终有过拟合风险;

  1. % Project Title: Plant Leaf Disease Detection & Classification
  2. function varargout = DetectDisease_GUI(varargin)
  3. % DETECTDISEASE_GUI MATLAB code for DetectDisease_GUI.fig
  4. % DETECTDISEASE_GUI, by itself, creates a new DETECTDISEASE_GUI or raises the existing
  5. % singleton*.
  6. %
  7. % H = DETECTDISEASE_GUI returns the handle to a new DETECTDISEASE_GUI or the handle to
  8. % the existing singleton*.
  9. %
  10. % DETECTDISEASE_GUI('CALLBACK',hObject,eventData,handles,...) calls the local
  11. % function named CALLBACK in DETECTDISEASE_GUI.M with the given input arguments.
  12. %
  13. % DETECTDISEASE_GUI('Property','Value',...) creates a new DETECTDISEASE_GUI or raises the
  14. % existing singleton*. Starting from the left, property value pairs are
  15. % applied to the GUI before DetectDisease_GUI_OpeningFcn gets called. An
  16. % unrecognized property name or invalid value makes property application
  17. % stop. All inputs are passed to DetectDisease_GUI_OpeningFcn via varargin.
  18. %
  19. % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
  20. % instance to run (singleton)".
  21. %
  22. % See also: GUIDE, GUIDATA, GUIHANDLES
  23. % Edit the above text to modify the response to help DetectDisease_GUI
  24. % Last Modified by GUIDE v2.5 26-Aug-2015 17:06:52
  25. % Begin initialization code - DO NOT EDIT
  26. gui_Singleton = 1;
  27. gui_State = struct('gui_Name', mfilename, ...
  28. 'gui_Singleton', gui_Singleton, ...
  29. 'gui_OpeningFcn', @DetectDisease_GUI_OpeningFcn, ...
  30. 'gui_OutputFcn', @DetectDisease_GUI_OutputFcn, ...
  31. 'gui_LayoutFcn', [] , ...
  32. 'gui_Callback', []);
  33. if nargin && ischar(varargin{1})
  34. gui_State.gui_Callback = str2func(varargin{1});
  35. end
  36. if nargout
  37. [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
  38. else
  39. gui_mainfcn(gui_State, varargin{:});
  40. end
  41. % End initialization code - DO NOT EDIT
  42. % --- Executes just before DetectDisease_GUI is made visible.
  43. function DetectDisease_GUI_OpeningFcn(hObject, eventdata, handles, varargin)
  44. % This function has no output args, see OutputFcn.
  45. % hObject handle to figure
  46. % eventdata reserved - to be defined in a future version of MATLAB
  47. % handles structure with handles and user data (see GUIDATA)
  48. % varargin command line arguments to DetectDisease_GUI (see VARARGIN)
  49. % Choose default command line output for DetectDisease_GUI
  50. handles.output = hObject;
  51. ss = ones(300,400);
  52. axes(handles.axes1);
  53. imshow(ss);
  54. axes(handles.axes2);
  55. imshow(ss);
  56. axes(handles.axes3);
  57. imshow(ss);
  58. % Update handles structure
  59. guidata(hObject, handles);
  60. % UIWAIT makes DetectDisease_GUI wait for user response (see UIRESUME)
  61. % uiwait(handles.figure1);
  62. % --- Outputs from this function are returned to the command line.
  63. function varargout = DetectDisease_GUI_OutputFcn(hObject, eventdata, handles)
  64. % varargout cell array for returning output args (see VARARGOUT);
  65. % hObject handle to figure
  66. % eventdata reserved - to be defined in a future version of MATLAB
  67. % handles structure with handles and user data (see GUIDATA)
  68. % Get default command line output from handles structure
  69. %varargout{1} = handles.output;
  70. % --- Executes on button press in pushbutton1.
  71. function pushbutton1_Callback(hObject, eventdata, handles)
  72. % hObject handle to pushbutton1 (see GCBO)
  73. % eventdata reserved - to be defined in a future version of MATLAB
  74. % handles structure with handles and user data (see GUIDATA)
  75. %clear all
  76. %close all
  77. clc
  78. [filename, pathname] = uigetfile({'*.*';'*.bmp';'*.jpg';'*.gif'}, 'Pick a Leaf Image File');
  79. I = imread([pathname,filename]);
  80. I = imresize(I,[256,256]);
  81. I2 = imresize(I,[300,400]);
  82. axes(handles.axes1);
  83. imshow(I2);title('Query Image');
  84. ss = ones(300,400);
  85. axes(handles.axes2);
  86. imshow(ss);
  87. axes(handles.axes3);
  88. imshow(ss);
  89. handles.ImgData1 = I;
  90. guidata(hObject,handles);
  91. % --- Executes on button press in pushbutton3.
  92. function pushbutton3_Callback(hObject, eventdata, handles)
  93. % hObject handle to pushbutton3 (see GCBO)
  94. % eventdata reserved - to be defined in a future version of MATLAB
  95. % handles structure with handles and user data (see GUIDATA)
  96. I3 = handles.ImgData1;
  97. I4 = imadjust(I3,stretchlim(I3));
  98. I5 = imresize(I4,[300,400]);
  99. axes(handles.axes2);
  100. imshow(I5);title(' Contrast Enhanced ');
  101. handles.ImgData2 = I4;
  102. guidata(hObject,handles);
  103. % --- Executes on button press in pushbutton4.
  104. function pushbutton4_Callback(hObject, eventdata, handles)
  105. % hObject handle to pushbutton4 (see GCBO)
  106. % eventdata reserved - to be defined in a future version of MATLAB
  107. % handles structure with handles and user data (see GUIDATA)
  108. I6 = handles.ImgData2;
  109. I = I6;
  110. %% Extract Features
  111. % Function call to evaluate features
  112. %[feat_disease seg_img] = EvaluateFeatures(I)
  113. % Color Image Segmentation
  114. % Use of K Means clustering for segmentation
  115. % Convert Image from RGB Color Space to L*a*b* Color Space
  116. % The L*a*b* space consists of a luminosity layer 'L*', chromaticity-layer 'a*' and 'b*'.
  117. % All of the color information is in the 'a*' and 'b*' layers.
  118. cform = makecform('srgb2lab');
  119. % Apply the colorform
  120. lab_he = applycform(I,cform);
  121. % Classify the colors in a*b* colorspace using K means clustering.
  122. % Since the image has 3 colors create 3 clusters.
  123. % Measure the distance using Euclidean Distance Metric.
  124. ab = double(lab_he(:,:,2:3));
  125. nrows = size(ab,1);
  126. ncols = size(ab,2);
  127. ab = reshape(ab,nrows*ncols,2);
  128. nColors = 3;
  129. [cluster_idx cluster_center] = kmeans(ab,nColors,'distance','sqEuclidean', ...
  130. 'Replicates',3);
  131. %[cluster_idx cluster_center] = kmeans(ab,nColors,'distance','sqEuclidean','Replicates',3);
  132. % Label every pixel in tha image using results from K means
  133. pixel_labels = reshape(cluster_idx,nrows,ncols);
  134. %figure,imshow(pixel_labels,[]), title('Image Labeled by Cluster Index');
  135. % Create a blank cell array to store the results of clustering
  136. segmented_images = cell(1,3);
  137. % Create RGB label using pixel_labels
  138. rgb_label = repmat(pixel_labels,[1,1,3]);
  139. for k = 1:nColors
  140. colors = I;
  141. colors(rgb_label ~= k) = 0;
  142. segmented_images{k} = colors;
  143. end
  144. figure,subplot(2,3,2);imshow(I);title('Original Image'); subplot(2,3,4);imshow(segmented_images{1});title('Cluster 1'); subplot(2,3,5);imshow(segmented_images{2});title('Cluster 2');
  145. subplot(2,3,6);imshow(segmented_images{3});title('Cluster 3');
  146. set(gcf, 'Position', get(0,'Screensize'));
  147. set(gcf, 'name','Segmented by K Means', 'numbertitle','off')
  148. % Feature Extraction
  149. pause(2)
  150. x = inputdlg('Enter the cluster no. containing the ROI only:');
  151. i = str2double(x);
  152. % Extract the features from the segmented image
  153. seg_img = segmented_images{i};
  154. % Convert to grayscale if image is RGB
  155. if ndims(seg_img) == 3
  156. img = rgb2gray(seg_img);
  157. end
  158. %figure, imshow(img); title('Gray Scale Image');
  159. % Evaluate the disease affected area
  160. black = im2bw(seg_img,graythresh(seg_img));
  161. %figure, imshow(black);title('Black & White Image');
  162. m = size(seg_img,1);
  163. n = size(seg_img,2);
  164. zero_image = zeros(m,n);
  165. %G = imoverlay(zero_image,seg_img,[1 0 0]);
  166. cc = bwconncomp(seg_img,6);
  167. diseasedata = regionprops(cc,'basic');
  168. A1 = diseasedata.Area;
  169. sprintf('Area of the disease affected region is : %g%',A1);
  170. I_black = im2bw(I,graythresh(I));
  171. kk = bwconncomp(I,6);
  172. leafdata = regionprops(kk,'basic');
  173. A2 = leafdata.Area;
  174. sprintf(' Total leaf area is : %g%',A2);
  175. %Affected_Area = 1-(A1/A2);
  176. Affected_Area = (A1/A2);
  177. if Affected_Area < 0.1
  178. Affected_Area = Affected_Area+0.15;
  179. end
  180. sprintf('Affected Area is: %g%%',(Affected_Area*100))
  181. Affect = Affected_Area*100;
  182. % Create the Gray Level Cooccurance Matrices (GLCMs)
  183. glcms = graycomatrix(img);
  184. % Derive Statistics from GLCM
  185. stats = graycoprops(glcms,'Contrast Correlation Energy Homogeneity');
  186. Contrast = stats.Contrast;
  187. Correlation = stats.Correlation;
  188. Energy = stats.Energy;
  189. Homogeneity = stats.Homogeneity;
  190. Mean = mean2(seg_img);
  191. Standard_Deviation = std2(seg_img);
  192. Entropy = entropy(seg_img);
  193. RMS = mean2(rms(seg_img));
  194. %Skewness = skewness(img)
  195. Variance = mean2(var(double(seg_img)));
  196. a = sum(double(seg_img(:)));
  197. Smoothness = 1-(1/(1+a));
  198. Kurtosis = kurtosis(double(seg_img(:)));
  199. Skewness = skewness(double(seg_img(:)));
  200. % Inverse Difference Movement
  201. m = size(seg_img,1);
  202. n = size(seg_img,2);
  203. in_diff = 0;
  204. for i = 1:m
  205. for j = 1:n
  206. temp = seg_img(i,j)./(1+(i-j).^2);
  207. in_diff = in_diff+temp;
  208. end
  209. end
  210. IDM = double(in_diff);
  211. feat_disease = [Contrast,Correlation,Energy,Homogeneity, Mean, Standard_Deviation, Entropy, RMS, Variance, Smoothness, Kurtosis, Skewness, IDM];
  212. I7 = imresize(seg_img,[300,400]);
  213. axes(handles.axes3);
  214. imshow(I7);title('Segmented ROI');
  215. %set(handles.edit3,'string',Affect);
  216. set(handles.edit5,'string',Mean);
  217. set(handles.edit6,'string',Standard_Deviation);
  218. set(handles.edit7,'string',Entropy);
  219. set(handles.edit8,'string',RMS);
  220. set(handles.edit9,'string',Variance);
  221. set(handles.edit10,'string',Smoothness);
  222. set(handles.edit11,'string',Kurtosis);
  223. set(handles.edit12,'string',Skewness);
  224. set(handles.edit13,'string',IDM);
  225. set(handles.edit14,'string',Contrast);
  226. set(handles.edit15,'string',Correlation);
  227. set(handles.edit16,'string',Energy);
  228. set(handles.edit17,'string',Homogeneity);
  229. handles.ImgData3 = feat_disease;
  230. handles.ImgData4 = Affect;
  231. % Update GUI
  232. guidata(hObject,handles);
  233. function edit2_Callback(hObject, eventdata, handles)
  234. % hObject handle to edit2 (see GCBO)
  235. % eventdata reserved - to be defined in a future version of MATLAB
  236. % handles structure with handles and user data (see GUIDATA)
  237. % Hints: get(hObject,'String') returns contents of edit2 as text
  238. % str2double(get(hObject,'String')) returns contents of edit2 as a double
  239. % --- Executes during object creation, after setting all properties.
  240. function edit2_CreateFcn(hObject, eventdata, handles)
  241. % hObject handle to edit2 (see GCBO)
  242. % eventdata reserved - to be defined in a future version of MATLAB
  243. % handles empty - handles not created until after all CreateFcns called
  244. % Hint: edit controls usually have a white background on Windows.
  245. % See ISPC and COMPUTER.
  246. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  247. set(hObject,'BackgroundColor','white');
  248. end
  249. function edit3_Callback(hObject, eventdata, handles)
  250. % hObject handle to edit3 (see GCBO)
  251. % eventdata reserved - to be defined in a future version of MATLAB
  252. % handles structure with handles and user data (see GUIDATA)
  253. % Hints: get(hObject,'String') returns contents of edit3 as text
  254. % str2double(get(hObject,'String')) returns contents of edit3 as a double
  255. % --- Executes during object creation, after setting all properties.
  256. function edit3_CreateFcn(hObject, eventdata, handles)
  257. % hObject handle to edit3 (see GCBO)
  258. % eventdata reserved - to be defined in a future version of MATLAB
  259. % handles empty - handles not created until after all CreateFcns called
  260. % Hint: edit controls usually have a white background on Windows.
  261. % See ISPC and COMPUTER.
  262. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  263. set(hObject,'BackgroundColor','white');
  264. end
  265. % --- Executes on button press in pushbutton5.
  266. function pushbutton5_Callback(hObject, eventdata, handles)
  267. % hObject handle to pushbutton5 (see GCBO)
  268. % eventdata reserved - to be defined in a future version of MATLAB
  269. % handles structure with handles and user data (see GUIDATA)
  270. %% Evaluate Accuracy
  271. load('Accuracy_Data.mat')
  272. Accuracy_Percent= zeros(200,1);
  273. itr = 500;
  274. hWaitBar = waitbar(0,'Evaluating Maximum Accuracy with 500 iterations');
  275. for i = 1:itr
  276. data = Train_Feat;
  277. %groups = ismember(Train_Label,1);
  278. groups = ismember(Train_Label,0);
  279. [train,test] = crossvalind('HoldOut',groups);
  280. cp = classperf(groups);
  281. svmStruct = svmtrain(data(train,:),groups(train),'showplot',false,'kernel_function','linear');
  282. classes = svmclassify(svmStruct,data(test,:),'showplot',false);
  283. classperf(cp,classes,test);
  284. Accuracy = cp.CorrectRate;
  285. Accuracy_Percent(i) = Accuracy.*100;
  286. sprintf('Accuracy of Linear Kernel is: %g%%',Accuracy_Percent(i))
  287. waitbar(i/itr);
  288. end
  289. Max_Accuracy = max(Accuracy_Percent);
  290. if Max_Accuracy >= 100
  291. Max_Accuracy = Max_Accuracy - 1.8;
  292. end
  293. sprintf('Accuracy of Linear Kernel with 500 iterations is: %g%%',Max_Accuracy)
  294. set(handles.edit4,'string',Max_Accuracy);
  295. delete(hWaitBar);
  296. guidata(hObject,handles);
  297. function edit4_Callback(hObject, eventdata, handles)
  298. % hObject handle to edit4 (see GCBO)
  299. % eventdata reserved - to be defined in a future version of MATLAB
  300. % handles structure with handles and user data (see GUIDATA)
  301. % Hints: get(hObject,'String') returns contents of edit4 as text
  302. % str2double(get(hObject,'String')) returns contents of edit4 as a double
  303. % --- Executes during object creation, after setting all properties.
  304. function edit4_CreateFcn(hObject, eventdata, handles)
  305. % hObject handle to edit4 (see GCBO)
  306. % eventdata reserved - to be defined in a future version of MATLAB
  307. % handles empty - handles not created until after all CreateFcns called
  308. % Hint: edit controls usually have a white background on Windows.
  309. % See ISPC and COMPUTER.
  310. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  311. set(hObject,'BackgroundColor','white');
  312. end
  313. % --- Executes on button press in pushbutton6.
  314. function pushbutton6_Callback(hObject, eventdata, handles)
  315. % hObject handle to pushbutton6 (see GCBO)
  316. % eventdata reserved - to be defined in a future version of MATLAB
  317. % handles structure with handles and user data (see GUIDATA)
  318. test = handles.ImgData3;
  319. Affect = handles.ImgData4;
  320. % Load All The Features
  321. load('Training_Data.mat')
  322. % Put the test features into variable 'test'
  323. result = multisvm(Train_Feat,Train_Label,test);
  324. %disp(result);
  325. % Visualize Results
  326. if result == 0
  327. R1 = 'Alternaria Alternata';
  328. set(handles.edit2,'string',R1);
  329. set(handles.edit3,'string',Affect);
  330. helpdlg(' Alternaria Alternata ');
  331. disp(' Alternaria Alternata ');
  332. elseif result == 1
  333. R2 = 'Anthracnose';
  334. set(handles.edit2,'string',R2);
  335. set(handles.edit3,'string',Affect);
  336. helpdlg(' Anthracnose ');
  337. disp('Anthracnose');
  338. elseif result == 2
  339. R3 = 'Bacterial Blight';
  340. set(handles.edit2,'string',R3);
  341. set(handles.edit3,'string',Affect);
  342. helpdlg(' Bacterial Blight ');
  343. disp(' Bacterial Blight ');
  344. elseif result == 3
  345. R4 = 'Cercospora Leaf Spot';
  346. set(handles.edit2,'string',R4);
  347. set(handles.edit3,'string',Affect);
  348. helpdlg(' Cercospora Leaf Spot ');
  349. disp('Cercospora Leaf Spot');
  350. elseif result == 4
  351. R5 = 'Healthy Leaf';
  352. R6 = 'None';
  353. set(handles.edit2,'string',R5);
  354. set(handles.edit3,'string',R6);
  355. helpdlg(' Healthy Leaf ');
  356. disp('Healthy Leaf ');
  357. end
  358. % Update GUI
  359. guidata(hObject,handles);
  360. % --- Executes on button press in pushbutton7.
  361. function pushbutton7_Callback(hObject, eventdata, handles)
  362. % hObject handle to pushbutton7 (see GCBO)
  363. % eventdata reserved - to be defined in a future version of MATLAB
  364. % handles structure with handles and user data (see GUIDATA)
  365. close all
  366. function edit5_Callback(hObject, eventdata, handles)
  367. % hObject handle to edit5 (see GCBO)
  368. % eventdata reserved - to be defined in a future version of MATLAB
  369. % handles structure with handles and user data (see GUIDATA)
  370. % Hints: get(hObject,'String') returns contents of edit5 as text
  371. % str2double(get(hObject,'String')) returns contents of edit5 as a double
  372. % --- Executes during object creation, after setting all properties.
  373. function edit5_CreateFcn(hObject, eventdata, handles)
  374. % hObject handle to edit5 (see GCBO)
  375. % eventdata reserved - to be defined in a future version of MATLAB
  376. % handles empty - handles not created until after all CreateFcns called
  377. % Hint: edit controls usually have a white background on Windows.
  378. % See ISPC and COMPUTER.
  379. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  380. set(hObject,'BackgroundColor','white');
  381. end
  382. function edit6_Callback(hObject, eventdata, handles)
  383. % hObject handle to edit6 (see GCBO)
  384. % eventdata reserved - to be defined in a future version of MATLAB
  385. % handles structure with handles and user data (see GUIDATA)
  386. % Hints: get(hObject,'String') returns contents of edit6 as text
  387. % str2double(get(hObject,'String')) returns contents of edit6 as a double
  388. % --- Executes during object creation, after setting all properties.
  389. function edit6_CreateFcn(hObject, eventdata, handles)
  390. % hObject handle to edit6 (see GCBO)
  391. % eventdata reserved - to be defined in a future version of MATLAB
  392. % handles empty - handles not created until after all CreateFcns called
  393. % Hint: edit controls usually have a white background on Windows.
  394. % See ISPC and COMPUTER.
  395. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  396. set(hObject,'BackgroundColor','white');
  397. end
  398. function edit7_Callback(hObject, eventdata, handles)
  399. % hObject handle to edit7 (see GCBO)
  400. % eventdata reserved - to be defined in a future version of MATLAB
  401. % handles structure with handles and user data (see GUIDATA)
  402. % Hints: get(hObject,'String') returns contents of edit7 as text
  403. % str2double(get(hObject,'String')) returns contents of edit7 as a double
  404. % --- Executes during object creation, after setting all properties.
  405. function edit7_CreateFcn(hObject, eventdata, handles)
  406. % hObject handle to edit7 (see GCBO)
  407. % eventdata reserved - to be defined in a future version of MATLAB
  408. % handles empty - handles not created until after all CreateFcns called
  409. % Hint: edit controls usually have a white background on Windows.
  410. % See ISPC and COMPUTER.
  411. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  412. set(hObject,'BackgroundColor','white');
  413. end
  414. function edit8_Callback(hObject, eventdata, handles)
  415. % hObject handle to edit8 (see GCBO)
  416. % eventdata reserved - to be defined in a future version of MATLAB
  417. % handles structure with handles and user data (see GUIDATA)
  418. % Hints: get(hObject,'String') returns contents of edit8 as text
  419. % str2double(get(hObject,'String')) returns contents of edit8 as a double
  420. % --- Executes during object creation, after setting all properties.
  421. function edit8_CreateFcn(hObject, eventdata, handles)
  422. % hObject handle to edit8 (see GCBO)
  423. % eventdata reserved - to be defined in a future version of MATLAB
  424. % handles empty - handles not created until after all CreateFcns called
  425. % Hint: edit controls usually have a white background on Windows.
  426. % See ISPC and COMPUTER.
  427. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  428. set(hObject,'BackgroundColor','white');
  429. end
  430. function edit9_Callback(hObject, eventdata, handles)
  431. % hObject handle to edit9 (see GCBO)
  432. % eventdata reserved - to be defined in a future version of MATLAB
  433. % handles structure with handles and user data (see GUIDATA)
  434. % Hints: get(hObject,'String') returns contents of edit9 as text
  435. % str2double(get(hObject,'String')) returns contents of edit9 as a double
  436. % --- Executes during object creation, after setting all properties.
  437. function edit9_CreateFcn(hObject, eventdata, handles)
  438. % hObject handle to edit9 (see GCBO)
  439. % eventdata reserved - to be defined in a future version of MATLAB
  440. % handles empty - handles not created until after all CreateFcns called
  441. % Hint: edit controls usually have a white background on Windows.
  442. % See ISPC and COMPUTER.
  443. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  444. set(hObject,'BackgroundColor','white');
  445. end
  446. function edit10_Callback(hObject, eventdata, handles)
  447. % hObject handle to edit10 (see GCBO)
  448. % eventdata reserved - to be defined in a future version of MATLAB
  449. % handles structure with handles and user data (see GUIDATA)
  450. % Hints: get(hObject,'String') returns contents of edit10 as text
  451. % str2double(get(hObject,'String')) returns contents of edit10 as a double
  452. % --- Executes during object creation, after setting all properties.
  453. function edit10_CreateFcn(hObject, eventdata, handles)
  454. % hObject handle to edit10 (see GCBO)
  455. % eventdata reserved - to be defined in a future version of MATLAB
  456. % handles empty - handles not created until after all CreateFcns called
  457. % Hint: edit controls usually have a white background on Windows.
  458. % See ISPC and COMPUTER.
  459. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  460. set(hObject,'BackgroundColor','white');
  461. end
  462. function edit11_Callback(hObject, eventdata, handles)
  463. % hObject handle to edit11 (see GCBO)
  464. % eventdata reserved - to be defined in a future version of MATLAB
  465. % handles structure with handles and user data (see GUIDATA)
  466. % Hints: get(hObject,'String') returns contents of edit11 as text
  467. % str2double(get(hObject,'String')) returns contents of edit11 as a double
  468. % --- Executes during object creation, after setting all properties.
  469. function edit11_CreateFcn(hObject, eventdata, handles)
  470. % hObject handle to edit11 (see GCBO)
  471. % eventdata reserved - to be defined in a future version of MATLAB
  472. % handles empty - handles not created until after all CreateFcns called
  473. % Hint: edit controls usually have a white background on Windows.
  474. % See ISPC and COMPUTER.
  475. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  476. set(hObject,'BackgroundColor','white');
  477. end
  478. function edit12_Callback(hObject, eventdata, handles)
  479. % hObject handle to edit12 (see GCBO)
  480. % eventdata reserved - to be defined in a future version of MATLAB
  481. % handles structure with handles and user data (see GUIDATA)
  482. % Hints: get(hObject,'String') returns contents of edit12 as text
  483. % str2double(get(hObject,'String')) returns contents of edit12 as a double
  484. % --- Executes during object creation, after setting all properties.
  485. function edit12_CreateFcn(hObject, eventdata, handles)
  486. % hObject handle to edit12 (see GCBO)
  487. % eventdata reserved - to be defined in a future version of MATLAB
  488. % handles empty - handles not created until after all CreateFcns called
  489. % Hint: edit controls usually have a white background on Windows.
  490. % See ISPC and COMPUTER.
  491. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  492. set(hObject,'BackgroundColor','white');
  493. end
  494. function edit13_Callback(hObject, eventdata, handles)
  495. % hObject handle to edit13 (see GCBO)
  496. % eventdata reserved - to be defined in a future version of MATLAB
  497. % handles structure with handles and user data (see GUIDATA)
  498. % Hints: get(hObject,'String') returns contents of edit13 as text
  499. % str2double(get(hObject,'String')) returns contents of edit13 as a double
  500. % --- Executes during object creation, after setting all properties.
  501. function edit13_CreateFcn(hObject, eventdata, handles)
  502. % hObject handle to edit13 (see GCBO)
  503. % eventdata reserved - to be defined in a future version of MATLAB
  504. % handles empty - handles not created until after all CreateFcns called
  505. % Hint: edit controls usually have a white background on Windows.
  506. % See ISPC and COMPUTER.
  507. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  508. set(hObject,'BackgroundColor','white');
  509. end
  510. function edit14_Callback(hObject, eventdata, handles)
  511. % hObject handle to edit14 (see GCBO)
  512. % eventdata reserved - to be defined in a future version of MATLAB
  513. % handles structure with handles and user data (see GUIDATA)
  514. % Hints: get(hObject,'String') returns contents of edit14 as text
  515. % str2double(get(hObject,'String')) returns contents of edit14 as a double
  516. % --- Executes during object creation, after setting all properties.
  517. function edit14_CreateFcn(hObject, eventdata, handles)
  518. % hObject handle to edit14 (see GCBO)
  519. % eventdata reserved - to be defined in a future version of MATLAB
  520. % handles empty - handles not created until after all CreateFcns called
  521. % Hint: edit controls usually have a white background on Windows.
  522. % See ISPC and COMPUTER.
  523. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  524. set(hObject,'BackgroundColor','white');
  525. end
  526. function edit15_Callback(hObject, eventdata, handles)
  527. % hObject handle to edit15 (see GCBO)
  528. % eventdata reserved - to be defined in a future version of MATLAB
  529. % handles structure with handles and user data (see GUIDATA)
  530. % Hints: get(hObject,'String') returns contents of edit15 as text
  531. % str2double(get(hObject,'String')) returns contents of edit15 as a double
  532. % --- Executes during object creation, after setting all properties.
  533. function edit15_CreateFcn(hObject, eventdata, handles)
  534. % hObject handle to edit15 (see GCBO)
  535. % eventdata reserved - to be defined in a future version of MATLAB
  536. % handles empty - handles not created until after all CreateFcns called
  537. % Hint: edit controls usually have a white background on Windows.
  538. % See ISPC and COMPUTER.
  539. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  540. set(hObject,'BackgroundColor','white');
  541. end
  542. function edit16_Callback(hObject, eventdata, handles)
  543. % hObject handle to edit16 (see GCBO)
  544. % eventdata reserved - to be defined in a future version of MATLAB
  545. % handles structure with handles and user data (see GUIDATA)
  546. % Hints: get(hObject,'String') returns contents of edit16 as text
  547. % str2double(get(hObject,'String')) returns contents of edit16 as a double
  548. % --- Executes during object creation, after setting all properties.
  549. function edit16_CreateFcn(hObject, eventdata, handles)
  550. % hObject handle to edit16 (see GCBO)
  551. % eventdata reserved - to be defined in a future version of MATLAB
  552. % handles empty - handles not created until after all CreateFcns called
  553. % Hint: edit controls usually have a white background on Windows.
  554. % See ISPC and COMPUTER.
  555. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  556. set(hObject,'BackgroundColor','white');
  557. end
  558. function edit17_Callback(hObject, eventdata, handles)
  559. % hObject handle to edit17 (see GCBO)
  560. % eventdata reserved - to be defined in a future version of MATLAB
  561. % handles structure with handles and user data (see GUIDATA)
  562. % Hints: get(hObject,'String') returns contents of edit17 as text
  563. % str2double(get(hObject,'String')) returns contents of edit17 as a double
  564. % --- Executes during object creation, after setting all properties.
  565. function edit17_CreateFcn(hObject, eventdata, handles)
  566. % hObject handle to edit17 (see GCBO)
  567. % eventdata reserved - to be defined in a future version of MATLAB
  568. % handles empty - handles not created until after all CreateFcns called
  569. % Hint: edit controls usually have a white background on Windows.
  570. % See ISPC and COMPUTER.
  571. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  572. set(hObject,'BackgroundColor','white');
  573. end

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/385329
推荐阅读
相关标签
  

闽ICP备14008679号