CN115019291B - Character recognition method for image, electronic device and storage medium - Google Patents

Character recognition method for image, electronic device and storage medium Download PDF

Info

Publication number
CN115019291B
CN115019291B CN202111387770.2A CN202111387770A CN115019291B CN 115019291 B CN115019291 B CN 115019291B CN 202111387770 A CN202111387770 A CN 202111387770A CN 115019291 B CN115019291 B CN 115019291B
Authority
CN
China
Prior art keywords
image
type
designated
specified
mobile phone
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111387770.2A
Other languages
Chinese (zh)
Other versions
CN115019291A (en
Inventor
潘宇欣
毛璐
孙甜甜
周元甲
诸葛超然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202111387770.2A priority Critical patent/CN115019291B/en
Publication of CN115019291A publication Critical patent/CN115019291A/en
Application granted granted Critical
Publication of CN115019291B publication Critical patent/CN115019291B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application provides a character recognition method of an image, electronic equipment and a storage medium, and relates to the technical field of computers. By adopting the method, the first electronic equipment receives the transmission operation and acquires the identification tag of the designated image; and indicating whether the second electronic equipment needs OCR character recognition operation on the specified image according to the identification tag, determining transmission data, and transmitting the transmission data to the second electronic equipment. And performing corresponding operation on the specified image by the second electronic equipment according to the operation that whether the identification label indicates that OCR character recognition needs to be performed on the specified image. Since the OCR recognition operation is not performed on all images, whether the designated image is subjected to the OCR recognition operation or not is determined according to the recognition tags in the transmission data, the power consumption of the electronic equipment is reduced, and the efficiency of the electronic equipment for performing the OCR character recognition on the images in the gallery is optimized.

Description

Character recognition method for image, electronic device and storage medium
Technical Field
The present application relates to the field of wireless communications, and in particular, to a method for recognizing characters in an image, an electronic device, and a storage medium.
Background
Optical Character Recognition (OCR) refers to a process of analyzing and recognizing an image file of text data to obtain text and layout information. OCR technology is now widely used in the fields of medicine, insurance, finance, logistics, traditional manufacturing, shopping, etc. For example, in an application scenario in the field of logistics, a user takes a photo of a logistics order using a mobile phone, and recognizes an express delivery order number on the photo through OCR characters. Through OCR technique, can acquire the express delivery bill number on the photo fast, need not artifical the entering and directly import into the system and carry out the express delivery inquiry.
However, at present, the power consumption of OCR character recognition of images in a gallery by electronic devices (such as mobile phones and tablet computers) is large, the time delay is long, and the user experience is affected.
Disclosure of Invention
The embodiment of the application provides an optimized character recognition method of an image, electronic equipment and a storage medium.
In some embodiments provided by the application, the electronic device can perform character recognition on the image needing character recognition instead of performing character recognition on all the images, so that the power consumption of the electronic device for performing character recognition on the image is reduced, the efficiency of the electronic device for performing OCR character recognition on the image is effectively improved, and the use experience of a user on the electronic device is improved.
In a first aspect, the present application provides a method for recognizing characters in an image, applied to a first electronic device, the method including: the first electronic equipment responds to the received transmission operation, obtains attribute information of the specified image, and the transmission operation is used for instructing the first electronic equipment to transmit the specified image to the second electronic equipment; acquiring attribute information of a designated image; acquiring an identification tag of the designated image, wherein the identification tag is used for indicating whether second electronic equipment needs OCR character recognition operation on the designated image; when the identification tag is detected to indicate that the second electronic equipment carries out OCR character recognition operation on the designated image, generating transmission data comprising the designated image, the attribute information of the designated image and the identification tag; when the identification label is detected to indicate that the second electronic equipment cancels the operation of OCR character recognition on the image, acquiring an OCR character recognition result of the specified image; generating transmission data including a designated image, an OCR character recognition result of the designated image, and an identification tag; and transmitting the transmission data to second electronic equipment, detecting a preset trigger condition by the second electronic equipment, and indicating whether to perform OCR character recognition operation on the specified image or not by the second electronic equipment according to an identification tag in the transmission data.
Therefore, after the first electronic equipment receives the transmission operation, the attribute information and the identification label of the designated image are obtained, when the identification label indicates the second electronic equipment to cancel the operation of OCR character recognition on the designated image, the transmission data of the first electronic equipment comprises the OCR character recognition result of the designated image, so that the second electronic equipment directly obtains the OCR character recognition result of the designated image, the operation of OCR character recognition on the designated image is not needed, and the power consumption of the second electronic equipment is reduced. When the identification tag indicates that the second electronic device performs OCR character recognition operation on the designated image, the determined transmission data contains the attribute information of the designated image, so that the second electronic device can perform OCR character recognition operation on the designated image according to the attribute information, and the accuracy of performing character recognition operation on the designated image is improved. When the first electronic equipment transmits the designated image, the first electronic equipment does not only transmit the image to the second electronic equipment, but indicates whether the second electronic equipment needs OCR character recognition operation on the designated image according to the identification tag of the designated image, so that the information of the designated image is enriched, the second electronic equipment can acquire the enriched information related to the designated image, the fact whether the OCR character recognition operation needs to be performed on the designated image can be efficiently determined, and the waste of the power consumption of the second electronic equipment is avoided.
According to the first aspect, when detecting that the identification tag instructs the second electronic device to perform OCR character recognition on the designated image, generating transmission data including the designated image, attribute information of the designated image, and the identification tag includes: when the identification tag is detected to indicate that the second electronic equipment carries out OCR character recognition operation on the specified image, whether the first electronic equipment has an OCR character recognition function or not is detected; when detecting that the first electronic equipment has an OCR character recognition function, acquiring an OCR character recognition result of the designated image, and taking the designated image, the attribute information of the designated image, the OCR character recognition result of the designated image and the recognition label as transmission data; and when the first electronic equipment is not detected to have the OCR character recognition function, the designated image, the attribute information of the designated image and the identification tag are used as transmission data. Under the condition that the first electronic equipment instructs the second electronic equipment to perform OCR character recognition on the designated image, when the first electronic equipment does not support OCR character recognition, the transmission of an OCR recognition result of the designated image is not needed, and the transmission of data is reduced; when the first electronic equipment supports OCR character recognition, the transmission data carries the OCR character recognition result of the designated image, so that the second electronic equipment can use the OCR character recognition result in the transmission data before performing OCR character recognition on the designated image, and a user can quickly check the OCR character recognition result of the designated image.
According to a first aspect, obtaining OCR character recognition results for a given image comprises: detecting whether an OCR character recognition result of a specified image exists in first electronic equipment or not; when detecting that an OCR character recognition result of the specified image exists in the first electronic equipment, reading the OCR character recognition result of the specified image; and when detecting that the OCR character recognition result of the specified image is not stored in the first electronic equipment, triggering the first electronic equipment to perform OCR character recognition operation on the specified image, and reading the OCR character recognition result of the specified image. The first electronic equipment can directly read the OCR character recognition result of the designated image, and can also obtain the OCR character recognition result of the designated image by the first electronic equipment, so that the problem that the OCR character recognition result of the designated image is failed to be sent due to the fact that the OCR character recognition result is not stored in the first electronic equipment is avoided, and the accuracy of the OCR character recognition result in the designated image in the transmission data is improved.
According to a first aspect, an identification tag for acquiring a given image, comprises: acquiring equipment information of first electronic equipment as first equipment information; acquiring equipment information of second electronic equipment as second equipment information; acquiring device information of a source device of a designated image as third device information; selecting one piece of designated device information as a designated image from the first device information and the third device information; comparing the grades of the specified equipment information and the second equipment information to obtain a comparison result; and determining the identification label of the designated image according to the comparison result. The device that performs OCR character recognition on the designated image may be another device, for example, the OCR character recognition result of the designated image in the first electronic device may be obtained by device C. Therefore, the equipment information for OCR character recognition of the specified image can be accurately indicated by acquiring the specified equipment information of the specified image. And the equipment with high equipment information has high accuracy of OCR character recognition and the equipment with low equipment information has high accuracy of OCR character recognition, and the equipment for accurately OCR character recognition on the specified image can be quickly determined by comparing the specified equipment information with the second equipment information.
According to the first aspect, selecting one of the first device information and the third device information as the designated device information of the designated image includes: detecting whether the first device information is the same as the third device information; when detecting that the first device information is the same as the third device information, acquiring the first device information as specified device information; when the first equipment information is detected to be different from the third equipment information, detecting whether an OCR character recognition result of a specified image exists in the first electronic equipment or not; when an OCR character recognition result of the designated image is detected, acquiring third equipment information as designated equipment information; and when the OCR character recognition result of the specified image is not detected, acquiring the first equipment information as the specified equipment information. By comparing the model of the first electronic equipment (such as a mobile phone A) with the model of the third electronic equipment (such as source identification equipment), if the model of the mobile phone A is determined to be the same as the model of the source identification equipment, the model of the mobile phone A can be directly determined to be the designated model, the judgment of whether the designated image has the OCR identification result or not is not needed, and unnecessary steps are reduced. The model of the source identification equipment is higher than that of the mobile phone A, and the mobile phone A does not have an OCR identification function, so that if the model of the source identification equipment is selected as the designated model, the mobile phone A or the mobile phone B does not perform character identification on the designated image, and the electronic equipment fails to identify the designated image.
According to a first aspect, the device information comprises a device model; comparing the grades of the specified device information and the second device information to obtain a comparison result, wherein the comparison result comprises the following steps: acquiring a specified model from the specified equipment information, and acquiring the model of the second equipment from the second equipment information; when the specified model is detected to be larger than the model of the second equipment, determining that the comparison result indicates that the grade of the specified equipment information is larger than the grade of the second equipment information; when the specified model is detected to be smaller than or equal to the model of the second device, it is determined that the comparison result indicates that the level of the specified device information is smaller than or equal to the level of the second device information. The high level in the designated equipment information and the second equipment information can be quickly determined through the equipment model, and the comparison speed is high and accurate.
According to a first aspect, the device information comprises a device model and system version information of the device; comparing the grades of the specified device information and the second device information to obtain a comparison result, wherein the comparison result comprises the following steps: acquiring a specified model from the specified equipment information, and acquiring the model of the second equipment from the second equipment information; when the specified model is detected to be equal to the model of the second equipment, acquiring the specified version information from the specified equipment information, and acquiring the version information of the second equipment from the second equipment information; when the specified version information is detected to be larger than the version information of the second equipment, determining that the comparison result indicates that the level of the specified equipment information is larger than the level of the second equipment information; when it is detected that the specified version information is less than or equal to the version information of the second device, it is determined that the comparison result indicates that the rank of the specified device information is less than or equal to the rank of the second device information. And the comparison of system version information is increased, and the accuracy of a comparison result is further improved.
According to a first aspect, determining an identification tag of a given image based on the comparison comprises: when the comparison result is detected to indicate that the level of the designated equipment information is greater than the level of the second equipment information, setting the identification label as a false value, wherein the false value is used for indicating the second electronic equipment to cancel the operation of OCR character recognition on the designated image; and when the comparison result indicates that the grade of the designated equipment information is less than or equal to the grade of the second equipment information, setting the identification label to be a true value, wherein the true value is used for indicating the second electronic equipment to perform OCR character identification operation on the designated image. When the level of the designated device information is greater than the level of the second device information, the OCR character recognition capability representing the second electronic device is weak, and the OCR character recognition accuracy obtained by the second electronic device is low, so that the first electronic device indicates the second electronic device to perform OCR character recognition on the designated image, the power consumption of the second electronic device can be reduced, and the accuracy of the OCR character recognition result of the designated image can be ensured.
According to a first aspect, determining an identification tag of a given image based on the comparison comprises: when the comparison result is detected to indicate that the level of the designated equipment information is greater than the level of the second equipment information, setting the identification label as a false value, wherein the false value is used for indicating the second electronic equipment to cancel the operation of OCR character recognition on the designated image; when it is detected that the comparison result indicates that the level of the specified device information is less than or equal to the level of the second device information, detecting a type to which the specified image belongs according to the attribute information of the specified image, the type to which the specified image belongs including: a first type, a second type, and a third type; and when the type of the designated image is detected to be the first type or the second type, setting the identification label to be a true value, wherein the type of the designated image is used for indicating the probability range of the designated image with characters, and the true value is used for indicating the second electronic device to perform OCR character recognition operation on the designated image. When the grade of the designated equipment information is less than or equal to that of the second equipment information and the type of the designated image is detected to be the first type or the second type, the second electronic equipment is instructed to perform OCR character recognition on the designated image, the probability that characters exist in the image of the first type or the second type is high, if the designated image belongs to the third type, the probability that the characters exist in the designated image is low, even if the grade of the designated equipment information is less than or equal to that of the second equipment information, the second electronic equipment does not need to perform OCR character recognition on the designated image, and further the power consumption of the second electronic equipment can be reduced.
According to the first aspect, the specifying the attribute information of the image includes: an information application tag for indicating an application to which the specified image belongs, a photographing mode tag, and a category content tag for indicating a category to which the content of the specified image belongs. The first electronic equipment can quickly judge the category of the content of the image, the category of the photographing mode and the category of the application to which the specified image belongs according to the application tag, the photographing mode tag and the content tag in the attribute information of the specified image.
According to the first aspect, the attribute information of the designated image further includes a first tag, the first tag is used for indicating a category of the designated image, and the category includes a screenshot or a photograph; according to the attribute information of the designated image, detecting the type of the designated image, including: determining the category of the designated image according to the first label of the designated image; determining a first detection result for indicating the type of the designated image according to the category of the designated image and the attribute information of the designated image; determining a second detection result for indicating the type of the specified image according to the content label of the specified image; and selecting a type with a high grade from the first detection result and the second detection result as a type to which the designated image belongs. The first electronic equipment can select a high-grade type from the multiple detection results as the type to which the designated image belongs, so that the accuracy of the type to which the detected designated image belongs can be ensured, and the problem that the second electronic equipment does not perform OCR character recognition on the designated image due to misjudgment is avoided.
According to a first aspect, determining a first detection result indicating a type to which a designated image belongs, based on a category of the designated image and attribute information of the designated image, includes: when the type of the designated image is determined to be the screenshot, determining the type of the application to which the designated image belongs according to the application label of the designated image; when the application to which the specified image belongs is detected to belong to the first type of application, determining that the first detection result indicates that the type to which the specified image belongs is the first type; when the application to which the specified image belongs is detected to belong to the second type of application, determining that the first detection result indicates that the type to which the specified image belongs is the second type; when the application to which the specified image belongs is detected to belong to the third type of application, determining that the first detection result indicates that the specified image belongs to the third type; wherein the first type of rank is greater than the second type of rank, and the second type of rank is greater than the third type of rank. When the designated image is a screenshot, determining the application type of the application to which the designated image belongs through the application tag in the designated image, and determining the type to which the designated image belongs; the first electronic equipment determines the type of the designated image in different modes according to the designated images of different types, and the speed of determining the first detection result of the designated image can be increased.
According to the first aspect, determining a first detection result indicating a type to which a designated image belongs, based on a category of the designated image and attribute information of the designated image, includes: when the type of the designated image is detected to be a photo, determining a photographing mode of the designated image according to a photographing mode label of the designated image; when the photographing mode of the designated image is detected to belong to a first type mode, determining that the type of the designated image indicated by the first detection result is a first type; when the photographing mode of the designated picture is detected to belong to a second type mode, determining that the type of the designated picture indicated by the first detection result is the second type; when the photographing mode of the designated picture is detected to belong to a third type mode, determining that the type of the designated picture indicated by the first detection result is the third type; wherein the grade of the first type is greater than the grade of the second type, which is greater than the grade of the third type. When the designated image is a photo, the first detection result of the designated image can be accurately determined by the photographing mode tag in the designated image.
According to the first aspect, determining a second detection result indicating a type to which the designated image belongs, based on the content tag of the designated image, includes: when the content label of the designated image is detected to belong to the first type label, determining that the second detection result indicates that the type of the designated image belongs to be the first type; when the content label of the designated image is detected to belong to the second type label, determining that the second detection result indicates that the type of the designated image belongs to be the second type; when the content label of the designated image is detected to belong to the third type label, determining that the second detection result indicates that the type of the designated image belongs to be the third type; wherein the first type of rank is greater than the second type of rank, and the second type of rank is greater than the third type of rank. The first electronic equipment can accurately determine the second detection result of the specified image through the content label in the specified image.
According to a first aspect, the method further comprises: acquiring the type of the designated image as a detection result; the detection result is added to the attribute information of the specified image. The type of the designated image is added to the attribute information of the designated image as a detection result, and the transmission data comprises the attribute information of the designated image, so that the second electronic equipment can directly acquire the type of the designated image without judging again, and the speed of performing OCR character recognition on the designated image is improved.
According to a first aspect, generating transmission data including a designated image, OCR character recognition results of the designated image, and an identification tag, comprises: adding the identification label and the OCR character recognition result of the specified image into the attribute information of the specified image; writing the updated attribute information of the designated image into a storage file of the designated image; and taking the updated designated image as transmission data. The first electronic equipment writes the attribute information into a storage file of the designated image, so that transmission is facilitated, and the condition that the attribute information is lost in the transmission process is avoided.
According to a first aspect, generating transmission data including a designated image, attribute information of the designated image, and an identification tag includes: adding an identification tag to attribute information of a specified image; writing the updated attribute information of the designated image into a storage file of the designated image; and taking the updated designated image as transmission data. The first electronic equipment writes the attribute information into a storage file of the designated image, so that transmission is facilitated, and the phenomenon that the attribute information is lost in the transmission process is avoided.
In a second aspect, the present application provides a method for recognizing characters in an image, which is applied to a second electronic device, and includes: in response to the received transmission data of the first electronic device, saving the transmission data, wherein the transmission data comprises a designated image, attribute information of the designated image and an identification tag, or the transmission data comprises: specifying an image, an OCR character recognition result of the specified image, and transmission data of the recognition tag; the identification tag is used for indicating whether the second electronic equipment carries out OCR character recognition operation on the specified image or not; acquiring attribute information of a designated image and an identification tag of the designated image; when the identification label of the designated image is detected to indicate that the second electronic equipment carries out OCR character recognition operation on the designated image, carrying out OCR character recognition operation on the designated image according to the attribute information of the designated image; and when the identification label of the designated image is detected to indicate that the second electronic equipment cancels the operation of OCR character recognition on the image, acquiring an OCR character recognition result of the designated image from the transmission data.
In this way, the second electronic device receives transmission data sent by the first electronic device, the transmission data comprises the designated image, the attribute information of the designated image and the identification tag, and when the identification tag indicates the second electronic device to cancel the operation of performing OCR character recognition on the designated image, the second electronic device can directly acquire the OCR recognition result of the designated image, so that the operation of performing OCR character recognition on the designated image is not needed, and the power consumption of the second electronic device is reduced. When the identification tag indicates that the second electronic equipment performs OCR character recognition operation on the designated image, the transmission data contains the attribute information of the designated image, so that the second electronic equipment can perform OCR character recognition operation on the designated image according to the attribute information, and the accuracy of performing character recognition operation on the designated image is improved. Meanwhile, OCR character recognition is not carried out on all the received designated images, and the efficiency of OCR character recognition of the designated images by the second electronic equipment is improved.
According to a second aspect, an operation of performing OCR character recognition on a designated image according to attribute information of the designated image includes: detecting the type of the designated image according to the attribute information of the designated image; when the designated image is detected to belong to the first type, performing OCR character recognition operation on the designated image; storing an OCR character recognition result of a specified image; when the designated image is detected to belong to the second type, whether the second electronic equipment is in a screen-off and charging state is detected; when the second electronic equipment is detected to be in a charging and screen-off state, performing OCR character recognition operation on the designated image, and storing an OCR character recognition result of the designated image; when the designated image is detected to belong to the third type, the operation of OCR character recognition on the designated image is cancelled; and displaying the specified image in response to the received first user operation. When the second electronic equipment detects that the designated image belongs to the second type and detects that the electronic equipment is not in a screen-off and charging state, the operation of OCR character recognition on the designated image is cancelled.
According to a second aspect, an operation of performing OCR character recognition on a designated image according to attribute information of the designated image includes: detecting the type of the designated image according to the attribute information of the designated image; when the designated image is detected to belong to the first type, performing OCR character recognition operation on the designated image; storing an OCR character recognition result of a specified image; when the designated image is detected to belong to the second type, detecting whether the second electronic equipment is in a screen-off and charging state; when detecting that the second electronic equipment is not in a charging and screen-off state, performing text detection operation on the designated image, and storing a text detection result of the designated image; and when the designated image is detected to belong to the third type, ending the operation of OCR character recognition on the designated image. The second electronic device only performs text detection in OCR character recognition on the image belonging to the second type, and since power consumption of the text detection in OCR character recognition is large, when the second electronic device is not in a state of being turned off and charged in this example, the text detection is not performed on the image belonging to the second type, so that power consumption of the mobile phone can be reduced.
According to a second aspect, detecting a type to which a specified image belongs based on attribute information of the specified image includes: determining the category of the designated image according to the first label of the designated image; determining a first detection result for indicating the type of the designated image according to the category of the designated image and the attribute information of the designated image; determining a second detection result for indicating the type of the specified image according to the content label of the specified image; and selecting a high-grade type from the first detection result and the second detection result as a type to which the designated image belongs.
According to the second aspect, determining a first detection result indicating a type to which a designated image belongs, based on a category of the designated image and attribute information of the designated image, includes: when the type of the designated image is determined to be the screenshot, determining the type of the application to which the designated image belongs according to the application label of the designated image; when the application to which the specified image belongs is detected to belong to the first type of application, determining that the first detection result indicates that the type to which the specified image belongs is the first type; when the application to which the specified image belongs is detected to belong to the second type of application, determining that the first detection result indicates that the type to which the specified image belongs is the second type; when the application to which the specified image belongs is detected to belong to the third type of application, determining that the first detection result indicates that the specified image belongs to the third type; wherein the first type of rank is greater than the second type of rank, and the second type of rank is greater than the third type of rank.
According to the second aspect, determining a first detection result indicating a type to which a designated image belongs, based on a category of the designated image and attribute information of the designated image, includes: when the type of the designated image is detected to be a photo, determining a photographing mode of the designated image according to a photographing mode label of the designated image; when the photographing mode of the designated image is detected to belong to a first type mode, determining that the type of the designated image indicated by the first detection result is a first type; when the photographing mode of the designated picture is detected to belong to a second type mode, determining that the type of the designated picture indicated by the first detection result is the second type; when the photographing mode of the designated picture is detected to belong to a third type mode, determining that the type of the designated picture indicated by the first detection result is the third type; wherein the first type of rank is greater than the second type of rank, and the second type of rank is greater than the third type of rank.
According to the second aspect, determining a second detection result indicating a type to which the designated image belongs, based on the content tag of the designated image, includes: when the content label of the designated image is detected to belong to the first type label, determining that the second detection result indicates that the type of the designated image belongs to be the first type; when the content label of the designated image is detected to belong to the second type label, determining that the second detection result indicates that the type of the designated image belongs to be the second type; when the content label of the designated image is detected to belong to the third type label, determining that the second detection result indicates that the type of the designated image belongs to be the third type; wherein the first type of rank is greater than the second type of rank, and the second type of rank is greater than the third type of rank. According to the second aspect, the attribute information of the designated image further includes a detection result of the designated image; according to the attribute information of the designated image, detecting the type of the designated image, including: acquiring a detection result of the specified image from the attribute information of the specified image; and acquiring the type of the specified image from the detection result.
According to a second aspect, an operation of performing OCR character recognition on a designated image according to attribute information of the designated image includes: determining the category of the designated image according to the first label in the attribute information of the designated image; determining first indication information of the designated image according to the category of the designated image; determining second indication information of the designated image according to the category of the content label of the designated image; when the first indication information and the second indication information of the specified image both indicate that the operation of OCR character recognition on the specified image is canceled, canceling the operation of OCR character recognition on the specified image; when any one of the first indication information and the second indication information of the designated image indicates the operation of performing OCR character recognition on the designated image, the operation of performing OCR character recognition on the designated image is performed.
In this way, the second electronic device can also respectively acquire first indication information determined according to the type of the image and second indication information determined according to the content tag, wherein the first indication information and the second indication information are both used for indicating whether the second electronic device needs to perform OCR character recognition operation on the specified image.
According to a second aspect, determining first indication information of a designated image according to a category of the designated image includes: when the fact that the category of the designated image belongs to the screenshot is detected, acquiring the category of the application to which the designated image belongs from the attribute information of the designated image; when the application to which the specified image belongs is detected to belong to the first type of application, determining that first indication information of the specified image indicates the second electronic equipment to perform OCR character recognition on the specified image; when the application to which the designated image belongs is detected to belong to the second type of application, whether the second electronic equipment is in a screen-off and charging state is detected; when the second electronic equipment is detected not to be in a charging and screen-off state, determining that the first indication information of the designated image indicates the second electronic equipment to stop performing OCR character recognition operation on the designated image; and when detecting that the application to which the specified image belongs to the third type of application, determining that the first indication information of the specified image indicates that the second electronic equipment stops OCR character recognition operation on the specified image.
According to a second aspect, determining first indication information of a designated image according to a category of the designated image includes: when the type of the designated image is detected to belong to the photo, determining the mode type of the photographing mode of the designated image according to the photographing mode tag of the designated image, wherein the mode type comprises a first type mode, a second type mode and a third type mode; when the photographing mode of the specified image is detected to belong to a first type mode, determining that first indication information of the specified image indicates second electronic equipment to perform OCR character recognition on the specified image; when the photographing mode of the designated image is detected to belong to a second type mode, detecting whether the second electronic equipment is in a screen-off and charging state; when the second electronic equipment is detected not to be in a charging and screen-off state, determining that the first indication information of the specified image indicates that the second electronic equipment cancels the operation of OCR character recognition on the specified image; and when the photographing mode of the specified image is detected to belong to the third type mode, determining that the first indication information of the specified image indicates the second electronic equipment to cancel the operation of performing OCR character recognition on the specified image.
According to a second aspect, determining second indication information of a specified image according to a category of a content tag of the specified image includes: when the content label of the designated image is detected to belong to the first type label, determining that second indicating information of the designated image indicates second electronic equipment to perform OCR character recognition on the designated image; when the content tag of the designated image is detected to belong to a second type tag, detecting whether the second electronic equipment is in a screen-off and charging state; when the electronic equipment is detected not to be in a charging and screen-off state, determining that second indication information of the specified image indicates that second electronic equipment cancels OCR character recognition operation on the specified image; and when the content label of the designated image is detected to belong to the third type label, determining that the second indication information of the designated image indicates the second electronic equipment to cancel the operation of OCR character recognition on the designated image.
According to the second aspect, before acquiring the attribute information of the specified image and the identification tag of the specified image, the method further comprises: detecting a preset trigger condition, wherein the preset trigger condition comprises the following steps: the second electronic equipment receives an operation of viewing a specified image by a user; or the second electronic equipment is in a screen-off and charging state; or the second electronic equipment receives the operation of viewing the gallery by the user. The second electronic equipment is provided with multiple triggering modes, so that the electronic equipment can timely perform character recognition operation on the image, a user can check the image conveniently, and the experience of the user in using the electronic equipment is improved.
In a third aspect, the present application provides an electronic device, comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory and when executed by the one or more processors, cause the method of text recognition of an image to be electronically performed, as the first aspect and any implementation of the first aspect.
In a fourth aspect, the present application provides an electronic device, comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, and when executed by the one or more processors, cause the method of text recognition of an image to be electronically performed as described in the second aspect and any one implementation of the second aspect.
Any one implementation manner of the second aspect and the second aspect corresponds to any one implementation manner of the first aspect and the first aspect, respectively. For technical effects corresponding to any one implementation manner of the second aspect and the second aspect, reference may be made to the technical effects corresponding to any one implementation manner of the first aspect and the first aspect, and details are not repeated here.
In a fifth aspect, the present application provides a computer-readable medium for storing a computer program, which, when run on an electronic device, causes the electronic device to perform a method for recognizing characters of an image corresponding to any one of the implementations of the first aspect and the first aspect, or perform a method for recognizing characters of an image corresponding to any one of the implementations of the second aspect and the second aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of an exemplary illustrated electronic device;
FIG. 2 is an interaction diagram of a method for recognizing characters in an image according to an embodiment of the present application;
FIG. 3a is a flowchart of determining a specific model according to an embodiment of the present application;
fig. 3b is a flowchart of determining transmission data according to an embodiment of the present application;
fig. 4a is a flowchart of an operation of performing OCR character recognition on a specified image by a mobile phone B according to an embodiment of the present application;
fig. 4B is a flowchart of another operation of performing OCR character recognition on a designated image by a mobile phone B according to the embodiment of the present application;
fig. 5a is a flowchart of determining first indication information when the mobile phone B determines that the type of the designated image is a screenshot;
fig. 5B is a flowchart of determining first indication information when the mobile phone B determines that the type of the designated image is a photo;
fig. 5c is a flowchart of determining second indication information when the mobile phone B according to the category of the content tag of the specified image according to the embodiment of the present application;
fig. 5d is a flowchart of determining a first detection result when the mobile phone B determines that the type of the designated image is the screenshot;
fig. 5e is a flowchart of determining a first detection result when the mobile phone B determines that the type of the designated image is a photo;
fig. 5f is a flowchart of determining a second detection result by the mobile phone B according to the embodiment of the present application
FIG. 6 is a schematic diagram of application categories provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a schema class provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of a tag class provided by an embodiment of the present application;
fig. 9a is a schematic diagram of a gallery of a mobile phone a according to an embodiment of the present application;
figure 9b shows a schematic diagram of cell phone C transmitting an image to cell phone a;
fig. 9c is a diagram showing attribute information of an image held by the mobile phone a;
FIG. 10 is a schematic diagram of image information provided in an embodiment of the present application;
FIG. 11 is a schematic diagram of a storage format of an image in JPG format according to an embodiment of the present application;
fig. 12 is a schematic diagram of a mobile phone a added with an identification tag according to an embodiment of the present application;
FIG. 13 is a diagram showing an operation of the cellular phone A performing OCR character recognition on a designated image;
FIG. 14 is a schematic diagram of an exemplary transmission;
fig. 15 is a diagram illustrating an example in which the mobile phone a adds the recognition result to the attribute information;
FIG. 16 is a diagram illustrating an exemplary transmission of data;
fig. 17 is a diagram schematically illustrating a specific image received by the cell phone B;
fig. 18 is a schematic diagram illustrating an exemplary handset a with an identification tag added;
FIG. 19 is a schematic diagram of an exemplary transmission;
fig. 20 is a diagram schematically illustrating a specific image received by the cellular phone B;
fig. 21 is a schematic diagram illustrating a specific image received by the cell phone B;
fig. 22 is a schematic diagram of attribute information of the image IMG2 exemplarily shown;
FIG. 23 is a diagram illustrating an application scenario of text recognition of an image;
FIG. 24 is a schematic diagram illustrating an application scenario of text recognition of another image;
FIG. 25 is a diagram illustrating an exemplary application scenario for text recognition of an image;
FIG. 26 is a diagram illustrating an application scenario for text recognition of an image;
FIG. 27 is a diagram illustrating an exemplary application scenario for text recognition of an image;
FIG. 28 is a diagram illustrating an exemplary application scenario for text recognition of an image;
FIG. 29a is a diagram illustrating an exemplary text recognition scenario for an image;
FIG. 29b is a diagram illustrating an exemplary text recognition scenario for an image;
FIG. 29c is a diagram illustrating an exemplary text recognition scenario for an image;
fig. 30 is a software configuration diagram of an exemplary illustrated electronic device;
fig. 31 is a schematic diagram illustrating interaction between internal modules of a mobile phone a;
FIG. 32 is a schematic diagram illustrating interaction between internal modules of a handset B;
fig. 33 is a schematic diagram illustrating interaction between internal modules of another handset a;
fig. 34 is an exemplary interaction diagram of modules when the mobile phone B performs an OCR character recognition operation on the image C.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The terms "first" and "second," and the like, in the description and in the claims of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular order of the objects. For example, the first target object and the second target object, etc. are specific sequences for distinguishing different target objects, rather than describing target objects.
Fig. 1 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present disclosure. It should be understood that the electronic device 100 shown in fig. 1 is only one example of an electronic device, and that the electronic device 100 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in fig. 1 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The electronic device 100 may include: the mobile terminal includes 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. Wherein the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
In this embodiment, the processor 110 may be configured to trigger text recognition on an image according to a user operation or detection of a preset recognition condition. The processor 110 may also be used to add other information to the image, such as a photographing mode of the image, device information for capturing the image, and the like. The processor 110 may also be configured to detect a current status of the electronic device, such as whether the electronic device is in a charging status, a screen-off status, or a screen-off and charging status. The processor 110 may also be configured to intercept an image formed by the contents of the screen according to a user operation and store the intercepted image in the gallery.
In this embodiment, the display screen 194 may be used to display images in a gallery, display an interface of an application program, and the like. The display screen may also display various operable controls (e.g., clickable buttons, slidable sliders, etc.) provided by the electronic device for the user, and the like.
In the embodiment of the present application, the internal memory 121 may be used to store images, such as images captured by a camera, images generated by screen capturing of an electronic device, and the like. The internal memory 121 may also store recognition results of OCR character recognition of images and the like.
It is to be understood that in other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components.
The software system of the electronic device 100 may employ a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the application takes an Android system with a layered architecture as an example.
In some embodiments, the electronic device 100 stores a plurality of images (e.g., 500 images) in a gallery, and the electronic device 100 performs OCR character recognition on the images viewed by the user in sequence in response to the user viewing the images. Alternatively, the electronic device 100 may use deep learning based OCR text recognition techniques. Deep learning OCR character recognition technology is a technology that uses a trained OCR model to perform recognition by collecting data and training a deep learning model (e.g., an OCR model). Deep learning based OCR models include text detection models and text recognition models. The electronic device 100 may deploy a text detection model to implement text detection on the image, and deploy a text recognition model to implement text recognition on the image. I.e. OCR character recognition comprises the operations of text detection and text recognition.
The text detection model is used for positioning the position of the text in the image. The electronic device 100 inputs an image into the text detection model, which outputs coordinates of each text region, each character in the image. The method for detecting the text by the text detection model comprises the following steps: a text detection method based on candidate boxes, a text detection method based on semantic segmentation, and a hybrid method based on two text detection methods.
The text recognition model is used to recognize text in the image. Alternatively, the electronic device 100 inputs a slice image of a single text region into a text recognition model that will output the textual content in the slice. The framework of text recognition model recognition of text comprises: a frame combining a Convolutional Neural Network (CNN), a Recurrent Neural Network (RNN), and a connection dominant time Classification (CTC) algorithm, or a frame combining a CNN, a Sequence to Sequence model, and an Attention model (Attention).
In order to ensure the accuracy of text recognition on an image, preprocessing is performed before OCR character recognition, such as performing rotation correction on the image, and post-processing may be performed after OCR character recognition, such as performing error correction on the text.
When the user clicks into the gallery of the electronic device 100, OCR character recognition of the image by the electronic device will be triggered. That is, each time the user views an image, the electronic device 100 performs OCR character recognition on the viewed image, which results in an increase in power consumption of the electronic device 100, for example, assuming that the time delay of OCR character recognition on an image with 5 lines of text is 630ms and the power consumption is m. When a user views 50 same images in sequence, the electronic device 100 performs OCR character recognition on the 50 images in sequence, where the time delay for viewing 50 images is 630ms × 50; the consumed power consumption is m x 50; the power consumption of the electronic device increases. The time for OCR character recognition is prolonged, so that the speed of the user for viewing the image is also influenced, and the experience of the user is influenced.
In addition, when a certain electronic device (e.g., the electronic device a) transmits an image to another electronic device (e.g., the electronic device B), the electronic device a stores the recognition result of the image, and after the electronic device a transmits the image to the electronic device B, the electronic device B still needs to perform character recognition on the image if the electronic device B checks the character recognition result of the image, thereby increasing the power consumption of the electronic device B.
Some embodiments of the present application provide a method for character recognition of an image to optimize efficiency of OCR character recognition of an image in a gallery by an electronic device. For example, in the embodiment of the present application, the electronic device 100 is a mobile phone.
Fig. 2 is a flowchart of an exemplary embodiment of the present disclosure, which provides a text recognition method for an image. The character recognition method of the image comprises the following steps:
step 201: the cell phone a reads attribute information of a specified image in response to the received image transmission instruction.
Illustratively, the mobile phone a is a sending end device of data, and the mobile phone B is a receiving end device of data. The mobile phone a stores attribute information corresponding to each image. Illustratively, the attribute information may include: the system comprises a first tag, a second tag, a photographing mode tag and a content tag; the method can also comprise the following steps: acquisition time information of the image, and the like. The first label is used for indicating the source mode of the acquired image, for example, the first label is "DCIM" and may be used for indicating that the image is from shooting, and the first label is "Screenshot" and may be used for indicating that the image is from screen capture operation. The photographing mode tag is used for indicating the working mode of photographing images, such as: portrait mode, large aperture mode, etc. The content tag is used to indicate a category to which the content of the image belongs, for example, if the content in the image is represented by a cake, the category to which the content of the image belongs is food, that is, the content tag "food" is used to indicate that the content of the image is food. If the content in the image is represented by characters, the category to which the content of the image belongs is a Text, and the mobile phone can mark a content tag of "Text1" for the image. The second label is used to indicate information of the application to which the image belongs. The image acquisition time information is used for indicating the time when the current mobile phone acquires the image or indicating the time when the source electronic equipment sending the image generates the image. Note that, the content included in the attribute information in the present application is only an illustrative example, and the present application is not limited thereto. In other embodiments, the attribute information may further include a combination of one or more of the following information: the method comprises the steps of obtaining color information of an image (such as RGB three-color detailed information), a photographing mode label (such as a portrait photographing mode label, a night scene photographing mode label, a large-aperture photographing mode label and the like), source equipment information and the like, wherein the source equipment information is used for indicating model information, system information (such as Android version information) and the like of equipment for sending the image.
The mobile phone a can store the attribute information of the image in the database of the mobile phone in a data structure manner. The mobile phone a binds the image and the attribute information of the image. For example, the mobile phone a may bind the image with the attribute information of the image through the identification information of the image. The identification information of an image may be used to uniquely indicate the image. The mobile phone a may generate the identification information of the image according to the attribute information, for example, the mobile phone a may set unique corresponding identification information (such as IMG 2) for the image, or may use the time when the image is captured as the identification information of the image.
It should be noted that the identification information in this example is only an exemplary example, and in other embodiments, the identification information may also be randomly generated, for example, a character string with a preset number of bits that can be generated at any time by a mobile phone, and the randomly generated character string is used as the identification information of an image, which is not limited in the application. In this example, the attribute information may be stored in the database in a table format, where the table format is shown in table 1, where the attribute information in table 1 includes: the image processing device comprises a first tag, a second tag, image acquisition time, a photographing mode tag and a content tag. And the mobile phone binds the image and the attribute information corresponding to the image through the image identifier. It should be noted that the items included in the attribute information in this example are only exemplary examples, and in other embodiments of the present application, the attribute information may include more or less items than those in table 1. The mobile phone can search the attribute information corresponding to the image according to the image identifier.
TABLE 1
Figure GDA0004009044430000131
The user can click the icon of the clone application in the mobile phone A, and the mobile phone A responds to the click operation of the user to start the clone application of the mobile phone A. Similarly, the mobile phone B starts the clone application in the mobile phone B in response to the start operation of the user. The clone application of the mobile phone A can be matched with the mobile phone B by acquiring the two-dimension code provided by the clone application of the mobile phone B, and the mobile phone A is in communication connection with the mobile phone B. The data transmission between the clone application of the mobile phone A and the clone application of the mobile phone B is carried out through a WLAN hotspot established between the two mobile phones, and the data in the old mobile phone (namely, the mobile phone A) can be quickly transmitted to the new mobile phone (namely, the mobile phone B) without using a data line, connecting to a network and using mobile data.
The mobile phone a may read the images in the gallery in response to a transmission instruction of the user (e.g., clicking a button for transmitting the images, etc.) after detecting that the connection with the mobile phone B is successfully established. Optionally, the mobile phone a selects any one of the images in the gallery as the designated image, for example, the mobile phone may sequentially use the images to be processed as the designated images. If the gallery stores 3 images (image a, image b, and image c, respectively), the mobile phone a traverses each image in the gallery. That is, when the mobile phone a processes the image a, the image a is set as a designated image. When processing the image b, the image b is used as a designated image. When the image c is processed, the image c is set as a designated image. After the mobile phone a determines the designated image, the attribute information of the designated image is read. Alternatively, the attribute information specifying the image in this example may include: a first tag, a content tag, and a second tag.
It should be noted that, in this example, a manner in which the mobile phone a transmits data through the clone application is taken as an example, in other examples, the mobile phone a may share an image in the mobile phone a to the mobile phone B through the instant messaging application in a manner of sharing the image. The way of sharing the image may be: glory sharing, bluetooth sharing, wechat sharing, wi-Fi sharing, etc., which are not listed in this example.
Step 202: the mobile phone a takes the attribute information of the specified image and the specified image as image information.
Step 203: the mobile phone A obtains the model of the receiving terminal device, the model of the source identification device of the appointed image and the model of the mobile phone A.
In some embodiments, after the communication connection between the mobile phone a and the mobile phone B is established, the mobile phone a can read the model of the mobile phone B. The mode of reading the model of the mobile phone B by the mobile phone a may be sending a request for reading the model to the mobile phone B, and the mobile phone B feeds back the model thereof to the mobile phone a after responding to the request for reading the model sent by the mobile phone a. The mobile phone a can also acquire the model of the device itself and the model of the source identification device of the image. Alternatively, the source identification device of the image may refer to a source device that acquires the image. For example, if the mobile phone a performs a character recognition operation on the specified image before executing step 201, the mobile phone a is the source recognition device of the specified image. For another example, the mobile phone a stores a specific image, and the specific image is transmitted from the mobile phone C to the mobile phone a, that is, the source identification device of the specific image is the mobile phone C. And when the source identification equipment of the specified image is the mobile phone A, the source identification equipment of the specified image and the mobile phone A are the same equipment.
Step 204: the mobile phone A selects one model from the model of the source identification equipment of the image and the model of the equipment of the mobile phone A as an appointed model.
Alternatively, the handset a in this example may determine the specified model by using the flow shown in fig. 3 a. The step of determining the specified model in fig. 3a may comprise:
step 2041: the mobile phone A judges whether the model of the mobile phone A is different from the model of the source identification device. If the model of the mobile phone a is determined to be the same as the model of the source identification device, step 2042 is executed. If the model of the mobile phone a is determined to be different from the model of the source identification device, step 2043 is executed.
Step 2042: the model of the mobile phone A is selected as the designated model by the mobile phone A.
For example, when the model of the mobile phone a is the same as the model of the source identification device of the designated image, the model of the mobile phone a may be directly used as the designated model.
Step 2043: the mobile phone A judges whether the designated image has an OCR recognition result. If it is determined that the designated image has the OCR recognition result, go to step 2044. If it is determined that the designated image has no OCR recognition result, go to step 2042.
For example, the mobile phone a may inquire whether the OCR recognition result of the designated image is stored, and if the OCR recognition result of the designated image is inquired, it may be determined that the designated image has the OCR recognition result, and step 2044 is performed. If the OCR recognition result of the designated image is not queried, it may be determined that the designated image has no OCR recognition result, and step 2042 is performed.
Step 2044: the mobile phone A selects the model of the source identification device as the designated model.
In this example, the model of the mobile phone a is compared with the source identification device, and if it is determined that the model of the mobile phone a is the same as the model of the source identification device, the model of the mobile phone a can be directly determined to be the designated model, and it is not necessary to determine whether the designated image has an OCR recognition result subsequently, thereby reducing unnecessary steps. The model of the source identification equipment is higher than that of the mobile phone A, and the mobile phone A does not have an OCR identification function, so that if the model of the source identification equipment is selected as the designated model, the mobile phone A or the mobile phone B does not perform character identification on the designated image, and the electronic equipment fails to identify the designated image.
It should be noted that, in another example, the mobile phone a may further obtain a system version of the mobile phone B, and after determining the specified model, obtain a system version of the device to which the specified model belongs as the specified version, for example, if the specified model is the model of the mobile phone a, then obtain the system version a1.0 of the mobile phone a. System version a1.0 is taken as the specified version. If the specified model is the model of the mobile phone C, the stored system version C1.0 of the mobile phone C can be acquired, and the mobile phone a takes the system version C1.0 as the specified version.
Step 205: the mobile phone A compares the model of the receiving end equipment with the specified model to obtain a comparison result.
Illustratively, the handset a compares the model of the handset B (i.e., the receiving end device) with the specified model to obtain a comparison result. That is, the comparison result may be that the specified model is the same as the model of the mobile phone B, the specified model is larger than the model of the mobile phone B, and the specified model is equal to the model of the mobile phone B.
In another example, when the mobile phone a further obtains the specified version and the system version of the mobile phone B, the mobile phone a first compares the model of the mobile phone B with the specified model, and when the model of the mobile phone B is different from the specified model, a comparison result between the model of the mobile phone B and the specified model is used as a comparison result. If the model of the mobile phone B is determined to be the same as the designated model, the mobile phone A compares the system version of the mobile phone B with the designated version, and a comparison result between the system version of the mobile phone B and the designated version is used as a comparison result. For example, if the mobile phone a determines that the designated model is the same as the model of the mobile phone B, the designated version is compared with the system version of the mobile phone B, and if the designated version is determined to be greater than the system version of the mobile phone B, the comparison result indicates that the designated version is greater than the system version of the mobile phone B.
It should be noted that, in this example, the result of comparison between the model of the mobile phone B and the designated model is taken as an example of the comparison result.
It can be understood that the mobile phone a may store information of the size relationship between the models of the mobile phones in advance, so that the mobile phone a may accurately compare the sizes between the models. Similarly, the mobile phone a may also store size relationship information between the system versions, so that the mobile phone a may accurately determine the sizes between the versions.
Step 206: and the mobile phone A determines the transmission data according to the comparison result and the image information.
In one example, handset a may determine the transmission data using the procedure shown in fig. 3 b. The process shown in FIG. 3b includes:
step 2061: the mobile phone A detects that the comparison result indicates that the designated model is larger than the model of the receiving terminal equipment. After which step 2062 is performed.
Step 2062: the mobile phone A sets the identification label as a false value.
Exemplarily, the mobile phone a performs a character recognition operation on a designated image to obtain a recognition result a1; the mobile phone B performs character recognition operation on the same designated image to obtain a recognition result B1. When the specified model is larger than the model of the mobile phone B, the identification result a1 is more accurate than the identification result B1. Therefore, when the mobile phone a determines that the designated model is larger than the model of the mobile phone B, the mobile phone a can indicate that the mobile phone B does not perform the character recognition operation on the designated image any more. Optionally, the mobile phone a may add an identification tag to the attribute information, where the identification tag may be information indicating whether the mobile phone B performs an OCR character recognition operation. When the value of the identification tag is false (i.e. false), the identification tag is used to instruct the mobile phone B to end the operation of performing OCR character recognition on the specified image.
It is understood that the value of the identification tag may also be other character strings, for example, a false value of the identification tag may be indicated by "0", which is not listed in this example.
Step 2063: the mobile phone A judges whether the designated image has an OCR recognition result. If the mobile phone a determines that the designated image has the OCR recognition result, step 2064 is executed, in which the image information and the recognition result are used as the transmission data. If the mobile phone a determines that the designated image has no recognition result of OCR, step 2065 is executed, that is, OCR character recognition is executed.
For example, the cell phone a may obtain the result of step 2043, that is, may know whether the designated image has the OCR recognition result.
In another example, the mobile phone a may also query whether the designated image has an OCR recognition result, if the mobile phone a queries the OCR recognition result of the designated image, the step 2064 is determined to be performed, and if the mobile phone a does not query the OCR character recognition result of the designated image, the step 2065 is determined to be performed.
Step 2064: the mobile phone a takes the image information and the recognition result as transmission data.
Step 2065: the mobile phone a performs an OCR character recognition operation on the designated image.
Illustratively, since the identification tag is used for indicating the operation that the mobile phone B does not perform character recognition on the image, when the mobile phone a does not inquire the recognition result of the OCR of the specified image, the operation that the mobile phone a performs OCR character recognition on the specified image is triggered.
The OCR character recognition process comprises the following steps: text detection and text recognition. When the mobile phone A detects that the designated image has the text, continuing to perform text recognition on the designated image, and acquiring a recognition result of the text recognition on the designated image by the mobile phone A, wherein the recognition result is also the recognition result of OCR character recognition. When the mobile phone a does not detect that the text exists in the designated image, the mobile phone a ends the flow of OCR character recognition.
Step 2066: the mobile phone A detects that the comparison result indicates that the designated model is smaller than or equal to the model of the receiving terminal equipment.
Step 2067: the mobile phone A sets the identification label as true value.
Exemplarily, the mobile phone a performs an OCR character recognition operation on a designated image to obtain a recognition result a1; and the mobile phone B performs OCR character recognition operation on the same specified image to obtain a recognition result B1. When the specified model is less than or equal to the model of the cellular phone B, the accuracy of the recognition result a1 is weaker than or equal to the recognition result B1. Therefore, when the mobile phone a determines that the specified model is smaller than or equal to the model of the mobile phone B, the mobile phone a can instruct the mobile phone B to perform an OCR character recognition operation on the specified image. Alternatively, handset a may set the value of the identification tag to be true (i.e. true), and then the identification tag is used to instruct handset B to perform an operation of OCR character recognition on the specified image.
It will be appreciated that other strings may be used for the value of the identification tag, for example, a true value of the identification tag may be indicated by "1", which is not listed in this example.
Step 2068: the mobile phone A inquires whether the mobile phone A has an OCR character recognition function. If the mobile phone a determines that the OCR character recognition function is available, step 2063 is executed. If the mobile phone a determines that the OCR character recognition function is not available, step 2069 is executed.
Illustratively, handset a may query the system of handset a whether it has OCR text recognition capability.
Step 2069: the mobile phone a takes the image information as transmission data.
It should be noted that, in another example, when the mobile phone a uses the result of the comparison between the system version and the specified version of the mobile phone B as the comparison result, the step 2061 performed by the mobile phone a is: the mobile phone A detects that the comparison result indicates that the designated version is larger than the version of the receiving terminal equipment. The step 2066 executed by the handset a may be: the mobile phone A detects that the comparison result indicates that the designated version is less than or equal to the version of the receiving terminal equipment.
Step 207: the mobile phone A sends transmission data to the mobile phone B.
Illustratively, handset a sends the transmission data to handset B through the established communication channel. As in this example, data transfer occurs through a WLAN hotspot established between the two handsets.
Step 208: and the mobile phone B receives the transmission data sent by the mobile phone A.
Step 209: the mobile phone B acquires the designated image and the attribute information of the designated image from the transmission data.
The transmission data includes a designated image and attribute information of the designated image. The mobile phone B acquires the designated image and the attribute information of the designated image from the transmission data.
Step 210: the mobile phone B stores the designated image and the attribute information of the designated image.
For example, the mobile phone B may store the attribute information of the image in a database of the mobile phone in a data structure manner. The mobile phone A binds the image and the attribute information of the image. For example, the mobile phone B may bind the image with the attribute information of the image through the identification information of the image. The identification information of an image may be used to uniquely indicate the image.
Step 211: and when the mobile phone B detects a preset trigger condition, performing OCR character recognition operation on the specified image according to the comparison result in the transmission data and the attribute information of the specified image.
Illustratively, the preset trigger condition may be: and the mobile phone B receives the operation of the user for checking any image in the gallery. It should be noted that the trigger conditions in this example are only exemplary examples, and in other examples, the preset trigger conditions may also be: the mobile phone B detects that the mobile phone B is in a screen-off and charging state; or, the mobile phone B receives the operation of the user for checking the gallery. This is not to be enumerated in this application.
In this example, after the mobile phone B binds the specified image and the attribute information of the specified image and stores the bound image, the mobile phone B may trigger the mobile phone B to perform an OCR character recognition operation on the specified image in response to an operation of the user to view the specified image.
The mobile phone B can obtain the comparison result in the transmission data and the attribute information of the designated image, and perform an OCR character recognition operation on the designated image. The following describes in detail the process of performing OCR character recognition on a designated image by the mobile phone B with reference to fig. 4a and 5a to 5c.
Fig. 4a is a flowchart illustrating an exemplary operation of the mobile phone B performing OCR character recognition on the designated image.
Step 2111: the mobile phone B reads the attribute information of the specified image.
And the mobile phone B stores the images of different source modes in the gallery for the user to view. For example, the mobile phone B obtains an image by taking a picture, the mobile phone B receives a designated image sent by another electronic device (such as the mobile phone a), or the mobile phone B obtains an image by capturing a screen.
In this example, an image is displayed on the gallery interface in a thumbnail mode, the user clicks the thumbnail, and the cell phone B responds to the clicking operation of the user to open the image corresponding to the thumbnail. The mobile phone B can also determine the identification information of the image corresponding to the thumbnail through the thumbnail, and search the attribute information bound with the identification information from the database. Illustratively, the mobile phone B searches the attribute information bound by the specified image from the database in response to the operation of clicking the thumbnail of the specified image by the user.
It should be noted that, in this example, the attribute information may include: the mobile terminal comprises a first tag, a second tag, a photographing mode tag, a content tag and an identification tag. Optionally, the attribute information may include time information of acquiring the image.
Step 2112: the mobile phone B determines whether the identification tag is a true value. And when the mobile phone B determines that the identification label is a false value, ending the process. When the mobile phone B determines that the identification tag is true, step 2113 and step 2115 are executed.
Illustratively, the mobile phone B acquires an identification tag from the attribute information of the specified image, and determines whether the identification tag is a true value. When the mobile B determines that the identification tag is false (i.e., false), the mobile B ends the process. After finishing the operation of performing OCR character recognition on the image, the mobile phone B can directly acquire the recognition result of the specified image from the transmission data.
In this example, the mobile phone B determines whether the mobile phone B performs OCR character recognition on the designation by judging whether the identification tag is a true value. When the identification label is a false value, the mobile phone B does not need to perform OCR character identification operation on the image, but directly acquires the identification result of the OCR character identification of the specified image from the transmission data, so that the situation of repeated identification or the situation that the accuracy of the identification result of the mobile phone B is smaller than that of the identification result in the transmission data is avoided.
When handset B determines that the identification tag is true (i.e., true), then handset B may perform steps 2113 and 2115 in parallel.
Step 2113: the mobile phone B determines the type of the designated image from the attribute information of the designated image.
Illustratively, after the cell phone B reads the attribute information of the specified image, the first tag is acquired from the attribute information. And the mobile phone B determines the category of the specified image according to the first label. For example, if the first tag obtained from the attribute information is "Screenshot", the mobile phone B determines that the specified image belongs to the Screenshot. If the value of the first label is "DCIM", the mobile phone B determines that the designated image belongs to a photo.
It is understood that the mobile phone B may store in advance a correspondence between the first tag and the category of the image, for example, "Screenshot" -Screenshot, "DCIM" -photo. When the mobile phone B acquires the first tag from the attribute information, the category of the designated image can be determined according to the stored correspondence between the first tag and the category of the image. It should be noted that the value of the first label is an exemplary example. In other embodiments, for example, the first label indicating the photograph may be "Camera". The value of the first tag is not particularly limited in this example.
In this example, the mobile phone can quickly acquire the category of the specified image through the attribute information.
Step 2114: the mobile phone B determines first indication information according to the type of the specified image. This step is followed by step 2117.
For example, when the mobile phone B determines that the category of the designated image is the screenshot, the method shown in fig. 5a may be used to determine the first indication information. When the cell phone B determines that the category of the designated image is a photograph, the first designation information may be determined by the method shown in fig. 5B.
In an example, a flow of determining the first indication information when the image is designated as the screenshot will be described with reference to fig. 5 a.
Step 501: and the mobile phone B determines the category of the specified image as the screenshot.
Step 502: and the mobile phone B acquires the information of the application to which the image belongs from the attribute information of the image.
For example, the handset B may obtain a second tag from the attribute information, and read the second tag, where the value of the second tag is: "taobao", the second label "taobao" may indicate that the application to which the screenshot belongs is "Taobao".
It is understood that the mobile phone B may store the corresponding relationship between the second tag and the application name in advance, for example, "taobao" -wanbao, "meitu" -american show. When the mobile phone B acquires the second tag from the attribute information, the name of the application to which the designated image belongs can be determined according to the stored correspondence between the second tag and the application name. It should be noted that the value of the second tag is an exemplary example.
Step 503: the handset B detects the type of application. When it is detected that the application belongs to the second probabilistic application, step 504 is performed. When it is detected that the application belongs to the first probabilistic application, step 506 is performed. When it is detected that the application belongs to the third probabilistic application, step 505 is performed.
For example, the electronic device may perform OCR character recognition on various screenshots, and determine the first probability application, the second probability application and the third probability application by means of big data statistics. Illustratively, a first probability application is used to indicate that the probability of the application occurring words is greater than a first threshold (e.g., the first threshold is 50%), and a second probability application is used to indicate that the probability of the application occurring words is greater than a second threshold and less than the first threshold, e.g., greater than 0 and less than 50%. The third probability application is used to indicate that the probability of the application appearing with a word is 0. It should be noted that, the first threshold and the second threshold are only exemplary, and the second threshold may be 0; in other embodiments, the first threshold may also be 60%, the second threshold may also be 20%, 10%, etc.
Fig. 6 is a schematic diagram of exemplary application categories. The handset B may store information of the application category as shown in fig. 6 in advance. Illustratively, the first probability application includes: social applications, educational applications, news reading applications, travel navigation applications, travel and lodging applications, shopping applications, business applications, food applications, portable life applications, and children applications. Social applications are such as: and (5) WeChat. Educational applications such as: XX learning English, XX tutoring, etc. News reading applications such as: daily news and central news. Travel navigation applications are as follows: baidu maps, gade maps, XX taxi taking applications, and the like. Travel accommodation applications are as follows: carry-the-journey application, where to go application, etc. Shopping applications include Taobao and Jingdong. Business applications such as: recruitment applications, brand query applications, and the like. Gourmet applications are as follows: lower kitchen use, etc. Portable life-style applications such as: memorandum, payment treasures, etc. Children's applications such as: XX picture of the book. It should be noted that the applications included in each category of the first probabilistic application are only examples, and in other embodiments, each category may further include other non-enumerated applications, for example, the social-type application may further include: nailing, flying pigeon, etc.
The second probabilistic application may include: the system comprises a video application, a financial and financial application (such as an exchange application), an exercise health application (such as XX exercise health), a tool application (such as a measuring tool application and a network disk application), and an automobile application (such as a second-hand car transaction application and a car inquiry application). The applications included in each category of the second probabilistic application are only examples, and in other embodiments, each category may further include other applications not listed, for example, the audio and video applications may further include: cool my music, etc.
The third probabilistic application may include: a beautification application (such as a figure beautifying application) and a theme personality application (such as a theme application). The applications included in each category of the third probabilistic application are only examples, and in other embodiments, each category may also include other non-enumerated applications.
In one example, the mobile phone B obtains information of an application to which the screenshot belongs, and a pre-stored application category, and determines the application category to which the screenshot belongs. For example, the name of the application to which the screenshot belongs is "panning", and the mobile phone B determines that the application to which the screenshot belongs to the first probability application according to the application category stored in advance.
In another example, the mobile phone B may also determine the category of the application to which the screenshot belongs through other means. For example, an application classification model to which the screenshot belongs may be trained, and the mobile phone B may input information of the application to which the screenshot belongs to the application classification model to which the screenshot belongs, so that the category of the application to which the screenshot belongs may be determined. The application classification model to which the screenshot belongs can be trained in advance. The training mode will not be described in detail.
It is understood that the mobile phone B may also determine the category of the application to which the screenshot belongs in other ways.
Step 504: and the mobile phone B judges whether the mobile phone B is in a screen-off and charging state. When the mobile phone B determines that it is in the off-screen and charging state, step 506 is executed. When the mobile phone B determines that it is not in the off-screen and charging state, step 505 is executed.
Step 505: the mobile phone B determines that the first indication information indicates to end the process.
Step 506: and the mobile phone B determines that the first indication information indicates OCR character recognition.
In another example, a flow of determining the first indication information when the image is specified will be described with reference to fig. 5 b.
Step 601: the mobile phone B determines the category of the specified image as a photo.
Step 602: the mobile phone B acquires the information of the photographing mode of the specified image from the attribute information of the specified image.
For example, the mobile phone B may read the content of the shooting mode tag from the attribute information, and use the value of the shooting mode tag as the information of the shooting mode, for example, the obtained attribute information includes "DCIM _20210928 \ _2010_ shooting _ Text1", the first attribute in the attribute information of the specified image is the source mode of the image, the value of the first tag is obtained as "DCIM", and the mobile phone B determines that the image belongs to the photo. The second attribute in the attribute information of the specified image is the photographing mode information of the image, the value of the obtained second label is "photographing", and the mobile phone B determines that the photographing mode of the image belongs to the common mode.
Alternatively, if the attribute information is stored in the database in the form of a table, the mobile phone B may read the value of the first tag of the specified image and the value of the photographing mode tag from the table according to the attribute name of the first tag and the identification information of the image. For example, the identification information of the designated image is "IMG2", and the value of the first tag of the image is read as "DCIM" and the value of the photographing mode tag of the image is read as "watermark" according to the contents of table 1.
Step 603: the mobile phone B recognizes the type of the photographing mode. When the mobile phone B recognizes that the photographing mode of the designated image belongs to the second probability mode, step 604 is executed. When the mobile phone B recognizes that the photographing mode of the designated image belongs to the first probability mode, step 606 is executed. When the mobile phone recognizes that the photographing mode of the designated image belongs to the third probability mode, step 605 is executed.
For example, the image may be divided into the photographing modes in advance, and the division of the photographing modes is similar to the division of the application categories, and refer to step 503, which is not described herein again. The first probability pattern is used to indicate that the probability of text appearing on the image is greater than a first threshold (e.g., the first threshold is 50%), and the second probability pattern is used to indicate that the probability of text appearing on the image is greater than a second threshold and less than the first threshold, e.g., greater than 0 and less than 50%. The third probability mode is used for indicating that the probability of the characters appearing on the image is less than or equal to the second threshold value and is greater than or equal to 0. It should be noted that the first threshold and the second threshold are only exemplary, and in other embodiments, the second threshold may be 0. Alternatively, the first threshold value may also be 60%, and the second threshold value may also be 20%, 10%, etc.
Fig. 7 is a diagram illustrating exemplary mode classes. The handset B may store information of the mode category as shown in fig. 7 in advance. Illustratively, the first probability pattern includes: a document rectification mode and a watermark mode. In this example, the modes included in the first probability mode are only examples, and in other embodiments, the first probability mode may be other photographing modes for photographing documents or containing text. The second probability pattern may include: a large aperture mode, a high pixel mode, and a normal photographing mode. In this example, the modes included in the second probability mode are only examples, and in other embodiments, the second probability mode may also be other photographing modes for photographing high-pixel images. The third probability pattern may include: night view mode, portrait mode, panorama mode, slow motion mode, underwater mode, black and white art mode, streamer shutter mode, delayed photography mode, super macro mode, multi-camera mode, and professional mode. The third probability pattern includes various types of labels, for example only, and in other embodiments, other non-enumerated patterns may be included.
In one example, the mobile phone B determines a category to which the photographing mode of the designated image belongs according to the value of the photographing mode tag and a pre-stored mode category. For example, the value of the shooting mode tag is "portrait", and the cell phone B determines that the "portrait" tag belongs to the third probability mode according to the pre-stored mode category.
In another example, handset B may also determine the category of the photographing mode tag in other ways. For example, a mode classification model of the photographing mode may be trained, and the mobile phone B inputs the content tag of the image into the trained mode classification model, so that the mode classification model may output the class of the photographing mode tag. The pattern classification model may be trained in advance. The training mode will not be described in detail. It will be appreciated that the handset B may also determine the category of the photographing mode tag in other ways.
Step 604: and the mobile phone B judges whether the mobile phone B is in a screen-off and charging state. When the mobile phone B determines that it is in the off-screen and charging state, step 606 is executed. When the mobile phone B determines that it is not in the off-screen and charging state, step 605 is executed.
Step 605: the mobile phone B determines that the first indication information indicates to end the process.
Step 606: and the mobile phone B determines that the first indication information indicates OCR character recognition.
In this example, when the mobile phone B determines that the type of the designated image is a screenshot, the first indication information is determined in a manner as shown in fig. 5 a; when the mobile phone B determines that the category of the designated image is a photograph, the first indication information is determined in the manner shown in fig. 5B.
It should be noted that the step of determining the first indication information and the step of determining the second indication information may be processed in parallel. I.e., after determining that the identification tag is true, step 2115 is performed in parallel.
Step 2115: and the mobile phone B judges whether the content label is empty or not according to the attribute information. When handset B determines that the content tag is not empty, step 2116 is performed. When handset B determines that the content tag is empty, step 2118 is performed.
Step 2116: and the mobile phone B determines second indication information according to the category of the content label of the specified image. After which step 2117 is performed.
In one example, a flow of determining the second indication information according to the category of the content tag of the specified image will be described with reference to fig. 5c. Determining the second indication information includes:
step 701: the mobile phone B acquires the content tag of the specified image from the attribute information of the specified image.
For example, the cell phone B may read the content of the content tag from the attribute information, for example, the obtained attribute information is "DICM _ Camera _20210928_2010_ shooting _ Text1", where a fifth attribute in the attribute information is the content tag, and the value of the content tag read by the cell phone is "Text1".
Alternatively, if the attribute information is stored in the database in the form of a table, the mobile phone B may read the value of the content tag of the image from the table according to the attribute name of the content tag and the identification information of the image. For example, the identification information of the image is "IMG1", and the value of the content tag corresponding to the image can be read as "Text1" from the content in table 1.
Step 702: handset B identifies the type of content tag. When the mobile phone B recognizes that the content tag of the designated image belongs to the second probability tag, step 703 is executed. When the mobile phone B recognizes that the content tag of the designated image belongs to the first probability tag, step 705 is executed. When the content label of the image is identified as belonging to the third probability label, step 704 is executed.
Illustratively, the categories of the content labels of the images may be pre-divided, illustratively, a first probability label indicating that the probability of text appearing on the images is greater than a first threshold (e.g., the first threshold is 50%), and a second probability label indicating that the probability of text appearing on the images is greater than a second threshold and less than the first threshold, e.g., greater than 0 and less than 50%. The third probability label is used for indicating that the probability of the characters appearing on the image is less than or equal to the second threshold and greater than or equal to 0. It should be noted that the first threshold and the second threshold are only exemplary, and in other embodiments, optionally, the first threshold may also be 60%, and the second threshold may also be 20%, 10%, and so on.
Fig. 8 is a diagram illustrating exemplary tag categories. The handset may store information of the tag class as shown in fig. 8 in advance. Illustratively, the first probability label includes: a class of documents. One class of documents includes: paper documents, identity cards, passports, bank cards, presentations, business cards, property cards, house books, invoices, train tickets, airline tickets, movie tickets, honor certificates, forms, marriage certificates, driving licenses, design drawings and the like. It should be noted that the types of objects included in a document category are merely examples, and in other embodiments, the document category may also include other non-listed entities including text, such as newspapers, magazines, and so on. The second probabilistic tag may include: vehicles and electric appliances. Alternatively, one type of vehicle may be a vehicle covered with text, for example, a car, train, ship, etc. whose body is covered with an advertisement. One type of electrical appliance may be an electrical appliance covered with text, for example, a printer, a self-service card charger, etc., whose body is covered with instructions for use. The objects included in the first category of transportation and the first category of electrical appliances are only examples, and in other embodiments, the first category of transportation may include other objects not listed, such as rescue vehicles covered with public welfare posts, and the second category of electrical appliances may include vending machines, intelligent containers, and the like. The third probabilistic tag may include: portrait, landscape, animal, home, art, show, sport, action, activity, accessory, apparel, toy, implement, vehicle class two, appliance class two, and document class two. Alternatively, the second type of vehicle may be a vehicle with no words covered or with less words than a predetermined number of words (e.g., 5 words), such as an excavator, a scooter, etc. The second type of electrical appliance can be an electrical appliance without covering characters or with characters less than a preset number of characters (such as 5 characters), such as an electric lamp, a patch board and the like
The home may be used to indicate that the object in the image is a sofa, a table, etc. The art can be used for indicating that objects in the image are artworks such as pictures and bottles. The program may be used to indicate that the image is on holidays, and if the image contains a cracker, the content tag for holidays may be used. Motion tags may be used to indicate motion of a person in an image, such as a start-up gesture of a person in an image, and tags for running may be used. The motion may be used to indicate the pose of a person or animal in the image. The activity may be used to indicate a task of a person in the image, the accessory may be used to indicate a decoration of clothing of the person in the image, the clothing may be used to indicate clothing of the person in the image, and so on.
The third probabilistic tag includes various types of tags, which is only an example, and in other examples, other non-enumerated tags may be included.
In one example, cell phone B determines the category to which the content tag of the designated image belongs based on the value of the content tag and the pre-stored tag category, similar to step 503. In another example, handset B may also determine the category of the content tag by other means.
Step 703: and the mobile phone B judges whether the mobile phone is in a screen-off and charging state. When the mobile phone B determines that it is in the off-screen and charging state, step 705 is executed. When the handset B determines that it is not in the off-screen and charging state, step 704 is executed.
Step 704: the mobile phone B determines that the second indication information indicates to end the process.
Step 705: and the mobile phone B determines that the second instruction information indicates OCR character recognition.
In this example, through steps 701 to 705, the mobile phone B can determine the second indication information according to the category of the content tag of the designated image. After the mobile phone B determines the first indication information and the second indication information, step 2117 may be executed.
Step 2117: the mobile phone B judges whether the first indication information and the second indication information both indicate to end the process. And when the mobile phone B determines that the first indication information and the second indication information both indicate that the flow is ended, ending the operation of performing OCR character recognition on the specified image. When the mobile phone B determines that both the first indication information and the second indication information indicate that the process is ended, step 2119 is executed.
Exemplarily, the mobile phone B determines that any one of the first indication information or the second indication information does not indicate to end the process, and then the mobile phone B executes step 2119.
Step 2118: and the mobile phone B determines that the second indication information indicates to end the process.
Step 2119: handset B performs OCR text recognition.
The mobile phone B carries out OCR character recognition on the image, and the OCR character recognition process comprises the following steps: text detection and text recognition. After the mobile phone B detects the text, continuing to perform text recognition on the designated image, and acquiring a recognition result of performing text recognition on the designated image by the mobile phone B, where the recognition result is also a recognition result of OCR character recognition. And when the mobile phone B does not detect the text, the mobile phone B ends the process.
Step 2120: the mobile phone B stores the recognition result of the OCR character recognition.
For example, the mobile phone B may store the recognition result of the OCR character recognition. And when the mobile phone B responds to the operation of viewing the OCR character recognition result by the user, displaying the recognition result. Illustratively, the operation of viewing the OCR text recognition results may be clicking a designated button in the interface.
In another example, another process of performing OCR character recognition on a designated image by the mobile phone B is described in detail with reference to fig. 4B and fig. 5d to 5f.
Fig. 4B is a flowchart illustrating an exemplary operation of performing OCR character recognition on the designated image by the mobile phone B.
Step 2111': the mobile phone B reads the attribute information of the designated image.
This step is similar to 2111 and will not be described further here.
Step 2112': the mobile phone B determines whether the identification tag is a true value. And when the identification label is detected to be a false value, ending the operation of performing OCR character recognition on the specified image. When the mobile phone B detects that the identification tag is true, step 2113 'and step 2114' are executed.
This step is similar to 2112 and will not be described further here.
Step 2113': the mobile phone B determines the type of the designated image from the attribute information of the designated image. After this step, step 2115' is performed.
This step is similar to 2113 and will not be described further here.
Step 2114': and the mobile phone B judges whether the content label is empty or not according to the attribute information. And determining that the second detection result is empty. When handset B detects that the content tag is not empty, step 2116' is performed. When handset B detects that the content tag is empty, step 2117' is performed.
This step is similar to 2115 and will not be described further here.
Step 2115': and the mobile phone B determines a first detection result according to the type of the specified image and the attribute information of the specified image. After this step, step 2118' is performed.
In one example, this step 2115' may take the form of the flow as in fig. 5d or 5 e. The specific process will be described in fig. 5d and 5 e.
Step 2116': and the mobile phone B acquires the content label from the attribute information and determines a second detection result. This step is followed by step 2118'.
The specific process of this step is shown in fig. 5f.
Step 2117': and the mobile phone B determines that the second detection result is empty. After this step, step 2118' is performed.
Step 2118': and the mobile phone B selects a high-grade type from the first detection result and the second detection result as the type to which the specified image belongs.
Optionally, the probability types to which the image belongs include: the first probability type, the second probability type, and the third probability type, wherein the first probability type is higher in level than the second probability type, and the second probability type is higher than the third probability type.
The images of the first probability type may include: the application belongs to an image of the first probability application, the photographing mode belongs to an image of the first photographing mode, or an image of which the content tag is the first probability tag.
The images of the second probability type may include: the image belonging to the second probability application, the image belonging to the second photographing mode in the photographing mode, or the image with the content tag being the second probability tag.
The images of the third probability type may include: the image belonging to the third probability application, the image belonging to the third shooting mode in the shooting mode, or the image with the content label as the third probability label.
And after the first detection result and the second detection result are determined, selecting a high-grade type as the probability type of the designated image. For example, if the first detection result indicates that the specified image belongs to the first probability type, and the second detection result indicates that the specified image belongs to the second probability type, it is determined that the image belongs to the first probability type.
Step 2119': the handset B detects the probability type of the specified image. And when the mobile phone B detects that the specified image belongs to the third probability type, ending the operation of performing OCR character recognition on the specified image. When mobile phone B detects that the designated image belongs to the second probability type, mobile phone B performs step 2120'. When mobile phone B detects that the designated image belongs to the first probability type, mobile phone B performs step 2123'.
Step 2120': and the mobile phone B judges whether the mobile phone is in a screen-off and charging state. When the mobile phone B detects that the mobile phone B is not in the charging and screen-off state, the mobile phone B executes step 2121'. When the mobile phone B detects that the mobile phone B is in the charging and screen-off state, the mobile phone B goes to step 2122'.
Step 2121': the mobile phone B specifies the text detection operation for the specified image. After this step, step 2122' is performed.
Step 2122': and storing the text detection result. After this step, the mobile phone B ends the operation of performing OCR character recognition on the designated image.
Step 2123': the mobile phone B performs a text detection operation on the specified image. After this step, step 2124' is performed.
Step 2124': the mobile phone B performs text recognition operation on the specified image.
Step 2125': and the mobile phone B stores the OCR character recognition result. After this step, the operation of OCR character recognition of the designated image is ended.
In the present example, the operations of text detection and text recognition are directly performed on the specified image belonging to the first probability type; and when the image is detected to belong to the second probability type and the mobile phone is not detected to be in the charging and screen-off states, carrying out text detection on the specified image. When the mobile phone detects that the designated image belongs to the third probability type, the designated image is not subjected to any operation; in this example, since the probability type to which the image belongs is determined in advance, a problem that operations performed on a specified image conflict with each other can be avoided.
Fig. 5d and 5e are flowcharts for determining the first detection result. Fig. 5f is a flow chart for determining a second detection result.
Fig. 5d is a schematic diagram of determining a first detection result when the category of the image belongs to the screenshot.
Step 501': and the mobile phone B determines the type of the specified image as the screenshot.
Similar to step 501, the detailed description is omitted here.
Step 502': and the mobile phone B acquires the information of the application to which the specified image belongs from the attribute information of the specified image.
Similar to step 502, further description is omitted here.
Step 503': the handset B detects the type of application. When the mobile phone B detects that the application to which the designated image belongs to the third probability application, step 504' is executed. When the mobile phone B detects that the application to which the designated image belongs to the second probability application, step 505' is executed. When the mobile phone B detects that the application to which the designated image belongs to the first probability application, step 506' is executed.
Similar to step 503, the detailed description is omitted here.
Step 504': the mobile phone B determines that the first detection result indicates that the specified image belongs to the third probability type.
Step 505': the mobile phone B determines that the first detection result indicates that the specified image belongs to the second probability type.
In a step 506': the handset B determines that the first detection result indicates that the specified image belongs to the first probability type.
In another example, fig. 5e is a schematic diagram illustrating the determination of the first detection result when the category of the image belongs to a photo.
A step 601': the mobile phone B determines the category of the specified image as a photo.
Similar to step 601, further description is omitted here.
Step 602': the mobile phone B acquires the information of the photographing mode of the specified image from the attribute information of the specified image.
Similar to step 602, the detailed description is omitted here.
Step 603': the mobile phone B detects the type of the photographing mode. When the mobile phone B detects that the photographing mode of the designated image belongs to the third probability mode, step 604' is executed. When the mobile phone B detects that the photographing mode of the designated image belongs to the second probability mode, step 605' is executed. When the mobile phone B detects that the photographing mode of the designated image belongs to the first probability application, step 606' is executed.
Similar to step 603, further description is omitted here.
Step 604': the mobile phone B determines that the first detection result indicates that the specified image belongs to the third probability type.
Step 605': the mobile phone B determines that the first detection result indicates that the specified image belongs to the second probability type.
Step 606': the handset B determines that the first detection result indicates that the specified image belongs to the first probability type.
In another example, fig. 5f is a schematic diagram of determining a second detection result according to a content tag of an image.
Step 701': the mobile phone B acquires the content tag of the specified image from the attribute information of the specified image.
Similar to step 701, further description is omitted here.
Step 702': handset B identifies the type of the content tag. When the mobile phone B detects that the content tag of the designated image belongs to the third probability tag, step 703' is executed. When the mobile phone B detects that the content tag of the designated image belongs to the second probability tag, step 704' is executed. When handset B detects that the content tag of the specified image belongs to the first probability application, step 705' is performed.
Similar to step 702, further description is omitted here.
Step 703': and the mobile phone B determines that the second detection result indicates that the specified image belongs to the third probability type.
Step 704': the mobile phone B determines that the second detection result indicates that the specified image belongs to the second probability type.
Step 705': the handset B determines that the second detection result indicates that the specified image belongs to the first probability type.
The following describes in detail a text recognition method for an image in the embodiment of the present application with reference to a specific scenario.
Fig. 9a is a schematic diagram of an exemplary illustrated gallery of handset a.
In one example, handset a launches a cloned application while handset B also launches a cloned application. And the mobile phone A establishes communication connection with the mobile phone B through the started clone application. The mobile phone a may, in response to receiving a transmission instruction from the user, sequentially take each image in the gallery as a designated image, and read attribute information of the designated image. Optionally, the transfer instruction in this example is that the user clicks a button for transferring the image in the clone application. For ease of understanding, the gallery main interface 901 of the mobile phone a is shown in this example, and thumbnails of the images are included in the gallery main interface 901. And binding respective attribute information to the image corresponding to each thumbnail. For example, attribute information 903 of the image corresponding to the thumbnail image 902. The attribute information includes: pixel information of an image corresponding to the thumbnail 902, a model of the mobile phone a (i.e., a model of a current device), a storage path of the image corresponding to the thumbnail 902, and the like. Alternatively, a part of the content in the attribute information may be referred to as a name of the image, for example, the first tag, the second tag, the content tag, and the acquisition time of the image in the attribute information may be used as the name of the image, and "screen _20210928 \_memorandum_text1" is used as the name of the image. The content included in the attribute information 903 is only an exemplary example, and in other examples, the attribute information may further include other content.
Fig. 9b shows a schematic diagram of cell phone C transmitting an image to cell phone a. In another example, cell phone C may establish a bluetooth connection with cell phone a before cell phone a establishes a communication connection with cell phone B, and cell phone C transmits an image into cell phone a through a bluetooth channel in response to an instruction from a user to transmit the image. And the mobile phone A receives the image transmitted by the mobile phone C and stores the image. Fig. 9c is a diagram showing attribute information of an image held by the mobile phone a.
As shown in fig. 9c, when the user clicks the gallery icon, the cell phone a displays a gallery main interface 901 'in response to the operation of clicking the gallery icon by the user, where the gallery main interface 901' includes thumbnails of the images. And binding respective attribute information to the image corresponding to each thumbnail. For example, the thumbnail image 902 'corresponds to the attribute information 903' of the image. The attribute information 903' includes: pixel information of an image corresponding to the thumbnail 902', a model of the mobile phone a (i.e., a model of a current device), a model of the source identification device (i.e., a model of the mobile phone C), a storage path of an image corresponding to the thumbnail 902', and the like.
In this example, the attribute information of the image includes: the model of the mobile phone a and the model information of the source identification device may not be included in the attribute information of the image in other examples, and the model of the mobile phone a and the model of the source identification device are stored in other positions by the mobile phone a.
The following takes the example of transferring the image corresponding to the thumbnail 902. With continued reference to fig. 9a, the cell phone a takes the image corresponding to the thumbnail image 902 as a designated image in response to the received transmission designation, and reads attribute information of the image corresponding to the thumbnail image 902. In one example, fig. 10 is a schematic diagram illustrating an example of image information. As shown in fig. 10, attribute information 1001 of a specific image and the specific image 1002 are bound as image information.
In another example, the mobile phone a may also write attribute information in the designated image 1002, with the designated image in which the attribute information is written as image information. Fig. 11 is a schematic diagram illustrating a storage format of an image in the JPG (or JPEG) format. In this example, the image is stored in the mobile phone a in the form of a hexadecimal file. Referring to fig. 11, reference numeral 1101 denotes a start of image (SOI) file, and reference numeral 1102 denotes an end of image (EOI) file of the image. I.e. the content of the image presented in the display screen starts from FFD8 and ends at FFD 9. Cell phone a does not show the content after FFD 9. The mobile phone a can write the attribute information of the image from the position of the FFD 9. Note that the attribute information of the image may be converted into a hexadecimal file and written from the position of the FFD9 into the storage file of the image.
In one example, since the mobile phone a and the mobile phone B both start their respective clone applications, and the mobile phone a and the mobile phone B are connected via a WLAN hotspot, the mobile phone a may send a request for reading the model to the mobile phone B, and after the mobile phone B receives the request for reading the model sent by the mobile phone a, the mobile phone B transmits the model of the mobile phone B to the mobile phone a. The mobile phone a reads the type of the transmission of the mobile phone B, for example, in this example, the type of the mobile phone B read by the mobile phone a is: honor 30.
In one example, the process of determining the specified model may be described in detail in conjunction with FIG. 9 a. As shown in fig. 9a, the model of the mobile phone a is "Honor 50pro". When the mobile phone A reads that the model of the mobile phone B is as follows: "Honor 30". Since the image IMG1 is obtained by screen capture of the mobile phone a, the mobile phone a queries that the source identification device of the image IMG1 is "Honor 50pro". The mobile phone A can detect that the model of the mobile phone A is the same as that of the source identification equipment, and then the mobile phone A selects the model of the mobile phone A as the designated model. Namely, the specified model determined by the mobile phone a is as follows: "Honor 50pro".
In another example, another scenario of determining a specified model may be detailed in conjunction with FIG. 9 c. As shown in fig. 9c, the model of the mobile phone a is "Honor 50pro". The model of the source identification device of the specified image is 'Honor 30', and when the mobile phone A reads that the model of the mobile phone B is: "Honor 30". The mobile phone a determines whether the designated image has an OCR recognition result if the mobile phone a detects that the model of the mobile phone a is different from the model of the source recognition device, in this example, taking the recognition result of the designated image is not queried by the mobile phone a as an example, when the mobile phone a queries the OCR recognition result of the designated image, the mobile phone a selects the model of the mobile phone a as the designated model. Namely, the specified model determined by the mobile phone a is: "Honor 50pro". Optionally, in another example, when the mobile phone a queries the recognition result of the specified image, the mobile phone a selects the model of the source recognition device as the specified model.
Fig. 12 is a schematic diagram illustrating an exemplary handset a with an identification tag added. In this example, as shown in fig. 12, the attribute information of the image 1301 shows that the designated model of the designated image is: "Honor 50pro". The mobile phone a compares the specified model (i.e., the horor 50 pro) with the model of the mobile phone B (i.e., the horor 30), and obtains a comparison result. If the mobile phone a detects that the comparison result indicates that "Honor 50pro" is greater than "Honor30", that is, the designated model is greater than the model of the mobile phone B, the value of the mobile phone a set identification tag 1302 is false (i.e., false). The mobile phone a adds the identification tag 1302 to the attribute information 1303 of the designated image 1301. Attribute information 1304 to which the identification tag is added is shown in fig. 12.
Note that the model of the current device and the model of the source identification device are not shown in the attribute information shown in fig. 12.
The mobile phone a queries whether the designated image has an OCR recognition result, and in one example, the mobile phone a may directly query the designated image recognition result a. In another example, when the mobile phone a does not query the recognition result of the OCR of the specific image, the mobile phone a may be triggered to perform OCR character recognition on the specific image. Fig. 13 is a schematic diagram showing an operation of the mobile phone a performing OCR character recognition on a designated image. For convenience of understanding, fig. 13a in fig. 13 shows the gallery main interface 1501, the image corresponding to the thumbnail 1503 is a designated image, and the mobile phone a directly performs OCR character recognition on the image corresponding to the thumbnail 1503 to obtain an OCR recognition result a. In this example, the time delay of OCR character recognition of the image corresponding to the thumbnail 1503 by the mobile phone a may be 630ms. As shown in fig. 13b, the mobile phone a performs OCR character recognition on the designated image, and reads the recognition result a.
Fig. 14 is a schematic diagram illustrating an exemplary transmission data. As shown in fig. 14, the mobile phone a can take a designation image 1602, attribute information 1601 of the designation image 1602, and a recognition result a (i.e., reference numeral 1603) of the designation image 1602 as a transmission data.
In another example, the mobile phone a may also write the acquired recognition result of the specified image into the attribute information or write the recognition result into a storage file of the specified image. As shown in fig. 15, fig. 15 is a schematic diagram showing that the mobile phone a adds the recognition result to the attribute information. As shown in fig. 15, the mobile phone a adds the recognition result a (i.e., reference numeral 1702) of the designated image (designated image 1701) to the attribute information 1703. The attribute information 1704 to which the recognition result a is added is shown in fig. 15. The attribute information 1704 includes: the identification result a identifies information such as a label, a designated model, a first label, a second label, a content label, and a pixel of the designated image. Fig. 16 is a diagram illustrating an exemplary transmission data. As shown in fig. 16, the cell phone a binds a specification image 1802 and attribute information 1801 of the specification image 1802 as transmission data. That is, the image information with the attribute information updated is used as transmission data. The attribute information for specifying the image may be written in a storage file of the image.
After determining the transmission data, the mobile phone a transmits the transmission data to the mobile phone B through the WLAN hotspot connection. The mobile phone B receives the transmission data sent by the mobile phone a, and can acquire the specified image (i.e., the image IMG 1) and the attribute information of the specified image from the transmission data. The mobile phone B may store the attribute information of the designated image in the database of the mobile phone B, and bind the designated image and the attribute information of the designated image. In this example, the transmission data further includes the identification result a, and then the mobile phone B may further obtain the identification result a from the transmission data, and similarly, the mobile phone B may bind the identification result a and the specific image.
In another example, when the attribute information and the recognition result are written into the storage file of the designated image (i.e., the image IMG 1) by the mobile phone a, and the mobile phone B receives the designated image, the attribute information and the recognition result a may be read from the storage file of the designated image.
Fig. 17 is a diagram schematically illustrating a specific image received by the cell phone B. When the mobile phone B detects an operation of the user to view the specified image, the mobile phone B reads the identification tag of the image IMG1. When the mobile phone B detects that the value of the identification label is false, the mobile phone B directly obtains the stored identification result a, and displays a control 1904 (for example, a control for "clicking to display the identification result") for displaying the identification result and the image IMG1 on the display interface 1901. As shown in fig. 17, the user clicks a detail button 1902 on the display interface 1901, and the cell phone B displays detailed information of the specified image in the display interface 1901 in response to the user's operation of clicking the detail button 1902. In this example, the detailed information includes attribute information 1903 including: the first label, the second label, the content label, the identification label, the appointed model and the like. In addition, the mobile phone B may also respond to the operation of clicking the control 1904 for displaying the identification result, and display the identification result a of the image IMG1 after Kms, optionally, K may be 10ms, that is, the time delay for the mobile phone B to display the image, in other embodiments, the time delay for the mobile phone B to display the image may also be other values, such as 20ms, 5ms, and the like, and the specific time delay is related to the system performance of the mobile phone B, which is not specifically limited in this embodiment.
In this example, when the mobile phone a and the mobile phone B transmit the image in the mobile phone a to the mobile phone B through the clone application, and when the mobile phone a determines that the designated model is larger than the model of the mobile phone B, it indicates that the identification result a obtained by the mobile phone a is more accurate, and the mobile phone a transmits the accurate identification result to the mobile phone B. After the mobile phone B detects the information indicating that OCR character recognition operation is not needed, OCR character recognition on the received specified image is not needed, and the power consumption of the mobile phone B is reduced. In addition, the designated model is higher than that of the mobile phone B, so that the accuracy of the displayed identification result is ensured, and the user experience is improved.
A scenario in which the specified model is less than or equal to the model of the handset B is described below with reference to fig. 18 to 20.
In one example, the image is designated as image IMG2, and the model number of the source identification device of the image IMG2 is: "Honor chang play 6X", the model of mobile phone A is "Honor30", and the model of mobile phone B is "Honor 30". If the mobile phone a detects that the model of the mobile phone a is different from the model of the source recognition device, the mobile phone a determines whether the designated image has an OCR recognition result, in this example, the mobile phone of "Honor chang play 6X" does not have an OCR character recognition function, so the mobile phone a does not query the recognition result of the image IMG2, and then the mobile phone a selects the model of the mobile phone a as the designated model, that is, the designated model is: "Honor 30".
It should be noted that the models of the mobile phones listed in this example are merely illustrative examples, and in other examples, the model of Honor playing 6X may be represented by "BLN-AL20", which is not listed in this example.
Fig. 18 is a schematic diagram illustrating an exemplary handset a added with an identification tag. In the present example, as shown in fig. 18, the specified model number of the specified image (i.e., the image IMG 2) shown in the attribute information of the image 2001 is: "Honor 30". The mobile phone a compares the specified model (i.e., the Honor 30) with the model of the mobile phone B (i.e., the Honor 30), and obtains a comparison result. If the mobile phone a detects that the comparison result indicates that the model of the mobile phone a is equal to the model of the mobile phone B, the value of the identification tag 2002 set by the mobile phone a is true (i.e., true). The mobile phone a adds the identification tag 2002 to the attribute information 2003 of the designated image 2001. The attribute information after the identification tag is added is shown as reference numeral 2004 in fig. 18.
Note that the model of the current device and the model of the source identification device are not shown in the attribute information 2004 shown in fig. 18.
In another example, the identification tag may also be written to a stored file of the specified image. If the image format is JPG, for example, the identification tag is written from the position of the FFD 9.
Fig. 19 is a diagram illustrating an exemplary transmission data. As shown in fig. 19, the cellular phone a can set a designated image 2102 and attribute information 2101 of the designated image 2102 as one transmission data. After determining the transmission data, the mobile phone a transmits the transmission data to the mobile phone B through the WLAN hotspot connection. The mobile phone B receives the transmission data sent by the mobile phone a, and can acquire the specified image (i.e., the image IMG 2) and the attribute information of the specified image from the transmission data. The mobile phone B may store the attribute information of the designated image in the database of the mobile phone B, and bind the designated image and the attribute information of the designated image.
Fig. 20 is a diagram schematically illustrating a specific image received by the cell phone B. As shown in fig. 20, the received specified image (i.e., image IMG 2) is displayed in the interface 2201 of the mobile phone B, the user clicks the detail button 2203 of the image IMG2, and the mobile phone B displays the detailed information of the image IMG2 in the mobile phone interface 1901 in response to the operation of clicking the detail button 2203 by the user. In this example, the detailed information includes attribute information 2202 including: the first label, the second label, the content label, the identification label, the appointed model and the like.
In addition, the mobile phone B reads the identification tag of the image IMG2 in response to the user's operation to view the specified image. And if the mobile phone B detects that the value of the identification tag is true, the mobile phone B performs OCR character recognition on the image IMG 2.
In this example, when the mobile phone a determines that the designated model is smaller than or equal to the model of the mobile phone B, it indicates that the identification result obtained by the mobile phone B is more accurate, and the mobile phone a transmits the attribute information of the image to the mobile phone B. After the mobile phone B detects the information indicating performing the OCR character recognition operation, the mobile phone B performs the designated OCR character recognition on the designated image according to the attribute information of the designated image, so that the output recognition result is more accurate.
Fig. 21 is a schematic diagram of an exemplary application scenario in which the mobile phone B performs OCR character recognition on an image.
The cell phone B responds to the operation of the user for viewing the gallery (such as clicking on an icon of an album), and displays a gallery interface 2301 shown as 21a in FIG. 21 in the display screen. Thumbnails of 6 images are displayed in the gallery interface 2301. The thumbnail view 2302 in 21a is a thumbnail of the image IMG 2. The user can check the image corresponding to the thumbnail in a mode of clicking the thumbnail. In this example, when acquiring the operation of clicking the thumbnail 2302, the mobile phone B may trigger the mobile phone B to read attribute information of an image (i.e., the image IMG 2) corresponding to the thumbnail 2302. Alternatively, only part of the attribute information is shown in 21a in fig. 21, for example, the acquired attribute information may include: the first label, the second label, the content label and the time information of acquiring the image, such as: screenshop _20210928_2010_, memorandum _, text1.
Schematic diagram of attribute information of the image IMG 2. As shown in fig. 22, the attribute information includes: a first tab 2401, image acquisition time information 2402, a second tab 2403, and a content tab 2404. As shown in fig. 22, the first label is "Screenshot" for indicating that the image is from the Screenshot mode. Reference numeral 2402 is used to indicate that the acquisition time of the image IMG2 is 20, 10 points on 9, 28 and 2021. The second tab 2403 is used to indicate information of an application to which the image IMG2 belongs, and for example, the mobile phone B may determine that the name of the application to which the image IMG2 belongs is "memo" according to "Memorandum". The content tag is used to indicate the category of the content of the image IMG2, for example, the cell phone B determines that the content of the image IMG2 belongs to a document class according to "Text1".
With continued reference to fig. 21, the mobile phone B obtains the first tag in the attribute information, where the first tag is "Screenshot". The mobile phone B may determine that the image belongs to the screenshot according to the first label. The mobile phone B acquires the second tag from the attribute information, and determines that the application to which the image belongs is a memo according to the second tag "Memorandum". And the mobile phone B determines that the memo application belongs to the portable life application according to the application name of the memo. The mobile phone B determines that the portable life application belongs to the first probability application, that is, the application to which the image corresponding to the thumbnail 2302 belongs to the first probability application, according to the pre-stored information of the application category (i.e., the application category classification information shown in fig. 6). And if the mobile phone B determines that the application to which the image IMG2 belongs to the first probability application, determining that the first indication information indicates OCR character recognition.
The mobile phone B detects that the content label of the image IMG2 is not empty. The mobile phone B acquires the content tag from the attribute information, and determines that the content of the image IMG2 belongs to a document class according to the content "Text1" of the content tag. The mobile phone B determines that the label of the document category belongs to the first probability label, that is, determines that the content label of the image IMG2 belongs to the first probability label, based on the information of the label category (i.e., the information of the label category shown in fig. 8) stored in advance. And if the mobile phone B determines that the content label of the image IMG2 belongs to the first probability label, determining that the second indication information indicates OCR character recognition.
If the mobile phone B determines that the first indication information and the second indication information both indicate OCR character recognition, the mobile phone B performs an OCR character recognition step to perform OCR character recognition on the image IMG2 (i.e., the image corresponding to the thumbnail 2302). And the mobile phone B acquires the recognition result of the OCR character recognition and stores the recognition result. The mobile phone B may store the identification result in a data structure, for example, the mobile phone B stores the identification information of the image IMG2 as a Key (Key) and stores the identification result as a value (value) corresponding to the Key. The recognition result may be stored in the attribute information of the image IMG 2. This example is not intended to be limiting.
It should be noted that, in this example, the duration of performing OCR character recognition on the image 2302 by the mobile phone B is 630ms. In other embodiments, the time delay for performing OCR character recognition on an image is related to the number of characters in the image, and the longer the number of characters, the longer the OCR character recognition duration.
Fig. 21b is a scene diagram of an exemplary image presentation. The user clicks on the thumbnail 2302 and after 630ms, cell phone B displays the interface 2303 as shown in 21B. Included in the interface 2303 are the image corresponding to the thumbnail 2302 (i.e., image IMG 2), and a control 2304 (i.e., a control showing "click to display recognition results"), the control 2304 being for instructing a user to view recognition results of OCR text recognition of the current image. Illustratively, the cell phone B switches the interface 2303 to the interface 2305 after 10ms in response to the user's operation of clicking the control 2304. The interface 2305 includes the mask 2306, showing the image 2307 over the mask 2306 and the recognition result 2308 of the image 2307. Reference numeral 2309 is used to indicate a control to copy text. After the control 2309 is clicked, the mobile phone B provides the user with an operation of copying the text through the touch screen, so that the user can copy the text. It should be noted that the time delay experienced by switching from 21b to 21c is an exemplary example, in other embodiments, the time delay experienced by switching from 21b to 21c may also be other values, such as 20ms, 5ms, and the like, and the specific time delay is related to the system performance of the mobile phone, which is not specifically limited in this embodiment.
It should be noted that the mask 2306 is only an exemplary example, and in other embodiments, the mask and the image 2307 may not be provided, for example, the recognition result 2308 of the image is directly displayed on the interface 2305.
In this example, the user may be prompted to click in other forms, for example, the currently displayed image may be indicated by a color to have a corresponding character recognition result. For example, when the control is yellow, the control indicates that the image has a corresponding character recognition result, and may also prompt the mobile phone to store the recognition result of the image displayed on the display interface through a voice.
Fig. 23 is a schematic diagram of an application scenario of character recognition of an image.
The cell phone B responds to the operation of the user for viewing the gallery (such as clicking on an icon of an album), and displays a gallery interface 2501 shown as 23a in FIG. 23 in the display screen. Thumbnails of 6 images are displayed in the gallery interface 2501. The user can check the image corresponding to the thumbnail by clicking the thumbnail. In this example, when the mobile phone B acquires an operation of clicking the thumbnail image 2502, the mobile phone B may be triggered to read attribute information 2503 of an image corresponding to the thumbnail image 2502 (for example, identification information of the image is IMG3, and hereinafter, "image IMG3" is used to indicate an image whose identification information is IMG 3). Alternatively, only part of the attribute information is shown in 23a in fig. 23, for example, the acquired attribute information may include: the first label, the second label, the content label and the time information of acquiring the image, such as: screenenshot _20210928_2010_memorandum. The mobile phone B acquires a first tag in the attribute information, where the first tag is "screenset". The mobile phone B may determine that the image belongs to the screenshot according to the first label. The mobile phone B acquires the second tag from the attribute information, and determines that the application to which the image belongs is a memo according to the second tag "Memorandum". And the mobile phone B determines that the memorandum application belongs to the portable living application according to the application name of the memorandum. The mobile phone B determines that the portable life application belongs to the first probability application, that is, the application to which the thumbnail image 2502 corresponds belongs to the first probability application, based on the pre-stored information on the application category (i.e., the application category classification information shown in fig. 6). And if the mobile phone B determines that the application of the image IMG3 belongs to the first probability application, determining that the first indication information indicates OCR character recognition.
The mobile phone B detects that the content label of the image IMG3 is empty. The mobile phone B determines that the second indication information indicates to end the process.
If the mobile phone B determines that the first indication information indicates performing OCR character recognition and determines that the second indication information indicates ending the process, the mobile phone B still performs an OCR character recognition step, and performs OCR character recognition on the image IMG3 (i.e., the image corresponding to the thumbnail 2502). And the mobile phone B acquires the recognition result of the OCR character recognition and stores the recognition result. Handset B may store the recognition result in a data structure. For example, the time period for mobile phone B to recognize the image IMG3 may be 630ms, and after 630ms, mobile phone B displays an interface 2504 as shown in 23B, where the interface 2504 includes the image IMG3, and a control 2505 (i.e., a control displaying "click to display recognition result") for instructing the user to view the recognition result of OCR character recognition of the current image. Similar to 21c in fig. 21, after 10ms elapses, the cell phone B switches the interface 2504 to display the recognition result shown in fig. 21c in response to the operation of clicking the control 2505 by the user, and details of the interface for displaying the recognition result are not repeated in this example.
In the example, the first indication information indicates that OCR character recognition is performed on the image, the second indication information indicates that the process is ended when the content tag in the attribute information is empty, and when the mobile phone determines that the first indication information is different from the second indication information, the mobile phone performs an operation of performing OCR character recognition on the image, so that the problem that the mobile phone misses recognition on the image is avoided, the accuracy of autonomously triggering OCR character recognition is improved, and the use experience of a user is further improved.
Fig. 24 is a schematic diagram illustrating an application scenario of character recognition of an image.
24a in FIG. 24 shows the gallery host interface 2601 of cell phone B, with thumbnails of the images presented in the gallery host interface 2601. In this example, as shown in 24a, in response to the user clicking the thumbnail 2602, the mobile phone B reads attribute information 2603 of an image corresponding to the thumbnail 2602 (for example, identification information of the image is IMG4, hereinafter, "image IMG4" is used to indicate an image whose identification information is IMG 4), that is, "DCIM _20210928_2010_ watermark _ Vehicle _1". The mobile phone B obtains the photographing mode tag from the attribute information, obtains the value "watermark" of the photographing mode tag, and determines that the photographing mode of the image IMG4 is the watermark mode. If the handset B determines that the watermark pattern belongs to the first probability pattern according to the pre-stored information of the pattern class (i.e., the classification information of the pattern class as shown in fig. 7), the handset B determines that the first indication information indicates performing OCR character recognition.
The cell phone B detects that the content tag of the image IMG4 is not empty. The mobile phone B acquires the content tag from the attribute information, and determines that the content of the image IMG4 belongs to the class of transportation means according to the content "Vehicle _1" of the content tag. The mobile phone B determines that the tags of the vehicle class belong to the second probabilistic tag according to the pre-stored information of the tag class (i.e., the information of the tag class shown in fig. 8). In one scenario, the mobile phone B recognizes that the content tag of the image IMG4 belongs to the second probability tag, and detects whether the mobile phone B is currently in a screen-off and charging state. If the mobile phone B does not detect that the mobile phone is in the screen-off and charging state, the mobile phone B determines that the second indication information indicates to end the process, that is, does not perform OCR character recognition on the image IMG 4.
If the mobile phone B determines that the first indication information indicates performing OCR character recognition and determines that the second indication information indicates ending the process, the mobile phone B still performs an OCR character recognition step, and performs OCR character recognition on the image IMG4 (i.e., the image corresponding to the thumbnail 2602). And the mobile phone B acquires the recognition result of the OCR character recognition and stores the recognition result. Handset B may store the recognition result in a data structure.
For example, the time period for cell phone B to recognize the image IMG4 may be 630ms, and cell phone B may display the interface 2604 as shown in fig. 24B after the elapse of 630ms. Included in interface 2604 is image IMG4, and a control 2605 (i.e., a control showing "click to display recognition result"), the control 2605 being used to instruct the user to view the recognition result of OCR character recognition of the current image. Similar to 21c in fig. 21, after 10ms elapses in response to the operation of clicking the control 2605 by the user, the mobile phone B displays the recognition result shown in fig. 21c on the display interface, which is not described again in this example.
In this example, the value of the content tag in the attribute information is not null, and the mobile phone determines that the second indication information indicates to end the process according to the value of the content tag. When the mobile phone determines that the first indication information is different from the second indication information, the mobile phone executes an operation of performing OCR character recognition on the image, so that the problem of missing recognition of the image by the mobile phone is avoided, the accuracy of autonomously triggering OCR character recognition is improved, and further the use experience of a user is improved.
Fig. 25 is a schematic diagram of an application scenario of character recognition of an image.
Fig. 25a shows the gallery main interface 2701 of the mobile phone B, and thumbnails of the images are shown in the gallery main interface 2701. In this example, as shown in fig. 25a, in response to the user clicking on the thumbnail 2702, the mobile phone B reads attribute information 2703 of an image corresponding to the thumbnail 2702 (for example, identification information of the image is IMG5, hereinafter, "image IMG5" is used to indicate an image whose identification information is IMG 5), that is, "screen _20210928 xu 2010_ car rental _ Vehicle _1".
The mobile phone B acquires a first label 'Screen shot' from the attribute information, and determines that the image IMG5 belongs to the Screenshot. After the mobile phone B determines that the image IMG5 belongs to the screenshot, the mobile phone B acquires a second label (namely 'car rental') from the attribute information, and determines that the 'car rental' application belongs to a second probability application according to the 'car rental' label of the second label. In one scenario, cell phone B determines that the application to which image IMG5 belongs to a second probabilistic application, and cell phone B detects whether it is currently in a screen-off and charging state. If the mobile phone B does not detect that the mobile phone B is in the screen-off and charging state, the mobile phone B determines that the first indication information indicates that the process is ended.
The mobile phone B detects that the content label of the image IMG5 is not empty. The mobile phone B acquires the content tag from the attribute information, and determines that the content tag of the image IMG5 belongs to the second probability tag according to the content "feature _1" of the content tag. The mobile phone B detects whether the mobile phone B is in a screen-off and charging state at present. If the mobile phone B does not detect that the mobile phone B is in the screen-off and charging state, the mobile phone B determines that the second indication information indicates that the process is ended.
Note that the battery indicator 2704 of the mobile phone B indicates that the mobile phone is in a low power state.
In an example, when the user finds that the battery level of the mobile phone B is low (as shown in 2704), the user performs the screen-off operation on the mobile phone B (or the mobile phone B detects that the battery level is low and turns off the mobile phone B by itself, that is, the mobile phone B performs the screen-off operation), and the user performs the charging operation on the mobile phone B. As shown in fig. 25B, the display 2705 is turned off, and a charging line 2706 charges the mobile phone B. When the mobile phone B detects that the mobile phone B is in the screen-off and charging state, the mobile phone B determines that the first indication information of the image IMG5 indicates OCR character recognition on the image IMG5, and determines that the second indication information indicates OCR character recognition on the image IMG5. The mobile phone B performs OCR character recognition on the image IMG5 according to the first indication information and the second indication information (i.e. a step of performing text detection and text recognition on the image IMG 5), obtains a recognition result of performing OCR character recognition on the image IMG5, and stores the recognition result of the image IMG5.
After 1 hour of charging, the user stops charging the mobile phone B, and 26a in fig. 26 shows a schematic diagram of the mobile phone in a full state after 1 hour of charging. As shown in fig. 26a, the gallery host interface 2801 shows thumbnails of the respective images, and the battery identification 2803 in the gallery host interface 2801 displays the full charge. In response to the operation of clicking the thumbnail 2802 by the user, the cell phone B queries that the image corresponding to the thumbnail 2802 is the image IMG5. And the mobile phone B queries the recognition result of the OCR character recognition of the image IMG5 according to the identification information of the image IMG5. As shown in fig. 26B, cell phone B switches from gallery master interface 2801 to interface 2804 over 10 ms. A control 2805 for instructing to view the recognition result is displayed on the interface 2804. As shown in fig. 26b, information for prompting the user to click to view the recognition result may be displayed on the control 2805, such as the text "click to display the recognition result" displayed on the control 2805. It is to be appreciated that control 2805 is not limited to the styles listed in this example, and in other embodiments, control 2805 may prompt the user by color to click to display the recognition results. Optionally, the mobile phone B may further display the recognition result of the image IMG5 by detecting a shortcut viewing operation, where the shortcut viewing operation may be set according to an actual application, for example, the mobile phone B may slide the screen left/right with three fingers, hit the screen three times in succession, and the like, which is not limited in this example.
In this example, when the mobile phone detects that the content tag of the image belongs to the second probability tag and the mobile phone detects that the image is not in the off-screen and charging state, it is determined that the second indication information does not indicate that the image is subjected to OCR character recognition. When the mobile phone detects that the photographing mode of the image belongs to the second probability mode and the mobile phone detects that the image is not in the screen-off and charging state, it is determined that the first indication information does not indicate the image to perform OCR character recognition. The first indication information and the second indication information both indicate that the process is ended, and the mobile phone does not perform OCR character recognition on the image, so that the power consumption of the mobile phone is saved. And when the mobile phone detects that the mobile phone is in a screen-off and charging state, the first indication information and the second indication information both indicate that OCR character recognition is carried out on the image, the mobile phone carries out OCR character recognition on the image, and a recognition result of the OCR character recognition of the image is stored. When the mobile phone detects the operation of checking the image by the user, the mobile phone can inquire whether the image has a recognition result before the attribute information of the image, if the recognition result exists, the mobile phone can directly display the image and prompt the user to check the recognition result of the image, and the OCR character recognition is carried out on the image without detecting the instruction of indicating the OCR character recognition by the user. When the mobile phone is in the screen-off and charging state, the user does not use the mobile phone, so that OCR character recognition is carried out in the state, the consumption of electric quantity when the mobile phone is in the non-charging state is avoided, and the cruising ability of the mobile phone can be improved.
Fig. 27 is a schematic diagram of an application scenario of character recognition of an image.
27a in FIG. 27 shows a schematic view of a user clicking on a thumbnail in a gallery. As shown in 27a, the gallery host interface 2901 shows thumbnails for each image. The mobile phone B reads the attribute information 2903 of the inquired image (for example, the identification information of the image is IMG6, and hereinafter, "image IMG6" is used to indicate the image of which the identification information is IMG 6) in response to the operation of clicking the thumbnail 2902 by the user. The mobile phone B acquires the first tag in the attribute information (i.e., "DCIM _20210928_2010_ portrait"), and the value of the first tag is "DCIM". Cell phone B can determine from the value of the first label that the image IMG6 belongs to a photo. The mobile phone B acquires the photographing mode tag from the attribute information, acquires the value "portrait" of the photographing mode tag, and determines that the photographing mode of the image IMG6 is the portrait mode. The handset B determines that the portrait mode belongs to the third probabilistic mode based on the information of the mode class stored in advance (i.e., the classification information of the mode class as shown in fig. 7). When the mobile phone B recognizes that the photographing mode of the image IMG6 belongs to the third probability mode, it may be determined that the first indication information indicates to end the process.
The mobile phone B detects that the content tag in the attribute information is not empty. The mobile phone B acquires the content tag as a portrait from the attribute information. And the mobile phone B determines that the portrait label belongs to the third probability label according to the content label and the pre-stored information of the label category. And if the mobile phone B determines that the content label of the image IMG6 is the third probability label, the mobile phone B determines that the second indication information indicates to end the process.
And if the mobile phone B determines that the first indication information and the second indication information both indicate that the process is ended, the mobile phone B does not perform OCR character recognition on the image IMG 6. Cell phone B may display an interface 2904 as shown at 27B on the display after a delay of 10 ms. The interface 2904 shows an image IMG6, shown at 27b, which does not involve text and belongs to a person image. Optionally, a control 2905 may also be displayed in the interface 2904 for instructing the user to perform OCR text recognition. As shown in 27b, a "click trigger OCR text recognition" control 2905 is displayed in interface 2904. The mobile phone B performs text detection on the image IMG6 in response to the user clicking the control 2905. The mobile phone B detects that no text exists in the image, and does not perform subsequent text recognition operation. Cell phone B can prompt in interface 2905 that no text is detected in the image.
In this example, since the third probability label indicates that the image does not relate to text, when the mobile phone determines that the content label of the image belongs to the third probability label, the mobile phone determines that the second indication information indicates to end the process. And the mobile phone detects that the image shooting mode is the portrait shooting mode, the portrait shooting mode belongs to the third probability mode, and the mobile phone determines that the first indication information indicates to end the process. Because the first indication information and the second indication information both indicate that the process is finished, the mobile phone does not perform OCR character recognition on the image, and the power consumption of the mobile phone is greatly reduced. According to the method and the device, whether OCR character recognition is immediately carried out on the image or not is determined according to the category of the content label of the image and the category of the image, or OCR character recognition is finished on the image, so that unnecessary power consumption consumed when the mobile phone looks over the image is greatly reduced.
Fig. 28 is a schematic diagram of an application scenario of character recognition of an image.
As shown at 28a in fig. 28, the gallery host interface 3001 shows a thumbnail of each image. The mobile phone B inquires an image corresponding to the thumbnail 3002 (for example, identification information of the image is IMG7, and hereinafter "image IMG7" is used to indicate an image whose identification information is IMG 7) in response to an operation of clicking the thumbnail 3002. The cell phone B acquires the attribute information 3003 of the image IMG7 (i.e., reads DCIM _20210928 xu 2010_ big aperture _ Vehicle _ 1). Cell phone B can determine from the value of the first label that the image IMG7 belongs to a photo. The mobile phone B determines that the photographing mode of the image IMG7 belongs to the second probability mode.
When the mobile phone B recognizes that the photographing mode of the image IMG5 belongs to the second probability mode, the mobile phone B detects whether the mobile phone B is currently in the off-screen and charging state. When the mobile phone B determines that the mobile phone B is not in the off-screen and charging state, the mobile phone B may perform text detection operation on the image IMG7. And when the mobile phone B detects that the text exists in the image IMG7, storing the text detection result of the image IMG7. Illustratively, the time delay of text detection of the image IMG7 by the mobile phone B is 230ms. After the text detection operation is completed, the mobile phone B may determine that the first indication information indicates to end the process, that is, the text recognition operation is not performed on the image IMG7.
The cell phone B detects that the content label of the image IMG7 is not empty. The mobile phone B determines that the content label of the image IMG7 belongs to the second probabilistic label. When the mobile phone B detects that the mobile phone B is not in the off-screen and charging state, the mobile phone B may perform text detection on the image IMG7. In this example, since the mobile phone B determines the first indication information and the second indication information in parallel, in order to reduce repeated processing on the image IMG7, the mobile phone B queries whether a text detection result exists in the image IMG7 before text detection is performed on the image IMG7, and if the mobile phone B determines that the text detection result exists, it directly determines that the second indication information indicates that the process is ended, that is, subsequent text recognition operation is not performed on the image IMG7. And if the mobile phone B determines that the text detection result does not exist, performing text detection operation on the image IMG7, and storing the text detection result of the image IMG7 when the mobile phone B detects that the text exists in the image IMG7. Illustratively, the time delay of text detection of the image IMG7 by the cell phone B is 230ms.
If the mobile phone B determines that the first indication information and the second indication information both indicate that the process is ended, the mobile phone B may switch the interface 3001 to the interface 3004 shown as 28B after 230 m. As shown in fig. 28b, a thumbnail image IMG7 is displayed on the interface 3004. And if the mobile phone B determines that the text detection result of the image IMG7 indicates that text exists, displaying a control 3005 on the interface 3004, where the control 3005 is used for indicating that text exists in the image IMG7 and for triggering an operation of text recognition. For example, in response to the operation of clicking the control 3005 by the user, the mobile phone B performs text recognition on the image IMG7 to obtain a recognition result of the text recognition on the image IMG7, and after the mobile phone performs text recognition for 400ms, the recognition result of the image IMG7 is displayed in the interface 3006, as shown in 28c, where reference numeral 3007 is a mask, reference numeral 3008 is the image IMG7, reference numeral 3009 is the recognition result of the image IMG7, and the control 3010 is configured to provide a function of copying characters for the user. In this example, the total time delay for performing OCR character recognition on the image IMG7 is 630ms, wherein the time delay for performing text detection on the image IMG7 by the mobile phone is 230ms, and the time delay for performing text recognition on the image IMG7 is 400ms. It should be noted that, in this example, the time delay for performing character detection and character recognition on the image IMG7 is only an example, where the time delay for text recognition is 400ms in this example, in other embodiments, the number of characters in the image is different, and the time delay for corresponding text recognition is also different, for example, the time delay for recognizing 100 characters is 500ms.
In this example, the content tag of the image belongs to the second probability tag, and it is determined that the photographing mode of the image belongs to the second probability mode. When the mobile phone detects that the mobile phone is not in the screen-off and charging state, and the mobile phone determines that the first indication information and the second indication information both indicate that the flow is finished, the mobile phone can perform text detection on the image in advance. When the mobile phone detects that the user indicates the operation of text recognition on the image, the text recognition is carried out on the image, so that the power consumption of the mobile phone is reduced. In addition, after the mobile phone responds to the text recognition operation of the user, the mobile phone only needs to perform the step of text recognition on the image instead of performing the two steps of text detection and text recognition on the image, so that the speed of displaying the recognition result is increased, and the use experience of the user is improved.
FIG. 29a is a schematic diagram illustrating an exemplary scenario for OCR character recognition of an image. In the scene of this example, the user clicks and views the image 3102, the mobile phone acquires the attribute information of the image 3102, and acquires the content tag, the first tag, the second tag, and the photographing mode tag of the image 3102 from the attribute information of the image 3102. The mobile phone B determines that the image 3102 belongs to the photo according to the first tag, determines that the photographing mode of the image 3102 belongs to the second probability mode according to the photographing mode tag, and then determines that the first detection result indicates that the image belongs to the second probability type. The mobile phone B determines that the content tag of the image 3102 belongs to the second probability tag according to the tag category; the mobile phone B determines that the second detection result indicates that the image belongs to the second probability type. From the first detection result and the second detection result, it is determined that the image 3102 belongs to the second probability type. The mobile phone B detects whether the mobile phone B is in a charging and screen-off state. When the mobile phone detects that the mobile phone is not in the charging and screen-off state, the operation of performing character recognition on the image 3102 is finished. After the time length of 10ms, the mobile phone may display a display interface 3101 as shown in fig. 29a, where the image 3102 is displayed on the display interface 3101, and a control 3103 is displayed on the image 3102. The control 3103 is used to trigger an operation of OCR character recognition on the image 3102. For example, when the user clicks the image 3102, the mobile phone is triggered to perform OCR character recognition, i.e., text detection and text recognition (also referred to as character recognition) on the image 3102. The mobile phone B can be switched to a new interface to display the OCR character recognition result. The mobile phone B may also mark the recognized text with a highlight color on the image 3102.
Fig. 29b is a schematic view of an exemplary scene for performing character recognition on an image. In the scene in this example, the user clicks and views the image 3105, the cellular phone acquires the attribute information of the image 3105, acquires the content tag of the image 3105 from the attribute information of the image 3105, and reads the content tag, the first tag, the second tag, and the photographing mode tag of the image 3105. The mobile phone B determines that the image 3105 belongs to a photo according to the first tag, and determines that the photographing mode of the image 3102 (for example, the photographing mode is "portrait") belongs to the third probability mode according to the photographing mode tag, and then the mobile phone B determines that the first detection result indicates that the image belongs to the third probability type. The mobile phone B determines that the content tag (for example, the content tag is "electric appliance type") of the image 3105 belongs to the second probability tag according to the tag type; and the mobile phone B determines that the second detection result indicates that the image belongs to the second probability type. From the first detection result and the second detection result, it is determined that the image 3105 belongs to the second probability type.
Cell phone B determines that image 3105 belongs to the second probability type, then cell phone B detects whether it is in a charged and de-screened state. When the mobile phone detects that the mobile phone is not in the charging and screen-off state, the text detection operation is performed on the image 3105 to obtain a text detection result. When the cell phone detects that there is a text detection result in the image 3105, a control 3106 may be displayed on the image 3105. For example, after the 230ms duration has elapsed, the mobile phone B may display a display interface 3104 as shown in fig. 29B, where the image 3105 is displayed on the display interface 3104, and a control 3106 is displayed on the image 3105. The control 3106 is used to trigger an operation of text recognition on the image 3105. Control 3106 may be set in gray, represented in this example by horizontal line fill. In other examples, the color of control 3106 may also be set to other colors, such as white, etc. When the mobile phone detects that the user clicks the control 3106, the mobile phone is triggered to perform text recognition on the image 3106, and the mobile phone B may switch to a new interface to display the OCR character recognition result. The mobile phone may also mark the recognized text with a highlight color on the image 3105.
Fig. 29c is a schematic view illustrating an exemplary scene for performing character recognition on an image. In the scene in this example, the user clicks and views the image 3108, the mobile phone acquires the attribute information of the image 3108, and acquires the content tag, the first tag, the second tag, and the photographing mode tag of the image 3108 from the attribute information of the image 3108. The mobile phone B determines that the image 3108 belongs to a photo according to the first tag, and determines that the photographing mode of the image 3108 (if the photographing mode is "normal photographing") belongs to the second probability mode according to the photographing mode tag, then the mobile phone B determines that the first detection result indicates that the image belongs to the second probability type. The mobile phone B determines that the content tag (for example, the content tag is "document type") of the image 3108 belongs to the first probability tag according to the tag type; the mobile phone B determines that the second detection result indicates that the image belongs to the first probability type. From the first detection result and the second detection result, it is determined that the image 3108 belongs to the first probability type. If the mobile phone B determines that the image 3108 belongs to the first probability, performing OCR character recognition on the image 3108 to obtain an OCR character recognition result. When the cell phone detects that there is OCR character recognition result in the image 3108, a control 3111 may be displayed on the image 3108. For example, after the time length of 630ms has elapsed, the mobile phone B may switch to the display interface 3107 shown in fig. 29c, and the image 3108 is displayed on the display interface 3107, and the control 3111 is displayed on the image 3108. The fill color of control 3111 is different from the fill color of control 3105, which can be, for example, bluetooth to fill control 3111.
In one example, cell phone B highlights the recognized text on this image 3102 in a highlighted color, such as 3109, 3110, etc. in fig. 29 c. In this example, the highlights are represented by dashed boxes. The control 3111 may also be an icon for indicating that OCR character recognition results are present for the image 3108.
In another example, the cell phone marks the recognized text in a highlighted color on the image 3108 in response to the user clicking on control 3111. In this example, the highlights are represented by dashed boxes.
In this example, possible diagrams of the image after the operation of character recognition of the image as in the present application are not listed.
In addition, the software system of the electronic device 100 for performing the operation of character recognition of the image in the example of the present application may adopt a hierarchical architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes an Android system with a hierarchical architecture as an example, and exemplarily illustrates a software structure of the electronic device 100.
Fig. 30 is a block diagram of a software configuration of the electronic device 100 according to the embodiment of the present application.
The layered architecture of the electronic device 100 divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into five layers, which are an application layer, an application framework layer, a system layer, a hardware abstraction layer, and a kernel layer from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 30, the application package may include applications such as camera, gallery, clone-on-switch, glory sharing, camera, OCR engine and smart screen capture.
In the embodiment of the application, the gallery displays the image and triggers an OCR engine to perform OCR character recognition operation on the image.
The OCR engine may perform OCR character recognition operations on the image, the OCR character recognition including both text detection and text recognition steps.
As shown in fig. 30, the application framework layer may include an activity manager, a window provider, a content manager, a notification manager, a battery manager, and the like. The notification manager in this example may send a message to the handset to go off screen and charge.
In the embodiment of the application, the battery manager can detect the state of the battery and detect whether the mobile phone is in a screen-off state. Meanwhile, when detecting that the electronic device is in a charging and screen-off state, the battery manager may send a screen-off and charging message to the database. As shown in fig. 30, the system layer may include a plurality of functional modules. For example: surface management layer (surface manager), media Libraries (Media Libraries), SQLite, two-dimensional image processing library, android runtime, and the like.
As shown in fig. 30, the hardware abstraction layer may include a plurality of modules. For example: the system comprises a graphic module, a Bluetooth module, a camera module, a Wi-Fi module, a hardware synthesizer and the like. The graphics module is used to generate images.
The kernel layer is a layer between hardware and software. The kernel layer at least comprises a display driver, a camera driver, an audio driver, a sensor driver and the like.
Fig. 31 is a schematic diagram illustrating interaction between internal modules of a mobile phone a (image sending-end device). Of these, fig. 31 shows only an internal block diagram of the cellular phone a.
Step 3301: the user performs an operation of opening the image a.
In this example, the mobile phone a displays a gallery main interface, and thumbnails of the images are displayed in the gallery main interface. The user performs an operation of opening the image a. The operation of opening an image may be clicking a thumbnail of the image.
Step 3302: the gallery of the mobile phone receives the operation of opening the image A by the user.
The gallery of the mobile phone receives the operation of opening the image A, and can trigger the gallery to execute the step 3303.
Step 3303: the gallery initiates a request to the multimedia database for image a.
The multimedia database may be a SQLite database.
Step 3304: the multimedia database returns image a to the library.
After the multimedia database of the mobile phone A inquires the image A, the image A can be directly returned to the gallery.
Step 3305: the gallery of the mobile phone A displays the image A.
Step 3306: the user initiates the operation of changing the clone.
The switch machine clone in this example is a switch machine clone application. The user can start the switch machine clone application of the mobile phone A by clicking the icon of the switch machine clone application.
Step 3307: the gallery of the mobile phone a initiates a request for obtaining the model and system version information of the mobile phone B to the mobile phone clone.
After the switch clone application is started, the gallery of the mobile phone a may send a request to the switch clone to obtain the model of the mobile phone B, or obtain the model and system version information of the mobile phone B.
In this example, the model and system version information of the mobile phone B are obtained as an example.
Step 3308: the mobile phone clone of the mobile phone A initiates a request for acquiring the model and system version information of the mobile phone B to the mobile phone B.
And the switch clone of the mobile phone B receives the request of the mobile phone A and inquires the model and the system version information of the mobile phone B. And the switch clone of the mobile phone B returns the model and the system version information of the mobile phone B to the switch clone of the mobile phone A.
Step 3309: and the switch clone of the mobile phone A receives the model and system version information of the mobile phone B returned by the switch clone of the mobile phone B.
A step 3310: and the change machine clone of the mobile phone A returns the model and system version information of the mobile phone B to the image library.
Step 3311: the gallery of the mobile phone A sends a request for inquiring the attribute information of the image A to the multimedia database of the mobile phone A.
In this example, the attribute information of the designated image may include: the mobile terminal comprises a first tag, a second tag, a photographing mode tag and a content tag. The attribute information of the designated image may further include: the model of the mobile phone A and the system version information of the mobile phone A. Optionally, other information, for example, a detection tag of the designated image, may be included in the attribute information of the designated image. The detection tag of the image a may be "screentypejude" which indicates whether or not there is a detection result of the image a. If the value of the detection tag is a true value (if the true value is true or 1), it indicates that the image a has a detection result, that is, indicates that the mobile phone has detected the probability type to which the image a belongs. If the value of the detection tag is a false value (e.g. true value is false or 0), it indicates that there is no detection result in the image a, i.e. it indicates that the mobile phone does not detect the probability type of the image a.
And the multimedia database receives the query request sent by the gallery and returns the attribute information of the image A to the gallery.
In this example, the attribute information of the image a may include: the image identification device comprises a first label, a second label, a photographing mode label, a content label, the model of the mobile phone A, the system version information of the model of the mobile phone A of the source identification device of the image A, a detection label of the mobile phone A and the like. Alternatively, the source identification device of image a may refer to a source device that acquires image a.
This step 3311 may also be performed prior to step 3307 in one example.
A step 3312: and the multimedia database of the mobile phone A returns the attribute information of the image A to the database.
Step 3313: the gallery of the mobile phone A selects one model from the model of the source identification device of the image A and the model of the mobile phone A as an appointed model.
The process of determining the specified model in this example may be the process in step 204, and is not described here again.
Step 3314: and if the gallery of the mobile phone A detects that the specified model is smaller than or equal to the model of the mobile phone B and detects that the probability type of the image A is the first probability type or the second probability type, setting the identification label as a true value.
Illustratively, the process of detecting that the specified model is less than or equal to the model of the mobile phone B by the gallery of the mobile phone a is similar to the process of the step 2066, and the mobile phone a may add an identification tag in the attribute information, where the identification tag may be information indicating whether the mobile phone B performs an OCR character recognition operation. When the value of the identification tag is a false value (false), the identification tag is used to instruct the mobile phone B to end the operation of performing OCR character recognition on the specified image.
Illustratively, the process of the gallery of handset a detecting that the specified model is less than or equal to the model of handset B is similar to the process of step 2066. And will not be described in detail herein. When the gallery of the mobile phone A detects that the specified model is smaller than or equal to the model of the mobile phone B, the probability type of the image A can be continuously detected. The probability type of the gallery detection image a of the mobile phone a is similar to the steps 2113 'to 2118', and the description thereof is omitted here.
And when the gallery of the mobile phone A detects that the specified model is smaller than or equal to the model of the mobile phone B and detects that the probability type of the mobile phone image A is the first probability type or the second probability type, setting the true value of the identification label.
And when the gallery of the mobile phone A detects that the specified model is smaller than or equal to the model of the mobile phone B and detects that the probability type of the mobile phone image A is the first probability type or the second probability type, setting the true value of the identification label. Alternatively, the detection result of the image a indicating the probability type to which the image a belongs may be added to the attribute information of the image a in a stored manner.
In another example, when the gallery of the mobile phone a detects that the specified model is smaller than or equal to the model of the mobile phone B and detects that the probability type to which the mobile phone image a belongs is the third probability type, a detection result indicating the type to which the image a belongs may be stored in the attribute information of the image a. The value of the identification tag may be set to a false value.
It should be noted that the gallery of the mobile phone a determines the transmission data according to the comparison result between the model of the mobile phone B and the designated model. For example, the comparison result indicates that the specified model is smaller than or equal to the model of the mobile phone B, and the probability type to which the mobile phone image a belongs is detected to be the first probability type or the second probability type, and information such as the image a, the detection result of the image a, the identification tag, and the like may be included in the transmission data.
Step 3315: the gallery of the mobile phone a sends the transmission data to the switch machine clone.
Illustratively, the transmission data may include image a and attribute information of image a. Optionally, the attribute information of the image a may include: the mobile phone identification system comprises a first tag, a second tag, a photographing mode tag, a content tag, the type of the mobile phone A, the system version information of the type of the source identification equipment of the image A, a detection tag, an identification tag, a detection result and the like of the mobile phone A.
A step 3316: the switch clone of the mobile phone A sends the transmission data to the switch clone of the mobile phone B.
The mobile phone A receives the transmission data, and the mobile phone B changes the mobile phone A to finish cloning the image A.
Fig. 32 is a schematic diagram illustrating interaction between internal modules of a mobile phone B (receiving end device of image a) according to an example. Fig. 32 shows only the internal block diagram of the mobile phone B. Handset B in fig. 32 serves as the receiving end device of handset a in fig. 31.
Step 3401: the mobile phone clone of the mobile phone B receives a request for acquiring the model and system version information of the mobile phone B, which is sent by the mobile phone A.
And after receiving the request for acquiring the model and the system version information of the mobile phone B, the mobile phone clone of the mobile phone B inquires the model and the system version information of the mobile phone B.
Step 3402: and the change clone of the mobile phone B sends the model and system version information of the mobile phone B to the mobile phone A.
Step 3403: the mobile phone A sends the transmission data to the mobile phone B.
In this example, the received transmission data may include: image a and attribute information of image a. Optionally, the attribute information of the image a may include: the mobile phone identification system comprises a first tag, a second tag, a photographing mode tag, a content tag, the type of the mobile phone A, the system version information of the type of the mobile phone A of the source identification equipment of the image A, a detection tag and an identification tag of the mobile phone A.
Step 3404: and the change clone of the mobile phone B sends transmission data to the gallery of the mobile phone B.
Step 3405: and the gallery of the mobile phone B acquires the image A and the attribute information of the image A from the transmission data.
Step 3406: and the gallery of the mobile phone B sends the image A and the attribute information of the image A to the multimedia database.
Step 3407: and binding the image A and the attribute information of the image A by the multimedia database of the mobile phone B, and storing.
Step 3408: and the gallery of the mobile phone B detects a preset trigger condition to acquire the identification label of the image A.
For example, the preset trigger condition may be: the mobile phone B receives the operation of the user for checking any image in the gallery. It should be noted that the trigger conditions in this example are only exemplary examples, and in other examples, the preset trigger conditions may also be: the mobile phone B detects that the mobile phone B is in a screen-off and charging state; or, the mobile phone B receives an operation of the user to view the gallery. This is not to be enumerated in this application.
Step 3409: and (4) detecting that the identification label is a true value by the gallery of the mobile phone B, and performing OCR character identification on the image A.
Illustratively, identifying the tag as a true value may perform steps 2113 to 2120 of fig. 4 a; or the gallery executes steps 2113 'through 2125' as in FIG. 4 b.
In another example, the attribute information of the image a stores the detection result of the image a, and the gallery may directly obtain the probability category to which the image a belongs. After the gallery of the mobile phone B obtains the probability type to which the image a belongs, steps 2119 'to 2125' may be executed. For example, when the gallery of the mobile phone B determines that the image a belongs to the third probability type, the flow ends.
Fig. 33 is a schematic diagram illustrating interaction between internal modules of another mobile phone a (image transmitting terminal apparatus). Of these, fig. 33 shows only an internal block diagram of the mobile phone a.
Step 3501: the user performs an operation of opening image B.
Step 3502: the gallery of the mobile phone receives the operation of opening the image A by the user.
Step 3503: the gallery initiates a request to the multimedia database for image B.
Step 3504: when the multimedia database returns image B to the database.
Step 3505: the gallery of the mobile phone a displays an image B.
Step 3506: the user initiates the operation of changing the clone.
The switch machine clone in this example is a switch machine clone application. The user can start the switch machine clone application of the mobile phone A by clicking the icon of the switch machine clone application.
Step 3507: the gallery of the mobile phone A initiates a request for obtaining the model number and system version information of the mobile phone B to the switch clone.
After the switch clone application is started, the gallery of the mobile phone a may send a request to the switch clone to obtain the model of the mobile phone B, or obtain the model and system version information of the mobile phone B.
In this example, the model and system version information of the mobile phone B are obtained as an example.
Step 3508: the mobile phone clone of the mobile phone A initiates a request for acquiring the model and system version information of the mobile phone B to the mobile phone B.
Step 3509: and the switch clone of the mobile phone A receives the model and system version information of the mobile phone B returned by the switch clone of the mobile phone B.
Step 3510: and the change machine clone of the mobile phone A returns the model and system version information of the mobile phone B to the image library.
Step 3511: the gallery of the mobile phone A sends a request for inquiring the attribute information of the image B to the multimedia database of the mobile phone A.
Step 3512: and the multimedia database of the mobile phone A returns the attribute information of the image B to the database.
Step 3513: the gallery of the mobile phone A selects one model from the model of the source identification device of the image B and the model of the mobile phone A as an appointed model.
Steps 3501 to 3513 in this example are similar to steps 3301 to 3313 in fig. 31, and will not be described again here.
Step 3514: and if the gallery of the mobile phone A detects that the specified model is larger than that of the mobile phone B, setting the identification tag as a false value.
Exemplarily, the process that the gallery of the mobile phone a detects that the designated model is larger than the model of the mobile phone B is similar to the process of step 2061, and the mobile phone a may add an identification tag to the attribute information, where the identification tag may be information indicating whether the mobile phone B performs an OCR character recognition operation. When the value of the identification tag is false (i.e. false), the identification tag is used to instruct the mobile phone B to end the operation of performing OCR character recognition on the specified image.
Step 3515: and the gallery of the mobile phone A acquires the recognition result of the image B.
The gallery of the mobile phone A can inquire whether an OCR character recognition result of the image B exists, and if the OCR character recognition result of the image B is detected, the recognition result of the image B is obtained. When the gallery does not detect the OCR character recognition result for image B, an OCR character recognition operation may be performed on image B (see step 2065 in fig. 3B).
In another example, the gallery may also perform OCR text recognition operations on image B. Fig. 4a, 5a to 5c can be referred to in the process of performing an OCR character recognition operation on the image B. The process of performing OCR character recognition on the image B may also refer to fig. 4B, 5e to 5f. The detailed process will not be described herein.
It should be noted that, after the gallery of the mobile phone a determines that the image B belongs to the second probability type, two operations of text detection and text recognition are directly performed on the image a without determining whether the mobile phone a is in the off-screen and charging state.
Step 3516: the gallery of the mobile phone a sends the transmission data to the switch machine clone.
Illustratively, the transmission data may include image a and attribute information of image a. Optionally, the attribute information of the image a may include: the image identification device comprises a first label, a second label, a photographing mode label, a content label, the model of the mobile phone A, the system version information of the model of the mobile phone A of the source identification device of the image A, a detection label, an identification label, a detection result and the like of the mobile phone A.
Step 3517: the switch clone of the mobile phone A sends the transmission data to the switch clone of the mobile phone B.
Illustratively, the transmission data of the mobile phone a may include an image B and attribute information of the image B, and the attribute information of the image B may include an identification tag and an OCR character recognition result of the image B.
The mobile phone A receives the transmission data, and the mobile phone B changes the mobile phone A to finish cloning the image A.
And the mobile phone B gallery sends the image B and the attribute information of the image B to a multimedia database of the mobile phone B for binding and storing. And when the gallery of the mobile phone B detects a preset trigger condition and the gallery detects a false value of the identification label of the image B, directly acquiring and displaying an OCR character identification result bound with the image B.
Fig. 34 is an interaction diagram of modules when the mobile phone B performs OCR character recognition operation on the image C.
Step 3601: and the gallery of the mobile phone B receives the operation of opening the image C by the user.
Step 3602: and the gallery of the mobile phone B initiates a request for inquiring the attribute information of the image C to the multimedia database.
Step 3603: and the multimedia database of the mobile phone B returns the image C and the attribute information of the image C to the database.
Step 3604: and the gallery of the mobile phone B detects that the identification label of the image C is a true value according to the attribute information of the image C.
Step 3605: and the gallery of the mobile phone B determines that the image C belongs to the second probability type according to the attribute information.
Step 3606: and triggering an OCR engine to execute an OCR character recognition operation by the gallery of the mobile phone B.
Step 3607: and the OCR engine of the mobile phone B executes the operation of OCR character recognition.
Step 3608: and the OCR engine of the mobile phone B transmits an OCR character recognition result to the multimedia database.
Step 3609: and returning an OCR character recognition result to the database by the OCR engine of the mobile phone B.
Step 3610: and displaying the image C and the display control C in the gallery of the mobile phone B.
And the control C is used for triggering the operation of displaying the OCR character recognition result.
Step 3611: and storing the OCR character recognition result in the multimedia database of the mobile phone B.
Step 3612: the user clicks on control C.
Step 3613: and displaying the image C and the OCR character recognition result in the image library of the mobile phone B.
The above steps are described in detail in other embodiments, and will not be described in detail in this example.
It will be appreciated that the electronic device, in order to implement the above-described functions, comprises corresponding hardware and/or software modules for performing the respective functions. The present application is capable of being implemented in hardware or a combination of hardware and computer software in conjunction with the exemplary algorithm steps described in connection with the embodiments disclosed herein.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, and therefore, the beneficial effects that can be achieved by the electronic device, the computer storage medium, the computer program product, or the chip may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Any of the various embodiments of the present application, as well as any of the same embodiments, can be freely combined. Any combination of the above is within the scope of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (33)

1. A character recognition method of an image is applied to a first electronic device, and the method comprises the following steps:
in response to the received transmission operation, acquiring attribute information of a designated image, wherein the transmission operation is used for instructing the first electronic device to transmit the designated image to a second electronic device, and the attribute information of the designated image comprises: the image processing device comprises a first label, a second label and a content label, wherein the first label is used for indicating a source mode of the specified image, the second label is used for indicating information of an application to which the specified image belongs, and the content label is used for indicating a category to which the content of the specified image belongs;
acquiring an identification label of the designated image, wherein the identification label is used for indicating whether the second electronic equipment needs OCR character recognition operation on the designated image;
when the identification label is detected to indicate the second electronic equipment to perform OCR character recognition operation on the specified image, generating transmission data comprising the specified image, the attribute information of the specified image and the identification label;
when the identification label is detected to indicate that the second electronic equipment cancels the operation of OCR character recognition on the image, acquiring an OCR character recognition result of the specified image; generating transmission data including the designated image, the OCR character recognition result of the designated image, and the recognition tag;
and transmitting the transmission data to the second electronic equipment, and when the second electronic equipment detects a preset trigger condition, determining whether to perform OCR character recognition operation on the specified image or not by the second electronic equipment according to the identification tag in the transmission data, wherein the first electronic equipment transmits the transmission data in a clone application or image sharing mode.
2. The method of claim 1, wherein the generating transmission data including the designated image, the attribute information of the designated image, and the identification tag when detecting that the identification tag indicates that the second electronic device performs OCR character recognition on the designated image comprises:
when the identification tag is detected to indicate that the second electronic equipment performs OCR character recognition operation on the specified image, detecting whether the first electronic equipment has an OCR character recognition function or not;
when detecting that the first electronic equipment has an OCR character recognition function, acquiring an OCR character recognition result of the designated image, and taking the designated image, the attribute information of the designated image, the OCR character recognition result of the designated image and the recognition tag as the transmission data;
and when the first electronic equipment is not detected to have the OCR character recognition function, taking the designated image, the attribute information of the designated image and the identification tag as the transmission data.
3. The method according to claim 1 or 2, wherein the obtaining of OCR character recognition results of the designated image comprises:
detecting whether an OCR character recognition result of the specified image exists in the first electronic equipment or not;
when detecting that the OCR character recognition result of the specified image exists in the first electronic equipment, reading the OCR character recognition result of the specified image;
and when the first electronic equipment is detected not to store the OCR character recognition result of the specified image, triggering the first electronic equipment to perform OCR character recognition operation on the specified image, and reading the OCR character recognition result of the specified image.
4. The method of claim 1, wherein obtaining the identification tag of the designated image comprises:
acquiring equipment information of the first electronic equipment as first equipment information;
acquiring device information of the second electronic device as second device information;
acquiring equipment information of source equipment of the specified image as third equipment information;
selecting one piece of designated device information from the first device information and the third device information as the designated image;
comparing the grades of the designated equipment information and the second equipment information to obtain a comparison result;
and determining the identification label of the designated image according to the comparison result.
5. The method according to claim 4, wherein selecting one of the first device information and the third device information as the designated device information of the designated image includes:
detecting whether the first device information is the same as the third device information;
when detecting that the first device information is the same as the third device information, acquiring the first device information as the designated device information;
when the first equipment information is detected to be different from the third equipment information, detecting whether an OCR character recognition result of the specified image exists in the first electronic equipment or not; when an OCR character recognition result of the specified image is detected, acquiring the third equipment information as the specified equipment information; and when the OCR character recognition result of the specified image is not detected, acquiring the first equipment information as the specified equipment information.
6. The method according to claim 4 or 5, wherein the device information includes a device model number; the comparing the grades of the designated device information and the second device information to obtain a comparison result includes:
acquiring a specified model from the specified equipment information, and acquiring the model of second equipment from the second equipment information;
when the specified model is detected to be larger than the model of the second equipment, determining that the comparison result indicates that the grade of the specified equipment information is larger than the grade of the second equipment information;
when the designated model is detected to be smaller than or equal to the model of the second equipment, determining that the comparison result indicates that the grade of the designated equipment information is smaller than or equal to the grade of the second equipment information.
7. The method according to claim 4 or 5, wherein the device information includes a device model and system version information of the device; the comparing the grades of the designated device information and the second device information to obtain a comparison result includes:
acquiring a specified model from the specified equipment information, and acquiring the model of second equipment from the second equipment information;
when the specified model is detected to be equal to the model of the second equipment, acquiring specified version information from the specified equipment information, and acquiring version information of the second equipment from the second equipment information;
when the specified version information is detected to be larger than the version information of the second equipment, determining that the comparison result indicates that the grade of the specified equipment information is larger than the grade of the second equipment information;
when the specified version information is detected to be less than or equal to the version information of the second device, determining that the comparison result indicates that the level of the specified device information is less than or equal to the level of the second device information.
8. The method according to any one of claims 4 to 5, wherein determining the identification label of the designated image according to the comparison result comprises:
when the comparison result is detected to indicate that the grade of the designated equipment information is greater than that of the second equipment information, the identification tag is set as a false value, and the false value is used for indicating the second electronic equipment to cancel the operation of OCR character recognition on the designated image;
and when the comparison result is detected to indicate that the grade of the designated equipment information is less than or equal to the grade of the second equipment information, setting the identification label to be a true value, wherein the true value is used for indicating the second electronic equipment to perform the operation of OCR character recognition on the designated image.
9. The method according to any one of claims 4 to 5, wherein determining the identification label of the designated image according to the comparison result comprises:
when the comparison result is detected to indicate that the level of the designated equipment information is greater than the level of the second equipment information, setting the identification label as a false value, wherein the false value is used for indicating the second electronic equipment to cancel the operation of OCR character recognition on the designated image;
when it is detected that the comparison result indicates that the level of the designated image information is less than or equal to the level of the second device information, detecting a type to which the designated image belongs according to the attribute information of the designated image, the type to which the designated image belongs including: a first type, a second type, and a third type; when detecting that the type of the designated image is the first type or the second type, setting the identification label to be a true value, wherein the type of the designated image is used for indicating a probability range of characters existing in the designated image, and the true value is used for indicating the second electronic device to perform the operation of OCR character recognition on the designated image.
10. The method according to claim 9, wherein the attribute information of the specified image includes: and the information application label and the photographing mode label are used for indicating the application of the specified image.
11. The method according to claim 10, wherein the attribute information of the specified image further includes a first label indicating a category of the specified image, the category including a screenshot or a photograph;
the detecting the type of the designated image according to the attribute information of the designated image comprises:
determining the category of the designated image according to the first label of the designated image;
determining a first detection result for indicating the type of the specified image according to the type of the specified image and the attribute information of the specified image;
determining a second detection result used for indicating the type of the specified image according to the content label of the specified image;
and selecting a type with a high grade from the first detection result and the second detection result as the type to which the specified image belongs.
12. The method according to claim 11, wherein determining, based on the category of the specific image and the attribute information of the specific image, a first detection result indicating a type to which the specific image belongs comprises:
when the type of the specified image is determined to be the screenshot, determining the type of the application to which the specified image belongs according to the application label of the specified image;
when the application to which the specified image belongs is detected to belong to a first type of application, determining that the first detection result indicates that the type to which the specified image belongs is a first type;
when the application to which the specified image belongs is detected to belong to a second type of application, determining that the first detection result indicates that the type to which the specified image belongs is a second type;
when the application to which the specified image belongs is detected to belong to a third type of application, determining that the first detection result indicates a third type to which the specified image belongs;
wherein the first type of rating is greater than the second type of rating, which is greater than the third type of rating.
13. The method according to claim 11, wherein determining a first detection result indicating a type to which the designated image belongs, based on the category of the designated image and attribute information of the designated image, comprises:
when the type of the designated image is detected to be a photo, determining a photographing mode of the designated image according to the photographing mode tag of the designated image;
when the photographing mode of the specified image is detected to belong to a first type mode, determining that a first detection result indicates that the type of the specified image belongs to be a first type;
when the photographing mode of the specified image is detected to belong to a second type mode, determining that the first detection result indicates that the type of the specified image belongs to be a second type;
when the photographing mode of the specified image is detected to belong to a third type mode, determining that the first detection result indicates that the type of the specified image belongs to be a third type;
wherein the first type of rating is greater than the second type of rating, which is greater than the third type of rating.
14. The method according to any one of claims 11 to 13, wherein determining, according to the content tag of the designated image, a second detection result indicating a type to which the designated image belongs comprises:
when the content label of the specified image is detected to belong to a first type label, determining that the second detection result indicates that the type of the specified image belongs to be a first type;
when the content label of the designated image is detected to belong to a second type label, determining that the second detection result indicates that the type of the designated image belongs to be a second type;
when the content label of the designated image is detected to belong to a third type label, determining that the second detection result indicates that the type of the designated image belongs to a third type;
wherein the first type of rating is greater than the second type of rating, which is greater than the third type of rating.
15. The method of claim 11, further comprising:
acquiring the type of the designated image as a detection result;
and adding the detection result to attribute information of the specified image.
16. The method of any of claims 1, 2, 4, 5, 10 to 13, wherein the generating the transmission data including the designated image, OCR text recognition results for the designated image, and the identification tag comprises:
adding the identification label and the OCR character recognition result of the specified image to the attribute information of the specified image;
writing the updated attribute information of the designated image into a storage file of the designated image;
and taking the updated designated image as the transmission data.
17. The method according to any one of claims 1, 2, 4, 5, 10 to 13, wherein the generating transmission data including the designated image, attribute information of the designated image, and the identification tag includes:
adding the identification tag to attribute information of the specified image;
writing the updated attribute information of the designated image into a storage file of the designated image;
and taking the updated designated image as the transmission data.
18. A character recognition method of an image is applied to a second electronic device, and the method comprises the following steps:
the second electronic equipment receives transmission data in a mode of cloning application or sharing images;
in response to the received transmission data of the first electronic device, saving the transmission data, wherein the transmission data comprises a designated image, attribute information of the designated image and an identification tag, or the transmission data comprises: the designated image, OCR character recognition results of the designated image, and the transmission data of the identification tag; the identification tag is used for indicating whether the second electronic equipment carries out OCR character recognition operation on the specified image; the attribute information of the specified image includes: the image processing device comprises a first label, a second label and a content label, wherein the first label is used for indicating the source mode of the specified image, the second label is used for indicating the information of the application to which the specified image belongs, and the content label is used for indicating the category to which the content of the specified image belongs;
acquiring attribute information of the specified image and an identification label of the specified image;
when the fact that the identification label of the specified image indicates that the second electronic equipment conducts OCR character recognition operation on the specified image is detected, conducting OCR character recognition operation on the specified image according to the attribute information of the specified image;
and when the fact that the identification label of the specified image indicates that the second electronic equipment cancels the operation of OCR character recognition on the image is detected, acquiring an OCR character recognition result of the specified image from the transmission data.
19. The method of claim 18, wherein the OCR character recognition operation performed on the specific image according to the attribute information of the specific image comprises:
detecting the type of the designated image according to the attribute information of the designated image;
when the appointed image is detected to belong to a first type, performing OCR character recognition operation on the appointed image; storing an OCR character recognition result of the specified image;
when the designated image is detected to belong to a second type, detecting whether the second electronic equipment is in a screen-off and charging state; when the second electronic equipment is detected to be in a charging and screen-off state, performing OCR character recognition operation on the specified image, and storing an OCR character recognition result of the specified image;
and when detecting that the specified image belongs to the third type, canceling the operation of OCR character recognition on the specified image.
20. The method of claim 18, wherein performing OCR character recognition on the designated image according to the attribute information of the designated image comprises:
detecting the type of the designated image according to the attribute information of the designated image;
when the designated image is detected to belong to a first type, performing OCR character recognition operation on the designated image; storing an OCR character recognition result of the specified image;
when the designated image is detected to belong to a second type, detecting whether the second electronic equipment is in a screen-off and charging state; when detecting that the second electronic equipment is not in a charging and screen-off state, performing text detection operation on the designated image, and storing a text detection result of the designated image;
and when detecting that the specified image belongs to the third type, canceling the operation of OCR character recognition on the specified image.
21. The method according to claim 19 or 20, wherein detecting a type to which the designated image belongs according to attribute information of the designated image comprises:
determining the category of the designated image according to the first label of the designated image;
determining a first detection result for indicating the type of the specified image according to the type of the specified image and the attribute information of the specified image;
determining a second detection result for indicating the type of the specified image according to the content label of the specified image;
and selecting a type with a high grade from the first detection result and the second detection result as the type to which the specified image belongs.
22. The method according to claim 21, wherein determining a first detection result indicating a type to which the designated image belongs according to the category of the designated image and attribute information of the designated image comprises:
when the type of the designated image is determined to be the screenshot, determining the type of the application to which the designated image belongs according to the application label of the designated image;
when the application to which the specified image belongs is detected to belong to a first type of application, determining that the first detection result indicates that the type to which the specified image belongs is a first type;
when the application to which the specified image belongs is detected to belong to a second type of application, determining that the first detection result indicates that the type to which the specified image belongs is a second type;
when the application to which the specified image belongs is detected to belong to a third type of application, determining that the first detection result indicates a third type to which the specified image belongs;
wherein the first type of rating is greater than the second type of rating, which is greater than the third type of rating.
23. The method according to claim 21, wherein determining a first detection result indicating a type to which the designated image belongs according to the category of the designated image and attribute information of the designated image comprises:
when the type of the designated image is detected to be a photo, determining a photographing mode of the designated image according to a photographing mode label of the designated image;
when the photographing mode of the specified image is detected to belong to a first type mode, determining that a first detection result indicates that the type of the specified image belongs to be a first type;
when the photographing mode of the specified image is detected to belong to a second type mode, determining that the first detection result indicates that the type of the specified image belongs to the second type;
when the photographing mode of the specified image is detected to belong to a third type mode, determining that the type of the specified image is indicated to be a third type by the first detection result;
wherein the first type of rating is greater than the second type of rating, which is greater than the third type of rating.
24. The method according to any one of claims 22 to 23, wherein determining, according to the content tag of the designated image, a second detection result indicating a type to which the designated image belongs comprises:
when the content label of the specified image is detected to belong to a first type label, determining that the second detection result indicates that the type of the specified image belongs to a first type;
when the content label of the designated image is detected to belong to a second type label, determining that the second detection result indicates that the type of the designated image belongs to a second type;
when the content label of the designated image is detected to belong to a third type label, determining that the second detection result indicates that the type of the designated image belongs to a third type;
wherein the first type of rating is greater than the second type of rating, which is greater than the third type of rating.
25. The method according to claim 19, wherein the attribute information of the specified image further includes a detection result of the specified image;
the detecting the type of the designated image according to the attribute information of the designated image comprises:
acquiring a detection result of the specified image from the attribute information of the specified image;
and acquiring the type of the specified image from the detection result.
26. The method of claim 18, wherein the OCR character recognition operation on the designated image according to the attribute information of the designated image comprises:
determining the category of the designated image according to a first label in the attribute information of the designated image;
determining first indication information of the designated image according to the category of the designated image;
determining second indication information of the specified image according to the category of the content label of the specified image;
when the first indication information and the second indication information of the specified image both indicate that the operation of OCR character recognition on the specified image is canceled, canceling the operation of OCR character recognition on the specified image;
when any one of the first indication information and the second indication information of the specified image is detected to indicate that the operation of OCR character recognition is carried out on the specified image, the operation of OCR character recognition is carried out on the specified image.
27. The method according to claim 26, wherein the determining the first indication information of the designated image according to the category of the designated image comprises:
when the fact that the category of the specified image belongs to the screenshot is detected, acquiring the category of the application to which the specified image belongs from the attribute information of the specified image;
when detecting that the application to which the specified image belongs to a first class of application, determining that first indication information of the specified image indicates that OCR character recognition is carried out on the specified image by the second electronic equipment;
when the application to which the specified image belongs is detected to belong to a second type of application, detecting whether the second electronic equipment is in a screen-off and charging state; when the second electronic equipment is detected not to be in a charging and screen-off state, determining that the first indication information of the specified image indicates that the second electronic equipment stops OCR character recognition operation on the specified image;
and when the application to which the specified image belongs is detected to belong to a third type of application, determining that the first indication information of the specified image indicates that the second electronic equipment stops OCR character recognition operation on the specified image.
28. The method according to claim 26, wherein the determining the first indication information of the designated image according to the category of the designated image comprises:
when the fact that the type of the specified image belongs to a photo is detected, determining the mode type of the photographing mode of the specified image according to the photographing mode label of the specified image, wherein the mode type comprises a first type mode, a second type mode and a third type mode;
when the photographing mode of the specified image is detected to belong to a first type mode, determining that first indication information of the specified image indicates the second electronic equipment to perform OCR character recognition on the specified image;
when the photographing mode of the specified image is detected to belong to a second type mode, detecting whether the second electronic equipment is in a screen-off and charging state; when the second electronic equipment is detected not to be in a charging and screen-off state, determining that the first indication information of the specified image indicates that the second electronic equipment cancels the operation of OCR character recognition on the specified image;
and when the photographing mode of the specified image is detected to belong to a third type mode, determining that the first indication information of the specified image indicates the second electronic equipment to cancel the operation of OCR character recognition on the specified image.
29. The method according to any one of claims 26 to 28, wherein determining the second indication information of the designated image according to the category of the content tag of the designated image comprises:
when the content label of the designated image is detected to belong to a first class label, determining that second indicating information of the designated image indicates the second electronic equipment to perform OCR character recognition on the designated image;
when the content tag of the designated image is detected to belong to a second type of tag, detecting whether the second electronic equipment is in a screen-off and charging state; when the electronic equipment is detected not to be in a charging and screen-off state, determining that second indication information of the specified image indicates that the second electronic equipment cancels OCR character recognition operation on the specified image;
and when the content label of the specified image is detected to belong to a third type of label, determining that the second indication information of the specified image indicates the second electronic equipment to cancel the operation of OCR character recognition on the specified image.
30. The method of claim 18, wherein prior to obtaining the attribute information of the specified image and the identification tag of the specified image, the method further comprises: detecting a preset trigger condition, wherein the preset trigger condition comprises the following steps: the second electronic equipment receives an operation of viewing the specified image by a user;
alternatively, the first and second liquid crystal display panels may be,
the second electronic equipment is in a screen-off and charging state;
alternatively, the first and second liquid crystal display panels may be,
and the second electronic equipment receives the operation of viewing the gallery by the user.
31. A first electronic device, comprising:
one or more processors;
a memory;
and one or more computer programs, wherein the one or more computer programs are stored on the memory and when executed by the one or more processors, cause the electronic to perform the method of text recognition of an image of any of claims 1-17.
32. A second electronic device, comprising:
one or more processors;
a memory;
and one or more computer programs, wherein the one or more computer programs are stored on the memory and when executed by the one or more processors, cause the electronic device to perform the method of text recognition of an image of any of claims 18-30.
33. A computer-readable storage medium comprising a computer program, which, when run on an electronic device, causes the electronic device to perform a method of text recognition of an image according to any one of claims 1-17, or causes the electronic device to perform a method of text recognition of an image according to any one of claims 18-30.
CN202111387770.2A 2021-11-22 2021-11-22 Character recognition method for image, electronic device and storage medium Active CN115019291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111387770.2A CN115019291B (en) 2021-11-22 2021-11-22 Character recognition method for image, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111387770.2A CN115019291B (en) 2021-11-22 2021-11-22 Character recognition method for image, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN115019291A CN115019291A (en) 2022-09-06
CN115019291B true CN115019291B (en) 2023-04-14

Family

ID=83064320

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111387770.2A Active CN115019291B (en) 2021-11-22 2021-11-22 Character recognition method for image, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115019291B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103475670A (en) * 2013-09-26 2013-12-25 深圳市金立通信设备有限公司 Data transmission method, device and system
CN108427947A (en) * 2018-03-16 2018-08-21 联想(北京)有限公司 A kind of image-recognizing method and electronic equipment
CN111669312A (en) * 2020-05-15 2020-09-15 上海盛付通电子支付服务有限公司 Message interaction method, electronic device and medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9436682B2 (en) * 2014-06-24 2016-09-06 Google Inc. Techniques for machine language translation of text from an image based on non-textual context information from the image
CN109104723A (en) * 2018-07-13 2018-12-28 Oppo(重庆)智能科技有限公司 A kind of network name display methods and relevant device
CN109492143A (en) * 2018-09-21 2019-03-19 平安科技(深圳)有限公司 Image processing method, device, computer equipment and storage medium
CN109919109A (en) * 2019-03-12 2019-06-21 深圳灵图慧视科技有限公司 Image-recognizing method, device and equipment
CN110717484B (en) * 2019-10-11 2021-07-27 支付宝(杭州)信息技术有限公司 Image processing method and system
CN113449829A (en) * 2021-06-25 2021-09-28 未鲲(上海)科技服务有限公司 Data transmission method based on optical character recognition technology and related device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103475670A (en) * 2013-09-26 2013-12-25 深圳市金立通信设备有限公司 Data transmission method, device and system
CN108427947A (en) * 2018-03-16 2018-08-21 联想(北京)有限公司 A kind of image-recognizing method and electronic equipment
CN111669312A (en) * 2020-05-15 2020-09-15 上海盛付通电子支付服务有限公司 Message interaction method, electronic device and medium

Also Published As

Publication number Publication date
CN115019291A (en) 2022-09-06

Similar Documents

Publication Publication Date Title
CN110286976B (en) Interface display method, device, terminal and storage medium
KR102010221B1 (en) Smartphone-based methods and systems
US20180276896A1 (en) System and method for augmented reality annotations
WO2022100221A1 (en) Retrieval processing method and apparatus, and storage medium
CN104036476A (en) Method for providing augmented reality, and portable terminal
CN111164983B (en) The interconnection terminal lends local processing capability
US11934485B2 (en) Method and apparatus for generating training sample of semantic segmentation model, storage medium, and electronic device
CN105224075A (en) Sensor-based mobile search, correlation technique and system
CN109981881B (en) Image classification method and electronic equipment
CN110049180A (en) Shoot posture method for pushing and device, intelligent terminal
CN109492170A (en) Information-pushing method and Related product
CN110022397A (en) Image processing method, device, storage medium and electronic equipment
CN107562954B (en) Recommendation search method and device based on mobile terminal and mobile terminal
CN115033318B (en) Character recognition method for image, electronic device and storage medium
CN116048765B (en) Task processing method, sample data processing method and electronic equipment
CN115019291B (en) Character recognition method for image, electronic device and storage medium
CN111597369A (en) Photo viewing method and device, storage medium and terminal
CN115035520B (en) Character recognition method for image, electronic device and storage medium
WO2022033432A1 (en) Content recommendation method, electronic device and server
CN115035360B (en) Character recognition method for image, electronic device and storage medium
CN115170785B (en) Character recognition method for image, electronic device and storage medium
CN113890994B (en) Image photographing method, system and storage medium
WO2023045702A1 (en) Information recommendation method and electronic device
WO2023174200A1 (en) Interface display method and related device
WO2022179271A1 (en) Search result feedback method and device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant