MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / compose

Function compose

rtpose_wrapper/python/caffe/coord_map.py:89–103  ·  view source on GitHub ↗

Compose a base coord map with scale a1, shift b1 with a further coord map with scale a2, shift b2. The scales multiply and the further shift, b2, is scaled by base coord scale a1.

(base_map, next_map)

Source from the content-addressed store, hash-verified

87
88
89def compose(base_map, next_map):
90 """
91 Compose a base coord map with scale a1, shift b1 with a further coord map
92 with scale a2, shift b2. The scales multiply and the further shift, b2,
93 is scaled by base coord scale a1.
94 """
95 ax1, a1, b1 = base_map
96 ax2, a2, b2 = next_map
97 if ax1 is None:
98 ax = ax2
99 elif ax2 is None or ax1 == ax2:
100 ax = ax1
101 else:
102 raise AxisMismatchException
103 return ax, a1 * a2, a1 * b2 + b1
104
105
106def inverse(coord_map):

Callers 1

coord_map_from_toFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected