EE368/CS232 Digial Image Processing Winer 207-208 Lecure Review and Quizzes (Due: Wednesday, January 7, :30pm) Please review wha you have learned in class and hen complee he online quiz quesions for he following secions on OpenEdX : Poin Operaions Hisograms Homework # Released: Monday, January 8 Due: Wednesday, January 7, :30pm. Displaying High Dynamic Range Images (Toal of 9 poins) (a) Assume we have he imaging sysem shown above. A high dynamic range (HDR) camera akes a picure of he scene wih a conras raio of 000:. The γ-predisorion circui inside he camera is se o use γ = 3.0. The acquired picure is shown on an image display (e.g., CRT or LCD) wih γ = 2.0. Wha is he conras raio of he image display required o accommodae he full dynamic range of he scene, wihou sauraion in boh he dark and brigh porions of he image? (3 poins) (b) On he handous webpage, you can find wo HDR images hw_memorial.hdr and hw_arium.hdr. Read each color image ino MATLAB using funcion hdrread (if you have rouble using hdrread, we also provide he daa in hw_memorial.ma and hw_arium.ma, which you can read using funcion load). Conver o a grayscale image using funcion rgb2gray. Show he grayscale image using funcion imshow, submi he displayed image, and commen on which deails in he image are easy/difficul o see. (2 poins) hps://suclass.sanford.edu/courses/course-v:engineering+ee368+winer208
(c) Apply a γ-nonlineariy mapping o each grayscale HDR image from par (b) o reduce is dynamic range, show he new image, and submi he displayed image. For each image, find and repor a value of γ ha allows you o see nearly all he deails. (2 poins) (d) Repea par (c), bu now apply γ-nonlineariy mappings o each of he red, green, and blue color componens. Firs, use he same value of γ for all color componens. Then, experimen wih differen values of γ for each of he color componens. Wha is he effec of using differen values of γ for each color componen compared o using he same value of γ for all color componens? You may submi images o faciliae your explanaion. (2 poins) Noe: Please include relevan MATLAB code. 2
2. Denoising for Asrophoography (Toal of 8 poins) Amaeur asrophoographers ofen se up saic cameras poined oward paricular regions of he nigh sky and record for an exended period of ime. On he handous webpage, you can find wo videos hw_sky_.avi and hw_sky_2.avi, which conain wo recordings of he nigh sky each lasing a few minues. Low ligh levels cause he video frames o be noiceably noisy. (a) To generae a single denoised image from each video, compue a running average of he frames f ( =,2,...) in he video wihou frame alignmen, according o he following updae rule: = f = + f = 2,3, To access he video frames in MATLAB, he following code can be used: vidobj = VideoReader( video.avi ); numframes = ge(vidobj, NumberOfFrames ); for i = : numframes frame = im2double(read(vidobj, i)); end % i Display and submi faverage a = 30 for each video. Commen on how effecively he noise is reduced and how much he sharp feaures are blurred by he averaging operaion. (4 poins) (b) Now, compue a running average of he frames wih frame alignmen, according o he following updae rule: = f = + Align ( f, ) 3 = 2,3,
Here, Align( f,g) aligns frames f and g by minimizing he mean squared difference over a se of horizonal and verical shifs. The following MATLAB code shows an example of how o horizonally and verically shif a frame: dx = ; % pixels dy = -; % pixels A = [ 0 dx; 0 dy; 0 0 ]; form = makeform( affine, A. ); [heigh, widh, channels] = size(frame); frametform = imransform(frame, form, bilinear,... XDaa, [ widh], YDaa, [ heigh],... FillValues, zeros(channels, )); Display and submi a = 30 for each video. Compare o he resul in (a) and commen on how effecively noise is reduced while sharp feaures are beer preserved. (4 poins) Noe: Please include relevan MATLAB code. 4
3. Image Subracion for Tampering Deecion (Toal of 8 poins) Images of painings are someimes ampered o inroduce suble and plausible aleraions. Please download he following images from he handous webpage: hw_paining reference.jpg: reference image of he original paining Irises hw_paining ampered.jpg: ampered image of Irises wih local modificaions hw_paining_2_reference.jpg: reference image of he original paining Sarry Nigh hw_paining_2_ampered.jpg: ampered image of Sarry Nigh wih local modificaions Reference Image Tampered Image Reference Image Tampered Image Deec he ampered regions for each paining by subracing he ampered image from he reference image. Image alignmen may be required prior o subracion. For each paining, submi a binary image where he ampered regions are marked by whie pixels and he nonampered regions are marked by black pixels. (8 poins) Noe: Please include relevan MATLAB code. 5
4. Nighime Road Conras Enhancemen (Toal of 8 poins) The visibiliy of lane markings, road signs, and obsacles on he roads is significanly reduced a nighime. To assis drivers in dark condiions, we can perform conras enhancemen on images capured by he car s fron-facing camera and display he enhanced images o he driver. On he handous webpage, you can find hree images capured a differen imes on differen roads: hw_dark_road_.jpg, hw_dark_road_2.jpg, and hw_dark_road_3.jpg. For each image, please perform he following operaions and submi he required resuls. (a) Plo and submi he hisogram (MATLAB funcion: imhis) of he original image s grayscale values. Briefly commen on he shape of each hisogram. (2 poins) (b) Apply global hisogram equalizaion o he original image (MATLAB funcion: hiseq). Display and submi he modified image. Plo and submi he hisogram of he modified image s grayscale values. Commen on visually desirable/undesirable regions in he modified image. (3 poins) (c) Apply locally adapive hisogram equalizaion o he original image (MATLAB funcion: adaphiseq). Display and submi he modified image. Plo and submi he hisogram of he modified image s grayscale values. Choose and repor he number of iles and he clipping limi for aaining higher conras while avoiding he generaion of noisy regions and he amplificaion of nonuniform lighing effecs. Commen on he subjecive qualiy of he modified image compared o he resul in (b). (3 poins) Noe: Please include relevan MATLAB code. 6