Lines Matching refs:np
16 import numpy as np namespace
29 state = 0.1 * np.random.randn(2, 1)
31 kalman.transitionMatrix = np.array([[1., 1.], [0., 1.]])
32 kalman.measurementMatrix = 1. * np.ones((1, 2))
33 kalman.processNoiseCov = 1e-5 * np.eye(2)
34 kalman.measurementNoiseCov = 1e-1 * np.ones((1, 1))
35 kalman.errorCovPost = 1. * np.ones((2, 2))
36 kalman.statePost = 0.1 * np.random.randn(2, 1)
40 return (np.around(img_width/2 + img_width/3*cos(angle), 0).astype(int),
41 np.around(img_height/2 - img_width/3*sin(angle), 1).astype(int))
50 measurement = kalman.measurementNoiseCov * np.random.randn(1, 1)
53 measurement = np.dot(kalman.measurementMatrix, state) + measurement
67 img = np.zeros((img_height, img_width, 3), np.uint8)
68 draw_cross(np.int32(state_pt), (255, 255, 255), 3)
69 draw_cross(np.int32(measurement_pt), (0, 0, 255), 3)
70 draw_cross(np.int32(predict_pt), (0, 255, 0), 3)
77 process_noise = kalman.processNoiseCov * np.random.randn(2, 1)
78 state = np.dot(kalman.transitionMatrix, state) + process_noise