kopia lustrzana https://github.com/OpenDroneMap/ODM
Fixed odm_georef normals handling, wrong pdal path for 2.5D meshing step
rodzic
b4fa9e9efa
commit
d4a4415dce
|
@ -1377,9 +1377,31 @@ void Georef::transformPointCloud(const char *inputFile, const Eigen::Transform<S
|
|||
file.parse_header(ss);
|
||||
|
||||
std::shared_ptr<PlyData> vertices = file.request_properties_from_element("vertex", { "x", "y", "z" });
|
||||
std::shared_ptr<PlyData> normals = file.request_properties_from_element("vertex", { "nx", "ny", "nz" });
|
||||
std::shared_ptr<PlyData> colors = file.request_properties_from_element("vertex", { "diffuse_red", "diffuse_green", "diffuse_blue" });
|
||||
std::shared_ptr<PlyData> normals;
|
||||
std::shared_ptr<PlyData> colors;
|
||||
|
||||
// Not all point clouds have normals and colors
|
||||
// and different naming conventions apply
|
||||
try{
|
||||
normals = file.request_properties_from_element("vertex", { "nx", "ny", "nz" });
|
||||
}catch(const std::exception &){}
|
||||
|
||||
if (!normals){
|
||||
try{
|
||||
normals = file.request_properties_from_element("vertex", { "normal_x", "normal_y", "normal_z" });
|
||||
}catch(const std::exception &){}
|
||||
}
|
||||
|
||||
try{
|
||||
colors = file.request_properties_from_element("vertex", { "diffuse_red", "diffuse_green", "diffuse_blue" });
|
||||
}catch(const std::exception &){}
|
||||
|
||||
if (!colors){
|
||||
try{
|
||||
colors = file.request_properties_from_element("vertex", { "red", "green", "blue" });
|
||||
}catch(const std::exception &){}
|
||||
}
|
||||
|
||||
file.read(ss);
|
||||
log_ << "Successfully loaded " << vertices->count << " points with corresponding normals from file.\n";
|
||||
|
||||
|
@ -1424,8 +1446,8 @@ void Georef::transformPointCloud(const char *inputFile, const Eigen::Transform<S
|
|||
|
||||
PlyFile outFile;
|
||||
outFile.add_properties_to_element("vertex", { "x", "y", "z" }, Type::FLOAT64, verts.size() * 3, reinterpret_cast<uint8_t*>(verts.data()), Type::INVALID, 0);
|
||||
outFile.add_properties_to_element("vertex", { "nx", "ny", "nz" }, Type::FLOAT32, verts.size() * 3, reinterpret_cast<uint8_t*>(normals->buffer.get()), Type::INVALID, 0);
|
||||
outFile.add_properties_to_element("vertex", { "red", "green", "blue" }, Type::UINT8, verts.size() * 3, reinterpret_cast<uint8_t*>(colors->buffer.get()), Type::INVALID, 0);
|
||||
if (normals) outFile.add_properties_to_element("vertex", { "nx", "ny", "nz" }, Type::FLOAT32, verts.size() * 3, reinterpret_cast<uint8_t*>(normals->buffer.get()), Type::INVALID, 0);
|
||||
if (colors) outFile.add_properties_to_element("vertex", { "red", "green", "blue" }, Type::UINT8, verts.size() * 3, reinterpret_cast<uint8_t*>(colors->buffer.get()), Type::INVALID, 0);
|
||||
outFile.get_comments().push_back("generated by OpenDroneMap");
|
||||
|
||||
outFile.write(outputStream, false);
|
||||
|
|
|
@ -129,8 +129,6 @@ class ODMGeoreferencingCell(ecto.Cell):
|
|||
'provided a GCP file. ')
|
||||
doPointCloudGeo = False # skip the rest of the georeferencing
|
||||
|
||||
odm_georeferencing_model_ply_geo = os.path.join(tree.odm_georeferencing,
|
||||
tree.odm_georeferencing_model_ply_geo)
|
||||
if doPointCloudGeo:
|
||||
# update images metadata
|
||||
geo_ref = reconstruction.georef
|
||||
|
|
Ładowanie…
Reference in New Issue