Commit fbb27ed0 authored by Bellaktris's avatar Bellaktris

bug fix

parent e92394d0
......@@ -211,7 +211,7 @@ static void dominantTransforms(const cv::Mat &img, std::vector <cv::Matx33f> &tr
int current = i*whs.cols + j;
int dy[] = {0, 1, 0}, dx[] = {0, 0, 1};
for (int k = 0; k < sizeof(dy)/sizeof(int); ++k)
for (int k = 0; k < int( sizeof(dy)/sizeof(int) ); ++k)
if (i - dy[k] >= 0 && j - dx[k] >= 0)
{
int neighbor = (i - dy[k])*whs.cols + (j - dx[k]);
......@@ -240,8 +240,8 @@ static void dominantTransforms(const cv::Mat &img, std::vector <cv::Matx33f> &tr
for (int i = 0, t = 0; i < annfHist.rows; ++i)
{
double *pAnnfHist = annfHist.template ptr<double>(i);
double *_pAnnfHist = _annfHist.template ptr<double>(i);
double *pAnnfHist = annfHist.ptr<double>(i);
double *_pAnnfHist = _annfHist.ptr<double>(i);
for (int j = 0; j < annfHist.cols; ++j)
if ( pAnnfHist[j] != 0 && pAnnfHist[j] == _pAnnfHist[j] )
......
......@@ -175,17 +175,17 @@ singleExpansion(const int alpha)
for (int j = 0; j < width - 1; ++j)
{
setWeights( graph, cv::Point(i, j), cv::Point(i, j + 1), currentRow[j], currentRow[j + 1], alpha );
setWeights( graph, cv::Point(i, j), cv::Point(i + 1, j), currentRow[j], nextRow[j], alpha );
setWeights( graph, cv::Point(j, i), cv::Point(j + 1, i), currentRow[j], currentRow[j + 1], alpha );
setWeights( graph, cv::Point(j, i), cv::Point(j, i + 1), currentRow[j], nextRow[j], alpha );
}
setWeights( graph, cv::Point(i, width - 1), cv::Point(i + 1, width - 1),
setWeights( graph, cv::Point(width - 1, i), cv::Point(width - 1, i + 1),
currentRow[width - 1], nextRow[width - 1], alpha );
}
const int *currentRow = (const int *) x_i.template ptr <int>(height - 1);
for (int i = 0; i < width - 1; ++i)
setWeights( graph, cv::Point(height - 1, i), cv::Point(height - 1, i + 1),
setWeights( graph, cv::Point(i, height - 1), cv::Point(i + 1, height - 1),
currentRow[i], currentRow[i + 1], alpha );
/** Max-flow computation **/
......
......@@ -101,10 +101,10 @@ static void nextProjection(std::vector <cv::Mat> &projections, const cv::Point &
for (int i = dy; i < nproj.rows; ++i)
{
float *vxNext = nproj.template ptr<float>(i - dy);
float *vNext = nproj.template ptr<float>(i);
float *vxNext = nproj.ptr<float>(i - dy);
float *vNext = nproj.ptr<float>(i);
float *vxCurrent = proj.template ptr<float>(i - dy);
float *vxCurrent = proj.ptr<float>(i - dy);
if (plusToMinusUpdate)
for (int j = dx; j < nproj.cols; ++j)
......
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