├── Image_Processing_GUI.m ├── README.md ├── gif └── digital_image_GUI.gif ├── lena.png └── 报告.docx /Image_Processing_GUI.m: -------------------------------------------------------------------------------- 1 | classdef Image_Processing_GUI < matlab.apps.AppBase 2 | 3 | % 与应用程序组件对应的属性 4 | properties (Access = public) 5 | %基本组件 6 | figure matlab.ui.Figure 7 | Label_Name matlab.ui.control.Label %姓名 8 | Label_Number matlab.ui.control.Label %学号 9 | globalVar_LEN 10 | globalVar_THETA 11 | globalVar_PSF 12 | globalVar_NCORR 13 | globalVar_ICORR 14 | globalVar_K 15 | globalGau_VAR 16 | globalGau_MEAN 17 | globalDENSITY 18 | global_SPEVAR 19 | global_idealp_Fre 20 | global_ideahp_Fre 21 | global_ideabp_lFre 22 | global_ideabp_hFre 23 | global_ideabs_Fre 24 | global_ideabs_w 25 | global_butterOrder 26 | global_butterlp_Fre 27 | global_butterhp_Fre 28 | global_butterbp_lFre 29 | global_butterbp_hFre 30 | global_butterbs_Fre 31 | global_butterbs_w 32 | global_gausslp_Fre 33 | global_gausshp_Fre 34 | global_gaussbp_lFre 35 | global_gaussbp_hFre 36 | global_gaussbs_Fre 37 | global_gaussbs_w 38 | global_wtThreshold 39 | global_homeOrder %阶数 40 | global_Fre %截止频率 41 | global_hGain %高频增益 42 | global_lGain %低频增益 43 | global_MeanFilter %均值滤波领域大小 44 | global_MedianFilter %中值滤波领域大小 45 | %总变差滤波 46 | global_lambda % 正则化参数,控制去噪程度 47 | global_numIterations % 迭代次数 48 | global_deltaT % 时间步长 49 | 50 | global_nlmeansH %去噪强度 51 | global_patchSize %块大小 52 | global_searchWindowSize %搜索窗口大小 53 | Label_PSNR matlab.ui.control.Label %峰值信噪比 54 | Label_MSE matlab.ui.control.Label %均方误差 55 | Label_SNR matlab.ui.control.Label %信噪比 56 | Label_SSIM matlab.ui.control.Label %结构相似性指数 57 | Label_qualityINFO matlab.ui.control.Label %参数说明 58 | Label_QUALITY 59 | uibuttongroup1 matlab.ui.container.ButtonGroup 60 | %文件操作 61 | reset matlab.ui.control.Button 62 | save matlab.ui.control.Button 63 | exit matlab.ui.control.Button 64 | load matlab.ui.control.Button 65 | uibuttongroup2 matlab.ui.container.ButtonGroup 66 | %原始图像 67 | orgimg matlab.ui.control.UIAxes 68 | uibuttongroup3 matlab.ui.container.ButtonGroup 69 | %效果预览图像 70 | effimg matlab.ui.control.UIAxes 71 | uibuttongroup8 matlab.ui.container.ButtonGroup 72 | %频域滤波 73 | p21 matlab.ui.control.Button %理想低通滤波 74 | Label_idealp_Fre matlab.ui.control.Label % 低通截止频率 75 | EditField_idealp_Fre matlab.ui.control.NumericEditField %低通截止频率 76 | p22 matlab.ui.control.Button %理想高通滤波 77 | Label_ideahp_Fre matlab.ui.control.Label % 高通截止频率 78 | EditField_ideahp_Fre matlab.ui.control.NumericEditField %高通截止频率 79 | p23 matlab.ui.control.Button %理想带通滤波 80 | Label_ideabp_lFre matlab.ui.control.Label % 带通低频截止频率 81 | EditField_ideabp_lFre matlab.ui.control.NumericEditField %带通低频截止频率 82 | Label_ideabp_hFre matlab.ui.control.Label % 带通高频截止频率 83 | EditField_ideabp_hFre matlab.ui.control.NumericEditField %带通高频截止频率 84 | p24 matlab.ui.control.Button %理想带阻滤波 85 | Label_ideabs_Fre matlab.ui.control.Label % 带通低频截止频率 86 | EditField_ideabs_Fre matlab.ui.control.NumericEditField %带通低频截止频率 87 | Label_ideabs_w matlab.ui.control.Label % 带通高频截止频率 88 | EditField_ideabs_w matlab.ui.control.NumericEditField %带通高频截止频率 89 | %巴特沃斯滤波器 90 | Label_butterOrder matlab.ui.control.Label % 巴特沃斯滤波器阶数 91 | EditField_butterOrder matlab.ui.control.NumericEditField %巴特沃斯滤波器阶数 92 | p31 matlab.ui.control.Button %巴特沃斯低通 93 | Label_butterlp_Fre matlab.ui.control.Label % 低通截止频率 94 | EditField_butterlp_Fre matlab.ui.control.NumericEditField %低通截止频率 95 | p32 matlab.ui.control.Button %巴特沃斯高通 96 | Label_butterhp_Fre matlab.ui.control.Label % 高通截止频率 97 | EditField_butterhp_Fre matlab.ui.control.NumericEditField %高通截止频率 98 | p33 matlab.ui.control.Button %巴特沃斯带通 99 | Label_butterbp_lFre matlab.ui.control.Label % 带通低频截止频率 100 | EditField_butterbp_lFre matlab.ui.control.NumericEditField %带通低频截止频率 101 | Label_butterbp_hFre matlab.ui.control.Label % 带通高频截止频率 102 | EditField_butterbp_hFre matlab.ui.control.NumericEditField %带通高频截止频率 103 | p34 matlab.ui.control.Button %巴特沃斯带通 104 | Label_butterbs_Fre matlab.ui.control.Label % 带通低频截止频率 105 | EditField_butterbs_Fre matlab.ui.control.NumericEditField %带通低频截止频率 106 | Label_butterbs_w matlab.ui.control.Label % 带通高频截止频率 107 | EditField_butterbs_w matlab.ui.control.NumericEditField %带通高频截止频率 108 | f21 matlab.ui.control.Button %高斯低通滤波 109 | Label_gausslp_Fre matlab.ui.control.Label % 低通截止频率 110 | EditField_gausslp_Fre matlab.ui.control.NumericEditField %低通截止频率 111 | f22 matlab.ui.control.Button %高斯高通滤波 112 | Label_gausshp_Fre matlab.ui.control.Label % 高通截止频率 113 | EditField_gausshp_Fre matlab.ui.control.NumericEditField %高通截止频率 114 | f23 matlab.ui.control.Button %高斯带通滤波 115 | Label_gaussbp_lFre matlab.ui.control.Label % 带通低频截止频率 116 | EditField_gaussbp_lFre matlab.ui.control.NumericEditField %带通低频截止频率 117 | Label_gaussbp_hFre matlab.ui.control.Label % 带通高频截止频率 118 | EditField_gaussbp_hFre matlab.ui.control.NumericEditField %带通高频截止频率 119 | f24 matlab.ui.control.Button %高斯带阻滤波 120 | Label_gaussbs_Fre matlab.ui.control.Label % 带通截止频率 121 | EditField_gaussbs_Fre matlab.ui.control.NumericEditField %带通截止频率 122 | Label_gaussbs_w matlab.ui.control.Label % 阻带带宽 123 | EditField_gaussbs_w matlab.ui.control.NumericEditField % 阻带带宽 124 | p4 matlab.ui.control.Button %小波去噪 125 | Label_wtThreshold matlab.ui.control.Label % 小波去噪阈值 126 | EditField_wtThreshold matlab.ui.control.NumericEditField %小波去噪阈值 127 | homefilter matlab.ui.container.ButtonGroup %同态滤波 128 | p5 matlab.ui.control.Button %同态滤波 129 | Label_homeOrder matlab.ui.control.Label % 同态滤波阶数 130 | EditField_homeOrder matlab.ui.control.NumericEditField %同态滤波阶数 131 | Label_Fre matlab.ui.control.Label % 同态滤波截止频率 132 | EditField_Fre matlab.ui.control.NumericEditField %同态滤波截止频率 133 | Label_hGain matlab.ui.control.Label %同态滤波高频增益 134 | EditField_hGain matlab.ui.control.NumericEditField %同态滤波高频增益 135 | Label_lGain matlab.ui.control.Label % 同态滤波低频增益 136 | EditField_lGain matlab.ui.control.NumericEditField %同态滤波低频增益 137 | uibuttongroup9 matlab.ui.container.ButtonGroup 138 | %空间滤波器/去噪 139 | p1 matlab.ui.control.Button %维纳滤波 140 | Label_Avg matlab.ui.control.Label %均值滤波 141 | Label_MeanFilter matlab.ui.control.Label % 均值滤波领域大小 142 | EditField_MeanFilter matlab.ui.control.NumericEditField % 均值滤波领域大小 143 | f1_1 matlab.ui.control.Button %均值滤波 replicate 144 | f1_2 matlab.ui.control.Button %均值滤波 symmetric 145 | f1_3 matlab.ui.control.Button %均值滤波 circular 146 | f3 matlab.ui.control.Button %中值滤波 147 | Label_MedianFilter matlab.ui.control.Label % 中值滤波领域大小 148 | EditField_MedianFilter matlab.ui.control.NumericEditField % 中值滤波领域大小 149 | f4 matlab.ui.control.Button %非局部均值去噪 150 | Label_nlmeansH matlab.ui.control.Label%去噪强度 151 | EditField_nlmeansH matlab.ui.control.NumericEditField 152 | Label_patchSize matlab.ui.control.Label %块大小 153 | EditField_patchSize matlab.ui.control.NumericEditField 154 | Label_searchWindowSize matlab.ui.control.Label %搜索窗口大小 155 | EditField_searchWindowSize matlab.ui.control.NumericEditField 156 | f5 matlab.ui.control.Button %总变差去噪 157 | Label_lambda matlab.ui.control.Label%去噪强度 158 | EditField_lambda matlab.ui.control.NumericEditField 159 | Label_numIterations matlab.ui.control.Label %块大小 160 | EditField_numIterations matlab.ui.control.NumericEditField 161 | Label_deltaT matlab.ui.control.Label %搜索窗口大小 162 | EditField_deltaT matlab.ui.control.NumericEditField 163 | Label_Wn matlab.ui.control.Label %维纳滤波提示 164 | %添加噪波 165 | uibuttongroup10 matlab.ui.container.ButtonGroup 166 | n1 matlab.ui.control.Button %高斯噪声 167 | Label_MEAN matlab.ui.control.Label %均值 168 | Label_VAR matlab.ui.control.Label %方差 169 | EditField_MEAN matlab.ui.control.NumericEditField %运动长度输入 170 | EditField_VAR matlab.ui.control.NumericEditField %运动方向角输入 171 | n2 matlab.ui.control.Button %泊松噪波 172 | n3 matlab.ui.control.Button %椒盐噪声 173 | Label_DENSITY matlab.ui.control.Label %噪声密度 174 | EditField_DENSITY matlab.ui.control.NumericEditField %噪声密度 175 | n4 matlab.ui.control.Button %斑点噪声 176 | Label_SPEVAR matlab.ui.control.Label %斑点噪声方差 177 | EditField_SPEVAR matlab.ui.control.NumericEditField %噪声密度 178 | n5 matlab.ui.control.Button %运动噪波 179 | Label_LEN matlab.ui.control.Label %运动长度 180 | Label_THETA matlab.ui.control.Label %运动方向角 181 | EditField_LEN matlab.ui.control.NumericEditField %运动长度输入 182 | EditField_THETA matlab.ui.control.NumericEditField %运动方向角输入 183 | uibuttongroup11 matlab.ui.container.ButtonGroup 184 | %变换波形显示 185 | g1 matlab.ui.control.UIAxes %图像RGB颜色分解 186 | g2 matlab.ui.control.UIAxes %傅里叶变换 187 | g3 matlab.ui.control.UIAxes %DCT变换 188 | g4 matlab.ui.control.UIAxes %小波变换1 189 | g5 matlab.ui.control.UIAxes %小波变换2 190 | g6 matlab.ui.control.UIAxes %小波变换3 191 | g7 matlab.ui.control.UIAxes %小波变换4 192 | uibuttongroup12_1 matlab.ui.container.ButtonGroup %小波选择 193 | Label matlab.ui.control.Label 194 | Button1 matlab.ui.control.Button 195 | Button2 matlab.ui.control.Button 196 | Button3 matlab.ui.control.Button 197 | Button4 matlab.ui.control.Button 198 | Button5 matlab.ui.control.Button 199 | Button6 matlab.ui.control.Button 200 | Button7 matlab.ui.control.Button 201 | end 202 | 203 | %根据对图片施加的效果更新变换图像 204 | methods (Access = private) 205 | 206 | function update(app, handles) %更新图表 207 | % 显示等待条 208 | h = waitbar(0, '更新图像中 等待...'); 209 | steps = 30; 210 | for step = 1:steps 211 | waitbar(step / steps) 212 | end 213 | close(h) 214 | 215 | mysize=size(handles.img); % 获取处理后的图像大小 216 | if numel(mysize)>2 217 | % 如果图像大小大于二维,则执行 updateColr 函数进行处理 218 | updateColr(app, handles) 219 | updateColr_FT(app, handles) 220 | updateColr_DCT(app, handles) 221 | else 222 | % 否则执行 updateGray 函数进行处理 223 | updateGray(app, handles) 224 | updateGray_FT(app, handles) 225 | updateGary_DCT(app, handles) %更新彩色图像彩色直方图 226 | end 227 | updateDWT(app, handles) 228 | 229 | [quality_MSE,quality_SNR,quality_PSNR,quality_SSIM] = calculateQualityMetrics(app,handles.i,handles.img); 230 | app.Label_SSIM.Text = ['SSIM: ', num2str(round(quality_SSIM, 3)), ' dB']; 231 | app.Label_PSNR.Text = ['PSNR: ', num2str(round(quality_PSNR, 3)), ' dB']; 232 | app.Label_SNR.Text = ['SNR: ', num2str(round(quality_SNR, 3)), ' dB']; 233 | app.Label_MSE.Text = ['MSE: ', num2str(round(quality_MSE, 3)), '']; 234 | 235 | 236 | end 237 | 238 | function updateColr(app, handles) %更新彩色图像彩色直方图 239 | set(handles.g1, 'Visible', 'on'); 240 | % 将图像数据重塑为一维数组 241 | ImageData1 = mat2gray( handles.img(:,:,1) ); 242 | ImageData1 = reshape(ImageData1, [numel(ImageData1), 1]) * 255; 243 | ImageData2 = mat2gray( handles.img(:,:,2) ); 244 | ImageData2 = reshape(ImageData2, [numel(ImageData2), 1]) * 255; 245 | ImageData3 = mat2gray( handles.img(:,:,3) ); 246 | ImageData3 = reshape(ImageData3, [numel(ImageData3), 1]) * 255; 247 | % 计算直方图 248 | [H1, X1] = imhist(uint8(ImageData1), 256); % 指定横坐标范围为0~255 249 | [H2, X2] = imhist(uint8(ImageData2), 256); % 指定横坐标范围为0~255 250 | [H3, X3] = imhist(uint8(ImageData3), 256); % 指定横坐标范围为0~255 251 | % 在g1示波器中绘制彩色直方图 252 | axes(handles.g1); 253 | cla; 254 | hold on; % 保持绘图区域,以便绘制其他曲线 255 | plot(X1, H1, 'R'); % 绘制红色通道直方图,颜色为红色 256 | plot(X2, H2, 'G'); % 绘制绿色通道直方图,颜色为绿色 257 | plot(X3, H3, 'B'); % 绘制蓝色通道直方图,颜色为蓝色 258 | legend('R','G','B'); 259 | title('图像颜色直方图'); 260 | maxY = max([H1 H2 H3]); 261 | maxY = max(maxY); 262 | disp(maxY); 263 | axis([0 255 0 maxY-1]); % 设置坐标轴范围,x轴范围为0到256,y轴范围根据直方图的最大值确定 264 | hold off; % 结束绘图区域的保持状态 265 | end 266 | 267 | function updateGray(app, handles) %更新灰度直方图 268 | set(handles.g1, 'Visible', 'on'); 269 | % 将滤波后的图像数据重塑为一维数组,并将像素值从[0, 1]映射到[0, 255] 270 | ImageData = mat2gray(handles.img); 271 | ImageData = reshape(ImageData, [numel(ImageData), 1]) * 255; 272 | % 计算直方图 273 | [H, X] = imhist(uint8(ImageData), 256); % 指定横坐标范围为0~255 274 | % 在 g1 示波器中绘制灰色直方图 275 | axes(handles.g1); 276 | cla; 277 | hold on; 278 | bar(X, H, 'k'); 279 | legend('灰度'); 280 | title('图像灰度直方图'); 281 | axis([0 255 0 max(H)]); 282 | hold off; 283 | end 284 | 285 | function updateColr_FT(app, handles) %更新彩色图像彩色直方图 286 | set(handles.g2, 'Visible', 'on'); 287 | % 计算傅里叶变换 288 | imgft = zeros(size(handles.img)); 289 | for i = 1:3 % 遍历每个颜色通道 290 | channel = handles.img(:,:,i); 291 | channel_ft = fft2(channel); % 傅里叶变换 292 | imgft(:,:,i) = abs(fftshift(channel_ft)); % 将傅里叶变换的模进行象限转换并保存 293 | end 294 | % 将三个颜色通道的傅里叶变换结果合并或做其他处理 295 | final_imgft = sum(imgft, 3); % 简单地将三个通道的结果相加 296 | % 可视化傅里叶变换结果 297 | imgftam = log(final_imgft + 1); % 将傅里叶变换结果的幅值映射到小的正数 298 | axes(handles.g2); 299 | cla; 300 | imshow(imgftam, []); % 显示傅里叶变换结果图像,映射到[0,1] 301 | title('彩色图像的傅里叶谱'); 302 | hold off; 303 | end 304 | 305 | function updateGray_FT(app, handles) %更新彩色图像彩色直方图 306 | set(handles.g2, 'Visible', 'on'); 307 | % 计算灰度傅里叶变换 308 | grayImg = handles.img; 309 | % 计算傅里叶变换 310 | imgft = fft2(grayImg); % 对灰度图像执行傅里叶变换 311 | imgft = abs(fftshift(imgft)); % 将傅里叶变换的模进行象限转换并保存 312 | % 可视化傅里叶变换结果 313 | imgftam = log(imgft + 1); % 将傅里叶变换结果的幅值映射到小的正数 314 | axes(handles.g2); 315 | cla; 316 | imshow(imgftam, []); % 显示傅里叶变换结果图像,映射到[0,1] 317 | title('灰度图像的傅里叶谱'); 318 | hold off; 319 | end 320 | 321 | function updateColr_DCT(app, handles) %更新彩色图像彩色直方图 322 | set(handles.g3, 'Visible', 'on'); 323 | % 对彩色图像进行DCT变换 324 | dct_img = zeros(size(handles.img)); 325 | for i = 1:3 % 遍历每个颜色通道 326 | channel = handles.img(:,:,i); 327 | dct_channel = dct2(channel); 328 | dct_img(:,:,i) = dct_channel; 329 | end 330 | dct_img = log(abs(dct_img)); 331 | axes(handles.g3); 332 | cla; 333 | imshow(dct_img, []); 334 | title('彩色图像的DCT频谱'); 335 | hold off; 336 | end 337 | 338 | function updateGary_DCT(app, handles) %更新彩色图像彩色直方图 339 | set(handles.g3, 'Visible', 'on'); 340 | % 对灰色图像进行DCT变换 341 | grayImg = handles.img; 342 | % 计算DCT变换 343 | dctImg = dct2(grayImg); 344 | % 可视化DCT变换结果 345 | axes(handles.g3); 346 | cla; 347 | imshow(log(abs(dctImg) + 1), []); % 显示DCT变换结果的幅值,映射到[0,1] 348 | title('灰度图像的DCT变换'); 349 | hold off; 350 | end 351 | 352 | function updateDWT(app, handles) %更新小波变换 353 | set(handles.g4, 'Visible', 'on'); 354 | set(handles.g5, 'Visible', 'on'); 355 | set(handles.g6, 'Visible', 'on'); 356 | set(handles.g7, 'Visible', 'on'); 357 | 358 | % 计算小波变换 359 | mysize=size(handles.img); % 获取处理后的图像大小 360 | if numel(mysize)>2 361 | grayimg = rgb2gray(handles.img); 362 | else 363 | grayimg = handles.img; 364 | end 365 | [grap_LLY, HL, LH, HH] = dwt2(grayimg, 'haar'); 366 | [LLY, HL, LH, HH] = dwt2(handles.img, 'haar'); 367 | %显示小波变换 368 | set(handles.g4, 'Visible', 'on'); 369 | axes(handles.g4); 370 | cla; 371 | imshow(grap_LLY, []); 372 | hold off; 373 | title('小波变换(1.灰度低频近似值)'); 374 | set(handles.g5, 'Visible', 'on'); 375 | axes(handles.g5); 376 | cla; 377 | imshow(HL, []); 378 | title('2.水平方向细节'); 379 | hold off; 380 | set(handles.g6, 'Visible', 'on'); 381 | axes(handles.g6); 382 | cla; 383 | imshow(LH, []); 384 | title('3.垂直方向细节'); 385 | hold off; 386 | set(handles.g7, 'Visible', 'on'); 387 | axes(handles.g7); 388 | cla; 389 | imshow(HH, []); 390 | title('4.对角线方向细节'); 391 | hold off; 392 | end 393 | 394 | % 定义计算图像质量评价指标的函数 395 | function [quality_MSE,quality_SNR,quality_PSNR,quality_SSIM] = calculateQualityMetrics(app,originalImage, processedImage, metric) 396 | % 将图像转为双精度类型 397 | originalImage = double(originalImage); 398 | processedImage = double(processedImage); 399 | 400 | quality_PSNR = calculatePSNR(app,originalImage, processedImage); 401 | quality_SSIM = calculateSSIM(app,originalImage, processedImage); 402 | quality_MSE = calculateMSE(app,originalImage, processedImage); 403 | quality_SNR = calculateSNR(app,originalImage, processedImage); 404 | end 405 | 406 | % 定义计算PSNR的函数 407 | function quality_PSNR = calculatePSNR(app,originalImage, processedImage) 408 | % 获取图像大小 409 | [M, N, ~] = size(originalImage); 410 | 411 | % 计算均方误差(MSE) 412 | mse = sum(sum((originalImage - processedImage).^2)) / (M * N); 413 | 414 | % 计算PSNR 415 | A = 255; % 8比特精度图像的最大像素值 416 | quality_PSNR = 10 * log10(A^2 / mse); 417 | end 418 | 419 | % 定义计算SSIM的函数 420 | function quality_SSIM = calculateSSIM(app,originalImage, processedImage) 421 | % 使用 MATLAB 内置的 ssim 函数计算 SSIM 422 | quality_SSIM = ssim(processedImage,originalImage); 423 | end 424 | 425 | % 定义计算MSE的函数 426 | function quality_MSE = calculateMSE(app,originalImage, processedImage) 427 | % 获取图像大小 428 | [M, N, ~] = size(originalImage); 429 | 430 | % 计算均方误差(MSE) 431 | quality_MSE = sum(sum((originalImage - processedImage).^2)) / (M * N); 432 | end 433 | 434 | % 定义计算 SNR 的函数 435 | function quality_SNR = calculateSNR(app,originalImage, processedImage) 436 | % 计算信号强度 437 | signal = sum(sum(originalImage.^2)); 438 | 439 | % 计算噪声强度 440 | noise = sum(sum((originalImage - processedImage).^2)); 441 | 442 | % 计算 SNR 443 | quality_SNR = 10 * log10(signal / noise); 444 | end 445 | 446 | end 447 | 448 | % 句柄控件控制的回调函数 449 | methods (Access = private) 450 | 451 | % 组件创建后执行的代码 452 | function Image_processing_GUI_OpeningFcn(app, varargin) 453 | % Create GUIDE-style callback args - Added by Migration Tool 454 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app); %#ok 455 | 456 | % 选择 Image_processing_GUI 的默认命令行输出 457 | handles.output = hObject; 458 | % 禁用一些按钮和控件 459 | set(handles.load,'Enable','on'); 460 | set(handles.save,'Enable','off'); 461 | set(handles.exit,'Enable','off'); 462 | set(handles.reset,'Enable','off'); 463 | set(handles.effimg,'Visible','off'); 464 | set(handles.orgimg,'Visible','off'); 465 | set(handles.g1,'Visible','off'); 466 | set(handles.g2,'Visible','off'); 467 | set(handles.g3,'Visible','off'); 468 | set(handles.g4,'Visible','off'); 469 | set(handles.g5,'Visible','off'); 470 | set(handles.g6,'Visible','off'); 471 | set(handles.g7,'Visible','off'); 472 | set(handles.n1,'Enable','off'); 473 | set(handles.n2,'Enable','off'); 474 | set(handles.n3,'Enable','off'); 475 | set(handles.n4,'Enable','off'); 476 | set(handles.f1_1,'Enable','off'); 477 | set(handles.f1_2,'Enable','off'); 478 | set(handles.f1_3,'Enable','off'); 479 | set(handles.f21,'Enable','off'); 480 | set(handles.f22,'Enable','off'); 481 | set(handles.f23,'Enable','off'); 482 | set(handles.f24,'Enable','off'); 483 | set(handles.f3,'Enable','off'); 484 | set(handles.f4,'Enable','off'); 485 | set(handles.f5,'Enable','off'); 486 | set(handles.p1,'Enable','off'); 487 | set(handles.p21,'Enable','off'); 488 | set(handles.p22,'Enable','off'); 489 | set(handles.p23,'Enable','off'); 490 | set(handles.p24,'Enable','off'); 491 | set(handles.p31,'Enable','off'); 492 | set(handles.p32,'Enable','off'); 493 | set(handles.p33,'Enable','off'); 494 | set(handles.p34,'Enable','off'); 495 | set(handles.p4,'Enable','off'); 496 | set(handles.p5,'Enable','off'); 497 | set(handles.uibuttongroup12_1,'visible','off'); 498 | set(handles.Button1,'Enable','off'); 499 | set(handles.Button2,'Enable','off'); 500 | set(handles.Button3,'Enable','off'); 501 | set(handles.Button4,'Enable','off'); 502 | set(handles.Button5,'Enable','off'); 503 | set(handles.Button6,'Enable','off'); 504 | set(handles.Button7,'Enable','off'); 505 | set(handles.n5,'Enable','off'); 506 | % 更新 handles 结构 507 | guidata(hObject, handles); 508 | end 509 | 510 | % 加载 511 | function load_Callback(app, event) 512 | % Create GUIDE-style callback args - Added by Migration Tool 513 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 514 | 515 | % 打开文件选择对话框 516 | [file, path] = uigetfile({'*.jpg;*.bmp;*.jpeg;*.png', '图片文件 (*.jpg,*.bmp,*.jpeg,*.png)'}, '打开文件'); 517 | 518 | image = [path file]; 519 | handles.file = image; 520 | 521 | % 如果用户取消选择文件,弹出警告对话框 522 | if (file == 0) 523 | warndlg('您没有选择图片。') ; 524 | return; 525 | end 526 | 527 | % 获取文件扩展名 528 | [fpath, fname, fext] = fileparts(file); 529 | validex = {'.bmp', '.jpg', '.jpeg', '.png'}; 530 | found = 0; 531 | 532 | % 检查文件扩展名是否合法 533 | for x = 1:length(validex) 534 | if (strcmpi(fext, validex{x})) 535 | found = 1; 536 | 537 | % 启用一些按钮和控件 538 | set(handles.save, 'Enable', 'on'); 539 | set(handles.exit, 'Enable', 'on'); 540 | set(handles.reset, 'Enable', 'on'); 541 | set(handles.effimg, 'Visible', 'on'); 542 | set(handles.orgimg, 'Visible', 'on'); 543 | set(handles.n1, 'Enable', 'on'); 544 | set(handles.n2, 'Enable', 'on'); 545 | set(handles.n3, 'Enable', 'on'); 546 | set(handles.n4, 'Enable', 'on'); 547 | set(handles.f1_1,'Enable','on'); 548 | set(handles.f1_2,'Enable','on'); 549 | set(handles.f1_3,'Enable','on'); 550 | set(handles.f21, 'Enable', 'on'); 551 | set(handles.f22, 'Enable', 'on'); 552 | set(handles.f23, 'Enable', 'on'); 553 | set(handles.f24, 'Enable', 'on'); 554 | set(handles.f3, 'Enable', 'on'); 555 | set(handles.f4, 'Enable', 'on'); 556 | set(handles.f5, 'Enable', 'on'); 557 | set(handles.p21,'Enable','on'); 558 | set(handles.p22,'Enable','on'); 559 | set(handles.p23,'Enable','on'); 560 | set(handles.p24,'Enable','on'); 561 | set(handles.p31,'Enable','on'); 562 | set(handles.p32,'Enable','on'); 563 | set(handles.p33,'Enable','on'); 564 | set(handles.p34,'Enable','on'); 565 | set(handles.p4, 'Enable', 'on'); 566 | set(handles.p5, 'Enable', 'on'); 567 | set(handles.Button1,'Enable','on'); 568 | set(handles.Button2,'Enable','on'); 569 | set(handles.Button3,'Enable','on'); 570 | set(handles.Button4,'Enable','on'); 571 | set(handles.Button5,'Enable','on'); 572 | set(handles.Button6,'Enable','on'); 573 | set(handles.Button7,'Enable','on'); 574 | set(handles.n5,'Enable','on'); 575 | 576 | % 读取图像数据 577 | handles.img = imread(image); %handles.img载入图像数据 578 | handles.i = imread(image); %原图数据 579 | % assignin('base', 'myVariable2', handles.img); 580 | 581 | % 显示图像在effimg和orgimg中 582 | axes(handles.orgimg); % 设置orgimg为当前绘图区域 583 | cla; % 清空当前绘图区域 584 | imshow(handles.img); % 在orgimg绘图区域显示图像数据 585 | 586 | axes(handles.effimg); % 设置effimg为当前绘图区域 587 | cla; % 清空当前绘图区域 588 | imshow(handles.img); % 在effimg绘图区域显示图像数据 589 | 590 | 591 | % 更新 handles 结构 592 | guidata(hObject, handles); 593 | 594 | % 关闭等待条 595 | hWaitbar = waitbar(0, '等待......', 'CreateCancelBtn', 'delete(gcbf)'); 596 | set(hWaitbar, 'Color', [0.9, 0.9, 0.9]); 597 | steps = 3; 598 | waitbar(1 / steps); 599 | waitbar(2 / steps); 600 | waitbar(3 / steps); 601 | %关闭进度条 602 | close(hWaitbar); 603 | 604 | update(app, handles); 605 | 606 | hWaitbar = waitbar(0, '等待......', 'CreateCancelBtn', 'delete(gcbf)'); 607 | set(hWaitbar, 'Color', [0.9, 0.9, 0.9]); 608 | steps = 10; 609 | for waiting = 1 : 10 610 | waitbar(waiting / steps); 611 | end 612 | close(hWaitbar); 613 | 614 | set(handles.uibuttongroup12_1,'visible','on'); 615 | 616 | app.globalVar_LEN = 10; 617 | app.globalVar_THETA = 20; 618 | app.globalGau_MEAN = 0; 619 | app.globalGau_VAR = 0.05; 620 | app.globalDENSITY = 0.1; 621 | app.global_SPEVAR = 0.04; 622 | %理想滤波器 623 | app.global_idealp_Fre = 60; 624 | app.global_ideahp_Fre = 30; 625 | app.global_ideabp_lFre = 20; 626 | app.global_ideabp_hFre = 80; 627 | app.global_ideabs_Fre = 50; 628 | app.global_ideabs_w = 30; 629 | %巴特沃斯滤波器 630 | app.global_butterOrder = 6; 631 | app.global_butterlp_Fre = 60; 632 | app.global_butterhp_Fre = 30; 633 | app.global_butterbp_lFre = 20; 634 | app.global_butterbp_hFre = 80; 635 | app.global_butterbs_Fre = 50; 636 | app.global_butterbs_w = 30; 637 | %高斯滤波器 638 | app.global_gausslp_Fre = 60; 639 | app.global_gausshp_Fre = 30; 640 | app.global_gaussbp_lFre = 20; 641 | app.global_gaussbp_hFre = 80; 642 | app.global_gaussbs_Fre = 50; 643 | app.global_gaussbs_w = 30; 644 | %小波去噪 645 | app.global_wtThreshold = 0.5; 646 | %同态滤波 647 | app.global_homeOrder = 1; 648 | app.global_Fre = 5; 649 | app.global_hGain = 1.1; 650 | app.global_lGain = 0.1; 651 | %均值滤波领域大小 652 | app.global_MeanFilter = 6; 653 | %中值滤波领域大小 654 | app.global_MedianFilter = 3; 655 | %总变差滤波 656 | app.global_lambda = 0.1; % 正则化参数,控制去噪程度 657 | app.global_numIterations = 30; % 迭代次数 658 | app.global_deltaT = 0.1; % 时间步长 659 | app.global_nlmeansH = 2; %去噪强度 660 | app.global_patchSize = 5; %块大小 661 | app.global_searchWindowSize = 10; %搜索窗口大小 662 | 663 | % 更新 handles 结构 664 | guidata(hObject, handles); 665 | break; 666 | end 667 | end 668 | % 如果文件扩展名不合法,弹出错误对话框 669 | if (found == 0) 670 | errordlg('文件扩展名不正确,请从可用扩展名[.jpg、.jpeg、.bmp、.png]中选择文件','Image Format Error'); 671 | end 672 | end 673 | 674 | % 退出 675 | function exit_Callback(app, event) 676 | % Create GUIDE-style callback args - Added by Migration Tool 677 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 678 | 679 | % 关闭所有图形窗口 680 | close all; 681 | end 682 | 683 | % 恢复原图 684 | function reset_Callback(app, event) 685 | % Create GUIDE-style callback args - Added by Migration Tool 686 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 687 | % 将图像恢复为初始状态 688 | handles.img = handles.i; 689 | % 在effimg中显示图像 690 | axes(handles.effimg); 691 | cla; 692 | imshow(handles.img); 693 | % 更新 694 | update(app, handles); 695 | % 更新 handles 结构 696 | guidata(hObject,handles); 697 | end 698 | 699 | % 保存图像 700 | function save_Callback(app, event) 701 | % Create GUIDE-style callback args - Added by Migration Tool 702 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 703 | 704 | % 弹出文件保存对话框 705 | [file, path] = uiputfile('*.jpg', 'Save Image as'); 706 | 707 | % 拼接保存路径和文件名 708 | save = [path file]; 709 | 710 | try 711 | % 将图像保存为 JPG 格式 712 | imwrite(handles.img, save, 'jpg'); 713 | catch 714 | warndlg('您没有填写保存图片名称。') ; 715 | return; 716 | end 717 | 718 | end 719 | 720 | % f1_1 : 均值滤波 replicate 721 | function f1_1_Callback(app, event) 722 | % 定义一个名为 f1_1_Callback 的函数,其输入参数为 app、event 和 neighborhood_size 723 | % 创建 GUIDE 风格的回调函数参数(由迁移工具添加) 724 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 725 | % 显示等待条 726 | h = waitbar(0, '等待...'); 727 | steps = 200; 728 | for step = 1:steps 729 | waitbar(step / steps) 730 | end 731 | close(h) 732 | 733 | mean_size = [app.global_MeanFilter, app.global_MeanFilter]; 734 | % 使用 convertToGUIDECallbackArguments 函数将 app 和 event 转换为 GUIDE 回调函数所需的参数,并将其存储在 hObject、eventdata 和 handles 变量中 735 | h = fspecial('average', mean_size); 736 | % 创建一个指定大小的平均滤波器模板 737 | handles.img = imfilter(handles.img, h, 'replicate'); 738 | % 使用平均滤波器对图像进行滤波处理 739 | axes(handles.effimg); 740 | cla; 741 | imshow(handles.img) 742 | % 将当前坐标轴更改为 handles.effimg 所代表的坐标轴,清空坐标轴并显示处理后的图像 743 | % 更新 handles 结构 744 | guidata(hObject, handles); 745 | % 显示等待条 746 | h = waitbar(0, '更新图像中 等待...'); 747 | steps = 200; 748 | for step = 1:steps 749 | waitbar(step / steps) 750 | end 751 | close(h) 752 | % 更新函数 753 | update(app, handles); 754 | end 755 | % f1_2 : 均值滤波 symmetric 756 | function f1_2_Callback(app, event) 757 | % 创建 GUIDE 风格的回调函数参数(由迁移工具添加) 758 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 759 | % 显示等待条 760 | h = waitbar(0, '等待...'); 761 | steps = 200; 762 | for step = 1:steps 763 | waitbar(step / steps) 764 | end 765 | close(h) 766 | mean_size = [app.global_MeanFilter, app.global_MeanFilter]; 767 | % 使用 convertToGUIDECallbackArguments 函数将 app 和 event 转换为 GUIDE 回调函数所需的参数,并将其存储在 hObject、eventdata 和 handles 变量中 768 | h = fspecial('average', mean_size); 769 | % 创建一个平均滤波器模板 770 | handles.img=imfilter(handles.img,h,'symmetric'); 771 | % 使用平均滤波器对图像进行滤波处理 772 | axes(handles.effimg); 773 | cla; 774 | imshow(handles.img) 775 | % 将当前坐标轴更改为 handles.effimg 所代表的坐标轴,清空坐标轴并显示处理后的图像 776 | % 更新 handles 结构 777 | guidata(hObject, handles); 778 | % 显示等待条 779 | h = waitbar(0, '更新图像中 等待...'); 780 | steps = 200; 781 | for step = 1:steps 782 | waitbar(step / steps) 783 | end 784 | close(h) 785 | % 更新函数 786 | update(app,handles); 787 | end 788 | % f1_3 : 均值滤波 circular 789 | function f1_3_Callback(app, event) 790 | % 创建 GUIDE 风格的回调函数参数(由迁移工具添加) 791 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 792 | % 显示等待条 793 | h = waitbar(0, '等待...'); 794 | steps = 200; 795 | for step = 1:steps 796 | waitbar(step / steps) 797 | end 798 | close(h) 799 | mean_size = [app.global_MeanFilter, app.global_MeanFilter]; 800 | % 使用 convertToGUIDECallbackArguments 函数将 app 和 event 转换为 GUIDE 回调函数所需的参数,并将其存储在 hObject、eventdata 和 handles 变量中 801 | h = fspecial('average', mean_size); 802 | % 创建一个平均滤波器模板 803 | handles.img=imfilter(handles.img,h,'circular'); 804 | % 使用平均滤波器对图像进行滤波处理 805 | axes(handles.effimg); 806 | cla; 807 | imshow(handles.img) 808 | % 将当前坐标轴更改为 handles.effimg 所代表的坐标轴,清空坐标轴并显示处理后的图像 809 | % 更新 handles 结构 810 | guidata(hObject, handles); 811 | % 显示等待条 812 | h = waitbar(0, '更新图像中 等待...'); 813 | steps = 200; 814 | for step = 1:steps 815 | waitbar(step / steps) 816 | end 817 | close(h) 818 | % 更新函数 819 | update(app,handles); 820 | end 821 | % Value changed function: EditField_MeanFilterChanged 822 | function EditField_MeanFilterChanged(app, event) 823 | app.global_MeanFilter = app.EditField_MeanFilter.Value; 824 | end 825 | 826 | % f3 中值滤波 827 | function f3_Callback(app, event) 828 | % 定义一个名为 f3_Callback 的函数,其输入参数为 app 和 event 829 | % 创建 GUIDE 风格的回调函数参数(由迁移工具添加) 830 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 831 | % 显示等待条 832 | h = waitbar(0, '等待...'); 833 | steps = 200; 834 | for step = 1:steps 835 | waitbar(step / steps) 836 | end 837 | close(h) 838 | median_size = [app.global_MedianFilter, app.global_MedianFilter]; 839 | % 使用 convertToGUIDECallbackArguments 函数将 app 和 event 转换为 GUIDE 回调函数所需的参数,并将其存储在 hObject、eventdata 和 handles 变量中 840 | mysize=size(handles.img); % 获取处理后的图像大小 841 | if numel(mysize)>2 842 | r=medfilt2(handles.img(:,:,1), median_size); 843 | % 对图像的红色通道进行中值滤波处理 844 | g=medfilt2(handles.img(:,:,2), median_size); 845 | % 对图像的绿色通道进行中值滤波处理 846 | b=medfilt2(handles.img(:,:,3), median_size); 847 | % 对图像的蓝色通道进行中值滤波处理 848 | handles.img=cat(3,r,g,b); 849 | else 850 | gray=medfilt2(handles.img(:,:,1), median_size); 851 | handles.img=cat(1, gray); 852 | end 853 | 854 | % 将三个滤波处理后的通道重新组合成图像 855 | axes(handles.effimg); 856 | % 将当前坐标轴更改为 handles.effimg 所代表的坐标轴 857 | cla; imshow(handles.img); 858 | % 清空坐标轴并显示处理后的图像 859 | guidata(hObject,handles); 860 | % 更新应用程序数据,将 handles 变量保存到 app 中 861 | % 更新 handles 结构 862 | guidata(hObject, handles); 863 | % 显示等待条 864 | h = waitbar(0, '更新图像中 等待...'); 865 | steps = 200; 866 | for step = 1:steps 867 | waitbar(step / steps) 868 | end 869 | close(h) 870 | % 更新函数 871 | update(app,handles); 872 | end 873 | % Value changed function: EditField_MedianFilterChanged 874 | function EditField_MedianFilterChanged(app, event) 875 | app.global_MedianFilter = app.EditField_MedianFilter.Value; 876 | end 877 | 878 | %非局部均值去噪 879 | function f4_Callback(app, event) 880 | % 从输入参数中获取对象句柄和其他信息 881 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 882 | 883 | % 显示等待条 884 | h_waitbar = waitbar(0, '等待... 正在计算,非局部均值去噪计算时间较长,请耐心等待。'); 885 | steps = 200; 886 | for step = 0:100 887 | waitbar(step / steps) 888 | end 889 | % 获取图像及相关参数 890 | img = handles.img; % 获取图像 891 | %I:含噪声图像 892 | %ds:邻域窗口半径 893 | %Ds:搜索窗口半径 894 | %h:高斯函数平滑参数 895 | %DenoisedImg:去噪图像 896 | h = app.global_nlmeansH; % 获取非局部均值去噪参数h 897 | ds = app.global_patchSize; % 获取像素块大小参数 898 | Ds = app.global_searchWindowSize; % 获取搜索窗口大小参数 899 | 900 | I=double(img); 901 | [m,n]=size(I); 902 | DenoisedImg=zeros(m,n); 903 | PaddedImg = padarray(I,[ds,ds],'symmetric','both'); 904 | kernel=ones(2*ds+1,2*ds+1); 905 | kernel=kernel./((2*ds+1)*(2*ds+1)); 906 | h2=h*h; 907 | for i=1:m 908 | for j=1:n 909 | i1=i+ds; 910 | j1=j+ds; 911 | W1=PaddedImg(i1-ds:i1+ds,j1-ds:j1+ds);%邻域窗口1 912 | wmax=0; 913 | average=0; 914 | sweight=0; 915 | %%搜索窗口 916 | rmin = max(i1-Ds,ds+1); 917 | rmax = min(i1+Ds,m+ds); 918 | smin = max(j1-Ds,ds+1); 919 | smax = min(j1+Ds,n+ds); 920 | for r=rmin:rmax 921 | for s=smin:smax 922 | if(r==i1&&s==j1) 923 | continue; 924 | end 925 | W2=PaddedImg(r-ds:r+ds,s-ds:s+ds);%邻域窗口2 926 | Dist2=sum(sum(kernel.*(W1-W2).*(W1-W2)));%邻域间距离 927 | w=exp(-Dist2/h2); 928 | if(w>wmax) 929 | wmax=w; 930 | end 931 | sweight=sweight+w; 932 | average=average+w*PaddedImg(r,s); 933 | end 934 | end 935 | average=average+wmax*PaddedImg(i1,j1);%自身取最大权值 936 | sweight=sweight+wmax; 937 | DenoisedImg(i,j)=average/sweight; 938 | end 939 | end 940 | 941 | for step = 100:200 942 | waitbar(step / steps) 943 | end 944 | close(h_waitbar) 945 | % 更新图像句柄中的图像数据 946 | handles.img = DenoisedImg; 947 | assignin('base', 'myVariable2', handles.img); 948 | % 在图像窗口中显示处理后的图像 949 | axes(handles.effimg); 950 | cla; 951 | imshow(handles.img,[]); 952 | 953 | % 更新图像句柄 954 | guidata(hObject, handles); 955 | 956 | % 更新应用程序 957 | update(app,handles); 958 | end 959 | 960 | % Value changed function: EditField_lambdaChanged 961 | function EditField_nlmeansHChanged(app, event) 962 | app.global_nlmeansH = app.EditField_nlmeansH.Value; 963 | end 964 | % Value changed function: EditField_numIterationsChanged 965 | function EditField_patchSizeChanged(app, event) 966 | app.global_patchSize = app.EditField_patchSize.Value; 967 | end 968 | % Value changed function: EditField_deltaTChanged 969 | function EditField_searchWindowSizeChanged(app, event) 970 | app.global_searchWindowSize = app.EditField_searchWindowSize.Value; 971 | end 972 | 973 | %总变差去噪 974 | function f5_Callback(app, event) 975 | % 创建 GUIDE 风格的回调函数参数 976 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 977 | 978 | % 显示等待条 979 | h = waitbar(0, '等待...'); 980 | steps = 200; 981 | for step = 1:steps 982 | waitbar(step / steps) 983 | end 984 | close(h) 985 | 986 | % 获取处理后的图像大小 987 | mysize = size(handles.img); 988 | if numel(mysize) > 2 989 | % 对图像的三个通道分别进行总变差去噪处理 990 | r = total_variation_denoising(app, handles.img(:,:,1)); % 对红色通道进行总变差去噪处理 991 | g = total_variation_denoising(app, handles.img(:,:,2)); % 对绿色通道进行总变差去噪处理 992 | b = total_variation_denoising(app, handles.img(:,:,3)); % 对蓝色通道进行总变差去噪处理 993 | handles.img = cat(3, r, g, b); 994 | else 995 | % 对灰度图像进行总变差去噪处理 996 | gray = total_variation_denoising(app, handles.img(:,:,1)); 997 | handles.img = cat(1, gray); 998 | end 999 | 1000 | % 将处理后的图像显示在坐标轴上 1001 | axes(handles.effimg); 1002 | cla; imshow(handles.img,[]); 1003 | 1004 | % 更新应用程序数据 1005 | guidata(hObject, handles); 1006 | 1007 | % 显示等待条 1008 | h = waitbar(0, '更新图像中 等待...'); 1009 | steps = 200; 1010 | for step = 1:steps 1011 | waitbar(step / steps) 1012 | end 1013 | close(h) 1014 | 1015 | % 更新函数 1016 | update(app, handles); 1017 | end 1018 | function denoised_img = total_variation_denoising(app, img) 1019 | % 设置总变差去噪参数 1020 | lambda = 0.1; % 正则化参数,控制去噪程度 1021 | num_iterations = 30; % 迭代次数 1022 | delta_t = 0.1; % 时间步长 1023 | 1024 | % 将输入图像转换为双精度数组 1025 | img = double(img); 1026 | 1027 | % 初始化 1028 | denoised_img = img; 1029 | 1030 | % 迭代优化 1031 | for i = 1:num_iterations 1032 | % 计算梯度 1033 | [gx, gy] = gradient(denoised_img); 1034 | 1035 | % 计算梯度的模长 1036 | grad_norm = sqrt(gx.^2 + gy.^2); 1037 | 1038 | % 计算梯度的方向 1039 | grad_dir = atan2(gy, gx); 1040 | 1041 | % 更新像素值 1042 | for x = 2:size(denoised_img, 1)-1 1043 | for y = 2:size(denoised_img, 2)-1 1044 | % 计算局部梯度的散度 1045 | div = (grad_norm(x, y) - grad_norm(x-1, y) + grad_norm(x, y) - grad_norm(x, y-1)); 1046 | % 更新像素值 1047 | denoised_img(x, y) = denoised_img(x, y) + delta_t * lambda * div; 1048 | end 1049 | end 1050 | end 1051 | end 1052 | function div = divergence(app, grad_dir, grad_norm) 1053 | % 计算梯度的散度 1054 | [gx, gy] = pol2cart(grad_dir, grad_norm); 1055 | div = divergence(gx, gy); 1056 | end 1057 | % Value changed function: EditField_lambdaChanged 1058 | function EditField_lambdaChanged(app, event) 1059 | app.global_lambda = app.EditField_lambda.Value; 1060 | end 1061 | % Value changed function: EditField_numIterationsChanged 1062 | function EditField_numIterationsChanged(app, event) 1063 | app.global_numIterations = app.EditField_numIterations.Value; 1064 | end 1065 | % Value changed function: EditField_deltaTChanged 1066 | function EditField_deltaTChanged(app, event) 1067 | app.global_deltaT = app.EditField_deltaT.Value; 1068 | end 1069 | 1070 | % Button pushed function: n1 高斯噪声 1071 | function n1_Callback(app, event) 1072 | % Create GUIDE-style callback args - Added by Migration Tool 1073 | [hObject, ~, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1074 | 1075 | % 显示等待条 1076 | h = waitbar(0, '等待...'); 1077 | steps = 200; 1078 | for step = 1:steps 1079 | waitbar(step / steps) 1080 | end 1081 | close(h) 1082 | 1083 | % 指定均值和方差 1084 | mean_value = app.globalGau_MEAN; % 均值 1085 | variance_value = app.globalGau_VAR; % 方差 1086 | 1087 | % 向图像添加高斯噪声 1088 | handles.img = imnoise(handles.img, 'gaussian', mean_value, variance_value); 1089 | 1090 | % 在orgimg中显示带噪声的图像 1091 | axes(handles.effimg); 1092 | cla; 1093 | imshow(handles.img); 1094 | 1095 | % 更新 handles 结构 1096 | guidata(hObject, handles); 1097 | 1098 | % 显示等待条 1099 | h = waitbar(0, '更新图像中 等待...'); 1100 | steps = 200; 1101 | for step = 1:steps 1102 | waitbar(step / steps) 1103 | end 1104 | close(h) 1105 | 1106 | % 更新函数 1107 | update(app,handles); 1108 | end 1109 | 1110 | % Button pushed function: n2 泊松噪声 1111 | function n2_Callback(app, event) 1112 | % Create GUIDE-style callback args - Added by Migration Tool 1113 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1114 | % 显示等待条 1115 | h = waitbar(0, '等待...'); 1116 | steps = 200; 1117 | for step = 1:steps 1118 | waitbar(step / steps) 1119 | end 1120 | close(h) 1121 | % 向图像添加泊松噪声 1122 | handles.img = imnoise(handles.img, 'poisson'); 1123 | % 在orgimg中显示带噪声的图像 1124 | axes(handles.effimg); 1125 | cla; 1126 | imshow(handles.img); 1127 | % 更新 handles 结构 1128 | guidata(hObject, handles); 1129 | % 显示等待条 1130 | h = waitbar(0, '更新图像中 等待...'); 1131 | steps = 200; 1132 | for step = 1:steps 1133 | waitbar(step / steps) 1134 | end 1135 | close(h) 1136 | % 更新函数 1137 | update(app,handles); 1138 | end 1139 | 1140 | % 按钮触发函数:n3_Callback 添加椒盐噪声 1141 | function n3_Callback(app, event) 1142 | % 显示等待条 1143 | h = waitbar(0, '等待...'); 1144 | steps = 200; 1145 | for step = 1:steps 1146 | waitbar(step / steps) 1147 | end 1148 | close(h); 1149 | % 创建 GUIDE 风格的回调函数参数(由迁移工具添加) 1150 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1151 | %读取噪声密度 1152 | density = app.globalDENSITY; 1153 | % 使用 convertToGUIDECallbackArguments 函数将 app 和 event 转换为 GUIDE 回调函数所需的参数,并将其存储在 hObject、eventdata 和 handles 变量中 1154 | handles.img = imnoise(handles.img,'salt & pepper',density); 1155 | % 对图像添加椒盐噪声,噪声密度为density 1156 | axes(handles.effimg); 1157 | % 将当前坐标轴更改为 handles.orgimg 所代表的坐标轴 1158 | cla; imshow(handles.img); 1159 | % 清空坐标轴并显示处理后的图像 1160 | % 更新 handles 结构 1161 | guidata(hObject, handles); 1162 | % 显示等待条 1163 | h = waitbar(0, '更新图像中 等待...'); 1164 | steps = 200; 1165 | for step = 1:steps 1166 | waitbar(step / steps) 1167 | end 1168 | close(h); 1169 | % 更新函数 1170 | update(app,handles); 1171 | end 1172 | 1173 | % Button pushed function: n4 斑点噪声 1174 | function n4_Callback(app, event) 1175 | % 创建 GUIDE 风格的回调参数 - 迁移工具添加 1176 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1177 | % 显示等待条 1178 | h = waitbar(0, '等待...'); 1179 | steps = 200; 1180 | for step = 1:steps 1181 | waitbar(step / steps) 1182 | end 1183 | close(h) 1184 | % 指定斑点噪声的方差 1185 | speckle_variance = app.global_SPEVAR; 1186 | % 对图像进行斑点噪声处理 1187 | handles.img = imnoise(handles.img, 'speckle', speckle_variance); 1188 | % 在 "effimg" axes 中显示处理后的图像 1189 | axes(handles.effimg); 1190 | cla; 1191 | imshow(handles.img); 1192 | % 更新 handles 结构 1193 | guidata(hObject, handles); 1194 | % 显示等待条 1195 | h = waitbar(0, '更新图像中 等待...'); 1196 | steps = 200; 1197 | for step = 1:steps 1198 | waitbar(step / steps) 1199 | end 1200 | close(h) 1201 | % 更新函数 1202 | update(app,handles); 1203 | end 1204 | % Value changed function: EditField_idealp_FreChanged 1205 | function EditField_SPEVARChanged(app, event) 1206 | app.global_SPEVAR = app.EditField_SPEVAR.Value; 1207 | end 1208 | 1209 | % Button pushed function: n5 运动噪声 1210 | function n5_Callback(app, event) 1211 | % 创建 GUIDE 风格的回调参数 - 迁移工具添加 1212 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1213 | % 显示等待条 1214 | h = waitbar(0, '等待...'); 1215 | steps = 200; 1216 | for step = 1:steps 1217 | waitbar(step / steps) 1218 | end 1219 | close(h) 1220 | set(handles.p1, 'Enable', 'on'); 1221 | 1222 | I = handles.img; % 原始图像 1223 | I = im2double(I); % 转换为双精度类型 1224 | LEN = app.globalVar_LEN; % 参数设置 线性运动的长度 1225 | THETA = app.globalVar_THETA; % 参数设置 线性运动的方向角度 1226 | PSF = fspecial('motion', LEN, THETA); % 产生点扩散函数PSF 1227 | J = imfilter(I, PSF, 'conv', 'circular'); % 进行运动模糊处理 1228 | noise = 0.03 * randn(size(I)); % 生成噪声 1229 | K = imadd(J, noise); % 将噪声添加到模糊图像中 1230 | K = im2uint8(K); % 转换为 uint8 类型 1231 | axes(handles.effimg); 1232 | cla; 1233 | imshow(K); 1234 | handles.img = K; 1235 | % 更新 handles 结构 1236 | guidata(hObject, handles); 1237 | 1238 | NP = abs(fft2(noise)).^2; % 计算噪声功率谱密度 1239 | NPower = sum(NP(:)) / prod(size(noise)); 1240 | NCORR = fftshift(real(ifft2(NP))); % 计算噪声功率谱密度的自相关 1241 | IP = abs(fft2(I).^2); % 计算图像功率谱密度 1242 | IPower = sum(IP(:)) / prod(size(I)); 1243 | ICORR = fftshift(real(ifft2(IP))); % 计算图像功率谱密度的自相关 1244 | app.globalVar_PSF = PSF; 1245 | app.globalVar_NCORR = NCORR; 1246 | app.globalVar_ICORR = ICORR; 1247 | app.globalVar_K = K; 1248 | 1249 | % 显示等待条 1250 | h = waitbar(0, '更新图像中 等待...'); 1251 | steps = 200; 1252 | for step = 1:steps 1253 | waitbar(step / steps) 1254 | end 1255 | % 更新函数 1256 | update(app,handles); 1257 | close(h) 1258 | end 1259 | % Value changed function: EditField_LEN 1260 | function EditField_LENChanged(app, event) 1261 | app.globalVar_LEN = app.EditField_LEN.Value; 1262 | end 1263 | % Value changed function: EditField_THETA 1264 | function EditField_THETAChanged(app, event) 1265 | app.globalVar_THETA = app.EditField_THETA.Value; 1266 | end 1267 | 1268 | % Button pushed function: p1 维纳滤波 1269 | function p1_Callback(app, event) 1270 | % Create GUIDE-style callback args - Added by Migration Tool 1271 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1272 | % 显示等待条 1273 | h = waitbar(0, '等待...'); 1274 | steps = 200; 1275 | for step = 1:steps 1276 | waitbar(step / steps) 1277 | end 1278 | close(h) 1279 | 1280 | PSF = app.globalVar_PSF; 1281 | NCORR = app.globalVar_NCORR; 1282 | ICORR = app.globalVar_ICORR; 1283 | K = app.globalVar_K; 1284 | L = deconvwnr(K, PSF, NCORR, ICORR); % 使用维纳滤波进行复原处理 1285 | 1286 | handles.img = L; 1287 | % 更新 handles 结构 1288 | guidata(hObject, handles); 1289 | axes(handles.effimg); 1290 | cla; 1291 | imshow(L); 1292 | % 显示等待条 1293 | h = waitbar(0, '更新图像中 等待...'); 1294 | steps = 200; 1295 | for step = 1:steps 1296 | waitbar(step / steps) 1297 | end 1298 | % 更新函数 1299 | update(app,handles); 1300 | close(h) 1301 | end 1302 | 1303 | %理想低通滤波器 1304 | function p21_Callback(app, event) 1305 | % Create GUIDE-style callback args - Added by Migration Tool 1306 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1307 | % 显示等待条 1308 | h = waitbar(0, '等待...'); 1309 | steps = 200; 1310 | for step = 1:steps 1311 | waitbar(step / steps) 1312 | end 1313 | close(h) 1314 | % 理想低通滤波器 1315 | mysize = size(handles.img); % 获取图像大小 1316 | if numel(mysize) > 2 % 如果图像为彩色图像 1317 | handles.img = rgb2gray(handles.img); % 转换为灰度图像 1318 | end 1319 | 1320 | I = handles.img; % 原始图像 1321 | I = im2double(I); % 转换为双精度类型 1322 | M = 2 * size(I, 1); % 滤波器行数 1323 | N = 2 * size(I, 2); % 滤波器列数 1324 | u = -M/2:(M/2-1); 1325 | v = -N/2:(N/2-1); 1326 | [U, V] = meshgrid(u, v); 1327 | D = sqrt(U.^2 + V.^2); 1328 | D0 = app.global_idealp_Fre; %低通截止频率 1329 | H = double(D <= D0); % 计算理想低通滤波器的传递函数 1330 | J = fftshift(fft2(I, size(H, 1), size(H, 2))); % 对输入图像进行傅里叶变换,并将零频率移动到频谱中心 1331 | K = J .* H; % 进行频域滤波 1332 | L = ifft2(ifftshift(K)); % 对滤波后的频谱进行傅里叶反变换 1333 | L = L(1:size(I, 1), 1:size(I, 2)); % 提取出与原始图像大小相同的部分作为输出结果 1334 | handles.img = L; 1335 | 1336 | axes(handles.effimg); 1337 | cla; 1338 | imshow(handles.img); 1339 | % 更新 handles 结构 1340 | guidata(hObject, handles); 1341 | % 显示等待条 1342 | h = waitbar(0, '更新图像中 等待...'); 1343 | steps = 200; 1344 | for step = 1:steps 1345 | waitbar(step / steps) 1346 | end 1347 | close(h) 1348 | % 更新函数 1349 | update(app,handles); 1350 | end 1351 | % Value changed function: EditField_idealp_FreChanged 1352 | function EditField_idealp_FreChanged(app, event) 1353 | app.global_idealp_Fre = app.EditField_idealp_Fre.Value; 1354 | end 1355 | %理想高通滤波器 1356 | function p22_Callback(app, event) 1357 | % Create GUIDE-style callback args - Added by Migration Tool 1358 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1359 | % 显示等待条 1360 | h = waitbar(0, '等待...'); 1361 | steps = 200; 1362 | for step = 1:steps 1363 | waitbar(step / steps) 1364 | end 1365 | close(h) 1366 | % 理想高通滤波器 1367 | mysize = size(handles.img); % 获取图像大小 1368 | if numel(mysize) > 2 % 如果图像为彩色图像 1369 | handles.img = rgb2gray(handles.img); % 转换为灰度图像 1370 | end 1371 | 1372 | I = handles.img; % 原始图像 1373 | I = im2double(I); % 转换为双精度类型 1374 | M = 2 * size(I, 1); % 滤波器行数 1375 | N = 2 * size(I, 2); % 滤波器列数 1376 | u = -M/2:(M/2-1); 1377 | v = -N/2:(N/2-1); 1378 | [U, V] = meshgrid(u, v); 1379 | D = sqrt(U.^2 + V.^2); 1380 | D0 = app.global_ideahp_Fre; 1381 | H_lowpass = double(D <= D0); % 计算理想低通滤波器的传递函数 1382 | H_highpass = 1 - H_lowpass; % 计算理想高通滤波器的传递函数 1383 | J = fftshift(fft2(I, size(H_highpass, 1), size(H_highpass, 2))); % 对输入图像进行傅里叶变换,并将零频率移动到频谱中心 1384 | K = J .* H_highpass; % 进行频域滤波 1385 | L = ifft2(ifftshift(K)); % 对滤波后的频谱进行傅里叶反变换 1386 | L = L(1:size(I, 1), 1:size(I, 2)); % 提取出与原始图像大小相同的部分作为输出结果 1387 | handles.img = L; 1388 | 1389 | axes(handles.effimg); 1390 | cla; 1391 | imshow(handles.img); 1392 | % 更新 handles 结构 1393 | guidata(hObject, handles); 1394 | % 显示等待条 1395 | h = waitbar(0, '更新图像中 等待...'); 1396 | steps = 200; 1397 | for step = 1:steps 1398 | waitbar(step / steps) 1399 | end 1400 | close(h) 1401 | % 更新函数 1402 | update(app,handles); 1403 | end 1404 | % Value changed function: EditField_ideahp_FreChanged 1405 | function EditField_ideahp_FreChanged(app, event) 1406 | app.global_ideahp_Fre = app.EditField_ideahp_Fre.Value; 1407 | end 1408 | %理想带通滤波器 1409 | function p23_Callback(app, event) 1410 | % Create GUIDE-style callback args - Added by Migration Tool 1411 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1412 | % 显示等待条 1413 | h = waitbar(0, '等待...'); 1414 | steps = 200; 1415 | for step = 1:steps 1416 | waitbar(step / steps) 1417 | end 1418 | close(h) 1419 | % 理想带通滤波器 1420 | mysize = size(handles.img); % 获取图像大小 1421 | if numel(mysize) > 2 % 如果图像为彩色图像 1422 | handles.img = rgb2gray(handles.img); % 转换为灰度图像 1423 | end 1424 | 1425 | I = handles.img; % 原始图像 1426 | I = im2double(I); % 转换为双精度类型 1427 | M = 2 * size(I, 1); % 滤波器行数 1428 | N = 2 * size(I, 2); % 滤波器列数 1429 | u = -M/2:(M/2-1); 1430 | v = -N/2:(N/2-1); 1431 | [U, V] = meshgrid(u, v); 1432 | D = sqrt(U.^2 + V.^2); 1433 | D0_low = 20; 1434 | D0_high = 80; 1435 | % 计算理想带通滤波器的传递函数 1436 | H = double((D >= D0_low) & (D <= D0_high)); 1437 | J = fftshift(fft2(I, size(H, 1), size(H, 2))); % 对输入图像进行傅里叶变换,并将零频率移动到频谱中心 1438 | K = J .* H; % 进行频域滤波 1439 | L = ifft2(ifftshift(K)); % 对滤波后的频谱进行傅里叶反变换 1440 | L = L(1:size(I, 1), 1:size(I, 2)); % 提取出与原始图像大小相同的部分作为输出结果 1441 | handles.img = L; 1442 | 1443 | axes(handles.effimg); 1444 | cla; 1445 | imshow(handles.img); 1446 | % 更新 handles 结构 1447 | guidata(hObject, handles); 1448 | % 显示等待条 1449 | h = waitbar(0, '更新图像中 等待...'); 1450 | steps = 200; 1451 | for step = 1:steps 1452 | waitbar(step / steps) 1453 | end 1454 | close(h) 1455 | % 更新函数 1456 | update(app,handles); 1457 | end 1458 | % Value changed function: EditField_ideabp_lFreChanged 1459 | function EditField_ideabp_lFreChanged(app, event) 1460 | app.global_ideabp_lFre = app.EditField_ideabp_lFre.Value; 1461 | end 1462 | % Value changed function: EditField_ideabp_hFreChanged 1463 | function EditField_ideabp_hFreChanged(app, event) 1464 | app.global_ideabp_hFre = app.EditField_ideabp_hFre.Value; 1465 | end 1466 | %理想带阻滤波器 1467 | function p24_Callback(app, event) 1468 | % Create GUIDE-style callback args - Added by Migration Tool 1469 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1470 | % 显示等待条 1471 | h = waitbar(0, '等待...'); 1472 | steps = 200; 1473 | for step = 1:steps 1474 | waitbar(step / steps) 1475 | end 1476 | close(h) 1477 | % 带阻滤波器 1478 | mysize = size(handles.img); % 获取图像大小 1479 | if numel(mysize) > 2 % 如果图像为彩色图像 1480 | handles.img = rgb2gray(handles.img); % 转换为灰度图像 1481 | end 1482 | 1483 | I = handles.img; % 原始图像 1484 | I = im2double(I); % 转换为双精度类型 1485 | M = 2 * size(I, 1); % 滤波器行数 1486 | N = 2 * size(I, 2); % 滤波器列数 1487 | u = -M/2:(M/2-1); 1488 | v = -N/2:(N/2-1); 1489 | [U, V] = meshgrid(u, v); 1490 | D = sqrt(U.^2 + V.^2); 1491 | D0 = app.global_ideabs_Fre; % 滤波器D0 1492 | W = app.global_ideabs_w; % 滤波器带宽 1493 | H = double(or(D < (D0 - W / 2), D > D0 + W / 2)); % 计算带阻滤波器的传递函数 1494 | J = fftshift(fft2(I, size(H, 1), size(H, 2))); % 对输入图像进行傅里叶变换,并将零频率移动到频谱中心 1495 | K = J .* H; % 进行频域滤波 1496 | L = ifft2(ifftshift(K)); % 对滤波后的频谱进行傅里叶反变换 1497 | L = L(1:size(I, 1), 1:size(I, 2)); % 提取出与原始图像大小相同的部分作为输出结果 1498 | handles.img = L; 1499 | 1500 | axes(handles.effimg); 1501 | cla; 1502 | imshow(handles.img); 1503 | % 更新 handles 结构 1504 | guidata(hObject, handles); 1505 | % 显示等待条 1506 | h = waitbar(0, '更新图像中 等待...'); 1507 | steps = 200; 1508 | for step = 1:steps 1509 | waitbar(step / steps) 1510 | end 1511 | close(h) 1512 | % 更新函数 1513 | update(app,handles); 1514 | end 1515 | % Value changed function: EditField_ideabs_FreChanged 1516 | function EditField_ideabs_FreChanged(app, event) 1517 | app.global_ideabs_Fre = app.EditField_ideabs_Fre.Value; 1518 | end 1519 | % Value changed function: EditField_ideabs_wChanged 1520 | function EditField_ideabs_wChanged(app, event) 1521 | app.global_ideabs_w = app.EditField_ideabs_w.Value; 1522 | end 1523 | 1524 | % Value changed function: EditField_butterOrderChanged 1525 | function EditField_butterOrderChanged(app, event) 1526 | app.global_butterOrder = app.EditField_butterOrder.Value; 1527 | end 1528 | %巴特沃斯低通滤波器 1529 | function p31_Callback(app, event) 1530 | % Create GUIDE-style callback args - Added by Migration Tool 1531 | [hObject, ~, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1532 | % 显示等待条 1533 | h = waitbar(0, '等待...'); 1534 | steps = 200; 1535 | for step = 1:steps 1536 | waitbar(step / steps) 1537 | end 1538 | close(h) 1539 | % 巴特沃斯低通滤波器 1540 | mysize = size(handles.img); % 获取图像大小 1541 | if numel(mysize) > 2 % 如果图像为彩色图像 1542 | handles.img = rgb2gray(handles.img); % 转换为灰度图像 1543 | end 1544 | 1545 | I = handles.img; % 原始图像 1546 | I = im2double(I); % 转换为双精度类型 1547 | M = 2 * size(I, 1); % 滤波器行数 1548 | N = 2 * size(I, 2); % 滤波器列数 1549 | u = -M/2:(M/2-1); 1550 | v = -N/2:(N/2-1); 1551 | [U, V] = meshgrid(u, v); 1552 | D = sqrt(U.^2 + V.^2); 1553 | D0 = 60; % 截止频率 1554 | n = app.global_butterOrder; % 巴特沃斯滤波器阶数 1555 | H = 1 ./ (1 + (D ./ D0).^(2*n)); % 计算巴特沃斯低通滤波器的传递函数 1556 | J = fftshift(fft2(I, size(H, 1), size(H, 2))); % 对输入图像进行傅里叶变换,并将零频率移动到频谱中心 1557 | K = J .* H; % 进行频域滤波 1558 | L = ifft2(ifftshift(K)); % 对滤波后的频谱进行傅里叶反变换 1559 | L = L(1:size(I, 1), 1:size(I, 2)); % 提取出与原始图像大小相同的部分作为输出结果 1560 | handles.img = L; 1561 | 1562 | axes(handles.effimg); 1563 | cla; 1564 | imshow(handles.img,[]); 1565 | % 更新 handles 结构 1566 | guidata(hObject, handles); 1567 | % 显示等待条 1568 | h = waitbar(0, '更新图像中 等待...'); 1569 | steps = 200; 1570 | for step = 1:steps 1571 | waitbar(step / steps) 1572 | end 1573 | close(h) 1574 | % 更新函数 1575 | update(app,handles); 1576 | end 1577 | % Value changed function: EditField_idealp_FreChanged 1578 | function EditField_butterlp_FreChanged(app, event) 1579 | app.global_butterlp_Fre = app.EditField_butterlp_Fre.Value; 1580 | end 1581 | %巴特沃斯高通滤波器 1582 | function p32_Callback(app, event) 1583 | % Create GUIDE-style callback args - Added by Migration Tool 1584 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1585 | % 显示等待条 1586 | h = waitbar(0, '等待...'); 1587 | steps = 200; 1588 | for step = 1:steps 1589 | waitbar(step / steps) 1590 | end 1591 | close(h) 1592 | % 巴特沃斯高通滤波器 1593 | mysize = size(handles.img); % 获取图像大小 1594 | if numel(mysize) > 2 % 如果图像为彩色图像 1595 | handles.img = rgb2gray(handles.img); % 转换为灰度图像 1596 | end 1597 | 1598 | I = handles.img; % 原始图像 1599 | I = im2double(I); % 转换为双精度类型 1600 | M = 2 * size(I, 1); % 滤波器行数 1601 | N = 2 * size(I, 2); % 滤波器列数 1602 | u = -M/2:(M/2-1); 1603 | v = -N/2:(N/2-1); 1604 | [U, V] = meshgrid(u, v); 1605 | D = sqrt(U.^2 + V.^2); 1606 | D0 = app.global_butterhp_Fre; % 截止频率 1607 | n = app.global_butterOrder; % 巴特沃斯滤波器阶数 1608 | H = 1 ./ (1 + (D0 ./ D).^(2*n)); % 计算巴特沃斯高通滤波器的传递函数 1609 | J = fftshift(fft2(I, size(H, 1), size(H, 2))); % 对输入图像进行傅里叶变换,并将零频率移动到频谱中心 1610 | K = J .* H; % 进行频域滤波 1611 | L = ifft2(ifftshift(K)); % 对滤波后的频谱进行傅里叶反变换 1612 | L = L(1:size(I, 1), 1:size(I, 2)); % 提取出与原始图像大小相同的部分作为输出结果 1613 | handles.img = L; 1614 | 1615 | axes(handles.effimg); 1616 | cla; 1617 | imshow(handles.img,[]); 1618 | % 更新 handles 结构 1619 | guidata(hObject, handles); 1620 | % 显示等待条 1621 | h = waitbar(0, '更新图像中 等待...'); 1622 | steps = 200; 1623 | for step = 1:steps 1624 | waitbar(step / steps) 1625 | end 1626 | close(h) 1627 | % 更新函数 1628 | update(app,handles); 1629 | end 1630 | % Value changed function: EditField_idealp_FreChanged 1631 | function EditField_butterhp_FreChanged(app, event) 1632 | app.global_butterhp_Fre = app.EditField_butterhp_Fre.Value; 1633 | end 1634 | %巴特沃斯带通滤波器 1635 | function p33_Callback(app, event) 1636 | % Create GUIDE-style callback args - Added by Migration Tool 1637 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1638 | 1639 | % 显示等待条 1640 | h = waitbar(0, '等待...'); 1641 | steps = 200; 1642 | for step = 1:steps 1643 | waitbar(step / steps) 1644 | end 1645 | close(h) 1646 | 1647 | % 巴特沃斯带通滤波器 1648 | mysize = size(handles.img); % 获取图像大小 1649 | if numel(mysize) > 2 % 如果图像为彩色图像 1650 | handles.img = rgb2gray(handles.img); % 转换为灰度图像 1651 | end 1652 | 1653 | I = mat2gray(handles.img,[0 255]);; % 原始图像 1654 | M = 2 * size(I, 1); % 滤波器行数 1655 | N = 2 * size(I, 2); % 滤波器列数 1656 | u = -M/2:(M/2-1); 1657 | v = -N/2:(N/2-1); 1658 | [U, V] = meshgrid(u, v); 1659 | D = sqrt(U.^2 + V.^2); 1660 | D0_low = app.global_butterbp_lFre; % 低频截止频率 1661 | D0_high = app.global_butterbp_hFre; % 高频截止频率 1662 | n = app.global_butterOrder; % 巴特沃斯滤波器阶数 1663 | H_low = 1 ./ (1 + (D ./ D0_low).^(2*n)); % 低通滤波器传递函数 1664 | H_high = 1 ./ (1 + (D0_high ./ D).^(2*n)); % 高通滤波器传递函数 1665 | H_bandpass = H_high .* H_low; % 带通滤波器传递函数 1666 | J = fftshift(fft2(I, size(H_bandpass, 1), size(H_bandpass, 2))); % 对输入图像进行傅里叶变换,并将零频率移动到频谱中心 1667 | K = J .* H_bandpass; % 进行频域滤波 1668 | L = ifft2(ifftshift(K)); % 对滤波后的频谱进行傅里叶反变换 1669 | L = L(1:size(I, 1), 1:size(I, 2)); % 提取出与原始图像大小相同的部分作为输出结果 1670 | handles.img = L; 1671 | 1672 | axes(handles.effimg); 1673 | cla; 1674 | imshow(handles.img,[]); 1675 | 1676 | % 更新 handles 结构 1677 | guidata(hObject, handles); 1678 | 1679 | % 显示等待条 1680 | h = waitbar(0, '更新图像中 等待...'); 1681 | steps = 200; 1682 | for step = 1:steps 1683 | waitbar(step / steps) 1684 | end 1685 | close(h) 1686 | 1687 | % 更新函数 1688 | update(app,handles); 1689 | end 1690 | % Value changed function: EditField_idealp_FreChanged 1691 | function EditField_butterbp_lFreChanged(app, event) 1692 | app.global_butterbp_lFre = app.EditField_butterbp_lFre.Value; 1693 | end 1694 | % Value changed function: EditField_idealp_FreChanged 1695 | function EditField_butterbp_hFreChanged(app, event) 1696 | app.global_butterbp_hFre = app.EditField_butterbp_hFre.Value; 1697 | end 1698 | % 巴特沃斯带阻滤波器 1699 | function p34_Callback(app, event) 1700 | % Create GUIDE-style callback args - Added by Migration Tool 1701 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 1702 | 1703 | % 显示等待条 1704 | h = waitbar(0, '等待...'); 1705 | steps = 200; 1706 | for step = 1:steps 1707 | waitbar(step / steps) 1708 | end 1709 | close(h) 1710 | 1711 | % 巴特沃斯带阻滤波器 1712 | mysize = size(handles.img); % 获取图像大小 1713 | if numel(mysize) > 2 % 如果图像为彩色图像 1714 | handles.img = rgb2gray(handles.img); % 转换为灰度图像 1715 | end 1716 | 1717 | I = mat2gray(handles.img,[0 255]); % 原始图像 1718 | M = 2 * size(I, 1); % 滤波器行数 1719 | N = 2 * size(I, 2); % 滤波器列数 1720 | u = -M/2:(M/2-1); 1721 | v = -N/2:(N/2-1); 1722 | [U, V] = meshgrid(u, v); 1723 | D = sqrt(U.^2 + V.^2); 1724 | D_width = app.global_butterbs_w; 1725 | D_fre = app.global_butterbs_Fre; 1726 | D0_low = D_fre - D_width/2; % 低频截止频率 1727 | D0_high = D_fre + D_width/2; % 高频截止频率 1728 | n = app.global_butterOrder; % 巴特沃斯滤波器阶数 1729 | H_low = 1 ./ (1 + (D0_low ./ D).^(2*n)); % 低通滤波器传递函数 1730 | H_high = 1 ./ (1 + (D ./ D0_high).^(2*n)); % 高通滤波器传递函数 1731 | H_bandstop = H_high .* H_low; % 带阻滤波器传递函数 1732 | J = fftshift(fft2(I, size(H_bandstop, 1), size(H_bandstop, 2))); % 对输入图像进行傅里叶变换,并将零频率移动到频谱中心 1733 | K = J .* H_bandstop; % 进行频域滤波 1734 | L = ifft2(ifftshift(K)); % 对滤波后的频谱进行傅里叶反变换 1735 | L = L(1:size(I, 1), 1:size(I, 2)); % 提取出与原始图像大小相同的部分作为输出结果 1736 | handles.img = L; 1737 | 1738 | axes(handles.effimg); 1739 | cla; 1740 | imshow(handles.img,[]); 1741 | 1742 | % 更新 handles 结构 1743 | guidata(hObject, handles); 1744 | 1745 | % 显示等待条 1746 | h = waitbar(0, '更新图像中 等待...'); 1747 | steps = 200; 1748 | for step = 1:steps 1749 | waitbar(step / steps) 1750 | end 1751 | close(h) 1752 | 1753 | % 更新函数 1754 | update(app,handles); 1755 | end 1756 | % Value changed function: EditField_idealp_FreChanged 1757 | function EditField_butterbs_FreChanged(app, event) 1758 | app.global_butterbs_Fre = app.EditField_butterbs_Fre.Value; 1759 | end 1760 | % Value changed function: EditField_idealp_FreChanged 1761 | function EditField_butterbs_wChanged(app, event) 1762 | app.global_butterbs_w = app.EditField_butterbs_w.Value; 1763 | end 1764 | 1765 | % f21 高斯低通滤波 1766 | function f21_Callback(app, event) 1767 | % 创建 GUIDE 风格的回调函数参数(由迁移工具添加) 1768 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); 1769 | % 显示等待条 1770 | h = waitbar(0, '等待...'); 1771 | steps = 200; 1772 | for step = 1:steps 1773 | waitbar(step / steps) 1774 | end 1775 | close(h) 1776 | % 使用 convertToGUIDECallbackArguments 函数将 app 和 event 转换为 GUIDE 回调函数所需的参数,并将其存储在 hObject、eventdata 和 handles 变量中 1777 | D0 = app.global_gausslp_Fre; % 截止频率设置在半径值为50处 1778 | original_img = mat2gray(handles.img,[0 255]); 1779 | filtered_img = GaussianLowpass(app, original_img, D0); 1780 | handles.img = filtered_img; 1781 | % 显示图像 1782 | axes(handles.effimg); cla; imshow(handles.img,[]); 1783 | % 将当前坐标轴更改为 handles.effimg 所代表的坐标轴,清空坐标轴并显示处理后的图像 1784 | % 更新 handles 结构 1785 | guidata(hObject, handles); 1786 | % 显示等待条 1787 | h = waitbar(0, '更新图像中 等待...'); 1788 | steps = 200; 1789 | for step = 1:steps 1790 | waitbar(step / steps) 1791 | end 1792 | close(h) 1793 | % 更新函数 1794 | update(app, handles); 1795 | end 1796 | function img_filtered = GaussianLowpass(app, img, D0) 1797 | [M, N] = size(img); 1798 | P = 2 * M; 1799 | Q = 2 * N; 1800 | fc = zeros(M, N); 1801 | 1802 | for x = 1:M 1803 | for y = 1:N 1804 | fc(x, y) = img(x, y) * (-1)^(x+y); 1805 | end 1806 | end 1807 | 1808 | F = fft2(fc, P, Q); 1809 | H = zeros(P, Q); 1810 | 1811 | for x = (-P/2):P/2-1 1812 | for y = (-Q/2):Q/2-1 1813 | D = sqrt(x^2 + y^2); 1814 | H(x+(P/2)+1, y+(Q/2)+1) = exp(-(D^2)/(2*D0^2)); 1815 | end 1816 | end 1817 | 1818 | G = H .* F; 1819 | 1820 | g = real(ifft2(G)); 1821 | g = g(1:1:M, 1:1:N); 1822 | 1823 | img_filtered = zeros(M, N); 1824 | 1825 | for x = 1:1:M 1826 | for y = 1:1:N 1827 | img_filtered(x, y) = g(x, y) * (-1)^(x+y); 1828 | end 1829 | end 1830 | 1831 | end 1832 | % Value changed function: EditField_idealp_FreChanged 1833 | function EditField_gausslp_FreChanged(app, event) 1834 | app.global_gausslp_Fre = app.EditField_gausslp_Fre.Value; 1835 | end 1836 | % f22 高斯高通滤波 1837 | function f22_Callback(app, event) 1838 | % 创建 GUIDE 风格的回调函数参数(由迁移工具添加) 1839 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); 1840 | % 显示等待条 1841 | h = waitbar(0, '等待...'); 1842 | steps = 200; 1843 | for step = 1:steps 1844 | waitbar(step / steps) 1845 | end 1846 | close(h) 1847 | % 使用 convertToGUIDECallbackArguments 函数将 app 和 event 转换为 GUIDE 回调函数所需的参数,并将其存储在 hObject、eventdata 和 handles 变量中 1848 | D0 = app.global_gausshp_Fre; % 截止频率设置在半径值为50处 1849 | original_img = mat2gray(handles.img,[0 255]); 1850 | filtered_img = GaussianHighpass(app, original_img, D0); 1851 | handles.img = filtered_img; 1852 | % 显示图像 1853 | axes(handles.effimg); cla; imshow(handles.img,[]); 1854 | % 将当前坐标轴更改为 handles.effimg 所代表的坐标轴,清空坐标轴并显示处理后的图像 1855 | % 更新 handles 结构 1856 | guidata(hObject, handles); 1857 | % 显示等待条 1858 | h = waitbar(0, '更新图像中 等待...'); 1859 | steps = 200; 1860 | for step = 1:steps 1861 | waitbar(step / steps) 1862 | end 1863 | close(h) 1864 | % 更新函数 1865 | update(app, handles); 1866 | end 1867 | function img_filtered = GaussianHighpass(app, img, D0) 1868 | [M, N] = size(img); 1869 | P = 2 * M; 1870 | Q = 2 * N; 1871 | fc = zeros(M, N); 1872 | 1873 | for x = 1:M 1874 | for y = 1:N 1875 | fc(x, y) = img(x, y) * (-1)^(x+y); 1876 | end 1877 | end 1878 | 1879 | F = fft2(fc, P, Q); 1880 | H = zeros(P, Q); 1881 | 1882 | for x = (-P/2):P/2-1 1883 | for y = (-Q/2):Q/2-1 1884 | D = sqrt(x^2 + y^2); 1885 | H(x+(P/2)+1, y+(Q/2)+1) = 1 - exp(-(D^2)/(2*D0^2)); % 使用 1 减去低通滤波器的传递函数来获取高通滤波器 1886 | end 1887 | end 1888 | 1889 | G = H .* F; 1890 | 1891 | g = real(ifft2(G)); 1892 | g = g(1:1:M, 1:1:N); 1893 | 1894 | img_filtered = zeros(M, N); 1895 | 1896 | for x = 1:1:M 1897 | for y = 1:1:N 1898 | img_filtered(x, y) = g(x, y) * (-1)^(x+y); 1899 | end 1900 | end 1901 | 1902 | end 1903 | % Value changed function: EditField_idealp_FreChanged 1904 | function EditField_gausshp_FreChanged(app, event) 1905 | app.global_gausshp_Fre = app.EditField_gausshp_Fre.Value; 1906 | end 1907 | % f23 高斯带通滤波 1908 | function f23_Callback(app, event) 1909 | % 创建 GUIDE 风格的回调函数参数(由迁移工具添加) 1910 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); 1911 | % 显示等待条 1912 | h = waitbar(0, '等待...'); 1913 | steps = 200; 1914 | for step = 1:steps 1915 | waitbar(step / steps) 1916 | end 1917 | close(h) 1918 | % 使用 convertToGUIDECallbackArguments 函数将 app 和 event 转换为 GUIDE 回调函数所需的参数,并将其存储在 hObject、eventdata 和 handles 变量中 1919 | D0_low = app.global_gaussbp_lFre; % 低频截止频率 1920 | D0_high = app.global_gaussbp_hFre; % 高频截止频率 1921 | original_img = mat2gray(handles.img,[0 255]); 1922 | filtered_img = GaussianBandpass(app, original_img, D0_low, D0_high); 1923 | handles.img = filtered_img; 1924 | % 显示图像 1925 | axes(handles.effimg); cla; imshow(handles.img,[]); 1926 | % 将当前坐标轴更改为 handles.effimg 所代表的坐标轴,清空坐标轴并显示处理后的图像 1927 | % 更新 handles 结构 1928 | guidata(hObject, handles); 1929 | % 显示等待条 1930 | h = waitbar(0, '更新图像中 等待...'); 1931 | steps = 200; 1932 | for step = 1:steps 1933 | waitbar(step / steps) 1934 | end 1935 | close(h) 1936 | % 更新函数 1937 | update(app, handles); 1938 | end 1939 | function img_filtered = GaussianBandpass(app, img, D0_low, D0_high) 1940 | [M, N] = size(img); 1941 | P = 2 * M; 1942 | Q = 2 * N; 1943 | fc = zeros(M, N); 1944 | 1945 | for x = 1:M 1946 | for y = 1:N 1947 | fc(x, y) = img(x, y) * (-1)^(x+y); 1948 | end 1949 | end 1950 | 1951 | F = fft2(fc, P, Q); 1952 | H = zeros(P, Q); 1953 | 1954 | for x = (-P/2):P/2-1 1955 | for y = (-Q/2):Q/2-1 1956 | D = sqrt(x^2 + y^2); 1957 | H(x+(P/2)+1, y+(Q/2)+1) = (1 - exp(-(D^2)/(2*D0_low^2))) .* (exp(-(D^2)/(2*D0_high^2))); % 使用高斯函数得到带通滤波器的传递函数 1958 | end 1959 | end 1960 | 1961 | G = H .* F; 1962 | 1963 | g = real(ifft2(G)); 1964 | g = g(1:1:M, 1:1:N); 1965 | 1966 | img_filtered = zeros(M, N); 1967 | 1968 | for x = 1:1:M 1969 | for y = 1:1:N 1970 | img_filtered(x, y) = g(x, y) * (-1)^(x+y); 1971 | end 1972 | end 1973 | 1974 | end 1975 | % Value changed function: EditField_idealp_FreChanged 1976 | function EditField_gaussbp_lFreChanged(app, event) 1977 | app.global_gaussbp_lFre = app.EditField_gaussbp_lFre.Value; 1978 | end 1979 | % Value changed function: EditField_idealp_FreChanged 1980 | function EditField_gaussbp_hFreChanged(app, event) 1981 | app.global_gaussbp_hFre = app.EditField_gaussbp_hFre.Value; 1982 | end 1983 | % f23 高斯带阻滤波 1984 | function f24_Callback(app, event) 1985 | % 创建 GUIDE 风格的回调函数参数(由迁移工具添加) 1986 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); 1987 | % 显示等待条 1988 | h = waitbar(0, '等待...'); 1989 | steps = 200; 1990 | for step = 1:steps 1991 | waitbar(step / steps) 1992 | end 1993 | close(h) 1994 | % 使用 convertToGUIDECallbackArguments 函数将 app 和 event 转换为 GUIDE 回调函数所需的参数,并将其存储在 hObject、eventdata 和 handles 变量中 1995 | D_width = app.global_gaussbs_w; 1996 | D_fre = app.global_gaussbs_Fre; 1997 | D0_low = D_fre - D_width/2; % 低频截止频率 1998 | D0_high = D_fre + D_width/2; % 高频截止频率 1999 | original_img = mat2gray(handles.img,[0 255]); 2000 | filtered_img = GaussianBandstop(app, original_img, D0_low, D0_high); 2001 | handles.img = filtered_img; 2002 | % 显示图像 2003 | axes(handles.effimg); cla; imshow(handles.img,[]); 2004 | % 将当前坐标轴更改为 handles.effimg 所代表的坐标轴,清空坐标轴并显示处理后的图像 2005 | % 更新 handles 结构 2006 | guidata(hObject, handles); 2007 | % 显示等待条 2008 | h = waitbar(0, '更新图像中 等待...'); 2009 | steps = 200; 2010 | for step = 1:steps 2011 | waitbar(step / steps) 2012 | end 2013 | close(h) 2014 | % 更新函数 2015 | update(app, handles); 2016 | end 2017 | function img_filtered = GaussianBandstop(app, img, D0_low, D0_high) 2018 | [M, N] = size(img); 2019 | P = 2 * M; 2020 | Q = 2 * N; 2021 | fc = zeros(M, N); 2022 | 2023 | for x = 1:M 2024 | for y = 1:N 2025 | fc(x, y) = img(x, y) * (-1)^(x+y); 2026 | end 2027 | end 2028 | 2029 | F = fft2(fc, P, Q); 2030 | H = zeros(P, Q); 2031 | 2032 | for x = (-P/2):P/2-1 2033 | for y = (-Q/2):Q/2-1 2034 | D = sqrt(x^2 + y^2); 2035 | H(x+(P/2)+1, y+(Q/2)+1) = 1 - exp(-(D^2)/(2*D0_high^2)) .* (1 - exp(-(D^2)/(2*D0_low^2))); % 使用高斯函数得到带阻滤波器的传递函数 2036 | end 2037 | end 2038 | 2039 | G = H .* F; 2040 | 2041 | g = real(ifft2(G)); 2042 | g = g(1:1:M, 1:1:N); 2043 | 2044 | img_filtered = zeros(M, N); 2045 | 2046 | for x = 1:1:M 2047 | for y = 1:1:N 2048 | img_filtered(x, y) = g(x, y) * (-1)^(x+y); 2049 | end 2050 | end 2051 | 2052 | end 2053 | % Value changed function: EditField_idealp_FreChanged 2054 | function EditField_gaussbs_FreChanged(app, event) 2055 | app.global_gaussbs_Fre = app.EditField_gaussbs_Fre.Value; 2056 | end 2057 | % Value changed function: EditField_idealp_FreChanged 2058 | function EditField_gaussbs_wChanged(app, event) 2059 | app.global_gaussbs_w = app.EditField_gaussbs_w.Value; 2060 | end 2061 | 2062 | %小波去噪 2063 | function p4_Callback(app, event) 2064 | % 创建 GUIDE 风格的回调参数 - 迁移工具添加 2065 | [hObject, ~, handles] = convertToGUIDECallbackArguments(app, event); %#ok 2066 | 2067 | % 获取处理后的图像 2068 | if numel(size(handles.img)) > 2 2069 | grayimg = rgb2gray(handles.img); 2070 | else 2071 | grayimg = handles.img; 2072 | end 2073 | 2074 | % 小波变换 2075 | [LLY, ~, ~, ~] = dwt2(grayimg, 'haar'); 2076 | 2077 | % 小波去噪处理 2078 | % 这里可以根据具体情况选择不同的去噪方法,比如基于阈值的去噪方法 2079 | threshold = app.global_wtThreshold; % 设定阈值 2080 | 2081 | % 改进的小波去噪方法:基于软阈值的小波去噪 2082 | % 调整阈值值 2083 | threshold = threshold * std(LLY(:)); % 根据小波系数的标准差动态调整阈值 2084 | 2085 | LLY_denoised = wthresh(LLY, 's', threshold); 2086 | 2087 | % 逆小波变换恢复图像 2088 | denoised_img = idwt2(LLY_denoised, [], [], [], 'haar'); 2089 | 2090 | handles.img = denoised_img; 2091 | % 显示去噪后的图像 2092 | axes(handles.effimg); 2093 | cla; 2094 | imshow(handles.img, []); 2095 | 2096 | % 显示等待条 2097 | h = waitbar(0, '更新图像中 等待...'); 2098 | steps = 100; 2099 | for step = 1:steps 2100 | waitbar(step / steps) 2101 | end 2102 | close(h) 2103 | % 更新函数 2104 | update(app, handles); 2105 | end 2106 | % Value changed function: EditField_THETA 2107 | function EditField_wtThresholdChanged(app, event) 2108 | app.global_wtThreshold = app.EditField_wtThreshold.Value; 2109 | end 2110 | 2111 | % Button pushed function: p5 同态滤波器 2112 | function p5_Callback(app, event) 2113 | % Create GUIDE-style callback args - Added by Migration Tool 2114 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 2115 | % 显示等待条 2116 | h = waitbar(0, '等待...'); 2117 | steps = 200; 2118 | for step = 1:steps 2119 | waitbar(step / steps) 2120 | end 2121 | close(h) 2122 | % 同态滤波器 2123 | % 检查图像通道数,如果是彩色图像则转换为灰度图像 2124 | mysize = size(handles.img); % 获取图像的大小 2125 | if numel(mysize) > 2 % 如果图像为彩色图像 2126 | handles.img = rgb2gray(handles.img); % 转换为灰度图像 2127 | end 2128 | 2129 | I = handles.img; % 原始图像 2130 | J = log(im2double(I) + 1); % 对原始图像进行对数变换 2131 | K = fft2(J); % 进行二维傅里叶变换 2132 | 2133 | % 参数设置 2134 | n = app.global_homeOrder; % 阶数 2135 | D0 = app.global_Fre * pi; % 截止频率 2136 | rh = app.global_hGain; % 高通增益 2137 | rl = app.global_lGain; % 低通增益 2138 | 2139 | % 创建同态滤波器 2140 | [row, column] = size(J); % 获取图像的行列数 2141 | [X, Y] = meshgrid(1:column, 1:row); % 创建X, Y网格 2142 | D1 = sqrt((X - round(row/2)).^2 + (Y - round(column/2)).^2); % 计算频率距离 2143 | H = rl + (rh ./ (1 + (D0./D1).^(2*n))); % 计算同态滤波器H 2144 | 2145 | L = K .* H; % 滤波器与频域图像相乘 2146 | M = ifft2(L); % 进行反傅里叶变换 2147 | N = exp(M) - 1; % 恢复图像 2148 | N = real(N); % 取实部 2149 | handles.img = double(N); 2150 | % 更新图像 2151 | axes(handles.effimg); 2152 | cla; 2153 | imshow(handles.img); 2154 | % 更新 handles 结构 2155 | guidata(hObject, handles); 2156 | % 显示等待条 2157 | h = waitbar(0, '更新图像中 等待...'); 2158 | steps = 200; 2159 | for step = 1:steps 2160 | waitbar(step / steps) 2161 | end 2162 | close(h) 2163 | % 更新函数 2164 | update(app,handles); 2165 | end 2166 | % Value changed function: EditField_homeOrder 2167 | function EditField_homeOrderChanged(app, event) 2168 | app.global_homeOrder = app.EditField_homeOrder.Value; 2169 | end 2170 | % Value changed function: EditField_Fre 2171 | function EditField_FreChanged(app, event) 2172 | app.global_Fre = app.EditField_Fre.Value; 2173 | end 2174 | % Value changed function: EditField_hGain 2175 | function EditField_hGainChanged(app, event) 2176 | app.global_hGain = app.EditField_hGain.Value; 2177 | end 2178 | % Value changed function: EditField_lGain 2179 | function EditField_lGainChanged(app, event) 2180 | app.global_lGain = app.EditField_lGain.Value; 2181 | end 2182 | 2183 | % Button pushed function: Button1 小波变换haar 2184 | function Button1Pushed(app, event) 2185 | % 计算小波变换 2186 | % 创建 GUIDE 风格的回调参数 - 迁移工具添加 2187 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 2188 | mysize=size(handles.img); % 获取处理后的图像大小 2189 | if numel(mysize)>2 2190 | grayimg = rgb2gray(handles.img); 2191 | else 2192 | grayimg = handles.img; 2193 | end 2194 | [grap_LLY, HL, LH, HH] = dwt2(grayimg, 'haar'); 2195 | [LLY, HL, LH, HH] = dwt2(handles.img, 'haar'); 2196 | %显示小波变换 2197 | set(handles.g4, 'Visible', 'on'); 2198 | axes(handles.g4); 2199 | cla; 2200 | imshow(grap_LLY, []); 2201 | hold off; 2202 | title('小波变换(1.灰度低频近似值)'); 2203 | set(handles.g5, 'Visible', 'on'); 2204 | axes(handles.g5); 2205 | cla; 2206 | imshow(HL, []); 2207 | title('2.水平方向细节'); 2208 | hold off; 2209 | set(handles.g6, 'Visible', 'on'); 2210 | axes(handles.g6); 2211 | cla; 2212 | imshow(LH, []); 2213 | title('3.垂直方向细节'); 2214 | hold off; 2215 | set(handles.g7, 'Visible', 'on'); 2216 | axes(handles.g7); 2217 | cla; 2218 | imshow(HH, []); 2219 | title('4.对角线方向细节'); 2220 | hold off; 2221 | % 显示等待条 2222 | h = waitbar(0, '更新图像中 等待...'); 2223 | steps = 100; 2224 | for step = 1:steps 2225 | waitbar(step / steps) 2226 | end 2227 | close(h) 2228 | end 2229 | 2230 | % Button pushed function: Button2 小波变换db2 2231 | function Button2Pushed(app, event) 2232 | % 创建 GUIDE 风格的回调参数 - 迁移工具添加 2233 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 2234 | % 计算小波变换 2235 | mysize=size(handles.img); % 获取处理后的图像大小 2236 | if numel(mysize)>2 2237 | grayimg = rgb2gray(handles.img); 2238 | else 2239 | grayimg = handles.img; 2240 | end 2241 | [grap_LLY, HL, LH, HH] = dwt2(grayimg, 'db2'); 2242 | [LLY, HL, LH, HH] = dwt2(handles.img, 'db2'); 2243 | %显示小波变换 2244 | set(handles.g4, 'Visible', 'on'); 2245 | axes(handles.g4); 2246 | cla; 2247 | imshow(grap_LLY, []); 2248 | hold off; 2249 | title('小波变换(1.灰度低频近似值)'); 2250 | set(handles.g5, 'Visible', 'on'); 2251 | axes(handles.g5); 2252 | cla; 2253 | imshow(HL, []); 2254 | title('2.水平方向细节'); 2255 | hold off; 2256 | set(handles.g6, 'Visible', 'on'); 2257 | axes(handles.g6); 2258 | cla; 2259 | imshow(LH, []); 2260 | title('3.垂直方向细节'); 2261 | hold off; 2262 | set(handles.g7, 'Visible', 'on'); 2263 | axes(handles.g7); 2264 | cla; 2265 | imshow(HH, []); 2266 | title('4.对角线方向细节'); 2267 | hold off; 2268 | % 显示等待条 2269 | h = waitbar(0, '更新图像中 等待...'); 2270 | steps = 100; 2271 | for step = 1:steps 2272 | waitbar(step / steps) 2273 | end 2274 | close(h) 2275 | end 2276 | 2277 | % Button pushed function: Button3 小波变换bior1.1 2278 | function Button3Pushed(app, event) 2279 | % 创建 GUIDE 风格的回调参数 - 迁移工具添加 2280 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 2281 | % 计算小波变换 2282 | mysize=size(handles.img); % 获取处理后的图像大小 2283 | if numel(mysize)>2 2284 | grayimg = rgb2gray(handles.img); 2285 | else 2286 | grayimg = handles.img; 2287 | end 2288 | [grap_LLY, HL, LH, HH] = dwt2(grayimg, 'bior1.1'); 2289 | [LLY, HL, LH, HH] = dwt2(handles.img, 'bior1.1'); 2290 | %显示小波变换 2291 | set(handles.g4, 'Visible', 'on'); 2292 | axes(handles.g4); 2293 | cla; 2294 | imshow(grap_LLY, []); 2295 | hold off; 2296 | title('小波变换(1.灰度低频近似值)'); 2297 | set(handles.g5, 'Visible', 'on'); 2298 | axes(handles.g5); 2299 | cla; 2300 | imshow(HL, []); 2301 | title('2.水平方向细节'); 2302 | hold off; 2303 | set(handles.g6, 'Visible', 'on'); 2304 | axes(handles.g6); 2305 | cla; 2306 | imshow(LH, []); 2307 | title('3.垂直方向细节'); 2308 | hold off; 2309 | set(handles.g7, 'Visible', 'on'); 2310 | axes(handles.g7); 2311 | cla; 2312 | imshow(HH, []); 2313 | title('4.对角线方向细节'); 2314 | hold off; 2315 | % 显示等待条 2316 | h = waitbar(0, '更新图像中 等待...'); 2317 | steps = 100; 2318 | for step = 1:steps 2319 | waitbar(step / steps) 2320 | end 2321 | close(h) 2322 | end 2323 | 2324 | % Button pushed function: Button4 小波变换coif1 2325 | function Button4Pushed(app, event) 2326 | % 创建 GUIDE 风格的回调参数 - 迁移工具添加 2327 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 2328 | % 计算小波变换 2329 | mysize=size(handles.img); % 获取处理后的图像大小 2330 | if numel(mysize)>2 2331 | grayimg = rgb2gray(handles.img); 2332 | else 2333 | grayimg = handles.img; 2334 | end 2335 | [grap_LLY, HL, LH, HH] = dwt2(grayimg, 'coif1'); 2336 | [LLY, HL, LH, HH] = dwt2(handles.img, 'coif1'); 2337 | %显示小波变换 2338 | set(handles.g4, 'Visible', 'on'); 2339 | axes(handles.g4); 2340 | cla; 2341 | imshow(grap_LLY, []); 2342 | hold off; 2343 | title('小波变换(1.灰度低频近似值)'); 2344 | set(handles.g5, 'Visible', 'on'); 2345 | axes(handles.g5); 2346 | cla; 2347 | imshow(HL, []); 2348 | title('2.水平方向细节'); 2349 | hold off; 2350 | set(handles.g6, 'Visible', 'on'); 2351 | axes(handles.g6); 2352 | cla; 2353 | imshow(LH, []); 2354 | title('3.垂直方向细节'); 2355 | hold off; 2356 | set(handles.g7, 'Visible', 'on'); 2357 | axes(handles.g7); 2358 | cla; 2359 | imshow(HH, []); 2360 | title('4.对角线方向细节'); 2361 | hold off; 2362 | % 显示等待条 2363 | h = waitbar(0, '更新图像中 等待...'); 2364 | steps = 100; 2365 | for step = 1:steps 2366 | waitbar(step / steps) 2367 | end 2368 | close(h) 2369 | end 2370 | 2371 | % Button pushed function: Button5 小波变换sym2 2372 | function Button5Pushed(app, event) 2373 | % 创建 GUIDE 风格的回调参数 - 迁移工具添加 2374 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 2375 | % 计算小波变换 2376 | mysize=size(handles.img); % 获取处理后的图像大小 2377 | if numel(mysize)>2 2378 | grayimg = rgb2gray(handles.img); 2379 | else 2380 | grayimg = handles.img; 2381 | end 2382 | [grap_LLY, HL, LH, HH] = dwt2(grayimg, 'sym2'); 2383 | [LLY, HL, LH, HH] = dwt2(handles.img, 'sym2'); 2384 | %显示小波变换 2385 | set(handles.g4, 'Visible', 'on'); 2386 | axes(handles.g4); 2387 | cla; 2388 | imshow(grap_LLY, []); 2389 | hold off; 2390 | title('小波变换(1.灰度低频近似值)'); 2391 | set(handles.g5, 'Visible', 'on'); 2392 | axes(handles.g5); 2393 | cla; 2394 | imshow(HL, []); 2395 | title('2.水平方向细节'); 2396 | hold off; 2397 | set(handles.g6, 'Visible', 'on'); 2398 | axes(handles.g6); 2399 | cla; 2400 | imshow(LH, []); 2401 | title('3.垂直方向细节'); 2402 | hold off; 2403 | set(handles.g7, 'Visible', 'on'); 2404 | axes(handles.g7); 2405 | cla; 2406 | imshow(HH, []); 2407 | title('4.对角线方向细节'); 2408 | hold off; 2409 | % 显示等待条 2410 | h = waitbar(0, '更新图像中 等待...'); 2411 | steps = 100; 2412 | for step = 1:steps 2413 | waitbar(step / steps) 2414 | end 2415 | close(h) 2416 | end 2417 | 2418 | % Button pushed function: Button6 小波变换fk4 2419 | function Button6Pushed(app, event) 2420 | % 创建 GUIDE 风格的回调参数 - 迁移工具添加 2421 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 2422 | % 计算小波变换 2423 | mysize=size(handles.img); % 获取处理后的图像大小 2424 | if numel(mysize)>2 2425 | grayimg = rgb2gray(handles.img); 2426 | else 2427 | grayimg = handles.img; 2428 | end 2429 | [grap_LLY, HL, LH, HH] = dwt2(grayimg, 'fk4'); 2430 | [LLY, HL, LH, HH] = dwt2(handles.img, 'fk4'); 2431 | %显示小波变换 2432 | set(handles.g4, 'Visible', 'on'); 2433 | axes(handles.g4); 2434 | cla; 2435 | imshow(grap_LLY, []); 2436 | hold off; 2437 | title('小波变换(1.灰度低频近似值)'); 2438 | set(handles.g5, 'Visible', 'on'); 2439 | axes(handles.g5); 2440 | cla; 2441 | imshow(HL, []); 2442 | title('2.水平方向细节'); 2443 | hold off; 2444 | set(handles.g6, 'Visible', 'on'); 2445 | axes(handles.g6); 2446 | cla; 2447 | imshow(LH, []); 2448 | title('3.垂直方向细节'); 2449 | hold off; 2450 | set(handles.g7, 'Visible', 'on'); 2451 | axes(handles.g7); 2452 | cla; 2453 | imshow(HH, []); 2454 | title('4.对角线方向细节'); 2455 | hold off; 2456 | % 显示等待条 2457 | h = waitbar(0, '更新图像中 等待...'); 2458 | steps = 100; 2459 | for step = 1:steps 2460 | waitbar(step / steps) 2461 | end 2462 | close(h) 2463 | end 2464 | 2465 | % Button pushed function: Button7 小波变换dmey 2466 | function Button7Pushed(app, event) 2467 | % 创建 GUIDE 风格的回调参数 - 迁移工具添加 2468 | [hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok 2469 | % 计算小波变换 2470 | mysize=size(handles.img); % 获取处理后的图像大小 2471 | if numel(mysize)>2 2472 | grayimg = rgb2gray(handles.img); 2473 | else 2474 | grayimg = handles.img; 2475 | end 2476 | [grap_LLY, HL, LH, HH] = dwt2(grayimg, 'dmey'); 2477 | [LLY, HL, LH, HH] = dwt2(handles.img, 'dmey'); 2478 | %显示小波变换 2479 | set(handles.g4, 'Visible', 'on'); 2480 | axes(handles.g4); 2481 | cla; 2482 | imshow(grap_LLY, []); 2483 | hold off; 2484 | title('小波变换(1.灰度低频近似值)'); 2485 | set(handles.g5, 'Visible', 'on'); 2486 | axes(handles.g5); 2487 | cla; 2488 | imshow(HL, []); 2489 | title('2.水平方向细节'); 2490 | hold off; 2491 | set(handles.g6, 'Visible', 'on'); 2492 | axes(handles.g6); 2493 | cla; 2494 | imshow(LH, []); 2495 | title('3.垂直方向细节'); 2496 | hold off; 2497 | set(handles.g7, 'Visible', 'on'); 2498 | axes(handles.g7); 2499 | cla; 2500 | imshow(HH, []); 2501 | title('4.对角线方向细节'); 2502 | hold off; 2503 | % 显示等待条 2504 | h = waitbar(0, '更新图像中 等待...'); 2505 | steps = 100; 2506 | for step = 1:steps 2507 | waitbar(step / steps) 2508 | end 2509 | close(h) 2510 | end 2511 | 2512 | 2513 | 2514 | % Value changed function: EditField_MEAN 2515 | function EditField_MEANChanged(app, event) 2516 | app.globalGau_MEAN = app.EditField_MEAN.Value; 2517 | end 2518 | 2519 | % Value changed function: EditField_VARChanged 2520 | function EditField_VARChanged(app, event) 2521 | app.globalGau_VAR = app.EditField_VAR.Value; 2522 | end 2523 | 2524 | % Value changed function: EditField_DENSITYChanged 2525 | function EditField_DENSITYChanged(app, event) 2526 | app.globalDENSITY = app.EditField_DENSITY.Value; 2527 | end 2528 | 2529 | end 2530 | 2531 | % UI界面布局初始化 2532 | methods (Access = private) 2533 | 2534 | % 创建 UIFigure 和组件 2535 | function createComponents(app) 2536 | 2537 | %创建组件 2538 | try 2539 | % 创建图形并隐藏,直到创建所有组件 2540 | app.figure = uifigure('Visible', 'off'); 2541 | app.figure.Colormap = [0.2431 0.149 0.6588;0.2431 0.1529 0.6745;0.2471 0.1569 0.6863;0.2471 0.1608 0.698;0.251 0.1647 0.7059;0.251 0.1686 0.7176;0.2549 0.1725 0.7294;0.2549 0.1765 0.7412;0.2588 0.1804 0.749;0.2588 0.1843 0.7608;0.2627 0.1922 0.7843;0.2627 0.1961 0.7922;0.2667 0.2 0.8039;0.2667 0.2039 0.8157;0.2706 0.2078 0.8235;0.2706 0.2157 0.8353;0.2706 0.2196 0.8431;0.2745 0.2235 0.851;0.2745 0.2275 0.8627;0.2745 0.2314 0.8706;0.2745 0.2392 0.8784;0.2784 0.2431 0.8824;0.2784 0.2471 0.8902;0.2784 0.2549 0.898;0.2784 0.2588 0.902;0.2784 0.2667 0.9098;0.2784 0.2706 0.9137;0.2784 0.2745 0.9216;0.2824 0.2824 0.9255;0.2824 0.2863 0.9294;0.2824 0.2941 0.9333;0.2824 0.298 0.9412;0.2824 0.3059 0.9451;0.2824 0.3098 0.949;0.2824 0.3137 0.9529;0.2824 0.3216 0.9569;0.2824 0.3255 0.9608;0.2824 0.3294 0.9647;0.2784 0.3373 0.9686;0.2784 0.3412 0.9686;0.2784 0.349 0.9725;0.2784 0.3529 0.9765;0.2784 0.3569 0.9804;0.2784 0.3647 0.9804;0.2745 0.3686 0.9843;0.2745 0.3765 0.9843;0.2745 0.3804 0.9882;0.2706 0.3843 0.9882;0.2706 0.3922 0.9922;0.2667 0.3961 0.9922;0.2627 0.4039 0.9922;0.2627 0.4078 0.9961;0.2588 0.4157 0.9961;0.2549 0.4196 0.9961;0.251 0.4275 0.9961;0.2471 0.4314 1;0.2431 0.4392 1;0.2353 0.4431 1;0.2314 0.451 1;0.2235 0.4549 1;0.2196 0.4627 0.9961;0.2118 0.4667 0.9961;0.2078 0.4745 0.9922;0.2 0.4784 0.9922;0.1961 0.4863 0.9882;0.1922 0.4902 0.9882;0.1882 0.498 0.9843;0.1843 0.502 0.9804;0.1843 0.5098 0.9804;0.1804 0.5137 0.9765;0.1804 0.5176 0.9725;0.1804 0.5255 0.9725;0.1804 0.5294 0.9686;0.1765 0.5333 0.9647;0.1765 0.5412 0.9608;0.1765 0.5451 0.9569;0.1765 0.549 0.9529;0.1765 0.5569 0.949;0.1725 0.5608 0.9451;0.1725 0.5647 0.9412;0.1686 0.5686 0.9373;0.1647 0.5765 0.9333;0.1608 0.5804 0.9294;0.1569 0.5843 0.9255;0.1529 0.5922 0.9216;0.1529 0.5961 0.9176;0.149 0.6 0.9137;0.149 0.6039 0.9098;0.1451 0.6078 0.9098;0.1451 0.6118 0.9059;0.1412 0.6196 0.902;0.1412 0.6235 0.898;0.1373 0.6275 0.898;0.1373 0.6314 0.8941;0.1333 0.6353 0.8941;0.1294 0.6392 0.8902;0.1255 0.6471 0.8902;0.1216 0.651 0.8863;0.1176 0.6549 0.8824;0.1137 0.6588 0.8824;0.1137 0.6627 0.8784;0.1098 0.6667 0.8745;0.1059 0.6706 0.8706;0.102 0.6745 0.8667;0.098 0.6784 0.8627;0.0902 0.6824 0.8549;0.0863 0.6863 0.851;0.0784 0.6902 0.8471;0.0706 0.6941 0.8392;0.0627 0.698 0.8353;0.0549 0.702 0.8314;0.0431 0.702 0.8235;0.0314 0.7059 0.8196;0.0235 0.7098 0.8118;0.0157 0.7137 0.8078;0.0078 0.7176 0.8;0.0039 0.7176 0.7922;0 0.7216 0.7882;0 0.7255 0.7804;0 0.7294 0.7765;0.0039 0.7294 0.7686;0.0078 0.7333 0.7608;0.0157 0.7333 0.7569;0.0235 0.7373 0.749;0.0353 0.7412 0.7412;0.051 0.7412 0.7373;0.0627 0.7451 0.7294;0.0784 0.7451 0.7216;0.0902 0.749 0.7137;0.102 0.7529 0.7098;0.1137 0.7529 0.702;0.1255 0.7569 0.6941;0.1373 0.7569 0.6863;0.1451 0.7608 0.6824;0.1529 0.7608 0.6745;0.1608 0.7647 0.6667;0.1686 0.7647 0.6588;0.1725 0.7686 0.651;0.1804 0.7686 0.6471;0.1843 0.7725 0.6392;0.1922 0.7725 0.6314;0.1961 0.7765 0.6235;0.2 0.7804 0.6157;0.2078 0.7804 0.6078;0.2118 0.7843 0.6;0.2196 0.7843 0.5882;0.2235 0.7882 0.5804;0.2314 0.7882 0.5725;0.2392 0.7922 0.5647;0.251 0.7922 0.5529;0.2588 0.7922 0.5451;0.2706 0.7961 0.5373;0.2824 0.7961 0.5255;0.2941 0.7961 0.5176;0.3059 0.8 0.5059;0.3176 0.8 0.498;0.3294 0.8 0.4863;0.3412 0.8 0.4784;0.3529 0.8 0.4667;0.3686 0.8039 0.4549;0.3804 0.8039 0.4471;0.3922 0.8039 0.4353;0.4039 0.8039 0.4235;0.4196 0.8039 0.4118;0.4314 0.8039 0.4;0.4471 0.8039 0.3922;0.4627 0.8 0.3804;0.4745 0.8 0.3686;0.4902 0.8 0.3569;0.5059 0.8 0.349;0.5176 0.8 0.3373;0.5333 0.7961 0.3255;0.5451 0.7961 0.3176;0.5608 0.7961 0.3059;0.5765 0.7922 0.2941;0.5882 0.7922 0.2824;0.6039 0.7882 0.2745;0.6157 0.7882 0.2627;0.6314 0.7843 0.251;0.6431 0.7843 0.2431;0.6549 0.7804 0.2314;0.6706 0.7804 0.2235;0.6824 0.7765 0.2157;0.698 0.7765 0.2078;0.7098 0.7725 0.2;0.7216 0.7686 0.1922;0.7333 0.7686 0.1843;0.7451 0.7647 0.1765;0.7608 0.7647 0.1725;0.7725 0.7608 0.1647;0.7843 0.7569 0.1608;0.7961 0.7569 0.1569;0.8078 0.7529 0.1529;0.8157 0.749 0.1529;0.8275 0.749 0.1529;0.8392 0.7451 0.1529;0.851 0.7451 0.1569;0.8588 0.7412 0.1569;0.8706 0.7373 0.1608;0.8824 0.7373 0.1647;0.8902 0.7373 0.1686;0.902 0.7333 0.1765;0.9098 0.7333 0.1804;0.9176 0.7294 0.1882;0.9255 0.7294 0.1961;0.9373 0.7294 0.2078;0.9451 0.7294 0.2157;0.9529 0.7294 0.2235;0.9608 0.7294 0.2314;0.9686 0.7294 0.2392;0.9765 0.7294 0.2431;0.9843 0.7333 0.2431;0.9882 0.7373 0.2431;0.9961 0.7412 0.2392;0.9961 0.7451 0.2353;0.9961 0.7529 0.2314;0.9961 0.7569 0.2275;0.9961 0.7608 0.2235;0.9961 0.7686 0.2196;0.9961 0.7725 0.2157;0.9961 0.7804 0.2078;0.9961 0.7843 0.2039;0.9961 0.7922 0.2;0.9922 0.7961 0.1961;0.9922 0.8039 0.1922;0.9922 0.8078 0.1922;0.9882 0.8157 0.1882;0.9843 0.8235 0.1843;0.9843 0.8275 0.1804;0.9804 0.8353 0.1804;0.9765 0.8392 0.1765;0.9765 0.8471 0.1725;0.9725 0.851 0.1686;0.9686 0.8588 0.1647;0.9686 0.8667 0.1647;0.9647 0.8706 0.1608;0.9647 0.8784 0.1569;0.9608 0.8824 0.1569;0.9608 0.8902 0.1529;0.9608 0.898 0.149;0.9608 0.902 0.149;0.9608 0.9098 0.1451;0.9608 0.9137 0.1412;0.9608 0.9216 0.1373;0.9608 0.9255 0.1333;0.9608 0.9333 0.1294;0.9647 0.9373 0.1255;0.9647 0.9451 0.1216;0.9647 0.949 0.1176;0.9686 0.9569 0.1098;0.9686 0.9608 0.1059;0.9725 0.9686 0.102;0.9725 0.9725 0.0941;0.9765 0.9765 0.0863;0.9765 0.9843 0.0824]; 2542 | app.figure.Position = [50 60 1620 850]; 2543 | app.figure.Name = 'Image_processing_GUI'; 2544 | app.figure.HandleVisibility = 'callback'; 2545 | app.figure.Tag = 'figure'; 2546 | catch 2547 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 2548 | end 2549 | 2550 | %文件操作控件 2551 | try 2552 | % Create uibuttongroup1 2553 | app.uibuttongroup1 = uibuttongroup(app.figure); 2554 | app.uibuttongroup1.Title = '文件操作'; 2555 | app.uibuttongroup1.Tag = 'uibuttongroup1'; 2556 | app.uibuttongroup1.FontName = 'Microsoft YaHei UI'; 2557 | app.uibuttongroup1.FontSize = 16; 2558 | app.uibuttongroup1.Position = [29 492 102 300]; 2559 | 2560 | % Create Label_Name 2561 | app.Label_Name = uilabel(app.figure); 2562 | app.Label_Name.FontWeight = 'bold'; 2563 | app.Label_Name.FontColor = [0.118 0.565 1]; % 深海蓝色 2564 | app.Label_Name.Position = [18 400 400 100]; 2565 | app.Label_Name.FontName = '宋体'; 2566 | app.Label_Name.FontSize = 18; 2567 | app.Label_Name.Text = ' 姓名'; 2568 | 2569 | % Create Label_Number 2570 | app.Label_Number = uilabel(app.figure); 2571 | app.Label_Number.FontWeight = 'bold'; 2572 | app.Label_Number.FontColor = [0.118 0.565 1]; % 深海蓝色 2573 | app.Label_Number.Position = [18 360 400 100]; 2574 | app.Label_Number.FontName = '宋体'; 2575 | app.Label_Number.FontSize = 18; 2576 | app.Label_Number.Text = ' 学号'; 2577 | catch 2578 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 2579 | end 2580 | 2581 | % Create load 2582 | try 2583 | app.load = uibutton(app.uibuttongroup1, 'push'); 2584 | app.load.ButtonPushedFcn = createCallbackFcn(app, @load_Callback, true); 2585 | app.load.Tag = 'load'; 2586 | app.load.FontName = 'Microsoft YaHei UI'; 2587 | app.load.FontSize = 20; 2588 | app.load.Position = [18 211 64 42]; 2589 | app.load.Text = '打开'; 2590 | catch 2591 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 2592 | end 2593 | 2594 | % Create exit 2595 | try 2596 | app.exit = uibutton(app.uibuttongroup1, 'push'); 2597 | app.exit.ButtonPushedFcn = createCallbackFcn(app, @exit_Callback, true); 2598 | app.exit.Tag = 'exit'; 2599 | app.exit.FontName = 'Microsoft YaHei UI'; 2600 | app.exit.FontSize = 20; 2601 | app.exit.Position = [18 154 64 42]; 2602 | app.exit.Text = '退出'; 2603 | catch 2604 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 2605 | end 2606 | 2607 | % Create save 2608 | try 2609 | app.save = uibutton(app.uibuttongroup1, 'push'); 2610 | app.save.ButtonPushedFcn = createCallbackFcn(app, @save_Callback, true); 2611 | app.save.Tag = 'save'; 2612 | app.save.FontName = 'Microsoft YaHei UI'; 2613 | app.save.FontSize = 20; 2614 | app.save.Position = [18 91 64 42]; 2615 | app.save.Text = '保存'; 2616 | catch 2617 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 2618 | end 2619 | 2620 | % Create reset 2621 | try 2622 | app.reset = uibutton(app.uibuttongroup1, 'push'); 2623 | app.reset.ButtonPushedFcn = createCallbackFcn(app, @reset_Callback, true); 2624 | app.reset.Tag = 'reset'; 2625 | app.reset.FontName = 'Microsoft YaHei UI'; 2626 | app.reset.FontSize = 20; 2627 | app.reset.Position = [18 30 64 42]; 2628 | app.reset.Text = '清除'; 2629 | catch 2630 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 2631 | end 2632 | % Create uibuttongroup2 原始图像 2633 | try 2634 | app.uibuttongroup2 = uibuttongroup(app.figure); 2635 | app.uibuttongroup2.Title = '原始图像'; 2636 | app.uibuttongroup2.Tag = 'uibuttongroup2'; 2637 | app.uibuttongroup2.FontName = 'Microsoft YaHei UI'; 2638 | app.uibuttongroup2.FontSize = 24; 2639 | app.uibuttongroup2.Position = [150 400 390 435]; 2640 | % Create orgimg 2641 | app.orgimg = uiaxes(app.uibuttongroup2); 2642 | app.orgimg.FontName = 'Microsoft YaHei UI'; 2643 | app.orgimg.Colormap = [0.2431 0.149 0.6588;0.2431 0.1529 0.6745;0.2471 0.1569 0.6863;0.2471 0.1608 0.698;0.251 0.1647 0.7059;0.251 0.1686 0.7176;0.2549 0.1725 0.7294;0.2549 0.1765 0.7412;0.2588 0.1804 0.749;0.2588 0.1843 0.7608;0.2627 0.1922 0.7843;0.2627 0.1961 0.7922;0.2667 0.2 0.8039;0.2667 0.2039 0.8157;0.2706 0.2078 0.8235;0.2706 0.2157 0.8353;0.2706 0.2196 0.8431;0.2745 0.2235 0.851;0.2745 0.2275 0.8627;0.2745 0.2314 0.8706;0.2745 0.2392 0.8784;0.2784 0.2431 0.8824;0.2784 0.2471 0.8902;0.2784 0.2549 0.898;0.2784 0.2588 0.902;0.2784 0.2667 0.9098;0.2784 0.2706 0.9137;0.2784 0.2745 0.9216;0.2824 0.2824 0.9255;0.2824 0.2863 0.9294;0.2824 0.2941 0.9333;0.2824 0.298 0.9412;0.2824 0.3059 0.9451;0.2824 0.3098 0.949;0.2824 0.3137 0.9529;0.2824 0.3216 0.9569;0.2824 0.3255 0.9608;0.2824 0.3294 0.9647;0.2784 0.3373 0.9686;0.2784 0.3412 0.9686;0.2784 0.349 0.9725;0.2784 0.3529 0.9765;0.2784 0.3569 0.9804;0.2784 0.3647 0.9804;0.2745 0.3686 0.9843;0.2745 0.3765 0.9843;0.2745 0.3804 0.9882;0.2706 0.3843 0.9882;0.2706 0.3922 0.9922;0.2667 0.3961 0.9922;0.2627 0.4039 0.9922;0.2627 0.4078 0.9961;0.2588 0.4157 0.9961;0.2549 0.4196 0.9961;0.251 0.4275 0.9961;0.2471 0.4314 1;0.2431 0.4392 1;0.2353 0.4431 1;0.2314 0.451 1;0.2235 0.4549 1;0.2196 0.4627 0.9961;0.2118 0.4667 0.9961;0.2078 0.4745 0.9922;0.2 0.4784 0.9922;0.1961 0.4863 0.9882;0.1922 0.4902 0.9882;0.1882 0.498 0.9843;0.1843 0.502 0.9804;0.1843 0.5098 0.9804;0.1804 0.5137 0.9765;0.1804 0.5176 0.9725;0.1804 0.5255 0.9725;0.1804 0.5294 0.9686;0.1765 0.5333 0.9647;0.1765 0.5412 0.9608;0.1765 0.5451 0.9569;0.1765 0.549 0.9529;0.1765 0.5569 0.949;0.1725 0.5608 0.9451;0.1725 0.5647 0.9412;0.1686 0.5686 0.9373;0.1647 0.5765 0.9333;0.1608 0.5804 0.9294;0.1569 0.5843 0.9255;0.1529 0.5922 0.9216;0.1529 0.5961 0.9176;0.149 0.6 0.9137;0.149 0.6039 0.9098;0.1451 0.6078 0.9098;0.1451 0.6118 0.9059;0.1412 0.6196 0.902;0.1412 0.6235 0.898;0.1373 0.6275 0.898;0.1373 0.6314 0.8941;0.1333 0.6353 0.8941;0.1294 0.6392 0.8902;0.1255 0.6471 0.8902;0.1216 0.651 0.8863;0.1176 0.6549 0.8824;0.1137 0.6588 0.8824;0.1137 0.6627 0.8784;0.1098 0.6667 0.8745;0.1059 0.6706 0.8706;0.102 0.6745 0.8667;0.098 0.6784 0.8627;0.0902 0.6824 0.8549;0.0863 0.6863 0.851;0.0784 0.6902 0.8471;0.0706 0.6941 0.8392;0.0627 0.698 0.8353;0.0549 0.702 0.8314;0.0431 0.702 0.8235;0.0314 0.7059 0.8196;0.0235 0.7098 0.8118;0.0157 0.7137 0.8078;0.0078 0.7176 0.8;0.0039 0.7176 0.7922;0 0.7216 0.7882;0 0.7255 0.7804;0 0.7294 0.7765;0.0039 0.7294 0.7686;0.0078 0.7333 0.7608;0.0157 0.7333 0.7569;0.0235 0.7373 0.749;0.0353 0.7412 0.7412;0.051 0.7412 0.7373;0.0627 0.7451 0.7294;0.0784 0.7451 0.7216;0.0902 0.749 0.7137;0.102 0.7529 0.7098;0.1137 0.7529 0.702;0.1255 0.7569 0.6941;0.1373 0.7569 0.6863;0.1451 0.7608 0.6824;0.1529 0.7608 0.6745;0.1608 0.7647 0.6667;0.1686 0.7647 0.6588;0.1725 0.7686 0.651;0.1804 0.7686 0.6471;0.1843 0.7725 0.6392;0.1922 0.7725 0.6314;0.1961 0.7765 0.6235;0.2 0.7804 0.6157;0.2078 0.7804 0.6078;0.2118 0.7843 0.6;0.2196 0.7843 0.5882;0.2235 0.7882 0.5804;0.2314 0.7882 0.5725;0.2392 0.7922 0.5647;0.251 0.7922 0.5529;0.2588 0.7922 0.5451;0.2706 0.7961 0.5373;0.2824 0.7961 0.5255;0.2941 0.7961 0.5176;0.3059 0.8 0.5059;0.3176 0.8 0.498;0.3294 0.8 0.4863;0.3412 0.8 0.4784;0.3529 0.8 0.4667;0.3686 0.8039 0.4549;0.3804 0.8039 0.4471;0.3922 0.8039 0.4353;0.4039 0.8039 0.4235;0.4196 0.8039 0.4118;0.4314 0.8039 0.4;0.4471 0.8039 0.3922;0.4627 0.8 0.3804;0.4745 0.8 0.3686;0.4902 0.8 0.3569;0.5059 0.8 0.349;0.5176 0.8 0.3373;0.5333 0.7961 0.3255;0.5451 0.7961 0.3176;0.5608 0.7961 0.3059;0.5765 0.7922 0.2941;0.5882 0.7922 0.2824;0.6039 0.7882 0.2745;0.6157 0.7882 0.2627;0.6314 0.7843 0.251;0.6431 0.7843 0.2431;0.6549 0.7804 0.2314;0.6706 0.7804 0.2235;0.6824 0.7765 0.2157;0.698 0.7765 0.2078;0.7098 0.7725 0.2;0.7216 0.7686 0.1922;0.7333 0.7686 0.1843;0.7451 0.7647 0.1765;0.7608 0.7647 0.1725;0.7725 0.7608 0.1647;0.7843 0.7569 0.1608;0.7961 0.7569 0.1569;0.8078 0.7529 0.1529;0.8157 0.749 0.1529;0.8275 0.749 0.1529;0.8392 0.7451 0.1529;0.851 0.7451 0.1569;0.8588 0.7412 0.1569;0.8706 0.7373 0.1608;0.8824 0.7373 0.1647;0.8902 0.7373 0.1686;0.902 0.7333 0.1765;0.9098 0.7333 0.1804;0.9176 0.7294 0.1882;0.9255 0.7294 0.1961;0.9373 0.7294 0.2078;0.9451 0.7294 0.2157;0.9529 0.7294 0.2235;0.9608 0.7294 0.2314;0.9686 0.7294 0.2392;0.9765 0.7294 0.2431;0.9843 0.7333 0.2431;0.9882 0.7373 0.2431;0.9961 0.7412 0.2392;0.9961 0.7451 0.2353;0.9961 0.7529 0.2314;0.9961 0.7569 0.2275;0.9961 0.7608 0.2235;0.9961 0.7686 0.2196;0.9961 0.7725 0.2157;0.9961 0.7804 0.2078;0.9961 0.7843 0.2039;0.9961 0.7922 0.2;0.9922 0.7961 0.1961;0.9922 0.8039 0.1922;0.9922 0.8078 0.1922;0.9882 0.8157 0.1882;0.9843 0.8235 0.1843;0.9843 0.8275 0.1804;0.9804 0.8353 0.1804;0.9765 0.8392 0.1765;0.9765 0.8471 0.1725;0.9725 0.851 0.1686;0.9686 0.8588 0.1647;0.9686 0.8667 0.1647;0.9647 0.8706 0.1608;0.9647 0.8784 0.1569;0.9608 0.8824 0.1569;0.9608 0.8902 0.1529;0.9608 0.898 0.149;0.9608 0.902 0.149;0.9608 0.9098 0.1451;0.9608 0.9137 0.1412;0.9608 0.9216 0.1373;0.9608 0.9255 0.1333;0.9608 0.9333 0.1294;0.9647 0.9373 0.1255;0.9647 0.9451 0.1216;0.9647 0.949 0.1176;0.9686 0.9569 0.1098;0.9686 0.9608 0.1059;0.9725 0.9686 0.102;0.9725 0.9725 0.0941;0.9765 0.9765 0.0863;0.9765 0.9843 0.0824]; 2644 | app.orgimg.FontSize = 13; 2645 | app.orgimg.NextPlot = 'replace'; 2646 | app.orgimg.Tag = 'orgimg'; 2647 | app.orgimg.Position = [0 30 320 320]; 2648 | catch 2649 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 2650 | end 2651 | % Create uibuttongroup3 修改后图像 2652 | try 2653 | app.uibuttongroup3 = uibuttongroup(app.figure); 2654 | app.uibuttongroup3.Title = '效果预览图像'; 2655 | app.uibuttongroup3.Tag = 'uibuttongroup3'; 2656 | app.uibuttongroup3.FontName = 'Microsoft YaHei UI'; 2657 | app.uibuttongroup3.FontSize = 24; 2658 | app.uibuttongroup3.Position = [550 400 390 435]; 2659 | % Create effimg 2660 | app.effimg = uiaxes(app.uibuttongroup3); 2661 | app.effimg.FontName = 'Microsoft YaHei UI'; 2662 | app.effimg.Colormap = [0.2431 0.149 0.6588;0.2431 0.1529 0.6745;0.2471 0.1569 0.6863;0.2471 0.1608 0.698;0.251 0.1647 0.7059;0.251 0.1686 0.7176;0.2549 0.1725 0.7294;0.2549 0.1765 0.7412;0.2588 0.1804 0.749;0.2588 0.1843 0.7608;0.2627 0.1922 0.7843;0.2627 0.1961 0.7922;0.2667 0.2 0.8039;0.2667 0.2039 0.8157;0.2706 0.2078 0.8235;0.2706 0.2157 0.8353;0.2706 0.2196 0.8431;0.2745 0.2235 0.851;0.2745 0.2275 0.8627;0.2745 0.2314 0.8706;0.2745 0.2392 0.8784;0.2784 0.2431 0.8824;0.2784 0.2471 0.8902;0.2784 0.2549 0.898;0.2784 0.2588 0.902;0.2784 0.2667 0.9098;0.2784 0.2706 0.9137;0.2784 0.2745 0.9216;0.2824 0.2824 0.9255;0.2824 0.2863 0.9294;0.2824 0.2941 0.9333;0.2824 0.298 0.9412;0.2824 0.3059 0.9451;0.2824 0.3098 0.949;0.2824 0.3137 0.9529;0.2824 0.3216 0.9569;0.2824 0.3255 0.9608;0.2824 0.3294 0.9647;0.2784 0.3373 0.9686;0.2784 0.3412 0.9686;0.2784 0.349 0.9725;0.2784 0.3529 0.9765;0.2784 0.3569 0.9804;0.2784 0.3647 0.9804;0.2745 0.3686 0.9843;0.2745 0.3765 0.9843;0.2745 0.3804 0.9882;0.2706 0.3843 0.9882;0.2706 0.3922 0.9922;0.2667 0.3961 0.9922;0.2627 0.4039 0.9922;0.2627 0.4078 0.9961;0.2588 0.4157 0.9961;0.2549 0.4196 0.9961;0.251 0.4275 0.9961;0.2471 0.4314 1;0.2431 0.4392 1;0.2353 0.4431 1;0.2314 0.451 1;0.2235 0.4549 1;0.2196 0.4627 0.9961;0.2118 0.4667 0.9961;0.2078 0.4745 0.9922;0.2 0.4784 0.9922;0.1961 0.4863 0.9882;0.1922 0.4902 0.9882;0.1882 0.498 0.9843;0.1843 0.502 0.9804;0.1843 0.5098 0.9804;0.1804 0.5137 0.9765;0.1804 0.5176 0.9725;0.1804 0.5255 0.9725;0.1804 0.5294 0.9686;0.1765 0.5333 0.9647;0.1765 0.5412 0.9608;0.1765 0.5451 0.9569;0.1765 0.549 0.9529;0.1765 0.5569 0.949;0.1725 0.5608 0.9451;0.1725 0.5647 0.9412;0.1686 0.5686 0.9373;0.1647 0.5765 0.9333;0.1608 0.5804 0.9294;0.1569 0.5843 0.9255;0.1529 0.5922 0.9216;0.1529 0.5961 0.9176;0.149 0.6 0.9137;0.149 0.6039 0.9098;0.1451 0.6078 0.9098;0.1451 0.6118 0.9059;0.1412 0.6196 0.902;0.1412 0.6235 0.898;0.1373 0.6275 0.898;0.1373 0.6314 0.8941;0.1333 0.6353 0.8941;0.1294 0.6392 0.8902;0.1255 0.6471 0.8902;0.1216 0.651 0.8863;0.1176 0.6549 0.8824;0.1137 0.6588 0.8824;0.1137 0.6627 0.8784;0.1098 0.6667 0.8745;0.1059 0.6706 0.8706;0.102 0.6745 0.8667;0.098 0.6784 0.8627;0.0902 0.6824 0.8549;0.0863 0.6863 0.851;0.0784 0.6902 0.8471;0.0706 0.6941 0.8392;0.0627 0.698 0.8353;0.0549 0.702 0.8314;0.0431 0.702 0.8235;0.0314 0.7059 0.8196;0.0235 0.7098 0.8118;0.0157 0.7137 0.8078;0.0078 0.7176 0.8;0.0039 0.7176 0.7922;0 0.7216 0.7882;0 0.7255 0.7804;0 0.7294 0.7765;0.0039 0.7294 0.7686;0.0078 0.7333 0.7608;0.0157 0.7333 0.7569;0.0235 0.7373 0.749;0.0353 0.7412 0.7412;0.051 0.7412 0.7373;0.0627 0.7451 0.7294;0.0784 0.7451 0.7216;0.0902 0.749 0.7137;0.102 0.7529 0.7098;0.1137 0.7529 0.702;0.1255 0.7569 0.6941;0.1373 0.7569 0.6863;0.1451 0.7608 0.6824;0.1529 0.7608 0.6745;0.1608 0.7647 0.6667;0.1686 0.7647 0.6588;0.1725 0.7686 0.651;0.1804 0.7686 0.6471;0.1843 0.7725 0.6392;0.1922 0.7725 0.6314;0.1961 0.7765 0.6235;0.2 0.7804 0.6157;0.2078 0.7804 0.6078;0.2118 0.7843 0.6;0.2196 0.7843 0.5882;0.2235 0.7882 0.5804;0.2314 0.7882 0.5725;0.2392 0.7922 0.5647;0.251 0.7922 0.5529;0.2588 0.7922 0.5451;0.2706 0.7961 0.5373;0.2824 0.7961 0.5255;0.2941 0.7961 0.5176;0.3059 0.8 0.5059;0.3176 0.8 0.498;0.3294 0.8 0.4863;0.3412 0.8 0.4784;0.3529 0.8 0.4667;0.3686 0.8039 0.4549;0.3804 0.8039 0.4471;0.3922 0.8039 0.4353;0.4039 0.8039 0.4235;0.4196 0.8039 0.4118;0.4314 0.8039 0.4;0.4471 0.8039 0.3922;0.4627 0.8 0.3804;0.4745 0.8 0.3686;0.4902 0.8 0.3569;0.5059 0.8 0.349;0.5176 0.8 0.3373;0.5333 0.7961 0.3255;0.5451 0.7961 0.3176;0.5608 0.7961 0.3059;0.5765 0.7922 0.2941;0.5882 0.7922 0.2824;0.6039 0.7882 0.2745;0.6157 0.7882 0.2627;0.6314 0.7843 0.251;0.6431 0.7843 0.2431;0.6549 0.7804 0.2314;0.6706 0.7804 0.2235;0.6824 0.7765 0.2157;0.698 0.7765 0.2078;0.7098 0.7725 0.2;0.7216 0.7686 0.1922;0.7333 0.7686 0.1843;0.7451 0.7647 0.1765;0.7608 0.7647 0.1725;0.7725 0.7608 0.1647;0.7843 0.7569 0.1608;0.7961 0.7569 0.1569;0.8078 0.7529 0.1529;0.8157 0.749 0.1529;0.8275 0.749 0.1529;0.8392 0.7451 0.1529;0.851 0.7451 0.1569;0.8588 0.7412 0.1569;0.8706 0.7373 0.1608;0.8824 0.7373 0.1647;0.8902 0.7373 0.1686;0.902 0.7333 0.1765;0.9098 0.7333 0.1804;0.9176 0.7294 0.1882;0.9255 0.7294 0.1961;0.9373 0.7294 0.2078;0.9451 0.7294 0.2157;0.9529 0.7294 0.2235;0.9608 0.7294 0.2314;0.9686 0.7294 0.2392;0.9765 0.7294 0.2431;0.9843 0.7333 0.2431;0.9882 0.7373 0.2431;0.9961 0.7412 0.2392;0.9961 0.7451 0.2353;0.9961 0.7529 0.2314;0.9961 0.7569 0.2275;0.9961 0.7608 0.2235;0.9961 0.7686 0.2196;0.9961 0.7725 0.2157;0.9961 0.7804 0.2078;0.9961 0.7843 0.2039;0.9961 0.7922 0.2;0.9922 0.7961 0.1961;0.9922 0.8039 0.1922;0.9922 0.8078 0.1922;0.9882 0.8157 0.1882;0.9843 0.8235 0.1843;0.9843 0.8275 0.1804;0.9804 0.8353 0.1804;0.9765 0.8392 0.1765;0.9765 0.8471 0.1725;0.9725 0.851 0.1686;0.9686 0.8588 0.1647;0.9686 0.8667 0.1647;0.9647 0.8706 0.1608;0.9647 0.8784 0.1569;0.9608 0.8824 0.1569;0.9608 0.8902 0.1529;0.9608 0.898 0.149;0.9608 0.902 0.149;0.9608 0.9098 0.1451;0.9608 0.9137 0.1412;0.9608 0.9216 0.1373;0.9608 0.9255 0.1333;0.9608 0.9333 0.1294;0.9647 0.9373 0.1255;0.9647 0.9451 0.1216;0.9647 0.949 0.1176;0.9686 0.9569 0.1098;0.9686 0.9608 0.1059;0.9725 0.9686 0.102;0.9725 0.9725 0.0941;0.9765 0.9765 0.0863;0.9765 0.9843 0.0824]; 2663 | app.effimg.FontSize = 13; 2664 | app.effimg.NextPlot = 'replace'; 2665 | app.effimg.Tag = 'effimg'; 2666 | app.effimg.Position = [0 30 320 320]; 2667 | 2668 | % Create Label_QUALITY 2669 | app.Label_QUALITY = uilabel(app.figure); 2670 | app.Label_QUALITY.FontWeight = 'bold'; 2671 | app.Label_QUALITY.FontColor = [0.118 0.565 1]; % 深海蓝色 2672 | app.Label_QUALITY.Position = [800 270 400 200]; 2673 | app.Label_QUALITY.FontName = '宋体'; 2674 | app.Label_QUALITY.FontSize = 27; 2675 | app.Label_QUALITY.Text = '去噪效果'; 2676 | % Create Label_MSE 2677 | app.Label_MSE = uilabel(app.figure); 2678 | app.Label_MSE.FontWeight = 'bold'; 2679 | app.Label_MSE.FontColor = [0.118 0.565 1]; % 深海蓝色 2680 | app.Label_MSE.Position = [780 230 400 200]; 2681 | app.Label_MSE.FontName = '宋体'; 2682 | app.Label_MSE.FontSize = 20; 2683 | app.Label_MSE.Text = 'MSE :'; 2684 | % Create Label_SNR 2685 | app.Label_SNR = uilabel(app.figure); 2686 | app.Label_SNR.FontWeight = 'bold'; 2687 | app.Label_SNR.FontColor = [0.118 0.565 1]; % 深海蓝色 2688 | app.Label_SNR.Position = [780 200 400 200]; 2689 | app.Label_SNR.FontName = '宋体'; 2690 | app.Label_SNR.FontSize = 20; 2691 | app.Label_SNR.Text = 'SNR :'; 2692 | % Create Label_PSNR 2693 | app.Label_PSNR = uilabel(app.figure); 2694 | app.Label_PSNR.FontWeight = 'bold'; 2695 | app.Label_PSNR.FontColor = [0.118 0.565 1]; % 深海蓝色 2696 | app.Label_PSNR.Position = [780 170 400 200]; 2697 | app.Label_PSNR.FontName = '宋体'; 2698 | app.Label_PSNR.FontSize = 20; 2699 | app.Label_PSNR.Text = 'PSNR: '; 2700 | % Create Label_SSIM 2701 | app.Label_SSIM = uilabel(app.figure); 2702 | app.Label_SSIM.FontWeight = 'bold'; 2703 | app.Label_SSIM.FontColor = [0.118 0.565 1]; % 深海蓝色 2704 | app.Label_SSIM.Position = [780 140 400 200]; 2705 | app.Label_SSIM.FontName = '宋体'; 2706 | app.Label_SSIM.FontSize = 20; 2707 | app.Label_SSIM.Text = 'SSIM:'; 2708 | % Create Label_qualityINFO 2709 | app.Label_qualityINFO = uilabel(app.figure); 2710 | app.Label_qualityINFO.FontColor = [0.139 0.79 0.349]; % 绿色 2711 | app.Label_qualityINFO.Position = [760 19 400 200]; 2712 | % app.Label_qualityINFO.FontWeight = 'bold'; 2713 | app.Label_qualityINFO.FontSize = 13; 2714 | app.Label_qualityINFO.Text = [ 2715 | 'MSE([0, +∞)):' , ... 2716 | newline, ... 2717 | ' 数值越小表示图像质量更好;',... 2718 | newline, ... 2719 | 'SNR([0, +∞) dB):', ... 2720 | newline, ... 2721 | ' 数值越高表示图像信号与噪声', ... 2722 | newline, ... 2723 | ' 比率更高,图像质量更好;',... 2724 | newline, ... 2725 | 'PSNR([0, +∞) dB):', ... 2726 | newline, ... 2727 | ' 数值越高表示图像质量更好;', ... 2728 | newline, ... 2729 | 'SSIM([-1, 1]):', ... 2730 | newline, ... 2731 | ' 接近 1 表示图像质量更好;' 2732 | ]; 2733 | % Create Label 2734 | app.Label_Wn = uilabel(app.figure); 2735 | app.Label_Wn.FontWeight = 'bold'; 2736 | app.Label_Wn.FontSize = 13; 2737 | app.Label_Wn.FontColor = [0.139 0.79 0.349]; 2738 | app.Label_Wn.Position = [775 5 200 35]; 2739 | app.Label_Wn.Text = {' 注: 维纳滤波需要'; '在添加运动噪波之后去噪'; ''}; 2740 | 2741 | catch 2742 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 2743 | end 2744 | % Create uibuttongroup8 频域滤波 2745 | try 2746 | app.uibuttongroup8 = uibuttongroup(app.figure); 2747 | app.uibuttongroup8.Title = '频域滤波'; 2748 | app.uibuttongroup8.Tag = 'uibuttongroup8'; 2749 | app.uibuttongroup8.FontName = 'Microsoft YaHei UI'; 2750 | app.uibuttongroup8.FontSize = 16; 2751 | app.uibuttongroup8.Position = [185 5 390 380]; 2752 | % Create p21 2753 | app.p21 = uibutton(app.uibuttongroup8, 'push'); 2754 | app.p21.ButtonPushedFcn = createCallbackFcn(app, @p21_Callback, true); 2755 | app.p21.Tag = 'p21'; 2756 | app.p21.FontSize = 16; 2757 | app.p21.Position = [15 270 105 28]; 2758 | app.p21.Text = '理想低通滤波'; 2759 | % Create Label_idealp_Fre 2760 | app.Label_idealp_Fre = uilabel(app.uibuttongroup8); 2761 | app.Label_idealp_Fre.FontSize = 14; 2762 | app.Label_idealp_Fre.FontWeight = 'bold'; 2763 | app.Label_idealp_Fre.FontColor = [1 0 0]; 2764 | app.Label_idealp_Fre.Position = [13 290 80 50]; 2765 | app.Label_idealp_Fre.Text = {'截止频率:'}; 2766 | % Create EditField_idealp_Fre 2767 | app.EditField_idealp_Fre = uieditfield(app.uibuttongroup8, 'numeric'); 2768 | app.EditField_idealp_Fre.ValueChangedFcn = createCallbackFcn(app, @EditField_idealp_FreChanged, true); 2769 | app.EditField_idealp_Fre.Position = [75 305 40 19]; 2770 | app.EditField_idealp_Fre.Value =60; 2771 | % Create p22 2772 | app.p22 = uibutton(app.uibuttongroup8, 'push'); 2773 | app.p22.ButtonPushedFcn = createCallbackFcn(app, @p22_Callback, true); 2774 | app.p22.Tag = 'p22'; 2775 | app.p22.FontSize = 16; 2776 | app.p22.Position = [15 220 105 28]; 2777 | app.p22.Text = '理想高通滤波'; 2778 | % Create Label_idealp_Fre 2779 | app.Label_ideahp_Fre = uilabel(app.uibuttongroup8); 2780 | app.Label_ideahp_Fre.FontSize = 14; 2781 | app.Label_ideahp_Fre.FontWeight = 'bold'; 2782 | app.Label_ideahp_Fre.FontColor = [1 0 0]; 2783 | app.Label_ideahp_Fre.Position = [13 235 80 50]; 2784 | app.Label_ideahp_Fre.Text = {'截止频率:'}; 2785 | % Create EditField_idealp_Fre 2786 | app.EditField_ideahp_Fre = uieditfield(app.uibuttongroup8, 'numeric'); 2787 | app.EditField_ideahp_Fre.ValueChangedFcn = createCallbackFcn(app, @EditField_ideahp_FreChanged, true); 2788 | app.EditField_ideahp_Fre.Position = [75 250 40 19]; 2789 | app.EditField_ideahp_Fre.Value =30; 2790 | % Create p23 2791 | app.p23 = uibutton(app.uibuttongroup8, 'push'); 2792 | app.p23.ButtonPushedFcn = createCallbackFcn(app, @p23_Callback, true); 2793 | app.p23.Tag = 'p23'; 2794 | app.p23.FontSize = 16; 2795 | app.p23.Position = [15 150 105 28]; 2796 | app.p23.Text = '理想带通滤波'; 2797 | % Create Label_ideabp_lFre 2798 | app.Label_ideabp_lFre = uilabel(app.uibuttongroup8); 2799 | app.Label_ideabp_lFre.FontSize = 12; 2800 | app.Label_ideabp_lFre.FontWeight = 'bold'; 2801 | app.Label_ideabp_lFre.FontColor = [1 0 0]; 2802 | app.Label_ideabp_lFre.Position = [3 194 100 30]; 2803 | app.Label_ideabp_lFre.Text = {'下限截止频率:'}; 2804 | % Create EditField_ideabp_lFre 2805 | app.EditField_ideabp_lFre = uieditfield(app.uibuttongroup8, 'numeric'); 2806 | app.EditField_ideabp_lFre.ValueChangedFcn = createCallbackFcn(app, @EditField_ideabp_lFreChanged, true); 2807 | app.EditField_ideabp_lFre.Position = [85 200 40 19]; 2808 | app.EditField_ideabp_lFre.Value =20; 2809 | % Create Label_ideabp_hFre 2810 | app.Label_ideabp_hFre = uilabel(app.uibuttongroup8); 2811 | app.Label_ideabp_hFre.FontSize = 12; 2812 | app.Label_ideabp_hFre.FontWeight = 'bold'; 2813 | app.Label_ideabp_hFre.FontColor = [1 0 0]; 2814 | app.Label_ideabp_hFre.Position = [3 174 100 30]; 2815 | app.Label_ideabp_hFre.Text = {'上限截止频率:'}; 2816 | % Create EditField_ideabp_hFre 2817 | app.EditField_ideabp_hFre = uieditfield(app.uibuttongroup8, 'numeric'); 2818 | app.EditField_ideabp_hFre.ValueChangedFcn = createCallbackFcn(app, @EditField_ideabp_hFreChanged, true); 2819 | app.EditField_ideabp_hFre.Position = [85 180 40 19]; 2820 | app.EditField_ideabp_hFre.Value =80; 2821 | % Create p24 2822 | app.p24 = uibutton(app.uibuttongroup8, 'push'); 2823 | app.p24.ButtonPushedFcn = createCallbackFcn(app, @p24_Callback, true); 2824 | app.p24.Tag = 'p24'; 2825 | app.p24.FontSize = 16; 2826 | app.p24.Position = [15 80 105 28]; 2827 | app.p24.Text = '理想带阻滤波'; 2828 | % Create Label_ideabs_Fre 2829 | app.Label_ideabs_Fre = uilabel(app.uibuttongroup8); 2830 | app.Label_ideabs_Fre.FontSize = 12; 2831 | app.Label_ideabs_Fre.FontWeight = 'bold'; 2832 | app.Label_ideabs_Fre.FontColor = [1 0 0]; 2833 | app.Label_ideabs_Fre.Position = [13 116 80 50]; 2834 | app.Label_ideabs_Fre.Text = {'截止频率:'}; 2835 | % Create EditField_ideabs_Fre 2836 | app.EditField_ideabs_Fre = uieditfield(app.uibuttongroup8, 'numeric'); 2837 | app.EditField_ideabs_Fre.ValueChangedFcn = createCallbackFcn(app, @EditField_ideabs_FreChanged, true); 2838 | app.EditField_ideabs_Fre.Position = [75 130 40 19]; 2839 | app.EditField_ideabs_Fre.Value =50; 2840 | % Create Label_ideabs_w 2841 | app.Label_ideabs_w = uilabel(app.uibuttongroup8); 2842 | app.Label_ideabs_w.FontSize = 12; 2843 | app.Label_ideabs_w.FontWeight = 'bold'; 2844 | app.Label_ideabs_w.FontColor = [1 0 0]; 2845 | app.Label_ideabs_w.Position = [13 95 80 50]; 2846 | app.Label_ideabs_w.Text = {'阻带带宽:'}; 2847 | % Create EditField_ideabs_w 2848 | app.EditField_ideabs_w = uieditfield(app.uibuttongroup8, 'numeric'); 2849 | app.EditField_ideabs_w.ValueChangedFcn = createCallbackFcn(app, @EditField_ideabs_wChanged, true); 2850 | app.EditField_ideabs_w.Position = [75 110 40 19]; 2851 | app.EditField_ideabs_w.Value =30; 2852 | 2853 | %巴特沃斯滤波器 2854 | %% 2855 | % Create Label_butterOrder 2856 | app.Label_butterOrder = uilabel(app.uibuttongroup8); 2857 | app.Label_butterOrder.FontSize = 12; 2858 | app.Label_butterOrder.FontWeight = 'bold'; 2859 | app.Label_butterOrder.FontColor = [1 0 0]; 2860 | app.Label_butterOrder.Position = [130 290 80 50]; 2861 | app.Label_butterOrder.Text = {'滤波器阶数:'}; 2862 | % Create EditField_butterOrder 2863 | app.EditField_butterOrder = uieditfield(app.uibuttongroup8, 'numeric'); 2864 | app.EditField_butterOrder.ValueChangedFcn = createCallbackFcn(app, @EditField_butterOrderChanged, true); 2865 | app.EditField_butterOrder.Position = [200 305 40 19]; 2866 | app.EditField_butterOrder.Value =6; 2867 | % Create p31 2868 | app.p31 = uibutton(app.uibuttongroup8, 'push'); 2869 | app.p31.ButtonPushedFcn = createCallbackFcn(app, @p31_Callback, true); 2870 | app.p31.Tag = 'p31'; 2871 | app.p31.FontSize = 16; 2872 | app.p31.Position = [135 253 105 28]; 2873 | app.p31.Text = '巴特沃斯低通滤波'; 2874 | % Create Label_butterlp_Fre 2875 | app.Label_butterlp_Fre = uilabel(app.uibuttongroup8); 2876 | app.Label_butterlp_Fre.FontSize = 14; 2877 | app.Label_butterlp_Fre.FontWeight = 'bold'; 2878 | app.Label_butterlp_Fre.FontColor = [1 0 0]; 2879 | app.Label_butterlp_Fre.Position = [130 270 80 50]; 2880 | app.Label_butterlp_Fre.Text = {'截止频率:'}; 2881 | % Create EditField_butterlp_Fre 2882 | app.EditField_butterlp_Fre = uieditfield(app.uibuttongroup8, 'numeric'); 2883 | app.EditField_butterlp_Fre.ValueChangedFcn = createCallbackFcn(app, @EditField_butterlp_FreChanged, true); 2884 | app.EditField_butterlp_Fre.Position = [200 285 40 19]; 2885 | app.EditField_butterlp_Fre.Value =60; 2886 | % Create p32 2887 | app.p32 = uibutton(app.uibuttongroup8, 'push'); 2888 | app.p32.ButtonPushedFcn = createCallbackFcn(app, @p32_Callback, true); 2889 | app.p32.Tag = 'p32'; 2890 | app.p32.FontSize = 16; 2891 | app.p32.Position = [135 200 105 28]; 2892 | app.p32.Text = '巴特沃斯高通滤波'; 2893 | % Create Label_butterhp_Fre 2894 | app.Label_butterhp_Fre = uilabel(app.uibuttongroup8); 2895 | app.Label_butterhp_Fre.FontSize = 14; 2896 | app.Label_butterhp_Fre.FontWeight = 'bold'; 2897 | app.Label_butterhp_Fre.FontColor = [1 0 0]; 2898 | app.Label_butterhp_Fre.Position = [130 215 80 50]; 2899 | app.Label_butterhp_Fre.Text = {'截止频率:'}; 2900 | % Create EditField_butterhp_Fre 2901 | app.EditField_butterhp_Fre = uieditfield(app.uibuttongroup8, 'numeric'); 2902 | app.EditField_butterhp_Fre.ValueChangedFcn = createCallbackFcn(app, @EditField_butterhp_FreChanged, true); 2903 | app.EditField_butterhp_Fre.Position = [200 230 40 19]; 2904 | app.EditField_butterhp_Fre.Value =30; 2905 | % Create p33 2906 | app.p33 = uibutton(app.uibuttongroup8, 'push'); 2907 | app.p33.ButtonPushedFcn = createCallbackFcn(app, @p33_Callback, true); 2908 | app.p33.Tag = 'p33'; 2909 | app.p33.FontSize = 16; 2910 | app.p33.Position = [135 130 105 28]; 2911 | app.p33.Text = '巴特沃斯带通滤波'; 2912 | % Create Label_butterbp_lFre 2913 | app.Label_butterbp_lFre = uilabel(app.uibuttongroup8); 2914 | app.Label_butterbp_lFre.FontSize = 12; 2915 | app.Label_butterbp_lFre.FontWeight = 'bold'; 2916 | app.Label_butterbp_lFre.FontColor = [1 0 0]; 2917 | app.Label_butterbp_lFre.Position = [125 163 80 50]; 2918 | app.Label_butterbp_lFre.Text = {'下限截止频率:'}; 2919 | % Create EditField_butterbp_lFre 2920 | app.EditField_butterbp_lFre = uieditfield(app.uibuttongroup8, 'numeric'); 2921 | app.EditField_butterbp_lFre.ValueChangedFcn = createCallbackFcn(app, @EditField_butterbp_lFreChanged, true); 2922 | app.EditField_butterbp_lFre.Position = [205 179 40 19]; 2923 | app.EditField_butterbp_lFre.Value =20; 2924 | % Create Label_butterbp_hFre 2925 | app.Label_butterbp_hFre = uilabel(app.uibuttongroup8); 2926 | app.Label_butterbp_hFre.FontSize = 12; 2927 | app.Label_butterbp_hFre.FontWeight = 'bold'; 2928 | app.Label_butterbp_hFre.FontColor = [1 0 0]; 2929 | app.Label_butterbp_hFre.Position = [125 143 80 50]; 2930 | app.Label_butterbp_hFre.Text = {'上限截止频率:'}; 2931 | % Create EditField_butterbp_hFre 2932 | app.EditField_butterbp_hFre = uieditfield(app.uibuttongroup8, 'numeric'); 2933 | app.EditField_butterbp_hFre.ValueChangedFcn = createCallbackFcn(app, @EditField_butterbp_hFreChanged, true); 2934 | app.EditField_butterbp_hFre.Position = [205 159 40 19]; 2935 | app.EditField_butterbp_hFre.Value =80; 2936 | % Create p34 2937 | app.p34 = uibutton(app.uibuttongroup8, 'push'); 2938 | app.p34.ButtonPushedFcn = createCallbackFcn(app, @p34_Callback, true); 2939 | app.p34.Tag = 'p34'; 2940 | app.p34.FontSize = 16; 2941 | app.p34.Position = [135 60 105 28]; 2942 | app.p34.Text = '巴特沃斯带阻滤波'; 2943 | % Create Label_butterbs_Fre 2944 | app.Label_butterbs_Fre = uilabel(app.uibuttongroup8); 2945 | app.Label_butterbs_Fre.FontSize = 12; 2946 | app.Label_butterbs_Fre.FontWeight = 'bold'; 2947 | app.Label_butterbs_Fre.FontColor = [1 0 0]; 2948 | app.Label_butterbs_Fre.Position = [135 95 80 50]; 2949 | app.Label_butterbs_Fre.Text = {'截止频率:'}; 2950 | % Create EditField_butterbs_Fre 2951 | app.EditField_butterbs_Fre = uieditfield(app.uibuttongroup8, 'numeric'); 2952 | app.EditField_butterbs_Fre.ValueChangedFcn = createCallbackFcn(app, @EditField_butterbs_FreChanged, true); 2953 | app.EditField_butterbs_Fre.Position = [200 110 40 19]; 2954 | app.EditField_butterbs_Fre.Value =50; 2955 | % Create Label_butterbs_w 2956 | app.Label_butterbs_w = uilabel(app.uibuttongroup8); 2957 | app.Label_butterbs_w.FontSize = 12; 2958 | app.Label_butterbs_w.FontWeight = 'bold'; 2959 | app.Label_butterbs_w.FontColor = [1 0 0]; 2960 | app.Label_butterbs_w.Position = [135 74 80 50]; 2961 | app.Label_butterbs_w.Text = {'阻带带宽:'}; 2962 | % Create EditField_butterbs_w 2963 | app.EditField_butterbs_w = uieditfield(app.uibuttongroup8, 'numeric'); 2964 | app.EditField_butterbs_w.ValueChangedFcn = createCallbackFcn(app, @EditField_butterbs_wChanged, true); 2965 | app.EditField_butterbs_w.Position = [200 90 40 19]; 2966 | app.EditField_butterbs_w.Value =30; 2967 | %% 2968 | %高斯滤波器 2969 | % Create f21 2970 | app.f21 = uibutton(app.uibuttongroup8, 'push'); 2971 | app.f21.ButtonPushedFcn = createCallbackFcn(app, @f21_Callback, true); 2972 | app.f21.Tag = 'f21'; 2973 | app.f21.FontSize = 16; 2974 | app.f21.Position = [270 270 105 28]; 2975 | app.f21.Text = '高斯低通滤波'; 2976 | % Create Label_gausslp_Fre 2977 | app.Label_gausslp_Fre = uilabel(app.uibuttongroup8); 2978 | app.Label_gausslp_Fre.FontSize = 14; 2979 | app.Label_gausslp_Fre.FontWeight = 'bold'; 2980 | app.Label_gausslp_Fre.FontColor = [1 0 0]; 2981 | app.Label_gausslp_Fre.Position = [260 290 80 50]; 2982 | app.Label_gausslp_Fre.Text = {'截止频率:'}; 2983 | % Create EditField_gausslp_Fre 2984 | app.EditField_gausslp_Fre = uieditfield(app.uibuttongroup8, 'numeric'); 2985 | app.EditField_gausslp_Fre.ValueChangedFcn = createCallbackFcn(app, @EditField_gausslp_FreChanged, true); 2986 | app.EditField_gausslp_Fre.Position = [330 305 40 19]; 2987 | app.EditField_gausslp_Fre.Value =60; 2988 | % Create f22 2989 | app.f22 = uibutton(app.uibuttongroup8, 'push'); 2990 | app.f22.ButtonPushedFcn = createCallbackFcn(app, @f22_Callback, true); 2991 | app.f22.Tag = 'f22'; 2992 | app.f22.FontSize = 16; 2993 | app.f22.Position = [270 210 105 28]; 2994 | app.f22.Text = '高斯高通滤波'; 2995 | % Create Label_gausshp_Fre 2996 | app.Label_gausshp_Fre = uilabel(app.uibuttongroup8); 2997 | app.Label_gausshp_Fre.FontSize = 14; 2998 | app.Label_gausshp_Fre.FontWeight = 'bold'; 2999 | app.Label_gausshp_Fre.FontColor = [1 0 0]; 3000 | app.Label_gausshp_Fre.Position = [260 240 80 30]; 3001 | app.Label_gausshp_Fre.Text = {'截止频率:'}; 3002 | % Create EditField_gausshp_Fre 3003 | app.EditField_gausshp_Fre = uieditfield(app.uibuttongroup8, 'numeric'); 3004 | app.EditField_gausshp_Fre.ValueChangedFcn = createCallbackFcn(app, @EditField_gausshp_FreChanged, true); 3005 | app.EditField_gausshp_Fre.Position = [330 245 40 19]; 3006 | app.EditField_gausshp_Fre.Value =30; 3007 | % Create f23 3008 | app.f23 = uibutton(app.uibuttongroup8, 'push'); 3009 | app.f23.ButtonPushedFcn = createCallbackFcn(app, @f23_Callback, true); 3010 | app.f23.Tag = 'f23'; 3011 | app.f23.FontSize = 16; 3012 | app.f23.Position = [270 130 105 28]; 3013 | app.f23.Text = '高斯带通滤波'; 3014 | % Create Label_gaussbp_lFre 3015 | app.Label_gaussbp_lFre = uilabel(app.uibuttongroup8); 3016 | app.Label_gaussbp_lFre.FontSize = 12; 3017 | app.Label_gaussbp_lFre.FontWeight = 'bold'; 3018 | app.Label_gaussbp_lFre.FontColor = [1 0 0]; 3019 | app.Label_gaussbp_lFre.Position = [260 185 80 30]; 3020 | app.Label_gaussbp_lFre.Text = {'下限截止频率:'}; 3021 | % Create EditField_gaussbp_lFre 3022 | app.EditField_gaussbp_lFre = uieditfield(app.uibuttongroup8, 'numeric'); 3023 | app.EditField_gaussbp_lFre.ValueChangedFcn = createCallbackFcn(app, @EditField_gaussbp_lFreChanged, true); 3024 | app.EditField_gaussbp_lFre.Position = [340 190 40 19]; 3025 | app.EditField_gaussbp_lFre.Value =20; 3026 | % Create Label_gaussbp_hFre 3027 | app.Label_gaussbp_hFre = uilabel(app.uibuttongroup8); 3028 | app.Label_gaussbp_hFre.FontSize = 12; 3029 | app.Label_gaussbp_hFre.FontWeight = 'bold'; 3030 | app.Label_gaussbp_hFre.FontColor = [1 0 0]; 3031 | app.Label_gaussbp_hFre.Position = [260 160 80 30]; 3032 | app.Label_gaussbp_hFre.Text = {'上限截止频率:'}; 3033 | % Create EditField_gaussbp_hFre 3034 | app.EditField_gaussbp_hFre = uieditfield(app.uibuttongroup8, 'numeric'); 3035 | app.EditField_gaussbp_hFre.ValueChangedFcn = createCallbackFcn(app, @EditField_gaussbp_hFreChanged, true); 3036 | app.EditField_gaussbp_hFre.Position = [340 165 40 19]; 3037 | app.EditField_gaussbp_hFre.Value =80; 3038 | % Create f24 3039 | app.f24 = uibutton(app.uibuttongroup8, 'push'); 3040 | app.f24.ButtonPushedFcn = createCallbackFcn(app, @f24_Callback, true); 3041 | app.f24.Tag = 'f24'; 3042 | app.f24.FontSize = 16; 3043 | app.f24.Position = [270 60 105 28]; 3044 | app.f24.Text = '高斯带阻滤波'; 3045 | % Create Label_gaussbs_Fre 3046 | app.Label_gaussbs_Fre = uilabel(app.uibuttongroup8); 3047 | app.Label_gaussbs_Fre.FontSize = 12; 3048 | app.Label_gaussbs_Fre.FontWeight = 'bold'; 3049 | app.Label_gaussbs_Fre.FontColor = [1 0 0]; 3050 | app.Label_gaussbs_Fre.Position = [265 105 80 30]; 3051 | app.Label_gaussbs_Fre.Text = {'截止频率:'}; 3052 | % Create EditField_gaussbs_Fre 3053 | app.EditField_gaussbs_Fre = uieditfield(app.uibuttongroup8, 'numeric'); 3054 | app.EditField_gaussbs_Fre.ValueChangedFcn = createCallbackFcn(app, @EditField_gaussbs_FreChanged, true); 3055 | app.EditField_gaussbs_Fre.Position = [330 110 40 19]; 3056 | app.EditField_gaussbs_Fre.Value =50; 3057 | % Create Label_gaussbs_w 3058 | app.Label_gaussbs_w = uilabel(app.uibuttongroup8); 3059 | app.Label_gaussbs_w.FontSize = 12; 3060 | app.Label_gaussbs_w.FontWeight = 'bold'; 3061 | app.Label_gaussbs_w.FontColor = [1 0 0]; 3062 | app.Label_gaussbs_w.Position = [265 84 80 30]; 3063 | app.Label_gaussbs_w.Text = {'阻带带宽:'}; 3064 | % Create EditField_gaussbs_w 3065 | app.EditField_gaussbs_w = uieditfield(app.uibuttongroup8, 'numeric'); 3066 | app.EditField_gaussbs_w.ValueChangedFcn = createCallbackFcn(app, @EditField_butterbs_wChanged, true); 3067 | app.EditField_gaussbs_w.Position = [330 90 40 19]; 3068 | app.EditField_gaussbs_w.Value =30; 3069 | 3070 | % Create p4 3071 | app.p4 = uibutton(app.uibuttongroup8, 'push'); 3072 | app.p4.ButtonPushedFcn = createCallbackFcn(app, @p4_Callback, true); 3073 | app.p4.Tag = 'p4'; 3074 | app.p4.FontSize = 16; 3075 | app.p4.Position = [10 10 110 28]; 3076 | app.p4.Text = 'haar小波去噪'; 3077 | % Create Label_wtThreshold 3078 | app.Label_wtThreshold = uilabel(app.uibuttongroup8); 3079 | app.Label_wtThreshold.FontSize = 13; 3080 | app.Label_wtThreshold.FontWeight = 'bold'; 3081 | app.Label_wtThreshold.FontColor = [1 0 0]; 3082 | app.Label_wtThreshold.Position = [10 45 90 30]; 3083 | app.Label_wtThreshold.Text = {'小波去噪';' 阈值:'}; 3084 | % Create EditField_wtThreshold 3085 | app.EditField_wtThreshold = uieditfield(app.uibuttongroup8, 'numeric'); 3086 | app.EditField_wtThreshold.ValueChangedFcn = createCallbackFcn(app, @EditField_wtThresholdChanged, true); 3087 | app.EditField_wtThreshold.Position = [75 50 40 19]; 3088 | app.EditField_wtThreshold.Value =0.5; 3089 | 3090 | 3091 | app.homefilter = uibuttongroup(app.uibuttongroup8); 3092 | app.homefilter.Position = [128 2 260 55]; 3093 | % Create p5 3094 | app.p5 = uibutton(app.homefilter, 'push'); 3095 | app.p5.ButtonPushedFcn = createCallbackFcn(app, @p5_Callback, true); 3096 | app.p5.Tag = 'p5'; 3097 | app.p5.FontSize = 16; 3098 | app.p5.Position = [135 0 85.3333333333333 28]; 3099 | app.p5.Text = '同态滤波'; 3100 | % Create Label_homeOrder 3101 | app.Label_homeOrder = uilabel(app.homefilter); 3102 | app.Label_homeOrder.FontSize = 14; 3103 | app.Label_homeOrder.FontWeight = 'bold'; 3104 | app.Label_homeOrder.FontColor = [1 0 0]; 3105 | app.Label_homeOrder.Position = [5 25 80 30]; 3106 | app.Label_homeOrder.Text = {'阶数:'}; 3107 | % Create EditField_homeOrder 3108 | app.EditField_homeOrder = uieditfield(app.homefilter, 'numeric'); 3109 | app.EditField_homeOrder.ValueChangedFcn = createCallbackFcn(app, @EditField_homeOrderChanged, true); 3110 | app.EditField_homeOrder.Position = [40 30 40 19]; 3111 | app.EditField_homeOrder.Value =1; 3112 | % Create Label_Fre 3113 | app.Label_Fre = uilabel(app.homefilter); 3114 | app.Label_Fre.FontSize = 12; 3115 | app.Label_Fre.FontWeight = 'bold'; 3116 | app.Label_Fre.FontColor = [1 0 0]; 3117 | app.Label_Fre.Position = [5 1 80 25]; 3118 | app.Label_Fre.Text = {'截止频率:'}; 3119 | % Create EditField_Fre 3120 | app.EditField_Fre = uieditfield(app.homefilter, 'numeric'); 3121 | app.EditField_Fre.ValueChangedFcn = createCallbackFcn(app, @EditField_FreChanged, true); 3122 | app.EditField_Fre.Position = [65 4 40 19]; 3123 | app.EditField_Fre.Value =5; 3124 | % Create Label_hGain 3125 | app.Label_hGain = uilabel(app.homefilter); 3126 | app.Label_hGain.FontSize = 12; 3127 | app.Label_hGain.FontWeight = 'bold'; 3128 | app.Label_hGain.FontColor = [1 0 0]; 3129 | app.Label_hGain.Position = [85 25 80 30]; 3130 | app.Label_hGain.Text = {'高频增益:'}; 3131 | % Create EditField_hGain 3132 | app.EditField_hGain = uieditfield(app.homefilter, 'numeric'); 3133 | app.EditField_hGain.ValueChangedFcn = createCallbackFcn(app, @EditField_hGainChanged, true); 3134 | app.EditField_hGain.Position = [140 30 30 19]; 3135 | app.EditField_hGain.Value =1.1; 3136 | % Create Label_lGain 3137 | app.Label_lGain = uilabel(app.homefilter); 3138 | app.Label_lGain.FontSize = 12; 3139 | app.Label_lGain.FontWeight = 'bold'; 3140 | app.Label_lGain.FontColor = [1 0 0]; 3141 | app.Label_lGain.Position = [173 15 80 50]; 3142 | app.Label_lGain.Text = {'低频增益:'}; 3143 | % Create EditField_lGain 3144 | app.EditField_lGain = uieditfield(app.homefilter, 'numeric'); 3145 | app.EditField_lGain.ValueChangedFcn = createCallbackFcn(app, @EditField_lGainChanged, true); 3146 | app.EditField_lGain.Position = [225 30 30 19]; 3147 | app.EditField_lGain.Value =0.1; 3148 | catch 3149 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 3150 | end 3151 | % Create uibuttongroup9 空域滤波 3152 | try 3153 | 3154 | app.uibuttongroup9 = uibuttongroup(app.figure); 3155 | app.uibuttongroup9.Title = '空间滤波器/去噪'; 3156 | app.uibuttongroup9.Tag = 'uibuttongroup2'; 3157 | app.uibuttongroup9.FontName = 'Microsoft YaHei UI'; 3158 | app.uibuttongroup9.FontSize = 16; 3159 | app.uibuttongroup9.Position = [580 5 158 390]; 3160 | 3161 | % Create Label 3162 | app.Label_Avg = uilabel(app.uibuttongroup9); 3163 | app.Label_Avg.FontWeight = 'bold'; 3164 | app.Label_Avg.FontSize = 16; 3165 | app.Label_Avg.FontColor = [0.976 0.549 0.223]; % 鲜艳橙色 3166 | app.Label_Avg.Position = [7 335 200 40]; 3167 | app.Label_Avg.Text = {'均值滤波方式:'}; 3168 | 3169 | % Create f1_1 3170 | app.f1_1 = uibutton(app.uibuttongroup9, 'push'); 3171 | app.f1_1.ButtonPushedFcn = createCallbackFcn(app, @f1_1_Callback, true); 3172 | app.f1_1.Tag = 'f1_1'; 3173 | app.f1_1.FontName = 'Microsoft JhengHei'; 3174 | app.f1_1.FontSize = 13; 3175 | app.f1_1.Position = [30 300 100 25]; 3176 | app.f1_1.Text = 'replicate'; 3177 | % Create f1_2 3178 | app.f1_2 = uibutton(app.uibuttongroup9, 'push'); 3179 | app.f1_2.ButtonPushedFcn = createCallbackFcn(app, @f1_2_Callback, true); 3180 | app.f1_2.Tag = 'f1_2'; 3181 | app.f1_2.FontName = 'Microsoft JhengHei'; 3182 | app.f1_2.FontSize = 13; 3183 | app.f1_2.Position = [30 275 100 25]; 3184 | app.f1_2.Text = 'symmetric'; 3185 | % Create f1_3 3186 | app.f1_3 = uibutton(app.uibuttongroup9, 'push'); 3187 | app.f1_3.ButtonPushedFcn = createCallbackFcn(app, @f1_3_Callback, true); 3188 | app.f1_3.Tag = 'f1_3'; 3189 | app.f1_3.FontName = 'Microsoft JhengHei'; 3190 | app.f1_3.FontSize = 13; 3191 | app.f1_3.Position = [30 250 100 25]; 3192 | app.f1_3.Text = 'circular'; 3193 | % Create Label_MeanFilter 3194 | app.Label_MeanFilter = uilabel(app.uibuttongroup9); 3195 | app.Label_MeanFilter.FontSize = 13; 3196 | app.Label_MeanFilter.FontWeight = 'bold'; 3197 | app.Label_MeanFilter.FontColor = [1 0 0]; 3198 | app.Label_MeanFilter.Position = [15 325 80 30]; 3199 | app.Label_MeanFilter.Text = {'领域大小:'}; 3200 | % Create EditField_MeanFilter 3201 | app.EditField_MeanFilter = uieditfield(app.uibuttongroup9, 'numeric'); 3202 | app.EditField_MeanFilter.ValueChangedFcn = createCallbackFcn(app, @EditField_MeanFilterChanged, true); 3203 | app.EditField_MeanFilter.Position = [90 328 40 19]; 3204 | app.EditField_MeanFilter.Value =6; 3205 | 3206 | % Create f3 3207 | app.f3 = uibutton(app.uibuttongroup9, 'push'); 3208 | app.f3.ButtonPushedFcn = createCallbackFcn(app, @f3_Callback, true); 3209 | app.f3.Tag = 'f3'; 3210 | app.f3.FontSize = 18; 3211 | app.f3.Position = [30 198 100 30]; 3212 | app.f3.Text = '中值滤波'; 3213 | % Create Label_MedianFilter 3214 | app.Label_MedianFilter = uilabel(app.uibuttongroup9); 3215 | app.Label_MedianFilter.FontSize = 13; 3216 | app.Label_MedianFilter.FontWeight = 'bold'; 3217 | app.Label_MedianFilter.FontColor = [1 0 0]; 3218 | app.Label_MedianFilter.Position = [15 225 80 30]; 3219 | app.Label_MedianFilter.Text = {'领域大小:'}; 3220 | % Create EditField_MedianFilter 3221 | app.EditField_MedianFilter = uieditfield(app.uibuttongroup9, 'numeric'); 3222 | app.EditField_MedianFilter.ValueChangedFcn = createCallbackFcn(app, @EditField_MedianFilterChanged, true); 3223 | app.EditField_MedianFilter.Position = [90 230 40 19]; 3224 | app.EditField_MedianFilter.Value =3; 3225 | 3226 | % Create f4 3227 | app.f4 = uibutton(app.uibuttongroup9, 'push'); 3228 | app.f4.ButtonPushedFcn = createCallbackFcn(app, @f4_Callback, true); 3229 | app.f4.Tag = 'f4'; 3230 | app.f4.FontSize = 18; 3231 | app.f4.Position = [10 35 140 30]; 3232 | app.f4.Text = '非局部均值去噪'; 3233 | % Create Label_nlmeansH 3234 | app.Label_nlmeansH = uilabel(app.uibuttongroup9); 3235 | app.Label_nlmeansH.FontSize = 12; 3236 | app.Label_nlmeansH.FontWeight = 'bold'; 3237 | app.Label_nlmeansH.FontColor = [1 0 0]; 3238 | app.Label_nlmeansH.Position = [10 90 80 30]; 3239 | app.Label_nlmeansH.Text = {'平滑参数:'}; 3240 | % Create EditField_nlmeansH 3241 | app.EditField_nlmeansH = uieditfield(app.uibuttongroup9, 'numeric'); 3242 | app.EditField_nlmeansH.ValueChangedFcn = createCallbackFcn(app, @EditField_nlmeansHChanged, true); 3243 | app.EditField_nlmeansH.Position = [90 100 40 16]; 3244 | app.EditField_nlmeansH.Value =2; 3245 | % Create Label_patchSize 3246 | app.Label_patchSize = uilabel(app.uibuttongroup9); 3247 | app.Label_patchSize.FontSize = 12; 3248 | app.Label_patchSize.FontWeight = 'bold'; 3249 | app.Label_patchSize.FontColor = [1 0 0]; 3250 | app.Label_patchSize.Position = [10 75 80 30]; 3251 | app.Label_patchSize.Text = {'块大小:'}; 3252 | % Create EditField_patchSize 3253 | app.EditField_patchSize = uieditfield(app.uibuttongroup9, 'numeric'); 3254 | app.EditField_patchSize.ValueChangedFcn = createCallbackFcn(app, @EditField_patchSizeChanged, true); 3255 | app.EditField_patchSize.Position = [90 83 40 16]; 3256 | app.EditField_patchSize.Value =5; 3257 | % Create Label_searchWindowSize 3258 | app.Label_searchWindowSize = uilabel(app.uibuttongroup9); 3259 | app.Label_searchWindowSize.FontSize = 12; 3260 | app.Label_searchWindowSize.FontWeight = 'bold'; 3261 | app.Label_searchWindowSize.FontColor = [1 0 0]; 3262 | app.Label_searchWindowSize.Position = [10 60 80 30]; 3263 | app.Label_searchWindowSize.Text = {'搜索窗口大小:'}; 3264 | % Create EditField_searchWindowSize 3265 | app.EditField_searchWindowSize = uieditfield(app.uibuttongroup9, 'numeric'); 3266 | app.EditField_searchWindowSize.ValueChangedFcn = createCallbackFcn(app, @EditField_searchWindowSizeChanged, true); 3267 | app.EditField_searchWindowSize.Position = [90 66 40 16]; 3268 | app.EditField_searchWindowSize.Value =10; 3269 | 3270 | %总变差去噪 3271 | % Create f5 3272 | app.f5 = uibutton(app.uibuttongroup9, 'push'); 3273 | app.f5.ButtonPushedFcn = createCallbackFcn(app, @f5_Callback, true); 3274 | app.f5.Tag = 'f5'; 3275 | app.f5.FontSize = 18; 3276 | app.f5.Position = [30 117 100 30]; 3277 | app.f5.Text = '总变差去噪'; 3278 | % Create Label_lambda 3279 | app.Label_lambda = uilabel(app.uibuttongroup9); 3280 | app.Label_lambda.FontSize = 12; 3281 | app.Label_lambda.FontWeight = 'bold'; 3282 | app.Label_lambda.FontColor = [1 0 0]; 3283 | app.Label_lambda.Position = [10 175 80 30]; 3284 | app.Label_lambda.Text = {'正则化参数:'}; 3285 | % Create EditField_lambda 3286 | app.EditField_lambda = uieditfield(app.uibuttongroup9, 'numeric'); 3287 | app.EditField_lambda.ValueChangedFcn = createCallbackFcn(app, @EditField_lambdaChanged, true); 3288 | app.EditField_lambda.Position = [90 181 40 16]; 3289 | app.EditField_lambda.Value =0.1; 3290 | % Create Label_numIterations 3291 | app.Label_numIterations = uilabel(app.uibuttongroup9); 3292 | app.Label_numIterations.FontSize = 12; 3293 | app.Label_numIterations.FontWeight = 'bold'; 3294 | app.Label_numIterations.FontColor = [1 0 0]; 3295 | app.Label_numIterations.Position = [10 158 80 30]; 3296 | app.Label_numIterations.Text = {'迭代次数:'}; 3297 | % Create EditField_numIterations 3298 | app.EditField_numIterations = uieditfield(app.uibuttongroup9, 'numeric'); 3299 | app.EditField_numIterations.ValueChangedFcn = createCallbackFcn(app, @EditField_numIterationsChanged, true); 3300 | app.EditField_numIterations.Position = [90 164 40 16]; 3301 | app.EditField_numIterations.Value =30; 3302 | % Create Label_deltaT 3303 | app.Label_deltaT = uilabel(app.uibuttongroup9); 3304 | app.Label_deltaT.FontSize = 12; 3305 | app.Label_deltaT.FontWeight = 'bold'; 3306 | app.Label_deltaT.FontColor = [1 0 0]; 3307 | app.Label_deltaT.Position = [10 142 80 30]; 3308 | app.Label_deltaT.Text = {'时间步长:'}; 3309 | % Create EditField_deltaT 3310 | app.EditField_deltaT = uieditfield(app.uibuttongroup9, 'numeric'); 3311 | app.EditField_deltaT.ValueChangedFcn = createCallbackFcn(app, @EditField_deltaTChanged, true); 3312 | app.EditField_deltaT.Position = [90 147 40 16]; 3313 | app.EditField_deltaT.Value =0.1; 3314 | 3315 | % Create p1 维纳滤波 3316 | app.p1 = uibutton(app.uibuttongroup9, 'push'); 3317 | app.p1.ButtonPushedFcn = createCallbackFcn(app, @p1_Callback, true); 3318 | app.p1.Tag = 'p1'; 3319 | app.p1.FontSize = 18; 3320 | app.p1.Position = [30 3 100 30]; 3321 | app.p1.Text = '维纳滤波'; 3322 | 3323 | catch 3324 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 3325 | end 3326 | % Create uibuttongroup10 噪声添加 3327 | try 3328 | app.uibuttongroup10 = uibuttongroup(app.figure); 3329 | app.uibuttongroup10.Title = '添加噪声'; 3330 | app.uibuttongroup10.Tag = 'uibuttongroup10'; 3331 | app.uibuttongroup10.FontName = 'Microsoft YaHei UI'; 3332 | app.uibuttongroup10.FontSize = 16; 3333 | app.uibuttongroup10.Position = [10 5 170 380]; 3334 | 3335 | % Create n1 3336 | app.n1 = uibutton(app.uibuttongroup10, 'push'); 3337 | app.n1.ButtonPushedFcn = createCallbackFcn(app, @n1_Callback, true); 3338 | app.n1.Tag = 'n1'; 3339 | app.n1.FontSize = 18; 3340 | app.n1.Position = [30,268,100,28]; 3341 | app.n1.Text = '高斯白噪声'; 3342 | 3343 | % Create Label_MEAN 3344 | app.Label_MEAN = uilabel(app.uibuttongroup10); 3345 | app.Label_MEAN.FontSize = 14; 3346 | app.Label_MEAN.FontWeight = 'bold'; 3347 | app.Label_MEAN.FontColor = [1 0 0]; 3348 | app.Label_MEAN.Position = [4,300,80,30]; 3349 | app.Label_MEAN.Text = {'均值:'}; 3350 | 3351 | % Create Label_VAR 3352 | app.Label_VAR = uilabel(app.uibuttongroup10); 3353 | app.Label_VAR.FontSize = 14; 3354 | app.Label_VAR.FontWeight = 'bold'; 3355 | app.Label_VAR.FontColor = [1 0 0]; 3356 | app.Label_VAR.Position = [88 300 80 30]; 3357 | app.Label_VAR.Text = {'方差:'}; 3358 | 3359 | % Create EditField_MEAN 3360 | app.EditField_MEAN = uieditfield(app.uibuttongroup10, 'numeric'); 3361 | app.EditField_MEAN.ValueChangedFcn = createCallbackFcn(app, @EditField_MEANChanged, true); 3362 | app.EditField_MEAN.Position = [40, 305,40,19]; 3363 | app.EditField_MEAN.Value =0; 3364 | 3365 | % Create EditField_VAR 3366 | app.EditField_VAR = uieditfield(app.uibuttongroup10, 'numeric'); 3367 | app.EditField_VAR.ValueChangedFcn = createCallbackFcn(app, @EditField_VARChanged, true); 3368 | app.EditField_VAR.Position = [124, 305,40,19]; 3369 | app.EditField_VAR.Value = 0.05; 3370 | 3371 | % Create n2 3372 | app.n2 = uibutton(app.uibuttongroup10, 'push'); 3373 | app.n2.ButtonPushedFcn = createCallbackFcn(app, @n2_Callback, true); 3374 | app.n2.Tag = 'n2'; 3375 | app.n2.FontSize = 18; 3376 | app.n2.Position = [40,230,85,28]; 3377 | app.n2.Text = '泊松噪波'; 3378 | 3379 | % Create n3 3380 | app.n3 = uibutton(app.uibuttongroup10, 'push'); 3381 | app.n3.ButtonPushedFcn = createCallbackFcn(app, @n3_Callback, true); 3382 | app.n3.Tag = 'n3'; 3383 | app.n3.FontSize = 18; 3384 | app.n3.Position = [40,170,85,28]; 3385 | app.n3.Text = '椒盐噪波'; 3386 | 3387 | % Create Label_DENSITY 3388 | app.Label_DENSITY = uilabel(app.uibuttongroup10); 3389 | app.Label_DENSITY.FontSize = 14; 3390 | app.Label_DENSITY.FontWeight = 'bold'; 3391 | app.Label_DENSITY.FontColor = [1 0 0]; 3392 | app.Label_DENSITY.Position = [8 200 90 30]; 3393 | app.Label_DENSITY.Text = {'椒盐噪声密度:'}; 3394 | 3395 | % Create EditField_DENSITY 3396 | app.EditField_DENSITY = uieditfield(app.uibuttongroup10, 'numeric'); 3397 | app.EditField_DENSITY.ValueChangedFcn = createCallbackFcn(app, @EditField_DENSITYChanged, true); 3398 | app.EditField_DENSITY.Position = [100 206 40 19]; 3399 | app.EditField_DENSITY.Value =0.1; 3400 | 3401 | % Create n4 3402 | app.n4 = uibutton(app.uibuttongroup10, 'push'); 3403 | app.n4.ButtonPushedFcn = createCallbackFcn(app, @n4_Callback, true); 3404 | app.n4.Tag = 'n4'; 3405 | app.n4.FontSize = 18; 3406 | app.n4.Position = [40,116,90,28]; 3407 | app.n4.Text = '斑点噪波'; 3408 | 3409 | % Create Label_SPEVAR speckle_variance 斑点噪声方差 3410 | app.Label_SPEVAR= uilabel(app.uibuttongroup10); 3411 | app.Label_SPEVAR.FontSize = 14; 3412 | app.Label_SPEVAR.FontWeight = 'bold'; 3413 | app.Label_SPEVAR.FontColor = [1 0 0]; 3414 | app.Label_SPEVAR.Position = [7 143 99 30]; 3415 | app.Label_SPEVAR.Text = {'斑点噪声方差: '}; 3416 | 3417 | % Create EditField_SPEVAR 3418 | app.EditField_SPEVAR = uieditfield(app.uibuttongroup10, 'numeric'); 3419 | app.EditField_SPEVAR.ValueChangedFcn = createCallbackFcn(app, @EditField_SPEVARChanged, true); 3420 | app.EditField_SPEVAR.Position = [100 148 40 19]; 3421 | app.EditField_SPEVAR.Value =0.04; 3422 | 3423 | % Create n5 3424 | app.n5 = uibutton(app.uibuttongroup10, 'push'); 3425 | app.n5.ButtonPushedFcn = createCallbackFcn(app, @n5_Callback, true); 3426 | app.n5.Tag = 'n5'; 3427 | app.n5.FontSize = 18; 3428 | app.n5.Position = [25, 10,120, 30]; 3429 | app.n5.Text = '添加运动噪波'; 3430 | 3431 | % Create Label_LEN 3432 | app.Label_LEN = uilabel(app.uibuttongroup10); 3433 | app.Label_LEN.FontSize = 14; 3434 | app.Label_LEN.FontWeight = 'bold'; 3435 | app.Label_LEN.FontColor = [1 0 0]; 3436 | app.Label_LEN.Position = [18,70,80,50]; 3437 | app.Label_LEN.Text = {'线性运动'; '长度:'; ''}; 3438 | 3439 | % Create Label_THETA 3440 | app.Label_THETA = uilabel(app.uibuttongroup10); 3441 | app.Label_THETA.FontSize = 14; 3442 | app.Label_THETA.FontWeight = 'bold'; 3443 | app.Label_THETA.FontColor = [1 0 0]; 3444 | app.Label_THETA.Position = [86 70 80 50]; 3445 | app.Label_THETA.Text = {'线性运动'; '方向角度:'}; 3446 | 3447 | % Create EditField 3448 | app.EditField_LEN = uieditfield(app.uibuttongroup10, 'numeric'); 3449 | app.EditField_LEN.ValueChangedFcn = createCallbackFcn(app, @EditField_LENChanged, true); 3450 | app.EditField_LEN.Position = [18,50,43,19]; 3451 | app.EditField_LEN.Value = 20; 3452 | 3453 | % Create EditField 3454 | app.EditField_THETA = uieditfield(app.uibuttongroup10, 'numeric'); 3455 | app.EditField_THETA.ValueChangedFcn = createCallbackFcn(app, @EditField_THETAChanged, true); 3456 | app.EditField_THETA.Position = [93,50,43,19]; 3457 | app.EditField_THETA.Value = 10; 3458 | 3459 | catch 3460 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 3461 | end 3462 | % Create uibuttongroup11 效果图片显示 3463 | try 3464 | app.uibuttongroup11 = uibuttongroup(app.figure); 3465 | app.uibuttongroup11.Title = '效果图片的变换波形显示 (FT,DCT,DWT)'; 3466 | app.uibuttongroup11.Tag = 'uibuttongroup11'; 3467 | app.uibuttongroup11.FontName = 'Microsoft YaHei UI'; 3468 | app.uibuttongroup11.FontSize = 24; 3469 | app.uibuttongroup11.Position = [950 5 660 830]; 3470 | 3471 | 3472 | % Create g1 图像RGB颜色分解或者灰度直方图分解 3473 | app.g1 = uiaxes(app.uibuttongroup11); 3474 | app.g1.FontName = 'Microsoft YaHei UI'; 3475 | app.g1.Colormap = [0.2431 0.149 0.6588;0.2431 0.1529 0.6745;0.2471 0.1569 0.6863;0.2471 0.1608 0.698;0.251 0.1647 0.7059;0.251 0.1686 0.7176;0.2549 0.1725 0.7294;0.2549 0.1765 0.7412;0.2588 0.1804 0.749;0.2588 0.1843 0.7608;0.2627 0.1922 0.7843;0.2627 0.1961 0.7922;0.2667 0.2 0.8039;0.2667 0.2039 0.8157;0.2706 0.2078 0.8235;0.2706 0.2157 0.8353;0.2706 0.2196 0.8431;0.2745 0.2235 0.851;0.2745 0.2275 0.8627;0.2745 0.2314 0.8706;0.2745 0.2392 0.8784;0.2784 0.2431 0.8824;0.2784 0.2471 0.8902;0.2784 0.2549 0.898;0.2784 0.2588 0.902;0.2784 0.2667 0.9098;0.2784 0.2706 0.9137;0.2784 0.2745 0.9216;0.2824 0.2824 0.9255;0.2824 0.2863 0.9294;0.2824 0.2941 0.9333;0.2824 0.298 0.9412;0.2824 0.3059 0.9451;0.2824 0.3098 0.949;0.2824 0.3137 0.9529;0.2824 0.3216 0.9569;0.2824 0.3255 0.9608;0.2824 0.3294 0.9647;0.2784 0.3373 0.9686;0.2784 0.3412 0.9686;0.2784 0.349 0.9725;0.2784 0.3529 0.9765;0.2784 0.3569 0.9804;0.2784 0.3647 0.9804;0.2745 0.3686 0.9843;0.2745 0.3765 0.9843;0.2745 0.3804 0.9882;0.2706 0.3843 0.9882;0.2706 0.3922 0.9922;0.2667 0.3961 0.9922;0.2627 0.4039 0.9922;0.2627 0.4078 0.9961;0.2588 0.4157 0.9961;0.2549 0.4196 0.9961;0.251 0.4275 0.9961;0.2471 0.4314 1;0.2431 0.4392 1;0.2353 0.4431 1;0.2314 0.451 1;0.2235 0.4549 1;0.2196 0.4627 0.9961;0.2118 0.4667 0.9961;0.2078 0.4745 0.9922;0.2 0.4784 0.9922;0.1961 0.4863 0.9882;0.1922 0.4902 0.9882;0.1882 0.498 0.9843;0.1843 0.502 0.9804;0.1843 0.5098 0.9804;0.1804 0.5137 0.9765;0.1804 0.5176 0.9725;0.1804 0.5255 0.9725;0.1804 0.5294 0.9686;0.1765 0.5333 0.9647;0.1765 0.5412 0.9608;0.1765 0.5451 0.9569;0.1765 0.549 0.9529;0.1765 0.5569 0.949;0.1725 0.5608 0.9451;0.1725 0.5647 0.9412;0.1686 0.5686 0.9373;0.1647 0.5765 0.9333;0.1608 0.5804 0.9294;0.1569 0.5843 0.9255;0.1529 0.5922 0.9216;0.1529 0.5961 0.9176;0.149 0.6 0.9137;0.149 0.6039 0.9098;0.1451 0.6078 0.9098;0.1451 0.6118 0.9059;0.1412 0.6196 0.902;0.1412 0.6235 0.898;0.1373 0.6275 0.898;0.1373 0.6314 0.8941;0.1333 0.6353 0.8941;0.1294 0.6392 0.8902;0.1255 0.6471 0.8902;0.1216 0.651 0.8863;0.1176 0.6549 0.8824;0.1137 0.6588 0.8824;0.1137 0.6627 0.8784;0.1098 0.6667 0.8745;0.1059 0.6706 0.8706;0.102 0.6745 0.8667;0.098 0.6784 0.8627;0.0902 0.6824 0.8549;0.0863 0.6863 0.851;0.0784 0.6902 0.8471;0.0706 0.6941 0.8392;0.0627 0.698 0.8353;0.0549 0.702 0.8314;0.0431 0.702 0.8235;0.0314 0.7059 0.8196;0.0235 0.7098 0.8118;0.0157 0.7137 0.8078;0.0078 0.7176 0.8;0.0039 0.7176 0.7922;0 0.7216 0.7882;0 0.7255 0.7804;0 0.7294 0.7765;0.0039 0.7294 0.7686;0.0078 0.7333 0.7608;0.0157 0.7333 0.7569;0.0235 0.7373 0.749;0.0353 0.7412 0.7412;0.051 0.7412 0.7373;0.0627 0.7451 0.7294;0.0784 0.7451 0.7216;0.0902 0.749 0.7137;0.102 0.7529 0.7098;0.1137 0.7529 0.702;0.1255 0.7569 0.6941;0.1373 0.7569 0.6863;0.1451 0.7608 0.6824;0.1529 0.7608 0.6745;0.1608 0.7647 0.6667;0.1686 0.7647 0.6588;0.1725 0.7686 0.651;0.1804 0.7686 0.6471;0.1843 0.7725 0.6392;0.1922 0.7725 0.6314;0.1961 0.7765 0.6235;0.2 0.7804 0.6157;0.2078 0.7804 0.6078;0.2118 0.7843 0.6;0.2196 0.7843 0.5882;0.2235 0.7882 0.5804;0.2314 0.7882 0.5725;0.2392 0.7922 0.5647;0.251 0.7922 0.5529;0.2588 0.7922 0.5451;0.2706 0.7961 0.5373;0.2824 0.7961 0.5255;0.2941 0.7961 0.5176;0.3059 0.8 0.5059;0.3176 0.8 0.498;0.3294 0.8 0.4863;0.3412 0.8 0.4784;0.3529 0.8 0.4667;0.3686 0.8039 0.4549;0.3804 0.8039 0.4471;0.3922 0.8039 0.4353;0.4039 0.8039 0.4235;0.4196 0.8039 0.4118;0.4314 0.8039 0.4;0.4471 0.8039 0.3922;0.4627 0.8 0.3804;0.4745 0.8 0.3686;0.4902 0.8 0.3569;0.5059 0.8 0.349;0.5176 0.8 0.3373;0.5333 0.7961 0.3255;0.5451 0.7961 0.3176;0.5608 0.7961 0.3059;0.5765 0.7922 0.2941;0.5882 0.7922 0.2824;0.6039 0.7882 0.2745;0.6157 0.7882 0.2627;0.6314 0.7843 0.251;0.6431 0.7843 0.2431;0.6549 0.7804 0.2314;0.6706 0.7804 0.2235;0.6824 0.7765 0.2157;0.698 0.7765 0.2078;0.7098 0.7725 0.2;0.7216 0.7686 0.1922;0.7333 0.7686 0.1843;0.7451 0.7647 0.1765;0.7608 0.7647 0.1725;0.7725 0.7608 0.1647;0.7843 0.7569 0.1608;0.7961 0.7569 0.1569;0.8078 0.7529 0.1529;0.8157 0.749 0.1529;0.8275 0.749 0.1529;0.8392 0.7451 0.1529;0.851 0.7451 0.1569;0.8588 0.7412 0.1569;0.8706 0.7373 0.1608;0.8824 0.7373 0.1647;0.8902 0.7373 0.1686;0.902 0.7333 0.1765;0.9098 0.7333 0.1804;0.9176 0.7294 0.1882;0.9255 0.7294 0.1961;0.9373 0.7294 0.2078;0.9451 0.7294 0.2157;0.9529 0.7294 0.2235;0.9608 0.7294 0.2314;0.9686 0.7294 0.2392;0.9765 0.7294 0.2431;0.9843 0.7333 0.2431;0.9882 0.7373 0.2431;0.9961 0.7412 0.2392;0.9961 0.7451 0.2353;0.9961 0.7529 0.2314;0.9961 0.7569 0.2275;0.9961 0.7608 0.2235;0.9961 0.7686 0.2196;0.9961 0.7725 0.2157;0.9961 0.7804 0.2078;0.9961 0.7843 0.2039;0.9961 0.7922 0.2;0.9922 0.7961 0.1961;0.9922 0.8039 0.1922;0.9922 0.8078 0.1922;0.9882 0.8157 0.1882;0.9843 0.8235 0.1843;0.9843 0.8275 0.1804;0.9804 0.8353 0.1804;0.9765 0.8392 0.1765;0.9765 0.8471 0.1725;0.9725 0.851 0.1686;0.9686 0.8588 0.1647;0.9686 0.8667 0.1647;0.9647 0.8706 0.1608;0.9647 0.8784 0.1569;0.9608 0.8824 0.1569;0.9608 0.8902 0.1529;0.9608 0.898 0.149;0.9608 0.902 0.149;0.9608 0.9098 0.1451;0.9608 0.9137 0.1412;0.9608 0.9216 0.1373;0.9608 0.9255 0.1333;0.9608 0.9333 0.1294;0.9647 0.9373 0.1255;0.9647 0.9451 0.1216;0.9647 0.949 0.1176;0.9686 0.9569 0.1098;0.9686 0.9608 0.1059;0.9725 0.9686 0.102;0.9725 0.9725 0.0941;0.9765 0.9765 0.0863;0.9765 0.9843 0.0824]; 3476 | app.g1.FontSize = 11.3333333333333; 3477 | app.g1.NextPlot = 'replace'; 3478 | app.g1.Tag = 'g1'; 3479 | app.g1.Position = [22 490 283 250]; 3480 | 3481 | % Create g2 图像傅里叶变换 3482 | app.g2 = uiaxes(app.uibuttongroup11); 3483 | app.g2.FontName = 'Microsoft YaHei UI'; 3484 | app.g2.Colormap = [0.2431 0.149 0.6588;0.2431 0.1529 0.6745;0.2471 0.1569 0.6863;0.2471 0.1608 0.698;0.251 0.1647 0.7059;0.251 0.1686 0.7176;0.2549 0.1725 0.7294;0.2549 0.1765 0.7412;0.2588 0.1804 0.749;0.2588 0.1843 0.7608;0.2627 0.1922 0.7843;0.2627 0.1961 0.7922;0.2667 0.2 0.8039;0.2667 0.2039 0.8157;0.2706 0.2078 0.8235;0.2706 0.2157 0.8353;0.2706 0.2196 0.8431;0.2745 0.2235 0.851;0.2745 0.2275 0.8627;0.2745 0.2314 0.8706;0.2745 0.2392 0.8784;0.2784 0.2431 0.8824;0.2784 0.2471 0.8902;0.2784 0.2549 0.898;0.2784 0.2588 0.902;0.2784 0.2667 0.9098;0.2784 0.2706 0.9137;0.2784 0.2745 0.9216;0.2824 0.2824 0.9255;0.2824 0.2863 0.9294;0.2824 0.2941 0.9333;0.2824 0.298 0.9412;0.2824 0.3059 0.9451;0.2824 0.3098 0.949;0.2824 0.3137 0.9529;0.2824 0.3216 0.9569;0.2824 0.3255 0.9608;0.2824 0.3294 0.9647;0.2784 0.3373 0.9686;0.2784 0.3412 0.9686;0.2784 0.349 0.9725;0.2784 0.3529 0.9765;0.2784 0.3569 0.9804;0.2784 0.3647 0.9804;0.2745 0.3686 0.9843;0.2745 0.3765 0.9843;0.2745 0.3804 0.9882;0.2706 0.3843 0.9882;0.2706 0.3922 0.9922;0.2667 0.3961 0.9922;0.2627 0.4039 0.9922;0.2627 0.4078 0.9961;0.2588 0.4157 0.9961;0.2549 0.4196 0.9961;0.251 0.4275 0.9961;0.2471 0.4314 1;0.2431 0.4392 1;0.2353 0.4431 1;0.2314 0.451 1;0.2235 0.4549 1;0.2196 0.4627 0.9961;0.2118 0.4667 0.9961;0.2078 0.4745 0.9922;0.2 0.4784 0.9922;0.1961 0.4863 0.9882;0.1922 0.4902 0.9882;0.1882 0.498 0.9843;0.1843 0.502 0.9804;0.1843 0.5098 0.9804;0.1804 0.5137 0.9765;0.1804 0.5176 0.9725;0.1804 0.5255 0.9725;0.1804 0.5294 0.9686;0.1765 0.5333 0.9647;0.1765 0.5412 0.9608;0.1765 0.5451 0.9569;0.1765 0.549 0.9529;0.1765 0.5569 0.949;0.1725 0.5608 0.9451;0.1725 0.5647 0.9412;0.1686 0.5686 0.9373;0.1647 0.5765 0.9333;0.1608 0.5804 0.9294;0.1569 0.5843 0.9255;0.1529 0.5922 0.9216;0.1529 0.5961 0.9176;0.149 0.6 0.9137;0.149 0.6039 0.9098;0.1451 0.6078 0.9098;0.1451 0.6118 0.9059;0.1412 0.6196 0.902;0.1412 0.6235 0.898;0.1373 0.6275 0.898;0.1373 0.6314 0.8941;0.1333 0.6353 0.8941;0.1294 0.6392 0.8902;0.1255 0.6471 0.8902;0.1216 0.651 0.8863;0.1176 0.6549 0.8824;0.1137 0.6588 0.8824;0.1137 0.6627 0.8784;0.1098 0.6667 0.8745;0.1059 0.6706 0.8706;0.102 0.6745 0.8667;0.098 0.6784 0.8627;0.0902 0.6824 0.8549;0.0863 0.6863 0.851;0.0784 0.6902 0.8471;0.0706 0.6941 0.8392;0.0627 0.698 0.8353;0.0549 0.702 0.8314;0.0431 0.702 0.8235;0.0314 0.7059 0.8196;0.0235 0.7098 0.8118;0.0157 0.7137 0.8078;0.0078 0.7176 0.8;0.0039 0.7176 0.7922;0 0.7216 0.7882;0 0.7255 0.7804;0 0.7294 0.7765;0.0039 0.7294 0.7686;0.0078 0.7333 0.7608;0.0157 0.7333 0.7569;0.0235 0.7373 0.749;0.0353 0.7412 0.7412;0.051 0.7412 0.7373;0.0627 0.7451 0.7294;0.0784 0.7451 0.7216;0.0902 0.749 0.7137;0.102 0.7529 0.7098;0.1137 0.7529 0.702;0.1255 0.7569 0.6941;0.1373 0.7569 0.6863;0.1451 0.7608 0.6824;0.1529 0.7608 0.6745;0.1608 0.7647 0.6667;0.1686 0.7647 0.6588;0.1725 0.7686 0.651;0.1804 0.7686 0.6471;0.1843 0.7725 0.6392;0.1922 0.7725 0.6314;0.1961 0.7765 0.6235;0.2 0.7804 0.6157;0.2078 0.7804 0.6078;0.2118 0.7843 0.6;0.2196 0.7843 0.5882;0.2235 0.7882 0.5804;0.2314 0.7882 0.5725;0.2392 0.7922 0.5647;0.251 0.7922 0.5529;0.2588 0.7922 0.5451;0.2706 0.7961 0.5373;0.2824 0.7961 0.5255;0.2941 0.7961 0.5176;0.3059 0.8 0.5059;0.3176 0.8 0.498;0.3294 0.8 0.4863;0.3412 0.8 0.4784;0.3529 0.8 0.4667;0.3686 0.8039 0.4549;0.3804 0.8039 0.4471;0.3922 0.8039 0.4353;0.4039 0.8039 0.4235;0.4196 0.8039 0.4118;0.4314 0.8039 0.4;0.4471 0.8039 0.3922;0.4627 0.8 0.3804;0.4745 0.8 0.3686;0.4902 0.8 0.3569;0.5059 0.8 0.349;0.5176 0.8 0.3373;0.5333 0.7961 0.3255;0.5451 0.7961 0.3176;0.5608 0.7961 0.3059;0.5765 0.7922 0.2941;0.5882 0.7922 0.2824;0.6039 0.7882 0.2745;0.6157 0.7882 0.2627;0.6314 0.7843 0.251;0.6431 0.7843 0.2431;0.6549 0.7804 0.2314;0.6706 0.7804 0.2235;0.6824 0.7765 0.2157;0.698 0.7765 0.2078;0.7098 0.7725 0.2;0.7216 0.7686 0.1922;0.7333 0.7686 0.1843;0.7451 0.7647 0.1765;0.7608 0.7647 0.1725;0.7725 0.7608 0.1647;0.7843 0.7569 0.1608;0.7961 0.7569 0.1569;0.8078 0.7529 0.1529;0.8157 0.749 0.1529;0.8275 0.749 0.1529;0.8392 0.7451 0.1529;0.851 0.7451 0.1569;0.8588 0.7412 0.1569;0.8706 0.7373 0.1608;0.8824 0.7373 0.1647;0.8902 0.7373 0.1686;0.902 0.7333 0.1765;0.9098 0.7333 0.1804;0.9176 0.7294 0.1882;0.9255 0.7294 0.1961;0.9373 0.7294 0.2078;0.9451 0.7294 0.2157;0.9529 0.7294 0.2235;0.9608 0.7294 0.2314;0.9686 0.7294 0.2392;0.9765 0.7294 0.2431;0.9843 0.7333 0.2431;0.9882 0.7373 0.2431;0.9961 0.7412 0.2392;0.9961 0.7451 0.2353;0.9961 0.7529 0.2314;0.9961 0.7569 0.2275;0.9961 0.7608 0.2235;0.9961 0.7686 0.2196;0.9961 0.7725 0.2157;0.9961 0.7804 0.2078;0.9961 0.7843 0.2039;0.9961 0.7922 0.2;0.9922 0.7961 0.1961;0.9922 0.8039 0.1922;0.9922 0.8078 0.1922;0.9882 0.8157 0.1882;0.9843 0.8235 0.1843;0.9843 0.8275 0.1804;0.9804 0.8353 0.1804;0.9765 0.8392 0.1765;0.9765 0.8471 0.1725;0.9725 0.851 0.1686;0.9686 0.8588 0.1647;0.9686 0.8667 0.1647;0.9647 0.8706 0.1608;0.9647 0.8784 0.1569;0.9608 0.8824 0.1569;0.9608 0.8902 0.1529;0.9608 0.898 0.149;0.9608 0.902 0.149;0.9608 0.9098 0.1451;0.9608 0.9137 0.1412;0.9608 0.9216 0.1373;0.9608 0.9255 0.1333;0.9608 0.9333 0.1294;0.9647 0.9373 0.1255;0.9647 0.9451 0.1216;0.9647 0.949 0.1176;0.9686 0.9569 0.1098;0.9686 0.9608 0.1059;0.9725 0.9686 0.102;0.9725 0.9725 0.0941;0.9765 0.9765 0.0863;0.9765 0.9843 0.0824]; 3485 | app.g2.FontSize = 11.3333333333333; 3486 | app.g2.NextPlot = 'replace'; 3487 | app.g2.Tag = 'g2'; 3488 | app.g2.Position = [70 240 283 250]; 3489 | 3490 | % Create g3 DCT变换 3491 | app.g3 = uiaxes(app.uibuttongroup11); 3492 | app.g3.FontName = 'Microsoft YaHei UI'; 3493 | app.g3.Colormap = [0.2431 0.149 0.6588;0.2431 0.1529 0.6745;0.2471 0.1569 0.6863;0.2471 0.1608 0.698;0.251 0.1647 0.7059;0.251 0.1686 0.7176;0.2549 0.1725 0.7294;0.2549 0.1765 0.7412;0.2588 0.1804 0.749;0.2588 0.1843 0.7608;0.2627 0.1922 0.7843;0.2627 0.1961 0.7922;0.2667 0.2 0.8039;0.2667 0.2039 0.8157;0.2706 0.2078 0.8235;0.2706 0.2157 0.8353;0.2706 0.2196 0.8431;0.2745 0.2235 0.851;0.2745 0.2275 0.8627;0.2745 0.2314 0.8706;0.2745 0.2392 0.8784;0.2784 0.2431 0.8824;0.2784 0.2471 0.8902;0.2784 0.2549 0.898;0.2784 0.2588 0.902;0.2784 0.2667 0.9098;0.2784 0.2706 0.9137;0.2784 0.2745 0.9216;0.2824 0.2824 0.9255;0.2824 0.2863 0.9294;0.2824 0.2941 0.9333;0.2824 0.298 0.9412;0.2824 0.3059 0.9451;0.2824 0.3098 0.949;0.2824 0.3137 0.9529;0.2824 0.3216 0.9569;0.2824 0.3255 0.9608;0.2824 0.3294 0.9647;0.2784 0.3373 0.9686;0.2784 0.3412 0.9686;0.2784 0.349 0.9725;0.2784 0.3529 0.9765;0.2784 0.3569 0.9804;0.2784 0.3647 0.9804;0.2745 0.3686 0.9843;0.2745 0.3765 0.9843;0.2745 0.3804 0.9882;0.2706 0.3843 0.9882;0.2706 0.3922 0.9922;0.2667 0.3961 0.9922;0.2627 0.4039 0.9922;0.2627 0.4078 0.9961;0.2588 0.4157 0.9961;0.2549 0.4196 0.9961;0.251 0.4275 0.9961;0.2471 0.4314 1;0.2431 0.4392 1;0.2353 0.4431 1;0.2314 0.451 1;0.2235 0.4549 1;0.2196 0.4627 0.9961;0.2118 0.4667 0.9961;0.2078 0.4745 0.9922;0.2 0.4784 0.9922;0.1961 0.4863 0.9882;0.1922 0.4902 0.9882;0.1882 0.498 0.9843;0.1843 0.502 0.9804;0.1843 0.5098 0.9804;0.1804 0.5137 0.9765;0.1804 0.5176 0.9725;0.1804 0.5255 0.9725;0.1804 0.5294 0.9686;0.1765 0.5333 0.9647;0.1765 0.5412 0.9608;0.1765 0.5451 0.9569;0.1765 0.549 0.9529;0.1765 0.5569 0.949;0.1725 0.5608 0.9451;0.1725 0.5647 0.9412;0.1686 0.5686 0.9373;0.1647 0.5765 0.9333;0.1608 0.5804 0.9294;0.1569 0.5843 0.9255;0.1529 0.5922 0.9216;0.1529 0.5961 0.9176;0.149 0.6 0.9137;0.149 0.6039 0.9098;0.1451 0.6078 0.9098;0.1451 0.6118 0.9059;0.1412 0.6196 0.902;0.1412 0.6235 0.898;0.1373 0.6275 0.898;0.1373 0.6314 0.8941;0.1333 0.6353 0.8941;0.1294 0.6392 0.8902;0.1255 0.6471 0.8902;0.1216 0.651 0.8863;0.1176 0.6549 0.8824;0.1137 0.6588 0.8824;0.1137 0.6627 0.8784;0.1098 0.6667 0.8745;0.1059 0.6706 0.8706;0.102 0.6745 0.8667;0.098 0.6784 0.8627;0.0902 0.6824 0.8549;0.0863 0.6863 0.851;0.0784 0.6902 0.8471;0.0706 0.6941 0.8392;0.0627 0.698 0.8353;0.0549 0.702 0.8314;0.0431 0.702 0.8235;0.0314 0.7059 0.8196;0.0235 0.7098 0.8118;0.0157 0.7137 0.8078;0.0078 0.7176 0.8;0.0039 0.7176 0.7922;0 0.7216 0.7882;0 0.7255 0.7804;0 0.7294 0.7765;0.0039 0.7294 0.7686;0.0078 0.7333 0.7608;0.0157 0.7333 0.7569;0.0235 0.7373 0.749;0.0353 0.7412 0.7412;0.051 0.7412 0.7373;0.0627 0.7451 0.7294;0.0784 0.7451 0.7216;0.0902 0.749 0.7137;0.102 0.7529 0.7098;0.1137 0.7529 0.702;0.1255 0.7569 0.6941;0.1373 0.7569 0.6863;0.1451 0.7608 0.6824;0.1529 0.7608 0.6745;0.1608 0.7647 0.6667;0.1686 0.7647 0.6588;0.1725 0.7686 0.651;0.1804 0.7686 0.6471;0.1843 0.7725 0.6392;0.1922 0.7725 0.6314;0.1961 0.7765 0.6235;0.2 0.7804 0.6157;0.2078 0.7804 0.6078;0.2118 0.7843 0.6;0.2196 0.7843 0.5882;0.2235 0.7882 0.5804;0.2314 0.7882 0.5725;0.2392 0.7922 0.5647;0.251 0.7922 0.5529;0.2588 0.7922 0.5451;0.2706 0.7961 0.5373;0.2824 0.7961 0.5255;0.2941 0.7961 0.5176;0.3059 0.8 0.5059;0.3176 0.8 0.498;0.3294 0.8 0.4863;0.3412 0.8 0.4784;0.3529 0.8 0.4667;0.3686 0.8039 0.4549;0.3804 0.8039 0.4471;0.3922 0.8039 0.4353;0.4039 0.8039 0.4235;0.4196 0.8039 0.4118;0.4314 0.8039 0.4;0.4471 0.8039 0.3922;0.4627 0.8 0.3804;0.4745 0.8 0.3686;0.4902 0.8 0.3569;0.5059 0.8 0.349;0.5176 0.8 0.3373;0.5333 0.7961 0.3255;0.5451 0.7961 0.3176;0.5608 0.7961 0.3059;0.5765 0.7922 0.2941;0.5882 0.7922 0.2824;0.6039 0.7882 0.2745;0.6157 0.7882 0.2627;0.6314 0.7843 0.251;0.6431 0.7843 0.2431;0.6549 0.7804 0.2314;0.6706 0.7804 0.2235;0.6824 0.7765 0.2157;0.698 0.7765 0.2078;0.7098 0.7725 0.2;0.7216 0.7686 0.1922;0.7333 0.7686 0.1843;0.7451 0.7647 0.1765;0.7608 0.7647 0.1725;0.7725 0.7608 0.1647;0.7843 0.7569 0.1608;0.7961 0.7569 0.1569;0.8078 0.7529 0.1529;0.8157 0.749 0.1529;0.8275 0.749 0.1529;0.8392 0.7451 0.1529;0.851 0.7451 0.1569;0.8588 0.7412 0.1569;0.8706 0.7373 0.1608;0.8824 0.7373 0.1647;0.8902 0.7373 0.1686;0.902 0.7333 0.1765;0.9098 0.7333 0.1804;0.9176 0.7294 0.1882;0.9255 0.7294 0.1961;0.9373 0.7294 0.2078;0.9451 0.7294 0.2157;0.9529 0.7294 0.2235;0.9608 0.7294 0.2314;0.9686 0.7294 0.2392;0.9765 0.7294 0.2431;0.9843 0.7333 0.2431;0.9882 0.7373 0.2431;0.9961 0.7412 0.2392;0.9961 0.7451 0.2353;0.9961 0.7529 0.2314;0.9961 0.7569 0.2275;0.9961 0.7608 0.2235;0.9961 0.7686 0.2196;0.9961 0.7725 0.2157;0.9961 0.7804 0.2078;0.9961 0.7843 0.2039;0.9961 0.7922 0.2;0.9922 0.7961 0.1961;0.9922 0.8039 0.1922;0.9922 0.8078 0.1922;0.9882 0.8157 0.1882;0.9843 0.8235 0.1843;0.9843 0.8275 0.1804;0.9804 0.8353 0.1804;0.9765 0.8392 0.1765;0.9765 0.8471 0.1725;0.9725 0.851 0.1686;0.9686 0.8588 0.1647;0.9686 0.8667 0.1647;0.9647 0.8706 0.1608;0.9647 0.8784 0.1569;0.9608 0.8824 0.1569;0.9608 0.8902 0.1529;0.9608 0.898 0.149;0.9608 0.902 0.149;0.9608 0.9098 0.1451;0.9608 0.9137 0.1412;0.9608 0.9216 0.1373;0.9608 0.9255 0.1333;0.9608 0.9333 0.1294;0.9647 0.9373 0.1255;0.9647 0.9451 0.1216;0.9647 0.949 0.1176;0.9686 0.9569 0.1098;0.9686 0.9608 0.1059;0.9725 0.9686 0.102;0.9725 0.9725 0.0941;0.9765 0.9765 0.0863;0.9765 0.9843 0.0824]; 3494 | app.g3.FontSize = 11.3333333333333; 3495 | app.g3.NextPlot = 'replace'; 3496 | app.g3.Tag = 'g3'; 3497 | app.g3.Position = [70 0 283 250]; 3498 | 3499 | % Create g4 小波变换1 3500 | app.g4 = uiaxes(app.uibuttongroup11); 3501 | app.g4.FontName = 'Microsoft YaHei UI'; 3502 | app.g4.Colormap = [0.2431 0.149 0.6588;0.2431 0.1529 0.6745;0.2471 0.1569 0.6863;0.2471 0.1608 0.698;0.251 0.1647 0.7059;0.251 0.1686 0.7176;0.2549 0.1725 0.7294;0.2549 0.1765 0.7412;0.2588 0.1804 0.749;0.2588 0.1843 0.7608;0.2627 0.1922 0.7843;0.2627 0.1961 0.7922;0.2667 0.2 0.8039;0.2667 0.2039 0.8157;0.2706 0.2078 0.8235;0.2706 0.2157 0.8353;0.2706 0.2196 0.8431;0.2745 0.2235 0.851;0.2745 0.2275 0.8627;0.2745 0.2314 0.8706;0.2745 0.2392 0.8784;0.2784 0.2431 0.8824;0.2784 0.2471 0.8902;0.2784 0.2549 0.898;0.2784 0.2588 0.902;0.2784 0.2667 0.9098;0.2784 0.2706 0.9137;0.2784 0.2745 0.9216;0.2824 0.2824 0.9255;0.2824 0.2863 0.9294;0.2824 0.2941 0.9333;0.2824 0.298 0.9412;0.2824 0.3059 0.9451;0.2824 0.3098 0.949;0.2824 0.3137 0.9529;0.2824 0.3216 0.9569;0.2824 0.3255 0.9608;0.2824 0.3294 0.9647;0.2784 0.3373 0.9686;0.2784 0.3412 0.9686;0.2784 0.349 0.9725;0.2784 0.3529 0.9765;0.2784 0.3569 0.9804;0.2784 0.3647 0.9804;0.2745 0.3686 0.9843;0.2745 0.3765 0.9843;0.2745 0.3804 0.9882;0.2706 0.3843 0.9882;0.2706 0.3922 0.9922;0.2667 0.3961 0.9922;0.2627 0.4039 0.9922;0.2627 0.4078 0.9961;0.2588 0.4157 0.9961;0.2549 0.4196 0.9961;0.251 0.4275 0.9961;0.2471 0.4314 1;0.2431 0.4392 1;0.2353 0.4431 1;0.2314 0.451 1;0.2235 0.4549 1;0.2196 0.4627 0.9961;0.2118 0.4667 0.9961;0.2078 0.4745 0.9922;0.2 0.4784 0.9922;0.1961 0.4863 0.9882;0.1922 0.4902 0.9882;0.1882 0.498 0.9843;0.1843 0.502 0.9804;0.1843 0.5098 0.9804;0.1804 0.5137 0.9765;0.1804 0.5176 0.9725;0.1804 0.5255 0.9725;0.1804 0.5294 0.9686;0.1765 0.5333 0.9647;0.1765 0.5412 0.9608;0.1765 0.5451 0.9569;0.1765 0.549 0.9529;0.1765 0.5569 0.949;0.1725 0.5608 0.9451;0.1725 0.5647 0.9412;0.1686 0.5686 0.9373;0.1647 0.5765 0.9333;0.1608 0.5804 0.9294;0.1569 0.5843 0.9255;0.1529 0.5922 0.9216;0.1529 0.5961 0.9176;0.149 0.6 0.9137;0.149 0.6039 0.9098;0.1451 0.6078 0.9098;0.1451 0.6118 0.9059;0.1412 0.6196 0.902;0.1412 0.6235 0.898;0.1373 0.6275 0.898;0.1373 0.6314 0.8941;0.1333 0.6353 0.8941;0.1294 0.6392 0.8902;0.1255 0.6471 0.8902;0.1216 0.651 0.8863;0.1176 0.6549 0.8824;0.1137 0.6588 0.8824;0.1137 0.6627 0.8784;0.1098 0.6667 0.8745;0.1059 0.6706 0.8706;0.102 0.6745 0.8667;0.098 0.6784 0.8627;0.0902 0.6824 0.8549;0.0863 0.6863 0.851;0.0784 0.6902 0.8471;0.0706 0.6941 0.8392;0.0627 0.698 0.8353;0.0549 0.702 0.8314;0.0431 0.702 0.8235;0.0314 0.7059 0.8196;0.0235 0.7098 0.8118;0.0157 0.7137 0.8078;0.0078 0.7176 0.8;0.0039 0.7176 0.7922;0 0.7216 0.7882;0 0.7255 0.7804;0 0.7294 0.7765;0.0039 0.7294 0.7686;0.0078 0.7333 0.7608;0.0157 0.7333 0.7569;0.0235 0.7373 0.749;0.0353 0.7412 0.7412;0.051 0.7412 0.7373;0.0627 0.7451 0.7294;0.0784 0.7451 0.7216;0.0902 0.749 0.7137;0.102 0.7529 0.7098;0.1137 0.7529 0.702;0.1255 0.7569 0.6941;0.1373 0.7569 0.6863;0.1451 0.7608 0.6824;0.1529 0.7608 0.6745;0.1608 0.7647 0.6667;0.1686 0.7647 0.6588;0.1725 0.7686 0.651;0.1804 0.7686 0.6471;0.1843 0.7725 0.6392;0.1922 0.7725 0.6314;0.1961 0.7765 0.6235;0.2 0.7804 0.6157;0.2078 0.7804 0.6078;0.2118 0.7843 0.6;0.2196 0.7843 0.5882;0.2235 0.7882 0.5804;0.2314 0.7882 0.5725;0.2392 0.7922 0.5647;0.251 0.7922 0.5529;0.2588 0.7922 0.5451;0.2706 0.7961 0.5373;0.2824 0.7961 0.5255;0.2941 0.7961 0.5176;0.3059 0.8 0.5059;0.3176 0.8 0.498;0.3294 0.8 0.4863;0.3412 0.8 0.4784;0.3529 0.8 0.4667;0.3686 0.8039 0.4549;0.3804 0.8039 0.4471;0.3922 0.8039 0.4353;0.4039 0.8039 0.4235;0.4196 0.8039 0.4118;0.4314 0.8039 0.4;0.4471 0.8039 0.3922;0.4627 0.8 0.3804;0.4745 0.8 0.3686;0.4902 0.8 0.3569;0.5059 0.8 0.349;0.5176 0.8 0.3373;0.5333 0.7961 0.3255;0.5451 0.7961 0.3176;0.5608 0.7961 0.3059;0.5765 0.7922 0.2941;0.5882 0.7922 0.2824;0.6039 0.7882 0.2745;0.6157 0.7882 0.2627;0.6314 0.7843 0.251;0.6431 0.7843 0.2431;0.6549 0.7804 0.2314;0.6706 0.7804 0.2235;0.6824 0.7765 0.2157;0.698 0.7765 0.2078;0.7098 0.7725 0.2;0.7216 0.7686 0.1922;0.7333 0.7686 0.1843;0.7451 0.7647 0.1765;0.7608 0.7647 0.1725;0.7725 0.7608 0.1647;0.7843 0.7569 0.1608;0.7961 0.7569 0.1569;0.8078 0.7529 0.1529;0.8157 0.749 0.1529;0.8275 0.749 0.1529;0.8392 0.7451 0.1529;0.851 0.7451 0.1569;0.8588 0.7412 0.1569;0.8706 0.7373 0.1608;0.8824 0.7373 0.1647;0.8902 0.7373 0.1686;0.902 0.7333 0.1765;0.9098 0.7333 0.1804;0.9176 0.7294 0.1882;0.9255 0.7294 0.1961;0.9373 0.7294 0.2078;0.9451 0.7294 0.2157;0.9529 0.7294 0.2235;0.9608 0.7294 0.2314;0.9686 0.7294 0.2392;0.9765 0.7294 0.2431;0.9843 0.7333 0.2431;0.9882 0.7373 0.2431;0.9961 0.7412 0.2392;0.9961 0.7451 0.2353;0.9961 0.7529 0.2314;0.9961 0.7569 0.2275;0.9961 0.7608 0.2235;0.9961 0.7686 0.2196;0.9961 0.7725 0.2157;0.9961 0.7804 0.2078;0.9961 0.7843 0.2039;0.9961 0.7922 0.2;0.9922 0.7961 0.1961;0.9922 0.8039 0.1922;0.9922 0.8078 0.1922;0.9882 0.8157 0.1882;0.9843 0.8235 0.1843;0.9843 0.8275 0.1804;0.9804 0.8353 0.1804;0.9765 0.8392 0.1765;0.9765 0.8471 0.1725;0.9725 0.851 0.1686;0.9686 0.8588 0.1647;0.9686 0.8667 0.1647;0.9647 0.8706 0.1608;0.9647 0.8784 0.1569;0.9608 0.8824 0.1569;0.9608 0.8902 0.1529;0.9608 0.898 0.149;0.9608 0.902 0.149;0.9608 0.9098 0.1451;0.9608 0.9137 0.1412;0.9608 0.9216 0.1373;0.9608 0.9255 0.1333;0.9608 0.9333 0.1294;0.9647 0.9373 0.1255;0.9647 0.9451 0.1216;0.9647 0.949 0.1176;0.9686 0.9569 0.1098;0.9686 0.9608 0.1059;0.9725 0.9686 0.102;0.9725 0.9725 0.0941;0.9765 0.9765 0.0863;0.9765 0.9843 0.0824]; 3503 | app.g4.FontSize = 11.3333333333333; 3504 | app.g4.NextPlot = 'replace'; 3505 | app.g4.Tag = 'g4'; 3506 | app.g4.Position = [440 550 273 200]; 3507 | 3508 | % Create g5 小波变换2 3509 | app.g5 = uiaxes(app.uibuttongroup11); 3510 | app.g5.FontName = 'Microsoft YaHei UI'; 3511 | app.g5.Colormap = [0.2431 0.149 0.6588;0.2431 0.1529 0.6745;0.2471 0.1569 0.6863;0.2471 0.1608 0.698;0.251 0.1647 0.7059;0.251 0.1686 0.7176;0.2549 0.1725 0.7294;0.2549 0.1765 0.7412;0.2588 0.1804 0.749;0.2588 0.1843 0.7608;0.2627 0.1922 0.7843;0.2627 0.1961 0.7922;0.2667 0.2 0.8039;0.2667 0.2039 0.8157;0.2706 0.2078 0.8235;0.2706 0.2157 0.8353;0.2706 0.2196 0.8431;0.2745 0.2235 0.851;0.2745 0.2275 0.8627;0.2745 0.2314 0.8706;0.2745 0.2392 0.8784;0.2784 0.2431 0.8824;0.2784 0.2471 0.8902;0.2784 0.2549 0.898;0.2784 0.2588 0.902;0.2784 0.2667 0.9098;0.2784 0.2706 0.9137;0.2784 0.2745 0.9216;0.2824 0.2824 0.9255;0.2824 0.2863 0.9294;0.2824 0.2941 0.9333;0.2824 0.298 0.9412;0.2824 0.3059 0.9451;0.2824 0.3098 0.949;0.2824 0.3137 0.9529;0.2824 0.3216 0.9569;0.2824 0.3255 0.9608;0.2824 0.3294 0.9647;0.2784 0.3373 0.9686;0.2784 0.3412 0.9686;0.2784 0.349 0.9725;0.2784 0.3529 0.9765;0.2784 0.3569 0.9804;0.2784 0.3647 0.9804;0.2745 0.3686 0.9843;0.2745 0.3765 0.9843;0.2745 0.3804 0.9882;0.2706 0.3843 0.9882;0.2706 0.3922 0.9922;0.2667 0.3961 0.9922;0.2627 0.4039 0.9922;0.2627 0.4078 0.9961;0.2588 0.4157 0.9961;0.2549 0.4196 0.9961;0.251 0.4275 0.9961;0.2471 0.4314 1;0.2431 0.4392 1;0.2353 0.4431 1;0.2314 0.451 1;0.2235 0.4549 1;0.2196 0.4627 0.9961;0.2118 0.4667 0.9961;0.2078 0.4745 0.9922;0.2 0.4784 0.9922;0.1961 0.4863 0.9882;0.1922 0.4902 0.9882;0.1882 0.498 0.9843;0.1843 0.502 0.9804;0.1843 0.5098 0.9804;0.1804 0.5137 0.9765;0.1804 0.5176 0.9725;0.1804 0.5255 0.9725;0.1804 0.5294 0.9686;0.1765 0.5333 0.9647;0.1765 0.5412 0.9608;0.1765 0.5451 0.9569;0.1765 0.549 0.9529;0.1765 0.5569 0.949;0.1725 0.5608 0.9451;0.1725 0.5647 0.9412;0.1686 0.5686 0.9373;0.1647 0.5765 0.9333;0.1608 0.5804 0.9294;0.1569 0.5843 0.9255;0.1529 0.5922 0.9216;0.1529 0.5961 0.9176;0.149 0.6 0.9137;0.149 0.6039 0.9098;0.1451 0.6078 0.9098;0.1451 0.6118 0.9059;0.1412 0.6196 0.902;0.1412 0.6235 0.898;0.1373 0.6275 0.898;0.1373 0.6314 0.8941;0.1333 0.6353 0.8941;0.1294 0.6392 0.8902;0.1255 0.6471 0.8902;0.1216 0.651 0.8863;0.1176 0.6549 0.8824;0.1137 0.6588 0.8824;0.1137 0.6627 0.8784;0.1098 0.6667 0.8745;0.1059 0.6706 0.8706;0.102 0.6745 0.8667;0.098 0.6784 0.8627;0.0902 0.6824 0.8549;0.0863 0.6863 0.851;0.0784 0.6902 0.8471;0.0706 0.6941 0.8392;0.0627 0.698 0.8353;0.0549 0.702 0.8314;0.0431 0.702 0.8235;0.0314 0.7059 0.8196;0.0235 0.7098 0.8118;0.0157 0.7137 0.8078;0.0078 0.7176 0.8;0.0039 0.7176 0.7922;0 0.7216 0.7882;0 0.7255 0.7804;0 0.7294 0.7765;0.0039 0.7294 0.7686;0.0078 0.7333 0.7608;0.0157 0.7333 0.7569;0.0235 0.7373 0.749;0.0353 0.7412 0.7412;0.051 0.7412 0.7373;0.0627 0.7451 0.7294;0.0784 0.7451 0.7216;0.0902 0.749 0.7137;0.102 0.7529 0.7098;0.1137 0.7529 0.702;0.1255 0.7569 0.6941;0.1373 0.7569 0.6863;0.1451 0.7608 0.6824;0.1529 0.7608 0.6745;0.1608 0.7647 0.6667;0.1686 0.7647 0.6588;0.1725 0.7686 0.651;0.1804 0.7686 0.6471;0.1843 0.7725 0.6392;0.1922 0.7725 0.6314;0.1961 0.7765 0.6235;0.2 0.7804 0.6157;0.2078 0.7804 0.6078;0.2118 0.7843 0.6;0.2196 0.7843 0.5882;0.2235 0.7882 0.5804;0.2314 0.7882 0.5725;0.2392 0.7922 0.5647;0.251 0.7922 0.5529;0.2588 0.7922 0.5451;0.2706 0.7961 0.5373;0.2824 0.7961 0.5255;0.2941 0.7961 0.5176;0.3059 0.8 0.5059;0.3176 0.8 0.498;0.3294 0.8 0.4863;0.3412 0.8 0.4784;0.3529 0.8 0.4667;0.3686 0.8039 0.4549;0.3804 0.8039 0.4471;0.3922 0.8039 0.4353;0.4039 0.8039 0.4235;0.4196 0.8039 0.4118;0.4314 0.8039 0.4;0.4471 0.8039 0.3922;0.4627 0.8 0.3804;0.4745 0.8 0.3686;0.4902 0.8 0.3569;0.5059 0.8 0.349;0.5176 0.8 0.3373;0.5333 0.7961 0.3255;0.5451 0.7961 0.3176;0.5608 0.7961 0.3059;0.5765 0.7922 0.2941;0.5882 0.7922 0.2824;0.6039 0.7882 0.2745;0.6157 0.7882 0.2627;0.6314 0.7843 0.251;0.6431 0.7843 0.2431;0.6549 0.7804 0.2314;0.6706 0.7804 0.2235;0.6824 0.7765 0.2157;0.698 0.7765 0.2078;0.7098 0.7725 0.2;0.7216 0.7686 0.1922;0.7333 0.7686 0.1843;0.7451 0.7647 0.1765;0.7608 0.7647 0.1725;0.7725 0.7608 0.1647;0.7843 0.7569 0.1608;0.7961 0.7569 0.1569;0.8078 0.7529 0.1529;0.8157 0.749 0.1529;0.8275 0.749 0.1529;0.8392 0.7451 0.1529;0.851 0.7451 0.1569;0.8588 0.7412 0.1569;0.8706 0.7373 0.1608;0.8824 0.7373 0.1647;0.8902 0.7373 0.1686;0.902 0.7333 0.1765;0.9098 0.7333 0.1804;0.9176 0.7294 0.1882;0.9255 0.7294 0.1961;0.9373 0.7294 0.2078;0.9451 0.7294 0.2157;0.9529 0.7294 0.2235;0.9608 0.7294 0.2314;0.9686 0.7294 0.2392;0.9765 0.7294 0.2431;0.9843 0.7333 0.2431;0.9882 0.7373 0.2431;0.9961 0.7412 0.2392;0.9961 0.7451 0.2353;0.9961 0.7529 0.2314;0.9961 0.7569 0.2275;0.9961 0.7608 0.2235;0.9961 0.7686 0.2196;0.9961 0.7725 0.2157;0.9961 0.7804 0.2078;0.9961 0.7843 0.2039;0.9961 0.7922 0.2;0.9922 0.7961 0.1961;0.9922 0.8039 0.1922;0.9922 0.8078 0.1922;0.9882 0.8157 0.1882;0.9843 0.8235 0.1843;0.9843 0.8275 0.1804;0.9804 0.8353 0.1804;0.9765 0.8392 0.1765;0.9765 0.8471 0.1725;0.9725 0.851 0.1686;0.9686 0.8588 0.1647;0.9686 0.8667 0.1647;0.9647 0.8706 0.1608;0.9647 0.8784 0.1569;0.9608 0.8824 0.1569;0.9608 0.8902 0.1529;0.9608 0.898 0.149;0.9608 0.902 0.149;0.9608 0.9098 0.1451;0.9608 0.9137 0.1412;0.9608 0.9216 0.1373;0.9608 0.9255 0.1333;0.9608 0.9333 0.1294;0.9647 0.9373 0.1255;0.9647 0.9451 0.1216;0.9647 0.949 0.1176;0.9686 0.9569 0.1098;0.9686 0.9608 0.1059;0.9725 0.9686 0.102;0.9725 0.9725 0.0941;0.9765 0.9765 0.0863;0.9765 0.9843 0.0824]; 3512 | app.g5.FontSize = 11.3333333333333; 3513 | app.g5.NextPlot = 'replace'; 3514 | app.g5.Tag = 'g5'; 3515 | app.g5.Position = [440 370 273 200]; 3516 | 3517 | % Create g6 小波变换3 3518 | app.g6 = uiaxes(app.uibuttongroup11); 3519 | app.g6.FontName = 'Microsoft YaHei UI'; 3520 | app.g6.Colormap = [0.2431 0.149 0.6588;0.2431 0.1529 0.6745;0.2471 0.1569 0.6863;0.2471 0.1608 0.698;0.251 0.1647 0.7059;0.251 0.1686 0.7176;0.2549 0.1725 0.7294;0.2549 0.1765 0.7412;0.2588 0.1804 0.749;0.2588 0.1843 0.7608;0.2627 0.1922 0.7843;0.2627 0.1961 0.7922;0.2667 0.2 0.8039;0.2667 0.2039 0.8157;0.2706 0.2078 0.8235;0.2706 0.2157 0.8353;0.2706 0.2196 0.8431;0.2745 0.2235 0.851;0.2745 0.2275 0.8627;0.2745 0.2314 0.8706;0.2745 0.2392 0.8784;0.2784 0.2431 0.8824;0.2784 0.2471 0.8902;0.2784 0.2549 0.898;0.2784 0.2588 0.902;0.2784 0.2667 0.9098;0.2784 0.2706 0.9137;0.2784 0.2745 0.9216;0.2824 0.2824 0.9255;0.2824 0.2863 0.9294;0.2824 0.2941 0.9333;0.2824 0.298 0.9412;0.2824 0.3059 0.9451;0.2824 0.3098 0.949;0.2824 0.3137 0.9529;0.2824 0.3216 0.9569;0.2824 0.3255 0.9608;0.2824 0.3294 0.9647;0.2784 0.3373 0.9686;0.2784 0.3412 0.9686;0.2784 0.349 0.9725;0.2784 0.3529 0.9765;0.2784 0.3569 0.9804;0.2784 0.3647 0.9804;0.2745 0.3686 0.9843;0.2745 0.3765 0.9843;0.2745 0.3804 0.9882;0.2706 0.3843 0.9882;0.2706 0.3922 0.9922;0.2667 0.3961 0.9922;0.2627 0.4039 0.9922;0.2627 0.4078 0.9961;0.2588 0.4157 0.9961;0.2549 0.4196 0.9961;0.251 0.4275 0.9961;0.2471 0.4314 1;0.2431 0.4392 1;0.2353 0.4431 1;0.2314 0.451 1;0.2235 0.4549 1;0.2196 0.4627 0.9961;0.2118 0.4667 0.9961;0.2078 0.4745 0.9922;0.2 0.4784 0.9922;0.1961 0.4863 0.9882;0.1922 0.4902 0.9882;0.1882 0.498 0.9843;0.1843 0.502 0.9804;0.1843 0.5098 0.9804;0.1804 0.5137 0.9765;0.1804 0.5176 0.9725;0.1804 0.5255 0.9725;0.1804 0.5294 0.9686;0.1765 0.5333 0.9647;0.1765 0.5412 0.9608;0.1765 0.5451 0.9569;0.1765 0.549 0.9529;0.1765 0.5569 0.949;0.1725 0.5608 0.9451;0.1725 0.5647 0.9412;0.1686 0.5686 0.9373;0.1647 0.5765 0.9333;0.1608 0.5804 0.9294;0.1569 0.5843 0.9255;0.1529 0.5922 0.9216;0.1529 0.5961 0.9176;0.149 0.6 0.9137;0.149 0.6039 0.9098;0.1451 0.6078 0.9098;0.1451 0.6118 0.9059;0.1412 0.6196 0.902;0.1412 0.6235 0.898;0.1373 0.6275 0.898;0.1373 0.6314 0.8941;0.1333 0.6353 0.8941;0.1294 0.6392 0.8902;0.1255 0.6471 0.8902;0.1216 0.651 0.8863;0.1176 0.6549 0.8824;0.1137 0.6588 0.8824;0.1137 0.6627 0.8784;0.1098 0.6667 0.8745;0.1059 0.6706 0.8706;0.102 0.6745 0.8667;0.098 0.6784 0.8627;0.0902 0.6824 0.8549;0.0863 0.6863 0.851;0.0784 0.6902 0.8471;0.0706 0.6941 0.8392;0.0627 0.698 0.8353;0.0549 0.702 0.8314;0.0431 0.702 0.8235;0.0314 0.7059 0.8196;0.0235 0.7098 0.8118;0.0157 0.7137 0.8078;0.0078 0.7176 0.8;0.0039 0.7176 0.7922;0 0.7216 0.7882;0 0.7255 0.7804;0 0.7294 0.7765;0.0039 0.7294 0.7686;0.0078 0.7333 0.7608;0.0157 0.7333 0.7569;0.0235 0.7373 0.749;0.0353 0.7412 0.7412;0.051 0.7412 0.7373;0.0627 0.7451 0.7294;0.0784 0.7451 0.7216;0.0902 0.749 0.7137;0.102 0.7529 0.7098;0.1137 0.7529 0.702;0.1255 0.7569 0.6941;0.1373 0.7569 0.6863;0.1451 0.7608 0.6824;0.1529 0.7608 0.6745;0.1608 0.7647 0.6667;0.1686 0.7647 0.6588;0.1725 0.7686 0.651;0.1804 0.7686 0.6471;0.1843 0.7725 0.6392;0.1922 0.7725 0.6314;0.1961 0.7765 0.6235;0.2 0.7804 0.6157;0.2078 0.7804 0.6078;0.2118 0.7843 0.6;0.2196 0.7843 0.5882;0.2235 0.7882 0.5804;0.2314 0.7882 0.5725;0.2392 0.7922 0.5647;0.251 0.7922 0.5529;0.2588 0.7922 0.5451;0.2706 0.7961 0.5373;0.2824 0.7961 0.5255;0.2941 0.7961 0.5176;0.3059 0.8 0.5059;0.3176 0.8 0.498;0.3294 0.8 0.4863;0.3412 0.8 0.4784;0.3529 0.8 0.4667;0.3686 0.8039 0.4549;0.3804 0.8039 0.4471;0.3922 0.8039 0.4353;0.4039 0.8039 0.4235;0.4196 0.8039 0.4118;0.4314 0.8039 0.4;0.4471 0.8039 0.3922;0.4627 0.8 0.3804;0.4745 0.8 0.3686;0.4902 0.8 0.3569;0.5059 0.8 0.349;0.5176 0.8 0.3373;0.5333 0.7961 0.3255;0.5451 0.7961 0.3176;0.5608 0.7961 0.3059;0.5765 0.7922 0.2941;0.5882 0.7922 0.2824;0.6039 0.7882 0.2745;0.6157 0.7882 0.2627;0.6314 0.7843 0.251;0.6431 0.7843 0.2431;0.6549 0.7804 0.2314;0.6706 0.7804 0.2235;0.6824 0.7765 0.2157;0.698 0.7765 0.2078;0.7098 0.7725 0.2;0.7216 0.7686 0.1922;0.7333 0.7686 0.1843;0.7451 0.7647 0.1765;0.7608 0.7647 0.1725;0.7725 0.7608 0.1647;0.7843 0.7569 0.1608;0.7961 0.7569 0.1569;0.8078 0.7529 0.1529;0.8157 0.749 0.1529;0.8275 0.749 0.1529;0.8392 0.7451 0.1529;0.851 0.7451 0.1569;0.8588 0.7412 0.1569;0.8706 0.7373 0.1608;0.8824 0.7373 0.1647;0.8902 0.7373 0.1686;0.902 0.7333 0.1765;0.9098 0.7333 0.1804;0.9176 0.7294 0.1882;0.9255 0.7294 0.1961;0.9373 0.7294 0.2078;0.9451 0.7294 0.2157;0.9529 0.7294 0.2235;0.9608 0.7294 0.2314;0.9686 0.7294 0.2392;0.9765 0.7294 0.2431;0.9843 0.7333 0.2431;0.9882 0.7373 0.2431;0.9961 0.7412 0.2392;0.9961 0.7451 0.2353;0.9961 0.7529 0.2314;0.9961 0.7569 0.2275;0.9961 0.7608 0.2235;0.9961 0.7686 0.2196;0.9961 0.7725 0.2157;0.9961 0.7804 0.2078;0.9961 0.7843 0.2039;0.9961 0.7922 0.2;0.9922 0.7961 0.1961;0.9922 0.8039 0.1922;0.9922 0.8078 0.1922;0.9882 0.8157 0.1882;0.9843 0.8235 0.1843;0.9843 0.8275 0.1804;0.9804 0.8353 0.1804;0.9765 0.8392 0.1765;0.9765 0.8471 0.1725;0.9725 0.851 0.1686;0.9686 0.8588 0.1647;0.9686 0.8667 0.1647;0.9647 0.8706 0.1608;0.9647 0.8784 0.1569;0.9608 0.8824 0.1569;0.9608 0.8902 0.1529;0.9608 0.898 0.149;0.9608 0.902 0.149;0.9608 0.9098 0.1451;0.9608 0.9137 0.1412;0.9608 0.9216 0.1373;0.9608 0.9255 0.1333;0.9608 0.9333 0.1294;0.9647 0.9373 0.1255;0.9647 0.9451 0.1216;0.9647 0.949 0.1176;0.9686 0.9569 0.1098;0.9686 0.9608 0.1059;0.9725 0.9686 0.102;0.9725 0.9725 0.0941;0.9765 0.9765 0.0863;0.9765 0.9843 0.0824]; 3521 | app.g6.FontSize = 11.3333333333333; 3522 | app.g6.NextPlot = 'replace'; 3523 | app.g6.Tag = 'g6'; 3524 | app.g6.Position = [440 185 273 200]; 3525 | 3526 | % Create g7 小波变换4 3527 | app.g7 = uiaxes(app.uibuttongroup11); 3528 | app.g7.FontName = 'Microsoft YaHei UI'; 3529 | app.g7.Colormap = [0.2431 0.149 0.6588;0.2431 0.1529 0.6745;0.2471 0.1569 0.6863;0.2471 0.1608 0.698;0.251 0.1647 0.7059;0.251 0.1686 0.7176;0.2549 0.1725 0.7294;0.2549 0.1765 0.7412;0.2588 0.1804 0.749;0.2588 0.1843 0.7608;0.2627 0.1922 0.7843;0.2627 0.1961 0.7922;0.2667 0.2 0.8039;0.2667 0.2039 0.8157;0.2706 0.2078 0.8235;0.2706 0.2157 0.8353;0.2706 0.2196 0.8431;0.2745 0.2235 0.851;0.2745 0.2275 0.8627;0.2745 0.2314 0.8706;0.2745 0.2392 0.8784;0.2784 0.2431 0.8824;0.2784 0.2471 0.8902;0.2784 0.2549 0.898;0.2784 0.2588 0.902;0.2784 0.2667 0.9098;0.2784 0.2706 0.9137;0.2784 0.2745 0.9216;0.2824 0.2824 0.9255;0.2824 0.2863 0.9294;0.2824 0.2941 0.9333;0.2824 0.298 0.9412;0.2824 0.3059 0.9451;0.2824 0.3098 0.949;0.2824 0.3137 0.9529;0.2824 0.3216 0.9569;0.2824 0.3255 0.9608;0.2824 0.3294 0.9647;0.2784 0.3373 0.9686;0.2784 0.3412 0.9686;0.2784 0.349 0.9725;0.2784 0.3529 0.9765;0.2784 0.3569 0.9804;0.2784 0.3647 0.9804;0.2745 0.3686 0.9843;0.2745 0.3765 0.9843;0.2745 0.3804 0.9882;0.2706 0.3843 0.9882;0.2706 0.3922 0.9922;0.2667 0.3961 0.9922;0.2627 0.4039 0.9922;0.2627 0.4078 0.9961;0.2588 0.4157 0.9961;0.2549 0.4196 0.9961;0.251 0.4275 0.9961;0.2471 0.4314 1;0.2431 0.4392 1;0.2353 0.4431 1;0.2314 0.451 1;0.2235 0.4549 1;0.2196 0.4627 0.9961;0.2118 0.4667 0.9961;0.2078 0.4745 0.9922;0.2 0.4784 0.9922;0.1961 0.4863 0.9882;0.1922 0.4902 0.9882;0.1882 0.498 0.9843;0.1843 0.502 0.9804;0.1843 0.5098 0.9804;0.1804 0.5137 0.9765;0.1804 0.5176 0.9725;0.1804 0.5255 0.9725;0.1804 0.5294 0.9686;0.1765 0.5333 0.9647;0.1765 0.5412 0.9608;0.1765 0.5451 0.9569;0.1765 0.549 0.9529;0.1765 0.5569 0.949;0.1725 0.5608 0.9451;0.1725 0.5647 0.9412;0.1686 0.5686 0.9373;0.1647 0.5765 0.9333;0.1608 0.5804 0.9294;0.1569 0.5843 0.9255;0.1529 0.5922 0.9216;0.1529 0.5961 0.9176;0.149 0.6 0.9137;0.149 0.6039 0.9098;0.1451 0.6078 0.9098;0.1451 0.6118 0.9059;0.1412 0.6196 0.902;0.1412 0.6235 0.898;0.1373 0.6275 0.898;0.1373 0.6314 0.8941;0.1333 0.6353 0.8941;0.1294 0.6392 0.8902;0.1255 0.6471 0.8902;0.1216 0.651 0.8863;0.1176 0.6549 0.8824;0.1137 0.6588 0.8824;0.1137 0.6627 0.8784;0.1098 0.6667 0.8745;0.1059 0.6706 0.8706;0.102 0.6745 0.8667;0.098 0.6784 0.8627;0.0902 0.6824 0.8549;0.0863 0.6863 0.851;0.0784 0.6902 0.8471;0.0706 0.6941 0.8392;0.0627 0.698 0.8353;0.0549 0.702 0.8314;0.0431 0.702 0.8235;0.0314 0.7059 0.8196;0.0235 0.7098 0.8118;0.0157 0.7137 0.8078;0.0078 0.7176 0.8;0.0039 0.7176 0.7922;0 0.7216 0.7882;0 0.7255 0.7804;0 0.7294 0.7765;0.0039 0.7294 0.7686;0.0078 0.7333 0.7608;0.0157 0.7333 0.7569;0.0235 0.7373 0.749;0.0353 0.7412 0.7412;0.051 0.7412 0.7373;0.0627 0.7451 0.7294;0.0784 0.7451 0.7216;0.0902 0.749 0.7137;0.102 0.7529 0.7098;0.1137 0.7529 0.702;0.1255 0.7569 0.6941;0.1373 0.7569 0.6863;0.1451 0.7608 0.6824;0.1529 0.7608 0.6745;0.1608 0.7647 0.6667;0.1686 0.7647 0.6588;0.1725 0.7686 0.651;0.1804 0.7686 0.6471;0.1843 0.7725 0.6392;0.1922 0.7725 0.6314;0.1961 0.7765 0.6235;0.2 0.7804 0.6157;0.2078 0.7804 0.6078;0.2118 0.7843 0.6;0.2196 0.7843 0.5882;0.2235 0.7882 0.5804;0.2314 0.7882 0.5725;0.2392 0.7922 0.5647;0.251 0.7922 0.5529;0.2588 0.7922 0.5451;0.2706 0.7961 0.5373;0.2824 0.7961 0.5255;0.2941 0.7961 0.5176;0.3059 0.8 0.5059;0.3176 0.8 0.498;0.3294 0.8 0.4863;0.3412 0.8 0.4784;0.3529 0.8 0.4667;0.3686 0.8039 0.4549;0.3804 0.8039 0.4471;0.3922 0.8039 0.4353;0.4039 0.8039 0.4235;0.4196 0.8039 0.4118;0.4314 0.8039 0.4;0.4471 0.8039 0.3922;0.4627 0.8 0.3804;0.4745 0.8 0.3686;0.4902 0.8 0.3569;0.5059 0.8 0.349;0.5176 0.8 0.3373;0.5333 0.7961 0.3255;0.5451 0.7961 0.3176;0.5608 0.7961 0.3059;0.5765 0.7922 0.2941;0.5882 0.7922 0.2824;0.6039 0.7882 0.2745;0.6157 0.7882 0.2627;0.6314 0.7843 0.251;0.6431 0.7843 0.2431;0.6549 0.7804 0.2314;0.6706 0.7804 0.2235;0.6824 0.7765 0.2157;0.698 0.7765 0.2078;0.7098 0.7725 0.2;0.7216 0.7686 0.1922;0.7333 0.7686 0.1843;0.7451 0.7647 0.1765;0.7608 0.7647 0.1725;0.7725 0.7608 0.1647;0.7843 0.7569 0.1608;0.7961 0.7569 0.1569;0.8078 0.7529 0.1529;0.8157 0.749 0.1529;0.8275 0.749 0.1529;0.8392 0.7451 0.1529;0.851 0.7451 0.1569;0.8588 0.7412 0.1569;0.8706 0.7373 0.1608;0.8824 0.7373 0.1647;0.8902 0.7373 0.1686;0.902 0.7333 0.1765;0.9098 0.7333 0.1804;0.9176 0.7294 0.1882;0.9255 0.7294 0.1961;0.9373 0.7294 0.2078;0.9451 0.7294 0.2157;0.9529 0.7294 0.2235;0.9608 0.7294 0.2314;0.9686 0.7294 0.2392;0.9765 0.7294 0.2431;0.9843 0.7333 0.2431;0.9882 0.7373 0.2431;0.9961 0.7412 0.2392;0.9961 0.7451 0.2353;0.9961 0.7529 0.2314;0.9961 0.7569 0.2275;0.9961 0.7608 0.2235;0.9961 0.7686 0.2196;0.9961 0.7725 0.2157;0.9961 0.7804 0.2078;0.9961 0.7843 0.2039;0.9961 0.7922 0.2;0.9922 0.7961 0.1961;0.9922 0.8039 0.1922;0.9922 0.8078 0.1922;0.9882 0.8157 0.1882;0.9843 0.8235 0.1843;0.9843 0.8275 0.1804;0.9804 0.8353 0.1804;0.9765 0.8392 0.1765;0.9765 0.8471 0.1725;0.9725 0.851 0.1686;0.9686 0.8588 0.1647;0.9686 0.8667 0.1647;0.9647 0.8706 0.1608;0.9647 0.8784 0.1569;0.9608 0.8824 0.1569;0.9608 0.8902 0.1529;0.9608 0.898 0.149;0.9608 0.902 0.149;0.9608 0.9098 0.1451;0.9608 0.9137 0.1412;0.9608 0.9216 0.1373;0.9608 0.9255 0.1333;0.9608 0.9333 0.1294;0.9647 0.9373 0.1255;0.9647 0.9451 0.1216;0.9647 0.949 0.1176;0.9686 0.9569 0.1098;0.9686 0.9608 0.1059;0.9725 0.9686 0.102;0.9725 0.9725 0.0941;0.9765 0.9765 0.0863;0.9765 0.9843 0.0824]; 3530 | app.g7.FontSize = 11.3333333333333; 3531 | app.g7.NextPlot = 'replace'; 3532 | app.g7.Tag = 'g7'; 3533 | app.g7.Position = [440 0 273 200]; 3534 | 3535 | % Create uibuttongroup12_1 3536 | app.uibuttongroup12_1 = uibuttongroup(app.uibuttongroup11); 3537 | app.uibuttongroup12_1.Title = '小波选择'; 3538 | app.uibuttongroup12_1.Tag = 'uibuttongroup12_1'; 3539 | app.uibuttongroup12_1.FontName = 'Microsoft YaHei UI'; 3540 | app.uibuttongroup12_1.FontSize = 16; 3541 | app.uibuttongroup12_1.Position = [350 480 133 260]; 3542 | 3543 | % Create Label 3544 | app.Label = uilabel(app.uibuttongroup12_1); 3545 | app.Label.FontWeight = 'bold'; 3546 | app.Label.FontAngle = 'italic'; 3547 | app.Label.FontColor = [0.149 0.149 0.149]; 3548 | app.Label.Position = [20 0 150 20]; 3549 | app.Label.Text = '(默认为harr小波)'; 3550 | 3551 | % Create Button1 3552 | app.Button1 = uibutton(app.uibuttongroup12_1, 'push'); 3553 | app.Button1.ButtonPushedFcn = createCallbackFcn(app, @Button1Pushed, true); 3554 | app.Button1.Position = [19 200 100 22]; 3555 | app.Button1.Tag = 'Button1'; 3556 | app.Button1.Text = 'haar'; 3557 | 3558 | % Create Button2 3559 | app.Button2 = uibutton(app.uibuttongroup12_1, 'push'); 3560 | app.Button2.ButtonPushedFcn = createCallbackFcn(app, @Button2Pushed, true); 3561 | app.Button2.Position = [19 170 100 22]; 3562 | app.Button2.Tag = 'Button2'; 3563 | app.Button2.Text = 'db2'; 3564 | 3565 | % Create Button3 3566 | app.Button3 = uibutton(app.uibuttongroup12_1, 'push'); 3567 | app.Button3.ButtonPushedFcn = createCallbackFcn(app, @Button3Pushed, true); 3568 | app.Button3.Position = [19 140 100 22]; 3569 | app.Button3.Tag = 'Button3'; 3570 | app.Button3.Text = 'bior1.1'; 3571 | 3572 | % Create Button4 3573 | app.Button4 = uibutton(app.uibuttongroup12_1, 'push'); 3574 | app.Button4.ButtonPushedFcn = createCallbackFcn(app, @Button4Pushed, true); 3575 | app.Button4.Position = [19 110 100 22]; 3576 | app.Button4.Tag = 'Button4'; 3577 | app.Button4.Text = 'coif1'; 3578 | 3579 | % Create Button5 3580 | app.Button5 = uibutton(app.uibuttongroup12_1, 'push'); 3581 | app.Button5.ButtonPushedFcn = createCallbackFcn(app, @Button5Pushed, true); 3582 | app.Button5.Position = [19 80 100 22]; 3583 | app.Button5.Tag = 'Button5'; 3584 | app.Button5.Text = 'sym2'; 3585 | 3586 | % Create Button6 3587 | app.Button6 = uibutton(app.uibuttongroup12_1, 'push'); 3588 | app.Button6.ButtonPushedFcn = createCallbackFcn(app, @Button6Pushed, true); 3589 | app.Button6.Position = [19 50 100 22]; 3590 | app.Button6.Tag = 'Button6'; 3591 | app.Button6.Text = 'fk4'; 3592 | 3593 | % Create Button7 3594 | app.Button7 = uibutton(app.uibuttongroup12_1, 'push'); 3595 | app.Button7.ButtonPushedFcn = createCallbackFcn(app, @Button7Pushed, true); 3596 | app.Button7.Position = [19 20 100 22]; 3597 | app.Button7.Tag = 'Button7'; 3598 | app.Button7.Text = 'dmey'; 3599 | 3600 | catch 3601 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 3602 | end 3603 | 3604 | % Show the figure after all components are created 3605 | app.figure.Visible = 'on'; 3606 | end 3607 | end 3608 | 3609 | % UI界面生成与删除 3610 | methods (Access = public) 3611 | 3612 | % Construct app 3613 | function app = Image_Processing_GUI(varargin) 3614 | 3615 | runningApp = getRunningApp(app); 3616 | 3617 | % 检查是否存在正在运行的单例App 3618 | if isempty(runningApp) 3619 | 3620 | try 3621 | % 创建UIFigure和组件 3622 | createComponents(app) 3623 | catch 3624 | errordlg('发生了错误,请检查输入或操作','错误','modal'); 3625 | end 3626 | % 将App注册到App Designer 3627 | registerApp(app, app.figure) 3628 | 3629 | % 执行启动函数 3630 | runStartupFcn(app, @(app)Image_processing_GUI_OpeningFcn(app, varargin{:})) 3631 | 3632 | else 3633 | % 聚焦正在运行的单例App 3634 | figure(runningApp.figure) 3635 | 3636 | app = runningApp; 3637 | end 3638 | 3639 | if nargout == 0 3640 | clear app 3641 | end 3642 | end 3643 | 3644 | % Code that executes before app deletion 3645 | function delete(app) 3646 | % 在app被删除时删除UIFigure 3647 | delete(app.figure) 3648 | end 3649 | end 3650 | end 3651 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **《数字图像处理》课程综合项目**——**基于多种滤波器的图像去噪算法比较与分析** 2 | 3 | ## GUI界面: 4 | 5 | ![digital_image_GUI](./gif/digital_image_GUI.gif) 6 | 7 | 本项目源代码和报告均在仓库中。 8 | 9 | ## 项目简介 10 | 11 | 本项目旨在设计一个基于Matlab的图像去噪GUI系统,通过应用多种图像去噪算法,提高图像的质量和可用性。该系统集成了多种经典和现代的去噪方法,并提供了直观的用户界面,方便用户对图像进行去噪处理和效果评估。 12 | 13 | ## 主要功能概述 14 | 15 | ### 1. 图像去噪方法 16 | 系统实现了多种常见的图像去噪方法,包括: 17 | 18 | - **均值滤波**:通过邻域像素的平均值来替代中心像素的值,有效减少高频噪声,但可能导致图像细节丢失 。 19 | - **中值滤波**:采用滤波窗口内像素的中值替代中心像素的值,能够有效去除椒盐噪声和脉冲噪声,同时保留图像边缘和细节信息 。 20 | - **高斯低通滤波**:利用高斯函数对图像进行低通滤波,平滑图像并减少噪声 。 21 | - **巴特沃斯低通滤波**:一种频域滤波方法,适用于去除频率较高的噪声 。 22 | - **小波变换**:通过小波分解和重构来实现图像去噪,能够有效保留图像的细节和边缘 。 23 | - **非局部均值去噪**:基于图像中相似区域的像素值信息,对目标像素进行加权平均,保留图像细节但计算复杂度较高 。 24 | - **维纳滤波**:基于最小均方误差准则,恢复由噪声污染的图像,效果显著但需预估噪声性质 。 25 | - **同态滤波**:结合对数变换和频域滤波,增强图像对比度,去除光照变化和噪声 。 26 | 27 | ### 2. 图像噪声添加 28 | 系统支持多种噪声类型的添加,以模拟实际应用中的噪声环境,包括高斯噪声、椒盐噪声、泊松噪声和运动噪声等 。 29 | 30 | ### 3. 去噪效果评估 31 | 提供了多种图像质量评价指标,包括峰值信噪比(PSNR)、均方误差(MSE)、信噪比(SNR)和结构相似性指数(SSIM)等,帮助用户客观比较不同去噪算法的性能 。 32 | 33 | ### 4. 用户界面 34 | 系统采用Matlab GUI设计,用户可以通过界面选择去噪方法、设置相关参数、添加噪声以及查看去噪效果图,操作简便直观 。 35 | 36 | ## 结论 37 | 38 | 本项目设计的数字图像处理GUI系统,通过集成多种图像去噪方法和提供直观的用户界面,方便用户进行图像去噪处理和效果评估。该系统具有重要的理论意义和实际应用价值,为推动数字图像处理技术的进步和满足实际应用需求提供了有力支持。 -------------------------------------------------------------------------------- /gif/digital_image_GUI.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kennems/Image_Processing_GUI/879ba5e06d15812c6631e5f6caa6f016753f8a96/gif/digital_image_GUI.gif -------------------------------------------------------------------------------- /lena.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kennems/Image_Processing_GUI/879ba5e06d15812c6631e5f6caa6f016753f8a96/lena.png -------------------------------------------------------------------------------- /报告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kennems/Image_Processing_GUI/879ba5e06d15812c6631e5f6caa6f016753f8a96/报告.docx --------------------------------------------------------------------------------