4. Another image technique is known as self-compensating, to manually adjust contrast to bring
out detail in an image. Apply the following steps to the image HipXray.png to perform a self-
compensating image adjustment
a. Stretch the image histogram with the following command
J = imadjust(im, stretchlim(im), []); %stretch histogram and save image to
variable J
b. Perform a negative transform on the histogram stretched image
c. Subtract the negative image from the histogram stretched image with following formula
$I_{Difference} = |A * w_A - B * w_B|$
Where A is the negative image, $w_A > 0$ (default 1) and where B is the histogram
stretched image, $w_B > 0$. $I_{Difference}$ is the absolute value of difference
d. Take a negative transform of the result to produce final image
Create the following figures
a. Original HipXray.png image
b. Self-Compensated image