omnister/fax
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
the program fax.c reads in a jpeg color photo of a line drawing and prints it out as a full contrast black and white drawing. This is useful for using a cell phone or web camera to capture a hand drawn schematic or block diagram. Most fax machines had a similar algorithm to suppress coffee stains, shadows or paper crinkles, hence the name "fax". The algorithm is a 2d baseline tracker with a comparator. The program reads an image <file>.jpg, blurs it with a fast X,Y boxcar convolution, offsets the blurred image by a constant pixel value to product a clipping threshold, and then compares the original image against the threshold, outputting black or white appropriately. The output is written to <file>.pgm If given the -g option, <file>.pgm is converted to <file>.gif using the pamtogif utility. The algorithm does a great job of ignoring shadows and lighting irreguluarities, paper wrinkles, stains and smudges and works well for converting hand drawings or photos into line work. You'll find a fast blurring algorithm in the code that convolves a boxcar in the x-direction, and then in the y-direction handling wrap around and edge effects appropriately.