def main():
data = pd.read_csv(
'Leon_group1_densified_point_cloud.xyz',
names=['X', 'Y', 'Z', 'C_R','C_G','C_B'],
delim_whitespace=True)
# Calculate Geotiff information
Auto = True
# If it is auto
if Auto == True:
# spacing could be changed
spacing = 1.6*get_space(data)
w = int((data.X.max() - data.X.min()) / spacing)
h = int((data.Y.max() - data.Y.min()) / spacing)
affine_par = [spacing,0,0,-spacing,data.X.min(),data.Y.max()]
else:
affine_name = ''
affine_par = np.loadtxt(affine_name) # input the affine name
h = 1792
w = 1053
print(affine_par)
print(h,w)
# Generate DEM
ortho = GEM_Dsm(data, h, w, 3, 0.15,affine_par)
# save to tif
ortho = ortho.astype(np.uint8)
# ortho = cv2.medianBlur(ortho, 3)
cv2.imwrite('ortho.tif',ortho)
array2Raster(ortho,affine_par,'test.tif')
评论列表
文章目录