Functions | |
def | ang_of_vec |
def | approx_equal |
def | approx_equalv |
def | argmax2d |
NUMPY HELPER FUNCTIONS. | |
def | avg_ang |
def | best_turn_dir |
def | blend |
MISCELLANEOUS MATH HELPER FUNCTIONS. | |
def | blend_ang |
def | bound |
Bound the value of a number to be above lower, and lower than upper. | |
def | bound_mat |
def | cart_of_pol |
def | degrees |
def | homo_to_point |
def | list_mat_to_mat |
def | list_of_mat |
def | nearest |
def | norm |
def | point_to_homo |
def | pol_of_cart |
def | radians |
def | renormalize |
Changes the range of an numpy array to betwen [0, 255] from it's [min_value, max_value]. | |
def | rnd |
def | standard_rad |
def | vec_of_ang |
Angles related functions. | |
Variables | |
diff_vec = mat-target | |
tuple | dist = np.power(np.sum(np.power(diff_vec, pwr),axis=0),0.5) |
tuple | indices = np.concatenate((np.matrix(range(sort_order.shape[1])), sort_order), 0) |
tuple | mat = ut.load_pickle('mat.pkl') |
tuple | pwr = np.ones_like(mat[0]) |
tuple | sort_order = dist.argsort(axis=1) |
tuple | target = ut.load_pickle('target.pkl') |
Definition at line 50 of file math_util.py.
def rfid_datacapture::math_util::approx_equal | ( | a, | |
b, | |||
epsilon = .001 |
|||
) |
Definition at line 32 of file math_util.py.
def rfid_datacapture.math_util.approx_equalv | ( | a, | |
b, | |||
epsilon = .001 |
|||
) |
Definition at line 35 of file math_util.py.
def rfid_datacapture.math_util.argmax2d | ( | mat | ) |
NUMPY HELPER FUNCTIONS.
Find the maximal position in a 2D array
Definition at line 98 of file math_util.py.
def rfid_datacapture.math_util.avg_ang | ( | wa, | |
a, | |||
wb, | |||
b | |||
) |
Calculates the average between two angles wa weight of first angle a first angle wb weight of second angle b second angle
Definition at line 54 of file math_util.py.
def rfid_datacapture.math_util.best_turn_dir | ( | reference, | |
new_angle | |||
) |
positive is left, negative is right!
Definition at line 73 of file math_util.py.
def rfid_datacapture.math_util.blend | ( | alpha, | |
a, | |||
b | |||
) |
MISCELLANEOUS MATH HELPER FUNCTIONS.
Definition at line 182 of file math_util.py.
def rfid_datacapture.math_util.blend_ang | ( | alpha, | |
a, | |||
b | |||
) |
Definition at line 64 of file math_util.py.
def rfid_datacapture.math_util.bound | ( | value, | |
lower, | |||
upper | |||
) |
Bound the value of a number to be above lower, and lower than upper.
Definition at line 10 of file math_util.py.
def rfid_datacapture.math_util.bound_mat | ( | m, | |
lower, | |||
upper | |||
) |
Definition at line 21 of file math_util.py.
Finds cartesian coordinates of polar points [r, t]'
Definition at line 77 of file math_util.py.
def rfid_datacapture.math_util.degrees | ( | mat | ) |
Definition at line 41 of file math_util.py.
Definition at line 203 of file math_util.py.
def rfid_datacapture.math_util.list_mat_to_mat | ( | list_mat, | |
axis = 0 |
|||
) |
Definition at line 113 of file math_util.py.
def rfid_datacapture.math_util.list_of_mat | ( | mat | ) |
Definition at line 116 of file math_util.py.
def rfid_datacapture.math_util.nearest | ( | mat, | |
target | |||
) |
Return a sorted list of the nearest (euclidean dist) element of a matrix to a target value and their indeices. @param mat mxn @param target mx1
Definition at line 120 of file math_util.py.
def rfid_datacapture.math_util.norm | ( | mat | ) |
Calculate L2 norm for column vectors in a matrix
Definition at line 188 of file math_util.py.
Convert points into homogeneous coordinates
Definition at line 197 of file math_util.py.
Find polar coordinates of cartesian points [x, y]'
Definition at line 85 of file math_util.py.
def rfid_datacapture.math_util.radians | ( | mat | ) |
Definition at line 38 of file math_util.py.
def rfid_datacapture.math_util.renormalize | ( | npimage_gray | ) |
Changes the range of an numpy array to betwen [0, 255] from it's [min_value, max_value].
Definition at line 107 of file math_util.py.
def rfid_datacapture.math_util.rnd | ( | v | ) |
Definition at line 194 of file math_util.py.
Definition at line 67 of file math_util.py.
Angles related functions.
Definition at line 47 of file math_util.py.
Definition at line 153 of file math_util.py.
tuple rfid_datacapture::math_util::dist = np.power(np.sum(np.power(diff_vec, pwr),axis=0),0.5) |
Definition at line 155 of file math_util.py.
tuple rfid_datacapture::math_util::indices = np.concatenate((np.matrix(range(sort_order.shape[1])), sort_order), 0) |
Definition at line 159 of file math_util.py.
Definition at line 150 of file math_util.py.
tuple rfid_datacapture::math_util::pwr = np.ones_like(mat[0]) |
Definition at line 154 of file math_util.py.
tuple rfid_datacapture::math_util::sort_order = dist.argsort(axis=1) |
Definition at line 156 of file math_util.py.
Definition at line 151 of file math_util.py.