/home/laradmin/lar/perception/road/caltech_lanes/src/LaneDetector.cpp File Reference

#include "LaneDetector.hh"
#include "mcv.hh"
#include "InversePerspectiveMapping.hh"
#include <vector>
#include <string>
#include <algorithm>
#include <iostream>
#include <list>
#include <math.h>
#include <cv.h>
#include <highgui.h>
Include dependency graph for LaneDetector.cpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  LaneDetector

Defines

#define LOCAL_MAX_IGNORE   (int(MAX_IGNORE/4))
#define MAX_IGNORE   0
#define MCV_CUM_SUM(type)
#define MCV_GET_NZ_POINTS(inMatType, outMatType)
#define MCV_MAT_LOCAL_MAX(type)
#define MCV_MAT_MAX(type)
#define MCV_THRESHOLD_LOWER(type)
#define MCV_VECTOR_LOCAL_MAX(type)
#define MCV_VECTOR_MAX(type)

Functions

void LaneDetector::dummy ()
CvPoint2D32f LaneDetector::mcvAddVector (CvPoint2D32f v1, CvPoint2D32f v2)
void LaneDetector::mcvBinarizeImage (CvMat *inImage)
void LaneDetector::mcvCheckLaneWidth (vector< Line > &lines, vector< float > &scores, float wMu, float wSigma)
 This function takes a bunch of lines, and check which 2 lines can make a lane.
bool LaneDetector::mcvCheckMergeLines (const Line &line1, const Line &line2, float thetaThreshold, float rThreshold)
bool LaneDetector::mcvCheckMergeSplines (const Spline &sp1, const Spline &sp2, float thetaThreshold, float rThreshold, float meanThetaThreshold, float meanRThreshold, float centroidThreshold)
int LaneDetector::mcvCheckPoints (const CvMat *points)
int LaneDetector::mcvCheckSpline (const Spline &spline, float curvenessThreshold, float lengthThreshold, float thetaDiffThreshold, float thetaThreshold)
int LaneDetector::mcvChooseBestPeak (const vector< CvPoint2D32f > &peaks, const vector< float > &peakVals, CvPoint2D32f &peak, float &peakVal, float contThreshold, const CvPoint2D32f &tangent, const CvPoint2D32f &prevPoint, float angleThreshold)
void LaneDetector::mcvCumSum (const CvMat *inMat, CvMat *outMat)
void LaneDetector::mcvDrawLine (CvMat *image, Line line, CvScalar color, int width)
void LaneDetector::mcvDrawRectangle (CvMat *image, CvRect rect, CvScalar color, int width)
void LaneDetector::mcvDrawSpline (CvMat *image, Spline spline, CvScalar color, int width)
void LaneDetector::mcvDrawText (CvMat *image, char *str, CvPoint point, float size, CvScalar color)
CvMat * LaneDetector::mcvEvalBezierSpline (const Spline &spline, float h, CvMat *tangents)
CvMat * LaneDetector::mcvExtendPoints (const CvMat *im, const CvMat *inPoints, float angleThreshold, float meanDirAngleThreshold, int linePixelsTangent, int linePixelsNormal, float contThreshold, int deviationThreshold, CvRect bbox, bool smoothPeaks)
void LaneDetector::mcvFilterLines (const CvMat *inImage, CvMat *outImage, unsigned char wx, unsigned char wy, FLOAT sigmax, FLOAT sigmay, LineType lineType)
Spline LaneDetector::mcvFitBezierSpline (CvMat *points, int degree)
void LaneDetector::mcvFitRansacLine (const CvMat *image, int numSamples, int numIterations, float threshold, float scoreThreshold, int numGoodFit, bool getEndPoints, LineType lineType, Line *lineXY, float *lineRTheta, float *lineScore)
void LaneDetector::mcvFitRansacSpline (const CvMat *image, int numSamples, int numIterations, float threshold, float scoreThreshold, int numGoodFit, int splineDegree, float h, Spline *spline, float *splineScore, int splineScoreJitter, float splineScoreLengthRatio, float splineScoreAngleRatio, float splineScoreStep, vector< Spline > *prevSplines)
void LaneDetector::mcvFitRobustLine (const CvMat *points, float *lineRTheta, float *lineAbc)
void LaneDetector::mcvGet2DerivativeGaussianKernel (CvMat *kernel, unsigned char w, FLOAT sigma)
CvMat * LaneDetector::mcvGetBezierSplinePixels (Spline &spline, float h, CvSize box, bool extendSpline)
Line LaneDetector::mcvGetExtendedNormalLine (CvPoint2D32f &curPoint, CvPoint2D32f &tangent, int linePixelsTangent, int linePixelsNormal, CvPoint2D32f &nextPoint)
void LaneDetector::mcvGetGaussianKernel (CvMat *kernel, unsigned char w, FLOAT sigma)
void LaneDetector::mcvGetHoughTransformLines (const CvMat *inImage, vector< Line > *lines, vector< FLOAT > *lineScores, FLOAT rMin, FLOAT rMax, FLOAT rStep, FLOAT thetaMin, FLOAT thetaMax, FLOAT thetaStep, bool binarize, bool localMaxima, FLOAT detectionThreshold, bool smoothScores, bool group, FLOAT groupThreshold)
void LaneDetector::mcvGetHVLines (const CvMat *inImage, vector< Line > *lines, vector< FLOAT > *lineScores, LineType lineType, FLOAT linePixelWidth, bool binarize, bool localMaxima, FLOAT detectionThreshold, bool smoothScores)
vector< int > LaneDetector::mcvGetJitterVector (int maxJitter)
void LaneDetector::mcvGetLanes (const CvMat *inImage, const CvMat *clrImage, vector< Line > *lanes, vector< FLOAT > *lineScores, vector< Spline > *splines, vector< float > *splineScores, CameraInfo *cameraInfo, LaneDetectorConf *stopLineConf, LineState *state)
float LaneDetector::mcvGetLineAngle (const Line &line)
void LaneDetector::mcvGetLineExtent (const CvMat *im, const Line &inLine, Line &outLine)
float LaneDetector::mcvGetLinePeak (const CvMat *im, const Line &line, vector< CvPoint2D32f > &peaks, vector< float > &peakVals, bool positivePeak, bool smoothPeaks)
CvMat * LaneDetector::mcvGetLinePixels (const Line &line)
void LaneDetector::mcvGetLines (const CvMat *image, LineType lineType, vector< Line > &lines, vector< float > &lineScores, vector< Spline > &splines, vector< float > &splineScores, LaneDetectorConf *lineConf, LineState *state)
void LaneDetector::mcvGetLinesBoundingBoxes (const vector< Line > &lines, LineType type, CvSize size, vector< CvRect > &boxes)
 This function extracts bounding boxes from lines.
