MCPcopy Create free account
hub / github.com/cdcseacave/openMVS / fit

Method fit

scripts/python/ImportDMAPs.py:122–131  ·  view source on GitHub ↗
(self, X, y)

Source from the content-addressed store, hash-verified

120 self.shift = shift
121
122 def fit(self, X, y):
123 # Solve for scale and shift
124 assert len(X) >= 2, "At least two samples are required for RANSAC"
125 if X[1][0] - X[0][0] == 0:
126 return
127 scale = (y[1][0] - y[0][0]) / (X[1][0] - X[0][0])
128 if scale <= 0:
129 return
130 self.scale = scale
131 self.shift = y[0][0] - scale * X[0][0]
132
133 def predict(self, X):
134 return self.scale * X + self.shift

Callers 1

scale_depth_mapFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected