lidar.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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. /* Boolean definitions */
  61. #define TRUE 1
  62. #define FALSE 0
  63. /*----------------------------------------------------------------------------------------------------------*/
  64. /*STRUCTS DECLARATION */
  65. struct Reg_dimens
  66. {
  67. double edge_h; /*Horizontal tile edge */
  68. double edge_v; /*Vertical tile edge */
  69. double overlap; /*Tile's overlapping size */
  70. double sn_size; /*South-North side size */
  71. double ew_size; /*East-West side size */
  72. };
  73. struct Point
  74. {
  75. double coordX;
  76. double coordY;
  77. double coordZ;
  78. int lineID;
  79. int cat;
  80. };
  81. struct element
  82. {
  83. double value;
  84. double residual;
  85. int freq;
  86. };
  87. /*----------------------------------------------------------------------------------------------------------*/
  88. /*FUNCTIONS DECLARATION */
  89. /*zones */
  90. void P_zero_dim(struct Reg_dimens * /**/);
  91. int P_set_dim(struct Reg_dimens *, double, double, int *, int *);
  92. int P_set_regions(struct Cell_head *, /**/
  93. struct bound_box *, /**/
  94. struct bound_box *, /**/ struct Reg_dimens, /**/ int /**/);
  95. int P_get_edge(int, /**/ struct Reg_dimens *, /**/ double, /**/ double /**/);
  96. int P_get_BandWidth(int, /**/ int /**/);
  97. double P_estimate_splinestep(struct Map_info *, double *, double *);
  98. struct Point *P_Read_Vector_Region_Map(struct Map_info *, /**/
  99. struct Cell_head *, /**/
  100. int *, /**/ int, /**/ int /**/);
  101. struct Point *P_Read_Raster_Region_Map(SEGMENT *, /**/
  102. struct Cell_head *, /**/
  103. struct Cell_head *, /**/
  104. 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. int P_Regular_Points(struct Cell_head *, /**/
  125. struct Cell_head *, /**/
  126. struct bound_box, /**/
  127. struct bound_box, /**/
  128. SEGMENT *, /**/
  129. double *, /**/
  130. double, /**/
  131. double, /**/
  132. double, /**/
  133. double, /**/
  134. int, /**/ int, /**/ int, /**/ int, /**/ int /**/);
  135. /*----------------------------------------------------------------------------------------------------------*/
  136. int P_Create_Aux2_Table(dbDriver *, /**/ char * /**/);
  137. int P_Create_Aux4_Table(dbDriver *, /**/ char * /**/);
  138. int P_Drop_Aux_Table(dbDriver *, /**/ char * /**/);
  139. /*----------------------------------------------------------------------------------------------------------*/
  140. void P_Aux_to_Raster(double **, /**/ int /**/);
  141. void P_Aux_to_Vector(struct Map_info *, /**/
  142. struct Map_info *, /**/ dbDriver *, /**/ char * /**/);
  143. double **P_Null_Matrix(double ** /**/);
  144. /*---------------------------------------------------------------------------------------*/
  145. /*interpSpline */
  146. void normalDefBicubic(double **N, double *TN, double *Q, double **obsVect,
  147. double deltaX, double deltaY, int xNum, int yNum,
  148. double xMin, double yMin, int obsNum, int parNum,
  149. int BW);
  150. void normalDefBilin(double **N, double *TN, double *Q, double **obsVect,
  151. double deltaX, double deltaY, int xNum, int yNum,
  152. double xMin, double yMin, int obsNum, int parNum, int BW);
  153. void nCorrectLapl(double **N, /* Normal Matrix () */
  154. double lambda, /* */
  155. int xNum, /* */
  156. int yNum, /* */
  157. double deltaX, /* */
  158. double deltaY); /* */
  159. void nCorrectGrad(double **N, double lambda, int xNum, int yNum,
  160. double deltaX, double deltaY);
  161. void obsEstimateBicubic(double **obsV, /* */
  162. double *obsE, /* */
  163. double *parV, /* */
  164. double deltX, /* */
  165. double deltY, /* */
  166. int xNm, /* */
  167. int yNm, /* */
  168. double xMi, /* */
  169. double yMi, /* */
  170. int obsN); /* */
  171. double dataInterpolateBicubic(double x, /* */
  172. double y, /* */
  173. double deltaX, /* */
  174. double deltaY, /* */
  175. int xNum, /* */
  176. int yNum, /* */
  177. double xMin, /* */
  178. double yMin, /* */
  179. double *parVect); /* */
  180. void obsEstimateBilin(double **obsV, double *obsE, double *parV, double deltX,
  181. double deltY, int xNm, int yNm, double xMi, double yMi,
  182. int obsN);
  183. double dataInterpolateBilin(double x, double y, double deltaX, double deltaY,
  184. int xNum, int yNum, double xMin, double yMin,
  185. double *parVect);
  186. #endif