before, the main focus of this paper is not to explore
the FE interface, so for more details about the FE
interface please refer to (Rodrigues, et al., 2013).
Figure 2: Example of a draw made on the Field Editor
representing four players that should be at the red zone
when the ball is inside the green one.
When the user completes the draw of the desired
team movement, typically the coaches or some other
member of the technical team, this has to be passed
to the FootData datacenter so that the depicted
movement is committed to the database (allowing
posterior load and re-edition), and transformed into
code which is then matched against the
acquired/tracked images.
Also outside the scope of this paper is the
tracking framework, developed inside the FootData
project. In resume the tracking framework is
composed by an application capable of doing the
tracking of the players and ball, given images of the
full size pitch. Please refer to (Rodrigues, et al.,
2013) for further details.
3 SERIALIZATION OF THE
DRAWN SCHEMAS
Returning to the communication between the FE
(web application) and the FootData datacenter, a
serialization process was thought tacking into
consideration the fact that the FE is implemented
over JavaScript and the FootData’s libraries used for
the verification of the procedures were programmed
in Python. In this case, the draw is converted to a
JSON document (JSON, 2014), which is a
lightweight data-interchange format. Using the
JSON type of format allowed us to take advantage of
(1) the JavaScript facilities to treat JSON
documents, (2) the fact that those documents are
very similar to Python dictionaries avoiding intricate
parsing procedures, and (3) the fact that the database
used to store the document is MongoDB
(MongoDB, 2014). MongoDB is a cross-platform
document-oriented database system, classified as a
noSQL database, which eschews the traditional
table-based relational database structure in favor of
JSON-like documents.
Figure 3 shows an example of the JSON
document generated by the FE to translate the
procedure depicted in Figure 2. The JSON document
has a predefined structure, that include the scheme
name, the type, the field dimensions, the field scale,
the players, the ball, the lines, the distances and a list
of conditions.
In more detail, the name attribute refers to the
name given by the coach to the drawn schema and
the type is used to categorize the procedures. The
attributes field_dimension and field_scale have also
to be passed, because the soccer pitch image used in
the field editor has been designed to a normalized
field dimension, which in general will not match the
dimensions of the majority of the stadiums, who
have slightly varying sizes. Knowing the field
dimensions where the game will occur and drawn
the specific game schemas to be detected, it is then
possible to adjust the depicted procedure to a
particular stadium.
The players attribute has an array that takes an
embed JSON object, a subdocument, for each player
inserted in the field editor, following the structure:
{"id":#, "number":#, "team":"#", "points": [#, #]}. A
different id is attributed to each object inserted in the
FE, so we can refer to any object by its id. The
subdocument has also the player's team, number,
field points (which is the player's coordinates on the
pitch, in pixels) and radius (value in meters in which
the player position can vary).
Figure 3: Example of JSON document generated at the
FE.
{“name”: “schema 1”, “description”: “BP”,
“type”: “DP”, “field_dimension”: [105, 68],
“field_scale”: [0.1, 0.1],
“players”:[{“id”:1,“number”:1,”team”:“A”,“points”:[514
,559],“radius”:3},{“id”:2,“number”:2,“team”:“A”,
“points”:[486, 438],“radius”:3},{“id”:3,“number”:3,
“team”:“A”,“points”:[483,314],“radius”: 3},{“id”:4,
”number”:4,”team”:“A”,“points”:[507,197],“radius”:3}
],
“ball”:{“id”:5,”points”:[762, 320],“owner”: “None”},
“zones”:[{“id”:7,“name”:“Zone 7”,“points”:[[945,498],
[945,198],[611,198],[611,498]]},{“id”:6,“name”:“Zone
6”,“points”:[[546,603],[546,103],[409,103],[409,
603]]}],
“lines”:[{“id”:10,”objects”:[3,4]},{“id”: 9,”objects”:
[2,3]},{“id”:8,”objects”:[1, 2]}],
“distances”:[{“objects”:[3,4],“distance”:12,“margin”:3
},{“objects”:[2,3],“distance”:12,“margin”:3},
{“objects”: [1, 2], “distance”: 12, “margin”: 3}],
“conditions”:[[{“verify_location”:[1,“IN”,6]},
{“verify_location”:[2,“IN”,6]},{“verify_location”:[
3,“IN”,6]},{“verify_location”:[4,“IN”,6]},
{“verify_location”:[5,“IN”,7]},{“verify_distances”:
true}],[{“alert”:“True”,msg”:“Pressing the ball “}],
[{“alert”: “False”,”msg”: ““}]]
}
AVisualProgrammingLanguageforSoccer
123