Machine Vision - Detecting circles (OpenCV)

I did think along those lines (get it? :stuck_out_tongue: ), but as i see it there are two problems with this approach:

  1. The open end of the the tube is not necessarily a straight line because of the lens distortion (if you see the picture you can see that it is slightly curved. Could be a problem, but perhaps not.

  2. The separation issue that you mentioned, is not easy to solve. There could easily be two tubes that lie close together, with the open ends pressed together, effectively hiding the line. However it is not geometrically possible for two tubes to hide the curved bottomline, since two tubes will only be touching on a very small part of the curve. This is why i am so keen on the circle detection, because it solves the two above mentioned problems very easily.