CN108205676B - The method and apparatus for extracting pictograph region - Google Patents

The method and apparatus for extracting pictograph region Download PDF

Info

Publication number
CN108205676B
CN108205676B CN201711174268.7A CN201711174268A CN108205676B CN 108205676 B CN108205676 B CN 108205676B CN 201711174268 A CN201711174268 A CN 201711174268A CN 108205676 B CN108205676 B CN 108205676B
Authority
CN
China
Prior art keywords
pixel
macro block
color
text
gray value
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.)
Active
Application number
CN201711174268.7A
Other languages
Chinese (zh)
Other versions
CN108205676A (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.)
Xian Wanxiang Electronics Technology Co Ltd
Original Assignee
Xian Wanxiang Electronics Technology 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 Xian Wanxiang Electronics Technology Co Ltd filed Critical Xian Wanxiang Electronics Technology Co Ltd
Priority to CN201711174268.7A priority Critical patent/CN108205676B/en
Publication of CN108205676A publication Critical patent/CN108205676A/en
Application granted granted Critical
Publication of CN108205676B publication Critical patent/CN108205676B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

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

Abstract

The invention discloses a kind of method and apparatus for extracting pictograph region.Wherein, this method comprises: image to be processed is carried out piecemeal, multiple macro blocks are obtained;Greyscale color transformation is carried out to the color value of pixel each in macro block, obtains the gray value of each pixel;The text pixel in macro block is searched according to the gray value of each pixel;Text pixel is extracted, and text pixel is spliced, obtains the character area of image to be processed.The technical issues of identification that the present invention solves character area in the prior art needs complicated modeling process, leads to identification process low efficiency.

Description

