Method, device, equipment and storage medium for acquiring bill feature area

By acquiring images under different light sources during the bill recognition process, analyzing and adjusting the coordinates of feature areas, the problem of inaccurate bill recognition is solved and higher accuracy is achieved.

CN112308056BActive Publication Date: 2024-12-03SHENZHEN YIHUA COMP +2
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN201910681591.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-26
Publication Date
2024-12-03
Estimated Expiration
2039-07-26

AI Technical Summary

Technical Problem

During the bill identification process, the image offset caused by hardware structure differences and other factors lead to inaccurate identification of bill flow numbers.

Method used

By acquiring the image of the ticket under different light sources, identifying the coordinates of the feature area, analyzing and obtaining the cutting adjustment parameters, and adjusting the cutting coordinates to obtain the complete feature area.

Benefits of technology

Improve the accuracy of identification of bill feature areas and ensure accurate acquisition of flow numbers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112308056B_ABST
    Figure CN112308056B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and storage medium for acquiring characteristic areas of bills. The method for acquiring characteristic areas of bills comprises: acquiring a first image of a bill under the illumination of a first light source; identifying the first coordinates of a first characteristic area in the first image; acquiring a second image of the bill under the illumination of a second light source; acquiring a second characteristic area in the second image based on the first coordinates; analyzing the second characteristic area to acquire cutting adjustment parameters; confirming the cutting coordinates of the second characteristic area based on the cutting adjustment parameters and the first coordinates; and acquiring a third characteristic area in the second image based on the cutting coordinates. The cutting adjustment parameters are acquired by analyzing the first coordinates and the second characteristic area, and the cutting coordinates are then obtained based on the cutting adjustment parameters. The third characteristic area is acquired based on the cutting coordinates, so as to achieve the effect of accurately acquiring the characteristic areas of bills.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of bill recognition, and in particular to a method, device, equipment and storage medium for acquiring a bill feature area. Background Art

[0002] As the flow of funds increases, bill businesses such as certificates of deposit, checks, and bills of exchange are becoming more and more common in our current life.

[0003] At present, the most important information on the entire ticket is the ticket number. The background comparison content and the corresponding ticket in the ticket box are all based on the serial ticket number of the deposit slip. When identifying the serial ticket number, the ticket is placed in the device, and the device scans the ticket to identify the serial ticket number and perform character segmentation to obtain the serial ticket number of the ticket. In actual device operation, due to various factors such as slight differences in hardware structure, differences in sensor factory delivery, and ticket jitter during ticket movement, there will be some deviation in the scanned sample image, which will lead to inaccurate identification of the serial number of the ticket. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, equipment and storage medium for acquiring a bill feature area, so as to improve the accuracy of acquiring the bill feature area.

[0005] In a first aspect, an embodiment of the present invention provides a method for acquiring a feature area of ​​a bill, comprising:

[0006] Acquire a first image of the bill under the illumination of a first light source;

[0007] identifying first coordinates of a first feature region in the first image;

[0008] Acquire a second image of the bill under the illumination of a second light source;

[0009] Acquire a second feature area in the second image based on the first coordinates;

[0010] Analyzing the second characteristic area to obtain cutting adjustment parameters;

[0011] Determining the cutting coordinates of the second feature area according to the cutting adjustment parameters and the first coordinates;

[0012] A third characteristic region in the second image is acquired based on the cutting coordinates.

[0013] Optionally, analyzing the second characteristic region to obtain a cutting adjustment parameter includes:

[0014] Adjusting the height direction of the first coordinate based on the second feature area to obtain a height cutting adjustment parameter;

[0015] The width direction of the first coordinate is adjusted based on the second characteristic region to obtain a width cutting adjustment parameter.

[0016] Optionally, the first coordinate includes a starting ordinate and an ending ordinate, and the adjusting the height direction of the first coordinate based on the second feature area to obtain a height cutting adjustment parameter includes:

[0017] Adjust the starting ordinate based on the first height adjustment threshold to obtain a starting adjusted ordinate;

[0018] adjusting the cutoff ordinate based on a second height adjustment threshold to obtain a cutoff adjusted ordinate;

[0019] Calculating the sum of grayscale values ​​of a preset number of consecutive rows between the start adjustment ordinate and the end adjustment ordinate according to a preset step length;

[0020] The coordinate corresponding to the minimum value of the gray value sum is used as the height cutting adjustment parameter.

[0021] Optionally, the step of calculating the sum of grayscale values ​​of a preset number of consecutive rows between the start adjustment ordinate and the end adjustment ordinate according to a preset step length includes:

[0022] Calculate the grayscale value of each row between the start adjustment ordinate and the end adjustment ordinate;

[0023] The grayscale values ​​of any consecutive preset number of rows are summed to obtain a plurality of grayscale value sums.

[0024] Optionally, the adjusting the width direction of the first coordinate based on the second feature area to obtain a width cutting adjustment parameter includes:

[0025] Moving the first coordinate in a first direction based on a width adjustment threshold, wherein at least two character segmentation frames are within the first coordinate;

[0026] Iteratively indenting each of the character segmentation boxes;

[0027] A width cutting adjustment parameter is obtained based on the indentation result of the iterative indentation.

[0028] Optionally, obtaining the width cutting adjustment parameter based on the indentation result of the iterative indentation includes:

[0029] Calculating the width difference between the maximum width and the minimum width of the character segmentation box after iterative indentation;

[0030] Determine whether the width difference is less than or equal to a difference threshold;

[0031] If the width difference is less than or equal to the difference threshold, selecting the abscissa at this time as the width cutting adjustment parameter;

[0032] If the width difference is greater than the preset difference, each character segmentation frame is iteratively indented again after translating the first coordinate in a second direction according to a translation threshold.

[0033] Optionally, the determining the cutting coordinates of the second feature area according to the cutting adjustment parameter and the first coordinates includes:

[0034] Selecting the height cutting adjustment parameter as the height cutting coordinate;

[0035] The width cutting coordinate is determined by calculating the difference between the width cutting adjustment parameter and the first coordinate in the width direction.

[0036] In a second aspect, an embodiment of the present invention provides a device for acquiring a feature area of ​​a bill, comprising:

[0037] An acquisition module, configured to acquire a first image of the bill under the illumination of a first light source, acquire a second image of the bill under the illumination of a second light source, acquire a second characteristic region in the second image based on the first coordinates, and acquire a third characteristic region in the second image based on the cutting coordinates;

[0038] A recognition module, used for recognizing first coordinates of a first feature area in a first image;

[0039] The analysis module is used to analyze the second characteristic area to obtain a cutting adjustment parameter, and to confirm a cutting coordinate of the second characteristic area according to the cutting adjustment parameter and the first coordinate.

[0040] In a third aspect, an embodiment of the present invention provides a device for acquiring a feature area of ​​a bill, comprising:

[0041] one or more processors;

[0042] A storage device for storing one or more programs;

[0043] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for acquiring the feature area of ​​a bill as described in any embodiment of the present invention.

[0044] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for acquiring the characteristic area of ​​a bill as described in any embodiment of the present invention.

[0045] The embodiment of the present invention obtains cutting adjustment parameters by analyzing the first coordinates and the second feature area, then obtains the cutting coordinates according to the cutting adjustment parameters, and obtains the third feature area based on the cutting coordinates, thereby solving the problem of inaccurate identification of the feature area of ​​the bill and achieving the effect of improving the accuracy of obtaining the feature area of ​​the bill. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is a flow chart of a method for acquiring a bill feature area provided in the first embodiment of the present invention;

[0047] Figure 2 is a schematic diagram of the first coordinate provided in the first embodiment of the present invention;

[0048] Figure 3 is a schematic diagram of a first image provided by Embodiment 1 of the present invention;

[0049] Figure 4 is a schematic diagram of a second image provided by Embodiment 1 of the present invention;

[0050] Figure 5 is a schematic diagram of a second image provided by Embodiment 1 of the present invention;

[0051] Figure 6 is a flow chart of a method for acquiring a bill feature area provided in Embodiment 2 of the present invention;

[0052] Figure 7 is a flow chart of a method for acquiring a bill feature area provided in Embodiment 2 of the present invention;

[0053] Figure 8 is a flow chart of a method for acquiring a bill feature area provided in Embodiment 2 of the present invention;

[0054] Fig. 9 is a schematic diagram after the first coordinate is moved in the first direction provided by the second embodiment of the present invention;

[0055] Fig.10 is an indented schematic diagram provided by Embodiment 2 of the present invention;

[0056] Fig.11 is a flow chart of a method for acquiring a bill feature area provided in Embodiment 2 of the present invention;

[0057] Fig.12 It is a structural schematic diagram of a device for acquiring a bill characteristic area provided in Embodiment 3 of the present invention;

[0058] Fig.13 It is a structural schematic diagram of a device for acquiring a feature area of ​​a bill provided in a fourth embodiment of the present invention. DETAILED DESCRIPTION

[0059] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0060] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0061] In addition, the terms "first", "second", etc. can be used in this article to describe various directions, actions, steps or elements, but these directions, actions, steps or elements are not limited by these terms. These terms are only used to distinguish a first direction, action, step or element from another direction, action, step or element. For example, without departing from the scope of the present application, the first speed difference can be referred to as the second speed difference, and similarly, the second speed difference can be referred to as the first speed difference. Both the first speed difference and the second speed difference are speed differences, but they are not the same speed difference. The terms "first", "second", etc. cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" and "batch" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0062] Embodiment 1

[0063] Figure 1 This is a flow chart of a method for acquiring a bill feature area provided in Embodiment 1 of the present invention. This embodiment is applicable to a scenario where a device is used to identify a serial number of a bill. The method can be performed by a device for acquiring a bill feature area, and specifically includes the following steps:

