kopia lustrzana https://github.com/OpenDroneMap/ODM
Faster EDT in orthophoto computations
rodzic
65ea3ec685
commit
282cb6ed37
|
@ -4,7 +4,7 @@ from opendm.dem import commands
|
|||
from opendm import system
|
||||
from opendm import log
|
||||
from opendm import context
|
||||
from scipy import signal, ndimage
|
||||
from scipy import signal
|
||||
import numpy as np
|
||||
|
||||
def create_25dmesh(inPointCloud, outMesh, dsm_radius=0.07, dsm_resolution=0.05, depth=8, samples=1, maxVertexCount=100000, verbose=False, available_cores=None, method='gridded', smooth_dsm=True):
|
||||
|
|
|
@ -7,7 +7,7 @@ import math
|
|||
import numpy as np
|
||||
import rasterio
|
||||
import fiona
|
||||
from scipy import ndimage
|
||||
from edt import edt
|
||||
from rasterio.transform import Affine, rowcol
|
||||
from rasterio.mask import mask
|
||||
from opendm import io
|
||||
|
@ -87,7 +87,7 @@ def compute_mask_raster(input_raster, vector_mask, output_raster, blend_distance
|
|||
if out_image.shape[0] >= 4:
|
||||
# alpha_band = rast.dataset_mask()
|
||||
alpha_band = out_image[-1]
|
||||
dist_t = ndimage.distance_transform_edt(alpha_band)
|
||||
dist_t = edt(alpha_band, black_border=True, parallel=0)
|
||||
dist_t[dist_t <= blend_distance] /= blend_distance
|
||||
dist_t[dist_t > blend_distance] = 1
|
||||
np.multiply(alpha_band, dist_t, out=alpha_band, casting="unsafe")
|
||||
|
@ -112,7 +112,7 @@ def feather_raster(input_raster, output_raster, blend_distance=20):
|
|||
if blend_distance > 0:
|
||||
if out_image.shape[0] >= 4:
|
||||
alpha_band = out_image[-1]
|
||||
dist_t = ndimage.distance_transform_edt(alpha_band)
|
||||
dist_t = edt(alpha_band, black_border=True, parallel=0)
|
||||
dist_t[dist_t <= blend_distance] /= blend_distance
|
||||
dist_t[dist_t > blend_distance] = 1
|
||||
np.multiply(alpha_band, dist_t, out=alpha_band, casting="unsafe")
|
||||
|
|
|
@ -25,4 +25,5 @@ scikit-learn==0.20
|
|||
laspy==1.6.0
|
||||
beautifulsoup4==4.9.1
|
||||
lxml==4.5.1
|
||||
matplotlib==1.5.1
|
||||
matplotlib==1.5.1
|
||||
edt==2.0.1
|
Ładowanie…
Reference in New Issue