我从英特尔实感深度摄像头获得点云。而我想去掉距离较远的加分点,如何在代码中加入条件?
获取点云的代码:
import numpy as np
from open3d import *
def main():
cloud = read_point_cloud("1.ply") # Read the point cloud
draw_geometries([cloud]) # Visualize the point cloud
if __name__ == "__main__":
main()
查看点云的代码:
import pyrealsense2 as rs
pipe = rs.pipeline()
config = rs.config()
config.enable_stream(rs.stream.depth)
pipe.start(config)
colorizer = rs.colorizer()
try:
frames = pipe.wait_for_frames()
colorized = colorizer.process(frames)
ply = rs.save_to_ply("1.ply")
ply.set_option(rs.save_to_ply.option_ply_binary, False)
ply.set_option(rs.save_to_ply.option_ply_normals, True)
ply.process(colorized)
print("Done")
finally:
pipe.stop()