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
1c62dfa5
Commit
1c62dfa5
authored
Feb 29, 2024
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creating kernel and matching images from different altitude
parent
2a60dccc
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
517 additions
and
3 deletions
+517
-3
DoubleFHT.java
src/main/java/com/elphel/imagej/common/DoubleFHT.java
+75
-2
Eyesis_Correction.java
.../java/com/elphel/imagej/correction/Eyesis_Correction.java
+16
-1
OrthoMap.java
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java
+426
-0
No files found.
src/main/java/com/elphel/imagej/common/DoubleFHT.java
View file @
1c62dfa5
...
@@ -346,7 +346,7 @@ public class DoubleFHT {
...
@@ -346,7 +346,7 @@ public class DoubleFHT {
return
phaseCorrelate
(
first
,
phaseCoeff
,
filter
,
fht_save
);
return
phaseCorrelate
(
first
,
phaseCoeff
,
filter
,
fht_save
);
}
}
public
double
[]
phaseCorrelate
(
public
double
[]
phaseCorrelate
(
// never
double
[]
first
,
double
[]
first
,
double
phaseCoeff
,
double
phaseCoeff
,
double
[]
filter
)
{
// high/low pass filtering
double
[]
filter
)
{
// high/low pass filtering
...
@@ -561,7 +561,7 @@ public class DoubleFHT {
...
@@ -561,7 +561,7 @@ public class DoubleFHT {
if
(
debug
)
ShowDoubleFloatArrays
.
showArrays
(
this
.
translateFHT
,
"translateFHT-"
+
IJ
.
d2s
(
dx
,
3
)+
":"
+
IJ
.
d2s
(
dy
,
3
));
if
(
debug
)
ShowDoubleFloatArrays
.
showArrays
(
this
.
translateFHT
,
"translateFHT-"
+
IJ
.
d2s
(
dx
,
3
)+
":"
+
IJ
.
d2s
(
dy
,
3
));
}
}
p
rivate
boolean
updateMaxN
(
double
[]
data
){
p
ublic
boolean
updateMaxN
(
double
[]
data
){
// was private
if
(
data
==
null
)
return
false
;
// do nothing
if
(
data
==
null
)
return
false
;
// do nothing
if
(!
powerOf2Size
(
data
))
{
if
(!
powerOf2Size
(
data
))
{
String
msg
=
"Image is not power of 2 size"
;
String
msg
=
"Image is not power of 2 size"
;
...
@@ -2146,6 +2146,41 @@ public class DoubleFHT {
...
@@ -2146,6 +2146,41 @@ public class DoubleFHT {
return
result
;
return
result
;
}
}
public
double
[]
divide
(
double
[]
h1
,
double
[]
h2
,
double
fat_zero
)
{
int
rowMod
,
colMod
;
double
mag
,
h2e
,
h2o
;
double
fz2
=
fat_zero
*
fat_zero
;
double
[]
result
=
new
double
[
maxN
*
maxN
];
for
(
int
r
=
0
;
r
<
maxN
;
r
++)
{
rowMod
=
(
maxN
-
r
)
%
maxN
;
for
(
int
c
=
0
;
c
<
maxN
;
c
++)
{
colMod
=
(
maxN
-
c
)
%
maxN
;
mag
=
h2
[
r
*
maxN
+
c
]
*
h2
[
r
*
maxN
+
c
]
+
h2
[
rowMod
*
maxN
+
colMod
]
*
h2
[
rowMod
*
maxN
+
colMod
]+
fz2
;
if
(
mag
<
1
e
-
20
)
mag
=
1
e
-
20
;
h2e
=
(
h2
[
r
*
maxN
+
c
]
+
h2
[
rowMod
*
maxN
+
colMod
]);
h2o
=
(
h2
[
r
*
maxN
+
c
]
-
h2
[
rowMod
*
maxN
+
colMod
]);
double
tmp
=
(
h1
[
r
*
maxN
+
c
]
*
h2e
-
h1
[
rowMod
*
maxN
+
colMod
]
*
h2o
);
result
[
r
*
maxN
+
c
]
=
tmp
/
mag
;
}
}
return
result
;
}
public
double
[]
setReal
(
double
[]
amp
)
{
// only first half used
double
[]
result
=
new
double
[
maxN
*
maxN
];
int
rowMod
,
colMod
;
for
(
int
r
=
0
;
r
<
maxN
/
2
;
r
++)
{
rowMod
=
(
maxN
-
r
)
%
maxN
;
for
(
int
c
=
0
;
c
<
maxN
;
c
++)
{
colMod
=
(
maxN
-
c
)
%
maxN
;
result
[
r
*
maxN
+
c
]
=
amp
[
r
*
maxN
+
c
];
result
[
rowMod
*
maxN
+
colMod
]
=
amp
[
r
*
maxN
+
c
];
}
}
return
result
;
}
public
double
[]
calculateAmplitude
(
double
[]
fht
)
{
public
double
[]
calculateAmplitude
(
double
[]
fht
)
{
int
size
=(
int
)
Math
.
sqrt
(
fht
.
length
);
int
size
=(
int
)
Math
.
sqrt
(
fht
.
length
);
...
@@ -2156,6 +2191,31 @@ public class DoubleFHT {
...
@@ -2156,6 +2191,31 @@ public class DoubleFHT {
swapQuadrants
(
amp
);
swapQuadrants
(
amp
);
return
amp
;
return
amp
;
}
}
public
double
[]
calculateAmplitudeNoSwap
(
double
[]
fht
)
{
int
size
=(
int
)
Math
.
sqrt
(
fht
.
length
);
double
[]
amp
=
new
double
[
size
*
size
];
for
(
int
row
=
0
;
row
<
size
;
row
++)
{
amplitude
(
row
,
size
,
fht
,
amp
);
}
return
amp
;
}
public
static
double
[]
calculatePhaseNoSwap
(
double
[]
fht
)
{
int
size
=(
int
)
Math
.
sqrt
(
fht
.
length
);
double
[]
phs
=
new
double
[
size
*
size
];
for
(
int
row
=
0
;
row
<
size
;
row
++)
{
phase
(
row
,
size
,
fht
,
phs
);
}
return
phs
;
}
public
double
[]
calculatePhase
(
double
[]
fht
)
{
int
size
=(
int
)
Math
.
sqrt
(
fht
.
length
);
double
[]
phs
=
new
double
[
size
*
size
];
for
(
int
row
=
0
;
row
<
size
;
row
++)
{
phase
(
row
,
size
,
fht
,
phs
);
}
swapQuadrants
(
phs
);
return
phs
;
}
public
double
[]
calculateAmplitudeHalf
(
double
[]
fht
)
{
public
double
[]
calculateAmplitudeHalf
(
double
[]
fht
)
{
int
size
=(
int
)
Math
.
sqrt
(
fht
.
length
);
int
size
=(
int
)
Math
.
sqrt
(
fht
.
length
);
...
@@ -2186,6 +2246,19 @@ public class DoubleFHT {
...
@@ -2186,6 +2246,19 @@ public class DoubleFHT {
}
}
}
}
static
void
phase
(
int
row
,
int
size
,
double
[]
fht
,
double
[]
phase
)
{
int
base
=
row
*
size
;
int
l
;
for
(
int
c
=
0
;
c
<
size
;
c
++)
{
l
=
((
size
-
row
)%
size
)
*
size
+
(
size
-
c
)%
size
;
double
re
=
0.5
*(
fht
[
base
+
c
]+
fht
[
l
]);
double
im
=
0.5
*(
fht
[
base
+
c
]-
fht
[
l
]);
phase
[
base
+
c
]
=
Math
.
atan2
(
im
,
re
);;
}
}
/* Squared amplitude of one row from 2D Hartley Transform. */
/* Squared amplitude of one row from 2D Hartley Transform. */
void
amplitude2
(
int
row
,
int
size
,
double
[]
fht
,
double
[]
amplitude
)
{
void
amplitude2
(
int
row
,
int
size
,
double
[]
fht
,
double
[]
amplitude
)
{
int
base
=
row
*
size
;
int
base
=
row
*
size
;
...
...
src/main/java/com/elphel/imagej/correction/Eyesis_Correction.java
View file @
1c62dfa5
...
@@ -849,6 +849,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
...
@@ -849,6 +849,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
addButton
(
"Read Tiff"
,
panelLWIRWorld
,
color_process
);
addButton
(
"Read Tiff"
,
panelLWIRWorld
,
color_process
);
addButton
(
"Set pair GPS"
,
panelLWIRWorld
,
color_process
);
addButton
(
"Set pair GPS"
,
panelLWIRWorld
,
color_process
);
addButton
(
"Test video"
,
panelLWIRWorld
,
color_process
);
addButton
(
"Test video"
,
panelLWIRWorld
,
color_process
);
addButton
(
"Deconvolve Slices"
,
panelLWIRWorld
,
color_process
);
plugInFrame
.
add
(
panelLWIRWorld
);
plugInFrame
.
add
(
panelLWIRWorld
);
}
}
...
@@ -5733,8 +5734,22 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
...
@@ -5733,8 +5734,22 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
return
;
return
;
}
}
OrthoMap
.
testVideo
(
imp_sel
);
OrthoMap
.
testVideo
(
imp_sel
);
}
else
if
(
label
.
equals
(
"Deconvolve Slices"
))
{
ImagePlus
imp_sel
=
WindowManager
.
getCurrentImage
();
if
(
imp_sel
==
null
)
{
IJ
.
showMessage
(
"Error"
,
"No images selected"
);
return
;
}
OrthoMap
.
testDeconvolveSlices
(
imp_sel
,
// ImagePlus imp,
512
,
// int [] slices,
new
int
[]
{
1
,
2
},
// int [] slices, deconvolve slice 2 with slice1
4
,
// int kernel_radius,
true
,
// boolean hor_sym,
true
,
// boolean vert_sym,
true
,
// false, // boolean all_sym,
DEBUG_LEVEL
);
// int debugLevel) { // >0
}
}
}
}
public
boolean
debugInitOneScene
()
{
public
boolean
debugInitOneScene
()
{
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java
View file @
1c62dfa5
This diff is collapsed.
Click to expand it.
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