Ask Your Question

Revision history [back]

Yes I think it's a bug :

line

 // create gaussian response
y=Mat::zeros((int)roi.height,(int)roi.width,CV_64F);
for(unsigned i=0;i<roi.height;i++){
  for(unsigned j=0;j<roi.width;j++){
    y.at<double>(i,j)=(i-roi.height/2+1)*(i-roi.height/2+1)+(j-roi.width/2+1)*(j-roi.width/2+1);
  }
}

when you roi.height is a double value (int)roi.height is not equal roi.height then in loop pixels outside are scanned. Loop should be : for(unsigned i=0;i<(int)roi.height;i++){ for(unsigned j=0;j<(int)roi.width;j++){

Yes I think it's a bug :

line

 // create gaussian response
y=Mat::zeros((int)roi.height,(int)roi.width,CV_64F);
for(unsigned i=0;i<roi.height;i++){
  for(unsigned j=0;j<roi.width;j++){
    y.at<double>(i,j)=(i-roi.height/2+1)*(i-roi.height/2+1)+(j-roi.width/2+1)*(j-roi.width/2+1);
  }
}

when you roi.height is a double value (int)roi.height is not equal roi.height then in loop pixels outside are scanned. Loop should be : for(unsigned i=0;i<(int)roi.height;i++){ for(unsigned j=0;j<(int)roi.width;j++){

About issue now I cannot find it https://github.com/opencv/opencv_contrib/issues. If you don't report it you can do it

Yes I think it's a bug :

line

 // create gaussian response
y=Mat::zeros((int)roi.height,(int)roi.width,CV_64F);
for(unsigned i=0;i<roi.height;i++){
  for(unsigned j=0;j<roi.width;j++){
    y.at<double>(i,j)=(i-roi.height/2+1)*(i-roi.height/2+1)+(j-roi.width/2+1)*(j-roi.width/2+1);
  }
}

when you roi.height is a double value (int)roi.height is not equal roi.height then in loop pixels outside are scanned. Loop should be : :

 for(unsigned i=0;i<(int)roi.height;i++){
    for(unsigned j=0;j<(int)roi.width;j++){

j=0;j<(int)roi.width;j++){

About issue now I cannot find it https://github.com/opencv/opencv_contrib/issues. If you don't report it you can do it

Yes I think it's a bug :

line

 // create gaussian response
y=Mat::zeros((int)roi.height,(int)roi.width,CV_64F);
for(unsigned i=0;i<roi.height;i++){
  for(unsigned j=0;j<roi.width;j++){
    y.at<double>(i,j)=(i-roi.height/2+1)*(i-roi.height/2+1)+(j-roi.width/2+1)*(j-roi.width/2+1);
  }
}

when you roi.height is a double value (int)roi.height is not equal roi.height then in loop pixels outside are scanned. Loop should be :something like this: y=Mat::zeros(static_cast<int>(roi.height),static_cast<int>(roi.width),CV_64F);

 for(unsigned i=0;i<(int)roi.height;i++){
i=0;i<y.height;i++){
   for(unsigned j=0;j<(int)roi.width;j++){
j=0;j<y.width;j++){

About issue now I cannot find it https://github.com/opencv/opencv_contrib/issues. If you don't report it you can do it

Yes I think it's a bug :

line

 // create gaussian response
y=Mat::zeros((int)roi.height,(int)roi.width,CV_64F);
for(unsigned i=0;i<roi.height;i++){
  for(unsigned j=0;j<roi.width;j++){
    y.at<double>(i,j)=(i-roi.height/2+1)*(i-roi.height/2+1)+(j-roi.width/2+1)*(j-roi.width/2+1);
  }
}

when you roi.height is a double value (int)roi.height is not equal roi.height then in loop pixels outside are scanned. Loop should be something like this: y=Mat::zeros(static_cast<int>(roi.height),static_cast<int>(roi.width),CV_64F);this:

 y=Mat::zeros(static_cast<int>(roi.height),static_cast<int>(roi.width),CV_64F);

 for(unsigned i=0;i<y.height;i++){
   for(unsigned j=0;j<y.width;j++){

About issue now I cannot find it https://github.com/opencv/opencv_contrib/issues. If you don't report it you can do it

Yes I think it's a bug :

line

 // create gaussian response
y=Mat::zeros((int)roi.height,(int)roi.width,CV_64F);
for(unsigned i=0;i<roi.height;i++){
  for(unsigned j=0;j<roi.width;j++){
    y.at<double>(i,j)=(i-roi.height/2+1)*(i-roi.height/2+1)+(j-roi.width/2+1)*(j-roi.width/2+1);
  }
}

when you roi.height is a double value (int)roi.height is not equal roi.height then in loop pixels outside are scanned. Loop should be something like this:

 y=Mat::zeros(static_cast<int>(roi.height),static_cast<int>(roi.width),CV_64F);

 for(unsigned i=0;i<y.height;i++){
i=0;i<y.rows;i++){
   for(unsigned j=0;j<y.width;j++){
j=0;j<y.cols;j++){

About issue now I cannot find it https://github.com/opencv/opencv_contrib/issues. If you don't report it you can do it