revised the perspective normalization function