(height, width, u0=None, v0=None)
| 6 | import os |
| 7 | |
| 8 | def init_image_coor(height, width, u0=None, v0=None): |
| 9 | u0 = width / 2.0 if u0 is None else u0 |
| 10 | v0 = height / 2.0 if v0 is None else v0 |
| 11 | |
| 12 | x_row = np.arange(0, width) |
| 13 | x = np.tile(x_row, (height, 1)) |
| 14 | x = x.astype(np.float32) |
| 15 | u_u0 = x - u0 |
| 16 | |
| 17 | y_col = np.arange(0, height) |
| 18 | y = np.tile(y_col, (width, 1)).T |
| 19 | y = y.astype(np.float32) |
| 20 | v_v0 = y - v0 |
| 21 | return u_u0, v_v0 |
| 22 | |
| 23 | def depth_to_pcd(depth, u_u0, v_v0, f, invalid_value=0): |
| 24 | mask_invalid = depth <= invalid_value |
no outgoing calls
no test coverage detected