GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
lidar.h
Go to the documentation of this file.
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 
19 #ifndef _POLIMIFUNCT_H_
20 #define _POLIMIFUNCT_H_
21 
22 #include <grass/gis.h>
23 #include <grass/gmath.h>
24 #include <grass/vector.h>
25 #include <grass/dbmi.h>
26 #include <grass/raster.h>
27 #include <grass/segment.h>
28 #include <grass/glocale.h>
29 
30 /*----------------------------------------------------------------------------------------------------------*/
31 /*CONSTANTS DECLARATION */
32 
33 #define NSPLX_MAX \
34  150 /* Maximum number of splines along East direction used in the \
35  subregions interpolation */
36 #define NSPLY_MAX \
37  150 /* Maximum number of splines along North direction used in the \
38  subregions interpolation */
39 #define OVERLAP_SIZE 10 /* Subregions overlapping size. */
40 #define LATO 1000 /* Side's size for v.lidar.growing. */
41 #define CONTOUR 15 /**/
42 #define GENERAL_ROW 0
43 #define GENERAL_COLUMN 1
44 #define FIRST_ROW 2
45 #define LAST_ROW 3
46 #define FIRST_COLUMN 4
47 #define LAST_COLUMN 5
48 /* FIELDS ID */
49 #define F_EDGE_DETECTION_CLASS 1
50 #define F_CLASSIFICATION 2
51 #define F_INTERPOLATION 3
52 #define F_COUNTER_OBJ 4
53 /* PRE-CLASSIFICATION */
54 #define PRE_TERRAIN 1
55 #define PRE_EDGE 2
56 #define PRE_UNKNOWN 3
57 /* FINAL CLASSIFICATION */
58 #define TERRAIN_SINGLE 1
59 #define TERRAIN_DOUBLE 2
60 #define OBJECT_DOUBLE 3
61 #define OBJECT_SINGLE 4
62 /* SINGLE OR DOUBLE PULSE */
63 #define SINGLE_PULSE 1
64 #define DOUBLE_PULSE 2
65 /* INTERPOLATOR */
66 #define P_BILINEAR 1
67 #define P_BICUBIC 0
68 
69 /*----------------------------------------------------------------------------------------------------------*/
70 /*STRUCTS DECLARATION */
71 struct Reg_dimens {
72  double edge_h; /*Horizontal tile edge */
73  double edge_v; /*Vertical tile edge */
74  double overlap; /*Tile's overlapping size */
75  double sn_size; /*South-North side size */
76  double ew_size; /*East-West side size */
77 };
78 
79 struct Point {
80  double coordX;
81  double coordY;
82  double coordZ;
83  int lineID;
84  int cat;
85 };
86 
87 struct element {
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 P_Sparse_Points(struct Map_info *, /**/
122  struct Cell_head *, /**/
123  struct bound_box, /**/
124  struct bound_box, /**/
125  double **, /**/
126  double *, /**/
127  int *, /**/
128  double, /**/
129  double, /**/
130  double, /**/
131  int, /**/
132  int, /**/
133  int, /**/
134  int, /**/
135  struct line_cats *, /**/
136  dbDriver *, /**/ double, /**/ char * /**/);
137 
138 int P_Regular_Points(struct Cell_head *, /**/
139  struct Cell_head *, /**/
140  struct bound_box, /**/
141  struct bound_box, /**/
142  SEGMENT *, /**/
143  double *, /**/
144  double, /**/
145  double, /**/
146  double, /**/
147  double, /**/
148  int, /**/ int, /**/ int, /**/ int, /**/ int /**/);
149 
150 /*----------------------------------------------------------------------------------------------------------*/
151 int P_Create_Aux2_Table(dbDriver *, /**/ char * /**/);
152 
153 int P_Create_Aux4_Table(dbDriver *, /**/ char * /**/);
154 
155 int P_Drop_Aux_Table(dbDriver *, /**/ char * /**/);
156 
157 /*----------------------------------------------------------------------------------------------------------*/
158 void P_Aux_to_Raster(double **, /**/ int /**/);
159 
160 void P_Aux_to_Vector(struct Map_info *, /**/
161  struct Map_info *, /**/ dbDriver *, /**/ char * /**/);
162 
163 double **P_Null_Matrix(double ** /**/);
164 
165 /*---------------------------------------------------------------------------------------*/
166 /*interpSpline */
167 void normalDefBicubic(double **N, double *TN, double *Q, double **obsVect,
168  double deltaX, double deltaY, int xNum, int yNum,
169  double xMin, double yMin, int obsNum, int parNum, int BW);
170 
171 void normalDefBilin(double **N, double *TN, double *Q, double **obsVect,
172  double deltaX, double deltaY, int xNum, int yNum,
173  double xMin, double yMin, int obsNum, int parNum, int BW);
174 
175 void nCorrectLapl(double **N, /* Normal Matrix () */
176  double lambda, /* */
177  int xNum, /* */
178  int yNum, /* */
179  double deltaX, /* */
180  double deltaY); /* */
181 
182 void nCorrectGrad(double **N, double lambda, int xNum, int yNum, double deltaX,
183  double deltaY);
184 
185 void obsEstimateBicubic(double **obsV, /* */
186  double *obsE, /* */
187  double *parV, /* */
188  double deltX, /* */
189  double deltY, /* */
190  int xNm, /* */
191  int yNm, /* */
192  double xMi, /* */
193  double yMi, /* */
194  int obsN); /* */
195 
196 double dataInterpolateBicubic(double x, /* */
197  double y, /* */
198  double deltaX, /* */
199  double deltaY, /* */
200  int xNum, /* */
201  int yNum, /* */
202  double xMin, /* */
203  double yMin, /* */
204  double *parVect); /* */
205 
206 void obsEstimateBilin(double **obsV, double *obsE, double *parV, double deltX,
207  double deltY, int xNm, int yNm, double xMi, double yMi,
208  int obsN);
209 
210 double dataInterpolateBilin(double x, double y, double deltaX, double deltaY,
211  int xNum, int yNum, double xMin, double yMin,
212  double *parVect);
213 
214 #endif
#define N
Definition: e_intersect.c:926
int P_get_edge(int, struct Reg_dimens *, double, double)
Definition: zones.c:196
double ** P_Null_Matrix(double **)
int P_get_BandWidth(int, int)
Definition: zones.c:218
struct Point * P_Read_Vector_Region_Map(struct Map_info *, struct Cell_head *, int *, int, int)
Definition: zones.c:322
double dataInterpolateBicubic(double x, double y, double deltaX, double deltaY, int xNum, int yNum, double xMin, double yMin, double *parVect)
Definition: InterpSpline.c:497
struct Point * P_Read_Raster_Region_Map(SEGMENT *, struct Cell_head *, struct Cell_head *, int *, int)
Definition: zones.c:387
void P_Aux_to_Raster(double **, int)
Definition: zones.c:540
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:107
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:291
void P_zero_dim(struct Reg_dimens *)
Definition: zones.c:9
void P_Aux_to_Vector(struct Map_info *, struct Map_info *, dbDriver *, char *)
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:556
int P_Create_Aux2_Table(dbDriver *, char *)
Definition: zones.c:465
int P_Drop_Aux_Table(dbDriver *, char *)
Definition: zones.c:529
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:197
double dataInterpolateBilin(double x, double y, double deltaX, double deltaY, int xNum, int yNum, double xMin, double yMin, double *parVect)
Definition: InterpSpline.c:604
int P_set_regions(struct Cell_head *, struct bound_box *, struct bound_box *, struct Reg_dimens, int)
Definition: zones.c:53
void nCorrectGrad(double **N, double lambda, int xNum, int yNum, double deltaX, double deltaY)
Definition: InterpSpline.c:399
double P_estimate_splinestep(struct Map_info *, double *, double *)
Definition: zones.c:259
double P_Mean_Calc(struct Cell_head *, struct Point *, int)
Definition: zones.c:231
int P_Create_Aux4_Table(dbDriver *, char *)
Definition: zones.c:493
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:434
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
int P_set_dim(struct Reg_dimens *, double, double, int *, int *)
Definition: zones.c:117
void nCorrectLapl(double **N, double lambda, int xNum, int yNum, double deltaX, double deltaY)
Definition: InterpSpline.c:199
2D/3D raster map header (used also for region)
Definition: gis.h:440
Vector map info.
Definition: dig_structs.h:1243
Definition: lidar.h:77
int cat
Definition: lidar.h:82
int lineID
Definition: lidar.h:81
double coordY
Definition: lidar.h:79
double coordX
Definition: lidar.h:78
double coordZ
Definition: lidar.h:80
double edge_v
Definition: lidar.h:71
double edge_h
Definition: lidar.h:70
double ew_size
Definition: lidar.h:74
double overlap
Definition: lidar.h:72
double sn_size
Definition: lidar.h:73
Bounding box.
Definition: dig_structs.h:64
Definition: lidar.h:85
double residual
Definition: lidar.h:87
double value
Definition: lidar.h:86
int freq
Definition: lidar.h:88
Feature category info.
Definition: dig_structs.h:1677
#define x