A picture abnormality determination method, device, apparatus and storage medium

CN116189038BActive Publication Date: 2026-09-18SHENZHEN CORERAIN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211666129.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2026-09-18
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

[0004]本发明提供了一种画面异常判定方法、装置、设备及存储介质,以解决无法准确地识别画面异常的问题

Benefits of technology

[0020] The method provided in this embodiment of the invention is based on a preset template image. It obtains a first comparison result and a second comparison result between two adjacent frames of images and the template image, and further compares the first comparison result and the second comparison result to obtain the difference information between the first comparison result and the second comparison result. Based on the difference information result, a preset algorithm is used to calculate and determine whether there is an abnormally moving object in the first target image. If there is an abnormally moving object in the first target image, the first target image is determined to be an abnormal image. The frequency of the first target image being an abnormal image is determined by the count value of the counting unit. Only when the count value is greater than a preset count value threshold is the video object determined to have a picture abnormality. This effectively reduces the frequency of misjudging the video object as having a picture abnormality due to normal object movement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116189038B_ABST
    Figure CN116189038B_ABST
Patent Text Reader

Abstract

The application relates to a picture abnormality judgment method, and relates to the field of image recognition.The method comprises the following steps: obtaining a frame image of a preset video object as a first target image; comparing a preset template image with the first target image to obtain a first comparison result; obtaining a next frame image of the first target image in the preset video object as a second target image, comparing the preset template image with the second target image to obtain a second comparison result; obtaining difference information of the first comparison result and the second comparison result; judging whether the first target image is an abnormal image according to the difference information; if the first target image is an abnormal image, increasing a preset counting value of a preset counting unit by a preset first value; judging whether the counting value is greater than a counting value threshold; and if the counting value is greater than the counting value threshold, judging that the video object has picture abnormality. The method effectively reduces the frequency of misjudgment that the video object has picture abnormality due to normal movement of an object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition, and in particular to a method, apparatus, device, and storage medium for determining image anomalies. Background Technology

[0002] With the rapid development of deep learning, computer vision has become the most important technology in the field of artificial intelligence, mainly involving reading video streams from cameras.

[0003] When the camera's imaging unit malfunctions or in weather conditions such as heavy rain or fog (outdoors), the internal algorithm may function normally, but the acquired images may appear abnormal, leading to frequent misidentifications. These abnormal images and frequent misidentifications severely impact the daily screening and maintenance work of staff. Summary of the Invention

[0004] This invention provides a method, apparatus, device, and storage medium for determining screen anomalies, in order to solve the problem of inaccurate identification of screen anomalies.

[0005] In a first aspect, the present invention provides a method for determining image anomalies, the method comprising:

[0006] Obtain a frame image of a preset video object as the first target image;

[0007] The preset template image is compared with the first target image to obtain the first comparison result;

[0008] Obtain the next frame image of the first target image in the preset video object as the second target image, compare the preset template image with the second target image to obtain a second comparison result;

[0009] Obtain the difference information between the first comparison result and the second comparison result;

[0010] Based on the difference information, determine whether the first target image is an abnormal image;

[0011] If the first target image is an abnormal image, the count value of the preset counting unit is increased by a preset first value;

[0012] Determine whether the count value of the preset counting unit is greater than the preset count value threshold;

[0013] If the count value of the preset counting unit is greater than the preset count value threshold, it is determined that the video object has an abnormal picture.

[0014] In a second aspect, the present invention provides a screen anomaly determination device, including a unit for performing the screen anomaly determination method as described in any embodiment of the first aspect.

[0015] Thirdly, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0016] Memory, used to store computer programs;

[0017] When a processor executes a program stored in a memory, it implements the steps of the screen anomaly determination method described in any embodiment of the first aspect.

[0018] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, wherein when executed by a processor, the computer program implements the steps of the screen anomaly determination method as described in any embodiment of the first aspect.

[0019] The technical solutions provided in the embodiments of the present invention have the following advantages compared with the prior art:

[0020] The method provided in this embodiment of the invention is based on a preset template image. It obtains a first comparison result and a second comparison result between two adjacent frames of images and the template image, and further compares the first comparison result and the second comparison result to obtain the difference information between the first comparison result and the second comparison result. Based on the difference information result, a preset algorithm is used to calculate and determine whether there is an abnormally moving object in the first target image. If there is an abnormally moving object in the first target image, the first target image is determined to be an abnormal image. The frequency of the first target image being an abnormal image is determined by the count value of the counting unit. Only when the count value is greater than a preset count value threshold is the video object determined to have a picture abnormality. This effectively reduces the frequency of misjudging the video object as having a picture abnormality due to normal object movement. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating a method for determining screen anomalies according to an embodiment of the present invention.

[0024] Figure 2A schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention;

[0025] Figure 3 A schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention;

[0026] Figure 4 A schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention;

[0027] Figure 5 A schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention;

[0028] Figure 6 A schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention;

[0029] Figure 7 A schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention;

[0030] Figure 8 This is a schematic diagram of the structure of a screen anomaly detection device provided in an embodiment of the present invention;

[0031] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] Example

[0034] Figure 1 This is a flowchart illustrating a method for determining image anomalies according to an embodiment of the present invention. The present invention proposes a method for determining image anomalies; specifically, see [link to documentation]. Figure 1 The method for determining abnormalities in the image includes the following steps S101-S108.

[0035] S101, Obtain the frame image of the preset video object as the first target image.

[0036] In practice, the video object refers to the video stream or video file acquired by the acquisition device. Frame images are extracted from the video object and used as the first target image.

[0037] S102, compare the preset template image with the first target image to obtain the first comparison result.

[0038] In specific implementation, the first comparison result includes the difference data between the template image and the first target image. The difference data can be obtained through algorithms such as comparison algorithm, contrast detection algorithm, and XOR algorithm.

[0039] In one embodiment, see Figure 2 , Figure 2 This is a schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention. Step S102 above includes steps S201-S202:

[0040] S201, Based on a preset twin network, the preset template image is compared with the first target image to generate a first binary image as the first comparison result.

[0041] In specific implementation, a Siamese network refers to a "conjoined neural network." The "conjoined" nature of the neural network is achieved by two neural networks sharing weights. By training a pre-defined conjoined neural network with customized characteristics, the trained conjoined neural network can have two inputs and one output. This means it can simultaneously input a template image and a first target image, compare the input template image and the first target image, and perform binarization processing on the regions that are the same or different between the input template image and the first target image, resulting in a first binary image. For example, by comparing the input template image and the first target image using a Siamese network, regions that are the same in the input template image and the first target image are marked with a value of 0, and regions that are different are marked with a value of 255. The final result is a first binary image containing only values ​​0 and 255, which is then used as the first comparison result.

[0042] By using a Siamese network to obtain the first binary image after comparing the template image and the first target image, the difference data between the template image and the first target image can be obtained more accurately. Furthermore, the Siamese network has convolution operations, which can effectively handle scenarios where the template image and the first target image have different resolutions, further improving the accuracy of obtaining the difference data between the template image and the first target image.

[0043] S202, based on the preset twin network, the preset template image is compared with the second target image to generate a second binary image as the second comparison result.

[0044] In practical implementation, a Siamese network refers to a "conjoined neural network." The "conjoined" nature of the neural network is achieved by two neural networks sharing weights. By training a pre-defined conjoined neural network with customized characteristics, the trained conjoined neural network can have two inputs and one output. This means it can simultaneously input a template image and a first target image, and then compare the input template image and the second target image. Binarization is performed on the regions that are the same or different between the input template image and the second target image, resulting in a second binary image. For example, by comparing the input template image and the second target image using a Siamese network, regions that are the same in the input template image and the second target image are marked with a value of 0, and regions that are different are marked with a value of 255. The final result is a second binary image containing only values ​​0 and 255, which is then used as the second comparison result.

[0045] By using a Siamese network to obtain a second binary image after comparing the template image and the second target image, the difference data between the template image and the second target image can be obtained more accurately. Furthermore, the Siamese network has convolution operations, which can effectively handle scenarios where the template image and the second target image have different resolutions, further improving the accuracy of obtaining the difference data between the template image and the second target image.

[0046] S103, obtain the next frame image of the first target image in the preset video object as the second target image, compare the preset template image with the second target image to obtain a second comparison result.

[0047] In practice, the second comparison result includes the difference data between the template image and the second target image. The difference data can be obtained through algorithms such as comparison algorithm, contrast detection algorithm, and XOR algorithm.

[0048] S104, Obtain the difference information between the first comparison result and the second comparison result.

[0049] In specific implementation, the difference information includes the difference data between the first comparison result and the second comparison result. In one embodiment, when people, vehicles, animals, etc., are moving normally, the pixel coordinates of the difference data in the first comparison result and the difference data in the second comparison result are approximately the same in the comparison results of two adjacent frames compared with the template image (i.e., the first comparison result and the second comparison result). Therefore, when people, vehicles, animals, etc., are moving normally, the proportion of identical data in the difference information between the first comparison result and the second comparison result is large, and the proportion of difference data in the difference information is small; while when there are abnormal fluctuations in the image or irregular changes such as rain, snow, and fog, the proportion of identical data in the difference information between the first comparison result and the second comparison result is small, and the proportion of difference data in the difference information is large.

[0050] By further calculating the difference information between the first comparison result and the second comparison result, the proportion of identical data and the proportion of different data in the difference information between the first comparison result and the second comparison result can be obtained. In this way, it can be determined whether the screen frame is an abnormal image, obtain frame images that filter normal object movement efficiently and accurately, and identify frame images with abnormal fluctuations and large changes in the screen.

[0051] In one embodiment, see Figure 3 , Figure 3 This is a schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention. Step S104 above includes steps S301-S304:

[0052] S301, determine whether the pixel values ​​of the first binary image and the second binary image are the same at the same pixel coordinate.

[0053] In practice, based on the same pixel coordinates in the first and second binary images, the pixel values ​​(i.e., values ​​0 or 255) of the first binary image and the pixel values ​​(i.e., values ​​0 or 255) of the second binary image are compared to see if they are the same.

[0054] S302, if the first binary image and the second binary image have the same pixel value at the same pixel coordinate, record the value corresponding to the pixel coordinate as the preset second value.

[0055] In practice, when the pixel value of the first binary image at pixel coordinates is the same as the pixel value of the second binary image, the value corresponding to the pixel coordinates is recorded as a second numerical value. This second numerical value can be any natural number such as 0, 1, 2, 3, etc.

[0056] In one embodiment, under the same pixel coordinates, when the pixel value of the first binary image and the pixel value of the second binary image are both 0, or when the pixel value of the first binary image and the pixel value of the second binary image are both 255, the value corresponding to the pixel coordinates is recorded as the preset second value.

[0057] S303, if the pixel values ​​of the first binary image and the second binary image are different at the same pixel coordinate, record the value corresponding to the pixel coordinate as the preset third value.

[0058] In practice, when the pixel value of the first binary image at pixel coordinates is different from the pixel value of the second binary image, the value corresponding to the pixel coordinates is recorded as a third value. The third value can be any natural number such as 0, 1, 2, 3, etc., and cannot be the same as the second value.

[0059] In one embodiment, under the same pixel coordinates, when the pixel value of the first binary image is 0 and the pixel value of the second binary image is 255; or when the pixel value of the first binary image is 255 and the pixel value of the second binary image is 0, the value corresponding to the pixel coordinates is recorded as the preset third value.

[0060] S304, a third binary image is generated based on the values ​​corresponding to all the pixel coordinates as the difference information.

[0061] In a specific implementation, the values ​​corresponding to all pixel coordinates (i.e., the second and third values) are used to generate a third binary image, and the third binary image is used as the difference information.

[0062] Binary images refer to images where each pixel has only two possible values ​​(i.e., a second value or a third value), thereby amplifying the differences in features.

[0063] By obtaining a third binary image after comparing the first and second binary images, the movement of the object between the two frames can be obtained more accurately, so as to further determine whether the object is moving normally or abnormally.

[0064] S105, determine whether the first target image is an abnormal image based on the difference information.

[0065] In practice, the difference information includes the difference data and the same data between the first comparison result and the second comparison result. Based on the difference data and the same data between the first comparison result and the second comparison result, combined with the threshold set by the staff, it can be determined whether the first target image is an abnormal image.

[0066] In one embodiment, see Figure 4 , Figure 4 This is a schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention. Step S105 above includes steps S401-S402:

[0067] S401, Obtain the contour contained in the third binary image.

[0068] In practice, the contour contained in the third binary image can be obtained from the intersection of the second and third values ​​contained in the third binary image.

[0069] S402, determine whether the first target image is an abnormal image based on the contour.

[0070] In practice, the contour data can be further extracted and processed to determine whether the first target image is an abnormal image.

[0071] In one embodiment, see Figure 5 , Figure 5 This is a schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention. Step S402 above includes steps S411-S412:

[0072] S411, obtain the number of contours, and determine whether the number of contours is greater than a preset contour number threshold.

[0073] In practice, the number of contours can be obtained. For example, when there is rain or snow, the rain and snow images in two frames are scattered and there are many contours. By judging whether the number of contours is greater than the preset contour number threshold, the abnormality of the frame image caused by rain and snow can be effectively judged.

[0074] S412, if the number of contours is greater than a preset contour number threshold, the first target image is determined to be an abnormal image.

[0075] In specific implementation, when the number of contours is greater than a preset contour number threshold, it is determined that the first target image has frame image anomalies caused by rain and snow weather, that is, the first target image is an abnormal image.

[0076] In one embodiment, see Figure 6 , Figure 6 This is a schematic diagram of a sub-process of a method for determining screen anomalies provided in an embodiment of the present invention. Step S402 above includes steps S421-S422:

[0077] S421, obtain the area enclosed by the contour, and determine whether the area enclosed by the contour is greater than a preset contour area threshold.

[0078] In practice, the area enclosed by the contour can be obtained. For example, when there is foggy weather, the fog images in two frames are continuous and the area enclosed by the occluded part is large. By judging whether the area enclosed by the contour is greater than the preset contour area threshold, the abnormality of the frame image caused by foggy weather can be effectively judged.

[0079] S422, if the area enclosed by the contour is greater than a preset contour area threshold, the first target image is determined to be an abnormal image.

[0080] In specific implementation, when the area enclosed by the contour is greater than the preset contour area threshold, it is determined that the first target image has a frame image abnormality caused by foggy weather, that is, the first target image is an abnormal image.

[0081] In one embodiment, step S402 includes: obtaining the number of contours and the area enclosed by the contours; if the number of contours is not greater than the preset contour number threshold and the area enclosed by the contours is not greater than the preset contour area threshold, the first target image is determined to be a normal image.

[0082] In practice, the first target image is determined to be a normal image only when the number of contours is not greater than the preset contour number threshold and the area enclosed by the contours is not greater than the preset contour area threshold.

[0083] Only by rigorously filtering images generated by normally moving objects can the workload of staff be effectively reduced.

[0084] S106, if the first target image is an abnormal image, increase the count value of the preset counting unit by a preset first value.

[0085] In specific implementation, the count value of the counting unit is used to record the current number of anomalies. The count value is a variable, and the first value can be, for example, a natural number such as 0, 1, 2, 3, etc. In one embodiment, the first value is 1, and the initial value of the count value of the counting unit is 0. If the first target image is an anomaly image, the count value is increased by 1, resulting in an updated count value of 1. At the same time, the updated count value is stored as the count value of the counting unit.

[0086] S107, determine whether the count value of the preset counting unit is greater than the preset count value threshold.

[0087] In specific implementation, after step S106, the updated count value is obtained as the count value of the counting unit, and the count value is compared with the preset count value threshold to determine whether the count value of the preset counting unit is greater than the preset count value threshold.

[0088] S108, if the count value of the preset counting unit is greater than the preset count value threshold, it is determined that the video object has an abnormal picture.

[0089] In practice, if the count value of the preset counting unit is greater than the preset counting threshold, meaning that the video object's frame image frequently exhibits abnormal fluctuations and irregular changes such as rain, snow, or fog, it is determined that the video object has an image anomaly, and the image anomaly information is output to the monitoring terminal to facilitate staff investigation. Using the count value of the counting unit and the counting threshold to further determine whether the video object has an image anomaly, and avoiding the direct judgment of occasional abnormal fluctuations and irregular changes such as rain, snow, or fog as having an image anomaly, makes this approach more practical.

[0090] In one embodiment, see Figure 7 , Figure 7 This is a schematic diagram of a sub-process of a method for determining screen anomalies according to an embodiment of the present invention. The method for determining screen anomalies further includes steps S109 and S110:

[0091] S109, if the first target image is a normal image, reduce the count value of the preset counting unit by a preset fourth value, and use the second target image as the new first target image, then proceed to step S103.

[0092] In specific implementation, the count value of the counting unit is used to record the current number of anomalies. The count value is a variable, and the fourth value can be, for example, a natural number such as 1, 2, 3, etc. In one embodiment, the fourth value is 1, and the initial value of the count value of the counting unit is 1. If the first target image is a normal image, the count value is reduced by 1, resulting in an updated count value of 0. At the same time, the updated count value is stored as the count value of the counting unit.

[0093] In one embodiment, to prevent the program from adding or subtracting the count value variable without upper or lower limits, the range of the count value variable is typically set to (0, count value threshold + 10). When the count value variable reaches the boundary of the range, it is no longer added or subtracted. For example, if the first value is 1 and the initial count value of the counting unit is 0, if the first target image is a normal image, the count value is reduced by 1, but the range of the count value variable is (0, count value threshold + 10), so the updated count value is still 0, and the updated count value is stored as the count value of the counting unit. The second target image is used as the new first target image, and the process proceeds to step S103. Steps S101-S110 are repeated as the video object is updated until it is determined that the video object has a picture abnormality or an instruction to stop executing the method is received.

[0094] S110, if the count value of the preset counting unit is not greater than the preset count value threshold, the second target image is used as the new first target image, and the process proceeds to the step of comparing the preset template image with the first target image to obtain the first comparison result.

[0095] In specific implementation, when the count value of the preset counting unit is not greater than the preset count value threshold, the second target image is directly used as the new first target image, and the process proceeds to step S103.

[0096] Based on a preset template image, the system obtains the first and second comparison results of two adjacent frames with the template image, and further compares the first and second comparison results to obtain the difference information between them. Based on the difference information, a preset algorithm is used to calculate and determine whether there is an abnormally moving object in the first target image. If there is an abnormally moving object in the first target image, it is determined to be an abnormal image. The frequency of the first target image being an abnormal image is determined by the count value of the counting unit. Only when the count value is greater than the preset count value threshold is the video object determined to have a picture abnormality, effectively reducing the frequency of misjudging the video object as having a picture abnormality due to normal object movement.

[0097] See Figure 8 This invention also provides an image anomaly determination device 600. The template image automatic update device includes a first acquisition unit 601, a comparison unit 602, a second acquisition unit 603, a third acquisition unit 604, a first judgment unit 605, a calculation unit 606, a second judgment unit 607, and a judgment unit 608.

[0098] The first acquisition unit 601 acquires a frame image of a preset video object as the first target image.

[0099] The comparison unit 602 compares the preset template image with the first target image to obtain a first comparison result.

[0100] The step of comparing the preset template image with the first target image to obtain a first comparison result includes:

[0101] The preset template image is compared with the first target image based on a preset twin network to generate a first binary image as the first comparison result.

[0102] The second acquisition unit 603 acquires the next frame image of the first target image in the preset video object as the second target image, compares the preset template image with the second target image, and obtains a second comparison result.

[0103] The step of comparing the preset template image with the second target image to obtain a second comparison result includes:

[0104] Based on the preset twin network, the preset template image is compared with the second target image to generate a second binary image as the second comparison result.

[0105] The third acquisition unit 604 acquires the difference information between the first comparison result and the second comparison result.

[0106] The step of obtaining the difference information between the first comparison result and the second comparison result includes:

[0107] Determine whether the pixel values ​​of the first binary image and the second binary image are the same at the same pixel coordinates;

[0108] If the first binary image and the second binary image have the same pixel value at the same pixel coordinate, the value corresponding to the pixel coordinate is recorded as the preset second value;

[0109] If the pixel values ​​of the first binary image and the second binary image are different at the same pixel coordinate, the value corresponding to the pixel coordinate is recorded as the preset third value;

[0110] A third binary image is generated based on the values ​​corresponding to all the pixel coordinates as the difference information.

[0111] The first judgment unit 605 determines whether the first target image is an abnormal image based on the difference information.

[0112] The step of determining whether the first target image is an abnormal image based on the difference information includes:

[0113] Obtain the contour contained in the third binary image;

[0114] Based on the contour, determine whether the first target image is an abnormal image.

[0115] The step of determining whether the first target image is an abnormal image based on the contour includes:

[0116] The number of contours is obtained, and it is determined whether the number of contours is greater than a preset contour number threshold.

[0117] If the number of contours is greater than a preset contour number threshold, the first target image is determined to be an abnormal image.

[0118] The step of determining whether the first target image is an abnormal image based on the contour includes:

[0119] Obtain the area enclosed by the contour, and determine whether the area enclosed by the contour is greater than a preset contour area threshold;

[0120] If the area enclosed by the contour is greater than a preset contour area threshold, the first target image is determined to be an abnormal image.

[0121] Determining whether the first target image is an abnormal image based on the contour includes:

[0122] The number of contours and the area enclosed by the contours are obtained. If the number of contours is not greater than the preset contour number threshold and the area enclosed by the contours is not greater than the preset contour area threshold, the first target image is determined to be a normal image.

[0123] After determining whether the first target image is an abnormal image based on the difference information, the method further includes:

[0124] If the first target image is a normal image, the count value of the preset counting unit is reduced by a preset fourth value;

[0125] The second target image is used as the new first target image, and the process proceeds to the step of comparing the preset template image with the first target image to obtain the first comparison result.

[0126] If the first target image is an abnormal image, the calculation unit 606 increases the count value of the preset counting unit by a preset first value.

[0127] The second judgment unit 607 determines whether the count value of the preset counting unit is greater than the preset count value threshold.

[0128] If the count value of the preset counting unit is greater than the preset count value threshold, the determination unit 608 determines that the video object has an abnormal picture.

[0129] like Figure 9 As shown, this embodiment of the invention provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0130] Memory 113 is used to store computer programs;

[0131] In one embodiment of the present invention, when the processor 111 executes the program stored in the memory 113, it implements the screen anomaly determination method provided in any of the aforementioned method embodiments.

[0132] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the screen anomaly determination method provided in any of the foregoing method embodiments.

[0133] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0134] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for determining image anomalies, characterized in that, The method includes: Obtain a frame image of a preset video object as the first target image; The preset template image is compared with the first target image to obtain the first comparison result; Obtain the next frame image of the first target image in the preset video object as the second target image, compare the preset template image with the second target image to obtain a second comparison result; Obtain the difference information between the first comparison result and the second comparison result; Based on the difference information, determine whether the first target image is an abnormal image; If the first target image is an abnormal image, the count value of the preset counting unit is increased by a preset first value; Determine whether the count value of the preset counting unit is greater than the preset count value threshold; If the count value of the preset counting unit is greater than the preset count value threshold, it is determined that the video object has an abnormal picture. The step of comparing the preset template image with the first target image to obtain a first comparison result includes: Based on a preset twin network, the preset template image is compared with the first target image to generate a first binary image as the first comparison result; Based on the preset twin network, the preset template image is compared with the second target image to generate a second binary image as the second comparison result; The step of obtaining the difference information between the first comparison result and the second comparison result includes: Determine whether the pixel values ​​of the first binary image and the second binary image are the same at the same pixel coordinates; If the first binary image and the second binary image have the same pixel value at the same pixel coordinate, the value corresponding to the pixel coordinate is recorded as a preset second value; If the pixel values ​​of the first binary image and the second binary image are different at the same pixel coordinate, the value corresponding to the pixel coordinate is recorded as a preset third value; A third binary image is generated based on the values ​​corresponding to all the pixel coordinates as the difference information.

2. The method according to claim 1, characterized in that, The step of determining whether the first target image is an abnormal image based on the difference information includes: Obtain the contour contained in the third binary image; Based on the contour, determine whether the first target image is an abnormal image.

3. The method according to claim 2, characterized in that, The step of determining whether the first target image is an abnormal image based on the contour includes: The number of contours is obtained, and it is determined whether the number of contours is greater than a preset contour number threshold. If the number of contours is greater than a preset contour number threshold, the first target image is determined to be an abnormal image.

4. The method according to claim 2, characterized in that, The step of determining whether the first target image is an abnormal image based on the contour includes: Obtain the area enclosed by the contour, and determine whether the area enclosed by the contour is greater than a preset contour area threshold; If the area enclosed by the contour is greater than a preset contour area threshold, the first target image is determined to be an abnormal image.

5. The method according to claim 2, characterized in that, Determining whether the first target image is an abnormal image based on the contour includes: The number of contours and the area enclosed by the contours are obtained. If the number of contours is not greater than a preset contour number threshold and the area enclosed by the contours is not greater than the preset contour area threshold, the first target image is determined to be a normal image.

6. The method according to claim 1, characterized in that, The method further includes: If the first target image is a normal image, the count value of the preset counting unit is reduced by a preset fourth value, the second target image is used as the new first target image, and the process proceeds to the step of comparing the preset template image with the first target image to obtain the first comparison result. If the count value of the preset counting unit is not greater than the preset count value threshold, the second target image is used as the new first target image, and the process proceeds to the step of comparing the preset template image with the first target image to obtain the first comparison result.

7. A device for determining image anomalies, characterized in that, Includes a unit for performing the method as described in any one of claims 1-6.

8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Monitoring picture anomaly detection method and device and storage medium

    CN111898486A

  • Camera picture detection method and device, electronic equipment and readable storage medium

    CN112040219A

  • Security system and method

    US20120229630A1