Print Uyghur document image recognition system and method based on link segment

文档序号:1243116 发布日期:2020-08-18 浏览:12次 中文

阅读说明:本技术 基于连体段的印刷体维吾尔文文档图像识别系统及方法 (Print Uyghur document image recognition system and method based on link segment ) 是由 卢朝阳 李楠 李静 于 2020-04-27 设计创作,主要内容包括:本发明公开一种基于连体段的印刷体维吾尔文文档图像识别系统及方法,其实现的步骤为:(1)建立印刷体维吾尔文连体段的特征模板库;(2)输入待识别的印刷体维吾尔文文档图像;(3)对输入的文档图像进行预处理;(4)生成连体段图像;(5)对连体段图像进行预处理;(6)提取连体段图像的Gabor特征向量;(7)对连体段图像进行分类识别;(8)输出识别的文档图像对应的文本格式文档。本发明能对包含多个单词的印刷体维吾尔文文档图像进行识别,识别准确度高、识别速度快,能够按照印刷体维吾尔文文档图像的书写顺序和格式将文档图像转换为文本文档。(The invention discloses a printing Uyghur document image recognition system and method based on a link segment, which comprises the following steps: (1) establishing a characteristic template library of a print Uyghur character link section; (2) inputting a print Uyghur document image to be identified; (3) preprocessing an input document image; (4) generating a connected segment image; (5) preprocessing the image of the connected segment; (6) extracting Gabor characteristic vectors of the image of the continuous segment; (7) classifying and identifying the image of the connected segment; (8) and outputting the text format document corresponding to the identified document image. The invention can identify the print Uyghur document image containing a plurality of words, has high identification accuracy and high identification speed, and can convert the document image into the text document according to the writing sequence and format of the print Uyghur document image.)

1. The print Uyghur document image recognition system based on the connected segment is characterized by comprising a connected segment database module, a document image input module, a document image preprocessing module, a document image segmentation module, a connected segment image preprocessing module, a connected segment image feature extraction module, a connected segment classification recognition module and a document image output module;

the connected segment database module is used for constructing a characteristic template library of the printed Uygur language connected segment by collecting the commonly used printed Uygur language connected segments with different fonts and different character sizes and sending the characteristic template library to the connected segment classification and identification module;

the document image input module is used for inputting a print Uygur language document image to be identified and sending the input print Uygur language document image to be identified to the document image preprocessing module;

the document image preprocessing module is used for carrying out binarization, denoising and inclination correction on a printed Uyghur document image to be identified to obtain a preprocessed document image and sending the preprocessed document image to the document image segmentation module;

the document image segmentation module is used for segmenting the preprocessed document image to generate a connected segment image and sending the generated connected segment image to the connected segment image preprocessing module;

the connected segment image preprocessing module is used for carrying out size normalization processing on the connected segment image to obtain a preprocessed connected segment image and sending the preprocessed connected segment image to the connected segment image characteristic extraction module;

the connected segment image feature extraction module is used for extracting the feature vector of the preprocessed connected segment image and sending the feature vector of the connected segment image to the connected segment classification and identification module;

the connected segment classifying and identifying module is used for classifying and identifying the connected segment image and sending an identification result to the document image output module;

and the document image output module is used for outputting the text format document corresponding to the identified document image.

2. The system of claim 1, wherein the document image input module inputs the printed Uyghur document image by connecting a scanner or opening a picture.

3. The system of claim 1, wherein a feature template library of the print Uygur language link segment is established, and the link segment image in the input print Uygur language document image is output in an editable format by matching with the link segment image in the input print Uygur language document image, so as to convert the input print Uygur language document image into a document in a text format; the method comprises the following specific steps:

(1) establishing a characteristic template library of a print Uyghur character link segment:

(1a) the connected segment database module takes the common Uygur language connected segment as an acquisition object, and establishes at least 50 sets of printing Uygur language document images with different fonts and different sizes and only containing the common Uygur language connected segment;

(1b) segmenting each set of print Uygur language document image, and forming a data sample library of the print Uygur language connected segment images by using a plurality of generated connected segment image samples;

(1c) the connected segment database module performs size normalization processing on each connected segment image sample in the data sample library by using a bicubic interpolation algorithm, extracts a Gabor characteristic vector of each connected segment image sample, and forms all the Gabor characteristic vectors into a characteristic template library for printing a Uygur language connected segment;

(2) inputting a print Uyghur document image to be recognized:

the document image input module inputs a print Uyghur document image to be identified, which only contains Uyghur;

(3) preprocessing an input document image:

(3a) the document image preprocessing module carries out binarization processing on the input document image by utilizing a maximum between-class variance algorithm;

(3b) the document image preprocessing module carries out denoising processing on the image after the binarization processing by using a median filtering algorithm;

