Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
x3domlet
Commits
6796bdda
Commit
6796bdda
authored
Aug 01, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
approx tilt and altitude by 2 points
parent
f029bffd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
5 deletions
+102
-5
align_functions.js
js/align_functions.js
+45
-0
ui_align.js
js/ui_align.js
+46
-2
viewer.html
viewer.html
+11
-3
No files found.
js/align_functions.js
View file @
6796bdda
...
...
@@ -263,3 +263,48 @@ function art_w_i(i,v){
return
1
;
//return 1/art_l_i(i);
}
/**
* Functions for relative altitude, tilt and roll
* art2_...
*/
function
art2_f_3d_i
(
i
,
v
){
return
art_f_3d_i
(
i
,[
v
[
0
],
0
,
v
[
1
]]);
}
function
art2_f_map_i
(
i
,
v
){
return
art_f_map_i
(
i
,[
v
[
0
],
0
,
v
[
1
]]);
}
function
art2_r_i
(
i
,
v
){
var
f1
=
art2_f_3d_i
(
i
,
v
);
var
f2
=
art2_f_map_i
(
i
,
v
);
//return (f1-f2+360)%360;
return
(
f1
-
f2
);
}
function
art2_dr_dx_i
(
i
,
v
){
return
art_dr_dx_i
(
i
,[
v
[
0
],
0
,
v
[
1
]]);
}
function
art2_dr_da_i
(
i
,
v
){
return
1
;
}
function
art2_l_i
(
i
){
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
z
;
return
Math
.
sqrt
(
Math
.
pow
(
xi
,
2
)
+
Math
.
pow
(
yi
,
2
)
+
Math
.
pow
(
zi
,
2
));
}
function
art2_w_i
(
i
,
v
){
return
1
;
//return 1/art_l_i(i);
}
js/ui_align.js
View file @
6796bdda
...
...
@@ -263,17 +263,29 @@ function distance_error(x,y,h){
*/
function
x3dom_align_art
(){
var
epsilon
=
1
e
-
8
;
//test_height_alignment_set1();
//test_height_alignment_set2();
//test_height_alignment_set3_2points();
if
(
Data
.
markers
.
length
<
2
){
console
.
log
(
"Too few points"
);
return
;
}
var
epsilon
=
1
e
-
8
;
var
result
=
numbers
.
calculus
.
GaussNewton
([
0
,
0
,
0
],
Data
.
markers
.
length
,
art_r_i
,[
art_dr_dx_i
,
art_dr_dy_i
,
art_dr_da_i
],
epsilon
,
art_w_i
);
if
(
Data
.
markers
.
length
==
2
){
console
.
log
(
"2 Markers provided: align Height'n'Tilt only (while Roll = 0)"
);
var
result
=
numbers
.
calculus
.
GaussNewton
([
0
,
0
],
Data
.
markers
.
length
,
art2_r_i
,[
art2_dr_dx_i
,
art2_dr_da_i
],
epsilon
,
art2_w_i
);
console
.
log
(
result
);
return
;
}
var
result
=
numbers
.
calculus
.
GaussNewton
([
0
,
0
,
0
],
Data
.
markers
.
length
,
art_r_i
,[
art_dr_dx_i
,
art_dr_dy_i
,
art_dr_da_i
],
epsilon
,
art_w_i
);
console
.
log
(
result
);
}
...
...
@@ -413,7 +425,39 @@ function test_height_alignment_set2(){
}
function
test_height_alignment_set3_2points
(){
Data
.
markers
=
[
// mark 1
{
d_map
:
59.51564928339807
,
d_x3d
:
58.313592803937226
,
align
:{
altitude
:
-
10.5
,
latitude
:
40.723442371919724
,
longitude
:
-
111.93217635154726
,
x
:
23.459612763633526
,
y
:
-
16.16174219091789
,
z
:
-
53.38653083581816
}
},
// mark 2
{
d_map
:
190.2700432380853
,
d_x3d
:
182.86147956244875
,
align
:{
altitude
:
-
10.5
,
latitude
:
40.72385908620143
,
longitude
:
-
111.93070113658906
,
x
:
37.888760344786206
,
y
:
-
21.838175845671834
,
z
:
-
178.89315958779198
}
}
];
}
...
...
viewer.html
View file @
6796bdda
...
...
@@ -74,15 +74,23 @@
<div
id=
'help_button'
>
?
</div>
<div
id=
'download_button'
title=
'Download 3d model (.obj & .x3d formats)'
></div>
<div
id=
'menu_button'
></div>
<div
id=
'align_button'
title=
'Run
alignment algorithm
for camera heading and location using markers.
<div
id=
'align_button'
title=
'Run
least squares fit algorithm (Gauss-Newton)
for camera heading and location using markers.
Instructions:
1. Use approximate location control on the map to change initial approximation for the algorithm.
2. Place at least 3 markers
on the 3D model
(ctrl+click) - drag to position more precisely.
2. Place at least 3 markers
in the 3D scene
(ctrl+click) - drag to position more precisely.
3. Move all markers on the map to update their location - drag to position more precisely.
4. Click this button - the results will appear in a dialog window with "apply"/"cancel"
5. To save the result click upload button (Initial location and heading) in the menu.'
class=
'edit'
></div>
<!--<div id='align_tr_button' title='Align tilt and roll' class='edit'></div>-->
<div
id=
'align_tr_button'
title=
'Align tilt and roll'
class=
'experimental'
></div>
<div
id=
'align_tr_button'
title=
'Run least squares fit algorithm (Gauss-Newton) for camera tilt, roll and altitude (relative).
Instructions:
1. Place markers in the 3D scene (ctrl+click) - drag to position more precisely.
* 2 markers - adjust tilt and altitude, while roll = 0°
* 3+ markers - adjust tilt, roll and altitude
2. Move all markers on the map to update their location - drag to position more precisely.
3. Turn on "Switch and Elevation control mode" for the map, drag markers over map to set approximate altitude relative to the camera.
4. Click this button - the results will appear in the browser console. Look for "v"-vector data.
'
class=
'experimental'
></div>
</div>
<div
id=
'info-wrapper'
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment