|
|
|
|
@ -28,40 +28,52 @@ Processing time scales with area, so 4x downscale = ~16x faster initial alignmen |
|
|
|
|
Memory usage significantly reduced |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
within_one_mile_check = False |
|
|
|
|
within_feet_check = True |
|
|
|
|
withinFeet = 10 # < 10 feet |
|
|
|
|
# Photo File Size Limits: |
|
|
|
|
too_small = 1024 # 1KB |
|
|
|
|
too_large = 10 * 1024 * 1024 # 10MB |
|
|
|
|
|
|
|
|
|
def handle_GPS(location1, location2): |
|
|
|
|
camera_info1, latitude1, longitude1 = location1 |
|
|
|
|
def camera_check(camera_info1, camera_info2, diff_location = False): |
|
|
|
|
make1 = camera_info1['Make'] |
|
|
|
|
model1 = camera_info1['Model'] |
|
|
|
|
|
|
|
|
|
camera_info2, latitude2, longitude2 = location2 |
|
|
|
|
make2 = camera_info2['Make'] |
|
|
|
|
model2 = camera_info2['Model'] |
|
|
|
|
|
|
|
|
|
point1 = (latitude1, longitude1) |
|
|
|
|
point2 = (latitude2, longitude2) |
|
|
|
|
|
|
|
|
|
if point1 == point2: |
|
|
|
|
print("Images are both from same exact Location") |
|
|
|
|
if make1 == make2 and model1 == model2: |
|
|
|
|
print("Cameras are the same.") |
|
|
|
|
print("✅Possible duplicate") |
|
|
|
|
delibs.exit_timer(5) |
|
|
|
|
elif coordinates.are_within_one_mile(*point1, *point2) and within_one_mile_check == True: |
|
|
|
|
if diff_location == True: |
|
|
|
|
print("Images are from different Locations") |
|
|
|
|
if make1 == make2 and model1 == model2: |
|
|
|
|
print("Images are within one mile") |
|
|
|
|
print("Cameras are the same.") |
|
|
|
|
delibs.exit_timer(6) |
|
|
|
|
else: |
|
|
|
|
print("Different Cameras detected.") |
|
|
|
|
print("👌Not a Duplicate") |
|
|
|
|
delibs.exit_timer(0) |
|
|
|
|
else: |
|
|
|
|
print("Images are from different Locations") |
|
|
|
|
if make1 != make2 or model1 != model2: |
|
|
|
|
print("Different Cameras detected.") |
|
|
|
|
print("👌Not a Duplicate") |
|
|
|
|
delibs.exit_timer(0) |
|
|
|
|
|
|
|
|
|
def handle_GPS(location1, location2): |
|
|
|
|
camera_info1, latitude1, longitude1 = location1 |
|
|
|
|
camera_info2, latitude2, longitude2 = location2 |
|
|
|
|
point1 = (latitude1, longitude1) |
|
|
|
|
point2 = (latitude2, longitude2) |
|
|
|
|
|
|
|
|
|
if point1 == point2: |
|
|
|
|
print("Images are both from same exact Location") |
|
|
|
|
camera_check(camera_info1, camera_info2) |
|
|
|
|
elif within_feet_check == True: |
|
|
|
|
feet = coordinates.haversine_distance_feet(point1, point2) |
|
|
|
|
print(f"Images distance in feet: {feet:.2f}") |
|
|
|
|
if feet < withinFeet: |
|
|
|
|
print(f"With in requirements of {withinFeet}") |
|
|
|
|
camera_check(camera_info1, camera_info2) |
|
|
|
|
else: |
|
|
|
|
camera_check(camera_info1, camera_info2, True) |
|
|
|
|
else: |
|
|
|
|
camera_check(camera_info1, camera_info2, True) |
|
|
|
|
|
|
|
|
|
def is_module_imported(module_name): |
|
|
|
|
return module_name in sys.modules |
|
|
|
|
|
|
|
|
|
|