(3c) the document image preprocessing module performs tilt correction processing on the denoised binary image by using a method of combining a Fourier transform algorithm and a Hough transform algorithm to obtain a preprocessed document image;

(4) generating a connected segment image:

(4a) the document image segmentation module performs horizontal integral projection on the preprocessed document image, and the upper and lower boundaries of each region, of which the continuous horizontal integral projection is not zero, in the preprocessed document image are used as the upper and lower boundaries of each line of document image to obtain a plurality of lines of document images;

(4b) the document image segmentation module selects any unselected line document image from the multiple line document images, performs expansion processing on the selected line document image by using a morphological expansion algorithm, performs vertical integral projection on the expanded line document image, and takes the left and right boundaries of an area where each continuous vertical integral projection in the expanded line document image is not zero as the left and right boundaries of each word image to obtain multiple word images;

(4c) the document image segmentation module judges whether all the line document images in the multiple line document images are selected or not, if so, the step (4d) is executed after all the word images in the multiple line document images are obtained, and if not, the step (4b) is executed;

(4d) the document image segmentation module selects any one word image from the multiple word images, an eight-neighborhood seed filling connected domain algorithm is adopted, all connected domains in the selected word images are sequentially extracted, and the connected domains are combined according to the area of each connected domain, the distance between the connected domains and the association position relation of the main stroke part and the additional stroke part in the connected segment to obtain multiple connected segment images;

(4e) the document image segmentation module judges whether all the word images in the plurality of word images are selected or not, if so, the step (5) is executed after all the connected segment images in the plurality of word images are obtained, and if not, the step (4d) is executed;

(5) preprocessing the image of the connected segment:

the connected segment image preprocessing module is used for carrying out normalization processing on the size of each connected segment image by utilizing a bicubic interpolation algorithm to obtain a preprocessed connected segment image;

(6) extracting Gabor feature vectors of the image of the continuous segment:

(6a) the connected segment image feature extraction module performs reverse color processing on each preprocessed connected segment image to obtain a connected segment image after reverse color processing;

(6b) the connected segment image feature extraction module is used for extracting the upper part of each reversed connected segment image according to the following formula and the height and the width of the two-dimensional Gabor filterAdding G in the next two directionshG is added to the pixel point with the row pixel value of 0 in the left and right directionswAnd (3) arranging pixel points with pixel values of 0 to obtain a bordered connected segment image:

wherein G ishRepresenting the number of lines of pixel points increased in the upper and lower directions of the image of the connected segment after the color reversal, GaborHeigh representing the height of a Gabor filter window, GaborWidth representing the width of the Gabor filter window, GwThe column number of pixel points increased in the left direction and the right direction of the reversed connected segment image is represented;

(6c) the connected segment image feature extraction module performs convolution operation on each pixel point in the edged connected segment image and the real part of the two-dimensional Gabor filter by using the two-dimensional Gabor filter to obtain a filtered connected segment image;

(6d) the connected segment image feature extraction module divides the filtered connected segment image into n multiplied by n parts according to the uniform height and width to obtain n multiplied by n image blocks;

(6e) the connected segment image feature extraction module calculates the energy of each image block, and forms the energy values of all the image blocks into a feature vector of the filtered connected segment image to obtain a Gabor feature vector of the connected segment image to be identified;

(7) classifying and identifying the connected segment images:

(7a) the connected segment classification and identification module calculates the Euclidean distance between the feature vector of the connected segment image to be identified and the feature vector of each connected segment sample in the feature template library established in the connected segment database module;

(7b) the connected segment classification and identification module sorts Euclidean distances between the feature vector of the connected segment image to be identified and the feature vector of each connected segment sample in the feature template library established in the connected segment database module according to the sequence from small to large;

(7c) the link segment classification and identification module selects the class of the link segment with the minimum Euclidean distance from the link segment to be identified in the characteristic template library as the preferred class of the link segment image to be identified;

(8) outputting the text format document corresponding to the identified document image:

and the document image output module outputs the preferred type of the connected segment image to be identified according to the writing sequence and the writing format in the input print Uygur language document image, outputs the connected segment corresponding to the preferred type in an editable format, and outputs all the connected segments in the document image to obtain the text format document corresponding to the document image.

4. The method of claim 3, wherein the association of the main stroke portion and the additional stroke portion in the link segment in step (4d) is based on the relationship between the main stroke portion and the additional stroke portion, wherein the main stroke portion includes the additional stroke portion, the main stroke portion intersects the additional stroke portion, the additional stroke portion is located above the main stroke portion, and the additional stroke portion is located below the main stroke portion.

5. The method for image recognition of printed Uyghur document based on continuous segments as claimed in claim 3, wherein the step (4d) of merging connected components comprises the following steps:

step 1, selecting any one connected domain from all connected domains in the selected word image, and searching the nearest connected domain adjacent to the selected connected domain;