double LaneDetector::mcvGetLocalMaxSubPixel (double val1, double val2, double val3)
void LaneDetector::mcvGetMatLocalMax (const CvMat *inMat, vector< double > &localMaxima, vector< CvPoint > &localMaximaLoc, double threshold)
void LaneDetector::mcvGetMatMax (const CvMat *inMat, vector< double > &maxima, vector< CvPoint > &maximaLoc, double threshold)
CvMat * LaneDetector::mcvGetNonZeroPoints (const CvMat *inMat, bool floatMat)
LineColor LaneDetector::mcvGetPointsColor (const CvMat *im, const CvMat *points, int window, float numYellowMin, float rgMin, float rgMax, float gbMin, float rbMin, bool rbf, float rbfThreshold)
void LaneDetector::mcvGetPointsFeatures (const CvMat *points, CvPoint2D32f *centroid, float *theta, float *r, float *length, float *meanTheta, float *meanR, float *curveness)
CvPoint2D32f LaneDetector::mcvGetPointsMeanVector (const CvMat *points, bool forward)
FLOAT LaneDetector::mcvGetQuantile (const CvMat *mat, FLOAT qtile)
void LaneDetector::mcvGetRansacLines (const CvMat *im, vector< Line > &lines, vector< float > &lineScores, LaneDetectorConf *lineConf, LineType lineType)
void LaneDetector::mcvGetRansacSplines (const CvMat *im, vector< Line > &lines, vector< float > &lineScores, LaneDetectorConf *lineConf, LineType lineType, vector< Spline > &splines, vector< float > &splineScores, LineState *state)
void LaneDetector::mcvGetSplineFeatures (const Spline &spline, CvPoint2D32f *centroid, float *theta, float *r, float *length, float *meanTheta, float *meanR, float *curveness)
void LaneDetector::mcvGetSplinesBoundingBoxes (const vector< Spline > &splines, LineType type, CvSize size, vector< CvRect > &boxes)
 This function extracts bounding boxes from splines.
