Due: Saturday, March 6, 2010 (before sunrise Sunday).
Credit (U-grad): Approximately 7 points (Relative, and very rough absolute weighting)
Credit (Grad): Approximately 7 points (Relative, and very rough absolute weighting)
It is probably a bit easier in Matlab, but doing some of the assignments in C may prove to be a useful exercise. If you think that vision research or programming may be in your future, you might want to consider doing some of the assignments in C/C++. If you are stretched for time, and like Matlab, you may want to stick to Matlab. Your choice!
Information for those working in C/C++.
This assignment has three parts, two of which are required for undergrads.
To simplify things, you should hard code the file names in the version of your program that you give to the TA. This request might be superseded by information provided by the TA on the list serve.
Below you will find images of a synthetic Lambertian surface imaged under seven different known lights that are provided. The goal is to determine the surface normals at each pixel, and then from that, a depth map for the surface.
/cs/www/classes/cs477/spring10/ua_cs_only/assignments/4-1.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/4-2.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/4-3.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/4-4.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/4-5.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/4-6.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/4-7.tiff(smaller versions in case the above are too slow in Matlab)
/cs/www/classes/cs477/spring10/ua_cs_only/assignments/small/4-1.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/small/4-2.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/small/4-3.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/small/4-4.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/small/4-5.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/small/4-6.tiff /cs/www/classes/cs477/spring10/ua_cs_only/assignments/small/4-7.tiffare seven images taken of a Lambertian surface with the light at seven different directions. Those directions are (in order):
0.44721360 0.00000000 0.89442719 0.27872325 0.34950790 0.89451528 -0.09788109 0.42884510 0.89805967 -0.37613011 0.18113471 0.90868936 -0.35093186 -0.16899988 0.92102436 -0.09599213 -0.42056900 0.90216807 0.26886278 -0.33714326 0.90224566You can assume that the projection is orthographic, with the z axis being normal to the image plane. You may recall that this means that the point (x,y,z) is simply projected to (x,z,0). If we ignore issues of rotation and units, this is like an aerial photograph where the points are far enough away that the relief does not matter.
A possible point of confusion regarding data formats is that images are typically indexed by row (increases in the direction that you normally think of as negative Y), and column, (increases in the direction that you normally think of as positive X). It is best to keep this convention for this assignment. If you use a different one, such as using X as the horizontal axis, you will get a different solution that is more difficult to interpret.
Now the meat:
Use photometric stereo to compute the surface normals at each point of the image. Notice that the surface has different albedo in the four quadrants. The normals that you compute must be independent of this. Demonstrate that you have good values for the normals by creating an image of the surface as if it had uniform albedo, and though it was illuminated by a light in the direction of the camera (i.e., in direction (0, 0, 1). You can assume that the albedo/light combination is such that a surface that is perpendicular to the camera direction (i.e., the normal is in the direction (0, 0, 1) has pixel value (250, 250, 250).
Submit code to produce this image, and the image.
For those working in C: I have provided a simple 3D plotting routine. Unfortunately, it is a bit crude, but it is sufficient for this assignment.
Submit code to produce this plot, and the plot in an image file (a screen shot is OK).