## S-114.204 Modelling of Perception | |

The second half of the home work consists of building a system that can infer the 3-dimensional structure of a wire frame model from 2-dimensional view, in a simple case. The scene S is a list of 3D positions of the nodes, and observation I is a list of the node position in the 2D image plane.

The following examples are from a matlab script, that contains base routines for the work. See download instructions below.

Example of 2D view | Example of Maximum Likelihood fit of the 3D positions. The blue structure produces exactly the observed image. The view direction is from the upper right corner closer to the observer. There are infinite number of solutions S that give the observed image I. |

Examples of Maximum a Posteriori (MAP) fits, with prior that favours large angles, and thus round objects. There are (at least) three local maxima in the posterior. The first two produce the well known Necker cube ambiquity, while the third is a bit less probable distorted solution. |

- Implement the MAP (Maximum A Posteriori) estimator for the 3D structure S given
the 2D image I

`S* = arg max P(S|I)`

Hint: minimize the negative logarithm of the posterior probability. For minimization you can use routines fminu (matlab version 5) or fminunc (matlab version 6). There is no need to compute the error gradient in closed form, as in this low-dimensional problem numerical gradient is fast enough. - In the demo-script the prior favours large angles. Implement this prior, and some other self-designed prior that should work with the cube and other structures. Explain the functioning of your own prior.
- In the demo-script the system is tested with a cube, to produce the ambiguous interpretation known as Necker cube illusion. Repeat this experiment.
- Implement simple stereo vision system and test it with Maximum Likelihood and
MAP estimators.

Observe the object from two slightly different angles, and fit the structure S to both images Ileft and Iright

`S* = arg max P(S| Ileft, Iright)` - In the file necker_demo.m there are is another shape, a hexagonal cylinder.
Test your estimator also with this structure.

Directory http://www.lce.hut.fi/teaching/S-114.204/matlab/ contains basic routines needed in the work. The zip-file necker_demo.zip contains all the files.

The demo script necker_demo.m contains
ready to use code for computing the projection matrix from 3D to 2D (using
orthographic or perspective projection), and to compute the angles of the structure.
After unziping the zip-file, run the demo with command (in matlab version 5 or 6)

** >> necker_demo **

Short report must be delivered, containing explanation of the used methods, chosen priors, description of the test results and conclusions.

Also a matlab script that produces the requested results should be delivered. If some minimization tends to take long time (more than some seconds), the code can load a precomputed result, but the original computation code must be available (eg. in comments).

The report and matlab-codes can be delivered either by

- packing all the stuff in a zip-file and sending it to the instructor jouko.lampinen@hut.fi
- constructing a web-page, where the codes and report can be downloaded and sending the pointer of the page by mail.

** Deadline: 31.5.2005 **

The page is maintained by Jouko.Lampinen@hut.fi

Last updated 29.4.2005