Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
textons.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Hann Woei Ho, Guido de Croon
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 
33 #ifndef TEXTONS_H
34 #define TEXTONS_H
35 
36 #include <stdint.h>
37 
38 // outputs
39 extern float *texton_distribution; // main outcome of the image processing: the distribution of textons in the image
40 
41 // settings
42 extern uint8_t running;
45 extern uint8_t alpha_uint;
46 extern uint8_t n_textons;
47 extern uint8_t patch_size; // Should be even
50 extern uint8_t FULL_SAMPLING;
51 extern uint32_t border_width;
52 extern uint32_t border_height;
54 
55 // status variables
57 extern float alpha;
58 extern float ** **dictionary;
61 
62 // functions:
65 void save_texton_dictionary(void);
66 void load_texton_dictionary(void);
67 
68 // Module functions
69 extern void textons_init(void);
70 extern void textons_stop(void);
71 
72 // helper functions (potentially should go elsewhere):
73 float get_entropy(float *p_dist, int D);
74 
75 #endif /* TEXTONS_H */
static uint8_t frame[20]
void save_texton_dictionary(void)
Save the texton dictionary.
Definition: textons.c:501
void load_texton_dictionary(void)
Load a texton dictionary.
Definition: textons.c:532
float * texton_distribution
Definition: textons.c:42
uint8_t patch_size
Definition: textons.c:123
uint32_t n_learning_samples
Definition: textons.c:124
uint8_t load_dictionary
Definition: textons.c:119
uint8_t n_textons
Definition: textons.c:122
uint8_t FULL_SAMPLING
Definition: textons.c:126
void DictionaryTrainingYUV(uint8_t *frame, uint16_t width, uint16_t height)
Function that performs one pass for dictionary training.
Definition: textons.c:227
uint8_t dictionary_ready
Definition: textons.c:132
uint32_t n_samples_image
Definition: textons.c:125
uint32_t learned_samples
Definition: textons.c:40
float get_entropy(float *p_dist, int D)
Function that calculates a base-2 Shannon entropy for a probability distribution.
Definition: textons.c:594
uint8_t dictionary_initialized
Definition: textons.c:41
float **** dictionary
Definition: textons.c:39
uint8_t alpha_uint
Definition: textons.c:121
uint8_t reinitialize_dictionary
Definition: textons.c:120
float alpha
Definition: textons.c:133
void textons_stop(void)
Definition: textons.c:583
void textons_init(void)
Initialize.
Definition: textons.c:562
void DistributionExtraction(uint8_t *frame, uint16_t width, uint16_t height)
Function that extracts a texton histogram from an image.
Definition: textons.c:372
uint32_t border_width
Definition: textons.c:127
uint32_t border_height
Definition: textons.c:128
uint8_t dictionary_number
Definition: textons.c:129
uint8_t running
Definition: textons.c:118
static float D
Definition: trilateration.c:35
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98