A deep learning based approach for extracting Arabic handwriting: applied calligraphy and old cursive