[0064] S110, acquiring a first image of the bill under illumination by a first light source.

[0065] Among them, the bills include but are not limited to deposit certificates, checks, and bills of exchange. The bills in this embodiment are all the same kind of bills, but the serial numbers of the characteristic areas are different. The first light source can be a visible light source (RGB light source), or an infrared light source (IR light source), or other light sources, which are not limited here. The RGB light source obtains visible light of various colors by changing the three color channels of red (Red), green (Green), and blue (Blue) and superimposing them on each other. The infrared light source is a non-illumination electric light source whose main purpose is to generate infrared radiation. The first image refers to the image of the bill under the illumination of the first light source. The images under illumination of different light sources are also different.

[0066] S120: Identify first coordinates of a first feature area in the first image.

[0067] The first feature area refers to the serial number area of ​​the bill in the first image. The first coordinate refers to the area coordinate of the serial number area, which is represented by the pixel value in the image, and one pixel point is one coordinate. Specifically, refer to Figure 2 , the first coordinate is the coordinate of the area enclosed by (X1, Y1), (X2, Y1), (X2, Y2), (X1, Y2). Figure 3 , Figure 3 is a schematic diagram of a first image, and region A is a first characteristic region in the first image.

[0068] S130: Acquire a second image of the bill under illumination by a second light source.

[0069] Among them, the second light source can be a visible light source (RGB light source), or an infrared light source (IR light source), or other light sources, which are not limited here. In this embodiment, the second light source and the first light source are of different types, and the second image refers to the image of the bill under the illumination of the second light source. Specifically, the first light source and the second light source can be the same or different. For example, the first light source is an RGB light source, and the second light source can be an RGB light source or an IR light source. The second image refers to the image of the bill under the illumination of the second light source. In an alternative embodiment, when the second light source and the first light source illuminate different surfaces of the bill, the second light source may also be the same as the first light source.

[0070] S140: Acquire a second feature area in the second image based on the first coordinates.

[0071] The second characteristic region refers to the region obtained in the second image by the first coordinates, that is, the second characteristic region is consistent with the region defined by the first coordinates. Figure 4 , Figure 4 is a schematic diagram of the second image, and region B is the second characteristic region obtained based on the first coordinates. It can be clearly seen that the second characteristic region does not completely cover the serial number in the second image.

[0072] S150: Analyze the second characteristic region to obtain cutting adjustment parameters.

[0073] Among them, the cutting adjustment parameter refers to the parameter used to adjust the first coordinate. In this embodiment, the cutting adjustment parameter is a coordinate value. Specifically, since the second feature area is obtained through the first coordinate, and the second image will have different degrees of offset relative to the first image, it will cause the second feature area to not completely cover the serial number of the second image, and the cutting recognition of the subsequent serial number is inaccurate. Therefore, the second feature area is analyzed to obtain the cutting adjustment parameter. In this embodiment, the cutting adjustment parameter is obtained by identifying the position of the blank pixels in the second feature area.

[0074] S160: Confirm the cutting coordinates of the second feature area according to the cutting adjustment parameters and the first coordinates.

[0075] The cutting coordinates refer to the coordinates for segmenting the serial number characters, which are determined by the cutting adjustment parameters and the first coordinates. In this embodiment, the cutting coordinates for obtaining the serial number of the complete second image can be recalculated by the cutting adjustment parameters and the first coordinates.

[0076] S170: Acquire a third feature area in the second image based on the cutting coordinates.

[0077] The third characteristic region refers to the complete serial number region obtained in the second image by cutting coordinates. Specifically, since the cutting coordinates have been determined by cutting adjustment parameters and the first coordinates before this step, the third characteristic region obtained by cutting coordinates can cover the serial number in the second image, thereby identifying the serial number. Figure 5 , Figure 5 is a schematic diagram of the second image, and region C is the third characteristic region obtained based on the cutting coordinates. It can be clearly seen that the third characteristic region is obtained for the second image by cutting the cutting coordinates obtained by the cutting adjustment parameters, so that the third characteristic region can completely cover the serial number in the second image.

[0078] The technical solution of the embodiment of the present invention obtains cutting adjustment parameters by analyzing the first coordinates and the second feature area, obtains cutting coordinates based on the cutting adjustment parameters, and obtains the third feature area based on the cutting coordinates, thereby solving the problem of inaccurate identification of the feature area of ​​the bill and achieving the effect of improving the accuracy of obtaining the feature area of ​​the bill.

[0079] Embodiment 2

[0080] Figure 6This is a flow chart of a method for acquiring a bill feature area provided in the second embodiment of the present invention. This embodiment is a further refinement of the above technical solution and is applicable to the scenario of using a device to identify the serial number of a bill. The method can be executed by a device for acquiring a bill feature area and specifically includes the following steps:

[0081] S210: Acquire a first image of the bill under illumination by a first light source.

