pixel_map: remove ugly signed cast
perspective_params: fix x dir calculation