motion
Converts Delta events into Motion events that signify an object moving in a direction
DeltaList = list[DeltaFeature]
module-attribute
Motion
Bases: FeatureExtractor[MotionFeature]
Component that consumes Delta events and produces Motion events
Source code in roc/feature_extractors/motion.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
delta_list = []
instance-attribute
__init__()
Source code in roc/feature_extractors/motion.py
98 99 100 |
|
event_filter(e)
Source code in roc/feature_extractors/motion.py
102 103 104 105 106 |
|
get_feature(e)
Source code in roc/feature_extractors/motion.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
MotionFeature
dataclass
Bases: Feature[MotionNode]
A vector describing a motion, including the start point, end point, direction and value of the thing moving
Source code in roc/feature_extractors/motion.py
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 |
|
direction
instance-attribute
end_point
instance-attribute
feature_name = 'Motion'
class-attribute
instance-attribute
start_point
instance-attribute
type
instance-attribute
__init__(*, feature_name='Motion', start_point, end_point, type, direction)
__str__()
Source code in roc/feature_extractors/motion.py
41 42 |
|
get_points()
Source code in roc/feature_extractors/motion.py
44 45 |
|
node_hash()
Source code in roc/feature_extractors/motion.py
47 48 |
|
MotionNode
Bases: FeatureNode
Source code in roc/feature_extractors/motion.py
20 21 22 23 24 25 26 |
|
attr_strs
property
direction
instance-attribute
type
instance-attribute
adjacent_direction(d1, d2)
Helper function to convert two positions into a direction such as 'UP' or 'DOWN_LEFT'
Source code in roc/feature_extractors/motion.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
emit_motion(mc, old_delta, new_delta)
Source code in roc/feature_extractors/motion.py
151 152 153 154 155 156 157 158 159 160 |
|