Added ferry filter in PDAL command to properly store color info in unreferenced LAS output

pull/6/head
Piero Toffanin 2017-03-19 12:53:01 -04:00
rodzic 1f733045ef
commit a0fa9661b4
2 zmienionych plików z 20 dodań i 4 usunięć

Wyświetl plik

@ -328,11 +328,12 @@ module.exports = class Task{
};
};
const pdalTranslate = (inputPath, outputPath) => {
const pdalTranslate = (inputPath, outputPath, filters) => {
return (done) => {
this.runningProcesses.push(processRunner.runPdalTranslate({
inputFile: inputPath,
outputFile: outputPath
outputFile: outputPath,
filters: filters
}, handleProcessExit(done), handleOutput));
};
};
@ -366,7 +367,13 @@ module.exports = class Task{
let unreferencedPointCloudPath = path.join(projectFolderPath, "opensfm", "depthmaps", "merged.ply");
if (fs.existsSync(unreferencedPointCloudPath)){
logger.info(`${lasPointCloudPath} is missing, will attempt to generate it from ${unreferencedPointCloudPath}`);
commands.unshift(pdalTranslate(unreferencedPointCloudPath, fullLasPointCloudPath));
commands.unshift(pdalTranslate(unreferencedPointCloudPath, fullLasPointCloudPath, [
{
// opensfm's ply files map colors with the diffuse_ prefix
dimensions: "diffuse_red = red, diffuse_green = green, diffuse_blue = blue",
type: "filters.ferry"
}
]));
}
}

Wyświetl plik

@ -93,9 +93,18 @@ module.exports = {
runPdalTranslate: makeRunner("/code/SuperBuild/build/pdal/bin/pdal",
function(options){
return ["translate",
let opts = ["translate",
"-i", options.inputFile,
"-o", options.outputFile];
if (options.filters){
opts = opts.concat([
"--json",
JSON.stringify(options.filters)
]);
}
return opts;
},
["inputFile", "outputFile"])
};