File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -366,7 +366,21 @@ test('Mean', function(assert) {
366
366
assert . end ( ) ;
367
367
} ) ;
368
368
369
+ test ( 'MatchTemplateByMatrix' , function ( assert ) {
370
+ var cv = require ( '../lib/opencv' ) ;
371
+ cv . readImage ( "./examples/files/car1.jpg" , function ( err , target ) {
372
+ cv . readImage ( "./examples/files/car1_template.jpg" , function ( err , template ) {
373
+ var res = target . matchTemplateByMatrix ( template , cv . Constants . TM_CCORR_NORMED ) ;
374
+ var minMax = res . minMaxLoc ( ) ;
375
+ var topLeft = minMax . maxLoc ;
376
+ assert . ok ( topLeft , "Found Match" ) ;
377
+ console . log ( topLeft . x === 717 ) ;
378
+ assert . equal ( topLeft . x , 717 , "match location x === 717" ) ;
379
+ assert . equal ( topLeft . y , 0 , "match location y === 717" ) ;
380
+ assert . end ( ) ;
381
+ } ) ;
382
+ } )
383
+ } ) ;
384
+
369
385
// Test the examples folder.
370
386
require ( './examples' ) ( )
371
-
372
-
You can’t perform that action at this time.
0 commit comments