12.07.2015 Views

CIS 4720 Key to Sample Midterm 1 I The gray level ... - Heppenstall.ca

CIS 4720 Key to Sample Midterm 1 I The gray level ... - Heppenstall.ca

CIS 4720 Key to Sample Midterm 1 I The gray level ... - Heppenstall.ca

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>CIS</strong> <strong>4720</strong> <strong>Key</strong> <strong>to</strong> <strong>Sample</strong> <strong>Midterm</strong> 1I<strong>The</strong> <strong>gray</strong> <strong>level</strong> mapping is a function m from in<strong>to</strong> such that: u, m(u)=au+b.a is the gain and b is the bias.(b) a > 1 and b < 0. Better contrast. A bit brighter.(c) 0 < a < 1 and b > 0. Less contrast. Brighter.(d) a 1 and b > 0. Same contrast. Brighter.(e) a 1 and b > 0. Same contrast. Brighter.This seems <strong>to</strong> be the his<strong>to</strong>gram of the negative image.(f) a = 0 and b > 0. No contrast. All pixels have the same <strong>gray</strong> <strong>level</strong>.II(x,y), [h*(af 1 +bf 2 )](x,y) = i j h(i,j) (af 1 +bf 2 )(xi,yj)= i j h(i,j) [af 1 (xi,yj)+bf 2 (xi,yj)]= i j [ah(i,j)f 1 (xi,yj)+bh(i,j)f 2 (xi,yj)]= a i j h(i,j)f 1 (xi,yj) + b i j h(i,j)f 2 (xi,yj)= a(h*f)(x,y) + b(h*f)(x,y)<strong>The</strong>refore: h*(af 1 +bf 2 ) = a(h*f 1 ) + b(h*f 2 )IIIAssume MN is the size of f and L is the number of possible <strong>gray</strong> <strong>level</strong> values. <strong>The</strong> his<strong>to</strong>gram off is the function H f from 0..L1 in<strong>to</strong> 0..MN such that for any u in 0..L1, the value H f (u) is the<strong>ca</strong>rdinal of the set {(x,y)(0..M1)(0..N1) | f(x,y)=u}. In other words, H f (u) is the number ofpixels whose <strong>gray</strong> <strong>level</strong> is u. See your class notes for the definition of the other his<strong>to</strong>grams. <strong>The</strong>principle of his<strong>to</strong>gram equalization is <strong>to</strong> find a <strong>gray</strong> <strong>level</strong> mapping that yields an “optimal”improvement in contrast. Ideally, the his<strong>to</strong>gram of the image after his<strong>to</strong>gram equalization is flat.Note that the improvement is optimal statisti<strong>ca</strong>lly, not necessarily perceptually.


IVA B A OP B255 (true) 255 (true) 255 (true)255 (true) 0 (false) 255 (true)0 (false) 255 (true) 0 (false)0 (false) 0 (false) 255 (true)A OP B A BA OP B A¬BA OP B ¬(¬AB)Let a be the logi<strong>ca</strong>l value of proposition A and b the logi<strong>ca</strong>l value of proposition B. We saw inclass that we <strong>ca</strong>n assign <strong>to</strong> ¬A the value 255a and we <strong>ca</strong>n assign <strong>to</strong> AB the value max(a,b), ormin(a+b,255), or a+bab/255, etc. <strong>The</strong>refore, we <strong>ca</strong>n assign <strong>to</strong> A¬B, i.e., A OP B, the valuemax(a,255b), or min(a+(255b),255), or a+(255b)a(255b)/255, etc. Two examples offunctions that <strong>ca</strong>n be used <strong>to</strong> implement OP are:Note that fg. For example, f(100,100)=155 and f(100,100)=255.f | (a,b) max(a,255b)g | (a,b) min(a+(255b),255)V2 1 1 1 1 1 1 22 1 1 1 1 22 1 1 2S2 1 1 1 1 22 2 1 1 1 2 23 2 1 1 1 1 1 2 2 3VI1/ Yes. Example: (e3,d3,c3,c4,c5,d5,d4,c4,c5,d5,e5).2/ No. <strong>The</strong> length of a 4-path from e3 <strong>to</strong> e5 is necessarily even.3/ Yes. Example: (e3,d3,c3,c4,c5,d5,c4,d4,c5,d5,e5).4/ Yes. Example: (e3,d3,d4,e5,d4,e5, …, d4,e5), where “d4,e5,” is repeated 1000 times.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!