Text information splicing method and device and electronic equipment

By determining the position coordinates of the sub-picture after the picture is cropped and verifying the overlapping area, the problem of duplicate text information processing in the prior art is solved, saving calculation amount and improving accuracy are achieved, and the problem of duplication of text information is avoided.

CN119168854APending Publication Date: 2024-12-20SHANGHAI WEIWENJIA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310672695.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-07
Publication Date
2024-12-20

Smart Images

  • Figure CN119168854A_ABST
    Figure CN119168854A_ABST
Patent Text Reader

Abstract

The invention provides a text information splicing method and device and electronic equipment, and relates to the technical field of image processing, an original picture is cut in advance to obtain a plurality of sub-pictures, the method comprises the following steps: obtaining a plurality of sub-pictures, the sub-pictures comprise text information, and the text information included in the sub-pictures with adjacent positions has an overlapping area; determining position coordinates of the text information included in the plurality of sub-pictures in the original picture; determining a target overlapping region of the text information included in the sub-pictures with adjacent positions based on the position coordinates; verifying whether the same target text information exists in the target overlapping region or not; and if the target text information exists, splicing the target text information. In the mode, the calculation amount generated by picture comparison is saved, and comparison errors and text information repetition are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a text information splicing method, device and electronic equipment. Background Art

[0002] Recognizing text information in images is an important task in digital image processing. Generally, OCR (Optical Character Recognition) is used. In the implementation process, when the image size is too large, the image is usually cropped, and then the text information of the cropped image is recognized separately, and then the recognized text information is spliced ​​to obtain the complete text information.

[0003] When cropping an image, in order to ensure the integrity of the text information, the sub-images obtained after cropping will usually have target overlapping areas, and repeated text information will appear in the target overlapping areas. In related technologies, when splicing text information, repeated text information is not considered, and adjacent sub-images are directly spliced. After splicing, the repeated text information in the target overlapping areas is cropped out by comparing the sub-images to achieve the purpose of deduplication. However, this solution not only has a large amount of calculation, but also may result in comparison errors, resulting in repeated text information. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a text information splicing method, device and electronic device, which saves the calculation amount generated by image comparison, avoids the occurrence of comparison errors and the appearance of text information duplication by splicing target text information in target overlapping areas.

[0005] In a first aspect, an embodiment of the present invention provides a method for splicing text information, which pre-crops an original image to obtain multiple sub-images, including: obtaining multiple sub-images, each of which includes text information, and the text information included in adjacent sub-images has an overlapping area; determining the position coordinates of the text information included in the multiple sub-images in the original image; determining a target overlapping area of ​​the text information included in the adjacent sub-images based on the position coordinates; verifying whether the same target text information exists in the target overlapping area; if the target text information exists, splicing the target text information.

[0006] In a preferred embodiment of the present invention, the above-mentioned determination of the position coordinates of the text information included in the multiple sub-pictures in the original picture includes: determining the first position coordinates of the multiple sub-pictures in the original picture; determining the second position coordinates of the text information in the sub-picture; and determining the position coordinates of the text information included in the multiple sub-pictures in the original picture based on the first position coordinates and the second position coordinates.

[0007] In a preferred embodiment of the present invention, the above-mentioned text information includes characters, and verifying whether the same target text information exists in the target overlapping area includes: performing frame selection operations on the text information included in multiple sub-pictures respectively to obtain text information boxes; based on the length of the text information box, the number of characters included in the text information and the target overlapping area, determining whether the same target text information exists in sub-pictures with adjacent positions.

[0008] In a preferred embodiment of the present invention, the above-mentioned determining whether the same target text information exists in adjacent sub-pictures based on the length of the text information box, the number of characters included in the text information and the target overlapping area includes: determining the length of each character based on the length of the text information box and the number of characters included in the text information; determining the proportion of the target overlapping area to the sub-picture; determining the target number of characters in the target overlapping area of ​​adjacent sub-pictures based on the proportion, the length of the text information box and the length of the characters; and determining whether the same target text information exists in adjacent sub-pictures based on the target number.

[0009] In a preferred embodiment of the present invention, the first sub-picture is the previous sub-picture of the second sub-picture, and the above-mentioned determination based on the target quantity whether the same target text information exists in the adjacent sub-pictures includes: judging whether the last target number of characters of the first sub-picture is the same as the first target number of characters of the second sub-picture.

[0010] In a preferred embodiment of the present invention, the above-mentioned determining the target number of characters in the target overlapping area of ​​sub-images adjacent to each other based on the ratio, the length of the text information box and the length of the character includes: determining the length of the text information box in the target overlapping area based on the ratio and the length of the text information box; determining the target number of characters in the target overlapping area of ​​sub-images adjacent to each other based on the length of the text information box in the target overlapping area and the length of the character.

[0011] In a preferred embodiment of the present invention, the above-mentioned splicing of the target text information includes: determining the proportion of the target overlapping area to the sub-image; determining the length of the target overlapping area based on the length and proportion of the sub-image; determining whether the text information included in the adjacent sub-images is continuous based on the position coordinates and length of the adjacent sub-images; if so, splicing the target text information.

[0012] In a preferred embodiment of the present invention, the third sub-picture is the previous sub-picture of the fourth sub-picture, and the above-mentioned determining whether the text information included in the adjacent sub-pictures is continuous based on the position coordinates and lengths of the adjacent sub-pictures includes: determining the position coordinates of the target sub-picture based on the position coordinates and length of the third sub-picture; and judging whether the position coordinates of the target sub-picture are the same as the position coordinates of the fourth sub-picture.

[0013] In a second aspect, an embodiment of the present invention further provides a text information splicing device, which pre-crops an original image to obtain multiple sub-images, including: a sub-image acquisition module, used to acquire multiple sub-images, each of which includes text information, and the text information included in adjacent sub-images has an overlapping area; a position coordinate determination module, used to determine the position coordinates of the text information included in the multiple sub-images in the original image; a target overlapping area determination module, used to determine the target overlapping area of ​​the text information included in the adjacent sub-images based on the position coordinates; a target text information verification module, used to verify whether the same target text information exists in the target overlapping area; a target text information splicing module, used to splice the target text information if the target text information exists.

[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the text information splicing method of the first aspect above.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] The embodiments of the present invention provide a text information splicing method, device and electronic device, which determine the position coordinates of text information included in multiple sub-pictures in an original picture, and then determine the target overlapping area of ​​the text information included in the sub-pictures with adjacent positions, and then verify whether the same target text information exists in the target overlapping area to ensure the accuracy of the target overlapping area. Then, when the same target text information exists in the target overlapping area, the target text information in the target overlapping area is spliced, which saves the calculation amount generated by picture comparison and avoids the occurrence of comparison errors and the appearance of repeated text information.

[0017] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.

[0018] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A flowchart of a text information splicing method provided by an embodiment of the present invention;

[0021] Figure 2 A flowchart of another text information splicing method provided by an embodiment of the present invention;

[0022] Figure 3 A flowchart of another text information splicing method provided by an embodiment of the present invention;

[0023] Figure 4 A flowchart of another text information splicing method provided by an embodiment of the present invention;

[0024] Figure 5 A structural schematic diagram of a text information splicing device provided by an embodiment of the present invention;

[0025] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] Recognizing text information in images is an important task in digital image processing. Generally, OCR (Optical Character Recognition) is used. In the implementation process, when the image size is too large, the image is usually cropped, and then the text information of the cropped image is recognized separately, and then the recognized text information is spliced ​​to obtain the complete text information.

[0028] When cropping an image, in order to ensure the integrity of the text information, the sub-images obtained after cropping will usually have target overlapping areas, and repeated text information will appear in the target overlapping areas. In related technologies, when splicing text information, repeated text information is not considered, and adjacent sub-images are directly spliced. After splicing, the repeated text information in the target overlapping areas is cropped out by comparing the sub-images to achieve the purpose of deduplication. However, this solution not only has a large amount of calculation, but also may result in comparison errors, resulting in repeated text information.

[0029] Based on this, an embodiment of the present invention provides a text information splicing method, device and electronic device, which determines the position coordinates of the text information included in multiple sub-pictures in the original picture, and then determines the target overlapping area of ​​the text information included in the adjacent sub-pictures, and then verifies whether the same target text information exists in the target overlapping area to ensure the accuracy of the target overlapping area, and then splices the target text information in the target overlapping area when the same target text information exists in the target overlapping area, thereby saving the calculation amount generated by picture comparison and avoiding the occurrence of comparison errors and the appearance of repeated text information.

[0030] To facilitate understanding of this embodiment, a text information splicing method disclosed in an embodiment of the present invention is first introduced in detail.

[0031] Example 1

[0032] The embodiment of the present invention provides a text information splicing method. Figure 1 A flowchart of a text information splicing method provided by an embodiment of the present invention. Figure 1 As shown, the original image is cropped in advance to obtain multiple sub-images. The text information splicing method may include the following steps:

[0033] Step S101, obtaining multiple sub-pictures.

[0034] The sub-image is obtained by cropping the original image according to a preset cropping order and a preset cropping size. The sub-image includes text information, and there is an overlapping area of ​​text information included in adjacent sub-images.

[0035] Step S102, determining the position coordinates of the text information included in the plurality of sub-pictures in the original picture.

[0036] A rectangular coordinate system can be established with the upper left corner of the original image as the coordinate origin, the horizontal direction as the x-axis, and the vertical direction as the y-axis. After cropping the original image, the position coordinates of the text information included in multiple sub-images in the original image can be directly obtained. The specific position coordinates of the sub-images can be represented by the coordinate points corresponding to the upper left corner of the sub-image and the coordinate points corresponding to the lower right corner.

[0037] Step S103: determining a target overlapping area of ​​text information included in adjacent sub-pictures based on the position coordinates.

[0038] The target overlapping area of ​​the text information included in the adjacent sub-pictures can be determined by the position coordinates. For example, the coordinates of the upper left corner of sub-picture 1 are (100, 100), and the coordinates of the lower right corner are (500, 200); the coordinates of the upper left corner of sub-picture 2 are (400, 100), and the coordinates of the lower right corner are (1000, 200), then the coordinates of the upper left corner of the target overlapping area of ​​the text information included in sub-picture 1 and sub-picture 2 can be determined by the position coordinates as (400, 100) and (500, 200).

[0039] Step S104, verifying whether there is the same target text information in the target overlapping area.

[0040] By comparing the target text information at the end of the previous sub-image with the target text information at the beginning of the next sub-image, it can be verified whether the same target text information exists in the target overlapping area, wherein the target text information at the end of the previous sub-image and the target text information at the beginning of the next sub-image are both located in the target overlapping area, and the previous sub-image is adjacent to the next sub-image.

[0041] By verifying whether the same target text information exists in the target overlapping area, the accuracy of the target text information is guaranteed, which provides a basis for the accurate splicing of the target text information and avoids repeated splicing of text information.

[0042] Step S105: If the target text information exists, the target text information is spliced.

[0043] Under the condition that the target text information exists, the target text information can be spliced ​​so that the text information included in the sub-pictures at adjacent positions is connected, thereby ensuring the integrity of the text information of the original picture.

[0044] The text information splicing method provided by the embodiment of the present invention determines the position coordinates of the text information included in multiple sub-pictures in the original picture, and then determines the target overlapping area of ​​the text information included in the adjacent sub-pictures, and then verifies whether the same target text information exists in the target overlapping area to ensure the accuracy of the target overlapping area. Then, when the same target text information exists in the target overlapping area, the target text information in the target overlapping area is spliced, which saves the calculation amount generated by picture comparison and avoids the occurrence of comparison errors and the appearance of repeated text information.

[0045] Example 2

[0046] The embodiment of the present invention also provides another text information splicing method; this method is implemented on the basis of the method in the above embodiment; this method focuses on describing the specific implementation method of determining the position coordinates of the text information included in multiple sub-pictures in the original picture.

[0047] Figure 2 A flowchart of another text information splicing method provided by an embodiment of the present invention, such as Figure 2 As shown, the text information splicing method may include the following steps:

[0048] Step S201, determining first position coordinates of a plurality of sub-pictures in the original picture.

[0049] A rectangular coordinate system can be established with the upper left corner of the original image as the coordinate origin, the horizontal direction as the x-axis, and the vertical direction as the y-axis. The first position coordinates are the upper left corner coordinates and the lower right corner coordinates of multiple sub-images. After the original image is cropped into multiple sub-images, the first position coordinates of the multiple sub-images can be automatically located.

[0050] Step S202, determining the second position coordinates of the text information in the sub-picture.

[0051] A rectangular coordinate system can be established with the upper left corner of the sub-image as the coordinate origin, the horizontal direction as the x-axis, and the vertical direction as the y-axis. The second position coordinates are the upper left corner coordinates and the lower right corner coordinates of the text information. After determining the first position coordinates of multiple sub-images, the text information can be automatically positioned at the second position coordinates of the sub-image.

[0052] Step S203: determining the position coordinates of the text information included in the plurality of sub-pictures in the original picture based on the first position coordinates and the second position coordinates.

[0053] The upper left corner coordinates in the first position coordinates and the second position coordinates may be added together to obtain the position coordinates of the text information included in the plurality of sub-pictures in the original picture.

[0054] For example, the upper left corner coordinate in the first position coordinate is (100, 100), the upper left corner coordinate in the second position coordinate is (10, 10), and the lower right corner coordinate is (20, 20). Then the position coordinates of the text information included in the sub-picture in the original picture are the upper left corner coordinate (100+10, 100+10), i.e. (110, 110), and the lower right corner coordinate (100+20, 100+20), i.e. (120, 120).

[0055] The text information splicing method provided by the embodiment of the present invention determines the first position coordinates and the second position coordinates, and then adds the first position coordinates and the second position coordinates to determine the position coordinates of the text information in the original image, thereby ensuring the accuracy of the target overlapping area, and further ensuring the accuracy of the target text information, providing a basis for the accurate splicing of the target text information, and avoiding repeated splicing of text information.

[0056] Example 3

[0057] The embodiment of the present invention also provides another text information splicing method; this method is implemented on the basis of the method in the above embodiment; this method focuses on describing the specific implementation method of verifying whether there is the same target text information in the target overlapping area.

[0058] Figure 3 A flowchart of another text information splicing method provided by an embodiment of the present invention, such as Figure 3 As shown, the text information includes characters, and the text information splicing method may include the following steps:

[0059] Step S301, performing a frame selection operation on the text information included in multiple sub-pictures to obtain text information frames.

[0060] Specifically, the text information included in the sub-image may be one line or multiple lines. When the text information is multiple lines, when performing a frame selection operation on the text information, the multiple lines of text information may be framed separately to obtain multiple text information frames.

[0061] Step S302 : determining whether the same target text information exists in adjacent sub-pictures based on the length of the text information box, the number of characters included in the text information, and the target overlapping area.

[0062] Among them, the length of the text information box can be determined by the x-axis in the rectangular coordinate system established with the upper left corner of the original image as the origin coordinate. Specifically, the horizontal coordinates of the upper left corner and the upper right corner of the text information box can be read on the rectangular coordinate system, and the length of the text information box can be obtained by subtracting the horizontal coordinates of the two points.

[0063] The number of characters included in the text information in each text information box may be identified by an OCR system.

[0064] Specifically, through steps A1 to A4, it can be determined whether the same target text information exists in adjacent sub-pictures based on the length of the text information box, the number of characters included in the text information, and the target overlapping area.

[0065] Step A1, determining the length of each character based on the length of the text information frame and the number of characters included in the text information.

[0066] Specifically, the length of a character may be calculated using the following formula: a=bc, where a is the length of the character, b is the length of the text information box, and c is the number of characters included in the text information.

[0067] Step A2, determining the ratio of the target overlapping area to the sub-image.

[0068] Since the original image is cropped in a preset order and at a preset size, the lengths of adjacent sub-images and target overlapping areas in the horizontal direction must be equal. Therefore, the proportion of the target overlapping area in the sub-image can be determined only by the lengths of adjacent sub-images and target overlapping areas in the x-axis direction. Specifically, the proportion of the target overlapping area in the sub-image can be calculated using the following formula: d = e / f, where d is the proportion of the target overlapping area in the sub-image, e is the length of the target overlapping area in the x-axis direction, and f is the length of adjacent sub-images in the x-axis direction.

[0069] Step A3, determining the target number of characters in the target overlapping area of ​​adjacent sub-pictures based on the ratio, the length of the text information box and the length of the characters.

[0070] Specifically, the above step A3 may include determining the length of the text information box in the target overlapping area based on the ratio and the length of the text information box; and determining the target number of characters in the target overlapping area of ​​adjacent sub-pictures based on the length of the text information box and the length of the characters in the target overlapping area.

