fixed kmeans center initialization in the case of huge matrices (ticket #1291); fixed warinings in libtiff.

This commit is contained in:
Vadim Pisarevsky 2011-08-11 22:27:18 +00:00
parent 1e6f1cc15c
commit 6942799669
2 changed files with 3 additions and 3 deletions

View File

@ -1450,14 +1450,14 @@ TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir)
case TIFF_BYTE:
case TIFF_SBYTE:
{
uint8 v[4];
uint8 v[4]={0,0,0,0};
return TIFFFetchByteArray(tif, dir, v)
&& TIFFSetField(tif, dir->tdir_tag, v[0], v[1]);
}
case TIFF_SHORT:
case TIFF_SSHORT:
{
uint16 v[2];
uint16 v[2]={0,0};
return TIFFFetchShortArray(tif, dir, v)
&& TIFFSetField(tif, dir->tdir_tag, v[0], v[1]);
}

View File

@ -2205,7 +2205,7 @@ static void generateCentersPP(const Mat& _data, Mat& _out_centers,
{
int i, j, k, dims = _data.cols, N = _data.rows;
const float* data = _data.ptr<float>(0);
int step = (int)(_data.step/sizeof(data[0]));
size_t step = _data.step/sizeof(data[0]);
vector<int> _centers(K);
int* centers = &_centers[0];
vector<float> _dist(N*3);