Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
9cd3391f
Commit
9cd3391f
authored
Dec 09, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working on derivatives
parent
ef835205
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
24 deletions
+31
-24
LensDistortionParameters.java
src/main/java/LensDistortionParameters.java
+31
-24
No files found.
src/main/java/LensDistortionParameters.java
View file @
9cd3391f
...
@@ -711,35 +711,28 @@ dPXmmc/dphi=
...
@@ -711,35 +711,28 @@ dPXmmc/dphi=
13
,
// 13 public double distortionA=0.0; // r^4 (normalized to focal length or to sensor half width?)
13
,
// 13 public double distortionA=0.0; // r^4 (normalized to focal length or to sensor half width?)
14
,
// 14 public double distortionB=0.0; // r^3
14
,
// 14 public double distortionB=0.0; // r^3
15
,
// 15 public double distortionC=0.0; // r^2
15
,
// 15 public double distortionC=0.0; // r^2
18
,
// 16 Orthogonal elongation for r^2"
18
,
// 16 Orthogonal elongation for r^2"
19
,
// 17 Diagonal elongation for r^2"
19
,
// 17 Diagonal elongation for r^2"
20
,
// 18 Distortion center shift X for r^3"
20
,
// 18 Distortion center shift X for r^3"
21
,
// 19 Distortion center shift Y for r^3"
21
,
// 19 Distortion center shift Y for r^3"
22
,
// 20 Orthogonal elongation for r^3"
22
,
// 20 Orthogonal elongation for r^3"
23
,
// 21 Diagonal elongation for r^3"
23
,
// 21 Diagonal elongation for r^3"
24
,
// 22 Distortion center shift X for r^4"
24
,
// 22 Distortion center shift X for r^4"
25
,
// 23 Distortion center shift Y for r^4"
25
,
// 23 Distortion center shift Y for r^4"
26
,
// 24 Orthogonal elongation for r^4"
26
,
// 24 Orthogonal elongation for r^4"
27
,
// 25 Diagonal elongation for r^4"
27
,
// 25 Diagonal elongation for r^4"
28
,
// 26 Distortion center shift X for r^5"
28
,
// 26 Distortion center shift X for r^5"
29
,
// 27 Distortion center shift Y for r^5"
29
,
// 27 Distortion center shift Y for r^5"
30
,
// 28 Orthogonal elongation for r^5"
30
,
// 28 Orthogonal elongation for r^5"
31
,
// 29 Diagonal elongation for r^5"
31
,
// 29 Diagonal elongation for r^5"
32
,
// 30 Distortion center shift X for r^6"
32
,
// 30 Distortion center shift X for r^6"
33
,
// 31 Distortion center shift Y for r^6"
33
,
// 31 Distortion center shift Y for r^6"
34
,
// 32 Orthogonal elongation for r^6"
34
,
// 32 Orthogonal elongation for r^6"
35
,
// 33 Diagonal elongation for r^6"
35
,
// 33 Diagonal elongation for r^6"
36
,
// 34 Distortion center shift X for r^7"
36
,
// 34 Distortion center shift X for r^7"
37
,
// 35 Distortion center shift Y for r^7"
37
,
// 35 Distortion center shift Y for r^7"
38
,
// 36 Orthogonal elongation for r^6"
38
,
// 36 Orthogonal elongation for r^6"
39
,
// 37 Diagonal elongation for r^6"
39
,
// 37 Diagonal elongation for r^6"
40
,
// 38 Distortion center shift X for r^8"
40
,
// 38 Distortion center shift X for r^8"
41
,
// 29 Distortion center shift Y for r^8"
41
,
// 29 Distortion center shift Y for r^8"
42
,
// 40 Orthogonal elongation for r^8"
42
,
// 40 Orthogonal elongation for r^8"
...
@@ -1299,7 +1292,7 @@ dPXmmc/dphi=
...
@@ -1299,7 +1292,7 @@ dPXmmc/dphi=
double
[][]
dXeYeZe
=
null
;
//[14];
double
[][]
dXeYeZe
=
null
;
//[14];
double
[][]
dPXYmmc
=
null
;
double
[][]
dPXYmmc
=
null
;
/*
/*
Modifying to accommodate for eccentricity of different terms (2 parameters per term) and elliptical shape (another 2 terms). When all are
Modifying to accommodate for eccentricity of different terms (2 parameters per term) and elliptical shape (another 2 terms). When all are
zeroes, the old parameters are in effect:
zeroes, the old parameters are in effect:
Rdist/R=A8*R^7+A7*R^6+A6*R^5+A5*R^4+A*R^3+B*R^2+C*R+(1-A6-A7-A6-A5-A-B-C)");
Rdist/R=A8*R^7+A7*R^6+A6*R^5+A5*R^4+A*R^3+B*R^2+C*R+(1-A6-A7-A6-A5-A-B-C)");
...
@@ -1440,26 +1433,40 @@ dPXmmc/dphi=
...
@@ -1440,26 +1433,40 @@ dPXmmc/dphi=
// double csi=rel_to_pix*a[i]*(i+1)*rr_pow_i;
// double csi=rel_to_pix*a[i]*(i+1)*rr_pow_i;
// drr_dx=x/rr, drr_dy=y/r
// drr_dx=x/rr, drr_dy=y/r
// ki=a[i]*(rr^(i+1-1.0) +ki1*rr^i+ki2*rr^(i-1)
// ki=a[i]*(rr^(i+1-1.0) +ki1*rr^i+ki2*rr^(i-1)
// dki_dx=a[i]*(i+1)*(rr^i)+ (dki1_dx*rr^i+ ki1*i* rr^(i-1)*x/r) + (dki2_dx+ ki2*(i-1)*rr^(i-2)*x/r)=
// dki_dx=a[i]*(i+1)*(rr^i)*x/rr+ (dki1_dx*rr^i+ ki1*i* rr^(i-1)*x/r) + (dki2_dx+ ki2*(i-1)*rr^(i-2)*x/r)= // (WAS)
// (a[i]*(i+1)*(rr^i)/rr)*x +
// dki_dx=a[i]*(i+1)*(rr^i)+ (dki1_dx*rr^i+ ki1*i* rr^(i-1)*x/r) + (dki2_dx*rr^(i-1) + ki2*(i-1)*rr^(i-2)*x/r)= // (CORRECTED)
// (axi*r^(i-1) + (axi*x+ayi*y)/r*i)) * x +
// (a[i]*(i+1)*(rr^i)/rr)*x + // OK
// 2*(adi*y - aoi*x)*rr^(i-1)+
// (axi*r^(i-1) + (axi*x+ayi*y)/r*i)) * x + // (WAS)
// (aoi*(y^2-x^2)+2*adi*x*y)*(i-1)/r^3 * x
// (axi*r^i + (axi*x+ayi*y)*i*rr^(i-2) * x) + // (CORRECTED)
// 2*(adi*y - aoi*x)*rr^(i-1)+ // OK
// (aoi*(y^2-x^2)+2*adi*x*y)*(i-1)/r^3 * x // (WAS)
// (aoi*(y^2-x^2)+2*adi*x*y)*(i-1)*r^(i-3) * x // (CORRECTED)
// dki_dy=
// dki_dy=
// (a[i]*(i+1)*(rr^i)/rr)*y +
// (a[i]*(i+1)*(rr^i)/rr)*y + // OK
// (ayi*r^(i-1)*y + (axi*x+ayi*y)/r*i)) * y +
// (ayi*r^(i-1)*y + (axi*x+ayi*y)/r*i)) * y + // (WAS)
// 2*(adi*x + aoi*y)*rr^(i-1)+
// (ayi*r^i + (axi*x+ayi*y)*i*rr^(i-2) * x) + // (CORRECTED)
// (aoi*(y^2-x^2)+2*adi*x*y)*(i-1)/r^3 * y
// 2*(adi*x + aoi*y)*rr^(i-1)+ // OK
// (aoi*(y^2-x^2)+2*adi*x*y)*(i-1)/r^3 * y // (WAS)
// (aoi*(y^2-x^2)+2*adi*x*y)*(i-1)*r^(i-3) * x // (CORRECTED)
// Below may speed up by branching for i==0, i==1 - starting with commonn code
// Below may speed up by branching for i==0, i==1 - starting with commonn code
double
ai_iplus1_rr_pow_i_minus_1
=
a
[
i
]*(
i
+
1
)*
rr_pow_i_minus_1
;
double
ai_iplus1_rr_pow_i_minus_1
=
a
[
i
]*(
i
+
1
)*
rr_pow_i_minus_1
;
double
ki1_div_r_mul_i
=
i
*
ki1
/
rr
;
double
rr_pow_i_minus_2
=
rr_pow_i_minus_1
/
rr
;
double
ki2_div_r3_mul_im1
=(
i
-
1
)*
ki2
/(
rr
*
rr
*
rr
);
// double ki1_div_r_mul_i=i*ki1/rr;
double
ki1_r_pow_im2_mul_i
=
i
*
ki1
*
rr_pow_i_minus_2
;
// (axi*x+ayi*y)*i*rr^(i-2)
// double ki2_div_r3_mul_im1=(i-1)*ki2/(rr*rr*rr);
double
ki2_r_pow_im3_mul_im1
=(
i
-
1
)*
ki2
*
rr_pow_i_minus_2
/
rr
;
// (aoi*(y^2-x^2)+2*adi*x*y)* (i-1)*r^(i-3)
// double dki_dx= x*(ai_iplus1_rr_pow_i_minus_1 +
// r_xyod[i][0]*rr_pow_i_minus_1 + ki1_div_r_mul_i+ki2_div_r3_mul_im1)+
// 2*(r_xyod[i][3]*y - r_xyod[i][2]*x)/rr_pow_i_minus_1;
double
dki_dx
=
x
*(
ai_iplus1_rr_pow_i_minus_1
+
double
dki_dx
=
x
*(
ai_iplus1_rr_pow_i_minus_1
+
r_xyod
[
i
][
0
]*
rr_pow_i_minus_1
+
ki1_div_r_mul_i
+
ki2_div_r3_mul_im1
)+
ki1_r_pow_im2_mul_i
+
ki2_r_pow_im3_mul_im1
)+
// r_xyod[i][0]*rr_pow_i_minus_1 +
2
*(
r_xyod
[
i
][
3
]*
y
-
r_xyod
[
i
][
2
]*
x
)/
rr_pow_i_minus_1
;
r_xyod
[
i
][
0
]*
rr_pow_i
+
2
*(
r_xyod
[
i
][
3
]*
y
-
r_xyod
[
i
][
2
]*
x
)/
rr_pow_i_minus_1
;
// double dki_dy= y*(ai_iplus1_rr_pow_i_minus_1 +
// r_xyod[i][1]*rr_pow_i_minus_1 + ki1_div_r_mul_i + ki2_div_r3_mul_im1)+
// 2*(r_xyod[i][3]*x + r_xyod[i][2]*y)/rr_pow_i_minus_1;
double
dki_dy
=
y
*(
ai_iplus1_rr_pow_i_minus_1
+
double
dki_dy
=
y
*(
ai_iplus1_rr_pow_i_minus_1
+
r_xyod
[
i
][
1
]*
rr_pow_i_minus_1
+
ki1_div_r_mul_i
+
ki2_div_r3_mul_im1
)
+
ki1_r_pow_im2_mul_i
+
ki2_r_pow_im3_mul_im1
)+
// r_xyod[i][1]*rr_pow_i_minus_1
+
2
*(
r_xyod
[
i
][
3
]*
x
+
r_xyod
[
i
][
2
]*
y
)/
rr_pow_i_minus_1
;
r_xyod
[
i
][
1
]*
rr_pow_i
+
2
*(
r_xyod
[
i
][
3
]*
x
+
r_xyod
[
i
][
2
]*
y
)/
rr_pow_i_minus_1
;
// double ai_iplus1_rr_pow_i= a[i]*(i+1)*rr_pow_i;
// double ai_iplus1_rr_pow_i= a[i]*(i+1)*rr_pow_i;
// double dki_dxmmc= ai_iplus1_rr_pow_i*(x*(1.0-r_xyod[i][2])+y*r_xyod[i][3])/rr;
// double dki_dxmmc= ai_iplus1_rr_pow_i*(x*(1.0-r_xyod[i][2])+y*r_xyod[i][3])/rr;
// double dki_dymmc= ai_iplus1_rr_pow_i*(y*(1.0+r_xyod[i][2])+x*r_xyod[i][3])/rr;
// double dki_dymmc= ai_iplus1_rr_pow_i*(y*(1.0+r_xyod[i][2])+x*r_xyod[i][3])/rr;
...
...
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