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