question‘s area recognition using image processing and regular expression

Overview

========================================

Paper-Question-recognition

========================================

question‘s area recognition using image processing and regular expression

image

bilibili宣传视频: https://www.bilibili.com/video/av53893090

当前系统及库版本

Windows:win10 anaconda: Anaconda navigator 1.9.2 opencv: Opencv3 3.1.0 AipOcr: 百度ocr库最新 re: re库,自带 python:Python 3.7.0

系统总体思路

image

预处理

image

透视矫正:目标找到纸的四个点然后矫正成右下图的样子

image

如何找到四个点? 有两大方法:Canny边缘检测和霍夫直线检测

边缘检测效果:得到近似轮廓从而获得四个点的位置

image

双页试卷处理: 类似这种图片,需要把试卷分成左右两份

image

我们的思路是: 1.选取中间部分的区域(如40%~60%)我们考虑上下也各截取了一部分,将该区域二值化
2.找到连续白色区域最多,但又远大于字与字空隙的距离的区域
3.计算这个区域的中心线后,这条线就是我们要找的双页试卷的切割线(橙色)

image

这个方法甚至可以处理两页之间中间有直线的试卷。只要存在满足一定条件的空白区域就可以找到分割线。

文字识别 最初我们用teseeract库作识别,但是识别精度感人,jTesssBoxEditor训练字库的效果也很感人。

时间紧迫,我们就选择了百度Ocr的API接口作为文字识别的工具。缺点是,免费版低精度一天只有500次的使用次数。

自然语言处理

这一部分是划分题目的重中之重。 我们之前的想法是,判断识别出的某一段是否为题干,如果是题干,那么就把它和上面的部分划分开来。 但是,判断题干的效果并不好。原因在于: 1.ocr文字识别出现误差,没有识别出必要的题号等标志性词。 2.没有良好的分词。 3.正则表达式判断题干情感(比如:‘’请问…的答案是‘’、‘’以下…正确的是“ 这种一看就是题目的题干的结构)难以尽善尽美,往往需要后期debug才能补充; 简而言之,能否正确识别出题干,是我们最需要关心的。 只要识别出题干,那么上一题就被分出来了。

image

另外还要考虑一下 注意事项,等无关紧要的东西不要被划分成题目。 划分出选择题的思路大致也和上面一样

划分题目区域

由于百度ocr接口除了文字还附带位置信息,所以我们只需要把每道题的题干+题目内容的位置信息合并就可以知道整道题的位置信息了。 ocr接口位置信息有4个变量(top,left,height,width),如下。

image

一道题按理来说就包括了图中的两个红框的位置信息,只要综合考虑位置信息,一定可以得到整道题的位置信息。

image

但是实际操作中出现了意外,一道题当最后一行压根没有识别出来怎么办。
解决办法是,根据下一道题的top信息来计算上一道题的height,这样就避免了 A.北京人遗址这一行没被识别出来的尴尬。

image

前端

综合考虑,我们还是使用了python的tkinter库制作前端。 很简单,很朴素。

image

包括了选择图片所在的文件夹,切题结果保存的文件夹,预处理,是否 人工校对,开始切题的功能。

如果开启了人工校对,切题完成后会出现校对页面。右边是原图,左边是切题结果。

image

Owner
Yuta Mizuki
I'm a japanese learner and I'm a chinese student ;It's nice to meet you
Yuta Mizuki
ScanTailor Advanced is the version that merges the features of the ScanTailor Featured and ScanTailor Enhanced versions, brings new ones and fixes.

ScanTailor Advanced The ScanTailor version that merges the features of the ScanTailor Featured and ScanTailor Enhanced versions, brings new ones and f

952 Dec 31, 2022
天池2021"全球人工智能技术创新大赛"【赛道一】:医学影像报告异常检测 - 第三名解决方案

天池2021"全球人工智能技术创新大赛"【赛道一】:医学影像报告异常检测 比赛链接 个人博客记录 目录结构 ├── final------------------------------------决赛方案PPT ├── preliminary_contest--------------------

19 Aug 17, 2022
Code release for Hu et al., Learning to Segment Every Thing. in CVPR, 2018.

Learning to Segment Every Thing This repository contains the code for the following paper: R. Hu, P. Dollár, K. He, T. Darrell, R. Girshick, Learning

Ronghang Hu 417 Oct 03, 2022
color detection using python

