International Journal on Document Analysis and Recognition manuscript No. (will be inserted by the editor)