Home | Develop | Download | Contact
pdsdic2d.h
1 /*
2  * pdsdic2d.h
3  *
4  * Copyright 2018 Fernando Pujaico Rivera <fernando.pujaico.rivera@gmail.com>
5  *
6  * This program 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 of the License, or
9  * (at your option) any later version.
10  *
11  * This program 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 this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  *
21  */
22 
35 #ifndef __PDSDIC2D_H__
36 #define __PDSDIC2D_H__
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 #include <stdio.h>
43 #include <stdlib.h>
44 #include <pds/pdsra.h>
45 
60 #ifndef PDS_MIN
61 
65  #define PDS_MIN(a,b) \
66  ({ typeof (a) _a = (a); \
67  typeof (b) _b = (b); \
68  (_a < _b) ? _a : _b; })
69 
70 #endif
71 
72 #ifndef PDS_DIC2D_NO_MOVED_THRESHOLD
73 
77  #define PDS_DIC2D_NO_MOVED_THRESHOLD 0.99
78 #endif
79 
80 #ifndef PDS_DIC2D_MATCH_THRESHOLD
81 
85  #define PDS_DIC2D_MATCH_THRESHOLD 0.75
86 #endif
87 
88 #ifndef PDS_DIC2D_SEARCH_PIXEL_BY_PIXEL
89 
93  #define PDS_DIC2D_SEARCH_PIXEL_BY_PIXEL 1
94 #endif
95 
96 #ifndef PDS_OK
97 
101  #define PDS_OK 1
102 #endif
103 
104 #ifndef PDS_WRONG
105 
109  #define PDS_WRONG 0
110 #endif
111 
112 
113 typedef enum
114 {
119 
127 typedef struct
128 {
130  PdsMatrix *M0;
132  PdsMatrix *M1;
133 
139  PdsRaReal match_threshold;
143 
146  PdsRaNatural search_step_size;
148  PdsRaNatural search_max_length;
150  unsigned char debug;
152  PdsRaReal last_match_corr;
153 }PdsDic2D;
154 
155 
170 PdsDic2D *pds_dic2d_new(PdsRaNatural Nlin,PdsRaNatural Ncol);
171 
181 PdsDic2D *pds_dic2d_new_from_matrices(const PdsMatrix *Mat0,const PdsMatrix *Mat1);
182 
184 
202 int pds_dic2d_tracking_region( PdsDic2D *DIC, PdsRegionRect Rin, PdsRegionRect *Rout);
203 
216 PdsMatrix *pds_dic2d_pearson_correlations_matrix(const PdsDic2D *DIC, PdsRegionRect Ro);
217 
229 int pds_dic2d_is_the_region_moved(PdsDic2D *DIC, PdsRegionRect Ro);
230 
232 
247 int pds_dic2d_push_matrix(PdsDic2D *DIC,const PdsMatrix *Mat);
248 
250 
267 int pds_dic2d_set_zero_std_search(PdsDic2D *DIC, int zero_std_search);
268 
278 int pds_dic2d_set_no_moved_threshold(PdsDic2D *DIC, PdsRaReal no_moved_threshold);
279 
289 int pds_dic2d_set_match_threshold(PdsDic2D *DIC, PdsRaReal match_threshold);
290 
300 int pds_dic2d_set_search_step_size(PdsDic2D *DIC, PdsRaNatural search_step_size);
301 
310 int pds_dic2d_set_search_max_length(PdsDic2D *DIC, PdsRaNatural search_max_length);
311 
320 int pds_dic2d_set_debug(PdsDic2D *DIC, unsigned char debug);
321 
329 int pds_dic2d_set_last_match_corr(PdsDic2D *DIC, PdsRaReal last_match_corr);
330 
332 
345 int pds_dic2d_get_nlines(const PdsDic2D *DIC, PdsRaNatural *Nlines);
346 
354 int pds_dic2d_get_ncolumns(const PdsDic2D *DIC, PdsRaNatural *Ncolumns);
355 
363 int pds_dic2d_get_no_moved_threshold(const PdsDic2D *DIC, PdsRaReal *no_moved_threshold);
364 
372 int pds_dic2d_get_match_threshold(const PdsDic2D *DIC, PdsRaReal *match_threshold);
373 
382 int pds_dic2d_get_search_step_size(const PdsDic2D *DIC, PdsRaNatural *search_step_size);
383 
391 int pds_dic2d_get_search_max_length(const PdsDic2D *DIC, PdsRaNatural *search_max_length);
392 
403 int pds_dic2d_get_zero_std_search(const PdsDic2D *DIC, int *zero_std_search);
404 
406 
418 void pds_dic2d_free(PdsDic2D *DIC);
419 
426 void pds_dic2d_destroy(PdsDic2D **DIC);
427 
429 
434 #ifdef __cplusplus
435 }
436 #endif
437 
438 #endif
439 
La estructura tipo PdsDic2D . Esta estructura contiene dos matrices de Nlin lineas y Ncol columnas...
Definition: pdsdic2d.h:127
int pds_dic2d_set_last_match_corr(PdsDic2D *DIC, PdsRaReal last_match_corr)
Establece el valor de la correlación en el ultimo match.
PdsDic2D * pds_dic2d_new(PdsRaNatural Nlin, PdsRaNatural Ncol)
Crea una estructura de tipo PdsDic2D, internamente la estructura contiene dos matrices con Nlin linea...
int pds_dic2d_get_nlines(const PdsDic2D *DIC, PdsRaNatural *Nlines)
Devuelve el número de lineas en las matrices dentro de la estructura DIC.
PdsRaNatural search_max_length
Definition: pdsdic2d.h:148
int pds_dic2d_get_ncolumns(const PdsDic2D *DIC, PdsRaNatural *Ncolumns)
Devuelve el número de columnas en las matrices dentro de la estructura DIC.
int pds_dic2d_get_search_max_length(const PdsDic2D *DIC, PdsRaNatural *search_max_length)
Devuelve la distancia máxima en pixels, para la búsqueda de regiones coincidentes.
PdsRaNatural search_step_size
Definition: pdsdic2d.h:146
int pds_dic2d_tracking_region(PdsDic2D *DIC, PdsRegionRect Rin, PdsRegionRect *Rout)
Devuelve la región coincidente en la segunda matriz.
int pds_dic2d_is_the_region_moved(PdsDic2D *DIC, PdsRegionRect Ro)
Indica si la región se ha movido.
PdsRaReal no_moved_threshold
Definition: pdsdic2d.h:142
PdsRaReal last_match_corr
Definition: pdsdic2d.h:152
PdsRaReal match_threshold
Definition: pdsdic2d.h:139
int pds_dic2d_set_search_step_size(PdsDic2D *DIC, PdsRaNatural search_step_size)
Establece el paso en pixels, para la búsqueda de regiones coincidentes. Por defecto es PDS_DIC2D_SEAR...
unsigned char debug
Definition: pdsdic2d.h:150
int pds_dic2d_set_debug(PdsDic2D *DIC, unsigned char debug)
Establece se debug esta habilitado, se habilitado se mostrara mas infrmacion por pantalla.
int pds_dic2d_set_search_max_length(PdsDic2D *DIC, PdsRaNatural search_max_length)
Establece la distancia máxima en pixels, para la busqueda de regiones coincidentes.
void pds_dic2d_free(PdsDic2D *DIC)
Libera la estructura de tipo puntero PdsDic2D.
int pds_dic2d_set_no_moved_threshold(PdsDic2D *DIC, PdsRaReal no_moved_threshold)
Establece el umbral para aceptar que la región no se ha movido. Por defecto este umbral es PDS_DIC2D_...
int pds_dic2d_set_zero_std_search(PdsDic2D *DIC, int zero_std_search)
Establece si una región con desvío padrón cero serán buscadas. Por defecto está variable está deshabi...
int pds_dic2d_get_no_moved_threshold(const PdsDic2D *DIC, PdsRaReal *no_moved_threshold)
Devuelve el umbral para aceptar que el objeto no se ha movido.
void pds_dic2d_destroy(PdsDic2D **DIC)
Libera la estructura de tipo puntero PdsDic2D, y limpia el puntero con NULL.
int zero_std_search
Definition: pdsdic2d.h:136
int pds_dic2d_get_match_threshold(const PdsDic2D *DIC, PdsRaReal *match_threshold)
Devuelve el umbral para aceptar una coincidencia en un match.
PdsMatrix * pds_dic2d_pearson_correlations_matrix(const PdsDic2D *DIC, PdsRegionRect Ro)
Retorna una matriz con las correlaciones de la región Ro en la matriz M0 de DIC, con una vecindad rec...
int pds_dic2d_set_match_threshold(PdsDic2D *DIC, PdsRaReal match_threshold)
Establece el umbral para aceptar una coincidencia en un match. Por defecto este umbral es PDS_DIC2D_M...
int pds_dic2d_get_zero_std_search(const PdsDic2D *DIC, int *zero_std_search)
Devuelve si esta habilitado que una región con desvío padrón cero sea buscada. Por defecto está varia...
int pds_dic2d_push_matrix(PdsDic2D *DIC, const PdsMatrix *Mat)
Actualiza los valores de las matrices en la estructura de tipo PdsDic2D, internamente la matriz M1->M...
int pds_dic2d_get_search_step_size(const PdsDic2D *DIC, PdsRaNatural *search_step_size)
Devuelve el paso en pixels, para la búsqueda de regiones coincidentes. Por defecto es PDS_DIC2D_SEARC...
PdsMatrix * M1
Definition: pdsdic2d.h:132
PdsMatrix * M0
Definition: pdsdic2d.h:130
PdsDic2D * pds_dic2d_new_from_matrices(const PdsMatrix *Mat0, const PdsMatrix *Mat1)
Crea una estructura de tipo PdsDic2D, internamente la estructura contiene una copia de las dos matric...
PdsDic2DOutput
Definition: pdsdic2d.h:113

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed