Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update ply_io and filter_branch.py #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add refl filtering and replace qrdar.io by ply_io
wanxinyang committed Jul 18, 2022
commit 83ada86de424768e11f9c0882ee8c67a93f28396
11 changes: 8 additions & 3 deletions python/filter_branch.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@
from sklearn.neighbors import NearestNeighbors
import argparse
import os
import qrdar
import ply_io


def nn(df, N=2):

@@ -22,6 +23,9 @@ def process_branch(B, length=.01):
# filter high deviation points
if 'dev' in B.columns:
B = B[B.dev.between(0, 10)]
# filter low reflectance points
if 'refl' in B.columns:
B = B[B.refl.between(-20,5)]

# fuzz filter
# voxelise branches (length = 1 cm)
@@ -57,9 +61,10 @@ def process_branch(B, length=.01):
parser.add_argument('--suffix', default='', help='file name suffix')
args = parser.parse_args()

pc = qrdar.io.read_ply(args.pc)
# pc = qrdar.io.read_ply(args.pc)
pc = ply_io.read_ply(args.pc)
b = process_branch(pc)
qrdar.io.write_ply(os.path.join(args.odir, '{}{}.ply'.format(os.path.split(args.pc)[1][:-4],
ply_io.write_ply(os.path.join(args.odir, '{}{}.ply'.format(os.path.split(args.pc)[1][:-4],
'' if len(args.suffix) == 0 else '.' + args.suffix)),
b)