Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-autoexposure
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
elphel-apps-autoexposure
Commits
4a215f5c
Commit
4a215f5c
authored
Jan 09, 2018
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed old bug in triggering overexposure recovery
parent
a74213fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
aexp_corr.c
src/aexp_corr.c
+6
-4
No files found.
src/aexp_corr.c
View file @
4a215f5c
...
...
@@ -112,7 +112,7 @@ int aexpCorr(int color, int frame, int target_frame) {
}
if
(
GLOBALPARS_SNGL
(
G_NEXT_AE_FRAME
)
>
frame
)
return
0
;
/// too early to bother
MDF3
(
fprintf
(
stderr
,
"*ae_err=%d
\n
"
,
*
ae_err
));
///======= 0 here
MDF3
(
fprintf
(
stderr
,
"
Accumulated error
*ae_err=%d
\n
"
,
*
ae_err
));
///======= 0 here
frac
=
framePars
[
target_frame
&
PARS_FRAMES_MASK
].
pars
[
P_AEXP_FRACPIX
];
// level=framePars[target_frame & PARS_FRAMES_MASK].pars[P_AEXP_LEVEL];
...
...
@@ -139,7 +139,7 @@ int aexpCorr(int color, int frame, int target_frame) {
}
}
level_gamma
=
framePars
[
target_frame
&
PARS_FRAMES_MASK
].
pars
[
P_AEXP_LEVEL
];
/// calculate sensor level from gamma_level using gamma table w
histh hash32 saved at hist_index
/// calculate sensor level from gamma_level using gamma table w
ith hash32 saved at hist_index
level
=
gammaReverse
(
level_gamma
);
MDF3
(
fprintf
(
stderr
,
"->>> frame=0x%x, target_frame=0x%x,dim=0x%04x, frac=0x%04x, level=0x%x,level_gamma=0x%x, perc=0x%04x
\n
"
,
frame
,
target_frame
,
dim
,
frac
,
level
,
level_gamma
,
perc
));
if
(
perc
<
0
)
{
...
...
@@ -147,10 +147,12 @@ int aexpCorr(int color, int frame, int target_frame) {
return
-
1
;
///getPercentile() failed
}
///
/// overexposure recovery
/// overexposure recovery
. Triggered if the percentile is above middle point between the set level and 0xffff
///
// if (perc > ((level+0xffff)>>1)) {
if
((
perc
>
((
level_gamma
+
0x1ffff
)
>>
2
))
&&
(
perc
>
0xf000
)
)
{
/// if ((perc > ((level_gamma+0x1ffff)>>2))&& (perc>0xf000) ) {
/// if ((perc > ((level_gamma+0x2ffff)>>2))&& (perc>0xf000) ) {
if
((
perc
>
((
level_gamma
+
0xffff
)
>>
1
))
&&
(
perc
>
0xf000
)
)
{
// more that a middle between level and upper limit of 0xfff
aex_recover_cntr
++
;
/// global counter
///NOTE: Maybe just dividing exposure by 2 /counter is enough?
...
...
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