Extract subtitles from video using opencv.通过opencv图片识别方法抽取视频中的文字,字幕。
git@yoqi.me e7eb33c0c0 update by server | 1 year ago | |
---|---|---|
assets | 4 years ago | |
tools-ocr | 4 years ago | |
.gitignore | 4 years ago | |
OcrUtils.py | 4 years ago | |
README.md | 4 years ago | |
README_CN.md | 1 year ago | |
main.py | 4 years ago | |
pre_do.py | 4 years ago | |
requirements.txt | 4 years ago | |
user_agent.py | 4 years ago |
videos extract subtitles. The project includes python (video processing) and java (picture to text) source.
This tool mainly serves companies such as news media and self-media. Implemented the following functions:
Position the subtitles in the video,
Use the Natural Language Recognition function to extract the subtitle text in the video.
Put the video file in the videos folder.
First execute the pre_do.py file to check the video frame rate, video size and other information.
Through the previous operation, modify the parameters in main.py so that the subtitle pictures are intercepted well. Then executing main.py will generate subtitle pictures (10 sentences combined into one picture for easy identification) in the videos folder after analyzing the video.
Execute MainFm.java to perform batch text recognition on the above pictures (call Baidu/Sogou and other text recognition free interfaces respectively). The obtained results are saved in the project resxxx.txt file.
Due to the text recognition interface, the recognition may be wrong. So you can execute it a few times and compare the results.
mail: liuyuqi.gov@msn.cn