A method and apparatus for region identification

By acquiring and correcting the size and coordinate information of local image regions, the coordinates of the complete image region are predicted, and sub-regions are divided and identified. This solves the problem of text information corresponding to location and improves extraction efficiency and accuracy.

CN115240200BActive Publication Date: 2026-06-09CHINA CONSTRUCTION BANK +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2022-08-10
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies cannot effectively match the extracted text information with the text positions in paper documents, resulting in low extraction efficiency.

Method used

By acquiring the size and coordinate information of a local image region, the size and coordinate information of the complete image region are corrected and predicted, divided into multiple sub-regions, and the text information in the sub-regions is identified to achieve the correspondence between text information and location.

Benefits of technology

It improves the efficiency of extracting text information from specific locations in images and enhances the accuracy of the correspondence between text information and location.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115240200B_ABST
    Figure CN115240200B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of regional identification method and device, apply in computer vision technical field.The method comprises: obtaining the first size information and the first coordinate information of local image area, obtaining the second size information of complete image area, according to the first size information of local image area and the second size information of complete image area, the first size information and the first coordinate information of local image area are corrected, third size information and third coordinate information are obtained, according to second size information and third size information, length proportion parameter and width proportion parameter are determined, according to length proportion parameter, width proportion parameter and third coordinate information, the second coordinate information of complete image area is determined, according to the second coordinate information and the second size information of complete image area, complete image area is divided into N sub-regions, and the text information in N sub-regions is identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to a method and apparatus for region recognition. Background Technology

[0002] With the continuous development of technology, computer vision technology is being applied in more and more fields. In particular, paper documents such as invoices and receipts, which require subsequent verification, are prone to loss and are difficult to preserve. Therefore, computer vision technology can be used to extract the effective text information from these paper documents and convert it into data for input into a computer system, facilitating subsequent operations.

[0003] Currently, the effective text information in a paper document is generally extracted using Optical Character Recognition (OCR) technology. However, the efficiency of extracting text information from the corresponding positions in the paper document is low because it is impossible to match the extracted text information with the text positions in the paper document.

[0004] In summary, how to match the extracted text information with the text positions in the paper document is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This invention provides a method and apparatus for region identification, which solves the problem in the prior art that it is impossible to match the extracted text information with the text position of paper documents.

[0006] In a first aspect, embodiments of the present invention provide a method for region recognition, the method comprising: acquiring first size information and first coordinate information of a local image region; acquiring second size information of a complete image region; correcting the first size information and first coordinate information of the local image region based on the first size information of the local image region and the second size information of the complete image region to obtain third size information and third coordinate information; determining a length ratio parameter and a width ratio parameter based on the second size information and the third size information; determining the second coordinate information of the complete image region based on the length ratio parameter, the width ratio parameter and the third coordinate information; dividing the complete image region into N sub-regions based on the second coordinate information and the second size information of the complete image region, and recognizing text information in the N sub-regions.

[0007] In this embodiment of the invention, by using the first size information and first coordinate information of the local image region and the second size information of the complete image region, the second coordinate information corresponding to the complete image region can be predicted. Using the second coordinate information and the second size information, the complete image region can be divided into multiple sub-regions, and the text information in the sub-regions can be identified, thereby realizing the correspondence between the text information of the sub-regions and the coordinate information of the sub-regions, which improves the efficiency of extracting text information at specific locations in the image.

[0008] Optionally, the second size information includes a second length and a second width, and the first size information includes a first length and a first width; the step of correcting the first size information and the first coordinate information of the local image region based on the first size information of the local image region and the second size information of the complete image region to obtain third size information and third coordinate information includes: deleting regions in the complete image region that are not included in the local image region; using the coordinates of the first boundary of the complete image region as the coordinates of the first boundary of the local image region after deleting the partial region to obtain the third coordinate information and the third size information.

[0009] In this embodiment of the invention, by correcting the local image region, the third size information and third coordinate information of the local image region can be obtained more accurately, thereby facilitating the subsequent more accurate prediction of the second coordinate information and second size information of the complete image region.

[0010] Optionally, the third dimension information includes a third length and a third width; determining the length ratio parameter and the width ratio parameter based on the second dimension information and the third dimension information includes: dividing the third length by the second length to determine the length ratio parameter; and dividing the third width by the second width to determine the width ratio parameter.

