Segmentation of warped text lines I am trying to segment warped text lines found in photos taken from a page of a book (from the camera of a smartphone). This is meant as a preprocessing step before running OCR on them.

I have found two relevant papers on this:

https://sites.google.com/a/iupr.com/bukhari/home/papers/Bukhari-Coupled-Snakelets-IJDAR12.pdf?attredirects=0

https://www.researchgate.net/profile/Rafael_Lins/publication/221000335_An_Efficient_Algorithm_for_Segmenting_Warped_Text-Lines_in_Document_Images/links/0fcfd5063a49cc779c000000.pdf?origin=publication_detail

I read the papers but they're too hard to implement, can anyone help?

Example input no.1: 

Example input no.2:
Your question is very broad and I won't go read the papers and implement it for you. If you could show specific problems, we might help you better (or the guys at stackoverflow for programming questions). 

Meanwhile, you can have a look at these two resources, which treat a similar problem, including some code: 

http://www.pyimagesearch.com/2014/09/01/build-kick-ass-mobile-document-scanner-just-5-minutes/

https://mzucker.github.io/2016/08/15/page-dewarping.html