hw-1 machine leanring

Upload: thuongnhan

Post on 08-Mar-2016

216 views

Category:

Documents


0 download

DESCRIPTION

HW-1 machine leanring

TRANSCRIPT

  • Huy Pham

    ID# 66572899

    HW 1

    3.

    a. a = [5:15]

    creates a vector of size 11 from 5 to 15

    b = [a([1:3:end])

    creates a copy of vector a from index 1 to the last index with step of 3

    b. f = [1501:2000]

    creates a vector of size 500 from 1501 through 2000

    g = find(f > 1850)

    creats a copy of vector f with indices of elements greater than 1850

    h = f(g)

    creats a copy of vector f with only elements of f using g as indices

    c. x = 22.*ones(1,10)

    creates a 1-D vector of size 10 with elements being all 22

    y = sum(x)

    assigns y to be a sum of all elements in vector x

    d. a = [1:100]

    creates a vector of size 100 from 1 through 100

    b = a([end:-1:1])

    creates a copy of vector a from the last index to the first index with step of -1 (b is a reverse

    vector of a)

  • 4. a.

    b.

  • c. t = 0.8

    d. mean = 0.7093

    e. z = reshape(y, [3,2]);

    f. x = min(min(A)); [r, c] = find(A==x,1);

    g. numel(unique(v));

    ans = 5

  • 5.

  • The resulting image is the average of many input images, so each input image is shown (a little)

    in the average image, which results in a blurry image but we can still recognize the shape of the

    objects in the image.

    6.

    The image appears to be darker than the jpg image because demosaicing is a lossy process

    The filter I use is:

    = 0.25 0.5 0.250.5 1 0.5

    0.25 0.5 0.25

    = 0 0.25 0

    0.25 1 0.250 0.25 0

    = 0.25 0.5 0.250.5 1 0.5

    0.25 0.5 0.25

    because it has to guess 2 missing color values for each pixel. Also, the jpg image is brighter

    because it has already been processed with White Balancing (correcting for different colour

    temperatures of light sources while taking the picture) and Gamma Correction (converting from

    the linear values to gamma corrected values).