[0011] In this embodiment of the invention, based on the length ratio parameter and the width ratio parameter, it is easier to predict the second coordinate information and the second size information of the complete image area more accurately in the subsequent process.

[0012] Optionally, the third coordinate information includes first abscissa information and first ordinate information, and the second coordinate information includes second abscissa information and second ordinate information; determining the second coordinate information of the complete image area based on the length ratio parameter, the width ratio parameter, and the third coordinate information includes: multiplying the first abscissa information by the length ratio parameter to determine the second abscissa information; multiplying the first ordinate information by the width ratio parameter to determine the second ordinate information.

[0013] In this embodiment of the invention, the second coordinate information of the complete image region can be determined more accurately by using the third coordinate information of the local image region and the length and width ratio parameters.

[0014] Optionally, dividing the complete image region into N sub-regions based on the second coordinate information and the second size information of the complete image region includes: inputting the second coordinate information and the second size information of the complete image region into a text segmentation model to obtain N sub-regions and the coordinate information of the sub-regions, where N is a positive integer not less than 1.

[0015] In this embodiment of the invention, by dividing the complete image area into N sub-regions and determining the coordinate information of the sub-regions, the sub-regions can be mapped to the coordinate information.

[0016] Optionally, identifying the text information in the N sub-regions includes: inputting the N sub-regions and their coordinate information into a text recognition model to obtain the text information in the sub-regions.

[0017] In this embodiment of the invention, by inputting the sub-region and its coordinate information into the text recognition model, the text information of the sub-region can be obtained, thereby realizing the correspondence between the text information of the sub-region and its coordinate information.

[0018] Optionally, if the difference between the ordinates of two adjacent sub-regions is less than a first threshold, the two adjacent sub-regions are merged into one sub-region.

[0019] In this embodiment of the invention, in order to avoid dividing the same text information into two sub-regions and affecting the correspondence between text information and text position, it is necessary to merge the first sub-region and the second sub-region, thereby improving the accuracy of text information and text position.

[0020] Secondly, embodiments of the present invention provide a region identification device, comprising:

[0021] An acquisition unit is configured to acquire first size information and first coordinate information of a local image region; acquire second size information of a complete image region; a processing unit is configured to, based on the first size information of the local image region and the second size information of the complete image region, correct the first size information and the first coordinate information of the local image region to obtain third size information and third coordinate information; determine a length ratio parameter and a width ratio parameter based on the second size information and the third size information; determine the second coordinate information of the complete image region based on the length ratio parameter, the width ratio parameter and the third coordinate information; divide the complete image region into N sub-regions based on the second coordinate information and the second size information of the complete image region, and identify text information in the N sub-regions.

[0022] Optionally, the second size information includes a second length and a second width, and the first size information includes a first length and a first width; the processing unit is specifically used to: delete the region in the complete image region that is not included in the local image region; use the coordinates of the first boundary of the complete image region as the coordinates of the first boundary of the local image region after deleting the partial region, to obtain the third coordinate information and the third size information.

[0023] Optionally, the processing unit is specifically used to: divide the third length by the second length to determine the length ratio parameter; and divide the third width by the second width to determine the width ratio parameter.

[0024] Optionally, the processing unit is specifically used to: multiply the first horizontal coordinate information by the length ratio parameter to determine the second horizontal coordinate information; and multiply the first vertical coordinate information by the width ratio parameter to determine the second vertical coordinate information.

[0025] Optionally, the processing unit is specifically used to: input the second coordinate information and the second size information of the complete image region into the text segmentation model to obtain N sub-regions and the coordinate information of the sub-regions, where N is a positive integer not less than 1.

[0026] Optionally, the processing unit is specifically used to: input the N sub-regions and the coordinate information of the sub-regions into the text recognition model to obtain the text information in the sub-regions.

[0027] Optionally, the processing unit is specifically used to: if the difference between the ordinates of two adjacent sub-regions is less than a first threshold, merge the two adjacent sub-regions into one sub-region.

[0028] Thirdly, embodiments of the present invention provide an electronic device, including at least one processor and at least one memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform any of the region identification methods described in the first aspect.

[0029] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a program that, when run on a computer, causes the computer to perform any of the region identification methods described in the first aspect.

