Working code for services for calibration and distortion matrix and saving image