Scanning and recognition method, storage medium, electronic device and scanning device
By dividing and adjusting the recognition area on the scanning device, the problem of inaccurate recognition of existing scanning pens when scanning small fonts and multiple lines of text is solved, and the accurate identification of multiple pieces of information is achieved and the user experience is improved.
Patent Information
- Application Number
- CN202110763025.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-06
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-07-06
AI Technical Summary
When existing scanning pens scan multiple lines of text with small font sizes, it is difficult to accurately identify specific lines of text, resulting in poor recognition experience.
By setting the recognition mode on the scanning device, dividing the scanning area according to preset rules, determining the effective image area, and adjusting the identification area according to the information entry situation in the area to ensure accurate identification of valid information.
When multiple messages are scanned, effective information can be accurately identified, improving the user experience.
Smart Images

Figure CN113469165B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of scanning technology, and in particular to a scanning recognition method, a computer-readable storage medium, an electronic device, and a scanning device. Background Art
[0002] The scanning pen uses scanning technology to directly scan images, tables or printed fonts into the pen for storage, or directly transfer them to a computer for storage, reading, editing and modification. The scanning pen generally includes a shell and a camera module located inside the shell. The camera module recognizes and scans the scanned object on the scanning medium such as photos and books through the scanning window opened on the shell to complete the input of the scanned object.
[0003] At present, although the scanning pen can complete a single line (such as Figure 1 ) or multi-line text (such as Figure 2 However, when scanning and entering a single line of text, if the text on the scanned text is too small (such as Figure 2 As shown), it will cause multiple lines of text to be scanned and entered at the same time, making it impossible to accurately recognize a specific line of target text, resulting in a poor recognition experience and inconvenient application. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems in the related art to a certain extent. To this end, the first object of the present invention is to provide a scanning and recognition method, which can accurately recognize valid information from multiple pieces of information when scanning, thereby improving user experience.
[0005] A second object of the present invention is to provide a computer-readable storage medium.
[0006] A third objective of the present invention is to provide an electronic device.
[0007] A fourth objective of the present invention is to provide a scanning device.
[0008] To achieve the above-mentioned purpose, the first aspect of the present invention proposes a scanning and recognition method, comprising the following steps: acquiring a recognition mode of a scanning device and an image to be recognized obtained by scanning the scanning device; when the recognition mode is a first mode, dividing the scanning area of the scanning device according to preset rules; determining a valid image area based on the divided areas and the information entered within the divided areas; and using the information recognized from the valid image area as target information.
[0009] According to an embodiment of the present invention, the method further includes: when the recognition mode is the second mode, using information recognized from the entire area corresponding to the image to be recognized as target information.
[0010] According to one embodiment of the present invention, dividing the scanning area of the scanning device according to preset rules includes: determining a central axis of the scanning area of the scanning device, wherein the central axis is parallel to a scanning direction of the scanning device; and extending toward both sides in sequence with the central axis as the center, dividing the scanning area of the scanning device into level 1 to level N areas in sequence, wherein the i+1 level area covers the i level area, 1≤i+1≤N, and N is an integer greater than 1.
[0011] Furthermore, determining the valid image area according to the divided areas and the information input in the divided areas includes: judging the level 1 to level N areas in sequence; and taking the area where the input information is first judged not to be empty as the valid image area.
[0012] Furthermore, the method further includes: when no valid image area can be determined from the divided areas, controlling the scanning device to issue a prompt message to indicate recognition failure.
[0013] According to one embodiment of the present invention, determining the valid image area based on the divided areas and the information entered in the divided areas includes: judging the level 1 to level N areas in turn; determining the area that is first judged to have entered information that is not empty, and recording it as the target area; judging whether the amount of information entered from the target area is greater than a preset threshold; if so, adjusting the target area, and using the adjusted target area as the valid image area, wherein the adjusted target area satisfies: the information entered from the adjusted target area is not empty, and the amount of information entered from the adjusted target area is less than or equal to the preset threshold; if not, using the target area as the valid image area.
[0014] According to the scanning and recognition method of the embodiment of the present invention, when the recognition mode is the first mode, the image to be recognized is divided into regions according to a preset rule, and the valid image region is determined according to the divided regions and the information input in the divided regions, and then the information recognized in the valid image region is used as the target information. Therefore, when multiple pieces of information are scanned, valid information can be accurately recognized from them, thereby improving the user experience.
[0015] To achieve the above-mentioned purpose, a second aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the scanning and recognition method is implemented.
[0016] To achieve the above-mentioned purpose, a third aspect of the present invention proposes an electronic device, comprising a memory, a processor and a computer program stored in the memory, wherein when the computer program is executed by the processor, the scanning and recognition method is implemented.
[0017] To achieve the above-mentioned purpose, the fourth aspect of the present invention proposes a scanning device, comprising: a shell, on which a scanning window is provided; a camera module, which is arranged in the shell and is used to perform scanning through the scanning window; and the electronic device, which is used to identify valid information from the information scanned and entered by the camera module.
[0018] Furthermore, the scanning device is a scanning pen.
[0019] According to the scanning device of the embodiment of the present invention, when scanning multiple pieces of information, valid information can be accurately identified therefrom, thereby improving user experience.
[0020] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of a scanning pen scanning a single line of text in the prior art;
[0022] Figure 2 It is a schematic diagram of a scanning pen scanning multiple lines of text in the prior art;
[0023] Figure 3 is a flowchart of a scanning and recognition method according to an embodiment of the present invention;
[0024] Figure 4 is a schematic diagram of dividing an image to be recognized into regions according to an embodiment of the present invention;
[0025] Figure 5 It is a schematic structural diagram of a scanning device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0027] Please refer to the following Figure 3-5 The scanning and recognition method, storage medium, electronic device and scanning device according to the embodiments of the present invention are described.
[0028] Figure 3 FIG. 1 is a flow chart of a scanning and recognition method according to an embodiment of the present invention. Figure 3 As shown, the scanning and recognition method comprises the following steps:
[0029] S101, obtaining a recognition mode of a scanning device and an image to be recognized scanned by the scanning device.
[0030] Specifically, a mode selection instruction can be input through the control panel or control buttons of the scanning device, and then a recognition mode corresponding to the mode selection instruction can be obtained; and an image to be recognized can be obtained through a camera module on the scanning device, wherein the recognition mode of the scanning device may include a first mode and a second mode, the first mode may be a partial information recognition mode, and the second mode may be a full information recognition mode.
[0031] S102: When the recognition mode is the first mode, divide the scanning area of the scanning device into regions according to a preset rule.
[0032] Specifically, when the recognition mode is the first mode (such as the partial information recognition mode, that is, if multiple lines of text are scanned, only part of the text is used as valid information), the scanning area of the scanning device is divided into regions according to a preset rule. Figure 2 When the recognition mode is the first mode, one or two lines of text need to be determined from the three lines of text scanned as valid information.
[0033] In one example of the present invention, dividing the scanning area of a scanning device according to preset rules may include: determining a central axis of the scanning area of the scanning device, wherein the central axis is parallel to a scanning direction of the scanning device; extending toward both sides in sequence with the central axis as the center, dividing the scanning area of the scanning device into level 1 to level N areas in sequence, wherein the i+1 level area covers the i level area, 1≤i+1≤N, and N is an integer greater than 1.
[0034] Specifically, see Figure 4 When the recognition mode is the first mode, the camera module can scan multiple lines of text. At this time, the central axis of the scanning area of the scanning device can be determined, and the scanning area of the scanning device can be divided into a primary area, a secondary area, a tertiary area, ..., N-level areas, where the secondary area covers the primary area, the tertiary area covers the secondary area, ..., the i+1-level area covers the i-level area, where 1≤i+1≤N, and N is an integer greater than 1. Figure 4 The value of N is 3. It should be noted that the central axis is parallel to the scanning direction of the scanning device. Therefore, by classifying the scanning area of the camera module, the scanned information is classified, which can facilitate the subsequent accurate acquisition of the scanned content.
[0035] In another example of the present invention, the scanning and recognition method may further include: when the recognition mode is the second mode (such as the full information recognition mode), using the information recognized from the entire area corresponding to the image to be recognized as the target information.
[0036] Specifically, when the recognition mode is the second mode, the information recognized from the entire area corresponding to the image to be recognized is directly used as the target information. Figure 2 When the recognition mode is the second mode, the scanned three lines of text can be directly used as target information.
[0037] S103: Determine a valid image area according to the divided areas and the information input in the divided areas.
[0038] As an example, determining the valid image area based on the divided areas and the information entered in the divided areas may include: judging the level 1 to level N areas in turn; and taking the area where the information entered is first judged not to be empty as the valid image area.
[0039] Specifically, see Figure 4 , the validity level of the information scanned in each area is: the first-level area takes precedence over the second-level area, the second-level area takes precedence over the third-level area, ..., the i-1 level area is superior to the i-level area. Therefore, the first-level area, the second-level area, the third-level area, ..., the N-level area are judged in turn, and the area where the information entered is not empty is first judged as the valid image area. For example, when the first-level area and the second-level area enter complete information content at the same time, the first-level area is used as the valid image area; when the i-1 level area and the i-level area enter complete information content at the same time, the i-1 level area is used as the valid image area. Therefore, by dividing the information entry situation in the area, the valid image area is obtained, which can ensure the accuracy of valid information recognition.
[0040] Furthermore, the scanning and identification method may also include: when no valid image area can be determined from the divided areas, controlling the scanning device to issue a prompt message to indicate that the identification has failed.
[0041] Specifically, when no valid image area can be determined from the divided areas, for example, the font size is too large and the scanning device cannot scan and enter any line of text, a prompt message can be issued through a display screen or a buzzer set on the scanning device, and the prompt message indicates that the recognition failed. Thus, the user can easily know that the scanning device has failed to recognize. Optionally, after the recognition fails, the camera module can be controlled to expand the scanning range so as to recognize valid information.
[0042] As another example, determining the valid image area based on the divided areas and the information entered in the divided areas may also include: judging the level 1 to level N areas in turn; determining the area where the information entered is first judged to be not empty, and recording it as the target area; judging whether the amount of information entered from the target area is greater than a preset threshold; if so, adjusting the target area, and using the adjusted target area as the valid image area, wherein the adjusted target area satisfies: the information entered from the adjusted target area is not empty, and the amount of information entered from the adjusted target area is less than or equal to the preset threshold; if not, using the target area as the valid image area.
[0043] Specifically, the first-level area, the second-level area, the third-level area, ..., the N-level area are judged in turn, and the area where the information entered is not empty is determined first, and recorded as the target area. For example: when the information content of the first-level area and the second-level area is entered at the same time, the first-level area is used as the target area; when the information content of the i-1-level area and the i-level area is entered at the same time, the i-1-level area is used as the target area. When the amount of information entered from the target area is greater than the preset threshold, for example, a line of text needs to be recognized, but the first-level area recognizes two lines of text, then the target area needs to be adjusted, such as moving one or both sides of the target area to the central axis until only one line of text can be recognized, and the adjusted target area is used as the effective image area, wherein the adjusted target area must meet two conditions: the information entered from the adjusted target area is not empty, and the amount of information entered from the adjusted target area is less than or equal to the preset threshold; when the amount of information entered from the target area is less than or equal to the preset threshold, the target area is used as the effective image area. Among them, the preset threshold can be set as needed.
[0044] S104: Use the information identified from the effective image area as target information.
[0045] In summary, the valid image area can be determined according to the divided area and the information input in the divided area, and the target information can be further obtained. Therefore, the scanning and recognition method can accurately identify valid information when scanning multiple pieces of information, thereby improving the user experience.
[0046] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned scanning and recognition method is implemented.
[0047] The computer-readable storage medium of an embodiment of the present invention, when the computer program corresponding to the above-mentioned scanning and identification method is stored thereon and executed by a processor, can accurately identify valid information from multiple pieces of information when scanning, thereby improving the user experience.
[0048] An embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, the above-mentioned scanning and recognition method is implemented.
[0049] The electronic device of the embodiment of the present invention can accurately identify valid information from multiple pieces of information when the computer program corresponding to the above-mentioned scanning and identification method stored in its memory is executed by the processor, thereby improving the user experience.
[0050] Figure 5 FIG. 1 is a schematic diagram of the structure of a scanning device according to an embodiment of the present invention. Figure 5 As shown, the scanning device 100 includes: a housing 10, on which a scanning window is provided; a camera module 20, which is disposed in the housing 10 and is used to perform scanning work through the scanning window; and an electronic device 30 of the above embodiment, which is used to identify valid information from the information scanned and recorded by the camera module 20. The scanning device 100 can be a scanning pen.
[0051] Specifically, a mode selection instruction can be input through the control panel or control buttons of the scanning device, and then a recognition mode corresponding to the mode selection instruction can be obtained; and the camera module 20 can perform a scanning operation in the scanning window to obtain an image to be recognized, wherein the recognition mode of the scanning device may include a first mode and a second mode.
[0052] In an example of the present invention, when the recognition mode is the first mode (such as scanning multiple lines of text), the scanning area of the scanning device is divided into regions according to a preset rule.
[0053] Specifically, see Figure 4 , when the recognition mode is the first mode (such as partial information recognition mode, that is, if multiple lines of text are scanned, only part of the text is used as valid information), the scanning area of the scanning device can be divided into primary area, secondary area, tertiary area, ..., N-level area by determining the central axis of the scanning area of the scanning device and extending it to both sides in sequence with the central axis as the center, and the secondary area covers the primary area, the tertiary area covers the secondary area, ..., the i+1 level area covers the i level area, wherein 1≤i+1≤N, and N is an integer greater than 1. It should be noted that the central axis is parallel to the scanning direction of the scanning device. Thus, by hierarchically dividing the scanning area of the camera module 20, the scanned and entered information is hierarchically divided, so as to accurately obtain the valid information in the scanned content later.
[0054] In another example of the present invention, when the recognition mode is the second mode (such as the full information recognition mode), the information recognized from the entire area corresponding to the image to be recognized is directly used as the target information.
[0055] As an example, according to the divided areas and the information input situation in the divided areas, the valid image area is determined, which may include: the validity level of the information scanned in each area is: the first-level area is prior to the second-level area, the second-level area is prior to the third-level area, ..., the i-1 level area is superior to the i-level area, therefore, the first-level area, the second-level area, the third-level area, ..., the N-level area are judged in turn, and the area where the information input is first judged to be not empty is taken as the valid image area, for example, when the first-level area and the second-level area have completed the information content input at the same time, the first-level area is taken as the valid image area; when the i-1 level area and the i-level area have completed the information content input at the same time, the i-1 level area is taken as the valid image area. Thus, the valid image area is obtained by the information input situation in the divided areas.
[0056] Furthermore, when no valid image area can be determined from the divided areas, for example, the font size is too large and the scanning device cannot scan and enter any line of text, a prompt message can be issued through a display screen or a buzzer set on the scanning device, and the prompt message indicates that the recognition failed. Thus, the user can easily know that the scanning device has failed to recognize. Optionally, after the recognition fails, the camera module can be controlled to expand the scanning range so as to recognize valid information.
[0057] As another example, determining the valid image area according to the divided areas and the information input in the divided areas may also include: judging the primary area, the secondary area, the tertiary area, ..., the N-level area in sequence, determining the area where the information input is not empty first, and recording it as the target area. For example: when the primary area and the secondary area have completed the information input at the same time, the primary area is used as the target area; when the i-1 level area and the i level area have completed the information input at the same time, the i-1 level area is used as the target area. When the amount of information input from the target area is greater than the preset threshold, for example, a line of text needs to be recognized, but the primary area recognizes two lines of text, then the target area needs to be adjusted, such as moving one or both sides of the target area to the central axis until only one line of text can be recognized, and the adjusted target area is used as the valid image area, wherein the adjusted target area must meet two conditions: the information input from the adjusted target area is not empty, and the amount of information input from the adjusted target area is less than or equal to the preset threshold; when the amount of information input from the target area is less than or equal to the preset threshold, the target area is used as the valid image area. Among them, the preset threshold can be set as needed.
[0058] Further, the electronic device 30 may use information identified from the effective image area as target information.
[0059] In summary, the valid image area can be determined according to the divided area and the information input in the divided area, and the target information can be further obtained. Therefore, the scanning device can accurately identify the valid information when scanning multiple pieces of information, thereby improving the user experience.
[0060] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0061] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0062] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0063] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0064] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0065] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0066] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0067] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A scanning and recognition method, characterized in that: The following steps are involved: Acquire a recognition mode of a scanning device and an image to be recognized scanned by the scanning device; When the recognition mode is the first mode, the scanning area of the scanning device is divided into regions according to a preset rule, including: determining a central axis of the scanning area of the scanning device, wherein the central axis is parallel to a scanning direction of the scanning device; taking the central axis as the center and extending toward both sides in sequence, the scanning area of the scanning device is divided into first to N levels of regions in sequence, wherein the i+1 level region covers the i level region, 1≤i+1≤N, and N is an integer greater than 1; Determine the effective image area according to the divided area and the information input in the divided area; using information identified from the effective image area as target information; Determining the valid image area according to the divided areas and the information input in the divided areas includes: Judge the level 1 to level N areas in turn; Determine the area where the input information is first determined to be not empty, and record it as the target area; Determining whether the amount of information entered from the target area is greater than a preset threshold; If yes, the target area is adjusted, and the adjusted target area is used as the valid image area, wherein the adjusted target area satisfies: the information entered from the adjusted target area is not empty, and the amount of information entered from the adjusted target area is less than or equal to the preset threshold; If not, the target area is used as the effective image area.
2. The scanning and recognition method according to claim 1, characterized in that: The method further comprises: When the recognition mode is the second mode, information recognized from the entire area corresponding to the image to be recognized is used as target information.
3. The scanning and recognition method according to claim 1, characterized in that: Determining the valid image area according to the divided areas and the information input in the divided areas includes: Judge the level 1 to level N areas in turn; The area where the input information is first determined to be not empty is taken as the valid image area.
4. The scanning and recognition method according to claim 3, characterized in that: The method further comprises: When no valid image area can be determined from the divided areas, the scanning device is controlled to issue a prompt message to indicate recognition failure.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the scanning and recognition method according to any one of claims 1 to 4 is implemented.
6. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: When the computer program is executed by the processor, the scanning and recognition method according to any one of claims 1 to 4 is implemented.
7. A scanning device, characterized in that: include: A housing, wherein a scanning window is provided on the housing; A camera module, the camera module is disposed in the housing and is used to perform scanning through the scanning window; The electronic device as described in claim 6 is used to identify valid information from the information scanned and recorded by the camera module.
8. The scanning device according to claim 7, characterized in that The scanning device is a scanning pen.
Citation Information
Patent Citations
Scanning-mode-adjustable text collection method and scanning device
CN102360427A
Determining method and determining device for slidable display area of spreadsheet document
CN105159570A
Scanning pen control method, electronic equipment and readable storage medium
CN112153236A