-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1623 from pierotofy/class
Automated point classification and other improvements
- Loading branch information
Showing
8 changed files
with
79 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,6 +177,7 @@ set(custom_libs OpenSfM | |
FPCFilter | ||
PyPopsift | ||
Obj2Tiles | ||
OpenPointClass | ||
) | ||
|
||
externalproject_add(mve | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
set(_proj_name openpointclass) | ||
set(_SB_BINARY_DIR "${SB_BINARY_DIR}/${_proj_name}") | ||
|
||
ExternalProject_Add(${_proj_name} | ||
DEPENDS pdal eigen34 | ||
PREFIX ${_SB_BINARY_DIR} | ||
TMP_DIR ${_SB_BINARY_DIR}/tmp | ||
STAMP_DIR ${_SB_BINARY_DIR}/stamp | ||
#--Download step-------------- | ||
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR} | ||
GIT_REPOSITORY https://github.com/uav4geo/OpenPointClass | ||
GIT_TAG v1.1.3 | ||
#--Update/Patch step---------- | ||
UPDATE_COMMAND "" | ||
#--Configure step------------- | ||
SOURCE_DIR ${SB_SOURCE_DIR}/${_proj_name} | ||
CMAKE_ARGS | ||
-DPDAL_DIR=${SB_INSTALL_DIR}/lib/cmake/PDAL | ||
-DWITH_GBT=ON | ||
-DBUILD_PCTRAIN=OFF | ||
-DEIGEN3_INCLUDE_DIR=${SB_SOURCE_DIR}/eigen34/ | ||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | ||
-DCMAKE_INSTALL_PREFIX:PATH=${SB_INSTALL_DIR} | ||
${WIN32_CMAKE_ARGS} | ||
#--Build step----------------- | ||
BINARY_DIR ${_SB_BINARY_DIR} | ||
#--Install step--------------- | ||
INSTALL_DIR ${SB_INSTALL_DIR} | ||
#--Output logging------------- | ||
LOG_DOWNLOAD OFF | ||
LOG_CONFIGURE OFF | ||
LOG_BUILD OFF | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import os | ||
from opendm.ai import get_model | ||
from opendm import log | ||
from opendm.system import run | ||
from opendm import io | ||
|
||
def classify(point_cloud): | ||
tmp_output = io.related_file_path(point_cloud, postfix=".classified") | ||
if os.path.isfile(tmp_output): | ||
os.remove(tmp_output) | ||
|
||
try: | ||
model = get_model("openpointclass", | ||
"https://github.com/uav4geo/OpenPointClass/releases/download/v1.1.3/vehicles-vegetation-buildings.zip", | ||
"v1.0.0", | ||
name="model.bin") | ||
|
||
if model is not None: | ||
run('pcclassify "%s" "%s" "%s" -u -s 2,64' % (point_cloud, tmp_output, model)) | ||
|
||
if os.path.isfile(tmp_output): | ||
os.remove(point_cloud) | ||
os.rename(tmp_output, point_cloud) | ||
else: | ||
log.ODM_WARNING("Cannot classify using OpenPointClass (no output generated)") | ||
else: | ||
log.ODM_WARNING("Cannot download/access model from %s" % (model_url)) | ||
|
||
except Exception as e: | ||
log.ODM_WARNING("Cannot classify using OpenPointClass: %s" % str(e)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters