MCPcopy Index your code
hub / github.com/makelove/OpenCV-Python-Tutorial / train

Method train

官方samples/digits.py:83–84  ·  view source on GitHub ↗
(self, samples, responses)

Source from the content-addressed store, hash-verified

81 self.model = cv2.ml.KNearest_create()
82
83 def train(self, samples, responses):
84 self.model.train(samples, cv2.ml.ROW_SAMPLE, responses)
85
86 def predict(self, samples):
87 retval, results, neigh_resp, dists = self.model.findNearest(samples, self.k)

Callers

nothing calls this directly

Calls 1

trainMethod · 0.45

Tested by

no test coverage detected