[0082] Among them, the bills include but are not limited to deposit certificates, checks, and bills of exchange. The bills in this embodiment are all the same kind of bills, but the serial numbers of the characteristic areas are different. The first light source can be a visible light source (RGB light source), or an infrared light source (IR light source), or other light sources, which are not limited here. The RGB light source obtains visible light of various colors by changing the three color channels of red (Red), green (Green), and blue (Blue) and superimposing them on each other. The infrared light source is a non-illumination electric light source whose main purpose is to generate infrared radiation. The first image refers to the image of the bill under the illumination of the first light source. The images under illumination of different light sources are also different.

[0083] S220: Identify first coordinates of a first feature area in the first image.

[0084] The first feature area refers to the serial number area of ​​the bill in the first image. The first coordinate refers to the regional coordinate of the serial number area, which is represented by the pixel value in the image, and one pixel point is one coordinate. Specifically, the first coordinate is the regional coordinate surrounded by (X1, Y1), (X2, Y1), (X2, Y2), (X1, Y2).

[0085] S230: Acquire a second image of the bill under illumination by a second light source.

[0086] The second light source may be a visible light source (RGB light source), an infrared light source (IR light source), or other light sources, which are not limited here. The second image refers to the image of the bill under the illumination of the second light source. Specifically, the first light source and the second light source may be the same or different. For example, the first light source is an RGB light source, and the second light source may be an RGB light source or an IR light source. The second image refers to the image of the bill under the illumination of the second light source.

[0087] S240: Acquire a second feature area in the second image based on the first coordinates.

[0088] The second characteristic region refers to a region obtained in the second image by the first coordinates, that is, the second characteristic region is consistent with the region defined by the first coordinates.

[0089] S250: Adjust the height direction of the first coordinate based on the second characteristic region to obtain a height cutting adjustment parameter.

[0090] Among them, the height cutting adjustment parameter refers to the interval range obtained by adjusting the first coordinate in the height direction. Exemplarily, the height cutting adjustment parameter is the interval range between Y3 and Y4 in the coordinate. Specifically, since the second feature area is obtained through the first coordinate, the second feature area does not overlap with the serial number area in the second image, and there will be a certain upper and lower offset. By adjusting the height direction of the first coordinate, the second feature area and the serial number area in the second image are consistent in the height direction.

[0091] S260: Adjust the width direction of the first coordinate based on the second characteristic region to obtain a width cutting adjustment parameter.

[0092] Among them, the width cutting adjustment parameter refers to the interval range obtained by adjusting the first coordinate in the width direction. Exemplarily, the width cutting adjustment parameter is the interval range between X3 and X4 in the coordinate. Specifically, since the second feature area is obtained through the first coordinate, the second feature area does not overlap with the serial number area of ​​the second image, and there will be a certain left and right offset. By adjusting the width direction of the first coordinate, the second feature area and the actual serial number area are consistent in the width direction.

[0093] S270: Confirm the cutting coordinates of the second feature area according to the cutting adjustment parameters and the first coordinates.

[0094] Among them, the cutting coordinates refer to the coordinates for dividing the serial number characters. In this embodiment, the cutting adjustment parameters include a height cutting adjustment parameter and a width cutting adjustment parameter. The cutting coordinates are confirmed by the cutting adjustment parameters and the first coordinate. Specifically, the height cutting adjustment parameter is selected as the height cutting coordinate; the width cutting coordinate is determined by calculating the difference between the width cutting adjustment parameter and the first coordinate in the width direction. Exemplarily, the first coordinate is the coordinate of the area surrounded by (X1, Y1), (X2, Y1), (X2, Y2), (X1, Y2), the height cutting adjustment parameter is the interval range between Y3 and Y4 in the coordinate, and the width cutting adjustment parameter is the interval range between X3 and X4 in the coordinate. Y3 and Y4 can be used as the ordinates of the cutting coordinates, and the average value of the difference between X3 and X1, X4 and X2 is taken, and the first coordinate is translated in the width direction according to this average value, so as to obtain the abscissa of the cutting coordinate.

[0095] S280: Acquire a third feature area in the second image based on the cutting coordinates.

[0096] The third characteristic region refers to the serial number region obtained in the second image by cutting coordinates. Specifically, since the cutting coordinates have been determined by cutting adjustment parameters and the first coordinates before this step, the third characteristic region obtained by cutting coordinates can cover the serial number in the second image, thereby identifying the serial number.

[0097] In this embodiment, for the same type of bill, the first coordinate may be a fixed coordinate template, or may be the cutting coordinate of the third characteristic area obtained last time.

[0098] refer to Figure 7 Specifically, step S250 includes:

[0099] S251. Adjust the starting ordinate based on a first height adjustment threshold to obtain a starting adjusted ordinate.

[0100] Among them, the starting ordinate is the minimum ordinate of the first coordinate. Exemplarily, the first coordinate is (X1, Y1), (X2, Y1), (X2, Y2), (X1, Y2), then the starting ordinate is Y1. Taking the first height adjustment threshold as 5 and the starting ordinate as Y1 as an example, the starting adjustment ordinate is Y1-5. The first height adjustment threshold is greater than the degree of the up and down offset of the second image. If the maximum degree of the up and down offset of the second image is 4, the first height adjustment threshold is greater than 5.