step 2, determining a main stroke part and an additional stroke part of the link section, classifying the selected connected domain and the connected domain nearest to the selected connected domain according to the area, setting the connected domain with the larger area as a main stroke part A of the link section, and setting the connected domain with the smaller area as an additional stroke part B of the link section;

step 3, judging whether the position relation of A and B belongs to any one of the correlation positions of the main part stroke part and the additional stroke part in the continuous body section according to the correlation position relation of the main part stroke part and the additional stroke part in the continuous body section, if so, merging the main stroke part and the additional stroke part which take A and B as a continuous body section, otherwise, executing the step 4;

step 4, if the connected domain B which meets the position relation condition of the main stroke part and the additional stroke part in the connected segment does not exist in the connected domain which is the nearest to the A, the A is an independent connected segment, and the A is used as an obtained connected segment image;

and 5, judging whether all connected domains in the selected word image are selected completely, if so, obtaining a plurality of connected segment images, and otherwise, executing the step 1.

6. The method of claim 3, wherein said calculating the energy of each image block in step (6e) is obtained by the following formula:

wherein e (k) represents the energy of the k-th image block in the n × n image blocks, s represents the total number of pixel points in the k-th image block,the method includes the steps that an open square operation is represented, i represents the serial number of a pixel point in a k-th image block, i is 1, 2.

Technical Field

The invention belongs to the technical field of optical character recognition, and further relates to a printed Uyghur document image recognition system and method based on a link segment in the technical field of optical character recognition. The invention can be used for identifying the printed Uygur language document image and outputting the printed Uygur language document image in a text format, thereby realizing the electronization of the printed Uygur language paper document.

Background

The printed Uygur paper document is electronized, which is beneficial to inheriting and developing Uygur culture, informatization development of Xinjiang areas and nationality uniting. Studies on the print-type igur recognition technology can be classified into character-based, link-based and word-based according to recognition objects. Currently, research on printed Uyghur document recognition usually selects words or characters as recognition units. Because Uyghur belongs to the adhesion type alphabetic writing, although the number of characters is small, the aspect ratio of the characters is not uniform, the similarity between the characters is high and the characters are mostly in an adhesion state, the character segmentation is extremely difficult, the character segmentation accuracy is low, and the recognition accuracy is low; for words, the number of the types of the words is large, so that the data acquisition work is time-consuming and labor-consuming, and the speed of classifying and identifying the words is slow; compared with characters and words, the method has the following advantages of selecting the link segment as the recognition unit: the splitting difficulty of the connected segment is moderate; the similarity between the connecting body sections is moderate; the number of types of the connecting body sections is moderate.

The patent document of Xinjiang university 'applied for' a high-precision matching algorithm for printing Uygur language word 'discloses a high-precision matching algorithm for printing Uygur language word images' (application number: CN201811612926.0, application publication number: CN 109766420A, application date: 2018-12-27), and the high-precision matching algorithm can be used for high-precision matching between the printing Uygur language word images. The matching calculation is realized by the following steps: step 1, obtaining local feature points of a retrieval picture and a matching picture by using SIFT features; step 2, carrying out feature matching on the local feature points; step 3, performing primary pre-matching on the number of matched results; and 4, performing projection transformation on the pre-matched feature objects after primary mapping treatment, and performing retrieval result identification on the matching words according to the projection transformation result to finish high-precision matching between the retrieval picture and the matching picture. Although the method can realize high-precision matching of the printed Uyghur word images and search a word to match all word combinations containing the word after optimization, the method still has the following defects: the method is suitable for recognizing the document image only containing one word and cannot be suitable for recognizing the document image containing a plurality of words, because the document image containing the plurality of words needs to be segmented to obtain a single word image, the method can be directly used, and therefore the method cannot be directly suitable for recognizing the document image containing the plurality of words.

The patent document "a method and system for recognizing characters of a wiki image" (application number: CN201910583713.8, application publication number: CN 110287952A, application date: 2019-09-27) applied by the company of chinese softscience and technology limited discloses a method and system for recognizing characters of a wiki image. The method adopts deep learning technology, and can realize detection and identification of the characters of the dimension picture. The method comprises the following concrete implementation steps: step 1, collecting an original picture, marking the picture, and taking the marked picture as a sample to be trained; step 2, inputting a sample to be trained into a CNN + BilSTM model to extract a characteristic vector and generate a Vietnamese text region positioning network model; step 3, inputting a sample to be trained into the CNN network and the BilSTM + CTC model to generate a dimensional language character recognition network model; and 4, detecting and identifying characters in the to-be-detected wiki pictures. The method has the following defects: the method has the advantages that the acquired original pictures are required to have diversity and multiple quantity, the marking process is very labor-consuming due to the multiple and complicated original pictures, and the error-free marking of the original pictures can be finished only by requiring a certain Uygur language basis for a marker in the marking process. Therefore, the unstable factors in the acquisition process of the sample to be trained are more, and the acquisition process is very difficult. Because the sample to be trained is the basis of the subsequent work, unstable factors in the original image acquisition and marking process can cause character detection or recognition errors in the subsequent work. The system disclosed by the patent document comprises an acquisition module, an area positioning model generation module, a first identification module, a character identification network model generation module and a second identification module, and can detect whether the pictures contain the dimensional characters and identify the characters in the dimensional pictures. The system has the following disadvantages: although the second recognition module of the system can recognize characters in the wiki picture, the writing sequence and format between the characters are not concerned when the second recognition module recognizes the characters, so that when the system recognizes the wiki picture, the sequence and format of the output characters and the characters in the picture are different, and the sequence and format of the output characters need to be corrected manually.

