A Robust Method for Characterization of Optical Waveguides and Couplers