float LaneDetector::mcvGetSplineScore (const CvMat *image, Spline &spline, float h, int jitterVal, float lengthRatio, float angleRatio)
void LaneDetector::mcvGetStopLines (const CvMat *inImage, vector< Line > *stopLines, vector< FLOAT > *lineScores, const CameraInfo *cameraInfo, LaneDetectorConf *stopLineConf)
void LaneDetector::mcvGetVectorLocalMax (const CvMat *inVec, vector< double > &localMaxima, vector< int > &localMaximaLoc)
void LaneDetector::mcvGetVectorMax (const CvMat *inVector, double *max, int *maxLoc, int ignore)
float LaneDetector::mcvGetVectorNorm (const CvPoint2D32f &v)
void LaneDetector::mcvGroupBoundingBoxes (vector< CvRect > &boxes, LineType type, float groupThreshold)
 This function groups together bounding boxes.
void LaneDetector::mcvGroupLines (vector< Line > &lines, vector< float > &lineScores, float groupThreshold, CvSize bbox)
void LaneDetector::mcvGroupSplines (vector< Spline > &splines, vector< float > &scores)
void LaneDetector::mcvInitLaneDetectorConf (char *const fileName, LaneDetectorConf *stopLineConf)
void LaneDetector::mcvIntersectLineRThetaWithBB (FLOAT r, FLOAT theta, const CvSize bbox, Line *outLine)
void LaneDetector::mcvIntersectLineRThetaWithRect (FLOAT r, FLOAT theta, const Line &rect, Line &outLine)
void LaneDetector::mcvIntersectLineWithBB (const Line *inLine, const CvSize bbox, Line *outLine)
bool LaneDetector::mcvIsPointInside (FLOAT_POINT2D &point, const CvRect &rect)
bool LaneDetector::mcvIsPointInside (FLOAT_POINT2D &point, const Line &rect)
bool LaneDetector::mcvIsPointInside (FLOAT_POINT2D point, CvSize bbox)
bool LaneDetector::mcvIsValidPeak (const CvPoint2D32f &peak, const CvPoint2D32f &tangent, const CvPoint2D32f &prevPoint, float angleThreshold)
void LaneDetector::mcvLines2Mat (const vector< Line > *lines, CvMat *mat)
void LaneDetector::mcvLinesImIPM2Im (vector< Line > &lines, IPMInfo &ipmInfo, CameraInfo &cameraInfo, CvSize imSize)
void LaneDetector::mcvLineXY2RTheta (const Line &line, float &r, float &theta)
Spline LaneDetector::mcvLineXY2Spline (const Line &line, int degree)
void LaneDetector::mcvLocalizePoints (const CvMat *im, const CvMat *inPoints, CvMat *outPoints, int numLinePixels, float angleThreshold)
void LaneDetector::mcvMat2Lines (const CvMat *mat, vector< Line > *lines)
void LaneDetector::mcvMatInt2Float (const CvMat *inMat, CvMat *outMat)
CvPoint2D32f LaneDetector::mcvMultiplyVector (CvPoint2D32f v, float s)
CvPoint2D32f LaneDetector::mcvNormalizeVector (float x, float y)
CvPoint2D32f LaneDetector::mcvNormalizeVector (const CvPoint &v)
CvPoint2D32f LaneDetector::mcvNormalizeVector (const CvPoint2D32f &v)
void LaneDetector::mcvPostprocessLines (const CvMat *image, const CvMat *clrImage, const CvMat *rawipm, const CvMat *fipm, vector< Line > &lines, vector< float > &lineScores, vector< Spline > &splines, vector< float > &splineScores, LaneDetectorConf *lineConf, LineState *state, IPMInfo &ipmInfo, CameraInfo &cameraInfo)
void LaneDetector::mcvSampleWeighted (const CvMat *cumSum, int numSamples, CvMat *randInd, CvRNG *rng)
void LaneDetector::mcvSetMat (CvMat *inMat, CvRect mask, double val)
void LaneDetector::mcvSortPoints (const CvMat *inPoints, CvMat *outPoints, int dim, int dir)
void LaneDetector::mcvSplinesImIPM2Im (vector< Spline > &splines, IPMInfo &ipmInfo, CameraInfo &cameraInfo, CvSize imSize)
CvPoint2D32f LaneDetector::mcvSubtractVector (const CvPoint2D32f &v1, const CvPoint2D32f &v2)
void LaneDetector::mcvThresholdLower (const CvMat *inMat, CvMat *outMat, FLOAT threshold)
void LaneDetector::SHOW_LINE (const Line line, char str[])
void LaneDetector::SHOW_SPLINE (const Spline spline, char str[])

