Please finish it with detail matlab code.

2. Task 2 (15′): Write a function to generate a piece-wise linear mapping transform to enhance the contrast of im_Idr, verify the effectiveness of the designed function in the following terms: (1) subjectively, and (2) objectively by checking the histogram of the enhanced image with respect to the histogram of the reference image, and (3) evaluating the PSNR with respect to the reference image. Include also in your report the intensity
PayPal Gateway not configured
PayPal Gateway not configured