lidar.h 6.4 KB

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