Scanning processing method and related device
By employing specific image processing modes in single-line and multi-line scanning methods, the problem of poor performance in existing scanning processes is solved, and image acquisition and processing are effectively improved.
Patent Information
- Application Number
- CN202511153979.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-14
AI Technical Summary
Existing scanning methods are ineffective and cannot meet application requirements.
Different image processing modes are adopted for different scanning modes, including single-line scanning mode and multi-line scanning mode. Different image processing modes are configured for each mode. For example, in single-line scanning mode, stitching and line cutting are performed directly, while in multi-line scanning mode, image correction, stitching and line cutting are performed. Based on the pre-configured correspondence between scanning mode and image processing mode, the target scanning mode is determined and processed.
It enables effective image acquisition and processing under different scanning modes, improves processing results, and meets practical application needs.
Smart Images

Figure CN120956843A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent recognition technology, and in particular to a scanning processing method and related apparatus. Background Technology
[0002] In some scenarios, it is necessary to use electronic devices to scan and acquire images, and then process the acquired images.
[0003] For example, in information retrieval scenarios, electronic devices with scanning and query functions (such as dictionary pens) are needed to scan the medium to collect images, process the collected images to obtain text, and then query and obtain relevant information about the text (such as translation results, pronunciation, meaning, etc.).
[0004] Current scanning methods involve acquiring images during a sliding scan and then directly stitching, cropping, and performing text recognition on the acquired images. However, these methods are ineffective and fail to meet application requirements. Summary of the Invention
[0005] In view of this, this application provides a scanning processing method and related apparatus to solve the problem that the current scanning processing methods are ineffective and cannot meet application requirements. The technical solution is as follows:
[0006] A scanning processing method, applied to an electronic device, the scanning processing method comprising:
[0007] When the entry conditions for the target scanning mode are met, the target scanning mode is entered, and images are acquired in the target scanning mode. The target scanning mode is one of a first scanning mode and a second scanning mode, and the scanning ranges of the first scanning mode and the second scanning mode are different.
[0008] Based on the pre-configured correspondence between scanning modes and image processing modes, the image processing mode corresponding to the target scanning mode is determined, wherein the image processing mode corresponding to the first scanning mode is different from the image processing mode corresponding to the second scanning mode.
[0009] The image acquired under the target scanning mode is processed using the image processing mode corresponding to the target scanning mode.
[0010] In one possible implementation, the scanning range of the first scanning mode is smaller than the scanning range of the second scanning mode;
[0011] The image processing mode corresponding to the second scanning mode includes a correction operation for the acquired image, while the image processing mode corresponding to the first scanning mode does not include a correction operation for the acquired image.
[0012] In one possible implementation, the first scanning mode is a single-line scanning mode, and the second scanning mode is a multi-line scanning mode;
[0013] The image processing mode corresponding to the single-line scanning mode is the first image processing mode, and the processing operations of the first image processing mode include: image stitching, line cutting, and text recognition in sequence.
[0014] The image processing mode corresponding to the multi-line scanning mode is the second image processing mode. The processing operations of the second image mode include, in sequence: image correction, image stitching, line cutting, and text recognition.
[0015] In one possible implementation, the entry condition for the target scanning mode is:
[0016] An operation was triggered upon detecting the user's selection of the target scanning mode.
[0017] Alternatively, a voice command from the user selecting the target scanning mode may be detected;
[0018] Alternatively, the state of the electronic device is detected to meet the conditions for selecting the target scanning mode.
[0019] In one possible implementation, after entering the target scanning mode, the method further includes:
[0020] Output indication information to indicate entering the target scanning mode.
[0021] In one possible implementation, if the target mode is a first scanning mode, then after determining the image processing mode corresponding to the target scanning mode, and before processing the image acquired in the target scanning mode using the image processing mode corresponding to the target scanning mode, the method further includes:
[0022] Whether to process the image using the first image processing mode is determined through user interaction;
[0023] If it is determined through user interaction that the first image processing mode is not used to process the image, then the second image processing mode is used to process the image acquired in the first scanning mode.
[0024] A second aspect of this application provides a dictionary pen, comprising: a scanning unit and a processing unit, wherein the scanning unit has a first scanning mode and a second scanning mode, and the scanning range of the first scanning mode and the second scanning mode are different;
[0025] The scanning unit is used to enter the target scanning mode when the entry conditions of the target scanning mode are met, and to acquire images in the target scanning mode, wherein the target scanning mode is one of a first scanning mode and a second scanning mode;
[0026] The processing unit is configured to determine the image processing mode corresponding to the target scanning mode based on a pre-configured correspondence between scanning modes and image processing modes, and to process the image acquired in the target scanning mode using the image processing mode corresponding to the target scanning mode, wherein the image processing mode corresponding to the first scanning mode is different from the processing mode corresponding to the second scanning mode.
[0027] A third aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0028] The memory is used to store computer programs;
[0029] The processor is used to execute the computer program so that the electronic device can implement any of the scanning processing method steps described above.
[0030] The fourth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to perform the steps of any of the above-described scanning processing methods.
[0031] The fifth aspect of this application discloses a computer program product comprising computer-readable instructions that, when executed on an electronic device, cause the electronic device to perform the steps of any of the scanning processing methods described above.
[0032] By employing the above technical solution, the scanning processing method provided in this application can enter the target scanning mode when the entry conditions for the target scanning mode are met, acquire images in the target scanning mode, and determine the image processing mode corresponding to the target scanning mode based on a pre-configured correspondence between scanning modes and image processing modes. Then, the image acquired in the target scanning mode is processed using the corresponding image processing mode. The scanning processing method provided in this application can acquire images under different scanning modes. Furthermore, corresponding image processing modes are pre-configured for different scanning modes. Therefore, after entering the target scanning mode, the image acquired under the target scanning mode can be processed using the image processing mode corresponding to the target scanning mode. The scanning processing method provided in this application can acquire and process images under different scanning modes, and different image processing modes can be used to process images acquired under different scanning modes. Thus, good processing results can be obtained for images acquired under different scanning modes, meeting the needs of practical applications. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0034] Figure 1 A schematic flowchart illustrating the scanning processing method provided in an embodiment of this application;
[0035] Figure 2 This is an example of an image obtained by correcting and then stitching together images acquired in multi-line scanning mode, as provided in an embodiment of this application.
[0036] Figure 3 This is an example of an image obtained by correcting, stitching, and cutting lines of an image acquired in a multi-line scanning mode, as provided in an embodiment of this application.
[0037] Figure 4 A schematic diagram of the structure of the dictionary pen provided in the embodiments of this application. Detailed Implementation
[0038] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0039] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0040] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0041] In recent years, with the rapid development of artificial intelligence, some electronic devices have become increasingly intelligent. Taking dictionary pens as an example, dictionary pens combine machine vision technology and paperless dictionary technology, integrating the traditional paper book word lookup function into a pen. Compared with traditional dictionary word lookup, it has the advantages of fast speed, high accuracy and convenient use.
[0042] For electronic devices with scanning and query functions (such as dictionary pens), the process of information query includes: acquiring images with a sliding scanning motion, stitching the acquired images, cutting the stitched images into lines, recognizing the text lines obtained from the line cutting process, obtaining the recognized text, and after obtaining the recognized text, querying relevant information about the recognized text (such as pronunciation, translation results, etc.).
[0043] In the process of developing this application, the inventors discovered that current electronic devices (such as dictionary pens) employ a single scanning method with poor results, failing to meet application requirements. Therefore, this application provides a scanning method with better performance.
[0044] The scanning processing method provided in this application will be described below through the following embodiments.
[0045] Please see Figure 1 The diagram illustrates a flowchart of a scanning processing method provided in an embodiment of this application. This scanning processing method can be applied to electronic devices (such as dictionary pens, literacy pens, translation pens, and other electronic devices with scanning and query functions). The method may include:
[0046] Step S101: When the entry conditions for the target scanning mode are met, enter the target scanning mode and acquire images in the target scanning mode.
[0047] In this embodiment, the electronic device has a first scanning mode and a second scanning mode. The target scanning mode is one of the first scanning mode and the second scanning mode. The scanning ranges of the first scanning mode and the second scanning mode are different.
[0048] Optionally, after entering the target scanning mode, an instruction message can be output to indicate that the target scanning mode has been entered. The method of outputting the instruction message can be, but is not limited to, playing the instruction message by voice, displaying the instruction message on the screen of the electronic device, etc. By outputting the instruction message, the user can know whether the desired scanning mode has been entered.
[0049] Step S102: Based on the pre-configured correspondence between scanning modes and image processing modes, determine the image processing mode corresponding to the target scanning mode.
[0050] In this embodiment, corresponding image processing modes are pre-configured for the first scanning mode and the second scanning mode, that is, the correspondence between the scanning mode and the image processing mode is pre-configured.
[0051] The pre-configured scanning modes and image processing modes correspond to each other as shown in the table below, which includes the first scanning mode, the second scanning mode, the image processing mode corresponding to the first scanning mode, and the image processing mode corresponding to the second scanning mode.
[0052] Table 1. Correspondence between scanning modes and image processing modes
[0053] Scanning mode Image processing mode corresponding to scanning mode First scanning mode First image processing mode Second scanning mode Second image processing mode
[0054] It should be noted that in this embodiment, the image processing mode corresponding to the first scanning mode is different from the image processing mode corresponding to the second scanning mode, that is, the first image processing mode is different from the second image processing mode.
[0055] If the target scanning mode is the first scanning mode, then based on the correspondence between the scanning mode and the image processing mode, the image processing mode corresponding to the first scanning mode can be determined as the first image processing mode. If the target scanning mode is the second scanning mode, then based on the correspondence between the scanning mode and the image processing mode, the image processing mode corresponding to the second scanning mode can be determined as the second image processing mode.
[0056] Step S103: Process the image acquired in the target scanning mode using the image processing mode corresponding to the target scanning mode.
[0057] If the target scanning mode is the first scanning mode, then the image processing mode corresponding to the first scanning mode, i.e., the first image processing mode, is used to process the image acquired in the first scanning mode; if the target scanning mode is the second scanning mode, then the image processing mode corresponding to the second scanning mode, i.e., the second image processing mode, is used to process the image acquired in the second scanning mode.
[0058] The first image processing mode is an image processing mode set for the first scanning mode. Using the first image processing mode to process images acquired in the first scanning mode can achieve better processing results. The second image processing mode is an image processing mode set for the second scanning mode. Using the image processing mode corresponding to the second scanning mode, i.e., the second image processing mode, to process images acquired in the second scanning mode can achieve better processing results.
[0059] The scanning processing method provided in this application embodiment can enter the target scanning mode when the entry conditions of the target scanning mode are met, acquire images in the target scanning mode, and determine the image processing mode corresponding to the target scanning mode based on a pre-configured correspondence between scanning modes and image processing modes. Then, the image acquired in the target scanning mode is processed using the image processing mode corresponding to the target scanning mode. The scanning processing method provided in this application embodiment can acquire images under different scanning modes. Furthermore, corresponding image processing modes are pre-configured for different scanning modes. Therefore, after entering the target scanning mode, the image acquired in the target scanning mode can be processed using the image processing mode corresponding to the target scanning mode. The image processing mode corresponding to the target scanning mode is a processing mode set specifically for the target scanning mode. Processing the image acquired in the target scanning mode using the image processing mode corresponding to the target scanning mode can achieve better processing results. In summary, the scanning processing method provided in this application embodiment can acquire images under different scanning modes and process images acquired under different scanning modes using different image processing modes. Thus, good processing results can be obtained for images acquired under different scanning modes, which can meet the needs of practical applications.
[0060] In the above embodiments, the target scanning mode is entered when the entry conditions for the target scanning mode are met. In some embodiments of this application, the entry conditions for the target scanning mode are described.
[0061] In one possible implementation, the entry condition for the target scanning mode can be triggered by detecting the user's selection of the target scanning mode. In this implementation, the user selects the scanning mode by operating the electronic device.
[0062] Optionally, the electronic device may be equipped with a physical button for selecting the scanning mode. The user can select the scanning mode by operating the physical button. When the user operates the physical button to select the target scanning mode, the user's selection of the target scanning mode is detected, and the target scanning mode can be entered.
[0063] Optionally, the electronic device's interface can be equipped with virtual buttons for selecting scanning modes. Users can select the scanning mode by operating the virtual buttons. For example, a user can click the virtual button to select the first scanning mode, or double-click the virtual button to select the second scanning mode. When a user operates the virtual button to select a target scanning mode, the user's selection of the target scanning mode is detected, and the user can then enter the target scanning mode.
[0064] Optionally, a preset scanning mode selection gesture can be provided. Users can select the scanning mode by making a scanning mode selection gesture on the screen of the electronic device. For example, a preset gesture 'a' can be used to select the first scanning mode, and a preset gesture 'b' can be used to select the second scanning mode. When the user makes gesture 'a' on the screen of the electronic device, the user's selection of the first scanning mode is detected, and the device enters the first scanning mode. When the user makes gesture 'b' on the screen of the electronic device, the user's selection of the second scanning mode is detected, and the device enters the second scanning mode.
[0065] Optionally, a preset scanning mode selection action (such as rotating the device 180°) can be made. The user can select the scanning mode by operating the electronic device. For example, the preset action a is to select the first scanning mode (such as rotating the device 90°), and the preset action b is to select the second scanning mode (such as rotating the device 180°). When the user operates the electronic device to perform action a, the user's selection of the first scanning mode is detected, and the device enters the first scanning mode. When the user operates the electronic device to perform action b, the user's selection of the second scanning mode is detected, and the device enters the second scanning mode.
[0066] In another possible implementation, the entry condition for the target scanning mode can be the detection of a voice command from the user selecting the target scanning mode. This implementation also involves the user selecting the scanning mode; however, unlike the previous implementation, in this implementation, the user does not need to manually operate the electronic device to select the scanning mode, but rather selects the scanning mode via voice.
[0067] In both of the above implementation methods, the scanning mode is selected by the user. In another possible implementation method, the state of the electronic device can be detected, and the scanning mode can be automatically selected according to the state of the electronic device.
[0068] Specifically, it can detect whether the state of the electronic device meets the conditions for selecting the target scanning mode. If the state of the electronic device meets the conditions for selecting the target scanning mode, then the target scanning mode is entered. That is, the entry condition for the target scanning mode can also be that the state of the electronic device meets the conditions for selecting the target scanning mode.
[0069] For example, the condition for selecting the first scanning mode can be that the sliding speed of the electronic device is greater than a speed threshold, and the condition for selecting the second scanning mode can be that the sliding speed of the electronic device is less than a speed threshold. That is, the sliding speed of the electronic device can be detected. If the sliding speed of the electronic device is detected to be greater than the speed threshold, the first scanning mode is entered. If the sliding speed of the electronic device is detected to be less than the speed threshold, the second scanning mode is entered. In this way, the automatic selection of the scanning mode can be realized.
[0070] In some embodiments of this application, the scanning range of the first scanning mode is smaller than the scanning range of the second scanning mode. For example, the first scanning mode is a single-line scanning mode, and the second scanning mode is a multi-line scanning mode.
[0071] The image processing mode corresponding to the second scanning mode may include correction operations for the acquired image, while the image processing mode corresponding to the first scanning mode may not include correction operations for the acquired image.
[0072] The scanning processing method provided in this application will be further described below, taking the first scanning mode as a single-line scanning mode and the second scanning mode as a multi-line scanning mode as an example.
[0073] Step a1: When the entry conditions for target scanning mode are met, enter target scanning mode and acquire images in target scanning mode.
[0074] The target scanning mode is one of the single-line scanning mode and the multi-line scanning mode. In the single-line scanning mode, one line of data is captured at a time, while in the multi-line scanning mode, multiple lines of data are captured at a time.
[0075] Optionally, after entering the target scanning mode, an indication message can be output to indicate whether the target scanning mode has been entered. If the single-line scanning mode has been entered, an indication message can be output to indicate whether the single-line scanning mode has been entered. If the multi-line scanning mode has been entered, an indication message can be output to indicate whether the multi-line scanning mode has been entered. Through this indication message, the user can know whether the desired scanning mode has been entered.
[0076] Step a2: Based on the pre-configured correspondence between scanning modes and image processing modes, determine the image processing mode corresponding to the target scanning mode.
[0077] The pre-configured scanning modes and image processing modes correspond to each other as shown in the table below, which includes single-line scanning mode, multi-line scanning mode, image processing mode corresponding to single-line scanning mode, and image processing mode corresponding to multi-line scanning mode.
[0078] Table 2. Correspondence between scanning modes and image processing modes
[0079] Scanning mode Image processing mode corresponding to scanning mode Single-line scan mode First image processing mode Multi-line scanning mode Second image processing mode
[0080] In this embodiment, the image processing mode corresponding to the single-line scanning mode is different from the image processing mode corresponding to the multi-line scanning mode, that is, the first image processing mode is different from the second image processing mode.
[0081] The image processing operation corresponding to the first scanning mode can sequentially include image stitching, line cutting, and text recognition. The image processing operation corresponding to the second scanning mode can sequentially include image correction, image stitching, line cutting, and text recognition.
[0082] If the target scanning mode is a single-line scanning mode, the image processing mode corresponding to the pre-configured scanning mode and image processing mode can be determined as the first image processing mode (image stitching, line cutting, text recognition) based on the pre-configured scanning mode and image processing mode correspondence. If the target scanning mode is a multi-line scanning mode, the image processing mode corresponding to the multi-line scanning mode can be determined as the second image processing mode (image correction, image stitching, line cutting, text recognition) based on the pre-configured scanning mode and image processing mode correspondence.
[0083] It should be noted that when electronic devices scan, the angle between the camera's normal and the medium causes trapezoidal distortion in the image content captured by the camera. In particular, the text closer to the edge of the scanning window tilts outward, causing the text near the two sides of the scanning window to have a figure-eight distortion. For images captured in single-line scanning mode, since the distortion of the middle line of text is relatively small, it can be directly spliced, cut, and processed for text recognition without affecting the accuracy of text recognition. However, for images captured in multi-line scanning mode, due to the distortion, directly splicing, cutting, and processing for text recognition will lead to some text recognition errors.
[0084] In view of this, this application proposes that for images acquired in single-line scanning mode, image correction processing is skipped, and image stitching, line cutting, and text recognition processing are performed directly. This can reduce computation time and improve response speed. For images acquired in the second scanning mode, image correction processing (such as trapezoidal correction processing) is introduced. Multi-line text usually needs to be globally stitched to ensure contextual coherence. Stitching after correction can avoid misalignment. Image correction processing can solve the distortion problem of multi-line text and improve the accuracy of subsequent stitching, line cutting, and text recognition.
[0085] Step S103: Process the image acquired in the target scanning mode using the image processing mode corresponding to the target scanning mode.
[0086] If the target scanning mode is single-line scanning, the image processing mode corresponding to single-line scanning, i.e., the first image processing mode, is used to process the image acquired in single-line scanning mode. Specifically, the image acquired in single-line scanning mode is directly stitched together, the stitched image is then segmented into lines, and the resulting text lines are subjected to OCR recognition to obtain the recognized text. If the target scanning mode is multi-line scanning, the image processing mode corresponding to multi-line scanning, i.e., the second image processing mode, is used to process the image acquired in multi-line scanning mode. Specifically, the image acquired in multi-line scanning mode is first corrected (e.g., trapezoidal correction), then the corrected image is stitched together, followed by line segmentation, and finally, the resulting text lines are subjected to OCR recognition to obtain the recognized text. Please refer to [link to relevant documentation]. Figure 2 and Figure 3 , Figure 2 An example is shown of an image obtained by correcting images acquired in multi-line scanning mode and then stitching them together. Figure 3 This example illustrates an image obtained after correcting, stitching, and cropping images acquired in multi-line scanning mode. Figure 2 and Figure 3 It can be seen that image correction processing can solve the distortion problem of multi-line text, thereby improving the accuracy of splicing and line cutting.
[0087] After obtaining the identified text, it can be input into a translation model for translation to obtain the translation result. Of course, this embodiment is not limited to translating the identified text after obtaining it. For example, the pronunciation, part of speech, meaning, antonyms, synonyms, source and other information of the identified text can also be obtained by querying the identified text.
[0088] In one possible implementation, when the target scanning mode is a single-line scanning mode, the image processing mode corresponding to the single-line scanning mode, namely the first image processing mode (image stitching, line cutting, text recognition), can be directly used to process the image acquired in the single-line scanning mode.
[0089] In another possible implementation, when the target scanning mode is single-line scanning mode, the user can interact to determine whether to use the image processing mode corresponding to single-line scanning mode, i.e., the first image processing mode, to process the image. If the user determines that the first image processing mode should be used, then the image acquired in single-line scanning mode is processed using the first image processing mode. If the user determines that the first image processing mode should not be used, then the second image processing mode (image correction, image stitching, line cutting, text recognition) is used to process the image acquired in the first scanning mode. This implementation allows the user to select the processing mode for images acquired in single-line scanning mode according to their needs.
[0090] The scanning processing method provided in this application can acquire images in both single-line and multi-line scanning modes. Corresponding image processing modes are pre-configured for each mode. Considering that the processing result of images in single-line scanning mode is unaffected by distortion, correction processing is skipped when processing images acquired in single-line scanning mode. However, the processing result of images in multi-line scanning mode is affected by distortion; therefore, correction processing is performed on images acquired in multi-line scanning mode. The scanning processing method provided in this application can acquire images in both single-line and multi-line scanning modes, and good processing results can be obtained for images acquired in either mode.
[0091] This application also provides a dictionary pen, such as... Figure 4 As shown, the dictionary pen may include a scanning unit 401 and a processing unit 402.
[0092] The scanning unit 401 has a first scanning mode and a second scanning mode, and the scanning ranges of the first scanning mode and the second scanning mode are different.
[0093] The scanning unit 401 is used to enter the target scanning mode when the entry conditions of the target scanning mode are met, and to acquire images in the target scanning mode. The target scanning mode is one of the first scanning mode and the second scanning mode.
[0094] The processing unit 402 is used to determine the image processing mode corresponding to the target scanning mode based on the pre-configured correspondence between scanning modes and image processing modes, and to process the image acquired in the target scanning mode using the image processing mode corresponding to the target scanning mode.
[0095] The image processing mode corresponding to the first scanning mode is different from the processing mode corresponding to the second scanning mode.
[0096] In one possible implementation, the scanning range of the first scanning mode is smaller than that of the second scanning mode.
[0097] The image processing mode corresponding to the second scanning mode includes a correction operation for the acquired image, while the image processing mode corresponding to the first scanning mode does not include a correction operation for the acquired image.
[0098] In one possible implementation, the first scanning mode is a single-line scanning mode, and the second scanning mode is a multi-line scanning mode.
[0099] The image processing mode corresponding to the single-line scanning mode is the first image processing mode. The processing operations of the first image processing mode include: image stitching, line cutting, and text recognition in sequence.
[0100] The image processing mode corresponding to the multi-line scanning mode is the second image processing mode. The processing operations of the second image mode include: image correction, image stitching, line cutting, and text recognition in sequence.
[0101] In one possible implementation, the entry condition for the target scanning mode is: detecting a user's selection trigger operation for the target scanning mode; or detecting a voice command from the user to select the target scanning mode; or detecting that the state of the electronic device meets the conditions for selecting the target scanning mode.
[0102] In one possible implementation, the dictionary pen may also include an information output unit.
[0103] After the scanning unit 401 enters the target scanning mode, the information output unit outputs indication information to indicate that the target scanning mode has been entered.
[0104] In one possible implementation, after determining that the image processing mode corresponding to the target scanning mode is the first image processing mode, the processing unit 402 determines whether to use the first image processing mode to process the image by interacting with the user. If it is determined by interacting with the user to use the first image processing mode to process the image, then the first image processing mode is used to process the image acquired in the first scanning mode. If it is determined by interacting with the user not to use the first image processing mode to process the image, then the second image processing mode is used to process the image acquired in the first scanning mode.
[0105] The dictionary pen provided in this application embodiment can acquire images under different scanning modes. Furthermore, it pre-configures corresponding image processing modes for different scanning modes. Thus, after entering the target scanning mode, it can use the image processing mode corresponding to the target scanning mode to process the image acquired under the target scanning mode. The dictionary pen provided in this application embodiment can acquire images under different scanning modes, and different image processing modes can be used to process the images acquired under different scanning modes. In this way, good processing results can be obtained for images acquired under different scanning modes, which can meet application requirements.
[0106] This application embodiment also provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0107] The memory is used to store computer programs;
[0108] The processor is used to execute the computer program so that the electronic device can implement the steps of the scanning processing method provided in the above embodiments.
[0109] This disclosure also provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the steps of the scanning processing method provided in the above embodiments.
[0110] This application also provides a computer program product, including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to perform the steps of the scanning processing method provided in the above embodiments.
[0111] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0113] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0114] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A scanning processing method, characterized in that, The scanning processing method, applied to electronic devices, includes: When the entry conditions for the target scanning mode are met, the target scanning mode is entered, and images are acquired in the target scanning mode. The target scanning mode is one of a first scanning mode and a second scanning mode, and the scanning ranges of the first scanning mode and the second scanning mode are different. Based on the pre-configured correspondence between scanning modes and image processing modes, the image processing mode corresponding to the target scanning mode is determined, wherein the image processing mode corresponding to the first scanning mode is different from the image processing mode corresponding to the second scanning mode. The image acquired under the target scanning mode is processed using the image processing mode corresponding to the target scanning mode.
2. The scanning processing method according to claim 1, characterized in that, The scanning range of the first scanning mode is smaller than the scanning range of the second scanning mode; The image processing mode corresponding to the second scanning mode includes a correction operation for the acquired image, while the image processing mode corresponding to the first scanning mode does not include a correction operation for the acquired image.
3. The scanning processing method according to claim 1, characterized in that, The first scanning mode is a single-line scanning mode, and the second scanning mode is a multi-line scanning mode; The image processing mode corresponding to the single-line scanning mode is the first image processing mode, and the processing operations of the first image processing mode include: image stitching, line cutting, and text recognition in sequence. The image processing mode corresponding to the multi-line scanning mode is the second image processing mode. The processing operations of the second image mode include, in sequence: image correction, image stitching, line cutting, and text recognition.
4. The scanning processing method according to claim 1, characterized in that, The conditions for entering the target scanning mode are: An operation was triggered upon detecting the user's selection of the target scanning mode. Alternatively, a voice command from the user selecting the target scanning mode may be detected; Alternatively, the state of the electronic device is detected to meet the conditions for selecting the target scanning mode.
5. The scanning processing method according to claim 1, characterized in that, After entering the target scanning mode, the following is also included: Output indication information to indicate entering the target scanning mode.
6. The scanning processing method according to claim 3, characterized in that, If the target mode is a first scanning mode, then after determining the image processing mode corresponding to the target scanning mode, and before processing the image acquired in the target scanning mode using the image processing mode corresponding to the target scanning mode, the method further includes: Whether to process the image using the first image processing mode is determined through user interaction; If it is determined through user interaction that the first image processing mode is not used to process the image, then the second image processing mode is used to process the image acquired in the first scanning mode.
7. A dictionary pen, characterized in that, include: A scanning unit and a processing unit, wherein the scanning unit has a first scanning mode and a second scanning mode, and the scanning range of the first scanning mode and the second scanning mode are different; The scanning unit is used to enter the target scanning mode when the entry conditions of the target scanning mode are met, and to acquire images in the target scanning mode, wherein the target scanning mode is one of the first scanning mode and the second scanning mode; The processing unit is configured to determine the image processing mode corresponding to the target scanning mode based on a pre-configured correspondence between scanning modes and image processing modes, and to process the image acquired in the target scanning mode using the image processing mode corresponding to the target scanning mode, wherein the image processing mode corresponding to the first scanning mode is different from the processing mode corresponding to the second scanning mode.
8. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the scanning processing method steps as described in any one of claims 1 to 6.
9. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to perform the steps of the scanning processing method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to perform the steps of the scanning processing method as described in any one of claims 1 to 6.