[go: up one dir, main page]

CN110298811B - Image preprocessing method, device, terminal and computer readable storage medium - Google Patents

Image preprocessing method, device, terminal and computer readable storage medium Download PDF

Info

Publication number
CN110298811B
CN110298811B CN201810233883.9A CN201810233883A CN110298811B CN 110298811 B CN110298811 B CN 110298811B CN 201810233883 A CN201810233883 A CN 201810233883A CN 110298811 B CN110298811 B CN 110298811B
Authority
CN
China
Prior art keywords
point
image
distribution
grayscale
grayscale histogram
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201810233883.9A
Other languages
Chinese (zh)
Other versions
CN110298811A (en
Inventor
郭宗明
亓文法
刘宇鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
Original Assignee
Peking University
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Peking University, Peking University Founder Group Co Ltd, Beijing Founder Electronics Co Ltd filed Critical Peking University
Priority to CN201810233883.9A priority Critical patent/CN110298811B/en
Publication of CN110298811A publication Critical patent/CN110298811A/en
Application granted granted Critical
Publication of CN110298811B publication Critical patent/CN110298811B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

本发明实施例提供一种图像的预处理方法、装置、终端以及计算机可读存储介质,方法包括:将预先获取的原始文本图像转换为灰度图像;对灰度图像进行膨胀腐蚀处理,获得处理后图像;将处理后图像划分为若干个预设大小的子图像块;确定每个子图像块中前景文字和背景底纹的灰度直方图分界拐点,并获取灰度直方图分界拐点处的像素值;根据灰度直方图分界拐点处的像素值对子图像块进行二值化处理,获得与子图像块相对应的黑白二值子图像块;将所有的黑白二值子图像块整合为与灰度图像相对应的二值图像。本发明明显消除了在图像拍摄时因诸如大量干涉莫尔条纹、曝光度不均匀以及随机噪声干扰等因素带来的影响,明显提高了图像OCR识别的准确率。

Figure 201810233883

Embodiments of the present invention provide an image preprocessing method, device, terminal, and computer-readable storage medium. The method includes: converting a pre-acquired original text image into a grayscale image; performing expansion and corrosion processing on the grayscale image, and obtaining a processing After image; divide the processed image into several sub-image blocks of preset size; determine the inflection point of the gray histogram boundary between the foreground text and background shading in each sub-image block, and obtain the pixels at the inflection point of the gray histogram boundary value; binarize the sub-image block according to the pixel value at the inflection point of the gray histogram boundary to obtain the black and white binary sub-image block corresponding to the sub-image block; integrate all the black-and-white binary sub-image blocks into a A binary image corresponding to a grayscale image. The invention obviously eliminates the influence caused by factors such as a large number of interference moire fringes, uneven exposure, random noise interference and the like during image shooting, and obviously improves the accuracy of image OCR recognition.

Figure 201810233883

Description

图像的预处理方法、装置、终端以及计算机可读存储介质Image preprocessing method, device, terminal, and computer-readable storage medium

技术领域technical field

本发明涉及图像处理技术领域,尤其涉及一种图像的预处理方法、装置、终端以及计算机可读存储介质。The present invention relates to the technical field of image processing, and in particular, to an image preprocessing method, device, terminal, and computer-readable storage medium.

背景技术Background technique

科学技术的快速发展带来了对信息的强大需求,而在当今社会,信息主要以“纸”作为介质而存在。传统的信息存储方式为人工录入信息并保存,这种方法缺点在于人工劳动量的巨大、时间消耗长、效率低。因此,为了减轻人们的劳动量同时满足人们对于信息的迫切需求,数字化的概念应运而生。光学字符识别(OCR,Optical Character Recognition)作为一种文字识别技术,运用计算机自动分析、由扫描仪等成像设备输入的文字图像并识别图像中的文字,最后将文字图像转换为可以编辑的文本,实现了文档图像的数字化,能够快速的实现文字录入的功能,代替了繁重的人工劳动。The rapid development of science and technology has brought a strong demand for information, and in today's society, information mainly exists as a medium of "paper". The traditional information storage method is to manually enter information and save it. The disadvantages of this method are the huge amount of manual labor, long time consumption and low efficiency. Therefore, in order to reduce people's labor and meet people's urgent needs for information, the concept of digitization came into being. Optical Character Recognition (OCR, Optical Character Recognition), as a text recognition technology, uses the computer to automatically analyze the text images input by imaging devices such as scanners and recognize the text in the images, and finally convert the text images into editable text. The digitization of document images is realized, and the function of text input can be quickly realized, replacing heavy manual labor.

一个完整的OCR系统一般包括:图像获取、预处理、特征抽取、识别分类、后处理以及识别结果六个模块。而OCR系统在识别低质量文档图像时,其关键技术在于图像预处理时采用的二值化算法,能否选取恰当的二值化算法决定了二值化结果的好坏,继而影响后续的识别正确率。随着数字化进程的不断深入,类似扫描仪等固定大型设备已经不能满足人们的需求。于是移动设备如数码相机、手机、掌上电脑(Personal Digital Assistant,简称PDA)等由于其可便携、响应快、价格低廉、不受环境限制等特点成为了人们更好的选择。虽然这些便携式设备不像扫描仪一样在空间上有限制,但也具有一定的缺点:1)在拍摄时,由于受到拍摄技术和自然条件等的限制,如曝光不足、光线变化、焦距变化、文件本身不平整等多种情况经常会出现,从而使拍摄出的图像出现大片噪声、光照不均、倾斜、扭曲等形变,这些形变都会使图像的质量受到一定程度的影响;2)当使用手机或者数码相机拍摄电脑屏幕中显示的文本文档时,由于相机快门的速度与屏幕的刷新频率不一致,导致了拍照图片出现严重的莫尔干涉条纹,从而严重影响了OCR的识别效率。A complete OCR system generally includes six modules: image acquisition, preprocessing, feature extraction, recognition and classification, post-processing and recognition results. When the OCR system recognizes low-quality document images, the key technology lies in the binarization algorithm used in image preprocessing. Whether an appropriate binarization algorithm can be selected determines the quality of the binarization result, which in turn affects subsequent recognition. Correct rate. With the continuous deepening of the digitalization process, fixed large-scale equipment such as scanners can no longer meet people's needs. Therefore, mobile devices such as digital cameras, mobile phones, and PDAs (Personal Digital Assistant, PDA for short) have become a better choice for people because of their portability, fast response, low price, and freedom from environmental restrictions. Although these portable devices are not limited in space like scanners, they also have certain disadvantages: 1) When shooting, due to the limitations of shooting technology and natural conditions, such as insufficient exposure, light changes, focal length changes, document A variety of situations such as unevenness often occur, resulting in large noises, uneven lighting, tilt, distortion and other deformations in the captured image. These deformations will affect the quality of the image to a certain extent; 2) When using a mobile phone or When a digital camera shoots a text document displayed on a computer screen, the shutter speed of the camera is inconsistent with the refresh rate of the screen, resulting in serious moire interference fringes in the photographed pictures, which seriously affects the recognition efficiency of OCR.

然而,由于上述情况下拍摄的文本文档图像质量较低,因此,当对上述拍摄的文本文档图像进行识别时,当前的OCR技术的字符识别率相对较低,严重的情况时可能完全无法识别。However, due to the low quality of the text document image captured in the above-mentioned situation, the character recognition rate of the current OCR technology is relatively low when the above-mentioned captured text document image is recognized, and may not be recognized at all in severe cases.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种图像的预处理方法、装置、终端以及计算机可读存储介质,用以解决现有技术中存在的由于文本文档拍照图像中出现的严重干扰摩尔纹、大片噪声以及光照不均等因素而引起的图像二值化效果较差的问题,从而提高文本文档图像的字符识别率。Embodiments of the present invention provide an image preprocessing method, device, terminal, and computer-readable storage medium, so as to solve the problems in the prior art due to serious interference moiré, large noise, and poor illumination that appear in photographed images of text documents. The problem of poor image binarization effect caused by equal factors, thereby improving the character recognition rate of text document images.

本发明实施例第一方面提供了一种图像的预处理方法,包括:A first aspect of the embodiments of the present invention provides an image preprocessing method, including:

将预先获取的原始文本图像转换为灰度图像;Convert pre-acquired raw text images to grayscale images;

对所述灰度图像进行膨胀腐蚀处理,获得处理后图像;performing dilation and corrosion processing on the grayscale image to obtain a processed image;

将所述处理后图像划分为若干个预设大小的子图像块;dividing the processed image into several sub-image blocks of preset size;

确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点,并获取所述灰度直方图分界拐点处的像素值;Determine the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each of the sub-image blocks, and obtain the pixel value at the boundary inflection point of the grayscale histogram;

根据所述灰度直方图分界拐点处的像素值对所述子图像块进行二值化处理,获得与所述子图像块相对应的黑白二值子图像块;Perform binarization processing on the sub-image block according to the pixel value at the inflection point of the boundary of the grayscale histogram to obtain a black and white binary sub-image block corresponding to the sub-image block;

将所有的黑白二值子图像块整合为与所述灰度图像相对应的二值图像。All black and white binary sub-image blocks are integrated into a binary image corresponding to the grayscale image.

可选的,所述确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点,包括:Optionally, the determining the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each of the sub-image blocks includes:

根据每个所述子图像块获取与所述子图像块相对应的灰度直方图分布;Obtaining a grayscale histogram distribution corresponding to the sub-image block according to each of the sub-image blocks;

获取所述灰度直方图分布的分布特征,并根据所述分布特征确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点。The distribution characteristics of the grayscale histogram distribution are obtained, and the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each of the sub-image blocks is determined according to the distribution characteristics.

可选的,所述根据所述分布特征确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点,包括:Optionally, determining the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each of the sub-image blocks according to the distribution feature, including:

根据所述灰度直方图分布特征确定所述灰度直方图分布中的左侧边界点Left和预设标记点Point;Determine the left boundary point Left and the preset marker point Point in the distribution of the grayscale histogram according to the distribution characteristics of the grayscale histogram;

若所述左侧边界点Left大于预设标记点Point,则根据公式

Figure GDA0003114778080000031
确定所述灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Left为左侧边界点,Point为预设标记点;或者If the left boundary point Left is greater than the preset mark point Point, then according to the formula
Figure GDA0003114778080000031
Determine the inflection point of the grayscale histogram boundary, where TH is the inflection point of the grayscale histogram boundary, Left is the left boundary point, and Point is a preset marker point; or

若所述左侧边界点Left小于预设标记点Point,则根据公式TH=Point确定所述灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Point为预设标记点。If the left boundary point Left is smaller than the preset mark point Point, the inflection point of the gray histogram boundary is determined according to the formula TH=Point, where TH is the inflection point of the gray histogram boundary, and Point is the preset mark point.

可选的,所述根据所述灰度直方图分布特征确定所述灰度直方图分布中的左侧边界点,包括:Optionally, the determining the left boundary point in the distribution of the grayscale histogram according to the distribution feature of the grayscale histogram includes:

根据所述灰度直方图分布特征确定所述灰度直方图分布的波峰位置;Determine the peak position of the grayscale histogram distribution according to the grayscale histogram distribution feature;

从所述灰度直方图分布的波峰位置依次按照像素数目递减的顺序在所述灰度直方图分布中进行搜索;Search in the grayscale histogram distribution in the order of decreasing pixel number from the peak positions of the grayscale histogram distribution;

