Scanning method and electronic device

By dynamically adjusting the tracking time threshold according to the scanning environment parameters, the scanning effect and efficiency issues caused by the fixed tracking time in the automatic scanning mode are solved, and efficient scanning and optimized user experience are achieved in different environments.

CN118233565BActive Publication Date: 2025-09-05HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211644791.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-20
Publication Date
2025-09-05
Estimated Expiration
2042-12-20

AI Technical Summary

Technical Problem

In automatic scanning mode, using a fixed tracking time threshold cannot guarantee optimal scanning effect and efficiency, resulting in a degraded user experience.

Method used

Adjust the tracking time threshold based on different scanning environment parameters, including the number of scans, device stability, and the type and status of the scanned object. By obtaining the environmental parameter values, the tracking time threshold is dynamically adjusted to adapt to different scanning environments.

Benefits of technology

While ensuring the scanning effect, the time required for a single scanning operation is reduced, and the scanning efficiency and user experience are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118233565B_ABST
    Figure CN118233565B_ABST
Patent Text Reader

Abstract

The present application provides a scanning method and electronic device, which relate to the field of image technology; the method is used to solve the problem that if the same tracking time is set, the optimal scanning effect and scanning efficiency cannot be guaranteed, which may lead to a decline in user experience. The method is applied to an electronic device, and the method includes: in automatic scanning mode, after the electronic device detects the scanned object, obtaining the environmental parameter value of the preset scanning environment parameter; the preset scanning environment parameter includes at least one of the number of scans performed by the electronic device since entering the automatic scanning mode, the stability of the electronic device, the type of the scanned object, and the status of the scanned object; the stability of the electronic device is used to indicate whether the electronic device is moving; the electronic device determines the tracking time threshold for performing this scanning operation based on the environmental parameter value; the electronic device starts counting the tracking time; when the tracking time reaches the tracking time threshold, the electronic device performs a scanning operation on the scanned object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image technology, and in particular to a scanning method and electronic equipment. Background Art

[0002] In the automatic scanning mode of a document scanning scenario, the scanning process for a document includes detection, tracking, image acquisition, and correction. Detection and correction rely on specific algorithms and require relatively fixed amounts of time. Tracking time, on the other hand, is typically a preset empirical value (e.g., tracking a document for a certain number of frames or for a certain amount of time).

[0003] In related technologies, the tracking time threshold for automatic scanning mode is typically set to a fixed value. This fixed value is used as the tracking time as long as the automatic scanning mode is in effect, regardless of the environment. However, the content and environment being scanned may vary in different scenarios. Setting a fixed tracking time cannot guarantee optimal scanning results and efficiency, potentially resulting in a poor user experience. Summary of the Invention

[0004] The embodiments of the present application provide a scanning method and an electronic device, which are used to solve the problem that if the same tracking time is set, the optimal scanning effect and scanning efficiency cannot be guaranteed, which may lead to a decline in user experience.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, a scanning method is provided, which is applied to an electronic device and includes:

[0007] In the automatic scanning mode, after detecting the scanned object, the electronic device obtains the environmental parameter value of the preset scanning environment parameter. The preset scanning environment parameter may include: the number of scans performed by the electronic device since the current round of entering the automatic scanning mode, the stability of the electronic device, the type of the scanned object, and at least one of the status of the scanned object; the stability of the electronic device is used to indicate whether the electronic device is moving; the status of the scanned object includes whether the scanned object is held by the user or the scanned object is placed on a stable plane. Then, the electronic device determines the tracking time threshold for performing this scanning operation based on the environmental parameter value. And, the electronic device starts to count the tracking time. When the tracking time reaches the tracking time threshold, the electronic device performs a scanning operation on the scanned object.

[0008] In this solution, different tracking time thresholds are set during the automatic scanning process based on different scanning environments, so that the time required for a single scan in automatic scanning mode varies with the scanning environment. This reduces the time required to perform scanning operations, improves scanning efficiency, and enhances the user experience, while ensuring the scanning effect in the scanning environment.

[0009] In some possible implementations, before the electronic device detects the scanned document, the method further includes: in response to a first event, the electronic device enters an automatic scanning mode, wherein the first event is used to trigger the automatic scanning mode.

[0010] In some possible implementations, before the electronic device detects the scanned object, the method further includes: the electronic device obtaining an initial tracking time. In this implementation, the electronic device determines a tracking time threshold for performing the current scanning operation based on the environmental parameter value. Specifically, the electronic device may include obtaining an adjustment time corresponding to the environmental parameter value; and then adjusting the initial tracking time based on the adjustment time to obtain the tracking time threshold.

[0011] In this solution, an initial tracking time is first set, and then the initial tracking time is adjusted according to different scanning environment parameter values, so that the final tracking time threshold corresponds to the current scanning environment.

[0012] In some possible implementations, the preset scanning environment parameters include: the number of scans, the stability of the electronic device, the type of the scanned document, and the status of the scanned document. In this implementation, the electronic device determines the adjustment time corresponding to the environmental parameter value, which may specifically include: when the number of scans is 0 and the stability of the electronic device is stable, the electronic device determines that the adjustment time corresponding to the environmental parameter value is the first adjustment time. Since the first scan after entering the automatic scanning mode is usually triggered after the user has prepared the scanned document, at this time, if the electronic device is also stable, the user's expectation of the speed of the first scan should be faster. Therefore, in this embodiment, the first adjustment time is less than 0, and the absolute value of the first adjustment time is equal to the initial tracking time, that is, the tracking time is set to 0.

[0013] For the first scan, if the electronic device is unstable, a certain amount of tracking time is required. Only after the electronic device is stable can the scanning operation be performed to obtain an electronic scan that meets the clarity requirements. For non-first scans, the scanned part may need to be updated, and the update of the scanned part may be related to the type and status of the scanned part. At the same time, the stability of the electronic device may still affect the shortest tracking time required to scan to meet the clarity requirements. Therefore, when the number of scans is not 0 and / or the stability of the electronic device is unstable, the electronic device determines that the adjustment time corresponding to the environmental parameter value is the second adjustment time. The second adjustment time is the sum of the third adjustment time corresponding to the number of scans, the fourth adjustment time corresponding to the stability of the electronic device, the fifth adjustment time corresponding to the type of the scanned part, and the sixth adjustment time corresponding to the status of the scanned part. Among them, when the second adjustment time is less than 0, the absolute value of the second adjustment time is less than the initial tracking time to ensure that the tracking time threshold is greater than 0.

[0014] In this embodiment, for the case where the electronic device performs the first scan in this round of automatic scanning mode and the electronic device is stable, the tracking time threshold is set to 0, which can reduce the time required for the first scanning operation and improve the efficiency of the first scan. Thereby improving the scanning efficiency in the automatic scanning mode. For the case where the electronic device is unstable during the first scan, or it is not the first scan, the initial tracking time is adjusted in combination with the adjustment time corresponding to different environmental parameter values, taking into account a variety of environmental parameters that may affect the shortest tracking time required to scan an electronic scan that meets the clarity requirements. Thereby, under the premise of ensuring the scanning effect in the scanning environment, the time required to perform a single scanning operation is reduced, the scanning efficiency of the electronic device in the automatic scanning mode is improved, and the user experience is improved.

[0015] In some possible implementations, when the number of scans is 0, the third adjustment time is less than 0; when the number of scans is not 0, the third adjustment time is greater than or equal to 0. Compared to the first scan, the scanned document may require a certain amount of time to update during a non-first scan. Therefore, when the number of scans is greater than 0, the third adjustment time can be set to be greater than or equal to 0.

[0016] In some possible implementations, when the stability of the electronic device is stable, the fourth adjustment time is less than or equal to 0; when the stability of the electronic device is unstable, the fourth adjustment time is greater than 0.

[0017] In some possible implementations, the stability of the electronic device may include a first level of stability, a second level of stability, a third level of stability, a fourth level of stability, a fifth level of stability, and a sixth level of stability. Six different fourth adjustment times may be set for the six different levels of stability. When the electronic device is in a stable state, the fourth adjustment time may be set to be less than or equal to 0, and the higher the stability, the larger the absolute value of the fourth adjustment time, that is, the more the initial tracking time is reduced, and the smaller the tracking time threshold is. Conversely, when the electronic device is in an unstable state, the fourth adjustment time may be set to be greater than 0, and the more unstable it is, the larger the absolute value of the fourth adjustment time, that is, the more the initial tracking time is increased, and the larger the tracking time threshold is.

[0018] In some possible embodiments, when the type of the scanned document belongs to a preset type, the fifth adjustment time is not equal to 0; the preset types include a first type, a second type, a third type, and a fourth type; the first type includes a type that does not require user operation; the second type includes a type that requires user operation and the scanned document is placed flat; the third type includes a type that requires user operation, the scanned document is not placed flat, and the size of the scanned document is smaller than a preset threshold; the fourth type includes a type that requires user operation, the scanned document is not placed flat, and the size of the scanned document is greater than or equal to a preset threshold; when the type of the scanned document does not belong to a preset type, the fifth adjustment time is equal to 0.

[0019] In this solution, the scanned objects are divided into four types according to the user's expected scanning speed for different types of scanned objects. Different fifth adjustment times can be set for different types of scanned objects. It should be understood that the fifth adjustment time can be greater than 0 or less than 0. That is, according to the type of the scanned object, the initial tracking time can be increased or reduced. In addition, in some cases, the electronic device may not be able to detect the type of the scanned object. In this case, the fifth adjustment time can be set to 0, that is, the initial tracking time is not adjusted according to the type of the scanned object. In this way, different tracking time thresholds can be adjusted according to different types of scanned objects, so that the tracking time thresholds are more in line with the actual user's expectations. Under the premise of ensuring the scanning effect in the scanning environment, the time required to perform a single scanning operation is reduced, the scanning efficiency of the electronic device in the automatic scanning mode is improved, and the user experience is improved.

[0020] In some possible implementations, the first type includes: electronic documents; the second type includes single-page paper documents that are placed flat; the third type includes book pages, single-page paper documents that are not placed flat and whose size is smaller than a preset threshold; the fourth type includes single-page paper documents that are not placed flat and whose size is greater than or equal to a preset threshold.

[0021] In some possible implementations, the state of the scanned object includes whether the scanned object is held by the user, whether the scanned object is placed on a stable plane, the proportion of the scanned object in the viewfinder of the electronic device, the multiple of the scanned object being magnified or reduced in the viewfinder of the electronic device, and the relative angle between the scanned object and the electronic device. In this solution, when the scanned object is held by the user and is not placed on a stable plane, the scanned object may be unstable and prone to shaking. If the scanned object is placed on a stable plane, it means that the scanned object is relatively stable. Therefore, in combination with whether the scanned object is held by the user and whether it is placed on a stable plane, a sixth adjustment time can be set to adjust the initial tracking time. When the proportion of the scanned object in the viewfinder of the electronic device is large, or the multiple of the scanned object being magnified or reduced in the viewfinder of the electronic device is large, a small movement of the scanned object or the electronic device may be magnified as a large movement in the viewfinder of the electronic device. On the contrary, if the scanned part occupies a smaller proportion in the viewfinder of the electronic device, or the magnification or reduction ratio of the scanned part in the viewfinder is smaller, then the movement of the scanned part is more difficult to be captured by the electronic device, or the movement of the electronic device has less impact on the scanned part in the viewfinder. Therefore, different sixth adjustment times can be set according to the magnification or reduction ratio or proportion of the scanned part in the viewfinder. In addition, the relative angle between the scanned part and the electronic device actually represents the relative angle between the plane where the scanned part is located and the plane where the electronic device is located. If the relative angle between the scanned part and the electronic device is large, then the scanned part is usually tilted more in the viewfinder of the electronic device, and at this time, it may take a longer time for the electronic device to track the scanned part. On the contrary, if the relative angle between the scanned part and the electronic device is large, then the time required for the electronic device to track the scanned part should be shorter. Therefore, different sixth adjustment times can also be set in combination with the relative angle between the scanned part and the electronic device.

