APP下载

基于图像处理的工程制图作业批改方法研究

2021-11-09朱文博杜锋

软件工程 2021年11期

朱文博 杜锋

摘  要:为了减轻制图教师批改尺规作业的工作量,提出一种基于图像处理的匹配算法。首先将纸质版作业拍照为图像;然后对图像进行灰度化,利用OTSU方法二值化,对有效区域进行裁剪,调节标准答案与学生作业像素尺寸大小,采用帧差法进行标准答案和学生作业的匹配,将标准答案与学生作业相减得出不同之处;最后在学生作业中将不同之处标记出来,从而实现尺规作业的自动批改。通过实验验证,该方法能快速准确地批改尺规作图。对于采用AutoCAD等软件绘图的作业只需另存为图片格式,同样适用于本文所述方法。

关键词:图像处理;图像匹配;帧差法;工程制图作业;自动批改

中图分类号:TP391.4     文献标识码:A

Research on the Correcting Method of Engineering Drawing

Homework based on Image Processing

ZHU Wenbo, DU Feng

(School of Mechanical Engineering, University of Shanghai for Science and Technology, Shanghai 200093, China)

teacherzwb@163.com; 1002054400@qq.com

Abstract: In order to reduce the workload of drawing teachers in correcting ruler-and-compass construction assignments, this paper proposes a matching algorithm based on image processing. Firstly, the paper homework is photographed as an image that is then grayed and binarized by OTSU method. The effective area is clipped, and the pixel size of the standard answer and the students' homework are adjusted. The frame difference method is used to match the standard answer and students' homework. The standard answer and the students' homework are subtracted to get their differences, which are finally marked in students' homework. Therefore, the automatic correction of students' homework is realized. The experimental results show that the method can correct ruler-and-compass construction homework quickly and accurately. The proposed method also applies to drawing homework with software such as AutoCAD, which only needs to be saved as an image format.

Keywords: image processing; image matching; frame difference method; engineering drawing homework; automatic

correction

1   引言(Introduction)

工程制圖是工科学生必修的一门专业基础课程,是培养学生绘制与阅读各类机械图样能力的课程。要掌握此课程的知识,练习习题是必不可少的。练习习题可以分为两类,一类是计算机软件绘图;另一类是最为广泛的尺规绘图。目前已有一些针对计算机软件绘图自动批改的研究[1]。然而在尺规绘图方面,仍然是教师手动批改,这使得教师需要花费大量的精力批改习题,导致教师的科研效率大大降低。繁重的工作量使基于图像处理的自动批改系统得到较好的应用,其核心包括图像采集、图像处理、分析模块以及人机交互模块等。采用图像处理的方法如何自动批改大量的制图作业,减轻制图教师的工作量,是一个值得研究的课题。……

登录APP查看全文