Speckle contrast at deviations from best focus in microfluidic and in vivo