Move C++ basic structures to separate header and inverse dependency from C API

cv::Complex, cv::Point_ and cv::Point3_ are moved.
This commit is contained in:
Andrey Kamaev
2013-03-26 19:48:50 +04:00
parent 19f8f85c51
commit 13b31b0804
19 changed files with 314 additions and 251 deletions

View File

@@ -321,7 +321,7 @@ static void DrawEtalon(IplImage *img, CvPoint2D32f *corners,
const int r = 4;
int i;
int x, y;
CvPoint prev_pt = { 0, 0 };
CvPoint prev_pt;
static const CvScalar rgb_colors[] = {
{{0,0,255}},
{{0,128,255}},

View File

@@ -87,8 +87,8 @@ int PointInRect(const CvPoint& p, const CvRect& r)
inline
int RectInRect(const CvRect& r1, const CvRect& r2)
{
CvPoint plt = {r1.x, r1.y};
CvPoint prb = {r1.x + r1.width, r1.y + r1.height};
CvPoint plt(r1.x, r1.y);
CvPoint prb(r1.x + r1.width, r1.y + r1.height);
return (PointInRect(plt, r2) && PointInRect(prb, r2));
}

View File

@@ -558,7 +558,7 @@ void CvCalibFilter::DrawPoints( CvMat** dstarr )
const int colorCount = sizeof(line_colors)/sizeof(line_colors[0]);
const int r = 4;
CvScalar color = line_colors[0];
CvPoint prev_pt = { 0, 0};
CvPoint prev_pt;
for( j = 0; j < count; j++ )
{

View File

@@ -1826,7 +1826,7 @@ void icvGetCutPiece( CvVect64d areaLineCoef1,CvVect64d areaLineCoef2,
/* Collect all candidate point */
CvPoint2D64d candPoints[8];
CvPoint2D64d midPoint = {0, 0};
CvPoint2D64d midPoint;
int numPoints = 0;
int res;
int i;

View File

@@ -694,7 +694,7 @@ void _cvProjectionPointToSegment(CvPoint2D32f* PointO,
float* dist)
{
float scal_AO_AB, scal_AB_AB;
CvPoint2D32f VectorAB = {PointB->x - PointA->x, PointB->y - PointA->y};
CvPoint2D32f VectorAB(PointB->x - PointA->x, PointB->y - PointA->y);
scal_AB_AB = VectorAB.x*VectorAB.x + VectorAB.y*VectorAB.y;
if(scal_AB_AB < LCM_CONST_ZERO)
{
@@ -704,7 +704,7 @@ void _cvProjectionPointToSegment(CvPoint2D32f* PointO,
return;
}
CvPoint2D32f VectorAO = {PointO->x - PointA->x, PointO->y - PointA->y};
CvPoint2D32f VectorAO(PointO->x - PointA->x, PointO->y - PointA->y);
scal_AO_AB = VectorAO.x*VectorAB.x + VectorAO.y*VectorAB.y;
if(dist)

View File

@@ -78,7 +78,7 @@ void _cvWorkEast (int i, int j, _CvWork** W, CvPoint2D32f* edges1, CvPoint2D
void _cvWorkSouthEast(int i, int j, _CvWork** W, CvPoint2D32f* edges1, CvPoint2D32f* edges2);
void _cvWorkSouth (int i, int j, _CvWork** W, CvPoint2D32f* edges1, CvPoint2D32f* edges2);
static CvPoint2D32f null_edge = {0,0};
static CvPoint2D32f null_edge;
double _cvStretchingWork(CvPoint2D32f* P1,
CvPoint2D32f* P2)
@@ -106,7 +106,7 @@ double _cvBendingWork( CvPoint2D32f* B0,
CvPoint* K*/)
{
CvPoint2D32f Q0, Q1, Q2;
CvPoint2D32f Q1_nm = { 0, 0 }, Q2_nm = { 0, 0 };
CvPoint2D32f Q1_nm, Q2_nm;
double d0, d1, d2, des, t_zero;
double k_zero, k_nonmon;
CvPoint2D32f center;

View File

@@ -328,8 +328,8 @@ static void color_derv( const CvArr* srcArr, CvArr* dstArr, int thresh )
}
#endif
const CvPoint icvCodeDeltas[8] =
{ {1, 0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}, {0, 1}, {1, 1} };
static const CvPoint icvCodeDeltas[8] =
{ CvPoint(1, 0), CvPoint(1, -1), CvPoint(0, -1), CvPoint(-1, -1), CvPoint(-1, 0), CvPoint(-1, 1), CvPoint(0, 1), CvPoint(1, 1) };
static CvSeq*
icvGetComponent( uchar* img, int step, CvRect rect,
@@ -366,7 +366,7 @@ icvGetComponent( uchar* img, int step, CvRect rect,
CvSeqWriter writer;
char *i0, *i1, *i3, *i4 = 0;
int prev_s = -1, s, s_end;
CvPoint pt = { x, y };
CvPoint pt(x, y);
if( !(prev == 0 && p == 2) ) /* if not external contour */
{

View File

@@ -749,11 +749,11 @@ int ChoiceTrackingFace2(CvFaceTracker* pTF, const int nElements, const CvFaceEle
face[element[0]] = *(new_face[element[0]]);
face[element[1]] = *(new_face[element[1]]);
// 3 element find by template
CvPoint templ_v01 = {pTF->ptTempl[element[1]].x - pTF->ptTempl[element[0]].x, pTF->ptTempl[element[1]].y - pTF->ptTempl[element[0]].y};
CvPoint templ_v02 = {pTF->ptTempl[element[2]].x - pTF->ptTempl[element[0]].x, pTF->ptTempl[element[2]].y - pTF->ptTempl[element[0]].y};
CvPoint prev_v01 = {pTF->face[element[1]].ptCenter.x - pTF->face[element[0]].ptCenter.x, pTF->face[element[1]].ptCenter.y - pTF->face[element[0]].ptCenter.y};
CvPoint prev_v02 = {pTF->face[element[2]].ptCenter.x - pTF->face[element[0]].ptCenter.x, pTF->face[element[2]].ptCenter.y - pTF->face[element[0]].ptCenter.y};
CvPoint new_v01 = {new_face[element[1]]->ptCenter.x - new_face[element[0]]->ptCenter.x, new_face[element[1]]->ptCenter.y - new_face[element[0]]->ptCenter.y};
CvPoint templ_v01(pTF->ptTempl[element[1]].x - pTF->ptTempl[element[0]].x, pTF->ptTempl[element[1]].y - pTF->ptTempl[element[0]].y);
CvPoint templ_v02(pTF->ptTempl[element[2]].x - pTF->ptTempl[element[0]].x, pTF->ptTempl[element[2]].y - pTF->ptTempl[element[0]].y);
CvPoint prev_v01(pTF->face[element[1]].ptCenter.x - pTF->face[element[0]].ptCenter.x, pTF->face[element[1]].ptCenter.y - pTF->face[element[0]].ptCenter.y);
CvPoint prev_v02(pTF->face[element[2]].ptCenter.x - pTF->face[element[0]].ptCenter.x, pTF->face[element[2]].ptCenter.y - pTF->face[element[0]].ptCenter.y);
CvPoint new_v01(new_face[element[1]]->ptCenter.x - new_face[element[0]]->ptCenter.x, new_face[element[1]]->ptCenter.y - new_face[element[0]]->ptCenter.y);
double templ_d01 = sqrt((double)templ_v01.x*templ_v01.x + templ_v01.y*templ_v01.y);
double templ_d02 = sqrt((double)templ_v02.x*templ_v02.x + templ_v02.y*templ_v02.y);
double prev_d01 = sqrt((double)prev_v01.x*prev_v01.x + prev_v01.y*prev_v01.y);
@@ -767,7 +767,7 @@ int ChoiceTrackingFace2(CvFaceTracker* pTF, const int nElements, const CvFaceEle
double y = double(new_v01.x) * sin_a + double(new_v01.y) * cos_a;
x = x * new_d02 / new_d01;
y = y * new_d02 / new_d01;
CvPoint new_v02 = {int(x + 0.5), int(y + 0.5)};
CvPoint new_v02(int(x + 0.5), int(y + 0.5));
face[element[2]].iColor = 0;
face[element[2]].iEnergy = 0;
face[element[2]].nRectsInThis = 0;
@@ -818,10 +818,10 @@ inline int GetEnergy(CvTrackingRect** ppNew, const CvTrackingRect* pPrev, CvPoin
inline int GetEnergy2(CvTrackingRect** ppNew, const CvTrackingRect* pPrev, CvPoint* ptTempl, CvRect* rTempl, int* element)
{
CvPoint new_v = {ppNew[element[0]]->ptCenter.x - ppNew[element[1]]->ptCenter.x,
ppNew[element[0]]->ptCenter.y - ppNew[element[1]]->ptCenter.y};
CvPoint prev_v = {pPrev[element[0]].ptCenter.x - pPrev[element[1]].ptCenter.x,
pPrev[element[0]].ptCenter.y - pPrev[element[1]].ptCenter.y};
CvPoint new_v(ppNew[element[0]]->ptCenter.x - ppNew[element[1]]->ptCenter.x,
ppNew[element[0]]->ptCenter.y - ppNew[element[1]]->ptCenter.y);
CvPoint prev_v(pPrev[element[0]].ptCenter.x - pPrev[element[1]].ptCenter.x,
pPrev[element[0]].ptCenter.y - pPrev[element[1]].ptCenter.y);
double new_d = sqrt((double)new_v.x*new_v.x + new_v.y*new_v.y);
double prev_d = sqrt((double)prev_v.x*prev_v.x + prev_v.y*prev_v.y);
double dx = ptTempl[element[0]].x - ptTempl[element[1]].x;