将搜索到的各个位置的像素数目依次相加,直至所述像素数目的总和与全部像素数目的总和的比值达到预先设置的像素值阈值比例为止;The number of pixels in each position that is searched is added in turn, until the ratio of the sum of the number of pixels to the sum of the number of all pixels reaches a preset pixel value threshold ratio;

将所述灰度直方图分布中的左侧位置确定为所述左侧边界点。The left position in the grayscale histogram distribution is determined as the left boundary point.

可选的,所述根据所述灰度直方图分布特征确定所述灰度直方图分布的波峰位置,包括:Optionally, the determining the peak position of the grayscale histogram distribution according to the grayscale histogram distribution features includes:

确定由所述灰度直方图分布中的预设位置所构成的位置集合,其中,所述预设位置的高度大于预设高度阈值;determining a position set consisting of preset positions in the grayscale histogram distribution, wherein the height of the preset position is greater than a preset height threshold;

获取所述位置集合中每个位置的像素数目;Obtain the number of pixels at each position in the set of positions;

将所述位置集合中像素数目最大的位置确定为所述灰度直方图分布的波峰位置。The position with the largest number of pixels in the position set is determined as the peak position of the grayscale histogram distribution.

可选的,根据所述灰度直方图分布特征确定所述灰度直方图分布中的预设标记点,包括:Optionally, determining the preset marker points in the grayscale histogram distribution according to the grayscale histogram distribution features, including:

获取所述左侧边界点处的变化斜率;obtaining the change slope at the left boundary point;

若所述变化斜率小于1,则在所述灰度直方图分布中从所述左侧边界点向右移动搜寻,直至所搜寻到的位置处的变化斜率大于或等于1;If the change slope is less than 1, move the search to the right from the left boundary point in the grayscale histogram distribution, until the change slope at the searched position is greater than or equal to 1;

将在所述灰度直方图分布中搜寻到的位置点作为所述预设标记点;或者,The position point found in the grayscale histogram distribution is used as the preset marker point; or,

若所述变化斜率大于1,则在所述灰度直方图分布中从所述左侧边界点向左移动搜寻,直至所搜寻到的位置处的变化斜率小于或等于1;If the change slope is greater than 1, move the search to the left from the left boundary point in the gray histogram distribution, until the change slope at the searched position is less than or equal to 1;

将在所述灰度直方图分布中搜寻到的位置点作为所述预设标记点。The position point found in the grayscale histogram distribution is used as the preset marker point.

可选的,所述获取所述左侧边界点处的变化斜率,包括:Optionally, the acquiring the change slope at the left boundary point includes:

获取所述波峰位置相对于所述灰度直方图分布的像素比例值、位于所述左侧边界点左边的第五个点所对应的左侧像素数目以及位于所述左侧边界点右边的第五个点所对应的右侧像素数目;Obtain the pixel ratio value of the peak position relative to the distribution of the grayscale histogram, the number of left pixels corresponding to the fifth point located to the left of the left boundary point, and the number of pixels located to the right of the left boundary point. The number of pixels on the right side corresponding to the five points;

根据所述像素比例值、左侧像素数目和右侧像素数目,并利用以下公式确定所述变化斜率:According to the pixel scale value, the number of pixels on the left and the number of pixels on the right, the change slope is determined by the following formula:

Figure GDA0003114778080000041
Figure GDA0003114778080000041

其中,k为左侧边界点处的变化斜率,H(l-5)为位于左侧边界点左边的第五个点所对应的左侧像素数目,H(l+5)为位于左侧边界点右边的第五个点所对应的右侧像素数目,ratio为波峰位置相对于灰度直方图分布的像素比例值。Among them, k is the change slope at the left boundary point, H(l-5) is the number of left pixels corresponding to the fifth point to the left of the left boundary point, and H(l+5) is the left boundary The number of pixels on the right corresponding to the fifth point to the right of the point, ratio is the pixel ratio value of the peak position relative to the distribution of the grayscale histogram.

可选的,所述获取所述波峰位置相对于所述灰度直方图分布的像素比例值,包括:Optionally, the obtaining the pixel ratio value of the peak position relative to the distribution of the grayscale histogram includes:

获取所述波峰位置的像素数目;Obtain the number of pixels at the peak position;

将所述波峰位置的像素数目与256的比值作为所述波峰位置相对于所述灰度直方图分布的像素比例值。The ratio of the number of pixels at the peak position to 256 is used as the pixel ratio value of the peak position relative to the grayscale histogram distribution.

可选的,所述对所述灰度图像进行膨胀腐蚀处理,包括:Optionally, performing dilation and corrosion processing on the grayscale image includes:

将所述灰度图像的图像区域与预先设置的内核做卷积操作,其中,所述内核包括正方形、矩形、菱形或者空心圆形中的任意一种。Perform a convolution operation on the image area of the grayscale image and a preset kernel, wherein the kernel includes any one of a square, a rectangle, a diamond, or a hollow circle.

可选的,所述内核的半径为2。Optionally, the radius of the inner core is 2.

可选的,所述子图像块的宽度和高度均为256。Optionally, the width and height of the sub-image block are both 256.

可选的,所述像素值阈值比例的取值范围为85%-95%之间。Optionally, the value range of the pixel value threshold ratio is between 85% and 95%.

本发明实施例第二方面提供了一种图像的预处理装置,包括:A second aspect of the embodiments of the present invention provides an image preprocessing device, including:

转换模块,用于将预先获取的原始文本图像转换为灰度图像;A conversion module for converting the pre-acquired original text image into a grayscale image;

膨胀腐蚀模块,用于对所述灰度图像进行膨胀腐蚀处理,获得处理后图像;an expansion corrosion module, used for performing expansion corrosion processing on the grayscale image to obtain a processed image;

图像划分模块,用于将所述处理后图像划分为若干个预设大小的子图像块;an image division module, configured to divide the processed image into several sub-image blocks of preset sizes;

确定模块,用于确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点,并获取所述灰度直方图分界拐点处的像素值;A determination module, configured to determine the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each of the sub-image blocks, and obtain the pixel value at the inflection point of the grayscale histogram boundary;

二值化处理模块,用于根据所述灰度直方图分界拐点处的像素值对所述子图像块进行二值化处理,获得与所述子图像块相对应的黑白二值子图像块;A binarization processing module, configured to perform a binarization process on the sub-image block according to the pixel value at the inflection point of the gray histogram boundary to obtain a black and white binary sub-image block corresponding to the sub-image block;

整合模块,用于将所有的黑白二值子图像块整合为与所述灰度图像相对应的二值图像。The integration module is used for integrating all the black and white binary sub-image blocks into a binary image corresponding to the grayscale image.

可选的,所述确定模块,用于:Optionally, the determining module is used for:

根据每个所述子图像块获取与所述子图像块相对应的灰度直方图分布;Obtaining a grayscale histogram distribution corresponding to the sub-image block according to each of the sub-image blocks;

获取所述灰度直方图分布的分布特征,并根据所述分布特征确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点。The distribution characteristics of the grayscale histogram distribution are obtained, and the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each of the sub-image blocks is determined according to the distribution characteristics.

可选的,所述确定模块,还用于:Optionally, the determining module is further used for:

根据所述灰度直方图分布特征确定所述灰度直方图分布中的左侧边界点Left和预设标记点Point;Determine the left boundary point Left and the preset marker point Point in the distribution of the grayscale histogram according to the distribution characteristics of the grayscale histogram;

若所述左侧边界点Left大于预设标记点Point,则根据公式

Figure GDA0003114778080000061
确定所述灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Left为左侧边界点,Point为预设标记点;或者If the left boundary point Left is greater than the preset mark point Point, then according to the formula
Figure GDA0003114778080000061
Determine the inflection point of the grayscale histogram boundary, where TH is the inflection point of the grayscale histogram boundary, Left is the left boundary point, and Point is a preset marker point; or

若所述左侧边界点Left小于预设标记点Point,则根据公式TH=Point确定所述灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Point为预设标记点。If the left boundary point Left is smaller than the preset mark point Point, the inflection point of the gray histogram boundary is determined according to the formula TH=Point, where TH is the inflection point of the gray histogram boundary, and Point is the preset mark point.

可选的,所述确定模块,还用于:Optionally, the determining module is further used for:

根据所述灰度直方图分布特征确定所述灰度直方图分布的波峰位置;Determine the peak position of the grayscale histogram distribution according to the grayscale histogram distribution feature;

从所述灰度直方图分布的波峰位置依次按照像素数目递减的顺序在所述灰度直方图分布中进行搜索;Search in the grayscale histogram distribution in the order of decreasing pixel number from the peak positions of the grayscale histogram distribution;

将搜索到的各个位置的像素数目依次相加,直至所述像素数目的总和与全部像素数目的总和的比值达到预先设置的像素值阈值比例为止;The number of pixels in each position that is searched is added in turn, until the ratio of the sum of the number of pixels to the sum of the number of all pixels reaches a preset pixel value threshold ratio;

将所述灰度直方图分布中的左侧位置确定为所述左侧边界点。The left position in the grayscale histogram distribution is determined as the left boundary point.

可选的,所述确定模块,还用于:Optionally, the determining module is further used for:

确定由所述灰度直方图分布中的预设位置所构成的位置集合,其中,所述预设位置的高度大于预设高度阈值;determining a position set consisting of preset positions in the grayscale histogram distribution, wherein the height of the preset position is greater than a preset height threshold;

获取所述位置集合中每个位置的像素数目;Obtain the number of pixels at each position in the set of positions;

将所述位置集合中像素数目最大的位置确定为所述灰度直方图分布的波峰位置。The position with the largest number of pixels in the position set is determined as the peak position of the grayscale histogram distribution.

可选的,所述确定模块,还用于:Optionally, the determining module is further used for:

获取所述左侧边界点处的变化斜率;obtaining the change slope at the left boundary point;

若所述变化斜率小于1,则在所述灰度直方图分布中从所述左侧边界点向右移动搜寻,直至所搜寻到的位置处的变化斜率大于或等于1;If the change slope is less than 1, move the search to the right from the left boundary point in the grayscale histogram distribution, until the change slope at the searched position is greater than or equal to 1;

将在所述灰度直方图分布中搜寻到的位置点作为所述预设标记点;或者,The position point found in the grayscale histogram distribution is used as the preset marker point; or,

若所述变化斜率大于1,则在所述灰度直方图分布中从所述左侧边界点向左移动搜寻,直至所搜寻到的位置处的变化斜率小于或等于1;If the change slope is greater than 1, move the search to the left from the left boundary point in the gray histogram distribution, until the change slope at the searched position is less than or equal to 1;

将在所述灰度直方图分布中搜寻到的位置点作为所述预设标记点。The position point found in the grayscale histogram distribution is used as the preset marker point.

可选的,所述确定模块,还用于:Optionally, the determining module is further used for:

获取所述波峰位置相对于所述灰度直方图分布的像素比例值、位于所述左侧边界点左边的第五个点所对应的左侧像素数目以及位于所述左侧边界点右边的第五个点所对应的右侧像素数目;Obtain the pixel ratio value of the peak position relative to the distribution of the grayscale histogram, the number of left pixels corresponding to the fifth point located to the left of the left boundary point, and the number of pixels located to the right of the left boundary point. The number of pixels on the right side corresponding to the five points;

