更新OcrLite库,添加接口。删除多余的库文件

This commit is contained in:
MistEO
2021-07-27 21:05:24 +08:00
parent 539689d1b7
commit d3e66e09c0
18 changed files with 39 additions and 39 deletions

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e3943a317403f5e5ec7744f930df528451aca888d13187f23baa86cf5700d7e2
oid sha256:d879f398273e21599cfc662fe5d86cd35ae397ae32d1832cef69be2c2eabdc5d
size 4744704

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c48d3baf0ce7742d54fc609d780def557078e7e7d61f0733682004bfd26355b
size 4739072

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a77a8fad259b26a9ab123fb83a3c72129396ccdb42be6c729444331c498bba38
size 4739072

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c5985e3afbe67b905a87ad0e18dafed0460ba33e8907bc1483d7e6ba2b9b10cb
oid sha256:d879f398273e21599cfc662fe5d86cd35ae397ae32d1832cef69be2c2eabdc5d
size 4744704

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3efb02b69038309da6adc09ed9b4688c966cf88871d433a49687c3840aba9343
size 55650816

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7820efdf7a466ef3ab077302ffe5f5dc79520cf432d505d3b692ff79ac59a3fb
size 101431808

View File

@@ -31,6 +31,9 @@ namespace ocr {
int padding, int maxSideLen,
float boxScoreThresh, float boxThresh, float unClipRatio, bool doAngle, bool mostAngle);
OcrResult detect(const cv::Mat & mat,
int padding, int maxSideLen,
float boxScoreThresh, float boxThresh, float unClipRatio, bool doAngle, bool mostAngle);
private:
bool isOutputConsole = false;
bool isOutputPartImg = false;

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1b6784aff198fc210202b9862dc6de042aa19e7bd5e91244178898a025045dbd
size 27364
oid sha256:5cc75be243439729d3faca7b20e9c0fe0e4b8d6139fffbbb05383735f54136af
size 27804

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d070e39e873a5692582e37341ffb89306a536406a13edee48f37b5ffea20e57f
size 13914

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d070e39e873a5692582e37341ffb89306a536406a13edee48f37b5ffea20e57f
size 13914

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1b6784aff198fc210202b9862dc6de042aa19e7bd5e91244178898a025045dbd
size 27364
oid sha256:5cc75be243439729d3faca7b20e9c0fe0e4b8d6139fffbbb05383735f54136af
size 27804

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:324a2b1625ac7a1f60e572f4ecd2c23eb7d8e3d3bb81194e94709ec70108a32c
size 4801362

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:da0b17f28181658389e3ab852f0129659598cd8d6f13ce45b9b9fdfb60ae20e9
size 4377174

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:673035c2d9da9fd08b6912fa23c7d06388f310818730f95ef8d953f8f271529a
size 2467276

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4f7d47b226f0589ded1d3c7d8cd4c1bbcc70256b878fd5a10c595adf1d81ee93
size 2546472

View File

@@ -151,7 +151,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>OcrLiteNcnn.lib;opencv_world3415.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>MeoAssistance.lib;OcrLiteNcnn.lib;opencv_world3415.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(TargetDir);$(SolutionDir)\3rdPart\lib\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{510b2363-fc44-405a-90b9-5126b6853026}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,6 +1,8 @@
#include <OcrLiteNcnn\OcrLite.h>
#include <AsstAux.h>
#include <iostream>
#include <fstream>
#include <chrono>
int main(int argc, char** argv)
{
@@ -11,8 +13,14 @@ int main(int argc, char** argv)
OcrLite ocr_lite;
ocr_lite.setNumThread(4);
//ocr_lite.initLogger(
// true,//isOutputConsole
// false,//isOutputPartImg
// false);//isOutputResultImg
ocr_lite.enableResultTxt(GetCurrentDir().c_str(), filename.c_str());
ocr_lite.setGpuIndex(0);
ocr_lite.setGpuIndex(-1);
const std::string models_dir = GetResourceDir() + "OcrLiteNcnn\\models\\";
@@ -21,12 +29,18 @@ int main(int argc, char** argv)
std::cerr << "initModels failed" << std::endl;
}
auto start = std::chrono::system_clock::now();
OcrResult result = ocr_lite.detect(GetCurrentDir().c_str(), filename.c_str(),
50, 1024,
0.6f, 0.3f,
2.0f, true, true);
std::cout << result.strRes << std::endl;
auto end = std::chrono::system_clock::now();
std::cout << "Time: " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << std::endl;
std::wcout << Utf8ToGBK(result.strRes) << std::endl;
getchar();
return 0;
}