The method and apparatus for extracting pictograph region
Technical field
The present invention relates to field of image processings, in particular to a kind of method and apparatus for extracting pictograph region.
Background technique
Text in computer digital image process field, image is a kind of important picture material.Automatically extract and It identifies the text in image, greatly computer can be assisted to be classified to image, indexed, and facilitate the place in image later period Reason, such as compression or OCR identification.
Pictograph cutting techniques can substantially be divided into three classes at present: the connected domain method based on color threshold, based on statistics Model method and method based on cluster.
1, based on the method for color threshold, full frame image would generally be done to global threshold or local threshold processing, make it Become a bianry image, then recycles spatial coherence, the region institute that the pixel that those are connected together is constituted The pixel of covering is labeled as text pixel, to achieve the purpose that extract text from background.The shortcomings that the method is, If the background of text is more complicated in image, and text color is similar to background, then the selection of global threshold or local threshold It will become extremely difficult, this method is caused not to be available.
2, based on the method for statistical model, pixel all in character block can be established probabilistic model, usually may be used by the method To be gauss hybrid models, then determine whether the pixel in each region belongs to character block pixel by probabilistic model parameter.By The image that nature generates more is applicable in the assumed condition of probabilistic model, so segmentation natural forms effect is preferable.But It is for artificial image (such as: print hand writing), this gaussian probability model is difficult to set up, so being applied in artificial image Text segmentation effect is poor.
3, based on the method for cluster, by the way that the pixel of a frame image is divided into M class, text pixel corresponds to wherein the method It is a kind of.By supporting vector product or principal component analytical method, a low dimensional space problem is converted into a high-dimensional space Problem.After higher dimensional space classification, its luv space is re-mapped back.Such method is needed to select suitable kernel function and be established Complicated mathematical model, computation complexity is high, practical application.Meanwhile if occurring largely and similar in text in background When color, background pixel can be included into as character block pixel, can also generate higher False Rate.
Above-mentioned collection Chinese word segmentation method divides text from the pixel data of global image, can not only interfere with part Text pixel judgement and mark, while the method for complicated mathematical model brings significant limitation to practical application.
Identification for character area in the prior art needs complicated modeling process, leads to asking for identification process low efficiency Topic, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides a kind of method and apparatus for extracting pictograph region, at least to solve the prior art The technical issues of identification of middle character area needs complicated modeling process, leads to identification process low efficiency.
According to an aspect of an embodiment of the present invention, a kind of method for extracting pictograph region is provided, comprising: will be to It handles image and carries out piecemeal, obtain multiple macro blocks;Greyscale color transformation is carried out to the color value of pixel each in macro block, is obtained every The gray value of a pixel;The text pixel in macro block is searched according to the gray value of each pixel;Text pixel is extracted, and to text Pixel is spliced, and the character area of image to be processed is obtained.
Further, the color value of each pixel is obtained, wherein color value includes the color data of three Color Channels; The mean value for determining the color data of three Color Channels is gray value.
Further, determine that the frequency of occurrences is most in macro block gray value is the according to the gray value of pixel each in macro block One domain color;It is text pixel that determining, which has the first kind pixel of the first domain color,.
Further, the ratio that the quantity of first kind pixel accounts for pixel quantity in macro block is compared with preset ratio; In the case where the ratio that the quantity of first kind pixel accounts for pixel quantity in macro block is greater than or equal to preset ratio, stopping continues to look into Look for text pixel;In the case where the ratio that the quantity of first kind pixel accounts for pixel quantity in macro block is less than preset ratio, macro Text pixel is continued to search in block.
Further, the most gray value of the frequency of occurrences is searched in the macro block for rejecting first kind pixel, and determination is being picked Except the most gray value of the frequency of occurrences in the macro block of first kind pixel is the second domain color;Determining has the second of the second domain color Class pixel is text pixel;The sum of the quantity of the quantity of first kind pixel and the second class pixel is accounted for the ratio of pixel quantity in macro block Example is compared with preset ratio;Pixel quantity in macro block is accounted in the quantity of first kind pixel and the sum of the quantity of the second class pixel Ratio be greater than or equal to preset ratio in the case where, stopping continue to search text pixel;In the quantity of first kind pixel and In the case that the ratio that the sum of the quantity of two class pixels accounts for pixel quantity in macro block is less than preset ratio, continue to search in a macroblock Text pixel.
Further, when finding n-th of domain color in a macroblock, if the sum of the quantity of n domain color accounts for macro block The ratio of middle pixel quantity is still less than preset ratio, and n is equal to domain color amount threshold, it is determined that text picture is not present in macro block Element, wherein domain color amount threshold is the domain color quantity in preset macro block.
Further, gray value is searched in a macroblock and meet the pixel of preset condition, wherein preset condition includes: and m The difference of the gray value of a domain color is within a preset range, wherein m >=1;The pixel for determining that gray value meets preset condition is text Pixel.
Further, the color frequency distribution map of macro block is determined according to the gray value of pixel each in macro block;According to color Frequency distribution searches the gray value that the frequency of occurrences is most in macro block, and determines that the gray value found is the first domain color.
Further, the text pixel in each macro block is marked;The text picture that will be marked in each macro block Element is spliced, and the corresponding character area of each macro block is obtained;The corresponding character area of each macro block is spliced, obtain to Handle the character area of image.
According to another aspect of an embodiment of the present invention, a kind of device for extracting pictograph region is additionally provided, comprising: point Block module obtains multiple macro blocks for image to be processed to be carried out piecemeal;Conversion module, for pixel each in macro block Color value carries out greyscale color transformation, obtains the gray value of each pixel;Searching module, for the gray value according to each pixel Search the text pixel in macro block;Abstraction module splices for extracting text pixel, and to text pixel, obtains wait locate Manage the character area of image.
According to another aspect of an embodiment of the present invention, a kind of storage medium is additionally provided, storage medium includes the journey of storage Sequence, wherein the method that equipment where control storage medium executes above-mentioned extraction pictograph region in program operation.
According to another aspect of an embodiment of the present invention, a kind of processor is additionally provided, processor is used to run program, In, program executes the above-mentioned method for extracting pictograph region when running.
In embodiments of the present invention, image to be processed is subjected to piecemeal, multiple macro blocks is obtained, to pixel each in macro block Color value carries out greyscale color transformation, obtains the gray value of each pixel, is searched in macro block according to the gray value of each pixel Text pixel extracts text pixel, and splices to text pixel, obtains the character block of image to be processed.Above scheme will Image to be processed obtains multiple macro blocks after carrying out piecemeal, obtains the text pixel in each macro block respectively, then will be in all macro blocks Text pixel spliced the molecule block for obtaining image to be processed, so as to be divided from the topography of image to be processed Analysis avoids complicated modeling process, and the identification for solving character area in the prior art needs complicated modeling process, causes The technical issues of identification process low efficiency, to improve the treatment effeciency for extracting character block.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart for extracting the method for character block in image according to the embodiment of the present application;
Fig. 2 is the flow chart of the method for character block in a kind of extraction image according to the embodiment of the present application;And
Fig. 3 is the schematic diagram for extracting the device of character block in image according to the embodiment of the present application.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product Or other step or units that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of embodiment for extracting the method for character block in image is provided, needs to illustrate It is that step shown in the flowchart of the accompanying drawings can execute in a computer system such as a set of computer executable instructions, Also, although logical order is shown in flow charts, and it in some cases, can be to be different from sequence execution herein Shown or described step.
Fig. 1 is the flow chart for extracting the method for character block in image according to the embodiment of the present application, as shown in Figure 1, the party Method includes the following steps:
Image to be processed is carried out piecemeal, obtains multiple macro blocks by step S102.
Specifically, above-mentioned image to be processed is the image to therefrom extract character area, it is by image segmentation to be processed Multiple macro blocks then can individually analyze each macro block, to analyze the part of image to be processed.
Step S104 carries out greyscale color transformation to the color value of pixel each in macro block, obtains the gray scale of each pixel Value.
Specifically, the color value to each pixel carries out greyscale color transformation, value determination according to the color of pixels can be The gray value of pixel.
In above-mentioned steps, carrying out greyscale color transformation can be Y points be transformed to the rgb value of pixel in YUV component Magnitude, i.e. gray value.After image is transformed to gray level image, the Y-component of text and background still has biggish difference, Text and background can be distinguished by Y-component, therefore the application extracts the character area of image to be processed by Y-component.
Step S106 searches the text pixel in macro block according to the gray value of each pixel.
Above-mentioned text pixel is to constitute the pixel of the character area of image to be processed, due in a macroblock, background color Value is usually more dispersed, and the color of text compares concentration, therefore the probability value that can occur according to gray value in pixel, comes true Determine the text pixel in macro block.
Step S108 extracts text pixel, and splices to text pixel, obtains the character block of image to be processed.
Specifically, the character area of above-mentioned image to be processed be used for characterize remove text other than background image after to Handle image.
In an alternative embodiment, then the macro block to be split for being divided into 8*8,16*16 or 32*32 can be obtained The gray value of each pixel in macro block is taken, and determines the text pixel in macro block according to the gray value of each pixel.It again will be wait locate Each macro block in reason image repeats the above steps to obtain the text pixel in each macro block, will finally process all macro blocks The text pixel obtained afterwards is spliced, to obtain the character area of image to be processed.
From the foregoing, it will be observed that image to be processed is carried out piecemeal by the above embodiments of the present application, multiple macro blocks are obtained, to every in macro block The color value of a pixel carries out greyscale color transformation, obtains the gray value of each pixel, is searched according to the gray value of each pixel Text pixel in macro block extracts text pixel, and splices to text pixel, obtains the character block of image to be processed.On State scheme will image to be processed carry out piecemeal after obtain multiple macro blocks, obtain the text pixel in each macro block respectively, then by institute There is the text pixel in macro block to be spliced to obtain the sub-block of image to be processed, so as to the topography to image to be processed It is analyzed, avoids complicated modeling process, the identification for solving character area in the prior art needs complicated modeling Journey, the technical issues of leading to identification process low efficiency, to improve the treatment effeciency for extracting character block.
Optionally, according to the above embodiments of the present application, greyscale color variation is carried out to the color value of pixel each in macro block, Obtain the gray value of each pixel, comprising:
Step S1041 obtains the color value of each pixel, wherein color value includes the color data of three Color Channels.
In an alternative embodiment, the color value of pixel is (R, G, B), and R, G, B are respectively three Color Channels, should The corresponding data of three Color Channels constitute the color value of pixel.
Step S1043 determines that the mean value of the color data of three Color Channels is gray value.
In an alternative embodiment, the gray value of pixel can be calculated by following formula:
Wherein, Y is used to characterize the gray value of pixel, and R, G, B are respectively used to indicate pixel in R, G, B Color data on these three Color Channels.
Optionally, it according to the above embodiments of the present application, is determined according to the gray value of each pixel, searches the text in macro block Pixel, comprising:
Step S1061 is according to the gray value that the gray value of pixel each in macro block determines that the frequency of occurrences is most in macro block First domain color.
Step S1063, it is text pixel that determining, which has the first kind pixel of the first domain color,.Determining that the first domain color is After text pixel, text pixel can also be marked.
Optionally, according to the above embodiments of the present application, after determining that the pixel with the first domain color is text pixel, The above method further include:
The ratio that the quantity of first kind pixel accounts for pixel quantity in macro block is compared step S1067 with preset ratio.
Step S1069 is greater than or equal to preset ratio in the ratio that the quantity of first kind pixel accounts for pixel quantity in macro block In the case where, stopping continues to search text pixel.
Specifically, text pixel can occupy one of all pixels in macro block if including character area in a macro block Certainty ratio is recognized in the case where the ratio that the quantity of first kind pixel accounts for pixel quantity in macro block is greater than or equal to preset ratio To have found text pixel all in macro block, therefore stop continuing to search.
Step S1071, the case where the ratio that the quantity of first kind pixel accounts for pixel quantity in macro block is less than preset ratio Under, text pixel is continued to search in a macroblock.
Specifically, text pixel can occupy one of all pixels in macro block if including character area in a macro block Certainty ratio, due to not can determine that the certain all same colors of the text in image to be processed, based on including in macro block Text pixel this it is assumed that first kind pixel quantity account for pixel quantity in macro block ratio be less than preset ratio the case where Under, it is believed that further include other text pixels in macro block, therefore continues to search.
Optionally, according to the above embodiments of the present application, the ratio of pixel quantity in macro block is accounted in the quantity of first kind pixel In the case where less than preset ratio, text pixel is continued to search in a macroblock, comprising:
Step S1073 searches the most gray value of the frequency of occurrences in the macro block for rejecting first kind pixel, and determination is being picked Except the most gray value of the frequency of occurrences in the macro block of first kind pixel is the second domain color.
Step S1075, it is text pixel that determining, which has the second class pixel of the second domain color,.
The sum of the quantity of the quantity of first kind pixel and the second class pixel is accounted for pixel quantity in macro block by step S1077 Ratio is compared with preset ratio.
Step S1079 accounts for pixel quantity in macro block in the quantity of first kind pixel and the sum of the quantity of the second class pixel In the case that ratio is greater than or equal to preset ratio, stopping continues to search text pixel.
Step S10711 accounts for pixel quantity in macro block in the quantity of first kind pixel and the sum of the quantity of the second class pixel In the case that ratio is less than preset ratio, text pixel is continued to search in a macroblock.
Optionally, according to the above embodiments of the present application, when finding n-th of domain color in a macroblock, if n main face The sum of quantity of color accounts for the ratio of pixel quantity in macro block still less than preset ratio, and n is equal to domain color amount threshold, it is determined that Text pixel is not present in macro block, wherein domain color amount threshold is the domain color quantity in preset macro block.
In an alternative embodiment, enabling domain color threshold value is 4, in the quantity and the second class pixel of first kind pixel The sum of quantity accounts for all pixels quantity in macro block and is rejecting first kind pixel and the second class pixel less than in the case where preset ratio Macro block in search the most color group of the frequency of occurrences, and determine and go out in the macro block for rejecting first kind pixel and the second class pixel The most color group of existing frequency is third domain color;Quantity, the quantity and third picture of the second class pixel in first kind pixel The sum of the quantity of element accounts for all pixels quantity in macro block and continues acquisition the 4th according to above scheme less than in the case where preset ratio Pixel, if the quantity of first kind pixel, the quantity of the second class pixel, the quantity of the quantity of third pixel and the 4th pixel it It is less than preset ratio with all pixels quantity in macro block is accounted for, it is determined that character block is not present in the macro block.
Due to obtaining domain color every time and determining that the corresponding pixel of domain color is text pixel, it is all based on the macro block packet The progress of this hypothesis of text pixel is included, if after finding n-th of domain color, the quantity of all domain colors accounts for picture in macro block The ratio of prime number amount is still less than preset ratio, then overthrowing this, there is no text pixels it is assumed that determining the macro block, and before cancellation Determining text pixel.
Optionally, according to the above embodiments of the present application, after finding m-th of domain color in a macroblock, method is also wrapped It includes:
Step S10611 searches gray value in a macroblock and meets the pixel of preset condition, wherein preset condition include: with The difference of the gray value of m-th of domain color is within a preset range, wherein m >=1.
Step S10613, the pixel for determining that gray value meets preset condition is text pixel.
In the above scheme, since in actual image, the boundary of text and background might not have apparent sharp Sharp edge circle, it is possible that in the case where bounding gradient transition during text rendering, therefore can will be poor with domain color It can also be used as text pixel away from the corresponding pixel of lesser gray value.
Above-mentioned steps can be in when progress of finding domain color every time, in an alternative embodiment, with the first domain color For, after determining the first domain color, search in a macroblock with the difference of the gray value of the first domain color less than Δ (such as: Δ= 4, then preset range is (0,4)) pixel, and also regard the pixel found as first kind pixel.
Optionally, according to the above embodiments of the present application, determine in macro block occur according to the gray value of pixel each in macro block The most gray value of frequency is the first domain color, comprising:
Step S10615 determines the color frequency distribution map of macro block according to the gray value of pixel each in macro block.
Step S10617 searches the gray value that the frequency of occurrences is most in macro block according to color frequency distribution map, and determination is looked into The gray value found is the first domain color.
Optionally, according to the above embodiments of the present application, text pixel is extracted, and text pixel is spliced, obtains figure The character block of picture, comprising:
Text pixel in each macro block is marked step S1081.
Step S1083 splices the character block being marked in each macro block, obtains the corresponding text of each macro block Block.
The corresponding character block of each macro block is spliced, obtains the character block of image to be processed by step S1085.
In above-mentioned steps, the text pixel in each macro block found out is marked, so as to be looked into basis Result is looked for determine the text pixel of all macro blocks.In an alternative embodiment, first according to label as a result, in each macro block Text pixel spliced, i.e., now obtain the character area of image local to be processed, then by the splicing result of each macro block into Row further splicing, to obtain the character area of image to be processed.
Fig. 2 is the flow chart of the method for character block in a kind of extraction image according to the embodiment of the present application, in conjunction with Fig. 2 institute Show, the method for character block in said extracted image be illustrated:
Step S21 reads a frame image.Specifically, the image of above-mentioned reading is image to be processed.
Step S22 divides the image into the image block of M × N.
Specifically, 16 × 16,32 × 32 square can be divided the image into above-mentioned steps, other can also be divided into The rectangular block of size.
Step S23 judges whether that all image blocks are completed in processing.The feelings of completion are all handled in all image blocks of image Terminate process under condition, in the case where untreated completion, enters step S24 and current image block is handled.
Step S24 does the conversion of greyscale color space to current image block.
Specifically, above-mentioned formula can beIt carries out greyscale color spatial alternation and obtains gray value.
Step S25, obtained M × N number of gray value do statistic histogram.
Step S26 finds gray value and occurs being less than or equal to 4 with its difference in the largest number of greyscale colors and histogram Color value is classified as the first domain color.
In above-mentioned steps, gray value in image block is found first and the largest number of greyscale colors occurs, then in histogram In find with occur the largest number of greyscale colors differ be less than or equal to 4 color value, the color value found is all classified as the One domain color.
Step S27, statistics belong to the pixel quantity N1 of the first domain color.
Step S28, judges whether the ratio of pixel shared by N1 is greater than threshold value T, in the case where the judgment result is yes, into Enter step S219, if it is judged that be it is no, then enter step S29.
Step S29 excludes N1 pixel, and finds the second domain color according to the method similar with S26.
Specifically, the second domain color step of searching is identical as the step of finding the first domain color in above-mentioned steps, picking Except finding the most gray value of the frequency of occurrences in the macro block of the first domain color, by the gray value found and with the gray scale that searches out Gray value of the difference of value less than 4 is all used as the second domain color.
Step S210, statistics belong to the pixel quantity N2 of the second domain color.
Step S211, determines whether the ratio of pixel shared by S=N1+N2 is more than or equal to threshold value T.It is yes in judging result In the case where enter step S219, if the determination result is NO, enter step S212.
Step S212 excludes N1+N2 pixel, and finds third domain color according to the method similar with S26.
Specifically, in above-mentioned steps, the step of finding the third domain color and phase the step of finding second of domain color Together.
Step S213, statistics belong to the pixel quantity N3 of third domain color.
Step S214, judges whether the ratio of pixel shared by S=N1+N2+N3 is more than or equal to threshold value T.In judging result S219 is entered step in the case where to be, if the determination result is NO, enters step S215.
Step S215 excludes N1+N2+N3 pixel, and finds the 4th domain color according to the method similar with S26.
Specifically, in above-mentioned steps, the step of the step of finding the 4th kind of domain color is with other domain colors of searching, is identical.
Step S216, statistics belong to the pixel quantity N4 of the 4th domain color.
Step S217, determines whether the ratio of pixel shared by S=N1+N2+N3+N4 is more than or equal to threshold value T.It is tied in judgement Fruit is to enter step S219 in the case where being, if the determination result is NO, enters step S218.
Step S218, marking does not have text pixel appearance in this image block.
Step S219, the pixel that domain color is covered are labeled as text pixel.
Embodiment 2
According to embodiments of the present invention, a kind of embodiment for extracting the device of character block in image is provided, Fig. 3 is according to this The schematic diagram for extracting the device of character block in image for applying for embodiment, as shown in figure 3, this method comprises the following steps:
Piecemeal module 30 obtains multiple macro blocks for image to be processed to be carried out piecemeal.
Conversion module 32 carries out greyscale color transformation for the color value to pixel each in macro block, obtains each pixel Gray value.
Searching module 34, for searching the text pixel in macro block according to the gray value of each pixel.
Abstraction module 36 is used for text pixel, and splices to text pixel, obtains the literal field of image to be processed Domain.
Embodiment 3
According to embodiments of the present invention, a kind of storage medium is provided, which is characterized in that storage medium includes the journey of storage Sequence, wherein the method that equipment where control storage medium executes the extraction pictograph region of embodiment 1 in program operation.
Embodiment 4
According to embodiments of the present invention, a kind of processor is provided, which is characterized in that processor is for running program, wherein The method in the extraction pictograph region in embodiment 1 is executed when program is run.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke Yiwei A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (8)

