Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
colorfilter.c
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2015
3
*
4
* This file is part of Paparazzi.
5
*
6
* Paparazzi is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2, or (at your option)
9
* any later version.
10
*
11
* Paparazzi is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with Paparazzi; see the file COPYING. If not, write to
18
* the Free Software Foundation, 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
20
*/
21
26
// Own header
27
#include "
modules/computer_vision/cv.h
"
28
#include "
modules/computer_vision/colorfilter.h
"
29
30
#include <stdio.h>
31
32
// Filter Settings
33
uint8_t
color_lum_min
= 105;
34
uint8_t
color_lum_max
= 205;
35
uint8_t
color_cb_min
= 52;
36
uint8_t
color_cb_max
= 140;
37
uint8_t
color_cr_min
= 180;
38
uint8_t
color_cr_max
= 255;
39
40
// Result
41
int
color_count
= 0;
42
43
// Function
44
bool_t
colorfilter_func
(
struct
image_t
* img);
45
bool_t
colorfilter_func
(
struct
image_t
* img)
46
{
47
// Filter
48
color_count
=
image_yuv422_colorfilt
(img,img,
49
color_lum_min
,
color_lum_max
,
50
color_cb_min
,
color_cb_max
,
51
color_cr_min
,
color_cr_max
52
);
53
54
return
FALSE
;
55
}
56
57
void
colorfilter_init
(
void
)
58
{
59
cv_add
(
colorfilter_func
);
60
}
61
colorfilter_init
void colorfilter_init(void)
Definition:
colorfilter.c:57
color_cb_max
uint8_t color_cb_max
Definition:
colorfilter.c:36
color_lum_max
uint8_t color_lum_max
Definition:
colorfilter.c:34
image_t
Definition:
image.h:42
FALSE
#define FALSE
Definition:
std.h:5
color_count
int color_count
Definition:
colorfilter.c:41
color_cr_max
uint8_t color_cr_max
Definition:
colorfilter.c:38
cv.h
Computer vision framework for onboard processing.
color_cb_min
uint8_t color_cb_min
Definition:
colorfilter.c:35
cv_add
void cv_add(cvFunction func)
Definition:
cv.c:35
uint8_t
unsigned char uint8_t
Definition:
types.h:14
colorfilter_func
bool_t colorfilter_func(struct image_t *img)
Definition:
colorfilter.c:45
color_lum_min
uint8_t color_lum_min
Definition:
colorfilter.c:33
color_cr_min
uint8_t color_cr_min
Definition:
colorfilter.c:37
image_yuv422_colorfilt
uint16_t image_yuv422_colorfilt(struct image_t *input, struct image_t *output, uint8_t y_m, uint8_t y_M, uint8_t u_m, uint8_t u_M, uint8_t v_m, uint8_t v_M)
Filter colors in an YUV422 image.
Definition:
image.c:149
colorfilter.h
sw
airborne
modules
computer_vision
colorfilter.c
Generated on Tue Jun 21 2016 14:01:16 for Paparazzi UAS by
1.8.8