[0030] Fifthly, embodiments of the present invention also provide a computer program product, wherein the storage medium stores a program that, when the program is run on a computer, causes the computer to perform any of the region identification methods described in the first aspect above. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a schematic diagram illustrating a conventional method for extracting text information, provided as an embodiment of the present invention.

[0033] Figure 2 A flowchart of a region identification method provided in an embodiment of the present invention;

[0034] Figure 3 A schematic diagram of a local image region provided in an embodiment of the present invention;

[0035] Figure 4 This is a schematic diagram illustrating the correction of a local image region provided in an embodiment of the present invention;

[0036] Figure 5 A flowchart illustrating a method for correcting first dimension information and first coordinate information provided in an embodiment of the present invention;

[0037] Figure 6a This is a schematic diagram illustrating the correction of a local image region provided in an embodiment of the present invention;

[0038] Figure 6b This is a schematic diagram of another method for correcting local image regions provided in an embodiment of the present invention;

[0039] Figure 6c This is a schematic diagram illustrating another method for correcting local image regions provided in an embodiment of the present invention;

[0040] Figure 6d This is a schematic diagram illustrating another method for correcting local image regions provided in an embodiment of the present invention;

[0041] Figure 7 This is a schematic diagram of N sub-regions provided in an embodiment of the present invention;

[0042] Figure 8 This is a schematic diagram of a merged sub-region provided in an embodiment of the present invention;

[0043] Figure 9 A schematic diagram of the structure of a region identification device provided in an embodiment of the present invention;

[0044] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0046] The following explanations of certain parts of this application are intended to provide general clarification for those skilled in the art, and do not limit the terminology used in this application.

[0047] OCR (Optical Character Recognition) technology: Electronic devices convert text in paper documents into black and white dot matrix images by setting dark and light modes, and then use character recognition methods to convert the black and white dot matrix images into computer text.

[0048] like Figure 1 The diagram illustrates a conventional method for extracting text information according to an embodiment of the present invention. Generally, if the paper document to be archived is a document image 101, when OCR technology is used to process the document image 101, the output is the text information 102 of the entire document image 101, where the text information 102 is unordered. Therefore, it is impossible to correlate the text information 102 with the corresponding text positions in the document image 101.

[0049] In one possible scenario, if only the name information in document image 101 needs to be extracted and input into the computer system, it would be necessary to first process document image 101 using OCR technology to output text information 102, and then manually match the text information with document image 101 to determine the name information in document image 101. This would result in a waste of manpower and resources, and the efficiency of extracting the text information 102 from the corresponding position in document image 101 would be low.

[0050] Therefore, this invention provides a method for region recognition, which can solve the problem of not being able to match the extracted text information with the text position.

[0051] like Figure 2 The diagram shown is a flowchart of a region identification method provided by an embodiment of the present invention. The method includes the following steps:

[0052] Step 201: Obtain the first size information and first coordinate information of the local image region.

[0053] In this embodiment of the invention, for example, if the paper document to be archived is a document image, in order to match the text position of the document image with the text information, it is necessary to first determine the position information of the document image. Specifically, there are two possibilities when displaying the document image on the screen. The first possibility is that the document image can be displayed completely on the screen. The second possibility is that due to the small screen size, only a partial image area of ​​the document image can be displayed on the screen, and the complete affected area cannot be displayed. See [link to relevant documentation]. Figure 3 If the second possibility applies, it is necessary to first obtain the first size information and first coordinate information of the local image region. This will facilitate the subsequent prediction of the coordinate information of the undisplayed image region based on the first size information and first coordinate information. The first size information refers to the length and width of the local image region, and the first coordinate information refers to the coordinate information of any point on the local image region. The first coordinate information can be the coordinates of the four corner vertices of the local image region, the coordinates of the center point and the four corners of the local image region, or the coordinates of other points; no limitation is made here.

[0054] Step 202: Obtain the second size information of the complete image area.

[0055] In this embodiment of the invention, for example, if the complete image area is a document image, then it is necessary to obtain the second size information of the document image from the document image library, wherein the second size information is the length and width of the document image.

[0056] Step 203: Based on the first size information of the local image region and the second size information of the complete image region, correct the first size information and the first coordinate information of the local image region to obtain the third size information and the third coordinate information.