Disclosure of Invention

The present invention is directed to provide a print Uyghur document image recognition system and method based on a link segment, so as to solve the problems that the prior art cannot recognize a document image containing a plurality of words, cannot output the document image according to the writing order and format of the document image, and the like.

The specific idea for realizing the purpose of the invention is as follows: establishing a characteristic template library of a print Uygur language connector section, segmenting an input print Uygur language document image to generate a connector section image, matching and identifying the generated connector section image and the established characteristic template library of the print Uygur language connector section, and outputting the identified connector section image in an editable format according to the writing sequence and format of the print Uygur language document image to realize the conversion of the input print Uygur language document image into a document with a text format.

The print Uyghur document image recognition system comprises a connected segment database module, a document image input module, a document image preprocessing module, a document image segmentation module, a connected segment image preprocessing module, a connected segment image feature extraction module, a connected segment classification recognition module and a document image output module. Wherein:

the connected segment database module is used for constructing a characteristic template library of the printed Uygur language connected segment by collecting the commonly used printed Uygur language connected segments with different fonts and different character sizes and sending the characteristic template library to the connected segment classification and identification module;

the document image input module is used for inputting a print Uyghur document image to be identified and sending the input print Uyghur document image to be identified to the document image preprocessing module;

the document image preprocessing module is used for carrying out binarization, denoising and inclination correction on a printed Uyghur document image to be identified to obtain a preprocessed document image and sending the preprocessed document image to the document image segmentation module;

the document image segmentation module is used for segmenting the preprocessed document image to generate a connected segment image and sending the generated connected segment image to the connected segment image preprocessing module;

the image preprocessing module of the connected segment is used for carrying out size normalization processing on the connected segment image to obtain a preprocessed connected segment image and sending the preprocessed connected segment image to the image feature extraction module of the connected segment;

the connected segment image feature extraction module is used for extracting the feature vector of the preprocessed connected segment image and sending the feature vector of the connected segment image to the connected segment classification and identification module;

the connected segment classifying and identifying module is used for classifying and identifying the connected segment image and sending an identification result to the document image output module;

and the document image output module is used for outputting the text format document corresponding to the identified document image.

The method for identifying the Uyghur document image of the printed matter comprises the following specific steps of:

(1) establishing a characteristic template library of a print Uyghur character link segment:

(1a) the connected segment database module takes the common Uygur language connected segment as an acquisition object, and establishes at least 50 sets of printing Uygur language document images with different fonts and different sizes and only containing the common Uygur language connected segment;

(1b) segmenting each set of print Uygur language document image, and forming a data sample library of the print Uygur language connected segment images by using a plurality of generated connected segment image samples;

(1c) the connected segment database module performs size normalization processing on each connected segment image sample in the data sample library by using a bicubic interpolation algorithm, extracts a Gabor characteristic vector of each connected segment image sample, and forms all the Gabor characteristic vectors into a characteristic template library for printing a Uygur language connected segment;

(2) inputting a print Uyghur document image to be recognized:

the document image input module inputs a print Uyghur document image to be identified, which only contains Uyghur;

(3) preprocessing an input document image:

(3a) the document image preprocessing module carries out binarization processing on the input document image by utilizing a maximum between-class variance algorithm;

(3b) the document image preprocessing module carries out denoising processing on the image after the binarization processing by using a median filtering algorithm;

(3c) the document image preprocessing module performs tilt correction processing on the denoised binary image by using a method of combining a Fourier transform algorithm and a Hough transform algorithm to obtain a preprocessed document image;

(4) generating a connected segment image:

(4a) the document image segmentation module performs horizontal integral projection on the preprocessed document image, and the upper and lower boundaries of each region, of which the continuous horizontal integral projection is not zero, in the preprocessed document image are used as the upper and lower boundaries of each line of document image to obtain a plurality of lines of document images;

(4b) the document image segmentation module selects any unselected line document image from the multiple line document images, performs expansion processing on the selected line document image by using a morphological expansion algorithm, performs vertical integral projection on the expanded line document image, and takes the left and right boundaries of an area where each continuous vertical integral projection in the expanded line document image is not zero as the left and right boundaries of each word image to obtain multiple word images;

