@@ -25,8 +25,11 @@ const getBriefOptions: GetBriefOptions = {
25
25
bestKptRadius : 5 ,
26
26
} ;
27
27
28
+ const firstNumber = 1 ;
29
+ const secondNumber = 2 ;
30
+
28
31
let source = readSync (
29
- ' ../../test/img/featureMatching/id-crops/crop1 .png' ,
32
+ ` ../../test/img/featureMatching/id-crops/crop ${ firstNumber } .png` ,
30
33
) . convertColor ( ImageColorModel . GREY ) ;
31
34
// fix contrast
32
35
const sourceExtremums = getMinMax ( source ) ;
@@ -37,7 +40,7 @@ source.level({
37
40
} ) ;
38
41
39
42
let destination = readSync (
40
- ' ../../test/img/featureMatching/id-crops/crop3 .png' ,
43
+ ` ../../test/img/featureMatching/id-crops/crop ${ secondNumber } .png` ,
41
44
) . convertColor ( ImageColorModel . GREY ) ;
42
45
// fix contrast
43
46
const destinationExtremums = getMinMax ( destination ) ;
@@ -52,16 +55,10 @@ console.log({
52
55
destination : { width : destination . width , height : destination . height } ,
53
56
} ) ;
54
57
55
- const sliceBriefOptions = { start : 0 , end : 20 } ;
58
+ const sliceBriefOptions = { start : 0 , end : 15 } ;
56
59
57
- const sourceBrief = sliceBrief (
58
- getBrief ( source , getBriefOptions ) ,
59
- sliceBriefOptions ,
60
- ) ;
61
- const destinationBrief = sliceBrief (
62
- getBrief ( destination , getBriefOptions ) ,
63
- sliceBriefOptions ,
64
- ) ;
60
+ const sourceBrief = getBrief ( source , getBriefOptions ) ;
61
+ const destinationBrief = getBrief ( destination , getBriefOptions ) ;
65
62
66
63
console . table ( sourceBrief . keypoints ) ;
67
64
@@ -80,11 +77,11 @@ console.log({
80
77
} ,
81
78
} ) ;
82
79
83
- const matches = bruteForceOneMatch (
84
- sourceBrief . descriptors ,
85
- destinationBrief . descriptors ,
86
- ) ;
87
- console . log ( 'nb matches: ' + matches . length ) ;
80
+ // const matches = bruteForceOneMatch(
81
+ // sourceBrief.descriptors,
82
+ // destinationBrief.descriptors,
83
+ // );
84
+ // console.log('nb matches: ' + matches.length);
88
85
89
86
const crossMatches = getCrosscheckMatches (
90
87
sourceBrief . descriptors ,
@@ -99,17 +96,17 @@ const montage = new Montage(source, destination, {
99
96
100
97
const showDistanceOptions : GetColorsOptions = { minValueFactor : 0.2 } ;
101
98
102
- montage . drawMatches (
103
- matches ,
104
- sourceBrief . keypoints ,
105
- destinationBrief . keypoints ,
106
- {
107
- showDistance : true ,
108
- color : [ 255 , 0 , 0 ] ,
109
- circleDiameter : getBriefOptions . centroidPatchDiameter ,
110
- showDistanceOptions,
111
- } ,
112
- ) ;
99
+ // montage.drawMatches(
100
+ // matches,
101
+ // sourceBrief.keypoints,
102
+ // destinationBrief.keypoints,
103
+ // {
104
+ // showDistance: true,
105
+ // color: [255, 0, 0],
106
+ // circleDiameter: getBriefOptions.centroidPatchDiameter,
107
+ // showDistanceOptions,
108
+ // },
109
+ // );
113
110
114
111
montage . drawMatches (
115
112
crossMatches ,
@@ -136,6 +133,6 @@ montage.drawKeypoints(destinationBrief.keypoints, {
136
133
origin : montage . destinationOrigin ,
137
134
} ) ;
138
135
139
- writeSync ( './ result.png' , montage . image ) ;
136
+ writeSync ( `./results/ result- ${ firstNumber } - ${ secondNumber } .png` , montage . image ) ;
140
137
141
138
console . log ( 'IMAGE WRITTEN TO DISK' ) ;
0 commit comments