根据所述像素比例值、左侧像素数目和右侧像素数目,并利用以下公式确定所述变化斜率:According to the pixel scale value, the number of pixels on the left and the number of pixels on the right, the change slope is determined by the following formula:

Figure GDA0003114778080000071
Figure GDA0003114778080000071

其中,k为左侧边界点处的变化斜率,H(l-5)为位于左侧边界点左边的第五个点所对应的左侧像素数目,H(l+5)为位于左侧边界点右边的第五个点所对应的右侧像素数目,ratio为波峰位置相对于灰度直方图分布的像素比例值。Among them, k is the change slope at the left boundary point, H(l-5) is the number of left pixels corresponding to the fifth point to the left of the left boundary point, and H(l+5) is the left boundary The number of pixels on the right corresponding to the fifth point to the right of the point, ratio is the pixel ratio value of the peak position relative to the distribution of the grayscale histogram.

可选的,所述确定模块,还用于:Optionally, the determining module is further used for:

获取所述波峰位置的像素数目;Obtain the number of pixels at the peak position;

将所述波峰位置的像素数目与256的比值作为所述波峰位置相对于所述灰度直方图分布的像素比例值。The ratio of the number of pixels at the peak position to 256 is used as the pixel ratio value of the peak position relative to the grayscale histogram distribution.

可选的,所述膨胀腐蚀模块,用于:Optionally, the expansion corrosion module is used for:

将所述灰度图像的图像区域与预先设置的内核做卷积操作,其中,所述内核包括正方形、矩形、菱形或者空心圆形中的任意一种。Perform a convolution operation on the image area of the grayscale image and a preset kernel, wherein the kernel includes any one of a square, a rectangle, a diamond, or a hollow circle.

可选的,所述内核的半径为2。Optionally, the radius of the inner core is 2.

可选的,所述子图像块的宽度和高度均为256。Optionally, the width and height of the sub-image block are both 256.

可选的,所述像素值阈值比例的取值范围为85%-95%之间。Optionally, the value range of the pixel value threshold ratio is between 85% and 95%.

本发明实施例第三方面提供一种图像的预处理终端,包括:A third aspect of the embodiments of the present invention provides an image preprocessing terminal, including:

存储器;memory;

处理器;以及processor; and

计算机程序;Computer program;

其中,所述计算机程序存储在所述存储器中,并被配置为由所述处理器执行以实现上述第一方面所述的一种图像的预处理方法。Wherein, the computer program is stored in the memory and configured to be executed by the processor to implement the image preprocessing method described in the first aspect above.

本发明实施例第四方面提供一种计算机可读存储介质,其上存储有计算机程序;A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium on which a computer program is stored;

所述计算机程序被处理器执行以实现上述第一方面所述的一种图像的预处理方法。The computer program is executed by the processor to implement the image preprocessing method described in the first aspect above.

本发明实施例提供的图像的预处理方法、装置、终端以及计算机可读存储介质,通过对图像进行分块处理,根据每个子图像块的直方图的分布特性自适应的搜寻图像二值化阈值,可以有效区分出前景区域和背景区域,明显消除了图像拍摄的过程中引入的诸如大量干涉莫尔条纹、曝光度不均匀以及随机噪声干扰等因素带来的影响,明显提高了文本图像OCR识别的准确率,保证了该方法的实用性,有利于市场的推广与应用。The image preprocessing method, device, terminal, and computer-readable storage medium provided by the embodiments of the present invention perform block processing on the image, and adaptively search for the image binarization threshold according to the distribution characteristics of the histogram of each sub-image block. , which can effectively distinguish the foreground area and the background area, obviously eliminate the influence of factors such as a large number of interference moire fringes, uneven exposure and random noise interference introduced in the process of image shooting, and significantly improve the OCR recognition of text images. The accuracy of the method ensures the practicability of the method and is beneficial to the promotion and application of the market.

附图说明Description of drawings

图1是本发明实施例提供的一种图像的预处理方法的流程图;1 is a flowchart of an image preprocessing method provided by an embodiment of the present invention;

图2a为本发明实施例提供的包含有摩尔纹的屏幕拍照图像的效果示意图;2a is a schematic diagram of the effect of a screen photographed image including moiré patterns provided by an embodiment of the present invention;

图2b为图2a经过初步膨胀腐蚀处理后的效果示意图;Fig. 2b is a schematic diagram of the effect of Fig. 2a after preliminary expansion corrosion treatment;

图3a为本发明实施例提供的文本文档屏幕拍照的效果示意图;3a is a schematic diagram of the effect of taking a picture of a text document screen provided by an embodiment of the present invention;

图3b为图3a中分块后的一个子图像块的效果示意图;Fig. 3b is a schematic diagram of the effect of a sub-image block after being divided into blocks in Fig. 3a;

图3c为图3b所对应的灰度直方图分布的效果示意图;Figure 3c is a schematic diagram of the effect of the distribution of the grayscale histogram corresponding to Figure 3b;

图4为本发明实施例提供的在灰度直方图分布中寻找左侧边界点的示意图;4 is a schematic diagram of finding a left boundary point in a grayscale histogram distribution according to an embodiment of the present invention;

图5为本发明实施例提供的在灰度直方图分布中计算左侧边界点处的变化斜率k的效果示意图;5 is a schematic diagram of the effect of calculating the change slope k at the left boundary point in the grayscale histogram distribution according to an embodiment of the present invention;

图6是本发明实施例提供的通过手机对纸质文档拍照后得到的文档图像的效果示意图;6 is a schematic diagram of the effect of a document image obtained by taking a picture of a paper document with a mobile phone according to an embodiment of the present invention;

图7为图3a直接OCR的结果示意图;Fig. 7 is the result schematic diagram of direct OCR of Fig. 3a;

图8为图6直接OCR的结果示意图;Fig. 8 is a schematic diagram of the result of the direct OCR of Fig. 6;

图9为图3a进行二值化预处理后的效果示意图;Figure 9 is a schematic diagram of the effect of Figure 3a after binarization preprocessing;

图10为图6进行二值化预处理后的效果示意图;FIG. 10 is a schematic diagram of the effect of FIG. 6 after binarization preprocessing;

图11为使用图9进行OCR的识别结果的示意图;Fig. 11 is a schematic diagram of the identification result of OCR using Fig. 9;

图12为使用图10进行OCR的识别结果的示意图;Figure 12 is a schematic diagram of the identification result of OCR using Figure 10;

图13为本发明实施例提供的一种图像的预处理装置的结构示意图;13 is a schematic structural diagram of an apparatus for preprocessing an image according to an embodiment of the present invention;

图14为本发明实施例提供的一种图像的预处理终端的结构示意图。FIG. 14 is a schematic structural diagram of an image preprocessing terminal according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明的说明书和权利要求书的术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤的过程或结构的装置不必限于清楚地列出的那些结构或步骤而是可包括没有清楚地列出的或对于这些过程或装置固有的其它步骤或结构。The terms "comprising" and "having" and any variations thereof in the description and claims of the present invention are intended to cover the non-exclusive inclusion, eg, a process or structure comprising a series of steps, not necessarily limited to those expressly listed Instead, those structures or steps may include other steps or structures not expressly listed or inherent to the processes or apparatus.

图1是本发明实施例提供的一种图像的预处理方法的流程图,参考附图1所示,本发明实施例提供一种图像的预处理方法,具体是基于统计灰度直方图分布的文本图像分块二值化预处理方法,该方法可以由一种图像的预处理装置来执行,包括:FIG. 1 is a flowchart of an image preprocessing method provided by an embodiment of the present invention. Referring to FIG. 1, an embodiment of the present invention provides an image preprocessing method, specifically based on the distribution of statistical grayscale histograms. A text image block binarization preprocessing method, which can be performed by an image preprocessing device, includes:

S1:将预先获取的原始文本图像转换为灰度图像I;S1: Convert the pre-acquired original text image into a grayscale image I;

其中,预先获取的原始文本图像可以为通过移动设备拍照所获取的图像,移动设备包括:数码相机、手机、掌上电脑等。Wherein, the pre-acquired original text image may be an image obtained by photographing a mobile device, and the mobile device includes a digital camera, a mobile phone, a handheld computer, and the like.

S2:对灰度图像I进行膨胀腐蚀处理,获得处理后图像I';S2: Perform expansion and corrosion processing on the grayscale image I to obtain the processed image I';

其中,对于电子文档通过屏幕拍照所获取的图像而言,由于拍照手机、数码相机等设备中摄像头的分辨率与电脑显示器的屏幕刷新频率存在差异,使得经屏幕拍照后的文档图像在背景区域不可避免的产生大量干涉条纹,严重影响文字的识别。为了消除大量的干涉条纹,同时提高文档图像前景与背景的对比度,需要针对灰度图像I进行形态学意义上的膨胀腐蚀操作。Among them, for the images obtained by taking pictures of electronic documents on the screen, due to the difference between the resolution of cameras in camera phones, digital cameras and other equipment and the screen refresh frequency of computer monitors, the document images after taking pictures on the screen cannot be seen in the background area. A large number of interference fringes are avoided, which seriously affects the recognition of characters. In order to eliminate a large number of interference fringes and at the same time improve the contrast between the foreground and background of the document image, it is necessary to perform the dilation and corrosion operation in the morphological sense for the grayscale image I.

形态学操作就是基于形状的一系列图像处理操作,通过将结构元素作用于输入图像来产生输出图像。基本的形态学操作有腐蚀与膨胀,此处的对灰度图像进行膨胀腐蚀处理可以包括:将灰度图像I的图像区域A与预先设置的内核B做卷积操作,其中,内核B包括正方形、矩形、菱形或者空心圆形中的任意一种;较为优选的,内核B的半径r设置为2。需要注意的是,内核有一个可定义的锚点,通常定义为内核中心点。Morphological operations are a series of image processing operations based on shape, which produce an output image by applying structural elements to the input image. The basic morphological operations include erosion and dilation. The dilation and erosion processing of the grayscale image here may include: convolving the image area A of the grayscale image I with a preset kernel B, where the kernel B includes a square , a rectangle, a rhombus or a hollow circle; more preferably, the radius r of the inner core B is set to 2. Note that the kernel has a definable anchor point, usually defined as the kernel center point.

所谓膨胀操作,是指将内核B划过图像,将内核B覆盖区域的最大像素值提取,并代替锚点位置的像素。显然这一最大化操作会导致图像中的亮区开始“扩展”。The so-called dilation operation means that the kernel B is drawn across the image, the maximum pixel value of the area covered by the kernel B is extracted, and the pixels at the anchor point are replaced. Obviously this maximization causes the bright areas in the image to start "expanding".

灰度图像的膨胀运算的数学定义为:The mathematical definition of the dilation operation for grayscale images is:

g(x,y)=dilate[f(x,y),B]=max{f(x-x′,y-y′)+B(x′,y′)|(x′,y′)∈Db}g(x,y)=dilate[f(x,y),B]=max{f(x-x',y-y')+B(x',y')|(x',y')∈Db}

其中,g(x,y)为膨胀后的灰度图像,f(x,y)为原灰度图像,B为内核结构元素。Among them, g(x, y) is the expanded grayscale image, f(x,y) is the original grayscale image, and B is the kernel structure element.

所谓腐蚀是指提取的是内核B覆盖下的像素最小值;进行腐蚀操作时,将内核B划过图像,将内核B覆盖区域的最小像素值提取,并代替锚点位置像素,腐蚀操作的结果是图片亮区变细,黑色区域变大。The so-called corrosion refers to the extraction of the minimum value of the pixel covered by the kernel B; when performing the corrosion operation, the kernel B is drawn across the image, and the minimum pixel value of the area covered by the kernel B is extracted, and replaces the anchor position pixel, the result of the corrosion operation The bright areas of the picture become thinner and the black areas become larger.

灰度图像的腐蚀运算的数学定义为:The mathematical definition of the erosion operation for grayscale images is:

g(x,y)=erode[f(x,y),B]=min{f(x+x′,y+y′)-B(x′,y′)|(x′,y′)∈Db}g(x,y)=erode[f(x,y),B]=min{f(x+x',y+y')-B(x',y')|(x',y') ∈Db}

其中,g(x,y)为腐蚀后的灰度图像,f(x,y)为原灰度图像,B为内核结构元素。Among them, g(x, y) is the grayscale image after corrosion, f(x,y) is the original grayscale image, and B is the kernel structure element.

对灰度图像I进行膨胀腐蚀运算得到图像I',其目的是针对屏幕拍照后的文本文档图像而言,保留字体笔画结构的同时,削弱干涉条纹或噪声的干扰。比如图2a包含有摩尔纹的屏幕拍照图像效果示意图,图2b为图2a初步膨胀腐蚀后的结果。从图2b可以看出膨胀腐蚀后的灰度图像的摩尔纹的纹路效果明显减弱。The image I' is obtained by performing the expansion and erosion operation on the grayscale image I, and its purpose is to reduce the interference of interference fringes or noise while preserving the stroke structure of the font for the text document image after the screen is photographed. For example, Fig. 2a contains a schematic diagram of the effect of a screen photographed image with moiré patterns, and Fig. 2b is the result of the preliminary expansion and corrosion of Fig. 2a. It can be seen from Figure 2b that the texture effect of the moiré pattern of the grayscale image after expansion and corrosion is significantly weakened.

S3:将处理后图像I'划分为若干个预设大小的子图像块;S3: Divide the processed image I' into several sub-image blocks of preset size;

其中,本实施例对于将处理后图像I'划分的子图像块的个数和划分方式不做限定,本领域技术人员可以根据具体的设计需求进行设置,其中,为了能够适应明暗不均的拍照图像,较为优选的,将膨胀腐蚀后的处理后图像I'平均分为m*m大小的子图像块Ψ。需要说明的是,在对处理后图像I'进行分块时,若图像分块较小,会导致子图像块中包含的内容过于单一、无法有效的统计灰度直方图分布的信息;若图像的分块过大,导致子图像块中的内容过多,例如:同一个子图像分块中可能出现图像明暗度差异过大等现象导致削弱后续灰度直方图分布本应出现的统计特性。因此,子图像块的宽度和高度的大小区间为200-350个像素最佳。在本实施例中,每个子图像块的宽度和高度m都等于256。Wherein, the present embodiment does not limit the number and division method of the sub-image blocks into which the processed image I′ is divided, and those skilled in the art can set it according to specific design requirements, wherein, in order to be able to adapt to photos with uneven light and dark For the image, preferably, the processed image I′ after the dilation and erosion is evenly divided into sub-image blocks Ψ of size m*m. It should be noted that when the processed image I' is divided into blocks, if the image blocks are small, the content contained in the sub-image blocks will be too single, and the information of the gray histogram distribution cannot be effectively counted; The sub-image block is too large, resulting in too much content in the sub-image block. For example, there may be a large difference in image brightness and darkness in the same sub-image block, which weakens the statistical characteristics that should appear in the subsequent grayscale histogram distribution. Therefore, the width and height of the sub-image blocks are optimal in the range of 200-350 pixels. In this embodiment, the width and height m of each sub-image block are equal to 256.

S4:确定每个子图像块中前景文字和背景底纹的灰度直方图分界拐点,并获取灰度直方图分界拐点处的像素值;S4: Determine the inflection point of the boundary of the grayscale histogram of the foreground text and the background shading in each sub-image block, and obtain the pixel value at the inflection point of the boundary of the grayscale histogram;

其中,确定每个子图像块中前景文字和背景底纹的灰度直方图分界拐点的具体实现过程可以包括:根据每个子图像块获取与子图像块相对应的灰度直方图分布;获取灰度直方图分布的分布特征,并根据分布特征确定每个子图像块中前景文字和背景底纹的灰度直方图分界拐点。The specific implementation process of determining the boundary point of the grayscale histogram between the foreground text and the background shading in each sub-image block may include: obtaining the grayscale histogram distribution corresponding to the sub-image block according to each sub-image block; obtaining the grayscale histogram distribution; According to the distribution characteristics of the histogram distribution, the inflection point of the gray histogram boundary between the foreground text and the background shading in each sub-image block is determined.

具体应用时,可以分别针对每一个子图像块Ψ进行统计分析,并计算得到其灰度直方图分布H(Ψ);比如图3a为文本文档屏幕拍照示意图,图3b为图3a分块后的一个子图像块Ψ,图3c为图3a所对应的灰度直方图分布效果示意图。从放大后的图3b效果可以看出,屏幕拍照的图像背景中存在严重的摩尔纹干涉情况。In specific applications, statistical analysis can be performed for each sub-image block Ψ, and its grayscale histogram distribution H(Ψ) can be obtained by calculation; for example, Fig. 3a is a schematic diagram of a text document screen photographing, and Fig. 3b is a block diagram of Fig. 3a. A sub-image block Ψ, Fig. 3c is a schematic diagram of the distribution effect of the grayscale histogram corresponding to Fig. 3a. It can be seen from the enlarged effect of Figure 3b that there is serious moiré interference in the background of the image captured by the screen.

进一步的,根据分布特征确定每个子图像块中前景文字和背景底纹的灰度直方图分界拐点可以包括:Further, determining the inflection point of the gray histogram boundary between the foreground text and the background shading in each sub-image block according to the distribution feature may include:

根据灰度直方图分布特征确定灰度直方图分布中的左侧边界点Left和预设标记点Point;Determine the left boundary point Left and the preset marker point Point in the grayscale histogram distribution according to the distribution characteristics of the grayscale histogram;

若左侧边界点Left大于预设标记点Point,则根据公式

Figure GDA0003114778080000121
确定灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Left为左侧边界点,Point为预设标记点;或者If the left boundary point Left is greater than the preset mark point Point, then according to the formula
Figure GDA0003114778080000121
Determine the inflection point of the gray histogram boundary, where TH is the inflection point of the gray histogram boundary, Left is the left boundary point, and Point is the preset marker point; or

若左侧边界点Left小于预设标记点Point,则根据公式TH=Point确定灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Point为预设标记点。If the left boundary point Left is smaller than the preset marker point Point, the inflection point of the gray histogram boundary is determined according to the formula TH=Point, where TH is the inflection point of the gray histogram boundary, and Point is the preset marker point.

本实施例中,通过简单的直方图遍历搜索而获得阈值拐点,计算方法简单,运行效率高。In this embodiment, the threshold inflection point is obtained through a simple histogram traversal search, the calculation method is simple, and the operation efficiency is high.

进一步的,在上述实现过程中,根据灰度直方图分布特征确定灰度直方图分布中的左侧边界点可以包括:Further, in the above implementation process, determining the left boundary point in the grayscale histogram distribution according to the grayscale histogram distribution characteristics may include:

根据灰度直方图分布特征确定灰度直方图分布的波峰位置;Determine the peak position of the gray histogram distribution according to the distribution characteristics of the gray histogram;

具体的,根据灰度直方图分布特征确定灰度直方图分布的波峰位置可以包括:确定由灰度直方图分布中的预设位置所构成的位置集合,其中,预设位置的高度大于预设高度阈值;获取位置集合中每个位置的像素数目;Specifically, determining the peak position of the grayscale histogram distribution according to the grayscale histogram distribution feature may include: determining a position set composed of preset positions in the grayscale histogram distribution, wherein the height of the preset position is greater than the preset height Height threshold; get the number of pixels at each location in the location set;

将位置集合中像素数目最大的位置确定为灰度直方图分布的波峰位置;也即:通过分析每个子图像块对应的灰度直方图分布特征,寻找直方图的波峰位置Peak,判断条件为:该位置处的灰度直方图最高,即相应的Peak处的像素个数H(Peak)最大,且Peak大于预设高度阈值T1,T1为60,并以此点作为统计直方图的中心点。The position with the largest number of pixels in the position set is determined as the peak position of the grayscale histogram distribution; that is, by analyzing the distribution characteristics of the grayscale histogram corresponding to each sub-image block, the peak position Peak of the histogram is found, and the judgment condition is: The grayscale histogram at this position is the highest, that is, the number of pixels H (Peak) at the corresponding Peak is the largest, and the Peak is greater than the preset height threshold T1, T1 is 60, and this point is used as the center point of the statistical histogram.

在确定波峰位置之后,可以从灰度直方图分布的波峰位置依次按照像素数目递减的顺序在灰度直方图分布中进行搜索;将搜索到的各个位置的像素数目依次相加,直至像素数目的总和与全部像素数目的总和的比值达到预先设置的像素值阈值比例为止;将灰度直方图分布中的左侧位置确定为左侧边界点。After determining the peak position, you can search in the grayscale histogram distribution in the order of decreasing pixel number from the peak position of the grayscale histogram distribution; add the number of pixels in each searched position in turn, until the number of pixels reaches The ratio of the sum to the sum of all pixel numbers reaches a preset pixel value threshold ratio; the left position in the grayscale histogram distribution is determined as the left boundary point.

具体的,从最高的波峰位置Peak依次根据灰度直方图分布次大的顺序搜索,比如图4所示,依次找次高和第三高等;按照相同的方法将所有遍历的灰度直方图分布中的像素数目相加得到φ,直到φ占整个灰度直方图分布包含的像素数目总和的比例达到T2为止;最后分别记录左右两边的直方图位置为Left和Right,并分别称之为中心区域的左侧边界点和右侧边界点,其中Left和Right为0-255之间的整数。T2的取值范围为85%-95%之间。在本实施例中,T2可以设置为92%。Specifically, from the highest peak position Peak, according to the order of the second largest distribution of gray histograms, for example, as shown in Figure 4, search for the second highest and the third highest in turn; according to the same method, all traversed gray histograms are distributed The number of pixels in the grayscale is added to obtain φ, until the proportion of φ to the total number of pixels contained in the entire grayscale histogram distribution reaches T2; finally, the histogram positions on the left and right sides are respectively recorded as Left and Right, and they are called the central area respectively. The left and right boundary points of , where Left and Right are integers between 0-255. The value range of T2 is between 85% and 95%. In this embodiment, T2 can be set to 92%.

进一步的,在确定左侧边界点之后,可以根据灰度直方图分布特征确定预设标记点,具体的,根据灰度直方图分布特征确定灰度直方图分布中的预设标记点可以包括:Further, after the left boundary point is determined, the preset marker point may be determined according to the distribution feature of the grayscale histogram. Specifically, the determination of the preset marker point in the grayscale histogram distribution according to the distribution feature of the grayscale histogram may include:

获取左侧边界点处的变化斜率;Get the slope of change at the left boundary point;

如图5示,l为当前的点,l-5和l+5分别为l前面第5个点和后面第5个点;要计算的k值,即为l-5和l+5两个点连成的直线段的斜率;也即,获取左侧边界点处的变化斜率的具体步骤可以包括:获取波峰位置相对于灰度直方图分布的像素比例值、位于左侧边界点左边的第五个点所对应的左侧像素数目以及位于左侧边界点右边的第五个点所对应的右侧像素数目;根据像素比例值、左侧像素数目和右侧像素数目,并利用以下公式确定变化斜率:As shown in Figure 5, l is the current point, l-5 and l+5 are the fifth point in front of l and the fifth point after l respectively; the k value to be calculated is two l-5 and l+5 The slope of the straight line segment formed by the points; that is, the specific steps of obtaining the change slope at the left boundary point may include: obtaining the pixel ratio value of the peak position relative to the distribution of the gray histogram, The number of pixels on the left side corresponding to the five points and the number of pixels on the right side corresponding to the fifth point located to the right of the left boundary point; according to the pixel ratio value, the number of pixels on the left side and the number of pixels on the right side, and determined by the following formula Slope of change:

Figure GDA0003114778080000131
Figure GDA0003114778080000131

其中,k为左侧边界点处的变化斜率,H(l-5)为位于左侧边界点左边的第五个点所对应的左侧像素数目,H(l+5)为位于左侧边界点右边的第五个点所对应的右侧像素数目,ratio为波峰位置相对于灰度直方图分布的像素比例值。Among them, k is the change slope at the left boundary point, H(l-5) is the number of left pixels corresponding to the fifth point to the left of the left boundary point, and H(l+5) is the left boundary The number of pixels on the right corresponding to the fifth point to the right of the point, ratio is the pixel ratio value of the peak position relative to the distribution of the grayscale histogram.

其中,获取波峰位置相对于灰度直方图分布的像素比例值可以包括:Wherein, obtaining the pixel ratio value of the peak position relative to the grayscale histogram distribution may include:

获取波峰位置的像素数目;将波峰位置的像素数目与256的比值作为波峰位置相对于灰度直方图分布的像素比例值。即:Obtain the number of pixels at the peak position; take the ratio of the number of pixels at the peak position to 256 as the pixel ratio value of the peak position relative to the grayscale histogram distribution. which is:

Figure GDA0003114778080000141
Figure GDA0003114778080000141

其中,ratio为波峰位置相对于灰度直方图分布的像素比例值,H(peak)为波峰位置的像素数目。Among them, ratio is the pixel ratio value of the peak position relative to the gray histogram distribution, and H(peak) is the number of pixels at the peak position.

在获取到变化斜率之后,需要对变化斜率进行分析处理,具体的,将变化斜率与1进行对比;After the change slope is obtained, the change slope needs to be analyzed and processed. Specifically, the change slope is compared with 1;

若变化斜率小于1,则在灰度直方图分布中从左侧边界点向右移动搜寻,直至所搜寻到的位置处的变化斜率大于或等于1;将在灰度直方图分布中搜寻到的位置点作为预设标记点;即:如果k<1,则从Left向左移动搜寻,直到k≥1,记录该点的位置为Point。或者,If the change slope is less than 1, move the search from the left boundary point to the right in the gray histogram distribution until the change slope at the searched position is greater than or equal to 1; The position point is used as the preset mark point; that is, if k<1, move to the left from Left to search until k≥1, and record the position of this point as Point. or,

若变化斜率大于1,则在灰度直方图分布中从左侧边界点向左移动搜寻,直至所搜寻到的位置处的变化斜率小于或等于1;将在灰度直方图分布中搜寻到的位置点作为预设标记点。即:如果k>1,则从Left向左移动搜寻,直到k≤1,记录该点的位置为Point。If the change slope is greater than 1, move the search from the left boundary point to the left in the grayscale histogram distribution until the change slope at the searched position is less than or equal to 1; The location point is used as the preset marker point. That is: if k>1, move to the left from Left to search until k≤1, and record the position of the point as Point.

S5:根据灰度直方图分界拐点处的像素值对子图像块进行二值化处理,获得与子图像块相对应的黑白二值子图像块;S5: binarize the sub-image block according to the pixel value at the inflection point of the gray histogram boundary, to obtain a black and white binary sub-image block corresponding to the sub-image block;

S6:将所有的黑白二值子图像块整合为与灰度图像相对应的二值图像。S6: Integrate all the black and white binary sub-image blocks into a binary image corresponding to the grayscale image.

为了说明本实施例的效果,以两幅图像为例进行效果显示:图2a包含有摩尔纹的屏幕拍照图像效果示意图;图6为通过手机对纸质文档拍照后得到的文档图像效果示意图,其中纸质经过了手工褶皱、撕毁和茶水浸泡等攻击性操作,曝光度明显不均,并且存在大量的由于经污损噪音黑点。图7为图3a直接OCR的结果示意图,图8为图6直接进行OCR的效果示意图,可以看出这两种情况下的OCR识别率相对较低。采用本发明的二值化预处理方法,图9为图3a进行二值化预处理后的效果示意图,图10为图6进行二值化预处理后的效果示意图。相应地,分别将经过二值化预处理的图像再次进行OCR识别。图11为使用图9进行OCR的识别结果示意图,图12为使用图10进行OCR的识别结果示意图。从图11和12所示的识别效果图可以看出,OCR的识别率明显大幅度提升。In order to illustrate the effect of the present embodiment, two images are taken as examples to display the effect: Fig. 2a includes a schematic diagram of the effect of a screen photographed image with moiré patterns; Fig. 6 is a schematic diagram of the effect of the document image obtained after the paper document is photographed by a mobile phone, wherein The paper has undergone aggressive manipulations such as manual creasing, tearing, and tea soaking, resulting in significantly uneven exposure and a large number of black spots due to defacement noise. Figure 7 is a schematic diagram of the result of direct OCR in Figure 3a, and Figure 8 is a schematic diagram of the effect of direct OCR in Figure 6. It can be seen that the OCR recognition rate in these two cases is relatively low. Using the binarization preprocessing method of the present invention, FIG. 9 is a schematic diagram of the effect after the binarization preprocessing in FIG. 3 a , and FIG. 10 is a schematic diagram of the effect after the binarization preprocessing in FIG. 6 . Correspondingly, the binarized preprocessed images are re-identified by OCR. FIG. 11 is a schematic diagram of the recognition result of OCR using FIG. 9 , and FIG. 12 is a schematic diagram of the recognition result of OCR performed using FIG. 10 . From the recognition renderings shown in Figures 11 and 12, it can be seen that the recognition rate of OCR is significantly improved.

本实施例提供的图像的预处理方法,通过对图像进行分块处理,根据每个子图像块的直方图的分布特性自适应的搜寻图像二值化阈值,可以有效区分出前景区域和背景区域,明显消除了图像拍摄的过程中引入的诸如大量干涉莫尔条纹、曝光度不均匀以及随机噪声干扰等因素带来的影响,明显提高了文本图像OCR识别的准确率,保证了该方法的实用性,有利于市场的推广与应用。In the image preprocessing method provided in this embodiment, the image is divided into blocks, and the image binarization threshold is adaptively searched according to the distribution characteristics of the histogram of each sub-image block, so that the foreground area and the background area can be effectively distinguished, The influence of factors such as a large number of interference moire fringes, uneven exposure and random noise interference introduced in the process of image shooting is obviously eliminated, the accuracy of OCR recognition of text images is significantly improved, and the practicability of the method is guaranteed. , which is conducive to the promotion and application of the market.

图13为本发明实施例提供的一种图像的预处理装置的结构示意图;参考附图13所示,本实施例提供了一种图像的预处理装置,包括:FIG. 13 is a schematic structural diagram of an image preprocessing apparatus provided by an embodiment of the present invention; with reference to FIG. 13 , this embodiment provides an image preprocessing apparatus, including:

转换模块1,用于将预先获取的原始文本图像转换为灰度图像;The conversion module 1 is used to convert the pre-acquired original text image into a grayscale image;

膨胀腐蚀模块2,用于对灰度图像进行膨胀腐蚀处理,获得处理后图像;The expansion and corrosion module 2 is used to perform expansion and corrosion processing on the grayscale image to obtain the processed image;

图像划分模块3,用于将处理后图像划分为若干个预设大小的子图像块;优选的,子图像块的宽度和高度均为256。The image dividing module 3 is used to divide the processed image into several sub-image blocks of preset size; preferably, the width and height of the sub-image blocks are both 256.

确定模块4,用于确定每个子图像块中前景文字和背景底纹的灰度直方图分界拐点,并获取灰度直方图分界拐点处的像素值;Determining module 4 is used to determine the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each sub-image block, and obtain the pixel value at the inflection point of the grayscale histogram boundary;

二值化处理模块5,用于根据灰度直方图分界拐点处的像素值对子图像块进行二值化处理,获得与子图像块相对应的黑白二值子图像块;The binarization processing module 5 is used to perform binarization processing on the sub-image block according to the pixel value at the inflection point of the gray histogram boundary to obtain a black and white binary sub-image block corresponding to the sub-image block;

整合模块6,用于将所有的黑白二值子图像块整合为与灰度图像相对应的二值图像。The integration module 6 is used to integrate all the black and white binary sub-image blocks into a binary image corresponding to the grayscale image.

其中,在确定模块4确定每个子图像块中前景文字和背景底纹的灰度直方图分界拐点时,该确定模块4具体用于:Wherein, when the determination module 4 determines the inflection point of the gray histogram boundary between the foreground text and the background shading in each sub-image block, the determination module 4 is specifically used for:

根据每个子图像块获取与子图像块相对应的灰度直方图分布;获取灰度直方图分布的分布特征,并根据分布特征确定每个子图像块中前景文字和背景底纹的灰度直方图分界拐点。Obtain the grayscale histogram distribution corresponding to the sub-image block according to each sub-image block; obtain the distribution characteristics of the gray-scale histogram distribution, and determine the gray-scale histogram of the foreground text and background shading in each sub-image block according to the distribution characteristics Demarcation point.

具体的,确定模块4根据分布特征确定每个子图像块中前景文字和背景底纹的灰度直方图分界拐点时,该确定模块4还用于:Specifically, when the determination module 4 determines the inflection point of the gray histogram boundary between the foreground text and the background shading in each sub-image block according to the distribution characteristics, the determination module 4 is also used for:

根据灰度直方图分布特征确定灰度直方图分布中的左侧边界点Left和预设标记点Point;Determine the left boundary point Left and the preset marker point Point in the grayscale histogram distribution according to the distribution characteristics of the grayscale histogram;

若左侧边界点Left大于预设标记点Point,则根据公式

Figure GDA0003114778080000161
确定灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Left为左侧边界点,Point为预设标记点;或者If the left boundary point Left is greater than the preset mark point Point, then according to the formula
Figure GDA0003114778080000161
Determine the inflection point of the gray histogram boundary, where TH is the inflection point of the gray histogram boundary, Left is the left boundary point, and Point is the preset marker point; or

若左侧边界点Left小于预设标记点Point,则根据公式TH=Point确定灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Point为预设标记点。If the left boundary point Left is smaller than the preset marker point Point, the inflection point of the gray histogram boundary is determined according to the formula TH=Point, where TH is the inflection point of the gray histogram boundary, and Point is the preset marker point.

进一步的,在确定模块4根据灰度直方图分布特征确定灰度直方图分布中的左侧边界点Left时,确定模块4还用于:Further, when the determination module 4 determines the left boundary point Left in the distribution of the grayscale histogram according to the distribution characteristics of the grayscale histogram, the determination module 4 is also used for:

