blob: 5a1384e35b32f53db32b6ea819f03539e4dffaaf [file] [log] [blame]
Brian Silvermanfac9b872020-02-05 20:07:38 -08001namespace frc971.vision.sift;
2
3// Represents a single feature extracted from an image.
4table Feature {
5 // Contains the descriptor data.
6 //
7 // TODO(Brian): These are scaled to be convertible to chars. Should we do
8 // that to minimize storage space? Or maybe int16?
9 //
10 // The size of this depends on the parameters. It is width*width*hist_bins.
11 // Currently we have width=4 and hist_bins=8, which results in a size of
12 // 4*4*8=128.
13 descriptor:[float];
14
15 // Location of the keypoint.
16 x:float;
17 y:float;
18
19 // Size of the keypoint neighborhood.
20 size:float;
21
22 // Angle of the keypoint.
23 // This is in [0,360) clockwise.
24 angle:float;
25
26 // How good of a keypoint this is.
27 response:float;
28
29 // Which octave this keypoint is from.
30 octave:int;
31}
32
33// Represents a single match between a training image and a query image.
34table Match {
35 // The index of the feature for the query image.
36 query_feature:int;
37 // The index of the feature for the training image.
38 train_feature:int;
39}
40
41// Represents all the matches between a single training image and a query
42// image.
43table ImageMatch {
44 matches:[Match];
45 // The index of the training image within all the training images.
46 train_image:int;
47}
48
49table TransformationMatrix {
50 // The matrix data. This is a row-major 3x4 matrix.
51 data:[double];
52}
53
54// Contains the information the EKF wants from an image.
55//
56// This is represented as a transformation to a target in field coordinates.
57table CameraPose {
58 // Transformation matrix from the target to the camera's origin.
59 camera_to_target:TransformationMatrix;
60
61 // Field coordinates of the target, represented as a transformation matrix
62 // from the target to the field.
63 // (0, 0, 0) is the center of the field, on the level of most of the field
64 // (not the region under the truss). Positive X is towards the red alliance's
65 // PLAYER STATION. Positive Z is up. The coordinate system is right-handed.
66 //
67 // Note that the red PLAYER STATION is where the red drive teams are. This is
68 // often where the blue robots are shooting towards.
69 //
70 // The value here will be selected from a small, static set of targets we
71 // train images on.
72 field_to_target:TransformationMatrix;
73}
74
75table ImageMatchResult {
76 // The matches from this image to each of the training images which matched.
77 image_matches:[ImageMatch];
78 // The transformations for this image for each of the training images which
79 // matched.
80 // TODO(Brian): Include some kind of covariance information for these.
81 camera_poses:[CameraPose];
82
83 // The features for this image.
84 features:[Feature];
Brian Silverman967e5df2020-02-09 16:43:34 -080085
86 // Timestamp when the frame was captured.
87 image_monotonic_timestamp_ns:long;
Brian Silvermanfac9b872020-02-05 20:07:38 -080088}
89
90root_type ImageMatchResult;