1 #include "testlib/testlib_test.h"
2 #include <bapl/bapl_affine_transform.h>
3 #include <bapl/bapl_affine_roi.h>
4 #include <bapl/bapl_mi_matcher.h>
5 #include "vil/vil_load.h"
6 #include "vil/vil_save.h"
7
8
MAIN(test_matcher)9 MAIN( test_matcher )
10 {
11 START ("matcher");
12
13 // Generate an image
14 //--------------------------------------------
15 #if 0
16 unsigned ni=256;
17 unsigned nj=256;
18 vil_image_view<vxl_byte> scene(ni,nj);
19 for (unsigned j=0;j<nj;++j){
20 for (unsigned i=0;i<ni;++i){
21 scene(i,j) = vxl_byte(((i%8)<4)?0:255);
22 }
23 }
24 #endif
25 vil_image_view<vxl_byte> scene = vil_load("C:/Live/Aq1/6/right/00000.tiff");
26 vil_image_view<vxl_byte> scene2 = vil_load("C:/Live/Aq1/6/right/00008.tiff");
27 bapl_affine_transform T(1, 0, 0, 1, 100, 230);
28 bapl_affine_roi roi(scene, T, 32, 32);
29 vil_save(roi.rectified_image(),"region.png");
30 bapl_mi_matcher_params params(25, 2.0, 10.0, 3.0, 2.0 );
31 bapl_mi_matcher matcher(scene2, roi, params);
32
33 matcher.generate();
34 matcher.generate();
35 matcher.generate();
36 matcher.generate();
37
38 bapl_affine_roi roi2(scene2, matcher.best_xform(), 32, 32);
39 vil_save(roi2.rectified_image(), "match.png");
40
41 //testlib_test_begin("identity transformed ROI");
42 //testlib_test_perform(vil_image_view_deep_equality(region, crop));
43
44 SUMMARY();
45 }
46