python 深度图转点云以及可视化

python 深度图转点云 并且可视化

# coding=utf-8

import numpy as np
from argparse import Namespace

from PIL import Image
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

camera_matrix = {
   'xc': 127.5, 'zc': 127.5, 'f': 128}
camera_matrix = Namespace(**camera_matrix)
def get_point_cloud_from_z(Y, camera_matrix, scale=1):
    """Projects the depth image Y into a 3D point cloud.
    Inputs:
        Y is ...xHxW
        camera_matrix
    Outputs:
        X is positive going right
        Y is positive into the image
        Z is positive up in the image
        XYZ is ...xHxWx3
    """

    x, z = np.meshgrid(np.arange

你可能感兴趣的:(笔记,python,计算机视觉,算法)