A vision-based document image segmentation algorithm implemented in C/C++