[0057] In embodiments of the present invention, such as Figure 4 The diagram shown is a schematic representation of a method for correcting a local image region according to an embodiment of the present invention. Since the positional information of the local image region can be identified on the display screen, it is not accurate and is easily interfered with by text information on the display screen. Therefore, because the local image region is inaccurate, the corresponding first size information and first coordinate information are also inaccurate, affecting the accuracy of the coordinate information of the subsequent prediction of the complete image region. Therefore, it is necessary to correct the local image region, and the corrected local image region corresponds to third size information and third coordinate information.

[0058] Step 204: Determine the length ratio parameter and width ratio parameter based on the second dimension information and the third dimension information.

[0059] In this embodiment of the invention, the second size information of the complete image region is divided into a second length and a second width, and the third size information of the corrected local image region is divided into a third length and a third width. The third length is divided by the second length to obtain a length ratio parameter, and the third width is divided by the second width to obtain a width ratio parameter.

[0060] Step 205: Determine the second coordinate information of the complete image area based on the length ratio parameter, the width ratio parameter, and the third coordinate information.

[0061] In this embodiment of the invention, the third coordinate information includes first abscissa information and first ordinate information, and the second coordinate information includes second abscissa information and second ordinate information. Multiplying the first abscissa information in the corrected third coordinate information of the local image region by a length ratio parameter yields the second abscissa information of the complete image region's second coordinate information. Multiplying the first ordinate information in the corrected third coordinate information of the local image region by a width ratio parameter yields the second ordinate information of the complete image region's second coordinate information.

[0062] Step 206: Based on the second coordinate information and second size information of the complete image area, divide the complete image area into N sub-regions and identify the text information in the N sub-regions.

[0063] In this embodiment of the invention, to facilitate the mapping of text information in a complete image region to text positions, the complete image region needs to be divided into N sub-regions based on the second coordinate information and the second size information of the complete image region. In this way, by identifying the text information in the N sub-regions, the text information in the complete image region can be mapped to text positions, thereby improving the efficiency of extracting text information from specific locations in the image.

[0064] Steps 201 to 206 show that since the complete image area cannot be fully displayed on the screen, the second coordinate information corresponding to the part of the image area not displayed on the screen can be predicted based on the first size information and first coordinate information of the local image area and the second size information of the complete image area. Through the second coordinate information and the second size information, the complete image area can be divided into multiple sub-regions, and the text information in the sub-regions can be identified, thereby realizing the correspondence between the text information of the sub-regions and the coordinate information of the sub-regions, which improves the efficiency of extracting text information at specific locations in the image.

[0065] In this embodiment of the invention, the first size information and first coordinate information of the local image region obtained in step 201 have errors. In order not to affect the subsequent accurate prediction of the second size information and second coordinate information of the complete image region based on the size information and coordinate information of the local image region, the following describes how to correct the first size information and first coordinate information.

[0066] like Figure 5 The diagram shown is a flowchart of a method for correcting first dimension information and first coordinate information according to an embodiment of the present invention. The method includes the following steps:

[0067] Step 501: Delete the regions in the complete image region that are not included in the local image region.

[0068] In embodiments of the present invention, such as Figure 6a The diagram shown is a schematic representation of a method for correcting a local image region according to an embodiment of the present invention. For example, when the right boundary of a local image region exceeds the right boundary of the complete image region, it indicates that the area in the complete image region not included in the local image region is interfering text or image information. In order to obtain the size and coordinate information of the local image region more accurately, it is necessary to delete the area in the complete image region not included in the local image region to obtain the corrected local image region.

[0069] like Figure 6bThe diagram illustrates another method for correcting a local image region according to an embodiment of the present invention. For example, when the left boundary of a local image region exceeds the left boundary of the complete image region, it indicates that the area in the complete image region not included in the local image region is interfering text or image information. In order to obtain the size and coordinate information of the local image region more accurately, it is necessary to delete the area in the complete image region not included in the local image region to obtain the corrected local image region.

[0070] like Figure 6c The diagram illustrates another method for correcting a local image region according to an embodiment of the present invention. For example, when the upper boundary of a local image region exceeds the upper boundary of the complete image region, it indicates that the area in the complete image region not included in the local image region is interfering text or image information. In order to obtain the size and coordinate information of the local image region more accurately, it is necessary to delete the area in the complete image region not included in the local image region to obtain the corrected local image region.

