A method, system, terminal device and storage medium for scanning page title
By using deep learning target detection technology to automatically identify and frame question areas in scanned pages, it solves the problems of slow speed and high cost of manual question framing in the existing technology, and achieves fast and accurate automatic question framing on scanned pages.
Patent Information
- Application Number
- CN202010598280.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-28
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-06-28
AI Technical Summary
In the existing technology, the process of scanning page frame questions requires a lot of manual intervention, is slow and costly, and is difficult to process large-scale images.
Deep learning target detection technology is used to identify the column lines and title serial numbers in the scanned page, automatically locate and frame the question area, and judge the column lines based on the angle of the vertical line to realize automated question framing.
It realizes fast and automatic question framing on scanned pages, reduces labor costs, improves processing efficiency, and has the ability to accurately identify multiple types of title serial numbers and column lines, avoiding question framing failures caused by identification errors.
Smart Images

Figure CN111767830B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, system, terminal device and storage medium for framing titles of scanned pages. Background Art
[0002] Currently, APPs with question search functions are loved by many students as auxiliary tools for learning. In order to improve the accuracy of question search, increasing the number of questions in the background question bank is a very direct and effective way.
[0003] The main process of storing questions is: select books, test papers, journals, etc., put them into a special scanner, scan and obtain electronic images of each page of the book, then select the question areas of each level, such as the big questions and small questions in the picture, send the question areas of each level to OCR recognition (optical character recognition), and finally store them. In this process, selecting questions at all levels is generally done manually, which is obviously too slow for processing millions of pictures, and the labor cost is too high. Summary of the invention
[0004] The purpose of the present invention is to provide a data processing method, system, terminal device and storage medium, which can realize the simultaneous use of shuttle boxes and tabs without the need for repeated code writing, which is conducive to the development of front-end functional modules and fundamentally improves the work efficiency of front-end development, and is of great significance.
[0005] The technical solution provided by the present invention is as follows:
[0006] The present invention provides a method for scanning a page title, comprising the following steps:
[0007] Get a scanned page;
[0008] Identify and locate the serial numbers of each level of titles in the scanned pages;
[0009] Identify and locate the left and right sides of the title in the scanned page;
[0010] According to the identified and located title numbers of each level, locate the top and bottom of each title;
[0011] The questions for each topic are framed according to the left side, the right side, the top side and the bottom side.
[0012] Furthermore, the identifying and locating the left and right sides of the title in the scanned page includes: identifying and locating the column line, and then determining the left side and / or the right side based on the identified and located column line; the column line is identified and located based on the following method:
[0013] When the scanning page is scanned, the vertical line of the image and the vertical line of the scanned page are fixed at an angle greater than zero, and then the title numbers of the same level arranged vertically in the scanning page are connected to form an oblique line segment, and then it is determined whether the slope of the oblique line segment is less than a preset value. If so, there is a column dividing line, otherwise there is no column dividing line.
[0014] Furthermore, the identifying and locating the left and right sides of the title in the scanned page includes: identifying and locating the column dividing line, specifically:
[0015] The solid and dotted lines in the scanned page are detected using the target detection method in deep learning. If the circumscribed rectangle of the detected solid and dotted lines satisfies the requirement that the height is greater than the preset height and the aspect ratio is greater than the preset ratio, it indicates that a column dividing line exists.
[0016] Furthermore, after completing the step of framing each question, the following steps are also included:
[0017] The area selected by the title frame is fine-tuned, including deleting blank areas in the area selected by the title frame, removing headers and footers, and removing binding lines.
[0018] The present invention also provides a frame title system for scanning pages, comprising the following modules:
[0019] A data acquisition module, used to acquire a scanned page;
[0020] The title number processing module is used to identify and locate the title numbers of each level in the scanned page;
[0021] The left-right processing module is used to identify and locate the left and right sides of the questions in the scanned page;
[0022] The upper and lower processing module locates the upper and lower sides of each title according to the identified and located title numbers at each level;
[0023] The frame title module is used to frame the titles of each question based on the left side, the right side, the top side and the bottom side.
[0024] Furthermore, the identifying and locating the left and right sides of the title in the scanned page includes: identifying and locating the column line, and then determining the left side and / or the right side based on the identified and located column line; the column line is identified and located based on the following method:
[0025] When the scanning page is scanned, the vertical line of the image and the vertical line of the scanned page are fixed at an angle greater than zero, and then the title numbers of the same level arranged vertically in the scanning page are connected to form an oblique line segment, and then it is determined whether the slope of the oblique line segment is less than a preset value. If so, there is a column dividing line, otherwise there is no column dividing line.
[0026] Furthermore, the identifying and locating the left and right sides of the title in the scanned page includes: identifying and locating the column dividing line, specifically:
[0027] The solid and dotted lines in the scanned page are detected using the target detection method in deep learning. If the circumscribed rectangle of the detected solid and dotted lines satisfies the requirement that the height is greater than the preset height and the aspect ratio is greater than the preset ratio, it indicates that a column dividing line exists.
[0028] Furthermore, after completing the frame title module, the following modules are also included:
[0029] The fine-tuning module is used to fine-tune the area selected by the title frame, including deleting one or more of the blank areas in the area selected by the title frame, removing the header and footer, and removing the binding line.
[0030] Through the method, system, terminal device and storage medium for framing titles of scanned pages provided by the present invention, automatic recognition of title numbers and column dividing lines is achieved, and then framing titles for each title is achieved based on the recognition results, with a high degree of automation, fast speed and low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The following will explain the preferred implementation mode in a clear and understandable manner with reference to the accompanying drawings, and further explain the above-mentioned characteristics, technical features, advantages and implementation methods of a scanning page framing method, system, terminal device and storage medium.
[0032] Figure 1 It is a flow chart of an embodiment of a method for scanning a page frame title of the present invention;
[0033] Figure 2 It is a frame title effect diagram of an embodiment of a frame title method for scanning pages of the present invention;
[0034] Figure 3 It is a frame title effect diagram of another embodiment of a frame title method for scanning pages of the present invention;
[0035] Figure 4 is a flow chart of another embodiment of a method for scanning a page title of the present invention;
[0036] Figure 5 It is a structural schematic diagram of another embodiment of a method for scanning a page title of the present invention;
[0037] Figure 6 It is a structural schematic diagram of an embodiment of a frame title system for scanning pages of the present invention;
[0038] Figure 7 It is a structural schematic diagram of another embodiment of a frame title system for scanning pages of the present invention;
[0039] Figure 8 It is a structural schematic diagram of another embodiment of a frame title system for scanning pages of the present invention;
[0040] Fig. 9 It is a structural schematic diagram of an embodiment of a terminal device of the present invention. DETAILED DESCRIPTION
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.
[0042] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".
[0043] One embodiment of the present invention, as Figure 1 As shown, a method for scanning a page title includes:
[0044] S100, obtaining a scanned page.
[0045] The main process of storing questions: select books, test papers, journals, etc., put them into a special scanner, scan and obtain the electronic scanned pages corresponding to each page of the book. For example, many conventional printing racks are equipped with scanning devices, which are scanned by the printer and then sent to the designated memory for storage for subsequent frame questions. In some embodiments of the present invention, when scanning, it can also be scanned by a dedicated scanning device, and a page turning device can be further designed to turn pages during scanning. After each page is scanned, the scanner controls the page turning device to turn the scanned book, test paper, journal, etc., and then scan the next page.
[0046] S200, identifying and locating the title serial numbers at each level in the scanned page.
[0047] Select books, test papers, journals, etc. Each question generally has a corresponding title number, and each title number may have a lower-level title number, or even level 3, level 4, etc. This embodiment adopts the recognition form of level 3 titles, with a total of 40 categories, as follows:
[0048] First level heading: Classes 1-10 correspond to: 1, 2, 3, ... 10
[0049] Classes 11-20 correspond to: Ⅰ, Ⅱ, Ⅲ, ... Ⅹ
[0050] Secondary heading: Classes 21-30 correspond to: 1, 2, 3, ... 10
[0051] Level 3 headings: Classes 31-40 correspond to: (1), (2), (3), … (10) respectively.
[0052] S300, identifying and locating the left side and the right side of the title in the scanned page.
[0053] The left and right sides of the question can usually be distinguished by the text in the leftmost column and the rightmost column in the scanned page. In order to avoid misidentification, for example, scratches that may exist in the page are judged as text, or shadows caused by light during scanning are judged as text. When these misjudged texts are located at the leftmost or rightmost of the normal text in the scanned page, it may cause misjudgment of the left and right sides. When the left and right sides of the question are identified and located, the approximate range of the left side and / or the right side of the question is pre-set. When the left and right sides of the question are not within this approximate range, they are not considered, and the text in the leftmost column and the rightmost column of the remaining part is used to identify and locate the left and right sides of the question.
[0054] When there are column lines in the scanned page, the column lines should also be taken into consideration. The column lines should be used to divide the left side and / or the title, and at the same time, the text in the aforementioned leftmost column and rightmost column should be distinguished. For example, when there is a vertical column line in the middle area of the page, for the title on the left side of the column line, the left side of the title should be divided according to the text in the leftmost column, and the right side of the title should be divided according to the column line. For the title on the right side of the column line, the left side of the title should be divided according to the column line, and the right side of the title should be divided according to the text in the rightmost column.
[0055] This embodiment provides a method for identifying and locating column lines, which is as follows: using the target detection method in deep learning to detect solid lines and dotted lines in the scanned page, if the circumscribed rectangles of the detected solid lines and dotted lines meet the requirement that the height is greater than a preset height and the aspect ratio is greater than a preset ratio, it indicates that there is a column line, such as Figure 2 As shown, the height of the circumscribed rectangular frame S of the column dividing line is generally higher, which is higher than the rectangular frame formed by the title content in the page. The circumscribed rectangular frame S is generally narrower, and the aspect ratio (height divided by width) is greater than the aspect ratio of the rectangular frame formed by the title content in the page, and is also greater than the aspect ratio of the rectangular frame formed by the scanning area of the gap between two pages of books, journals, etc. The method of target detection in deep learning can be, for example, a convolutional neural network algorithm.
[0056] S400, locating the top and bottom of each title according to the identified and located title numbers of each level.
[0057] The upper side of the title is the row where the title number is located, and the lower side of the title is the area above the row where the next title number is located.
[0058] S500, frame each question based on the left side, the right side, the top side and the bottom side.
[0059] When framing a question, the smallest unit of the framing question can be determined according to actual conditions. For example, in this embodiment, only the question areas corresponding to the highest two levels of title numbers are framed, that is, if there are question numbers of level one, level two, and level three, the question areas corresponding to the question numbers of level one and below will be selected to form a question frame, and the question areas corresponding to the question numbers of level two and below will form a question frame of the next level. If the question has only one level of title number, the question area corresponding to the title signal will be directly framed, that is, the question has only one question frame. For details, please refer to Figure 3 The frame title effect diagram shown.
[0060] After completing the framed question, the selected areas of the framed question are sent to OCR recognition to obtain the specific content of the question and finally put it into the database.
[0061] The technical problem to be solved by the present invention is to provide a method for framing titles for scanned pages. The present invention does not require a large amount of equipment and personnel investment. It only needs to run the logic on an ordinary computer to quickly and automatically complete batch framing titles. It has the ability to recognize the layout, and is particularly good at recognizing column lines, avoiding the failure of framing titles for the entire page due to recognition errors. It has the ability to recognize multiple types of title numbers, can complete the framing of multi-level titles, and can meet most usage requirements.
[0062] One embodiment of the present invention, as Figure 4 As shown, a method for scanning a page title includes:
[0063] S010, obtaining a scanned page;
[0064] S020, identifying and locating the serial numbers of titles at all levels in the scanned pages;
[0065] S030, identifying and locating the left side and the right side of the title in the scanned page;
[0066] S040, locating the upper side and the lower side of each title according to the identified and located title numbers of each level;
[0067] S050, framing each question based on the left side, the right side, the upper side, and the lower side;
[0068] S060, determine whether there are scanned pages to be framed, if yes, return to step S010 to continue processing the next scanned page, if no, the framed question is ended.
[0069] Specifically, this embodiment is an improved embodiment corresponding to the above embodiment. For the same parts, please refer to the above embodiment and will not be described in detail here.
[0070] Compared with the above embodiment, in this embodiment, a different implementation method from that of the previous embodiment is adopted in step S030, which is specifically embodied as follows.
[0071] The identification and positioning method of the column dividing line provided in this embodiment is as follows: when the scanning page is scanned, the longitudinal line of the image and the longitudinal line of the scanned page are fixed at an angle greater than zero, and then the title serial numbers of the same level arranged vertically in the scanning page are connected to form an oblique line segment, and then it is determined whether the slope of the oblique line segment is less than a preset value, if so, there is a column dividing line, otherwise there is no column dividing line. The above-mentioned fixed angle greater than zero can be, for example, when scanning, so that the longitudinal line of the scanned page is at a certain angle clockwise or counterclockwise relative to the longitudinal line of the entire image, and this angle is generally selected within 5 degrees.
[0072] Meanwhile, compared with the previous embodiment, this embodiment adds step S060, which determines whether there are scanned pages to be framed, and if so, returns to step S010 to continue processing the next scanned page, and if not, the framed questioning is finished. In this way, batch framed questions for scanned pages can be completed, for example, batch framed questions for a book, journal, or test paper can be completed each time.
[0073] One embodiment of the present invention, as Figure 5 As shown, a method for scanning a page title includes:
[0074] S001, obtain a scanned page;
[0075] S002, identifying and locating the title serial numbers at all levels in the scanned page;
[0076] S003, identifying and locating the left and right sides of the title in the scanned page;
[0077] S004, locating the upper and lower sides of each title according to the identified and located title numbers of each level;
[0078] S005, frame each question according to the left side, the right side, the upper side and the lower side;
[0079] S006. Fine-tune the area selected by the title frame, including deleting one or more of the blank area in the area selected by the title frame, removing the header and footer, and removing the binding line.
[0080] Specifically, this embodiment is Figure 1 For the improved embodiments corresponding to the illustrated embodiments, the same parts are specifically referred to the above embodiments, which will not be described in detail here.
[0081] In this embodiment, relative to Figure 1 For the embodiment shown, step S006 is added. Step S005 realizes fine-tuning of the area framed by the title, that is, further fine-tuning of the content in the title frame to achieve a better title frame effect. Deleting the blank area preferably deletes the area on the outside of the title frame, that is, the blank area on the outside of the title area. Other blank areas in the title can also be further deleted, such as the blank area around the illustration. Headers, footers and binding lines may affect subsequent OCR recognition. Deleting them in step S006 can reduce OCR misrecognition.
[0082] One embodiment of the present invention, as Figure 6 As shown, a frame title system for scanning pages includes a data acquisition module 100, a title number processing module 200, a left-right processing module 300, an up-down processing module 400, and a frame title module 500.
[0083] The data acquisition module 100 is used to acquire a scanned page.
[0084] The main process of storing questions: select books, test papers, journals, etc., put them into a special scanner, scan and obtain the electronic scanned pages corresponding to each page of the book. For example, many conventional printing racks are equipped with scanning devices, which are scanned by the printer and then sent to the designated memory for storage for subsequent frame questions. In some embodiments of the present invention, when scanning, it can also be scanned by a dedicated scanning device, and a page turning device can be further designed to turn pages during scanning. After each page is scanned, the scanner controls the page turning device to turn the scanned book, test paper, journal, etc., and then scan the next page.
[0085] The title number processing module 200 is used to identify and locate the title numbers of each level in the scanned page.
[0086] Select books, test papers, journals, etc. Each question generally has a corresponding title number, and each title number may have a lower-level title number, or even level 3, level 4, etc. This embodiment adopts the recognition form of level 3 titles, with a total of 40 categories, as follows:
[0087] First level heading: Classes 1-10 correspond to: 1, 2, 3, ... 10
[0088] Classes 11-20 correspond to: Ⅰ, Ⅱ, Ⅲ, ... Ⅹ
[0089] Secondary heading: Classes 21-30 correspond to: 1, 2, 3, ... 10
[0090] Level 3 headings: Classes 31-40 correspond to: (1), (2), (3), … (10) respectively.
[0091] The left-right processing module 300 is used to identify and locate the left and right sides of the title in the scanned page.
[0092] The left and right sides of the question can usually be distinguished by the text in the leftmost column and the rightmost column in the scanned page. In order to avoid misidentification, for example, scratches that may exist in the page are judged as text, or shadows caused by light during scanning are judged as text. When these misjudged texts are located at the leftmost or rightmost of the normal text in the scanned page, it may cause misjudgment of the left and right sides. When the left and right sides of the question are identified and located, the approximate range of the left side and / or the right side of the question is pre-set. When the left and right sides of the question are not within this approximate range, they are not considered, and the text in the leftmost column and the rightmost column of the remaining part is used to identify and locate the left and right sides of the question.
[0093] When there are column lines in the scanned page, the column lines should also be taken into consideration. The column lines should be used to divide the left side and / or the title, and at the same time, the text in the aforementioned leftmost column and rightmost column should be distinguished. For example, when there is a vertical column line in the middle area of the page, for the title on the left side of the column line, the left side of the title should be divided according to the text in the leftmost column, and the right side of the title should be divided according to the column line. For the title on the right side of the column line, the left side of the title should be divided according to the column line, and the right side of the title should be divided according to the text in the rightmost column.
[0094] This embodiment provides a method for identifying and locating column lines, which is as follows: using the target detection method in deep learning to detect solid lines and dotted lines in the scanned page, if the circumscribed rectangles of the detected solid lines and dotted lines meet the requirement that the height is greater than a preset height and the aspect ratio is greater than a preset ratio, it indicates that there is a column line, such as Figure 2 As shown, the height of the circumscribed rectangular frame S of the column dividing line is generally higher, which is higher than the rectangular frame formed by the title content in the page. The circumscribed rectangular frame S is generally narrower, and the aspect ratio (height divided by width) is greater than the aspect ratio of the rectangular frame formed by the title content in the page, and is also greater than the aspect ratio of the rectangular frame formed by the scanning area of the gap between two pages of books, journals, etc. The method of target detection in deep learning can be, for example, a convolutional neural network algorithm.
[0095] The upper and lower processing module 400 is used to locate the upper and lower sides of each title according to the identified and located title numbers of each level.
[0096] The upper side of the title is the row where the title number is located, and the lower side of the title is the area above the row where the next title number is located.
[0097] The title frame module 500 is used to frame the title of each question based on the left side, the right side, the top side and the bottom side.
[0098] When framing a question, the smallest unit of the framing question can be determined according to actual conditions. For example, in this embodiment, only the question areas corresponding to the highest two levels of title numbers are framed, that is, if there are question numbers of level one, level two, and level three, the question areas corresponding to the question numbers of level one and below will be selected to form a question frame, and the question areas corresponding to the question numbers of level two and below will form a question frame of the next level. If the question has only one level of title number, the question area corresponding to the title signal will be directly framed, that is, the question has only one question frame. For details, please refer to Figure 3 The frame title effect diagram shown.
[0099] After completing the framed question, the selected areas of the framed question are sent to OCR recognition to obtain the specific content of the question and finally put it into the database.
[0100] The technical problem to be solved by the present invention is to provide a method for framing titles for scanned pages. The present invention does not require a large amount of equipment and personnel investment. It only needs to run the logic on an ordinary computer to quickly and automatically complete batch framing titles. It has the ability to recognize the layout, and is particularly good at recognizing column lines, avoiding the failure of framing titles for the entire page due to recognition errors. It has the ability to recognize multiple types of title numbers, can complete the framing of multi-level titles, and can meet most usage requirements.
[0101] One embodiment of the present invention, as Figure 7 As shown, a frame title system for scanning pages includes: a data acquisition module 010, a question number processing module 020, a left-right processing module 030, an up-down processing module 040, a frame title module 050 and a judgment module 060.
[0102] The data acquisition module 010 is used to acquire a scanned page;
[0103] The title number processing module 020 is used to identify and locate the title numbers of each level in the scanned page;
[0104] The left-right processing module 030 is used to identify and locate the left and right sides of the title in the scanned page;
[0105] The upper and lower processing module 040 is used to locate the upper and lower sides of each title according to the identified and located title numbers of each level;
[0106] The frame title module 050 is used to frame the title of each question according to the left side, the right side, the upper side and the lower side;
[0107] The judgment module 060 is used to judge whether there are scanned pages to be framed. If yes, it returns to the data acquisition module 010 to continue processing the next scanned page. If no, the framed question is ended.
[0108] Specifically, this embodiment is an improved embodiment corresponding to the above embodiment. For the same parts, please refer to the above embodiment and will not be described in detail here.
[0109] Compared with the above-mentioned embodiment, the left-right processing module 030 in this embodiment adopts a different implementation method from that in the previous embodiment, which is specifically embodied as follows.
[0110] The identification and positioning method of the column dividing line provided in this embodiment is as follows: when the scanning page is scanned, the longitudinal line of the image and the longitudinal line of the scanned page are fixed at an angle greater than zero, and then the title serial numbers of the same level arranged vertically in the scanning page are connected to form an oblique line segment, and then it is determined whether the slope of the oblique line segment is less than a preset value, if so, there is a column dividing line, otherwise there is no column dividing line. The above-mentioned fixed angle greater than zero can be, for example, when scanning, so that the longitudinal line of the scanned page is at a certain angle clockwise or counterclockwise relative to the longitudinal line of the entire image, and this angle is generally selected within 5 degrees.
[0111] Meanwhile, compared with the previous embodiment, the present embodiment adds a judgment module 060 to judge whether there are scanned pages to be framed, if yes, then return to the data acquisition module 010 to continue processing the next scanned page, if no, then the framed questioning is finished. In this way, batch framed questions for scanned pages can be completed, for example, batch framed questions for a book, journal or test paper can be completed each time.
[0112] One embodiment of the present invention, as Figure 8 As shown, a frame title system for scanning pages includes:
[0113] Data acquisition module 001, question number processing module 002, left-right processing module 003, top-bottom processing module 004, frame question module 005 and fine-tuning module 006.
[0114] The data acquisition module 001 is used to acquire a scanned page;
[0115] The title number processing module 002 is used to identify and locate the title numbers of each level in the scanned page;
[0116] The left-right processing module 003 is used to identify and locate the left and right sides of the title in the scanned page;
[0117] The upper and lower processing module 004 is used to locate the upper and lower sides of each title according to the identified and located title numbers of each level;
[0118] The frame title module 005 is used to frame the title of each question according to the left side, the right side, the upper side and the lower side;
[0119] The fine-tuning module 006 is used to fine-tune the area selected by the title, including deleting one or more of the blank areas in the area selected by the title, removing the header and footer, and removing the binding line.
[0120] Specifically, this embodiment is Figure 6 For the improved embodiments corresponding to the illustrated embodiments, the same parts are specifically referred to the above embodiments, which will not be described in detail here.
[0121] In this embodiment, relative to Figure 6 For the embodiment shown, a fine-tuning module 006 is added, and the frame title module 005 realizes fine-tuning of the area framed by the frame title, that is, further fine-tuning of the content in the frame title to achieve a better frame title effect. Deleting the blank area is preferably deleting the area on the outside of the frame title, that is, the blank area on the outside of the title area, and other blank areas in the title can also be further deleted, such as the blank area around the illustration. The header, footer and binding line may affect the subsequent OCR recognition. Deleting them in step S006 can reduce OCR misrecognition.
[0122] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned program modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program units or modules to complete all or part of the functions described above. The program modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a processing unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software program unit. In addition, the specific names of the program modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
[0123] One embodiment of the present invention, as Fig. 9 As shown, a terminal device 100 includes a processor 110 and a memory 120, wherein the memory 120 is used to store a computer program; the processor 110 is used to execute the computer program stored in the memory 120 to implement the above Figure 1-5 The frame title method of scanning pages in any corresponding method embodiment.
[0124] The terminal device 100 may be a desktop computer, a notebook, a PDA, a tablet computer, a mobile phone, a human-computer interaction screen, etc. The terminal device 100 may include, but is not limited to, a processor 110 and a memory 120. Those skilled in the art will appreciate that Fig. 9 This is only an example of the terminal device 100 and does not constitute a limitation on the terminal device 100. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the terminal device 100 may also include an input / output interface, a display device, a network access device, a communication bus, a communication interface, etc. The communication interface and the communication bus may also include an input / output interface, wherein the processor 110, the memory 120, the input / output interface and the communication interface communicate with each other through the communication bus. The memory 120 stores a computer program, and the processor 110 is used to execute the computer program stored in the memory 120 to implement the above Figure 1-5 The frame title method of scanning pages in any corresponding method embodiment.
[0125] The processor 110 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0126] The memory 120 may be an internal storage unit of the terminal device 100, such as a hard disk or memory of the terminal device. The memory may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Furthermore, the memory 120 may include both an internal storage unit of the terminal device 100 and an external storage device. The memory 120 is used to store the computer program and other programs and data required by the terminal device 100. The memory may also be used to temporarily store data that has been output or is to be output.
[0127] The communication bus is a circuit that connects the elements described and implements transmission between these elements. For example, the processor 110 receives commands from other elements through the communication bus, decrypts the received commands, and performs calculations or data processing according to the decrypted commands. The memory 120 may include program modules, such as a kernel, middleware, an application programming interface (API) and an application. The program module may be composed of software, firmware or hardware, or at least two of them. The input / output interface forwards commands or data entered by the user through the input / output interface (such as a sensor, keyboard, touch screen). The communication interface connects the terminal device 100 to other network devices, user devices, and networks. For example, the communication interface can be connected to the network via wired or wireless connection to connect to other external network devices or user devices. Wireless communication may include at least one of the following: wireless fidelity (WiFi), Bluetooth (BT), near field communication technology (NFC), global satellite positioning system (GPS) and cellular communication, etc. Wired communication may include at least one of the following: universal serial bus (USB), high-definition multimedia interface (HDMI), asynchronous transmission standard interface (RS-232), etc. The network may be a telecommunication network and a communication network. The communication network may be a computer network, the Internet, the Internet of Things, or a telephone network. The terminal device 100 may be connected to the network via a communication interface, and the protocol used by the terminal device 100 to communicate with other network devices may be supported by at least one of an application, an application programming interface (API), a middleware, a kernel, and a communication interface.
[0128] One embodiment of the present invention is a storage medium, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operations performed by the corresponding embodiment of the above-mentioned method for scanning pages. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a read-only compact disk (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device.
[0129] They can be implemented with program codes executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0130] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0131] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed with hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0132] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or 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 interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0133] 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.
[0134] In addition, each functional unit in each embodiment of the present application 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. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0135] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by sending instructions to related hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes: computer program code, and the computer program code can be in the form of source code, data item code, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0136] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.
Claims
1. A method for framing a title on a scanned page. It is characterized in that The steps include: Get a scanned page; Identify and locate the serial numbers of each level of titles in the scanned pages; Identify and locate the left and right sides of the title in the scanned page, including: Identify and locate the column dividing line, and then determine the left side and the right side correspondingly based on the identified and located column dividing line; According to the identified and located title numbers of each level, locate the top and bottom of each title; According to the left side, the right side, the upper side and the lower side, frame the questions for each question; Among them, the recognition and positioning of column lines are specifically: using the target detection method in deep learning to detect solid lines and dotted lines in the scanned page. If the circumscribed rectangle of the detected solid lines and dotted lines satisfies the requirement that the height is greater than the preset height and the aspect ratio is greater than the preset ratio, it indicates that a column line exists.
2. The method for framing a title on a scanned page according to claim 1, It is characterized in that The dividing line is identified and located based on the following method: When the scanning page is scanned, the vertical line of the image and the vertical line of the scanned page are fixed at an angle greater than zero, and then the title numbers of the same level arranged vertically in the scanning page are connected to form an oblique line segment, and then it is determined whether the slope of the oblique line segment is less than a preset value. If so, there is a column dividing line, otherwise there is no column dividing line.
3. The method for framing a title on a scanned page according to claim 1 or 2, It is characterized in that After completing the steps of setting the frame of each question, the method further includes the following steps: The area selected by the title frame is fine-tuned, including deleting blank areas in the area selected by the title frame, removing headers and footers, and removing binding lines.
4. A frame title system for scanning pages, It is characterized in that Includes the following modules: A data acquisition module, used to acquire a scanned page; The title number processing module is used to identify and locate the title numbers of each level in the scanned page; The left and right processing module is used to identify and locate the left and right sides of the questions in the scanned page. The method comprises: identifying and locating a column dividing line, and then determining the left side and the right side corresponding to the column dividing line identified and located; The upper and lower processing module locates the upper and lower sides of each title according to the identified and located title numbers at each level; A frame title module, used for framing each question according to the left side, the right side, the top side and the bottom side; The left and right processing module is also used to detect solid lines and dotted lines in the scanned page using a target detection method in deep learning. If the circumscribed rectangle of the detected solid lines and dotted lines satisfies a height greater than a preset height and a height-to-width ratio greater than a preset ratio, it indicates that a column dividing line exists.
5. The frame title system for scanning pages according to claim 4, It is characterized in that The identifying and locating the left and right sides of the title in the scanned page includes: identifying and locating the column line, and then determining the left and right sides based on the identified and located column line; the column line is identified and located based on the following method: When the scanning page is scanned, the vertical line of the image and the vertical line of the scanned page are fixed at an angle greater than zero, and then the title numbers of the same level arranged vertically in the scanning page are connected to form an oblique line segment, and then it is determined whether the slope of the oblique line segment is less than a preset value. If so, there is a column dividing line, otherwise there is no column dividing line.
6. The title frame system for scanning pages according to claim 4 or 5, It is characterized in that The frame title module also includes the following modules: The fine-tuning module is used to fine-tune the area selected by the title frame, including deleting one or more of the blank areas in the area selected by the title frame, removing the header and footer, and removing the binding line.
7. A terminal device, It is characterized in that It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor is used to execute the computer program stored in the memory to implement the operations performed by the scanning page title method as described in any one of claims 1 to 3.
8. A storage medium, It is characterized in that The storage medium stores at least one instruction, which is loaded and executed by the processor to implement the operation performed by the method for scanning page titles as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Method and system for labeling and identifying subject area based on edge location
CN109325401A
Photographing box question searching method and device, terminal and storage medium
CN110503087A
Question selection method and device, terminal equipment and readable storage medium
CN110837833A
Method and apparatus for discriminating between documents in batch scanned document files
US6735335B1
