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

Function checkedTrace

官方samples/lk_homography.py:41–46  ·  view source on GitHub ↗
(img0, img1, p0, back_threshold = 1.0)

Source from the content-addressed store, hash-verified

39 blockSize = 19 )
40
41def checkedTrace(img0, img1, p0, back_threshold = 1.0):
42 p1, st, err = cv2.calcOpticalFlowPyrLK(img0, img1, p0, None, **lk_params)
43 p0r, st, err = cv2.calcOpticalFlowPyrLK(img1, img0, p1, None, **lk_params)
44 d = abs(p0-p0r).reshape(-1, 2).max(-1)
45 status = d < back_threshold
46 return p1, status
47
48green = (0, 255, 0)
49red = (0, 0, 255)

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected