00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __TLHOUGH_H__
00018 #define __TLHOUGH_H__
00019
00020
00021 #include <vector>
00022 using std::vector;
00023
00024 #include "tlVision.h"
00025
00026
00027
00028
00029 class tlHough
00030 {
00031 public:
00032 tlImage *srcImage;
00033 int srcWidth;
00034 int srcHeight;
00035 short *accumulator;
00036 short *sinTheta;
00037 short *cosTheta;
00038 float angularIncrement;
00039 int hOffset;
00040 int hWidth;
00041 int hHeight;
00042 short maxAcc;
00043
00044 vector <tlLine*> lineList;
00045
00046 private:
00047 int clear();
00048 int add (tlLine *line);
00049 struct lline *newLine (tlLine *line);
00050 int makeAccumulator ();
00051 int clearAccumulator ();
00052 int extractLines (int lineCount);
00053
00054 public:
00055
00056 tlHough (int sWidth, int sHeight, float angIncr = 0.0f);
00057 virtual ~tlHough();
00058
00059
00060 int setParam (int sWidth, int sHeight, float angIncr = 0.0f);
00061 int setAngularIncrement (float angIncr);
00062 float getAngularIncrement () { return (float)(180.0f*angularIncrement/TL_PI); };
00063
00064
00065 int extract (tlImage *image, int lineCount = 1);
00066
00067
00068 int getLineCount ();
00069 tlLine *getLine (int index);
00070 tlLine *getLinePtr (int index);
00071 int getLineCopy (tlLine *line, int index);
00072
00073
00074 int getHoughImage (tlImage *image);
00075 };
00076
00077
00078 #endif