1. a kind of method for extracting pictograph region characterized by comprising
Image to be processed is subjected to piecemeal, obtains multiple macro blocks;
Greyscale color transformation is carried out to the color value of each pixel in the macro block, obtains the gray value of each pixel;
The text pixel in the macro block is searched according to the gray value of each pixel;
The text pixel is extracted, and the text pixel is spliced, obtains the character area of the image to be processed;
The text pixel in the macro block is searched according to the gray value of each pixel, comprising:
Determine that the gray value that the frequency of occurrences is most in the macro block is first main according to the gray value of pixel each in the macro block Color;
It is the text pixel that determining, which has the first kind pixel of first domain color,;
After determining that the pixel with first domain color is the text pixel, the method also includes:
The ratio that the quantity of the first kind pixel accounts for pixel quantity in the macro block is compared with preset ratio;
It is greater than or equal to the preset ratio in the ratio that the quantity of the first kind pixel accounts for pixel quantity in the macro block In the case of, stopping continues to search the text pixel;
In the case where the ratio that the quantity of the first kind pixel accounts for pixel quantity in the macro block is less than the preset ratio, The text pixel is continued to search in the macro block.
2. the method according to claim 1, wherein the color value to each pixel in the macro block carries out gray scale Colour switching obtains the gray value of each pixel, comprising:
Obtain the color value of each pixel, wherein the color value includes the color data of three Color Channels;
The mean value for determining the color data of three Color Channels is the gray value.
3. the method according to claim 1, wherein the quantity in the first kind pixel accounts for picture in the macro block In the case that the ratio of prime number amount is less than the preset ratio, the text pixel is continued to search in the macro block, comprising:
The most gray value of the frequency of occurrences is searched in the macro block for rejecting the first kind pixel, and is determined and rejected described first The most gray value of the frequency of occurrences is the second domain color in the macro block of class pixel;
It is the text pixel that determining, which has the second class pixel of second domain color,;
The sum of the quantity of the quantity of the first kind pixel and the second class pixel is accounted for the ratio of pixel quantity in the macro block Example is compared with the preset ratio;
The ratio of pixel quantity in the macro block is accounted in the quantity of the first kind pixel and the sum of the quantity of the second class pixel In the case that example is greater than or equal to the preset ratio, stopping continues to search the text pixel;
The ratio of pixel quantity in the macro block is accounted in the quantity of the first kind pixel and the sum of the quantity of the second class pixel In the case that example is less than the preset ratio, the text pixel is continued to search in the macro block.
4. according to the method described in claim 3, it is characterized in that, when finding n-th of domain color in the macro block, such as The sum of the quantity of n domain color of fruit accounts for the ratio of pixel quantity in the macro block still less than the preset ratio, and the n is equal to Domain color amount threshold, it is determined that the text pixel is not present in the macro block, wherein the domain color amount threshold is pre- If the macro block in domain color quantity.
5. according to the method described in claim 3, it is characterized in that, after finding m-th of domain color in the macro block, The method also includes:
Gray value is searched in the macro block and meets the pixel of preset condition, wherein the preset condition includes: and the m The difference of the gray value of a domain color is within a preset range, wherein m >=1;
The pixel for determining that gray value meets the preset condition is the text pixel.
6. the method according to claim 1, wherein determining institute according to the gray value of pixel each in the macro block Stating the most gray value of the frequency of occurrences in macro block is the first domain color, comprising:
The color frequency distribution map of the macro block is determined according to the gray value of pixel each in the macro block;
The gray value that the frequency of occurrences is most in the macro block is searched according to the color frequency distribution map, and determines the ash found Angle value is first domain color.
7. the method according to claim 1, wherein extract the text pixel, and to the text pixel into Row splicing, obtains the character area of described image, comprising:
Text pixel in each macro block is marked;
The text pixel being marked in each macro block is spliced, the corresponding literal field of each macro block is obtained Domain;
The corresponding character area of each macro block is spliced, the character area of the image to be processed is obtained.
8. a kind of device for extracting pictograph region characterized by comprising
Piecemeal module obtains multiple macro blocks for image to be processed to be carried out piecemeal;
Conversion module carries out greyscale color transformation for the color value to each pixel in the macro block, obtains each picture The gray value of element;
Searching module, for searching the text pixel in the macro block according to the gray value of each pixel;
Abstraction module splices for extracting the text pixel, and to the text pixel, obtains the image to be processed Character area;
The text pixel in the macro block is searched according to the gray value of each pixel, comprising:
Determine that the gray value that the frequency of occurrences is most in the macro block is first main according to the gray value of pixel each in the macro block Color;
It is the text pixel that determining, which has the first kind pixel of first domain color,;
After determining that the pixel with first domain color is the text pixel, described device further include:
Comparison module, for the quantity of the first kind pixel is accounted for the ratio and preset ratio of pixel quantity in the macro block into Row compares;
Stopping modular, the ratio for accounting for pixel quantity in the macro block in the quantity of the first kind pixel are greater than or equal to institute In the case where stating preset ratio, stopping continues to search the text pixel;
Searching module, the ratio for accounting for pixel quantity in the macro block in the quantity of the first kind pixel are less than described default In the case where ratio, the text pixel is continued to search in the macro block.
CN201711174268.7A 2017-11-22 2017-11-22 The method and apparatus for extracting pictograph region Active CN108205676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711174268.7A CN108205676B (en) 2017-11-22 2017-11-22 The method and apparatus for extracting pictograph region

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711174268.7A CN108205676B (en) 2017-11-22 2017-11-22 The method and apparatus for extracting pictograph region