[0022] In some possible implementations, the electronic device stores a correspondence between different environmental parameter values ​​and adjustment times for preset scanning environment parameters. In this implementation, the electronic device determines the adjustment time corresponding to the environmental parameter value by searching the correspondence for the adjustment time corresponding to the environmental parameter value. In this solution, the electronic device stores the correspondence in advance, and during automatic scanning, the electronic device can search the correspondence for the adjustment time, thereby improving the efficiency of determining the tracking time threshold and, therefore, the efficiency of automatic scanning.

[0023] In some possible implementations, the electronic device determines a tracking time threshold for performing the current scanning operation based on environmental parameter values. Specifically, the electronic device may determine a baseline tracking time based on the type and status of the scanned object; different baseline tracking times correspond to different types and statuses of the scanned object. The electronic device determines a scan count adjustment time based on the number of scans, and determines a stability adjustment time based on the stability of the electronic device. The electronic device then adjusts the baseline tracking time based on the scan count adjustment time and the stability adjustment time to obtain the tracking time threshold.

[0024] In this solution, the electronic device first determines a baseline tracking time based on the type of scanned object. It then adjusts this baseline tracking time based on the number of scans and the stability of the electronic device. This allows different tracking time thresholds to be set for different scanning environments. While ensuring the best scanning results in the given environment, this reduces the time required for scanning operations, improves scanning efficiency, and enhances the user experience.

[0025] In some possible implementations, during the first scan in the current round of automatic scanning mode, the electronic device obtains environmental parameter values ​​of preset scanning environmental parameters when detecting the scanned object.

[0026] In some other possible implementations, when the wheel enters the automatic scanning mode for non-first scanning, the electronic device obtains the environmental parameter values ​​of the preset scanning environmental parameters when the scanned object is detected and the scanned object is updated.

[0027] In this solution, if this is the first scanning operation after entering automatic scanning mode, the electronic device only needs to detect the scanned object in the viewfinder to begin tracking, image acquisition, and correction of the scanned object. However, if this is not the first scanning operation after entering automatic scanning mode, to reduce repeated scanning of scanned objects with the same content, the electronic device can first determine whether the scanned object has been updated after detecting the scanned object in the viewfinder. If so, tracking, image acquisition, and correction of the scanned object can then be performed. This reduces repeated scanning.

[0028] In some possible implementations, the electronic device may determine that the scanned document has been updated when it detects that the difference between the current scanned document and the scanned document at the previous moment is greater than a preset difference threshold, or the similarity between the current scanned document and the scanned document at the previous moment is less than a preset similarity threshold.

[0029] In some possible implementations, if the electronic device does not detect the scanned article, and / or the difference between the scanned article and the scanned article at the previous moment is less than a preset difference threshold, the electronic device determines whether the viewfinder of the electronic device has entered a motion state. If none of the electronic devices have entered a motion state within the sleep time threshold, the electronic device starts a low-power camera mode. In the low-power camera mode, the electronic device continuously detects whether the viewfinder has entered a motion state, and the electronic device no longer detects the scanned article. In this solution, if the viewfinder of the electronic device has not entered a motion state for a long time, the electronic device controls the electronic device to enter a low-power camera mode, thereby reducing the power consumption of the mobile phone.

[0030] In some possible implementations, after the electronic device activates low-power camera mode, the method further includes: upon detecting that the viewfinder is in motion, the electronic device exits low-power camera mode and re-detects the scanned document. While in low-power camera mode, if motion is detected in the viewfinder, the scanned document may be updated within the viewfinder. Thereafter, the electronic device exits low-power camera mode. This reduces the power consumption of the electronic device.

[0031] In some possible implementations, after the electronic device enters automatic scanning mode and before the electronic device performs a scanning operation on the scanned object, the method further includes: the electronic device resetting the scan count to zero. In this implementation, after the electronic device performs a scanning operation on the scanned object, the method further includes: the electronic device incrementing the scan count by 1 and continuing to scan the scanned object. In this solution, in automatic scanning mode, after the electronic device performs a single scanning operation, the scan count is recorded so that the tracking time threshold is determined based on the scan count.

[0032] In a second aspect, an electronic device is provided, comprising: a processor and a memory; the memory is used to store computer-executable instructions, and when the electronic device is running, the processor executes the computer-executable instructions stored in the memory to enable the electronic device to perform a scanning method as described in any one of the first aspects above.

[0033] In a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the computer-readable storage medium is run on a computer, the computer can execute the scanning method of any one of the above-mentioned first aspects.

[0034] In a fourth aspect, a computer program product comprising instructions is provided, which, when executed on an electronic device, enables the electronic device to execute any one of the scanning methods of the first aspect.

[0035] In a fifth aspect, a device (for example, a chip system) is provided, which includes a processor for supporting an electronic device to implement the functions involved in the first aspect above. In one possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, it can be composed of a chip or include a chip and other discrete devices.

[0036] Among them, the technical effects brought about by any design method in the second to fifth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1A A schematic diagram of an automatic scanning scenario provided in an embodiment of the present application;

[0038] Figure 1B A schematic diagram of an automatic scanning mode scenario provided in an embodiment of the present application;

[0039] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0040] Figure 3 A schematic diagram of the software architecture of an electronic device provided in an embodiment of the present application;

[0041] Figure 4A A schematic diagram of a scanning method according to an embodiment of the present invention;

[0042] Figure 4B A schematic diagram of a framing screen provided in an embodiment of the present application;

[0043] Figure 4C A schematic diagram of a scanning method according to an embodiment of the present invention;

[0044] Figure 5 A schematic diagram of a scanning method according to an embodiment of the present invention;

[0045] Figure 6 A schematic diagram of a scanning method according to an embodiment of the present invention;

[0046] Figure 7A A schematic diagram of a scanning method according to an embodiment of the present invention;

[0047] Figure 7B A schematic diagram of a scanning method according to an embodiment of the present invention;

[0048] Figure 8 A schematic diagram of a scanning method according to an embodiment of the present invention;

[0049] Figure 9 A schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] Document scanning is the process by which a scanning device converts a document into an electronic scan. Document scanning can be divided into manual scanning mode and automatic scanning mode. Manual scanning mode allows the user to manually control the scanning device to scan when the document is ready. Automatic scanning mode, on the other hand, allows the scanning device to automatically scan the document upon detecting it, without requiring any user intervention.

[0051] In the automatic scanning mode of the document scanning scene, the scanning process of a scanned document includes detection, tracking, image acquisition and correction in sequence.

[0052] Detection involves detecting the edges and content of objects in an image to determine the boundaries of the object, thereby isolating the object of interest. In some embodiments of the present application, in automatic scanning mode, the edges of the object can be detected and combined with the content of the object to determine whether the object is a predetermined type of scanned object, such as a document. If the edges of the scanned object are detected, the image corresponding to the scanned object is separated from the viewfinder.

[0053] Tracking refers to using contextual information from a video or image sequence to predict the motion state of an object in the image and calibrate its position. In the present embodiment, tracking refers to the camera application tracking the position of the scanned object from the time it detects the scanned object until it performs correction.

[0054] Image acquisition refers to the scanning device capturing a photograph of the scanned object using an image acquisition module to obtain a corresponding image. In embodiments of the present application, when the scanning device scans a document, the scanning device performs image acquisition. Based on the edges of the scanned object determined by detection and tracking, the scanning device can separate the image of the scanned object from the overall image and then acquire the image. In other words, the scanning device acquires an image corresponding to the scanned object.

[0055] Correction is used to correct deformations such as tilt, rotation, and wrinkles in the scanned document, thereby obtaining an electronic scan that is closer to the original content of the scanned document.

[0056] In automatic scanning mode, users typically desire to perform a single scan on a single document to avoid repeated scanning. Therefore, in some embodiments, after the scanning device detects an edge of the document in the viewfinder, it tracks the edge and begins counting the tracking time. When the tracking time for the document reaches a preset tracking time threshold, image capture and correction are performed on the document. The scanning device then re-detects the document, detecting whether the document exists in the viewfinder. Before the user manually updates to the next document, or the document automatically updates to the next document, the document detected in the viewfinder may still be the previous document, i.e., one that has already been scanned. To avoid or reduce repeated scanning, the scanning device can determine whether the detected document has been updated. If an update is determined, a new scan is performed, determining whether the tracking time has reached the tracking time threshold. If so, image capture and correction are performed.

[0057] Furthermore, the scanning device determines whether the scanned object has been updated. Specifically, the scanning device may determine whether the scanned object has been updated by comparing the currently detected scanned object with the scanned object detected at a previous moment. In some embodiments, the scanning device may detect the scanned object in the viewfinder at a certain frequency. In this embodiment, the previous moment may refer to the scanned object detected last. Exemplarily, the scanning device captures an image frame at a preset time interval and detects the captured image to determine whether the scanned object is present. When a scanned object is detected, the scanning device determines whether the scanned object has been updated compared to the scanned object in the previous captured image.

[0058] Furthermore, after the scanning device detects the edge of the scanned object in the viewfinder, it may lose track of the object due to significant vibration of the scanning device or the object. In this case, the scanning device should stop tracking and return to detecting the object in the viewfinder.

[0059] In this embodiment, if a previously scanned object remains relatively stable within the viewfinder, the detection of the object will be determined to be unchanged, and no new scan will be performed. If a previously scanned object experiences significant jitter within the viewfinder for a short period of time, resulting in a loss of tracking, triggering a re-detection by the scanning device, the scanning device may repeat the scan operation on the same object.

[0060] In other embodiments, the scanning device determines whether the scanned article has been updated by comparing the currently detected scanned article with the scanned article from the last scanning operation to determine whether the scanning device has performed a scanning operation on the scanned article. Exemplarily, the scanning device may cache the image of the detected scanned article when performing a scanning operation. Before performing the next scanning operation, the scanning device may compare the currently detected scanned article with the image in the cache to determine whether the currently detected scanned article has been updated compared to the scanned article from the last scanning operation. Alternatively, the scanning device may compare the currently detected scanned article with the electronic scan obtained from the last scanning operation to determine whether the currently detected scanned article has been updated compared to the scanned article from the last scanning operation.

[0061] The scanning device compares the two images to determine whether the scanned document has been updated. Specifically, this can be done by calculating a difference value or similarity between the two images. If the difference value between the two images is greater than a preset difference threshold, or the similarity between the two images is less than a preset similarity threshold, the two images are different. This indicates that the scanned document has been updated. The specific method for calculating the difference value or similarity between the images can be found in the relevant art and will not be detailed in this embodiment.

[0062] Detection and correction both rely on specific algorithms and require relatively fixed time. Image acquisition time is also fixed. Tracking time is usually a preset empirical value (such as tracking a document for a certain number of frames or a certain time).

[0063] In related art, the tracking time threshold for automatic scanning mode is typically set to a fixed value. This fixed value is used as the tracking time as long as the automatic scanning state is in effect, regardless of the environment. In automatic scanning mode, the mobile phone 1 begins counting after detecting the edge of the scanned object. When the count reaches the tracking time threshold, the scanning device performs image acquisition and correction operations. The same tracking time threshold means that in automatic scanning mode, the interval between detecting the edge of the scanned object and performing image acquisition and correction is the same.

[0064] However, the content and environment being scanned may vary in different scenarios. If the same tracking time threshold is used, then a shorter tracking time threshold (i.e., shorter tracking time) has the advantage of higher automatic scanning efficiency; however, it can easily result in electronic scans that fail to meet clarity requirements. For example, in a scenario where the user manually turns pages of the scanned document, if the tracking time threshold is set short, the user's hand may be included in the scanned document as part of the document, resulting in partial obstruction of the electronic scan. For another example, in a scenario where the user is holding a scanning device for automatic scanning, if the tracking time threshold is set short, a new scan operation may be performed before the scanning device has reached a relatively stable state. This can easily result in inaccurate detection of the scanned document, resulting in poor quality of the electronic scan, such as a low intersection over union (IOU). In other words, different scanning environments result in different minimum tracking times, starting from detecting the edge of the scanned document until the scan is completed to meet clarity requirements. Among them, the clarity requirement refers to the clarity requirement for the electronic scanned copies collected by automatic scanning. Usually, if the electronic scanned copy contains the complete content of the scanned copy and the text and images therein can be distinguished, it can be considered that the electronic scanned copy meets the clarity requirement.

[0065] For example, Figure 1A As shown, if the mobile phone 1 is placed on a relatively fixed object such as a stand 3 and the scanned object 2 is an electronic document, which is relatively stable, the mobile phone 1 only needs to track for a short time to scan the electronic scanned document that meets the required clarity. In this case, a long tracking time may affect the scanning efficiency.

[0066] For example, Figure 1B As shown, when a user holds a mobile phone 1 to automatically scan a document 2, due to the large swing amplitude of the mobile phone 1, a longer tracking time is required for the mobile phone 1 to obtain a more stable and clear electronic scan. In this case, if the tracking time is too short, the obtained electronic scan is likely to be unclear.

[0067] Therefore, if the same tracking time threshold is used in different scanning scenarios, the best scanning effect and scanning efficiency may not be guaranteed, resulting in a degradation of user experience.

[0068] Based on this, the present application provides a scanning method, which can be applied to an electronic device. The electronic device includes an image acquisition module for supporting the function of scanning the content of the scanned object, and can also be called a scanning device. In the technical solution provided in the embodiment of the present application, different tracking time thresholds can be set for different scanning environments. In this way, after the electronic device detects the edge of the updated scanned object, before the electronic device performs a scanning operation on the scanned object, the electronic device can obtain the environmental parameters of the current scanning environment, and determine the corresponding tracking time threshold based on the scanning environment indicated by the obtained environmental parameters. Afterwards, after the electronic device detects the edge of the scanned object, the tracking time is counted, and when the counted tracking time reaches the tracking time threshold, the electronic device performs a scan on the scanned object. In this way, during the automatic scanning process, different tracking time thresholds are set according to different scanning environments, so that the time to perform a single scanning operation varies with the changes in the scanning environment. Thereby, under the premise of ensuring the scanning effect in the scanning environment, the time required for scanning is reduced and the scanning efficiency is improved.

[0069] For example, the electronic device may be a mobile phone (e.g. Figure 1A and Figure 1B As shown in the figure, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), wearable devices, augmented reality (AR) and virtual reality (VR) devices, media players, televisions, scanners and other devices. The embodiments of the present application do not impose any special restrictions on the specific form of the device.

[0070] like Figure 2 FIG2 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a touch sensor 180B, and the like.

[0071] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0072] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Among them, different processing units can be independent devices or integrated into one or more processors. For example, the processor 110 is used to execute the network acceleration method in the embodiment of the present application.

[0073] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0074] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0075] The USB interface 130 is an interface that complies with USB standards, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and peripheral devices.

[0076] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0077] The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.).

[0078] In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0079] The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from the wired charger via the USB interface 130.

[0080] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160.

[0081] In some other embodiments, the power management module 141 may also be provided in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.

[0082] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0083] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0084] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low-noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 1.

[0085] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0086] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that electronic device 100 can communicate with the network and other devices through wireless communication technology.

[0087] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170 and the application processor.

[0088] The audio module 170 is used to convert digital audio signals into analog audio signals for output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0089] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 180A can be provided on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a device comprising at least two parallel plates having a conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A.

[0090] Touch sensor 180B, also known as a "touch panel," can be disposed on display screen 194. The touch sensor 180B and display screen 194 form a touch screen, also known as a "touch screen." Touch sensor 180B is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided via display screen 194. In other embodiments, touch sensor 180B can also be disposed on the surface of electronic device 100, at a location different from that of display screen 194.

[0091] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0092] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts and can also be used for touch vibration feedback.

[0093] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0094] The camera 193 is used to capture static images or videos. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1. In the embodiment of the present application, the electronic device 100 can capture images of the scanned object through the camera 193.

[0095] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1. In the embodiment of the present application, the electronic device 100 may display the image currently captured by the camera 193 through the display screen 194 .

[0096] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and disconnected from the electronic device 100 by inserting or removing the SIM card into or from the SIM card interface 195. The electronic device 100 may support one or N SIM card interfaces, where N is a positive integer greater than one.

[0097] The scanning methods in the following embodiments can all be implemented in the electronic device 100 having the above hardware structure.

[0098] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100. Figure 3 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0099] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0100] The application layer can include a series of application packages.

[0101] like Figure 3 As shown, the application package may include applications such as a camera, gallery, and memo. The camera may include a document preview module and a document scan preview module. The document scan preview module is used to display an image captured by the electronic device's camera on a display screen. In automatic scanning mode, the image includes the scanned document.

[0102] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0103] like Figure 3 As shown, the application framework layer may include a window manager, a resource manager, a notification manager, an activity manager, and the like.

[0104] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0105] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0106] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0107] The system library can include multiple functional modules, such as media libraries, graphics processing libraries, and Android runtime.

[0108] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.

[0109] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0110] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0111] The algorithm engine layer includes a document image understanding algorithm engine and a document scanning algorithm engine. The document image understanding algorithm in the document image understanding algorithm engine can be used for image recognition. The document scanning algorithm in the document scanning algorithm engine can be used to perform intelligent processing of scanned documents, such as detection, tracking, and correction, as well as other functions such as adding filters to scanned documents.

[0112] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0113] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0114] The graphics processing library can be used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0115] The kernel layer is the layer between hardware and software. The kernel layer can be display driver, audio driver, sensor driver, etc.

[0116] The technical solution provided in the embodiment of the present application is applied to the scenario of automatically scanning a scanned object using an electronic device. Different tracking time thresholds are set in different scanning environments, so that the automatic scanning can ensure the scanning effect while better improving the scanning efficiency.

[0117] The scanning method provided in the embodiment of the present application will be described in detail below with reference to the embodiments and drawings. Figure 4A FIG. 1 is a flow chart of a technical solution provided in an embodiment of the present application. The method includes S401 to S409.

[0118] S401. Mobile phone 1 starts the camera application.

[0119] In some embodiments, the mobile phone 1 may start the camera application in response to the second event. For example, the mobile phone 1 may start the camera application in response to a user triggering an operation to open the camera application.

[0120] S402. In response to the first event, the mobile phone 1 enters the automatic scanning mode.

[0121] The first event is used to trigger the entry into automatic scanning mode. For example, the first event may be a user clicking on the automatic scanning mode option in the camera application of mobile phone 1. Alternatively, the first event may be receiving a user voice command, which is used to control mobile phone 1 to enter automatic scanning mode. Alternatively, the first event may be receiving a call instruction from another application, which is used to invoke the automatic scanning function of the camera application. In other embodiments, the first event may also be other events.

[0122] In automatic scanning mode, the camera app can automatically perform a scan operation upon detecting the scanned document and generate the corresponding electronic scanned document. The scanned document may include paper documents, color pages, cards and certificates, slides, business cards, test papers, invoices, etc. Among them, paper documents: include ordinary paper documents, books, papers, contracts, reports, official documents, newspapers, certificates and awards, etc. Color pages: posters, brochures, magazines, book covers, comics, picture books, etc. Cards and certificates: identity cards, bank cards, household registration books, driver's licenses, real estate certificates, business licenses, graduation certificates, degree certificates, marriage certificates, etc. Slides: the display or projection of electronic documents such as PPT, Word, Excel, Keynote on monitors, mobile phone screens, tablet screens, projection screens, and electronic screens in conference rooms.

