I'm trying to build a library of cvblob using OpenCV, and while compiling in VS 2013,
error C4703: potentially uninitialized local pointer variable 'track' used
error C4703: potentially uninitialized local pointer variable 'blob' used
I'm not sure why this is, since the pointer variables are defined a block above (albeit in a separate loop). Here is the code:
// Update track
//cout << "Matching: track=" << track->id << ", blob=" << blob->label << endl;
track->label = blob->label; // ERROR HERE
track->centroid = blob->centroid;
I'm using pre-written header and source files, so I'm not sure what the problem is. Anyone know what the fix is?
Before //Update Track
, Here is where 'track' and 'blob' are referenced above, with no errors:
// Select track
CvTrack *track;
unsigned int area = 0;
for (list<CvTrack*>::const_iterator it=tt.begin(); it!=tt.end(); ++it)
{
CvTrack *t = *it;
unsigned int a = (t->maxx-t->minx)*(t->maxy-t->miny);
if (a>area)
{
area = a;
track = t;
}
}
// Select blob
CvBlob *blob;
area = 0;