Image processing for measuring physical parameters