根据灰度直方图分布特征确定灰度直方图分布的波峰位置;从灰度直方图分布的波峰位置依次按照像素数目递减的顺序在灰度直方图分布中进行搜索;将搜索到的各个位置的像素数目依次相加,直至像素数目的总和与全部像素数目的总和的比值达到预先设置的像素值阈值比例为止;将灰度直方图分布中的左侧位置确定为左侧边界点;其中,像素值阈值比例的取值范围为85%-95%之间。Determine the peak position of the grayscale histogram distribution according to the distribution characteristics of the grayscale histogram; search in the grayscale histogram distribution in the order of decreasing number of pixels from the peak position of the grayscale histogram distribution; The number of pixels is added in turn until the ratio of the sum of the number of pixels to the sum of the total number of pixels reaches the preset pixel value threshold ratio; the left position in the grayscale histogram distribution is determined as the left boundary point; The value range of the value threshold ratio is between 85%-95%.

其中,在确定模块4根据灰度直方图分布特征确定灰度直方图分布的波峰位置时,该确定模块4具体还用于:Wherein, when the determination module 4 determines the peak position of the grayscale histogram distribution according to the distribution characteristics of the grayscale histogram, the determination module 4 is specifically also used for:

确定由灰度直方图分布中的预设位置所构成的位置集合,其中,预设位置的高度大于预设高度阈值;获取位置集合中每个位置的像素数目;将位置集合中像素数目最大的位置确定为灰度直方图分布的波峰位置。Determine a position set composed of preset positions in the grayscale histogram distribution, wherein the height of the preset position is greater than the preset height threshold; obtain the number of pixels in each position in the position set; The position is determined as the peak position of the grayscale histogram distribution.

进一步的,在确定模块4根据灰度直方图分布特征确定灰度直方图分布中的左侧边界点Left和预设标记点Point时,该确定模块4具体还用于:Further, when the determination module 4 determines the left boundary point Left and the preset marker point Point in the distribution of the grayscale histogram according to the distribution characteristics of the grayscale histogram, the determination module 4 is specifically also used for:

获取左侧边界点处的变化斜率;若变化斜率小于1,则在灰度直方图分布中从左侧边界点向右移动搜寻,直至所搜寻到的位置处的变化斜率大于或等于1;将在灰度直方图分布中搜寻到的位置点作为预设标记点;或者,Obtain the change slope at the left boundary point; if the change slope is less than 1, move the search to the right from the left boundary point in the gray histogram distribution until the change slope at the searched position is greater than or equal to 1; The position points found in the grayscale histogram distribution are used as preset markers; or,

若变化斜率大于1,则在灰度直方图分布中从左侧边界点向左移动搜寻,直至所搜寻到的位置处的变化斜率小于或等于1;将在灰度直方图分布中搜寻到的位置点作为预设标记点。If the change slope is greater than 1, move the search from the left boundary point to the left in the grayscale histogram distribution until the change slope at the searched position is less than or equal to 1; The location point is used as the preset marker point.

进一步的,在确定模块4获取左侧边界点处的变化斜率时,该确定模块4还用于:Further, when the determination module 4 obtains the change slope at the left boundary point, the determination module 4 is also used for:

获取波峰位置相对于灰度直方图分布的像素比例值、位于左侧边界点左边的第五个点所对应的左侧像素数目以及位于左侧边界点右边的第五个点所对应的右侧像素数目;根据像素比例值、左侧像素数目和右侧像素数目,并利用以下公式确定变化斜率:Obtain the pixel ratio value of the peak position relative to the grayscale histogram distribution, the number of left pixels corresponding to the fifth point to the left of the left boundary point, and the right side corresponding to the fifth point to the right of the left boundary point Number of pixels; the slope of change is determined from the pixel scale value, the number of pixels on the left, and the number of pixels on the right, using the following formula:

Figure GDA0003114778080000171
Figure GDA0003114778080000171

其中,k为左侧边界点处的变化斜率,H(l-5)为位于左侧边界点左边的第五个点所对应的左侧像素数目,H(l+5)为位于左侧边界点右边的第五个点所对应的右侧像素数目,ratio为波峰位置相对于灰度直方图分布的像素比例值。Among them, k is the change slope at the left boundary point, H(l-5) is the number of left pixels corresponding to the fifth point to the left of the left boundary point, and H(l+5) is the left boundary The number of pixels on the right corresponding to the fifth point to the right of the point, ratio is the pixel ratio value of the peak position relative to the distribution of the grayscale histogram.

进一步的,确定模块4还用于:获取波峰位置的像素数目;将波峰位置的像素数目与256的比值作为波峰位置相对于灰度直方图分布的像素比例值。Further, the determining module 4 is further used for: acquiring the number of pixels at the peak position; and taking the ratio of the number of pixels at the peak position to 256 as the pixel ratio value of the peak position relative to the grayscale histogram distribution.

可选的,膨胀腐蚀模块2具体还用于:将灰度图像的图像区域与预先设置的内核做卷积操作,其中,内核包括正方形、矩形、菱形或者空心圆形中的任意一种。优选的,内核的半径为2。Optionally, the dilation and corrosion module 2 is further configured to perform a convolution operation on the image area of the grayscale image and a preset kernel, wherein the kernel includes any one of a square, a rectangle, a diamond, or a hollow circle. Preferably, the radius of the inner core is 2.

本实施例提供的图像的预处理装置能够用于执行图1实施例的方法,其具体执行方式和有益效果类似,在这里不再赘述。The image preprocessing apparatus provided in this embodiment can be used to execute the method of the embodiment in FIG. 1 , and the specific execution manner and beneficial effects thereof are similar, which will not be repeated here.

本发明实施例还提供一种图像的预处理终端,包括:The embodiment of the present invention also provides an image preprocessing terminal, including:

存储器;memory;

处理器;以及processor; and

计算机程序;Computer program;

其中,计算机程序存储在存储器中,并被配置为由处理器执行以实现上述的一种图像的预处理方法。Wherein, the computer program is stored in the memory and configured to be executed by the processor to realize the above-mentioned image preprocessing method.

具体的,图14为本发明实施例提供的图像的预处理终端的结构示意图。Specifically, FIG. 14 is a schematic structural diagram of an image preprocessing terminal according to an embodiment of the present invention.

如图所示,图像的预处理终端800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)接口812,传感器组件814,以及通信组件816。As shown, image preprocessing terminal 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, Sensor assembly 814 , and communication assembly 816 .

处理组件802通常控制图像的预处理终端800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operation of the terminal 800 for image preprocessing, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 can include one or more processors 820 to execute instructions to perform all or some of the steps of the methods described above. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

存储器804被配置为存储各种类型的数据以支持在图像的预处理终端800的操作。这些数据的示例包括用于在图像的预处理终端800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。Memory 804 is configured to store various types of data to support operation of terminal 800 in image preprocessing. Examples of such data include instructions for any application or method operating on the terminal 800 for preprocessing images, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.

电源组件806为图像的预处理终端800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为图像的预处理终端800生成、管理和分配电力相关联的组件。Power supply component 806 provides power to various components of image preprocessing terminal 800 . Power supply components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to preprocessing terminal 800 for images.

多媒体组件808包括在图像的预处理终端800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。The multimedia component 808 includes a screen that provides an output interface between the image preprocessing terminal 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. A touch sensor can sense not only the boundaries of a touch or swipe action, but also the duration and pressure associated with the touch or swipe action.

音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当图像的预处理终端800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。Audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the image preprocessing terminal 800 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or transmitted via communication component 816 . In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.

传感器组件814包括一个或多个传感器,用于为图像的预处理终端800提供各个方面的状态评估。例如,传感器组件814可以检测到图像的预处理终端800的打开/关闭状态,组件的相对定位,例如组件为图像的预处理终端800的显示器和小键盘,传感器组件814还可以检测图像的预处理终端800或图像的预处理终端800一个组件的位置改变,用户与图像的预处理终端800接触的存在或不存在,图像的预处理终端800方位或加速/减速和图像的预处理终端800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括摄像头组件,摄像头可采用如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。Sensor assembly 814 includes one or more sensors for providing status assessment of various aspects to terminal 800 for image preprocessing. For example, the sensor component 814 can detect the open/closed state of the image preprocessing terminal 800, the relative positioning of components, such as the display and keypad of the image preprocessing terminal 800, the sensor component 814 can also detect the preprocessing of the image Change of position of terminal 800 or a component of image preprocessing terminal 800, presence or absence of user contact with image preprocessing terminal 800, image preprocessing terminal 800 orientation or acceleration/deceleration and temperature of image preprocessing terminal 800 Variety. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 814 may also include a camera assembly, which may employ, for example, a CMOS or CCD image sensor for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

通信组件816被配置为便于图像的预处理终端800和其他设备之间有线或无线方式的通信。图像的预处理终端800可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 816 is configured to facilitate wired or wireless communication between the image processing terminal 800 and other devices. The image preprocessing terminal 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

在示例性实施例中,图像的预处理终端800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, the image preprocessing terminal 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs) , Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the above method.

本发明实施例第四方面提供一种计算机可读存储介质,其上存储有计算机程序;计算机程序被处理器执行以实现上述第一方面的一种图像的预处理方法。A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium on which a computer program is stored; the computer program is executed by a processor to implement an image preprocessing method according to the first aspect.

最后需要说明的是,本领域普通技术人员可以理解上述实施例方法中的全部或者部分流程,是可以通过计算机程序来指令相关的硬件完成,的程序可存储于一计算机可读存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,的存储介质可以为磁盘、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。Finally, it should be noted that those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it may include the flow of the embodiments of the above-mentioned methods. The storage medium may be a magnetic disk, an optical disk, a read only memory (ROM) or a random access memory (RAM), and the like.

本发明实施例中的各个功能单元可以集成在一个处理模块中,也可以是各个单元单独的物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现,并作为独立的产品销售或使用时,也可以存储在一个计算机可读存储介质中。上述提到的存储介质可以是只读存储器、磁盘或光盘等。Each functional unit in this embodiment of the present invention may be integrated into one processing module, or each unit may exist physically alone, or two or more units may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disk, or the like.

以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。The above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that the foregoing embodiments can still be used for The technical solutions described in the examples are modified, or some or all of the technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (18)

