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
05489e74
Commit
05489e74
authored
Jul 24, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
1494df60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
numbers.calculus.extra.js
js/numbers/numbers.calculus.extra.js
+12
-8
ui_align.js
js/ui_align.js
+12
-1
No files found.
js/numbers/numbers.calculus.extra.js
View file @
05489e74
...
@@ -59,7 +59,7 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps,w){
...
@@ -59,7 +59,7 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps,w){
var
v1
=
iterate
(
v0
,
n
,
r
,
dr
)
var
v1
=
iterate
(
v0
,
n
,
r
,
dr
)
//
console.log(v1);
console
.
log
(
v1
);
var
s0
=
sigma
(
v0
,
n
,
r
)
var
s0
=
sigma
(
v0
,
n
,
r
)
var
s1
=
sigma
(
v1
,
n
,
r
)
var
s1
=
sigma
(
v1
,
n
,
r
)
...
@@ -85,8 +85,6 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps,w){
...
@@ -85,8 +85,6 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps,w){
var
J
=
jacobian
(
v
,
n
,
dr
)
var
J
=
jacobian
(
v
,
n
,
dr
)
console
.
log
(
J
);
var
Jt
=
numbers
.
matrix
.
transpose
(
J
)
var
Jt
=
numbers
.
matrix
.
transpose
(
J
)
for
(
var
i
=
0
;
i
<
n
;
i
++
){
for
(
var
i
=
0
;
i
<
n
;
i
++
){
...
@@ -197,6 +195,8 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
...
@@ -197,6 +195,8 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
var
counter
=
0
var
counter
=
0
var
v0
=
v
var
v0
=
v
var
xn
=
r
.
length
;
if
(
w
===
undefined
){
if
(
w
===
undefined
){
w
=
function
(){
w
=
function
(){
return
1
;
return
1
;
...
@@ -231,7 +231,11 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
...
@@ -231,7 +231,11 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
//functions
//functions
function
iterate
(
v
,
n
,
r
,
dr
){
function
iterate
(
v
,
n
,
r
,
dr
){
var
wsum
=
ws
(
v
,
n
)
var
wsum
=
0
;
for
(
var
j
=
0
;
j
<
xn
;
j
++
){
wsum
+=
ws
(
v
,
n
,
xn
)
}
var
J
=
jacobian
(
v
,
n
,
dr
)
var
J
=
jacobian
(
v
,
n
,
dr
)
var
Jt
=
numbers
.
matrix
.
transpose
(
J
)
var
Jt
=
numbers
.
matrix
.
transpose
(
J
)
...
@@ -307,19 +311,19 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
...
@@ -307,19 +311,19 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
}
}
// normalized weight
// normalized weight
function
wn
(
i
,
v
,
wsum
){
function
wn
(
i
,
v
,
wsum
,
xn
){
return
w
(
i
,
v
)
/
wsum
return
w
[
xn
]
(
i
,
v
)
/
wsum
}
}
// sum of weights for normalization
// sum of weights for normalization
function
ws
(
v
,
n
){
function
ws
(
v
,
n
,
xn
){
var
wsum
=
0
var
wsum
=
0
for
(
var
i
=
0
;
i
<
n
;
i
++
){
for
(
var
i
=
0
;
i
<
n
;
i
++
){
wsum
+=
w
(
i
,
v
)
wsum
+=
w
[
xn
]
(
i
,
v
)
}
}
return
wsum
return
wsum
...
...
js/ui_align.js
View file @
05489e74
...
@@ -401,7 +401,18 @@ function x3dom_align_hll3(){
...
@@ -401,7 +401,18 @@ function x3dom_align_hll3(){
var
xyh
=
[
x0
,
y0
];
var
xyh
=
[
x0
,
y0
];
var
result
=
numbers
.
calculus
.
GaussNewton
(
xyh
,
Data
.
markers
.
length
,
hll3_r_i
,[
hll3_dr_dx_i
,
hll3_dr_dy_i
],
epsilon
,
hll3_w_i
);
var
result
=
numbers
.
calculus
.
GaussNewton
(
xyh
,
Data
.
markers
.
length
,
hll3_r_i
,[
hll3_dr_dx_i
,
hll3_dr_dy_i
],
epsilon
,
hll3_w_i
);
//var result = numbers.calculus.GaussNewton_nD(xyh,Data.markers.length,hll3_r_i,[hll3_dr_dx_i,hll3_dr_dy_i],epsilon,hll3_w_i);
/*
var rs_i = [hll3_r_i, hll3_r_i];
var drs_i = [
[hll3_dr_dx_i, hll3_dr_dy_i],
[hll3_dr_dx_i, hll3_dr_dy_i]
];
var ws_i = [hll3_w_i, hll3_w_i];
var result = numbers.calculus.GaussNewton_nD(xyh,Data.markers.length,rs_i,drs_i,epsilon,ws_i);
*/
xyh
=
[
result
.
v
[
0
],
result
.
v
[
1
],
h0
];
xyh
=
[
result
.
v
[
0
],
result
.
v
[
1
],
h0
];
...
...
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