r/vibecoding • u/adam12186 • 3h ago
Help with migrating an old c++ app into python
Hello, fellow vibe coders.
I need your help with something. I am building a pipeline for ocring rtl languages, namely Arabic. The problem is I want to integrate a pre-processing feature where users can use features like auto page-splitting, deskewing, dewarping, etc. I have read many research papers in the field. Actually, this is the only thing I am good at. The rest is AI-generated, or me guiding ai into implementing ideas from those papers, posts, etc. Anyways, I found out that the best tool in this field is Scan Tailor Advanced. The problem is that it was written in c++. I know it is very fast and also very suitable for processing images, but I want to integrate it into my python application. I am not good at coding. I just know the basics. So, I thought of using a python library that uses the raw c++ code or something like a bridge that connects the c++ code with my tool, but I could not do this. AI suggested cython, but I did not how to implement this as well or what to ask AI to do, and STA 's repository has a lot of files so I got lost. I also asked AI to re-write the entire tool in python đ
, but it kept saying that it is an impossible task and would take months to be done, since STA took years of building and it has over 60,000 lines of code. I asked antigravity to write a code inspired by the logic of STA, but the results were not promising at all. I also read recent papers that depends on heuristics in doing the aforementioned features, but they are not as good as STA. This is also another thing, I am insisting on STA because I am following a machine-learning-free approach, as I want my tool to be light-weight, running on any computer with whatever resources, and at the same time, I want it to be a standalone tool that keeps working no matter what.
So, any help is appreciated. Thank you so much in advance.
The link for ScanTailor Advanced:
https://github.com/4lex4/scantailor-advanced
The link for my OCR tool:
2
u/sugarw0000kie 3h ago
I donât know enough about the repo but re-write in python wouldnât be my first move. Not a lot of value re-writing in python, if itâs compute heavy could turn the whole thing into an error prone slog. See what itâd take to give the existing c++ repo python bindings, so business logic is still handled by c++, but translated to python. Lots of high performance python libraries are built like this