a very simple method that still finds most of the bubbles:
- threshold the image
- find contours in threshold image
- filter out all contours that are too small and draw all others filled
- erode that mask until the vertical lines have disappeared
- count the new number of blobs/contours and dilate if you need the original size
steps look like these:
- thresholded (50)

- contours (all)

- contours (filtered mask)

- eroded mask

- dilated mask and overlay

as you can see it is very simple and finds most of the bubbles. If you dont know how often you have to erode, you can detect the vertical lines with HoughLines first.