1.一种图像的预处理方法,其特征在于,包括:1. a preprocessing method of image, is characterized in that, comprises: 将预先获取的原始文本图像转换为灰度图像;Convert pre-acquired raw text images to grayscale images; 对所述灰度图像进行膨胀腐蚀处理,获得处理后图像;performing dilation and corrosion processing on the grayscale image to obtain a processed image; 将所述处理后图像划分为若干个预设大小的子图像块;dividing the processed image into several sub-image blocks of preset size; 确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点,并获取所述灰度直方图分界拐点处的像素值;Determine the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each of the sub-image blocks, and obtain the pixel value at the boundary inflection point of the grayscale histogram; 根据所述灰度直方图分界拐点处的像素值对所述子图像块进行二值化处理,获得与所述子图像块相对应的黑白二值子图像块;Perform binarization processing on the sub-image block according to the pixel value at the inflection point of the boundary of the grayscale histogram to obtain a black and white binary sub-image block corresponding to the sub-image block; 将所有的黑白二值子图像块整合为与所述灰度图像相对应的二值图像;integrating all black and white binary sub-image blocks into a binary image corresponding to the grayscale image; 其中,所述确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点,包括:Wherein, the determining the inflection point of the gray histogram boundary between the foreground text and the background shading in each of the sub-image blocks includes: 根据每个所述子图像块获取与所述子图像块相对应的灰度直方图分布;Obtaining a grayscale histogram distribution corresponding to the sub-image block according to each of the sub-image blocks; 获取所述灰度直方图分布的分布特征,并根据所述分布特征确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点;Obtaining the distribution features of the grayscale histogram distribution, and determining the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each of the sub-image blocks according to the distribution features; 其中,所述根据所述分布特征确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点,包括:Wherein, determining the inflection point of the gray histogram boundary between the foreground text and the background shading in each of the sub-image blocks according to the distribution features includes: 根据所述灰度直方图分布特征确定所述灰度直方图分布中的左侧边界点Left和预设标记点Point;Determine the left boundary point Left and the preset marker point Point in the distribution of the grayscale histogram according to the distribution characteristics of the grayscale histogram; 若所述左侧边界点Left大于预设标记点Point,则根据公式
Figure FDA0003114778070000011
确定所述灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Left为左侧边界点,Point为预设标记点;或者
If the left boundary point Left is greater than the preset mark point Point, then according to the formula
Figure FDA0003114778070000011
Determine the inflection point of the grayscale histogram boundary, where TH is the inflection point of the grayscale histogram boundary, Left is the left boundary point, and Point is a preset marker point; or
若所述左侧边界点Left小于预设标记点Point,则根据公式TH=Point确定所述灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Point为预设标记点;If the left boundary point Left is smaller than the preset mark point Point, then determine the inflection point of the gray histogram boundary according to the formula TH=Point, where TH is the inflection point of the gray histogram boundary, and Point is the preset mark point; 其中,所述根据所述灰度直方图分布特征确定所述灰度直方图分布中的左侧边界点,包括:Wherein, determining the left boundary point in the distribution of the grayscale histogram according to the distribution characteristics of the grayscale histogram includes: 根据所述灰度直方图分布特征确定所述灰度直方图分布的波峰位置;Determine the peak position of the grayscale histogram distribution according to the grayscale histogram distribution feature; 从所述灰度直方图分布的波峰位置依次按照像素数目递减的顺序在所述灰度直方图分布中进行搜索;Search in the grayscale histogram distribution in the order of decreasing pixel number from the peak positions of the grayscale histogram distribution; 将搜索到的各个位置的像素数目依次相加,直至所述像素数目的总和与全部像素数目的总和的比值达到预先设置的像素值阈值比例为止;The number of pixels in each position that is searched is added in turn, until the ratio of the sum of the number of pixels to the sum of the number of all pixels reaches a preset pixel value threshold ratio; 将所述灰度直方图分布中的左侧位置确定为所述左侧边界点;Determining the left position in the distribution of the grayscale histogram as the left boundary point; 其中,所述根据所述灰度直方图分布特征确定所述灰度直方图分布中的预设标记点,包括:Wherein, determining the preset marker points in the distribution of the grayscale histogram according to the distribution characteristics of the grayscale histogram includes: 获取所述左侧边界点处的变化斜率;obtaining the change slope at the left boundary point; 若所述变化斜率小于1,则在所述灰度直方图分布中从所述左侧边界点向右移动搜寻,直至所搜寻到的位置处的变化斜率大于或等于1;If the change slope is less than 1, move the search to the right from the left boundary point in the grayscale histogram distribution, until the change slope at the searched position is greater than or equal to 1; 将在所述灰度直方图分布中搜寻到的位置点作为所述预设标记点;或者,The position point found in the grayscale histogram distribution is used as the preset marker point; or, 若所述变化斜率大于1,则在所述灰度直方图分布中从所述左侧边界点向左移动搜寻,直至所搜寻到的位置处的变化斜率小于或等于1;If the change slope is greater than 1, move the search to the left from the left boundary point in the gray histogram distribution, until the change slope at the searched position is less than or equal to 1; 将在所述灰度直方图分布中搜寻到的位置点作为所述预设标记点。The position point found in the grayscale histogram distribution is used as the preset marker point.
2.根据权利要求1所述的方法,其特征在于,所述根据所述灰度直方图分布特征确定所述灰度直方图分布的波峰位置,包括:2 . The method according to claim 1 , wherein, determining the peak position of the grayscale histogram distribution according to the grayscale histogram distribution characteristics, comprising: 2 . 确定由所述灰度直方图分布中的预设位置所构成的位置集合,其中,所述预设位置的高度大于预设高度阈值;determining a position set consisting of preset positions in the grayscale histogram distribution, wherein the height of the preset position is greater than a preset height threshold; 获取所述位置集合中每个位置的像素数目;Obtain the number of pixels at each position in the set of positions; 将所述位置集合中像素数目最大的位置确定为所述灰度直方图分布的波峰位置。The position with the largest number of pixels in the position set is determined as the peak position of the grayscale histogram distribution. 3.根据权利要求1所述的方法,其特征在于,所述获取所述左侧边界点处的变化斜率,包括:3. The method according to claim 1, wherein the acquiring the change slope at the left boundary point comprises: 获取波峰位置相对于所述灰度直方图分布的像素比例值、位于所述左侧边界点左边的第五个点所对应的左侧像素数目以及位于所述左侧边界点右边的第五个点所对应的右侧像素数目;Obtain the pixel ratio value of the peak position relative to the distribution of the grayscale histogram, the number of left pixels corresponding to the fifth point located to the left of the left boundary point, and the fifth point located to the right of the left boundary point. The number of pixels on the right side corresponding to the point; 根据所述像素比例值、左侧像素数目和右侧像素数目,并利用以下公式确定所述变化斜率:According to the pixel scale value, the number of pixels on the left and the number of pixels on the right, the change slope is determined by the following formula:
Figure FDA0003114778070000021
Figure FDA0003114778070000021
其中,k为左侧边界点处的变化斜率,H(l-5)为位于左侧边界点左边的第五个点所对应的左侧像素数目,H(l+5)为位于左侧边界点右边的第五个点所对应的右侧像素数目,ratio为波峰位置相对于灰度直方图分布的像素比例值。Among them, k is the change slope at the left boundary point, H(l-5) is the number of left pixels corresponding to the fifth point to the left of the left boundary point, and H(l+5) is the left boundary The number of pixels on the right corresponding to the fifth point to the right of the point, ratio is the pixel ratio value of the peak position relative to the distribution of the grayscale histogram.
4.根据权利要求3所述的方法,其特征在于,所述获取所述波峰位置相对于所述灰度直方图分布的像素比例值,包括:4. The method according to claim 3, wherein the obtaining the pixel ratio value of the peak position relative to the distribution of the grayscale histogram comprises: 获取所述波峰位置的像素数目;Obtain the number of pixels at the peak position; 将所述波峰位置的像素数目与256的比值作为所述波峰位置相对于所述灰度直方图分布的像素比例值。The ratio of the number of pixels at the peak position to 256 is used as the pixel ratio value of the peak position relative to the grayscale histogram distribution. 5.根据权利要求1-4中任意一项所述的方法,其特征在于,所述对所述灰度图像进行膨胀腐蚀处理,包括:5. The method according to any one of claims 1-4, wherein the performing dilation and corrosion processing on the grayscale image comprises: 将所述灰度图像的图像区域与预先设置的内核做卷积操作,其中,所述内核包括正方形、矩形、菱形或者空心圆形中的任意一种。Perform a convolution operation on the image area of the grayscale image and a preset kernel, wherein the kernel includes any one of a square, a rectangle, a diamond, or a hollow circle. 6.根据权利要求5所述的方法,其特征在于,所述内核的半径为2。6. The method of claim 5, wherein the inner core has a radius of 2. 7.根据权利要求1-4中任意一项所述的方法,其特征在于,所述子图像块的宽度和高度均为256。7 . The method according to claim 1 , wherein the width and height of the sub-image block are both 256. 8 . 8.根据权利要求2所述的方法,其特征在于,所述像素值阈值比例的取值范围为85%-95%之间。8 . The method according to claim 2 , wherein the value range of the pixel value threshold ratio is between 85% and 95%. 9 . 9.一种图像的预处理装置,其特征在于,包括:9. An image preprocessing device, comprising: 转换模块,用于将预先获取的原始文本图像转换为灰度图像;A conversion module for converting the pre-acquired original text image into a grayscale image; 膨胀腐蚀模块,用于对所述灰度图像进行膨胀腐蚀处理,获得处理后图像;an expansion corrosion module, used for performing expansion corrosion processing on the grayscale image to obtain a processed image; 图像划分模块,用于将所述处理后图像划分为若干个预设大小的子图像块;an image division module, configured to divide the processed image into several sub-image blocks of preset sizes; 确定模块,用于确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点,并获取所述灰度直方图分界拐点处的像素值;A determination module, configured to determine the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each of the sub-image blocks, and obtain the pixel value at the inflection point of the grayscale histogram boundary; 二值化处理模块,用于根据所述灰度直方图分界拐点处的像素值对所述子图像块进行二值化处理,获得与所述子图像块相对应的黑白二值子图像块;A binarization processing module, configured to perform a binarization process on the sub-image block according to the pixel value at the inflection point of the gray histogram boundary to obtain a black and white binary sub-image block corresponding to the sub-image block; 整合模块,用于将所有的黑白二值子图像块整合为与所述灰度图像相对应的二值图像;an integration module for integrating all black and white binary sub-image blocks into a binary image corresponding to the grayscale image; 其中,所述确定模块,用于:Wherein, the determining module is used for: 根据每个所述子图像块获取与所述子图像块相对应的灰度直方图分布;Obtaining a grayscale histogram distribution corresponding to the sub-image block according to each of the sub-image blocks; 获取所述灰度直方图分布的分布特征,并根据所述分布特征确定每个所述子图像块中前景文字和背景底纹的灰度直方图分界拐点;Obtaining the distribution features of the grayscale histogram distribution, and determining the inflection point of the grayscale histogram boundary between the foreground text and the background shading in each of the sub-image blocks according to the distribution features; 所述确定模块,还用于:The determining module is also used for: 根据所述灰度直方图分布特征确定所述灰度直方图分布中的左侧边界点Left和预设标记点Point;Determine the left boundary point Left and the preset marker point Point in the distribution of the grayscale histogram according to the distribution characteristics of the grayscale histogram; 若所述左侧边界点Left大于预设标记点Point,则根据公式
Figure FDA0003114778070000041
确定所述灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Left为左侧边界点,Point为预设标记点;或者
If the left boundary point Left is greater than the preset mark point Point, then according to the formula
Figure FDA0003114778070000041
Determine the inflection point of the grayscale histogram boundary, where TH is the inflection point of the grayscale histogram boundary, Left is the left boundary point, and Point is a preset marker point; or
若所述左侧边界点Left小于预设标记点Point,则根据公式TH=Point确定所述灰度直方图分界拐点,其中,TH为灰度直方图分界拐点,Point为预设标记点;If the left boundary point Left is smaller than the preset mark point Point, then determine the inflection point of the gray histogram boundary according to the formula TH=Point, where TH is the inflection point of the gray histogram boundary, and Point is the preset mark point; 所述确定模块,还用于:The determining module is also used for: 根据所述灰度直方图分布特征确定所述灰度直方图分布的波峰位置;Determine the peak position of the grayscale histogram distribution according to the grayscale histogram distribution feature; 从所述灰度直方图分布的波峰位置依次按照像素数目递减的顺序在所述灰度直方图分布中进行搜索;Search in the grayscale histogram distribution in the order of decreasing pixel number from the peak positions of the grayscale histogram distribution; 将搜索到的各个位置的像素数目依次相加,直至所述像素数目的总和与全部像素数目的总和的比例达到预先设置的像素值阈值比例为止;The pixel numbers of the searched positions are added in turn, until the ratio of the sum of the pixel numbers to the sum of all the pixel numbers reaches a preset pixel value threshold ratio; 将所述灰度直方图分布中的左侧位置确定为所述左侧边界点;Determining the left position in the distribution of the grayscale histogram as the left boundary point; 所述确定模块,还用于:The determining module is also used for: 获取所述左侧边界点处的变化斜率;obtaining the change slope at the left boundary point; 若所述变化斜率小于1,则在所述灰度直方图分布中从所述左侧边界点向右移动搜寻,直至所搜寻到的位置处的变化斜率大于或等于1;If the change slope is less than 1, move the search to the right from the left boundary point in the grayscale histogram distribution, until the change slope at the searched position is greater than or equal to 1; 将在所述灰度直方图分布中搜寻到的位置点作为所述预设标记点;或者,The position point found in the grayscale histogram distribution is used as the preset marker point; or, 若所述变化斜率大于1,则在所述灰度直方图分布中从所述左侧边界点向左移动搜寻,直至所搜寻到的位置处的变化斜率小于或等于1;If the change slope is greater than 1, move the search to the left from the left boundary point in the gray histogram distribution, until the change slope at the searched position is less than or equal to 1; 将在所述灰度直方图分布中搜寻到的位置点作为所述预设标记点。The position point found in the grayscale histogram distribution is used as the preset marker point.
10.根据权利要求9所述的装置,其特征在于,所述确定模块,还用于:10. The apparatus according to claim 9, wherein the determining module is further configured to: 确定由所述灰度直方图分布中的预设位置所构成的位置集合,其中,所述预设位置的高度大于预设高度阈值;determining a position set consisting of preset positions in the grayscale histogram distribution, wherein the height of the preset position is greater than a preset height threshold; 获取所述位置集合中每个位置的像素数目;Obtain the number of pixels at each position in the set of positions; 将所述位置集合中像素数目最大的位置确定为所述灰度直方图分布的波峰位置。The position with the largest number of pixels in the position set is determined as the peak position of the grayscale histogram distribution. 11.根据权利要求9所述的装置,其特征在于,所述确定模块,还用于:11. The apparatus according to claim 9, wherein the determining module is further configured to: 获取所述波峰位置相对于所述灰度直方图分布的像素比例值、位于所述左侧边界点左边的第五个点所对应的左侧像素数目以及位于所述左侧边界点右边的第五个点所对应的右侧像素数目;Obtain the pixel ratio value of the peak position relative to the distribution of the grayscale histogram, the number of left pixels corresponding to the fifth point located to the left of the left boundary point, and the number of pixels located to the right of the left boundary point. The number of pixels on the right side corresponding to the five points; 根据所述像素比例值、左侧像素数目和右侧像素数目,并利用以下公式确定所述变化斜率:According to the pixel scale value, the number of pixels on the left and the number of pixels on the right, the change slope is determined by the following formula:
Figure FDA0003114778070000051
Figure FDA0003114778070000051
其中,k为左侧边界点处的变化斜率,H(l-5)为位于左侧边界点左边的第五个点所对应的左侧像素数目,H(l+5)为位于左侧边界点右边的第五个点所对应的右侧像素数目,ratio为波峰位置相对于灰度直方图分布的像素比例值。Among them, k is the change slope at the left boundary point, H(l-5) is the number of left pixels corresponding to the fifth point to the left of the left boundary point, and H(l+5) is the left boundary The number of pixels on the right corresponding to the fifth point to the right of the point, ratio is the pixel ratio value of the peak position relative to the distribution of the grayscale histogram.
12.根据权利要求11所述的装置,其特征在于,所述确定模块,还用于:12. The apparatus according to claim 11, wherein the determining module is further configured to: 获取所述波峰位置的像素数目;Obtain the number of pixels at the peak position; 将所述波峰位置的像素数目与256的比值作为所述波峰位置相对于所述灰度直方图分布的像素比例值。The ratio of the number of pixels at the peak position to 256 is used as the pixel ratio value of the peak position relative to the grayscale histogram distribution. 13.根据权利要求9-12中任意一项所述的装置,其特征在于,所述膨胀腐蚀模块,用于:13. The device according to any one of claims 9-12, wherein the expansion corrosion module is used for: 将所述灰度图像的图像区域与预先设置的内核做卷积操作,其中,所述内核包括正方形、矩形、菱形或者空心圆形中的任意一种。Perform a convolution operation on the image area of the grayscale image and a preset kernel, wherein the kernel includes any one of a square, a rectangle, a diamond, or a hollow circle. 14.根据权利要求13所述的装置,其特征在于,所述内核的半径为2。14. The apparatus of claim 13, wherein the inner core has a radius of 2. 15.根据权利要求9-12中任意一项所述的装置,其特征在于,所述子图像块的宽度和高度均为256。15 . The apparatus according to claim 9 , wherein the width and height of the sub-image blocks are both 256. 16 . 16.根据权利要求10所述的装置,其特征在于,所述像素值阈值比例的取值范围为85%-95%之间。16 . The device according to claim 10 , wherein the value range of the pixel value threshold ratio is between 85% and 95%. 17 . 17.一种图像的预处理终端,其特征在于,包括:17. An image preprocessing terminal, comprising: 存储器;memory; 处理器;以及processor; and 计算机程序;Computer program; 其中,所述计算机程序存储在所述存储器中,并被配置为由所述处理器执行以实现如权利要求1-8中任意一项所述的一种图像的预处理方法。Wherein, the computer program is stored in the memory and configured to be executed by the processor to implement an image preprocessing method according to any one of claims 1-8. 18.一种计算机可读存储介质,其特征在于,其上存储有计算机程序;18. A computer-readable storage medium, characterized in that a computer program is stored thereon; 所述计算机程序被处理器执行以实现如权利要求1-8中任意一项所述的一种图像的预处理方法。The computer program is executed by the processor to implement an image preprocessing method according to any one of claims 1-8.
CN201810233883.9A 2018-03-21 2018-03-21 Image preprocessing method, device, terminal and computer readable storage medium Expired - Fee Related CN110298811B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810233883.9A CN110298811B (en) 2018-03-21 2018-03-21 Image preprocessing method, device, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810233883.9A CN110298811B (en) 2018-03-21 2018-03-21 Image preprocessing method, device, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110298811A CN110298811A (en) 2019-10-01
CN110298811B true CN110298811B (en) 2021-10-26

