Spring 2015 Final Exam Sample Matlab program 5

advertisement
Sample 5
Digital negative can be obtained by reverse scaling of the gray levels according to the transformation
𝑣 = 𝐿 − 𝑢,
𝐿 = 255 𝑓𝑜𝑟 8 𝑏𝑖𝑡 𝑖𝑚𝑎𝑔𝑒
𝑢 𝑖𝑠 𝑖𝑛𝑝𝑢𝑡 𝑖𝑛𝑡𝑒𝑛𝑠𝑖𝑡𝑦 𝑙𝑒𝑣𝑒𝑙
𝑣 𝑖𝑠 𝑜𝑢𝑡𝑝𝑢𝑡 𝑖𝑛𝑡𝑒𝑛𝑠𝑖𝑡𝑦 𝑙𝑒𝑣𝑒𝑙
Segmentation of certain gray levels from rest of the image is achieved by Intensity level slicing
transformations.
1. Read a N×N gray scale image.
2. Perform digital negative transformation and show the negative image.
3. Prompt user to enter lower and higher values of pixel intensity level and perform intensity level
slicing
a. without background
b. with background
4. Compress the dynamic range via logarithmic transformation
𝑣 = 𝑐 𝑙𝑜𝑔10 (1 + |𝑢|)
Where 𝑐 is scaling constant, 𝑢 is input intensity level, 𝑣 is output intensity level.
5. Given a 3×3 averaging mask. Apply this mask directly to the input image (Do not use filter2
function) and show filtered image.
Download