Try   HackMD

CMSC 178 Assignment 2

James Casia
Jojemar Janea

2A. Deconvolution using Wiener Filter

Here are the results after running the code

k=0.01

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

k=0.001

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

k=0.0001

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

k=0.00001
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

As you can see, the images was successfully deblurred although it appears to have artifacts and do not look exactly like the original image. We tested with values of k from 0.1 to 0.00001. And it can be observed that as k decreases, the more 'grainier' the resultant image appears.

For the number plates challenge, We tested different values of k.
k = 0.1

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

k = 0.01
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

k = 0.001
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

k = 0.0001
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

We tried iterating from k = 0.1 until k = 0.0001. The smaller k was, the clearer the text, but the image starts to become undesirably grainy.
With k = 0.001, we can clearly see the numbers in the plates. The numbers in the number plates are:
EN 1113, DT 1735
CD 7984, OT 9824
WYG 734, IT 0420

2B. Motion Image Compression

Here are the results after running the code. As you can see, our code was able to exactly get the same outputs as the sample.

Frame 1

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Frame 8

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

These frames were with the default values, Q = 80 and tolerance = 5.0. We were able to attain a total error of 552853 bytes.
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Experimenting with changing the Q values:

Q = 50, tolerance = 5.0
total_error = 382428 bytes
Q = 70, tolerance = 5.0
total_error = 472966 bytes
Q = 80, tolerance = 5.0
total_error = 552853 bytes
Q = 90, tolerance = 5.0
total_error = 708338 bytes

Experimenting with changing the tolerance values:

Q = 80, tolerance = 2.5
total_error = 772194
Q = 80, tolerance = 5.0
total_error = 552853 bytes
Q = 80, tolerance = 10.0
total_error = 472127
Q = 80, tolerance = 20.0
total_error = 409901

Based on the above results, we can see that total error increases when Q is increased. When tolerance is increased, total error decreases.

2C. Written Questions

  1. In terms of the simple linear transformations ‘translation’, ‘isometric’, ‘linear conformal’, ‘affine’ and ‘projective’. Ignoring lens distortion, which transformations best describe the relationships between images in the following situations (you must explain your reasoning for each your answers.):
  • A camera mounted on a telescope looking up at a celestial body (eg. Jupiter). The telescope can tilt up and down and left and right (assume the scene itself is static).
    • Translation. Due to the great distance and great size of the celestial body, the tilting of the telescope causes the image to be translated.
  • B. A series of photographs of a document sitting on a desk taken from different positions throughout the room (just consider the transformation of the document itself, not the rest of the room).
    • Projective. The different positions and angles will cause the image of the paper to shift, rotate, and scale projectively.

Given the matrix transformation of linear-conformal

[RcosθRsinθtxRsinθRcosθty001]
We can simply equate the given matrix representation of the linear transformation and solve for the values.

T=[RcosθRsinθtxRsinθRcosθty001][1.732111011.732120001]=[RcosθRsinθtxRsinθRcosθty001]

We have the system of equations

Rcosθ=1.7321Rsinθ=1Rsinθ=1tx=10ty=20

We immediately get the translation values
To solve

R=1.7321cosθ

Equating that into

Rsinθ=11.7321cosθsinθ=1 1.7321tanθ=1tanθ=11.7321θ=arctan(11.7321)θ=30

We get the value of theta. Then using that value to get R

R=1.7321cosθR=1.7321cos30R=1.73210.8660R=2

Therefore the transformation values are:

tx=10ty=20θ=30R=2

  1. What are the nearest and bilinear estimate for pixel (20.6, 10.2) ?
  • Nearest neighbor = 64 since I(21,10) is the nearest neighbor
  • Bilinear = 80.64
    I(p)=(1a)(1b)I(x,y)+(1a)bI(x,y+1)+a(1b)I(x+1,y)+abI(x+1,y+1)I(p)=(10.6)(10.2)128+(10.6)(0.2)64+0.6(10.2)64+0.60.232I(p)=40.96+5.12+30.72+3.84I(p)=80.64
  1. As we compare spectra 1 and spectra 2, we can see that there is a major stripe in spectra 2. Because of this, we can say that the output of that spectra does not have a uniform background. Among the two outputs, output 2 has no uniform background. Therefore, we can conclude that spectra 2 produces output 2 and filter 1 produces output 1.