lidar.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. char **, /**/
  102. struct Cell_head *, /**/
  103. struct Cell_head *, /**/
  104. int *, /**/ int *, /**/ int /**/);
  105. double P_Mean_Calc(struct Cell_head *, /**/ struct Point *, /**/ int /**/);
  106. /*----------------------------------------------------------------------------------------------------------*/
  107. void
  108. P_Sparse_Points(struct Map_info *, /**/
  109. struct Cell_head *, /**/
  110. struct bound_box, /**/
  111. struct bound_box, /**/
  112. double **, /**/
  113. double *, /**/
  114. int *, /**/
  115. double, /**/
  116. double, /**/
  117. double, /**/
  118. int, /**/
  119. int, /**/
  120. int, /**/
  121. int, /**/
  122. struct line_cats *, /**/
  123. dbDriver *, /**/ double, /**/ char * /**/);
  124. double **P_Regular_Points(struct Cell_head *, /**/
  125. struct Cell_head *, /**/
  126. struct bound_box, /**/
  127. struct bound_box, /**/
  128. double **, /**/
  129. char **, /**/
  130. double *, /**/
  131. double, /**/
  132. double, /**/
  133. double, /**/
  134. double, /**/
  135. int, /**/ int, /**/ int, /**/ int, /**/ int /**/);
  136. /*----------------------------------------------------------------------------------------------------------*/
  137. int P_Create_Aux2_Table(dbDriver *, /**/ char * /**/);
  138. int P_Create_Aux4_Table(dbDriver *, /**/ char * /**/);
  139. int P_Drop_Aux_Table(dbDriver *, /**/ char * /**/);
  140. /*----------------------------------------------------------------------------------------------------------*/
  141. void P_Aux_to_Raster(double **, /**/ int /**/);
  142. void P_Aux_to_Vector(struct Map_info *, /**/
  143. struct Map_info *, /**/ dbDriver *, /**/ char * /**/);
  144. double **P_Null_Matrix(double ** /**/);
  145. /*---------------------------------------------------------------------------------------*/
  146. /*interpSpline */
  147. void normalDefBicubic(double **N, double *TN, double *Q, double **obsVect,
  148. double deltaX, double deltaY, int xNum, int yNum,
  149. double xMin, double yMin, int obsNum, int parNum,
  150. int BW);
  151. void normalDefBilin(double **N, double *TN, double *Q, double **obsVect,
  152. double deltaX, double deltaY, int xNum, int yNum,
  153. double xMin, double yMin, int obsNum, int parNum, int BW);
  154. void nCorrectLapl(double **N, /* Normal Matrix () */
  155. double lambda, /* */
  156. int xNum, /* */
  157. int yNum, /* */
  158. double deltaX, /* */
  159. double deltaY); /* */
  160. void nCorrectGrad(double **N, double lambda, int xNum, int yNum,
  161. double deltaX, double deltaY);
  162. void obsEstimateBicubic(double **obsV, /* */
  163. double *obsE, /* */
  164. double *parV, /* */
  165. double deltX, /* */
  166. double deltY, /* */
  167. int xNm, /* */
  168. int yNm, /* */
  169. double xMi, /* */
  170. double yMi, /* */
  171. int obsN); /* */
  172. double dataInterpolateBicubic(double x, /* */
  173. double y, /* */
  174. double deltaX, /* */
  175. double deltaY, /* */
  176. int xNum, /* */
  177. int yNum, /* */
  178. double xMin, /* */
  179. double yMin, /* */
  180. double *parVect); /* */
  181. void obsEstimateBilin(double **obsV, double *obsE, double *parV, double deltX,
  182. double deltY, int xNm, int yNm, double xMi, double yMi,
  183. int obsN);
  184. double dataInterpolateBilin(double x, double y, double deltaX, double deltaY,
  185. int xNum, int yNum, double xMin, double yMin,
  186. double *parVect);
  187. #endif