Press here to go back 

Computational Neuroscience 0368.3013.01

given by Prof. H. Yeshurun

Exercise #2 - Final Project.
Do you have more questions ? try FAQs.

Project definition:
Your task is to construct a system for artificial vision, for the detection of simple objects.
Your system should be a rough approximation of V1. It means that the images are processed by a set of oriented edge detectors of various sizes and orientation, and their output is used for further calculations. Stereo estimation could be carried out by the algorithms we have presented, as well as by straight forward correlation.
The input will be two series of pictures (left and right eye / camera). Each picture may contain rectangles, triangles and circles. Each one of the object may move on every axis: x  (horizontal) y (vertical) and z (depth). Object may also rotate around its center. The movement of an object may be a combination of the above. An object first appears either by moving into the frame boundaries (xy movement)  or from 'infinity' depth (disparity = 0): appearing as a pixel which gradually grows.  In every frame only one new object may appear. In each picture there will be no more than 7 object. Each series will contain a maximum of 30 objects. Objects never overlap.
An object does not move faster than 30 pixels/frame on x axis and y axis, and rotates no faster than 15 degrees/frame.  The disparity of an object may range between 0 and 10. The disparity change from a (left/right) pair of picture to the following pair will be not greater than 2 pixels/frame.
The output file should contain a list of the objects, sorted by time of first appearance. For every objects the following details are needed:

For exact format of input and output files, please see

The language of your implementation may be Matlab, ANSI  C and ANSI  C++ . For other platforms, please ask.
The project should be compiled, linked and executed under libra. It should be compatible with the g++ compiler.
If you are using Matlab at home, make sure you have the 'images' toolbox, and preferably use version 5.0 or higher. This will make your life much easier. If you are editing your matlab file using emacs editor you may want to use the "matlab.el" file (at ) which colors your code and adds some features to your editor.
Procedural issues:

Files an permissions: Files in your ~/cns00b/ directory:
1.  The MATLAB source files or the C / C++ source files, including the header files.
2. A makefile (Relevant only if you right using C / C++). makefile is a standard descriptive file for the project. Once written, the UNIX command line 'make' should compile and link the project and leave the output executable file in the same directory. To enable this, the name of the makefile should be 'makefile'. Please refer to the UNIX manual for a detailed description of the makefile. A sample a makefile may be found in
The result of the compilation & linkage should be an executable file named cns.
Make sure to use only relative path names to ensure that the project can be compiled in other directories as well. Through the checking procedure, the entire directory will be copied to the checkers account and will be compiled there. A good idea to check this requirement will be to open a parallel directory in one of the other group members and to try to make (= compile and link) and execute the project there. After the project is done and tested, no object files or executables should be left in the cns00b directory.
3. An id file. The id file is a plain text file. It should include one line per each group member. This line should include the following fields: <login> <id> <full name>. Exactly one white space should separate each two fields. Please see a sample id file in This file will be read by an automatic program and thus should comply exactly with the definitions. It should not include any additional information. Please use plain text editors (NOT word processors) or the UNIX echo command to create this file.
4. An output ASCII - text file named "output.txt"  of your program when run on the example input files in

The documentation should describe the entire project.  It should be clear and built of nicely separated sections. Its length should be no more than 2 two sided pages. The documentation should include the following parts:

  1. Header - including the same information as in the id file.
  2.A list of all the files in the project, and a short description of each one of them.
  3.A general description of the project logic and the application flow.
  4.A list of all the methods and algorithms used, together with a short explanation why they were chosen. The documentation file should NOT include the code itself.
You should submit your documentation to the mailbox of Oded Schwartz (3rd floor, Schriber building).
No printout of your source code is needed.

Input / Output
The MATLAB main file name should be cns.m . If you use C/C++ the executable file name should be cns.
Your program should read it's input from the sub directory "./cns00b/input/".  In this sub directory there will be the image files "Left1.bmp", "Right1.bmp", "Left2.bmp" etc. There will also be a file named "info.txt" containing the number of pairs of images.
One may assume that the input to the program is legal.
Sample input files may be found in
Note: You should check your application with relevant input files, covering as many cases as you can think
of. You may use the given sample files to test your application, but keep in mind that other input files will be used in the final check.

Programming Guidelines
  1. Functionality. Each function should perform one thing. This thing should be the function name. Functions should be short and clear. Any repeated code parts should be concentrated in functions.
  2. Documentation. The code should be clear. Therefore, short comments should appear in various places, such as preceding functions or complicated blocks, when defining variables, etc. If there are assumptions regarding the input / output of the functions, they should appear too.
  3. Naming. A significant part of the documentation resides in the code itself. This should be done by proper name choosing. The names of the variables and functions should imply their role.
  4. No compilation errors or warnings are permitted.
  5. Obviously, no run time errors are acceptable.

Grading Criteria
The grades will be composed of the following parts:
  1. Correctness of the program. The correctness will be checked by an automatic mechanism, and therefore a special care should be taken meeting the exact syntactic requirements.
  2. Documentation. The grade for the documentation will be given for clarity and simplicity.
  3. There is no penalty for the first 3 days of late submission. However, from the 4th day on, you lose 4 points every day.
If you have more questions, please contact me.