You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Add the projection information: image ID and 2D point coordinates
92
-
projections.append((image.image_id, point2D.xy))
93
-
#print(f"Image {image.image_id}: Projected 2D point (x, y) = {point2D.xy}")
94
-
95
-
projections_3d_tiepoints[point3D_id] = {
96
-
'3D_tiepoint': point3D.xyz,
97
-
'projections': projections,
98
-
}
99
-
100
-
returnprojections_3d_tiepoints
101
-
102
-
if__name__=="__main__":
103
-
parser=argparse.ArgumentParser(
104
-
description="Export pairs in a txt file from a COLMAP database."
105
-
)
106
-
parser.add_argument("-d", "--database", type=Path, required=True, help="Path to COLMAP database.")
107
-
parser.add_argument("-m", "--min_n_matches", type=int, required=True, help="Min number of matches that a pair should have after geometric verification.")
108
-
parser.add_argument("-o", "--output", type=Path, required=True, help="Path to output folder.")
109
-
parser.add_argument("-l", "--model", type=Path, required=True, help="Path to model folder.")
print(f"Percentage of cells with non zero density: {covered_area}%")
83
+
84
+
density_grid_normalized=zoom(
85
+
density_grid_normalized,
86
+
zoom=upsample_factor,
87
+
order=1# Cubic interpolation (you can use order=1 for linear interpolation)
88
+
)
89
+
165
90
# Save the density map as a JPEG
166
91
withrasterio.open(
167
-
'/home/threedom/Desktop/buttare/density.jpg',
92
+
f'{output_dir}/density_{image_name}.jpg',
168
93
"w",
169
94
driver="JPEG", # Use JPEG driver
170
95
height=density_grid_normalized.shape[0],
@@ -174,7 +99,45 @@ def EvaluateKeypointDensity(
174
99
transform=transform
175
100
) asdst:
176
101
dst.write(density_grid_normalized, 1)
102
+
103
+
returnimage_name, covered_area
104
+
105
+
if__name__=="__main__":
106
+
107
+
parser=argparse.ArgumentParser(
108
+
description="Export pairs in a txt file from a COLMAP database."
109
+
)
110
+
parser.add_argument("-d", "--database", type=Path, required=True, help="Path to COLMAP database.")
111
+
parser.add_argument("-m", "--min_n_matches", type=int, required=True, help="Min number of matches that a pair should have after geometric verification.")
112
+
parser.add_argument("-o", "--output", type=Path, required=True, help="Path to output folder.")
113
+
parser.add_argument("-l", "--model", type=Path, required=True, help="Path to model folder.")
0 commit comments