[0071] The length of the text information box in the target overlapping area can be calculated using the following formula: g=bd, where g is the length of the text information box in the target overlapping area, b is the length of the text information box, and d is the ratio of the target overlapping area to the sub-image.

[0072] The target number of characters in the target overlapping area can be calculated using the following formula: h=g / a, where h is the target number of characters in the target overlapping area, g is the length of the text information box in the target overlapping area, and a is the length of the characters.

[0073] Step A4: determining whether the same target text information exists in adjacent sub-pictures based on the number of targets.

[0074] Specifically, the above step A4 may include: determining whether the last target number of characters in the first sub-picture is the same as the first target number of characters in the second sub-picture.

[0075] Among them, the first sub-image is the previous sub-image of the second sub-image. After the target number of characters is determined, the last target number of characters of the first sub-image and the first target number of characters of the second sub-image are recognized by the OCR system, and it can be determined whether the last target number of characters of the first sub-image and the first target number of characters of the second sub-image are the same.

[0076] The text information splicing method provided by the embodiment of the present invention determines the length of each character by the length of the text information box and the number of characters included in the text information, and then determines the length of the text information box in the target overlapping area by the ratio of the target overlapping area to the sub-image and the length of the text information box. Finally, according to the length of the text information box and the length of the characters in the target overlapping area, the target number of characters in the target overlapping area of ​​the adjacent sub-images is determined, and according to whether the last target number of characters in the first sub-image and the first target number of characters in the second sub-image are the same, it is verified whether the same target text information exists in the target overlapping area, thereby ensuring the accuracy of the target text information, providing a basis for accurate splicing of the target text information, and avoiding repeated splicing of text information.

[0077] Example 4

[0078] The embodiment of the present invention also provides another text information splicing method; this method is implemented on the basis of the method in the above embodiment; this method focuses on describing the specific implementation method of splicing the target text information.

[0079] Figure 4 A flowchart of another text information splicing method provided by an embodiment of the present invention, such as Figure 4 As shown, the text information splicing method may include the following steps:

[0080] Step S401, determining the ratio of the target overlapping area to the sub-picture.

[0081] The ratio of the target overlapping area to the sub-image is determined in the same manner as in the aforementioned step A2, and will not be described in detail here.

[0082] Step S402: determining the length of the target overlapping area based on the length and proportion of the sub-pictures.

[0083] Since the sub-image is cropped according to a preset size, the length of the sub-image can be obtained by the preset size.

[0084] Specifically, the length of the target overlapping area can be calculated using the following formula: i=jd, where i is the length of the target overlapping area, j is the length of the sub-image, and d is the ratio of the target overlapping area to the sub-image.

[0085] Step S403: determining whether text information included in adjacent sub-pictures is continuous based on the position coordinates and lengths of the adjacent sub-pictures.

[0086] Specifically, the third sub-picture is the previous sub-picture of the fourth sub-picture, and the position coordinates of the target sub-picture are determined based on the position coordinates and length of the third sub-picture; and it is determined whether the position coordinates of the target sub-picture are the same as the position coordinates of the fourth sub-picture.

[0087] Among them, the position coordinates of the target sub-image are obtained by subtracting the length of the target overlapping area from the position coordinates of the third sub-image. By comparing the obtained position coordinates of the target sub-image with the position coordinates of the fourth sub-image, it is determined whether the position coordinates of the target sub-image are the same as the position coordinates of the fourth sub-image. If they are the same, the text information included in the adjacent sub-images is continuous.

[0088] The text information included in the adjacent sub-pictures is represented to be continuous, and the text information included in the adjacent sub-pictures is the same piece of text information.

[0089] Step S404: If yes, the target text information is spliced.

[0090] Under the condition that the target text information exists, the target text information can be spliced ​​so that the text information included in the sub-pictures at adjacent positions is connected, thereby ensuring the integrity of the text information of the original picture.

[0091] The text information splicing method provided by the embodiment of the present invention determines the length of the target overlapping area by the ratio of the target overlapping area to the sub-image and the length of the sub-image, and then determines whether the text information included in the adjacent sub-images is continuous according to the position coordinates and lengths of the adjacent sub-images. If it is continuous, the target text information is spliced, thereby ensuring the accuracy of the target text information, providing a basis for the accurate splicing of the target text information, and avoiding repeated splicing of text information.

