-
Notifications
You must be signed in to change notification settings - Fork 0
/
AerialScanFlight.swift
61 lines (44 loc) · 1.81 KB
/
AerialScanFlight.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// AerialScanFlight.swift
// AerialScan
//
// Created by Ramsundar Shandilya on 1/19/18.
// Copyright © 2018 Ramsundar Shandilya. All rights reserved.
//
import Foundation
struct AerialScanFlight {
let altitude: Double
let sweepAngle: Degrees
let cameraPitchAngle: Degrees
let camera = Camera.mavic
/// Front Lap / Forward lap is the amount of image overlap between successive photos along a flight line, i.e. the photos that overlaps within the same flight line. Increasing frontlap has minimal effect on flight duration and can increase your chance of making a successful map.
let frontLap: Double
/// Side Lap is the the amount of overlap between images from adjacent flight lines, i.e. the percentage of overlap between each leg of flight. Increasing sidelap generally increases your chances of a good quality map.
let sideLap: Double
var lateralFootPrint: Double {
return altitude * camera.sensorWidth/camera.focalLength
}
var longitudinalFootPrint: Double {
return altitude * camera.sensorHeight/camera.focalLength
}
var sideLapDistance: Double {
return lateralFootPrint * (1 - sideLap/100)
}
var frontLapDistance: Double {
return longitudinalFootPrint * (1 - frontLap/100)
}
var obliqueDistance: Double {
return altitude * tan(cameraPitchAngle)
}
}
struct Camera {
/// Focal length of the lens (mm)
let focalLength: Double
/// Sensor Dimensions: Width (m)
let sensorWidth: Double
/// Sensor Dimensions: Height (m)
let sensorHeight: Double
let resolutionWidth: Double
let resolutionHeight: Double
static let mavic = Camera(focalLength: 3.57, sensorWidth: 6.17, sensorHeight: 3.47, resolutionWidth: 4000, resolutionHeight: 3000)
}