U2 Follow multiple centroids part question

I am confused about Additonal step(Follow Multiple centroids ). When i execute the follow_line_step_multiple.py , i expect to see green point in each blob as the centroid, shown in tutorial. But not, i only see one red dot, and the screen log output 19 centroids and the coordinate of each. All of the coordinates are zero x component and around 315 for y component, but the row_to_watch var is 20, i am crazy.

so i am sorry for poor english, i summary my question as follow:

  1. No green dot, only one red dot
  2. 19 centroids represent one point closely, and exceed the res image range.

I think maybe some bug in cv2.findContours function, but not sure. Please help, thanks.

Yeah, after testing, It seems that contours has changed and now it doesn’t support this feature as before. We will see into this to see how we can come with an alternative.

This means the code used here is same as before right? Even I when I checked this code with about selecting the right path, that is to make robot to move only on loop. Instead of moving on the loop it moves in a inner circle with offset to the some loop. I am quite confused about how we are able to track multiple colors. So, to understand this concept is there any other way to do the same? That is regarding " when robot is encountered with multiple lines"

Hello,

regarding this problem, I think the code in the text is wrong.

wrong):
contours, _, ___ = cv2.findContours(mask, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_TC89_L1)

right):
_,contours, ___ = cv2.findContours(mask, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_TC89_L1)