Glare removal as an ill-conditioned problem