Lens distortion correction division model 1p
 All Classes Files Functions Variables
subpixel_image_contours.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010-2013, AMI RESEARCH GROUP <lalvarez@dis.ulpgc.es>
3  License : CC Creative Commons "Attribution-NonCommercial-ShareAlike"
4  see http://creativecommons.org/licenses/by-nc-sa/3.0/es/deed.en
5  */
6 
7 
8 #ifndef AMI_DLL_H
9  #define AMI_DLL_H
10 #endif
11 
17 #ifndef SUBPIXEL_IMAGE_CONTOURS_H
18 #define SUBPIXEL_IMAGE_CONTOURS_H
19 
20 #include <stdlib.h>
21 #include "../ami_image/image.h"
22 #include "../ami_primitives/point2d.h"
23 
24 
25 #ifdef __AMIDEBUG__
26  #include "wxAmiDebugLog.h"
27 #endif
28 using namespace std;
29 
30 namespace ami
31 {
32 
33 // class AMI_DLL_H OF SUBPIXEL PRECISION CONTOURS
39 class AMI_DLL_H subpixel_image_contours{
40  bool *c;
41  float *x;
42  float *y;
43  float *d;
45  float *coseno ;
46  float *seno ;
47  int N ;
48  int width;
49  int height ;
50 
51 public:
52 
59  width = 0;
60  height = 0;
61  c = NULL;
62  x = NULL;
63  y = NULL;
64  d = NULL;
65  coseno = NULL;
66  seno = NULL;
67  }
68 
73  subpixel_image_contours(int width_c,int height_c);
74 
80 
86 
92  bool subpixel_empty();
93 
99  point2d<double> find_nearest_subpixel(point2d<double> point );
100 
106  bool *get_c(){return c;}
107 
108  const bool *get_c() const {return c;}
109 
115  float *get_x(){return x;}
116 
117  const float *get_x() const {return x;}
118 
124  float *get_y(){return y;}
125 
126  const float *get_y() const {return y;}
127 
134  float *get_d(){return d;}
135 
136  const float *get_d() const {return d;}
137 
143  float *get_coseno(){return coseno;}
144 
145  const float *get_coseno() const {return coseno;}
146 
152  float *get_seno(){return seno;}
153 
154  const float *get_seno() const {return seno;}
155 
161  int get_width() const {return width;}
162 
168  int get_height() const {return height;}
169 
170 
176  void set_c(bool *c2){if(c!=NULL) free(c); c=c2;}
177 
183 void set_x(float *x2){if(x!=NULL) free(x); x=x2;}
184 
190 void set_y(float *y2){if(y!=NULL) free(y); y=y2;}
191 
198  void set_d(float *d2){if(d!=NULL) free(d); d=d2;}
199 
205  void set_coseno(float *coseno2){
206  if(coseno!=NULL) free(coseno); coseno=coseno2;}
207 
213  void set_seno(float *seno2){
214  if(seno!=NULL) free(seno); seno=seno2;}
215 
221  int set_width(int width2){return width=width2;}
222 
228  int set_height(int height2){return height=height2;}
229 
230 };
231 
232 
233 }
234 
235 #endif
subpixel_image_contours()
Constructor without taking memory.
Definition: subpixel_image_contours.h:58
void set_y(float *y2)
Set array y of subpixel y coordinate location.
Definition: subpixel_image_contours.h:190
Class to store subpixel contours.
Definition: subpixel_image_contours.h:39
float * get_coseno()
Return array coseno of x coordinate contour point orientation.
Definition: subpixel_image_contours.h:143
int set_width(int width2)
Set image width.
Definition: subpixel_image_contours.h:221
float * get_x()
Return array x of subpixel x coordinate location.
Definition: subpixel_image_contours.h:115
void set_seno(float *seno2)
Set array seno of y coordinate contour point orientation.
Definition: subpixel_image_contours.h:213
bool * get_c()
Return array c to identity contour points.
Definition: subpixel_image_contours.h:106
void set_coseno(float *coseno2)
Set array coseno of x coordinate contour point orientation.
Definition: subpixel_image_contours.h:205
float * get_y()
Return array y of subpixel y coordinate location.
Definition: subpixel_image_contours.h:124
int get_height() const
Return image height.
Definition: subpixel_image_contours.h:168
float * get_seno()
Return array seno of y coordinate contour point orientation.
Definition: subpixel_image_contours.h:152
int get_width() const
Return image width.
Definition: subpixel_image_contours.h:161
void set_c(bool *c2)
Set array c to identity contour points.
Definition: subpixel_image_contours.h:176
int set_height(int height2)
Set image height.
Definition: subpixel_image_contours.h:228
void set_x(float *x2)
Set array x of subpixel x coordinate location.
Definition: subpixel_image_contours.h:183
float * get_d()
Return array d of distance to a contour pixel to the boundary of contour pixel area.
Definition: subpixel_image_contours.h:134
void set_d(float *d2)
Set array d of distance to a contour pixel to the boundary of contour pixel area. ...
Definition: subpixel_image_contours.h:198