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
c6342926
Commit
c6342926
authored
Sep 16, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing multi-sensor operation
parent
0a534fc8
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
5 deletions
+19
-5
.gitignore
.gitignore
+1
-0
Makefile
src/Makefile
+7
-0
autoexposure
src/autoexposure
+0
-0
globalsinit.c
src/globalsinit.c
+8
-4
temperature
src/temperature
+0
-0
white_balance.c
src/white_balance.c
+3
-1
No files found.
.gitignore
View file @
c6342926
...
...
@@ -13,3 +13,4 @@ bitbake-logs
*.o
*.cgi
bitbake-logs
.depend
src/Makefile
View file @
c6342926
...
...
@@ -36,3 +36,10 @@ clean:
# REMOTE_USER=${REMOTE_USER}
# REMOTE_IP=${REMOTE_IP}
depend
:
.depend
.depend
:
$(SRCS)
rm
-f
./.depend
$(CC)
$(CFLAGS)
-MM
$^
>
./.depend
;
include
.depend
src/autoexposure
deleted
100755 → 0
View file @
0a534fc8
File deleted
src/globalsinit.c
View file @
c6342926
...
...
@@ -67,13 +67,17 @@ int initFilesMmap(int sensor_port, int sensor_subchannel) {
const
char
*
framepars_driver_name
=
framepars_dev_names
[
sensor_port
];
const
char
histogram_driver_name
[]
=
DEV393_PATH
(
DEV393_HISTOGRAM
);
const
char
gamma_driver_name
[]
=
DEV393_PATH
(
DEV393_GAMMA
);
int
total_hist_entries
;
// =8*4 for 4 sensors
///Frame parameters file open/mmap (read/write)
fd_fparmsall
=
open
(
framepars_driver_name
,
O_RDWR
);
if
(
fd_fparmsall
<
0
)
{
ELP_FERR
(
fprintf
(
stderr
,
"Open failed: (%s)
\r\n
"
,
framepars_driver_name
));
return
-
1
;
}
frameParsAll
=
(
struct
framepars_all_t
*
)
mmap
(
0
,
sizeof
(
struct
framepars_all_t
)
*
HISTOGRAM_CACHE_NUMBER
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
fd_fparmsall
,
0
);
// frameParsAll = (struct framepars_all_t *) mmap(0, sizeof (struct framepars_all_t) * HISTOGRAM_CACHE_NUMBER , PROT_READ | PROT_WRITE, MAP_SHARED, fd_fparmsall, 0);
frameParsAll
=
(
struct
framepars_all_t
*
)
mmap
(
0
,
sizeof
(
struct
framepars_all_t
),
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
fd_fparmsall
,
0
);
if
((
int
)
frameParsAll
==
-
1
)
{
ELP_FERR
(
fprintf
(
stderr
,
"problems with mmap: %s
\n
"
,
framepars_driver_name
));
close
(
fd_fparmsall
);
...
...
@@ -90,10 +94,10 @@ int initFilesMmap(int sensor_port, int sensor_subchannel) {
close
(
fd_fparmsall
);
return
-
1
;
}
// Select port and subchannel for histograms
lseek
(
fd_histogram_cache
,
LSEEK_HIST_SET_CHN
+
(
4
*
sensor_port
)
+
sensor_subchannel
,
SEEK_END
);
/// specify port/sub-channel is needed
// Select port and subchannel for histograms
(result is the total number of histograms entries)
total_hist_entries
=
lseek
(
fd_histogram_cache
,
LSEEK_HIST_SET_CHN
+
(
4
*
sensor_port
)
+
sensor_subchannel
,
SEEK_END
);
/// specify port/sub-channel is needed
histogram_cache
=
(
struct
histogram_stuct_t
*
)
mmap
(
0
,
sizeof
(
struct
histogram_stuct_t
)
*
HISTOGRAM_CACHE_NUMBER
,
PROT_READ
,
MAP_SHARED
,
fd_histogram_cache
,
0
);
histogram_cache
=
(
struct
histogram_stuct_t
*
)
mmap
(
0
,
sizeof
(
struct
histogram_stuct_t
)
*
total_hist_entries
,
PROT_READ
,
MAP_SHARED
,
fd_histogram_cache
,
0
);
if
((
int
)
histogram_cache
==
-
1
)
{
ELP_FERR
(
fprintf
(
stderr
,
"problems with mmap: %s
\n
"
,
histogram_driver_name
));
close
(
fd_fparmsall
);
...
...
src/temperature
deleted
100755 → 0
View file @
0a534fc8
File deleted
src/white_balance.c
View file @
c6342926
...
...
@@ -161,8 +161,10 @@ int whiteBalanceCorr(int frame, int target_frame, int ae_rslt) {
/// Find the "brightest" color (maximal number of pixels above wb_whitelev ). wb_whitelev is currently rounded to 8 bits
max_white_pixels
=
0
;
num_pixels
=
histogram_cache
[
hist_index
].
cumul_hist
[
255
+
(
COLOR_Y_NUMBER
<<
8
)];
/// this one is definitely calculated
// Because it is used for autoexposure? Check it is valid
if
(
num_pixels
<
MIN_PIXELS_TO_ADJUST
)
{
ELP_FERR
(
fprintf
(
stderr
,
"Few pixels to process, giving up. num_pixels=%d, frame=%d (0x%x)
\n
"
,
num_pixels
,
frame
,
frame
));
ELP_FERR
(
fprintf
(
stderr
,
"Few pixels to process, giving up. num_pixels=%d, frame=%d (0x%x) valid=0x%lx
\n
"
,
num_pixels
,
frame
,
frame
,
histogram_cache
[
hist_index
].
valid
));
return
-
1
;
}
min_white_pixels
=
num_pixels
;
...
...
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