Commit 69427996 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

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

fixed kmeans center initialization in the case of huge matrices (ticket #1291); fixed warinings in libtiff.
parent 1e6f1cc1
......@@ -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]);
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment