Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
textons.h File Reference

Takes an image and represents the texture and colors in the image with a texton histogram. More...

#include <stdint.h>
+ Include dependency graph for textons.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void DictionaryTrainingYUV (uint8_t *frame, uint16_t width, uint16_t height)
 Function that performs one pass for dictionary training. More...
 
void DistributionExtraction (uint8_t *frame, uint16_t width, uint16_t height)
 Function that extracts a texton histogram from an image. More...
 
void save_texton_dictionary (void)
 Save the texton dictionary. More...
 
void load_texton_dictionary (void)
 Load a texton dictionary. More...
 
void textons_init (void)
 Initialize. More...
 
void textons_stop (void)
 

Variables

float * texton_distribution
 
uint8_t load_dictionary
 
uint8_t alpha_uint
 
uint8_t n_textons
 
uint8_t patch_size
 
uint32_t n_learning_samples
 
uint32_t n_samples_image
 
uint8_t FULL_SAMPLING
 
uint32_t border_width
 
uint32_t border_height
 
uint8_t dictionary_number
 
uint8_t dictionary_ready
 
float alpha
 
float **** dictionary
 
uint32_t learned_samples
 
uint8_t dictionary_initialized
 

Detailed Description

Takes an image and represents the texture and colors in the image with a texton histogram.

A texton is a cluster centroid in a space populated by image patches. First, this code learns or loads a texton dictionary. Then, for each incoming image, patches are sampled from the image, compared to textons in the dictionary, and the closest texton is identified, augmenting the corresponding bin in the texton histogram.

Definition in file textons.h.

Function Documentation

void DictionaryTrainingYUV ( uint8_t frame,
uint16_t  width,
uint16_t  height 
)

Function that performs one pass for dictionary training.

It extracts samples from an image, finds the closest texton and moves it towards the sample.

Parameters
[in]frame*The YUV image data
[in]widthThe width of the image
[in]heightThe height of the image

Definition at line 166 of file textons.c.

References alpha_uint, image_t::buf, dictionary, dictionary_initialized, learned_samples, n_samples_image, n_textons, patch_size, and image_t::w.

Referenced by texton_func().

+ Here is the caller graph for this function:

void DistributionExtraction ( uint8_t frame,
uint16_t  width,
uint16_t  height 
)

Function that extracts a texton histogram from an image.

Parameters
[in]frame*The YUV image data
[in]widthThe width of the image
[in]heightThe height of the image

Definition at line 311 of file textons.c.

References border_height, border_width, image_t::buf, dictionary, FULL_SAMPLING, n_samples_image, n_textons, patch_size, and texton_distribution.

Referenced by texton_func().

+ Here is the caller graph for this function:

void load_texton_dictionary ( void  )

Load a texton dictionary.

Definition at line 471 of file textons.c.

References dictionary, dictionary_initialized, dictionary_logger, dictionary_number, DICTIONARY_PATH, EOF, learned_samples, load_dictionary, n_textons, and patch_size.

Referenced by texton_func().

+ Here is the caller graph for this function:

void save_texton_dictionary ( void  )

Save the texton dictionary.

Definition at line 441 of file textons.c.

References dictionary, dictionary_logger, dictionary_number, DICTIONARY_PATH, n_textons, and patch_size.

Referenced by texton_func().

+ Here is the caller graph for this function:

void textons_init ( void  )

Initialize.

Definition at line 501 of file textons.c.

References dictionary, dictionary_initialized, learned_samples, n_textons, patch_size, texton_distribution, texton_func(), and image_t::w.

+ Here is the call graph for this function:

void textons_stop ( void  )

Definition at line 522 of file textons.c.

References dictionary, and texton_distribution.

Variable Documentation

uint8_t alpha_uint

Definition at line 95 of file textons.c.

Referenced by DictionaryTrainingYUV().

uint32_t border_height

Definition at line 102 of file textons.c.

Referenced by DistributionExtraction().

uint32_t border_width

Definition at line 101 of file textons.c.

Referenced by DistributionExtraction().

uint8_t dictionary_initialized

Definition at line 39 of file textons.c.

Referenced by DictionaryTrainingYUV(), load_texton_dictionary(), and textons_init().

uint8_t dictionary_number

Definition at line 103 of file textons.c.

Referenced by load_texton_dictionary(), and save_texton_dictionary().

uint8_t dictionary_ready

Definition at line 106 of file textons.c.

uint8_t FULL_SAMPLING

Definition at line 100 of file textons.c.

Referenced by DistributionExtraction().

uint32_t learned_samples

Definition at line 38 of file textons.c.

Referenced by DictionaryTrainingYUV(), load_texton_dictionary(), texton_func(), and textons_init().

uint8_t load_dictionary

Definition at line 94 of file textons.c.

Referenced by load_texton_dictionary(), and texton_func().

uint32_t n_learning_samples

Definition at line 98 of file textons.c.

Referenced by texton_func().

uint32_t n_samples_image

Definition at line 99 of file textons.c.

Referenced by DictionaryTrainingYUV(), and DistributionExtraction().

float* texton_distribution

Definition at line 40 of file textons.c.

Referenced by DistributionExtraction(), textons_init(), and textons_stop().