[0071] like Figure 6d The diagram illustrates another method for correcting a local image region according to an embodiment of the present invention. For example, when the lower boundary of a local image region exceeds the lower boundary of the complete image region, it indicates that the area in the complete image region not included in the local image region is interfering text or image information. In order to obtain the size and coordinate information of the local image region more accurately, it is necessary to delete the area in the complete image region not included in the local image region to obtain the corrected local image region.

[0072] Step 502: Use the coordinates of the first boundary of the complete image region as the coordinates of the first boundary of the local image region after deleting the partial region to obtain the third coordinate information and the third size information.

[0073] In this embodiment of the invention, for example, if the right boundary of a local image region exceeds the right boundary of the complete image region, the coordinates of the first boundary of the complete image region are used as the coordinates of the first boundary of the local image region after deleting the portion of the region. This allows for the acquisition of the corrected local image region, its third coordinate information, and its third size information. (See also...) Figure 6a The first boundary of the complete image region is the right boundary of the complete image region. The local image region after deleting part of the region is the corrected local image region, and the first boundary of the corrected local image region is the right boundary of the corrected local image region.

[0074] For example, if the left boundary of a local image region exceeds the left boundary of the complete image region, the coordinates of the first boundary of the complete image region can be used as the coordinates of the first boundary of the local image region after partial deletion. This allows us to obtain the corrected local image region, as well as its third coordinate and third size information. (See [reference needed]). Figure 6b The first boundary of the complete image region is the left boundary of the complete image region. The local image region after deleting part of the region is the corrected local image region, and the first boundary of the corrected local image region is the left boundary of the corrected local image region.

[0075] For example, if the upper boundary of a local image region exceeds the upper boundary of the complete image region, the coordinates of the first boundary of the complete image region can be used as the coordinates of the first boundary of the local image region after deleting the portion. This allows us to obtain the corrected local image region, as well as its third coordinate and third size information. (See [reference needed]). Figure 6c The first boundary of the complete image region is the upper boundary of the complete image region. The local image region after deleting part of the region is the corrected local image region, and the first boundary of the corrected local image region is the upper boundary of the corrected local image region.

[0076] For example, if the lower boundary of a local image region exceeds the lower boundary of the complete image region, the coordinates of the first boundary of the complete image region can be used as the coordinates of the first boundary of the local image region after deleting the portion. This allows us to obtain the corrected local image region, as well as its third coordinate and third size information. (See [reference needed]). Figure 6d The first boundary of the complete image region is the lower boundary of the complete image region. The local image region after deleting part of the region is the corrected local image region, and the first boundary of the corrected local image region is the lower boundary of the corrected local image region.

[0077] Steps 501 to 502 show that by correcting the local image region, the third size information and third coordinate information of the local image region can be obtained more accurately, which facilitates the subsequent accurate prediction of the second coordinate information and second size information of the complete image region based on the third size information and third coordinate information.

[0078] The second size information and second coordinate information are derived from the third size information and third coordinate information by using length and width scaling parameters to predict the second coordinate information and second size information of the complete image region. The third size information includes a third length and a third width, while the second size information includes a second length and a second width. The following describes how to determine the length and width scaling parameters.

[0079] In this embodiment of the invention, the length ratio parameter is determined by dividing the third length by the second length. For example, if the third length of a local image region is 5cm and the second length of the complete image region is 10cm, then the length ratio parameter is 1 / 2.

[0080] In this embodiment of the invention, the width ratio parameter is determined by dividing the third width by the second width. For example, if the third width of the layout image area is 6cm and the second width of the complete image area is 12cm, then the width ratio parameter is 1 / 2.

[0081] Referring to step 205, the second coordinate information of the complete image region can be determined, wherein the second coordinate information of the complete image region is the coordinate information of any point in the complete image region.

[0082] like Figure 7 The diagram shown illustrates an embodiment of the present invention with N sub-regions. By inputting the second coordinate information and second size information of the complete image region into the text segmentation model, N sub-regions and their coordinate information can be obtained, where N is a positive integer not less than 1.

[0083] In this embodiment of the invention, by inputting N sub-regions and their coordinate information into the text recognition model, the text information within each sub-region is obtained. The text information in the first sub-region is "Today," in the second sub-region is "The weather is nice," in the third sub-region is "It cost 10 yuan," and in the fourth sub-region is "The length is 10 meters." This allows for rapid mapping of text information within a complete image region to its corresponding text location, thereby improving the efficiency of extracting text information from corresponding positions within the complete image region and enhancing the user experience.