[0123] In some embodiments, when the camera application of the mobile phone 1 performs automatic scanning, the scanning process of a scanned object includes detection, tracking, image acquisition and correction. Among them, the detection is used to detect the edge of the scanned object and determine the position of the scanned object in the viewfinder. Figure 4B As shown, the camera application of the mobile phone 1 includes a paper document 42 and other backgrounds (such as Figure 4B The pen 43 shown is used to detect and locate the scanned part (i.e., paper document 42) from the image, as shown in FIG. Figure 4B The detection frame 44 shown corresponds to the edge of the scanned part.

[0124] As can be seen from the above description, correction is used to correct deformation problems, so that the electronic scanned copy obtained by image acquisition is closer to the original content of the scanned copy. Figure 4B , the paper document 42 is wrinkled and deformed, and the mobile phone 1 captures and corrects the image to obtain an electronic scan 45. It should be noted that in actual situations, in a single scanning operation in the automatic scanning mode, image capture can be performed first and then the image corresponding to the scanned document can be corrected, or the image corresponding to the scanned document can be corrected first and then the corrected image can be captured.

[0125] During the automatic scanning process, the content to be scanned typically includes multiple copies, such as all presentation document pages of a PowerPoint presentation, every page of a book, or multiple test papers. That is, after entering the automatic scanning mode, the mobile phone 1 may need to perform multiple scanning operations. In some embodiments, the mobile phone 1 performs a scanning operation when the content of the scanned document is updated. This can avoid repeated scanning of the same scanned document, which would result in wasted storage space. For example, a scanning operation is performed on the first page of a PowerPoint presentation or book, and when the PowerPoint presentation or book is turned to the second page, a scanning operation is performed on the second page. For another example, a scanning operation is performed on the first test paper, and when the viewfinder of the mobile phone 1 is updated to the second test paper, the mobile phone 1 performs a scanning operation on the second test paper, and so on. Specifically, when the mobile phone 1 detects a new scanned document in the viewfinder, the mobile phone 1 re-performs detection, tracking, image acquisition, and correction on the currently detected image to obtain a new electronic scan.

[0126] S403. Mobile phone 1 determines whether the scanned document is detected.

[0127] In some embodiments, during the first scan in the current round of automatic scanning mode, any scanned object detected by mobile phone 1 is considered a new scanned object for mobile phone 1. Therefore, during the first scan, S403 described above may specifically involve detecting an update to the scanned object upon detection by mobile phone 1. Mobile phone 1 may detect the scanned object using a detection algorithm. The specific implementation of the process for mobile phone 1 detecting the scanned object using the detection algorithm can be found in the relevant art and will not be detailed in this embodiment.

[0128] Furthermore, in some embodiments, after the first scan operation in the current round of automatic scanning mode is completed, for non-initial scans starting from the second scan, mobile phone 1 has already scanned the previous scanned document and only needs to scan the scanned document that has not yet been scanned. Therefore, for mobile phone 1, when it detects a scanned document in the viewfinder during non-initial scanning, it is possible that the scanned document has already been scanned. Therefore, in the above-mentioned S403, after detecting the scanned document, mobile phone 1 needs to determine whether a scan operation has already been performed on the scanned document. If a scan operation has been performed on the scanned document, mobile phone 1 should not repeat the scan operation on the scanned document.

[0129] In some embodiments, in a non-initial scanning scenario, S403 may specifically be a determination that a new scan operation is required when the mobile phone 1 detects the scanned object and the difference between the scanned object and the previously scanned object is greater than a preset difference threshold. The specific manner in which the mobile phone 1 detects whether the difference between the scanned object and the previously scanned object is greater than the preset difference threshold can be found in the description of the related technical solutions and is not further described in the present embodiment.

[0130] like Figure 4C As shown, in some embodiments, the above S403 specifically includes S403a-S403c:

[0131] S403a. Mobile phone 1 determines whether the scanned document is detected.

[0132] As can be seen from the above embodiments, the detection of the scanned document is divided into two cases depending on whether it is the first scan by the mobile phone 1. Therefore, after the mobile phone 1 detects the scanned document, it is still necessary to determine whether it is the first scan, that is, S403b.

[0133] S403b. Mobile phone 1 determines whether it is the first scan.

[0134] The term "first scan" refers to the first scanning operation performed by mobile phone 1 after entering the automatic scanning mode. As can be seen from the above embodiments, if this is the first scan, mobile phone 1 can perform the following operations (tracking, image acquisition, and correction, etc.). If this is not the first scan, mobile phone 1 must also determine whether the scanned document has been updated, as in S403c.

[0135] S403c. Mobile phone 1 determines whether the scanned document is updated.

[0136] If the scanned document is not updated, the mobile phone 1 may return to continuously detecting the scanned document, ie, S403a.

[0137] In the above embodiment, whether the scanned object is updated is determined by detecting the difference between the two scanned objects. In other embodiments, whether the scanned object is updated can also be determined by detecting the similarity between the two scanned objects. For example, in the above S403, for the case where it is not the first scan, the mobile phone 1 can also determine that a new scan operation is required when an edge of the scanned object is detected and the similarity between the scanned object and the previously scanned object is less than a preset similarity threshold.

[0138] In some embodiments, in a non-initial scan scenario, the mobile phone 1 may detect whether the scanned document has been updated within the viewfinder. If an update is detected within the viewfinder, it can be understood that the mobile phone 1 has not yet performed a scan operation on the scanned document, and the mobile phone 1 needs to perform a scan operation on the scanned document.

[0139] It should be understood that Figure 4A As shown, if the mobile phone 1 determines that no scanned document is currently detected in the viewfinder, it can return to continue detecting the scanned document, that is, S403. In some embodiments, the mobile phone 1 repeats the process of S403 when no updated scanned document is detected, which can be called the execution process of the general camera mode. In this embodiment, as Figure 5 As shown, the above S401 may specifically include S401 a:

[0140] S401 a. Mobile phone 1 activates the general camera mode of the camera application.

[0141] The scanning scenario is divided into a general camera mode and a low-power camera mode. In general camera mode, the mobile phone 1 can detect whether there is a scanned object in the viewfinder or an updated scanned object at a preset frequency. In general camera mode, the mobile phone 1 can continuously detect the scanned object in the viewfinder. This facilitates the rapid entry into a new scanning operation after detecting a scanned object or detecting an updated scanned object, that is, starting tracking, image acquisition, and correction of the scanned object.

[0142] As can be seen from the description of the above embodiment, for non-initial scanning operations after entering the automatic scanning mode, the mobile phone 1 will not perform a new scanning operation until an updated scanned document is detected. In actual practice, after the mobile phone 1 enters the automatic scanning mode and performs at least one scanning operation, the scanned document may not be updated for a long period of time. In this case, the user may be in a paused operation state, and the mobile phone 1 does not need to perform a scanning operation. In this case, in order to reduce the power consumption of the mobile phone 1, if the viewfinder does not enter a motion state for a period of time, the mobile phone 1 can perform a sleep operation. After the mobile phone 1 performs the sleep operation, it temporarily stops detecting the scanned document.

[0143] In some embodiments, the sleep operation can also be referred to as general camera mode sleep, where the mobile phone 1 switches to low-power camera mode. In low-power camera mode, the mobile phone 1 can continuously detect whether the viewfinder screen enters a motion state. It should be understood that if the viewfinder screen enters a motion state, it indicates that the scanned document may have been updated in the viewfinder screen. Therefore, the mobile phone 1 can determine whether to exit low-power camera mode and return to general camera mode by determining whether the viewfinder screen enters a motion state.

[0144] In some embodiments, as Figure 5 As shown, after S403a, if the mobile phone 1 detects that the scanned document has not been updated, or after S403c, if the mobile phone 1 detects that the scanned document has not been updated, the above method further includes S501-S509.

[0145] in:

[0146] S501. Mobile phone 1 detects whether the viewfinder image enters a motion state.

[0147] The viewfinder is the image within the camera viewfinder frame of the mobile phone 1. If the viewfinder enters a motion state, it means that the content captured by the camera of the mobile phone 1 may change, that is, the scanned document may be updated. Therefore, if the mobile phone 1 detects that the viewfinder enters a motion state, it can continue to detect whether the scanned document has been updated. If the mobile phone 1 detects that the viewfinder does not enter a motion state, it can execute S502:

[0148] S502. Mobile phone 1 triggers a sleep timer.

[0149] After the sleep timer is triggered, the mobile phone 1 needs to continuously detect whether the viewfinder image enters a motion state.

[0150] S503. Mobile phone 1 continues to detect whether the viewfinder image enters a motion state.

[0151] If yes, the sleep timer is reset to zero, as in S504.

[0152] S504. The sleep timer is cleared.

[0153] If the viewfinder enters a motion state, the mobile phone 1 or the scanned document may enter a motion state, and the scanned document may be updated. Therefore, if it is detected that the viewfinder enters a motion state, the sleep timer is reset and the mobile phone 1 continues to detect the scanned document.

[0154] After S503 , if the viewfinder image still does not enter the motion state, the sleep timer continues to count until the sleep time reaches the sleep time threshold.

[0155] S505. Mobile phone 1 determines whether the timing time of the sleep timer reaches the sleep time threshold.

[0156] If the sleep timer has not reached the sleep time threshold, phone 1 continues to detect whether the viewfinder has entered a motion state. If the sleep timer reaches the sleep time threshold, indicating that the viewfinder of phone 1 has not entered a motion state for a long time, the camera application of phone 1 can be put into sleep mode. In other words, the general camera mode is put into sleep mode, and the low-power camera mode is activated.

[0157] S506. General camera mode sleep.

[0158] S507. Start low power camera mode.

[0159] After starting the low-power camera mode, the mobile phone 1 can continue to detect whether the viewfinder image enters a motion state.

[0160] S508. Mobile phone 1 continues to detect whether the viewfinder image enters a motion state.

[0161] It should be understood that, while in low-power camera mode, mobile phone 1 can continuously detect whether the viewfinder enters a motion state. If mobile phone 1 detects motion in the viewfinder during low-power camera mode, it can reset the sleep timer and exit low-power camera mode. In this embodiment, exiting low-power camera mode returns to the normal camera mode of the camera application, after which mobile phone 1 will continue to detect scanned items.

[0162] S509. Mobile phone 1 exits the low-power camera mode and restarts the general camera mode.

[0163] Steps S506 and S507 described above temporarily stop detecting the scanned object after entering the automatic scanning mode and when certain conditions are met. Since mobile phone 1 does not exit the camera application, but rather switches from the general camera mode of the camera application to the low-power camera mode, when the conditions for exiting the low-power mode are met, the camera application of mobile phone 1 will restart the general camera mode and re-detect the scanned object.

[0164] In some embodiments, after S506 and S507, the number of scans may not be reset to zero; that is, after re-starting the general camera mode at S509, if the scanned object is detected, it should be determined that it is not the first scan. In other embodiments, after S506 and S507, the number of scans may also be reset to zero; that is, after S509, if the scanned object is detected, it should be determined that it is the first scan.

[0165] In some embodiments, the above processes S501 - S509 may be implemented by the sleep detection module in the mobile phone 1 .

[0166] In the technical solution provided in the embodiment of the present application, when the mobile phone 1 is detecting the scanned object, if it is determined that the viewfinder screen has not changed for a period of time, the mobile phone 1 can suspend the detection of the scanned object, that is, the detection of the scanned object is dormant, thereby reducing the power consumption of the mobile phone 1.

[0167] After S403 , if the mobile phone 1 detects the scanned document, S404 may be executed.

[0168] S404. Mobile phone 1 obtains the environmental parameter value of the preset scanning environmental parameter.

[0169] The scanning environment refers to the environment in which the mobile phone 1 is scanning the scanned object. As can be seen from the above description, in different scanning environments, if the scanning effect is to be guaranteed, the shortest tracking time required should be different. For example Figure 1A and Figure 1B Under the two scanning environments, the shortest tracking time required for the mobile phone 1 to scan and obtain an electronic scanned copy that meets the definition requirements is different.

[0170] The preset scanning environment parameters may include one or more. In some embodiments, the preset scanning environment parameters may include the number of scans, the type of scanned object, the state of the scanned object, and the stability of the electronic device (such as mobile phone 1). The number of scans is used to record the number of scans performed by mobile phone 1 after entering the automatic scanning mode. The state of the scanned object includes whether the scanned object is held by the user or placed on a stable surface.

[0171] It should be understood that in the embodiment where the preset scanning environment parameters include the number of scans, the above method needs to record the number of scans after each scan by the mobile phone 1. In some embodiments, in order to ensure that the number of scans recorded by the mobile phone 1 corresponds to the number of scans actually performed by the mobile phone 1, the mobile phone 1 resets the number of scans to zero each time after entering the automatic scanning mode and before performing the first scan. Figure 6 S601 shown.

[0172] S601. Mobile phone 1 sets the number of scans to zero.

[0173] Furthermore, in this embodiment, when the mobile phone 1 exits the automatic scanning mode, it indicates that the scanning of this round of the automatic scanning mode is finished.

[0174] As can be seen from the above embodiments, mobile phone 1 can enter automatic scanning mode in response to user operation. Typically, users will control mobile phone 1 to enter automatic scanning mode and automatically scan the document after preparing it. Because the document is already prepared and relatively stable during the first scan, mobile phone 1 can scan the document quickly, resulting in a clear electronic scan. In this case, the tracking time threshold for the first scan can be set to a shorter value to shorten the initial scan time and improve scanning efficiency.

[0175] During this round of automatic scanning, after the first scan operation is completed, mobile phone 1 should perform a second scan operation after the scanned document is updated. Scanned document updates usually require waiting for a certain period of time until the scanned document is automatically updated, or waiting for the user to manually update the scanned document. This update process usually involves the movement of the scanned document, which may also cause the scanned document to be unstable. When the scanned document is unstable, it will take longer for mobile phone 1 to scan an electronic scan that meets the clarity requirements. Compared to the first scan operation, the tracking time threshold for non-first scan operations can be set to be longer.

[0176] Furthermore, the above S404 may specifically include: mobile phone 1 obtains the number of scans, and determines whether the environmental parameter value is the first scan based on the number of scans. For example, when the number of scans = 0, the environmental parameter value = the current first scan; when the number of scans ≠ 0, the environmental parameter value = the current non-first scan.

[0177] In the above embodiment, the length of the tracking time threshold is set based on whether it is the first scan or not, and the number of scans in this round of automatic scanning is divided into two situations: the first scan and the non-first scan. However, based on whether it is the first scan or not, the type of the scanned document is different, which may involve different ways of updating the scanned document during the automatic scanning process. Since the update methods of the scanned document are different, the update speeds of the scanned document may be different. In order for the automatic scan to scan an electronic scan that meets the clarity requirements, it is usually necessary to perform a new scanning operation after the scanned document is updated to ensure the clarity of the scanned electronic scan. Therefore, different types of scanned documents may also affect the shortest tracking time required to scan an electronic scan that meets the clarity requirements.

[0178] Exemplarily, when the scanned document is a PPT document page, the scanned document update can correspond to the PPT page turning. However, PPT page turning usually does not require the user to perform manual operations on the PPT, and the speed of PPT page turning is usually fast. Therefore, in this scenario, the mobile phone 1 can set the tracking time threshold to be shorter to shorten the scanning time as much as possible while meeting the scanning clarity requirements. When the scanned document is a paper document (such as book pages, test papers, etc.), the scanned document update can correspond to the paper document page turning, or switching to the next paper document. However, turning the paper document page or switching to the next one may require the help of the user, such as manual page turning by the user, which is slow. Therefore, in this scenario, the mobile phone 1 can set the tracking time threshold to be longer to ensure a clearer scanning effect of the electronic scanned document.

[0179] In some embodiments, the types of scanned documents may be divided into four types: a first type, a second type, a third type, and a fourth type, according to the user's expectations of the scanning speed from high to low.

[0180] Exemplarily, the first type may include: scanned documents that do not require user operation, such as PPT.

[0181] The second type may include: single paper documents that require user operation and are placed flat to be scanned; such as A4, A3 paper documents, certificates, etc. that are placed flat.

[0182] The third category includes scans that require user interaction, are not flattened, and are smaller than a preset threshold, such as pages from a 16-mo to 32-mo book. The preset threshold can be set based on actual circumstances, such as A4 paper size or a 32-mo book page. Paper size is used to determine whether a paper document is user-friendly. Larger paper makes turning pages more difficult, and thus, page turning may take longer.

[0183] The fourth type may include: scanned documents that require user operation, are not placed flat, and have a size greater than or equal to a preset threshold; such as test papers and other paper documents that are large and difficult to place flat.

[0184] In some embodiments, the above S404 may specifically include: mobile phone 1 obtaining the type of the scanned document. For example, when the type of the scanned document is the first type, mobile phone 1 obtains the environmental parameter value corresponding to the type of the scanned document as the first type. If the type of the scanned document is the second type, mobile phone 1 obtains the environmental parameter value corresponding to the type of the scanned document as the second type.

[0185] Furthermore, for the same type of scanned document, different tracking time thresholds can be set in combination with the status of the scanned document. In some embodiments, the status of the scanned document may specifically include whether the scanned document is held by the user, whether the scanned document is placed on a stable surface, the proportion of the scanned document in the viewfinder of the mobile phone 1, the magnification or reduction ratio of the scanned document in the viewfinder of the mobile phone 1, and the relative angle between the scanned document and the mobile phone 1. It should be understood that the above-mentioned status of the scanned document is only an example. In actual situations, other statuses of the scanned document may also be included, such as the page size of the scanned document, the brightness of the scanned document in the viewfinder, etc.

[0186] When the scanned document is held by the user or is not placed on a stable surface, the scanned document may be unstable and prone to shaking. In this case, a longer tracking time threshold needs to be set to obtain a clearer electronic scan. If the scanned document is placed on a stable surface, it means that the scanned document is relatively stable, and the minimum tracking time required for mobile phone 1 to scan and obtain an electronic scan that meets the required clarity is shorter. In other words, the tracking time threshold can be set to a smaller value in this case.

[0187] For example, for the same A4 paper document, when it is placed flat on a relatively stable surface such as a desktop, the A4 paper document is more stable; however, when the A4 paper document is held by a user, the A4 paper document is relatively less stable. As can be seen from the description of the above embodiment, the more stable the A4 paper document is, the shorter the time it takes for the mobile phone 1 to scan it and obtain an electronic scan that meets the clarity requirements. Therefore, for the same A4 paper document, the tracking time threshold set when it is placed flat on a stable surface such as a desktop can be smaller than the tracking time threshold when the document is held by a user.

[0188] The proportion of the scanned document in the viewfinder of mobile phone 1 indicates the proportion of the image corresponding to the scanned document in the entire viewfinder. For the same scanned document, if the proportion of the scanned document in the viewfinder is small, such as less than the preset proportion threshold, it means that the scanned document is far away from mobile phone 1. At this time, the relatively small movement in the viewfinder is easily magnified by the camera of mobile phone 1. In this case, mobile phone 1 responds to updates of the scanned document more quickly, that is, mobile phone 1 can detect updates of the scanned document more quickly. Therefore, at this time, the tracking time threshold can be set to be shorter. On the contrary, if the proportion of the scanned document in the viewfinder is large, such as greater than the preset proportion threshold, it means that the scanned document is close to mobile phone 1 at this time. In this case, the tracking time threshold can be set to be longer.

[0189] The magnification or reduction ratio of the scanned object in the viewfinder of mobile phone 1 indicates the magnification ratio of the image of the scanned object in the current viewfinder compared to the image of the scanned object when the image is not magnified. The greater the magnification ratio of the scanned object in the viewfinder of mobile phone 1, the more minor movements of the scanned object or mobile phone 1 will be magnified by the camera application of mobile phone 1, that is, the movement of the scanned object in the viewfinder will be greater.

[0190] In some embodiments, the magnification or reduction ratio of the scanned document in the viewfinder of the mobile phone 1 can be obtained from the camera application of the mobile phone 1. Exemplarily, the currently used camera parameters, such as the magnification / reduction ratio or the focal length, can be obtained from the camera application of the mobile phone 1, and the magnification or reduction ratio of the scanned document in the viewfinder can be determined by the camera parameters. If the camera parameter obtained is the magnification / reduction ratio, this parameter can be directly determined as the magnification or reduction ratio of the scanned document in the viewfinder. If the camera parameter obtained is the focal length, the mobile phone 1 needs to obtain the magnification or reduction ratio of the scanned document in the viewfinder according to the focal length conversion. For the specific implementation method of obtaining the corresponding magnification or reduction ratio according to the focal length conversion, reference can be made to the description in the relevant technology and will not be repeated in the embodiments of the present application.

[0191] The relative angle between the scanned object and the phone 1 represents the relative angle between the plane of the scanned object and the plane of the phone 1 screen. If the relative angle between the scanned object and the phone 1 is large, the scanned object is typically tilted significantly in the phone 1's viewfinder. In this case, the minimum tracking time required for the phone 1 to scan the scanned object to meet the required clarity may be longer. In this case, the tracking time threshold can be set to a longer value. Conversely, if the relative angle between the scanned object and the phone 1 is large, the tracking time threshold can be set to a shorter value.

[0192] Furthermore, for paper documents such as book pages, test papers, and certificates, different tracking time thresholds can be set based on their page size. Larger paper documents are more difficult for users to manage. For documents with more difficult management, a longer tracking time threshold should be set. Smaller paper documents are easier for users to manage, so shorter tracking time thresholds can be set for larger documents.

[0193] It should be understood that the above-mentioned states of the scanned articles are merely examples. In other embodiments, the same type of scanned articles may further include other states, and different tracking time thresholds may also be set for other states of the same type of scanned articles.

[0194] In some embodiments, the above S404 may specifically include: mobile phone 1 obtaining the type and / or status of the scanned document. For example, when the scanned document is an electronic document, mobile phone 1 obtains the environmental parameter value corresponding to the type of the scanned document as an electronic document. The status of the scanned document may be that the scanned document is far away from mobile phone 1 (the focal length is far or the scanned document occupies a small proportion of the viewfinder), or the status of the scanned document may be that the scanned document is close to mobile phone 1.

[0195] Specifically, the mobile phone 1 can obtain the type and status of the scanned object through methods such as image recognition. The mobile phone 1 can obtain the status of the scanned object through at least one of image recognition, obtaining the current focal length of the mobile phone 1, and determining the proportion of the scanned object within the viewfinder. For example, when using image recognition to determine the status of the scanned object, the determination can be made by identifying the plane on which the scanned object is placed, or by identifying whether the scanned object is held by the user.

[0196] In addition to the stability of the scanned document, the stability of the mobile phone 1 may also affect the minimum tracking time required to scan an electronic scanned document that meets the required clarity in automatic scanning mode. The stability of the mobile phone 1 indicates whether the mobile phone 1 is moving. When the mobile phone 1 is moving, the stability of the mobile phone 1 is low or unstable. When the mobile phone 1 is not moving, the stability of the mobile phone 1 is high or stable.

[0197] Exemplarily, the relationship between the stability of the mobile phone 1 and the user's desired scanning speed may include: the mobile phone 1 is very stable (stationary), indicating that the user holding the mobile phone 1 has a stable posture or that the mobile phone 1 has reached a stable state with the help of external forces (such as a tripod, table or bracket, etc.). In this case, the user generally expects a fast scanning speed. The mobile phone 1 is relatively stable (the amplitude of the mobile phone 1 is small), indicating that the user holding the mobile phone 1 has an approximately stable posture, or that the mobile phone 1 is relatively stable. In this case, the user expects a faster scanning speed. The mobile phone 1 is unstable (the amplitude of the mobile phone 1 is large), indicating that the user holding the mobile phone 1 may be adjusting his posture. In this case, the user does not expect to scan or the scanning effect is poor. That is, the more stable the mobile phone 1 is, the shorter the minimum tracking time required to scan an electronic scan that meets the clarity requirements. Conversely, the more unstable the mobile phone 1 is, the longer the minimum tracking time required to scan an electronic scan that meets the clarity requirements.

[0198] As can be seen from the above embodiments, for the first scan performed by mobile phone 1 in automatic scanning mode, the scanned object is generally relatively stable. However, during the first scan, mobile phone 1 may be stable or unstable. For non-first scans performed by mobile phone 1 in automatic scanning mode, mobile phone 1 may also be stable or unstable. Therefore, in addition to determining whether this is the first scan, mobile phone 1 may also determine the length of the tracking time threshold based on the current stability of mobile phone 1. For example, when mobile phone 1 detects a higher degree of stability, it may set a longer tracking time threshold.

[0199] In some embodiments, the stability of the mobile phone 1 can be divided into two states: stable and unstable. According to the two states of the mobile phone 1 being stable and unstable, two different tracking time thresholds can be set.

[0200] In other embodiments, the stability of the mobile phone 1 can be divided into more than two levels of stability. For example, the stability can be divided into six different levels of stability from strong to weak: level 1 stability, level 2 stability, level 3 stability, level 4 stability, level 5 stability, and level 6 stability. Six different tracking time thresholds can be set for the corresponding states of the six levels of stability.

[0201] Furthermore, the above S404 may specifically include: mobile phone 1 obtaining the amplitude strength of mobile phone 1, and determining the stability of mobile phone 1 based on the amplitude strength of mobile phone 1. Mobile phone 1 may obtain the amplitude strength of mobile phone 1 by obtaining an acceleration value through an accelerometer of mobile phone 1, obtaining an angular velocity and / or angular acceleration through a gyroscope, and determining the stability of mobile phone 1 based on the acceleration, angular velocity and / or angular acceleration.

[0202] In some embodiments, mobile phone 1 can set corresponding thresholds based on acceleration, angular velocity, and angular acceleration, and determine the stability of mobile phone 1 by comparing acceleration, angular velocity, and angular acceleration with their corresponding thresholds. For example, if acceleration is less than the acceleration threshold, angular velocity is less than the acceleration threshold, and angular acceleration is less than the angular acceleration threshold, mobile phone 1 is determined to be stable. If angular velocity is greater than or equal to the acceleration threshold, angular velocity is greater than or equal to the acceleration threshold, or angular acceleration is greater than or equal to the angular acceleration threshold, mobile phone 1 is determined to be unstable.

[0203] In other embodiments, the mobile phone may set multiple thresholds corresponding to acceleration, angular velocity, and angular acceleration, such as a first acceleration threshold, a second acceleration threshold, a first angular velocity threshold, a second angle threshold, and so on. For example, the mobile phone 1 may determine the threshold intervals for acceleration, angular velocity, and angular acceleration, respectively, and thereby determine the stability of the mobile phone 1. For example, when the acceleration is less than the first angle threshold, the angular velocity is less than the first angular velocity threshold, and the angular acceleration is less than the first angular acceleration threshold, the stability of the mobile phone 1 is determined to be level one. When the acceleration is between the first acceleration threshold and the second acceleration threshold, the angular velocity is between the first angular velocity threshold and the second angular velocity threshold, and the angular acceleration is between the first angular acceleration threshold and the second angular acceleration threshold, the stability of the mobile phone 1 is determined to be level two, and so on. Here, the first acceleration threshold is less than the second acceleration threshold, the first angular velocity threshold is less than the second angular velocity threshold, and the first angular acceleration threshold is less than the first angular acceleration threshold.

[0204] It should be understood that the above-mentioned preset scanning environment parameters are only examples. In other embodiments, the preset scanning environment parameters may also include other types of environment parameters.

[0205] S405. Mobile phone 1 determines a tracking time threshold for executing this scanning operation according to the environmental parameter value.

[0206] The current scanning operation refers to the next single scanning operation to be performed by the mobile phone 1 in the automatic scanning mode. The tracking time threshold is used to indicate the tracking time required for the current scan. When the tracking time reaches the tracking time threshold, the mobile phone 1 can perform the scan to obtain an electronic scanned copy.

[0207] In some embodiments, the mobile phone 1 stores correspondences between different environment parameter values ​​of various preset scanning environment parameters and tracking time thresholds. The above S405 may specifically include: the mobile phone 1 may determine the tracking time threshold corresponding to the environment parameter value of the current scanning environment by searching the above correspondences.

[0208] For example, mobile phone 1 may store the following corresponding relationships: if it is not the first scan, the scanned document is an electronic document, and mobile phone 1 is stable, the tracking time threshold is T1; if it is not the first scan, the scanned document is an electronic document, and mobile phone 1 is unstable, the tracking time threshold is T2. If it is not the first scan, the scanned document is a book page, and mobile phone 1 is stable, the tracking time threshold is T3; if it is not the first scan, the scanned document is a book page, and mobile phone 1 is unstable, the tracking time threshold is T3. If it is not the first scan, the scanned document is a test paper, and mobile phone 1 is stable, the tracking time threshold is T5; if it is not the first scan, the scanned document is a test paper, and mobile phone 1 is unstable, the tracking time threshold is T6. If it is the first scan, the scanned document is an electronic document, and mobile phone 1 is unstable, the tracking time threshold is T7; if it is the first scan, the scanned document is a book page, and mobile phone 1 is unstable, the tracking time threshold is T8; if it is the first scan, the scanned document is a test paper, and mobile phone 1 is unstable, the tracking time threshold is T9. If it is the first scan and mobile phone 1 is stable, the tracking time threshold is T10, and so on.

[0209] Taking the scanning environment including non-first scanning, the type of the scanned object is an electronic document and the mobile phone 1 is stable as an example, by querying the above correspondence, it can be determined that the corresponding tracking time threshold is T1.

[0210] As can be seen from the above embodiment, during the first scan and when the phone 1 is stable, the phone 1 immediately scans upon detecting the scanned document, resulting in a clear electronic scan. Therefore, in the above embodiment, the tracking time threshold T10 corresponding to the first scan and when the phone 1 is stable is set to 0.

[0211] As can be seen from the description of the above embodiments, the scanned document is usually ready when the first scan is performed, that is, the scanned document is relatively stable. During the first scan, if the mobile phone 1 detects that the stability of the mobile phone 1 is relatively high, then the mobile phone 1 immediately performs a scan when the scanned document is detected, and a clear electronic scan can be obtained. Therefore, in some embodiments, the mobile phone 1 can also store the following corresponding relationship: the first scan and the mobile phone 1 are stable, and the tracking time threshold is 0. That is to say, during the first scan, regardless of the type of the scanned document, as long as the first scan is performed and the mobile phone 1 is stable, it is considered that the user expects to perform the first scan immediately. The mobile phone 1 can perform the scanning operation immediately when the scanned document is detected. In this way, the time required for the first scan can be reduced and the scanning efficiency can be improved.

[0212] In this embodiment, mobile phone 1 can search for a matching tracking time threshold in the above-described correspondence based on the environmental parameter values ​​of the current scanning environment, and use this as the tracking time threshold for executing the current scanning operation. When two or more scanning environment parameters are included, corresponding tracking time thresholds are pre-set for all combinations of different environmental parameter values ​​for different preset scanning environment parameters. During use, a matching tracking time threshold need only be searched for for each scanning environment parameter. This can speed up the determination of the tracking time threshold, thereby improving the efficiency of automatic scanning.

[0213] In other embodiments, the mobile phone 1 pre-sets various adjustment times corresponding to different environmental parameter values ​​of various preset scanning environmental parameters. Figure 7A As shown, the above method further includes S701:

[0214] S701. Mobile phone 1 obtains initial tracking time.

[0215] For example, T 初始 Can be set to 700ms.

[0216] In some embodiments, the mobile phone 1 may be pre-set to store the initial tracking time as T 初始 It should be noted that S701 is executed before S405. S701 can be executed after S402 and before S601. Figure 7A Alternatively, S701 may be executed after S404 and before S405. In the embodiment of the present application, the specific execution order of S701 is not limited.

[0217] Furthermore, in this embodiment, the above S405 may specifically include S702 and S703, wherein:

[0218] S702. Mobile phone 1 obtains the adjustment time corresponding to the environmental parameter value.

[0219] S703. Mobile phone 1 adjusts the initial tracking time according to the adjustment time to obtain a tracking time threshold.

[0220] In some embodiments, the mobile phone 1 may also pre-set the following corresponding relationship: the adjustment time corresponding to the first scan is T1 调节 , the adjustment time corresponding to the non-first scan is T2 调节 If the type of scanned document is electronic document, the corresponding adjustment time is T3 调节 If the scanned document type is a book page, the corresponding adjustment time is T4. 调节 The type of scanned document is test paper, and the corresponding adjustment time is T5 调节 The adjustment time corresponding to the stability of mobile phone 1 is T6 调节, the adjustment time corresponding to the instability of mobile phone 1 is T7 调节 The proportion of the scanned document in the viewfinder of mobile phone 1 is less than the preset proportion threshold, and the corresponding adjustment time is T8 调节 When the scanned document is held by the user, the corresponding adjustment time is T9 调节 , etc. The adjustment time corresponding to the environmental parameter value can be set as a positive number, i.e., to increase the initial tracking time; or it can be set as a negative number, i.e., to decrease the initial tracking time. It should be understood that the above correspondence is only a partial example. In actual situations, the correspondence stored in mobile phone 1 may also include correspondences between other environmental parameter values ​​and adjustment times.

[0221] The above S703 can be divided into two situations: the first scan and the stability of the mobile phone 1 is stable, and the non-first scan and / or the stability of the mobile phone 1 is unstable. The non-first scan and / or the stability of the mobile phone 1 is unstable, which can specifically include: the first scan and the stability of the mobile phone 1 is unstable; the non-first scan and the stability of the mobile phone 1 is stable; and the non-first scan and the stability of the mobile phone 1 is unstable.

[0222] In some embodiments, the above S703 may include: when the number of scans is 0 (first scan) and the stability of the mobile phone 1 is stable, the mobile phone 1 determines that the adjustment time corresponding to the environmental parameter value is the first adjustment time.

[0223] The first adjustment time is less than 0, and the absolute value of the first adjustment time is equal to the initial tracking time. It should be noted that if the mobile phone 1 determines that it is the first scan and the mobile phone 1 is stable, the tracking time threshold is no longer adjusted in combination with the type of the scanned object.

[0224] As can be seen from the above embodiment, when the mobile phone 1 is in a stable state during the first scan, the mobile phone 1 immediately scans the scanned document upon detecting it, and a clear electronic scanned document can be obtained. Therefore, in the above embodiment of setting the initial tracking time and the adjustment time, the tracking time threshold corresponding to the first scan and the stable state of the mobile phone 1 needs to be set to 0. At this time, T1 can be set to 调节 With T6 调节 The sum of the values ​​is set to be less than 0, and T1 调节 With T6 调节 The absolute value of is set to be equal to the initial tracking time. That is, T 跟踪 =T 初始 +T1 调节 +T6 调节 =0.

[0225] For example, the initial tracking time can be set to 700 milliseconds (ms), and the adjustment time corresponding to the first scan is set to T1 调节=-500ms, the adjustment time corresponding to the stability of mobile phone 1 is set to T6 调节 If mobile phone 1 detects that it is the first scan and mobile phone 1 is stable, then T 跟踪 =700-500-200=0ms.

[0226] In the technical solution provided in the embodiment of the present application, for the case where the mobile phone 1 performs the first scanning operation after entering the automatic scanning mode in this round and the mobile phone 1 is stable, the tracking time threshold is set to 0. In this way, the time required for the mobile phone 1 to perform the first scan in this case can be reduced, thereby improving the scanning efficiency.

[0227] In other embodiments, the above S703 may include: when the number of scans is not 0 (not the first scan) and / or the stability of the mobile phone 1 is unstable, the mobile phone 1 determines that the adjustment time corresponding to the environmental parameter value is the second adjustment time.

[0228] Among them, the second adjustment time is: the sum of the third adjustment time corresponding to the number of scans, the fourth adjustment time corresponding to the stability of the mobile phone 1, the fifth adjustment time corresponding to the type of the scanned document, and the sixth adjustment time corresponding to the state of the scanned document.

[0229] The second adjustment time can be greater than or less than 0, depending on the third, fourth, and fifth adjustment times corresponding to the scanning environment value. However, when the second adjustment time is less than 0, the absolute value of the second adjustment time is less than the initial tracking time. This ensures that the tracking time threshold is greater than 0.

[0230] As can be seen from the above embodiment, when entering the first scan in automatic scanning mode, the user usually has already prepared the scanned object and the scanning device (mobile phone 1). In this case, the third adjustment time can be set to less than 0, that is, the initial tracking time can be reduced. If this is not the first scan in automatic scanning mode, and the scanned object needs to be updated, the third adjustment time can be set to greater than or equal to 0, that is, the initial tracking time can be increased or not adjusted.

[0231] Similarly, as can be seen from the above embodiments, the higher the stability of mobile phone 1, the shorter the corresponding tracking time can be set. Therefore, when setting the fourth adjustment time based on the stability of mobile phone 1, the fourth adjustment time can be set to less than or equal to 0 when mobile phone 1 is stable. When mobile phone 1 is unstable, the fourth adjustment time can be set to greater than 0.

[0232] In addition, in conjunction with the description of the above embodiment, it can be seen that different tracking time thresholds can be set for different types of scanned documents. In the embodiment of the present application, different fifth adjustment times can be set according to different types of scanned documents. Specifically, when the type of the scanned document belongs to a preset type, the fifth adjustment time can be set to be different from 0. The preset types include a first type, a second type, a third type, and a fourth type. If the type of the scanned document is not identified, or the type of the scanned document does not belong to the preset type, then the fifth adjustment time can be set to be equal to 0.

[0233] Furthermore, as can be seen from the above embodiments, the types of scanned documents can be categorized into four types: first, second, third, and fourth, based on the user's desired scanning speed, from high to low. That is, for the first type of scanned document, the higher the user's desired scanning speed, the shorter the tracking time threshold, compared to the second type. Therefore, when setting the fifth adjustment time based on the different types of scanned documents, the fifth adjustment times corresponding to the first, second, third, and fourth types can be set to increase in sequence. For example, the fifth adjustment time corresponding to the first type of scanned document can be set to less than 0 and have a larger absolute value. The fifth adjustment time corresponding to the second type of scanned document can be set to less than 0 and have a smaller absolute value. The fifth adjustment time corresponding to the third type of scanned document can be set to greater than 0 and have a smaller absolute value. And the fifth adjustment time corresponding to the fourth type of scanned document can be set to greater than 0 and have a larger absolute value. It should be understood that the above settings for the fifth adjustment time are merely examples; in actual situations, the fifth adjustment time can be set to other values.

[0234] In addition to the type of scanned document affecting the tracking time threshold that needs to be set, the state of the scanned document may also affect the size of the tracking time threshold that needs to be set. As can be seen from the description of the above embodiment, the state of the scanned document may include: whether the scanned document is held by the user, whether the scanned document is placed on a stable surface, the proportion of the scanned document in the viewfinder of the mobile phone 1, the magnification or reduction ratio of the scanned document in the viewfinder of the mobile phone 1, and the relative angle between the scanned document and the mobile phone 1, etc.

[0235] If the scanned object is held by the user or not placed on a stable surface, a longer tracking time threshold may be required because the scanned object may be unstable. Therefore, the sixth adjustment time can be set to be greater than or equal to 0. If the scanned object is placed on a stable surface, indicating that the scanned object is stable, the tracking time threshold can be set to be shorter. In this case, the sixth adjustment time can be set to be less than or equal to 0.

[0236] For another example, when the state of the scanned object is that the scanned object is magnified to a large extent in the viewfinder image, the required tracking time threshold is longer, and in this case the sixth adjustment time can be set to be greater than or equal to 0. If the scanned object is magnified to a small extent in the viewfinder image, the required tracking time threshold is shorter; in this case the sixth adjustment time can be set to be less than or equal to 0. Similarly, the sixth adjustment time when the scanned object occupies a large proportion in the viewfinder image can be set to be greater than the sixth adjustment time when the proportion is small. The sixth adjustment time corresponding to when the brightness of the scanned object is too high or too low can be set to be greater than the sixth adjustment time corresponding to when the brightness is normal, and so on. It should be understood that the above-mentioned setting of the sixth adjustment time is only an example. In actual situations, different sixth adjustment times can also be set in combination with other states of the scanned object.

[0237] It should be understood that the settings of the third adjustment time, the fourth adjustment time, the fifth adjustment time and the sixth adjustment time corresponding to the above different environmental parameter values ​​are only examples. In other embodiments, they can also be set to other adjustment times according to actual conditions.

[0238] Taking the scanning environment as an example, where the first scan is performed, the type of the scanned document is an electronic document, the proportion of the scanned document in the viewfinder of mobile phone 1 is less than the preset proportion threshold, and mobile phone 1 is unstable, the initial tracking time is adjusted according to the adjustment time corresponding to each environmental parameter value to obtain the tracking time threshold: T 跟踪 =T 初始 +T1 调节 +T3 调节 +T7 调节 +T8 调节 .

[0239] The above examples illustrate different adjustment times for different types of scanned objects. However, in practice, there may be scanned objects of types not listed above. If mobile phone 1 detects that the type of the scanned object does not belong to any of the pre-set scanned object types, mobile phone 1 can obtain a default adjustment time. In some embodiments, the default adjustment time can be set to 0. That is, if mobile phone 1 detects that the scanned object does not belong to the pre-set type, the initial tracking time is not adjusted. In other words, when the scanned object type does not belong to the pre-set type, the fifth adjustment time is 0.

[0240] In addition, in some embodiments, the fifth adjustment time and the sixth adjustment time can be set separately or combined. That is, for the same type of scanned workpiece, a corresponding adjustment time (the sum of the fifth adjustment time and the sixth adjustment time) is set according to the different states of the scanned workpiece. In some embodiments, Table 1 shows some examples of different adjustment times set for different types of scanned workpieces. It should be understood that the adjustment times shown in Table 1 are only examples, and in other embodiments, the adjustment times can be set to other values ​​according to actual conditions.

[0241] Table 1

[0242]

[0243]

[0244] The above example shows two different stability levels for mobile phone 1: stable and unstable. As can be seen from the above examples, more than two different stability levels can be set for mobile phone 1. In this example, a corresponding adjustment time can be set for each stability level. For example, six different stability levels are defined, ranging from stable to unstable: level 1, level 2, level 3, level 4, level 5, and level 6. The smaller the number corresponding to the stability level, the higher the stability level.

[0245] In some embodiments, the first, second, and third levels of stability can be classified as indicating that the mobile phone 1 is stable, while the fourth, fifth, and sixth levels of stability can be classified as indicating that the mobile phone 1 is unstable. Specifically, when the mobile phone 1 detects that the current scan is the first time and that the stability of the mobile phone 1 is at the first, second, or third level of stability, the corresponding adjustment time will be determined as the first adjustment time based on the environmental parameter value, that is, the tracking time threshold will be set to 0. When the mobile phone 1 detects that the current scan is not the first time, or that the stability of the mobile phone 1 is at the fourth, fifth, or sixth level of stability, the corresponding adjustment time will be determined as the second adjustment time based on the environmental parameter value.

[0246] Furthermore, for the above six levels of stability, corresponding fourth adjustment time is set respectively, such as T10 调节 -T15 调节 Table 2 shows some examples of the fourth adjustment time set for different stable states of the mobile phone 1. It should be understood that the fourth adjustment time shown in Table 2 is only an example, and in other embodiments, the adjustment time can be set to other values ​​according to actual conditions.

[0247] Table 2

[0248]

[0249] In this embodiment, the mobile phone 1 can first obtain the initial tracking time T 初始 , and then find the adjustment time corresponding to the environmental parameter value of the current scanning environment. Take the scanning environment including the first scan, the type of the scanned object is an electronic document, the proportion of the scanned object in the viewfinder of mobile phone 1 is less than the preset proportion threshold, and the stability of mobile phone 1 is level 6 stability (corresponding to unstable mobile phone 1) as an example, according to the adjustment time corresponding to each environmental parameter value, the initial tracking time is adjusted to obtain the tracking time threshold: T 跟踪 =T 初始 +T1 调节 +T3 调节 +T13 调节 +T8 adjustment.

[0250] In the technical solution provided in the embodiments of this application, different tracking time thresholds are further subdivided according to the different states of the same type of scanned document and the different stability levels of the mobile phone 1. The tracking time thresholds can be set in different scanning environments to better suit the current scanning environment. In this way, the mobile phone 1 can further improve scanning efficiency while still meeting the required clarity requirements for electronic scans.

[0251] In an embodiment in which an initial tracking time is set and a corresponding adjustment time is set for each environmental parameter value, the preset scanning environmental parameters can be divided into different levels. When the mobile phone 1 determines the tracking time threshold based on the environmental parameter value, the initial tracking time can be adjusted in turn based on the preset scanning environmental parameters corresponding to each level.

[0252] Exemplarily, it is determined whether the scanning operation being performed is the first scan after entering the automatic scanning mode in this round, and the corresponding adjustment time can be set to the first-level adaptive adjustment in combination with the judgment result. The stability of the mobile phone 1 is determined, and the corresponding adjustment time can be set to the second-level adaptive adjustment in combination with the judgment result. The type of the scanned object and the state of the scanned object are determined, and the corresponding adjustment time can be set to the third-level adaptive adjustment in combination with the judgment result. Alternatively, the tracking time threshold value adjusted according to the type of the scanned object and the state of the scanned object can be set to the first-level adaptive adjustment, the tracking time threshold value adjusted according to the stability of the mobile phone 1 can be set to the second-level adaptive adjustment, and the tracking time threshold value adjusted according to whether it is the first scan can be set to the third-level adaptive adjustment. It should be understood that the levels of the above-mentioned preset scanning environment parameters are only examples. In other embodiments, the preset scanning environment parameters can be set to adaptive adjustment levels in other ways.

[0253] In the above embodiment, the adjustment time of the tracking time threshold is set according to the level of different scanning environments, and the first level of adaptive adjustment corresponds to an adjustment time T 一级调节 , the second-level adaptive adjustment corresponds to an adjustment time T 二级调节 , the three-level adaptive adjustment corresponds to an adjustment time T 三级调节 Except for the first scan and when the mobile phone 1 is stable, the tracking time threshold can be expressed as T 跟踪 =T 初始 +T 一级调节 +T 二级调节 +T 三级调节 In the case of the first scan and when the mobile phone 1 is stable, the tracking time threshold can be expressed as T 跟踪 =0.

[0254] In some embodiments, in the aforementioned embodiments of classifying different scanning environments into different adaptive adjustment levels, the primary, secondary, and tertiary determinations can be performed in parallel. This reduces the time required to determine the tracking time threshold and effectively improves scanning efficiency. In other embodiments, the primary, secondary, and tertiary determinations can also be performed serially.

[0255] In the above embodiment, mobile phone 1 first obtains an initial tracking time and then sequentially adjusts this initial tracking time based on various environmental parameter values. That is, regardless of the scanning environment, the same initial tracking time is obtained. In other embodiments, considering that scanned objects during an automatic scan are typically of the same type and in the same state, S405 can also specifically determine a baseline tracking time based on the type and state of the scanned object. Subsequently, the baseline tracking time is adjusted based on whether this is the first scan and the stable state of mobile phone 1 to obtain a tracking time threshold.

[0256] Taking the determination of whether the first adaptive adjustment is made as the first level and the determination of the stability of the mobile phone 1 as the second level adaptive adjustment as an example, in this embodiment, the tracking time threshold can be determined according to the first level adaptive tracking time, the second level adaptive tracking time and the third level adaptive tracking time (i.e., the reference tracking time), which can be expressed as: T 跟踪 =T 一级 +T 二级 +T 三级(基准) The first-level adaptive tracking time and the second-level adaptive tracking time can be set with reference to the adjustment time for whether it is the first scan and the stability of the mobile phone 1 in the above embodiment, and can be set to positive or negative numbers.

[0257] The three-level adaptive tracking time can be determined based on the type of scanned object. Table 3 shows, in some embodiments, the three-level adaptive tracking time, or baseline tracking time, set for different scanned object types and states. It should be understood that the baseline tracking time shown in Table 3 is merely an example; in other embodiments, the baseline tracking time can be set to other values ​​based on actual circumstances.

[0258] Table 3

[0259]

[0260] In the technical solution provided in the embodiments of the present application, a baseline value for tracking time is set based on the type and status of the scanned object. This baseline value is then adjusted based on whether it is the first scan and the stability of the mobile phone 1. This can also yield a tracking time threshold corresponding to the current scanning environment parameter values. This allows for different tracking time thresholds to be set for different scanning environments.

[0261] S406. Mobile phone 1 starts counting and tracking time.

[0262] In some embodiments, the mobile phone 1 counts the tracking time, which can be specifically achieved through a tracking time timer.

[0263] The tracking time counter is used to record the tracking time during the current scanning operation. In some embodiments, the above S406 may specifically include: the mobile phone 1 resets the tracking time counter to zero and then begins to measure the tracking time. In some embodiments, the mobile phone 1 may reset the tracking time counter to zero and begin measuring the tracking time after detecting the scanned object and determining the position of the scanned object in the viewfinder. This ensures accurate tracking time measurement.

[0264] After the mobile phone 1 starts counting the tracking time, the mobile phone 1 or the scanned object may still change, such as if the mobile phone 1 or the scanned object is moved, or if the scanned object in the viewfinder is obscured by other objects. In this case, if the mobile phone 1 continues to count the tracking time and performs a scanning operation when the tracking time reaches the tracking time threshold, it is very likely that the scanned object will be blurred or incomplete. Therefore, in some embodiments, after the mobile phone 1 starts counting the tracking time, it will continue to detect the scanned object in the viewfinder to determine whether the tracked target (scanned object) has maintained the same state. If not, the scanning operation should not be performed.

[0265] In some embodiments, as Figure 7B As shown, after S406, the above method further includes S704:

[0266] S704. Mobile phone 1 determines whether the scanned document is updated.

[0267] Since mobile phone 1 executes S406 only after detecting the scanned object, after S406, mobile phone 1 only needs to confirm whether the previously detected scanned object has been updated. If the scanned object is not updated during the tracking process, the tracking time can be continuously counted until the tracking time threshold is reached, and then S407 is executed. If the scanned object is updated during the tracking process, mobile phone 1 needs to re-detect the new scanned object, that is, return to S403a. In some embodiments, if mobile phone 1 detects that the scanned object has been updated during the tracking process, it can also be considered as losing the tracking target.

[0268] In combination with the above description, it can be seen that the mobile phone 1 detects whether the scanned part has been updated. Specifically, the mobile phone 1 can capture a frame of image at a preset time interval and detect the captured image to determine whether the scanned part exists therein, and when the scanned part is detected, determine whether the scanned part is updated compared with the scanned part in the last captured image.

[0269] In some embodiments, the mobile phone 1 determines whether the scanned object has been updated compared to the scanned object in the last captured image. Specifically, the mobile phone 1 may extract feature points from two adjacent captured images and compare them to determine whether the scanned object has been updated. When extracting feature points for comparison, the mobile phone 1 may determine that the scanned object in the viewfinder has been updated when a change in the feature points between two adjacent captured images is detected to be greater than a preset change threshold. The preset change threshold may be set to any value based on actual circumstances, such as 20%, 30%, 40%, etc.

[0270] Because the extraction and comparison of feature points in the image is fast, the detection speed can be improved. After determining that the scanned object has been updated, the detection can be quickly returned to the original state, avoiding the situation where the mobile phone 1 cannot capture a stable image of the scanned object when performing the scanning operation. This improves the accuracy of the automatic scanning mode of the mobile phone 1.

[0271] In other embodiments, the mobile phone 1 may also identify the content in the image and compare the content of the scanned object detected in the currently captured image with the content of the scanned object detected in the last captured image to determine whether the scanned object has been updated. This can improve the accuracy of detecting whether the scanned object has been updated and reduce the possibility of repeated scanning operations on the same scanned object.

[0272] S407. Mobile phone 1 determines whether the tracking time reaches the tracking time threshold.

[0273] As can be seen from the above embodiment, in automatic scanning mode, the scanning process for a scanned object sequentially includes detection, tracking, image acquisition, and correction. When it is detected that the tracking time of the scanned object before the current scanning operation has reached the tracking time threshold, correction of the detected scanned object begins, as shown in S408.

[0274] In some embodiments, when the mobile phone 1 continuously detects whether the scanned document is updated during the tracking process, if the mobile phone 1 determines that the tracking time has not reached the tracking time threshold, the mobile phone 1 can return to detect whether the scanned document is updated, such as Figure 7B It should be noted that after the mobile phone 1 starts timing the tracking time in S406, the mobile phone 1 can first determine whether the scanned document has been updated, and then determine whether the tracking time has reached the threshold. The mobile phone 1 can also first determine whether the tracking time has reached the tracking time threshold, and then determine whether the scanned document has been updated. Alternatively, the mobile phone 1 can also simultaneously determine whether the tracking time has reached the tracking time threshold and whether the scanned document has been updated. Figure 7B The execution order of S704 and S407 is not limited. As long as it is determined that the scanned document remains unchanged and the tracking time reaches the tracking time threshold, the subsequent steps, such as S408, can be executed.

[0275] S408. Mobile phone 1 performs a scanning operation on the scanned document to obtain an electronic scanned document.

[0276] In some embodiments, the mobile phone 1 performs a scanning operation on the scanned document, which may specifically include the mobile phone 1 capturing and correcting an image of the scanned document to obtain a corrected electronic scanned document.

[0277] In some embodiments, the mobile phone 1 captures an image of the scanned object, which may specifically include: the mobile phone 1 captures an image in an image area corresponding to the scanned object detected, i.e., an image corresponding to the scanned object. The mobile phone 1 then corrects the captured image corresponding to the scanned object to obtain an electronic scan of the scanned object.

[0278] In order to acquire an electronic scan that is closer to the scanned object, the scanned object should generally be scanned without obstruction. However, as can be seen from the description of the above embodiments, the type of the scanned object may be a paper document, and the paper document may need to be held by the user as the scanned object, or the user may use other objects to maintain the stability of the paper document. Or the scanned object is an electronic document, and the user's hand or other objects such as a remote control are in the viewfinder of the scanned object. In this scenario, if the user's hand or other object always appears in the viewfinder of the scanned object, no scanning is performed, and automatic scanning will not be possible. Therefore, in some embodiments, it is possible to determine whether the scanned object is obstructed, and to determine whether automatic scanning needs to be performed by determining whether the hand is in motion.

[0279] In some embodiments, after the above S407, before the mobile phone 1 performs scanning and correction, it can also be determined whether the scanned object is blocked. Figure 8 As shown, the above method further includes S801-S802:

[0280] S801. Mobile phone 1 determines whether there is any obstructing object on the scanned document.

[0281] For example, the blocking object may include a user's hand, a remote control, a ruler, a pen, a stapler, or a mobile phone, a cup, etc. After S801, if the mobile phone 1 determines that there is a blocking object, it further determines whether the blocking object is in motion, such as S802:

[0282] S802. Mobile phone 1 determines whether the blocking object is in motion.

[0283] If the obstructing object is detected to be in motion, it means that the current user may be moving the obstructing object out of the view of the scanned object. In this case, the scanning operation should not be performed. Instead, the scanning operation should be performed after the user moves the obstructing object to a point where it no longer obstructs the scanned object. Figure 8 As shown, if it is determined that the blocking object is in motion, the process returns to continue executing S802.

[0284] If it is determined that there is an obstructing object on the scanned object, and the obstructing object is not in motion, it may mean that the obstructing object needs to appear within the viewfinder of the scanned object, such as when the user holds the scanned object or uses other objects to keep the scanned object stable. In this case, the scanning operation should be performed, such as Figure 8 As shown, the process proceeds to S408.

[0285] In the technical solution provided in the embodiment of the present application, when a portion of the scanned document is obscured by an obstructing object, it is determined whether it is necessary to immediately perform scanning and correction. This can avoid the problem that the mobile phone 1 cannot perform the automatic scanning operation when the obstructing object obscures part of the content of the scanned document. If there is an obstructing object on the scanned document, the scanning operation is performed when the obstructing object no longer moves. In this way, the possibility of scanning the obstructing object in the electronic scanned document is reduced, and the degree of restoration of the scanned electronic scanned document to the original content of the scanned document is improved. At the same time, it is ensured that the mobile phone 1 can smoothly and automatically perform the scanning operation in the automatic scanning mode.

[0286] The specific implementation process of the mobile phone 1 correcting the electronic scanned document can refer to the description in the relevant technology and will not be repeated in the embodiment of the present application.

[0287] At this point, a scan in the automatic scanning mode is completed, and the mobile phone 1 obtains an electronic scan. Further, the mobile phone 1 can also save the electronic scan obtained by the mobile phone 1.

[0288] S409. Mobile phone 1 saves the electronic scanned copy.

[0289] In some embodiments, the mobile phone 1 stores the corrected electronic scan.

[0290] In the technical solution provided by the embodiments of this application, different tracking time thresholds are set during the automatic scanning process according to different scanning environments, so that the time required for a single scan in the automatic scanning mode varies with the scanning environment. This reduces the time required to perform the scanning operation and improves scanning efficiency while ensuring the scanning effect in the scanning environment.

[0291] Furthermore, after a single scan of the automatic scan is completed, the mobile phone 1 can prepare to perform the next scan. Figure 4A After S409, the above method can return to continue to execute S403-S409. In addition, since a single scan is completed, the number of scans can be increased by 1 before the mobile phone 1 performs the next scan. Please continue to refer to Figure 6 Before mobile phone 1 returns to execute S403, it also includes S602:

[0292] S602. Number of scans = number of scans + 1.

[0293] In the technical solution provided in the embodiment of the present application, in the automatic scanning mode, after the mobile phone 1 performs a single scanning operation, the number of scans is recorded so as to determine the tracking time threshold according to the number of scans.

[0294] Some other embodiments of the present application provide an electronic device, which may be the above-mentioned electronic device (such as mobile phone 1). The electronic device may include: a memory and one or more processors. The memory is coupled to the processor. The memory is also used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device may execute the various functions or steps performed by the mobile phone 1 in the above-mentioned method embodiment. When the electronic device is an electronic device, its structure can refer to Figure 2 The structure of the electronic device 100 is shown.

[0295] The present application also provides a chip system. Figure 9 As shown, the chip system 90 includes at least one processor 901 and at least one interface circuit 902. The processor 901 and the interface circuit 902 can be interconnected via lines. For example, the interface circuit 902 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 902 can be used to send signals to other devices (such as the processor 901). Exemplarily, the interface circuit 902 can read instructions stored in the memory and send the instructions to the processor 901. When the instruction is executed by the processor 901, the electronic device can execute the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiments of the present application.

[0296] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device (such as mobile phone 1), the electronic device executes the various functions or steps executed by mobile phone 1 in the above-mentioned method embodiment.

[0297] The present application also provides a computer program product, which, when executed on a computer, enables the computer to execute the functions or steps executed by the mobile phone 1 in the above method embodiment.

[0298] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0299] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, 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, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0300] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0301] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0302] If the integrated 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 readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0303] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A scanning method, characterized in that: The method is applied to an electronic device, and includes: In the automatic scanning mode, after detecting the scanned object, the electronic device obtains environmental parameter values ​​of preset scanning environmental parameters; the preset scanning environmental parameters include: the state of the scanned object; wherein the state of the scanned object includes whether the scanned object is held by a user, whether the scanned object is placed on a stable plane, the proportion of the scanned object in the viewfinder of the electronic device, the magnification or reduction ratio of the scanned object in the viewfinder of the electronic device, and the relative angle between the scanned object and the electronic device; The electronic device determines a tracking time threshold for performing the current scanning operation according to the environmental parameter value; the tracking time threshold is directly proportional to the proportion of the scanned object in the viewfinder image of the electronic device; The electronic device starts timing and tracking time; When the tracking time reaches the tracking time threshold, the electronic device performs a scanning operation on the scanned object.

2. The method according to claim 1, characterized in that Before the electronic device detects the scanned document, the method further includes: In response to a first event, the electronic device enters an automatic scanning mode; the first event is used to trigger the automatic scanning mode.

3. The method according to claim 1, characterized in that The preset scanning environment parameters further include: at least one of the number of scans performed by the electronic device since entering the automatic scanning mode in this round, the stability of the electronic device, and the type of the scanned object; The stability of the electronic device is used to indicate whether the electronic device is moving.

4. The method according to any one of claims 1 to 3, characterized in that Before the electronic device detects the scanned document, the method further includes: The electronic device acquires an initial tracking time; The electronic device determines, according to the environmental parameter value, a tracking time threshold for performing the current scanning operation, including: The electronic device obtains an adjustment time corresponding to the environmental parameter value; The electronic device adjusts the initial tracking time according to the adjustment time to obtain the tracking time threshold.

5. The method according to claim 4, characterized in that The preset scanning environment parameters include: the number of scans performed by the electronic device since entering the automatic scanning mode in this round, the stability of the electronic device, the type of the scanned object, and the status of the scanned object; the adjustment time corresponding to the environmental parameter value obtained by the electronic device includes: When the number of scans is 0 and the stability of the electronic device is stable, the electronic device determines that the adjustment time corresponding to the environmental parameter value is a first adjustment time; the first adjustment time is less than 0, and the absolute value of the first adjustment time is equal to the initial tracking time; When the number of scans is not 0 and / or the stability of the electronic device is unstable, the electronic device determines that the adjustment time corresponding to the environmental parameter value is the second adjustment time; the second adjustment time is: the sum of the third adjustment time corresponding to the number of scans, the fourth adjustment time corresponding to the stability of the electronic device, the fifth adjustment time corresponding to the type of the scanned object, and the sixth adjustment time corresponding to the state of the scanned object; wherein, when the second adjustment time is less than 0, the absolute value of the second adjustment time is less than the initial tracking time.

6. The method according to claim 5, characterized in that When the number of scans is 0, the third adjustment time is less than 0; when the number of scans is not 0, the third adjustment time is greater than or equal to 0.

7. The method according to claim 5, characterized in that When the stability of the electronic device is stable, the fourth adjustment time is less than or equal to 0; when the stability of the electronic device is unstable, the fourth adjustment time is greater than 0.

8. The method according to claim 5, characterized in that When the type of the scanned object belongs to a preset type, the fifth adjustment time is not equal to 0; the preset types include a first type, a second type, a third type, and a fourth type; the first type includes a type that does not require user operation; the second type includes a type that requires user operation and the scanned object is placed flat; the third type includes a type that requires user operation, the scanned object is not placed flat, and the size of the scanned object is smaller than a preset threshold; the fourth type includes a type that requires user operation, the scanned object is not placed flat, and the size of the scanned object is greater than or equal to the preset threshold; When the type of the scanned object does not belong to the preset type, the fifth adjustment time is equal to 0.

9. The method according to claim 8, characterized in that The first type includes: electronic documents; the second type includes single-page paper documents placed flat; the third type includes book pages, single-page paper documents that are not placed flat and whose size is smaller than the preset threshold; the fourth type includes single-page paper documents that are not placed flat and whose size is greater than or equal to the preset threshold.

10. The method according to claim 4, characterized in that The electronic device stores a correspondence between different environmental parameter values ​​of the preset scanning environmental parameters and adjustment time; The electronic device obtains the adjustment time corresponding to the environmental parameter value, including: The electronic device searches the corresponding relationship for an adjustment time corresponding to the environmental parameter value.

11. The method according to claim 3, characterized in that The preset scanning environment parameters include: the number of scans performed by the electronic device since entering the automatic scanning mode in this round, the stability of the electronic device, the type of the scanned object, and the status of the scanned object; the electronic device determines the tracking time threshold for performing the current scanning operation based on the environmental parameter values, including: The electronic device determines a reference tracking time according to the type of the scanned object and the state of the scanned object; different types of scanned objects correspond to different reference tracking times; The electronic device determines a scan number adjustment time according to the scan number, and determines a stability adjustment time according to the stability of the electronic device; The electronic device adjusts the reference tracking time according to the scanning number adjustment time and the stability adjustment time to obtain the tracking time threshold.

12. The method according to any one of claims 1-3 and 5-11, characterized in that The method further comprises: During the first scanning in the automatic scanning mode in this round, the electronic device obtains the environmental parameter value of the preset scanning environmental parameter when detecting the scanned object.

13. The method according to claim 12, characterized in that The method further comprises: In this round of scanning that is not the first time entering the automatic scanning mode, the electronic device obtains the environmental parameter value of the preset scanning environmental parameter when detecting the scanned object and the scanned object is updated.

14. The method according to claim 13, characterized in that The method further comprises: If the electronic device does not detect the scanned object, and / or the scanned object is not updated, the electronic device determines whether the viewfinder screen of the electronic device enters a motion state; If the electronic device does not enter a motion state within the sleep time threshold, the electronic device starts a low-power camera mode; in the low-power camera mode, the electronic device continuously detects whether the viewfinder screen enters a motion state, and the electronic device no longer detects the scanned object.

15. The method according to claim 14, characterized in that After the electronic device starts the low power camera mode, the method further includes: When it is detected that the viewfinder screen enters a motion state, the electronic device exits the low-power camera mode and re-detects the scanned object.

16. The method according to claim 2, characterized in that After the electronic device enters the automatic scanning mode and before the electronic device performs a scanning operation on the scanned object, the method further includes: The electronic device sets the number of scans to zero; After the electronic device performs a scanning operation on the scanned object, the method further includes: The electronic device adds 1 to the number of scans and continues to detect the scanned object.

17. An electronic device, characterized in that: The electronic device comprises: a processor and a memory; the memory stores computer program code, the computer program code comprising computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 16.

18. A computer-readable storage medium, characterized in that The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • Information processing apparatus, method for controlling the same

    CN104519233A