Image validity verification method and device and electronic equipment

By performing light and dark pattern recognition and binary processing based on the outline parameters of the highlighted area of ​​the image, combined with the preset detection model verification, the problem of low efficiency and accuracy in image verification is solved, and the automation and high-accuracy image effectiveness is achieved verify.

CN119251320APending Publication Date: 2025-01-03BEIJING SIMING QICHUANG TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411488527.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

Existing image validation methods have problems with low verification efficiency and low accuracy, especially when verifying posters shared on Moments in Internet fission marketing activities, the manual review time is long and the machine review passes image feature matching to verify accuracy. Insufficient sex.

Method used

By determining the light and dark mode according to the highlighted area contour parameters of the image to be detected, performing grayscale binarization and segmentation processing, screenshots of candidate key image elements are obtained, and detection is performed using preset detection models and validity thresholds to automatically verify the image's Validity.

Benefits of technology

The efficiency and accuracy of image verification are improved, and the entire process does not require manual participation. The verification accuracy is further improved through the detection of preset detection models and validity thresholds, solving the problem of low verification efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251320A_ABST
    Figure CN119251320A_ABST
Patent Text Reader

Abstract

The invention provides an image validity verification method and device and electronic equipment, and relates to the technical field of image processing, and the method comprises the steps: determining a light and shade mode corresponding to a to-be-detected image according to a first contour parameter corresponding to a highlight region in the to-be-detected image, the light and shade mode being used for representing the depth of a background color in the to-be-detected image; performing binarization and segmentation processing on the grey-scale map corresponding to the to-be-detected image to obtain element screenshots corresponding to candidate key image elements in the to-be-detected image; detecting the element screenshots by using a preset detection model to determine element detection results corresponding to the candidate key image elements; and comparing the element detection result with a validity threshold, and determining whether the to-be-detected image passes validity verification according to a comparison result. By adopting the image validity verification method and device and the electronic equipment, the problems of low verification efficiency and verification accuracy in the image validity verification process are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image validity verification method, device and electronic equipment. Background Art

[0002] With the rapid development of Internet technology, more and more companies are conducting fission marketing activities through the Internet, for example, requiring users to share specific posters to Moments to conduct fission marketing activities such as sharing rewards. In order to ensure the authenticity and effectiveness of user sharing behavior, it is necessary to verify the posters shared to Moments. At present, image validity verification methods usually include manual review and machine review.

[0003] However, the manual review method has the problems of long verification time and low verification efficiency; and the existing machine review method verifies the validity of the screenshot through image feature matching, which has the problem of low verification accuracy. Summary of the invention

[0004] In view of this, the purpose of the present application is to provide an image validity verification method, device and electronic device to solve the problem of low verification efficiency and verification accuracy in the existing image validity verification process.

[0005] In a first aspect, an embodiment of the present application provides an image validity verification method, comprising:

[0006] Determine the light and dark mode corresponding to the image to be detected according to the first contour parameter corresponding to the highlight area in the image to be detected, where the light and dark mode is used to characterize the depth of the background color in the image to be detected;

[0007] According to the light and dark mode, the grayscale image corresponding to the image to be detected is binarized and segmented to obtain the element screenshot corresponding to the candidate key image element in the image to be detected;

[0008] The element screenshots are detected using a preset detection model to determine the element detection results corresponding to the candidate key image elements. The element detection results are used to characterize whether each element screenshot is valid and the credibility of the element detection results;

[0009] The feature detection result is compared with the validity threshold, and whether the image to be detected passes the validity verification is determined based on the comparison result.

[0010] Optionally, element screenshots corresponding to candidate key image elements of different element types are obtained in the following manner: determine a binarization threshold corresponding to the light and dark mode, and use the binarization threshold to binarize the grayscale image to obtain a binarization matrix; vertically and horizontally segment the binarization matrix to obtain an element bounding box corresponding to each candidate key image element; for each candidate key image element, determine the element type of the candidate key image element based on the second contour parameter of the element bounding box corresponding to the candidate key image element; and take a screenshot of the area corresponding to the element bounding box in the image to be detected to obtain element screenshots of the candidate key image elements under each element type.

[0011] Optionally, the binarized matrix is ​​split vertically and horizontally respectively, including: performing horizontal axis projection on the binarized matrix to select a first candidate coordinate pair that meets a preset height condition through vertical segmentation; performing vertical axis projection on the first candidate coordinate pair to select a second candidate coordinate pair that meets a preset width condition through horizontal segmentation; and determining an element bounding box based on the first candidate coordinate pair and the second candidate coordinate pair.

[0012] Optionally, the second contour parameters include second region contour area and size parameters, and determining the element type of the candidate key image element based on the second contour parameters of the element bounding box corresponding to the candidate key image element, including: determining the element type of the candidate key image element based on the second region contour area and size parameters.

[0013] Optionally, the first contour parameter includes a first region contour area, and the light and dark mode corresponding to the image to be detected is determined according to the first contour parameter corresponding to the highlight area in the image to be detected, including: using a preset color threshold to create a mask image representing the highlight area, and determining the first region contour area corresponding to the mask image; determining the light and dark mode corresponding to the image to be detected according to the first region contour area and the total contour area of ​​the image to be detected.

[0014] Optionally, determining the light and dark mode corresponding to the image to be detected based on the contour area of ​​the first region and the total contour area of ​​the image to be detected includes: determining the ratio of the contour area of ​​the first region to the total contour area, and determining the light and dark mode corresponding to the image to be detected based on the ratio.

[0015] Optionally, the element screenshots are detected using a preset detection model to determine the element detection results corresponding to the candidate key image elements, including: inputting the element screenshot corresponding to each candidate key image element into the target preset detection model corresponding to the candidate key image element to determine the element detection results corresponding to the candidate key image element.

[0016] Optionally, the method further includes: determining the confidence distribution corresponding to the candidate key image elements according to business rules and historical image detection data; and determining a validity threshold for validity verification according to the confidence distribution.

[0017] In a second aspect, an embodiment of the present application further provides an image validity verification device, the device comprising:

[0018] A light and dark mode determination module is used to determine the light and dark mode corresponding to the image to be detected according to the first contour parameter corresponding to the highlight area in the image to be detected, and the light and dark mode is used to characterize the depth of the background color in the image to be detected;

[0019] The feature screenshot module is used to binarize and segment the grayscale image corresponding to the image to be detected according to the light and dark mode, so as to obtain the feature screenshots corresponding to the candidate key image elements of different feature types in the image to be detected. The feature detection result is used to indicate whether each feature screenshot is valid and the credibility of the feature detection result;

[0020] A screenshot detection module is used to detect the element screenshot using a preset detection model to determine the element detection results corresponding to the candidate key image elements;

[0021] The validity verification module is used to compare the feature detection result with the validity threshold, and determine whether the image to be detected passes the validity verification based on the comparison result.

[0022] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the image validity verification method as described above are performed.

[0023] The embodiments of the present application bring the following beneficial effects:

[0024] An image validity verification method, device and electronic device provided in the embodiments of the present application can automatically binarize and segment the image to be detected in different light and dark modes according to the contour parameters of the highlight area to obtain feature screenshots under different feature types, and then use a preset detection model and a validity threshold to detect the feature screenshots to determine the image verification result. The entire verification process does not require human participation, and the verification accuracy is further improved by detecting together with the preset detection model and the validity threshold. Compared with the image validity verification method in the prior art, the problem of low verification efficiency and low verification accuracy in the validity verification process is solved.

[0025] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1 A flowchart of an image validity verification method provided by an embodiment of the present application is shown;

[0028] Figure 2 A flow chart of the element screenshot method provided in an embodiment of the present application is shown;

[0029] Figure 3 A schematic diagram of vertically splitting an image provided by an embodiment of the present application is shown;

[0030] Figure 4 A schematic diagram showing the structure of an image validity verification device provided in an embodiment of the present application is shown;

[0031] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0032] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.

[0033] It is worth noting that before this application was filed, with the rapid development of Internet technology, more and more companies were conducting fission marketing activities through the Internet. For example, companies required users to share specific posters to WeChat Moments to conduct fission marketing activities such as sharing gifts. In order to ensure the authenticity and effectiveness of user sharing behavior, it is necessary to verify the posters shared to Moments. At present, image validity verification methods usually include manual review and machine review. However, the manual review method has the problems of long verification time and low verification efficiency; and the existing machine review method verifies the validity of the screenshot through image feature matching, which has the problem of low verification accuracy.

[0034] Based on this, an embodiment of the present application provides an image validity verification method to improve the efficiency and accuracy of image validity verification.

[0035] See also Figure 1 , Figure 1 This is a flow chart of an image validity verification method provided by an embodiment of the present application. Figure 1 As shown, the image validity verification method provided by the embodiment of the present application includes:

[0036] Step S101, determining a light and dark mode corresponding to the image to be detected according to a first contour parameter corresponding to a highlight area in the image to be detected;

[0037] Step S102, binarizing and segmenting the grayscale image corresponding to the image to be detected according to the light and dark mode, so as to obtain an element screenshot corresponding to the candidate key image element in the image to be detected;

[0038] Step S103, using a preset detection model to detect the element screenshot to determine the element detection result corresponding to the candidate key image element;

[0039] Step S104, comparing the element detection result with the validity threshold, and determining whether the image to be detected passes the validity verification according to the comparison result.

[0040] Through the above steps, the present application can automatically binarize and segment the images to be detected in different light and dark modes according to the contour parameters of the highlighted area to obtain feature screenshots under different feature types, and then use the preset detection model and validity threshold to detect the feature screenshots to determine the image verification result. The entire verification process does not require human participation, and the detection through the preset detection model and validity threshold further improves the verification accuracy, solving the problems of low verification efficiency and verification accuracy in the validity verification process.

[0041] Below Figure 1 Each step is described in detail.

[0042] In step S101, a light and dark mode corresponding to the image to be detected is determined according to a first contour parameter corresponding to a highlight area in the image to be detected.

[0043] Here, the image to be detected may refer to an object of image validity verification, for example, the image to be detected may be a screenshot of a mobile phone.

[0044] The first contour parameter may refer to a contour parameter of a highlight region. The first contour parameter includes a first region contour area corresponding to the highlight region. The first region contour area may refer to a contour area of ​​the highlight region in the image to be detected.

[0045] The light and dark mode may refer to an interface display mode set in an application on a terminal device. The light and dark mode is used to represent the lightness or darkness of the background color in the image to be detected.

[0046] For example, the terminal device may be a smartphone, a tablet computer or a desktop computer. When the terminal device is a smartphone and the application is set to WeChat, different light and dark modes may refer to whether the dark mode of WeChat is turned on. If the dark mode is turned on, the light and dark mode is the dark mode; if the dark mode is not turned on, the light and dark mode is the bright mode.

[0047] In the embodiment of the present application, taking the marketing activity of sharing gifts as an example, the user can send the poster corresponding to the marketing activity to WeChat Moments, intercept and upload the mobile phone screenshot of WeChat Moments with the poster, and the mobile phone screenshot is the image to be detected. After obtaining the image to be detected, first determine whether the image to be detected is repeated with the image in the existing database according to the underlying image encoding corresponding to the image to be detected. If it is repeated, it is determined that the image to be detected is invalid. If it is not repeated, continue with the following determination step.

[0048] In the case where the image is not repeated, it is necessary to determine the light and dark mode corresponding to the image to be detected. At this time, the image to be detected is first converted from the RGB color space to the HSV color space, and then a mask image representing the highlight area is created using a preset color threshold, and the mask image is morphologically processed to remove noise. Then, the contour area of ​​the first region corresponding to the mask image after noise removal is determined. Among them, the preset color threshold is a set value, and those skilled in the art can determine the specific value of the preset color threshold according to actual conditions, and this application is not limited here. In addition, the created mask image value contains pixels with higher brightness in the image to be detected.

[0049] After obtaining the contour area of ​​the first region, the light and dark mode corresponding to the image to be detected can be determined according to the contour area of ​​the first region and the total contour area of ​​the image to be detected. Specifically, the total contour area of ​​the image to be detected can be calculated first, and then the ratio of the contour area of ​​the first region to the total contour area can be determined, and then the light and dark mode corresponding to the image to be detected can be determined according to the ratio.

[0050] In the above example, the image to be detected is a screenshot of WeChat Moments. At this time, the total contour area does not include the area corresponding to the fixed display content of the mobile phone. For example, the total area does not include the area where the time and the remaining battery percentage are displayed on the mobile phone screen. If the ratio is greater than the preset ratio threshold, the image to be detected is determined to be in bright mode; if the ratio is less than or equal to the preset ratio threshold, the image to be detected is determined to be in dim mode.

[0051] In step S102, the grayscale image corresponding to the image to be detected is binarized and segmented according to the light and dark mode to obtain an element screenshot corresponding to the candidate key image element in the image to be detected.

[0052] Here, the binarization and segmentation processing includes a binarization processing and a segmentation processing.

[0053] The candidate key image elements may refer to important image elements in the image to be detected. For example, the candidate key image elements may be posters, icons, or recommendations. The posters refer to posters of marketing activities; the icons may refer to icons provided by the platform that publishes the posters, such as a like icon; and the recommendations may refer to sentences written by users on the platform that publishes the posters.

[0054] The element screenshot may refer to a screenshot corresponding to a candidate key image element. For example, the element screenshot may be a poster screenshot or an icon screenshot of a like icon.

[0055] Refer to the following Figure 2 Let's introduce the process of obtaining feature screenshots.

[0056] Figure 2 A flowchart of the element screenshot method provided in an embodiment of the present application is shown. Figure 2 As shown, the element screenshot method includes:

[0057] Step S201 , determining a binarization threshold corresponding to the dark mode, and using the binarization threshold to perform binarization processing on the grayscale image to obtain a binarization matrix.

[0058] Here, the binarization thresholds corresponding to different light and dark modes can be determined first, and then the grayscale image corresponding to the image to be detected can be binarized using the binarization thresholds to obtain a binarization matrix. The binarization thresholds of different light and dark modes can be determined based on experience.

[0059] If the light and dark mode is dim mode, the selected binarization threshold is 100. If the pixel value of the pixel in the grayscale image is greater than 100, the grayscale value of the pixel in the binarization matrix is ​​set to 0 (black), that is, the published content is set to black. If the pixel value of the pixel in the grayscale image is less than or equal to 100, the grayscale value of the pixel in the binarization matrix is ​​set to 255 (white), that is, the background is set to white.

[0060] If the light and dark mode is bright mode, the selected binarization threshold is 200. If the pixel value of the pixel in the grayscale image is greater than 200, the grayscale value of the pixel in the binarization matrix is ​​set to 255 (white), that is, the background is set to white. If the pixel value of the pixel in the grayscale image is less than or equal to 200, the grayscale value of the pixel in the binarization matrix is ​​set to 0 (black), that is, the published content is set to black.

[0061] In this way, in different light and dark modes, the grayscale value of the content posted by the user can be set to black, and the grayscale value of the background content can be set to white.

[0062] Step S202 , vertically and horizontally segmenting the binary matrix to obtain an element bounding box corresponding to each candidate key image element.

[0063] Specifically, the binary matrix can be projected horizontally, that is, the two-dimensional image corresponding to the binary matrix is ​​projected on the x-axis. The horizontal projection process is called vertical segmentation or vertical projection. The first candidate coordinate pair that meets the preset width condition is selected by vertical segmentation. For example, the elements of each row in the binary matrix are circulated, and the pixel value of each column is judged in turn whether it is 0 (black pixel point), and the number of all black pixels in the row is counted. Assuming that there are M black pixels in a row, the row is set to black from the first column to the Mth column, and so on. The columns that need to be set to black in each row can be determined, thereby obtaining a horizontal projection image. After the horizontal projection is performed, multiple first coordinates can be obtained in the horizontal projection image. The first coordinates are the coordinates of the black pixel points in the horizontal projection image. Each two first coordinates in these first coordinates form a group of first coordinate pairs. The coordinate pairs in which the horizontal distance between the two first coordinates in these first coordinate pairs is greater than the width ratio threshold are determined as the first candidate coordinate pairs.

[0064] The horizontal distance ratio may refer to the ratio of the horizontal distance between the two coordinates to the total horizontal distance corresponding to the vertical segmentation of the binary matrix. If the horizontal distance ratio is greater than the width ratio threshold, it is determined that the first coordinate pair meets the preset width condition; if the horizontal distance ratio is less than or equal to the width ratio threshold, it is determined that the first coordinate pair does not meet the preset width condition.

[0065] Refer to the following Figure 3Let's introduce the selection process of the first candidate coordinate pair.

[0066] Figure 3 A schematic diagram of vertically splitting an image provided by an embodiment of the present application is shown in FIG. Figure 3 As shown, the distance S1 between the coordinate point 301 and the coordinate point 302 is the horizontal distance between the two first coordinates, and the horizontal distance ratio is: the ratio of the distance S1 to the total length S2, and the total length S2 is Figure 3 If the horizontal distance accounts for more than 5% of the total width, the first coordinate pair is determined to be a first candidate coordinate pair that meets the preset width condition.

[0067] Then, the first candidate coordinate pair is projected on the vertical axis, that is, the two-dimensional image corresponding to the binarized matrix is ​​projected on the y-axis. The vertical axis projection process is called horizontal segmentation or horizontal projection. The second candidate coordinate pair that meets the preset height condition is selected through horizontal segmentation, for example: the elements of each column in the binarized matrix are circulated, and the pixel value of each row is judged in turn whether it is 0 (black pixel point), and the number of all black pixels in the column is counted. Assuming that there are N black pixels in a column, the column is set to black from the first row to the Nth row, and so on. The rows that need to be set to black in each column can be determined, thereby obtaining a vertical projection image. After the vertical axis projection is performed, multiple second coordinates can be obtained in the vertical projection image. The second coordinates are the coordinates of the black pixel points in the vertical projection image. Each two second coordinates in these second coordinates form a group of second coordinate pairs. The coordinate pairs in which the vertical distance between the two second coordinates in these second coordinate pairs is greater than the height ratio threshold are determined as the second candidate coordinate pairs. The purpose of horizontal segmentation is to cut out the area corresponding to the vertical segmentation, and the candidate coordinate pairs are obtained in a similar way.

[0068] The vertical distance ratio may refer to the ratio of the vertical distance between the two coordinates to the total vertical distance corresponding to the binary matrix. If the vertical distance ratio is greater than the height ratio threshold, it is determined that the second coordinate pair meets the preset height condition; if the vertical distance ratio is less than or equal to the height ratio threshold, it is determined that the second coordinate pair does not meet the preset height condition.

[0069] Finally, the element bounding box is determined according to the first candidate coordinate pair and the second candidate coordinate pair. Here, two coordinates in the image to be detected can be determined according to the first candidate coordinate pair, and another two coordinates in the image to be detected can be determined according to the second candidate coordinate pair. The element bounding box can be determined by these four coordinates.

[0070] Step S203 : for each candidate key image element, determine the element type of the candidate key image element according to the second contour parameter of the element bounding box corresponding to the candidate key image element.

[0071] The second contour parameters include the second region contour area and size parameters. Specifically, the element type of the candidate key image element can be determined based on the second region contour area and size parameters. In the above example, the element types include poster elements, icon elements, and recommendation elements. The size of the second region contour area corresponding to each element type is different, and the size parameters corresponding to each element type are also different. For example: the second region contour area corresponding to the poster is the largest, the second region contour area corresponding to the recommendation is the second, and the second region contour area corresponding to the icon is the smallest. The length and width of the poster are slightly different, the length and width of the icon are basically the same, and the length and width of the recommendation are quite different. The corresponding aspect ratio range can be set for each element type.

[0072] In one example, the element type of each candidate key image element can be divided according to the size of the second region contour area, that is, the candidate key image elements belonging to the same contour area range are divided into the same element type, and the specific element type is determined according to the size of the contour area range, for example: the candidate key image elements belonging to the same contour area range [50,100] are all determined as posters. Then, the actual aspect ratio of each candidate key image element is compared with the aspect ratio range of the element type corresponding to the determined candidate key image element. If the actual aspect ratio of the candidate key image element is within the aspect ratio range, it is determined that the element type of the candidate key image element is correctly selected; if the actual aspect ratio of the candidate key image element is not within the aspect ratio range, it is determined that the element type of the candidate key image element is incorrectly selected, and the second contour parameter is adjusted to re-determine the element type of the candidate key image element.

[0073] In another example, the element type of each candidate key image element can be divided according to the ratio of the second region contour area to the total contour area of ​​the image to be detected, that is, the candidate key image elements belonging to the same contour area ratio range are divided into the same element type, and the specific element type is determined according to the size of the contour area ratio range, for example: the candidate key image elements belonging to the same contour area ratio range of [20%, 25%] are all determined as posters. Then, the actual aspect ratio of the candidate key image element is used to determine whether the element type is correct.

[0074] Step S204 , taking a screenshot of the area corresponding to the bounding box of the element in the image to be detected, so as to obtain an element screenshot of the candidate key image element under each element type.

[0075] After determining the element bounding box and the type of the candidate key image element, a screenshot may be taken of the area indicated by each element bounding box to obtain an element screenshot of each candidate key image element, and the element type corresponding to each element screenshot is known.

[0076] In step S103, the element screenshot is detected using a preset detection model to determine the element detection results corresponding to the candidate key image elements.

[0077] The feature detection results include whether each feature screenshot is valid and the credibility of the feature detection results.

[0078] In the embodiment of the present application, when the element screenshots are obtained by vertical segmentation and horizontal segmentation, it is impossible to determine the specific content of the element screenshots, and it is necessary to classify the element screenshots using a preset detection model. At this time, the element screenshot corresponding to each candidate key image element can be input into the target preset detection model corresponding to the candidate key image element to determine the element detection result corresponding to the candidate key image element.

[0079] Specifically, the poster screenshot can be input into the text recognition model and the target detection model to obtain the poster element detection result, the icon screenshot can be input into the target detection model to obtain the icon element detection result, and the recommendation word screenshot can be input into the text recognition model to obtain the recommendation word element detection result.

[0080] Among them, the text recognition model and the target detection model can be neural network models trained according to business rules and historical image detection data.

[0081] The poster element detection results include the poster text recognition results output by the text recognition model, the confidence of the poster text recognition results, and the poster element candidate boxes and the confidence of the poster elements output by the object detection model. The poster text recognition results include the poster text passed verification and the poster text failed verification. The icon element detection results include the icon element candidate boxes and the confidence of the icon element. The recommendation word element detection results include the recommendation word element candidate boxes and the confidence of the recommendation word element.

[0082] Here, the range of the feature candidate box output by the target detection model is smaller than the range of the feature screenshot. If the target detection model is used directly to detect the candidate key image features in the feature candidate box, the detection effect will be poor and the detection time will be long due to the small size of the image features. Therefore, image segmentation can be used to obtain feature screenshots, and then the target detection model can be used to further detect the feature screenshots to improve the detection accuracy.

[0083] The element candidate box is used to mark the position of the candidate key image element in the image to be detected, and the element confidence is used to indicate the credibility of the recognition result. For example, the confidence of the poster text recognition result is used to indicate the credibility of the poster text recognition result, the confidence of the icon element is used to indicate the credibility of the icon recognition result, and the confidence of the recommendation element is used to indicate the credibility of the recommendation recognition result.

[0084] Taking icon elements as an example, after multiple icon screenshots are input into the target detection module, the output is the icon element candidate box corresponding to each icon screenshot and the confidence of the icon element. The confidence is used to indicate the credibility that the icon in the icon screenshot is a like icon.

[0085] In step S104, the element detection result is compared with the validity threshold, and it is determined whether the image to be detected passes the validity verification according to the comparison result.

[0086] Before comparing the element detection results with the validity threshold, it is necessary to determine the validity threshold first. Here, the confidence distribution corresponding to the candidate key image elements can be determined based on the business rules and historical image detection data, and then the validity threshold used for validity verification can be determined based on the confidence distribution. Among them, business rules may refer to validity verification rules. For example, business rules may require higher accuracy for validity verification of posters, while lower accuracy for validity verification of icons. At the same time, based on historical image detection data, the confidence distribution of different element types can be statistically analyzed. For example, the confidence of icon elements follows a normal distribution. In this way, based on the confidence distribution corresponding to different element types, the validity threshold that meets the requirements of the business rules can be selected from the confidence distribution data.

[0087] Then, the confidence in the feature detection result is compared with the validity threshold. If the confidence in the feature detection result corresponding to each feature type is greater than or equal to the validity threshold, it is determined that the image to be detected has passed the validity verification; otherwise, if the confidence in the feature detection result corresponding to any feature type is less than the validity threshold, it is determined that the image to be detected has not passed the validity verification.

[0088] Based on the same inventive concept, an image validity verification device corresponding to the image validity verification method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned image validity verification method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0089] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an image validity verification device provided by an embodiment of the present application. Figure 4 As shown in , the image validity verification device 400 includes:

[0090] The light and dark mode determination module 401 is used to determine the light and dark mode corresponding to the image to be detected according to the first contour parameter corresponding to the highlight area in the image to be detected, and the light and dark mode is used to represent the depth of the background color in the image to be detected;

[0091] The element screenshot module 402 is used to perform binarization and segmentation processing on the grayscale image corresponding to the image to be detected according to the light and dark mode, so as to obtain element screenshots corresponding to the candidate key image elements of different element types in the image to be detected. The element detection result is used to indicate whether each element screenshot is valid and the credibility of the element detection result;

[0092] The screenshot detection module 403 is used to detect the element screenshot using a preset detection model to determine the element detection result corresponding to the candidate key image element;

[0093] The validity verification module 404 is used to compare the element detection result with the validity threshold, and determine whether the image to be detected passes the validity verification according to the comparison result.

[0094] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .

[0095] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the above-mentioned Figure 1 The specific implementation of the steps of the image validity verification method in the method embodiment shown can be found in the method embodiment, and will not be repeated here.

[0096] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The specific implementation of the steps of the image validity verification method in the method embodiment shown can be found in the method embodiment, and will not be repeated here.

[0097] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0098] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0099] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0100] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0101] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0102] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for verifying image validity, characterized in that: include: Determine a light and dark mode corresponding to the image to be detected according to a first contour parameter corresponding to a highlight area in the image to be detected, wherein the light and dark mode is used to characterize the depth of the background color in the image to be detected; According to the light and dark mode, binarization and segmentation processing are performed on the grayscale image corresponding to the image to be detected to obtain element screenshots corresponding to candidate key image elements of different element types in the image to be detected; Using a preset detection model to detect the element screenshots to determine the element detection results corresponding to the candidate key image elements, the element detection results are used to characterize whether each element screenshot is valid and the credibility of the element detection results; The element detection result is compared with the validity threshold, and it is determined whether the image to be detected passes the validity verification according to the comparison result.

2. The method according to claim 1, characterized in that Get the feature screenshots corresponding to the candidate key image features of different feature types in the following ways: Determine a binarization threshold corresponding to the light and dark mode, and use the binarization threshold to perform binarization processing on the grayscale image to obtain a binarization matrix; The binary matrix is ​​segmented vertically and horizontally respectively to obtain an element bounding box corresponding to each candidate key image element; For each candidate key image element, determining the element type of the candidate key image element according to the second contour parameter of the element bounding box corresponding to the candidate key image element; A screenshot is taken of the area corresponding to the element bounding box in the image to be detected to obtain an element screenshot of the candidate key image element under each element type.

3. The method according to claim 2, characterized in that The step of vertically segmenting and horizontally segmenting the binary matrix comprises: Performing horizontal axis projection on the binary matrix to select a first candidate coordinate pair that meets a preset height condition through vertical segmentation; Performing vertical axis projection on the first candidate coordinate pair, so as to select a second candidate coordinate pair satisfying a preset width condition through horizontal segmentation; An element bounding box is determined according to the first candidate coordinate pair and the second candidate coordinate pair.

4. The method according to claim 2, characterized in that: The second contour parameter includes a second region contour area and size parameter, and determining the element type of the candidate key image element according to the second contour parameter of the element bounding box corresponding to the candidate key image element includes: The element type of the candidate key image element is determined according to the contour area of ​​the second region and the size parameter.

5. The method according to claim 1, characterized in that The first contour parameter includes a contour area of ​​a first region, and determining the light and dark mode corresponding to the image to be detected according to the first contour parameter corresponding to the highlight region in the image to be detected includes: Creating a mask image representing the highlight area using a preset color threshold, and determining a contour area of ​​the first region corresponding to the mask image; The light and dark mode corresponding to the image to be detected is determined according to the contour area of ​​the first region and the total contour area of ​​the image to be detected.

6. The method according to claim 5, characterized in that The step of determining the light and dark mode corresponding to the image to be detected according to the contour area of ​​the first region and the total contour area of ​​the image to be detected includes: The ratio of the contour area of ​​the first region to the total contour area is determined, and the light and dark mode corresponding to the image to be detected is determined according to the ratio.

7. The method according to claim 1, characterized in that The detecting the element screenshot by using a preset detection model to determine the element detection result corresponding to the candidate key image element includes: The element screenshot corresponding to each candidate key image element is input into the target preset detection model corresponding to the candidate key image element to determine the element detection result corresponding to the candidate key image element.

8. The method according to claim 1, characterized in that The method further comprises: Determine the confidence distribution of the candidate key image elements according to business rules and historical image detection data; According to the confidence distribution, a validity threshold for validity verification is determined.

9. An image validity verification device, characterized in that: include: A light and dark mode determination module, used to determine the light and dark mode corresponding to the image to be detected according to the first contour parameter corresponding to the highlight area in the image to be detected, wherein the light and dark mode is used to characterize the depth of the background color in the image to be detected; An element screenshot module is used to perform binarization and segmentation processing on the grayscale image corresponding to the image to be detected according to the light and dark mode, so as to obtain an element screenshot corresponding to the candidate key image element in the image to be detected; A screenshot detection module, used to detect the element screenshots using a preset detection model to determine the element detection results corresponding to the candidate key image elements, wherein the element detection results are used to characterize whether each element screenshot is valid and the credibility of the element detection results; The validity verification module is used to compare the element detection result with the validity threshold, and determine whether the image to be detected passes the validity verification according to the comparison result.

10. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the image validity verification method as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Method for distinguishing between images obtained by a mobile device camera and images obtained by special applications for creating screenshots

    RU2848148C1