Final Report

1. Discuss performance of your program

In my program I first thresholded the original image to help reduce the noise. I then calculated the dot products of two vectors. I chose at random which direction each vector would face. But only two vectors were calculated for each 3D point. The normal vectors came from taking the cross product of the two vectors just described.

I then calculated the occurence of each normal vector. Then to map the pixel value from one of the five regions to the image being displayed I used this equation; Nx( x + px ) + Ny( y + py ) + Nz( z + pz ) = 0; where N is the normal vector, p corresponds to the point on the plane perpendicular to N, and x,y,z are coordinates of the image.

If the equation equals zero then those points( x,y,z ) are on one of the five regions.

2. Suggest improvements for better performance

I used many for loops in my program. I could have used separable windows to make my computions faster.

I also may have wrote to many functions. Less function calls also would have sped things up a bit. However, these extra functions were needed, and probably a few more could have been added to help keep a grasp of what was going on. Even with the extra overheads I still had trouble grasping this particuliar assignment.

3. Explanation of algorithms( functions )

The computeCrossProduct function computes the cross product of two vectors. The computeNormals function computes the normal vector by taking the cross product of two vectors. It also gets a set of points on the plane perpendicular to the normal vector. The putIntoSimiliarBin function puts similiar normal vectors together with possible repeats of the same normal vector. The getMoreFrequentOccurence calculates how many similiar normal vectors there are within the bin. The getMinMax function gets five levels of the most frequently occurring normal vectors and assigns each as region one through five. The compareZeroVector function sees if coordinates are perpendicular to a plane and returns 1( true ) if the points ly on the plane. The setUpPicture function gives the corresponding pixel value to the image if points are on the plane are perpendicular to the normal vector. And the number1 function controls the sequence of calling the previously mentioned functions.

4. Explanation of results

My program has trouble distinguishing between regions one through five as my output images shall show. Each region seems to overlap other regions which are not of the same plane. Regions 1, 3, 4, and 5 do not distinguish each corresponding plane adequately enough while region 2 shows almost all of the five seperate planes together. All in all my program has trouble detecting normal planes.