CN108734161B - Method, device and equipment for identifying prefix number area and storage medium - Google Patents
Method, device and equipment for identifying prefix number area and storage medium Download PDFInfo
- Publication number
- CN108734161B CN108734161B CN201710239389.9A CN201710239389A CN108734161B CN 108734161 B CN108734161 B CN 108734161B CN 201710239389 A CN201710239389 A CN 201710239389A CN 108734161 B CN108734161 B CN 108734161B
- Authority
- CN
- China
- Prior art keywords
- crown word
- sliding window
- word number
- area
- determining
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/60—Type of objects
- G06V20/62—Text, e.g. of license plates, overlay texts or captions on TV images
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/28—Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Character Input (AREA)
- Image Analysis (AREA)
Abstract
The embodiment of the invention discloses a method, a device and equipment for identifying a prefix number region and a storage medium. The method comprises the following steps: moving a first sliding window line by line on a gray scale image of a crown word number search area, and determining the upper and lower boundaries of a crown word number area according to the coverage areas of the first sliding window at different moving positions; carrying out binarization processing on the gray level images in the upper and lower boundaries to form a binarized image; and moving a second sliding window on the binarized image column by column, and determining the left and right boundaries of the crown word number region according to the coverage areas of the second sliding window at different moving positions. By the technical scheme of the invention, the processing time can be saved, and the processing efficiency can be improved.
Description
Technical Field
The embodiment of the invention relates to an image processing technology, in particular to a method, a device, equipment and a storage medium for identifying a prefix number area.
Background
The serial number on the paper currency is also called as a crown word serial number, taking the RMB as an example, the crown word is two or three English letters printed on the paper currency and used for marking a printing batch, and the serial number is arranged and printed by a paper money printer according to a certain rule; the number is an Arabic numeral serial number printed behind the crown word and used for indicating the arrangement sequence of each banknote in the same crown word batch.
In order to identify the crown word number in the bill, the crown word number is often processed first. The currently widely adopted crown word number processing method is as follows: firstly, the crown word number is binarized, then the crown word number is accurately positioned, and finally the crown word number is segmented. In the prior art, the binarization process is performed before accurate positioning, so that a large amount of time is wasted, and the processing efficiency is influenced.
Disclosure of Invention
The embodiment of the invention provides a method, a device and equipment for identifying a prefix number region and a storage medium, which are used for saving processing time and improving processing efficiency.
In a first aspect, an embodiment of the present invention provides a method for identifying a crown word number region, including:
moving a first sliding window line by line on a gray scale image of a crown word number search area, and determining the upper and lower boundaries of a crown word number area according to the coverage areas of the first sliding window at different moving positions;
carrying out binarization processing on the gray level images in the upper and lower boundaries to form a binarized image;
and moving a second sliding window on the binarized image column by column, and determining the left and right boundaries of the crown word number region according to the coverage areas of the second sliding window at different moving positions.
Further, the size of the first sliding window is determined according to the standard height of the crown word number area and the width of the crown word number searching area; and the size of the second sliding window is determined according to the standard height and the standard width of the crown word number region.
Further, the moving the first sliding window on the gray scale map of the crown word number search area line by line includes:
if the accumulated value of the pixels of the upper boundary of the crown word number area is smaller than that of the pixels of the lower boundary of the crown word number area in the standard crown word number area image, moving the first sliding window on the gray scale map of the crown word number search area line by line according to the sequence from top to bottom;
and if the accumulated value of the pixels on the upper boundary of the crown word number area is greater than the accumulated value of the pixels on the lower boundary of the crown word number area in the standard crown word number area image, moving the first sliding window on the gray scale map of the crown word number search area line by line according to the sequence from bottom to top.
Further, the determining the upper and lower boundaries of the crown word size area according to the coverage areas of the first sliding window at different moving positions includes:
respectively calculating the pixel accumulated value of each pixel point in the coverage areas of the first sliding window at different moving positions;
and determining the upper and lower boundaries of the coverage area of the first sliding window corresponding to the minimum pixel accumulated value as the upper and lower boundaries of the crown word size area.
Further, the determining, as the upper and lower boundaries of the crown region, the upper and lower boundaries of the coverage region of the first sliding window corresponding to the minimum accumulated pixel value further includes:
and if at least two minimum pixel accumulated values are obtained through calculation, determining the upper and lower boundaries of the coverage area of the first sliding window corresponding to the last obtained minimum pixel accumulated value as the upper and lower boundaries of the crown word size area by referring to the moving direction of the first sliding window.
Further, the binarizing processing the gray level map within the upper and lower boundaries to form a binarized image includes:
carrying out binarization processing on the gray level images in the upper and lower boundaries according to columns, and calculating the projection result of each column after completing the binarization processing on each column;
determining left and right boundaries of the crown word number region according to coverage areas of the second sliding window at different moving positions, comprising:
calculating a projection result accumulated value of each coverage area according to the columns included in the coverage areas at different moving positions of the second sliding window and the projection results of each column;
determining an extreme point type according to the processing mode of the binarization processing;
and acquiring a target projection result accumulated value matched with the extreme point type from the projection result accumulated values, and determining the left and right boundaries of the coverage area of the second sliding window corresponding to the target projection result accumulated value as the left and right boundaries of the crown word size area.
Further, after determining the left and right boundaries of the crown word number region according to the coverage areas of the second sliding window at different moving positions, the method further includes:
determining a crown word number area gray level image according to the upper and lower boundaries and the left and right boundaries in the gray level image of the crown word number search area;
equally dividing the crown word number area gray level image according to the number of the crown word number characters to form a plurality of divided areas;
and performing binarization processing on the plurality of divided areas respectively.
In a second aspect, an embodiment of the present invention further provides an apparatus for identifying a crown word number region, where the apparatus includes:
the upper and lower boundary determining module is used for moving the first sliding window line by line on the gray scale image of the crown word number searching area and determining the upper and lower boundaries of the crown word number area according to the coverage areas of the first sliding window at different moving positions;
the binarization processing module is used for carrying out binarization processing on the gray level images in the upper and lower boundaries to form a binarization image;
and the left and right boundary determining module is used for moving a second sliding window on the binarized image column by column and determining the left and right boundaries of the crown word number area according to the coverage areas of the second sliding window at different moving positions.
Further, the size of the first sliding window is determined according to the standard height of the crown word number area and the width of the crown word number searching area; and the size of the second sliding window is determined according to the standard height and the standard width of the crown word number region.
Further, the upper and lower boundary determining module includes:
the first moving submodule is used for moving the first sliding window line by line on the gray level image of the crown word number searching region according to the sequence from top to bottom if the pixel accumulated value of each pixel point on the upper boundary of the crown word number region is smaller than that of each pixel point on the lower boundary of the crown word number region in the standard crown word number region image;
and the second moving submodule is used for moving the first sliding window line by line on the gray scale map of the crown word number search area according to the sequence from bottom to top if the accumulated value of the pixels of the upper boundary of the crown word number area is larger than the accumulated value of the pixels of the lower boundary of the crown word number area in the standard crown word number area image.
Further, the upper and lower boundary determining module further includes:
the pixel accumulation submodule is used for respectively calculating the pixel accumulation value of each pixel point in the coverage area of the first sliding window at different moving positions;
and the boundary determining submodule is used for determining the upper boundary and the lower boundary of the coverage area of the first sliding window corresponding to the minimum pixel accumulated value as the upper boundary and the lower boundary of the crown word number area.
Further, the boundary determining sub-module is further configured to:
and if at least two minimum pixel accumulated values are obtained through calculation, determining the upper and lower boundaries of the coverage area of the first sliding window corresponding to the last obtained minimum pixel accumulated value as the upper and lower boundaries of the crown word size area by referring to the moving direction of the first sliding window.
Further, the binarization processing module is specifically configured to:
carrying out binarization processing on the gray level images in the upper and lower boundaries according to columns, and calculating the projection result of each column after completing the binarization processing on each column;
the left and right boundary determining module is specifically configured to:
calculating a projection result accumulated value of each coverage area according to the columns included in the coverage areas at different moving positions of the second sliding window and the projection results of each column;
determining an extreme point type according to the processing mode of the binarization processing;
and acquiring a target projection result accumulated value matched with the extreme point type from the projection result accumulated values, and determining the left and right boundaries of the coverage area of the second sliding window corresponding to the target projection result accumulated value as the left and right boundaries of the crown word size area.
Further, the method also comprises the following steps:
a gray map determining module, configured to determine, in a gray map of the crown word number search region, a gray map of the crown word number region according to the upper and lower boundaries and the left and right boundaries after determining the left and right boundaries of the crown word number region according to the coverage regions of the second sliding window at different moving positions;
the region segmentation module is used for equally segmenting the crown word number region gray level image according to the number of the crown word numbers to form a plurality of segmentation regions;
and the area binarization module is used for respectively carrying out binarization processing on the plurality of segmentation areas.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the method for identifying a crown word number region according to any one of the embodiments of the present invention when executing the computer program.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method for identifying a crown word number region according to any one of the embodiments of the present invention.
The embodiment of the invention firstly moves the first sliding window, determines the upper and lower boundaries of the crown word number area according to the coverage areas of the first sliding window at different moving positions on the gray map of the crown word number searching area, then carries out binarization processing on the gray map in the upper and lower boundaries, and finally moves the second sliding window on the binarized image row by row, thereby determining the left and right boundaries of the crown word number area.
Drawings
Fig. 1 is a schematic flowchart of a method for identifying a crown word number region according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for identifying a crown word number region according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for identifying a crown word number region according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flow chart of a method for identifying a crown word number region according to an embodiment of the present invention. The method is applicable to the case of processing the serial number of the paper currency, and can be executed by a serial number area identification device which can be composed of hardware and/or software and can be generally integrated in a computer and all terminals containing image processing functions. The method specifically comprises the following steps:
s110, moving the first sliding window line by line on the gray scale image of the crown word number searching area, and determining the upper and lower boundaries of the crown word number area according to the coverage area of the first sliding window at different moving positions.
The crown word number search area may be an area obtained after preliminary positioning in a banknote grayscale image, and specifically, the preliminary positioning process may be to obtain a grayscale image of a banknote image after image acquisition of the banknote and perform preliminary positioning on the crown word number area on the grayscale image according to an empirical value. Optionally, when the first sliding window moves line by line, the coverage area is different due to different moving positions, so that pixel points included in different coverage areas are also changed, and since the pixel values of the pixel points in the crown word number area are specific compared with the pixel values of the pixel points in other areas, when the first sliding window moves to a specific position, the pixel values of the pixel points included in the coverage area meet a preset condition, and then the upper and lower boundaries of the crown word number area are determined.
Preferably, the size of the first sliding window is determined according to the standard height of the crown word size region and the width of the crown word size search region.
Illustratively, if the standard height of the crown word size region is 20 and the width of the preliminarily determined crown word size search region is 300, the height of the first sliding window is 20 and the width thereof is 300. This has the advantage that when the first sliding window moves line by line, the upper and lower boundaries of the coverage area of the first sliding window can be determined as the upper and lower boundaries of the crown word number area once it is detected that the first sliding window moves to a position where the crown word number area can be completely covered.
And S120, performing binarization processing on the gray level map in the upper and lower boundaries to form a binarized image.
Optionally, a preset image binarization algorithm may be used to perform binarization processing on the gray level map within the upper and lower boundaries, where the binarization algorithm may be an OTSU (maximum inter-class variance) algorithm or a P parameter method. The basic idea of the OTSU algorithm is to divide an image into a foreground image and a background image according to an initial threshold, then calculate the variance between the two images, update the threshold, recalculate the inter-class variance, and when the threshold meeting the maximum inter-class variance is the obtained optimal threshold. The basic idea of the P-parameter method is to divide the image by cycling through different gray levels when the ratio of the target in the image is known, and calculate the ratio of the corresponding target, and if the difference between the ratio and the known target ratio is small enough, the threshold is the optimal division threshold.
The advantage of performing binarization processing after the upper and lower boundaries are determined is that the time for binarization processing is reduced and the processing efficiency is improved by reducing the gray level maps to be processed, i.e. only performing binarization processing on the gray level maps in the upper and lower boundaries.
Preferably, the binarization processing is performed on the gray scale maps within the upper and lower boundaries in columns, and after the binarization processing is completed for each column, the projection result of the column is calculated.
Wherein calculating the projection result of the row means calculating the sum of the row pixel values of the row. The method has the advantages that the cycle times of traversing each pixel point once can be reduced, so that the binarization processing process and the process of calculating the projection result of each column can be completed within the cycle of traversing the pixel points once, the processing time is further saved, and the processing efficiency is improved.
And S130, moving the second sliding window column by column on the binary image, and determining the left and right boundaries of the crown word size area according to the coverage areas of the second sliding window at different moving positions.
Optionally, when the second sliding window moves row by row, the coverage area is different due to different moving positions, so that pixel points included in different coverage areas are also changed, and since the pixel values of the pixel points in the crown word number area are specific compared with the pixel values of the pixel points in other areas, when the second sliding window moves to a specific position, the pixel values of the pixel points included in the coverage area meet a preset condition, and then the upper and lower boundaries of the crown word number area are determined.
In addition, the advantage of determining the upper and lower boundaries and then determining the left and right boundaries is that if there is contamination or noise on the gray scale map of the crown word number search area, since the number of pixels included in the row direction is greater than that in the column direction, the sum of the pixel values in the row direction due to the same contamination or noise has less influence, and when the crown word number area is accurately positioned, determining the upper and lower boundaries and then determining the left and right boundaries can improve the positioning accuracy of the crown word number area and reduce the influence of noise on positioning.
Preferably, the size of the second sliding window is determined according to the standard height and the standard width of the crown word size region.
Optionally, the size of the second sliding window is equal to the standard size of the crown word size region.
Illustratively, if the standard height of the crown region is 20 and the standard width is 200, the height of the second sliding window is 20 and the width thereof is 200. This has the advantage that, when the second sliding window is moved column by column, the left and right boundaries of the second sliding window coverage area can be determined as the left and right boundaries of the crown word number area upon detecting that the second sliding window has moved to a position where the second sliding window can completely cover the crown word number area.
Preferably, determining the left and right boundaries of the crown word size region according to the coverage areas of the second sliding window at different moving positions may include: respectively calculating projection result accumulated values of all coverage areas according to the columns included in the coverage areas at different moving positions of the second sliding window and the projection results of all the columns; determining the type of the extreme point according to the processing mode of binarization processing; and acquiring a target projection result accumulated value matched with the extreme point type from the projection result accumulated values, and determining the left and right boundaries of the coverage area of the second sliding window corresponding to the target projection result accumulated value as the left and right boundaries of the prefix number area.
And calculating the projection result accumulated value of each coverage area, namely calculating the sum of pixel values of each row of pixel points contained in each coverage area.
For example, if the formed binary image has a crown word number character assigned as black (pixel value of pixel is 0) and a background assigned as white (pixel value of pixel is 255), the pole type is a minimum value point; if the prefix character is assigned white and the background is assigned black, then the pole type is the maximum point.
Because the upper and lower boundaries of different characters in the crown word size are different, and the binarization threshold value in the local region corresponding to each character also has a difference, in order to further improve the positioning accuracy of the crown word size, and also in order to further eliminate noise interference and improve the binarization processing effect, it is preferable that, after determining the left and right boundaries of the crown word size region according to the coverage regions of the second sliding window at different moving positions, the method further includes: determining a gray scale image of the crown word number area according to an upper boundary, a lower boundary, a left boundary and a right boundary in the gray scale image of the crown word number search area; equally dividing the crown word number area gray level image according to the number of the crown word number characters to form a plurality of divided areas; the plurality of divided regions are subjected to binarization processing.
The method comprises the steps of dividing a crown word number region gray-scale map into a plurality of crown word number regions, dividing the crown word number regions into a plurality of division regions, dividing the division regions into a plurality of division regions, and dividing the division regions into the plurality of division regions.
According to the technical scheme of the embodiment, the first sliding window is moved firstly, the upper and lower boundaries of the crown word number area are determined according to the coverage areas of the first sliding window at different moving positions on the gray scale map of the crown word number searching area, binarization processing is performed on the gray scale map in the upper and lower boundaries, and finally the second sliding window is moved on the binarization image row by row to determine the left and right boundaries of the crown word number area.
Example two
Fig. 2 is a flowchart illustrating a method for identifying a crown word number region according to a second embodiment of the present invention. The present embodiment is optimized based on the above embodiments, and provides a preferred method for identifying a crown word number region, specifically, further optimizing the upper and lower boundaries of the crown word number region determined according to the coverage areas of the first sliding window at different moving positions by moving the first sliding window on the gray scale map of the crown word number search region line by line. The method specifically comprises the following steps:
s210, in the standard crown word number region image, whether the pixel accumulated value of each pixel point on the upper boundary of the crown word number region is smaller than that of each pixel point on the lower boundary of the crown word number region or not is judged, and if yes, S220 is executed; if not, go to S230.
Since the pixel values of the upper end and the lower end of the character contained in the font size are different in most cases, for example, in a gray map containing only the character "T", the upper end pixel value is lower than the lower end pixel value; in a gray-scale image containing only the character "a", the upper pixel value is higher than the lower pixel value. In addition, the heights of the letters and the numbers contained in the crown word numbers in each version of the RMB may be different, so that the sum of the pixel values of each point on the upper boundary is different from the sum of the pixel values of each point on the lower boundary, for example, for the RMB, the height of the first two letters in the crown word numbers of the 99 version of the RMB is higher than that of the last eight characters, and the height of the first two letters in the crown word numbers of the 15 version of the RMB is lower than that of the last eight characters, so that the sum of the pixel values of each point on the upper boundary is generally higher than that of each point on the lower boundary. Therefore, different moving directions need to be adopted for different standard crown word number area images corresponding to different standard paper money so as to reduce the influence of noise on the positioning accuracy of the upper and lower boundaries of the crown word number area.
And S220, moving the first sliding window line by line on the gray scale image of the crown word number search area according to the sequence from top to bottom.
Illustratively, the upper and lower boundaries of the crown word number region are respectively the 21 st line and the 40 th line of the crown word number search region, and when most of letters or numbers contained in the crown word number region in the standard crown word number region image are characters with obvious upper pixel values lower than lower pixel values, such as "T", "7", the pixel accumulated value of each pixel point on the upper boundary of the crown word number region is greater than the accumulated value of each pixel point on the lower boundary of the crown word number region. At this time, if the accumulated value of the pixels in the 21 st row is 200 and the accumulated value of the pixels in the 40 th row is 100, when noise occurs in the 20 th row, the pixel value of the noise (the noise is a black pixel) needs to be lower than 100 to cause the positioning error of the upper and lower boundaries; when noise occurs in line 41, the pixel value of the noise is lower than 200, which results in the positioning of the upper and lower boundaries being incorrect. In this case, the noise margin in the region below the lower boundary is higher than that in the region above the upper boundary. In addition, since the probability of occurrence of a small stain in a gray scale map is generally higher than the probability of occurrence of a large stain, it is not easy to cause an error in positioning a prefix region when the small stain occurs in a region below the lower boundary in general. In the limit case of two minimum pixel accumulated values, the upper and lower boundaries of the coverage area of the first sliding window corresponding to the minimum pixel accumulated value obtained finally are preferably determined as the upper and lower boundaries of the prefix region, so that the robustness of prefix region positioning can be improved by moving the first sliding window in the order from top to bottom.
And S230, moving the first sliding window on the gray map of the crown word number search area line by line according to the sequence from bottom to top.
Optionally, in the standard crown word number region image, when the pixel accumulated value of each pixel point on the upper boundary of the crown word number region is equal to the pixel accumulated value of each pixel point on the lower boundary of the crown word number region, the moving direction is not limited.
Illustratively, the upper and lower boundaries of the crown word number region are respectively the 21 st line and the 40 th line of the crown word number search region, and when the heights of the upper boundaries of the letters and the numbers contained in the crown word number region in the standard crown word number region image are not consistent (for example, 99 th edition or 15 th edition renminbi), the accumulated value of the pixels on the upper boundary of the crown word number region is larger than that of the pixels on the lower boundary of the crown word number region. At this time, if the accumulated value of the pixels in the 21 st row is 200 and the accumulated value of the pixels in the 40 th row is 100, when noise occurs in the 20 th row, the pixel value of the noise (the noise is a black pixel) needs to be lower than 100 to cause the positioning error of the upper and lower boundaries; when the noise appears on line 41, the pixel value of the noise is lower than 200, which causes the upper and lower boundaries to be positioned incorrectly, in which case the noise margin of the region above the upper boundary is higher than that of the region below the lower boundary. In addition, since the probability of occurrence of a small stain in a gray scale map is generally higher than the probability of occurrence of a large stain, it is not easy to cause an error in positioning the prefix size region when the small stain occurs in a region above the upper boundary in general. In the limit case of two minimum pixel accumulated values, the upper and lower boundaries of the coverage area of the first sliding window corresponding to the last minimum pixel accumulated value are preferably determined as the upper and lower boundaries of the prefix region, so that the robustness of prefix region positioning can be improved by moving the first sliding window in the order from bottom to top.
And S240, respectively calculating the accumulated value of each pixel point in the coverage area of the first sliding window at different moving positions.
Illustratively, the coverage area of the first sliding window includes 20 rows, and when the first sliding window starts to move from the 1 st row, the sum of the pixel values of all the pixel points in the 1 st row to the 20 th row in the gray scale map of the crown word number search area, that is, the pixel accumulated value of each pixel point in the 1 st row to the 20 th row is calculated; when the first sliding window moves downwards by one line, calculating the accumulated value of the pixels in the 2 nd line to the 21 st line; and when the first sliding window continues to move downwards by one row, calculating the pixel accumulation value of each pixel point in the 3 rd row to the 22 th row, and so on until all rows included in the gray-scale image of the crown word number search area are traversed.
And S250, determining the upper and lower boundaries of the coverage area of the first sliding window corresponding to the minimum pixel accumulated value as the upper and lower boundaries of the prefix size area.
When all the rows in the gray scale map of the crown word number search area are traversed, a plurality of pixel accumulated values can be obtained, the coverage area of the first sliding window corresponding to the minimum pixel accumulated value is selected, and the upper boundary and the lower boundary of the coverage area are determined as the upper boundary and the lower boundary of the crown word number area.
For example, when the first sliding window moves to the 21 st row and the calculated accumulated value of the pixels is the smallest, the 21 st row and the 40 th row are respectively determined as the upper and lower boundaries of the prefix size region.
Preferably, if at least two minimum pixel accumulated values are calculated, the upper and lower boundaries of the coverage area of the first sliding window corresponding to the last obtained minimum pixel accumulated value are determined as the upper and lower boundaries of the prefix size area with reference to the moving direction of the first sliding window.
Illustratively, in one limiting case, the accumulated pixel values in rows 20 to 39 are equal to the accumulated pixel values in rows 21 to 40, and are all the minimum accumulated pixel values. At this time, if the first sliding window moves line by line according to the sequence from top to bottom, determining the upper and lower boundaries of the 21 st line and the 40 th line prefix number areas; if the first sliding window is moved line by line in the order from bottom to top, the top and bottom boundaries of the 20 th and 39 th line prefix regions are determined.
And S260, carrying out binarization processing on the gray level map in the upper and lower boundaries to form a binarized image.
And S270, moving the second sliding window column by column on the binary image, and determining the left and right boundaries of the crown word size area according to the coverage areas of the second sliding window at different moving positions.
According to the technical scheme, the moving direction of the first sliding window is determined by judging the size relationship between the pixel accumulated value of each pixel point on the upper boundary of the crown word number region and the pixel accumulated value of each pixel point on the lower boundary of the crown word number region in the standard crown word number region image, so that the upper and lower boundaries of the coverage region of the first sliding window corresponding to the minimum pixel accumulated value are selected from the calculated pixel accumulated values and determined as the upper and lower boundaries of the crown word number region, the positioning robustness of the crown word number region is improved, and the influence of image noise or contamination on the positioning accuracy is reduced.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an apparatus for identifying a crown word number region according to a third embodiment of the present invention. The device can be applied to the condition of processing the serial number of the paper currency, can be composed of hardware and/or software, and can be generally integrated in a computer and all terminals containing image processing functions. Referring to fig. 3, the apparatus for recognizing the crown word number region includes: an upper and lower boundary determining module 310, a binarization processing module 320, and a left and right boundary determining module 330, which are described in detail below.
An upper and lower boundary determining module 310, configured to move a first sliding window line by line on a grayscale map of a crown word number search area, and determine an upper and lower boundary of a crown word number area according to coverage areas of the first sliding window at different moving positions;
a binarization processing module 320, configured to perform binarization processing on the grayscale map within the upper and lower boundaries to form a binarized image;
a left-right boundary determining module 330, configured to move a second sliding window column by column on the binarized image, and determine left and right boundaries of the crown word number region according to coverage areas of the second sliding window at different moving positions.
According to the identification device of the crown word number area provided by the embodiment of the invention, the first sliding window is moved firstly, the upper and lower boundaries of the crown word number area are determined according to the coverage areas of the first sliding window at different moving positions on the gray scale image of the crown word number search area, then the binarization processing is carried out on the gray scale image in the upper and lower boundaries, finally the second sliding window is moved on the binarization image column by column, and then the left and right boundaries of the crown word number area are determined.
Optionally, the size of the first sliding window is determined according to the standard height of the crown word number region and the width of the crown word number search region; and the size of the second sliding window is determined according to the standard height and the standard width of the crown word number region.
Optionally, the upper and lower boundary determining module 310 may include:
the first moving submodule is used for moving the first sliding window line by line on the gray level image of the crown word number searching region according to the sequence from top to bottom if the pixel accumulated value of each pixel point on the upper boundary of the crown word number region is smaller than that of each pixel point on the lower boundary of the crown word number region in the standard crown word number region image;
and the second moving submodule is used for moving the first sliding window line by line on the gray scale map of the crown word number search area according to the sequence from bottom to top if the accumulated value of the pixels of the upper boundary of the crown word number area is larger than the accumulated value of the pixels of the lower boundary of the crown word number area in the standard crown word number area image.
Optionally, the upper and lower boundary determining module 310 may further include:
the pixel accumulation submodule is used for respectively calculating the pixel accumulation values of all pixel points in the coverage areas of the first sliding window at different moving positions;
and the boundary determining submodule is used for determining the upper boundary and the lower boundary of the coverage area of the first sliding window corresponding to the minimum pixel accumulated value as the upper boundary and the lower boundary of the crown word number area.
Optionally, the boundary determining sub-module may be further configured to:
and if at least two minimum pixel accumulated values are obtained through calculation, determining the upper and lower boundaries of the coverage area of the first sliding window corresponding to the last obtained minimum pixel accumulated value as the upper and lower boundaries of the crown word size area by referring to the moving direction of the first sliding window.
Optionally, the binarization processing module 320 may be specifically configured to:
carrying out binarization processing on the gray level images in the upper and lower boundaries according to columns, and calculating the projection result of each column after completing the binarization processing on each column;
the left-right boundary determining module 330 may be specifically configured to:
calculating a projection result accumulated value of each coverage area according to the columns included in the coverage areas at different moving positions of the second sliding window and the projection results of each column;
determining an extreme point type according to the processing mode of the binarization processing;
and acquiring a target projection result accumulated value matched with the extreme point type from the projection result accumulated values, and determining the left and right boundaries of the coverage area of the second sliding window corresponding to the target projection result accumulated value as the left and right boundaries of the crown word size area.
Optionally, the method may further include:
a gray map determining module, configured to determine, in a gray map of the crown word number search region, a gray map of the crown word number region according to the upper and lower boundaries and the left and right boundaries after determining the left and right boundaries of the crown word number region according to the coverage regions of the second sliding window at different moving positions;
the region segmentation module is used for equally segmenting the crown word number region gray level image according to the number of the crown word numbers to form a plurality of segmentation regions;
and the area binarization module is used for respectively carrying out binarization processing on the plurality of segmentation areas.
The product can execute the method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 4 is only one example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 4, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system memory 28, for example, implementing the method for identifying a crown word number region provided by the embodiment of the present invention: moving a first sliding window line by line on a gray scale image of a crown word number search area, and determining the upper and lower boundaries of a crown word number area according to the coverage areas of the first sliding window at different moving positions; carrying out binarization processing on the gray level images in the upper and lower boundaries to form a binarized image; and moving a second sliding window on the binarized image column by column, and determining the left and right boundaries of the crown word number region according to the coverage areas of the second sliding window at different moving positions.
EXAMPLE five
An embodiment five of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for identifying a crown word number region as provided in all inventive embodiments of the present application: moving a first sliding window line by line on a gray scale image of a crown word number search area, and determining the upper and lower boundaries of a crown word number area according to the coverage areas of the first sliding window at different moving positions; carrying out binarization processing on the gray level images in the upper and lower boundaries to form a binarized image; and moving a second sliding window on the binarized image column by column, and determining the left and right boundaries of the crown word number region according to the coverage areas of the second sliding window at different moving positions.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (9)
1. A method for identifying a crown word number region, comprising:
moving a first sliding window line by line on a gray scale image of a crown word number search area, and determining the upper and lower boundaries of a crown word number area according to the coverage areas of the first sliding window at different moving positions;
carrying out binarization processing on the gray level images in the upper and lower boundaries to form a binarized image;
the binarization processing of the gray level images in the upper and lower boundaries to form a binarized image comprises the following steps:
carrying out binarization processing on the gray level images in the upper and lower boundaries according to columns, and calculating the projection result of each column after completing the binarization processing on each column;
determining left and right boundaries of the crown word number region according to coverage areas of a second sliding window at different moving positions, comprising:
calculating a projection result accumulated value of each coverage area according to the columns included in the coverage areas at different moving positions of the second sliding window and the projection results of each column;
determining an extreme point type according to the processing mode of the binarization processing;
acquiring a target projection result accumulated value matched with the extreme point type from the projection result accumulated values, and determining the left and right boundaries of the coverage area of the second sliding window corresponding to the target projection result accumulated value as the left and right boundaries of the crown word size area;
and moving a second sliding window on the binarized image column by column, and determining the left and right boundaries of the crown word number region according to the coverage areas of the second sliding window at different moving positions.
2. The method of claim 1, wherein:
the size of the first sliding window is determined according to the standard height of the crown word number area and the width of the crown word number searching area; and the size of the second sliding window is determined according to the standard height and the standard width of the crown word number region.
3. The method of claim 2, wherein moving the first sliding window line by line on the gray scale map of the crown word number search region comprises:
if the accumulated value of the pixels of the upper boundary of the crown word number area is smaller than that of the pixels of the lower boundary of the crown word number area in the standard crown word number area image, moving the first sliding window on the gray scale map of the crown word number search area line by line according to the sequence from top to bottom;
and if the accumulated value of the pixels on the upper boundary of the crown word number area is greater than the accumulated value of the pixels on the lower boundary of the crown word number area in the standard crown word number area image, moving the first sliding window on the gray scale map of the crown word number search area line by line according to the sequence from bottom to top.
4. The method of claim 3, wherein determining the upper and lower boundaries of the crown word size region according to the coverage area of the first sliding window at different moving positions comprises:
respectively calculating the pixel accumulated value of each pixel point in the coverage areas of the first sliding window at different moving positions;
and determining the upper and lower boundaries of the coverage area of the first sliding window corresponding to the minimum pixel accumulated value as the upper and lower boundaries of the crown word size area.
5. The method of claim 4, wherein determining upper and lower boundaries of the coverage area of the first sliding window corresponding to the minimum pixel accumulation value as upper and lower boundaries of the crown region further comprises:
and if at least two minimum pixel accumulated values are obtained through calculation, determining the upper and lower boundaries of the coverage area of the first sliding window corresponding to the last obtained minimum pixel accumulated value as the upper and lower boundaries of the crown word size area by referring to the moving direction of the first sliding window.
6. The method of claim 1, further comprising, after determining the left and right boundaries of the crown number region from the coverage areas of the second sliding window at different movement locations:
determining a crown word number area gray level image according to the upper and lower boundaries and the left and right boundaries in the gray level image of the crown word number search area;
equally dividing the crown word number area gray level image according to the number of the crown word number characters to form a plurality of divided areas;
and performing binarization processing on the plurality of divided areas respectively.
7. An apparatus for identifying a crown word number region, comprising:
the upper and lower boundary determining module is used for moving the first sliding window line by line on the gray scale image of the crown word number searching area and determining the upper and lower boundaries of the crown word number area according to the coverage areas of the first sliding window at different moving positions;
the binarization processing module is used for carrying out binarization processing on the gray level images in the upper and lower boundaries to form a binarization image;
a left-right boundary determining module, configured to move a second sliding window column by column on the binarized image, and determine left and right boundaries of the crown word number region according to coverage areas of the second sliding window at different moving positions;
the binarization processing module may specifically be configured to:
carrying out binarization processing on the gray level images in the upper and lower boundaries according to columns, and calculating the projection result of each column after completing the binarization processing on each column;
the left-right boundary determining module may be specifically configured to:
calculating a projection result accumulated value of each coverage area according to the columns included in the coverage areas at different moving positions of the second sliding window and the projection results of each column;
determining an extreme point type according to the processing mode of the binarization processing;
and acquiring a target projection result accumulated value matched with the extreme point type from the projection result accumulated values, and determining the left and right boundaries of the coverage area of the second sliding window corresponding to the target projection result accumulated value as the left and right boundaries of the crown word size area.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-6 when executing the program.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710239389.9A CN108734161B (en) | 2017-04-13 | 2017-04-13 | Method, device and equipment for identifying prefix number area and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710239389.9A CN108734161B (en) | 2017-04-13 | 2017-04-13 | Method, device and equipment for identifying prefix number area and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108734161A CN108734161A (en) | 2018-11-02 |
CN108734161B true CN108734161B (en) | 2022-01-25 |
Family
ID=63924485
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710239389.9A Active CN108734161B (en) | 2017-04-13 | 2017-04-13 | Method, device and equipment for identifying prefix number area and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108734161B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112740151B (en) * | 2018-11-08 | 2024-07-30 | 深圳市欢太科技有限公司 | Data input method of terminal equipment, terminal equipment and storage medium |
CN110276353B (en) * | 2019-05-09 | 2021-06-29 | 深圳怡化电脑股份有限公司 | Method and device for segmenting prefix number characters, readable storage medium and terminal equipment |
CN110223309B (en) * | 2019-05-20 | 2021-07-06 | 深圳新视智科技术有限公司 | Edge detection method, edge detection device, computer equipment and storage medium |
CN112733834B (en) * | 2021-03-30 | 2021-07-06 | 恒银金融科技股份有限公司 | Character area positioning method based on non-matrix window mode |
CN113989304A (en) * | 2021-11-10 | 2022-01-28 | 心医国际数字医疗系统(大连)有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1869640A1 (en) * | 2005-04-15 | 2007-12-26 | Earth Resource Management Services (ERM.S) | Method for hierarchical determination of coherent events in a seismic image |
CN103903018A (en) * | 2014-04-02 | 2014-07-02 | 浙江师范大学 | Method and system for positioning license plate in complex scene |
CN105069893A (en) * | 2015-08-17 | 2015-11-18 | 深圳怡化电脑股份有限公司 | Method and apparatus for checking bank note |
CN105184290A (en) * | 2015-08-25 | 2015-12-23 | 深圳怡化电脑股份有限公司 | Target region extraction method and system |
CN106022346A (en) * | 2016-05-24 | 2016-10-12 | 深圳怡化电脑股份有限公司 | Banknote number cutting method and device |
CN106056751A (en) * | 2016-05-20 | 2016-10-26 | 聚龙股份有限公司 | Prefix number identification method and system |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8867828B2 (en) * | 2011-03-04 | 2014-10-21 | Qualcomm Incorporated | Text region detection system and method |
CN103093181B (en) * | 2011-11-01 | 2016-04-27 | 青岛海信网络科技股份有限公司 | A kind of method and apparatus of license plate image location |
CN105225335A (en) * | 2015-10-28 | 2016-01-06 | 深圳怡化电脑股份有限公司 | A kind of stained recognition methods of paper money number and system |
-
2017
- 2017-04-13 CN CN201710239389.9A patent/CN108734161B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1869640A1 (en) * | 2005-04-15 | 2007-12-26 | Earth Resource Management Services (ERM.S) | Method for hierarchical determination of coherent events in a seismic image |
CN103903018A (en) * | 2014-04-02 | 2014-07-02 | 浙江师范大学 | Method and system for positioning license plate in complex scene |
CN105069893A (en) * | 2015-08-17 | 2015-11-18 | 深圳怡化电脑股份有限公司 | Method and apparatus for checking bank note |
CN105184290A (en) * | 2015-08-25 | 2015-12-23 | 深圳怡化电脑股份有限公司 | Target region extraction method and system |
CN106056751A (en) * | 2016-05-20 | 2016-10-26 | 聚龙股份有限公司 | Prefix number identification method and system |
CN106022346A (en) * | 2016-05-24 | 2016-10-12 | 深圳怡化电脑股份有限公司 | Banknote number cutting method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108734161A (en) | 2018-11-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108734161B (en) | Method, device and equipment for identifying prefix number area and storage medium | |
CN110569830B (en) | Multilingual text recognition method, device, computer equipment and storage medium | |
US11113836B2 (en) | Object detection method, device, apparatus and computer-readable storage medium | |
CN109740469B (en) | Lane line detection method, lane line detection device, computer device, and storage medium | |
CN110046529B (en) | Two-dimensional code identification method, device and equipment | |
CN107437294B (en) | Character segmentation method, device, equipment and storage medium | |
CN108491845B (en) | Character segmentation position determination method, character segmentation method, device and equipment | |
CN109117814B (en) | Image processing method, image processing apparatus, electronic device, and medium | |
CN107067536B (en) | A kind of image boundary determines method, apparatus, equipment and storage medium | |
CN110598686A (en) | Invoice identification method, system, electronic equipment and medium | |
CN110135225B (en) | Sample labeling method and computer storage medium | |
CN110674811B (en) | Image recognition method and device | |
CN109389110B (en) | Region determination method and device | |
CN115063618B (en) | Defect positioning method, system, equipment and medium based on template matching | |
CN115439866A (en) | Method, equipment and storage medium for identifying table structure of three-line table | |
CN112837384B (en) | Vehicle marking method and device and electronic equipment | |
CN113392455A (en) | House type graph scale detection method and device based on deep learning and electronic equipment | |
JPH10307889A (en) | Character recognition method, its device and recording medium recording character recognition program | |
CN109726722B (en) | Character segmentation method and device | |
CN109145916B (en) | Image character recognition and cutting method and storage device | |
CN114120305B (en) | Training method of text classification model, and text content recognition method and device | |
CN113378847B (en) | Character segmentation method, system, computer device and storage medium | |
CN106886777B (en) | Character boundary determining method and device | |
CN112784737B (en) | Text detection method, system and device combining pixel segmentation and line segment anchor | |
CN111368572A (en) | Two-dimensional code identification method and system |
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 |