diff --git a/README.md b/README.md new file mode 100644 index 0000000..4ed9d5d --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +#

图像界面识别-小组作业

+## 运行库 +cv2、matplotlib、easyocr +## 实现原理 +我们采用分割的方式将图片中所有玩家的ID和评分进行分割。
+然后我们对所有分割下来的图片进行识别,将文字提取出来。
+最终通过比较所有玩家的评分来找出评分最高的玩家。 +## 分割 +我们使用了最简单的方法进行分割。
+认为确认所有ID和评分的坐标位置进行分割。
+```c +# ID坐标 +id = [ + (460, 415, 800, 460), + (460, 610, 800, 655), + (550, 805, 800, 850), + (460, 995, 800, 1040), + (460, 1190, 800, 1235), + + (1860, 415, 2200, 460), + (1930, 600, 2200, 665), + (1860, 805, 2200, 850), + (1930, 980, 2200, 1055), + (1860, 1190, 2200, 1235), +] + +# 评分坐标 +score = [ + (335, 488, 465, 545), + (335, 680, 465, 740), + (335, 875, 465, 930), + (335, 1070, 465, 1125), + (335, 1260, 465, 1320), + + (1710, 488, 1845, 545), + (1710, 680, 1845, 740), + (1710, 875, 1845, 930), + (1710, 1070, 1845, 1125), + (1710, 1260, 1845, 1320), +] +``` +## 识别 +采用[`easyocr`](https://github.com/JaidedAI/EasyOCR)来对图像进行识别。 +```c +import easyocr + +# 识别中文并关闭GPU完全使用CPU +reader = easyocr.Reader(['ch_sim'], gpu=False) + +# 将RGB图像识别为文字 +results_id.append(reader.readtext(rgb, detail=0)) +``` +## 比较 +采用最简单的比较方式,定义变量max_val = 0.0和max_idx = 0。
+循环对所有评分变量进行对比记下最大值何其对于的ID序号。 +## 结果展示 +### 图像分割结果 +图像ID分割效果
+![id](/result/id.png#pic_center) +图像评分分割效果 +![score](/result/score.png#pic_center) +## 致谢 +感谢[`easyocr`](https://github.com/JaidedAI/EasyOCR)项目团队的每一个成员。 +## 小组成员 +张豪、孟梓涵、龚韩轩、张梦南
+(排名不分先后) \ No newline at end of file diff --git a/result/id.png b/result/id.png new file mode 100644 index 0000000..6d154ef Binary files /dev/null and b/result/id.png differ diff --git a/result/score.png b/result/score.png new file mode 100644 index 0000000..19a59ef Binary files /dev/null and b/result/score.png differ