renamed cv_ae_awb to bebop_ae_awb

This commit is contained in:
kirkscheper
2017-01-10 11:06:32 +01:00
parent f99ee0fc51
commit 2baf51ea4f
5 changed files with 42 additions and 42 deletions
+1 -1
View File
@@ -52,7 +52,7 @@
<define name="VIEWVIDEO_QUALITY_FACTOR" value="40"/>
</module>
<module name="cv_ae_awb"/>
<module name="bebop_ae_awb"/>
</modules>
+22
View File
@@ -0,0 +1,22 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="bebop_ae_awb" dir="computer_vision">
<doc>
<description>Auto exposure and Auto white balancing for the Bebop 1 and 2</description>
<section name="bebop_ae_awb">
<define name="BEBOP_AUTO_EXPOSURE" value="true" description="perform auto exposure (Default: true)"/>
<define name="BEBOP_AUTO_WHITE_BALANCE" value="true" description="Perform auto white balance (Default: true)"/>
</section>
</doc>
<header>
<file name="bebop_ae_awb.h"/>
</header>
<init fun="bebop_ae_awb_init()"/>
<periodic fun="bebop_ae_awb_periodic()" freq="5" autorun="TRUE"/>
<makefile target="ap">
<file name="bebop_ae_awb.c"/>
</makefile>
</module>
-22
View File
@@ -1,22 +0,0 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="cv_ae_awb" dir="computer_vision">
<doc>
<description>Auto exposure and Auto white balancing for the Bebop 1 and 2</description>
<section name="cv_ae_awb">
<define name="CV_AUTO_EXPOSURE" value="true" description="perform auto exposure (Default: true)"/>
<define name="CV_AUTO_WHITE_BALANCE" value="true" description="Perform auto white balance (Default: true)"/>
</section>
</doc>
<header>
<file name="cv_ae_awb.h"/>
</header>
<init fun="cv_ae_awb_init()"/>
<periodic fun="cv_ae_awb_periodic()" freq="5" autorun="TRUE"/>
<makefile target="ap">
<file name="cv_ae_awb.c"/>
</makefile>
</module>
@@ -18,12 +18,12 @@
* <http://www.gnu.org/licenses/>.
*/
/**
* @file "modules/computer_vision/cv_ae_awb.c"
* @author Freek van Tienen
* @file "modules/computer_vision/bebop_ae_awb.c"
* @author Freek van Tienen, Kirk Scheper
* Auto exposure and Auto white balancing for the Bebop 1 and 2
*/
#include "modules/computer_vision/cv_ae_awb.h"
#include "bebop_ae_awb.h"
#include "boards/bebop.h"
#include "boards/bebop/mt9f002.h"
#include "lib/isp/libisp.h"
@@ -32,25 +32,25 @@
#define sgn(x) (float)((x < 0) ? -1 : (x > 0))
#ifndef CV_AUTO_EXPOSURE
#define CV_AUTO_EXPOSURE true
#ifndef BEBOP_AUTO_EXPOSURE
#define BEBOP_AUTO_EXPOSURE true
#endif
#ifndef CV_AUTO_WHITE_BALANCE
#define CV_AUTO_WHITE_BALANCE true
#ifndef BEBOP_AUTO_WHITE_BALANCE
#define BEBOP_AUTO_WHITE_BALANCE true
#endif
#define CV_AWB_MIN_GAIN 2
#define CV_AWB_MAX_GAIN 75
#define BEBOP_AWB_MIN_GAIN 2
#define BEBOP_AWB_MAX_GAIN 75
void cv_ae_awb_init(void) {}
void bebop_ae_awb_init(void) {}
void cv_ae_awb_periodic(void)
void bebop_ae_awb_periodic(void)
{
struct isp_yuv_stats_t yuv_stats;
if (isp_get_statistics_yuv(&yuv_stats) == 0) {
#if CV_AUTO_EXPOSURE
#if BEBOP_AUTO_EXPOSURE
// Calculate the CDF based on the histogram
uint32_t cdf[MAX_HIST_Y];
cdf[0] = yuv_stats.ae_histogram_Y[0];
@@ -98,7 +98,7 @@ void cv_ae_awb_periodic(void)
mt9f002_set_exposure(&mt9f002);
#endif
#if CV_AUTO_WHITE_BALANCE
#if BEBOP_AUTO_WHITE_BALANCE
// It is very important that the auto exposure converges faster than the color correction
// Calculate AWB and project from original scale [0,255] onto more typical scale[-0.5,0.5]
float avgU = ((float) yuv_stats.awb_sum_U / (float) yuv_stats.awb_nb_grey_pixels) / 256. - 0.5;
@@ -18,16 +18,16 @@
* <http://www.gnu.org/licenses/>.
*/
/**
* @file "modules/computer_vision/cv_ae_awb.h"
* @author Freek van Tienen
* @file "modules/computer_vision/bebop_ae_awb.h"
* @author Freek van Tienen, Kirk Scheper
* Auto exposure and Auto white balancing for the Bebop 1 and 2
*/
#ifndef CV_AE_AWB_H
#define CV_AE_AWB_H
#ifndef BEBOP_AE_AWB_H
#define BEBOP_AE_AWB_H
extern void cv_ae_awb_init(void);
extern void cv_ae_awb_periodic(void);
extern void bebop_ae_awb_init(void);
extern void bebop_ae_awb_periodic(void);
#endif