orientation.h
1 /*
2  * Player - One Hell of a Robot Server
3  * Copyright (C) 2000 Brian Gerkey et al
4  * gerkey@usc.edu
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  */
21 
22 /******************************************************
23  * orientation - header
24  *
25  * Description
26  * estimate orientation of the ground object
27  *
28  ******************************************************
29  */
30 
31 #ifndef __ORIENTATION__H_
32 #define __ORIENTATION__H_
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #include <stdio.h>
40 #include <math.h>
41 #include <cv.h>
42 
43 
44 //Estimate the length between two points (cvpoint)
45 double length(CvPoint *pnt1, CvPoint *pnt2);
46 
47 //estimate direction of line
48 int deltaline(CvPoint *pnt1, CvPoint *pnt2, char ch);
49 
50 //estimate total difference between two lines (using delta x and delta y of
51 //the the two points of a line)
52 int difference(CvPoint *pnt1, CvPoint *pnt2, CvPoint *pnt3, CvPoint *pnt4, char ch);
53 
54 //put length values of lines into array
55 void fillarray(CvSeq *result);
56 
57 //sort array
58 void sortarray();
59 
60 //return centre point of two points
61 CvPoint centralpoint(CvPoint pnt1, CvPoint pnt2);
62 
63 //Get the central point between the two parallel lines
64 CvPoint getcentralpoint(IplImage *image, CvSeq *res);
65 
66 //pnt1 is center of mass of object, pnt2 is found central point
67 //between parallel lines
68 float getorientation(CvPoint pnt1, CvPoint pnt2);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* __ORIENTATION__H_ */
Definition: camera.h:149