答题卡一般是怎么识别的,哪种答题卡识别不了

首页 > 教育培训 > 作者:YD1662023-05-07 01:19:34

ANSWER_KEY = {0: 1, 1: 4, 2: 0, 3: 3, 4: 1} 1

其中sort_contours的函数具体是这样。

def sort_contours(cnts, method="left-to-right"): reverse = False i = 0 if method == "right-to-left" or method == "bottom-to-top": reverse = True if method == "top-to-bottom" or method == "bottom-to-top": i = 1 boundingBoxes = [cv2.boundingRect(c) for c in cnts] (cnts, boundingBoxes) = zip(*sorted(zip(cnts, boundingBoxes), key=lambda b: b[1][i], reverse=reverse)) return cnts, boundingBoxes 1234567891011

排序的结果也可以展示一下。

答题卡一般是怎么识别的,哪种答题卡识别不了(9)

答题卡一般是怎么识别的,哪种答题卡识别不了(10)


通过一次一次遍历来判断。

⭐️五、展示操作

score = (correct / 5.0) * 100 print("[INFO] score: {:.2f}%".format(score)) cv2.putText(warped, "{:.2f}%".format(score), (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (0, 0, 255), 2) cv2.imshow("Original", image) cv2.imshow("Exam", warped) cv2.waitKey(0) 1234567

答题卡一般是怎么识别的,哪种答题卡识别不了(11)


在原图中画出来可以使用红色标记为错误选项!

答题卡一般是怎么识别的,哪种答题卡识别不了(12)

上一页1234下一页

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.