(4c) the document image segmentation module judges whether all the line document images in the multiple line document images are selected or not, if so, the step (4d) is executed after all the word images in the multiple line document images are obtained, and if not, the step (4b) is executed;

(4d) the document image segmentation module selects any one word image from the multiple word images, an eight-neighborhood seed filling connected domain algorithm is adopted, all connected domains in the selected word images are sequentially extracted, and the connected domains are combined according to the area of each connected domain, the distance between the connected domains and the association position relation of the main stroke part and the additional stroke part in the connected segment to obtain multiple connected segment images;

(4e) the document image segmentation module judges whether all the word images in the plurality of word images are selected or not, if so, the step (5) is executed after all the connected segment images in the plurality of word images are obtained, and if not, the step (4d) is executed;

(5) preprocessing the image of the connected segment:

the connected segment image preprocessing module is used for carrying out normalization processing on the size of each connected segment image by utilizing a bicubic interpolation algorithm to obtain a preprocessed connected segment image;

(6) extracting Gabor feature vectors of the image of the continuous segment:

(6a) the connected segment image feature extraction module performs reverse color processing on each preprocessed connected segment image to obtain a connected segment image after reverse color processing;

(6b) the connected segment image feature extraction module adds G to the upper and lower directions of each reversed connected segment image according to the following formula and the height and width of the two-dimensional Gabor filterhG is added to the pixel point with the row pixel value of 0 in the left and right directionswAnd (3) arranging pixel points with pixel values of 0 to obtain a bordered connected segment image:

wherein G ishRepresenting the number of lines of pixel points increased in the upper and lower directions of the image of the connected segment after the color reversal, GaborHeigh representing the height of a Gabor filter window, GaborWidth representing the width of the Gabor filter window, GwThe column number of pixel points increased in the left direction and the right direction of the reversed connected segment image is represented;

(6c) the connected segment image feature extraction module performs convolution operation on each pixel point in the edged connected segment image and the real part of the two-dimensional Gabor filter by using the two-dimensional Gabor filter to obtain a filtered connected segment image;

(6d) the connected segment image feature extraction module divides the filtered connected segment image into n multiplied by n parts according to the uniform height and width to obtain n multiplied by n image blocks;

(6e) the connected segment image feature extraction module calculates the energy of each image block, and forms the energy values of all the image blocks into a feature vector of the filtered connected segment image to obtain a Gabor feature vector of the connected segment image to be identified;

(7) classifying and identifying the connected segment images:

(7a) the connected segment classification and identification module calculates the Euclidean distance between the feature vector of the connected segment image to be identified and the feature vector of each connected segment sample in the feature template library established in the connected segment database module;

(7b) the connected segment classification and identification module sorts Euclidean distances between the feature vector of the connected segment image to be identified and the feature vector of each connected segment sample in the feature template library established in the connected segment database module according to the sequence from small to large;

(7c) the link segment classification and identification module selects the class of the link segment with the minimum Euclidean distance from the link segment to be identified in the characteristic template library as the preferred class of the link segment image to be identified;

(8) outputting the text format document corresponding to the identified document image:

and the document image output module outputs the preferred type of the connected segment image to be identified according to the writing sequence and the writing format in the input print Uygur language document image, outputs the connected segment corresponding to the preferred type in an editable format, and outputs all the connected segments in the document image to obtain the text format document corresponding to the document image.

Compared with the prior art, the invention has the following advantages:

first, the printed Uyghur document image recognition method of the present invention uses a printed Uyghur document image containing a plurality of words as a recognition object, and can recognize a document image containing a plurality of words, thereby overcoming the problem that the prior art can only recognize a document image containing one word, and having the advantage of recognizing a document image containing a plurality of words.

Secondly, the method for identifying the image of the printed Uygur language document of the invention divides the image of the printed Uygur language document to generate a connected segment image, and then identifies the image of the printed Uygur language document by taking the connected segment image as an identification unit, thereby overcoming the problems of low dividing accuracy and low identification accuracy of the image of the printed Uygur language document when the image of the printed Uygur language document is divided to generate the image of the characters due to the serious adhesion phenomenon among the characters in the prior art and also overcoming the problems of low identification speed of the image of the printed Uygur language document due to the long time consumption when the words are classified and identified because of various words when the image of the printed Uygur language document is identified by taking Uygur words as the identification unit in the prior art, the method has the advantages of high segmentation accuracy, high recognition accuracy and high recognition speed of the printed Uyghur document image.

Thirdly, the document image output module in the print Uygur language identification system outputs the preferred type of the connected segment image to be identified in an editable format according to the writing sequence and the writing format in the print Uygur language document image, and overcomes the problem that the identification system in the prior art cannot output the connected segment corresponding to the preferred type according to the writing sequence and the writing format in the print Uygur language document image, so that the print Uygur language document image can be converted into the text document according to the writing sequence and the writing format of the print Uygur language document image.

