Determination of the πNN vertex function from np and pp charge exchange scattering