Publications (2)

Publication Number Publication Date
CN108205676A CN108205676A (en) 2018-06-26
CN108205676B true CN108205676B (en) 2019-06-07

Family

ID=62604454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711174268.7A Active CN108205676B (en) 2017-11-22 2017-11-22 The method and apparatus for extracting pictograph region

Country Status (1)

Country Link
CN (1) CN108205676B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109359644A (en) * 2018-08-28 2019-02-19 东软集团股份有限公司 Character image uniformity comparison method, apparatus, storage medium and electronic equipment
CN111918065A (en) * 2019-05-08 2020-11-10 中兴通讯股份有限公司 Information compression/decompression method and device
CN110505483A (en) * 2019-07-09 2019-11-26 西安万像电子科技有限公司 Image encoding method and device
CN113065544B (en) * 2020-01-02 2024-05-10 阿里巴巴集团控股有限公司 Character recognition method and device and electronic equipment
CN111583158B (en) * 2020-05-19 2022-09-23 国网吉林省电力有限公司 Bill electronic image compression storage method with simplified background expression
CN112257629A (en) * 2020-10-29 2021-01-22 广联达科技股份有限公司 Text information identification method and device for construction drawing
CN112383779A (en) * 2020-11-03 2021-02-19 西安万像电子科技有限公司 Image encoding method and device, image decoding method and device, and processor

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978565A (en) * 2015-05-11 2015-10-14 厦门翼歌软件科技有限公司 Universal on-image text extraction method
CN107093172A (en) * 2016-02-18 2017-08-25 清华大学 character detecting method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978565A (en) * 2015-05-11 2015-10-14 厦门翼歌软件科技有限公司 Universal on-image text extraction method
CN107093172A (en) * 2016-02-18 2017-08-25 清华大学 character detecting method and system

