Lines Matching refs:np

28 import numpy as np  namespace
138 first_derivative = np.polyder(coefficients, m=1)
139 second_derivative = np.polyder(coefficients, m=2)
140 extrema = np.roots(first_derivative)
143 if np.polyval(second_derivative, extremum) > 0:
387 rotations_sum = np.cumsum(rotations)
410 gyro_times = np.array([e['time'] for e in gyro_events])
411 all_gyro_rots = np.array([e['z'] for e in gyro_events])
451 gyro_rots = np.array(gyro_rots)
470 x0 = (x-x.mean(0)) / np.sqrt(((x-x.mean(0))**2.0).sum())
471 y0 = (y-y.mean(0)) / np.sqrt(((y-y.mean(0))**2.0).sum())
472 u, _, vt = np.linalg.svd(np.dot(x0.T, y0), full_matrices=False)
473 return np.dot(vt.T, u.T)
501 frame = (frame * 255.0).astype(np.uint8) # cv2 uses [0, 255]
508 pre_mask = np.zeros_like(gframes[0])
528 for pt in np.rint(p0_filtered).astype(int):
557 for x, y in np.rint(p0_filtered[st == 1]).astype(int):
567 rotations = np.array(rotations)
610 shift_candidates = np.arange(-_CORR_TIME_OFFSET_MAX,
633 fit_coeffs, residuals, _, _, _ = np.polyfit(
638 total_sum_of_squares = np.sum(
639 (spatial_distances - np.mean(spatial_distances)) ** 2
662 limited_residuals = np.sum(
663 (np.polyval(fit_coeffs, small_shift_candidates) - small_spatial_distances)
667 limited_total_sum_of_squares = np.sum(
668 (small_spatial_distances - np.mean(small_spatial_distances)) ** 2
727 times = np.array([(e['time'] - gyro_events[0]['time']) * _NSEC_TO_SEC
729 x = np.array([e['x'] for e in gyro_events])
730 y = np.array([e['y'] for e in gyro_events])
731 z = np.array([e['z'] for e in gyro_events])
746 pylab.ylim([np.amin(z)/4, np.amax(z)/4]) # zoom in 4x from z axis
753 pylab.ylim([np.amin(z), np.amax(z)])
779 gyro_times = np.array([e['time'] for e in gyro_events])
780 gyro_speed = np.array([e['z'] for e in gyro_events])
794 return np.array(gyro_rotations)