把三维的点投影到二维图像,找图像边缘,然后反向映射,找到对应的边缘点
# coding:utf-8
import open3d as o3d
import numpy as np
import cv2
def img_edge(point_cloud_np):
# 把三维的点投影到二维图像,找图像边缘,然后反向映射,找到对应的边缘点
vol_bnds = np.zeros((3, 2))
vol_bnds[:, 0] = np.minimum(vol_bnds[:, 0], np.amin(point_cloud_np, axis=0))
vol_bnds[:, 1] = np.maximum(vol_bnds[:, 1], np.amax(point_cloud_np, axis=0))
print(vol_bnds)
# leafsize = 0.1
leafsize = 0.2
vol_dim = np.ceil((vol_bnds[:, 1] - vol_bnds[:, 0]) / leafsize).copy(order='C').astype(int)
print(vol_dim)
# tsdf_vol_cpu = np.ones(vol_dim).astype(np.float32)
shift = 100
bev_map = np.zeros((vol_dim[1]+shift, vol_dim[0]+shift))
for p in point_cloud_np:
cx = np.floor((p[0] - vol_bnds[0, 0]) / leafsize)
cy = np.floor((p[1] - vol_bnds[1, 0]) / leafsize)
文章来源地址https://www.toymoban.com/news/detail-628818.html
文章来源:https://www.toymoban.com/news/detail-628818.html
到了这里,关于获取点云二维边缘点(附open3d python代码)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!