Technique for accurate measurement of capillary lengths and diameters