A Study on the Accuracy of OCR Engines for Source Code Transcription from Programming Screencasts

A Study on the Accuracy of OCR Engines for Source Code Transcription from Programming Screencasts
复制标题

DOI:
10.1145/3379597.3387468
复制
发表时间:
2020-05
期刊:
2020 IEEE/ACM 17th International Conference on Mining Software Repositories (MSR)
影响因子:
--
通讯作者:
Abdulkarim Khormi;Mohammad D. Alahmadi;S. Haiduc
Abdulkarim Khormi;Mohammad D. Alahmadi;S. Haiduc
中科院分区:
其他
文献类型:
--
作者:
Abdulkarim Khormi;Mohammad D. Alahmadi;S. Haiduc

文献摘要

被引文献

相似文献

编程截屏视频可以为开发人员提供丰富的文档来源。然而,尽管有这样的视频,但其中可用的信息,特别是正在显示的源代码,并不容易被程序员查找、搜索或重用。最近的工作已经确定了这一挑战,并提出了从视频教程中识别和提取源代码的解决方案,以便开发人员或其他工具随时可以使用它。这些方法中的一个关键组件是光学字符识别(OCR)引擎,用于转录屏幕上显示的源代码。以前的工作只是简单地选择了一个OCR引擎,而没有考虑它的准确性或其他引擎在源代码识别上的准确性。本文对六种OCR引擎从截屏视频和代码图像中提取源代码的准确性进行了实证研究。我们的结果表明,不同的OCR引擎的转录精度差异很大,而且到目前为止,在以前的研究中选择最广泛的OCR引擎并不是最好的选择。我们还展示了字体类型和大小等其他因素如何影响某些引擎的结果。最后,我们为屏幕视频创建者提供了关于使用哪些字体来实现对其源代码的更好OCR识别的编程指南,并为希望分析屏幕视频中的源代码的研究人员提供了关于OCR选择的建议。
Programming screencasts can be a rich source of documentation for developers. However, despite the availability of such videos, the information available in them, and especially the source code being displayed is not easy to find, search, or reuse by programmers. Recent work has identified this challenge and proposed solutions that identify and extract source code from video tutorials in order to make it readily available to developers or other tools. A crucial component in these approaches is the Optical Character Recognition (OCR) engine used to transcribe the source code shown on screen. Previous work has simply chosen one OCR engine, without consideration for its accuracy or that of other engines on source code recognition. In this paper, we present an empirical study on the accuracy of six OCR engines for the extraction of source code from screencasts and code images. Our results show that the transcription accuracy varies greatly from one OCR engine to another and that the most widely chosen OCR engine in previous studies is by far not the best choice. We also show how other factors, such as font type and size can impact the results of some of the engines. We conclude by offering guidelines for programming screencast creators on which fonts to use to enable a better OCR recognition of their source code, as well as advice on OCR choice for researchers aiming to analyze source code in screencasts.