merged all the latest changes from 2.4 to trunk
This commit is contained in:
@@ -269,13 +269,15 @@ static Mat readMatFromBin( const string& filename )
|
||||
if( f )
|
||||
{
|
||||
int rows, cols, type, dataSize;
|
||||
fread( (void*)&rows, sizeof(int), 1, f );
|
||||
fread( (void*)&cols, sizeof(int), 1, f );
|
||||
fread( (void*)&type, sizeof(int), 1, f );
|
||||
fread( (void*)&dataSize, sizeof(int), 1, f );
|
||||
size_t elements_read1 = fread( (void*)&rows, sizeof(int), 1, f );
|
||||
size_t elements_read2 = fread( (void*)&cols, sizeof(int), 1, f );
|
||||
size_t elements_read3 = fread( (void*)&type, sizeof(int), 1, f );
|
||||
size_t elements_read4 = fread( (void*)&dataSize, sizeof(int), 1, f );
|
||||
CV_Assert(elements_read1 == 1 && elements_read2 == 1 && elements_read3 == 1 && elements_read4 == 1);
|
||||
|
||||
uchar* data = (uchar*)cvAlloc(dataSize);
|
||||
fread( (void*)data, 1, dataSize, f );
|
||||
size_t elements_read = fread( (void*)data, 1, dataSize, f );
|
||||
CV_Assert(elements_read == (size_t)(dataSize));
|
||||
fclose(f);
|
||||
|
||||
return Mat( rows, cols, type, data );
|
||||
|
@@ -75,7 +75,8 @@ int CV_MserTest::LoadBoxes(const char* path, vector<CvBox2D>& boxes)
|
||||
while (!feof(f))
|
||||
{
|
||||
CvBox2D box;
|
||||
fscanf(f,"%f,%f,%f,%f,%f\n",&box.angle,&box.center.x,&box.center.y,&box.size.width,&box.size.height);
|
||||
int values_read = fscanf(f,"%f,%f,%f,%f,%f\n",&box.angle,&box.center.x,&box.center.y,&box.size.width,&box.size.height);
|
||||
CV_Assert(values_read == 5);
|
||||
boxes.push_back(box);
|
||||
}
|
||||
fclose(f);
|
||||
|
Reference in New Issue
Block a user