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
95386703
Commit
95386703
authored
Aug 09, 2025
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjusting parameters, improved filtering, added error display by the
targets
parent
25577f58
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
430 additions
and
58 deletions
+430
-58
LensAdjustment.java
...in/java/com/elphel/imagej/calibration/LensAdjustment.java
+3
-3
CLTParameters.java
src/main/java/com/elphel/imagej/cameras/CLTParameters.java
+3
-3
DoubleGaussianBlur.java
...ain/java/com/elphel/imagej/common/DoubleGaussianBlur.java
+19
-12
CuasMotion.java
src/main/java/com/elphel/imagej/cuas/CuasMotion.java
+372
-33
IntersceneMatchParameters.java
...lphel/imagej/tileprocessor/IntersceneMatchParameters.java
+33
-7
No files found.
src/main/java/com/elphel/imagej/calibration/LensAdjustment.java
View file @
95386703
...
...
@@ -546,7 +546,7 @@ public class LensAdjustment {
double
targetMicrons
,
// target lens center distance (away from "best focus"
double
toleranceMicrons
,
// microns
double
toleranceTilt
,
//
double
toleranceThreshold
,
// When each error is under swcaled th
e
reshold, reduce correxction step twice
double
toleranceThreshold
,
// When each error is under swcaled threshold, reduce correxction step twice
double
parallelAdjustThreshold
,
// adjust 3 motors parallel if focal distance error in the center exceeds this
double
motorsSigma
,
// when fitting planes for far/near, tiltX and tiltY the weights of the samples decay with this sigma
double
motorsSigma3
,
// all 3 motors together (focusing center)
...
...
@@ -710,7 +710,7 @@ public class LensAdjustment {
this
.
targetMicrons
=
targetMicrons
;
// target lens center distance (away from "best focus"
this
.
toleranceMicrons
=
toleranceMicrons
;
// microns
this
.
toleranceTilt
=
toleranceTilt
;
//
this
.
toleranceThreshold
=
toleranceThreshold
;
// When each error is under swcaled th
e
reshold, reduce correxction step twice
this
.
toleranceThreshold
=
toleranceThreshold
;
// When each error is under swcaled threshold, reduce correxction step twice
this
.
parallelAdjustThreshold
=
parallelAdjustThreshold
;
// adjust 3 motors parallel if focal distance error in the center exceeds this
this
.
motorsSigma
=
motorsSigma
;
// when fitting planes for far/near, tiltX and tiltY the weights of the samples decay with this sigma
this
.
motorsSigma3
=
motorsSigma3
;
// same when 3 motors move together
...
...
@@ -873,7 +873,7 @@ public class LensAdjustment {
this
.
targetMicrons
,
// target lens center distance (away from "best focus"
this
.
toleranceMicrons
,
// microns
this
.
toleranceTilt
,
//
this
.
toleranceThreshold
,
// When each error is under swcaled th
e
reshold, reduce correxction step twice
this
.
toleranceThreshold
,
// When each error is under swcaled threshold, reduce correxction step twice
this
.
parallelAdjustThreshold
,
// adjust 3 motors parallel if focal distance error in the center exceeds this
this
.
motorsSigma
,
// when fitting planes for far/near, tiltX and tiltY the weights of the samples decay with this sigma
...
...
src/main/java/com/elphel/imagej/cameras/CLTParameters.java
View file @
95386703
...
...
@@ -3512,7 +3512,7 @@ public class CLTParameters {
gd
.
addCheckbox
(
"Add port weights to RGBA stack (debug feature)"
,
this
.
keep_weights
);
gd
.
addCheckbox
(
"Replace port weights with per-channel MIDCT (16x16) - were relevant"
,
this
.
replace_weights
);
gd
.
addCheckbox
(
"Alpha channel: use center 8x8 (unchecked - treat same as RGB)"
,
this
.
sharp_alpha
);
gd
.
addNumericField
(
"Alpha channel 0.0 th
ereshold (lower - transparent)"
,
this
.
alpha0
,
3
);
gd
.
addNumericField
(
"Alpha channel 0.0 th
reshold (lower - transparent)"
,
this
.
alpha0
,
3
);
gd
.
addNumericField
(
"Alpha channel 1.0 threshold (higher - opaque)"
,
this
.
alpha1
,
3
);
gd
.
addCheckbox
(
"Generate shifted channel linear RGB stacks"
,
this
.
gen_chn_stacks
);
gd
.
addCheckbox
(
"Generate shifted channel color image stack"
,
this
.
gen_chn_img
);
...
...
@@ -4130,11 +4130,11 @@ public class CLTParameters {
"Absolute inter-sensor difference to seed transparent texture."
);
gd
.
addNumericField
(
"Seed fat zero of combo variance"
,
this
.
lre_seed_same_fz
,
5
,
7
,
""
,
// 6.5; // 13; // seed_inter = 50.0;
"Add to the denominator (to combined variance) to divide inter-sensor variance."
);
gd
.
addNumericField
(
"Seed FOM th
ereshold"
,
this
.
lre_seed_fom
,
5
,
7
,
""
,
// 2.0; // 1.9; // 1.2;
gd
.
addNumericField
(
"Seed FOM th
reshold"
,
this
.
lre_seed_fom
,
5
,
7
,
""
,
// 2.0; // 1.9; // 1.2;
"Seed threshold for var_inter/(var_same+var_same_fz) - definitely not a foreground."
);
gd
.
addNumericField
(
"Seed fat zero of inter-sensor variance"
,
this
.
lre_trim_inter_fz
,
5
,
7
,
""
,
//5.0; // 13.0;
"Add to the denominator (to inter-sensor variance) to divide combo variance."
);
gd
.
addNumericField
(
"Trim FOM th
ereshold"
,
this
.
lre_trim_fom
,
5
,
7
,
""
,
// 0.5; // 0.8; // 1.3; // 1.8; // 1.2; // 0.8; // 0.4; // 0.7;
gd
.
addNumericField
(
"Trim FOM th
reshold"
,
this
.
lre_trim_fom
,
5
,
7
,
""
,
// 0.5; // 0.8; // 1.3; // 1.8; // 1.2; // 0.8; // 0.4; // 0.7;
"Trim threshold for var_same/(var_inter+var_inter_fz) - seems to be foreground."
);
gd
.
addMessage
(
"Reducing Trim FOM near high-contrast FG over sky by thresholding, bluring and dividing"
);
// Scale down FOM for pixels near high-variance VAR_SAME
...
...
src/main/java/com/elphel/imagej/common/DoubleGaussianBlur.java
View file @
95386703
...
...
@@ -106,7 +106,8 @@ public class DoubleGaussianBlur {
return
;
}
/* Blur an image in one direction (x or y) by a Gaussian.
/**
* Blur an image in one direction (x or y) by a Gaussian.
* @param ip The Image with the original data where also the result will be stored
* @param sigma Standard deviation of the Gaussian
* @param accuracy Accuracy of kernel, should not be > 0.02
...
...
@@ -188,7 +189,8 @@ public class DoubleGaussianBlur {
}
return
;
}
/* Create a 1-dimensional normalized Gaussian kernel with standard deviation sigma
/**
* Create a 1-dimensional normalized Gaussian kernel with standard deviation sigma
* and the running sum over the kernel
* Note: this is one side of the kernel only, not the full kernel as used by the
* Convolver class of ImageJ.
...
...
@@ -252,14 +254,15 @@ public class DoubleGaussianBlur {
}
return
kernel
;
}
/* Scale a line (row or column of a FloatProcessor or part thereof)
/** Scale a line (row or column of a FloatProcessor or part thereof)
* down by a factor <code>reduceBy</code> and write the result into
* <code>cache</code>.
* Input line pixel # <code>unscaled0</code> will correspond to output
* line pixel # 0. <code>unscaled0</code> may be negative. Out-of-line
* pixels of the input are replaced by the edge pixels.
*/
void
downscaleLine
(
double
[]
pixels
,
double
[]
cache
,
double
[]
kernel
,
static
void
downscaleLine
(
double
[]
pixels
,
double
[]
cache
,
double
[]
kernel
,
int
reduceBy
,
int
pixel0
,
int
unscaled0
,
int
length
,
int
pointInc
,
int
newLength
)
{
if
(
pixel0
>
pixels
.
length
)
{
System
.
out
.
println
(
"++++++ Error in DoubleGaussianBlur, pixel0="
+
pixel0
+
", pixels.length="
+(
pixels
.
length
));
...
...
@@ -280,7 +283,8 @@ public class DoubleGaussianBlur {
}
}
/* Create a kernel for downscaling. The kernel function preserves
/**
* Create a kernel for downscaling. The kernel function preserves
* norm and 1st moment (i.e., position) and has fixed 2nd moment,
* (in contrast to linear interpolation).
* In scaled space, the length of the kernel runs from -1.5 to +1.5,
...
...
@@ -288,7 +292,7 @@ public class DoubleGaussianBlur {
* Array index corresponding to the kernel center is
* unitLength*3/2
*/
double
[]
makeDownscaleKernel
(
int
unitLength
)
{
static
double
[]
makeDownscaleKernel
(
int
unitLength
)
{
int
mid
=
unitLength
*
3
/
2
;
double
[]
kernel
=
new
double
[
3
*
unitLength
];
for
(
int
i
=
0
;
i
<=
unitLength
/
2
;
i
++)
{
...
...
@@ -306,10 +310,11 @@ public class DoubleGaussianBlur {
return
kernel
;
}
/* Scale a line up by factor <code>reduceBy</code> and write as a row
/**
* Scale a line up by factor <code>reduceBy</code> and write as a row
* or column (or part thereof) to the pixels array of a FloatProcessor.
*/
void
upscaleLine
(
double
[]
cache
,
double
[]
pixels
,
double
[]
kernel
,
static
void
upscaleLine
(
double
[]
cache
,
double
[]
pixels
,
double
[]
kernel
,
int
reduceBy
,
int
pixel0
,
int
unscaled0
,
int
writeFrom
,
int
writeTo
,
int
pointInc
)
{
int
p
=
pixel0
+
pointInc
*
writeFrom
;
for
(
int
xout
=
writeFrom
;
xout
<
writeTo
;
xout
++,
p
+=
pointInc
)
{
...
...
@@ -322,7 +327,8 @@ public class DoubleGaussianBlur {
}
}
/* Create a kernel for upscaling. The kernel function is a convolution
/**
* Create a kernel for upscaling. The kernel function is a convolution
* of four unit squares, i.e., four uniform kernels with value +1
* from -0.5 to +0.5 (in downscaled coordinates). The second derivative
* of this kernel is smooth, the third is not. Its standard deviation
...
...
@@ -330,7 +336,7 @@ public class DoubleGaussianBlur {
* The kernel runs from [-2 to +2[, corresponding to array index
* 0 ... 4*unitLength (whereby the last point is not in the array any more).
*/
double
[]
makeUpscaleKernel
(
int
unitLength
)
{
static
double
[]
makeUpscaleKernel
(
int
unitLength
)
{
double
[]
kernel
=
new
double
[
4
*
unitLength
];
int
mid
=
2
*
unitLength
;
kernel
[
0
]
=
0
;
...
...
@@ -349,7 +355,8 @@ public class DoubleGaussianBlur {
return
kernel
;
}
/* Convolve a line with a symmetric kernel and write to a separate array,
/**
* Convolve a line with a symmetric kernel and write to a separate array,
* possibly the pixels array of a FloatProcessor (as a row or column or part thereof)
*
* @param input Input array containing the line
...
...
@@ -371,7 +378,7 @@ public class DoubleGaussianBlur {
* @param pointInc Increment of the pixels array index to the next point (for an ImageProcessor,
* it should be <code>1</code> for a row, <code>width</code> for a column)
*/
public
void
convolveLine
(
double
[]
input
,
double
[]
pixels
,
double
[][]
kernel
,
int
readFrom
,
public
static
void
convolveLine
(
double
[]
input
,
double
[]
pixels
,
double
[][]
kernel
,
int
readFrom
,
int
readTo
,
int
writeFrom
,
int
writeTo
,
int
point0
,
int
pointInc
)
{
int
length
=
input
.
length
;
double
first
=
input
[
0
];
//out-of-edge pixels are replaced by nearest edge pixels
...
...
src/main/java/com/elphel/imagej/cuas/CuasMotion.java
View file @
95386703
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/tileprocessor/IntersceneMatchParameters.java
View file @
95386703
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