⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_glcm_features.m

📁 segmentation code in image processing
💻 M
字号:
% Timing improvement between GLCM_Features1.m and GLCM_Features2.m

clear all

offsetmat = [];
for i = 1:10
    offsetmat = [offsetmat; i*[1 0]];
    I = imread('circuit.tif'); GLCM2 = graycomatrix(I,...
        'NumLevels',64,'Offset',offsetmat);
    
    tic; stats1 = GLCM_Features1(GLCM2,0); t1(i) = toc;
    clear stats1 
    
    t = cputime; stats1 = GLCM_Features1(GLCM2,0); ct1(i) = cputime-t;
    clear stats1
                        
    
    tic; stats2 = GLCM_Features2(GLCM2,0); t2(i) = toc;
    clear stats2
    
    t = cputime; stats2 = GLCM_Features2(GLCM2,0); ct2(i) = cputime-t;
    clear stats2
    
end

figure; subplot(2,1,1);
            hold on
            plot(t1,'-*');
            plot(t2,':sr');
            xlabel('No. of GLCMs input');
            ylabel('Execution time (secs)');
            legend('GLCM Features1','GLCM Features2');
            hold off
       subplot(2,1,2);
            hold on
            plot(ct1,'-*');
            plot(ct2,':sr');
            xlabel('No. of GLCMs input');
            ylabel('CPU time (secs)');   
            legend('GLCM Features1','GLCM Features2');
            hold off              
                      

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -