This repository was archived by the owner on Dec 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 694
New Pythonic pcl.{load,save} functions; PLY format support #31
Merged
+182
−102
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XXX the at() members of PointCloud[T] can also throw: >>> a = np.random.randn(10000, 3).astype(np.float32) >>> p = PointCloud() >>> p.from_array(a) >>> p[10000] terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check Aborted ... but a bug in Cython's code generator prevents "except+" from working with a function returning a reference.
Using pointers to work around broken C++ reference support in Cython. operator[] seems to be completely broken in Cython. E.g. >>> a = np.random.randn(10000, 3).astype(np.float32) >>> p = PointCloud() >>> p.from_array(a) >>> %timeit p.to_array() 10000 loops, best of 3: 23.4 µs per loop Previously 50.8 µs per loop.
Allows splitting the big pcl.pyx module and writing parts in pure Python to speed up compilation.
Contributor
|
Looks good, I have no complaints with your API changes, nor the re-organisation. Do you have a minimal PLY file you could commit to the repository for testing? I'll merge this branch as it includes #30 (which looked fine too) |
Contributor
Author
|
I can push a unit test that converts a PCD to PLY and back, is that ok? |
Contributor
|
Yeah, that would be fine. On Mon, Jul 7, 2014 at 1:52 PM, Lars Buitinck [email protected]
|
Contributor
Author
|
Added such a unit test in 4e103e8. Also changed the test to not leave clutter in |
nzjrs
added a commit
that referenced
this pull request
Jul 7, 2014
New Pythonic pcl.{load,save} functions; PLY format support
Contributor
|
Thanks for your work! |
Sirokujira
pushed a commit
to Sirokujira/python-pcl
that referenced
this pull request
Mar 10, 2017
New Pythonic pcl.{load,save} functions; PLY format support
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a pretty massive change to the codebase. It replaces
PointCloud.{from_file,to_file}with free-standingloadandsavefunctions. To prevent excessive compile times, these functions are defined in a pure Python module, and the code is reorganized into a package to make this possible.Also, the
PointCloudconstructor was pimped to take a list, array or integer argument for initialization. I found that more Pythonic than the current "construct, then fill" idiom.The first four commits are actually the ones from #30; I wanted to avoid merge conflicts with that PR.