Drawings

FIG. 1 is a block diagram of the system of the present invention;

FIG. 2 is a flow chart of the method of the present invention;

FIG. 3 is an image of a print Uyghur document input in a simulation experiment of the present invention;

FIG. 4 is a diagram showing the recognition result of printed Uyghur document images outputted in the simulation experiment of the present invention.

Detailed Description

The invention is further described below with reference to the accompanying drawings.

The structure of the system of the present invention will be further described with reference to fig. 1.

The system comprises a connected segment database module, a document image input module, a document image preprocessing module, a document image segmentation module, a connected segment image preprocessing module, a connected segment image feature extraction module, a connected segment classification and identification module and a document image output module. The output end of the connected segment database module is connected with the input end of the connected segment classification identification module, the output end of the document image input module is connected with the input end of the document image preprocessing module, the output end of the document image preprocessing module is connected with the input end of the document image segmentation module, the output end of the document image segmentation module is connected with the input end of the connected segment image preprocessing module, the output end of the connected segment image preprocessing module is connected with the input end of the connected segment image feature extraction module, the output end of the connected segment image feature extraction module is connected with the input end of the connected segment classification identification module, and the output end of the connected segment classification identification module is connected with the document image input module.

And the connected segment database module is used for constructing a characteristic template library of the print Uygur language connected segment by acquiring the common print Uygur language connected segment with different fonts and different character sizes and sending the characteristic template library to the connected segment classification and identification module.

And the document image input module is used for inputting the print Uygur language document image to be identified and sending the input print Uygur language document image to be identified to the document image preprocessing module.

And the document image preprocessing module is used for carrying out binarization, denoising and inclination correction on the print Uyghur document image to be identified to obtain a preprocessed document image and sending the preprocessed document image to the document image segmentation module.

And the document image segmentation module is used for segmenting the preprocessed document image to generate a connected segment image and sending the generated connected segment image to the connected segment image preprocessing module.

And the connected segment image preprocessing module is used for carrying out size normalization processing on the connected segment image to obtain a preprocessed connected segment image and sending the preprocessed connected segment image to the connected segment image characteristic extraction module.

And the connected segment image feature extraction module is used for extracting the feature vector of the preprocessed connected segment image and sending the feature vector of the connected segment image to the connected segment classification and identification module.

And the connected section classification and identification module is used for classifying and identifying the connected section image and sending an identification result to the document image output module.

And the document image output module is used for outputting the text format document corresponding to the identified document image.

The method of the invention is further described with reference to figure 2.

Step 1, establishing a characteristic template library of a print Uyghur character link segment.

The connected segment database module takes the common Uygur language connected segment as an acquisition object, and establishes at least 50 sets of printing Uygur language document images with different fonts and different sizes and only containing the common Uygur language connected segment.

And segmenting each set of print Uygur language document image, and forming a data sample library of the print Uygur language connected segment images by using the generated multiple connected segment image samples.

And the connected segment database module performs size normalization processing on each connected segment image sample in the data sample library by using a bicubic interpolation algorithm, extracts the Gabor characteristic vector of each connected segment image sample, and forms all the Gabor characteristic vectors into a characteristic template library for printing the Uygur language connected segment.

And 2, inputting a print Uyghur document image to be recognized.

The document image input module inputs a print Uyghur document image to be identified, which only contains Uyghur.

And 3, preprocessing the input document image.

The document image preprocessing module carries out binarization processing on an input document image by utilizing a maximum between-class variance algorithm, wherein the maximum between-class variance algorithm comprises the following specific steps:

step 1, calculating the percentage of the total number of the pixel points of each pixel value in the total number of the pixel points in the print Uyghur document image to be identified according to the following formula:

where i represents the value of a pixel point, i ═ 0,1iThe percentage of the total number of pixels with a pixel value of i to the total number of pixels in the printed Uyghur document image to be identified, piIs greater than 0 andniand N represents the total number of pixel points with the pixel value of i in the print Uygur language document image to be identified.

Step 2, calculating the average gray level mu of all pixel points in the print Uygur language document image to be identified according to the following formulaT

Wherein f isminMinimum value f representing pixel values of all pixel points in the print Uygur document image to be recognizedmaxExpressing the maximum value of pixel values of all pixel points in the print Uygur document image to be identified;

step 3, frommin,fmax]And selecting an unselected integer value t, and taking all pixel points with the pixel value smaller than t in the printed Uyghur document image as pixel points of a foreground part in the printed Uyghur document image, and taking the rest pixel points as pixel points of a background part.

Step 4, calculating the between-class variance of the foreground and the background in the print Uygur language document image to be identified according to the following formula

Step 5, judging whether the selection is finished or notmin,fmax]If so, executing the 6 th step of the step, otherwise, executing the 3 rd step of the step.

