master
tunmx 2 years ago
commit a40ca1f2a1

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
<component name="XMakeProjectSettings">
<option name="currentArchitecture" value="x86_64" />
<option name="workingDirectory" value="$PROJECT_DIR$" />
</component>
</project>

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/HyperLPR.iml" filepath="$PROJECT_DIR$/.idea/HyperLPR.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/ZephyrLPR.iml" filepath="$PROJECT_DIR$/.idea/ZephyrLPR.iml" />
</modules>
</component>
</project>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeRunConfigurationManager" shouldGenerate="true" shouldDeleteObsolete="true">
<generated>
<config projectName="HyperLPR3-Source" targetName="hyperlpr3" />
</generated>
</component>
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="ChangeListManager">
<list default="true" id="4be586f9-7a61-4585-994f-eaa32375497d" name="Changes" comment="Changes">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ClangdSettings">
<option name="formatViaClangd" value="false" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="CMakeBuildProfile:Debug" />
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="CMakeLists.txt" />
<option value="Python Script" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitSEFilterConfiguration">
<file-type-list>
<filtered-out-file-type name="LOCAL_BRANCH" />
<filtered-out-file-type name="REMOTE_BRANCH" />
<filtered-out-file-type name="TAG" />
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
</file-type-list>
</component>
<component name="OCResolveContextSettings">
<option name="configuration" value="0-Debug-CAPISample" />
</component>
<component name="ProjectId" id="2JZnjSwoRDsATe87YQzqJ7YkiGg" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="RunOnceActivity.cidr.known.project.marker" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="cf.first.check.clang-format" value="false" />
<property name="cidr.known.project.marker" value="true" />
<property name="cmake.loaded.for.project" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/resource/font" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resource/font" />
<recent name="$PROJECT_DIR$/images" />
<recent name="$PROJECT_DIR$/resource/models" />
<recent name="$PROJECT_DIR$/resource/models/r2_mobile" />
<recent name="$PROJECT_DIR$/command" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/Prj-Python" />
<recent name="$PROJECT_DIR$/cpp/src/nn_implementation_module/classification" />
<recent name="$PROJECT_DIR$/cpp/src/model_load" />
<recent name="$PROJECT_DIR$/resource/images" />
<recent name="$PROJECT_DIR$/cpp/src" />
</key>
</component>
<component name="RunManager">
<configuration default="true" type="CLionExternalRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true">
<method v="2">
<option name="CLION.EXTERNAL.BUILD" enabled="true" />
</method>
</configuration>
<configuration name="hyperlpr3" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="HyperLPR3-Source" TARGET_NAME="hyperlpr3" CONFIG_NAME="Debug">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
<configuration default="true" type="GradleAppRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true">
<method v="2">
<option name="com.jetbrains.cidr.cpp.gradle.execution.GradleNativeBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="4be586f9-7a61-4585-994f-eaa32375497d" name="Changes" comment="" />
<created>1672294609542</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1672294609542</updated>
<workItem from="1672294615702" duration="31662000" />
<workItem from="1672907618661" duration="1860000" />
<workItem from="1675042522538" duration="41206000" />
<workItem from="1675382177821" duration="15919000" />
<workItem from="1675643323338" duration="62886000" />
<workItem from="1675927240890" duration="12610000" />
<workItem from="1676020392199" duration="521000" />
<workItem from="1676533389966" duration="46803000" />
<workItem from="1677026784456" duration="8941000" />
<workItem from="1677043986150" duration="4211000" />
<workItem from="1677050704713" duration="8926000" />
<workItem from="1677111778645" duration="5714000" />
<workItem from="1677139138915" duration="6553000" />
<workItem from="1677218101830" duration="1207000" />
<workItem from="1677220611638" duration="33000" />
<workItem from="1677457111481" duration="10241000" />
<workItem from="1677496149958" duration="6514000" />
<workItem from="1677562836387" duration="7087000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
</project>

@ -34,7 +34,7 @@
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

@ -7,10 +7,11 @@ from PIL import ImageDraw
# 导入依赖包
import hyperlpr3 as lpr3
def draw_plate_on_image(img, box, text, font):
x1, y1, x2, y2 = box
cv2.rectangle(img, (x1, y1), (x2, y2), (139, 139, 102), 2, cv2.LINE_AA)
cv2.rectangle(img, (x1, y1 - 18), (x2, y1), (139, 139, 102), -1)
cv2.rectangle(img, (x1, y1 - 20), (x2, y1), (139, 139, 102), -1)
data = Image.fromarray(img)
draw = ImageDraw.Draw(data)
draw.text((x1 + 1, y1 - 18), text, (255, 255, 255), font=font)
@ -20,12 +21,12 @@ def draw_plate_on_image(img, box, text, font):
# 中文字体加载
font_ch = ImageFont.truetype("../resource/font/platech.ttf", 14, 0)
font_ch = ImageFont.truetype("../resource/font/platech.ttf", 20, 0)
# 实例化识别对象
catcher = lpr3.LicensePlateCatcher()
catcher = lpr3.LicensePlateCatcher(detect_level=lpr3.DETECT_LEVEL_HIGH)
# 读取图片
image = cv2.imread("../resource/images/test_img.jpg")
image = cv2.imread("/Users/tunm/datasets/boundingbox/[[359, 1292], [487, 1292], [487, 1324], [359, 1324]].jpg")
# 执行识别算法
results = catcher(image)
@ -34,5 +35,6 @@ for code, confidence, type_idx, box in results:
text = f"{code} - {confidence:.2f}"
image = draw_plate_on_image(image, box, text, font=font_ch)
# 显示检测结果
cv2.imshow("w", image)
cv2.waitKey(0)

@ -113,7 +113,7 @@ A此项目来源于作者早期的研究和调试代码代码缺少一定
### C/C++编译依赖库
编译C/C++工程需要使用第三方依赖库,将库下载后解压,并将其通过拷贝或软链接放入根目录(与CMakeLists.txt同级)即可,依赖的库下载地址:[百度网盘](https://pan.baidu.com/s/1hLzumPbrrnuI__CYv_ognA) code: kdae
编译C/C++工程需要使用第三方依赖库,将库下载后解压,并将其通过拷贝或软链接放入根目录(与CMakeLists.txt同级)即可,依赖的库下载地址:[百度网盘](https://pan.baidu.com/s/138O2bSlPN0H81OYP6zc3yQ) code: 5duf
### Linux/Mac动态链接库编译
@ -241,7 +241,7 @@ sh command/build_release_android_share.sh
### 识别测试APP
- 体验 Android APP[APK下载](https://github.com/szad670401/HyperLPR/blob/master/apk/hyperlpr3-demo.apk?raw=true)
- 体验 Android APP[扫码下载](http://fir.tunm.top/hyperlpr)
#### 获取帮助

Binary file not shown.
Loading…
Cancel
Save