EIEdgeImage.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #pragma once
00026 #include "plugins/SceneUnderstanding/LFLineFitter/LFLineSegment.h"
00027 #include "plugins/SceneUnderstanding/LFLineFitter/LFLineFitter.h"
00028 #include <vector>
00029 using namespace std;
00030
00031
00032
00033 class EIEdgeImage {
00034 public:
00035 EIEdgeImage();
00036 ~EIEdgeImage();
00037 void SafeRelease();
00038 void Read(char* fileName);
00039 void Read(LFLineFitter &lf);
00040 void Read(int width, int height, int nLines, LFLineSegment* linesSegment);
00041
00042
00043 void SetNumDirections(const int nDirections) {nDirections_=nDirections;};
00044 void Scale(double s);
00045 void setWeights();
00046
00047 void ConstructDirectionImage(int index,IplImage* image);
00048 double Length();
00049
00050 void operator=(EIEdgeImage& ei);
00051 void Boundary(double &minx, double &miny, double &maxx, double &maxy);
00052 void SetDirectionIndices();
00053
00054
00055
00056 void ConstructImage(IplImage *image, int thickness = 1);
00057
00058 int width_;
00059 int height_;
00060 int nLines_;
00061 LFLineSegment* lines_;
00062 int* directionIndices_;
00063 double length;
00064
00065 private:
00066
00067 void SetLines2Grid();
00068 void SetDirections();
00069 int Theta2Index(double theta);
00070 double Index2Theta(int index);
00071
00072 private:
00073 int nDirections_;
00074
00075 vector<LFLineSegment*>* directions_;
00076
00077
00078 friend class LMLineMatcher;
00079 friend class LMDistanceImage;
00080 };