16 #include <opencv2/core/core.hpp> 74 void Init (
unsigned int iImgWidth,
unsigned int iImgHeight,
bool bAllowToModifyTheSources =
false,
unsigned char iEdgeToProcess = 0xFF,
unsigned char iEdgeInProcess = 0xFF-1,
unsigned char iEdgeProcessed = 0xFF-2,
unsigned char iEdgeStrengthRemoved = 0 );
89 void Perform (
unsigned char* pImgEdgeStrength,
int defEdgeLinkMode = MODE_CONTOUR,
void* pImgEdgeDirection = NULL,
int defImgEdgeDirectionType = ANGLE_8U );
95 void Draw(
unsigned char* pImgRGB );
112 int GetEdgeListSplittedXY (std::vector<cv::Point_<int> > &rEdges, std::vector<unsigned char> **ppAngle8Bit = NULL);
120 int getContours( std::vector<std::vector<cv::Point> > &contours,
unsigned min_length = 0);
163 void Trace_Complex ( CvPoint tPoint,
int *pEnd,
unsigned int iCommingFromEdge );
165 void Trace_Contour ( CvPoint tPoint,
int *pEnd,
unsigned int iCommingFromEdge );
169 static const CvPoint
GetNeighborPoint ( CvPoint pPtrCenter,
int iNeighborIndex );
170 static const void SortArrayIndexes (
int *pArray,
int *pIndexes,
const int iSize );
174 return mpImgEdge + ( tPoint.y * mImgWidth + tPoint.x );
176 inline void SumArrayMatrix (
int *pMatrixA,
int *pMatrixB,
int *pSum,
const int iSize ) {
177 for (
int i = 0; i < iSize; i++ ) pSum[i] = pMatrixA[i] + pMatrixB[i];
180 return ( ( p.x > 0 ) && ( p.x < mImgWidth-1 ) && ( p.y > 0 ) && ( p.y < mImgHeight-1 ) );
int GetEdgeListSplittedXY(std::vector< cv::Point_< int > > &rEdges, std::vector< unsigned char > **ppAngle8Bit=NULL)
Returns number of edges and edges in the arguments.
static const int pppDirectionWeightsField[4][3][3]
void markNeighborEdgesAsProcessed(unsigned char *pPix)
int GetImgDirectionIndex(CvPoint tPoint)
static const CvPoint GetNeighborPoint(CvPoint pPtrCenter, int iNeighborIndex)
void Trace_Simple(CvPoint tPoint, int *pEnd)
std::vector< cv::Range > getSegmentIndexes()
the indexes of the contour segments
void Perform(unsigned char *pImgEdgeStrength, int defEdgeLinkMode=MODE_CONTOUR, void *pImgEdgeDirection=NULL, int defImgEdgeDirectionType=ANGLE_8U)
Starts the edge linking with a certain mode.
static const void SortArrayIndexes(int *pArray, int *pIndexes, const int iSize)
std::vector< CvPoint > mEdges
void Init(unsigned int iImgWidth, unsigned int iImgHeight, bool bAllowToModifyTheSources=false, unsigned char iEdgeToProcess=0xFF, unsigned char iEdgeInProcess=0xFF-1, unsigned char iEdgeProcessed=0xFF-2, unsigned char iEdgeStrengthRemoved=0)
Inititalized the class and reserves the momory needed.
static const int ANGLE_32F
Static const variable used to define the source format of a gradient image as atan2(dy, dx) of the edge The format ANGLE_32F means values from -PI to +PI.
unsigned char mEdgeInProcess
static const int ppGradientWeightsField[4][9]
static const int ANGLE_64F
Static const variable used to define the source format of a gradient image as atan2(dy, dx) of the edge The format ANGLE_64F means values from -PI to +PI.
std::vector< unsigned char > mAngle8Bit
int mdImgEdgeDirectionType
int getContours(std::vector< std::vector< cv::Point > > &contours, unsigned min_length=0)
Returns the contour as vector of vector points.
void GetAbnormitiesInEdgesImage(IplImage *ptImgEdge, std::vector< CvPoint > *pAbnormities, uchar iEdgeStrength=0)
Find egde contour Abnormities in edge image.
void Trace_Contour(CvPoint tPoint, int *pEnd, unsigned int iCommingFromEdge)
static const int MODE_COMPLEX
Static const variable used to define the methode used to find the contour (linked edges) ...
static const int pppCommingFromEdgeWeightsField[9][3][3]
unsigned char mEdgeProcessed
unsigned char * getImgEdge(CvPoint tPoint)
unsigned char * mpImgEdge
unsigned int GetNrOfEdges()
Returns a number of edges used to linke edges to semgents.
void Trace_Complex(CvPoint tPoint, int *pEnd, unsigned int iCommingFromEdge)
std::vector< cv::Range > mSegments
void Draw(unsigned char *pImgRGB)
Draws the detected contours in a RGB image with radom colours.
void * mpImgEdgeDirection
static const int MODE_GRAIDENT
Static const variable used to define the methode used to find the contour (linked edges) ...
void SumArrayMatrix(int *pMatrixA, int *pMatrixB, int *pSum, const int iSize)
bool mbAllowToModifyTheSources
static const int MODE_CONTOUR
Static const variable used to define the methode used to find the contour (linked edges) ...
Class to link detected images edges a typical source can be a cvCanny image.
static const int ppContourWeightsField[9][9]
bool isInImage(const CvPoint &p)
void Trace_Gradient(CvPoint tPoint, int *pEnd)
static const int MODE_SIMPLE
Static const variable used to define the methode used to find the contour (linked edges) ...
unsigned char mEdgeToProcess
static const int ANGLE_8U
Static const variable used to define the source format of a gradient image as atan2(dy, dx) of the edge The format ANGLE_8U means zero rad are 0, +PI and -PI are 0x7F.