Variables

int LaneDetector::DEBUG_LINES = 0

Detailed Description

Author:
Mohamed Aly <malaa@caltech.edu>
Date:
Thu 26 Jul, 2007

Definition in file LaneDetector.cpp.


Define Documentation

#define LOCAL_MAX_IGNORE   (int(MAX_IGNORE/4))
#define MAX_IGNORE   0
#define MCV_CUM_SUM ( type   ) 
Value:
/*row vector*/                                  \
    if(inMat->rows == 1)                                \
        for (int i=1; i<outMat->cols; i++)              \
            CV_MAT_ELEM(*outMat, type, 0, i) +=         \
                CV_MAT_ELEM(*outMat, type, 0, i-1);     \
    /*column vector*/                                   \
    else                                                \
        for (int i=1; i<outMat->rows; i++)              \
            CV_MAT_ELEM(*outMat, type, i, 0) +=         \
                CV_MAT_ELEM(*outMat, type, i-1, 0);
#define MCV_GET_NZ_POINTS ( inMatType,
outMatType   ) 
Value:
/*loop and allocate the points*/ \
     for (int i=0; i<inMat->rows; i++) \
        for (int j=0; j<inMat->cols; j++) \
            if (CV_MAT_ELEM(*inMat, inMatType, i, j)) \
            { \
                CV_MAT_ELEM(*outMat, outMatType, 0, k) = j; \
                CV_MAT_ELEM(*outMat, outMatType, 1, k) = i; \
                CV_MAT_ELEM(*outMat, outMatType, 2, k) = \
                  (outMatType) CV_MAT_ELEM(*inMat, inMatType, i, j); \
                k++; \
            } \
#define MCV_MAT_LOCAL_MAX ( type   ) 
#define MCV_MAT_MAX ( type   ) 
Value:
/*loop on the matrix and get points that are larger than their*/ \
    /*neighboring 8 pixels*/ \
    for(int i=1; i<inMat->rows-1; i++) \
        for (int j=1; j<inMat->cols-1; j++) \
        { \
            /*get the current value*/ \
            val = CV_MAT_ELEM(*inMat, type, i, j); \
            /*check if it's larger than threshold*/ \
            if (val >= threshold) \
            { \
                /*found a maxima, put it in the return vector*/ \
                /*in decending order*/ \
                /*iterators for the two vectors*/ \
                vector<double>::iterator k; \
                vector<CvPoint>::iterator l; \
                /*loop till we find the place to put it in descendingly*/ \
                for(k=maxima.begin(), l=maximaLoc.begin(); \
                    k != maxima.end()  && val<= *k; k++,l++); \
                /*add its index*/ \
                maxima.insert(k, val); \
                maximaLoc.insert(l, cvPoint(j, i)); \
            } \
        }
#define MCV_THRESHOLD_LOWER ( type   ) 
Value:
for (int i=0; i<inMat->height; i++) \
        for (int j=0; j<inMat->width; j++) \
            if ( CV_MAT_ELEM(*inMat, type, i, j)<threshold) \
                CV_MAT_ELEM(*outMat, type, i, j)=(type) 0;
#define MCV_VECTOR_LOCAL_MAX ( type   ) 

This function gets the local maxima in a vector and their positions

Parameters:
inVec input vector
localMaxima the output vector of local maxima
localMaximaLoc the vector of locations of the local maxima,

Definition at line 1108 of file LaneDetector.cpp.

#define MCV_VECTOR_MAX ( type   ) 

This function gets the maximum value in a vector (row or column) and its location

Parameters:
inVector the input vector
max the output max value
maxLoc the location (index) of the first max

Definition at line 916 of file LaneDetector.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


caltech_lanes
Author(s): Morais
autogenerated on Wed Jul 23 04:33:34 2014