[0101] S252: Adjust the cutoff ordinate based on the second height adjustment threshold to obtain a cutoff adjusted ordinate.

[0102] Wherein, the cut-off ordinate is the maximum ordinate of the first coordinate. Exemplarily, the first coordinate is (X1, Y1), (X2, Y1), (X2, Y2), (X1, Y2), then the cut-off ordinate is Y2. Taking the second height adjustment threshold as 5 and the cut-off ordinate as Y2 as an example, the cut-off adjustment ordinate is Y2+5. Optionally, the first height adjustment threshold and the second height adjustment threshold may be consistent or inconsistent.

[0103] S253: Calculate the sum of grayscale values ​​of a preset number of consecutive rows between the start adjustment vertical coordinate and the end adjustment vertical coordinate according to a preset step length.

[0104] In this embodiment, the preset step size is 1. The number of consecutive preset lines is determined according to the height of the character. For example, if the character height is 23, the number of consecutive preset lines is also 23. For example, if the character height is 23, the starting adjustment ordinate is 35, and the ending adjustment ordinate is 68, the calculation starts from the bottom and the sum of the gray values ​​of 35-58, 36-59...45-68 is calculated respectively.

[0105] Optionally, the grayscale value of each row can be calculated first, and then the grayscale values ​​of a preset number of consecutive rows can be summed. For example, the grayscale value of row 35 is a, and the grayscale value of row 36 is b. When the sum of the grayscale values ​​of 35-58 needs to be calculated, it is only necessary to add the grayscale value of each row of 35-58. If the sum of the grayscale values ​​of 36-59 needs to be calculated, it is only necessary to subtract the grayscale value of row 35 from the sum of the grayscale values ​​of 35-58, and then add the grayscale value of row 59.

[0106] S254: Use the coordinates corresponding to the minimum value of the total grayscale value as height cutting adjustment parameters.

[0107] In this embodiment, since the sum of grayscale values ​​of multiple consecutive preset rows is calculated, the sum of grayscale values ​​has multiple values, and the coordinate corresponding to the minimum value of the sum of grayscale values ​​is selected as the height cutting adjustment parameter. For example, the sum of grayscale values ​​between 40 and 63 is the smallest, and the ordinates of the height cutting adjustment parameter are 40 and 63.

[0108] refer to Figure 8 Specifically, step S260 includes:

[0109] S261. Move the first coordinate in a first direction based on a width adjustment threshold, wherein there are at least two character segmentation boxes within the first coordinate.

[0110] The width adjustment threshold is determined by the degree of left-right offset of the second image. If the maximum left-right offset of the second image is 4, the width adjustment threshold can be 5. The first direction can be left or right. The character segmentation frame is used to segment the characters in the feature area. If the feature area to be obtained is a serial ticket number, since the serial ticket number is 8 digits, the number of character segmentation frames is also 8. Reference Fig. 9 , Fig. 9 It is a schematic diagram after the first coordinate is moved in the first direction.

[0111] S262: Iteratively indent each of the character segmentation boxes.

[0112] Iterative indentation means moving the left boundary of the character segmentation box to the right and stopping when it hits the foreground point, and moving the right boundary to the left and stopping when it hits the foreground point. Fig.10 , Fig.10 This is a schematic diagram after iterative indentation.

[0113] S263: Obtain a width cutting adjustment parameter based on the indentation result of the iterative indentation.

[0114] The indentation result includes successful indentation and failed indentation. If the indentation is successful, the corresponding horizontal coordinate at this time is selected as the width cutting adjustment parameter.

[0115] refer to Fig.11Specifically, step S263 includes:

[0116] S2631, calculating the width difference between the maximum width and the minimum width of the character segmentation frame after iterative indentation.

[0117] Among them, the width of each character segmentation box will change after iterative indentation, and the width difference between the maximum width and the minimum width needs to be calculated.

[0118] S2632: Determine whether the width difference is less than or equal to a difference threshold.

[0119] The difference threshold is used to determine whether the indentation is successful. Preferably, the difference threshold is 3. If the width difference is less than or equal to the difference threshold, step S2633 is executed; if the width difference is greater than the difference threshold, step S2634 is executed.

[0120] S2633. Select the horizontal coordinate at this time as the width cutting adjustment parameter.

[0121] The horizontal coordinate includes a starting horizontal coordinate and an ending horizontal coordinate. The starting horizontal coordinate is the coordinate on the left side of the first character, and the ending horizontal coordinate is the coordinate on the right side of the last character.

[0122] S2634, after translating the first coordinate in a second direction according to a translation threshold, iteratively indent each of the character segmentation frames again.

