lidar.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /***********************************************************************
  2. *
  3. * MODULE: lidarlib
  4. *
  5. * AUTHOR(S): Roberto Antolin
  6. *
  7. * PURPOSE: LIDAR library
  8. *
  9. * COPYRIGHT: (C) 2006 by Politecnico di Milano -
  10. * Polo Regionale di Como
  11. *
  12. * This program is free software under the
  13. * GNU General Public License (>=v2).
  14. * Read the file COPYING that comes with GRASS
  15. * for details.
  16. *
  17. **************************************************************************/
  18. #ifndef _POLIMIFUNCT_H_
  19. #define _POLIMIFUNCT_H_
  20. #include <grass/gis.h>
  21. #include <grass/gmath.h>
  22. #include <grass/vector.h>
  23. #include <grass/dbmi.h>
  24. #include <grass/raster.h>
  25. #include <grass/glocale.h>
  26. /*----------------------------------------------------------------------------------------------------------*/
  27. /*CONSTANTS DECLARATION */
  28. #define NSPLX_MAX 150 /* Maximum number of splines along East direction used in the subregions interpolation */
  29. #define NSPLY_MAX 150 /* Maximum number of splines along North direction used in the subregions interpolation */
  30. #define OVERLAP_SIZE 10 /* Subregions overlapping size. */
  31. #define LATO 1000 /* Side's size for v.lidar.growing. */
  32. #define CONTOUR 15 /**/
  33. #define GENERAL_ROW 0
  34. #define GENERAL_COLUMN 1
  35. #define FIRST_ROW 2
  36. #define LAST_ROW 3
  37. #define FIRST_COLUMN 4
  38. #define LAST_COLUMN 5
  39. /* FIELDS ID */
  40. #define F_EDGE_DETECTION_CLASS 1
  41. #define F_CLASSIFICATION 2
  42. #define F_INTERPOLATION 3
  43. #define F_COUNTER_OBJ 4
  44. /* PRE-CLASSIFICATION */
  45. #define PRE_TERRAIN 1
  46. #define PRE_EDGE 2
  47. #define PRE_UNKNOWN 3
  48. /* FINAL CLASSIFICATION */
  49. #define TERRAIN_SINGLE 1
  50. #define TERRAIN_DOUBLE 2
  51. #define OBJECT_DOUBLE 3
  52. #define OBJECT_SINGLE 4
  53. /* SINGLE OR DOUBLE PULSE */
  54. #define SINGLE_PULSE 1
  55. #define DOUBLE_PULSE 2
  56. /* INTERPOLATOR */
  57. #define P_BILINEAR 1
  58. #define P_BICUBIC 0
  59. /* Boolean definitions */
  60. #define TRUE 1
  61. #define FALSE 0
  62. /*----------------------------------------------------------------------------------------------------------*/
  63. /*STRUCTS DECLARATION */
  64. struct Reg_dimens
  65. {
  66. double edge_h; /*Horizontal tile edge */
  67. double edge_v; /*Vertical tile edge */
  68. double overlap; /*Tile's overlapping size */
  69. double sn_size; /*South-North side size */
  70. double ew_size; /*East-West side size */
  71. };
  72. struct Point
  73. {
  74. double coordX;
  75. double coordY;
  76. double coordZ;
  77. int lineID;
  78. int cat;
  79. };
  80. struct element
  81. {
  82. double value;
  83. double residual;
  84. int freq;
  85. };
  86. /*----------------------------------------------------------------------------------------------------------*/
  87. /*FUNCTIONS DECLARATION */
  88. /*zones */
  89. void P_zero_dim(struct Reg_dimens * /**/);
  90. int P_set_dim(struct Reg_dimens *, double, double, int *, int *);
  91. int P_set_regions(struct Cell_head *, /**/
  92. struct bound_box *, /**/
  93. struct bound_box *, /**/ struct Reg_dimens, /**/ int /**/);
  94. int P_get_edge(int, /**/ struct Reg_dimens *, /**/ double, /**/ double /**/);
  95. int P_get_BandWidth(int, /**/ int /**/);
  96. double P_estimate_splinestep(struct Map_info *, double *, double *);
  97. struct Point *P_Read_Vector_Region_Map(struct Map_info *, /**/
  98. struct Cell_head *, /**/
  99. int *, /**/ int, /**/ int /**/);
  100. struct Point *P_Read_Raster_Region_Map(double **, /**/
  101. struct Cell_head *, /**/
  102. struct Cell_head *, /**/
  103. int *, /**/ int *, /**/ int /**/);
  104. double P_Mean_Calc(struct Cell_head *, /**/ struct Point *, /**/ int /**/);
  105. /*----------------------------------------------------------------------------------------------------------*/
  106. void
  107. P_Sparse_Points(struct Map_info *, /**/
  108. struct Cell_head *, /**/
  109. struct bound_box, /**/
  110. struct bound_box, /**/
  111. double **, /**/
  112. double *, /**/
  113. int *, /**/
  114. double, /**/
  115. double, /**/
  116. double, /**/
  117. int, /**/
  118. int, /**/
  119. int, /**/
  120. int, /**/
  121. struct line_cats *, /**/
  122. dbDriver *, /**/ double, /**/ char * /**/);
  123. double **P_Regular_Points(struct Cell_head *, /**/
  124. struct Cell_head *, /**/
  125. struct bound_box, /**/
  126. struct bound_box, /**/
  127. double **, /**/
  128. double *, /**/
  129. double, /**/
  130. double, /**/
  131. double, /**/
  132. double, /**/
  133. int, /**/ int, /**/ int, /**/ int, /**/ int /**/);
  134. /*----------------------------------------------------------------------------------------------------------*/
  135. int P_Create_Aux2_Table(dbDriver *, /**/ char * /**/);
  136. int P_Create_Aux4_Table(dbDriver *, /**/ char * /**/);
  137. int P_Drop_Aux_Table(dbDriver *, /**/ char * /**/);
  138. /*----------------------------------------------------------------------------------------------------------*/
  139. void P_Aux_to_Raster(double **, /**/ int /**/);
  140. void P_Aux_to_Vector(struct Map_info *, /**/
  141. struct Map_info *, /**/ dbDriver *, /**/ char * /**/);
  142. double **P_Null_Matrix(double ** /**/);
  143. /*---------------------------------------------------------------------------------------*/
  144. /*interpSpline */
  145. void normalDefBicubic(double **N, double *TN, double *Q, double **obsVect,
  146. double deltaX, double deltaY, int xNum, int yNum,
  147. double xMin, double yMin, int obsNum, int parNum,
  148. int BW);
  149. void normalDefBilin(double **N, double *TN, double *Q, double **obsVect,
  150. double deltaX, double deltaY, int xNum, int yNum,
  151. double xMin, double yMin, int obsNum, int parNum, int BW);
  152. void nCorrectLapl(double **N, /* Normal Matrix () */
  153. double lambda, /* */
  154. int xNum, /* */
  155. int yNum, /* */
  156. double deltaX, /* */
  157. double deltaY); /* */
  158. void nCorrectGrad(double **N, double lambda, int xNum, int yNum,
  159. double deltaX, double deltaY);
  160. void obsEstimateBicubic(double **obsV, /* */
  161. double *obsE, /* */
  162. double *parV, /* */
  163. double deltX, /* */
  164. double deltY, /* */
  165. int xNm, /* */
  166. int yNm, /* */
  167. double xMi, /* */
  168. double yMi, /* */
  169. int obsN); /* */
  170. double dataInterpolateBicubic(double x, /* */
  171. double y, /* */
  172. double deltaX, /* */
  173. double deltaY, /* */
  174. int xNum, /* */
  175. int yNum, /* */
  176. double xMin, /* */
  177. double yMin, /* */
  178. double *parVect); /* */
  179. void obsEstimateBilin(double **obsV, double *obsE, double *parV, double deltX,
  180. double deltY, int xNm, int yNm, double xMi, double yMi,
  181. int obsN);
  182. double dataInterpolateBilin(double x, double y, double deltaX, double deltaY,
  183. int xNum, int yNum, double xMin, double yMin,
  184. double *parVect);
  185. #endif