------------------------------------------------------------------------------- Distort v1.0 Documentation written by Francois Fleuret Contact for comments & bug reports Check http://www.eleves.ens.fr:8080/home/fleuret for latest version ------------------------------------------------------------------------------- Distort is a small program which performs image distortions using a file of coordinates that defines a distorted gride. I wrote it to correct the distortions of the QuickCam. The syntax is the following : ./distort The gride file contains first a couple of integers wich are the number of intersections per line, and the number of lines, and then the list of the couples of coordinates of each intersection of the gride. The distort program will load the gride file, the source_pic file and will build a new picture so that the point of the original picture whose location is the location of the k-th intersection of the n-th line of the gride will be in the result picture at the location ((k-1)*block_size, (n-1)*block_size). The locations of the other points, those whose coordinates are not directly given in the gride file, will be afinely interpolated. The result picture is smoothed with an anti-aliasing algorithm : the gray level of a point in the result picture is a center of mass of the gray levels of four pixels in the original pictures. The weights depending on the distance to the four points. You can use this program with any gride file. I made one for the QuickCam, wich is called quickcam.grd. The pictures file MUST BE IN PGM OR PPM FORMAT. I'm sorry for this point, but I didn't develop new pictures loading/saving routines and the only ones I had can only do that. I wrote this program in few hours, so it's VERY dirty, the source is horrible, disgusting, berk berk berk. Please don't judge me on this program ;) Francois FLEURET