-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmotion.testing
More file actions
executable file
·63 lines (33 loc) · 1.29 KB
/
motion.testing
File metadata and controls
executable file
·63 lines (33 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
open List;;
(* get image data *)
#use"test1.caml";; (** i1 *)
#use"test2.caml";; (** i2 *)
#use"test1b.caml";; (** i1b *)
#use"test2b.caml";; (** i2b *)
#use"test1c.caml";; (** i1c *)
#use"test2c.caml";; (** i2c *)
#use"test1d.caml";; (** i1d -- case c reversed *)
#use"test2d.caml";; (** i2d *)
(*********************** testing cases ***********************)
let tst1 = diffImRow(hd(i1),hd(i2));;
let tst2 = diffIm(i1,i2);;
let nd1 = noDiff(diffIm(i1,i2));;
let nd2 = noDiff(diffIm(i1,i1));;
let nd3 = noDiff(diffIm(i2,i1));;
let pp1 = pp_my_image(i1);;
let pp2 = pp_my_image(i2);;
let mn1 = maskneg(i1,diffIm(i1,i2));;
let mp1 = maskpos(i2,diffIm(i1,i2));;
let fnzr1 = rowmaskneg([2;2;4;5;6;2;2;2],[0;0;-1;-2;-3;0;0;0]);;
let fnzr1b = rowmaskpos([2;2;4;5;6;2;2;2],[0;0;-1;-2;-3;0;0;0]);;
let fnzr2 = rowmaskpos([2;2;4;5;6;2;2;2],[0;0;+1;+2;+3;0;0;0]);;
let fnzr2b = rowmaskneg([2;2;4;5;6;2;2;2],[0;0;+1;+2;+3;0;0;0]);;
let fnz1 = firstnonzero(maskneg(i1,diffIm(i1,i2)));;
let fnz2 = firstnonzero(maskpos(i2,diffIm(i1,i2)));;
let td1 = tuplediffint((5,4),(2,5));;
(* the bigger tests *)
let ans1 = motion(i1,i2);;
let ans2 = motion(i1b,i2b);;
let ans2c = motion(i1c,i2c);;
let ans2d = motion(i1d,i2d);;
let ans3ex = motion(i1,i1);; (* throws exception; test last *)