[0092] Example 5

[0093] Corresponding to the above method embodiment, the embodiment of the present invention provides a text information splicing device, Figure 5A structural diagram of a text information splicing device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the text information splicing device may include:

[0094] The sub-picture acquisition module 501 is used to acquire a plurality of sub-pictures, wherein the sub-pictures include text information, and the text information included in adjacent sub-pictures has overlapping areas;

[0095] A position coordinate determination module 502, configured to determine the position coordinates of the text information included in the plurality of sub-pictures in the original picture;

[0096] A target overlapping region determining module 503 determines a target overlapping region of text information included in adjacent sub-pictures based on the position coordinates;

[0097] A target text information verification module 504, used to verify whether the same target text information exists in the target overlapping area;

[0098] The target text information splicing module 505 is used to splice the target text information if the target text information exists.

[0099] The text information splicing device provided by the embodiment of the present invention determines the position coordinates of the text information included in multiple sub-pictures in the original picture, and then determines the target overlapping area of ​​the text information included in the adjacent sub-pictures, and then verifies whether the same target text information exists in the target overlapping area to ensure the accuracy of the target overlapping area. Then, when the same target text information exists in the target overlapping area, the target text information in the target overlapping area is spliced, which saves the calculation amount generated by picture comparison and avoids the occurrence of comparison errors and the appearance of repeated text information.

[0100] In some embodiments, the position coordinate determination module is also used to determine the first position coordinates of multiple sub-pictures in the original picture; determine the second position coordinates of the text information in the sub-picture; and determine the position coordinates of the text information included in the multiple sub-pictures in the original picture based on the first position coordinates and the second position coordinates.

[0101] In some embodiments, the target text information verification module is also used to perform frame selection operations on the text information included in multiple sub-pictures to obtain text information frames; based on the length of the text information frame, the number of characters included in the text information and the target overlapping area, determine whether the same target text information exists in adjacent sub-pictures.

[0102] In some embodiments, the target text information verification module is also used to determine the length of each character based on the length of the text information box and the number of characters included in the text information; determine the proportion of the target overlapping area in the sub-image; based on the proportion, the length of the text information box and the length of the characters, determine the target number of characters in the target overlapping area of ​​adjacent sub-images; based on the target number, determine whether the same target text information exists in adjacent sub-images.

[0103] In some embodiments, the first sub-image is the previous sub-image of the second sub-image, and the target text information verification module is further used to determine whether the last target number of characters in the first sub-image is the same as the first target number of characters in the second sub-image.

[0104] In some embodiments, the target text information verification module is also used to determine the length of the text information box in the target overlapping area based on the ratio and the length of the text information box; and determine the target number of characters in the target overlapping area of ​​adjacent sub-images based on the length of the text information box and the length of the characters in the target overlapping area.

[0105] In some embodiments, the target text information splicing module is also used to determine the proportion of the target overlapping area to the sub-image; determine the length of the target overlapping area based on the length and proportion of the sub-image; determine whether the text information included in the adjacent sub-images is continuous based on the position coordinates and length of the adjacent sub-images; if so, splice the target text information.

[0106] In some embodiments, the third sub-picture is the previous sub-picture of the fourth sub-picture, and the target text information splicing module is also used to determine the position coordinates of the target sub-picture based on the position coordinates and length of the third sub-picture; and to determine whether the position coordinates of the target sub-picture are the same as the position coordinates of the fourth sub-picture.

[0107] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0108] Example 6

[0109] The embodiment of the present invention also provides an electronic device for executing the above-mentioned text information splicing method; see Figure 6 A structural schematic diagram of an electronic device is shown, which includes a memory 600 and a processor 601, wherein the memory 600 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 601 to implement the above-mentioned text information splicing method.

[0110] Further, Figure 6The electronic device shown further includes a bus 602 and a communication interface 603 , and the processor 601 , the communication interface 603 and the memory 600 are connected via the bus 602 .

[0111] The memory 600 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 603 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 602 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0112] The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 601. The above processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 600, and the processor 601 reads the information in the memory 600 and completes the steps of the method of the above embodiment in combination with its hardware.

