# Import system modules
import arcpy
# Create temporary control point feature classes in memory for camera locations
sr = arcpy.SpatialReference(102100) # WGS 1984 Web Mercator (Auxiliary Sphere)
arcpy.management.CreateFeatureClass("memory", "point_1_fc", "POINT", spatial_reference=sr)
arcpy.management.CreateFeatureClass("memory", "point_2_fc", "POINT", spatial_reference=sr)
# Add camera locations to the temporary control point feature classes
with arcpy.da.InsertCursor(r"memory\point_1_fc", ["SHAPE@XY"]) as cursor:
cursor.insertRow([arcpy.Point(-13046063.3, 4036427.6)])
with arcpy.da.InsertCursor(r"memory\point_2_fc", ["SHAPE@XY"]) as cursor:
cursor.insertRow([arcpy.Point(-13046055.9, 4036422.1)])
# Set local variables
# Set the control point parameter values
# Note: Video timestamps are strings in format hh:mm:ss.s
control_point_1 = ["00:05:40.7", r"memory\point_1_fc"]
control_point_2 = ["00:11:25.3", r"memory\point_2_fc"]
# Specify indoor level for floor awareness
arcpy.management.MakeFeatureLayer(r"C:\IndoorsModel.gdb\Indoor\Levels", "levels_lyr",
"NAME = 'Building 1 Floor 1'")
in_levels_feature = "levels_lyr"
# Set remaining parameter variables
in_360_video = r"C:\SiteVideos\Building1_Floor1.mp4"
target_oriented_imagery = r"C:\Campus.gdb\OIDataset"
target_image_folder = r"C:\Data\ImagesFolder"
extraction_interval = "5 Seconds"
start_timestamp = "00:05:35"
end_timestamp="00:15:00"
# Run the tool
arcpy.indoors.ThreeSixtyVideoToOrientedImagery(in_360_video, target_oriented_imagery, target_image_folder, control_point_1, control_point_2,
in_levels_feature, extraction_interval, start_timestamp, end_timestamp)
# Release memory
del cursor
arcpy.Delete_management(r"memory\point_1_fc")
arcpy.Delete_management(r"memory\point_2_fc")