Also Published As

Publication number Publication date
CN108205676A (en) 2018-06-26

Similar Documents

Publication Publication Date Title
CN108205676B (en) The method and apparatus for extracting pictograph region
US6922485B2 (en) Method of image segmentation for object-based image retrieval
CN104346370B (en) Picture search, the method and device for obtaining image text information
Cao et al. Hyperspectral band selection using improved classification map
CN104899586B (en) Method and device is identified to the word content for including in image
CN109359515A (en) A kind of method and device that the attributive character for target object is identified
CN110378235A (en) A kind of fuzzy facial image recognition method, device and terminal device
CN111597870B (en) Human body attribute identification method based on attention mechanism and multi-task learning
CN109002755B (en) Age estimation model construction method and estimation method based on face image
CN107169106A (en) Video retrieval method, device, storage medium and processor
CN110807110B (en) Image searching method and device combining local and global features and electronic equipment
CN108492160A (en) Information recommendation method and device
CN114419363A (en) Target classification model training method and device based on label-free sample data
CN112084904A (en) Face searching method, device and storage medium
CN116206334A (en) Wild animal identification method and device
CN112668638A (en) Image aesthetic quality evaluation and semantic recognition combined classification method and system
CN108647703A (en) A kind of type judgement method of the classification image library based on conspicuousness
CN109800215A (en) Method, apparatus, computer storage medium and the terminal of a kind of pair of mark processing
CN109857897B (en) Trademark image retrieval method and device, computer equipment and storage medium
CN107239787A (en) A kind of utilization multi-source data have the Image classification method of privacy protection function
CN110210561B (en) Neural network training method, target detection method and device, and storage medium
CN108334602B (en) Data annotation method and device, electronic equipment and computer storage medium
CN109376746A (en) A kind of image identification method and system
CN114332915A (en) Human body attribute detection method and device, computer equipment and storage medium
Jyothi et al. Computational color naming for human-machine interaction

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
TR01 Transfer of patent right

Effective date of registration: 20230106

Address after: Room 740, No. 1256 and 1258, Wanrong Road, Jing'an District, Shanghai, 200072

Patentee after: Shanghai Jingda Xinlian Information Technology Co.,Ltd.

Address before: Room d102, building 4, Fengye Xindu District, hi tech Zone, Xi'an City, Shaanxi Province

Patentee before: XI'AN VANXVM ELECTRONICS TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230724

Address after: 710075, 2nd Floor, Building 5, Taiwei Zhilian Center, No. 8 Tangyan South Road, High tech Zone, Xi'an City, Shaanxi Province

Patentee after: XI'AN VANXVM ELECTRONICS TECHNOLOGY Co.,Ltd.

Address before: Room 740, No. 1256 and 1258, Wanrong Road, Jing'an District, Shanghai, 200072

Patentee before: Shanghai Jingda Xinlian Information Technology Co.,Ltd.