[0123] The translation threshold can be any value, and preferably, the translation threshold is 1. The second direction is opposite to the first direction. If the first direction is left, the second direction is right. Taking the translation threshold of 1 and the second direction of right as an example, after translating the first coordinate to the right by 1, each character segmentation box is iteratively indented again. If the width difference is still greater than the difference threshold, continue to translate and iterate again until the width difference is less than or equal to the difference threshold.

[0124] The technical solution of the embodiment of the present invention obtains cutting adjustment parameters by analyzing the first coordinates and the second feature area, obtains cutting coordinates based on the cutting adjustment parameters, and obtains the third feature area based on the cutting coordinates, thereby solving the problem of inaccurate identification of the feature area of ​​the bill and achieving the effect of improving the accuracy of obtaining the feature area of ​​the bill.

[0125] Embodiment 3

[0126] Fig.12 This is a structural diagram of a device for acquiring a characteristic area of ​​a bill provided in Example 3 of the present invention. This embodiment is applicable to a scenario in which a device is used to identify the serial number of a bill. The device can be implemented in software and / or hardware and can be integrated on a device for acquiring a characteristic area of ​​a bill.

[0127] like Fig.12 As shown, the device for acquiring the characteristic region of a bill provided in this embodiment may include an acquisition module 410, a recognition module 420 and an analysis module 430, wherein:

[0128] An acquisition module 410 is used to acquire a first image of the bill under the illumination of a first light source, acquire a second image of the bill under the illumination of a second light source, acquire a second characteristic region in the second image based on the first coordinates, and acquire a third characteristic region in the second image based on the cutting coordinates;

[0129] An identification module 420, configured to identify first coordinates of a first feature region in a first image;

[0130] The analysis module 430 is used to analyze the second characteristic region to obtain a cutting adjustment parameter, and to determine the cutting coordinates of the second characteristic region according to the cutting adjustment parameter and the first coordinates.

[0131] Optionally, the analysis module 430 is specifically used for:

[0132] Adjusting the height direction of the first coordinate based on the second feature area to obtain a height cutting adjustment parameter;

[0133] The width direction of the first coordinate is adjusted based on the second characteristic region to obtain a width cutting adjustment parameter.

[0134] Optionally, the analysis module 430 includes:

[0135] The height unit is used to adjust the starting ordinate based on a first height adjustment threshold to obtain a starting adjusted ordinate; and to adjust the ending ordinate based on a second height adjustment threshold to obtain a ending adjusted ordinate.

[0136] A calculation unit, configured to calculate the sum of grayscale values ​​of a preset number of consecutive rows between the start adjustment ordinate and the end adjustment ordinate according to a preset step length;

[0137] The coordinate corresponding to the minimum value of the gray value sum is used as the height cutting adjustment parameter.

[0138] Optionally, the computing unit is specifically used for:

[0139] Calculate the grayscale value of each row between the start adjustment ordinate and the end adjustment ordinate;

[0140] The grayscale values ​​of any consecutive preset number of rows are summed to obtain a plurality of grayscale value sums.

[0141] Optionally, the analysis module 430 further includes:

[0142] A width unit is used to move the first coordinate in a first direction based on a width adjustment threshold, wherein there are at least two character segmentation frames in the first coordinate; iteratively indent each of the character segmentation frames; and obtain a width cutting adjustment parameter based on an indentation result of the iterative indentation.

[0143] Optionally, the calculation unit is further used to calculate the width difference between the maximum width and the minimum width of the character segmentation frame after iterative indentation;

[0144] Determine whether the width difference is less than or equal to a difference threshold;

[0145] If the width difference is less than or equal to the difference threshold, selecting the abscissa at this time as the width cutting adjustment parameter;

[0146] If the width difference is greater than the preset difference, each character segmentation frame is iteratively indented again after translating the first coordinate in a second direction according to a translation threshold.

[0147] Optionally, the analysis module 430 is specifically used to select the height cutting adjustment parameter as the height cutting coordinate;

[0148] The width cutting coordinate is determined by calculating the difference between the width cutting adjustment parameter and the first coordinate in the width direction.

[0149] The device for acquiring the characteristic area of ​​a bill provided in the embodiment of the present invention can execute the method for acquiring the characteristic area of ​​a bill provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. The contents not described in detail in this embodiment can refer to the description in any method embodiment of the present invention.

[0150] Embodiment 4

[0151] Fig.13 It is a structural schematic diagram of a device for acquiring a feature area of ​​a bill provided in a fourth embodiment of the present invention. Fig.13 A block diagram of an exemplary document feature area acquisition device 612 suitable for implementing the embodiments of the present invention is shown. Fig.13 The device 612 for acquiring the feature area of ​​the bill shown is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present invention.

[0152] like Fig.13 As shown, the device 612 for acquiring the feature area of ​​the bill is presented in the form of a general device for acquiring the feature area of ​​the bill. The components of the device 612 for acquiring the feature area of ​​the bill may include, but are not limited to: one or more processors 616, a storage device 628, and a bus 618 connecting different system components (including the storage device 628 and the processor 616).

