|
| | a = normal[0] |
| |
| | b = normal[1] |
| |
| | c = normal[2] |
| |
| | C_x = np.cov(xyz.T) |
| |
| | colorized = cv.applyColorMap(i8, cv.COLORMAP_JET) |
| |
| | crop = orig[int(my):int(My), int(mx):int(Mx)].astype(np.float) |
| |
| | d = -np.dot(point, normal) |
| |
| | Dcrop = np.zeros_like(crop).astype(np.float) |
| |
| | direction_vector = eig_vecs[:, min_eig_val_index].copy() |
| |
| | dist = abs(a * x + b * y + c * z + d)/e |
| |
| | Dmap = np.dstack((Dcrop, Dcrop, Dcrop)) |
| |
| | e = math.sqrt(a * a + b * b + c * c) |
| |
| | eig_vals |
| |
| | eig_vecs |
| |
| | f = open(filename,"r") |
| |
| | file_extension |
| |
| string | filename = "D:/dataset/gt-4622.png" |
| |
| | fname |
| |
| | font = cv.FONT_HERSHEY_COMPLEX_SMALL |
| |
| int | height = 0 |
| |
| list | i = [] |
| |
| tuple | i8 = (i * 255.0).astype(np.uint8) |
| |
| | im = colorized.copy() |
| |
| int | key = cv.waitKey(100)&0xFF |
| |
| | m = np.percentile(i, 5) |
| |
| | M = np.percentile(i, 95) |
| |
| | min_eig_val_index = np.argmin(eig_vals) |
| |
| int | mx = 0 |
| |
| int | Mx = 0 |
| |
| int | my = 0 |
| |
| int | My = 0 |
| |
| | normal = direction_vector/np.linalg.norm(direction_vector) |
| |
| | orig = i.copy() |
| |
| | point = np.mean(xyz, axis=0) |
| |
| | rmse = math.sqrt(variance) |
| |
| int | rmse_mm = rmse*1000 |
| |
| | size = i.shape[0] |
| |
| | variance = np.min(eig_vals) |
| |
| int | width = 0 |
| |
| list | X = [] |
| |
| tuple | x = (float(j) / width - 0.5)*z |
| |
| int | x0 = 0 |
| |
| int | x1 = 0 |
| |
| | Xcrop = np.zeros_like(crop).astype(np.float) |
| |
| int | xx = 0 |
| |
| | xyz = np.dstack((X, Y, Z)) |
| |
| list | Y = [] |
| |
| tuple | y = (float(i) / height - 0.5)*z |
| |
| int | y0 = 0 |
| |
| int | y1 = 0 |
| |
| | Ycrop = np.zeros_like(crop).astype(np.float) |
| |
| int | yy = 0 |
| |
| list | Z = [] |
| |
| float | z = crop[i - my, j - mx]*0.001 |
| |
| | Zcrop = np.zeros_like(crop).astype(np.float) |
| |