CN116452615B - Segmentation method and device for foreground and background of crown word size region - Google Patents

Segmentation method and device for foreground and background of crown word size region Download PDF

Info

Publication number
CN116452615B
CN116452615B CN202310720261.XA CN202310720261A CN116452615B CN 116452615 B CN116452615 B CN 116452615B CN 202310720261 A CN202310720261 A CN 202310720261A CN 116452615 B CN116452615 B CN 116452615B
Authority
CN
China
Prior art keywords
character
pixel
crown word
threshold
image
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
CN202310720261.XA
Other languages
Chinese (zh)
Other versions
CN116452615A (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.)
Cashway Technology Co Ltd
Original Assignee
Cashway 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 Cashway Technology Co Ltd filed Critical Cashway Technology Co Ltd
Priority to CN202310720261.XA priority Critical patent/CN116452615B/en
Publication of CN116452615A publication Critical patent/CN116452615A/en
Application granted granted Critical
Publication of CN116452615B publication Critical patent/CN116452615B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • 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

Abstract

The application provides a segmentation method and a segmentation device for a foreground and a background of a crown word size region; the method comprises the following steps: splitting the crown word size area A according to the number of noise points and a preset width threshold W to obtain a plurality of single small block character graphs C; selecting a plurality of target small images in a single small character image C, and determining a sequence F and a character area G according to the numerical relation between Euclidean distances among pixel points of each target small image and a preset Euclidean threshold k; adjusting the pixel value of the pixel point in the character area G to obtain a secondary adjustment chart I; repeatedly adjusting the secondary denoising graph I based on the adjusted European threshold k 'and the adjusted standardized threshold q' to obtain an independent character graph J; and splicing the independent character graph J with other small graphs M to obtain a crown word size image Z after segmentation of the foreground and the background. According to the application, the optimal k and q values are obtained through calculation and repeated adjustment of the Euclidean distance so as to cut the crown word size, and a cleaner crown word size image can be obtained.

Description

