SHARE
TWEET

Untitled

a guest Mar 21st, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         for (int i = 0; i < src->rows; i++) {
  2.             for (int j = 0; j < src->cols; j++) {
  3.                 if (src->at<Vec3b>(i, j) == src->at<Vec3b>(y, x)) {
  4.                     nom += (i - rb)*(j - cb);
  5.                     den += (j - cb)*(j - cb) - (i - rb)*(i - rb);
  6.                     if (src->at<Vec3b>(i, j) != src->at<Vec3b>(i - 1, j - 1))   { perimeter++; continue; }
  7.                     if (src->at<Vec3b>(i, j) != src->at<Vec3b>(i - 1, j))       { perimeter++; continue; }
  8.                     if (src->at<Vec3b>(i, j) != src->at<Vec3b>(i - 1, j + 1))   { perimeter++; continue; }
  9.                     if (src->at<Vec3b>(i, j) != src->at<Vec3b>(i, j - 1))       { perimeter++; continue; }
  10.                     if (src->at<Vec3b>(i, j) != src->at<Vec3b>(i, j + 1))       { perimeter++; continue; }
  11.                     if (src->at<Vec3b>(i, j) != src->at<Vec3b>(i + 1, j - 1))   { perimeter++; continue; }
  12.                     if (src->at<Vec3b>(i, j) != src->at<Vec3b>(i + 1, j))       { perimeter++; continue; }
  13.                     if (src->at<Vec3b>(i, j) != src->at<Vec3b>(i + 1, j + 1))   { perimeter++; continue; }
  14.  
  15.                 }
  16.             }
  17.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top