- 积分
- 14
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-5-29
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2015-5-29 21:08:07
|
显示全部楼层
- % Yigang Peng, Arvind Ganesh, November 2009.
- % Questions? abalasu2@illinois.edu
- %
- % Copyright: Perception and Decision Laboratory, University of Illinois, Urbana-Champaign
- % Microsoft Research Asia, Beijing
- %
- % Reference: RASL: Robust Alignment by Sparse and Low-rank Decomposition for Linearly Correlated Images
- % Yigang Peng, Arvind Ganesh, John Wright, Wenli Xu, and Yi Ma. Proc. of CVPR, 2010.
- %
- % robust batch image alignment example
- % clear
- clc ;
- %clear all;
- close all ;
- % addpath
- addpath RASL_toolbox ;
- addpath data ;
- addpath results ;
- %% define images' path
- currentPath = cd;
- % input path
- imagePath = fullfile(currentPath,'data','LFW') ;
- pointPath = fullfile(currentPath,'data','LFW') ; % path to files containing initial feature(eye) coordinates
- userName = 'Jacques_Chirac' ;
- % one of
- % 'Gloria_Macapagal_Arroyo', 'Jennifer_Capriati', 'Laura_Bush',
- % 'Serena_Williams', 'Barack_Obama', 'Ariel_Sharon',
- % 'Arnold_Schwarzenegger', 'Colin_Powell', 'Donald_Rumsfeld',
- % 'George_W_Bush', 'Gerhard_Schroeder', 'Hugo_Chavez',
- % 'Jacques_Chirac', 'Jean_Chretien', 'John_Ashcroft',
- % 'Junichiro_Koizumi', 'Lleyton_Hewitt', 'Luiz_Inacio_Lula_da_Silva',
- % 'Tony_Blair', 'Vladimir_Putin'
- % output path
- destRoot = fullfile(currentPath,'results') ;
- destDir = fullfile(destRoot,userName) ;
- if ~exist(destDir,'dir')
- mkdir(destRoot,userName) ;
- end
- %% define parameters
- % dispaly flag
- raslpara.DISPLAY = 1 ;
- % save flag
- raslpara.saveStart = 1 ;
- raslpara.saveEnd = 1 ;
- raslpara.saveIntermedia = 0 ;
- % for face images
- raslpara.canonicalImageSize = [ 120 100 ];
- raslpara.canonicalEyeCoords = [ 5 25 ; ...
- 5 5 ];
-
- % parametric tranformation model
- raslpara.transformType = 'SIMILARITY';
- % one of 'TRANSLATION', 'SIMILARITY', 'AFFINE','HOMOGRAPHY'
- raslpara.numScales = 1 ; % if numScales > 1, we use multiscales
- % main loop
- raslpara.stoppingDelta = .000001; % stopping condition of main loop
- raslpara.maxIter = 250; % maximum iteration number of main loops
- % inner loop
- raslpara.inner_tol = 1e-6 ;
- raslpara.inner_maxIter = 1000 ;
- raslpara.continuationFlag = 1 ;
- raslpara.mu = 1e-3 ;
- raslpara.lambdac = 3 ; % lambda = lambdac/sqrt(m)
- %% Get training images
- % get initial transformation
- transformationInit = 'SIMILARITY';
- [fileNames, transformations, numImages] = get_training_images( imagePath, pointPath, userName, raslpara.canonicalEyeCoords, transformationInit) ;
- %% RASL main loop: do robust batch image alignment
- [D, Do, A, E, xi, numIterOuter, numIterInner ] = rasl_main(fileNames, transformations, numImages, raslpara, destDir);
- %% plot the results
- layout.xI = 5 ;
- layout.yI = 7 ;
- layout.gap = 2 ;
- layout.gap2 = 1 ;
- rasl_plot(destDir, numImages, raslpara.canonicalImageSize, layout)
复制代码
这是主要的代码部分,其中有
% for face images
raslpara.canonicalImageSize = [ 120 100 ];
raslpara.canonicalEyeCoords = [ 5 25 ; ...
5 5 ];
我感觉是识别区域的,求大神讲解 |
|