kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Use .ply file instead of .las to generate potree cloud
rodzic
b941e3a126
commit
7eee2e687e
16
libs/Task.js
16
libs/Task.js
|
@ -34,7 +34,7 @@ let Directories = require('./Directories');
|
||||||
let statusCodes = require('./statusCodes');
|
let statusCodes = require('./statusCodes');
|
||||||
|
|
||||||
module.exports = class Task{
|
module.exports = class Task{
|
||||||
constructor(uuid, name, done, options = [], webhook){
|
constructor(uuid, name, done, options = [], webhook = null){
|
||||||
assert(uuid !== undefined, "uuid must be set");
|
assert(uuid !== undefined, "uuid must be set");
|
||||||
assert(done !== undefined, "ready must be set");
|
assert(done !== undefined, "ready must be set");
|
||||||
|
|
||||||
|
@ -49,9 +49,6 @@ module.exports = class Task{
|
||||||
this.runningProcesses = [];
|
this.runningProcesses = [];
|
||||||
this.webhook = webhook;
|
this.webhook = webhook;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async.series([
|
async.series([
|
||||||
// Read images info
|
// Read images info
|
||||||
cb => {
|
cb => {
|
||||||
|
@ -356,22 +353,23 @@ module.exports = class Task{
|
||||||
|
|
||||||
let orthophotoPath = path.join('odm_orthophoto', 'odm_orthophoto.tif'),
|
let orthophotoPath = path.join('odm_orthophoto', 'odm_orthophoto.tif'),
|
||||||
lasPointCloudPath = path.join('odm_georeferencing', 'odm_georeferenced_model.las'),
|
lasPointCloudPath = path.join('odm_georeferencing', 'odm_georeferenced_model.las'),
|
||||||
|
plyPointCloudPath = path.join('odm_georeferencing', 'odm_georeferenced_model.ply'),
|
||||||
projectFolderPath = this.getProjectFolderPath();
|
projectFolderPath = this.getProjectFolderPath();
|
||||||
|
|
||||||
let commands = [
|
let commands = [
|
||||||
generateTiles(orthophotoPath, 'orthophoto_tiles'),
|
generateTiles(orthophotoPath, 'orthophoto_tiles'),
|
||||||
generatePotreeCloud(lasPointCloudPath, 'potree_pointcloud'),
|
generatePotreeCloud(plyPointCloudPath, 'potree_pointcloud'),
|
||||||
createZipArchive('all.zip', allFolders)
|
createZipArchive('all.zip', allFolders)
|
||||||
];
|
];
|
||||||
|
|
||||||
// If point cloud file does not exist, it's likely because location (GPS/GPC) information
|
// If point cloud file does not exist, it's likely because location (GPS/GPC) information
|
||||||
// was missing and the file was not generated.
|
// was missing and the file was not generated.
|
||||||
let fullLasPointCloudPath = path.join(projectFolderPath, lasPointCloudPath);
|
let fullPlyPointCloudPath = path.join(projectFolderPath, plyPointCloudPath);
|
||||||
if (!fs.existsSync(fullLasPointCloudPath)){
|
if (!fs.existsSync(fullPlyPointCloudPath)){
|
||||||
let unreferencedPointCloudPath = path.join(projectFolderPath, "opensfm", "depthmaps", "merged.ply");
|
let unreferencedPointCloudPath = path.join(projectFolderPath, "opensfm", "depthmaps", "merged.ply");
|
||||||
if (fs.existsSync(unreferencedPointCloudPath)){
|
if (fs.existsSync(unreferencedPointCloudPath)){
|
||||||
logger.info(`${lasPointCloudPath} is missing, will attempt to generate it from ${unreferencedPointCloudPath}`);
|
logger.info(`${plyPointCloudPath} is missing, will attempt to generate it from ${unreferencedPointCloudPath}`);
|
||||||
commands.unshift(pdalTranslate(unreferencedPointCloudPath, fullLasPointCloudPath, [
|
commands.unshift(pdalTranslate(unreferencedPointCloudPath, fullPlyPointCloudPath, [
|
||||||
{
|
{
|
||||||
// opensfm's ply files map colors with the diffuse_ prefix
|
// opensfm's ply files map colors with the diffuse_ prefix
|
||||||
dimensions: "diffuse_red = red, diffuse_green = green, diffuse_blue = blue",
|
dimensions: "diffuse_red = red, diffuse_green = green, diffuse_blue = blue",
|
||||||
|
|
Ładowanie…
Reference in New Issue