mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-28 09:58:23 +08:00
renamed cv_ae_awb to bebop_ae_awb
This commit is contained in:
@@ -52,7 +52,7 @@
|
|||||||
<define name="VIEWVIDEO_QUALITY_FACTOR" value="40"/>
|
<define name="VIEWVIDEO_QUALITY_FACTOR" value="40"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
<module name="cv_ae_awb"/>
|
<module name="bebop_ae_awb"/>
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
@@ -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>
|
|
||||||
|
|
||||||
+13
-13
@@ -18,12 +18,12 @@
|
|||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @file "modules/computer_vision/cv_ae_awb.c"
|
* @file "modules/computer_vision/bebop_ae_awb.c"
|
||||||
* @author Freek van Tienen
|
* @author Freek van Tienen, Kirk Scheper
|
||||||
* Auto exposure and Auto white balancing for the Bebop 1 and 2
|
* 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.h"
|
||||||
#include "boards/bebop/mt9f002.h"
|
#include "boards/bebop/mt9f002.h"
|
||||||
#include "lib/isp/libisp.h"
|
#include "lib/isp/libisp.h"
|
||||||
@@ -32,25 +32,25 @@
|
|||||||
|
|
||||||
#define sgn(x) (float)((x < 0) ? -1 : (x > 0))
|
#define sgn(x) (float)((x < 0) ? -1 : (x > 0))
|
||||||
|
|
||||||
#ifndef CV_AUTO_EXPOSURE
|
#ifndef BEBOP_AUTO_EXPOSURE
|
||||||
#define CV_AUTO_EXPOSURE true
|
#define BEBOP_AUTO_EXPOSURE true
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CV_AUTO_WHITE_BALANCE
|
#ifndef BEBOP_AUTO_WHITE_BALANCE
|
||||||
#define CV_AUTO_WHITE_BALANCE true
|
#define BEBOP_AUTO_WHITE_BALANCE true
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CV_AWB_MIN_GAIN 2
|
#define BEBOP_AWB_MIN_GAIN 2
|
||||||
#define CV_AWB_MAX_GAIN 75
|
#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;
|
struct isp_yuv_stats_t yuv_stats;
|
||||||
|
|
||||||
if (isp_get_statistics_yuv(&yuv_stats) == 0) {
|
if (isp_get_statistics_yuv(&yuv_stats) == 0) {
|
||||||
#if CV_AUTO_EXPOSURE
|
#if BEBOP_AUTO_EXPOSURE
|
||||||
// Calculate the CDF based on the histogram
|
// Calculate the CDF based on the histogram
|
||||||
uint32_t cdf[MAX_HIST_Y];
|
uint32_t cdf[MAX_HIST_Y];
|
||||||
cdf[0] = yuv_stats.ae_histogram_Y[0];
|
cdf[0] = yuv_stats.ae_histogram_Y[0];
|
||||||
@@ -98,7 +98,7 @@ void cv_ae_awb_periodic(void)
|
|||||||
mt9f002_set_exposure(&mt9f002);
|
mt9f002_set_exposure(&mt9f002);
|
||||||
#endif
|
#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
|
// 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]
|
// 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;
|
float avgU = ((float) yuv_stats.awb_sum_U / (float) yuv_stats.awb_nb_grey_pixels) / 256. - 0.5;
|
||||||
+6
-6
@@ -18,16 +18,16 @@
|
|||||||
* <http://www.gnu.org/licenses/>.
|
* <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @file "modules/computer_vision/cv_ae_awb.h"
|
* @file "modules/computer_vision/bebop_ae_awb.h"
|
||||||
* @author Freek van Tienen
|
* @author Freek van Tienen, Kirk Scheper
|
||||||
* Auto exposure and Auto white balancing for the Bebop 1 and 2
|
* Auto exposure and Auto white balancing for the Bebop 1 and 2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CV_AE_AWB_H
|
#ifndef BEBOP_AE_AWB_H
|
||||||
#define CV_AE_AWB_H
|
#define BEBOP_AE_AWB_H
|
||||||
|
|
||||||
extern void cv_ae_awb_init(void);
|
extern void bebop_ae_awb_init(void);
|
||||||
extern void cv_ae_awb_periodic(void);
|
extern void bebop_ae_awb_periodic(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Reference in New Issue
Block a user