pdfbclassify_texture.m

来自「matlab官方网站中的用于图像融合技术的contourlet变换源代码」· M 代码 · 共 59 行

M
59
字号
% pdfbclassify_texture.m% written by: Duncan Po% Date: December 3, 2002% perform texture classification based on contourlets % % Usage:    kld = pdfbclassify_texture(qimage, qformat, tdb, tdir, mdir, firsttime)% Inputs:   qimage      - query texture image file name%           qformat     - format of the query texture image file%           tdb         - texture database: vector (using cell structure)%                           of the names of all the texture images%                           e.g. {'texture1', 'texture2', 'texture3'}%           tdir        - texture directory: full path of the directory %                           that contains the texture images%           mdir        - model directory: full path of the directory that %                           either contains the texture models, or that is%                           for saving of the texture models%           firsttime   - set to 1 if this is the first time that this%                           algorithm is run and no model is available%                           for the database images, set to 0 otherwise           % Output:   kld         - the Kublick Liebler distance between the treesfunction kld = pdfbclassify_texture(qimage, qformat, tdb, tdir, mdir, firsttime)N = 8;NN = 16;if tdir(end) ~= '/'    tdir = strcat(tdir, '/');end;if mdir(end) ~= '/'    mdir = strcat(mdir, '/');end;mdir = strcat(mdir, '/');[kld, kld2] = pdfbtestall_imagekld(qimage, qformat, tdb, tdir, mdir, N, firsttime);[skld2, ind2] = sort(kld2);ind2 = ind2(1:NN-1);original = imread(qimage, qformat);figure;subplot(4,4,1);imshow(original);for ploti = 2:NN    dbimagenum = floor((ind2(ploti-1)-1)/N)+1;    dbimage = tdb{dbimagenum};    dbimagenum = mod(ind2(ploti-1)-1, N)+1;    file = sprintf('%s%s%02d', tdir, dbimage, dbimagenum);    qresult = imread(file, 'bmp');    subplot(4,4,ploti);    imshow(qresult);end;

⌨️ 快捷键说明

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