Conversion method, device, equipment and storage medium of non-line stream file
By performing page segmentation and structural element identification of wireless strip flow files, determining row grouping structure and blank columns with preset coefficients, generating and writing target structure text data, the problem of low accuracy in converting wireless strip flow files in the prior art is solved, and accurate positioning and efficient conversion are achieved.
Patent Information
- Application Number
- CN202210535864.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2042-05-17
AI Technical Summary
The prior art has low accuracy when converting wireless streaming files, and it is impossible to accurately locate the cells of text data.
By dividing the target format wireless strip flow file to be converted, the target wireless strip flow picture is obtained; identifying the target image structural elements to obtain a continuous text outline; determining the row group structure text data and blank columns based on the preset height coefficient, line coefficient, interval coefficient and continuous text outline; generating the target structure text data, and writing it to the target line file according to the target data writing strategy.
It effectively improves the accuracy of converting wireless streaming files and accurately locates the cells that text data.
Smart Images

Figure CN115050041B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, equipment and storage medium for converting a non-line stream file. Background Art
[0002] Bank transaction data is one of the important bases for reflecting the operating conditions of small and micro customer groups, and the analysis of transaction data is one of the important means to assess whether customers are at risk. Currently, transaction data is often realized by printing, but the PDF files and pictures generated by scans are all unformatted data, that is, there are no lines of transaction data, and the text data in the scans usually have defects such as unclear text, skewed tables, or seals covering the text. To solve the above defects, the current common method is to use deep learning networks for recognition, but the accuracy of deep learning networks in the recognition process is low, resulting in a lot of errors in the final text and the inability to accurately locate the cells of the text data.
[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present invention is to provide a method, device, equipment and storage medium for converting a non-linear pipeline file, aiming to solve the technical problems that the prior art has low accuracy in converting non-linear pipeline files and cannot accurately locate the cells of text data.
[0005] To achieve the above object, the present invention provides a method for converting a non-rule stream file, the method comprising the following steps:
[0006] The target format non-linear stream file to be converted is segmented into pages to obtain the target non-linear stream picture;
[0007] Performing structural element recognition on the target wireless streaming image to obtain a continuous text outline;
[0008] Determine the row grouping structure character data and blank columns according to the preset height coefficient, the preset row coefficient, the preset spacing coefficient and the continuous character outline;
[0009] Target structured text data is generated according to the row grouping structured text data and the blank columns, and the target structured text data is written into a target line file according to a target data writing strategy.
[0010] Optionally, the step of performing page segmentation on the target format wireless stream file to be converted to obtain a target wireless stream picture includes:
[0011] The target format non-lined stream file to be converted is segmented into pages to obtain a plurality of pages of the target format non-lined stream file;
[0012] Scaling the plurality of pages of target format non-line stream files according to a target multiple;
[0013] Convert several pages of zoomed target format lineless stream files to obtain target lineless stream pictures.
[0014] Optionally, before the target format unlined stream file to be converted is segmented into pages to obtain a plurality of pages of target format unlined stream files, the method further includes:
[0015] Receive the electronic wireless serial number file sent by the terminal device;
[0016] Scanning the electronic version of the wireless stripe flow file to obtain a wireless stripe flow scan file;
[0017] When the wireless stripe-streamed scan file meets the preset text recognition defect, the wireless stripe-streamed scan file is used as a wireless stripe-streamed file in a target format to be converted.
[0018] Optionally, the performing structural element recognition on the target wireless streaming image to obtain a continuous text outline includes:
[0019] Perform channel splitting on the target wireless streaming image to obtain a target number of channels;
[0020] Extract the red channel of the target number of channels;
[0021] Binarization is performed on the target wireless streaming picture according to the red channel to obtain a binary wireless streaming picture with black background and white characters;
[0022] According to the OTSU threshold, the structure element recognition is performed on the binary wireless flow picture with white characters on a black background through the OpenCV image algorithm to obtain a continuous text contour.
[0023] Optionally, the determining the row grouping structure text data and blank columns according to a preset height coefficient, a preset row coefficient, a preset spacing coefficient and the continuous text contours includes:
[0024] Obtaining a corresponding continuous character contour height according to the continuous character contour;
[0025] Screening the continuous character contours whose height is less than the preset height coefficient;
[0026] Sort the filtered continuous text contours according to the target order relationship;
[0027] Obtaining the corresponding current contour ordinate and previous contour ordinate according to the sorted continuous text contours;
[0028] The current contour ordinate and the previous contour ordinate are subtracted to obtain a contour ordinate difference;
[0029] When the difference in the vertical coordinates of the contour is greater than a preset line coefficient, the contours of each line of continuous text are obtained;
[0030] Obtaining the current contour horizontal coordinate and the adjacent contour horizontal coordinate according to the continuous text contours of each line;
[0031] Performing a difference calculation on the current contour horizontal coordinate and the adjacent contour horizontal coordinate to obtain a contour horizontal coordinate difference;
[0032] When the difference between the horizontal coordinates of the contours is less than a preset interval coefficient, the text contour corresponding to the horizontal coordinate of the current contour and the contour corresponding to the horizontal coordinate of the adjacent contour are merged to obtain the target horizontal coordinate contour;
[0033] Generate row grouping structured text data according to the continuous text contours of each row and the target horizontal coordinate contour;
[0034] A corresponding blank column is obtained according to the row grouping structure text data.
[0035] Optionally, obtaining a corresponding blank column according to the row grouping structure text data includes:
[0036] Obtaining a column number set according to the row grouping structure text data;
[0037] Extract the highest number of columns in the column number set;
[0038] Get the total number of header columns of the target format non-line stream file to be converted;
[0039] Iterate the highest number of columns to obtain the upper left horizontal coordinate of the target column;
[0040] Obtain the upper right horizontal coordinate of the next column of the title row according to the total number of title columns;
[0041] When the upper left horizontal coordinate of the target column is greater than the upper right horizontal coordinate of the next column of the title row, the target column is regarded as a blank column.
[0042] Optionally, generating target structured text data according to the row grouping structured text data and the blank columns, and writing the target structured text data into a target line file according to a target data writing strategy, includes:
[0043] Marking the blank columns according to a preset marking strategy;
[0044] Complete the blank columns after the mark using the target agreed value;
[0045] Generate target structured text data according to the blank columns after column completion and the row grouping structured text data;
[0046] The target structure data is written into the target line file according to the target data writing strategy.
[0047] In addition, to achieve the above-mentioned purpose, the present invention also proposes a device for converting a stream file without stripes, the device for converting a stream file without stripes comprising:
[0048] An acquisition module is used to obtain the current network information of the target terminal device;
[0049] A connection module, used for establishing a connection with the target terminal device through a peer-to-peer network strategy when the current network information and the target network information are not in the same local area network;
[0050] A receiving module, used for receiving a control instruction sent by the target terminal device when the connection with the target terminal device is successful;
[0051] The control module is used to project the content to be projected through the control instructions to achieve control of the projection based on the terminal device.
[0052] In addition, to achieve the above-mentioned purpose, the present invention also proposes a conversion device for wireless stripe files, the conversion device for wireless stripe files comprising: a memory, a processor, and a conversion program for wireless stripe files stored in the memory and executable on the processor, the conversion program for wireless stripe files being configured to implement the conversion method for wireless stripe files as described above.
[0053] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a conversion program for a wireless stream file is stored. When the conversion program for a wireless stream file is executed by a processor, the conversion method for a wireless stream file as described above is implemented.
[0054] The method for converting a lineless pipeline file proposed in the present invention performs page segmentation on a target format lineless pipeline file to be converted to obtain a target lineless pipeline image; performs structural element recognition on the target lineless pipeline image to obtain a continuous text outline; determines row grouping structural text data and blank columns according to a preset height coefficient, a preset row coefficient, a preset spacing coefficient and the continuous text outline; generates target structural text data according to the row grouping structural text data and the blank columns, and writes the target structural data into a target line file according to a target data writing strategy; in the above manner, the continuous text outline is processed according to the preset height coefficient, the preset row coefficient and the preset spacing coefficient, and then the blank columns are marked and completed, and then the target structural data is written, thereby effectively improving the accuracy of converting the lineless pipeline file and accurately locating the cells. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a structural schematic diagram of a wireless stream file conversion device in a hardware operating environment involved in an embodiment of the present invention;
[0056] Figure 2 A schematic diagram of a flow chart of a first embodiment of a method for converting a non-line stream file according to the present invention;
[0057] Figure 3 A schematic diagram of a flow chart of a second embodiment of a method for converting a non-line stream file according to the present invention;
[0058] Figure 4 A schematic diagram of a flow chart of a third embodiment of a method for converting a non-line stream file according to the present invention;
[0059] Figure 5 It is a functional module diagram of the first embodiment of the device for converting a non-stripe stream file according to the present invention.
[0060] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0061] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0062] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of the structure of a wireless stream file conversion device in a hardware operating environment according to an embodiment of the present invention.
[0063] like Figure 1As shown, the wireless stream file conversion device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0064] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the conversion device of the non-line stream file, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0065] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a conversion program for wireless stream files.
[0066] exist Figure 1 In the wireless stripe stream file conversion device shown, the network interface 1004 is mainly used for data communication with the network integration platform workstation; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the wireless stripe stream file conversion device of the present invention can be set in the wireless stripe stream file conversion device, and the wireless stripe stream file conversion device calls the wireless stripe stream file conversion program stored in the memory 1005 through the processor 1001, and executes the wireless stripe stream file conversion method provided by the embodiment of the present invention.
[0067] Based on the above hardware structure, an embodiment of the method for converting a wireless stream file of the present invention is proposed.
[0068] Reference Figure 2 , Figure 2 It is a flowchart diagram of the first embodiment of the method for converting a non-line stream file according to the present invention.
[0069] In a first embodiment, the method for converting a non-line stream file comprises the following steps:
[0070] Step S10, dividing the target format non-linear pipeline file to be converted into pages to obtain a target non-linear pipeline picture.
[0071] It should be noted that the executor of this embodiment is a conversion device for non-line flow files, and may also be other devices that can achieve the same or similar functions, such as a file conversion controller, etc. This embodiment does not limit this. In this embodiment, the file conversion controller is used as an example for explanation.
[0072] It should be understood that the target format wireless flow file to be converted refers to a wireless flow file that cannot be directly edited and needs to be converted. The target format can be PDF format. The target wireless flow picture refers to the picture obtained by page segmentation and conversion operations on the target format wireless flow file. The target wireless flow picture can be in png, jpg and other formats.
[0073] Step S20, performing structural element recognition on the target wireless streaming image to obtain continuous text contours.
[0074] It can be understood that the continuous text contour refers to the contour of a section of continuous text in the target wireless streaming image, specifically, the target wireless streaming image is subjected to structural element recognition. For example, if there are continuous text "transaction date" in the structural element recognition of the target wireless streaming image, the four texts are recognized as separate continuous text contours.
[0075] Further, step S20 includes: performing channel splitting on the target wireless streaming picture to obtain a target number of channels; extracting a red channel of the target number of channels; binarizing the target wireless streaming picture according to the red channel to obtain a binary wireless streaming picture with white characters on a black background; performing structural element recognition on the binary wireless streaming picture with white characters on a black background through an opencv image algorithm according to an otsu threshold to obtain a continuous text contour.
[0076] It should be understood that the target wireless water flow picture is RGB color, not grayscale, indexed color, CMYK color, Lab color, etc. Therefore, after obtaining the target wireless water flow picture, the channel of the RGB image of the target wireless water flow picture is split, and the split channels include red channel, green channel and blue channel. Due to the interference of the red seal in the target wireless water flow picture, the red channel needs to be binarized. After the processing is completed, a binary wireless water flow picture with black background and white text is obtained.
[0077] It can be understood that the OpenCV image algorithm refers to an algorithm for detecting and recognizing images. A large amount of experimental data shows that compared with other image recognition algorithms, the OpenCV image algorithm has extremely high accuracy in recognizing images. In this embodiment, the structural elements of the binary wireless streaming image with white text on a black background are recognized by the OpenCV image algorithm according to the OTSU threshold, which can effectively improve the accuracy of obtaining continuous text contours.
[0078] Step S30, determining the row grouping structure text data and blank columns according to the preset height coefficient, the preset row coefficient, the preset spacing coefficient and the continuous text contour.
[0079] It should be understood that the preset height coefficient refers to the contour height comparison coefficient, the preset row coefficient refers to the contour row height comparison coefficient, the preset interval coefficient refers to the interval coefficient between contours, the row grouping structure text data refers to the structured text data grouped by rows, which is specifically generated based on the continuous text contours of each row and the target horizontal coordinate contour. The blank column refers to the column without actual data in the row grouping structure text data. After setting the preset height coefficient, preset row coefficient, and preset interval coefficient, the preset height coefficient, preset row coefficient, and preset interval coefficient are compared with the related text contours respectively, and then the row grouping structure text data and blank columns are determined based on the comparison results.
[0080] Step S40, generating target structured text data according to the row grouping structured text data and the blank columns, and writing the target structured text data into a target line file according to a target data writing strategy.
[0081] It can be understood that the target structure text data refers to the data of the unit cells of the target format non-line flow file that has been accurately located, and the target data writing strategy refers to the strategy for writing data to the file. The target data writing strategy can be a sequential data writing strategy, that is, writing the target structure data to the target line file in row and column order. The target line file can be a line file in Excel format.
[0082] Further, step S40 includes: marking the blank columns according to a preset marking strategy; completing the marked blank columns by using a target agreed value; generating target structured text data according to the blank columns after column completion and the row grouping structured text data; and writing the target structured data into a target line file according to a target data writing strategy.
[0083] It should be understood that the preset marking strategy refers to a strategy for marking specific locations. After the marking is completed, the blank columns after the marking are completed by the target agreed value. The target agreed value can be a null value, that is, NULL. After the column is completed, the target structure text data is generated, and then the target structure data is written to the target line file according to the target data writing strategy.
[0084] This embodiment obtains a target non-lined pipeline image by performing page segmentation on the target format non-lined pipeline file to be converted; performs structural element recognition on the target non-lined pipeline image to obtain a continuous text outline; determines the row grouping structure text data and the blank column according to a preset height coefficient, a preset row coefficient, a preset spacing coefficient and the continuous text outline; generates target structure text data according to the row grouping structure text data and the blank column, and writes the target structure data to the target line file according to the target data writing strategy; through the above method, the continuous text outline is processed according to the preset height coefficient, the preset row coefficient, and the preset spacing coefficient, and then the blank column is marked and the column is completed, and then the target structure data is written, so as to effectively improve the accuracy of converting the non-lined pipeline file and accurately locate the cell.
[0085] In one embodiment, if Figure 3 Based on the first embodiment, a second embodiment of the method for converting a non-line stream file of the present invention is proposed, wherein step S10 comprises:
[0086] Step S101, dividing the target format non-line stream file to be converted into pages to obtain a plurality of pages of target format non-line stream files.
[0087] It should be understood that the several-page target format non-linear pipeline file refers to the non-linear pipeline file after page segmentation, that is, the target format non-linear pipeline file is segmented according to the number of pages. For example, if the target format non-linear pipeline file is ten pages, then the several-page target format non-linear pipeline file is also ten pages.
[0088] Furthermore, before step S101, it also includes: receiving an electronic wireless stripe stream file sent by a terminal device; scanning the electronic wireless stripe stream file to obtain a wireless stripe stream scan file; when the wireless stripe stream scan file meets the preset text recognition defects, using the wireless stripe stream scan file as a target format wireless stripe stream file to be converted.
[0089] It can be understood that the electronic wireless transaction file is exported by the user from the terminal device, which can be a mobile banking terminal device or an online banking terminal device. The wireless transaction scan file refers to the file obtained by scanning the electronic wireless transaction file. The preset text recognition defect refers to the defect of being unable to accurately identify the cell where the text is located. The preset text recognition defect can be unclear text, skewed text, and text covered by a seal.
[0090] It should be understood that after obtaining the wireless stripe stream scanning file, it is determined whether the wireless stripe stream scanning file has a preset text recognition defect. If so, it is necessary to convert the target format wireless stripe stream file using the method of this embodiment. At this time, the wireless stripe stream scanning file is used as the target format wireless stripe stream file to be converted.
[0091] Step S102, scaling the plurality of pages of target format non-line stream files according to a target multiple.
[0092] It is understandable that in order to improve the file conversion efficiency, after obtaining several pages of target format lineless pipeline files, it is necessary to scale the several pages of target format lineless pipeline files by a target multiple. The target multiple can be 5 times or other multiples, and this embodiment does not limit this.
[0093] Step S103, converting the zoomed target format lineless stream files of several pages to obtain a target lineless stream picture.
[0094] It should be understood that after obtaining the scaled several pages of target format wireless pipeline files, the scaled several pages of target format wireless pipeline files need to be converted separately, that is, the scaled several pages of target format wireless pipeline files are converted from file format to picture format. After the conversion is completed, the target wireless pipeline picture is obtained.
[0095] This embodiment divides the target format wireless stream file to be converted into pages to obtain several pages of target format wireless stream files; scales the several pages of target format wireless stream files according to a target multiple; converts the scaled several pages of target format wireless stream files to obtain a target wireless stream picture; through the above method, the target format wireless stream file to be converted is divided into pages, and then the several pages of target format wireless stream files obtained by page division are scaled according to a target multiple, and finally the scaled several pages of target format wireless stream files are converted into a target wireless stream picture, thereby effectively improving the efficiency of obtaining the target wireless stream picture.
[0096] In one embodiment, if Figure 4Based on the first embodiment, a third embodiment of the method for converting a non-line stream file of the present invention is proposed, wherein step S30 comprises:
[0097] Step S301, obtaining the corresponding continuous text contour height according to the continuous text contour.
[0098] It can be understood that the continuous text contour height refers to the height of the continuous text contour, and no matter whether the continuous text is slanted or vertical, the continuous text contour height is determined by the bottom contour and the top contour.
[0099] Step S302 , screening the continuous character contours whose heights are less than the preset height coefficient.
[0100] It should be understood that after obtaining the height of the continuous text contour, the continuous text contour height is compared with the preset height coefficient, that is, it is determined whether the continuous text contour height is less than the preset height coefficient. If so, the continuous text contours less than the preset height coefficient are filtered out to remove interference points.
[0101] Step S303, sorting the screened continuous text contours according to the target sequence relationship.
[0102] It can be understood that the target sequence relationship refers to the relationship for sorting continuous text contours. The target sequence relationship can be a small-to-large sequence relationship or a large-to-small sequence relationship. This embodiment does not limit this and uses the small-to-large sequence relationship as an example for explanation. After determining the target sequence relationship, the filtered continuous text contours are sorted according to the target sequence relationship.
[0103] Step S304, obtaining the corresponding current contour ordinate and previous contour ordinate according to the sorted continuous character contours.
[0104] It should be understood that the current contour ordinate refers to the ordinate of the row where the current continuous text contour is located, and the previous contour ordinate refers to the ordinate of the row where the previous continuous text contour is located. The current contour ordinate and the previous contour ordinate are obtained by looping through the sorted continuous text contours.
[0105] Step S305 , performing a difference calculation between the current contour ordinate and the previous contour ordinate to obtain a contour ordinate difference.
[0106] It can be understood that the contour ordinate difference refers to the difference between the contour ordinates, specifically, the difference between the current contour ordinate and the previous contour ordinate. For example, if the current contour ordinate is y1 and the previous contour ordinate is y2, then the contour ordinate difference is y2-y1.
[0107] Step S306, when the vertical coordinate difference of the contour is greater than the preset line coefficient, the contours of each line of continuous characters are obtained.
[0108] It should be understood that after obtaining the contour ordinate difference, the contour ordinate difference is compared with the preset row coefficient, that is, to determine whether the contour ordinate difference is greater than the preset row coefficient. If so, the row where the current contour ordinate is located is determined to be a new row, and the determination is repeated in this way to obtain the contours of each line of continuous text.
[0109] Step S307, obtaining the horizontal coordinate of the current contour and the horizontal coordinate of the adjacent contour according to the contours of the continuous text lines.
[0110] It can be understood that the current contour horizontal coordinate refers to the horizontal coordinate of the current continuous text contour, specifically the upper left horizontal coordinate. Similarly, the adjacent contour horizontal coordinate refers to the horizontal coordinate of the contour adjacent to the current continuous text contour, specifically the upper right horizontal coordinate. The coordinate structure of the current contour horizontal coordinate and the adjacent contour horizontal coordinate is [x0:y0, x1+y1].
[0111] Step S308: performing a difference calculation on the current contour horizontal coordinate and the adjacent contour horizontal coordinate to obtain a contour horizontal coordinate difference.
[0112] It should be understood that the contour horizontal coordinate difference refers to the difference between the contour horizontal coordinates, specifically, the difference between the current contour horizontal coordinate and the adjacent contour horizontal coordinate is calculated.
[0113] Step S309 , when the contour horizontal coordinate difference is less than a preset interval coefficient, the text contour corresponding to the current contour horizontal coordinate and the contour corresponding to the adjacent contour horizontal coordinate are merged to obtain the target horizontal coordinate contour.
[0114] It can be understood that after obtaining the contour horizontal coordinate difference, the contour horizontal coordinate difference is compared with the preset interval coefficient, that is, to determine whether the contour horizontal coordinate difference is less than the preset interval coefficient. If so, the text contour corresponding to the current contour horizontal coordinate and the contour corresponding to the adjacent contour horizontal coordinate are merged to obtain the target horizontal coordinate contour. If not, the text contour corresponding to the current contour horizontal coordinate and the contour corresponding to the adjacent contour horizontal coordinate are both separate text contours.
[0115] Step S310, generating line grouping structured text data according to the continuous text contours of each line and the target horizontal coordinate contour.
[0116] It should be understood that row-grouped structural text data refers to structural text data grouped by row. After obtaining the contours of each continuous row of text and the target horizontal coordinate contour, the contours of each continuous row of text are grouped by row according to the target horizontal coordinate contour to obtain row-grouped structural text data.
[0117] Step S311, obtaining corresponding blank columns according to the row grouping structure text data.
[0118] It can be understood that a blank column refers to a column without actual data in the row grouping structure text data, that is, after the row grouping structure text data is obtained, the blank column in the row grouping structure text data is calculated through the horizontal coordinate.
[0119] Further, step S311 includes: obtaining a column number set according to the row grouping structure text data; extracting the highest number of columns in the column number set; obtaining the total number of title columns of the target format non-line pipeline file to be converted; iterating the highest number of columns to obtain the upper left horizontal coordinate of the target column; obtaining the upper right horizontal coordinate of the next column of the title row according to the total number of title columns; when the upper left horizontal coordinate of the target column is greater than the upper right horizontal coordinate of the next column of the title row, treating the target column as a blank column.
[0120] It should be understood that the column number frequency set refers to a set composed of the number of occurrences of each column number in the row grouping structure text data, and then the column number with the highest number of occurrences, that is, the column number with the highest number of occurrences, is selected from the column number frequency set. The total number of title columns refers to the number of all columns in the target format non-line flow file to be converted. The number of title columns is the most complete. Specifically, the upper right horizontal coordinate of the next column of the title row is compared with the upper left horizontal coordinate of the target column, that is, to determine whether the upper right horizontal coordinate of the next column of the title row is greater than the upper right horizontal coordinate of the next column of the title row. If so, it is determined that a column jump must occur, that is, the target column is treated as a blank column, and then the column completion is performed.
[0121] This embodiment obtains the corresponding continuous text contour height according to the continuous text contour, and then determines whether the continuous text contour height is less than the preset height coefficient. If so, the continuous text contour is screened, and then the screened continuous text contours are sorted according to the target sequence relationship, and then the current contour ordinate and the previous contour ordinate are subtracted, and then it is determined whether the contour ordinate difference is greater than the preset row coefficient. If so, the current contour horizontal coordinate and the adjacent contour horizontal coordinate are obtained according to each row of continuous text contours, and the current contour horizontal coordinate and the adjacent contour horizontal coordinate are subtracted, and then it is determined whether the contour horizontal coordinate difference is less than the preset interval coefficient. If so, the text contour corresponding to the current contour horizontal coordinate and the contour corresponding to the adjacent contour horizontal coordinate are merged, and then row grouping structure text data is generated according to each row of continuous text contours and the target horizontal coordinate contour, and finally the corresponding blank column is obtained according to the row grouping structure text data, thereby effectively improving the accuracy of obtaining the blank column.
[0122] In addition, an embodiment of the present invention further proposes a storage medium, on which a conversion program for a wireless stream file is stored. When the conversion program for a wireless stream file is executed by a processor, the steps of the method for converting a wireless stream file as described above are implemented.
[0123] Since the storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.
[0124] In addition, refer to Figure 5 The embodiment of the present invention further provides a device for converting a stream file without any stripes, and the device for converting a stream file without any stripes includes:
[0125] The segmentation module 10 is used to segment the target format non-linear pipeline file to be converted into pages to obtain a target non-linear pipeline picture.
[0126] The recognition module 20 is used to perform structural element recognition on the target wireless streaming image to obtain continuous text contours.
[0127] The determination module 30 is used to determine the row grouping structure text data and the blank column according to the preset height coefficient, the preset row coefficient, the preset spacing coefficient and the continuous text contour.
[0128] The generating module 40 is used to generate target structured text data according to the row grouping structured text data and the blank columns, and write the target structured data into a target line file according to a target data writing strategy.
[0129] This embodiment obtains a target non-lined pipeline image by performing page segmentation on the target format non-lined pipeline file to be converted; performs structural element recognition on the target non-lined pipeline image to obtain a continuous text outline; determines the row grouping structure text data and the blank column according to a preset height coefficient, a preset row coefficient, a preset spacing coefficient and the continuous text outline; generates target structure text data according to the row grouping structure text data and the blank column, and writes the target structure data to the target line file according to the target data writing strategy; through the above method, the continuous text outline is processed according to the preset height coefficient, the preset row coefficient, and the preset spacing coefficient, and then the blank column is marked and the column is completed, and then the target structure data is written, so as to effectively improve the accuracy of converting the non-lined pipeline file and accurately locate the cell.
[0130] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0131] In addition, for technical details not fully described in this embodiment, reference can be made to the method for converting a non-line pipeline file provided in any embodiment of the present invention, and will not be repeated here.
[0132] In one embodiment, the segmentation module 10 is also used to perform page segmentation on the target format wireless pipeline file to be converted to obtain several pages of target format wireless pipeline files; scale the several pages of target format wireless pipeline files according to the target multiple; convert the scaled several pages of target format wireless pipeline files to obtain the target wireless pipeline picture.
[0133] In one embodiment, the segmentation module 10 is also used to receive an electronic wireless stripe stream file sent by a terminal device; scan the electronic wireless stripe stream file to obtain a wireless stripe stream scan file; when the wireless stripe stream scan file meets the preset text recognition defects, use the wireless stripe stream scan file as the target format wireless stripe stream file to be converted.
[0134] In one embodiment, the recognition module 20 is also used to split the channel of the target wireless flowing water picture to obtain a target number channel; extract the red channel of the target number channel; binarize the target wireless flowing water picture according to the red channel to obtain a binary wireless flowing water picture with white text on a black background; perform structural element recognition on the binary wireless flowing water picture with white text on a black background through an opencv image algorithm according to an otsu threshold to obtain a continuous text contour.
[0135] In one embodiment, the determination module 30 is further used to obtain the corresponding continuous text contour height according to the continuous text contour; screen the continuous text contour whose height is less than the preset height coefficient; sort the screened continuous text contours according to the target order relationship; obtain the corresponding current contour ordinate and previous contour ordinate according to the sorted continuous text contour; perform a difference calculation between the current contour ordinate and the previous contour ordinate to obtain the contour ordinate difference; when the contour ordinate difference is greater than the preset row coefficient, obtain each row of continuous text contours; obtain the current contour horizontal coordinate and the adjacent contour horizontal coordinate according to each row of continuous text contours; perform a difference calculation between the current contour horizontal coordinate and the adjacent contour horizontal coordinate to obtain the contour horizontal coordinate difference; when the contour horizontal coordinate difference is less than the preset interval coefficient, merge the text contour corresponding to the current contour horizontal coordinate and the contour corresponding to the adjacent contour horizontal coordinate to obtain the target horizontal coordinate contour; generate row grouping structure text data according to the each row of continuous text contours and the target horizontal coordinate contour; and obtain the corresponding blank column according to the row grouping structure text data.
[0136] In one embodiment, the determination module 30 is further used to obtain a column number set based on the row grouping structure text data; extract the highest number of columns in the column number set; obtain the total number of title columns of the target format non-line pipeline file to be converted; iterate the highest number of columns to obtain the upper left horizontal coordinate of the target column; obtain the upper right horizontal coordinate of the next column of the title row based on the total number of title columns; when the upper left horizontal coordinate of the target column is greater than the upper right horizontal coordinate of the next column of the title row, the target column is treated as a blank column.
[0137] In one embodiment, the generation module 40 is also used to mark the blank columns according to a preset marking strategy; complete the marked blank columns by using a target agreed value; generate target structure text data based on the blank columns after column completion and the row grouping structure text data; and write the target structure data into the target line file according to the target data writing strategy.
[0138] Other embodiments of the device for converting a non-line stream file of the present invention or implementation methods thereof may refer to the above-mentioned method embodiments, which will not be repeated here.
[0139] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0140] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0141] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, an integrated platform workstation, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0142] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for converting a non-line stream file, characterized in that: The method for converting the non-line stream file comprises the following steps: The target format non-linear stream file to be converted is segmented into pages to obtain the target non-linear stream picture; Performing structural element recognition on the target non-line flowing water picture to obtain a continuous text outline; Determine the row grouping structure character data and blank columns according to the preset height coefficient, the preset row coefficient, the preset spacing coefficient and the continuous character outline; Generate target structured text data according to the row grouping structured text data and the blank columns, and write the target structured text data into a target line file according to a target data writing strategy; The step of determining the row grouping structure text data and blank columns according to the preset height coefficient, the preset row coefficient, the preset spacing coefficient and the continuous text contour comprises: Obtaining a corresponding continuous character contour height according to the continuous character contour; Screening the continuous character contours whose height is less than the preset height coefficient; Sort the filtered continuous text contours according to the target order relationship; Obtaining the corresponding current contour ordinate and previous contour ordinate according to the sorted continuous text contours; The current contour ordinate and the previous contour ordinate are subtracted to obtain a contour ordinate difference; When the difference in the vertical coordinates of the contour is greater than a preset line coefficient, the contours of each line of continuous text are obtained; Obtaining the current contour horizontal coordinate and the adjacent contour horizontal coordinate according to the continuous text contours of each line; Performing a difference calculation on the current contour horizontal coordinate and the adjacent contour horizontal coordinate to obtain a contour horizontal coordinate difference; When the difference between the horizontal coordinates of the contours is less than a preset interval coefficient, the text contour corresponding to the horizontal coordinate of the current contour and the contour corresponding to the horizontal coordinate of the adjacent contour are merged to obtain the target horizontal coordinate contour; Generate row grouping structured text data according to the continuous text contours of each row and the target horizontal coordinate contour; A corresponding blank column is obtained according to the row grouping structure text data.
2. The method for converting a non-line stream file as claimed in claim 1, characterized in that: The target format wireless stream file to be converted is segmented into pages to obtain a target wireless stream picture, including: The target format non-lined stream file to be converted is segmented into pages to obtain a plurality of pages of the target format non-lined stream file; Scaling the plurality of pages of target format non-line stream files according to a target multiple; Convert several pages of zoomed target format lineless stream files to obtain target lineless stream pictures.
3. The method for converting a non-line stream file as claimed in claim 2, characterized in that: Before the target format non-line stream file to be converted is segmented into pages to obtain a plurality of pages of target format non-line stream files, the method further comprises: Receive the electronic wireless serial number file sent by the terminal device; Scanning the electronic version of the wireless stripe flow file to obtain a wireless stripe flow scan file; When the wireless stripe-streamed scan file meets the preset text recognition defect, the wireless stripe-streamed scan file is used as a wireless stripe-streamed file in a target format to be converted.
4. The method for converting a non-line stream file as claimed in claim 1, characterized in that: The step of performing structural element recognition on the target non-line flow picture to obtain a continuous text outline includes: Perform channel splitting on the target non-linear stream image to obtain a target number of channels; Extract the red channel of the target number of channels; Binarization is performed on the target wireless line flow picture according to the red channel to obtain a binary wireless line flow picture with black background and white characters; According to the OTSU threshold, the structure element recognition is performed on the binary wireless flow picture with white characters on a black background through the OpenCV image algorithm to obtain a continuous text contour.
5. The method for converting a non-line stream file as claimed in claim 1, characterized in that: The step of obtaining a corresponding blank column according to the row grouping structure text data includes: Obtaining a column number set according to the row grouping structure text data; Extract the highest number of columns in the column number set; Get the total number of header columns of the target format non-line stream file to be converted; Iterate the highest number of columns to obtain the upper left horizontal coordinate of the target column; Obtain the upper right horizontal coordinate of the next column of the title row according to the total number of title columns; When the upper left horizontal coordinate of the target column is greater than the upper right horizontal coordinate of the next column of the title row, the target column is regarded as a blank column.
6. The method for converting a non-line stream file according to any one of claims 1 to 5, characterized in that: The step of generating target structured text data according to the row grouping structured text data and the blank columns, and writing the target structured text data into a target line file according to a target data writing strategy includes: Marking the blank columns according to a preset marking strategy; Complete the blank columns after the mark using the target agreed value; Generate target structured text data according to the blank columns after column completion and the row grouping structured text data; The target structure data is written into the target line file according to the target data writing strategy.
7. A device for converting a non-line stream file, characterized in that: The conversion device of the non-line stream file comprises: A segmentation module is used to segment the target format non-linear flow file to be converted into pages to obtain a target non-linear flow picture; A recognition module, used for performing structural element recognition on the target non-line water flow picture to obtain a continuous text outline; A determination module, used for determining the row grouping structure text data and blank columns according to a preset height coefficient, a preset row coefficient, a preset spacing coefficient and the continuous text contour; A generating module, used for generating target structured text data according to the row grouping structured text data and the blank columns, and writing the target structured data into a target line file according to a target data writing strategy; The determination module is also used to obtain the corresponding continuous text contour height according to the continuous text contour; screen the continuous text contour whose continuous text contour height is less than the preset height coefficient; sort the screened continuous text contours according to the target order relationship; obtain the corresponding current contour ordinate and previous contour ordinate according to the sorted continuous text contour; perform difference calculation between the current contour ordinate and the previous contour ordinate to obtain the contour ordinate difference; when the contour ordinate difference is greater than the preset row coefficient, obtain each row of continuous text contours; obtain the current contour horizontal coordinate and the adjacent contour horizontal coordinate according to each row of continuous text contours; perform difference calculation between the current contour horizontal coordinate and the adjacent contour horizontal coordinate to obtain the contour horizontal coordinate difference; when the contour horizontal coordinate difference is less than the preset interval coefficient, merge the text contour corresponding to the current contour horizontal coordinate and the contour corresponding to the adjacent contour horizontal coordinate to obtain the target horizontal coordinate contour; generate row grouping structure text data according to the each row of continuous text contours and the target horizontal coordinate contour; and obtain the corresponding blank column according to the row grouping structure text data.
8. A device for converting a non-line stream file, characterized in that: The wireless stripe file conversion device includes: a memory, a processor, and a wireless stripe file conversion program stored in the memory and executable on the processor, wherein the wireless stripe file conversion program is configured to implement a wireless stripe file conversion method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a conversion program for a wireless stream file, and when the conversion program for a wireless stream file is executed by a processor, the conversion method for a wireless stream file according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Stream file analysis processing method and device, equipment and storage medium
CN111125026A
Method for improving bank flow identification accuracy
CN113158755A