Proximity Operator of the Matrix Perspective Function and its Applications