Image processing method, device, electronic device and storage medium
By obtaining the first screenshot of the target area in the target page and using the target information to obtain the target image with higher definition for image recognition, the problem of low image recognition accuracy due to low definition is solved, and efficient image recognition in a low definition environment is achieved.
Patent Information
- Application Number
- CN202111349797.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-11-15
AI Technical Summary
Due to the low sharpness of the image in the display interface, the image recognition accuracy is low.
By obtaining the first screenshot of the target area in the target page, the target information is used to obtain a target image with a higher similarity and higher definition to the image to be identified, such as an image of an enlarged image or a target subpage, and image recognition is performed.
Improves the accuracy of image recognition and ensures that image content can still be effectively recognized under low clarity.
Smart Images

Figure CN114049638B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and specifically relates to an image processing method, device, electronic device and storage medium. Background Art
[0002] With the continuous development of technology, image recognition functions have become increasingly popular. Users can use image recognition functions to identify image content or extract text content in images.
[0003] Image clarity is one of the important factors affecting image recognition accuracy. However, the images in many display interfaces are small in size, which results in a corresponding decrease in image clarity. In addition, the image clarity in many display interfaces is inherently low, which leads to low image recognition accuracy. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide an image processing method, device, electronic device and storage medium, which can solve the problem of low image recognition accuracy due to low clarity.
[0005] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:
[0006] Obtaining a first screenshot of a target area in a target page, wherein the target area includes an image to be recognized;
[0007] In the case where the image to be identified has associated target information, obtaining a target image corresponding to the image to be identified based on the target information; the target information points to a target subpage or an enlarged image of the image to be identified;
[0008] Image recognition is performed based on the target image.
[0009] In a second aspect, an embodiment of the present application provides an image processing device, comprising:
[0010] A first acquisition module, configured to acquire a first screenshot of a target area in a target page, wherein the target area includes an image to be identified;
[0011] A second acquisition module is configured to acquire a target image corresponding to the image to be identified based on the target information if there is associated target information with the image to be identified; the target information points to a target subpage or an enlarged image of the image to be identified;
[0012] The first search module is configured to perform image recognition based on the target image.
[0013] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method described in the first aspect.
[0016] In an embodiment of the present application, when there is associated target information in the image to be identified in the target area, a target image with higher similarity to the image to be identified and higher clarity is obtained through the target information, and then image recognition is performed using the target image with higher clarity, thereby effectively improving the accuracy of image recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A schematic diagram of the image processing method provided in an embodiment of the present application;
[0018] Figure 2 This is a schematic diagram of a user selecting a target area in an embodiment of the present application;
[0019] Figure 3 A schematic diagram of the image recognition process provided in an embodiment of the present application;
[0020] Figure 4 A schematic diagram of a user selecting a target area according to an embodiment of the present application;
[0021] Figure 5 This is a schematic diagram of an enlarged image of the first image to be recognized described in the embodiment of the present application;
[0022] Figure 6 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
[0023] Figure 7 A schematic diagram of the electronic device structure provided in an embodiment of the present application;
[0024] Figure 8 A schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0026] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0027] The following describes in detail an image processing method, device, electronic device, and storage medium provided by the embodiments of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0028] Figure 1 A flow chart of the image processing method provided in the embodiment of the present application is shown as follows: Figure 1 As shown, including:
[0029] Step 110: Acquire a first screenshot of a target area in a target page, wherein the target area includes an image to be recognized;
[0030] Specifically, the target page described in the embodiment of the present application can be the display interface of an application running in the electronic device, which can be the application interface of the electronic device system, such as a dialing interface, or a system settings interface, or it can be the specific usage interface of a third-party application, such as a web page opened by a browser application.
[0031] The target page described in the embodiment of the present application includes a target area, which may be an area selected by the user in the target page or a pre-set area in the target page.
[0032] When the target area is the area selected by the user, the user's input for intercepting the target area in the target page is obtained. Figure 2 This is a schematic diagram of a user selecting a target area in an embodiment of the present application. Figure 2 As shown, the input may specifically be a sliding box selection operation of the user in the target page.
[0033] Optionally, the input may also be a two-finger sliding operation of the user on the target page, which is not limited in the embodiment of the present application.
[0034] The target area described in the embodiment of the present application may be a square area or a circular area, or an area of other shapes, and the embodiment of the present application does not limit this.
[0035] The image to be identified described in the embodiment of the present application is an image that requires image recognition. For the convenience of capturing, the image can be captured by obtaining a first screenshot of its corresponding target area in the embodiment of the present application.
[0036] The target area described in the embodiment of the present application contains at least one image to be identified, and there may also be multiple images to be identified in the target area. In this case, multiple images can be captured at one time. It can be understood that the first screenshot at this time should also contain the image to be identified in the target area.
[0037] Step 120: If there is target information associated with the image to be identified, obtain a target image corresponding to the image to be identified based on the target information; the target information points to a target subpage or an enlarged image of the image to be identified;
[0038] Specifically, the target information described in the embodiments of the present application may be link information or image information.
[0039] As an optional embodiment, when determining whether the image to be identified has associated target information, it can be determined based on the attribute information of the image to be identified, or the size, position or layer order of the image to be identified in the current display interface.
[0040] As another optional embodiment, a method for determining whether there is associated target information with the image to be identified may specifically be to simulate in the background the operation of clicking on the image to be identified in the target area. If there are multiple images to be identified, the operation of clicking on each image to be identified will be simulated separately. After simulating the click operation, it is determined in the background whether the electronic device will respond to the click operation, call up a new page or call up an enlarged image. If the simulated click operation can call up a new page or call up an enlarged image, it is considered that there is associated target information with the image to be identified.
[0041] More specifically, the operation of clicking on the image to be identified in the target area is simulated in the background. After the simulated click operation, it is determined whether the electronic device will respond to the click operation. If it responds to the click operation, that is, calls the link information and jumps to a new page, it means that there is associated target information with the image to be identified at this time, and the target information is link information.
[0042] It can be understood that in the embodiment of the present application, the interface pointed to when the target information is link information can be a sub-interface of the target page, for example, it can be a secondary page of the target page.
[0043] In an embodiment of the present application, when there is associated target information with the image to be identified, it means that there may be a possibility of finding a target image with higher clarity than the image to be identified, so the image to be identified with higher clarity will be obtained through the target information.
[0044] When there is only one image to be identified in the target area and there is associated target information with the image to be identified, an image with a higher similarity to the image to be identified, a higher definition and a larger size is obtained through the target information; if the image is successfully obtained, the image is used as the target image; if the image is not successfully obtained, the first screenshot is still used as the target image.
[0045] As an optional embodiment, when there are multiple images to be identified in the target area, there may still be some images to be identified in the target area that have no associated target information, while some images to be identified have associated target information. Through the target information, an image with a high similarity to the image to be identified, higher clarity and larger size is obtained; when the image is successfully obtained, a target image is generated based on the image and the image to be identified that has no associated target information.
[0046] As another optional embodiment, when there are multiple images to be identified in the target area, and none of the images to be identified in the target area has associated target information, the first screenshot is directly used as the target image.
[0047] Step 130: Perform image recognition based on the target image.
[0048] Specifically, in the embodiment of the present application, image recognition is performed based on the target image, which may specifically include identifying text information in the target image, or extracting image information in the target image, and displaying search results based on the image information, or identifying and searching for an approximate image of the target image. For example, to identify the image information of a certain celebrity, the detailed personal information of the celebrity will be specifically identified, and an approximate image corresponding to the celebrity will be displayed.
[0049] In an embodiment of the present application, when there is associated target information in the image to be identified in the target area, a target image with a higher similarity to the image to be identified and a higher definition is obtained through the target information, and then image recognition is performed using the target image with a higher definition, thereby effectively improving the accuracy of image recognition.
[0050] Optionally, acquiring a target image corresponding to the image to be identified based on the target information includes:
[0051] When the target information points to an enlarged image of the image to be identified, acquiring the enlarged image based on the target information;
[0052] When the clarity of the enlarged image is higher than that of the image to be identified, and the area proportion of the image to be identified in the target area exceeds a first preset threshold, the enlarged image is used as the target image.
[0053] Specifically, the enlarged image of the image to be identified described in the embodiment of the present application is an image that can be called through the target operation on the image to be identified, which is the image to be identified with a larger image size, that is, the enlarged image has a very high similarity with the image to be processed.
[0054] In an embodiment of the present application, when the target information points to an enlarged image of the image to be identified, specifically, after simulating a click operation on the image to be identified, an enlarged image of the image to be identified can be obtained, and the enlarged image is likely to have better clarity than the image to be identified.
[0055] Therefore, in an embodiment of the present application, the electronic device automatically captures the enlarged image, and then calculates the clarity index of the image to be identified and the clarity index of the enlarged image through an image clarity evaluation algorithm, and judges the clarity of the enlarged image and the image to be identified based on the clarity index, wherein the image clarity evaluation algorithm can be at least one of the Brenner gradient function, the Tenengrad gradient function, the grayscale variance function, the grayscale variance product function, and the energy gradient function, and the embodiment of the present application is not limited to this.
[0056] In an embodiment of the present application, when the clarity of the enlarged image is higher than the clarity of the image to be identified, the area ratio of the image to be identified in the target area is further determined. When the area ratio of the image to be identified in the target area exceeds a first preset threshold, the enlarged image is used as the target image. When the area ratio of the image to be identified in the target area does not exceed the first preset threshold, the target image is obtained based on the enlarged image and the first screenshot.
[0057] In an embodiment of the present application, when the target information points to an enlarged image of the image to be identified, the enlarged image is obtained, and the clarity of the enlarged image is compared with the clarity of the image to be identified. Only when the clarity of the enlarged image is higher than the clarity of the image to be identified, the enlarged image is used as the target image, thereby effectively improving the clarity of the image to be identified.
[0058] Optionally, acquiring a target image corresponding to the image to be identified based on the target information includes:
[0059] In a case where the target information points to a target subpage, acquiring all subpage images of the target subpage based on the target information;
[0060] Based on the similarity between each of the sub-page images and the image to be identified, the sub-page images whose similarity with the image to be identified exceeds a second preset threshold are selected as candidate target images;
[0061] When the clarity of the candidate target image is higher than that of the image to be identified, the size of the candidate target image is larger than the size of the image to be identified, and the area proportion of the image to be identified in the target area exceeds a first preset threshold, the candidate target image is used as the target image.
[0062] Specifically, when the target information described in the embodiment of the present application points to a target subpage, it can be that after simulating a click on the image to be identified, it will jump to the corresponding target subpage, which can be a secondary subpage of the target page.
[0063] Accordingly, there may be multiple sub-page images in the target sub-page. In the embodiment of the present application, when the target information points to the target sub-page, it is very likely that an image with a higher similarity to the image to be identified and a higher definition can be obtained from the target sub-page.
[0064] Therefore, in the embodiment of the present application, the electronic device will open the target subpage pointed to by the target information in the background, and then capture all subpage images in the target subpage.
[0065] It can be understood that most of the sub-page images in the target sub-page are images that are not related to the image to be identified. Therefore, it is necessary to first determine an image that is sufficiently similar to the image to be identified. At this time, the similarity comparison between each sub-page image and its corresponding image to be identified can be performed to obtain the similarity value of each sub-page image relative to the image to be identified. The sub-page image whose similarity with the image to be identified exceeds a second preset threshold value is used as a candidate target image.
[0066] If there are multiple sub-page images whose similarities to the image to be identified exceed the second preset threshold, the sub-page image with the highest similarity is selected as the candidate target image.
[0067] In an embodiment of the present application, the clarity of the candidate target image may not be as good as the clarity of the image to be identified in the first screenshot, or the size of the candidate target image may be smaller than the size of the image to be identified. In this case, even if the candidate target image is very similar to the image to be identified, the candidate target image will not be used as the target image in the embodiment of the present application.
[0068] Therefore, in an embodiment of the present application, the clarity index and size between the candidate target image and the image to be identified are first compared. When the clarity of the candidate target image is higher than the clarity of the image to be identified and the size of the candidate target image is larger than the size of the image to be identified, the target image can be obtained based on the candidate target image.
[0069] When the area ratio of the image to be identified in the target area exceeds a first preset threshold, the candidate target image is directly used as the target image.
[0070] In an embodiment of the present application, when the target information points to a target subpage, an attempt can be made to obtain a higher-definition image to be recognized from the subpage image of the target subpage, thereby effectively ensuring the accuracy of image recognition.
[0071] Optionally, the method further includes:
[0072] Obtaining a target image based on the candidate target image and the first screenshot, if the clarity of the candidate target image is higher than the clarity of the image to be identified, the size of the candidate target image is larger than the size of the image to be identified, and the area proportion of the image to be identified in the target area does not exceed a first preset threshold;
[0073] Image recognition is performed based on the target image.
[0074] Specifically, the area ratio of the image to be identified in the target area described in the embodiment of the present application is used to determine how many non-image areas exist in the target area, and these non-image areas are often areas used to display text. If the area ratio of the image to be identified in the target area does not exceed the first preset threshold, it means that there are still more areas for displaying text in the target area selected by the user, which means that the user is likely to want to identify the text information in this area.
[0075] For example, the first preset threshold is set to 0.9. If the image to be identified accounts for more than 90% of the entire target area, it is determined that only identifying the image to be identified can meet the user's needs. If the image to be identified accounts for no more than 90% of the entire target area, it is determined that only identifying the image to be identified is not enough to meet the user's needs.
[0076] If the candidate target image is directly used as the target image for image recognition, the area where text is displayed will be omitted, that is, the text information in the area cannot be recognized. Therefore, when the area proportion of the image to be recognized in the target area does not exceed the first preset threshold, the target image will be obtained based on the candidate target image and the first screenshot, that is, image recognition will be performed on the first screenshot and the candidate target image at the same time.
[0077] In the embodiment of the present application, the influence of the area ratio of the image to be identified in the target area on the image recognition result is fully considered. When the area ratio of the image to be identified in the target area does not exceed the first preset threshold, image recognition will be additionally performed on the first screenshot to ensure the integrity of image recognition.
[0078] Optionally, determining whether the image to be identified has associated target information includes:
[0079] performing a simulation operation on the image to be recognized;
[0080] In a case where the target information is called in the background based on the simulation operation, it is determined that the image to be identified has associated target information.
[0081] Specifically, after obtaining the first screenshot, it is necessary to further determine whether the image to be identified in the target area of the first screenshot has associated target information.
[0082] The simulated operation of the image to be recognized described in the embodiments of this application can specifically be a simulated click instruction generated in the background. This simulated operation will not have any response in the foreground interface and will not affect the user's operation and experience. In other words, it is equivalent to an operation that is only a simulated test. If there are multiple images to be recognized in the target area, each image to be recognized will be simulated and clicked separately.
[0083] The target information described in this application may specifically be link information or image information. After simulating a click operation, it will be determined in the background whether the electronic device will respond to the click operation and call up the image information or link information.
[0084] In an embodiment of the present application, if the target information is successfully called in the background, it is determined that the image to be identified has associated target information; if the target information cannot be successfully called in the background, it is determined that the image to be identified does not have associated target information.
[0085] In the embodiment of the present application, by performing a simulation operation on the image to be identified, it is possible to quickly determine whether the image to be identified in the target area has associated target information.
[0086] Optionally, the method further includes:
[0087] In the case that there is no associated target information for the image to be identified, an image search is performed based on the image to be identified.
[0088] Specifically, if there is no associated target information for the image to be identified, that is, if there is no response after attempting to perform a touch operation on the image to be identified, it means that there is no associated target information for the image to be identified.
[0089] In the embodiment of the present application, if there is no associated target information for the image to be identified, it means that there may be no other way to obtain a clearer image to be identified, so the image search is performed directly based on the image to be identified.
[0090] In an embodiment of the present application, when there is no associated target information for the image to be identified, image search is continued based on the image to be identified, thereby ensuring that image recognition continues.
[0091] Optionally, Figure 3 The image recognition process diagram provided in the embodiment of the present application is as follows: Figure 3 As shown, including:
[0092] In step 301, the user enters a target page and starts a screenshot image recognition function of the electronic device. The user selects a target area to be recognized in the target page.
[0093] Figure 4 This is a schematic diagram of a user selecting a target area provided in an embodiment of the present application, such as Figure 4 As shown, the target area 41 selected by the user on the target page includes a first image 411 and a second image 412 to be recognized.
[0094] Step 302: The electronic device detects the image to be identified in the target area, and detects the target area where the image to be identified is located. Figure 4 The first image to be identified 411 and the second image to be identified 412 are automatically simulated and clicked on the center positions of the areas of the two images to be identified, and it is detected whether the image can be enlarged after the click. If the enlarged image can be obtained after the simulated click, step 305 is entered, otherwise step 303 is entered.
[0095] In step 303, the electronic device detects the image to be identified in the target area, and determines whether a new app page or web link will be called by simulating a click operation on the area where the image to be identified is located in the target area. If a new page can be called, it means that the target sub-interface can be accessed through the image to be identified, and the process goes to step 305; otherwise, the process goes to step 304.
[0096] In step 304, the terminal does not have a path to obtain a clearer image, and only sends the screenshot to the server for image recognition.
[0097] Step 305, the target sub-interface can be entered through the target information corresponding to the image to be identified. At this time, the terminal automatically enters the target sub-interface, captures all sub-interface images in the target sub-interface, and then performs similarity matching on all sub-interface images and their corresponding images to be identified to find the candidate target image.
[0098] Step 306: The terminal automatically captures the enlarged high-definition image. Figure 5 This is a schematic diagram of an enlarged image of the first image to be identified described in the embodiment of the present application, such as Figure 5 As shown, it includes a schematic diagram 511 of an enlarged image of a first image to be identified.
[0099] In step 307, the terminal compares the captured image with the screenshot image for clarity to determine whether to use the captured image for recognition. Size comparison is performed by comparing the captured image area with the image area. Image clarity is calculated using a clarity evaluation algorithm to determine a clarity index, which is then compared. If the captured image is larger than or equal to the original screenshot area and has higher clarity than the original screenshot area, the process proceeds to step 308; otherwise, the process proceeds to step 304.
[0100] Step 308: After the image is captured, it is determined whether the user only needs to identify the image within the target capture area. If so, the captured image is sent to the server for recognition. The terminal calculates the ratio of the image within the target capture area to the entire capture area (image area / capture area). If the ratio exceeds a first preset threshold, the process proceeds to step 309; otherwise, the process proceeds to step 310.
[0101] Step 309: The terminal sends only the captured high-definition image to the server for identification.
[0102] Step 310: The terminal sends the captured high-definition image and the screenshot image to the server for recognition. In this case, the user may need to recognize other area contents in addition to the image, such as extracting text.
[0103] Step 311: The server receives the image sent by the terminal and performs recognition, and returns the recognition result to the terminal after the recognition is completed.
[0104] Step 312: The terminal receives the recognition result returned by the server, parses it, and displays it on the terminal.
[0105] In an embodiment of the present application, when there is associated target information in the image to be identified in the target area, an attempt will be made to obtain a target image that has a high similarity with the image to be identified and a higher definition through the target information, and then image recognition will be performed using the target image with a higher definition, thereby effectively improving the accuracy of image recognition.
[0106] It should be noted that the image processing method provided in the embodiments of the present application can be executed by an image processing device or a control module in the image processing device for executing the image processing method. In the embodiments of the present application, the image processing device provided in the embodiments of the present application is described by taking the image processing device executing the image processing method as an example.
[0107] Figure 6 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, including:
[0108] The first acquisition module 610 is used to acquire a first screenshot of a target area in a target page, where the target area includes an image to be identified;
[0109] The second acquisition module 620 is configured to acquire a target image corresponding to the image to be identified based on the target information if there is associated target information with the image to be identified; the target information points to a target subpage or an enlarged image of the image to be identified;
[0110] The first search module 630 is used to perform image recognition based on the target image.
[0111] Optionally, the second acquisition module is specifically configured to:
[0112] When the target information points to an enlarged image of the image to be identified, acquiring the enlarged image based on the target information;
[0113] When the clarity of the enlarged image is higher than that of the image to be identified, and the area proportion of the image to be identified in the target area exceeds a first preset threshold, the enlarged image is used as the target image.
[0114] Optionally, the second acquisition module is specifically configured to:
[0115] In a case where the target information points to a target subpage, acquiring all subpage images of the target subpage based on the target information;
[0116] Based on the similarity between each of the sub-page images and the image to be identified, the sub-page images whose similarity with the image to be identified exceeds a second preset threshold are selected as candidate target images;
[0117] When the clarity of the candidate target image is higher than that of the image to be identified, the size of the candidate target image is larger than the size of the image to be identified, and the area proportion of the image to be identified in the target area exceeds a first preset threshold, the candidate target image is used as the target image.
[0118] Optionally, the second acquisition module is further configured to:
[0119] Obtaining a target image based on the candidate target image and the first screenshot, if the clarity of the candidate target image is higher than the clarity of the image to be identified, the size of the candidate target image is larger than the size of the image to be identified, and the area proportion of the image to be identified in the target area does not exceed a first preset threshold;
[0120] Image recognition is performed based on the target image.
[0121] Optionally, the device further comprises:
[0122] The second search module is configured to perform an image search based on the image to be identified when there is no associated target information for the image to be identified.
[0123] Optionally, the device further comprises:
[0124] an execution module, configured to perform a simulation operation on the image to be recognized;
[0125] The determination module is used to determine whether the image to be identified has associated target information when the target information is called in the background based on the simulation operation.
[0126] In an embodiment of the present application, when there is associated target information in the image to be identified in the target area, an attempt will be made to obtain a target image that has a high similarity with the image to be identified and a higher definition through the target information, and then image recognition will be performed using the target image with a higher definition, thereby effectively improving the accuracy of image recognition.
[0127] The image processing device in the embodiments of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), an ATM, or an kiosks, etc., which are not specifically limited in the embodiments of the present application.
[0128] The image processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0129] The image processing device provided in the embodiment of the present application can achieve Figures 1 to 5 To avoid repetition, the various processes implemented in the method embodiment are not described here.
[0130] Optionally, Figure 7 This is a schematic diagram of the electronic device structure provided in the embodiment of the present application, such as Figure 7 As shown, an embodiment of the present application also provides an electronic device 700, including a processor 701, a memory 702, and a program or instruction stored in the memory 702 and executable on the processor 701. When the program or instruction is executed by the processor 701, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0131] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0132] Figure 8 A schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
[0133] The electronic device 800 includes but is not limited to components such as a radio frequency unit 801 , a network module 802 , an audio output unit 803 , an input unit 804 , a sensor 805 , a display unit 806 , a user input unit 807 , an interface unit 808 , a memory 809 , and a processor 810 .
[0134] Those skilled in the art will understand that the electronic device 800 may also include a power source (such as a battery) to power each component, and the power source may be logically connected to the processor 810 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be repeated here.
[0135] The user input unit 807 is used to obtain a first screenshot of a target area in a target page, where the target area includes an image to be recognized;
[0136] The processor 810 is configured to, if there is target information associated with the image to be identified, obtain a target image corresponding to the image to be identified based on the target information; the target information points to a target subpage or an enlarged image of the image to be identified;
[0137] The processor 810 is configured to perform image recognition based on the target image.
[0138] The processor 810 is configured to, when the target information points to the enlarged image of the image to be identified, acquire the enlarged image based on the target information;
[0139] The processor 810 is configured to use the enlarged image as the target image if the clarity of the enlarged image is higher than the clarity of the image to be identified and the area proportion of the image to be identified in the target area exceeds a first preset threshold.
[0140] The processor 810 is configured to, when the target information points to a target subpage, obtain all subpage images of the target subpage based on the target information;
[0141] The processor 810 is configured to, based on the similarities between the sub-page images and the image to be identified, select the sub-page images whose similarity with the image to be identified exceeds a second preset threshold as candidate target images;
[0142] The processor 810 is used to use the candidate target image as the target image when the clarity of the candidate target image is higher than the clarity of the image to be identified, the size of the candidate target image is larger than the size of the image to be identified, and the area proportion of the image to be identified in the target area exceeds a first preset threshold.
[0143] The processor 810 is configured to obtain a target image based on the candidate target image and the first screenshot, if the clarity of the candidate target image is higher than the clarity of the image to be recognized, the size of the candidate target image is larger than the size of the image to be recognized, and the area proportion of the image to be recognized in the target area does not exceed a first preset threshold;
[0144] The processor 810 is configured to perform image recognition based on the target image.
[0145] The processor 810 is configured to perform an image search based on the image to be identified when there is no associated target information for the image to be identified.
[0146] The processor 810 is configured to perform a simulation operation on the image to be recognized;
[0147] In a case where the target information is called in the background based on the simulation operation, it is determined that the image to be identified has associated target information.
[0148] In an embodiment of the present application, when there is associated target information in the image to be identified in the target area, an attempt will be made to obtain a target image that has a high similarity with the image to be identified and a higher definition through the target information, and then image recognition will be performed using the target image with a higher definition, thereby effectively improving the accuracy of image recognition.
[0149] It should be understood that in an embodiment of the present application, the input unit 804 may include a graphics processing unit (GPU) 8041 and a microphone 8042. The graphics processor 8041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 806 may include a display panel 8061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 807 includes a touch panel 8071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include two parts: a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here. The memory 809 may be used to store software programs and various data, including, but not limited to, applications and operating systems. The processor 810 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and applications, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 810.
[0150] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned image processing method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0151] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk.
[0152] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0153] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0154] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0155] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0156] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. An image processing method, characterized in that: include: Obtaining a first screenshot of a target area in a target page, wherein the target area includes an image to be recognized; performing a simulation operation on the image to be recognized; In a case where the target information is called in the background based on the simulation operation, determining whether the image to be identified has associated target information; In a case where the image to be identified has associated target information, acquiring a target image corresponding to the image to be identified based on the target information; The target information points to the target subpage; performing image recognition based on the target image; Wherein, obtaining a target image corresponding to the image to be identified based on the target information includes: In a case where the target information points to a target subpage, acquiring all subpage images of the target subpage based on the target information; Based on the similarity between each of the sub-page images and the image to be identified, the sub-page images whose similarity with the image to be identified exceeds a second preset threshold are selected as candidate target images; When the clarity of the candidate target image is higher than that of the image to be identified, the size of the candidate target image is larger than the size of the image to be identified, and the area proportion of the image to be identified in the target area exceeds a first preset threshold, the candidate target image is used as the target image.
2. The image processing method according to claim 1, wherein: The target information also points to an enlarged image of the image to be identified. Acquiring a target image corresponding to the image to be identified based on the target information includes: When the target information points to an enlarged image of the image to be identified, acquiring the enlarged image based on the target information; When the clarity of the enlarged image is higher than that of the image to be identified, and the area proportion of the image to be identified in the target area exceeds a first preset threshold, the enlarged image is used as the target image.
3. The image processing method according to claim 1, wherein: The method further comprises: Obtaining a target image based on the candidate target image and the first screenshot, if the clarity of the candidate target image is higher than the clarity of the image to be identified, the size of the candidate target image is larger than the size of the image to be identified, and the area proportion of the image to be identified in the target area does not exceed a first preset threshold; Image recognition is performed based on the target image.
4. An image processing device, characterized in that include: A first acquisition module, configured to acquire a first screenshot of a target area in a target page, wherein the target area includes an image to be identified; performing a simulation operation on the image to be recognized; In a case where the target information is called in the background based on the simulation operation, determining whether the image to be identified has associated target information; A second acquisition module is configured to acquire a target image corresponding to the image to be identified based on the target information if there is associated target information with the image to be identified; the target information points to a target subpage; A first search module, configured to perform image recognition based on the target image; The second acquisition module is specifically configured to: In a case where the target information points to a target subpage, acquiring all subpage images of the target subpage based on the target information; Based on the similarity between each of the sub-page images and the image to be identified, the sub-page images whose similarity with the image to be identified exceeds a second preset threshold are selected as candidate target images; When the clarity of the candidate target image is higher than that of the image to be identified, the size of the candidate target image is larger than the size of the image to be identified, and the area proportion of the image to be identified in the target area exceeds a first preset threshold, the candidate target image is used as the target image.
5. The image processing device according to claim 4, wherein The target information also points to the enlarged image of the image to be identified, and the second acquisition module is specifically configured to: When the target information points to an enlarged image of the image to be identified, acquiring the enlarged image based on the target information; When the clarity of the enlarged image is higher than that of the image to be identified, and the area proportion of the image to be identified in the target area exceeds a first preset threshold, the enlarged image is used as the target image.
6. The image processing device according to claim 4, wherein The second acquisition module is further configured to: Obtaining a target image based on the candidate target image and the first screenshot, if the clarity of the candidate target image is higher than the clarity of the image to be identified, the size of the candidate target image is larger than the size of the image to be identified, and the area proportion of the image to be identified in the target area does not exceed a first preset threshold; Image recognition is performed based on the target image.
7. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the image processing method according to any one of claims 1 to 3.
8. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the image processing method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Display device and content display method
CN112601117A