GEDIHelper.exe -poly [image.tif(bmp,jpg)] –txt [output.txt] –img [output.tif(bmp,jpg)] -filter int

GEDIHelper will extract all connected component from image.tif and find the optimum (not necessarily convex) polygon that warp the connected component inside. 

–img is optional and mainly for debug purpose. The extracted polygons will be rendered to output.tif if “-img” is present and the program will run slow. 
So it’s recommended not to call –img unless the computed polygons are wrong.

-txt defines the text file which has all the extracted polygons. The format of output.txt is:
N1 x11 y11 x12 y12     <- define the upper left and bottom right corner of the box bounding the polygon inside
Followed by N1 lines of x and y coordinates describing polygon 1
N2 x21 y21 x22 y22
Followed by N2 lines of x and y coordinates describing polygon 2
....
-1
The file ends when Nx=-1.

-filter is optional which defines the least area of the box we compute for box and polygon, for example "-filter 5" will ignore all connected components with the bounding box 
1x1,1x2,1x3,1x4,2x2, by default filter  area is set to 5 

Normally the program will finish in 1 second (without –img). But in some rare case (for example the picture has a big table or grid) it might take up to 10 seconds. 
If the input image is not binary image, it will be binarized automatically the threshold 128. All connected component with <5 pixels are ignored. 


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

GEDIHelper.exe -box [image.tif(bmp,jpg)]  -filter int

-box works similar to -poly, but instead of computing polygons, it generates only the bounding boxes of the connected components. 
The format of output.txt is the same but with N==0 and no polygon coordinates.  -filter works the same and the file also ends with -1. 
Run testbox.bat and see output.txt for example.
Changed on Jan 29/2008: GEDIHelper will dump all boxes to STDOUT instead of the file defined by -txt

Let me know if you have any problem running the program.

By the way, if you don’t have MS Visual Studio 2005 (not 2003) installed, you need to run vcredist_x86.exe first as a local administrator. 
Otherwise GEDIHelper.exe cannot run without the corresponding dlls. 

liuxu@mobileama.com