Segmentation method and device for foreground and background of crown word size region
Technical Field
The application relates to the technical field of image processing, in particular to a method and a device for segmenting a foreground and a background of a crown word size region.
Background
The foreground and background segmentation technology of images relates to the extensive and detailed business field, for example, background noise is needed to be removed in the technology of recognizing the crown word number of currency so as to highlight the main character of the crown word number, and the clear main character plays a key role in the recognition accuracy of the crown word number.
At present, a common method for segmenting the front background and the rear background of the crown word size comprises the steps of dimming and highlighting a main character of the crown word size image, then binarizing or graying the adjusted crown word size image, and finding pixels with pixel values lower than the average value of regional pixel values in the graying or binarized crown word size image to determine the outer boundary of the crown word size, so that the foreground and the background are segmented.
The existing segmentation method is more suitable for crown word number graphs with clear background, simple structure and few noise points, but the optimal region pixel mean value is difficult to find for currency images such as the fast, so that the crown word number character pixels are different from the background pixels, and aiming at paper money similar to fast currency, different constant parameters are needed to position the boundaries of the crown word number regions, so that the existing method has the characteristics of weak robustness and weak universality.
Disclosure of Invention
Based on this, it is an object of the present application to provide a method and apparatus for segmentation of the foreground and background of a crown word size area to segment the foreground and background of the crown word size area.
In a first aspect, the present embodiment provides a segmentation method for a foreground and a background of a crown word size region, where the segmentation method includes: step 1: obtaining a crown word number area A of the initial bill image based on a standardized threshold q of pixel points in the initial bill image, wherein the crown word number area A comprises all crown word number complete characters; step 2: splitting the crown word size area A according to the number of noise points and a preset width threshold W to obtain a plurality of single small character patterns C; step 3: selecting a plurality of target small images in a single small character image C, and determining a sequence F and a character area G according to the numerical relation between Euclidean distances among pixel points of each target small image and a preset Euclidean threshold k; step 4: based on the standardized threshold q, adjusting the pixel value of the pixel point in the character area G to obtain a secondary adjustment chart I; step 5: adjusting the European threshold k and the standardized threshold q, and repeatedly executing the step 3 and the step 4 on the secondary denoising picture I based on the adjusted European threshold k 'and the adjusted standardized threshold q' to obtain an independent character picture J; step 6: processing other single small block character graphs C except the target small graph to obtain other small graphs M; step 7: and splicing the independent character graph J with other small graphs M to obtain a crown word size image Z after segmentation of the foreground and the background.
Further, step 1 includes: 1-1: calculating the average value of all pixel values of a target crown word number area of the initial bill image; 1-2: taking the average value as a standardized threshold value q, assigning a pixel value of a pixel point smaller than q in a target crown word number area as a first numerical value, and assigning a pixel value of a pixel point larger than or equal to q as a second numerical value, wherein the first numerical value is smaller than q, and the second numerical value is larger than q;1-3: and determining the crown word number area A according to the assigned pixel value.
Further, step 2 includes: 2-1: according to a preset width threshold W, performing quasi-splitting on the crown word size area A to obtain a plurality of quasi-splitting areas; 2-2: calculating the number of black pixel points of each column in each to-be-split area, and taking the to-be-split area with the largest number of columns as a noise area B;2-3: calculating the transverse width W1 of the nearest neighbor character below or above the noise area B; 2-4: and taking the maximum value in the preset width threshold W and the transverse width W1 as the cutting width, and evenly cutting the crown word size area A from left to right to obtain a plurality of single small block character graphs C.
Further, step 3 includes: 3-1: taking a small image R where the noise area B is located and a single small character image C on the left side and the right side of the small image R as a target small image; 3-2: determining a reference pixel value of a reference coordinate according to the central position coordinate and the central position pixel value of each target small image; 3-3: respectively calculating Euclidean distances between pixel values of pixel points at other positions of each target small image and the reference pixel values of the target small image; 3-4: determining a sequence F according to the position coordinates of the pixel points in the target small image, the Euclidean distance and the positions of the pixel points in the target small image, wherein the numerical value of a data set contained in the sequence F is equal to the number of the pixel points in the target small image; 3-5: and adjusting pixel values of pixel points with Euclidean distance smaller than a preset Euclidean threshold k in each sequence F, and obtaining a character region G and a character boundary T based on an adjustment result.
Further, the step 3-5 includes: 3-5-1: the data sets in the sequence F are arranged in ascending order according to the value of the Euclidean distance to obtain a sequence F';3-5-2: extracting pixel points corresponding to the first k data sets of the sequence F', and determining a character boundary T according to the position coordinates of the extracted pixel points; 3-5-3: assigning the pixel value of the pixel point corresponding to the data set after the kth of the sequence F' to be the first numerical value in the step 1-2; 3-5-4: and combining the pixel points corresponding to the k data sets in the sequence F' and the pixel points after assignment to obtain a character region G.
Further, step 6 includes: 6-1: transversely projecting other single small block character graphs C except the target small graph to obtain pixel values of each row of each single small block character graph C; 6-2: calculating the row X with the continuous pixel value of 0 of each other single small block character graph C; 6-3: if the number of lines X is larger than a preset value, defining a region corresponding to the number of lines X as a black region Y;6-4: if the pixel value of each pixel point adjacent to the upper and lower black areas Y is not 0, the pixel values within the black areas Y are not processed, and the pixel values of the pixel points of the areas except the black areas Y in other single small block character images C are increased or decreased to obtain other small images M.
Further, step 4 includes: and (3) carrying out assignment in the step (1-2) on the pixel values of the pixel points outside the character boundary T in the character region G, and carrying out no assignment processing on the pixel values of the pixel points in the region inside the character boundary T.
Further, step 5 includes: for the step 3 which is repeatedly executed, 3 secondary adjustment images I are used as 3 target small images of the step 3 to carry out the same processing, so as to obtain 3 images E; and for the repeatedly executed step 4, the adjusted standardized threshold q 'is redetermined based on the pixel values of all the pixel points in the 3 secondary adjustment images I, and the pixel value assignment is carried out on the obtained 3 images E based on q', so that the repeated operation is continuously carried out until the independent character image J is obtained.
In a second aspect, an embodiment of the present application provides a segmentation apparatus for a foreground and a background of a crown word size region, the segmentation apparatus including: the threshold determining module is used for obtaining a crown word number area A of the initial bill image based on a standardized threshold q of pixel points in the initial bill image, wherein the crown word number area A comprises all crown word number complete characters; the splitting module is used for splitting the crown word size area A according to the number of noise points and a preset width threshold W to obtain a plurality of single small character diagrams C; the sequence confirming module is used for selecting a plurality of target small images in the single small character image C, and determining a sequence F and a character area G according to the numerical relation between Euclidean distances among pixel points of the target small images and a preset Euclidean threshold k; the adjustment module is used for adjusting the pixel value of the pixel point in the character area G based on the standardized threshold value q to obtain a secondary adjustment chart I; the circulation module is used for adjusting the European threshold k and the standardized threshold q, and repeatedly executing the step 3 and the step 4 on the secondary denoising diagram I based on the adjusted European threshold k 'and the adjusted standardized threshold q' to obtain an independent character diagram J; the other character processing module is used for processing other single small block character graphs C except the target small graph to obtain other small graphs M; and the synthesis module is used for splicing the independent character graph J with other small graphs M to obtain a crown word size image Z after the segmentation of the foreground and the background.
The embodiment of the application has the following beneficial effects:
1. and 3, optimizing the crown word size image through a threshold k of Euclidean distance between pixel points, reducing the constant use of non-universality and reducing the workload of calculating the cut image.
2. And step 7, the optimal k and q values are obtained through repeated adjustment, so that the robustness of a cutting algorithm is improved, and a cleaner crown word size image can be obtained.
3. The method has strong universality, is applicable to target areas with fewer noise points, and can be used for expanding the example of directly calculating the neighborhood category without cutting single characters. Or is also suitable for recognizing the hand-sign characters.
4. The application determines the boundary of the crown word size area by calculating the distance between adjacent pixels of the target area and judging the difference value of the adjacent pixel values, thereby dividing the foreground and the background of the crown word size.
Additional features and advantages of the application will be set forth in the description which follows, or in part will be obvious from the description, or may be learned by practice of the application.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for segmenting a foreground and a background of a crown word size region according to an embodiment of the present application;
fig. 2 is a schematic diagram of a crown word size area a according to an embodiment of the present application;
fig. 3 is a schematic diagram of a quasi-splitting area according to an embodiment of the present application;
fig. 4 is a schematic diagram of a noise area B and a nearest neighbor character S according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a set of single tile character maps C provided by an embodiment of the present application;
fig. 6 is a schematic diagram of a character area G according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a secondary adjustment chart I according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an independent character chart J according to an embodiment of the present application;
fig. 9 is a schematic diagram of a crown word size image Z according to an embodiment of the present application;
fig. 10 is a schematic diagram of character areas where characters are connected according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Examples
The embodiment provides a method for segmenting foreground and background of a crown word size region, and fig. 1 is a flowchart of the method, and the method includes:
step 1: and obtaining a crown word number area A of the initial bill image based on the standardized threshold q of the pixel points in the initial bill image, wherein the crown word number area A comprises all crown word number complete characters.
Specifically, the above-obtained crown word number area is shown in fig. 2.
The step 1 comprises the following steps:
1-1: and calculating the average value of all pixel values of the target crown word number area of the initial bill image.
1-2: and taking the average value as a standardized threshold value q, assigning a pixel value of a pixel point smaller than q in the target crown word number area as a first numerical value, and assigning a pixel value of a pixel point larger than or equal to q as a second numerical value, wherein the first numerical value is smaller than q, and the second numerical value is larger than q.
Specifically, if the average value of all the calculated pixel values is 150, if the pixel value of a certain point in the target crown word size area is 135, the pixel value of the certain point is assigned as 100; if the pixel value of a point is originally 175, the pixel value of the point is assigned 200. This process is a preliminary denoising process, and can increase the difference between the foreground and the background.
1-3: and determining the crown word number area A according to the assigned pixel value.
Step 2: and splitting the crown word size area A according to the number of noise points and a preset width threshold W to obtain a plurality of single small block character graphs C.
The step 2 comprises the following steps:
2-1: and according to a preset width threshold W, performing quasi-splitting on the crown word number area A to obtain a plurality of quasi-splitting areas.
As shown in fig. 3, 3 quasi-split areas are between 4 gray vertical lines.
Specifically, the first 2 contains more noise above and contains this 2 and other characters can be separated to the greatest extent (the width of the hand mark obtains this width W, which can be said to be a preset empirical threshold.
2-2: and calculating the number of black pixel points of each column in each quasi-split area, and taking the quasi-split area with the column with the largest number as a noise area B.
Specifically, as shown in fig. 4, the noise region B is a region above the first "2".
2-3: the lateral width W1 of the nearest neighbor character below or above the noise region B is calculated.
Specifically, in fig. 4, there is the nearest neighbor character below B, i.e., the S region, and the lateral width of the S region is W1.
2-4: and taking the maximum value in the preset width threshold W and the transverse width W1 as the cutting width, and evenly cutting the crown word size area A from left to right to obtain a plurality of single small block character graphs C.
Specifically, all of the individual tile character maps C are shown in fig. 5, and each rectangle of fig. 5 is 1 individual tile character map C.
The significance of the steps 2-4 is as follows: the method ensures that the nearest neighbor characters above or below the noise area B with the largest noise are contained in a cut character graph, simultaneously ensures that the adjacent character areas of the characters contain fewer noise from top to bottom, ensures convenient observation, highlights the number of character pixels, and reduces the condition that the number of noise is more than the number of character pixels.
Step 3: and selecting a plurality of target small images in the single small character image C, and determining a sequence F and a character area G according to the numerical relation between Euclidean distances among pixel points of the target small images and a preset Euclidean threshold k.
The step 3 comprises the following steps:
3-1: and taking the small image R where the noise area B is positioned and a single small character image C on the left side and the right side of the small image R as target small images.
Specifically, 3 target panels are labeled as in FIG. 5. A large number of experiments prove that the subsequent processing of selecting the 3 target small images in fig. 5 is most suitable, namely, the noise in the image can be accurately processed, and useless workload is not increased. In practical applications, the number may be adjusted based on different types of notes.
3-2: and determining the reference pixel value of the reference coordinate according to the central position coordinate and the central position pixel value of each target small image.
Specifically, the center position is the intersection point of the diagonal lines of the rectangular picture, the coordinates of the intersection point may be (1/2 ), and the pixels at the center position may be black or not black; if the pixel is black, the central position coordinate and the central position pixel value are the reference coordinate and the reference pixel value respectively, otherwise, the position of the pixel which is closest to the central position in physical distance and is black is taken as the reference point, the position of the pixel is the reference coordinate, and the pixel is the reference pixel value.
3-3: and respectively calculating Euclidean distances between the pixel values of the pixel points at other positions of each target small image and the reference pixel values of the target small image.
Specifically, the difference between pixel values is the euclidean distance.
3-4: and determining a sequence F according to the position coordinates of the pixel points, the Euclidean distance and the positions of the target small images, wherein the numerical value of a data set contained in the sequence F is equal to the number of the pixel points in the target small images.
For step 3, for example, for the plot R of fig. 5, for example, the pixel value of the center position is black RGB (0, 0), then the center position is the reference position, for example, there are 3×4 pixels (hundreds or thousands of pixels in actual operation) in the plot R, as can be seen from fig. 5, R is the 5 th plot, and then the obtained sequence F is: { [ (0, 0), 10,5], [ (0, 1), 20,5],. Cndot }, wherein [ (0, 0), 10,5] is a data set, and since there are 12 pixels in R, there are 12 such data sets in F, wherein (0, 0) or (0, 1) in the data sets represents the position coordinates of the pixels; 10 or 20 in the data set represents the corresponding euclidean distance (i.e. the difference between the pixel value of the point and the reference pixel value); and 5 in the data set represents the category, i.e. R is the 5 th panel. Each target plot corresponds to one sequence F, so here 3 sequences F can be obtained.
3-5: and adjusting pixel values of pixel points with Euclidean distance smaller than a preset Euclidean threshold k in each sequence F, and obtaining a character region G and a character boundary T based on an adjustment result.
Specifically, the euclidean threshold k may be adjusted according to actual requirements, for example, k may be set to 200 or 150.
Specifically, steps 3-5 include:
3-5-1: and (3) according to the numerical value of the Euclidean distance, ascending order arrangement is carried out on the data groups in the sequence F, so as to obtain a sequence F'.
3-5-2: and extracting pixel points corresponding to the first k data sets of the sequence F', and determining a character boundary T according to the position coordinates of the extracted pixel points.
3-5-3: and (3) assigning the pixel value of the pixel point corresponding to the data set after the kth of the sequence F' to be the first numerical value in the step (1-2).
3-5-4: and combining the pixel points corresponding to the k data sets in the sequence F' and the pixel points after assignment to obtain a character region G.
Here, k pixel points can be obtained for each sequence F' including k sets of data, and the upper, lower, left, and right boundaries can be determined from the coordinate data of the k pixel points. As shown in fig. 6, the character boundary T is a small rectangular area formed by four points of "2" up, down, left and right (for convenience of observation, the four points do not completely correspond to T, and in actual operation, the four points should coincide with border lines of the character boundary T), and the character area G is the entire rectangular area shown in fig. 6. As shown in fig. 6, which is a schematic diagram of the character area G, the point in the middle of "2" is the center position.
Step 4: and adjusting the pixel value of the pixel point in the character area G based on the standardized threshold q to obtain a secondary adjustment chart I.
Here, 3 secondary adjustment maps I are obtained as shown in fig. 7.
Specifically, here, the process corresponds to the process of secondary denoising, and the denoising process is the same as that of step 1-2. Specifically, the assignment of step 1-2 is only performed on the pixel values of the pixel points outside the character boundary T in the character region G, and no assignment processing is performed on the region inside the character boundary T.
Step 5: and (3) adjusting the European threshold k and the standardized threshold q, and repeatedly executing the step (3) and the step (4) on the secondary denoising diagram I based on the adjusted European threshold k 'and the adjusted standardized threshold q' to obtain an independent character diagram J.
Specifically, for the repeatedly executed step 3, the same process is performed with the 3 secondary adjustment charts I of fig. 7 as the 3 target small charts of the step 3, so as to obtain 3 images E; for the repeatedly executed step 4, the normalized threshold q 'is to be redetermined based on the pixel values of all the pixel points in the 3 secondary adjustment images I, and the pixel value assignment (i.e. the denoising process) is performed on the obtained 3 images E based on q', and the steps are repeated until the definition requirement is met, i.e. until the independent character image J with clear segmentation of the foreground and the background shown in fig. 8 is obtained.
Specifically, the purpose of the loop repetition here is to obtain, through multiple attempts, a suitable k ', q' and then an image J in which the noise region and the background are fused and the character region is clear.
Step 6: and processing other single small block character graphs C except the target small graph to obtain other small graphs M.
The step 6 comprises the following steps:
6-1: and transversely projecting other single small block character graphs C except the target small graph to obtain pixel values of each row of each other single small block character graph C.
Here, in practical application, for the rest of the characters, there is a high possibility that the left or right of the character has a noise, and the probability that the upper or lower of the character has a noise is small, so the lateral projection is selected here.
6-2: the number of rows X with a continuous pixel value of 0 (i.e., black) for each other single tile character map C is calculated.
6-3: if the number of lines X is greater than a preset value, the region corresponding to the number of lines X as a whole is defined as a black region Y.
6-4: if the pixel value of each pixel point adjacent to the upper and lower black areas Y is not 0, the pixel values within the black areas Y are not processed, and the pixel values of the pixel points of the areas except the black areas Y in other single small block character images C are increased or decreased to obtain other small images M.
Step 7: and splicing the independent character graph J with other small graphs M to obtain a crown word size image Z after segmentation of the foreground and the background, as shown in fig. 9.
The beneficial effects of this embodiment are:
1. and 3, optimizing the crown word size image through a threshold k of Euclidean distance between pixel points, reducing the constant use of non-universality and reducing the workload of calculating the cut image.
2. And step 7, the optimal k and q values are obtained through repeated adjustment, so that the robustness of a cutting algorithm is improved, and a cleaner crown word size image can be obtained.
3. The method has strong universality, is applicable to target areas with fewer noise points, and can be used for expanding the example of directly calculating the neighborhood category without cutting single characters (for example, the step 2 can be omitted). Alternatively, the method is also suitable for recognizing the hand-sign characters, as shown in fig. 10.
4. The application determines the boundary of the crown word size area by calculating the distance between adjacent pixels of the target area and judging the difference value of the adjacent pixel values (step 3-step 7), thereby dividing the foreground and the background of the crown word size.
Examples
The present embodiment provides a segmentation apparatus for a foreground and a background of a crown word size region, where the segmentation apparatus includes:
and the threshold determining module is used for obtaining a crown word number area A of the initial bill image based on the standardized threshold q of the pixel points in the initial bill image, wherein the crown word number area A comprises all crown word number complete characters.
And the splitting module is used for splitting the crown word size area A according to the number of the noise points and a preset width threshold W to obtain a plurality of single small block character graphs C.
The sequence confirming module is used for selecting a plurality of target small images in the single small-block character image C, and determining a sequence F and a character area G according to the numerical relation between Euclidean distances among pixel points of the target small images and a preset Euclidean threshold k.
And the adjustment module is used for adjusting the pixel value of the pixel point in the character area G based on the standardized threshold value q to obtain a secondary adjustment chart I.
And the circulation module is used for adjusting the European threshold k and the standardized threshold q, and repeatedly executing the step 3 and the step 4 on the secondary denoising diagram I based on the adjusted European threshold k 'and the adjusted standardized threshold q' to obtain the independent character diagram J.
And the other character processing module is used for processing the other single small block character graphs C except the target small graph to obtain other small graphs M.
And the synthesis module is used for splicing the independent character graph J with other small graphs M to obtain a crown word size image Z after the segmentation of the foreground and the background.
The implementation principle and the generated technical effects of the segmentation device for the foreground and the background of the crown word size area provided by the embodiment of the application are the same as those of the segmentation method embodiment of the foreground and the background of the crown word size area, and for the sake of brief description, the corresponding contents in the foregoing method embodiment can be referred to where the device embodiment part is not mentioned.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.

Claims (9)

1. A method for segmenting a foreground and a background of a crown word size region, the method comprising:
step 1: obtaining a crown word number area A of the initial bill image based on a standardized threshold q of pixel points in the initial bill image, wherein the crown word number area A comprises all crown word number complete characters;
step 2: splitting the crown word size area A according to the number of noise points and a preset width threshold W to obtain a plurality of single small character patterns C;
step 3: selecting a plurality of target small images in a single small character image C, and determining a sequence F and a character area G according to the numerical relation between Euclidean distances among pixel points of each target small image and a preset Euclidean threshold k;
the step 3 comprises the following steps: determining a reference pixel value of a reference coordinate according to the central position coordinate and the central position pixel value of each target small image; respectively calculating Euclidean distances between pixel values of pixel points at other positions of each target small image and the reference pixel values of the target small image; determining a sequence F according to the position coordinates of the pixel points in the target small image, the Euclidean distance and the positions of the pixel points in the target small image, wherein the numerical value of a data set contained in the sequence F is equal to the number of the pixel points in the target small image; adjusting pixel values of pixel points with Euclidean distance smaller than a preset Euclidean threshold k in each sequence F, and obtaining a character region G and a character boundary T based on an adjustment result;
step 4: based on the standardized threshold q, adjusting the pixel value of the pixel point in the character area G to obtain a secondary adjustment chart I;
step 5: adjusting the European threshold k and the standardized threshold q, and repeatedly executing the step 3 and the step 4 on the secondary adjustment chart I based on the adjusted European threshold k 'and the adjusted standardized threshold q' until an independent character chart J meeting the definition requirement is obtained;
step 6: processing other single small block character graphs C except the target small graph to obtain other small graphs M;
step 7: and splicing the independent character graph J with other small graphs M to obtain a crown word size image Z after segmentation of the foreground and the background.
2. The method for segmenting the foreground and the background of a crown word size area according to claim 1, wherein the step 1 comprises:
1-1: calculating the average value of all pixel values of a target crown word number area of the initial bill image;
1-2: taking the average value as a standardized threshold value q, assigning a pixel value of a pixel point smaller than q in a target crown word number area as a first numerical value, and assigning a pixel value of a pixel point larger than or equal to q as a second numerical value, wherein the first numerical value is smaller than q, and the second numerical value is larger than q;
1-3: and determining the crown word number area A according to the assigned pixel value.
3. The method for segmenting the foreground and the background of the crown word size area according to claim 2, wherein the step 2 comprises:
2-1: according to a preset width threshold W, performing quasi-splitting on the crown word size area A to obtain a plurality of quasi-splitting areas;
2-2: calculating the number of black pixel points of each column in each to-be-split area, and taking the to-be-split area with the largest number of columns as a noise area B;
2-3: calculating the transverse width W1 of the nearest neighbor character below or above the noise area B;
2-4: and taking the maximum value in the preset width threshold W and the transverse width W1 as the cutting width, and evenly cutting the crown word size area A from left to right to obtain a plurality of single small block character graphs C.
4. The method of segmentation of a foreground and a background of a crown word size area according to claim 3, wherein step 3 further comprises: and taking the small image R where the noise area B is positioned and a single small character image C on the left side and the right side of the small image R as target small images.
5. The method for segmenting the foreground and the background of the crown word size region according to claim 4, wherein the step of adjusting the pixel values of the pixels with the euclidean distance smaller than the preset euclidean threshold k in each sequence F and obtaining the character region G and the character boundary T based on the adjustment result comprises the steps of:
3-5-1: the data sets in the sequence F are arranged in ascending order according to the value of the Euclidean distance to obtain a sequence F';
3-5-2: extracting pixel points corresponding to the first k data sets of the sequence F', and determining a character boundary T according to the position coordinates of the extracted pixel points;
3-5-3: assigning the pixel value of the pixel point corresponding to the data set after the kth of the sequence F' to be the first numerical value in the step 1-2;
3-5-4: and combining the pixel points corresponding to the k data sets in the sequence F' and the pixel points after assignment to obtain a character region G.
6. The method of segmentation of a foreground and a background of a crown word size area according to claim 5, wherein step 6 comprises:
6-1: transversely projecting other single small block character graphs C except the target small graph to obtain pixel values of each row of each single small block character graph C;
6-2: calculating the row X with the continuous pixel value of 0 of each other single small block character graph C;
6-3: if the number of lines X is larger than a preset value, defining a region corresponding to the number of lines X as a black region Y;
6-4: if the pixel value of each pixel point adjacent to the upper and lower black areas Y is not 0, the pixel values within the black areas Y are not processed, and the pixel values of the pixel points of the areas except the black areas Y in other single small block character images C are increased or decreased to obtain other small images M.
7. The method of segmentation of a crown size area foreground and background according to claim 6, wherein step 4 comprises:
and (3) carrying out assignment in the step (1-2) on the pixel values of the pixel points outside the character boundary T in the character region G, and carrying out no assignment processing on the pixel values of the pixel points in the region inside the character boundary T.
8. The method of segmentation of a crown size area foreground and background according to claim 7, wherein step 5 comprises:
for the step 3 which is repeatedly executed, 3 secondary adjustment images I are used as 3 target small images of the step 3 to carry out the same processing, so as to obtain 3 images E; and for the repeatedly executed step 4, the adjusted standardized threshold q 'is redetermined based on the pixel values of all the pixel points in the 3 secondary adjustment images I, and the pixel value assignment is carried out on the obtained 3 images E based on q', so that the repeated operation is continuously carried out until the independent character image J is obtained.
9. A segmentation apparatus for a foreground and a background of a crown word size region, the segmentation apparatus comprising:
the threshold determining module is used for obtaining a crown word number area A of the initial bill image based on a standardized threshold q of pixel points in the initial bill image, wherein the crown word number area A comprises all crown word number complete characters;
the splitting module is used for splitting the crown word size area A according to the number of noise points and a preset width threshold W to obtain a plurality of single small character diagrams C;
the sequence confirming module is used for selecting a plurality of target small images in the single small character image C, and determining a sequence F and a character area G according to the numerical relation between Euclidean distances among pixel points of the target small images and a preset Euclidean threshold k;
the sequence confirming module is also used for respectively determining a reference pixel value of the reference coordinate according to the central position coordinate and the central position pixel value of each target small image; respectively calculating Euclidean distances between pixel values of pixel points at other positions of each target small image and the reference pixel values of the target small image; determining a sequence F according to the position coordinates of the pixel points in the target small image, the Euclidean distance and the positions of the pixel points in the target small image, wherein the numerical value of a data set contained in the sequence F is equal to the number of the pixel points in the target small image; adjusting pixel values of pixel points with Euclidean distance smaller than a preset Euclidean threshold k in each sequence F, and obtaining a character region G and a character boundary T based on an adjustment result;
the adjustment module is used for adjusting the pixel value of the pixel point in the character area G based on the standardized threshold value q to obtain a secondary adjustment chart I;
the circulation module is used for adjusting the European threshold k and the standardized threshold q, and repeatedly executing the step 3 and the step 4 on the secondary adjustment chart I based on the adjusted European threshold k 'and the adjusted standardized threshold q' until an independent character chart J meeting the definition requirement is obtained;
the other character processing module is used for processing other single small block character graphs C except the target small graph to obtain other small graphs M;
and the synthesis module is used for splicing the independent character graph J with other small graphs M to obtain a crown word size image Z after the segmentation of the foreground and the background.
CN202310720261.XA 2023-06-19 2023-06-19 Segmentation method and device for foreground and background of crown word size region Active CN116452615B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310720261.XA CN116452615B (en) 2023-06-19 2023-06-19 Segmentation method and device for foreground and background of crown word size region

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310720261.XA CN116452615B (en) 2023-06-19 2023-06-19 Segmentation method and device for foreground and background of crown word size region

Publications (2)

Publication Number Publication Date
CN116452615A CN116452615A (en) 2023-07-18
CN116452615B true CN116452615B (en) 2023-10-03

Family

ID=87122353

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310720261.XA Active CN116452615B (en) 2023-06-19 2023-06-19 Segmentation method and device for foreground and background of crown word size region

Country Status (1)

Country Link
CN (1) CN116452615B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102136064A (en) * 2011-03-24 2011-07-27 成都四方信息技术有限公司 System for recognizing characters from image
CN104700092A (en) * 2015-03-26 2015-06-10 南京理工大学 Small-character number identification method based on template and feature matching
CN105654072A (en) * 2016-03-24 2016-06-08 哈尔滨工业大学 Automatic character extraction and recognition system and method for low-resolution medical bill image
CN107045634A (en) * 2017-05-02 2017-08-15 电子科技大学 A kind of text positioning method based on maximum stable extremal region and stroke width
CN109543676A (en) * 2018-11-08 2019-03-29 中国电力科学研究院有限公司 A kind of print-wheel type water meter Number character recognition method based on image procossing
CN115050015A (en) * 2022-08-15 2022-09-13 恒银金融科技股份有限公司 Method for accurately dividing character area of financial bill account

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102136064A (en) * 2011-03-24 2011-07-27 成都四方信息技术有限公司 System for recognizing characters from image
CN104700092A (en) * 2015-03-26 2015-06-10 南京理工大学 Small-character number identification method based on template and feature matching
CN105654072A (en) * 2016-03-24 2016-06-08 哈尔滨工业大学 Automatic character extraction and recognition system and method for low-resolution medical bill image
CN107045634A (en) * 2017-05-02 2017-08-15 电子科技大学 A kind of text positioning method based on maximum stable extremal region and stroke width
CN109543676A (en) * 2018-11-08 2019-03-29 中国电力科学研究院有限公司 A kind of print-wheel type water meter Number character recognition method based on image procossing
CN115050015A (en) * 2022-08-15 2022-09-13 恒银金融科技股份有限公司 Method for accurately dividing character area of financial bill account

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Scale and Orientation Invariant Text Segmentation for Born-Digital Compound Images;Huan Yang et al.;IEEE Transactions on Cybernetics;第45卷(第3期);全文 *
基于改进K-均值聚类的 纸币冠字号图像分割算法;金佳鑫等;辽宁科技大学学报;第37卷(第3期);全文 *

Also Published As

Publication number Publication date
CN116452615A (en) 2023-07-18

Similar Documents

Publication Publication Date Title
CN105261110B (en) A kind of efficiently DSP paper money number recognition methods
CN104751187A (en) Automatic meter-reading image recognition method
CN107437085A (en) A kind of method, apparatus and readable storage medium storing program for executing of lifting OCR discriminations
EP2569930A2 (en) Segmentation of a word bitmap into individual characters or glyphs during an ocr process
CN115331245B (en) Table structure identification method based on image instance segmentation
CN110473174B (en) Method for calculating accurate number of pencils based on image
CN109948621B (en) Image processing and character segmentation method based on picture verification code
US7715632B2 (en) Apparatus and method for recognizing an image
CN111461131A (en) Identification method, device, equipment and storage medium for ID card number information
CN111161288B (en) Image processing method and device
JP2018060389A (en) Program, information storing medium and character dividing device
CN106991753A (en) A kind of image binaryzation method and device
CN116452615B (en) Segmentation method and device for foreground and background of crown word size region
CN110674811B (en) Image recognition method and device
CN112329641A (en) Table identification method, device and equipment and readable storage medium
JPH0950527A (en) Frame extracting device and rectangle extracting device
CN106951902A (en) A kind of image binaryzation processing method and processing device
CN114882192B (en) Building facade segmentation method and device, electronic equipment and storage medium
CN108831004B (en) Method and device for determining paper currency crown word number area and automatic deposit and withdrawal equipment
CN106056575A (en) Image matching method based on object similarity recommended algorithm
JP2010191767A (en) Device and method for recognizing character
CN106023191B (en) A kind of optics delineation character edge extraction and edge fitting method based on structure feature
CN109086766B (en) Multi-threshold fusion crown word number extraction method based on integral graph
CN110348452B (en) Image binarization processing method and system
Xu et al. A solution to reconstruct cross-cut shredded text documents based on character recognition and genetic algorithm

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