Created
May 25, 2017 00:53
-
-
Save connormanning/c912309cf0a3fd61b5fbf7a0b00e1508 to your computer and use it in GitHub Desktop.
Normalize colors with PDAL filters.programmable
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
import numpy as np | |
def normalize(i, o): | |
o['Red'] = i['Red'] >> 8; | |
o['Green'] = i['Green'] >> 8; | |
o['Blue'] = i['Blue'] >> 8; | |
return True |
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
{ | |
"pipeline":[ | |
"/opt/data/input.laz", | |
{ | |
"type":"filters.programmable", | |
"script":"/opt/data/normalize.py", | |
"function":"normalize", | |
"module":"anything" | |
}, | |
{ | |
"type":"writers.las", | |
"filename":"/opt/data/output.laz", | |
"forward": "all" | |
} | |
] | |
} |
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
# Presuming your file is called input.laz | |
docker run -it -v `pwd`:/opt/data pdal/pdal:1.2 pdal pipeline /opt/data/pipeline.json | |
# Now your output should be at output.laz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment