Deduplication method and electronic device
By automatically determining the similarity and text-image inclusion relationship of scanned images in electronic devices and combining this with quality scoring, efficient and accurate deduplication of scanned images is achieved. This solves the problems of low efficiency and poor accuracy of manual deduplication by users and improves the user experience.
Patent Information
- Application Number
- CN202211615199.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-12-15
AI Technical Summary
Existing methods for deduplicating images scanned by electronic devices rely on manual operation by the user, which is inefficient and inaccurate.
By determining the image similarity and text-image inclusion relationship of scanned images, and combining this with a quality score, the system automatically performs deduplication on the scanned images.
It achieves efficient and accurate deduplication of scanned images, improving the user experience.
Smart Images

Figure CN118214809B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a deduplication method and electronic device. Background Art
[0002] With the development of terminal technology, electronic devices (such as mobile phones) can perform more and more functions. For example, scanning can be performed through electronic devices.
[0003] Currently, electronic devices can scan paper documents or electronic documents awaiting scanning. A document to be scanned typically includes at least one object. For example, the object could be an A4 sheet of paper containing images and / or documents. When scanning with an electronic device, the same object may be scanned multiple times, and then the desired image is selected from the resulting scans. During this process, the electronic device needs to deduplicate the scanned images. Current deduplication methods rely on the user's selection of redundant images, followed by user confirmation before deletion. This requires manual operation for each redundant image, resulting in low efficiency and poor accuracy due to the user's subjective selection of redundant images. Summary of the Invention
[0004] This application provides a deduplication method and electronic device to solve the problems of low efficiency and poor accuracy when deduplicating scanned images based on manual user operation.
[0005] In a first aspect, embodiments of this application provide a deduplication method, the method comprising:
[0006] Obtain the first scanned image, which is a scanned image of the document to be scanned;
[0007] The image similarity between the first scanned image and each of the at least one second scanned image is determined, wherein the second scanned image is a scanned image of the document to be scanned obtained prior to the first scanned image;
[0008] Based on the image similarity, the first scanned image and the at least one second scanned image are divided into at least one image set;
[0009] Determine the text-image inclusion relationships among the scanned images in each of the image sets and the quality score of each scanned image;
[0010] Upon receiving the operation to generate an electronic document, the first scanned image and the at least one second scanned image are deduplicated based on the image-text inclusion relationship and the quality score.
[0011] In this way, the electronic device can determine the image similarity of scanned images. Then, based on the obtained image similarity, similar scanned images can be grouped into image sets. Next, the image-text inclusion relationships among the scanned images in each image set and the quality score of each scanned image in each image set can be determined. Finally, based on the image-text inclusion relationships among the scanned images in each image set and the quality score of each scanned image in each image set, duplicate images are removed. It is evident that through this method, the electronic device can automatically perform image similarity analysis on scanned images, and then accurately and efficiently remove duplicate scanned images based on the image-text inclusion relationships between scanned images and the quality scores of each scanned image, resulting in a better user experience.
[0012] Furthermore, following the above method, after each new scanned image is obtained by the electronic device, the similarity between the newly obtained scanned image and each previously obtained scanned image is determined in real time, as well as the text-image inclusion relationship between each scanned image and the quality score of each scanned image. Subsequently, after receiving the operation to generate an electronic document, the scanned images can be deduplicated quickly and efficiently based on the previously determined text-image inclusion relationship and quality score, resulting in higher deduplication efficiency.
[0013] In one possible implementation, the third scanned image is any one of the at least one second scanned image;
[0014] Determining the image similarity between the first scanned image and the third scanned image includes:
[0015] Determine the cosine similarity between the first scanned image and the third scanned image;
[0016] The cosine similarity is determined as the image similarity between the first scanned image and the third scanned image.
[0017] In this way, the similarity between the first scanned image and any second scanned image can be determined quickly and accurately, thus quickly and accurately determining whether the two scanned images are similar, which has good applicability.
[0018] In one possible implementation, the third scanned image is any one of the at least one second scanned image;
[0019] Determining the image similarity between the first scanned image and the third scanned image includes:
[0020] Obtain a preset number of first feature points and a preset number of second feature points, wherein the first feature points are feature points of the first scanned image and the second feature points are feature points of the third scanned image;
[0021] A first quantity is determined, which is the number of second feature points that match the first feature point;
[0022] The ratio of the first quantity to the preset quantity is determined as the image similarity between the first scanned image and the third scanned image.
[0023] In this way, the similarity between the first scanned image and any second scanned image can be determined quickly and accurately, thus quickly and accurately determining whether the two scanned images are similar, which has good applicability.
[0024] In one possible implementation, the third scanned image is any one of the at least one second scanned image;
[0025] Determining the image similarity between the first scanned image and the third scanned image includes:
[0026] Identify the same first layout and second layout, where the first layout is the layout of the first scanned image and the second layout is the layout of the third scanned image;
[0027] Determine the character similarity between the identical first and second page layouts;
[0028] The mean of all character similarities is determined to be the image similarity between the first scanned image and the third scanned image.
[0029] In this way, the similarity between the first scanned image and any second scanned image can be determined quickly and accurately, thus quickly and accurately determining whether the two scanned images are similar, which has good applicability.
[0030] In one possible implementation, determining the image-text inclusion relationship between each scanned image in each image set includes:
[0031] The text-image inclusion relationship between each scanned image in each image set is determined using optical character recognition methods.
[0032] This allows for precise determination of whether any two scanned images are identical, contain each other, or are adjacent, facilitating accurate deduplication of all subsequent scanned images.
[0033] In one possible implementation, determining the quality score for each scanned image in each of the image sets includes:
[0034] Determine the quality parameters and weighting coefficients of each scanned image in each image set, wherein the quality parameters include at least one of the following: peak signal-to-noise ratio, structural similarity, image enhancement factor, and general quality index;
[0035] Based on the quality parameters and their weighting coefficients, a quality score is determined for each scanned image in each image set.
[0036] This allows for precise determination of the quality of each scanned image. When deduplicating identical scanned images later, lower-quality redundant images can be removed, while higher-quality scanned images are retained, resulting in a better user experience.
[0037] In one possible implementation, determining the quality score for each scanned image in each of the image sets includes:
[0038] Determine the confidence level of the characters in each scanned image in each of the image sets;
[0039] A quality score for each scanned image in each image set is determined based on the confidence level.
[0040] This allows for precise determination of the quality of each scanned image. When deduplicating identical scanned images later, lower-quality redundant images can be removed, while higher-quality scanned images are retained, resulting in a better user experience.
[0041] In one possible implementation, the step of deduplicating the first scanned image and the at least one second scanned image based on the image-text inclusion relationship and the quality score includes:
[0042] Based on the image-text inclusion relationship and the quality score, redundant images are identified in the first scanned image and the at least one second scanned image;
[0043] Upon receiving the user's deduplication request, the redundant images are deleted.
[0044] This method removes redundant images from identical scanned images and from scanned images with overlapping relationships. Furthermore, the retained scanned images are of higher quality, allowing for the generation of higher-quality electronic documents. Additionally, after deduplication, scanned images with parallel image-text relationships are still preserved, ensuring users receive complete electronic documents without losing any information from the original scanned document, resulting in a better user experience.
[0045] Secondly, embodiments of this application provide another deduplication method, which includes:
[0046] Obtain at least one scanned image of the document to be scanned;
[0047] After receiving the operation to generate an electronic document, determine the image similarity between the scanned images in the at least one scanned image;
[0048] Based on the image similarity, the at least one scanned image is divided into at least one image set;
[0049] Determine the text-image inclusion relationships among the scanned images in each of the image sets and the quality score of each scanned image;
[0050] Based on the image-text inclusion relationship and the quality score, the at least one scanned image is deduplicated.
[0051] In this way, after the electronic device obtains any new scanned image, it does not immediately determine the image similarity between the new scanned image and each of the previously obtained scanned images, the text-image inclusion relationships between the scanned images, or the quality score of each scanned image. Instead, after receiving the command to generate an electronic document, it begins to determine the image similarity of each of the at least one previously obtained scanned image. Based on the image similarity, it further determines the text-image inclusion relationships between the scanned images and the quality score of each scanned image. Then, it removes duplicates from all the obtained scanned images. Therefore, according to this method, image similarity calculations are only performed after receiving the command to generate an electronic document. If the command to generate an electronic document is not received, the electronic device will not perform image similarity calculations, thus avoiding the waste of the electronic device's computing resources.
[0052] Thirdly, embodiments of this application provide another deduplication method, which includes:
[0053] After the deduplication condition is met, at least one stored image is obtained, including the scanned image;
[0054] Determine the image similarity among the stored images in the at least one stored image;
[0055] Based on the image similarity, the at least one stored image is divided into at least one image set;
[0056] Determine the text-image inclusion relationships among the stored images in each of the image sets and the quality score of each stored image;
[0057] Based on the image-text inclusion relationship and the quality score, the at least one stored image is deduplicated.
[0058] In this way, electronic devices can periodically deduplicate all or some of the images stored on them, thus avoiding waste of storage resources. Alternatively, electronic devices can also deduplicate all or some of the images stored on them based on user actions, which not only avoids wasting storage resources but also improves user experience and adaptability.
[0059] Fourthly, embodiments of this application provide an electronic device comprising: one or more processors and one or more memories; wherein the one or more memories store computer programs or instructions, and when the computer programs or instructions are executed by the one or more processors, the electronic device performs the method described in any one of the first to third aspects.
[0060] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions, which, when executed, perform the method described in any one of the first to third aspects.
[0061] As can be seen, the deduplication method provided in this application allows electronic devices to determine the image similarity of scanned images. Then, based on the obtained image similarity, similar scanned images can be grouped into image sets. Next, the image-text inclusion relationship between scanned images in each image set and the quality score of each scanned image in each image set can be determined. Finally, based on the image-text inclusion relationship between scanned images in each image set and the quality score of each scanned image in each image set, all scanned images can be deduplicated to remove redundant images. Therefore, through this method, electronic devices can automatically perform image similarity analysis on scanned images, and then accurately and efficiently deduplicate similar scanned images based on the image-text inclusion relationship between scanned images and the quality score of each scanned image, resulting in a better user experience. Attached Figure Description
[0062] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0063] Figure 2 This is a software structure block diagram of an electronic device provided in an embodiment of this application;
[0064] Figure 3 This is a flowchart illustrating a deduplication method provided in an embodiment of this application;
[0065] Figure 4 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0066] Figure 5 This is a schematic diagram of another application scenario provided by an embodiment of this application;
[0067] Figure 6 This is a flowchart illustrating a method for determining the image similarity between a first scanned image and a third scanned image, as provided in an embodiment of this application.
[0068] Figure 7This is a flowchart illustrating another method for determining the image similarity between a first scanned image and a third scanned image, provided in an embodiment of this application.
[0069] Figure 8 This is a flowchart illustrating another method for determining the image similarity between a first scanned image and a third scanned image, provided in an embodiment of this application.
[0070] Figure 9 This is a schematic diagram of another application scenario provided by an embodiment of this application;
[0071] Figure 10 This is a schematic diagram of another application scenario provided by an embodiment of this application;
[0072] Figure 11 This is a schematic diagram of another application scenario provided by an embodiment of this application;
[0073] Figure 12 This is a schematic diagram of another application scenario provided by an embodiment of this application;
[0074] Figure 13 This is a schematic diagram of another application scenario provided by an embodiment of this application;
[0075] Figure 14 This is a schematic diagram of another application scenario provided by an embodiment of this application;
[0076] Figure 15 This is a schematic diagram of another application scenario provided by an embodiment of this application;
[0077] Figure 16 This is a flowchart illustrating another deduplication method provided in an embodiment of this application;
[0078] Figure 17 This is a flowchart illustrating another deduplication method provided in an embodiment of this application;
[0079] Figure 18 This is a structural block diagram of a de-duplication device provided in an embodiment of this application;
[0080] Figure 19 This is a structural block diagram of a chip provided in an embodiment of this application. Detailed Implementation
[0081] The technical solution of this application will now be described with reference to the accompanying drawings.
[0082] In the description of this application, unless otherwise stated, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Furthermore, "at least one" means one or more, "at least two" means two or more, and "multiple" also means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and the terms "first," "second," etc., do not necessarily imply that they are different.
[0083] It should be noted that, in this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0084] To facilitate understanding of the technical solution of this application, the application scenarios of the technical solution provided in this application will be illustrated below.
[0085] With the development of terminal technology, electronic devices (such as mobile phones) are becoming increasingly feature-rich. For example, scanning functions can be integrated into the mobile phone's system. Optionally, the mobile phone's scanning function can be integrated into a camera application. Optionally, it can also be integrated into applications such as memos. This application does not impose any limitations on this. In this way, users can use electronic devices to scan paper documents (such as paper contracts) or electronic documents (such as PPT presentations) awaiting scanning.
[0086] For example, the documents to be scanned may include paper documents, brochures, cards, slides, business cards, exam papers, invoices, etc. For example, paper documents may include books, papers, contracts, reports, official documents, newspapers, certificates, awards, and other ordinary paper documents besides those mentioned above. For example, brochures may include posters, flyers, magazines, book covers, comics, picture books, etc. For example, cards may include ID cards, bank cards, household registration books, driver's licenses, property ownership certificates, business licenses, graduation certificates, degree certificates, marriage certificates, etc. For example, slides may include electronic documents such as PPT, Word, Excel, Keynote displayed or projected onto a monitor, mobile phone screen, tablet screen, projection screen, or electronic screen in a meeting room.
[0087] The document to be scanned may include at least one object to be scanned. For example, the document to be scanned may be a paper contract or paper instruction manual consisting of multiple A4 sheets, where each A4 sheet containing text and / or images (or information) can be a scanning object. As another example, the document to be scanned may be a presentation (PPT, etc.) consisting of multiple slides, where each slide containing text and / or images can be a scanning object.
[0088] When using electronic devices for scanning, each object can be scanned multiple times, resulting in multiple scanned images. Then, the desired images can be selected from these multiple images. However, this process requires the user to manually deduplicate the scanned images, removing redundant images. This necessitates manual selection and deletion of each redundant image, leading to low deduplication efficiency. Furthermore, the selection criteria for redundant images are uncertain due to manual selection, resulting in poor accuracy and consequently, poor accuracy in the subsequent deduplication process, leading to a poor user experience.
[0089] To address the aforementioned issues, embodiments of this application provide a deduplication method and an electronic device. In this method, the electronic device can determine the image similarity of scanned images. Then, based on the obtained image similarity, similar scanned images are grouped into image sets. Next, the image-text inclusion relationship between each scanned image in each image set and the quality score of each scanned image in each image set can be determined. Finally, based on the image-text inclusion relationship between each scanned image in each image set and the quality score of each scanned image in each image set, all scanned images are deduplicated to remove redundant images. Therefore, through the deduplication method provided in this application, the electronic device can automatically perform image similarity analysis on scanned images, and then accurately identify redundant images among similar scanned images based on the image-text inclusion relationship between scanned images and the quality score of each scanned image, thereby achieving accurate and efficient deduplication of scanned images and providing a better user experience.
[0090] It should be noted that the electronic device described in this application can be stationary or mobile. The electronic device can include communication terminals, vehicle-mounted devices, mobile devices, user terminals, mobile terminals, wireless communication devices, portable terminals, user agents, user devices, service equipment, or user equipment (UE), etc., which are devices located at the outermost edge of a computer network and are mainly used for data input and the output or display of processing results. For example, the electronic device can be a mobile phone, tablet device, handheld device with wireless communication capabilities, computing device, vehicle-mounted communication module, or other processing device connected to a wireless modem.
[0091] For example, see Figure 1 , Figure 1 A schematic diagram of the structure of the electronic device 100 is shown.
[0092] 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 speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0093] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0094] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0095] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0096] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0097] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0098] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0099] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.
[0100] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0101] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.
[0102] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.
[0103] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0104] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, or USB Type-C port. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0105] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0106] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0107] The power management module 141 connects 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, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0108] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0109] 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 one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0110] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0111] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0112] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. 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 antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0113] 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, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0114] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0115] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0116] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0117] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0118] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0119] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0120] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0121] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0122] The external storage interface 120 can be used to connect an external memory card, such as a MicroSD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0123] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.
[0124] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0125] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0126] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A. Multiple speakers 170A can be installed in the electronic device 100; for example, a speaker 170A can be installed on the top of the electronic device 100, or a speaker 170A can be installed on the bottom, etc.
[0127] The receiver 170B, also known as a "handpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to hear the voice. In some embodiments, the speaker 170A and the receiver 170B can also be configured as a single component, which is not a limitation of this application.
[0128] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.
[0129] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.
[0130] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0131] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.
[0132] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.
[0133] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.
[0134] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.
[0135] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.
[0136] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.
[0137] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0138] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.
[0139] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.
[0140] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0141] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.
[0142] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0143] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0144] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0145] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support NanoSIM cards, MicroSIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0146] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0147] Figure 2 This is a software structure block diagram of the electronic device 100 according to an embodiment of this application.
[0148] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. In other optional embodiments, an algorithm engine layer can be added between the application framework layer and the system libraries. The algorithm engine layer can include several algorithm engines, such as image and text understanding algorithm engines and document scanning algorithm engines.
[0149] The application layer can include a series of application packages.
[0150] like Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0151] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0152] like Figure 2 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0153] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0154] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0155] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0156] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0157] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0158] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0159] AndroidRuntime consists of core libraries and a virtual machine. AndroidRuntime is responsible for the scheduling and management of the Android system.
[0160] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0161] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0162] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGLES), 2D graphics engines (e.g., SGL), etc.
[0163] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0164] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0165] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0166] A 2D graphics engine is a graphics engine for 2D drawing.
[0167] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0168] The following describes an embodiment of the deduplication method provided in this application.
[0169] See Figure 3 , Figure 3 This is a flowchart illustrating a deduplication method provided in an embodiment of this application. This method can be applied to electronic devices, for example, it can be applied to... Figure 1 and Figure 2 In the electronic device 100 shown. For example... Figure 3 As shown, the method may include the following steps:
[0170] Step S101: Obtain the first scanned image.
[0171] The first scanned image is a scanned image of the document to be scanned. Alternatively, it can be said that the first scanned image is the currently obtained scanned image of the document to be scanned. Or, it can be said that the first scanned image is the most recently obtained scanned image of the document to be scanned. Or, it can be said that the first scanned image is the most recently obtained scanned image of the document to be scanned.
[0172] Optionally, the document to be scanned can be a paper document or an electronic document. The document to be scanned may include at least one object to be scanned, and each object to be scanned may include text and / or image information, etc. It should be noted that the object to be scanned may also include other information, such as table information, etc. This application does not limit this.
[0173] For example, the documents to be scanned may include paper documents, brochures, cards, slides, business cards, exam papers, invoices, etc. For example, paper documents may include books, papers, contracts, reports, official documents, newspapers, certificates, awards, and other ordinary paper documents besides those mentioned above. For example, brochures may include posters, flyers, magazines, book covers, comics, picture books, etc. For example, cards may include ID cards, bank cards, household registration books, driver's licenses, property ownership certificates, business licenses, graduation certificates, degree certificates, marriage certificates, etc. For example, slides may include electronic documents such as PPT, Word, Excel, Keynote displayed or projected onto a monitor, mobile phone screen, tablet screen, projection screen, or electronic screen in a meeting room.
[0174] When the document to be scanned includes multiple objects to be scanned, the first scanned image can be a scanned image of any one of the objects to be scanned in the document.
[0175] The following is an example illustrating a specific application scenario.
[0176] For example, such as Figure 4 As shown, the document to be scanned can be Figure 4 The illustrated instruction manual 400 comprises multiple A4 sheets. Each A4 sheet of the instruction manual 400 can be used as a scanned object. Furthermore, each A4 sheet may contain text and / or images.
[0177] like Figure 5 As shown in (a), the user can click the scan button 501 on the scanning interface 500 of the camera application (APP) of the electronic device. Upon receiving the user's click of the scan button 501 on the scanning interface 500, the electronic device, in response to this operation, can begin scanning the object 401 of the paper instruction manual 400 to be scanned, obtaining... Figure 5 The scanned image shown in (b) is shown in the image.
[0178] Following the above method, each time the electronic device receives a user's click on the scan button 501, it can scan the object 401 to be scanned. After multiple scans, the electronic device can obtain multiple scanned images of the object 401. It can be understood that the electronic device can also, in the same manner, scan other objects in the paper instruction manual 400 besides the object 401 to be scanned, one or more times to obtain multiple scanned images. The most recently obtained scanned image can be used as the first scanned image. In other words, the most recently obtained scanned image can be used as the first scanned image. For example, the most recently obtained scanned image could be... Figure 5 The first scanned image is shown in (b) above. Figure 5The scanned image shown in (b) is shown in the image.
[0179] Step S102: Determine the image similarity between the first scanned image and each of the second scanned images in at least one second scanned image.
[0180] The second scanned image is a scanned image of the document to be scanned obtained before the first scanned image. That is, before obtaining the first scanned image, scanning any object in the document to be scanned will result in a second scanned image. Optionally, after each scan of any object in the document to be scanned and obtaining a scanned image, the obtained scanned images can be stored. That is, both the first scanned image and all second scanned images can be stored.
[0181] Optionally, the first scanned image can be the first scanned image obtained after the electronic device starts scanning. In this scenario, the electronic device has not obtained any other scanned images before the first scanned image. That is, the electronic device has not obtained a second scanned image. In this case, the electronic device can store the first scanned image, and then retrieve the first scanned image again before executing step S102.
[0182] Optionally, the electronic device may obtain at least one second scanned image before obtaining the first scanned image. During step S102, the image similarity between the first scanned image and each second scanned image obtained before the first scanned image can be determined. Specifically, the image similarity between any second scanned image and the first scanned image can be determined in the same way as determining the image similarity between the first and third scanned images. Here, the third scanned image is any second scanned image obtained before the first scanned image. Alternatively, it can be said that the third scanned image is any one of the at least one second scanned image.
[0183] In practice, determining the image similarity between the first scanned image and the third scanned image can be achieved in various ways. For example:
[0184] In the first implementation method, it can be done according to Figure 6 The method shown determines the image similarity between the first scanned image and the third scanned image. For example... Figure 6 As shown, determining the image similarity between the first scanned image and the third scanned image can be achieved through the following steps:
[0185] Step S201: Determine the cosine similarity between the first scanned image and the third scanned image.
[0186] After obtaining the first and third scanned images, the cosine similarity between them can be calculated using the same method as calculating the cosine similarity between two images. The calculated cosine similarity value between the first and third scanned images is between 0 and 1. Within this range, a higher cosine similarity value indicates a greater similarity between the first and third scanned images.
[0187] Step S202: Determine the cosine similarity as the image similarity between the first scanned image and the third scanned image.
[0188] After determining the cosine similarity between the first and third scanned images, this cosine similarity can be defined as the image similarity between the first and third scanned images. Accordingly, in this scenario, the image similarity value between the first and third scanned images is between 0 and 1. Furthermore, within the range of 0-1, the higher the image similarity value between the first and third scanned images, the more similar they are.
[0189] Optionally, a value between 0 and 1 can be selected as the similarity threshold according to the needs of the application scenario. For example, 0.8 or 0.9 can be selected as the similarity threshold. When the image similarity between the first scanned image and the third scanned image is greater than or equal to the similarity threshold, the first scanned image and the third scanned image can be considered similar, and then the first scanned image and the third scanned image can be grouped into the same image set.
[0190] In the second implementation method, it can be done according to Figure 7 The method shown determines the image similarity between the first scanned image and the third scanned image. For example... Figure 7 As shown, determining the image similarity between the first scanned image and the third scanned image can also be achieved through the following steps:
[0191] Step S301: Obtain a preset number of first feature points and a preset number of second feature points.
[0192] The first feature point is a feature point from the first scanned image. The second feature point is a feature point from the third scanned image. The preset number can be set according to the needs of the actual application scenario.
[0193] After obtaining the first and third scanned images, a predetermined number of feature points can be extracted from the first scanned image and the third scanned image, respectively, using the same feature point extraction method. Each feature point extracted from the first scanned image is then designated as a first feature point, and each feature point extracted from the third scanned image is designated as a second feature point.
[0194] For example, any of the following algorithms can be used: ORB (oriented fast and rotated brief) algorithm, scale-invariant feature transform (SIFT) algorithm, speed-eduprobust features (SURF) algorithm, histogram of oriented gradient (HOG) algorithm, deep neural network feature point extraction algorithm, etc., to extract a preset number of first feature points from the first scanned image and a preset number of second feature points from the third scanned image, respectively.
[0195] Step S302: Determine the first quantity.
[0196] Wherein, the first quantity is the number of second feature points that match the first feature point.
[0197] After extracting a predetermined number of first feature points from the first scanned image and a predetermined number of second feature points from the third scanned image, the number of matching feature points in the first and third scanned images can be determined, that is, the number of matching first and second feature points can be determined. Then, the determined number of matching feature points is recorded as the first number.
[0198] Step S303: Determine the ratio of the first quantity to the preset quantity as the image similarity between the first scanned image and the third scanned image.
[0199] After determining the number of matching feature points (i.e., the first number) in the first scanned image and the third scanned image, the ratio of the first number to the preset number can be determined as the image similarity between the first scanned image and the third scanned image.
[0200] In this scenario, the image similarity value between the first and third scanned images also falls between 0 and 1. Furthermore, within this range, the higher the image similarity value between the first and third scanned images, the more similar they are.
[0201] Optionally, a value between 0 and 1 can be selected as the similarity threshold according to the needs of the application scenario. For example, 0.8 or 0.9 can be selected as the similarity threshold. When the image similarity between the first scanned image and the third scanned image is greater than or equal to the similarity threshold, the first scanned image and the third scanned image can be considered similar, and then the first scanned image and the third scanned image can be grouped into the same image set.
[0202] In the third implementation method, it can be done according to Figure 8 The method shown determines the image similarity between the first scanned image and the third scanned image. For example... Figure 8 As shown, determining the image similarity between the first scanned image and the third scanned image can also be achieved through the following steps:
[0203] Step S401: Determine the same first and second layouts.
[0204] The first page is the layout of the first scanned image. The second page is the layout of the third scanned image.
[0205] After obtaining the first and third scanned images, it is possible to determine the identical layouts in the first and third scanned images. That is, to identify the identical first and second layouts.
[0206] Optionally, the first scanned image and the third scanned image may not have the same layout. That is, there may be no identical first or second layout. This would indicate that the first scanned image and the third scanned image are not similar.
[0207] Optionally, the number of identical layouts in the first scanned image and the third scanned image is at least one. That is, there is at least one set of identical layouts between the first scanned image and the third scanned image. Specifically, there is at least one set of identical first and second layouts.
[0208] In practice, optical character recognition (OCR) algorithms can be used to identify the same first and second layouts between the first and third scanned images.
[0209] Step S402: Determine the character similarity between the same first and second pages.
[0210] If it is determined that there is no identical first layout and second layout in the first scanned image and the third scanned image, then the character similarity determined in step S402 is zero.
[0211] If it is determined that there is at least one set of identical first and second layouts between the first and third scanned images, then the character similarity between each set of identical first and second layouts can be determined. The character similarity between identical first and second layouts is the ratio of the number of identical characters in the first and second layouts to the total number of duplicate characters in the first and second layouts.
[0212] In practice, optical character recognition algorithms can be used to determine the character similarity between the first and second pages of each set of identical pages.
[0213] Step S403: Determine the mean of all character similarities as the image similarity between the first scanned image and the third scanned image.
[0214] After determining the character similarity between the first and third scanned images for each pair of identical first and second page layouts, the average of all determined character similarities can be used as the image similarity between the first and third scanned images.
[0215] Similarly, in this scenario, the image similarity value between the first and third scanned images is also between 0 and 1. Furthermore, within this range, the higher the image similarity value between the first and third scanned images, the more similar they are.
[0216] Optionally, a value between 0 and 1 can be selected as the similarity threshold according to the needs of the application scenario. For example, 0.8 or 0.9 can be selected as the similarity threshold. When the image similarity between the first scanned image and the third scanned image is greater than or equal to the similarity threshold, the first scanned image and the third scanned image can be considered similar, and then the first scanned image and the third scanned image can be grouped into the same image set.
[0217] By using any of the methods described above to determine the image similarity between the first scanned image and the third scanned image, the image similarity between the first scanned image and any one of the at least one second scanned image can be determined.
[0218] Step S103: Based on the image similarity, divide the first scanned image and the at least one second scanned image into at least one image set.
[0219] Based on the foregoing, after the electronic device begins scanning the document, starting from the second scanned image of the document, each time the electronic device obtains a scanned image of the document and uses that image as the first scanned image, it can calculate the image similarity between the first scanned image and every second scanned image obtained before it. Therefore, after the electronic device begins scanning the document and obtains the second scanned image, it can divide the first and second scanned images into at least one image set based on the calculated image similarity between the first and second scanned images.
[0220] Optionally, if the image similarity between the first scanned image and the second scanned image is greater than or equal to a similarity threshold, then the first scanned image and the second scanned image can be classified into the same image set. Alternatively, if the image similarity between the first scanned image and the second scanned image is less than a similarity threshold, then the first scanned image and the second scanned image can be classified into two different image sets.
[0221] After the electronic device obtains the third scanned image of the document to be scanned, it can use this third scanned image as the first scanned image and then calculate the image similarity between the first scanned image and each of the previously obtained second scanned images. Based on the calculated image similarity, the third scanned image is assigned to the image set containing the second scanned images whose image similarity is greater than or equal to a similarity threshold. Alternatively, if the image similarity between the third scanned image and any of the previously obtained second scanned images is less than the similarity threshold, the third scanned image is assigned to a separate image set.
[0222] Following this pattern, each time the electronic device acquires a new scanned image of a document to be scanned, this image can be used as the first scanned image. The similarity between this first scanned image and every second scanned image acquired before it is then calculated. Based on the calculated similarity, the newly acquired scanned image is assigned to the same set of second scanned images whose similarity is greater than or equal to a similarity threshold. Alternatively, if the similarity between a newly acquired scanned image and any previously acquired second scanned image is less than the similarity threshold, the newly acquired scanned image is assigned to a separate image set.
[0223] Based on this, when the electronic device executes step S103, it can first determine whether the first scanned image is the Nth scanned image of the document to be scanned obtained by the electronic device, where N is an integer greater than 2; then, when the first scanned image is the Nth scanned image of the document to be scanned obtained by the electronic device, it can be assigned to the image set containing second scanned images whose image similarity is greater than or equal to a similarity threshold, based on the calculated image similarity between the first scanned image and each previously obtained second scanned image. Alternatively, when the first scanned image is the Nth scanned image of the document to be scanned obtained by the electronic device, and the image similarity between the first scanned image and any previously obtained second scanned image is less than the similarity threshold, the first scanned image is assigned to a separate image set. Or,
[0224] The first scanned image is not the Nth scanned image of the document to be scanned obtained by the electronic device; that is, the first scanned image is the second scanned image of the document to be scanned. In this case, if the image similarity between the first scanned image and the second scanned image is greater than or equal to the similarity threshold, then the first scanned image and the second scanned image are classified into the same image set. Alternatively, if the image similarity between the first scanned image and the second scanned image is less than the similarity threshold, then the first scanned image and the second scanned image are classified into two different image sets.
[0225] In this way, the first scanned image and at least one second scanned image can be divided into at least one image set.
[0226] Step S104: Determine the text-image inclusion relationship between each scanned image in each image set and the quality score of each scanned image.
[0227] After obtaining at least one image set, if all scanned images within the same set are relatively similar, they can be considered as scanned images of the same object in the document to be scanned. In this way, multiple scanned images can be obtained for the same object in the document. Storing all the obtained scanned images or using them to generate the electronic document would consume a large amount of storage resources, resulting in waste. To save storage resources on electronic devices, lower-quality scanned images can be deleted, while higher-quality images are retained.
[0228] Optionally, after dividing the image into at least one set, the electronic device can determine the text-image inclusion relationship between each scanned image in each set and the quality score of each scanned image in each set, so that the scanned images with better quality can be selected for storage or to generate electronic documents, thereby saving the storage resources of the electronic device.
[0229] Optionally, the text-image inclusion relationship between the scanned images in each image set can be determined using an optical character recognition (OCR) method. Further, the text-image inclusion relationship between the scanned images can be determined based on the inclusion relationship between the text information of the scanned images, and / or the inclusion relationship between the image information of the scanned images.
[0230] For example, taking the fourth and fifth scanned images in the target image set as examples, the text-image inclusion relationship between the scanned images in the image set is explained. Here, the target image set is any one of the at least one generated image set. The fourth and fifth scanned images are any two scanned images in the target image set.
[0231] When the types of information included in the fourth scanned image and the fifth scanned image are the same—for example, both the fourth and fifth scanned images include only text information, or both include only image information, or both include both text and image information—if the fourth scanned image includes more information than the fifth scanned image and the information included in the fourth scanned image encompasses all the information included in the fifth scanned image, then the text-image inclusion relationship between the fourth and fifth scanned images can be considered as follows: the fourth scanned image includes the fifth scanned image. Alternatively, the text-image inclusion relationship between the fourth and fifth scanned images can also be considered as follows: the fourth scanned image is the parent set of the fifth scanned image, or the fifth scanned image is a subset of the fourth scanned image.
[0232] For example, Figure 9 The slide 900 shown is a scanned object of the document to be scanned. Slide 900 includes text information 1, text information 2, text information 3, and text information 4. When slide 900 is displayed, text information 1, text information 2, text information 3, and text information 4 can be dynamically displayed at different times. That is, text information 1, text information 2, text information 3, and text information 4 can be displayed at different times.
[0233] When acquiring scanned images of slide 900, the electronic device can acquire a scanned image each time one or more of text information 1, text information 2, text information 3, and text information 4 are displayed on slide 900, thus obtaining multiple scanned images of slide 900. These multiple scanned images can be combined to form a target image set.
[0234] like Figure 10 As shown, the target image set can include Figure 10 The fourth scan image shown in (a) and Figure 10The fifth scanned image is shown in (b) above. The fourth scanned image includes text information 1, text information 2, text information 3, and text information 4. The fifth scanned image includes text information 1 and text information 2. Therefore, the text-image inclusion relationship between the fourth and fifth scanned images can be considered as follows: the fourth scanned image includes the fifth scanned image. Alternatively, the text-image inclusion relationship between the fourth and fifth scanned images can also be considered as follows: the fourth scanned image is the parent set of the fifth scanned image, or the fifth scanned image is a subset of the fourth scanned image.
[0235] For example, Figure 11 The slide 1100 shown is a scanned object of the document to be scanned. Slide 1100 includes image information 1, image information 2, image information 3, and image information 4. When slide 1100 is displayed, image information 1, image information 2, image information 3, and image information 4 can be dynamically displayed at different times. That is, image information 1, image information 2, image information 3, and image information 4 can be displayed at different times.
[0236] When acquiring scanned images of slide 1100, the electronic device can acquire one scanned image at each of the following times: when slide 1100 displays image information 1, image information 2, image information 3, and image information 4, thus obtaining multiple scanned images of slide 1100. These multiple scanned images can be combined to form a target image set.
[0237] like Figure 12 As shown, the target image set can include Figure 12 The fourth scan image shown in (a) and Figure 12 The fifth scanned image is shown in (b) above. The fourth scanned image includes image information 1, image information 2, image information 3, and image information 4. The fifth scanned image includes image information 1 and image information 2. Therefore, the image-text inclusion relationship between the fourth and fifth scanned images can be considered as follows: the fourth scanned image includes the fifth scanned image. Alternatively, the image-text inclusion relationship between the fourth and fifth scanned images can also be considered as follows: the fourth scanned image is the parent set of the fifth scanned image, or the fifth scanned image is a subset of the fourth scanned image.
[0238] For example, Figure 13 The slide 1300 shown is a scanned object of the document to be scanned. Slide 1300 includes text information 5, text information 6, image information 5, and image information 6. When slide 1300 is displayed, text information 5, text information 6, image information 5, and image information 6 can be dynamically displayed at different times. That is, text information 5, text information 6, image information 5, and image information 6 can be displayed at different times.
[0239] When acquiring scanned images of slide 1300, the electronic device can acquire one scanned image at each of the following times: when slide 1300 displays text information 5, text information 6, image information 5, and image information 6, thus obtaining multiple scanned images of slide 1300. These multiple scanned images can be combined to form a target image set.
[0240] like Figure 14 As shown, the target image set can include Figure 14 The fourth scan image shown in (a) and Figure 14 The fifth scanned image is shown in (b) of the diagram. The fourth scanned image includes text information 5, text information 6, image information 5, and image information 6. The fifth scanned image includes text information 5 and image information 5. Therefore, the text-image inclusion relationship between the fourth and fifth scanned images can be considered as follows: the fourth scanned image includes the fifth scanned image. Alternatively, the text-image inclusion relationship between the fourth and fifth scanned images can also be considered as follows: the fourth scanned image is the parent set of the fifth scanned image, or the fifth scanned image is a subset of the fourth scanned image.
[0241] When the types of information included in the fourth scanned image are partially the same as those included in the fifth scanned image, but the types of information included in the fourth scanned image are fewer than those included in the fifth scanned image, for example, the fourth scanned image includes only text information or only image information, and the fifth scanned image includes both text information and image information, if the information included in the fourth scanned image contains all the information of the same type as the information in the fifth scanned image, then the image-text inclusion relationship between the fourth scanned image and the fifth scanned image can be considered as: the fourth scanned image and the fifth scanned image are parallel.
[0242] For example, such as Figure 15 As shown, Figure 15 The scanned image shown in (a) is the fourth scanned image, which includes text information 7 and text information 8. Figure 15 The scanned image shown in (b) is the fifth scanned image, which includes partial information of text information 7 and partial information of text information 8, as well as image information 7. Therefore, the text-image inclusion relationship between the fourth and fifth scanned images can be considered as follows: the fourth and fifth scanned images are parallel.
[0243] If the type of information contained in the fourth scanned image is different from the type of information contained in the fifth scanned image, then the image-text inclusion relationship between the fourth scanned image and the fifth scanned image can be considered as follows: the fourth scanned image and the fifth scanned image are parallel.
[0244] If the information contained in the fourth scanned image is exactly the same as that contained in the fifth scanned image, then the image-text inclusion relationship between the fourth scanned image and the fifth scanned image can be considered as follows: the fourth scanned image and the fifth scanned image are identical.
[0245] Optionally, determining the quality score for each scanned image in each image set can be achieved in several ways. For example:
[0246] In the first method, determining the quality score of each scanned image in each image set can be achieved as follows:
[0247] The first step is to determine the quality parameters of each scanned image in each image set and the weighting coefficient of each quality parameter.
[0248] The quality parameters for each scanned image include at least one of the following parameters: Peak Signal-to-Noise Ratio (PSNR), Structural Similarity (SSIM), Image Enhancement Factor (IEF), and Universal Quality Index (UQI).
[0249] The weighting coefficients for each quality parameter can be pre-set according to the needs of the actual application scenario and then stored in the electronic device. When determining the quality score of each scanned image in each image set, these coefficients can be retrieved from the electronic device.
[0250] The second step is to determine the quality score of each scanned image in each image set based on the quality parameters and the weighting coefficients of each quality parameter.
[0251] After determining the quality parameters and weight coefficients of each scanned image in each image set, the quality parameters of the scanned image are weighted and summed according to the weight coefficients of each quality parameter. The result of the weighted summation is then determined as the quality score of the scanned image.
[0252] After determining the quality score of each scanned image in each image set using the first quality scoring method described above, the scanned image with the higher the quality score in the same image set is considered to be of better quality.
[0253] In the second approach, determining the quality score for each scanned image in each image set can be achieved as follows:
[0254] The first step is to determine the confidence level of the characters in each scanned image in each image set.
[0255] In practice, the confidence level of each character in each scanned image in each image set can be determined using the Optical Character Recognition (OCR) method.
[0256] The second step is to determine the quality score of each scanned image in each image set based on the confidence level.
[0257] After determining the confidence level of each character in each scanned image in each image set, the average confidence level (or mean confidence level) of all characters in that scanned image can be used as the quality score of that scanned image.
[0258] It should be noted that other quality scoring methods can also be used to determine the quality score of each scanned image in each image set. For example, the values of parameters such as sharpness, contrast, and average brightness of each scanned image can be weighted and summed, and the result of the weighted sum can be used as the quality score of that scanned image. Alternatively, a deep neural network can be used to determine the quality score of each scanned image. Another method is to use optical character recognition (OCR) to perform layout analysis on each scanned image, match the layout analysis results with a preset standard template layout, and determine the quality score of that scanned image based on the matching result. This application does not limit the implementation method for determining the quality score of each scanned image in each image set.
[0259] After determining the quality score of each scanned image in each image set using the second method or any other quality scoring method described above, the scanned image with the higher the quality score in the same image set is considered to be of better quality.
[0260] Step S105: After receiving the operation to generate an electronic document, deduplicatize the first scanned image and the at least one second scanned image according to the image-text inclusion relationship and the quality score.
[0261] The scanning interface of the electronic device can also be equipped with a function button to trigger the generation of an electronic document. When it is necessary to generate an electronic document based on the scanned image of the document to be scanned, the user can click this function button. After receiving the user's click of this function button, the electronic device can interpret it as receiving an operation to generate an electronic document. In response to this operation, the electronic device can generate the electronic document of the document to be scanned based on the scanned image of the document obtained in the current scanning task.
[0262] Optionally, after receiving the operation to generate an electronic document, the electronic device can, based on the text-image inclusion relationship between each scanned image in each image set obtained above and the quality score of each scanned image, first remove duplicates from the first scanned image and all second scanned images obtained above (i.e., at least one second scanned image obtained above), so that an electronic document can be generated based on the scanned image with better quality.
[0263] During the deduplication process of the first scanned image and all second scanned images, the electronic device can first identify redundant images in the first scanned image and all second scanned images. Then, the electronic device can mark or highlight the aforementioned redundant images for display to the user. In the interface displaying the redundant images to the user, a confirmation button can also be provided. Upon receiving a user's click of this confirmation button, the electronic device can consider it to have received a deduplication operation. In response to this operation, the electronic device can delete the redundant images in the first scanned image and all second scanned images, thereby achieving the purpose of deduplication of the first scanned image and all second scanned images.
[0264] Based on this, optionally, deduplication of the obtained first scanned image and all second scanned images can be achieved according to the image-text inclusion relationship and quality score of each scanned image in each image set. This can be implemented as follows: Based on the image-text inclusion relationship and quality score of each scanned image in each image set, identify redundant images in the first scanned image and all second scanned images; after receiving the user's deduplication operation, delete the redundant images in the first scanned image and all second scanned images. For ease of distinction, the redundant images in the first scanned image and all second scanned images will be referred to as the first redundant image.
[0265] Furthermore, based on the text-image inclusion relationship between each scanned image in each image set and the quality score of each scanned image, redundant images in the first scanned image and all second scanned images are determined. That is, the first redundant image is determined as follows: Based on the text-image inclusion relationship between each scanned image in each image set and the quality score of each scanned image, the redundant images in each image set are determined (hereinafter, the redundant images in each image set are referred to as the second redundant images); the second redundant images in all image sets are determined as the first redundant images.
[0266] Furthermore, based on the text-image inclusion relationships between scanned images in each image set and the quality scores of each scanned image, a second redundant image is determined in each image set. This can be achieved by referring to the implementation method of determining the second redundant image in the target image set based on the text-image inclusion relationships between scanned images in the target image set and the quality scores of each scanned image. Here, the target image set is any one of the at least one image set obtained above.
[0267] Optionally, the second redundant image in the target image set can be determined based on the image-text inclusion relationship between the scanned images in the target image set and the quality score of each scanned image. This can be achieved in the following way:
[0268] The first step is to determine the third redundant image in the target image set based on the text-image inclusion relationship between the scanned images in the target image set.
[0269] Optionally, the third redundant image in the target image set can be determined based on the image-text inclusion relationship among the scanned images in the target image set. This can be achieved as follows: determine whether the target image set includes the sixth scanned image; if the target image set includes the sixth scanned image, determine all scanned images included in the sixth scanned image in the target image set as the third redundant images. Alternatively, if the target image set does not include the sixth scanned image, then there are no third redundant images in the target image set, i.e., the number of third redundant images in the target image set is zero.
[0270] In this context, the sixth scanned image in the target image set is a scanned image that serves only as a parent set within the target image set. That is, in the target image set, the sixth scanned image contains other scanned images, but no single other scanned image contains the sixth scanned image. Optionally, the number of sixth scanned images in the target image set can be one or more.
[0271] The second step is to determine the first sub-image set.
[0272] If the target image set contains a third redundant image (i.e., the number of third redundant images in the target image set is not zero), then the image set consisting of all scanned images other than the third redundant images in the target image set is determined as the first sub-image set. Alternatively, if the target image set does not contain a third redundant image (i.e., the number of third redundant images in the target image set is zero), then the target image set is determined as the first sub-image set.
[0273] The third step is to identify the fourth redundant image in the first sub-image set.
[0274] Optionally, determining the fourth redundant image in the first sub-image set can be achieved by the following steps:
[0275] Step 1: Determine if there are identical scanned images in the first sub-image set.
[0276] If a scanned image in the first sub-image set has the same text-image inclusion relationship as other scanned images in the same sub-image set, then it can be considered that the first sub-image set contains identical scanned images. Alternatively,
[0277] If there is no scanned image in the first sub-image set that has the same text-image inclusion relationship as other scanned images in the first sub-image set, then it can be considered that there are no identical scanned images in the first sub-image set.
[0278] Step 2: If there are identical scanned images in the first sub-image set, determine the fourth redundant image in the first sub-image set based on the quality score of each scanned image.
[0279] In specific implementation, the fourth redundant image in the first sub-image set is determined based on the quality score of each scanned image. This can be achieved as follows: Scanned images in the first sub-image set with the same image-text inclusion relationship are grouped into the same image set, and each resulting image set is designated as the second sub-image set. That is, all scanned images in each second sub-image set have the same image-text inclusion relationship. The scanned image with the highest quality score in each second sub-image set is selected and designated as the seventh scanned image of that second sub-image set. All other scanned images in all second sub-image sets except the seventh scanned image are designated as the fourth redundant images.
[0280] Step 3: If there is no identical scanned image in the first sub-image set, determine that there is no fourth redundant image in the first sub-image set, or determine that there is zero fourth redundant image in the first sub-image set.
[0281] Step 4: The third and fourth redundant images are designated as the second redundant images.
[0282] After identifying the third and fourth redundant images, they can be designated as the second redundant images in the target image set.
[0283] Following the method described above for determining the second redundant image in the target image set, the second redundant image in each image set can be identified. After identifying the second redundant image in each image set, the second redundant images in all image sets can be considered redundant images of the first scanned image and all second scanned images; that is, the second redundant images in all image sets can be considered first redundant images. Then, after receiving the user's deduplication operation, the electronic device can delete the first redundant image, thereby achieving the purpose of deduplicating the first scanned image and all second scanned images.
[0284] After deduplication of the first scanned image and all second scanned images, the remaining scanned images do not have the following image-text inclusion relationships: identical and inclusive. That is, redundant images in identical scanned images and redundant images in scanned images with inclusion relationships have been deleted. Furthermore, the remaining scanned images are of higher quality, allowing for the generation of higher-quality electronic documents. In addition, after deduplication, scanned images with parallel image-text inclusion relationships are still retained, ensuring that users receive complete electronic documents without losing any information from the original scanned document, resulting in a better user experience.
[0285] As can be seen, the deduplication method provided in this application allows an electronic device to determine the image similarity of scanned images. Then, based on the obtained image similarity, similar scanned images can be grouped into a single image set. Next, the text-image inclusion relationship between each scanned image in each image set and the quality score of each scanned image in each image set can be determined. Finally, based on the text-image inclusion relationship between each scanned image in each image set and the quality score of each scanned image in each image set, all scanned images can be deduplicated to remove redundant images. Therefore, the deduplication method provided in this application allows an electronic device to automatically perform image similarity analysis on scanned images, and then accurately identify redundant images among similar scanned images based on the text-image inclusion relationship between scanned images and the quality score of each scanned image, thereby enabling accurate and efficient deduplication of scanned images and resulting in a better user experience.
[0286] Furthermore, according to the deduplication method provided in the above embodiments, after the electronic device obtains a new scanned image, it determines in real time the image similarity between the newly obtained scanned image and each previously obtained scanned image, as well as the image-text inclusion relationship between each scanned image and the quality score of each scanned image. Subsequently, after receiving the operation to generate an electronic document, it can quickly and efficiently deduplicate the scanned images based on the previously determined image-text inclusion relationship and quality score, resulting in higher deduplication efficiency.
[0287] See Figure 16 , Figure 16 This is a schematic flowchart illustrating another deduplication method provided in an embodiment of this application. This method can be applied to electronic devices, for example, it can be applied to... Figure 1 and Figure 2 In the electronic device 100 shown. For example... Figure 16 As shown, the method may include the following steps:
[0288] Step S501: Obtain at least one scanned image of the document to be scanned.
[0289] The specific content of the document to be scanned can be found in the following reference. Figure 3 The details of the illustrated embodiment will not be repeated here.
[0290] For details on how an electronic device acquires at least one scanned image of a document to be scanned, please refer to [link / reference]. Figure 4 and Figure 5 The method for obtaining multiple scanned images shown will not be elaborated here.
[0291] Step S502: After receiving the operation to generate an electronic document, determine the image similarity between the scanned images in the at least one scanned image.
[0292] For details on the operation of receiving and generating electronic documents by electronic devices, please refer to step S105, which will not be repeated here.
[0293] The specific implementation method for determining the image similarity between each scanned image in at least one scanned image can refer to the implementation method for determining the image similarity between the first scanned image and the third scanned image in step S102 of the aforementioned embodiment, which will not be described in detail here.
[0294] Step S503: Based on the image similarity, divide the at least one scanned image into at least one image set.
[0295] The specific implementation of step S503 can be referred to in step S103, which divides the first scanned image and at least one second scanned image into at least one image set based on image similarity. It will not be described in detail here.
[0296] Step S504: Determine the text-image inclusion relationship between each scanned image in each image set and the quality score of each scanned image.
[0297] The specific implementation of step S504 can be referred to the implementation of step S104 in the aforementioned embodiments, and will not be described in detail here.
[0298] Step S505: Based on the image-text inclusion relationship and the quality score, deduplicate the at least one scanned image.
[0299] The specific implementation of step S505 can be referred to the implementation of deduplication of the first scanned image and all second scanned images in step S105 of the aforementioned embodiment, which will not be described in detail here.
[0300] According to the deduplication method provided in the above embodiments, after the electronic device obtains any new scanned image, it does not determine the image similarity between the newly obtained scanned image and each previously obtained scanned image, nor the image-text inclusion relationship and quality score of each scanned image in real time. Instead, after receiving the operation to generate an electronic document, it begins to determine the image similarity of each scanned image in at least one previously obtained scanned image, and further determines the image-text inclusion relationship and quality score of each scanned image based on the image similarity. Then, it deduplicates all the obtained scanned images. It is evident that, according to the deduplication method provided in the above embodiments, image similarity calculations are only performed after receiving the operation to generate an electronic document. If the operation to generate an electronic document is not received, the electronic device will not perform image similarity calculations, thereby avoiding the waste of the electronic device's computing resources.
[0301] See Figure 17 , Figure 17This is a schematic flowchart illustrating another deduplication method provided in an embodiment of this application. This method can be applied to electronic devices, for example, it can be applied to... Figure 1 and Figure 2 In the electronic device 100 shown. For example... Figure 17 As shown, the method may include the following steps:
[0302] Step S601: After meeting the deduplication conditions, obtain at least one stored image.
[0303] The electronic device can also be configured with deduplication conditions. These conditions trigger the electronic device to deduplicate all or a subset of the images stored in the device. Based on this, after the deduplication conditions are met, the electronic device can retrieve at least one image from all stored images and record this retrieved image as a stored image. Subsequently, the electronic device can deduplicate the retrieved at least one stored image. The stored image retrieved by the electronic device may include a scanned image. Optionally, to facilitate differentiation from other stored images, a scan mark can be added to the scanned image.
[0304] Optionally, the electronic device can periodically deduplicate the images stored in it according to a preset deduplication cycle. The start time of the first deduplication step and the duration of the preset deduplication cycle can both be set according to the needs of the actual application scenario. Based on this, when the electronic device detects that the deduplication start time has been reached at the beginning of each deduplication cycle, it can be considered that the deduplication conditions have been met.
[0305] Optionally, a deduplication function button can be set in the image library app of the electronic device. Users can click this button to trigger the electronic device to deduplicate the images stored on it. Based on this, after receiving the user's action of clicking the deduplication function button in the image library app, the electronic device can consider that the deduplication condition has been met. It should be noted that the deduplication condition can also be set to other conditions, and this application does not impose any restrictions on this.
[0306] In practice, optionally, after the deduplication conditions are met, the electronic device can retrieve at least one stored image from all the images stored in the electronic device according to the pre-set deduplication range or deduplication target.
[0307] For example, the deduplication range or target can be set to scanned images obtained within the last month or week. Alternatively, the deduplication range or target can be set to all images in an image folder created within the last week. It should be understood that the deduplication range or target can also be set to other ranges or targets, and this application does not impose any restrictions on this.
[0308] Optionally, after satisfying the deduplication condition, the electronic device may also select at least one stored image from all images stored in the electronic device based on the user's selection operation. It should be understood that the electronic device may also obtain at least one stored image through other acquisition methods, and this application does not impose any restrictions on this.
[0309] Step S602: Determine the image similarity between the stored images in the at least one stored image.
[0310] The specific implementation method for determining the image similarity between each stored image in at least one stored image in step S602 can refer to the implementation method for determining the image similarity between the first scanned image and the third scanned image in step S102 of the aforementioned embodiment, which will not be described in detail here.
[0311] Step S603: Based on the image similarity, divide the at least one stored image into at least one image set.
[0312] The specific implementation of step S603 can be referred to in step S103, which divides the first scanned image and at least one second scanned image into at least one image set based on image similarity. It will not be described in detail here.
[0313] Step S604: Determine the text-image inclusion relationship between each stored image in each image set and the quality score of each stored image.
[0314] The specific implementation of step S604 can be referred to the implementation of step S104 in the foregoing embodiments, and will not be described in detail here.
[0315] Step S605: Based on the image-text inclusion relationship and the quality score, deduplicate the at least one stored image.
[0316] The specific implementation of step S605 can be found in step S105, which involves deduplicating the first scanned image and at least one second scanned image based on the image-text inclusion relationship and quality score. It will not be described in detail here.
[0317] According to the deduplication method provided in the above embodiments, electronic devices can periodically deduplicate all or some of the images stored in the electronic device, thereby avoiding waste of storage resources. Alternatively, electronic devices can also deduplicate all or some of the images stored in the electronic device based on user operations, which can improve user experience and adaptability while avoiding waste of storage resources.
[0318] The various method embodiments described herein can be independent solutions or combinations based on internal logic, and all such solutions fall within the protection scope of this application.
[0319] It is understood that the methods and operations implemented by electronic devices in the above-described method embodiments can also be implemented by components (such as chips, modules, or circuits) that can be used in electronic devices.
[0320] The above embodiments describe the deduplication method provided in this application. It is understood that, in order to achieve the above functions, the electronic device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0321] This application embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0322] The above, combined with Figures 1 to 17 The deduplication method provided in the embodiments of this application is described in detail below. Figure 18 and Figure 19 The apparatus provided in the embodiments of this application is described in detail. It should be understood that the description of the apparatus embodiments corresponds to the description of the method embodiments. Therefore, for content not described in detail, please refer to the method embodiments above. For the sake of brevity, it will not be repeated here.
[0323] See Figure 18 , Figure 18 This is a structural block diagram of a deduplication device provided in an embodiment of this application. This device can be part of an electronic device and applied within it. Alternatively, it can be the electronic device itself; this application does not limit its application to this. Figure 18 As shown, the device 1800 may include: an acquisition module 1801, a first determination module 1802, a classification module 1803, a second determination module 1804, and a deduplication module 1805. The device 1800 can perform the above-described... Figures 3 to 17 The operation performed by the electronic device in any of the method embodiments shown.
[0324] For example, in an optional embodiment of this application, the acquisition module 1801 can be used to acquire a first scanned image, wherein the first scanned image is a scanned image of the document to be scanned.
[0325] The first determining module 1802 can be used to determine the image similarity between the first scanned image and each of the at least one second scanned image, wherein the second scanned image is a scanned image of the document to be scanned obtained prior to the first scanned image.
[0326] The classification module 1803 can be used to divide the first scanned image and the at least one second scanned image into at least one image set based on the image similarity.
[0327] The second determining module 1804 can be used to determine the text-image inclusion relationship between each scanned image in each image set and the quality score of each scanned image.
[0328] The deduplication module 1805 can be used to deduplicatively process the first scanned image and the at least one second scanned image based on the image-text inclusion relationship and the quality score after receiving the operation of generating an electronic document.
[0329] In one possible implementation, the third scanned image is any one of the at least one second scanned image; the first determining module 1802 is used to determine the image similarity between the first scanned image and the third scanned image, specifically: the first determining module 1802 is used to: determine the cosine similarity between the first scanned image and the third scanned image; and determine the cosine similarity as the image similarity between the first scanned image and the third scanned image.
[0330] In one possible implementation, the third scanned image is any one of the at least one second scanned image; the first determining module 1802 is used to determine the image similarity between the first scanned image and the third scanned image, specifically: the first determining module 1802 is used to: acquire a preset number of first feature points and a preset number of second feature points, wherein the first feature points are feature points of the first scanned image and the second feature points are feature points of the third scanned image; determine a first quantity, wherein the first quantity is the number of second feature points that match the first feature points; and determine the ratio of the first quantity to the preset quantity as the image similarity between the first scanned image and the third scanned image.
[0331] In one possible implementation, the third scanned image is any one of the at least one second scanned image; the first determining module 1802 is used to determine the image similarity between the first scanned image and the third scanned image, specifically: the first determining module 1802 is used to: determine the same first layout and second layout, where the first layout is the layout of the first scanned image and the second layout is the layout of the third scanned image; determine the character similarity between the same first layout and second layout; and determine that the average of all the character similarities is the image similarity between the first scanned image and the third scanned image.
[0332] In one possible implementation, the second determining module 1804 is used to determine the image-text inclusion relationship between each scanned image in each image set, specifically: the second determining module 1804 is used to determine the image-text inclusion relationship between each scanned image in each image set by means of an optical character recognition method.
[0333] In one possible implementation, the second determining module 1804 is used to determine the quality score of each scanned image in each image set, specifically: the second determining module 1804 is used to: determine the quality parameters and weight coefficients of each scanned image in each image set, wherein the quality parameters include at least one of the following: peak signal-to-noise ratio, structural similarity, image enhancement factor, and general quality index; and determine the quality score of each scanned image in each image set based on the quality parameters and the weight coefficients of the quality parameters.
[0334] In one possible implementation, the second determining module 1804 is used to determine the quality score of each scanned image in each image set, specifically: the second determining module 1804 is used to: determine the confidence level of the characters in each scanned image in each image set; and determine the quality score of each scanned image in each image set based on the confidence level.
[0335] In one possible implementation, the deduplication module 1805 is used to deduplicatize the first scanned image and the at least one second scanned image according to the image-text inclusion relationship and the quality score. Specifically, the deduplication module 1805 is used to: determine redundant images in the first scanned image and the at least one second scanned image according to the image-text inclusion relationship and the quality score; and delete the redundant images after receiving the user's deduplication operation.
[0336] In another optional embodiment of this application, the acquisition module 1801 can be used to acquire at least one scanned image of the document to be scanned.
[0337] The first determining module 1802 can be used to determine the image similarity between each scanned image in the at least one scanned image after receiving the operation of generating an electronic document.
[0338] The classification module 1803 can be used to divide the at least one scanned image into at least one image set based on the image similarity.
[0339] The second determining module 1804 can be used to determine the text-image inclusion relationship between each scanned image in each image set and the quality score of each scanned image.
[0340] The deduplication module 1805 can be used to deduplicat at least one scanned image based on the image-text inclusion relationship and the quality score.
[0341] In another optional embodiment of this application, the acquisition module 1801 can be used to acquire at least one stored image after the deduplication condition is met, the stored image including a scanned image.
[0342] The first determining module 1802 can be used to determine the image similarity between the stored images in the at least one stored image.
[0343] The classification module 1803 can be used to divide the at least one stored image into at least one image set based on the image similarity.
[0344] The second determining module 1804 can be used to determine the text-image inclusion relationship between each stored image in each image set and the quality score of each stored image.
[0345] The deduplication module 1805 can be used to deduplicat at least one stored image based on the image-text inclusion relationship and the quality score.
[0346] In other words, the device 1800 can achieve the corresponding Figures 3 to 17 The steps or processes performed by the electronic device in any of the deduplication method embodiments shown may include those for execution by the device 1800. Figures 3 to 17 The module of the method executed by the electronic device in any of the deduplication method embodiments shown is illustrated. It should be understood that the specific process of each module executing the corresponding steps described above has been explained in detail in the above deduplication method embodiments, and will not be repeated here for the sake of brevity.
[0347] This application also provides a processing apparatus, which includes at least one processor and a communication interface. The communication interface is used to provide information input and / or output to the at least one processor, which is used to execute the methods described in the above method embodiments.
[0348] It should be understood that the aforementioned processing device can be a chip. For example, see Figure 19 , Figure 19 This is a structural block diagram of a chip provided in an embodiment of this application. Figure 19 The chip shown can be a general-purpose processor or a special-purpose processor. The chip 1900 may include at least one processor 1901. The at least one processor 1901 can be used to support... Figure 18 The device shown performs Figures 3 to 17 The technical solution shown in any one of the embodiments.
[0349] Optionally, the chip 1900 may also include a transceiver 1902, which is used to receive control from the processor 1901 for support. Figure 18 The device shown performs Figures 3 to 17 The technical solution shown in any of the embodiments. Optionally, Figure 19 The chip 1900 shown may also include a storage medium 1903. Specifically, the transceiver 1902 may be replaced by a communication interface that provides information input and / or output to the at least one processor 1901.
[0350] It should be noted that, Figure 19 The chip 1900 shown can be implemented using one or more field-programmable gate arrays (FPGAs), programmable logic devices (PLDs), application-specific integrated circuits (ASICs), system-on-chips (SoCs), central processing units (CPUs), network processors (NPs), digital signal processing circuits (DSPs), microcontroller units (MCUs), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits capable of performing the various functions described throughout this application.
[0351] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are omitted here.
[0352] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0353] According to the method provided in the embodiments of this application, the embodiments of this application also provide a computer program product, which includes: a computer program or instructions, which, when executed on a computer, cause the computer to perform... Figures 3 to 17 The method of any one of the embodiments shown.
[0354] According to the method provided in the embodiments of this application, the embodiments of this application also provide a computer-readable storage medium storing a computer program or instructions, which, when executed on a computer, cause the computer to perform... Figures 3 to 17 The method of any one of the embodiments shown.
[0355] Based on the method provided in the embodiments of this application, this application also provides an electronic device. This electronic device includes, but is not limited to, mobile phones, tablets, personal computers, workstations, large-screen devices (e.g., smart screens, smart TVs), handheld game consoles, home game consoles, virtual reality devices, augmented reality devices, mixed reality devices, and in-vehicle smart terminals. This electronic device may include the deduplication device provided in the above embodiments of this application.
[0356] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, device modules, and electronic devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0357] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0358] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0359] In addition, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit.
[0360] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0361] The deduplication device, processing device, chip, computer-readable storage medium, computer program product, and electronic device provided in the embodiments of this application are all used to execute the methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects corresponding to the methods provided above, and will not be repeated here.
[0362] It should be understood that in the various embodiments of this application, the execution order of each step should be determined by its function and internal logic, and the size of each step number does not mean the order of execution, and does not constitute a limitation on the implementation process of the embodiments.
[0363] The various parts of this specification are described in a progressive manner. Similar or identical parts between the various embodiments can be referred to interchangeably. Each embodiment focuses on the differences from other embodiments. In particular, the embodiments for deduplication devices, chips, computer-readable storage media, computer program products, and electronic devices are basically similar to the method embodiments, so the descriptions are relatively simple, and relevant details can be found in the descriptions within the method embodiments.
[0364] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0365] The embodiments described above do not constitute a limitation on the scope of protection of this application.
Claims
1. A deduplication method, characterized in that, The method includes: Obtain the first scanned image, which is a scanned image of the document to be scanned; The image similarity between the first scanned image and each second scanned image is determined, where the second scanned image is a scanned image of the document to be scanned obtained prior to the first scanned image. The method for determining the image similarity between the first scanned image and each second scanned image includes: identifying identical first and second layouts based on optical character recognition (OCR), where the first layout is the layout of the first scanned image and the second layout is the layout of the second scanned image; in the case of identical first and second layouts, determining the character similarity between the identical first and second layouts based on OCR, where the character similarity is the ratio of the number of identical characters in the first and second layouts to the total number of duplicate characters in both layouts; and determining the mean of all character similarities as the image similarity between the first scanned image and the second scanned image. Based on the image similarity, the first scanned image and the second scanned image are divided into at least one image set; Using optical character recognition methods, the image-text inclusion relationship between each scanned image in each image set is determined, and the quality parameters and weight coefficients of each scanned image in each image set are determined. Based on the quality parameters and the weight coefficients of the quality parameters, a quality score for each scanned image in each image set is determined. The quality parameters include at least one of the following: peak signal-to-noise ratio, structural similarity, image enhancement factor, and general quality index. The image-text inclusion relationship includes at least one of the following: parallel, parent set, subset, and same. Upon receiving the operation to generate an electronic document, the first scanned image and the at least one second scanned image are deduplicated based on the image-text inclusion relationship and the quality score.
2. The method according to claim 1, characterized in that, The step of deduplicating the first scanned image and the at least one second scanned image based on the image-text inclusion relationship and the quality score includes: Based on the image-text inclusion relationship and the quality score, redundant images are identified in the first scanned image and the at least one second scanned image; Upon receiving the user's deduplication request, the redundant images are deleted.
3. A deduplication method, characterized in that, The method includes: Obtain the first scanned image, which is a scanned image of the document to be scanned; The image similarity between the first scanned image and each second scanned image is determined, where the second scanned image is a scanned image of the document to be scanned obtained prior to the first scanned image. The method for determining the image similarity between the first scanned image and each second scanned image includes: identifying identical first and second layouts based on optical character recognition (OCR), where the first layout is the layout of the first scanned image and the second layout is the layout of the second scanned image; in the case of identical first and second layouts, determining the character similarity between the identical first and second layouts based on OCR, where the character similarity is the ratio of the number of identical characters in the first and second layouts to the total number of duplicate characters in both layouts; and determining the mean of all character similarities as the image similarity between the first scanned image and the second scanned image. Based on the image similarity, the first scanned image and the second scanned image are divided into at least one image set; Using optical character recognition methods, the image-text inclusion relationship between each scanned image in each image set is determined, and the confidence level of each character in each scanned image in each image set is determined. Based on the confidence level, a quality score for each scanned image in each image set is determined. The image-text inclusion relationship includes at least one of parallel, parent set, subset, and same. Upon receiving the operation to generate an electronic document, the first scanned image and the at least one second scanned image are deduplicated based on the image-text inclusion relationship and the quality score.
4. A deduplication method, characterized in that, The method includes: Obtain at least one scanned image of the document to be scanned; After receiving the operation to generate an electronic document, the image similarity between the scanned images in the at least one scanned image is determined; wherein, the method for determining the image similarity between the scanned images in the at least one scanned image includes: determining whether there are identical layouts based on an optical character recognition method; if identical layouts exist, determining the character similarity between the identical layouts based on an optical character recognition method, wherein the character similarity is the ratio of the number of identical characters in the identical layouts to the total number of duplicate characters in the identical layouts; determining the mean of all the character similarities as the image similarity between the scanned images; and dividing the at least one scanned image into at least one image set according to the image similarity; Using optical character recognition methods, the image-text inclusion relationship between each scanned image in each image set is determined, and the quality parameters and weight coefficients of each scanned image in each image set are determined. Based on the quality parameters and the weight coefficients of the quality parameters, a quality score for each scanned image in each image set is determined. The quality parameters include at least one of the following: peak signal-to-noise ratio, structural similarity, image enhancement factor, and general quality index. The image-text inclusion relationship includes at least one of the following: parallel, parent set, subset, and same. Based on the image-text inclusion relationship and the quality score, the at least one scanned image is deduplicated.
5. A deduplication method, characterized in that, The method includes: Obtain at least one scanned image of the document to be scanned; After receiving the operation to generate an electronic document, the image similarity between the scanned images in the at least one scanned image is determined. The method for determining the image similarity between the scanned images in the at least one scanned image includes: determining whether there are identical layouts based on an optical character recognition (OCR) method; if identical layouts exist, determining the character similarity between the identical layouts based on the OCR method; the character similarity is the ratio of the number of identical characters in the identical layouts to the total number of duplicate characters in the identical layouts; and determining the mean of all character similarities as the image similarity between the scanned images. Based on the image similarity, the at least one scanned image is divided into at least one image set; Using optical character recognition methods, the image-text inclusion relationship between each scanned image in each image set is determined, and the confidence level of each character in each scanned image in each image set is determined. Based on the confidence level, a quality score for each scanned image in each image set is determined. The image-text inclusion relationship includes at least one of parallel, parent set, subset, and same. Based on the image-text inclusion relationship and the quality score, the at least one scanned image is deduplicated.
6. A deduplication method, characterized in that, The method includes: After the deduplication condition is met, at least one stored image is obtained, including the scanned image; Determining the image similarity among the at least one stored image, wherein the method for determining the image similarity among the at least one stored image includes: determining whether there are identical layouts based on an optical character recognition method; if identical layouts exist, determining the character similarity among the identical layouts based on an optical character recognition method, wherein the character similarity is the ratio of the number of identical characters in the identical layouts to the total number of duplicate characters in the identical layouts; and determining the mean of all the character similarities as the image similarity among the stored images. Based on the image similarity, the at least one stored image is divided into at least one image set; Using optical character recognition methods, the image-text inclusion relationship between each stored image in each image set is determined, and the quality parameters and weight coefficients of each stored image in each image set are determined. Based on the quality parameters and the weight coefficients of the quality parameters, the quality score of each stored image in each image set is determined. The quality parameters include at least one of the following: peak signal-to-noise ratio, structural similarity, image enhancement factor, and general quality index. The image-text inclusion relationship includes at least one of the following: parallel, parent set, subset, and same. Based on the image-text inclusion relationship and the quality score, the at least one stored image is deduplicated.
7. A deduplication method, characterized in that, The method includes: After the deduplication condition is met, at least one stored image is obtained, including the scanned image; Determining the image similarity among the at least one stored image, wherein the method for determining the image similarity among the at least one stored image includes: determining whether there are identical layouts based on an optical character recognition method; if identical layouts exist, determining the character similarity among the identical layouts based on an optical character recognition method, wherein the character similarity is the ratio of the number of identical characters in the identical layouts to the total number of duplicate characters in the identical layouts; and determining the mean of all the character similarities as the image similarity among the stored images. Based on the image similarity, the at least one stored image is divided into at least one image set; Using optical character recognition methods, the image-text inclusion relationship between each stored image in each image set is determined, and the confidence level of each character in each stored image in each image set is determined. Based on the confidence level, the quality score of each stored image in each image set is determined. The image-text inclusion relationship includes at least one of parallel, parent set, subset, and same. Based on the image-text inclusion relationship and the quality score, the at least one stored image is deduplicated.
8. An electronic device, characterized in that, The electronic device includes: one or more processors and one or more memories; the one or more memories store computer programs or instructions that, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions, which, when executed, perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Picture processing method and mobile terminal
CN106649759A
File scanning method, device and equipment
CN109729231A