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
1a8e9ec4
Commit
1a8e9ec4
authored
Jul 18, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E_d^-1 average
parent
a827cf54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
ui_align.js
js/ui_align.js
+27
-2
test.html
test.html
+2
-2
No files found.
js/ui_align.js
View file @
1a8e9ec4
...
...
@@ -179,9 +179,12 @@ function x3dom_align_GN(){
}
//calc distance error
de
=
distance_error
(
xyh
[
0
],
xyh
[
1
],
xyh
[
2
]);
//convert to conventional range
xyh
[
2
]
=
(
xyh
[
2
]
+
360
)
%
360
;
//init apply dialog
apply_alignment_dialog
([
x0
,
y0
,
h0
],
xyh
,
counter
,
s1
);
apply_alignment_dialog
([
x0
,
y0
,
h0
],
xyh
,
counter
,
s1
,
de
);
}
...
...
@@ -517,7 +520,7 @@ function AxV(A,V){
/*
* ui dialog to apply or cancel results
*/
function
apply_alignment_dialog
(
xyh0
,
xyh1
,
c
,
e
){
function
apply_alignment_dialog
(
xyh0
,
xyh1
,
c
,
e
,
de
){
var
d
=
$
(
"<div>"
,{
id
:
"aa1_dialog"
});
...
...
@@ -525,6 +528,7 @@ function apply_alignment_dialog(xyh0,xyh1,c,e){
'<div>Alignment algorithm results</div>'
,
'<br/>'
,
'<div>Error: <b>'
+
e
+
' °</b></div>'
,
'<div>d<sup>-1</sup> Error: <b>'
+
de
+
' m<sup>-1</sup></b></div>'
,
'<div>Iterations: <b>'
+
c
+
'</b></div>'
,
'<div>'
,
'<table>'
,
...
...
@@ -604,6 +608,27 @@ function apply_alignment(xyh){
}
function
distance_error
(
x
,
y
,
h
){
var
sum
=
0
;
for
(
var
i
=
0
;
i
<
Data
.
markers
.
length
;
i
++
){
var
angle0
=
h
;
var
angle1
=
f2_map_i
(
i
,
x
,
y
,
h
);
var
z_map
=
Math
.
cos
(
Math
.
PI
/
180
*
(
angle0
-
angle1
))
*
Data
.
markers
[
i
].
d_map
;
var
z_x3d
=
-
Data
.
markers
[
i
].
align
.
z
;
sum
+=
1
/
z_map
-
1
/
z_x3d
;
console
.
log
(
"Marker: "
+
i
+
", Camera heading: "
+
angle0
+
", Point azimuth: "
+
angle1
+
" , z_map: "
+
z_map
+
", z_x3d: "
+
z_x3d
+
", error^-1: "
+
(
1
/
z_map
-
1
/
z_x3d
));
}
sum
=
sum
/
Data
.
markers
.
length
;
console
.
log
(
"Final sum averaged: "
+
sum
);
return
sum
;
}
/*
* not used
*/
...
...
test.html
View file @
1a8e9ec4
...
...
@@ -149,13 +149,13 @@ Instructions:
<div
id=
'kmlstatus'
></div>
</td>
</tr>
<tr
class=
'experimental'
>
<
!--<
tr class='experimental'>
<td>
<button id='align_0' class='donothide'>Align0</button>
<button id='align_1' class='donothide'>Align1</button>
<button id='align_2' class='donothide'>Align2</button>
</td>
</tr>
</tr>
-->
<tr>
<td>
</td>
</tr>
...
...
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