Hide last authors
stu122612 5.1 1 = Motivation =
stu122612 3.1 2
stu122612 5.1 3 Attempting to decouple the SCCharts Controller and physics calculations (amongst other things) from fixed pixel coordinates a world coordinate system was introduced. This coordinate system has its origin in the center between the two bottom flipper tips. Standing in front of the flipper the Y-axis points upwards on the playing field and the X-axis points to the right. One unit in the world coordinate system corresponds to 1m.
4
5 The main program relies on a (at compile-time present) transformation matrix definition which can be generated and tested with a small standalone tool. Testing requires recompilation of the tool. As there is no depth information available, points in the image that are in the same 2D position of an orthographic parallel view onto the playing field will be in different positions with the generated transformation, so this solution is certainly not exact.
6
7 = Calibration =
8
9 == Compiling ==
10
Richard Kreissig 9.1 11 >
stu122612 5.1 12
stu120505 8.1 13 {{{make calibrate}}}
stu122612 5.1 14
stu120505 8.1 15 This produces a binary fileĀ {{code language="none"}}calibrate{{/code}} in the same directory.
stu122612 5.1 16
17 == Usage ==
18
stu122612 6.1 19 (% class="wrapped" %)
stu122612 5.1 20 |=(((
21 Button
22 )))|=(((
23 Function
24 )))
25 |(((
26 1-4
27 )))|(((
28 Choose the index of the point to set
29 )))
30 |(((
31 t
32 )))|(((
33 Enters a test mode, which prints clicked pixel coordinates in the world coordinate system via the configured transformation matrix in the console. This matrix must be present in the file
34
35 {{code language="none"}}
36 calibration_config.h
37 {{/code}}
38
39 at compile time.
40 )))
41 |(((
42 w
43 )))|(((
44 Generates and writes a transformation matrix from the four points (if all are present) into the file
45
46 {{code language="none"}}
47 calibration_config.h
48 {{/code}}
49
50
51 )))
52 |(((
53 q
54 )))|(((
55 Quits the program
56 )))
57
stu122612 3.1 58 = Reference Points =
59
stu122612 4.1 60 (% class="wrapped" %)
stu122612 3.1 61 |=(% colspan="1" %)(% colspan="1" %)
62 (((
63 Point #
64 )))|=(((
65 Point in Image
66 )))|=(((
stu122612 4.1 67 Description (when looking at flipper)
stu122612 3.1 68 )))|=(((
69 Position in World Coordinates (Measured in meters)
70 )))
71 |(% colspan="1" %)(% colspan="1" %)
72 (((
73 1
74 )))|(((
75 top right
76 )))|(((
stu122612 4.1 77 Top of the left outlane detector wire
stu122612 3.1 78 )))|(((
79 -0.203, 0.106
80 )))
81 |(% colspan="1" %)(% colspan="1" %)
82 (((
83 2
84 )))|(((
85 bottom right
86 )))|(((
stu122612 4.1 87 Horizontal middle of the top edge of the black square on the tube shaped graphic
stu122612 3.1 88 )))|(((
89 -0.164, 0.685
90 )))
91 |(% colspan="1" %)(% colspan="1" %)
92 (((
93 3
94 )))|(((
95 bottom left
96 )))|(((
stu122612 4.1 97 Bottom right corner of the letter 'E' trigger (right side of the ramp)
stu122612 3.1 98 )))|(((
99 0.199, 0.637
100 )))
101 |(% colspan="1" %)(% colspan="1" %)
102 (((
103 4
104 )))|(((
105 top left
106 )))|(((
stu122612 4.1 107 Bottom of the right outlane detector wire
stu122612 3.1 108 )))|(((
109 0.200, 0.103
110 )))
111
112 [[image:attach:CalibrationPoints.png]]
113
Richard Kreissig 9.1 114 Uncropped Image
stu122612 3.1 115 [[image:attach:2020-03-03-181059_1920x1200_scrot.png]]
stu122612 6.1 116
Richard Kreissig 9.1 117
stu122612 6.1 118 [[image:attach:geogebra.png]]
119
Richard Kreissig 9.1 120 Geogebra File
stu122612 6.1 121
Richard Kreissig 9.1 122 [[geogebra.png>>attach:geogebra.png]]
stu122612 6.1 123
stu122612 7.1 124
125 The reference points used in the calibration (see table) were empirically corrected to the left, as the coordinate system resulting from the generated transformation was slightly shifted to the right. This may have been the case because it is hard to //exactly// match the reference points to pixels in the image. Subsequent calibrations may yield different errors in the coordinate system.