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
a2ab98bb
Commit
a2ab98bb
authored
Jan 14, 2017
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed slightly incorrect colors (window multiplication changing kernels)
parent
96038858
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
14 deletions
+18
-14
EyesisDCT.java
src/main/java/EyesisDCT.java
+0
-11
ImageDtt.java
src/main/java/ImageDtt.java
+18
-3
No files found.
src/main/java/EyesisDCT.java
View file @
a2ab98bb
...
...
@@ -792,23 +792,12 @@ public class EyesisDCT {
for
(
int
i
=
0
;
i
<
norm_sym_weights
.
length
;
i
++){
scale_sym
+=
norm_sym_weights
[
i
]*
kernels
[
chn
].
st_kernels
[
nc
][
tileY
][
tileX
][
i
];
}
/*
for (int i = 0; i< dct_size; i++){
for (int j = 0; j< dct_size; j++){
double d = kernels[chn].st_kernels[nc][tileY][tileX][i*dct_size+j];
if (i > 0) d*=2;
if (j > 0) d*=2;
scale_sym +=d;
}
}
*/
for
(
int
i
=
0
;
i
<
kernels
[
chn
].
st_kernels
[
nc
][
tileY
][
tileX
].
length
;
i
++)
{
kernels
[
chn
].
st_kernels
[
nc
][
tileY
][
tileX
][
i
]
/=
scale_sym
;
}
if
((
debugLevel
>
0
)
&&
(
tileY
==
dct_parameters
.
tileY
)
&&
(
tileX
==
dct_parameters
.
tileX
))
{
System
.
out
.
println
(
"chn="
+
chn
+
" tileY="
+
tileY
+
", tileX"
+
tileY
+
" scale_sym="
+
scale_sym
);
}
}
// Make a copy of direct kernels (debug feature, may be removed later)
for
(
int
i
=
0
;
i
<
dct_size
;
i
++){
...
...
src/main/java/ImageDtt.java
View file @
a2ab98bb
...
...
@@ -661,7 +661,18 @@ public class ImageDtt {
final
double
[][]
filters_proto
=
new
double
[
3
][];
System
.
out
.
println
(
"dct_color_convert(): kr="
+
kr
+
" kg="
+
kg
+
" kb="
+
kb
);
final
double
[]
sigmas
=
{
sigma_rb
,
sigma_y
,
sigma_color
};
double
[]
norm_sym_weights
=
new
double
[
dct_size
*
dct_size
];
for
(
int
i
=
0
;
i
<
dct_size
;
i
++){
for
(
int
j
=
0
;
j
<
dct_size
;
j
++){
double
d
=
Math
.
cos
(
Math
.
PI
*
i
/(
2
*
dct_size
))*
Math
.
cos
(
Math
.
PI
*
j
/(
2
*
dct_size
));
if
(
i
>
0
)
d
*=
2.0
;
if
(
j
>
0
)
d
*=
2.0
;
norm_sym_weights
[
i
*
dct_size
+
j
]
=
d
;
}
}
for
(
int
n
=
0
;
n
<
3
;
n
++)
{
double
s
=
0.0
;
for
(
int
i
=
0
;
i
<
dct_size
;
i
++){
for
(
int
j
=
0
;
j
<
dct_size
;
j
++){
...
...
@@ -669,12 +680,16 @@ public class ImageDtt {
if
(
sigmas
[
n
]
==
0.0
)
d
=
((
i
==
0
)
&&
(
j
==
0
))?
1.0
:
0.0
;
else
d
=
Math
.
exp
(-(
i
*
i
+
j
*
j
)/(
2
*
sigmas
[
n
]));
filters_proto_direct
[
n
][
i
*
dct_size
+
j
]
=
d
;
if
(
i
>
0
)
d
*=
2
;
if
(
j
>
0
)
d
*=
2
;
s
+=
d
;
//
if (i > 0) d*=2;
//
if (j > 0) d*=2;
//
s += d;
}
}
for
(
int
i
=
0
;
i
<
dct_len
;
i
++){
s
+=
norm_sym_weights
[
i
]*
filters_proto_direct
[
n
][
i
];
}
System
.
out
.
println
(
"dct_color_convert(): sigmas["
+
n
+
"]="
+
sigmas
[
n
]+
", sum="
+
s
);
for
(
int
i
=
0
;
i
<
dct_len
;
i
++){
filters_proto_direct
[
n
][
i
]
/=
s
;
...
...
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