Calculating the volume of elongated bubbles and droplets in microchannels from a top view image