[10] | 1 | %CHICKENPIECES
|
---|
| 2 | %
|
---|
| 3 | % D = CHICKENPIECES(NORM,COST,DIR)
|
---|
| 4 | %
|
---|
| 5 | % Reads the original, asymmetric distances
|
---|
| 6 |
|
---|
| 7 | function a = chickenpieces(norm,cost,dirname)
|
---|
| 8 | if nargin < 3
|
---|
| 9 | dirname = ['/data/pr/projects/dissim/data/chickenpieces/chickenpieces_norm' num2str(norm) '.0'];
|
---|
| 10 | if ispc
|
---|
| 11 | dirname = ['s:\root' dirname];
|
---|
| 12 | end
|
---|
| 13 | end
|
---|
| 14 | if nargin < 2
|
---|
| 15 | dir(dirname)
|
---|
| 16 | a = [];
|
---|
| 17 | return
|
---|
| 18 | end
|
---|
| 19 | name = ['chickenpieces_norm' num2str(norm) '.0_AngleCostFunction' num2str(cost) '.0.dm'];
|
---|
| 20 | a = prtbunke(fullfile(dirname,name));
|
---|
| 21 | if length(a)==1 & a==-1
|
---|
| 22 | return
|
---|
| 23 | end
|
---|
| 24 | a = setprior(a,getprior(a,0));
|
---|
| 25 | %a = (a + a')/2;
|
---|
| 26 | a = setname(a,['Chickenpieces-' int2str(norm) '-' int2str(cost)]);
|
---|
| 27 | desc = ['This is one of the chickenpieces dissimilarity matrices as made available by Bunke et.al. ' ...
|
---|
| 28 | 'Every entry is a weighted edit distance between two strings representing the contours of 2D blobs. ' ...
|
---|
| 29 | 'Contours are approximated by vectors of length ' num2str(norm) ...
|
---|
| 30 | '. Angles between vectors are used as replacement costs. ' ...
|
---|
| 31 | 'The costs for insertion and deletion are ' num2str(cost)];
|
---|
| 32 | ref = ['H. Bunke, H., U. Buhler, Applications of approximate string matching to 2D shape recognition, ' ...
|
---|
| 33 | 'Pattern recognition 26 (1993) 1797-1812'];
|
---|
| 34 | link = {'The original dissimilarity datasets', 'http://www.iam.unibe.ch/fki/databases/string-edit-distance-matrices'; ...
|
---|
| 35 | 'The original images','http://algoval.essex.ac.uk/data/sequence/chicken/'; ...
|
---|
| 36 | 'The PRTools versions','http://prlab.tudelft.nl/data/disdatasets.html'};
|
---|
| 37 | a = setuser(a,desc,'desc');
|
---|
| 38 | a = setuser(a,ref,'ref');
|
---|
| 39 | a = setuser(a,link,'link');
|
---|