Family

ID=68025297

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810233883.9A Expired - Fee Related CN110298811B (en) 2018-03-21 2018-03-21 Image preprocessing method, device, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110298811B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109300190B (en) * 2018-09-06 2021-08-10 百度在线网络技术(北京)有限公司 Three-dimensional data processing method, device, equipment and storage medium
CN111866584A (en) * 2019-10-08 2020-10-30 高新华 Automatic video content replacement system
CN112489058B (en) * 2020-12-03 2024-08-23 山东承势电子科技有限公司 Efficient and accurate stripe direction estimation method
CN112750136B (en) * 2020-12-30 2023-12-05 深圳英集芯科技股份有限公司 Image processing method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1622589A (en) * 2003-11-26 2005-06-01 松下电器产业株式会社 Image processing method and image processing apparatus
EP2779089A2 (en) * 2010-07-30 2014-09-17 Fundação D. Anna Sommer Champalimaud E Dr. Carlos Montez Champalimaud Systems and methods for segmentation and processing of tissue images and feature extraction from same for treating, diagnosing, or predicting medical conditions
CN107292311A (en) * 2017-08-10 2017-10-24 河南科技大学 A kind of recognition methods of the Characters Stuck identifying code based on neutral net
CN107609558A (en) * 2017-09-13 2018-01-19 北京元心科技有限公司 Character image processing method and processing device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9436983B2 (en) * 2013-06-14 2016-09-06 nLightn, Inc. Systems and methods for non-linear processing of image frames

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1622589A (en) * 2003-11-26 2005-06-01 松下电器产业株式会社 Image processing method and image processing apparatus
EP2779089A2 (en) * 2010-07-30 2014-09-17 Fundação D. Anna Sommer Champalimaud E Dr. Carlos Montez Champalimaud Systems and methods for segmentation and processing of tissue images and feature extraction from same for treating, diagnosing, or predicting medical conditions
CN107292311A (en) * 2017-08-10 2017-10-24 河南科技大学 A kind of recognition methods of the Characters Stuck identifying code based on neutral net
CN107609558A (en) * 2017-09-13 2018-01-19 北京元心科技有限公司 Character image processing method and processing device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Document image binarization using wavelets for OCR applications;C. Patvardhan等;《ICVGIP "12: Proceedings of the Eighth Indian Conference on Computer Vision》;20121231;1-8 *
复杂背景中维-汉混排字符串的分割技术研究;阿不都萨拉木·达吾提等;《激光杂志》;20140731;5-10 *

Also Published As

Publication number Publication date
CN110298811A (en) 2019-10-01

Similar Documents

Publication Publication Date Title
CN110298811B (en) Image preprocessing method, device, terminal and computer readable storage medium
CN106462766B (en) Image capture parameters adjustment is carried out in preview mode
CN106127751B (en) Image detection method, device and system
CN105528606B (en) Area recognizing method and device
WO2019104705A1 (en) Image processing method and device
KR101821750B1 (en) Picture processing method and device
CN105095881B (en) Face recognition method, face recognition device and terminal
CN106228556B (en) image quality analysis method and device
JP2003058894A (en) Method and device for segmenting pixeled image
CN110569835B (en) Image recognition method and device and electronic equipment
CN107091704B (en) Pressure detection method and device
CN104050645B (en) Image processing method and device
CN110619325A (en) Text recognition method and device
CN109784327B (en) Boundary box determining method and device, electronic equipment and storage medium
CN112906686A (en) Character recognition method and device, electronic equipment and storage medium
WO2015196681A1 (en) Picture processing method and electronic device
WO2023056950A1 (en) Image processing method and electronic device
CN108769527B (en) Scene identification method and device and terminal equipment
US20210174553A1 (en) Image processing method and apparatus, and storage medium
CN113553523A (en) Method, device, electronic device, medium and product for generating skeleton screen page
CN115249208A (en) Image processing method, video processing method and device, terminal and storage medium
CN114418865A (en) Image processing method, device, equipment and storage medium
CN115641269A (en) Image repairing method and device and readable storage medium
CN112016595A (en) Image classification method and device, electronic equipment and readable storage medium
CN113255412B (en) Document image processing method, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230328

Address after: 100871 No. 5, the Summer Palace Road, Beijing, Haidian District

Patentee after: Peking University

Address before: 100871 No. 5, the Summer Palace Road, Beijing, Haidian District

Patentee before: Peking University

Patentee before: PEKING UNIVERSITY FOUNDER GROUP Co.,Ltd.

Patentee before: BEIJING FOUNDER ELECTRONICS Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20211026

CF01 Termination of patent right due to non-payment of annual fee