colordetection color detection using python In this color detection Python project, we are going to build an application through which you can automat

Ruchith Kumar 1 Nov 04, 2021
Semantic-based Patch Detection for Binary Programs

PMatch Semantic-based Patch Detection for Binary Programs Requirement tensorflow-gpu 1.13.1 numpy 1.16.2 scikit-learn 0.20.3 ssdeep 3.4 Usage tar -xvz

Mr.Curiosity 3 Sep 02, 2022
TextBoxes++: A Single-Shot Oriented Scene Text Detector

TextBoxes++: A Single-Shot Oriented Scene Text Detector Introduction This is an application for scene text detection (TextBoxes++) and recognition (CR

Minghui Liao 930 Jan 04, 2023
LEARN OPENCV IN 3 HOURS USING PYTHON - INCLUDING EXAMPLE PROJECTS

LEARN OPENCV IN 3 HOURS USING PYTHON - INCLUDING EXAMPLE PROJECTS

Murtaza Hassan 815 Dec 29, 2022
Simple SDF mesh generation in Python

Generate 3D meshes based on SDFs (signed distance functions) with a dirt simple Python API.

Michael Fogleman 1.1k Jan 08, 2023
This is a real life mario project using python and mediapipe

real-life-mario This is a real life mario project using python and mediapipe How to run to run this just run - realMario.py file requirements This req

Programminghut 42 Dec 22, 2022
Deep Learning Chinese Word Segment

引用 本项目模型BiLSTM+CRF参考论文:http://www.aclweb.org/anthology/N16-1030 ,IDCNN+CRF参考论文:https://arxiv.org/abs/1702.02098 构建 安装好bazel代码构建工具,安装好tensorflow(目前本项目需

2.1k Dec 23, 2022
This is a passport scanning web service to help you scan, identify and validate your passport created with a simple and flexible design and ready to be integrated right into your system!

Passport-Recogniton-System This is a passport scanning web service to help you scan, identify and validate your passport created with a simple and fle

Mo'men Ashraf Muhamed 7 Jan 04, 2023
Use Youdao OCR API to covert your clipboard image to text.

Alfred Clipboard OCR 注:本仓库基于 oott123/alfred-clipboard-ocr 的逻辑用 Python 重写,换用了有道 AI 的 API,准确率更高,有效防止百度导致隐私泄露等问题,并且有道 AI 初始提供的 50 元体验金对于其资费而言个人用户基本可以永久使用

Junlin Liu 6 Sep 19, 2022
Automatic Number Plate Recognition (ANPR) is a highly accurate system capable of reading vehicle number plates without human intervention

ANPR ANPR is therefore the underlying technology used to find a vehicle license/number plate and it, in turn, supplies this information to a next stag

Melih Emin Kılıçoğlu 1 Jan 09, 2022
governance proposal to make fei redeemable for eth

Feil Proposal 🌲 Abstract Migrate all ETH from Fei protocol-controlled value into Yearn ETH Vault. Allow redemptions of outstanding FEI for yvETH. At

13 Mar 31, 2022
docstrum

Docstrum Algorithm Getting Started This repo is for developing a Docstrum algorithm presented by O’Gorman (1993). Disclaimer This source code is built

Chulwoo Mike Pack 54 Dec 13, 2022
ISI's Optical Character Recognition (OCR) software for machine-print and handwriting data

VistaOCR ISI's Optical Character Recognition (OCR) software for machine-print and handwriting data Publications "How to Efficiently Increase Resolutio

ISI Center for Vision, Image, Speech, and Text Analytics 21 Dec 08, 2021
The virtual calculator will be above the live streaming from your camera

The virtual calculator is above the live streaming from my camera usb , the program first detect my hand and in each frame calculate the distance between two finger ,if the distance is lower than the

gasbaoui mohammed al amine 5 Jul 01, 2022
The project is an official implementation of our paper "3D Human Pose Estimation with Spatial and Temporal Transformers".

3D Human Pose Estimation with Spatial and Temporal Transformers This repo is the official implementation for 3D Human Pose Estimation with Spatial and

Ce Zheng 363 Dec 28, 2022
Machine Leaning applied to denoise images to improve OCR Accuracy

Machine Learning to Denoise Images for Better OCR Accuracy This project is an adaptation of this tutorial and used only for learning purposes: https:/

Antonio Bri Pérez 2 Nov 16, 2022