Step 6, at [ fmin,fmax]Selecting t within the range at which the inter-class variance reaches a maximum*The value is taken as a binarization threshold value T.

And 7, assigning the pixel value of each pixel point with the pixel value larger than the binarization threshold value T in the printed Uygur language document image to be 255, and assigning the pixel values of the other pixel points to be 0 to obtain the binarized printed Uygur language document image.

And the document image preprocessing module carries out denoising processing on the image after the binarization processing by using a median filtering algorithm.

And the document image preprocessing module performs tilt correction processing on the denoised binary image by using a method of combining a Fourier transform algorithm and a Hough transform algorithm to obtain a preprocessed document image.

The method for combining the Fourier transform algorithm and the Hough transform algorithm comprises the following specific steps:

and step 1, carrying out Fourier transformation on the denoised binary image to obtain a magnitude spectrum image in a Fourier spectrum of the denoised binary image, wherein the low-frequency part of the magnitude spectrum image is in the four-angle area of the magnitude spectrum image, and the high-frequency part of the magnitude spectrum image is in the central area of the magnitude spectrum image.

And 2, exchanging the low-frequency part region and the high-frequency part region of the magnitude spectrum image by utilizing the translation property of Fourier transform, translating the low-frequency part of the magnitude spectrum image to the central region of the magnitude spectrum image, and translating the high-frequency part to the four corner regions of the magnitude spectrum image to obtain the centralized magnitude spectrum image.

And 3, detecting the inclination angle of the inclined straight line passing through the central point in the centered amplitude spectrum image according to the following formula to obtain the inclination angle of the denoised binary image:

xcosθ+ysinθ=r

wherein x represents the abscissa of all points on an inclined straight line in the centered amplitude spectrum image, y represents the ordinate of all points on the inclined straight line in the centered amplitude spectrum image, r represents the distance from all points on the inclined straight line to the origin in the centered amplitude spectrum image, and theta represents the included angle between the inclined straight line of the centered amplitude spectrum image and the x axis, namely the inclination angle of the denoised binary image.

And 4, transforming the plane coordinates of each pixel point in the denoised binary image by using an affine transformation matrix according to the following formula, thereby completing the inclination correction of the denoised binary image:

wherein x and y represent the plane coordinates of the denoised binary image before and after position transformation, x 'and y' represent the plane coordinates of the denoised binary image before and after position transformation, and txAnd tyRepresenting the center position of the denoised binary image, a0And a1To representThe components of the angle of inclination theta in the x-and y-axes, a2And a31 is taken.

And 4, generating a continuous segment image.

And the document image segmentation module performs horizontal integral projection on the preprocessed document image, and uses the upper and lower boundaries of each region, of which the continuous horizontal integral projection is not zero, in the preprocessed document image as the upper and lower boundaries of each line of document image to obtain a plurality of lines of document images.

The document image segmentation module selects any unselected line document image from the multiple line document images, performs expansion processing on the selected line document image by using a morphological expansion algorithm, performs vertical integral projection on the expanded line document image, and takes the left and right boundaries of an area where each continuous vertical integral projection in the expanded line document image is not zero as the left and right boundaries of each word image to obtain multiple word images.

The document image segmentation module selects any word image from the multiple word images, adopts an eight-neighborhood seed filling connected domain algorithm, sequentially extracts all connected domains in the selected word images, and merges the connected domains according to the area of each connected domain, the distance between the connected domains and the association position relationship of the main stroke part and the additional stroke part in the link segment to obtain multiple link segment images.

The associated position relationship of the main stroke part and the additional stroke part in the link section means that the main stroke part comprises four position relationships of the additional stroke part, the intersection of the main stroke part and the additional stroke part, the additional stroke part positioned above the main stroke part and the additional stroke part positioned below the main stroke part.

The specific steps for merging the connected domains are as follows:

step 1, selecting any one connected domain from all the connected domains in the selected word image, and searching the nearest connected domain adjacent to the selected connected domain.

And 2, determining a main stroke part and an additional stroke part of the link section, classifying the selected connected domain and the connected domain nearest to the selected connected domain according to the area size, setting the connected domain with the larger area as a main stroke part A of the link section, and setting the connected domain with the smaller area as an additional stroke part B of the link section.

And 3, judging whether the position relation of the A and the B belongs to any one of the associated positions of the main part stroke part and the additional stroke part in the continuous body section or not according to the associated position relation of the main part stroke part and the additional stroke part in the continuous body section, if so, combining the main stroke part and the additional stroke part which take the A and the B as the continuous body section, otherwise, executing the step 4 of the step.

And 4, if the connected domain B which meets the position relation condition of the main stroke part and the additional stroke part in the connected segment does not exist in the connected domain which is the nearest to the A, the A is an independent connected segment, and the A is used as the obtained connected segment image.