[0113] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned text information splicing method. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0114] The computer program product for the text information splicing method provided in the embodiment of the present invention includes a computer-readable storage medium storing a non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0115] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0116] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0117] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0118] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0119] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0120] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A text information splicing method, characterized in that: The original image is pre-cropped to obtain a plurality of sub-images, and the method includes: Acquire a plurality of sub-pictures, wherein the sub-pictures include text information, and the text information included in adjacent sub-pictures has overlapping areas; Determining position coordinates of the text information included in the plurality of sub-pictures in the original picture; Determining a target overlapping area of ​​text information included in the adjacent sub-pictures based on the position coordinates; Verify whether the same target text information exists in the target overlapping area; If target text information exists, the target text information is spliced.

2. The method according to claim 1, characterized in that The determining the position coordinates of the text information included in the plurality of sub-pictures in the original picture includes: Determining first position coordinates of the plurality of sub-images in the original image; Determining a second position coordinate of the text information in the sub-picture; The position coordinates of the text information included in the plurality of sub-pictures in the original picture are determined based on the first position coordinates and the second position coordinates.

3. The method according to claim 1, characterized in that The text information includes characters, and verifying whether the target overlapping area contains the same target text information includes: Performing a frame selection operation on the text information included in the multiple sub-pictures to obtain text information frames; Based on the length of the text information frame, the number of characters included in the text information, and the target overlapping area, it is determined whether the sub-pictures at adjacent positions have the same target text information.

4. The method according to claim 3, characterized in that The determining, based on the length of the text information frame, the number of characters included in the text information, and the target overlapping area, whether the adjacent sub-pictures have the same target text information includes: determining the length of each of the characters based on the length of the text information frame and the number of characters included in the text information; Determine the ratio of the target overlapping area to the sub-image; determining a target number of the characters in a target overlapping area of ​​the adjacent sub-pictures based on the ratio, the length of the text information box, and the length of the characters; It is determined whether the sub-pictures adjacent to each other have the same target text information based on the target quantity.

5. The method according to claim 4, characterized in that The first sub-image is the previous sub-image of the second sub-image; The determining, based on the number of targets, whether the adjacent sub-pictures have the same target text information includes: It is determined whether the target number of characters at the end of the first sub-image is the same as the target number of characters at the beginning of the second sub-image.

6. The method according to claim 4, characterized in that The determining, based on the ratio, the length of the text information box, and the length of the characters, a target number of the characters in the target overlapping area of ​​the adjacent sub-pictures includes: determining a length of the text information box in the target overlapping area based on the ratio and the length of the text information box; Based on the length of the text information box and the length of the characters in the target overlapping area, a target number of characters in the target overlapping area of ​​the adjacent sub-pictures is determined.

7. The method according to claim 1, characterized in that The step of splicing the target text information includes: Determine the ratio of the target overlapping area to the sub-image; determining a length of the target overlapping area based on a length of the sub-picture and the ratio; determining whether text information included in the adjacent sub-pictures is continuous based on the position coordinates and the lengths of the adjacent sub-pictures; If so, the target text information is spliced.

8. The method according to claim 7, characterized in that The third sub-picture is a sub-picture preceding the fourth sub-picture, and determining whether text information included in the adjacent sub-pictures is continuous based on the position coordinates and the length of the adjacent sub-pictures includes: Determining the position coordinates of the target sub-picture based on the position coordinates of the third sub-picture and the length; It is determined whether the position coordinates of the target sub-picture are the same as the position coordinates of the fourth sub-picture.

9. A text information splicing device, characterized in that: The original image is cropped in advance to obtain multiple sub-images, including: A sub-image acquisition module, configured to acquire a plurality of sub-images, wherein the sub-images include text information, and the text information included in adjacent sub-images has overlapping areas; a position coordinate determining module, configured to determine position coordinates of the text information included in the plurality of sub-pictures in the original picture; a target overlapping region determining module, which determines, based on the position coordinates, a target overlapping region of text information included in the adjacent sub-pictures; A target text information verification module, used to verify whether the same target text information exists in the target overlapping area; The target text information splicing module is used to splice the target text information if the target text information exists.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the text information splicing method according to any one of claims 1 to 8.