代码拉取完成,页面将自动刷新
多种图像识别算法的性能测试 & 算法优劣对比.
在airtest框架中集成了不同种类的图像识别算法。 其中包括模板匹配、以及基于特征点的图像识别方法。
"tpl"
["kaze", "brisk", "akaze", "orb", "sift", "surf", "brief"]
from airtest.core.settings import Settings as ST
# 脚本运行时将按照此算法顺序识别,直到“找到符合设定阈值的识别结果”或“识别超时”:
ST.CVSTRATEGY = ["surf", "tpl"]
pip install -r requirements.txt
python benchmark.py
运行代码在benchmark.py
中:
method_list = ["kaze", "brisk", "akaze", "orb", "sift", "surf", "brief"]
# 针对一张图片,绘制该张图片的CPU和内存使用情况.截屏[2907, 1403] 截图[1079, 804]
search_file, screen_file = "sample\\high_dpi\\tpl1551940579340.png", "sample\\high_dpi\\tpl1551944272194.png"
dir_path, file_name = "result", "high_dpi.json"
test_and_profile_and_plot(search_file, screen_file, dir_path, file_name, method_list)
run tume
输出method_list = ["kaze", "brisk", "akaze", "orb", "sift", "surf", "brief"]
# 测试多张图片,写入性能测试数据
test_and_profile_all_images(method_list)
# 对比绘制多张图片的结果
plot_profiled_all_images_table(method_list)
profile_recorder.py
CheckKeypointResult
: 执行特征点识别,查看结果;RecordThread
: 用于记录CPU和内存的线程;ProfileRecorder
: 执行图像匹配,记录性能数据并写入文件.plot.py
PlotResult
:绘制单张图片的方法对比结果.benchmark.py
profile_different_methods
: 执行指定图片的图像识别,并写入指定文件;plot_one_image_result
: 绘制指定图片的性能数据结果图;test_and_profile_all_images
: 对特定的多张图片执行匹配,记录性能数据并写入文件;plot_profiled_all_images_table
: 对多个图片的识别结果,绘制对比结果图.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。