@mapcatch/util 2.0.6 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catchUtil.min.cjs.js +2928 -0
- package/dist/catchUtil.min.esm.js +44502 -42814
- package/dist/catchUtil.min.js +248 -248
- package/package.json +11 -2
- package/src/constants/annotation_color.js +0 -7
- package/src/constants/annotation_draw_style.js +0 -228
- package/src/constants/annotation_label_style.js +0 -76
- package/src/constants/annotation_style.js +0 -118
- package/src/constants/bmap_types.js +0 -44
- package/src/constants/cameras.js +0 -5
- package/src/constants/crs.js +0 -42099
- package/src/constants/crs_types.js +0 -22
- package/src/constants/default_layers.js +0 -149
- package/src/constants/dsm_colors.js +0 -10
- package/src/constants/error_codes.js +0 -44
- package/src/constants/height_colors.js +0 -1
- package/src/constants/index.js +0 -20
- package/src/constants/layer_folders.js +0 -6
- package/src/constants/layer_groups.js +0 -34
- package/src/constants/layer_groups_multispectral.js +0 -34
- package/src/constants/layer_icons.js +0 -19
- package/src/constants/map_style.js +0 -11
- package/src/constants/measurement_fields.js +0 -208
- package/src/constants/task_params.js +0 -33
- package/src/constants/tools.js +0 -20
- package/src/event/event.js +0 -191
- package/src/event/event_bus.js +0 -5
- package/src/event/index.js +0 -2
- package/src/gl-operations/constants.js +0 -9
- package/src/gl-operations/default_options.js +0 -98
- package/src/gl-operations/index.js +0 -533
- package/src/gl-operations/reglCommands/contours.js +0 -27
- package/src/gl-operations/reglCommands/default.js +0 -46
- package/src/gl-operations/reglCommands/hillshading.js +0 -340
- package/src/gl-operations/reglCommands/index.js +0 -6
- package/src/gl-operations/reglCommands/multiLayers.js +0 -303
- package/src/gl-operations/reglCommands/transitions.js +0 -111
- package/src/gl-operations/reglCommands/util.js +0 -71
- package/src/gl-operations/renderer.js +0 -210
- package/src/gl-operations/shaders/fragment/convertDem.js +0 -26
- package/src/gl-operations/shaders/fragment/convolutionSmooth.js +0 -55
- package/src/gl-operations/shaders/fragment/diffCalc.js +0 -34
- package/src/gl-operations/shaders/fragment/drawResult.js +0 -47
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +0 -79
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +0 -60
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +0 -31
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +0 -61
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +0 -27
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +0 -26
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +0 -54
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +0 -81
- package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +0 -55
- package/src/gl-operations/shaders/fragment/interpolateColor.js +0 -66
- package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +0 -50
- package/src/gl-operations/shaders/fragment/interpolateValue.js +0 -137
- package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +0 -36
- package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +0 -46
- package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +0 -54
- package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +0 -62
- package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +0 -70
- package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +0 -78
- package/src/gl-operations/shaders/fragment/single.js +0 -93
- package/src/gl-operations/shaders/transform.js +0 -22
- package/src/gl-operations/shaders/util/computeColor.glsl +0 -85
- package/src/gl-operations/shaders/util/getTexelValue.glsl +0 -10
- package/src/gl-operations/shaders/util/isCloseEnough.glsl +0 -9
- package/src/gl-operations/shaders/util/rgbaToFloat.glsl +0 -18
- package/src/gl-operations/shaders/vertex/double.js +0 -17
- package/src/gl-operations/shaders/vertex/multi3.js +0 -20
- package/src/gl-operations/shaders/vertex/multi4.js +0 -23
- package/src/gl-operations/shaders/vertex/multi5.js +0 -26
- package/src/gl-operations/shaders/vertex/multi6.js +0 -29
- package/src/gl-operations/shaders/vertex/single.js +0 -13
- package/src/gl-operations/shaders/vertex/singleNotTransformed.js +0 -12
- package/src/gl-operations/texture_manager.js +0 -141
- package/src/gl-operations/util.js +0 -336
- package/src/index.js +0 -20
- package/src/measure/index.js +0 -209
- package/src/measure/tile_cache.js +0 -88
- package/src/mvs/index.js +0 -26
- package/src/mvs/protos/index.js +0 -12
- package/src/mvs/protos/proto_10.js +0 -155
- package/src/observation_pretict.js +0 -168
- package/src/photo-parser/exif/gps_tags.js +0 -33
- package/src/photo-parser/exif/ifd1_tags.js +0 -22
- package/src/photo-parser/exif/index.js +0 -143
- package/src/photo-parser/exif/parse_image.js +0 -290
- package/src/photo-parser/exif/string_values.js +0 -137
- package/src/photo-parser/exif/tags.js +0 -75
- package/src/photo-parser/exif/tiff_tags.js +0 -35
- package/src/photo-parser/exif/util.js +0 -103
- package/src/photo-parser/image-size/detector.js +0 -24
- package/src/photo-parser/image-size/fromFile.js +0 -55
- package/src/photo-parser/image-size/index.js +0 -2
- package/src/photo-parser/image-size/lookup.js +0 -37
- package/src/photo-parser/image-size/types/bmp.js +0 -10
- package/src/photo-parser/image-size/types/cur.js +0 -16
- package/src/photo-parser/image-size/types/dds.js +0 -10
- package/src/photo-parser/image-size/types/gif.js +0 -11
- package/src/photo-parser/image-size/types/heif.js +0 -35
- package/src/photo-parser/image-size/types/icns.js +0 -112
- package/src/photo-parser/image-size/types/ico.js +0 -74
- package/src/photo-parser/image-size/types/index.js +0 -43
- package/src/photo-parser/image-size/types/j2c.js +0 -11
- package/src/photo-parser/image-size/types/jp2.js +0 -22
- package/src/photo-parser/image-size/types/jpg.js +0 -157
- package/src/photo-parser/image-size/types/ktx.js +0 -18
- package/src/photo-parser/image-size/types/png.js +0 -36
- package/src/photo-parser/image-size/types/pnm.js +0 -74
- package/src/photo-parser/image-size/types/psd.js +0 -10
- package/src/photo-parser/image-size/types/svg.js +0 -100
- package/src/photo-parser/image-size/types/tga.js +0 -14
- package/src/photo-parser/image-size/types/tiff.js +0 -92
- package/src/photo-parser/image-size/types/utils.js +0 -83
- package/src/photo-parser/image-size/types/webp.js +0 -67
- package/src/photo-parser/index.js +0 -185
- package/src/report/annotations_report.js +0 -446
- package/src/report/index.js +0 -2
- package/src/report/map_util.js +0 -81
- package/src/report/pdf_creator.js +0 -247
- package/src/report/report.js +0 -581
- package/src/transform.js +0 -207
- package/src/util.js +0 -671
package/src/report/report.js
DELETED
|
@@ -1,581 +0,0 @@
|
|
|
1
|
-
import moment from 'moment'
|
|
2
|
-
import { formatDate, getAverageValue, getAppVersion } from '../util'
|
|
3
|
-
import _ from 'lodash'
|
|
4
|
-
import {getFeatures} from './map_util'
|
|
5
|
-
|
|
6
|
-
export default async function generateReport (params) {
|
|
7
|
-
let {projectInfo, taskInfo, reportInfo, photosString, tilejson} = params
|
|
8
|
-
let photos = JSON.parse(photosString)
|
|
9
|
-
let report = {
|
|
10
|
-
title: '成果质量报告',
|
|
11
|
-
projectName: projectInfo.name,
|
|
12
|
-
taskName: taskInfo.name,
|
|
13
|
-
project_id: taskInfo.project_id,
|
|
14
|
-
task_id: taskInfo.task_id,
|
|
15
|
-
user_id: taskInfo.user_id,
|
|
16
|
-
data_type: taskInfo.data_type,
|
|
17
|
-
sections: [
|
|
18
|
-
{
|
|
19
|
-
title: '任务概览',
|
|
20
|
-
content: [
|
|
21
|
-
{
|
|
22
|
-
type: 'form',
|
|
23
|
-
items: getTaskPreview(taskInfo, photos)
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'sub-title',
|
|
27
|
-
label: '耗时统计'
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
type: 'tree',
|
|
31
|
-
items: getTimeStatistic(reportInfo)
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
type: 'image',
|
|
35
|
-
imageType: 'overview'
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
type: 'page-line' // 分页
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
title: '空三质量报告',
|
|
44
|
-
content: [
|
|
45
|
-
{
|
|
46
|
-
type: 'sub-title',
|
|
47
|
-
label: '测区概况及覆盖度'
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
type: 'form',
|
|
51
|
-
items: getSurveyOverview(photos, reportInfo)
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
type: 'image',
|
|
55
|
-
imageType: 'overlap'
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
type: 'page-line' // 分页
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: 'sub-title',
|
|
62
|
-
label: '相机校正'
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
type: 'form',
|
|
66
|
-
items: getCameraOverview(photos, reportInfo)
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
type: 'cameras',
|
|
70
|
-
items: getCameras(reportInfo)
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
type: 'page-line' // 分页
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
type: 'sub-title',
|
|
77
|
-
label: '图像位置'
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
type: 'image',
|
|
81
|
-
imageType: 'photos',
|
|
82
|
-
errorFeatures: await getErrorFeatures(photos, taskInfo, reportInfo),
|
|
83
|
-
errorData: getErrorData(reportInfo.image_POS_diff.filter(d => !!d.pos_diff))
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
type: 'page-line' // 分页
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
title: '重建质量报告',
|
|
92
|
-
content: [
|
|
93
|
-
{
|
|
94
|
-
type: 'sub-title',
|
|
95
|
-
label: '运行环境'
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
type: 'form',
|
|
99
|
-
items: getReconstructEnvironment(reportInfo, taskInfo)
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
type: 'sub-title',
|
|
103
|
-
label: '重建参数'
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
type: 'form',
|
|
107
|
-
items: getReconstructParams(reportInfo)
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
// 建了二维地图才有以下报告
|
|
114
|
-
if (tilejson) {
|
|
115
|
-
report.sections[2].content.push(
|
|
116
|
-
{
|
|
117
|
-
type: 'sub-title',
|
|
118
|
-
label: '数字表面模型'
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
type: 'image',
|
|
122
|
-
imageType: 'dsm'
|
|
123
|
-
}
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
if (reportInfo.gcp_quality?.length) {
|
|
127
|
-
report.sections[1].content.push({
|
|
128
|
-
type: 'sub-title',
|
|
129
|
-
label: '像控点精度'
|
|
130
|
-
},{
|
|
131
|
-
type: 'third-title',
|
|
132
|
-
label: '控制点'
|
|
133
|
-
},{
|
|
134
|
-
type: 'gcps',
|
|
135
|
-
data: getControlPoints(reportInfo.gcp_quality, 'control point')
|
|
136
|
-
},{
|
|
137
|
-
type: 'third-title',
|
|
138
|
-
label: '检查点'
|
|
139
|
-
},{
|
|
140
|
-
type: 'gcps',
|
|
141
|
-
data: getControlPoints(reportInfo.gcp_quality, 'check point')
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
type: 'page-line' // 分页
|
|
145
|
-
})
|
|
146
|
-
}
|
|
147
|
-
return report
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function getTaskPreview (taskInfo, photos) {
|
|
151
|
-
return [
|
|
152
|
-
{
|
|
153
|
-
label: '任务名称',
|
|
154
|
-
value: taskInfo.name
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
label: '任务类型',
|
|
158
|
-
value: getDataType(taskInfo.data_type)
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
label: '数据采集时间',
|
|
162
|
-
value: formatDate(taskInfo.captured_at)
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
label: '照片数量',
|
|
166
|
-
value: photos.length
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
label: '开始时间',
|
|
170
|
-
value: formatDate(taskInfo.started_at)
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
label: '完成时间',
|
|
174
|
-
value: formatDate(taskInfo.completed_at)
|
|
175
|
-
}
|
|
176
|
-
]
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function getTimeStatistic (reportInfo) {
|
|
180
|
-
return [
|
|
181
|
-
{
|
|
182
|
-
level: 1,
|
|
183
|
-
label: '总耗时',
|
|
184
|
-
value: formatDuration(((+reportInfo.at_time || 0) + (+reportInfo.reconstruction_time || 0)) * 60),
|
|
185
|
-
children: [
|
|
186
|
-
{
|
|
187
|
-
level: 2,
|
|
188
|
-
label: '空三时间',
|
|
189
|
-
value: formatDuration(reportInfo.at_time * 60),
|
|
190
|
-
children: [
|
|
191
|
-
{
|
|
192
|
-
level: 3,
|
|
193
|
-
label: '特征提取时间',
|
|
194
|
-
value: formatDuration(reportInfo.feature_extraction_time * 60)
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
level: 3,
|
|
198
|
-
label: 'sfm时间',
|
|
199
|
-
value: formatDuration(reportInfo.sfm_time * 60)
|
|
200
|
-
}
|
|
201
|
-
]
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
level: 2,
|
|
205
|
-
label: '重建时间',
|
|
206
|
-
value: formatDuration(reportInfo.reconstruction_time * 60)
|
|
207
|
-
}
|
|
208
|
-
]
|
|
209
|
-
}
|
|
210
|
-
]
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function formatDuration (seconds) { // 单位为秒, 格式化为可读的时间
|
|
214
|
-
if (!seconds) {
|
|
215
|
-
return '暂无'
|
|
216
|
-
}
|
|
217
|
-
let duration = moment.duration(seconds, 'seconds')
|
|
218
|
-
if (duration.days() > 0) {
|
|
219
|
-
return `${duration.days()}天${duration.hours()}小时${duration.minutes()}分${duration.seconds()}秒`
|
|
220
|
-
} else if (duration.hours() > 0) {
|
|
221
|
-
return `${duration.hours()}小时${duration.minutes()}分钟${duration.seconds()}秒`
|
|
222
|
-
} else if (duration.minutes() > 0) {
|
|
223
|
-
return `${duration.minutes()}分钟${duration.seconds()}秒`
|
|
224
|
-
} else {
|
|
225
|
-
return `${duration.seconds()}秒`
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
function getDataType (type) {
|
|
230
|
-
if (type === 'infrared') {
|
|
231
|
-
return '热红外'
|
|
232
|
-
} else if (type === 'multispectral') {
|
|
233
|
-
return '多光谱'
|
|
234
|
-
} else {
|
|
235
|
-
return '可见光'
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function getSurveyOverview (photos, reportInfo) {
|
|
240
|
-
return [
|
|
241
|
-
{
|
|
242
|
-
label: '照片数量',
|
|
243
|
-
value: photos.length
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
label: '飞行高度',
|
|
247
|
-
value: reportInfo.flight_height ? `${_.round(reportInfo.flight_height, 2)}米` : '暂无'
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
label: '连接点数',
|
|
251
|
-
value: reportInfo.tie_point_count
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
label: '地面分辨率',
|
|
255
|
-
value: reportInfo.scene_gsd ? `${_.round(reportInfo.scene_gsd, 2)}米` : '暂无'
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
label: '测区面积',
|
|
259
|
-
value: reportInfo.scene_area ? `${_.round(reportInfo.scene_area, 2)}平方米` : '暂无'
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
label: '重投影误差',
|
|
263
|
-
value: reportInfo.residual_rmse ? `${_.round(reportInfo.residual_rmse, 2)}pixel` : '暂无'
|
|
264
|
-
}
|
|
265
|
-
]
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
function getCameraOverview (photos, reportInfo) {
|
|
269
|
-
return [
|
|
270
|
-
{
|
|
271
|
-
label: '相机数量',
|
|
272
|
-
value: reportInfo.input_camera_count || '暂无'
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
label: '照片数量',
|
|
276
|
-
value: photos.length
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
label: '入网照片',
|
|
280
|
-
value: reportInfo.input_image_count - reportInfo.removed_image_count
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
label: '未入网照片',
|
|
284
|
-
value: reportInfo.removed_image_count
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
label: '入网率',
|
|
288
|
-
value: `${_.round(100 * (reportInfo.input_image_count - reportInfo.removed_image_count) / reportInfo.input_image_count, 2)}%`
|
|
289
|
-
}
|
|
290
|
-
]
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function getControlPoints (gcps, type) {
|
|
294
|
-
let points = gcps.filter(d => d.usage === type)
|
|
295
|
-
let cols = [
|
|
296
|
-
{
|
|
297
|
-
title: 'ID',
|
|
298
|
-
key: 'id',
|
|
299
|
-
width: 80
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
title: '刺点数',
|
|
303
|
-
key: 'observation_count'
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
title: '重投影误差(px)',
|
|
307
|
-
key: 'residual',
|
|
308
|
-
width: 150
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
title: 'X误差(cm)',
|
|
312
|
-
key: 'error_x'
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
title: 'Y误差(cm)',
|
|
316
|
-
key: 'error_y'
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
title: 'Z误差(cm)',
|
|
320
|
-
key: 'error_z'
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
title: '总计',
|
|
324
|
-
key: 'error_total'
|
|
325
|
-
}
|
|
326
|
-
]
|
|
327
|
-
let data = [], x_norm = 0, y_norm = 0, z_norm = 0, count = 0
|
|
328
|
-
if (!points.length) {
|
|
329
|
-
return {cols, data}
|
|
330
|
-
}
|
|
331
|
-
points.forEach(p => {
|
|
332
|
-
let {id, observation_count, error, observation_residual} = p
|
|
333
|
-
data.push({
|
|
334
|
-
id,
|
|
335
|
-
observation_count,
|
|
336
|
-
residual: observation_residual ? _.round(getAverageValue(observation_residual, 'residual'), 5) : undefined,
|
|
337
|
-
error_x: _.round(error[0] * 100, 5),
|
|
338
|
-
error_y: _.round(error[1] * 100, 5),
|
|
339
|
-
error_z: _.round(error[2] * 100, 5),
|
|
340
|
-
error_total: _.round(Math.sqrt(error[0] * error[0] + error[1] * error[1] + error[2] * error[2]) * 100, 5)
|
|
341
|
-
})
|
|
342
|
-
x_norm += error[0] * error[0]
|
|
343
|
-
y_norm += error[1] * error[1]
|
|
344
|
-
z_norm += error[2] * error[2]
|
|
345
|
-
count += observation_count
|
|
346
|
-
})
|
|
347
|
-
data.push({
|
|
348
|
-
id: '总计',
|
|
349
|
-
observation_count: count,
|
|
350
|
-
error_x: _.round(Math.sqrt(x_norm / points.length) * 100, 5),
|
|
351
|
-
error_y: _.round(Math.sqrt(y_norm / points.length) * 100, 5),
|
|
352
|
-
error_z: _.round(Math.sqrt(z_norm / points.length) * 100, 5),
|
|
353
|
-
error_total: _.round(Math.sqrt((x_norm + y_norm + z_norm) / points.length) * 100, 5)
|
|
354
|
-
})
|
|
355
|
-
return {cols, data}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
function getCameras (reportInfo) {
|
|
359
|
-
let {AT_camera_parameters, initial_camera_parameters} = reportInfo
|
|
360
|
-
let cameras = []
|
|
361
|
-
let calibrationCols = [
|
|
362
|
-
{
|
|
363
|
-
title: '',
|
|
364
|
-
key: 'name',
|
|
365
|
-
width: 80
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
title: '焦距[px]',
|
|
369
|
-
key: 'focalLength'
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
title: '主点X[px]',
|
|
373
|
-
key: 'ppX'
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
title: '主点Y[px]',
|
|
377
|
-
key: 'ppY'
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
title: 'K1',
|
|
381
|
-
key: 'k1'
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
title: 'K2',
|
|
385
|
-
key: 'k2'
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
title: 'K3',
|
|
389
|
-
key: 'k3'
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
title: 'P1',
|
|
393
|
-
key: 'p1'
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
title: 'P2',
|
|
397
|
-
key: 'p2'
|
|
398
|
-
}
|
|
399
|
-
]
|
|
400
|
-
AT_camera_parameters.forEach((item) => {
|
|
401
|
-
cameras.push({
|
|
402
|
-
cameraId: item.id,
|
|
403
|
-
forms: [
|
|
404
|
-
{
|
|
405
|
-
label: '相机名称',
|
|
406
|
-
value: item.camera_name || '暂无'
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
label: '成像模式',
|
|
410
|
-
value: '暂无'
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
label: '传感器尺寸',
|
|
414
|
-
value: '暂无'
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
label: '像幅大小',
|
|
418
|
-
value: `${item.width} × ${item.height}`
|
|
419
|
-
}
|
|
420
|
-
],
|
|
421
|
-
calibrationCols,
|
|
422
|
-
calibrationData: getCameraCalibrationData(item.id, AT_camera_parameters, initial_camera_parameters, calibrationCols)
|
|
423
|
-
})
|
|
424
|
-
})
|
|
425
|
-
return cameras
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
function getCameraCalibrationData (camera_id, AT_camera_parameters, initial_camera_parameters, columns) {
|
|
429
|
-
let data = ['校正前', '校正后', '差值'].map(d => {
|
|
430
|
-
return {name: d}
|
|
431
|
-
})
|
|
432
|
-
let initialCamera = initial_camera_parameters.find(d => d.id === camera_id)
|
|
433
|
-
let atCamera = AT_camera_parameters.find(d => d.id === camera_id)
|
|
434
|
-
if (!initialCamera || !atCamera) {
|
|
435
|
-
return data
|
|
436
|
-
}
|
|
437
|
-
for(let i = 0;i < columns.length - 1;i++) {
|
|
438
|
-
let precition = i > 5 ? 6 : 4
|
|
439
|
-
data[0][columns[i + 1].key] = _.round(initialCamera.parameters[i], precition)
|
|
440
|
-
data[1][columns[i + 1].key] = _.round(atCamera.parameters[i], precition)
|
|
441
|
-
data[2][columns[i + 1].key] = _.round(atCamera.parameters[i] - initialCamera.parameters[i], precition)
|
|
442
|
-
}
|
|
443
|
-
return data
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
// 照片位置的中误差
|
|
447
|
-
function getErrorData (diffs) {
|
|
448
|
-
let quadraticSumX = 0,quadraticSumY = 0,quadraticSumZ = 0
|
|
449
|
-
let n = diffs.length
|
|
450
|
-
diffs.forEach(d => {
|
|
451
|
-
quadraticSumX += Math.pow(d.pos_diff[0], 2)
|
|
452
|
-
quadraticSumY += Math.pow(d.pos_diff[1], 2)
|
|
453
|
-
quadraticSumZ += Math.pow(d.pos_diff[2], 2)
|
|
454
|
-
})
|
|
455
|
-
let err = {
|
|
456
|
-
ex: _.round(Math.sqrt(quadraticSumX / n) * 100, 5),
|
|
457
|
-
ey: _.round(Math.sqrt(quadraticSumY / n) * 100, 5),
|
|
458
|
-
ez: _.round(Math.sqrt(quadraticSumZ / n) * 100, 5),
|
|
459
|
-
exy: _.round(Math.sqrt((quadraticSumX + quadraticSumY) / n) * 100, 5),
|
|
460
|
-
et: _.round(Math.sqrt((quadraticSumX + quadraticSumY + quadraticSumZ) / n) * 100, 5)
|
|
461
|
-
}
|
|
462
|
-
let unit = 'cm'
|
|
463
|
-
if (Object.keys(err).find(k => err[k] > 100)) {
|
|
464
|
-
unit = 'm'
|
|
465
|
-
for(let key in err) {
|
|
466
|
-
err[key] = _.round(err[key] / 100, 5)
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
return {
|
|
470
|
-
data: [err],
|
|
471
|
-
cols: [
|
|
472
|
-
{
|
|
473
|
-
title: `X中误差(${unit})`,
|
|
474
|
-
key: 'ex'
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
title: `Y中误差(${unit})`,
|
|
478
|
-
key: 'ey'
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
title: `Z中误差(${unit})`,
|
|
482
|
-
key: 'ez'
|
|
483
|
-
},
|
|
484
|
-
{
|
|
485
|
-
title: `XY中误差(${unit})`,
|
|
486
|
-
key: 'exy'
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
title: `总中误差(${unit})`,
|
|
490
|
-
key: 'et'
|
|
491
|
-
}
|
|
492
|
-
]
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
async function getErrorFeatures (photos, reportInfo, tilejson) {
|
|
497
|
-
let {image_POS_diff} = reportInfo
|
|
498
|
-
let {bounds} = tilejson
|
|
499
|
-
let geoDiff = Math.max(bounds[2] - bounds[0], bounds[3] - bounds[1])
|
|
500
|
-
let zoom = Math.log2(690 * 360 / (geoDiff * 512))
|
|
501
|
-
return Object.assign({bounds}, getFeatures(photos, image_POS_diff.filter(d => !!d.pos_diff), zoom))
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
function getReconstructEnvironment (reportInfo, taskInfo) {
|
|
505
|
-
return [
|
|
506
|
-
{
|
|
507
|
-
label: 'CPU型号',
|
|
508
|
-
value: reportInfo.cpu_name || '暂无'
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
label: 'GPU型号',
|
|
512
|
-
value: reportInfo.gpu_name || '暂无'
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
label: '内存',
|
|
516
|
-
value: reportInfo.max_ram ? `${_.round(reportInfo.max_ram, 2)}GB` : '暂无'
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
label: 'SDK版本(空三)',
|
|
520
|
-
value: reportInfo.sdk_version_AT || '暂无'
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
label: 'SDK版本(重建)',
|
|
524
|
-
value: reportInfo.sdk_version_3D || '暂无'
|
|
525
|
-
},
|
|
526
|
-
{
|
|
527
|
-
label: '软件版本',
|
|
528
|
-
value: getAppVersion(taskInfo)
|
|
529
|
-
}
|
|
530
|
-
]
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
function getReconstructParams (reportInfo) {
|
|
534
|
-
return [
|
|
535
|
-
{
|
|
536
|
-
label: '重建精度',
|
|
537
|
-
value: getReconstructAccurency(reportInfo.reconstruction_level)
|
|
538
|
-
},
|
|
539
|
-
{
|
|
540
|
-
label: '分块数量',
|
|
541
|
-
value: reportInfo.block_count || '暂无'
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
label: '输出成果类型',
|
|
545
|
-
value: reportInfo.production_type || '暂无'
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
label: '2D成果坐标系',
|
|
549
|
-
value: getCoordinateSystem(reportInfo.production_cs_2d)
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
label: '3D成果坐标系',
|
|
553
|
-
value: getCoordinateSystem(reportInfo.production_cs_3d)
|
|
554
|
-
}
|
|
555
|
-
]
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
function getReconstructAccurency (accurency) {
|
|
559
|
-
accurency = Number(accurency)
|
|
560
|
-
if (accurency === 1) {
|
|
561
|
-
return '超高精度'
|
|
562
|
-
} else if (accurency === 2) {
|
|
563
|
-
return '高精度'
|
|
564
|
-
} else if (accurency === 3) {
|
|
565
|
-
return '中精度'
|
|
566
|
-
} else {
|
|
567
|
-
return '暂无'
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
function getCoordinateSystem (cs) {
|
|
572
|
-
if (!cs) {
|
|
573
|
-
return '暂无'
|
|
574
|
-
}
|
|
575
|
-
let enums = ['LOCAL_ENU', 'LOCAL', 'Geographic', 'Projected', 'Geocentric', 'Unsupported']
|
|
576
|
-
if (cs.epsg_code) {
|
|
577
|
-
return `EPSG:${cs.epsg_code}`
|
|
578
|
-
} else {
|
|
579
|
-
return enums[cs.type]
|
|
580
|
-
}
|
|
581
|
-
}
|