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

Function motion_kernel

官方samples/deconvolution.py:52–59  ·  view source on GitHub ↗
(angle, d, sz=65)

Source from the content-addressed store, hash-verified

50 return img*w + img_blur*(1-w)
51
52def motion_kernel(angle, d, sz=65):
53 kern = np.ones((1, d), np.float32)
54 c, s = np.cos(angle), np.sin(angle)
55 A = np.float32([[c, -s, 0], [s, c, 0]])
56 sz2 = sz // 2
57 A[:,2] = (sz2, sz2) - np.dot(A[:,:2], ((d-1)*0.5, 0))
58 kern = cv2.warpAffine(kern, A, (sz, sz), flags=cv2.INTER_CUBIC)
59 return kern
60
61def defocus_kernel(d, sz=65):
62 kern = np.zeros((sz, sz), np.uint8)

Callers 1

updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected