CN116563563A - Image anomaly detection method, device, terminal and storage medium - Google Patents

Image anomaly detection method, device, terminal and storage medium Download PDF

Info

Publication number
CN116563563A
CN116563563A CN202210104390.1A CN202210104390A CN116563563A CN 116563563 A CN116563563 A CN 116563563A CN 202210104390 A CN202210104390 A CN 202210104390A CN 116563563 A CN116563563 A CN 116563563A
Authority
CN
China
Prior art keywords
image
parameter value
similar
pixel point
abnormal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210104390.1A
Other languages
Chinese (zh)
Inventor
杨良
王文飞
冉飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202210104390.1A priority Critical patent/CN116563563A/en
Publication of CN116563563A publication Critical patent/CN116563563A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The embodiment of the disclosure discloses an image anomaly detection method, an image anomaly detection device, a terminal and a storage medium; the image anomaly detection method comprises the following steps: acquiring a first image and a second image; the first image is an image to be detected, and the second image is an image for reference; determining a similarity map of the first image and the second image with respect to image features; wherein the image features include: brightness features and/or structural features; acquiring abnormal pixel points based on the similarity graph; and if the number of the abnormal pixel points is greater than or equal to a preset threshold value, determining that the first image is an abnormal image.

Description

Image anomaly detection method, device, terminal and storage medium
Technical Field
The present disclosure relates to, but not limited to, the field of image technology or the field of computer computing, and in particular, to a method, an apparatus, a terminal, and a storage medium for detecting an image anomaly.
Background
In the test of the camera or the camera, bad image generation caused by the abnormal function of the camera or the camera is likely to occur. Such bad images tend to be morphologically distinct and may appear at the pixel level. Due to factors such as ambient light change, automatic exposure, automatic focusing, automatic white balance, optical anti-shake adjustment and the like, the images have great differences in microscopic degree, and pixels cannot be directly used for differential detection. In the field of anomaly detection, when an anomaly occurs in a photographed image, pixel-level anomaly detection is difficult due to the influence of the above factors, and anomaly detection in a fixed form is often only possible.
The existing pixel level anomaly detection algorithm has extremely high requirements on the quality of shot images and other factors; however, the non-pixel level anomaly detection algorithm is often used for detecting anomalies based on fixed forms, and cannot be used for compatibly detecting anomalies in changing forms.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides an image anomaly detection method, an apparatus, a terminal, and a storage medium.
According to a first aspect of the present disclosure, there is provided an image anomaly detection method, the method including:
acquiring a first image and a second image; the first image is an image to be detected, and the second image is an image for reference;
determining a similarity map of the first image and the second image with respect to image features; wherein the image features include: brightness features and/or structural features;
acquiring abnormal pixel points based on the similarity graph;
and if the number of the abnormal pixel points is greater than or equal to a preset threshold value, determining that the first image is an abnormal image.
In some embodiments, the determining a similarity map of the first image and the second image with respect to image features comprises:
determining a first similarity map of the first image and the second image with respect to the luminance feature and/or a second similarity map with respect to the structural feature;
The obtaining abnormal pixel points based on the similarity graph includes:
acquiring a first abnormal pixel point based on the first similar diagram, and/or acquiring a second abnormal pixel point based on the second similar diagram;
and if the number of the abnormal pixel points is greater than or equal to a preset threshold value, determining that the first image is an abnormal image, wherein the abnormal image comprises one of the following steps:
if the number of the first abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
if the number of the second abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
and if the first abnormal pixel point and the second abnormal pixel point corresponding to the first abnormal pixel point are larger than or equal to the preset threshold value, determining that the first image is the abnormal image.
In some embodiments, the acquiring a first abnormal pixel point based on the first similarity map and/or acquiring a second abnormal pixel point based on the second similarity map includes:
performing binarization processing on the first similar graph to obtain a binarized first similar graph, and/or performing binarization processing on the second similar graph to obtain a binarized second similar graph;
And acquiring the first abnormal pixel point based on the first similar graph after binarization processing, and/or acquiring the second abnormal pixel point based on the second similar graph after binarization processing.
In some embodiments, the determining a first similarity map for the luminance feature and/or a second similarity map for the structural feature of the first image and the second image comprises:
determining a first similar parameter value for the first image and the second image based on a product of a mean value of first feature parameter values describing the first image and a mean value of second feature parameter values describing the second image, and a sum of a square of the mean value of the first feature parameter values and a square of the mean value of the second feature parameter values;
determining the first similarity map of the first image and the second image with respect to the luminance feature based on the first similarity parameter value;
and/or the number of the groups of groups,
determining a second similar parameter value for the first image and the second image based on a product of a standard deviation of the first characteristic parameter value and a standard deviation of the second characteristic parameter value and a sum of squares of the standard deviation of the first characteristic parameter value and the standard deviation of the second characteristic parameter value;
A second similarity map of the first image and the second image with respect to the structural feature is determined based on the second similarity parameter values.
In some embodiments, the method comprises:
acquiring a first color parameter value and a second color parameter value of the first image and the second image in a color gamut channel respectively;
determining the first color parameter value as the first characteristic parameter value and/or determining the second color parameter value as the second characteristic parameter value; or alternatively, the process may be performed,
the first color parameter value is filtered based on a gaussian filter to obtain the first feature parameter value and/or the second color parameter value is filtered based on the gaussian filter to obtain the second feature parameter value.
In some embodiments, the acquiring a first abnormal pixel point based on the first similarity map and/or acquiring a second abnormal pixel point based on the second similarity map includes:
if the first similar parameter value corresponding to the pixel point in the first similar graph is greater than or equal to a preset parameter value, determining the pixel point corresponding to the first similar parameter value as the first abnormal pixel point;
And/or the number of the groups of groups,
and if the second similar parameter value corresponding to the pixel point in the second similar image is larger than or equal to the preset parameter value, determining the pixel point corresponding to the second similar parameter value as the second abnormal pixel point.
According to a second aspect of the present disclosure, there is provided an image abnormality detection apparatus including:
the acquisition module is used for acquiring the first image and the second image; the first image is an image to be detected, and the second image is an image for reference;
a processing module for determining a similarity graph of the first image and the second image with respect to image features; wherein the image features include: brightness features and/or structural features;
the processing module is used for acquiring abnormal pixel points based on the similarity graph;
and the determining module is used for determining that the first image is an abnormal image if the number of the abnormal pixel points is greater than or equal to a preset threshold value.
In some embodiments, the processing module is configured to determine a first similarity map for the first image and the second image with respect to the luminance feature and/or a second similarity map for the structural feature;
the processing module is used for acquiring a first abnormal pixel point based on the first similar diagram and/or acquiring a second abnormal pixel point based on the second similar diagram;
The determining module is used for one of the following:
if the number of the first abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
if the number of the second abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
and if the first abnormal pixel point and the second abnormal pixel point corresponding to the first abnormal pixel point are larger than or equal to the preset threshold value, determining that the first image is the abnormal image.
In some embodiments, the processing module is configured to perform binarization processing on the first similar graph to obtain the first similar graph after binarization processing, and/or perform binarization processing on the second similar graph to obtain the second similar graph after binarization processing;
the processing module is configured to obtain the first abnormal pixel point based on the first similarity graph after binarization processing, and/or obtain the second abnormal pixel point based on the second similarity graph after binarization processing.
In some embodiments, the processing module is configured to determine a first similar parameter value for the first image and the second image based on a product of a mean value of first feature parameter values describing the first image and a mean value of second feature parameter values describing the second image, and a sum of a square of the mean value of the first feature parameter values and a square of the mean value of the second feature parameter values;
The processing module is configured to determine the first similarity map of the first image and the second image with respect to the luminance feature based on the first similarity parameter value;
and/or the number of the groups of groups,
the processing module is configured to determine a second similar parameter value of the first image and the second image based on a standard deviation between the first characteristic parameter value and the second characteristic parameter value and a sum of squares of the standard deviation of the first characteristic parameter value and the standard deviation of the second characteristic parameter value;
the processing module is configured to determine a second similarity map of the first image and the second image with respect to the structural feature based on the second similarity parameter value.
In some embodiments, the acquiring module is configured to acquire a first color parameter value and a second color parameter value of the first image and the second image in the color gamut channel respectively;
the processing module is configured to determine the first color parameter value as the first feature parameter value and/or determine the second color parameter value as the second feature parameter value; or alternatively, the process may be performed,
the processing module is configured to filter the first color parameter value based on a gaussian filter to obtain the first feature parameter value, and/or filter the second color parameter value based on the gaussian filter to obtain the second feature parameter value.
In some embodiments, the processing module is configured to determine, if the first similar parameter value corresponding to the pixel point in the first similar graph is greater than or equal to a predetermined parameter value, that the pixel point corresponding to the first similar parameter value is the first abnormal pixel point;
and/or the number of the groups of groups,
the processing module is configured to determine, if the second parameter value corresponding to the pixel point in the second similar image is greater than or equal to the predetermined parameter value, that the pixel point corresponding to the second parameter value is the second abnormal pixel point.
According to a third aspect of embodiments of the present disclosure, there is provided a terminal comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: and when the executable instruction is executed, the image anomaly detection method according to any embodiment of the disclosure is realized.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium storing an executable program, wherein the executable program, when executed by a processor, implements the image anomaly detection method according to any embodiment of the present disclosure.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
The embodiment of the disclosure can determine the similarity graph of the image characteristics of the first image and the second image with respect to the brightness characteristics and/or the structural characteristics and the like by acquiring the first image and the second image; acquiring abnormal pixel points based on the similarity graph; and if the number of the abnormal pixels is greater than or equal to a preset threshold value, determining the first image as an abnormal image. Thus, the embodiment of the disclosure can realize the abnormality detection of the pixel level of the image by detecting the abnormality of the pixel point; and thus may also be applied to the testing of cameras or video cameras or the anomaly detection of images on industrial products. In addition, the embodiment of the invention does not need special shooting support equipment to acquire the image, so that the cost of hardware for detecting the abnormal image can be saved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart illustrating an image anomaly detection method according to an exemplary embodiment of the present disclosure.
Fig. 2 is a flowchart illustrating an image anomaly detection method according to an exemplary embodiment of the present disclosure.
Fig. 3 is a flowchart illustrating an image anomaly detection method according to an exemplary embodiment of the present disclosure.
Fig. 4 is a flowchart illustrating an image anomaly detection method according to an exemplary embodiment of the present disclosure.
Fig. 5 is a block diagram illustrating an image anomaly detection apparatus according to an exemplary embodiment of the present disclosure.
Fig. 6 is a block diagram of a terminal according to an exemplary embodiment of the present disclosure.
Fig. 7 is a block diagram of a terminal according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the invention. Rather, they are merely examples of apparatus and methods consistent with aspects of the invention as detailed in the accompanying claims.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
FIG. 1 is a schematic illustration of a method for detecting anomalies in an image according to an exemplary embodiment; as shown in fig. 1, the image anomaly detection method is performed by a first device, and includes the steps of:
step S11: acquiring a first image and a second image; the first image is an image to be detected, and the second image is an image for reference;
step S12: determining a similarity map of the first image and the second image with respect to image features; wherein the image features include: brightness features and/or structural features;
step S13: acquiring abnormal pixel points based on the similarity graph;
step S14: and if the number of the abnormal pixel points is greater than or equal to a preset threshold value, determining that the first image is an abnormal image.
The image anomaly detection method disclosed by the embodiment of the disclosure is applied to the terminal. The terminal here may be various mobile devices or fixed devices. For example, the terminal may be a server, computer, tablet, mobile phone, television, sound box, wearable device, etc.
Here, the first image and the second image may each be any one of the images; for example, it may be an image of a video, a photograph, or a promotional picture.
In one embodiment, the first image and the second image are of the same type; alternatively, the objects included in the first image and the second image are the same. Here, the object includes, but is not limited to, at least one of: humans, animals, plants, objects, buildings or landscapes, etc.
In one embodiment, the first image and the second image include the same pixel, or the first image includes the same pixel and the second image includes the same pixel within a predetermined range, or the first image and the second image have the same size.
One or more first images may be acquired and one or more second images may be acquired in this step S11. The first image to be detected in the embodiment of the disclosure may be one or more, so that detection of one or more first images may be achieved; the number of images used in the embodiment of the disclosure may be one or more, so that the detection of abnormal images can be performed by one or more first images relative to one or more second images. In the embodiments of the present disclosure, a plurality may refer to 2 or more.
Here, the image features include, but are not limited to, at least one of: color features, brightness features, contrast features, and structural features.
In one embodiment, a color feature is used to indicate the color value of the image in the gamut channel. Here, the color value of the image in the color gamut channel may refer to: the pixel points of the image are color values of the color gamut channels. For example, the gamut channels are three gamut channels of red (R), green (G), and blue (B); the color characteristic refers to the characteristic of color values of each pixel point in three color gamut channels of RGB, for example, a certain red pixel point, the color values are as follows: r is 255, G is 0 and B is 0.
In one embodiment, a brightness feature is used to indicate the darkness of the image. The brightness of an image may refer to: the degree of darkness of the pixels of the image. For example, if the gray scale value of the color gamut channel is [0, 255], the [0, 255] can be corresponding to a luminance value of 0% to 100%; the closer the pixel is to 0 in each gamut channel, the lower the luminance, and the closer the pixel is to 255 in each gamut channel, the higher the luminance.
In one embodiment, contrast features are used to indicate the difference between the brightest and darkest of the image.
In an embodiment of the present disclosure, a similarity graph of the first image and the second image with respect to the luminance feature means: a similarity map of the first image and the second image with respect to luminance features, or a similarity map of the first image and the second image associated with luminance and contrast features.
In one embodiment, structural features are used to indicate the characteristics of the image structural composition. For example, structural features may include, but are not limited to, at least one of: texture features, shape features, and spatial relationship features. The texture features are used for identifying the surface properties of the scene corresponding to the image or the image area. The row-like features including contour features and/or region features; the contour features of an image are primarily directed to the boundaries of objects in the image, and the area features of the image may relate to the entire shape area. The spatial relationship may be a spatial position or a relative direction relationship between a plurality of objects segmented in the image.
Here, the similarity map includes, but is not limited to: the first similarity graph and/or the second similarity graph. The first similarity graph is a similarity graph of the first image and the second image relative to brightness characteristics or a similarity graph relative to brightness and contrast characteristics; the second similarity map is a similarity map of the first image and the second image with respect to the structural feature.
In this step S12, it may include: determining similar parameter values of each pixel point corresponding to the first image and the second image on the basis of the characteristic parameter values of the characteristic image characteristics of the first image and the characteristic parameter values of the characteristic image characteristics of the second image; determining a similarity graph based on the similarity parameter values corresponding to the pixel points; the similarity map comprises similar parameter values corresponding to the pixel points.
Here, the abnormal pixel points include, but are not limited to: the first abnormal pixel point and/or the second abnormal pixel point. The first abnormal pixel point is an abnormal pixel point in the first similar graph; the second abnormal pixel point is an abnormal pixel point in the second similar graph.
Here, the predetermined threshold value may be preset or determined in response to a user input operation or determined based on a historical empirical value. The predetermined threshold may be set based on the size of the image, the type of image, or historical experience. For example, for a first image of 400×400 pixels, the predetermined threshold may be 20; for a first image of 200 x 200 pixels, the predetermined threshold may be 30 pixels.
In the embodiment of the disclosure, the similarity graph of the image features of the first image and the second image with respect to the brightness features and/or the structural features and the like can be determined by acquiring the first image and the second image; acquiring abnormal pixel points based on the similarity graph; and if the number of the abnormal pixels is greater than or equal to a preset threshold value, determining the first image as an abnormal image. Thus, the embodiment of the disclosure can realize the abnormality detection of the pixel level of the image by detecting the abnormality of the pixel point; and thus may also be applied to the testing of cameras or video cameras or the anomaly detection of images on industrial products.
In the embodiment of the disclosure, special shooting support equipment is not needed for acquiring the image, so that the cost of hardware for detecting the abnormal image can be saved.
As shown in fig. 2, in some embodiments, the step S12 includes:
step S121: determining a first similarity map of the first image and the second image with respect to the luminance feature and/or a second similarity map with respect to the structural feature;
the step S13 includes:
step S131: acquiring a first abnormal pixel point based on the first similar diagram, and/or acquiring a second abnormal pixel point based on the second similar diagram;
the step S14 includes one of the following:
step S141: if the number of the first abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
step S142: if the number of the second abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
step S143: and if the first abnormal pixel point and the second abnormal pixel point corresponding to the first abnormal pixel point are larger than or equal to the preset threshold value, determining that the first image is the abnormal image.
In this manner, in the embodiment of the present disclosure, the first abnormal pixel point may be acquired from the first similarity graph of the luminance feature, and the first image is determined to be an abnormal image based on the number of the first abnormal pixel points being greater than or equal to the predetermined threshold. In this manner, detection may be performed from a pixel level associated with the luminance feature to determine whether the first image is an outlier image.
Or, in the embodiment of the present disclosure, the second abnormal pixel point may be obtained from a second similar graph of the structural feature, and the second image is determined to be an abnormal image based on the number of the second abnormal pixel point being greater than or equal to a predetermined threshold. In this manner, detection may be performed from the pixel level of the pixel level associated with the structural feature to determine whether the first image is an outlier image.
Alternatively, the embodiment of the disclosure may also acquire a first abnormal pixel point from a first similar graph of the luminance feature and acquire a second abnormal pixel point from a second similar graph of the image feature; and determining the first image as an abnormal image based on the first abnormal pixel point and the second abnormal pixel point corresponding to the first abnormal pixel point being greater than or equal to a predetermined threshold. In this way, the two dimensions of the brightness feature and the structural feature of the same pixel point can be detected, and the first image is determined to be an abnormal image only when the number of abnormal pixel points of the first image, which are abnormal for the brightness feature and the structural feature, exceeds a preset threshold; that is, the first image is determined to be an abnormal image when a large difference is simultaneously exhibited on the first similar image of the brightness contrast characteristic and the second similar image of the structural characteristic. Therefore, the accuracy of detecting the abnormal image can be improved, and the probability of false detection is reduced.
As such, in embodiments of the present disclosure, various ways of detecting whether the first image is an abnormal image may be provided.
As shown in fig. 3, in some embodiments, the method includes:
step S10: acquiring a first color parameter value and a second color parameter value of the first image and the second image in a color gamut channel respectively;
step S10A: determining the first color parameter value as the first characteristic parameter value and/or determining the second color parameter value as the second characteristic parameter value; or alternatively, the process may be performed,
step S10B: the first color parameter value is filtered based on a gaussian filter to obtain the first feature parameter value and/or the second color parameter value is filtered based on the gaussian filter to obtain the second feature parameter value.
In one embodiment, the color parameter values of the image in the color gamut channel are obtained by performing normalization processing on the image in the color gamut channel. For example, the first image is normalized in each color gamut channel, so as to obtain a first color parameter value of the first image in each color gamut channel; for another example, the second image is normalized in each color gamut channel, so as to obtain a second color parameter value of the second image in each color gamut channel.
In one embodiment, determining the first color parameter value of the first image in the color gamut channel in step S10 includes: acquiring a first color value of a first image in each color gamut channel; determining a first value based on a difference of the first color value and a mean of the first color value; the first color parameter value is determined based on a ratio of the first value to a standard deviation of the first color value. For example, the terminal obtains that the first color parameter value of the first image in the color gamut channel isWherein (x, y) is a coordinate in the first image, and one coordinate may represent one pixel point; p (P) 1 (x, y) is the first color value of the first image in each color gamut channel, e.g., the P 1 (x, y) may be the first color values of each pixel in the first image in R, G and B color gamut channels, respectively; />For the mean value of the first color value, e.g. the +.>The average value of the first color values corresponding to the pixel points in the first image can be obtained; />Standard deviation of the first color valueFor example, theThe standard deviation of the first color value corresponding to each pixel point in the first image may be used.
Exemplary, if the first image includes n pixels; the terminal may determine the first color value of the first image as P 1 (x,y)=P 1,i (x, y) i=1, 2,..n; the terminal may determine, based on the first color value of the first image, that the average value of the first color value isThe terminal may determine that the standard deviation of the first color value of the first image is +.>The terminal determines that the first color parameter value of the first image is
In one embodiment, determining the second color parameter value of the second image in the color gamut channel in step S10 includes: acquiring a second color value of a second image in each color gamut channel; determining a second value based on a difference of the second color value and a mean of the second color value; the second color parameter value is determined based on a ratio of the second value to a standard deviation of the second color value. For example, the terminal acquires a second color parameter value of the second image in the color gamut channel as followsWherein (x, y) is a coordinate in the second image, and one coordinate may represent one pixel point; p (P) 2 (x, y) is the second color value of the second image in each color gamut channel, e.g., the P 2 (x, y) may be the second color values of the three color gamut channels R, G and B for each pixel point in the second image; />Is the mean value of the second color value, e.g. the +.>The average value of the second color values corresponding to the pixel points in the second image can be obtained; / >For the second color value standard deviation, e.g., the +.>The standard deviation of the second color value corresponding to each pixel point in the second image may be used.
Exemplary, if the first image includes n pixels; the terminal may determine the second color value of the second image as P 2 (x,y)=P 2,i (x, y) i=1, 2, … n; the terminal may determine, based on the second color value of the second image, that the average value of the second color value isThe terminal may determine that the standard deviation of the second color value of the second image is +.>The terminal determines that the second color parameter value of the second image is
Exemplary, based on the above embodiment, the terminal may determine the first characteristic parameter value asAnd/or, the second characteristic parameter value may be determined to be +.>
Thus, in embodiments of the present disclosure, both the first image and the second image may be normalized to the same distribution space, e.g., both the first image and the second image may be normalized to the distribution space corresponding to the three color gamut channels of RGB; the first image and the second image can be standardized in this way, so that the first image and the second image can be compared in the same distribution space. Moreover, the first image and the second image can be normalized to the distribution space corresponding to the color gamut channel, so that the influence caused by brightness change can be reduced.
Here, the gaussian filter may be any gaussian filter function. For example, the Gaussian filter function may beOr->Where (x, y) is coordinates of pixel points in the image, σ is standard deviation, etc.
In one embodiment, the gaussian filter is a gaussian filter function using a 7 x 7 gaussian convolution kernel.
In one embodiment, filtering the first color parameter value based on a gaussian filter in step S10B to obtain the first feature parameter value includes: a first feature parameter value is obtained based on a product of the first color parameter value and the Gaussian filter function.
Exemplary, the first color parameter value is P 1 =P' 1 (x, y) gaussian filter function is gaussian kernel; the first characteristic parameter value is P' 1 =P 1 ×gaussiankernel。
In one embodiment, filtering the second color parameter value based on the gaussian filter in step S10B to obtain the second feature parameter value includes: a second characteristic parameter value is obtained based on the product of the second color parameter value and the Gaussian filter function.
Exemplary, the second color parameter value is P 2 =P' 2 (x, y) gaussian filter function is gaussian kernel; the first characteristic parameter value is P' 2 =P 2 ×gaussiankernel。
Thus, in the embodiments of the present disclosure, the first color parameter value and the second color parameter value may be filtered by a gaussian filter (e.g., a gaussian filter function), so as to obtain a filtered first feature parameter value and a filtered second feature parameter value. In this way, the influence of pixel offset caused by optical anti-shake and micro-motion can be weakened through the Gaussian filter, and the determination of the difference between the pixels of the first image and the pixels of the second image can be accurately realized.
In the embodiment of the disclosure, the distribution and the size of the gaussian kernel of the gaussian filter function can be changed according to the offset of the photographing pixels.
In some embodiments, the step S121 includes:
determining a first similar parameter value for the first image and the second image based on a product of a mean value of first feature parameter values describing the first image and a mean value of second feature parameter values describing the second image, and a sum of a square of the mean value of the first feature parameter values and a square of the mean value of the second feature parameter values;
determining the first similarity map of the first image and the second image with respect to the luminance feature based on the first similarity parameter value;
and/or the number of the groups of groups,
determining a second similar parameter value for the first image and the second image based on a product of a standard deviation of the first characteristic parameter value and a standard deviation of the second characteristic parameter value and a sum of squares of the standard deviation of the first characteristic parameter value and the standard deviation of the second characteristic parameter value;
a second similarity map of the first image and the second image with respect to the structural feature is determined based on the second similarity parameter values.
Here, the first similarity map is a similarity map of the first image and the second image with respect to brightness and contrast characteristics.
In one embodiment, the determining the first similar parameter value of the first image and the second image based on a product of a mean value of first feature parameter values describing the first image and a mean value of second feature parameter values describing the second image, and a sum of a square of the mean value of the first feature parameter values and a square of the mean value of the second feature parameter values comprises:
determining a third value based on a product of the mean of the first feature parameter values and the mean of the second feature parameter values;
determining a fourth value based on a sum of a square of a mean of the first feature parameter values and a square of a mean of the second feature parameter values;
the first similar parameter value is determined based on a ratio of the third value to the fourth value.
Here, the terminal determines a mean value of the first feature parameter values based on the first feature parameter values; and determining a mean of the second feature parameter values based on the second feature parameter values.
Here, determining a third value based on a product of the mean of the first characteristic parameter and the mean of the second characteristic parameter includes: a third value is determined based on a product of the mean of the first characteristic parameter and the mean of the second characteristic parameter, and a predetermined coefficient. Here, the predetermined coefficient may be preset, and may be, for example, but not limited to, 2.
Here, determining the first similar parameter value based on a ratio of the third value to the fourth value may include: the first similar parameter value is determined based on a ratio of a sum of the third value and a first constant to a sum of a fourth value and the first constant. Here, the first constant may be a control zero constant.
The terminal is illustratively based on a first characteristic parameter value P' 1 Determining the mean value of the first characteristic parameter valueBased on the second characteristic parameter value P' 2 Determining the mean value of the second characteristic parameter +.>The terminal determines, based on the product of the average value of the first feature parameter values and the average value of the second feature parameter values, that the third value is: />The terminal determines a fourth value as +.f based on the sum of the square of the mean of the first characteristic parameter values and the square of the mean of the second characteristic parameter values>If the terminal determines that the first constant is C 1 The method comprises the steps of carrying out a first treatment on the surface of the The terminal determines the first similar parameter value as +.>
In one embodiment, the determining the first similarity map of the first image and the second image with respect to the luminance feature based on the first similarity parameter value includes:
Forming the first similarity graph of the first image and the second image about the brightness characteristic based on the first similarity parameter value corresponding to each pixel point; the first similarity map includes the first similarity parameter values corresponding to the pixel points.
In this way, in the embodiment of the present disclosure, the first similarity map of the brightness contrast ratio of the first image and the second image may be calculated for the first image and the second image after being filtered by the gaussian filter function, so that the difference between the brightness and the contrast ratio of the first image and the second image may be accurately described. And it may be determined whether each pixel point is an abnormal pixel point based on each first similarity parameter value included in the first similarity map.
In one embodiment, determining the second similar parameter value of the first image and the second image based on a standard deviation between the first and second characteristic parameter values and a sum of squares of the standard deviation of the first and second characteristic parameter values comprises:
determining a fifth value based on a standard deviation between the first feature parameter value and the second feature parameter value;
determining a sixth value based on a sum of a square of a standard deviation of the second characteristic parameter value and a square of a standard deviation of the second characteristic parameter value;
The second similar parameter value is determined based on a ratio of the fifth value to the sixth value.
Here, the terminal determines a standard deviation of the first characteristic parameter value based on the first characteristic parameter value; and determining a standard deviation of the second feature parameter value based on the second feature parameter value.
Here, the terminal determines a standard deviation between the first feature parameter value and the second feature parameter value based on the first feature parameter value and the second feature parameter value.
Here, determining a sixth value based on a sum of a square of a standard deviation of the second characteristic parameter value and a square of a standard deviation of the second characteristic parameter value, includes: a sixth value is determined based on a product of the standard deviation of the first characteristic parameter and the standard deviation of the second characteristic parameter, and a predetermined coefficient. Here, the predetermined coefficient may be preset, and may be, for example, but not limited to, 2.
Here, determining the second similar parameter value based on a ratio of the fifth value to the sixth value may include: the second similar parameter value is determined based on a ratio of a sum of the fifth value and a second constant to a sum of the sixth value and the second constant. Here, the second constant may be a control zero constant. Here, the second constant may be the same as or different from the first constant.
The terminal is illustratively based on a first characteristic parameter value P' 1 Determining standard deviation of first characteristic parameter valueBased on the second characteristic parameter value P' 2 Determining the second bitStandard deviation of symptom parameters->The terminal determines a standard deviation between the first feature parameter value and the second feature parameter value based on the first feature parameter value and the second feature parameter value, and determines a fifth value based on the first feature parameter value and the second feature parameter value as follows: />The terminal determines a sixth value as +.>If the terminal determines that the second constant is C 2 The method comprises the steps of carrying out a first treatment on the surface of the The terminal determines the second similar parameter value as +.>
In one embodiment, determining a second similarity map of the first image and the second image with respect to the structural feature based on the second similarity parameter values comprises:
forming the second similar graph of the first image and the second image about the structural feature based on the first similar parameter value corresponding to each pixel point; the second similarity map includes the second similar parameter values corresponding to the pixel points.
In this way, in the embodiment of the present disclosure, the second similarity map of the structural features of the first image and the second image may be calculated for the first image and the second image after being filtered by the gaussian filter function, so that the difference between the structural features of the first image and the second image may be accurately described. And it may be determined whether each pixel point is an abnormal pixel point based on each second similar parameter value included in the second similar map.
In some embodiments, the step S131 includes:
if the first similar parameter value corresponding to the pixel point in the first similar graph is greater than or equal to a preset parameter value, determining the pixel point corresponding to the first similar parameter value as the first abnormal pixel point;
and/or the number of the groups of groups,
and if the second similar parameter value corresponding to the pixel point in the second similar image is larger than or equal to the preset parameter value, determining the pixel point corresponding to the second similar parameter value as the second abnormal pixel point.
Here, the pixel points in the first similar image refer to the pixel points corresponding to the first image and/or the second image; and the pixel points in the second similar image refer to the pixel points corresponding to the first image and/or the second image. One pixel in the first similarity map corresponds to a first similarity parameter value and/or one pixel in the second similarity map corresponds to a second similarity parameter value.
Here, the predetermined parameter value may be set in advance or determined based on a user input operation or determined based on an empirical value. Here, the predetermined parameter value corresponding to the first similarity map is different from the predetermined parameter value corresponding to the second similarity map.
In the embodiment of the disclosure, whether the pixel point corresponding to the first similar parameter value and/or the second similar parameter value is an abnormal pixel point may be determined based on the magnitude of the first similar parameter value and/or the second similar parameter value in the first similar graph and the predetermined parameter value; in this way, it can be determined from the difference in brightness contrast and/or structure whether the first image is an abnormal image.
In some embodiments, the step S131 includes:
performing binarization processing on the first similar graph to obtain a binarized first similar graph, and/or performing binarization processing on the second similar graph to obtain a binarized second similar graph;
and acquiring the first abnormal pixel point based on the first similar graph after binarization processing, and/or acquiring the second abnormal pixel point based on the second similar graph after binarization processing.
Here, if the first similarity map is denoted by "LC", the first image after the binarization process may be: LC' =binary (LC); if the second similar plot is denoted by "ST", the second image after binarization processing may be: ST' =binary (ST).
Here, the binarization processing refers to determining similar parameter values corresponding to each pixel point in the image as a first parameter value and a second parameter value; the first parameter value indicates that the pixel point is an abnormal pixel point; the second parameter value indicates that the pixel point is a normal pixel point. For example, the value of the similar parameter corresponding to each pixel point is determined to be 0 or 1; wherein the abnormal pixel point is set to 1, and the normal pixel point is set to 0.
Exemplary, binarized values of similar parametersSim is a similar parameter value corresponding to the pixel point; the thread is a predetermined parameter value.
For example, if the first similar graph and/or the second similar graph includes n pixels, the first similar graph includes first similar parameter values corresponding to the n pixels and/or the second similar graph includes second similar parameter values corresponding to the n pixels.
Determining the n first similar parameter values as 1 or 0 based on the magnitudes of the n first similar parameter values and the predetermined parameter values, respectively; if the first similar parameter value of the one or more pixel points is greater than or equal to the predetermined parameter value, the first similar parameter value of the one or more pixel points is set to 1; if the first similar parameter value of the one or more similar points is greater than or equal to the predetermined parameter value, the first similar parameter value of the one or more similar points is set to 0. And setting the first similar parameter values corresponding to the n pixel points to 0 or 1 respectively to obtain a binarized first similar graph. For example, the first similar parameter value after binarization processing is Wherein sim is 1 Is the first similar parameter valueThe method comprises the steps of carrying out a first treatment on the surface of the the thread is a predetermined parameter value.
Determining the n second similar parameter values as 1 or 0 based on the magnitudes of the n second similar parameter values and the predetermined parameter values, respectively; if the second similar parameter value of the one or more pixel points is greater than or equal to the predetermined parameter value, the second similar parameter value of the one or more pixel points is set to 1; if the second similar parameter value of the one or more similar points is greater than or equal to the predetermined parameter value, the second similar parameter value of the one or more similar points is set to 0. And setting the second similar parameter values corresponding to the n pixel points to 0 or 1 respectively to obtain a second similar graph after binarization processing. For example, the second similar parameter value after binarization isWherein sim is 2 Is a second similar parameter value; the thread is a predetermined parameter value.
In this way, in the embodiment of the present disclosure, the first similar graph of brightness contrast and/or the second similar graph of structural features may be binarized to obtain the binarized first similar graph and/or second similar graph; thus, the method can more clearly determine which pixel points are abnormal pixel points. Thus, the number of the first abnormal pixel points in the first similar diagram and/or the second abnormal pixel points in the second similar diagram based on statistics accurately determines whether the first image is an abnormal image.
In addition, in the embodiment of the present disclosure, if the number of the first abnormal pixel points and the second abnormal pixel points needs to be counted, that is, the first similar graph and the second similar graph are subjected to binarization processing, the first similar graph and the second similar graph may be normalized to the same distribution space; it is convenient to determine whether the pixel point in the second similar diagram corresponding to a certain pixel point in the first similar diagram is an abnormal pixel point.
To further illustrate the present disclosure, a specific example is provided below.
As shown in fig. 4, there is provided an image anomaly detection method performed by a terminal, the method including the steps of:
step S21: acquiring a first image and a second image;
in an alternative embodiment, the terminal captures a first image and acquires a pre-stored second image.
Step S22a: acquiring a first similar graph of the first image and the second image with respect to brightness characteristics;
in an alternative embodiment, the terminal normalizes the first image in the gamut channel to obtain the first color parameter valueWherein P is 1 (x, y) may be the first color values of each pixel in the first image in R, G and B color gamut channels, respectively; />Is the mean of the first color values; and normalizing the second image in the color gamut channel to obtain a second color parameter value +. >Wherein P is 2 (x, y) may be the second color values of the three color gamut channels R, G and B for each pixel point in the second image; />Is the mean of the second color values. The terminal filters the first color parameter value based on a gaussian filter function to obtain a first characteristic parameter value P' 1 =P 1 X gaussian kernel, and filtering the second color parameter value based on a gaussian filter function to obtain a second characteristic parameter value P' 2 =P 2 X gaussiankernel. The terminal determines a first similar parameter value of the first image and the second image based on a product of a mean value of the first characteristic parameter value and a mean value of the second characteristic parameter value of the second image and a sum of squares of the mean value of the first characteristic parameter value and a square of the mean value of the second characteristic parameter value ∈>The terminal determines a first similarity graph of the first image and the second image based on the first similarity parameter value of each pixel point.
Step S23a: performing binarization processing on the first similar graph to obtain a binarized first similar graph;
in an alternative embodiment, the terminal determines each first similar parameter value in the first similar graph as the first parameter value or the second parameter value, so as to obtain a first similar graph after binarization processing; the parameter value in the first similarity graph after the binarization processing is LC' =binary (LC).
Step S22b: acquiring a second similar graph of the first image and the second image relative to the structural feature;
in an alternative embodiment, the terminal determines the second similar parameter values of the first image and the second image based on the product of the standard deviation of the first characteristic parameter value and the standard deviation of the second characteristic parameter value and the sum of the standard deviation of the first characteristic parameter value and the square of the standard deviation of the second characteristic parameter valueThe terminal determines a second similarity map of the first image and the second image based on the second similarity parameter values of the pixel points.
Step S23b: performing binarization processing on the second similar graph to obtain a binarized second similar graph;
in an alternative embodiment, the terminal determines each second similar parameter value in the second similar graph as the first parameter value or the second parameter value, so as to obtain a second similar graph after binarization processing; in the second similar diagram after the binarization processing, the parameter value is ST' =bin (ST).
Step S24: performing bit and operation on pixel points corresponding to the terminals of the first similar diagram and the second similar diagram;
in an optional embodiment, the terminal determines that a pixel point in the first similar graph is a first abnormal pixel point, and determines that a pixel point in the second similar graph corresponding to the pixel point in the first similar graph is a second abnormal pixel point, and determines that the pixel points corresponding to the first similar graph and the second similar graph are abnormal pixel points. Sim=lc '& ST', when the pixel points of the first similar image and the pixel points of the second similar image are abnormal pixel points, the corresponding pixel points are abnormal pixel points.
Step S25: determining the pixel points as abnormal pixel points;
in an alternative embodiment, the terminal obtains the values of similar parameters after binarizationAnd determining abnormal pixel points based on the similar parameter values. For example, if a first similarity parameter value in the binarized first similarity graph is 1, determining that a pixel corresponding to the first similarity parameter value is an abnormal pixel; if the first similarity parameter value in the binarized first similarity map is 0, determining that the pixel point corresponding to the first similarity parameter value is a normal pixel point. For another example, if the second similar parameter value in the binarized second similar graph is 1, determining that the pixel point corresponding to the second similar parameter value is an abnormal pixel point; if the second similar parameter value in the binarized second similar diagram is 0, determining the pixel point corresponding to the second similar parameter value as a normal pixel point.
Step S26: counting abnormal pixel points;
in an alternative embodiment, the terminal counts abnormal pixels corresponding to the first image and the second image, sim= Σsim; wherein, the SIM is the abnormal pixel point of the first similar image and the corresponding pixel point of the second similar image.
Step S27: determining whether the number of abnormal pixels is greater than a predetermined threshold; if yes, executing step S28a; if not, executing step S28b;
Step S28a: determining the first image as an abnormal image;
step S28b: it is determined that the first image is not an outlier image.
Fig. 5 provides an image anomaly detection apparatus shown in an exemplary embodiment, which is applied to a terminal; as shown in fig. 7, the apparatus includes:
an acquisition module 41 for acquiring a first image and a second image; the first image is an image to be detected, and the second image is an image for reference;
a processing module 42 for determining a similarity map of the first image and the second image with respect to image features; wherein the image features include: brightness features and/or structural features;
the processing module 42 is configured to obtain an abnormal pixel point based on the similarity map;
the determining module 43 is configured to determine that the first image is an abnormal image if the number of abnormal pixels is greater than or equal to a predetermined threshold.
In some embodiments, the processing module 42 is configured to determine a first similarity map of the first image and the second image with respect to the luminance feature and/or a second similarity map with respect to the structural feature;
the processing module 42 is configured to obtain a first abnormal pixel point based on the first similarity map, and/or obtain a second abnormal pixel point based on the second similarity map;
The determining module 43 is configured to one of:
if the number of the first abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
if the number of the second abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
and if the first abnormal pixel point and the second abnormal pixel point corresponding to the first abnormal pixel point are larger than or equal to the preset threshold value, determining that the first image is the abnormal image.
In some embodiments, the processing module 42 is configured to perform binarization processing on the first similar graph to obtain the binarized first similar graph, and/or perform binarization processing on the second similar graph to obtain the binarized second similar graph;
the processing module 42 is configured to obtain the first abnormal pixel point based on the first similarity map after binarization processing, and/or obtain the second abnormal pixel point based on the second similarity map after binarization processing.
In some embodiments, the processing module 42 is configured to determine a first similar parameter value for the first image and the second image based on a product of a mean value of first feature parameter values describing the first image and a mean value of second feature parameter values describing the second image, and a sum of a square of the mean value of the first feature parameter values and a square of the mean value of the second feature parameter values;
The processing module 42 is configured to determine the first similarity map of the first image and the second image with respect to the luminance feature based on the first similarity parameter value;
and/or the number of the groups of groups,
the processing module 42 is configured to determine a second similar parameter value of the first image and the second image based on a product of a standard deviation of the first characteristic parameter value and a standard deviation of the second characteristic parameter value and a sum of squares of the standard deviation of the first characteristic parameter value and the standard deviation of the second characteristic parameter value;
the processing module 42 is configured to determine a second similarity map of the first image and the second image with respect to the structural feature based on the second similarity parameter value.
In some embodiments, the obtaining module 41 is configured to obtain a first color parameter value and a second color parameter value of the first image and the second image in the color gamut channel respectively;
the processing module 42 is configured to determine the first color parameter value as the first feature parameter value and/or determine the second color parameter value as the second feature parameter value; or alternatively, the process may be performed,
the processing module 42 is configured to filter the first color parameter value based on a gaussian filter to obtain the first feature parameter value, and/or filter the second color parameter value based on the gaussian filter to obtain the second feature parameter value.
In some embodiments, the processing module 42 is configured to determine, if the first similar parameter value corresponding to the pixel point in the first similar graph is greater than or equal to a predetermined parameter value, that the pixel point corresponding to the first similar parameter value is the first abnormal pixel point;
and/or the number of the groups of groups,
the processing module 42 is configured to determine, if the second similar parameter value corresponding to the pixel point in the second similar image is greater than or equal to the predetermined parameter value, that the pixel point corresponding to the second similar parameter value is the second abnormal pixel point.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
As shown in fig. 6, an embodiment of the present disclosure further provides a terminal, which is characterized by including:
a processor 51;
a memory 52 for storing instructions executable by the processor 51;
wherein the processor 51 is configured to: and when the executable instruction is executed, the image anomaly detection method according to any embodiment of the disclosure is realized.
The memory may include various types of storage media, which are non-transitory computer storage media capable of continuing to memorize information stored thereon after a power down of the communication device.
The processor may be coupled to the memory via a bus or the like for reading an executable program stored on the memory, for example, implementing at least one of the methods shown in fig. 1-4.
Embodiments of the present disclosure also provide a computer-readable storage medium storing an executable program, wherein the executable program when executed by a processor implements the image anomaly detection method according to any embodiment of the present disclosure. For example, at least one of the methods shown in fig. 1 to 4 is implemented.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 7 is a block diagram illustrating a method for a terminal 600 according to an example embodiment. For example, the terminal 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, or the like.
Referring to fig. 7, the terminal 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an input/output (I/O) interface 612, a sensor component 614, and a communication component 616.
The processing component 602 generally controls overall operation of the terminal 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the terminal 600. Examples of such data include instructions for any application or method operating on terminal 600, contact data, phonebook data, messages, pictures, videos, and the like. The memory 604 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply assembly 606 provides power to the various components of the terminal 600. The power supply components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the terminal 600.
The multimedia component 608 includes a screen between the terminal 600 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the terminal 600 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 610 is configured to output and/or input audio signals. For example, the audio component 610 includes a Microphone (MIC) configured to receive external audio signals when the terminal 600 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 614 includes one or more sensors for providing status assessment of various aspects of the terminal 600. For example, the sensor assembly 614 may detect the on/off state of the terminal 600, the relative positioning of the components, such as the display and keypad of the terminal 600, the sensor assembly 614 may also detect a change in position of the terminal 600 or a component of the terminal 600, the presence or absence of user contact with the terminal 600, the orientation or acceleration/deceleration of the terminal 600, and a change in temperature of the terminal 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communication between the terminal 600 and other devices, either wired or wireless. The terminal 600 may access a wireless network based on a communication standard, such as WiFi,4G or 5G, or a combination thereof. In one exemplary embodiment, the communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the terminal 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 604, including instructions executable by processor 620 of terminal 600 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (14)

1. An image anomaly detection method, the method comprising:
acquiring a first image and a second image; the first image is an image to be detected, and the second image is an image for reference;
determining a similarity map of the first image and the second image with respect to image features; wherein the image features include: brightness features and/or structural features;
Acquiring abnormal pixel points based on the similarity graph;
and if the number of the abnormal pixel points is greater than or equal to a preset threshold value, determining that the first image is an abnormal image.
2. The method of claim 1, wherein the determining a similarity map of the first image and the second image with respect to image features comprises:
determining a first similarity map of the first image and the second image with respect to the luminance feature and/or a second similarity map with respect to the structural feature;
the obtaining abnormal pixel points based on the similarity graph includes:
acquiring a first abnormal pixel point based on the first similar diagram, and/or acquiring a second abnormal pixel point based on the second similar diagram;
and if the number of the abnormal pixel points is greater than or equal to a preset threshold value, determining that the first image is an abnormal image, wherein the abnormal image comprises one of the following steps:
if the number of the first abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
if the number of the second abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
and if the first abnormal pixel point and the second abnormal pixel point corresponding to the first abnormal pixel point are larger than or equal to the preset threshold value, determining that the first image is the abnormal image.
3. The method according to claim 2, wherein the acquiring a first outlier pixel based on the first similarity map and/or acquiring a second outlier pixel based on the second similarity map comprises:
performing binarization processing on the first similar graph to obtain a binarized first similar graph, and/or performing binarization processing on the second similar graph to obtain a binarized second similar graph;
and acquiring the first abnormal pixel point based on the first similar graph after binarization processing, and/or acquiring the second abnormal pixel point based on the second similar graph after binarization processing.
4. A method according to claim 2 or 3, wherein said determining a first similarity map of the first image and the second image with respect to the luminance feature and/or a second similarity map with respect to the structural feature comprises:
determining a first similar parameter value for the first image and the second image based on a product of a mean value of first feature parameter values describing the first image and a mean value of second feature parameter values describing the second image, and a sum of a square of the mean value of the first feature parameter values and a square of the mean value of the second feature parameter values;
Determining the first similarity map of the first image and the second image with respect to the luminance feature based on the first similarity parameter value;
and/or the number of the groups of groups,
determining a second similar parameter value for the first image and the second image based on a standard deviation between the first and second characteristic parameter values and a sum of squares of the standard deviation of the first and second characteristic parameter values;
a second similarity map of the first image and the second image with respect to the structural feature is determined based on the second similarity parameter values.
5. The method according to claim 4, characterized in that the method comprises:
acquiring a first color parameter value and a second color parameter value of the first image and the second image in a color gamut channel respectively;
determining the first color parameter value as the first characteristic parameter value and/or determining the second color parameter value as the second characteristic parameter value; or alternatively, the process may be performed,
the first color parameter value is filtered based on a gaussian filter to obtain the first feature parameter value and/or the second color parameter value is filtered based on the gaussian filter to obtain the second feature parameter value.
6. The method of claim 4, wherein the acquiring a first outlier pixel based on the first similarity map and/or acquiring a second outlier pixel based on the second similarity map comprises:
if the first similar parameter value corresponding to the pixel point in the first similar graph is greater than or equal to a preset parameter value, determining the pixel point corresponding to the first similar parameter value as the first abnormal pixel point;
and/or the number of the groups of groups,
and if the second similar parameter value corresponding to the pixel point in the second similar image is larger than or equal to the preset parameter value, determining the pixel point corresponding to the second similar parameter value as the second abnormal pixel point.
7. An image abnormality detection apparatus, characterized by comprising:
the acquisition module is used for acquiring the first image and the second image; the first image is an image to be detected, and the second image is an image for reference;
a processing module for determining a similarity graph of the first image and the second image with respect to image features; wherein the image features include: brightness features and/or structural features;
the processing module is used for acquiring abnormal pixel points based on the similarity graph;
And the determining module is used for determining that the first image is an abnormal image if the number of the abnormal pixel points is greater than or equal to a preset threshold value.
8. The apparatus of claim 7, wherein the device comprises a plurality of sensors,
the processing module is used for determining a first similar graph of the first image and the second image relative to the brightness characteristic and/or a second similar graph relative to the structural characteristic;
the processing module is used for acquiring a first abnormal pixel point based on the first similar diagram and/or acquiring a second abnormal pixel point based on the second similar diagram;
the determining module is used for one of the following:
if the number of the first abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
if the number of the second abnormal pixel points is greater than or equal to the preset threshold value, determining that the first image is the abnormal image;
and if the first abnormal pixel point and the second abnormal pixel point corresponding to the first abnormal pixel point are larger than or equal to the preset threshold value, determining that the first image is the abnormal image.
9. The apparatus of claim 8, wherein the device comprises a plurality of sensors,
The processing module is configured to perform binarization processing on the first similar graph to obtain a binarized first similar graph, and/or perform binarization processing on the second similar graph to obtain a binarized second similar graph;
the processing module is configured to obtain the first abnormal pixel point based on the first similarity graph after binarization processing, and/or obtain the second abnormal pixel point based on the second similarity graph after binarization processing.
10. The device according to claim 8 or 9, wherein,
the processing module is configured to determine a first similar parameter value of the first image and the second image based on a product of a mean value of first feature parameter values describing the first image and a mean value of second feature parameter values describing the second image, and a sum of a square of the mean value of the first feature parameter values and a square of the mean value of the second feature parameter values;
the processing module is configured to determine the first similarity map of the first image and the second image with respect to the luminance feature based on the first similarity parameter value;
and/or the number of the groups of groups,
The processing module is configured to determine a second similar parameter value of the first image and the second image based on a standard deviation between the first characteristic parameter value and the second characteristic parameter value and a sum of squares of the standard deviation of the first characteristic parameter value and the standard deviation of the second characteristic parameter value;
the processing module is configured to determine a second similarity map of the first image and the second image with respect to the structural feature based on the second similarity parameter value.
11. The apparatus of claim 10, wherein the device comprises a plurality of sensors,
the acquisition module is used for acquiring a first color parameter value and a second color parameter value of the first image and the second image in a color gamut channel respectively;
the processing module is configured to determine the first color parameter value as the first feature parameter value and/or determine the second color parameter value as the second feature parameter value; or alternatively, the process may be performed,
the processing module is configured to filter the first color parameter value based on a gaussian filter to obtain the first feature parameter value, and/or filter the second color parameter value based on the gaussian filter to obtain the second feature parameter value.
12. The apparatus of claim 10, wherein the device comprises a plurality of sensors,
the processing module is configured to determine, if the first similar parameter value corresponding to the pixel point in the first similar graph is greater than or equal to a predetermined parameter value, that the pixel point corresponding to the first similar parameter value is the first abnormal pixel point;
and/or the number of the groups of groups,
the processing module is configured to determine, if the second parameter value corresponding to the pixel point in the second similar image is greater than or equal to the predetermined parameter value, that the pixel point corresponding to the second parameter value is the second abnormal pixel point.
13. A terminal, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: for implementing the image anomaly detection method of any one of claims 1-6 when the executable instructions are executed.
14. A computer-readable storage medium, characterized in that the readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements the image abnormality detection method according to any one of claims 1 to 6.
CN202210104390.1A 2022-01-28 2022-01-28 Image anomaly detection method, device, terminal and storage medium Pending CN116563563A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210104390.1A CN116563563A (en) 2022-01-28 2022-01-28 Image anomaly detection method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210104390.1A CN116563563A (en) 2022-01-28 2022-01-28 Image anomaly detection method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN116563563A true CN116563563A (en) 2023-08-08

