Image detection method, device, storage medium and computer equipment
By performing pixel difference analysis and feature determination on the initial image and target image, combined with image change parameters, automated image detection is realized, solving the problem of inefficient image detection in the prior art, and significantly improving the detection efficiency.
Patent Information
- Application Number
- CN202110260048.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-10
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-03-10
AI Technical Summary
In the prior art, image detection efficiency is low, and manual detection is required, which is inefficient.
By obtaining the initial image and image change parameters, processing the initial image based on these parameters to obtain the target image; then performing pixel difference analysis on the initial image and the target image to obtain the differential image; based on the differential pixel points in the differential image, the target difference region and its regional difference characteristics are determined; finally, the detection result of the target image is determined based on the regional difference characteristics and image change parameters.
An automated image detection process has been realized, which significantly improves image detection efficiency and reduces manual intervention.
Smart Images

Figure CN113706439B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of images, and in particular to an image detection method, device, storage medium and computer equipment. Background Art
[0002] With the development of technology, images can be processed locally in specific scenarios, such as the face-slimming and eye-enlarging processing commonly used in photo-taking software. Since it is a local and small-scale processing, the changes in the processed image are relatively subtle compared to the image before processing. If the processing effect of the processed image is to be tested, most of the time it needs to be done manually.
[0003] During the research and development of the prior art, the inventors of the present application found that the existing image detection method is inefficient. Summary of the invention
[0004] The embodiments of the present application provide an image detection method, apparatus, storage medium and computer equipment, which can effectively improve the efficiency of image detection.
[0005] The present application provides an image detection method, including:
[0006] Get the initial image and image change parameters;
[0007] Processing the initial image based on the image change parameter to obtain a target image;
[0008] Performing pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image;
[0009] Based on a plurality of difference pixels in the difference image, determining a target difference region and a regional difference feature of the target difference region in the difference image;
[0010] A detection result of the target image is determined according to the regional difference feature and the image change parameter.
[0011] Accordingly, the present application provides an image detection device, comprising:
[0012] An acquisition module, used to acquire an initial image and image change parameters;
[0013] A processing module, used for processing the initial image based on the image change parameter to obtain a target image;
[0014] A difference analysis module, used for performing pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image;
[0015] a feature determination module, configured to determine a target difference region and a regional difference feature of the target difference region in the difference image based on a plurality of difference pixels in the difference image;
[0016] The result determination module is used to determine the detection result of the target image according to the regional difference characteristics and the image change parameters.
[0017] In some embodiments, the image detection device further comprises:
[0018] A calculation module, used for performing fusion calculation on all target difference pixels in the target difference area to obtain pixel difference features;
[0019] At this time, the result determination module is specifically used for:
[0020] A detection result of the target image is determined based on the region difference feature, the pixel difference feature and the image change parameter.
[0021] In some embodiments, the result determination module includes an acquisition submodule, a quantification submodule and a determination submodule, wherein:
[0022] An acquisition submodule is used to acquire an image change measurement model;
[0023] A quantization submodule, used to perform difference quantization on the regional difference feature and the pixel difference feature through the image change measurement model to obtain actual change data of the target image;
[0024] The determination submodule is used to determine the detection result of the target image based on the actual change data and the image change parameter.
[0025] In some embodiments, the determination submodule is specifically used for:
[0026] When the difference between the actual change data and the image change parameter is less than a preset threshold, determining that the detection result of the target image is normal;
[0027] When the difference between the actual change data and the image change parameter is greater than a preset threshold, it is determined that the detection result of the target image is an image abnormality.
[0028] In some embodiments, the image change measurement model includes a region measurement sub-model and a pixel measurement sub-model, the actual change data includes region actual change data and pixel actual change data, and the quantization sub-module is specifically used for:
[0029] Quantifying the regional difference features by using the regional measurement sub-model to obtain actual regional change data of the target image;
[0030] The pixel difference feature is quantified by the pixel measurement sub-model to obtain actual pixel change data of the target image.
[0031] In some embodiments, the determination submodule is specifically used for:
[0032] When the difference between the actual change data of the region and the image change parameter is less than a preset first threshold, and the difference between the actual change data of the pixel and the image change parameter is less than a preset second threshold, it is determined that the detection result of the target image is normal.
[0033] In some embodiments, the determination submodule is specifically used for:
[0034] When the difference between the actual change data of the area and the image change parameter is greater than a preset first threshold, determining that the detection result of the target image is an image area abnormality;
[0035] When the difference between the actual pixel change data and the image change parameter is greater than a preset second threshold, it is determined that the detection result of the target image is an image position abnormality.
[0036] In some embodiments, the initial image includes a plurality of initial pixels, the target image includes a plurality of target pixels, and the difference analysis module includes a determination submodule, a calculation submodule and an integration submodule, wherein:
[0037] A determination submodule, configured to determine, based on the position information of each initial pixel point in the initial image and the position information of each target pixel point in the target image, a plurality of groups of pixel pairs having the same position information, wherein the pixel pairs include the initial pixel points and the target pixel points;
[0038] A calculation submodule, used to perform difference calculation on each group of pixel pairs according to the color information of each initial pixel point and the color information of each target pixel point, so as to obtain color difference information of each group of pixel pairs;
[0039] The integration submodule is used to integrate the position information and color difference information of each group of pixel pairs to obtain a difference image.
[0040] In some embodiments, the computing submodule is specifically used for:
[0041] Determine the difference between the color information of the initial pixel and the color information of the target pixel in the pixel pair;
[0042] When the difference information meets a preset condition, determining the color difference information of the pixel pair as first color difference information;
[0043] When the difference information does not meet a preset condition, the color difference information of the pixel pair is determined to be second color difference information.
[0044] In some embodiments, the difference pixel points include position information and color difference information, and the feature determination module is specifically used to:
[0045] When the color difference information of the difference pixel is the target difference information, determining the difference pixel as the target difference pixel;
[0046] According to the position information of all target difference pixels in the difference image, a target difference region in the difference image and a region difference feature of the target difference region are determined.
[0047] In some embodiments, the image detection device further comprises:
[0048] A sample acquisition module, used to acquire an initial sample image and at least two target sample images corresponding to the initial sample image, wherein the target sample images carry sample change parameters relative to the initial sample image;
[0049] A sample difference module, used for performing difference processing on the initial sample image and the at least two target sample images to obtain a sample difference feature of each target sample image;
[0050] The model generation module is used to generate an image change measurement model based on the sample difference characteristics of each target sample image and set sample change parameters.
[0051] Correspondingly, an embodiment of the present application further provides a storage medium, which stores a computer program, and the computer program is suitable for loading by a processor to execute any image detection method provided in the embodiment of the present application.
[0052] Correspondingly, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any one of the image detection methods provided in the embodiment of the present application is implemented.
[0053] The present application can obtain an initial image and image change parameters; process the initial image based on the image change parameters to obtain a target image; perform pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image; based on multiple difference pixels in the difference image, determine the target difference area and the regional difference features of the target difference area in the difference image; determine the detection result of the target image based on the regional difference features and the image change parameters.
[0054] The present application can perform difference calculation on the initial image and the target image to obtain a difference image between the two, as well as a target difference area in the difference image and regional difference features of the target difference area, and then perform detection based on the regional difference features and image change parameters to obtain a detection result of the target image. Compared with the prior art, the present application automatically implements the above process through computer equipment, which can effectively improve image detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0056] Figure 1 is a scene schematic diagram of an image detection system provided in an embodiment of the present application;
[0057] Figure 2 It is a flowchart of the image detection method provided in the embodiment of the present application;
[0058] Figure 3 is another schematic diagram of the process of the image detection method provided in the embodiment of the present application;
[0059] Figure 4 is an image schematic diagram of the image detection method provided in an embodiment of the present application;
[0060] Figure 5 is a schematic diagram of an image region of an image detection method provided in an embodiment of the present application;
[0061] Figure 6 is a schematic diagram of the structure of an image detection device provided in an embodiment of the present application;
[0062] Figure 7 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described in this application are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0064] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0065] Computer Vision (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further perform graphic processing so that computer processing becomes an image that is more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0066] The image detection method of the present application is related to the technology in the field of artificial intelligence. For example, the initial image can be processed by an artificial intelligence model to obtain a target image. For example, the image change processing measurement model can include one trained based on deep learning technology, and so on.
[0067] The image detection method of the present application can be integrated in an image detection system, and the image detection system can be integrated in one or more computer devices, and the computer device can include a terminal or a server, etc., wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart home, a wearable electronic device, a car computer, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and this application is not limited here.
[0068] See also Figure 1The image detection system may include an image detection device, wherein the image detection device can obtain an initial image and an image change parameter; process the initial image based on the image change parameter to obtain a target image; perform pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image; determine a target difference area and regional difference features of the target difference area in the difference image based on multiple difference pixels in the difference image; and determine a detection result of the target image according to the regional difference features and the image change parameter.
[0069] It should be noted that Figure 1 The scene diagram of the image detection system shown is merely an example. The image detection system and scene described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of image detection devices and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.
[0070] In this embodiment, the image detection method is described in detail. The image detection method can be integrated in a terminal or a server, such as Figure 2 As shown, Figure 2 : is a flow chart of an image detection method provided in an embodiment of the present application. The image detection method may include:
[0071] 101. Obtain an initial image and image change parameters.
[0072] The initial image may include an image before processing, and the initial image may be a picture or a video frame captured from a video. For example, the initial image may be a frame image captured from a short video uploaded by a user.
[0073] Among them, the image change parameters may include data based on which the initial image is processed. The image change parameters may include percentages, decimals, integers, etc. The form of the image change parameters can be flexibly determined according to the actual application scenario. The image change parameters may include parameters based on which some elements in the initial image are processed. For example, the image change parameters may be parameters for potato elements in the initial image.
[0074] Specifically, there are many ways to obtain the initial image. It can be obtained by photographing with an image acquisition device, or by receiving user uploads or computer device transmissions. If an image is photographed or received, the image can be directly determined to be the initial image. If a video is photographed or received, the video frame image obtained by intercepting the video can be the initial image.
[0075] The image change parameters may be input by the user, or may be pre-set and stored in a local terminal or server or other computer device, or may be calculated by the computer device based on specific features (such as area, resolution, etc.) of the acquired initial image, etc. For example, the computer device determines the change parameter range of the initial image through an algorithm based on the resolution and color range of the initial image, and displays the change parameter range on the user interface. The user inputs a target change parameter within the change parameter range, so that the computer device acquires the target change parameter.
[0076] For example, picture A (ie, the initial image) is obtained by shooting on a computer device, a parameter acquisition request is sent to the server, and then the image change parameter 1 returned by the server based on the parameter acquisition request is received.
[0077] 102. Process the initial image based on the image change parameter to obtain a target image.
[0078] Among them, the target image may include a processed image. The target image is obtained by processing the initial image. The target image may be obtained by processing the initial image as a whole, or the target image may be obtained by moving, enlarging or reducing elements in the initial image. Therefore, the target change parameter may refer to the distance the element moves, the degree of enlargement or reduction of the element, etc.
[0079] Specifically, processing the initial image according to the image change parameters may include at least one of image enhancement, image segmentation, and image recognition. The processing may also be performed through a trained machine learning model. For example, the initial image and image change parameters are input into a trained change model for processing to obtain a target image.
[0080] For example, input picture A into the image processing model and obtain the processed picture B.
[0081] 103. Perform pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image.
[0082] Among them, the difference image may include an image obtained according to the difference between the initial image and the target image. The difference between the initial image and the target image can be expressed in various forms depending on the application scenarios. Therefore, the display elements of the difference image can exist in various different situations. The display elements can be such as the size of the difference image, the color range of pixels in the difference image, etc. In addition, the display elements of the difference image have no obvious correlation with the size, pixel color range and other information of the initial image and the target image. For example, the difference image and the initial image can have the same size, number of pixels, and pixel color range.
[0083] Specifically, the difference between the two can be obtained through pixel difference analysis, and the pixel difference analysis is targeted at corresponding positions in the initial image and the target image. For example, the initial image and the target image can be partitioned according to the same partitioning principle, and then pixel difference analysis is performed on each group of corresponding areas of the two, and a difference image is obtained based on the analysis results of each group of corresponding areas; for another example, pixel difference analysis can be performed on pixel points belonging to the same pixel position in the initial image and the target image to obtain a difference image.
[0084] Specifically, the pixel difference analysis may include analyzing at least one of the pixel position information, color information, quantity information, etc. For example, the number of pixels in the initial image and the target image that are within a preset color range may be counted respectively, and then the difference between the two may be calculated to obtain the preset pixel information, and finally a difference image may be generated based on the preset pixel information and the difference number.
[0085] For example, a difference analysis is performed on pixels at corresponding positions in images A and B to obtain a difference image C.
[0086] In some embodiments, the initial image includes a plurality of initial pixels, the target image includes a plurality of target pixels, and the step of "performing pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image" may include:
[0087] Based on the position information of each initial pixel point in the initial image and the position information of each target pixel point in the target image, multiple groups of pixel pairs with the same position information are determined, and the pixel pairs include initial pixel points and target pixel points; according to the color information of each initial pixel point and the color information of each target pixel point, a difference calculation is performed on each group of pixel pairs to obtain color difference information of each group of pixel pairs; the position information and color difference information of each group of pixel pairs are integrated to obtain a difference image.
[0088] An image may include multiple pixels, an initial image includes multiple initial pixels, and a target image includes multiple target pixels. Each pixel is located at a specific position in the image and has a specific color. One way to perform pixel difference analysis may be to perform a color difference analysis on pixels located at the same position in the initial image and the target image to obtain a difference image.
[0089] The position information may include the relative position of the pixel in the image. The position information may be represented by coordinates. For example, the position information of the pixel A may be (30, 30).
[0090] In this embodiment, the processing of the initial image does not change the image size, resolution, etc., and the processing mainly changes the relevant information of the elements in the initial image, that is, the initial image and the target image have the same size and contain the same number of pixels. Then, based on the position information of each initial pixel in the initial image and the position information of each target pixel in the target image, multiple groups of pixel pairs can be determined, and each group of pixel pairs includes an initial pixel and a target pixel with the same position information.
[0091] The color information may be represented by different color modes, such as indexed color, RGB mode, HSB mode, etc. For example, if represented by RGB mode, the color information of pixel A may be (10, 20, 5).
[0092] Specifically, the difference calculation can be performed on each group of pixel pairs in turn, and the color difference information can be obtained based on the color information of the initial pixel point in the pixel pair and the color information of the target pixel point. For example, the variance or standard deviation of the color information of the two can be calculated.
[0093] The color difference information may represent the difference in color between pixel pairs. The color difference information may be similar to the color information. For example, the color difference information may be represented by the same color model as the color information. There may be at least two types of color difference information obtained after the difference calculation.
[0094] Each pixel pair can correspond to position information (i.e., the position information of the initial pixel or target pixel contained in the pixel pair) and color difference information. By integrating this information, a difference image can be obtained. A pixel point includes position information and color information, so the obtained color difference information can be set as color information, and then combined with the position information corresponding to the pixel, a difference pixel point can be determined. By performing the above operation on all pixel pairs, a number of difference pixels can be obtained, and these difference pixels can constitute a difference image.
[0095] For example, picture A includes multiple initial pixel points, and picture B includes multiple target pixel points. Based on the position information of each initial pixel point in picture A and the position information of each target pixel point in picture B, multiple groups of pixel pairs with the same position information are determined, and each group of pixel pairs includes an initial pixel point and a target pixel point; according to the color information of the initial pixel points and the color information of the target pixel points in a group of pixel pairs, the group of pixel pairs is calculated to obtain the color difference information of the group of pixels, and the color difference information of each group of pixel pairs is obtained according to the above method; the position information and color difference information of each group of pixel pairs are integrated to obtain the difference image C.
[0096] In some embodiments, the step of “calculating the difference of each pixel pair according to the color information of each initial pixel point and the color information of each target pixel point to obtain the color difference information of each pixel pair” may include:
[0097] Determine the difference information between the color information of the initial pixel point in the pixel pair and the color information of the target pixel point; when the difference information meets the preset condition, determine the color difference information of the pixel pair as the first color difference information; when the difference information does not meet the preset condition, determine the color difference information of the pixel pair as the second color difference information.
[0098] In this embodiment, the color information can be represented as an array containing at least two elements, the color information of the initial pixel point is the initial color array, the color information of the target pixel point is the target color data, and the difference information may include the difference between the initial color array and the target color array. For example, the absolute values of the difference between the array elements with the same position in the array can be calculated separately to obtain the difference information.
[0099] The preset condition can be flexibly set according to actual conditions, for example, the preset condition can be that the difference information is the same as the set data, or the difference information is within a set value range, etc. Then, when the difference information meets the preset condition, the color difference information is determined to be the first color difference information, and when the difference information does not meet the preset condition, the color difference information is determined to be the second color difference information.
[0100] According to the color information of each initial pixel and the color information of each target pixel, the difference of each pixel pair is calculated to obtain the color difference information of each pixel pair, which can be calculated by the algorithm. For example, the pixel pair includes the initial pixel and the target pixel, and the color information of the initial pixel can be expressed as The color information of the target pixel can be expressed as The color difference information can be (R x,y ,G x ,y ,B x,y ), the algorithm for determining the color difference information of a pixel pair can be:
[0101]
[0102] 104. Determine a target difference region and a regional difference feature of the target difference region in the difference image based on a plurality of difference pixels in the difference image.
[0103] Among them, the target difference area can be a part of the difference image, the target difference area is the area in the difference image that can show the difference between the initial image and the target image, and the regional difference feature may include the geometric features of the target difference area, for example, the regional difference feature may be the area, position, and shape of the target difference area.
[0104] There are multiple ways to determine the target difference region in the difference image, for example, a target difference region is randomly obtained in the difference image through a random algorithm. There are also multiple ways to obtain the regional difference feature, for example, the geometric data such as the side length and radius of the target difference region can be measured, and then the regional difference feature is calculated based on the geometric data.
[0105] For example, the difference image C may be input into an intelligent model in the field of computer vision to obtain the output target difference region 1 and the relative position information of the target difference region 1 in the difference image C (ie, regional difference features).
[0106] In some embodiments, the difference pixel point includes position information and color difference information, and the step of “determining the target difference area and the regional difference feature of the target difference area in the difference image based on the plurality of difference pixel points in the difference image” may include:
[0107] When the color difference information of the difference pixel is the target difference information, the difference pixel is determined to be the target difference pixel; and according to the position information of all the target difference pixels in the difference image, the target difference area in the difference image and the area difference feature of the target difference area are determined.
[0108] In this embodiment, the difference pixels may be screened to obtain target difference pixels, and the target difference region and its region difference features may be determined according to the positions of all target difference pixels in the difference image.
[0109] Specifically, the difference pixel points may be screened according to the color difference information, and the difference pixel points whose color difference information is the target color difference information may be determined as the target difference pixel points, wherein the target color difference information may be predetermined and may be at least one of all the color difference information. For example, when the difference color information includes the first difference color information and the second difference color information, the target difference information may be the first difference color information. For another example, the target color difference information may be A1 and A3, and the difference pixel points whose color difference information is A1 or A3 may be determined as the target difference pixel points.
[0110] Among them, the area that can include all target difference pixels can be determined as the target difference area. The shape of the target difference area can be, for example, a rectangle, a circle, or an irregular polygon. The target difference area can include only all target difference pixels, or all target difference pixels and some non-target difference pixels. For example, in order to obtain a circular target difference area, the target difference area must include all target difference pixels and some non-target difference pixels in order to obtain a polygonal area formed by all target difference pixels.
[0111] For example, when the color difference information of the difference pixel is difference information 1, the difference pixel is determined to be a target difference pixel; according to the position information of all target difference pixels in the difference image C, a target difference region 1 in the difference image and a regional difference feature 1 of the target difference region are determined.
[0112] 105. Determine the detection result of the target image according to the regional difference characteristics and the image change parameters.
[0113] Among them, the detection results may include the ability to determine whether the target image is the image after the initial image is changed based on the image change parameters. If so, the processing process of the initial image is effective and correct, and the desired target image is obtained. Otherwise, there is an abnormality in the processing process of the initial image, and the actual target image is inconsistent with the desired image. When the difference between the initial image and the desired image is small, the solution of the present application is used to detect whether the actual target image is the desired image. Compared with manual methods, the present application can effectively improve image detection efficiency.
[0114] Specifically, there are multiple ways to determine the detection result according to the regional difference feature and the image change parameter. For example, the regional difference feature and the image change parameter can be fused and calculated to determine the detection result.
[0115] For example, according to the image change parameter 1 and the relative position information of the target difference area 1 in the difference image C, the detection result 1 of the image B is determined.
[0116] In some embodiments, the image detection method further comprises:
[0117] All target difference pixels in the target difference area are fused and calculated to obtain pixel difference features;
[0118] The step of “determining the detection result of the target image according to the regional difference feature and the image change parameter” may include:
[0119] The detection result of the target image is determined based on the regional difference features, pixel difference features and image change parameters.
[0120] In order to further extract information from the difference image and obtain more accurate detection results, all target difference pixels in the target difference area can be fused to obtain pixel difference features at the pixel level, and then the detection result of the target image can be obtained based on the pixel difference features and the area difference features.
[0121] Among them, the pixel difference feature may include a feature obtained based on all target difference pixels, may include a position feature obtained based on the position information of all target difference pixels, may include a color feature obtained based on the color information of all target difference pixels, may include an information feature obtained based on the position information and color information of all target difference pixels, and so on.
[0122] Specifically, the fusion calculation can be at least one of the calculation methods such as averaging, weighting, variance / standard deviation, normalization / normal distribution, etc. For example, the color standard deviation of the color information of all target pixels can be calculated, and the position standard deviation of the position information of all target pixels can be calculated, and then the color standard deviation and the position standard deviation can be weighted and summed to obtain the pixel difference feature.
[0123] For example, there may be N target difference pixels in the target difference area (N is a positive integer), and the coordinates of the nth target difference pixel may be (x n ,y n ), the pixel difference feature may include a first average position and the second mean position The calculation formula can be:
[0124]
[0125] There are many ways to determine the detection result based on the regional difference feature, the pixel difference feature and the image change parameter. For example, the regional difference feature, the pixel difference feature and the image change parameter can be fused and calculated to obtain the detection result of the target image.
[0126] For example, the position coordinates of all target difference pixels in target difference region 1 may be fused and calculated to obtain pixel difference information 1, and the regional difference feature 1 and the pixel difference feature 1 may be weighted averaged, and the obtained result may be compared with the image change parameter to obtain the detection result of picture 2.
[0127] In some embodiments, the step of “determining the detection result of the target image based on the regional difference feature, the pixel difference feature and the image change parameter” may include:
[0128] Acquire an image change measurement model; quantify the difference between regional difference features and pixel difference features through the image change measurement model to obtain actual change data of the target image; and determine the detection result of the target image based on the actual change data and the image change parameters.
[0129] Among them, the image change measurement model can be used to quantify the degree of change of the target image relative to the initial image. The image change measurement model can include at least one. If it includes multiple, the multi-dimensional (dimensions such as position, color, etc.) changes of the target image relative to the initial image can be quantified separately. It can include directly obtaining an existing image change measurement model, or building an initial model and training the initial model, and finally obtaining a trained image change measurement model, and so on.
[0130] The actual change data may include quantitative data of the part of the target image that has changed relative to the initial image, and the image change parameter is the data based on which the initial image is processed, and is the quantitative data of the part of the target image that has changed relative to the initial image in theory. Therefore, the target image may be detected based on the actual change data and the image change parameter to determine the detection result. For example, if the actual change data is the same as the image change parameter, the detection result is determined to be that the target image is normal, and if the actual change data is different from the image change parameter, the detection result is determined to be that the target image is abnormal.
[0131] For example, a model M may be obtained, pixel difference information 1 and regional difference feature 1 may be input into the model M for difference quantification, and actual change data 1 of image B may be obtained. Detection may be performed based on the actual change data 1 and the image change parameter 1 to obtain the detection result of image B.
[0132] In some embodiments, the step of “determining the detection result of the target image based on the actual change data and the image change parameter” may include:
[0133] When the difference between the actual change data and the image change parameter is less than the preset threshold, the detection result of the target image is determined to be normal; when the difference between the actual change data and the image change parameter is greater than the preset threshold, the detection result of the target image is determined to be abnormal.
[0134] In practical applications, the difference between the actual change data and the image change parameters can be calculated. If the difference is within an acceptable range, it can be considered that the target image has passed the detection. At this time, it can be understood that the gap between the target image and the desired image is small and can be ignored.
[0135] Specifically, the actual change data may be smaller than the image change parameter or may be larger than the image change parameter, so the absolute value difference between the two can be calculated, and the degree of difference between the actual change data and the image change parameter can be measured according to the size of the absolute value difference.
[0136] Among them, a normal image means that the target image detection passes, that is, the target image meets the requirements of the image obtained by processing the initial image based on the image change parameters; an abnormal image means that the target image detection fails, that is, the target image does not meet the requirements of the image obtained by processing the initial image based on the image change parameters.
[0137] For example, when the difference between the actual change data 1 and the image change parameter 1 is less than the preset threshold 1, the detection result of picture B is determined to be a normal image; when the difference between the actual change data 1 and the image change parameter 1 is greater than the preset threshold 1, the detection result of picture B is determined to be an abnormal image.
[0138] In some embodiments, the image change measurement model includes a region measurement sub-model and a pixel measurement sub-model, and the actual change data includes region actual change data and pixel actual change data.
[0139] The step of “quantifying the difference between the regional difference features and the pixel difference features through the image change measurement model to obtain the actual change data of the target image” may include:
[0140] The regional difference features are quantified by the regional measurement sub-model to obtain the actual regional change data of the target image; the pixel difference features are quantified by the pixel measurement sub-model to obtain the actual pixel change data of the target image.
[0141] Specifically, the two sub-models can be used to quantify the regional difference features and the pixel difference features respectively, and obtain the regional actual change data and the pixel actual change data of the target image respectively, wherein the regional measurement sub-model is used to quantify the degree of regional change of the target image relative to the initial image, and the pixel measurement sub-model is used to quantify the degree of pixel change of the target image relative to the initial image. The regional actual change data can be the quantified data of the regional part of the target image that has changed relative to the initial image, and the pixel actual change data can be the quantified data of the pixel part of the target image that has changed relative to the initial image.
[0142] For example, model M includes sub-model M1 and sub-model M2. The pixel difference information 1 is input into sub-model M1 to obtain pixel actual change data 1, and the region difference information 1 is input into sub-model M2 to obtain region actual change data 1.
[0143] In some embodiments, the step of “determining the detection result of the target image based on the actual change data and the image change parameter” may include:
[0144] When the difference between the actual change data of the region and the image change parameter is less than a preset first threshold, and the difference between the actual change data of the pixel and the image change parameter is less than a preset second threshold, the detection result of the target image is determined to be normal.
[0145] The difference between the actual change data of the region and the image change parameter may be an absolute value difference, and the difference between the actual change data of the pixel and the image change parameter may be an absolute value difference. The absolute value difference is the difference between the two and then the absolute value is calculated.
[0146] Different dimensions (regions and pixels) have different tolerances for error sizes, so a preset first threshold and a preset second threshold may be set for the actual region change data and the actual pixel change data, respectively, to obtain a more accurate detection result of the target image.
[0147] For example, if the difference between the actual region change data 1 and the image change parameter 1 is less than the first threshold, and the difference between the actual pixel change data 1 and the image change parameter 1 is less than the second threshold, the detection result of image B is determined to be normal.
[0148] In some embodiments, the step of “determining the detection result of the target image based on the actual change data and the image change parameter” may include:
[0149] When the difference between the actual change data of the area and the image change parameter is greater than the preset first threshold, the detection result of the target image is determined to be an image area abnormality; when the difference between the actual change data of the pixel and the image change parameter is greater than the preset second threshold, the detection result of the target image is determined to be an image position abnormality.
[0150] Among them, the image area anomaly indicates that the difference area of the target image relative to the initial image does not meet the image change parameters, and the image area anomaly indicates that the pixel difference of the target image relative to the initial image does not meet the image difference parameters.
[0151] For example, if the difference between the actual area change data 1 and the image change parameter 1 is greater than the first threshold, the detection result of image B is determined to be an image area abnormality; if the difference between the actual pixel change data 1 and the image change parameter 1 is greater than the second threshold, the detection result of image B is determined to be an image position abnormality.
[0152] In some embodiments, the image testing method further comprises:
[0153] An initial sample image and at least two target sample images corresponding to the initial sample image are obtained, wherein the target sample images carry sample change parameters relative to the initial sample image; the initial sample image is subjected to difference processing with the at least two target sample images to obtain sample difference features of each target sample image; and an image change measurement model is generated based on the sample difference features of each target sample image and the set sample change parameters.
[0154] The image change measurement model of the present application can be obtained based on regression analysis or machine learning. For example, an initial measurement equation (i.e., an initial measurement model) can be set. The initial measurement model may include at least one unknown parameter. The independent variable of the initial measurement model is the sample difference feature, and the dependent variable is the sample change parameter. The sample difference feature and the sample change parameter of each target sample image can be used as the independent variable and the dependent variable of the initial measurement model respectively to obtain at least two equations. By solving the at least two equations, the known values of all unknown parameters in the initial measurement model are obtained, and the image change measurement model including the known values of all unknown parameters is obtained.
[0155] Among them, the target sample image is obtained by changing the initial sample image based on the sample change parameter, the sample change parameter is the parameter based on which the initial sample image is changed to obtain the target sample image, and the sample difference feature is the quantitative data of the actual change of the target sample image relative to the initial sample image.
[0156] The present application can perform difference calculation on the initial image and the target image to obtain a difference image between the two, as well as a target difference area in the difference image and regional difference features of the target difference area, and then perform detection based on the regional difference features and image change parameters to obtain a detection result of the target image. Compared with the prior art, the present application automatically implements the above process through computer equipment, which can effectively improve image detection efficiency.
[0157] The method described in the above embodiment is further described in detail below with examples.
[0158] This application can detect the beautification effect of an image that has been beautified. The beautification operation may include enlarging eyes, adjusting nose size, adjusting lip thickness, smiling lips, thinning face, etc. See Figure 3 , Figure 3 A schematic diagram of a flow chart of an image detection method provided in an embodiment of the present application, the image detection method may include:
[0159] 201. A computer device obtains an initial sample image and at least two target sample images corresponding to the initial sample image, where the target sample images carry sample change parameters relative to the initial sample image.
[0160] For example, a computer device obtains sample image 1 (i.e., an initial sample image), and sample image 2 (target sample image) and sample image 3 (target sample image) corresponding to sample image 1, sample image 2 carries change parameter 1, and sample image 3 carries change parameter 2, wherein sample image 1 is a face image, sample image 2 is an image obtained by performing a 50% (sample change parameter 1) wide eye operation on sample image 1, and sample image 3 is an image obtained by performing an 80% (sample change parameter 2) wide eye operation on sample image 1.
[0161] 202. The computer device performs pixel difference analysis on corresponding positions of the initial sample image and its corresponding at least two target sample images respectively to obtain at least two sample difference images.
[0162] For example, a difference analysis is performed on the pixels at corresponding positions in sample image 1 and sample image 2 to obtain sample difference image 1, and a difference analysis is performed on the pixels at corresponding positions in sample image 1 and sample image 3 to obtain sample difference image 2. The difference analysis may be a difference calculation of the color values (such as RGB values) of the pixels at the same position, such as a difference calculation may be performed on the color values of each color channel, and a pixel value is assigned to the pixel at the position in the difference image based on the calculation result.
[0163] 203. The computer device determines a target sample difference region and a sample region difference feature of the target sample difference region in each sample difference image based on a plurality of sample difference pixels in each sample difference image.
[0164] For example, sample difference image 1 can be found in Figure 4 , Figure 4 The pixel with the color value of (0,0,0) (black) and the pixel with the color value of (255,255,255) (white) are included in the sample. The white part is framed with a minimum rectangular frame to obtain the target sample difference area 1. The target sample difference area 1 can be seen in Figure 5 , and measure the horizontal side length 1 (ie, sample area difference feature 11) and the vertical side length 1 (sample area difference feature 12) of the target sample difference area 1.
[0165] 204. The computer device performs fusion calculation on all target sample difference pixels in each target sample difference area to obtain sample pixel difference features of each sample difference image.
[0166] For example, in sample difference image 1, the target sample difference pixel is a pixel with a color value of (255, 255, 255). Each target sample difference pixel has a two-dimensional position coordinate value in the sample difference image, i.e., an X value and a Y value. The X values of all target sample difference pixels are averaged to obtain a first average coordinate value (i.e., sample pixel difference feature 1). The Y values of all target sample difference pixels are averaged to obtain a second average coordinate value (i.e., sample pixel difference feature 2).
[0167] 205. The computer device generates a pixel change measurement model based on sample pixel difference features and sample change parameters of at least two sample difference images, and generates a region change measurement model based on sample region difference features and sample change parameters of at least two sample difference images.
[0168] For example, the sample difference image 1 corresponds to the horizontal side length 1 (i.e., the sample area difference feature 11) h1, the vertical side length 1 (i.e., the sample area difference feature 12) v1, and the first X average coordinate value (i.e., the sample pixel difference feature 11) and the first Y average coordinate value (ie, sample pixel difference feature 12)
[0169] The sample difference image 1 corresponds to the horizontal side length 2 (ie, the sample area difference feature 21) h2 and the vertical side length 2 (the sample area difference feature 22) v2, the second X average coordinate value (ie, the sample pixel difference feature 21) and the second Y average coordinate value (ie, sample pixel difference feature 22)
[0170] You can get the initial regional change measurement model 1p h , Initial regional change measurement model 2p v , Initial pixel change measurement model 1p x and the initial pixel change metric model 2p y , respectively:
[0171] p h =ah+b
[0172] p v =cv+d
[0173]
[0174] Measuring model 1p in terms of pixel changes x As an example, 50% (sample variation parameter 1) p1 and the first X average coordinate value (ie, sample pixel difference feature 11) are used. Substitution We get formula 1:
[0175]
[0176] 80% (sample variation parameter 2) p2 and the second X average coordinate value (ie, sample pixel difference feature 12) Substitute We get formula 2:
[0177]
[0178] Based on equation 1 and equation 2, we can calculate e and f as follows:
[0179]
[0180] Then we get the pixel change measurement model 1p x :
[0181]
[0182] Similarly, we can get the pixel change measurement model 2p y :
[0183]
[0184] Regional Change Metrics Model 1p h :
[0185]
[0186] Regional Change Measurement Model 2p v :
[0187]
[0188] 206. The computer device receives the initial image and the image change parameter.
[0189] For example, receiving the image to be beautified (i.e., the initial image) and the beautification effectiveness percentage p set for the image to be beautified t (i.e. image change parameters).
[0190] 207. The computer device processes the initial image based on the image change parameter to obtain a target image.
[0191] For example, the beautified image is beautified according to the beautification effectiveness percentage to obtain a beautified image (ie, a target image).
[0192] 208. The computer device performs pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image.
[0193] For example, a difference analysis is performed on the pixels at corresponding positions in the beautified image and the post-beautified image to obtain a beautified difference image (ie, a difference image).
[0194] 209. The computer device determines a target difference region and a regional difference feature of the target difference region in the difference image based on a plurality of difference pixels in the difference image, and performs a fusion calculation on all target difference pixels in the target difference region to obtain a pixel difference feature.
[0195] For example, according to the difference pixels in the beauty difference image, a rectangular difference area (i.e., a target difference area) in the beauty difference image is determined, and the horizontal and vertical side lengths of the rectangular difference area are measured, and the position coordinates of all the difference pixels in the rectangular difference area are averaged to obtain the X average value and the Y average value.
[0196] 210. The computer device inputs the regional difference feature into the regional change measurement model to obtain the regional actual change data, and inputs the pixel difference feature data into the pixel change measurement model to obtain the pixel actual change data.
[0197] For example, the beauty effect percentage and horizontal side length are input into the area change measurement model 1p h , and obtain the lateral true variation parameter p h1 , input the beauty effect percentage and vertical side length into the regional change measurement model 2p v , get the longitudinal true change parameter p v1 , input the beauty effect percentage and X average value into the pixel change measurement model 1p x , get the true change parameter p of X x1 , input the beauty effect percentage and Y average value into the pixel change measurement model 2p y , get the true change parameter p of Y y1 .
[0198] 211. The computer device determines the detection result of the target image based on the actual change data of the area, the actual change data of the pixel and the image change parameter.
[0199] For example, when the lateral true variation parameter p h1 , longitudinal true variation parameter p v1 , X real change parameter p x1 , Y real change parameter p y1 When the following conditions are met, it is determined that the change of the image after beautification compared to the image to be beautified meets the beautification effective percentage, and the conditions specifically include:
[0200] |p h1 -p t |≤k1
[0201] |p v1 -p t |≤k2
[0202] |p x1 -p t |≤k3
[0203] |p y1 -p t |≤k4
[0204] Among them, k1, k2, k3, and k4 can be flexibly set according to needs, and can be the same or different, and there is no limitation here.
[0205] The present application can perform difference calculation on the initial image and the target image to obtain a difference image between the two, as well as a target difference area in the difference image and regional difference features of the target difference area, and then perform detection based on the regional difference features and image change parameters to obtain a detection result of the target image. Compared with the prior art, the present application automatically implements the above process through computer equipment, which can effectively improve image detection efficiency.
[0206] In order to better implement the image detection method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above image detection method. The meanings of the terms are the same as those in the above image detection method, and the specific implementation details can refer to the description in the method embodiment.
[0207] like Figure 6 As shown, Figure 6 A schematic diagram of the structure of an image detection device provided in an embodiment of the present application, wherein the image detection device may include an acquisition module 301, a processing module 302, a difference analysis module 303, a feature determination module 304 and a result determination module 305, wherein:
[0208] An acquisition module 301 is used to acquire an initial image and image change parameters;
[0209] A processing module 302 is used to process the initial image based on the image change parameter to obtain a target image;
[0210] The difference analysis module 303 is used to perform pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image;
[0211] A feature determination module 304 is used to determine a target difference region and a regional difference feature of the target difference region in the difference image based on a plurality of difference pixels in the difference image;
[0212] The result determination module 305 is used to determine the detection result of the target image according to the regional difference characteristics and the image change parameters.
[0213] In some embodiments, the image detection device further comprises:
[0214] A calculation module is used to perform fusion calculation on all target difference pixels in the target difference area to obtain pixel difference features;
[0215] At this time, the result determination module is specifically used for:
[0216] The detection result of the target image is determined based on the regional difference features, pixel difference features and image change parameters.
[0217] In some embodiments, the result determination module includes an acquisition submodule, a quantification submodule and a determination submodule, wherein:
[0218] An acquisition submodule is used to acquire an image change measurement model;
[0219] A quantization submodule is used to quantify the regional difference features and the pixel difference features through an image change measurement model to obtain actual change data of the target image;
[0220] The determination submodule is used to determine the detection result of the target image based on the actual change data and the image change parameters.
[0221] In some embodiments, the determination submodule is specifically used for:
[0222] When the difference between the actual change data and the image change parameter is less than a preset threshold, the detection result of the target image is determined to be normal;
[0223] When the difference between the actual change data and the image change parameter is greater than a preset threshold, the detection result of the target image is determined to be an image anomaly.
[0224] In some embodiments, the image change measurement model includes a region measurement sub-model and a pixel measurement sub-model, the actual change data includes region actual change data and pixel actual change data, and the quantization sub-module is specifically used for:
[0225] The regional difference features are quantified through the regional measurement sub-model to obtain the actual regional change data of the target image;
[0226] The pixel difference features are quantified through the pixel measurement sub-model to obtain the actual pixel change data of the target image.
[0227] In some embodiments, the determination submodule is specifically used for:
[0228] When the difference between the actual change data of the region and the image change parameter is less than a preset first threshold, and the difference between the actual change data of the pixel and the image change parameter is less than a preset second threshold, the detection result of the target image is determined to be normal.
[0229] In some embodiments, the determination submodule is specifically used for:
[0230] When the difference between the actual area change data and the image change parameter is greater than a preset first threshold, determining that the detection result of the target image is an image area abnormality;
[0231] When the difference between the actual pixel change data and the image change parameter is greater than a preset second threshold, it is determined that the detection result of the target image is an image position abnormality.
[0232] In some embodiments, the initial image includes a plurality of initial pixels, the target image includes a plurality of target pixels, and the difference analysis module includes a determination submodule, a calculation submodule and an integration submodule, wherein:
[0233] A determination submodule, used to determine a plurality of groups of pixel pairs with the same position information based on the position information of each initial pixel point in the initial image and the position information of each target pixel point in the target image, wherein the pixel pairs include the initial pixel points and the target pixel points;
[0234] A calculation submodule, used to perform difference calculation on each group of pixel pairs according to the color information of each initial pixel point and the color information of each target pixel point, so as to obtain color difference information of each group of pixel pairs;
[0235] The integration submodule is used to integrate the position information and color difference information of each group of pixel pairs to obtain a difference image.
[0236] In some embodiments, the computing submodule is specifically used for:
[0237] Determine the difference between the color information of the initial pixel and the color information of the target pixel in the pixel pair;
[0238] When the difference information meets a preset condition, determining the color difference information of the pixel pair as first color difference information;
[0239] When the difference information does not meet the preset condition, the color difference information of the pixel pair is determined to be second color difference information.
[0240] In some embodiments, the difference pixel points include position information and color difference information, and the feature determination module is specifically used to:
[0241] When the color difference information of the difference pixel is the target difference information, determining the difference pixel as the target difference pixel;
[0242] According to the position information of all target difference pixels in the difference image, the target difference region in the difference image and the regional difference features of the target difference region are determined.
[0243] In some embodiments, the image detection device further comprises:
[0244] A sample acquisition module, used to acquire an initial sample image and at least two target sample images corresponding to the initial sample image, wherein the target sample images carry sample change parameters relative to the initial sample image;
[0245] A sample difference module, used for performing difference processing on an initial sample image and at least two target sample images to obtain a sample difference feature of each target sample image;
[0246] The model generation module is used to generate an image change measurement model based on the sample difference characteristics of each target sample image and set sample change parameters.
[0247] In the present application, the acquisition module 301 acquires the initial image and image change parameters; the processing module 302 processes the initial image based on the image change parameters to obtain the target image; the difference analysis module 303 performs pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image; the feature determination module 304 determines the target difference area and the regional difference features of the target difference area in the difference image based on multiple difference pixels in the difference image; the result determination module 305 determines the detection result of the target image according to the regional difference features and the image change parameters.
[0248] The present application can perform difference calculation on the initial image and the target image to obtain a difference image between the two, as well as a target difference area in the difference image and regional difference features of the target difference area, and then perform detection based on the regional difference features and image change parameters to obtain a detection result of the target image. Compared with the prior art, the present application automatically implements the above process through computer equipment, which can effectively improve image detection efficiency.
[0249] In addition, the embodiment of the present application also provides a computer device, which can be a terminal or a server. Figure 7 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0250] The computer device may include one or more processing core processors 401, one or more computer-readable storage media memories 402, a power supply 403, an input unit 404 and other components. Those skilled in the art will appreciate that Figure 7 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0251] The processor 401 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 402 and calling data stored in the memory 402, it executes various functions of the computer device and processes data, thereby performing overall detection of the computer device. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user pages and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0252] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0253] The computer device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0254] The computer device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0255] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:
[0256] Acquire an initial image and image change parameters; process the initial image based on the image change parameters to obtain a target image; perform pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image; determine a target difference area and regional difference features of the target difference area in the difference image based on a plurality of difference pixels in the difference image; determine a detection result of the target image based on the regional difference features and the image change parameters.
[0257] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0258] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations in the above-mentioned embodiments.
[0259] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0260] To this end, the embodiment of the present application further provides a storage medium, in which a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any image detection method provided in the embodiment of the present application. For example, the computer program can execute the following steps:
[0261] Acquire an initial image and image change parameters; process the initial image based on the image change parameters to obtain a target image; perform pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image; determine a target difference area and regional difference features of the target difference area in the difference image based on a plurality of difference pixels in the difference image; determine a detection result of the target image based on the regional difference features and the image change parameters.
[0262] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0263] Since the computer program stored in the storage medium can execute the steps in any image detection method provided in the embodiments of the present application, the beneficial effects that can be achieved by any image detection method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0264] The above is a detailed introduction to an image detection method, device, storage medium and computer equipment provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An image detection method, characterized in that: include: Get the initial image and image change parameters; Processing the initial image based on the image change parameter to obtain a target image; Performing pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image; Based on a plurality of difference pixels in the difference image, determining a target difference region and a regional difference feature of the target difference region in the difference image; Performing fusion calculation on all target difference pixels in the target difference area to obtain pixel difference features; Determining the detection result of the target image according to the regional difference features and the image change parameters, including: acquiring an image change measurement model; quantifying the difference between the regional difference features and the pixel difference features through the image change measurement model to obtain actual change data of the target image; and determining the detection result of the target image based on the actual change data and the image change parameters.
2. The method according to claim 1, characterized in that: The determining the detection result of the target image based on the actual change data and the image change parameter includes: When the difference between the actual change data and the image change parameter is less than a preset threshold, determining that the detection result of the target image is normal; When the difference between the actual change data and the image change parameter is greater than a preset threshold, it is determined that the detection result of the target image is an image abnormality.
3. The method according to claim 1, characterized in that The image change measurement model includes a region measurement sub-model and a pixel measurement sub-model, and the actual change data includes region actual change data and pixel actual change data. The step of quantifying the difference between the regional difference feature and the pixel difference feature by using the image change measurement model to obtain actual change data of the target image includes: Quantifying the regional difference features by using the regional measurement sub-model to obtain actual regional change data of the target image; The pixel difference feature is quantified by the pixel measurement sub-model to obtain actual pixel change data of the target image.
4. The method according to claim 3, characterized in that: The determining the detection result of the target image based on the actual change data and the image change parameter includes: When the difference between the actual change data of the region and the image change parameter is less than a preset first threshold, and the difference between the actual change data of the pixel and the image change parameter is less than a preset second threshold, it is determined that the detection result of the target image is normal.
5. The method according to claim 3, characterized in that: The determining the detection result of the target image based on the actual change data and the image change parameter includes: When the difference between the actual change data of the area and the image change parameter is greater than a preset first threshold, determining that the detection result of the target image is an image area abnormality; When the difference between the actual pixel change data and the image change parameter is greater than a preset second threshold, it is determined that the detection result of the target image is an image position abnormality.
6. The method according to claim 1, characterized in that The initial image includes a plurality of initial pixel points, and the target image includes a plurality of target pixel points. The performing pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image includes: Based on the position information of each initial pixel point in the initial image and the position information of each target pixel point in the target image, determining a plurality of groups of pixel pairs with the same position information, wherein the pixel pairs include the initial pixel points and the target pixel points; According to the color information of each initial pixel point and the color information of each target pixel point, a difference calculation is performed on each group of pixel pairs to obtain color difference information of each group of pixel pairs; The position information and color difference information of each pixel pair are integrated to obtain a difference image.
7. The method according to claim 6, characterized in that The method of performing difference calculation on each pixel pair according to the color information of each initial pixel point and the color information of each target pixel point to obtain color difference information of each pixel pair includes: Determine the difference between the color information of the initial pixel and the color information of the target pixel in the pixel pair; When the difference information meets a preset condition, determining the color difference information of the pixel pair as first color difference information; When the difference information does not meet a preset condition, the color difference information of the pixel pair is determined to be second color difference information.
8. The method according to claim 1, characterized in that: The difference pixel points include position information and color difference information. The determining, based on a plurality of difference pixels in the difference image, a target difference region and a regional difference feature of the target difference region in the difference image comprises: When the color difference information of the difference pixel is the target difference information, determining the difference pixel as the target difference pixel; According to the position information of all target difference pixels in the difference image, a target difference region in the difference image and a region difference feature of the target difference region are determined.
9. The method according to claim 1, characterized in that: The method further comprises: Acquire an initial sample image and at least two target sample images corresponding to the initial sample image, wherein the target sample images carry sample change parameters relative to the initial sample image; Performing difference processing on the initial sample image and the at least two target sample images to obtain a sample difference feature of each target sample image; Based on the sample difference features of each target sample image and the set sample change parameters, an image change measurement model is generated.
10. An image detection device, characterized in that: include: An acquisition module, used to acquire an initial image and image change parameters; A processing module, used for processing the initial image based on the image change parameter to obtain a target image; A difference analysis module, used for performing pixel difference analysis on corresponding positions in the initial image and the target image to obtain a difference image; a feature determination module, configured to determine a target difference region and a regional difference feature of the target difference region in the difference image based on a plurality of difference pixels in the difference image; A calculation module is used to perform fusion calculation on all target difference pixels in the target difference area to obtain pixel difference features; A result determination module is used to determine the detection result of the target image according to the regional difference features and the image change parameters, including: obtaining an image change measurement model; quantifying the difference between the regional difference features and the pixel difference features through the image change measurement model to obtain actual change data of the target image; and determining the detection result of the target image based on the actual change data and the image change parameters.
11. A storage medium, characterized in that: The storage medium stores a plurality of computer programs, and the computer programs are suitable for being loaded by a processor to execute the steps in any one of the methods according to claims 1 to 9.
12. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the methods of claims 1 to 9.
Citation Information
Patent Citations
Method for remote sensing image change detection based on Semi-NMF
CN103955926A
Image processing method and device, and mobile terminal
CN108492246A