Fixed bug in classifications when creating DTM from labeled point cloud

Bug was caused by DSM/DTM scales not being aligned
Also took the opportunity to fix void fill issues for same DTMs
This commit is contained in:
Kevin Foster
2019-03-19 14:56:05 -04:00
parent 4aded417f9
commit 7ab2661368

View File

@@ -227,6 +227,20 @@ void Shr3dder::createDTM0() {
dtm0Image = OrthoImage<unsigned short>(&dsmImage); // Size to match dsm
dtm0Image.readFromPointCloud(ground,dsmImage.gsd,shr3d::MAX_VALUE); // Using max to better match DSM
// Need to match scales and offsets between DSM and DTM
adjust_scale(dtm0Image,dsmImage.offset,dsmImage.scale);
// Fill voids
dtm0Image.fillVoidsPyramid(false);
// Replicate DSM voids in DTM
for (unsigned int j = 0; j < dtm0Image.height; j++) {
for (unsigned int i = 0; i < dtm0Image.width; i++) {
if (!dsmImage.data[j][i])
dtm0Image.data[j][i] = 0;
}
}
return;
}