Family

ID=87484926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210104390.1A Pending CN116563563A (en) 2022-01-28 2022-01-28 Image anomaly detection method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN116563563A (en)

Similar Documents

Publication Publication Date Title
US9674395B2 (en) Methods and apparatuses for generating photograph
CN106331504B (en) Shooting method and device
CN106131441B (en) Photographing method and device and electronic equipment
CN110958401B (en) Super night scene image color correction method and device and electronic equipment
CN108009563B (en) Image processing method and device and terminal
CN105678296B (en) Method and device for determining character inclination angle
CN113411498A (en) Image shooting method, mobile terminal and storage medium
CN113920465A (en) Method and device for identifying film trailer, electronic equipment and storage medium
CN106982327B (en) Image processing method and device
CN110876014B (en) Image processing method and device, electronic device and storage medium
CN107613210B (en) Image display method and device, terminal and storage medium
CN112188096A (en) Photographing method and device, terminal and storage medium
CN116563563A (en) Image anomaly detection method, device, terminal and storage medium
CN110874829B (en) Image processing method and device, electronic device and storage medium
CN115641269A (en) Image repairing method and device and readable storage medium
CN115953422B (en) Edge detection method, device and medium
CN109447929B (en) Image synthesis method and device
CN110876013B (en) Method and device for determining image resolution, electronic equipment and storage medium
CN109862252B (en) Image shooting method and device
CN107071274B (en) Distortion processing method and terminal
CN117408868A (en) Image processing method and device, electronic equipment and storage medium
CN118248055A (en) Screen control method, device and storage medium
CN117710224A (en) Image fusion method, device, terminal and storage medium
CN116993575A (en) Image processing method, device, equipment and medium
CN117291823A (en) Image processing method, device and storage medium

Legal Events

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