kopia lustrzana https://github.com/OpenDroneMap/ODM
Invert radius steps, multiplier for mesh DSM, density checks
rodzic
4a0b60bf70
commit
3d4725c615
|
@ -373,10 +373,9 @@ def window_filter_2d(arr, nodata, window, kernel_size, filter):
|
|||
return win_arr
|
||||
|
||||
|
||||
def get_dem_radius_steps(stats_file, steps, resolution):
|
||||
radius_steps = [point_cloud.get_density(stats_file, resolution)]
|
||||
def get_dem_radius_steps(stats_file, steps, resolution, multiplier = 1.0):
|
||||
radius_steps = [point_cloud.get_density(stats_file, resolution) * multiplier]
|
||||
for _ in range(steps - 1):
|
||||
radius_steps.append(radius_steps[-1] / math.sqrt(2)) # sqrt(2) is arbitrary, maybe there's a better value?
|
||||
radius_steps.reverse()
|
||||
|
||||
radius_steps.append(radius_steps[-1] * math.sqrt(2)) # sqrt(2) is arbitrary, maybe there's a better value?
|
||||
|
||||
return radius_steps
|
|
@ -20,7 +20,7 @@ def create_25dmesh(inPointCloud, outMesh, filtered_point_cloud_stats, dsm_resolu
|
|||
os.mkdir(tmp_directory)
|
||||
log.ODM_INFO('Created temporary directory: %s' % tmp_directory)
|
||||
|
||||
radius_steps = commands.get_dem_radius_steps(filtered_point_cloud_stats, 3, dsm_resolution)
|
||||
radius_steps = commands.get_dem_radius_steps(filtered_point_cloud_stats, 3, dsm_resolution, multiplier=math.sqrt(2))
|
||||
|
||||
log.ODM_INFO('Creating DSM for 2.5D mesh')
|
||||
|
||||
|
|
|
@ -120,7 +120,11 @@ def get_density(stats_file, resolution_fallback=5.0):
|
|||
with open(stats_file, 'r') as f:
|
||||
j = json.loads(f.read())
|
||||
if "density" in j:
|
||||
return round(j["density"], 3)
|
||||
d = j["density"]
|
||||
if d > 0:
|
||||
return round(d, 3)
|
||||
else:
|
||||
return fallback()
|
||||
else:
|
||||
return fallback()
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue