Image detection method and apparatus
By generating and sending image feature vectors on the server side, the client compares them to determine whether the image is faulty. This solves the problem of low image detection efficiency in e-commerce scenarios and reduces the client's computing power requirements and network bandwidth usage.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies for detecting images displayed on e-commerce clients require high computing power and consume large amounts of network bandwidth, resulting in low image detection efficiency and an inability to effectively identify various errors.
The server extracts features from the image, generates a first feature vector, and sends it to the client. The client then extracts features from the displayed image and compares them with the first feature vector to determine if there are any errors in the image.
It reduces the client's computing power requirements, decreases power consumption, and ignores the impact of network bandwidth, thus achieving efficient image detection.
Smart Images

Figure CN116862839B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] One or more embodiments of the present specification relate to the field of image processing, and in particular, to an image detection method and device. BACKGROUND
[0002] In an e-commerce scenario, how to show correct images to users through a client is the basis of customer flow. If the images are wrong, for example, there are wrong pictures or wrong pictures, it can cause the information conveyed to the user to be wrong, and it is easy to cause the transaction to fail. Therefore, image detection needs to be performed on the images displayed by the client to determine whether they are wrong.
[0003] In related technologies, when the client performs image detection on the displayed images, it mainly extracts features from the displayed images, and then performs image recognition based on the extracted feature vectors to identify whether there are wrong parts in the images. This method requires a lot of computing power and can only identify a small number of errors. SUMMARY
[0004] Therefore, one or more embodiments of the present specification provide an image detection method and device to solve the problems in the related art.
[0005] To achieve the above-mentioned purpose, one or more embodiments of the present specification provide technical solutions as follows:
[0006] According to a first aspect of one or more embodiments of the present specification, an image detection method is provided, applied to a client, comprising:
[0007] sending image request information for a first image to a server, wherein the image request information includes image display requirements of the client for the first image;
[0008] obtaining image data satisfying the image display requirements of the first image obtained by the server performing image processing on the first image, and a first feature vector obtained by the server performing feature extraction on the first image;
[0009] performing visual rendering based on the image data to generate a second image corresponding to the first image, and outputting and displaying the second image through an interactive interface of the client;
[0010] performing feature extraction on the second image to obtain a second feature vector, and comparing the first feature vector with the second feature vector to determine whether the output and displayed second image is wrong.
[0011] According to a second aspect of one or more embodiments of the present specification, an image detection method is provided, applied to a server, comprising:
[0012] obtain image request information for the first image from a client, the image request information including image display requirements of the client for the first image;
[0013] perform image processing on the first image to obtain image data satisfying the image display requirements, and perform feature extraction on the first image to obtain a first feature vector;
[0014] send the image data satisfying the image display requirements corresponding to the first image and the first feature vector to the client, so that the client performs visual rendering based on the image data to generate a second image corresponding to the first image, and outputs and displays the second image through an interactive interface of the client, performs feature extraction on the second image to obtain a second feature vector, and compares the first feature vector with the second feature vector to determine whether the output and display of the second image is incorrect.
[0015] According to a third aspect of one or more embodiments of the present specification, an image detection apparatus is provided, comprising:
[0016] an image request module configured to send image request information for a first image to a server, the image request information including image display requirements for the first image;
[0017] a data receiving module configured to obtain image data satisfying the image display requirements obtained by the server performing image processing on the first image, and a first feature vector obtained by the server performing feature extraction on the first image;
[0018] an image display module configured to perform visual rendering based on the image data to generate a second image corresponding to the first image, and output and display the second image through an interactive interface;
[0019] an image detection module configured to perform feature extraction on the second image to obtain a second feature vector, and compare the first feature vector with the second feature vector to determine whether the output and display of the second image is incorrect.
[0020] According to a fourth aspect of one or more embodiments of the present specification, an image detection apparatus is provided, comprising:
[0021] a request receiving module configured to obtain image request information for a first image from a client, the image request information including image display requirements of the client for the first image;
[0022] a feature extraction module, configured to perform image processing on the first image to obtain image data satisfying the image display requirement, and to perform feature extraction on the first image to obtain a first feature vector;
[0023] a data sending module, configured to send, to the client, the image data satisfying the image display requirement corresponding to the first image and the first feature vector, so that the client performs visual rendering based on the image data to generate a second image corresponding to the first image, and outputs and displays the second image through an interactive interface of the client, performs feature extraction on the second image to obtain a second feature vector, and compares the first feature vector with the second feature vector to determine whether the output and display of the second image is incorrect.
[0024] According to a fifth aspect of one or more embodiments of the present specification, an electronic device is provided, comprising:
[0025] a processor;
[0026] a memory for storing processor-executable instructions;
[0027] The processor implements the method of the first aspect by running the executable instructions.
[0028] According to a sixth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, which stores computer instructions that are executed by a processor to implement the steps of the method of the first aspect.
[0029] In the above technical solution, the server extracts features from the first image to obtain a first feature vector corresponding to the first image and sends it to the client. The client extracts features from the displayed second image and compares the obtained second feature vector with the first feature vector to determine whether the second image is incorrect compared with the first image. Thus, the client can detect images through a simple method, reducing the demand for computing power of the client and the power consumption of the client when detecting images. Moreover, since the server only needs to send the first feature vector to the client, the impact of image detection on network bandwidth can be ignored. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 FIG. 1 is a schematic diagram of an architecture of an image detection system provided by an example embodiment;
[0031] Figure 2 FIG. 1 is a schematic diagram of an architecture of an image detection system provided by an example embodiment;
[0032] Figure 3FIG. 2 is a flowchart of another image detection method provided by an example embodiment;
[0033] Figure 4 FIG. 2 is a flowchart of another image detection method provided by an example embodiment;
[0034] Figure 5 FIG. 2 is a flowchart of another image detection method provided by an example embodiment;
[0035] Figure 6 FIG. 2 is a flowchart of another image detection method provided by an example embodiment;
[0036] Figure 7 FIG. 3 is a structural schematic diagram of an image detection device provided by an example embodiment;
[0037] Figure 8 FIG. 3 is a structural schematic diagram of an image detection device provided by an example embodiment;
[0038] Figure 9 FIG. 4 is a structural schematic diagram of an electronic device provided by an example embodiment. DETAILED DESCRIPTION
[0039] The example embodiments will be described in detail herein with reference to the attached drawings. In the following description, the same numbers are used to represent the same elements in different drawings. The embodiments described in the following example embodiments are not representative of all embodiments consistent with one or more embodiments of the present description. Rather, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of the present description as detailed in the appended claims.
[0040] It should be noted that the steps of the corresponding method are not necessarily performed in the order shown and described in the present description in other embodiments. In some other embodiments, the steps included in the method can be more or less than described in the present description. In addition, a single step described in the present description can be divided into multiple steps for description in other embodiments, and multiple steps described in the present description can be combined into a single step for description in other embodiments.
[0041] In the e-commerce scenario, how to show the correct image to the user through the client is the basis of customer flow, and if the picture is wrong, for example, the picture is wrong or the picture is wrong, which can cause the information conveyed to the user to be wrong, and is easy to cause the transaction to fail. Therefore, a method for image detection of images displayed on the client is needed.
[0042] The related art mainly adopts two methods when the client performs image detection on the displayed image, which are the no-reference method and the full-reference method. For the no-reference image detection method, the client can directly extract features from the displayed image, and then perform image recognition based on the extracted feature vector to identify whether there is an error in the image. For example, a pre-trained deep neural network (DNN) can be used. The no-reference method requires a high amount of computing power, greatly increasing the power supply pressure of the client, and since there is no reference, only a few specific image errors can be identified, such as image discontinuity, partial non-display, etc. For the full-reference image detection method, the client can request the original image from the server, compare the original image with the displayed image, and determine whether the displayed image is incorrect. The full-reference method requires requesting the original image from the server, which puts a large burden on the network bandwidth and easily increases the overall latency.
[0043] Therefore, the present specification proposes an image detection method. The server extracts features from the original image to obtain a first feature vector, and when receiving image request information from the client, sends image data and the first feature vector corresponding to the original image to the client. The client generates a displayed image based on the received image data, and when determining that image detection is needed, extracts features from the displayed image to obtain a second feature vector, and then compares the first feature vector with the second feature vector to determine whether the displayed image is incorrect.
[0044] In implementation, the client sends image request information for a first image to the server, wherein the image request information includes image display requirements of the client for the first image; obtains image data satisfying the image display requirements and a first feature vector extracted by the server from the first image, wherein the image data is obtained by the server performing image processing on the first image; performs visual rendering based on the image data to generate a second image corresponding to the first image, and outputs the second image through an interactive interface of the client; extracts features from the second image to obtain a second feature vector, and compares the first feature vector with the second feature vector to determine whether the output displayed second image is incorrect.
[0045] In the above technical solution, the server extracts features from the first image to obtain a first feature vector corresponding to the first image and sends it to the client. The client extracts features from the displayed second image and compares the obtained second feature vector with the first feature vector to determine whether the second image is incorrect compared with the first image. Thus, the client can detect images by a simple method, reducing the demand for client computing power and reducing power consumption when the client performs image detection. Moreover, since the server only needs to send the first feature vector to the client, the impact of image detection on network bandwidth can be ignored.
[0046] Please refer to Figure 1 , Figure 1 is an exemplary embodiment of an architecture diagram of an image detection system. As Figure 1 shown, the system can include a network 10, a server 11, and a plurality of electronic devices, such as a terminal device 12, a terminal device 13, and a terminal device 14.
[0047] The server 11 can be a physical server containing a standalone host, or it can be a virtual server, cloud server, etc. carried by a host cluster. The terminal devices 12-14 are only one type of electronic device that users can use. In fact, users can also use electronic devices such as mobile phones, tablet devices, notebook computers, personal digital assistants (PDAs), wearable devices (such as smart glasses, smart watches, etc.), and the like, and the one or more embodiments of the present specification do not limit this. The network 10 can include various types of wired or wireless networks.
[0048] In an embodiment, the server 11 can cooperate with the terminal devices 12-14; wherein the server 11 can respond to the image request information of the client to obtain image data by image processing the first image and obtain a first feature vector by feature extraction of the first image; then send it to the terminal devices 12-14 through the network 10, and then the terminal devices 12-14 generate a second image corresponding to the first image based on the image data by visual rendering based on the image detection method of the present specification, and output and display the second image through the interactive interface of the client; extract a second feature vector from the second image, and compare the first feature vector with the second feature vector to determine whether the output and displayed second image is incorrect.
[0049] In order for those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the present specification will be described clearly and completely below with reference to the drawings in the embodiments of the present application.
[0050] Please see Figure 2 , Figure 2 This is an exemplary embodiment of an image detection method. The method can be applied to a client, which can be used to display images to a user through an interactive interface. The image detection method may include the following steps.
[0051] S210. Send image request information for the first image to the server, wherein the image request information includes the client's image display requirements for the first image.
[0052] The client can first send an image request message for a first image to the server. This first image can be the original image, which is the original image the server wants the client to display to the user. The image request message may include the identifier of the first image, the identifier of the client, and so on.
[0053] The image request information may also include the client's image display requirements for the first image, such as the image's data type, size, resolution, encoding type, etc. These image display requirements can be determined based on the client type, the image display method, and the opening method of the application used to display the image.
[0054] The image display requirements can also be determined by the server based on pre-maintained client type, image display method, and the opening method of the application used to display the image, etc., to determine the image display requirements of the first image corresponding to the client.
[0055] S220. Obtain image data that meets the image display requirements obtained by the server performing image processing on the first image, and a first feature vector obtained by the server performing feature extraction on the first image.
[0056] After receiving the client's image request information for the first image, the server can first determine whether the currently saved image data of the first image meets the image display requirements of the first image. If it does not meet the requirements, the server needs to process the first image to obtain image data that meets the client's image display requirements. Image processing of the first image can include image transcoding, such as decoding, scaling, and encoding the saved image data of the first image.
[0057] When processing the first image, the server can also extract features from the first image to obtain a first feature vector corresponding to the first image.
[0058] The method for feature extraction of the image can be various, for example, Histogram of Oriented Gradient (HOG) feature extraction, Local Binary Pattern (LBP) feature extraction, Haar-like feature extraction, etc.
[0059] As described above, different clients have different image display requirements. In order to keep the feature vectors corresponding to the images before and after image processing consistent, the color features of the image can be extracted, and the feature extraction can be performed based on different color spaces, for example, RGB color space, HSV color space, Lab color space, etc. For the sake of simplicity, the RGB color space is taken as an example in the following embodiments. The RGB color space can include three color channels: red (R), green (G), and blue (B).
[0060] For example, in an embodiment, the first image can be regarded as an RGB image. The feature vector extracted after feature extraction of the first image can include at least one of the following:
[0061] the mean value of each channel of RGB;
[0062] the standard deviation of each channel of RGB;
[0063] the weighted sum of the mean value and the standard deviation of each channel of RGB.
[0064] For example, in an embodiment, the first image can be divided into a plurality of image regions a1, a2,..., an. n The mean value and the standard deviation of the three channels of RGB of each image region are calculated respectively, and the formulas are as follows:
[0065] avg i,c = mean (a i,c ), 1≤i≤n, c=1, 2, 3
[0066] var i,c = std (a i,c ), 1≤i≤n, c=1, 2, 3
[0067] wherein avg i,c is the mean value of the image region a i for the c channel, and var i,c is the standard deviation of the image region a iThe standard deviation of the c channel, c = 1, 2, 3 corresponds to the RGB three channels respectively. The mean and the standard deviation of each channel are fused in each image region, that is, the weighted sum of the mean and the standard deviation of each channel is calculated to obtain the feature value of each image region for the RGB three channels fusion (i,c) , and the formula is as follows:
[0068] fusion (i,c) = a · avg (i,c) + b · (var (i,c) ) 2 , 1≤i≤n, c = 1, 2, 3
[0069] Wherein, a and b are preset weights.
[0070] Based on the three feature values corresponding to each image region calculated by the above formula, a 1*27 feature vector can be generated as the first feature vector corresponding to the first image.
[0071] The server sends the image data satisfying the image display requirement corresponding to the first image and the first feature vector corresponding to the first image to the client.
[0072] The server can send data to the client in various ways, for example, the server can send the image data and the first feature vector to the client through the wireless network in response to the image request information sent by the client; or, the server can also publish the image data and / or the first feature vector to the CDN network first, and save and push to the client by the CDN network.
[0073] The CDN network can be pre-set with the lifetime of the image data and / or the first feature vector, and cache the image data and / or the first feature vector received from the server within the lifetime; if the lifetime is exceeded, the corresponding image data and / or the first feature vector can be deleted; it can also request the server whether it needs to update the image data and / or the first feature vector, and then update or delete the image data and / or the first feature vector according to the reply of the server.
[0074] The client can determine whether the CDN network accessed by the client stores the image data satisfying the image display requirement corresponding to the first image and / or the first feature vector corresponding to the first image published by the server before sending the image request information to the server. If yes, the image data satisfying the image display requirement corresponding to the first image and / or the first feature vector corresponding to the first image are obtained from the CDN network. If not, the image request information is sent to the server through the CDN network, the image data satisfying the image display requirement corresponding to the first image and the first feature vector obtained by the server by performing image processing on the first image are sent to the CDN network, the image data and the first feature vector are pushed to the client by the CDN network, and the image data and the first feature vector are stored in the CDN network. The original image data of the first image stored in the CDN network can be carried in the image request information sent to the server through the CDN network, so that the server performs image processing on the first image based on the original image data.
[0075] For example, in an embodiment, the server can also pre-process the first image to generate image data satisfying multiple image display requirements and first feature vectors based on different types of clients, and publish the image data and the first feature vectors to the CDN network for storage, so that the client can directly obtain the corresponding image data and the first feature vectors from the CDN network without sending a request to the server, thereby reducing the demand for network bandwidth.
[0076] S230, visual rendering is performed based on the image data to generate a second image corresponding to the first image, and the second image is output and displayed through the interactive interface of the client.
[0077] After receiving the image data corresponding to the first image, the client can perform visual rendering on the image data to generate a second image corresponding to the first image, and output and display the second image through the interactive interface of the client. If the received image data is not erroneous, the generated second image should be theoretically the same as the first image.
[0078] S240, a second feature vector is extracted from the second image, and the first feature vector is compared with the second feature vector to determine whether the output and displayed second image is erroneous.
[0079] When the client determines that the displayed second image needs to be detected, the client can extract a second feature vector corresponding to the second image from the second image.
[0080] The determining of the need for image detection on the displayed second image can include: obtaining instruction information for image detection on the second image; or periodically performing image detection on the displayed second image based on a preset period, and the like.
[0081] The method for feature extraction on the second image can use the same method as the feature extraction on the first image by the server, for example, as described above, the color features of the second image are extracted based on the RGB color space to calculate the second feature vector corresponding to the second image.
[0082] The client compares the calculated second feature vector corresponding to the second image with the first feature vector corresponding to the first image calculated by the server, if the second feature vector is identical to the first feature vector, it can be considered that the second image is identical to the first image, and the client outputs that the displayed second image is not wrong; if the second feature vector is not identical to the first feature vector, it can be considered that the second image is not identical to the first image, and the client outputs that the displayed second image is wrong.
[0083] The second feature vector identical to the first feature vector can include: the second feature vector is the same as the first feature vector; or it can also include that the second feature vector is close enough to the first feature vector, for example, the gap between the first feature vector and the second feature vector is less than a preset threshold.
[0084] In order to more accurately detect the second image seen by the user, when detecting the second image, a screenshot operation can be performed on the display area corresponding to the second image in the interactive interface to obtain a screenshot corresponding to the second image; and then feature extraction is performed on the screenshot to obtain a second feature vector corresponding to the second image.
[0085] After the client determines the detection result of the second image based on the comparison result of the second feature vector and the first feature vector, the detection result can be reported. If the detection result is that the second image is wrong, the server can re-perform image processing on the first image to obtain new image data and send it to the client; or make the CDN network update the image data corresponding to the first image, and the like.
[0086] When comparing the second feature vector and the first feature vector and determining the detection result including whether the second image is wrong based on the comparison result; if the second image is wrong, the detection result can also include the image area of the second image that is wrong, and the reason why the second image is wrong, and the like.
[0087] As described above, when the feature vectors of the images are obtained, the images can be divided into a plurality of image regions, and at least one feature value corresponding to each image region is calculated. Therefore, when the first feature vector and the second feature vector are compared, the feature values corresponding to the same image regions in the first feature vector and the second feature vector can also be compared; if it is determined that the second image is incorrect according to the comparison result of the first feature vector and the second feature vector, the image region with errors can also be determined according to the comparison result of the feature values corresponding to each image region.
[0088] In addition, since each image region corresponds to the feature values of the three channels of RGB, when the first feature vector and the second feature vector are compared, the feature values corresponding to the same channels in the same image regions in the first feature vector and the second feature vector can also be compared; if it is determined that the second image is incorrect according to the comparison result of the first feature vector and the second feature vector, the image region with errors and the channel with errors in the three channels of RGB can also be determined according to the comparison result of the feature values corresponding to each image region.
[0089] It should be noted that when the first image and the second image are feature extracted, the feature extraction can be performed on a to-be-detected target specified by a user in the image. The to-be-detected target can refer to a specified region in the image, or a specified object in the image, such as a person, a product, a text, etc. The first feature vector obtained by the server by performing feature extraction on the first image can be a feature vector obtained by the server by performing feature extraction on the to-be-detected target specified by the user in the first image; correspondingly, the second feature vector obtained by the client by performing feature extraction on the second image can be a feature vector obtained by the client by performing feature extraction on the to-be-detected target in the second image.
[0090] For example, in an embodiment, the client can include the image display requirements of the client for the first image and the to-be-detected target specified by the user in the image request information sent to the server; after receiving the image request information, the server can perform image processing on the first image to obtain image data meeting the image display requirements, and perform feature extraction on the to-be-detected target in the first image to obtain a first feature vector; the server sends the image data and the first feature vector to the client; the client performs visual rendering based on the image to generate a second image corresponding to the first image, and outputs and displays the second image through the interactive interface of the client; when it is determined that the second image needs to be image detected, the client performs feature extraction on the to-be-detected target in the second image to obtain a second feature vector, and compares the first feature vector with the second feature vector to determine whether the to-be-detected target in the output and displayed second image is incorrect.
[0091] From the technical solutions of the above embodiments, the first image is feature-extracted by the server to obtain the first feature vector corresponding to the first image and sent to the client. The second image displayed is feature-extracted by the client, and the second feature vector obtained is compared with the first feature vector to determine whether the second image is wrong compared with the first image, so that the client can detect the image by a simple method, reducing the demand for the computing power of the client and reducing the power consumption of the client when detecting the image. And since the server only needs to send the first feature vector to the client, the influence of image detection on network bandwidth can be ignored.
[0092] Based on the above embodiments, the client can obtain the first feature vector obtained by the server by feature-extracting the first image. The first feature vector obtained by feature-extracting the first image by the server during image transcoding of the first image; or the first feature vector obtained by the server by feature-extracting the first image in response to obtaining the feature acquisition information after the client sends the feature acquisition information to the server when determining that the second image needs to be image-detected.
[0093] For example, please refer to Figure 3 , Figure 3 An image detection method is shown.
[0094] The client first sends picture request information for the first image to the server;
[0095] The server receives the image request information and processes the first image to obtain image data corresponding to the first image. The image processing of the first image can include decoding, scaling, encoding, and other operations on the original image data of the first image. The server can also feature-extract the first image during image processing of the first image. The first feature vector corresponding to the first image can be obtained by feature-extracting the decoded data after decoding the original image data of the first image;
[0096] The server sends the image data corresponding to the first image and the first feature vector as a return result to the client;
[0097] The client decodes the received return result, visualizes and renders based on the image data corresponding to the first image, generates a second image corresponding to the first image, and outputs and displays the second image on the interactive interface of the client;
[0098] When the client determines that the second image needs to be subjected to image detection, the client performs a screenshot operation on a display area corresponding to the second image in the interactive interface to obtain a screenshot corresponding to the second image; and performs feature extraction on the screenshot to obtain a second feature vector corresponding to the second image.
[0099] Then, the client compares the first feature vector and the second feature vector, and determines whether the second image is erroneous according to a comparison result, and reports a detection result obtained.
[0100] For example, as shown in Figure 4 , Figure 4 An image detection method is shown. Compared with the image detection method shown in Figure 3 , in the image detection method shown in Figure 4 , the server does not perform feature extraction on the first image simultaneously in the process of performing image processing on the first image after receiving the picture request.
[0101] When the client determines that the second image needs to be subjected to image detection, the client sends feature request information to the server simultaneously when performing feature extraction on the second image.
[0102] After the server receives the feature request information, the server performs feature extraction on the first image, and sends a first feature vector obtained by the feature extraction to the client, and the client compares the first feature vector and a second feature vector to determine whether the second image is erroneous, and reports a detection result obtained.
[0103] For example, as shown in Figure 5 , Figure 5 An image detection method is shown. Compared with the image detection method shown in Figure 4 , in the image detection method shown in Figure 5 , when the client determines that the second image needs to be subjected to image detection, the client can first obtain a URL address of the image, and send the URL address to the server by the feature request information, so that the server can obtain the image according to the URL address, and perform decoding and scaling on the image before performing feature extraction to obtain a first feature vector.
[0104] For example, as shown in Figure 6 , Figure 6 An image detection method is shown. The method can be applied to a server, and includes the following steps.
[0105] S610, obtaining image request information for a first image from a client, the image request information including image display requirements of the client for the first image;
[0106] S620, performing image processing on the first image to obtain image data satisfying the image display requirement, and performing feature extraction on the first image to obtain a first feature vector;
[0107] S630, sending, to the client, the image data satisfying the image display requirement corresponding to the first image and the first feature vector, so that the client performs visual rendering based on the image data to generate a second image corresponding to the first image, and outputs and displays the second image through an interactive interface of the client, performs feature extraction on the second image to obtain a second feature vector, and compares the first feature vector with the second feature vector to determine whether the output and display of the second image are erroneous.
[0108] Optionally, the image processing includes image transcoding; and the performing feature extraction on the first image to obtain the first feature vector includes:
[0109] In the process of performing image transcoding on the first image, the feature extraction is performed on the first image to obtain the first feature vector.
[0110] It should be noted that the server can implement the method embodiment as shown in Figures 2-6 , and obtain the same technical effect, and the repeated parts will not be described here.
[0111] As can be seen from the technical solutions of the above embodiments, in the embodiments of the present application, the server performs feature extraction on the first image to obtain the first feature vector corresponding to the first image and sends the first feature vector to the client, the client performs feature extraction on the displayed second image, and compares the obtained second feature vector with the first feature vector to determine whether the second image is erroneous compared with the first image, so that the client can detect the image through a simple method, the demand for the computing power of the client is reduced, the power consumption of the client in image detection is reduced, and since the server only needs to send the first feature vector to the client, the influence of image detection on network bandwidth can be ignored.
[0112] Corresponding to the foregoing embodiments of the image detection method, the present application also provides embodiments of an image detection device.
[0113] As shown in Figure 7 , the image detection device includes an image request module 701, an information acquisition module 702, an image display module 703, and an image detection module 704.
[0114] The image request module 701 is configured to send image request information for a first image to a server, wherein the image request information includes an image display requirement for the first image.
[0115] The information obtaining module 702 is configured to obtain image data satisfying the image display requirement obtained by the server performing image processing on the first image, and a first feature vector obtained by the server performing feature extraction on the first image.
[0116] The image display module 703 is configured to perform visual rendering based on the image data to generate a second image corresponding to the first image, and output and display the second image through an interactive interface.
[0117] The image detection module 704 is configured to perform feature extraction on the second image to obtain a second feature vector, and compare the first feature vector with the second feature vector to determine whether the output and displayed second image is incorrect.
[0118] The embodiment of the present application extracts features of the first image through the server to obtain a first feature vector corresponding to the first image and send it to the client, the client extracts features of the displayed second image, and compares the obtained second feature vector with the first feature vector to determine whether the second image is incorrect compared with the first image, so that the client can detect the image through a simple method, reduces the demand for computing power of the client, reduces the power consumption of the client when detecting the image, and since the server only needs to send the first feature vector to the client, the influence of image detection on network bandwidth can be ignored.
[0119] Corresponding to the foregoing embodiment of the image detection method, the present application also provides an embodiment of an image detection device.
[0120] As shown in Figure 8 The image detection device includes a request receiving module 801, a feature extraction module 802, and a data sending module 803.
[0121] The request receiving module 801 is configured to obtain image request information for a first image from a client, wherein the image request information includes image display requirements of the client for the first image.
[0122] The feature extraction module 802 is configured to perform image processing on the first image to obtain image data satisfying the image display requirement, and perform feature extraction on the first image to obtain a first feature vector.
[0123] The data sending module 803 is configured to send, to the client, image data corresponding to the first image and satisfying the image display requirement and the first feature vector, so that the client performs visual rendering based on the image data, generates a second image corresponding to the first image, and outputs the second image through an interactive interface of the client to display the second image, and then performs feature extraction on the second image to obtain a second feature vector, and compares the first feature vector with the second feature vector to determine whether the output display of the second image is incorrect.
[0124] The embodiment of the present application extracts features of the first image through the server to obtain a first feature vector corresponding to the first image and send it to the client, the client extracts features of the displayed second image, and compares the obtained second feature vector with the first feature vector to determine whether the second image is incorrect compared with the first image, so that the client can detect the image through a simple method, reduces the demand for computing power of the client, reduces the power consumption of the client when detecting the image, and since the server only needs to send the first feature vector to the client, the influence of image detection on network bandwidth can be ignored.
[0125] Figure 9 is a schematic structural diagram of a device provided by an example embodiment. Please refer to Figure 9 At the hardware level, the device includes a processor 902, an internal bus 904, a network interface 906, a memory 908, and a non-volatile memory 910, and of course, other required hardware. One or more embodiments of the present specification can be implemented in a software manner, such as reading a corresponding computer program from the non-volatile memory 910 into the memory 908 by the processor 902 and then running. Of course, in addition to the software implementation, one or more embodiments of the present specification do not exclude other implementation manners, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or a logic device.
[0126] The system, device, module or unit illustrated in the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0127] In a typical configuration, a computer includes one or more processors (CPUs), input / output interfaces, network interfaces, and memories.
[0128] Memory can include non-persistent memory, Random Access Memory (RAM), and / or non-volatile memory, such as Read Only Memory (ROM) or flash memory, in computer readable media. Memory is an example of computer readable media.
[0129] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media, or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to computing devices. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.
[0130] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0131] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or equipment including the element.
[0132] The above-described embodiments of the application have several aspects, no single one of which is solely responsible for the application's desirable attributes. Without limiting the scope of this application as expressed by the claims which follow, some further examples of aspects of the application are discussed below.
[0133] The terminology used in this description is for the purpose of describing particular embodiments only and is not intended to limit one or more embodiments of the present description. As used in one or more embodiments of the present description and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0134] It will be understood that, although the terms first, second, third, etc. can be used herein to describe various information, these terms are not intended to denote a temporal sequence. Rather, these terms are used only as distinguishable to reference various information. For example, without departing from the scope of one or more embodiments, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining."
[0135] The foregoing is considered as illustrative only of the principles of one or more embodiments of the present description. Further, since numerous modifications and changes will readily occur to those skilled in the art, it is not desired to limit the one or more embodiments of the present description to the exact construction and operation described. Accordingly, all such variations are intended to be included within the scope of one or more embodiments of the present description as defined in the claims below and any equivalents thereto.
Claims
1. An image detection method, characterized in that, Applied to the client side, including: Send an image request message for the first image to the server, the image request message including the client's image display requirements for the first image; The server obtains image data that meets the image display requirements by performing image processing on the first image, and a first feature vector obtained by the server performing feature extraction on the first image; wherein, the first feature vector includes a feature vector obtained by performing feature extraction on the color features of the first image. Visual rendering is performed based on the image data to generate a second image corresponding to the first image, and the second image is displayed through the client's interactive interface; The second image is subjected to feature extraction to obtain a second feature vector, and the first feature vector is compared with the second feature vector to determine whether the second image displayed in the output is incorrect; wherein, the second feature vector includes a feature vector obtained by feature extraction of the color features of the second image.
2. The method according to claim 1, characterized in that, The step of extracting features from the second image to obtain a second feature vector includes: In the interactive interface, a screenshot operation is performed on the display area corresponding to the second image to obtain a screenshot corresponding to the second image; Feature extraction is performed on the screenshot to obtain a second feature vector corresponding to the second image.
3. The method according to claim 1, characterized in that, The image is an RGB image; the feature vector includes at least one of the following: The average value of each RGB channel; Standard deviation of each RGB channel; The weighted sum of the mean and standard deviation of each RGB channel.
4. The method according to claim 1, characterized in that, The image processing includes image transcoding; The step of obtaining the first feature vector obtained by the server after performing feature extraction on the first image includes: Obtain the first feature vector obtained by the server during the image transcoding process of the first image, which is performed on the first image.
5. The method according to claim 1, characterized in that, The first feature vector is a feature vector obtained by the server extracting features from the target to be detected in the first image as specified by the user; the second feature vector is a feature vector obtained by the client extracting features from the target to be detected in the second image.
6. The method according to claim 1, characterized in that, The step of obtaining image data that meets the image display requirements obtained by the server performing image processing on the first image, and the first feature vector obtained by the server performing feature extraction on the first image, includes: Determine whether the CDN network accessed by the client stores image data corresponding to the first image that meets the image display requirements, and / or the first feature vector corresponding to the first image, published by the server; if so, obtain the image data corresponding to the first image that meets the image display requirements, and / or the first feature vector corresponding to the first image, from the CDN network.
7. An image detection method, characterized in that, Applied to the server side, including: Obtain image request information for the first image from the client, the image request information including the client's image display requirements for the first image; The first image is processed to obtain image data that meets the image display requirements, and a first feature vector is obtained by feature extraction of the first image; wherein, the first feature vector includes a feature vector obtained by feature extraction of the color features of the first image. The system sends image data corresponding to the first image and meeting the image display requirements, as well as the first feature vector, to the client so that the client performs visualization rendering based on the image data, generates a second image corresponding to the first image, and outputs and displays the second image through the client's interactive interface. Then, it extracts features from the second image to obtain a second feature vector, and compares the first feature vector with the second feature vector to determine whether there is an error in outputting and displaying the second image. The second feature vector includes a feature vector obtained by extracting the color features of the second image.
8. The method according to claim 7, characterized in that, The image processing includes image transcoding; The step of extracting features from the first image to obtain a first feature vector includes: During the image transcoding process of the first image, feature extraction is performed on the first image to obtain a first feature vector.
9. An image detection device, characterized in that, include: The image request module is used to send image request information for the first image to the server, and the image request information includes the image display requirements for the first image; The data receiving module is used to acquire image data that meets the image display requirements obtained by the server performing image processing on the first image, and a first feature vector obtained by the server performing feature extraction on the first image; wherein, the first feature vector includes a feature vector obtained by performing feature extraction on the color features of the first image. The image display module is used to perform visualization rendering based on the image data, generate a second image corresponding to the first image, and output and display the second image through an interactive interface. The image detection module is used to extract features from the second image to obtain a second feature vector, and compare the first feature vector with the second feature vector to determine whether the second image displayed in the output is incorrect; wherein, the second feature vector includes a feature vector obtained by extracting the color features of the second image.
10. An image detection device, characterized in that, include: The request receiving module is used to obtain image request information for the first image from the client, wherein the image request information includes the client's image display requirements for the first image; The feature extraction module is used to perform image processing on the first image to obtain image data that meets the image display requirements, and to perform feature extraction on the first image to obtain a first feature vector; wherein, the first feature vector includes a feature vector obtained by extracting the color features of the first image. The data sending module is used to send image data corresponding to the first image and meeting the image display requirements, as well as the first feature vector, to the client, so that the client performs visualization rendering based on the image data, generates a second image corresponding to the first image, and outputs and displays the second image through the client's interactive interface. Then, the second image is subjected to feature extraction to obtain a second feature vector, and the first feature vector is compared with the second feature vector to determine whether there is an error in outputting and displaying the second image; wherein, the second feature vector includes a feature vector obtained by feature extraction of the color features of the second image.
11. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor implements the method as described in any one of claims 1-8 by executing the executable instructions.
12. A computer-readable storage medium, characterized in that, It stores computer instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Method and apparatus for providing a session status indicator
US8954876B1