Detecting ascender and descender in cursive handwriting