This code was iplemented using MATLAB 2010b, thus in case of any errors please check the built-in commands new releases updates. The code assumes that the image dataset has corresponding annotations (groundtruth) in PAGE xml format. The code consists of the following files: 1. ECDP_Main.m: the driver file that calls all ECDP system functions and displays results on workspace 2. ECDP_Make_Reference_Patches.m: a code that segments the input image to overlapping patches and associate each to its corresponding groundtruth label. 3. ECDP_Extract_Features_And_Test.m: a code that extracts features from input patches and introduce them to the trained model and auxiliary functions: 4. Remove_Border_Noise.m: removes the noise on the document image borders 5. Label_Reference_Patches.m: associates patches to their corresponding groundtruth labels. 6. Compute_Vertices.m: parses the ground truth XML and extracts the numeral values of regions bounding boxes. 7. Consult_Neighbors.m: refines the ECDP classification rersults by majority voting of 8-NN of each patch. 8. Build_Zones.m: Creating text zones from the detected text patches. Please don't forget to: ------------------------ 1. Create a folder to all contain the data and change paths in ECDP_Main.m to the location of the folder containing your image data files or to where you wish output files to be saved to. 2. Uncomment any visual check to see the results on a document image 3. Have your groundtruth in PAGE XML format, otherwise use Alethia tool to create it.