1 #ifndef ANDROID_DVR_TRACKING_TYPES_H_ 2 #define ANDROID_DVR_TRACKING_TYPES_H_ 3 4 #include <stdint.h> 5 #include <sys/cdefs.h> 6 7 __BEGIN_DECLS 8 9 typedef struct DvrTrackingBufferMetadata { 10 // Specifies the source of this image. 11 uint32_t camera_mask; 12 // Specifies the memory format of this image. 13 uint32_t format; 14 /// The width of the image data. 15 uint32_t width; 16 /// The height of the image data. 17 uint32_t height; 18 /// The number of bytes per scanline of image data. 19 uint32_t stride; 20 /// The frame number of this image. 21 int32_t frame_number; 22 /// The timestamp of this image in nanoseconds. Taken in the middle of the 23 /// exposure interval. 24 int64_t timestamp_ns; 25 // This is the timestamp for recording when the system using the HAL 26 // received the callback. It will not be populated by the HAL. 27 int64_t callback_timestamp_ns; 28 /// The exposure duration of this image in nanoseconds. 29 int64_t exposure_duration_ns; 30 } DvrTrackingBufferMetadata; 31 32 // Represents a set of features extracted from a camera frame. Note that this 33 // should be in sync with TangoHalCallbacks defined in tango-hal.h. 34 typedef struct DvrTrackingFeatures { 35 // Specifies the source of the features. 36 uint32_t camera_mask; 37 38 // This is unused. 39 uint32_t unused; 40 41 // The timestamp in nanoseconds from the image that generated the features. 42 // Taken in the middle of the exposure interval. 43 int64_t timestamp_ns; 44 45 // This is the timestamp for recording when the system using the HAL 46 // received the callback. It will not be populated by the HAL. 47 int64_t callback_timestamp_ns; 48 49 // The frame number from the image that generated the features. 50 int64_t frame_number; 51 52 // The number of features. 53 int count; 54 55 // An array of 2D image points for each feature in the current image. 56 // This is sub-pixel refined extremum location at the fine resolution. 57 float (*positions)[2]; 58 59 // The id of these measurements. 60 int32_t* ids; 61 62 // The feature descriptors. 63 uint64_t (*descriptors)[8]; 64 65 // Laplacian scores for each feature. 66 float* scores; 67 68 // Is this feature a minimum or maximum in the Laplacian image. 69 // 0 if the feature is a maximum, 1 if it is a minimum. 70 int32_t* is_minimum; 71 72 // This corresponds to the sub-pixel index of the laplacian image 73 // that the extremum was found. 74 float* scales; 75 76 // Computed orientation of keypoint as part of FREAK extraction, except 77 // it's represented in radians and measured anti-clockwise. 78 float* angles; 79 80 // Edge scores for each feature. 81 float* edge_scores; 82 } DvrTrackingFeatures; 83 84 // Represents a sensor event. 85 typedef struct DvrTrackingSensorEvent { 86 // The sensor type. 87 int32_t sensor; 88 89 // Event type. 90 int32_t type; 91 92 // This is the timestamp recorded from the device. Taken in the middle 93 // of the integration interval and adjusted for any low pass filtering. 94 int64_t timestamp_ns; 95 96 // The event data. 97 float x; 98 float y; 99 float z; 100 } DvrTrackingSensorEvent; 101 102 __END_DECLS 103 104 #endif // ANDROID_DVR_TRACKING_TYPES_H_ 105