[0153] Bus 618 represents one or more of several types of bus structures, including a storage device bus or storage device controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Subversive Alliance (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

[0154] The acquisition device 612 of the ticket feature area typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the acquisition device 612 of the ticket feature area, including volatile and non-volatile media, removable and non-removable media.

[0155] The storage device 628 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 630 and / or cache memory 632. The terminal 612 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 634 may be used to read and write non-removable, non-volatile magnetic media ( Fig.13 not shown, usually called a "hard drive"). Although Fig.13 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk, such as a compact disc read-only memory (CD-ROM), a digital video disc (DVD-ROM) or other optical media) can be provided. In these cases, each drive can be connected to the bus 618 through one or more data medium interfaces. The storage device 628 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the embodiments of the present invention.

[0156] A program / utility 640 having a set (at least one) of program modules 642 may be stored, for example, in storage device 628, such program modules 642 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 642 generally perform the functions and / or methods of the embodiments described herein.

[0157] The device 612 for acquiring the feature area of ​​the ticket may also communicate with one or more external devices 614 (e.g., a keyboard, a pointing terminal, a display 624, etc.), and may also communicate with one or more terminals that enable a user to interact with the device 612 for acquiring the feature area of ​​the ticket, and / or communicate with any terminal (e.g., a network card, a modem, etc.) that enables the device 612 for acquiring the feature area of ​​the ticket to communicate with one or more other computing terminals. Such communication may be performed through an input / output (I / O) interface 622. Furthermore, the device 612 for acquiring the feature area of ​​the ticket may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 620. Fig.13 As shown, the network adapter 620 communicates with other modules of the acquisition device 612 of the ticket feature area through the bus 618. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the acquisition device 612 of the ticket feature area, including but not limited to: microcode, terminal driver, redundant processor, external disk drive array, disk array (Redundant Arrays of Independent Disks, RAID) system, tape drive and data backup storage system, etc.

[0158] The processor 616 executes various functional applications and data processing by running the program stored in the storage device 628, for example, implementing a method for acquiring a feature area of ​​a bill provided in any embodiment of the present invention, which may include:

[0159] Acquire a first image of the bill under the illumination of a first light source;

[0160] identifying first coordinates of a first feature region in the first image;

[0161] Acquire a second image of the bill under the illumination of a second light source;

[0162] Acquire a second feature area in the second image based on the first coordinates;

[0163] Analyzing the second characteristic area to obtain cutting adjustment parameters;

[0164] Determining the cutting coordinates of the second feature area according to the cutting adjustment parameters and the first coordinates;

[0165] A third characteristic region in the second image is acquired based on the cutting coordinates.

[0166] The technical solution of the embodiment of the present invention obtains cutting adjustment parameters by analyzing the first coordinates and the second feature area, obtains cutting coordinates based on the cutting adjustment parameters, and obtains the third feature area based on the cutting coordinates, thereby solving the problem of inaccurate identification of the feature area of ​​the bill and achieving the effect of improving the accuracy of obtaining the feature area of ​​the bill.

[0167] Embodiment 5

[0168] Embodiment 5 of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, a method for acquiring a feature area of ​​a bill as provided in any embodiment of the present invention is implemented. The method may include:

[0169] Acquire a first image of the bill under the illumination of a first light source;

[0170] identifying first coordinates of a first feature region in the first image;

[0171] Acquire a second image of the bill under the illumination of a second light source;

[0172] Acquire a second feature area in the second image based on the first coordinates;

[0173] Analyzing the second characteristic area to obtain cutting adjustment parameters;

[0174] Determining the cutting coordinates of the second feature area according to the cutting adjustment parameters and the first coordinates;

[0175] A third characteristic region in the second image is acquired based on the cutting coordinates.

[0176] The computer-readable storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0177] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0178] The program code contained on the storage 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.

[0179] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or terminal. 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0180] The technical solution of the embodiment of the present invention obtains cutting adjustment parameters by analyzing the first coordinates and the second feature area, obtains cutting coordinates based on the cutting adjustment parameters, and obtains the third feature area based on the cutting coordinates, thereby solving the problem of inaccurate identification of the feature area of ​​the bill and achieving the effect of improving the accuracy of obtaining the feature area of ​​the bill.