[0084] like Figure 8 The diagram illustrates a method for merging sub-regions according to an embodiment of the present invention. In one possible scenario, if the text information of the first sub-region in a complete image area is "Today," and the text information of the second sub-region is "The weather is nice," since the difference in the vertical coordinates of the first and second sub-regions is less than a first threshold, the text information in the first and second sub-regions is considered to be the same sentence. To avoid dividing the same sentence into two sub-regions and affecting the correspondence between text information and text position, the first and second sub-regions need to be merged to obtain a fifth sub-region. The text information of the fifth sub-region is "The weather is nice today." Since the difference in the vertical coordinates of the third and fourth sub-regions is greater than the first threshold, the text information in the third and fourth sub-regions is not considered to be the same sentence. Therefore, the third and fourth sub-regions are not merged, thereby improving the accuracy of text information and text position.

[0085] Based on the same technical concept described above, embodiments of the present invention also provide a region identification device, which can execute the methods described in the method embodiments above. The structure of the region identification device provided in the embodiments of the present invention can be found in [reference needed]. Figure 9 The device 900 includes:

[0086] The acquisition unit 901 is used to acquire first size information and first coordinate information of a local image region; and acquire second size information of a complete image region. The processing unit 902 is used to correct the first size information and first coordinate information of the local image region according to the first size information of the local image region and the second size information of the complete image region to obtain third size information and third coordinate information; determine length ratio parameters and width ratio parameters according to the second size information and the third size information; determine the second coordinate information of the complete image region according to the length ratio parameters, the width ratio parameters and the third coordinate information; divide the complete image region into N sub-regions according to the second coordinate information and the second size information of the complete image region, and identify text information in the N sub-regions.

[0087] The second size information includes a second length and a second width, and the first size information includes a first length and a first width; the processing unit 902 is specifically used to: delete the region in the complete image region that is not included in the local image region; use the coordinates of the first boundary of the complete image region as the coordinates of the first boundary of the local image region after deleting the part of the region, and obtain the third coordinate information and the third size information.

[0088] Optionally, the processing unit 902 is specifically used to: divide the third length by the second length to determine the length ratio parameter; and divide the third width by the second width to determine the width ratio parameter.

[0089] Optionally, the processing unit 902 is specifically used to: multiply the first horizontal coordinate information by the length ratio parameter to determine the second horizontal coordinate information; and multiply the first vertical coordinate information by the width ratio parameter to determine the second vertical coordinate information.

[0090] Optionally, the processing unit 902 is specifically used to: input the second coordinate information of the complete image region and the second size information of the complete image region into the text segmentation model to obtain N sub-regions and the coordinate information of the sub-regions, where N is a positive integer not less than 1.

[0091] Optionally, the processing unit 902 is specifically used to: input the N sub-regions and the coordinate information of the sub-regions into the character recognition model to obtain the character information in the sub-regions.

[0092] Optionally, the processing unit 902 is specifically used to: if the difference between the ordinates of two adjacent sub-regions is less than a first threshold, merge the two adjacent sub-regions into one sub-region.

[0093] Based on the same technical concept, embodiments of this application also provide an electronic device, such as... Figure 10 As shown, the electronic device 1000 includes at least one processor 1001 and a memory 1002 connected to the at least one processor. In this embodiment, the specific connection medium between the processor 1001 and the memory 1002 is not limited. Figure 10 Taking the connection between processor 1001 and memory 1002 via a bus as an example. The bus can be divided into address bus, data bus, control bus, etc. In this embodiment, memory 1002 stores instructions that can be executed by at least one processor 1001. At least one processor 1001 can execute the steps included in the aforementioned region identification method by executing the instructions stored in memory 1002.

[0094] The processor 1001 is the control center of the computing device, and can connect to various parts of the computing device using various interfaces and lines. It performs data processing by running or executing instructions stored in the memory 1002 and accessing data stored in the memory 1002. Optionally, the processor 1001 may include one or more processing units. The processor 1001 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles issuing instructions. It is understood that the modem processor may not be integrated into the processor 1001. In some embodiments, the processor 1001 and the memory 1002 may be implemented on the same chip; in some embodiments, they may be implemented on separate chips.

