opencv - Understanding Snake -


i trying make snake active contour program , been looking @ different websites shows how programmed snake none of them explain cv_value or coefficient usage , how initialized it.

here code working on not know problem is.

void snake(mat copy){   threshold(copy, copy, 170, 255, cv_thresh_binary);   float alpha = 0.1; //continuity snake   float beta = 0.5;  //curvature snake   float gamma = 0.4; //movement snake    //have odd   cvsize size;   size.width = 5;    size.height = 5;    cvtermcriteria criteria;   criteria.type = cv_termcrit_iter;   criteria.max_iter = 10000;   criteria.epsilon = 0.1;    int cpt = 40;    cvpoint pointsarray[5];   pointsarray[0].x = 0;   pointsarray[0].y = 95;   pointsarray[1].x = 5;   pointsarray[1].y = 95;   pointsarray[2].x = 10;   pointsarray[2].y = 95;   pointsarray[3].x = 15;   pointsarray[3].y = 95;   pointsarray[4].x = 20;   pointsarray[4].y = 95;    //the code (image, points, length, alpha (consistency), beta (curve), gamma (movement), coefficient usage, win, criteria, calcgradient)   cvsnakeimage(copy, pointsarray, cpt, &alpha, &beta, &gamma, cv_value, size,criteria, 0);  } 

  • cv_value indicates each of alpha, beta, gamma pointer single value used points;

  • cv_array indicates each of alpha, beta, gamma pointer array of coefficients different points of snake. arrays must have size equal contour size.


Comments

Popular posts from this blog

python - How to create jsonb index using GIN on SQLAlchemy? -

PHP DOM loadHTML() method unusual warning -

c# - TransactionScope not rolling back although no complete() is called -