Code cleanup: silence some -Wnarrowing warnings from C++11

This commit is contained in:
Sergey Sharybin 2012-08-01 15:02:09 +00:00
parent 2fcd6827bf
commit cad8609172
2 changed files with 3 additions and 3 deletions

@ -209,7 +209,7 @@ void CameraIntrinsics::ComputeLookupGrid(Grid* grid, int width, int height, doub
if( ix >= width-2 ) ix = width-2;
if( iy >= height-2 ) iy = height-2;
Offset offset = { ix-x, iy-y, fx, fy };
Offset offset = { (short)(ix-x), (short)(iy-y), (unsigned char)fx, (unsigned char)fy };
grid->offset[y*width+x] = offset;
}
}

@ -66,7 +66,7 @@ std::vector<Feature> DetectFAST(const unsigned char* data, int width, int height
Feature *all_features = new Feature[num_features];
for(int i = 0; i < num_features; ++i) {
Feature a = { nonmax[i].x, nonmax[i].y, scores[i], 0 };
Feature a = { (float)nonmax[i].x, (float)nonmax[i].y, (float)scores[i], 0 };
all_features[i] = a;
}
@ -173,7 +173,7 @@ void DetectMORAVEC(ubyte* image, int stride, int width, int height, Feature* det
for(int y=16; y<height-16; y++) {
for(int x=16; x<width-16; x++) {
int s = scores[y*width+x];
Feature f = { x+8, y+8, s, 16 };
Feature f = { (float)x+8.0f, (float)y+8.0f, (float)s, 16 };
if(s>min) detected[i++] = f;
}
}