Homework Assignment for CMSC 426: Bayes' Rule, Geometric Transforms, and Optical Flow - Pr, Assignments of Computer Science

The instructions for homework 6 in the computer science course cmsc 426, due on may 4, 2005. The homework covers topics such as bayes' rule for animal classification, geometric transforms for image processing, and the lukas-kanade optical flow algorithm. Students are required to explain the use of bayes' rule for weight-based animal classification, develop programs for rotation, change of scale, and affine transforms with brightness interpolation, and implement the lukas-kanade optical flow algorithm.

Typology: Assignments

Pre 2010

Uploaded on 02/13/2009

koofers-user-lgb
koofers-user-lgb 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMSC 426 Homework 6 Due May 4 Spring 05
1. (25 points) Suppose we are trying to distinguish cats from dogs and the only
measurement we have is the weight of the animal. Let the prior probabilities
for the animal being a cat or a dog be P(CAT) = 0.3, P(DOG) = 0.7
and let the class conditional density functions for (integer-valued) weight
given class be uniformly distributed as follows:
–P(Weight|CAT) is uniform on [20, 39]
–P(Weight|DOG) is uniform on [30,59].
Explain how Bayes’ rule can be used to classify an unknown animal having
weight 35 pounds given the prior and conditional probabilities defined above.
2. (60 points) A geometric transform is a vector function T that maps the pixel
(x, y) to a new position (x0, y0). T is defined by its two components
x0 = Tx(x, y) y0 = Ty(x, y)
Geometric transformations of images are usually implemented in two steps.
First for a point (x0, y0) we find from the inverse transform T1 the
corresponding point (x, y). Second, since x and y are not integers, we need to
estimate the brightness value at (x, y) by interpolation (from neighboring
integer points).
Explain why you think the transforms are implemented in this way.
Develop programs for the following geometric transforms:
(a) Rotation
(b) Change of scale
(c) Affine transform calculated from three pairs of corresponding points.
Recall an affine transform is defined as
x0 = a0 + a1x + a2y y0 = b0 + b1x + b2y
For each of the above transforms, implement the following two brightness
interpolation approaches:
• Nearest-neighbor interpolation
• Bi-linear interpolation (from four neighboring points).
Run your algorithms on a picture of your choice. Print the code. Print your
results for
(a) Scaling by a factor 3
(b) An affine transform with points A = (1, 0),B = (1, 0),C = (0,p3)
mapping to points A0 =(1.9, 0),B0 = (0.5, 0),C0 = (0, 1) using bi-linear
interpolation.
pf2

Partial preview of the text

Download Homework Assignment for CMSC 426: Bayes' Rule, Geometric Transforms, and Optical Flow - Pr and more Assignments Computer Science in PDF only on Docsity!

CMSC 426 Homework 6 Due May 4 Spring 05

  1. (25 points) Suppose we are trying to distinguish cats from dogs and the only measurement we have is the weight of the animal. Let the prior probabilities for the animal being a cat or a dog be P(CAT) = 0.3, P(DOG) = 0. and let the class conditional density functions for (integer-valued) weight given class be uniformly distributed as follows: –P(Weight|CAT) is uniform on [20, 39] –P(Weight|DOG) is uniform on [30,59].

Explain how Bayes’ rule can be used to classify an unknown animal having weight 35 pounds given the prior and conditional probabilities defined above.

  1. (60 points) A geometric transform is a vector function T that maps the pixel (x, y) to a new position (x0, y0). T is defined by its two components

x0 = T x (x, y) y0 = T y (x, y)

Geometric transformations of images are usually implemented in two steps. First for a point (x0, y0) we find from the inverse transform T −^1 the corresponding point (x, y). Second, since x and y are not integers, we need to estimate the brightness value at (x, y) by interpolation (from neighboring integer points).

Explain why you think the transforms are implemented in this way.

Develop programs for the following geometric transforms: (a) Rotation (b) Change of scale (c) Affine transform calculated from three pairs of corresponding points. Recall an affine transform is defined as x 0 = a 0 + a 1 x + a 2 y y 0 = b 0 + b 1 x + b 2 y For each of the above transforms, implement the following two brightness interpolation approaches:

  • Nearest-neighbor interpolation
  • Bi-linear interpolation (from four neighboring points).

Run your algorithms on a picture of your choice. Print the code. Print your results for (a) Scaling by a factor 3 (b) An affine transform with points A = (1, 0),B = (−1, 0),C = (0,p3) mapping to points A0 =(1.9, 0),B0 = (−0.5, 0),C0 = (0, 1) using bi-linear interpolation.

  1. (65 points) Implement the Lukas-Kanade optical flow algorithm using the implementation described in class. The two images are posted online. Compute the normal flow using the following steps: a. The images are filtered with a spatial- Gaussian filter, with standard deviation _ = 1.5 and kernel size 11×11. b. The spatial derivatives are computed using the 5- point symmetric kernel (−1, 8, 0,−8, 1)/ c. Estimation of the normal flow at points with high spatial gradient (experiment with the threshold) d. Estimate the optical flow from the normal flow values with weighted least squares minimization. (solve using the SVD) Print your code. Plot the estimated normal flow and optical flow field. (Explore how you plot flow vectors in matlab)