[0095] Processor 1001 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the region identification method can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.

[0096] Memory 1002, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 1002 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 1002 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 1002 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.

[0097] Based on the same technical concept, embodiments of this application also provide a computer-readable storage medium storing a computer program executable by a computing device, which, when run on the computing device, causes the computing device to perform the steps of the above-described region identification method.

[0098] Based on the same technical concept, embodiments of this application also provide a computer program product, including computer-readable instructions, which, when executed by a processor, enable the aforementioned region identification method to be implemented.

[0099] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0100] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0101] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0102] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0103] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0104] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for region identification, characterized in that, include: Obtain the first size information and first coordinate information of the local image region; the local image region is a partial display area of ​​the document image visible on the display screen; Obtain the second size information of the complete image area; the complete image area is the complete area of ​​the document image read from the document image library; Based on the first size information of the local image region and the second size information of the complete image region, the first size information and the first coordinate information of the local image region are corrected to obtain the third size information and the third coordinate information. Based on the second dimension information and the third dimension information, determine the length ratio parameter and the width ratio parameter; The second coordinate information of the complete image region is determined based on the length ratio parameter, the width ratio parameter, and the third coordinate information; Based on the second coordinate information and the second size information of the complete image region, the complete image region is divided into N sub-regions, and the text information in the N sub-regions is identified.

2. The method as described in claim 1, characterized in that, The second dimension information includes a second length and a second width, and the first dimension information includes a first length and a first width; The step of correcting the first size information and the first coordinate information of the local image region based on the first size information of the local image region and the second size information of the complete image region to obtain third size information and third coordinate information includes: Delete the regions in the complete image region that are not included in the local image region; The coordinates of the first boundary of the complete image region are used as the coordinates of the first boundary of the local image region after deleting a portion of the region, thus obtaining the third coordinate information and the third size information.

3. The method as described in claim 2, characterized in that, The third dimension information includes a third length and a third width; The step of determining the length ratio parameter and the width ratio parameter based on the second dimension information and the third dimension information includes: The third length is divided by the second length to determine the length ratio parameter; The third width is divided by the second width to determine the width ratio parameter.

4. The method as described in claim 1, characterized in that, The third coordinate information includes first horizontal coordinate information and first vertical coordinate information, and the second coordinate information includes second horizontal coordinate information and second vertical coordinate information; Determining the second coordinate information of the complete image region based on the length ratio parameter, the width ratio parameter, and the third coordinate information includes: The first horizontal coordinate information is multiplied by the length ratio parameter to determine the second horizontal coordinate information; The first ordinate information is multiplied by the width ratio parameter to determine the second ordinate information.

5. The method as described in claim 1, characterized in that, The step of dividing the complete image region into N sub-regions based on the second coordinate information and the second size information of the complete image region includes: The second coordinate information and the second size information of the complete image region are input into the text segmentation model to obtain N sub-regions and the coordinate information of the sub-regions, where N is a positive integer not less than 1.

6. The method as described in claim 5, characterized in that, The identification of text information in the N sub-regions includes: The N sub-regions and their coordinate information are input into the text recognition model to obtain the text information in the sub-regions.

7. The method as described in claim 5, characterized in that, If the difference in the ordinates of two adjacent sub-regions is less than a first threshold, the two adjacent sub-regions are merged into one sub-region.

8. A device for region identification, characterized in that, include: The acquisition unit is used to acquire first size information and first coordinate information of a local image region; the local image region is a local display area visible on the display screen; and to acquire second size information of a complete image region; the complete image region is the complete area of ​​a target image read from an image repository. The processing unit is configured to: correct the first size information and the first coordinate information of the local image region based on the first size information of the local image region and the second size information of the complete image region to obtain third size information and third coordinate information; determine a length ratio parameter and a width ratio parameter based on the second size information and the third size information; determine the second coordinate information of the complete image region based on the length ratio parameter, the width ratio parameter and the third coordinate information; divide the complete image region into N sub-regions based on the second coordinate information and the second size information of the complete image region, and identify text information in the N sub-regions.

9. An electronic device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the method as described in any one of claims 1 to 7 according to the obtained program.

10. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method of claim 1.

11. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method of claim 1.