ncnn notes (four) ncnn project learning in chineseocr-lite

Project address: https://github.com/JiangP95/chineseocr_lite

After downloading, find ncnn_project, and then use cmake to compile.

You may encounter some problems when directly using cmake to compile the project under win10:

1. Link your own opencv library;

2. The narrow conversion problem. This may be a problem of the C++ version or VS. The value written with a decimal point is the double type by default. If you want to assign to the float type, you need to add f after the number. For example, 0.7f means float type, 0.7 means Is of type double;

3. Problems with the ncnn.lib library. Problems such as compilation options may cause the link function to fail. The solution is to replace the original ncnn library with the ncnn library compiled by yourself;

4. There are two places to identify and display Chinese garbled characters when generating OCR projects:

1) The non-recognized characters output by cout are displayed as garbled characters in Chinese that is only used to display prompt information. Solution: The ocr.cpp file is in utf-8 format. Use advanced save. Store the ocr.cpp file in GB2312 format. The Chinese of the message can be output normally;

2). The Chinese of the recognition result is displayed as garbled characters. The solution: convert the encoding format of the keys.txt file, the original encoding format is utf-8, use notpad++ to open-encoding-to ANSI encoding-save.

Recognition result:

 

Guess you like

Origin blog.csdn.net/juluwangriyue/article/details/108837573