Skip to content

Commit 35c1ed5

Browse files
authored
[docs] Modify OCR_windows.md (#16356)
* modify OCR_windows.md * modify OCR_windows.md
1 parent dc75da6 commit 35c1ed5

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

deploy/cpp_infer/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ endif()
4242
if (WIN32)
4343
include_directories("${PADDLE_LIB}/paddle/include")
4444
link_directories("${PADDLE_LIB}/paddle/lib")
45-
set(OpenCV_DIR "${OPENCV_DIR}/lib")
45+
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
46+
set(OpenCV_DIR "${OPENCV_DIR}/x64/vc16/lib")
4647
find_package(OpenCV REQUIRED )
4748
if(USE_FREETYPE)
4849
if(NOT "opencv_freetype" IN_LIST OpenCV_LIBS)

docs/version3.x/deployment/cpp/OCR_windows.en.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ First, download the OpenCV source code. Taking OpenCV 4.7.0 as an example, downl
4848

4949
- Step 3: Generate Visual Studio Project
5050

51+
Search for `BUILD_opencv_world` and check it.
5152
Click Configure -> Generate -> Open in Project sequentially to enter the Visual Studio 2022 compilation interface.
5253

5354
<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/refs/heads/main/images/paddleocr/deployment/cpp/opencv_step3.png"/>
5455

5556
- Step 4: Execute Compilation
5657

57-
Click "Start Solution Generation". After compilation, click INSTALL to complete the installation.
58+
Click Start Solution Generation. After compilation, click INSTALL to complete the installation.
5859

5960
<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/refs/heads/main/images/paddleocr/deployment/cpp/opencv_step4.png"/>
6061

@@ -124,12 +125,12 @@ The compilation steps are as follows:
124125

125126
- Step 6:Run the prediction demo
126127

127-
Copy the following files to the `deploy/cpp_infer/build/Release/` directory, then follow Sections 2.2 and 2.3 to run the demo:
128-
1. `paddle_inference/paddle/lib/paddle_inference.dll`
129-
2. `paddle_inference/paddle/lib/common.dll`
130-
3. `deploy/cpp_infer/build/bin/Release/abseil_dll.dll`
131-
4. `deploy/cpp_infer/build/third_party/clipper_ver6.4.2/cpp/Release/polyclipping.dll`
132-
5. `opencv-4.7.0/build/install/bin/opencv_world470.dll`
128+
Copy the following files to the `deploy\cpp_infer\build\Release\` directory, then follow Sections 2.2 and 2.3 to run the demo:
129+
1. `paddle_inference\paddle\lib\paddle_inference.dll`
130+
2. `paddle_inference\paddle\lib\common.dll`
131+
3. `deploy\cpp_infer\build\bin\Release\abseil_dll.dll`
132+
4. `deploy\cpp_infer\build\third_party\clipper_ver6.4.2\cpp\Release\polyclipping.dll`
133+
5. `opencv-4.7.0\build\install\x64\vc16\bin\opencv_world470.dll`
133134

134135
### 2.2 Prepare the Model
135136

@@ -230,7 +231,7 @@ To visualize text recognition results, you need to compile OpenCV with the FreeT
230231

231232
<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/refs/heads/main/images/paddleocr/deployment/cpp/opencv_freetype_step5.png"/>
232233

233-
After completing the above steps, click "Configure" again in the CMake interface. After ensuring there are no errors, click "Generate", and then click "Open Project" to open Visual Studio. Right-click on "ALL_BUILD" and select "Build". After the compilation is completed, right-click on "INSTALL" and select "Build".
234+
After completing the above steps, click Configure again in the CMake interface. After ensuring there are no errors, click Generate, and then click Open Project to open Visual Studio. Switch from Debug to Release, right-click on ALL_BUILD and select Build. After the compilation is completed, right-click on INSTALL and select Build.
234235

235236
Note: If you have compiled OpenCV with FreeType included, when compiling the demo for the General OCR Pipeline in Section 2.1 Step 3, you need to check the `USE_FREETYPE` option to enable text rendering functionality. Additionally, when running the demo, you need to provide the path to the corresponding TTF font file using the `--vis_font_dir your_ttf_path` parameter.
236237

docs/version3.x/deployment/cpp/OCR_windows.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
- Step 3 :生成 Visual Studio 项目
5050

51+
搜索 `BUILD_opencv_world` 并勾选。
5152
依次点击 Configure -> Generate -> Open in Project,将进入 Visual Studio 2022 编译界面。
5253

5354
<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/refs/heads/main/images/paddleocr/deployment/cpp/opencv_step3.png"/>
@@ -134,7 +135,7 @@ paddle_inference
134135
2. `paddle_inference\paddle\lib\common.dll`
135136
3. `deploy\cpp_infer\build\bin\Release\abseil_dll.dll`
136137
4. `deploy\cpp_infer\build\third_party\clipper_ver6.4.2\cpp\Release\polyclipping.dll`
137-
5. `opencv-4.7.0\build\install\bin\opencv_world470.dll`
138+
5. `opencv-4.7.0\build\install\x64\vc16\bin\opencv_world470.dll`
138139

139140
### 2.2 准备模型
140141

@@ -237,7 +238,7 @@ paddle_inference
237238

238239
<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/refs/heads/main/images/paddleocr/deployment/cpp/opencv_freetype_step5.png"/>
239240

240-
完成后,再次在 Cmake 界面,点击 configure, 确定没报错后,点击 Generate,最后点击 Open Project,打开 Visual studio,找到 ALL_BUILD 右键Build, 等待编译完成后, 找到 INSTALL 右键 Build。
241+
完成后,再次在 Cmake 界面,点击 configure, 确定没报错后,点击 Generate,最后点击 Open Project,打开 Visual studio,将 Debug 切换为 Release,找到 ALL_BUILD 右键 Build, 等待编译完成后, 找到 INSTALL 右键 Build。
241242

242243
注意:如果完成编译包含 FreeType 的 OpenCV,在编译通用 OCR 产线 demo 时,需要在 2.1节 Step 3 配置编译选项时勾选 `USE_FREETYPE` 开启文字渲染功能,并且在运行 demo 时通过 `--vis_font_dir your_ttf_path` 提供相应 ttf 字体文件路径。
243244

0 commit comments

Comments
 (0)