kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Added ferry filter in PDAL command to properly store color info in unreferenced LAS output
rodzic
1f733045ef
commit
a0fa9661b4
13
libs/Task.js
13
libs/Task.js
|
@ -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"
|
||||
}
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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"])
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue