Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

your point vec has 6 items, so the largest valid index is 5, and your loop should be:

  for (int i = 0; i < 5; i++)  // 6-1 because of vec[i+1]

your point vec has 6 items, so the largest valid index is 5, and your loop should be:

  for (int i = 0; i < 5; i++)  // 6-1 because of vec[i+1]

also:

 im += img; // this should be removed !

your point vec has 6 items, so the largest valid index is 5, and your loop should be:

  for (int i = 0; i < 5; i++)  // 6-1 because of vec[i+1]

also:

 im += img; // this should be removed !
! (and use imshow("image", img);)