And 5, judging whether all connected domains in the selected word image are selected completely, if so, obtaining a plurality of connected segment images, and otherwise, executing the step 1 of the step.

And 5, preprocessing the image of the connected segment.

The connected segment image preprocessing module performs normalization processing on the size of each connected segment image by using a bicubic interpolation algorithm to obtain a preprocessed connected segment image.

And 6, extracting Gabor characteristic vectors of the continuous segment image.

And the connected segment image feature extraction module performs reverse color processing on each preprocessed connected segment image to obtain a connected segment image after reverse color processing.

The connected segment image feature extraction module adds G to the upper and lower directions of each reversed connected segment image according to the following formula and the height and width of the two-dimensional Gabor filterhG is added to the pixel point with the row pixel value of 0 in the left and right directionswAnd (3) arranging pixel points with pixel values of 0 to obtain a bordered connected segment image:

wherein G ishRepresenting opposite colorsThe number of lines of pixel points increased in the upper and lower directions of the connected image is increased, GaborHeigh represents the height of a Gabor filter window, GaborWidth represents the width of the Gabor filter window, and GwAnd the column number of the pixel points increased in the left direction and the right direction of the reversed connected segment image is represented.

And the connected segment image feature extraction module performs convolution operation on each pixel point in the edged connected segment image and the real part of the two-dimensional Gabor filter by using the two-dimensional Gabor filter to obtain the filtered connected segment image.

The connected segment image feature extraction module divides the filtered connected segment image into n × n parts according to the uniform height and width to obtain n × n image blocks.

And the connected segment image feature extraction module calculates the energy of each image block, and forms the energy values of all the image blocks into a feature vector of the filtered connected segment image to obtain a Gabor feature vector of the connected segment image to be identified. Wherein, calculating the energy of each image block is obtained by the following formula:

wherein e (k) represents the energy of the k-th image block in the n × n image blocks, s represents the total number of pixel points in the k-th image block,the method includes the steps that an open square operation is represented, i represents the serial number of a pixel point in a k-th image block, i is 1, 2.

And 7, classifying and identifying the connected segment images.

The connected segment classification and identification module calculates the Euclidean distance between the feature vector of the connected segment image to be identified and the feature vector of each connected segment sample in the feature template library established in the connected segment database module; wherein, the calculation of the Euclidean distance between the feature vector of the connected segment image to be identified and the feature vector of each connected segment sample in the feature template library is obtained by the following formula:

wherein d isxyRepresenting Euclidean distance, X, between the characteristic value in the characteristic vector of the connected segment image to be identified and the characteristic value in the characteristic vector of each connected segment sample in the characteristic template libraryjRepresenting the jth characteristic value in the characteristic vector of the connected segment image to be identified, wherein j is 1,2jAnd the j-th characteristic value in the characteristic vector of a certain connector segment sample in the characteristic template library is represented.

And the connected segment classification and identification module sorts the Euclidean distances between the feature vector of the connected segment image to be identified and the feature vector of each connected segment sample in the feature template library established in the connected segment database module according to the sequence from small to large.

And the link segment classification and identification module selects the class of the link segment with the minimum Euclidean distance from the link segment to be identified in the characteristic template library as the preferred class of the link segment image to be identified.

And 8, outputting the text format document corresponding to the identified document image.

And the document image output module outputs the preferred type of the connected segment image to be identified according to the writing sequence and the writing format in the input print Uygur language document image, outputs the connected segment corresponding to the preferred type in an editable format, and outputs all the connected segments in the document image to obtain the text format document corresponding to the document image.

The effects of the present invention can be further illustrated by the following simulation experiments.

1. And (5) simulating experimental conditions.

The simulation test of the invention is carried out in a hardware environment with computer hardware configured as Intel (R) core (TM) -i5-4200U @1.60GHz and 4.0GB RAM and a software environment with computer software configured as vs 2012.

2. And (5) analyzing simulation experiment contents and results.

The recognition system scans a print Uyghur document by connecting with a scanner, inputs a scanned print Uyghur document image or inputs a print Uyghur document image in a picture opening mode, and FIG. 3 is a print Uyghur document image to be recognized, which only contains Uyghur, and is input during simulation experiments of the invention. The system and the method of the invention are adopted to identify the image of the input print Uyghur language document like the image 3, and the identification result is shown in the figure 4.

Fig. 4 is a recognition result diagram obtained by recognizing an input image diagram 3 based on a connected segment print Uygur language document image recognition method, and it can be seen by comparing fig. 4 with fig. 3 that the recognition result diagram 4 is consistent with the writing sequence and writing format in the input print Uygur language document diagram 3, and the print Uygur language document image is output in an editable format, which verifies that the invention can output the text document corresponding to the print Uygur language document image according to the writing sequence and format of the input print Uygur language document image, thereby realizing the electronization of the print Uygur language document image.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于改进锚框的高光谱多目标检测方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!