[0181] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for acquiring a bill feature area, characterized in that: include: Acquire a first image of the bill under the illumination of a first light source; identifying first coordinates of a first feature region in the first image; Acquire a second image of the bill under the illumination of a second light source; Acquire a second feature area in the second image based on the first coordinates; Analyzing the second characteristic area to obtain cutting adjustment parameters; Determining the cutting coordinates of the second feature area according to the cutting adjustment parameters and the first coordinates; Acquire a third characteristic region in the second image based on the cutting coordinates; The step of analyzing the second characteristic region to obtain the cutting adjustment parameter includes: Adjusting the height direction of the first coordinate based on the second feature area to obtain a height cutting adjustment parameter; The first coordinate includes a starting ordinate and an ending ordinate, the starting ordinate is the minimum ordinate of the first coordinate, the ending ordinate is the maximum ordinate of the first coordinate, and the height cutting adjustment parameter is obtained by adjusting the height direction of the first coordinate based on the second feature area, including: Adjusting the starting ordinate based on a first height adjustment threshold to obtain a starting adjusted ordinate; adjusting the cutoff ordinate based on a second height adjustment threshold to obtain a cutoff adjusted ordinate; Calculating the sum of grayscale values ​​of a preset number of consecutive rows between the start adjustment ordinate and the end adjustment ordinate according to a preset step length; The coordinate corresponding to the minimum value of the gray value sum is used as the height cutting adjustment parameter.

2. The method for obtaining the characteristic area of ​​a bill according to claim 1, characterized in that: The analyzing the second characteristic region to obtain the cutting adjustment parameter also includes: The width direction of the first coordinate is adjusted based on the second characteristic region to obtain a width cutting adjustment parameter.

3. The method for acquiring the characteristic area of ​​a bill according to claim 1, characterized in that: The step of calculating the sum of grayscale values ​​of a preset number of consecutive rows between the start adjustment ordinate and the end adjustment ordinate according to a preset step length includes: Calculate the grayscale value of each row between the start adjustment ordinate and the end adjustment ordinate; The grayscale values ​​of any consecutive preset number of rows are summed to obtain a plurality of grayscale value sums.

4. The method for obtaining the characteristic area of ​​a bill according to claim 2, characterized in that: The step of adjusting the width direction of the first coordinate based on the second feature area to obtain a width cutting adjustment parameter includes: Moving the first coordinate in a first direction based on a width adjustment threshold, wherein at least two character segmentation frames are within the first coordinate; Iteratively indenting each of the character segmentation boxes; A width cutting adjustment parameter is obtained based on the indentation result of the iterative indentation.

5. The method for acquiring the characteristic area of ​​a bill according to claim 4, characterized in that: The step of obtaining the width cutting adjustment parameter based on the indentation result of the iterative indentation includes: Calculating the width difference between the maximum width and the minimum width of the character segmentation frame after iterative indentation; Determine whether the width difference is less than or equal to a difference threshold; If the width difference is less than or equal to the difference threshold, selecting the abscissa at this time as the width cutting adjustment parameter; If the width difference is greater than the preset difference, each character segmentation frame is iteratively indented again after translating the first coordinate in a second direction according to a translation threshold.

6. The method for acquiring the characteristic area of ​​a bill according to claim 2, characterized in that: The step of confirming the cutting coordinates of the second feature area according to the cutting adjustment parameter and the first coordinates includes: Selecting the height cutting adjustment parameter as the height cutting coordinate; The width cutting coordinate is determined by calculating the difference between the width cutting adjustment parameter and the first coordinate in the width direction.

7. A device for acquiring a characteristic area of ​​a bill, characterized in that: The device is used to execute the method for acquiring the characteristic area of ​​a bill as claimed in claim 1, comprising: An acquisition module, used to acquire a first image of the bill under the illumination of a first light source, and acquire a second image of the bill under the illumination of a second light source; A recognition module, used for recognizing first coordinates of a first feature area in a first image; an analysis module, configured to analyze the second characteristic region to obtain a cutting adjustment parameter, and to determine a cutting coordinate of the second characteristic region according to the cutting adjustment parameter and the first coordinate; The acquisition module is further used to acquire a second characteristic region in the second image based on the first coordinates, and acquire a third characteristic region in the second image based on the cutting coordinates; Wherein, the analysis module is specifically used for: Adjusting the height direction of the first coordinate based on the second feature area to obtain a height cutting adjustment parameter; The first coordinate includes a starting ordinate and an ending ordinate, the starting ordinate is the minimum ordinate of the first coordinate, and the ending ordinate is the maximum ordinate of the first coordinate. The analysis module includes: A height unit, configured to adjust the starting ordinate based on a first height adjustment threshold to obtain a starting adjusted ordinate; adjusting the cutoff ordinate based on a second height adjustment threshold to obtain a cutoff adjusted ordinate; A calculation unit, configured to calculate the sum of grayscale values ​​of a preset number of consecutive rows between the start adjustment ordinate and the end adjustment ordinate according to a preset step length; The coordinate corresponding to the minimum value of the gray value sum is used as the height cutting adjustment parameter.

8. A device for acquiring a characteristic area of ​​a bill, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for acquiring the feature area of ​​a bill as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for obtaining the feature area of ​​a bill as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Digital image processing system applied to bill image character recognition and method

    CN104112128A

  • Optical character recognition apparatus and optical character recognition method

    CN105320951A

  • Method and device for realizing interactive image segmentation, and terminal

    CN106898003A

  • Bank note identification method and device

    CN107331026A

  • Picture segmentation method and device, storage medium and computer equipment

    CN108305261A