CSC 520
Digital Image Processing

Programming Assignment 03

Programming Instructions:The student will select a programming language of his/her choice. The language selected should be maintained throughout the course. All code will include proper programming structure for the language selected. The code will have copious comments.

Objective: To compute arithmetic operations over a two images. You will implement the following basic arithmetic operations (+, -, *, /) given two imput images and produce the output image. Remember that this is array processing not matrix.

Some operations will cause the image to exceed its display bounds, e.g. an 8-bit grayscale image (0-255) cannot display any pixels above 255 or below 0 or a real value for the pixel. Image scaling after the arithemetic operation may be required to deal with range bounds. You should also convert any real values to integer using the floor function. Your solution should include automatic image intensity scaling to the original range.

Interface: image method/function_name(image img1, image img2, op)

img1 - is input image in pgm format
img2 - is input image in pgm format
op - is one of the four basic arithmetic operations ('+'. '-', '*', '/')

Evaluation: img1 = starP5.pgm, img2 = invStarP2.pgm, go through all four basic operations. Discuss your results in detail. Did any operation produce a result that you were not expecting? How can these basic operations be used for real-world image processing?