CN116156157B - Camera shielding abnormality detection method and electronic equipment - Google Patents

Camera shielding abnormality detection method and electronic equipment Download PDF

Info

Publication number
CN116156157B
CN116156157B CN202310443237.6A CN202310443237A CN116156157B CN 116156157 B CN116156157 B CN 116156157B CN 202310443237 A CN202310443237 A CN 202310443237A CN 116156157 B CN116156157 B CN 116156157B
Authority
CN
China
Prior art keywords
image
camera
image block
texture
characteristic
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.)
Active
Application number
CN202310443237.6A
Other languages
Chinese (zh)
Other versions
CN116156157A (en
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.)
Changsha Hisense Intelligent System Research Institute Co ltd
Original Assignee
Changsha Hisense Intelligent System Research Institute 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 Changsha Hisense Intelligent System Research Institute Co ltd filed Critical Changsha Hisense Intelligent System Research Institute Co ltd
Priority to CN202310443237.6A priority Critical patent/CN116156157B/en
Publication of CN116156157A publication Critical patent/CN116156157A/en
Application granted granted Critical
Publication of CN116156157B publication Critical patent/CN116156157B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/54Extraction of image or video features relating to texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Signal Processing (AREA)
  • Biomedical Technology (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a detection method for camera shielding abnormality and electronic equipment. The application can detect the condition of the camera in real time based on the video single-frame image, and has the performance of low delay and high precision; the picture position information, texture information, brightness information and pixel value distribution information are fully utilized, and the method has the characteristics of high flexibility and high accuracy; the abnormal situations except the normal and the blocked camera can be respectively identified. The anomaly defined by the application refers to the condition that the image of the camera is blurred and unclear due to signal disturbance, light and other reasons.

Description

Camera shielding abnormality detection method and electronic equipment
Technical Field
The application relates to the field of image recognition, in particular to a method for detecting shielding abnormality of a camera and electronic equipment.
Background
Safety problems have been very interesting, especially in important public places, and in order to ensure the safety of people, monitoring cameras are often installed. A clear monitoring device can help us prevent something from happening, and can also provide a first field picture for tracing other things.
For example, the monitoring camera is arranged on the bus, so that the situation of a driver and passengers can be known in time, and safety management is facilitated. The manager can timely and intuitively know the conditions of driver and passenger in the vehicle through the monitoring camera, and is convenient for analysis and management work implementation. Meanwhile, the video picture provided by the camera is also main data for analyzing the behavior of the driver. The above situations all require that the camera works under normal conditions to achieve an auxiliary effect, and once the camera is shielded or abnormal, the camera cannot observe the monitored object, although some methods for detecting whether the camera is shielded exist at present. The application patent application CN106326917A discloses an intelligent detection method for camera occlusion, which comprises the steps of image downsampling, gabor filtering treatment, PCA dimension reduction treatment, data training, occlusion judgment and the like, wherein a support vector machine is trained by taking uniformLBP characteristics of an image as learning classification characteristics, whether the camera is occluded or not is judged by using the trained parameters, the stability and the accuracy of the uniformLBP characteristics of the sample image are improved by carrying out Gabor filtering on the acquired sample image, the training data quantity of the support vector machine is reduced by carrying out PCA dimension reduction on the uniformLBP characteristics, and the intelligent detection method is reliable in principle, high in judgment speed, low in implementation cost and environment-friendly. The application patent CN104240235B discloses a method and a system for detecting the occlusion of a camera, which mainly comprise the steps of selecting a frame of image of the camera when the camera is not occluded as a reference frame, comparing the distribution similarity of gray histograms of a current frame and the reference frame, if the similarity is smaller than a first threshold value, sequentially comparing the distribution similarity of gray histograms of a continuous multi-frame and the reference frame after the current frame, if the similarity is smaller than the first threshold value, taking the next frame of the continuous multi-frame as the first current frame, comparing the similarity of gray histograms of every two adjacent frames of images between the first current frame and the continuous multi-frame after the first current frame, and if the distribution similarity of the gray histograms of every two adjacent frames of images between the first current frame and the continuous multi-frame after the first current frame is greater than a second threshold value, determining the state of the camera as the occlusion. The application patent application CN111275658A discloses a method and a system for detecting camera occlusion, which comprise the steps of obtaining color information of each pixel unit of an image, counting the number of color types of the image according to the color information of each pixel unit of the image, judging that a camera for shooting the image is occluded if the number of the color types of the image is smaller than an occlusion critical threshold value, judging that the camera for shooting the image is not occluded if the number of the color types of the image is larger than or equal to the occlusion critical threshold value, and detecting whether the camera for shooting the image is occluded or not according to single-frame image information.
However, the above method has some problems, such as failure to work in a scene with a complex background, failure to identify a shade with uneven brightness, failure to identify an abnormal light pollution, etc., resulting in extremely high false alarm rate and false alarm rate.
Disclosure of Invention
In order to solve the technical problems, the application provides a detection method for camera shielding abnormality and electronic equipment. The aim of the application is achieved by the following technical scheme:
a detection method for camera shielding abnormality comprises the following steps:
s101, inputting pictures: reading a video stream shot by a camera to acquire an image frame;
s102, converting a gray level diagram: converting the image frame into a gray scale map;
s103, partitioning: uniformly dividing a gray scale image into N x N image blocks; n is the number of image blocks in each row and each column, and N is more than or equal to 3;
s104, obtaining image block characteristics: respectively calculating to obtain each image block characteristic, wherein each image block characteristic comprises a histogram characteristic, a mean characteristic and a texture characteristic;
s105, obtaining image features: splicing the image block features to obtain the whole image features;
s106: obtaining an image block feature set: forming an image block feature set by the image block features and the whole image feature set;
s107: setting feature selection and judgment rules, and determining the conditions of the camera, wherein the conditions of the camera comprise normal and non-shielding, normal and shielding and abnormal conditions.
Further improvement, n=3.
Further improved, the feature selection and judgment rule in step S107 is as follows:
s1071, judging whether the texture characteristics of the middle area image block are larger than or equal to a first preset threshold value, if yes, enough textures are available, otherwise, the textures are not available; if the middle area image block has insufficient texture, indicating that the camera is normal and the occlusion or the camera is abnormal, entering step S1072; otherwise, enter step S1073;
s1072, judging the image brightness of the whole image based on the mean value characteristic, if the image brightness is larger than or equal to a second threshold value, enabling the camera to be normal and shielded, otherwise, entering step S1074;
s1073, judging whether the image texture is smaller than a third threshold value, wherein the image texture is not abundant if the image texture is smaller than the third threshold value, and otherwise, the image texture is abundant; if the image textures are not abundant, judging that the camera is abnormal, otherwise, turning to step S1075;
s1074, judging that the camera is normal and shielded if the texture features of the image blocks in the second row are smaller than or equal to 0, otherwise judging that the camera is abnormal;
s1075, judging the following two conditions: the first condition is that the histogram features of all the image blocks are ordered from big to small, the sum of the two maximum values is obtained, and whether the sum of the two maximum values is larger than or equal to 0.9 is judged; judging whether the standard deviation of three image blocks in each column is less than 225 x y/3 or not; if one of the first condition and the second condition is met, the camera is abnormal, otherwise, the camera is normal and is not shielded.
In a further improvement, in step S1071, the first preset threshold is y/2, and the value range of y is 0.005-0.05.
In a further improvement, in S1073, the third threshold value is y, and the value range of y is 0.005-0.05; and taking the largest texture characteristic in the second row of three image blocks as the image texture.
Further improvement, y=0.01
Further improved, in step S1072, the method for calculating the brightness of the image is as follows: sorting the values of the mean value features fm of all the image blocks, and averaging the four maximum values to obtain image brightness; the second threshold is 225/2.
In a further improvement, in the step S104, when the histogram feature of the image block is extracted, the image block is equally divided into 10 groups from 0 to 255, and the probability value of the gray value distribution of each group of pixels is obtained as the histogram feature.
In a further improvement, in step S103, the gray scale map is uniformly divided into nine blocks according to a form of nine-grid, and the numbers are sequentially ordered in the order from top to bottom and from left to right.
An electronic device, comprising: a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the method as described above.
The application has the beneficial effects that:
first: the application can detect the condition of the camera in real time based on the video single-frame image and has the performance of low delay and high precision.
Second,: the application fully utilizes the picture position information, the texture information, the brightness information and the pixel value distribution information, and has the characteristics of strong flexibility and high accuracy.
Third,: the application can respectively identify the abnormal conditions except the normal and the blocked camera. An anomaly as defined herein refers to a situation where a camera is blurred and unclear due to signal disturbance, light, and the like.
Drawings
The application is further illustrated by the accompanying drawings, the content of which does not constitute any limitation of the application.
FIG. 1 is a schematic illustration of image segmentation;
FIG. 2 is a schematic general flow diagram of the present application;
fig. 3 is a flow chart illustrating the setting of the feature selection and judgment rule in step S107;
FIG. 4-1 is an occlusion type detection diagram I;
FIG. 4-2 illustrates a second view of occlusion type detection;
FIG. 4-3 illustrates a third view of occlusion type detection;
FIGS. 4-4 show a fourth view of occlusion type detection;
FIGS. 4-5 detect FIG. five for occlusion type;
FIGS. 4-6 detect a sixth view for occlusion type;
FIGS. 4-7 illustrate a seven for occlusion type detection;
FIGS. 4-8 detect an eighth view for occlusion type;
FIG. 5-1 is an anomaly type detection graph I;
FIG. 5-2 is an anomaly type detection graph II;
5-3 are anomaly type detection graphs three;
5-4 are diagrams of anomaly type detection;
5-5 are anomaly type detection diagrams five;
FIGS. 5-6 illustrate a sixth example of anomaly type detection;
fig. 5-7 show a seven for anomaly type detection.
Detailed Description
The application will be further described in detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the application more apparent.
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. indicate orientations or positional relationships based on the drawings are merely for convenience in describing the present application and simplifying the description, and do not indicate or imply that the apparatus or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present application. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more features. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
In the present application, the term "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described as "exemplary" in this disclosure is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for purposes of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes have not been described in detail so as not to obscure the description of the application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
Example 1
The method for detecting the shielding abnormality of the camera shown in fig. 2 comprises the following steps:
s101, reading a video stream shot by a camera, and acquiring an image frame: reading a video stream shot by a camera to obtain an image frame of the video stream, wherein the image frame needs to be judged in a time point;
s102, converting the image frame obtained in the step S101 into a gray scale map with gray scale values;
s103, partitioning: and uniformly dividing the gray level image in the step S102 into 9 blocks according to a nine-grid mode to obtain 9 image blocks. The specific image block features are extracted by numbering as shown in fig. 1, and the specific image block features are extracted as follows:
the image is divided into three rows and three columns (where horizontal is the row and vertical is the column). The nine-grid form shown in fig. 1 is that the image blocks are numbered sequentially from left to right from top to bottom, so as to obtain the image block 1, the image block 2, the image block 3, the image block 4, the image block 5, the image block 6, the image block 7, the image block 8 and the image block 9.
S104, obtaining image block characteristics: extracting histogram features f of image block 1, image block 2, image block 3, image block 4, image block 5, image block 6, image block 7, image block 8, and image block 9, respectively h Mean characteristic f m
Grouping in extracting histogram features is equally divided into a groups from 0-255 to obtain probability values of pixel distribution of each group, thus f h ∈R 1*N . According to the research of experimental data, the value a is adjusted to be 10, the optimal effect can be obtained at this time, but other values such as 5, 8, 11 and 15 can also obtain better judgment results, so that the adjustment of the value of N only belongs to simple replacement of the application and is within the protection scope of the application.
More specifically, the histogram feature is a commonly used data statistics. And (3) taking different values of a certain physical or characteristic quantity, finding out the maximum value and the minimum value of the physical or characteristic quantity, determining a section to contain all measured data, dividing the section into a plurality of sections, counting the frequency or the duty ratio of the measured result among the sections, taking the measured data as an abscissa, and drawing each section and the corresponding frequency or the duty ratio of the section as an ordinate, thereby obtaining a rectangular chart, namely a statistical histogram. The number of cells divided in the histogram is called the group number, and is expressed by bins, wherein the difference between the horizontal coordinates of two endpoints in each group is called the group distance. The interval of the minimum and maximum values of the data represented by the histogram is called the range of values (range) of the histogram. A histogram with the same group spacing for all groups is referred to as a uniform histogram (uniform histogram), otherwise it is referred to as a non-uniform histogram. The histogram established based on one physical quantity or object characteristic value is a one-dimensional histogram, and in fact, a multi-dimensional histogram can be established based on a plurality of physical quantities or characteristic values, for example, a population distribution histogram established based on age+years of education in population data is a two-dimensional histogram. The number of physical quantities or feature quantities is called the dimension of the histogram and is expressed in dims. The present application is obvious as one-dimensional histogram feature.
Mean characteristic f of the application m The average value is obtained by weighting and averaging the pixel values of all the pixel points, namely the gray values of all the pixel points are accumulated and summed, and then the value obtained by dividing the gray values by the number of the pixel points is the average value characteristic f m . The average characteristic of the gray values of the image can show the brightness degree in the corresponding area of the image, and belongs to the numerical measurement of the brightness of an area.
S1032, extracting texture features of the image block: the method comprises the steps of obtaining a feature matrix M consistent with each image block in size by adopting a canny edge feature extraction operator, wherein the matrix is a binary matrix, detecting that the matrix value of an edge is 1, detecting that the matrix value of the edge is 0, adding the matrix values, and dividing the number of pixels of the image blocks to obtain texture features. The calculation formula is as follows
Wherein M is a matrix obtained by an edge feature extraction operator, m=canny (img), canny () is an edge feature extraction operator, an input is an image, and an output is a matrix equal to the image frame height; m is m ab For the values of the feature matrix M in row a and column b,w,hthe width and the height of the image block are; f (f) t Is a texture feature of the image block.
Wherein the texture features characterize the turbulence of the pixel points and the sitting complexity. The larger the texture feature value, the more complex the texture of the image is; the smaller the texture feature value, the smoother the texture of the image.
S105, obtaining image features: histogram feature f of each image block h Mean characteristic f m And texture feature f t Splicing to obtain the characteristic F of a single image block i ∈R 1*12 Sequentially extracting features of image block 1, image block 2, image block 3, image block 4, image block 5, image block 6, image block 7, image block 8, and image block 9, and splicingObtaining the characteristic F epsilon R of the whole image 9*12 Wherein the texture features F of the whole image t ∈R 9*1 Mean characteristic F m ∈R 9*1
The method comprises the following steps of (1) denoising, namely performing convolution on an image by Gaussian filtering, 2, obtaining gradients, namely performing convolution on the image by using a gradient filtering template, obtaining gradients in the X direction and the Y direction of the image and corresponding included angles, 3, performing non-maximum suppression, namely comparing a gradient module value of each pixel with two adjacent pixels in the gradient direction, and reserving pixel gray levels with the gradient as a maximum point, and 4, drawing edges by double thresholds: and taking the edge extracted by the high threshold value as a main edge, supplementing the low threshold value edge connected with the main edge at the edge incomplete part, and finally forming complete edge information.
S106, obtaining an image block feature set: histogram feature f of block 1, block 2, block 3, block 4, block 5, block 6, block 7, block 8, block 9 h Mean characteristic f m And texture feature f t And F i ∈R 1*12 And the characteristics F E R of the whole image 9*12 Texture feature F t ∈R 9*1 And mean feature F m ∈R 9*1 The collection constitutes a set of image block features.
S107, setting feature selection and judgment rules, and determining the condition of a camera, wherein the condition of the camera comprises normal and non-shielding, normal and shielding and abnormality: after the features of the entire image are obtained, the detection rules of occlusion and abnormality are set next based on the extracted features. The application constructs and designs an occlusion anomaly detection mechanism based on the characteristics, the pixel block position information and the pixel block local relation, wherein the detection mechanism is shown in fig. 3 in the specification and the drawing of the application, namely, the occlusion anomaly detection flow of the application is realized as follows:
s1071, judging whether the texture characteristics of the middle area image block are larger than or equal to a first preset threshold value, if yes, enough textures are available, otherwise, the textures are not available; if the middle area image block has insufficient texture, the shooting is describedIf the camera is normal and the shielding or camera is abnormal, step S1072 is performed; otherwise, step S1073 is entered: if the middle area of the image has insufficient texture, which indicates that the camera is blocked or abnormal, the step S1072 is performed to detect the blocking abnormality of the camera, otherwise the step S1073 is performed to determine whether the texture of the image is abundant. The specific judgment rule of the step is carried out by the following formula: max (f) t2 ,f t5 ,f t8 ) Not less than y/2, wherein f ti The texture characteristic of the ith image block is represented, y is a set threshold value, the threshold value y is obtained through experiments in the optimization process, and 0.01 is found to be optimal after y= 0.05,0.01,0.005,0.015 is tried to be equivalent, but other values are also simple to adjust based on the application, so that the texture characteristic is also within the protection scope of the application. Wherein max () means that the maximum value is taken, i.e. max (f t2 ,f t5 ,f t8 ) Represents taking f t2 、f t5、 f t8 The largest of the three values is then determined if it is greater than or equal to y/2.
S1072, judging the image brightness of the whole image based on the mean value characteristics, if the image brightness is larger than or equal to a second threshold value, enabling the camera to be normal and shielded, otherwise, entering step S1074: in the step S1071, after the image lacks texture information, it is determined that the camera is in an occluded state or an abnormal state, then the step determines the brightness of the image based on the mean feature, and if the brightness of the image is less than the second threshold, the image is occluded. If the image is greater than or equal to the second threshold, step S1074 is performed to further determine. Specifically, the judgment formula in this step is as follows:
i.e. judging whether mean (Fm) [ -4: ]) > = 225/2 is true, the second threshold of this step is set to 225/2, but obviously replacing it with the remaining threshold belongs to a simple replacement of the technique of the present application, which is also within the scope of protection of the present application. Where mean () represents averaging.
mean (fm) [ -4: ] > = 225/2 means that the values of the mean feature fm of nine image blocks are first sorted, the four largest values are averaged, and then compared with 225/2.
S1073, judging whether the image texture is smaller than a third threshold value, wherein the image texture is not abundant if the image texture is smaller than the third threshold value, and otherwise, the image texture is abundant; if the image texture is not abundant, judging that the camera is abnormal, otherwise, turning to step S1075: in the step S1071, it is first determined whether the image texture is abundant after determining that the image has at least texture information greater than or equal to the first threshold, if the image texture is less than the preset third threshold y, the image texture is abundant, and if the image texture is greater than or equal to the third threshold y, the image texture is abundant.
The specific judgment formula is as follows:
max(f t2 ,f t5 ,f t8 )<y
in the sense that the texture feature f of the image block 2 is taken t2 Texture feature f of image block 3 t5 Texture feature f of image block 8 t8 And comparing it with a third threshold y to determine if it is less than y.
If the above is true, the texture is not rich, the image is detected as the camera is abnormal, otherwise, step S1075 is needed.
S1074, judging that the camera is normal and shielded if the texture features of the image blocks in the second row are smaller than or equal to 0, otherwise judging that the camera is abnormal: in step 1072, after it is determined that the image lacks texture information and has a certain brightness, it is further determined whether the image is blocked by a transparent object or has abnormal illumination. The determination rule is to determine whether or not the middle region pixel block has texture, i.e., to determine max (f t2 ,f t5 ,f t8 ) Is less than or equal to 0. If the texture is not present, the camera is judged to be normal and shielded, and if the texture is not present, the camera is judged to be abnormal.
The meaning of the above is to take the texture feature f of the image block 2 t2 Texture feature f of image block 3 t5 Texture feature f of image block 8 t8 And determining whether the maximum value is less than or equal to 0.
S1075, judging the following two conditions: the first condition is that all the image block histogram features are ordered from big to small, and the obtainedJudging whether the sum of the two maximum values is larger than or equal to 0.9; judging whether the standard deviation of three image blocks in each column is less than 225 x y/3 or not; if one of the first condition and the second condition is met, the camera is abnormal, otherwise, the camera is normal and is not shielded: the step is next to step S1073, where the image has abundant texture information, and the step detects whether the image texture is abnormal such as a screen (bar, snow pattern, black and white block) of the camera. The detection rule makes a judgment for the pixel distribution and the luminance distribution based on the histogram. Firstly, taking the histogram characteristic of the image block in the middle area, calculating the sum of maximum probability values, wherein the maximum probability values represent the proportion of two pixel intervals with the largest distribution to the whole image, and if the maximum probability values are larger than 0.9, the image block has excessively single pixels. Or counting the mean value characteristics of the images, and detecting whether the mean value of the image blocks in each column of the images has a significant difference. If the rule is not met, the image is normal, otherwise, the camera is abnormal. The specific judgment rule is as follows: sum (sort (f) hi )[:2])≥0.9 for i in[2,5,8] or std(f min )<255*y/3 for i[[1,4,7],[2,5,8],[3,6,9]]。
Wherein std (f) min )<255*y/3 for i[[1,4,7],[2,5,8],[3,6,9]]Can be replaced by std (f mj 、f mj+3 、f mj+6 )<255*y/3 for j in [1,2,3]The method comprises the steps of carrying out a first treatment on the surface of the j represents the j-th row, and is transversely arranged as a row and vertically arranged as a column in the application.
sum () represents the sum; sort (f) hi )[:2]Representing the ranking of the histogram features, taking the first two maxima after ranking, aiming at looking at the proportion of the most distributed pixels of the picture to the total, f hi Representing the histogram feature of the i-th image block,for i in[2,5,8]represents i=2, 5 or 8;for j in [1,2,3]represents j=1, 2 or 3; std () represents standard deviation, f mj Representing the mean characteristic of the image block of the j-th line.
The actual detection results of the present application are shown in fig. 4-1 to fig. 4-8 as occlusion. Fig. 5-1 to 5-7 show anomaly type detection, and the pictures of the cameras are all pictures of the cameras on the real road. On a real road, the camera can be influenced by strong light, rain, snow, wind, sand and other weather to cause abnormal detection. And sometimes, people can also shield the camera when the road is illegal, so that the camera is prevented from being shot. Therefore, when the camera is detected to be shielded at this time, the picture before shielding can be traced back in time and provided for the police so as to judge whether the illegal act occurs. When the camera is detected to be abnormal, the road administration or corresponding staff, drivers and the like can be timely notified to timely repair or replace the camera.
Furthermore, it is within the scope of the present application to make a simple replacement of the present application, such as a decision as to whether it is uniformly divided into thirty-six (i.e., originally each image block is subdivided into four) blocks, or it is substantially divided into nine-grid blocks, and further to make an adaptive adjustment of the threshold value as needed, such as setting y to 0.015, etc., which is a simple replacement in the art.
The actual detection result of the method is consistent with the actual situation, so that the method has good detection performance.
According to the application, the image is divided into nine blocks of three rows and three columns, the image blocks are divided into nine blocks of three rows and three columns, the position information of the image can be further provided, the image analysis of specific scenes is facilitated, and the local characteristic information of the image can be extracted based on the image blocks.
According to the application, by extracting the texture features, the histogram features and the mean features of the image block, the features can reflect the texture richness, the pixel distribution and the brightness of the picture, so that the shielding condition of the camera can be analyzed in various aspects more carefully.
The application combines the position relation of the image blocks to reasonably design the extracted texture features, the histogram features and the mean features to judge whether the camera is normal, shielded or abnormal.
Example 2
On the basis of embodiment 1, the application also claims an electronic device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the method of embodiment 1.
Although embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the application, the scope of which is defined in the appended claims and their equivalents.

Claims (6)

1. A detection method for shielding abnormality of a camera is characterized by comprising the following steps: the method comprises the following steps:
s101, inputting pictures: reading a video stream shot by a camera to acquire an image frame;
s102, converting a gray level diagram: converting the image frame into a gray scale map;
s103, partitioning: uniformly dividing a gray scale image into N x N image blocks; n is the number of image blocks per row and column, n=3;
s104, obtaining image block characteristics: respectively calculating to obtain each image block characteristic, wherein each image block characteristic comprises a histogram characteristic, a mean characteristic and a texture characteristic;
s105, obtaining image features: splicing the image block features to obtain the whole image features; histogram feature f of individual image blocks h Mean characteristic f m And texture feature f t Splicing to obtain the characteristic F of a single image block i ∈R 1*12 Sequentially extracting the characteristics of the image block 1, the image block 2, the image block 3, the image block 4, the image block 5, the image block 6, the image block 7, the image block 8 and the image block 9, and splicing to obtain the characteristics F epsilon R of the whole image 9*12 Wherein the texture features F of the whole image t ∈R 9*1 Mean characteristic F m ∈R 9*1
S106: obtaining an image block feature set: forming an image block feature set by the image block features and the whole image feature set;
s107: setting a feature selection and judgment rule, and determining the condition of a camera, wherein the condition of the camera comprises normal and non-shielding, normal and shielding and abnormal;
the feature selection and judgment rules are as follows:
s1071, judging whether the texture characteristics of the middle area image block are larger than or equal to a first preset threshold value, if yes, enough textures are available, otherwise, the textures are not available; if the middle area image block has insufficient texture, indicating that the camera is normal and the occlusion or the camera is abnormal, entering step S1072; otherwise, enter step S1073;
s1072, judging the image brightness of the whole image based on the mean value characteristic, if the image brightness is larger than or equal to a second threshold value, enabling the camera to be normal and shielded, otherwise, entering step S1074; the method for calculating the brightness of the image comprises the following steps: sorting the values of the mean value features fm of all the image blocks, and averaging the four maximum values to obtain image brightness; the second threshold is 225/2;
s1073, judging whether the image texture is smaller than a third threshold value, wherein the image texture is not abundant if the image texture is smaller than the third threshold value, and otherwise, the image texture is abundant; if the image textures are not abundant, judging that the camera is abnormal, otherwise, turning to step S1075; wherein the third threshold value is y, and the value range of y is 0.005-0.05; taking the largest texture feature in the second row of three image blocks as an image texture;
s1074, judging that the camera is normal and shielded if the texture features of the image blocks in the second row are smaller than or equal to 0, otherwise judging that the camera is abnormal;
s1075, judging the following two conditions: the first condition is that the histogram features of all the image blocks are ordered from big to small, the sum of the two maximum values is obtained, and whether the sum of the two maximum values is larger than or equal to 0.9 is judged; judging whether the standard deviation of three image blocks in each column is less than 225 x y/3 or not; if one of the first condition and the second condition is met, the camera is abnormal, otherwise, the camera is normal and is not shielded.
2. The method for detecting camera occlusion anomaly of claim 1, wherein: in step S1071, the first preset threshold is y/2.
3. The method for detecting camera occlusion anomaly of claim 1, wherein: y=0.01.
4. The method for detecting camera occlusion anomaly of claim 1, wherein: in the step S104, when the histogram feature of the image block is extracted, the image block is equally divided into 10 groups from 0 to 255, and the probability value of the gray value distribution of each group of pixels is obtained as the histogram feature.
5. The method for detecting a camera occlusion anomaly according to any one of claims 1 to 4, wherein: in step S103, the gray scale map is uniformly divided into nine blocks in the form of nine-grid, and the numbers are sequentially ordered in the order from top to bottom and left to right.
6. An electronic device, comprising: a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1-4.
CN202310443237.6A 2023-04-24 2023-04-24 Camera shielding abnormality detection method and electronic equipment Active CN116156157B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310443237.6A CN116156157B (en) 2023-04-24 2023-04-24 Camera shielding abnormality detection method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310443237.6A CN116156157B (en) 2023-04-24 2023-04-24 Camera shielding abnormality detection method and electronic equipment

Publications (2)

Publication Number Publication Date
CN116156157A CN116156157A (en) 2023-05-23
CN116156157B true CN116156157B (en) 2023-08-18

Family

ID=86354746

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310443237.6A Active CN116156157B (en) 2023-04-24 2023-04-24 Camera shielding abnormality detection method and electronic equipment

Country Status (1)

Country Link
CN (1) CN116156157B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012155000A (en) * 2011-01-24 2012-08-16 Casio Comput Co Ltd Image processing system and image processing method and program
CN105744268A (en) * 2016-05-04 2016-07-06 深圳众思科技有限公司 Camera shielding detection method and device
JP2016134804A (en) * 2015-01-20 2016-07-25 富士通株式会社 Imaging range abnormality discrimination device, imaging range abnormality discrimination method and computer program for imaging range abnormality discrimination
CN106326917A (en) * 2016-08-12 2017-01-11 青岛大学 Camera masking intelligent detection method
WO2019202207A1 (en) * 2018-04-19 2019-10-24 Nokia Technologies Oy Processing video patches for three-dimensional content
CN111970405A (en) * 2020-08-21 2020-11-20 Oppo(重庆)智能科技有限公司 Camera shielding detection method, storage medium, electronic device and device
CN112291551A (en) * 2020-06-23 2021-01-29 广州红贝科技有限公司 Video quality detection method based on image processing, storage device and mobile terminal
CN114187498A (en) * 2021-12-08 2022-03-15 上海商汤智能科技有限公司 Occlusion detection method and device, electronic equipment and storage medium
WO2022062772A1 (en) * 2020-09-25 2022-03-31 腾讯科技(深圳)有限公司 Image detection method and apparatus, and computer device and computer-readable storage medium
CN114627292A (en) * 2022-03-08 2022-06-14 浙江工商大学 Industrial shielding target detection method
WO2022134957A1 (en) * 2020-12-25 2022-06-30 展讯通信(上海)有限公司 Camera occlusion detection method and system, electronic device, and storage medium
CN114913168A (en) * 2022-06-08 2022-08-16 浙江理工大学 Fabric texture abnormity detection method
CN115049612A (en) * 2022-06-13 2022-09-13 上海商汤科技开发有限公司 Camera state monitoring method and device, computing equipment and medium
CN115908802A (en) * 2022-11-14 2023-04-04 北京工业大学 Camera shielding detection method and device, electronic equipment and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10769454B2 (en) * 2017-11-07 2020-09-08 Nvidia Corporation Camera blockage detection for autonomous driving systems

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012155000A (en) * 2011-01-24 2012-08-16 Casio Comput Co Ltd Image processing system and image processing method and program
JP2016134804A (en) * 2015-01-20 2016-07-25 富士通株式会社 Imaging range abnormality discrimination device, imaging range abnormality discrimination method and computer program for imaging range abnormality discrimination
CN105744268A (en) * 2016-05-04 2016-07-06 深圳众思科技有限公司 Camera shielding detection method and device
CN106326917A (en) * 2016-08-12 2017-01-11 青岛大学 Camera masking intelligent detection method
WO2019202207A1 (en) * 2018-04-19 2019-10-24 Nokia Technologies Oy Processing video patches for three-dimensional content
CN112291551A (en) * 2020-06-23 2021-01-29 广州红贝科技有限公司 Video quality detection method based on image processing, storage device and mobile terminal
CN111970405A (en) * 2020-08-21 2020-11-20 Oppo(重庆)智能科技有限公司 Camera shielding detection method, storage medium, electronic device and device
WO2022062772A1 (en) * 2020-09-25 2022-03-31 腾讯科技(深圳)有限公司 Image detection method and apparatus, and computer device and computer-readable storage medium
WO2022134957A1 (en) * 2020-12-25 2022-06-30 展讯通信(上海)有限公司 Camera occlusion detection method and system, electronic device, and storage medium
CN114187498A (en) * 2021-12-08 2022-03-15 上海商汤智能科技有限公司 Occlusion detection method and device, electronic equipment and storage medium
CN114627292A (en) * 2022-03-08 2022-06-14 浙江工商大学 Industrial shielding target detection method
CN114913168A (en) * 2022-06-08 2022-08-16 浙江理工大学 Fabric texture abnormity detection method
CN115049612A (en) * 2022-06-13 2022-09-13 上海商汤科技开发有限公司 Camera state monitoring method and device, computing equipment and medium
CN115908802A (en) * 2022-11-14 2023-04-04 北京工业大学 Camera shielding detection method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN116156157A (en) 2023-05-23

Similar Documents

Publication Publication Date Title
CN103763515B (en) A kind of video abnormality detection method based on machine learning
CN103116985B (en) Detection method and device of parking against rules
CN110602484B (en) Online checking method for shooting quality of power transmission line equipment
CN108805042B (en) Detection method for monitoring video sheltered from leaves in road area
CN115249246B (en) Optical glass surface defect detection method
CN109918971B (en) Method and device for detecting number of people in monitoring video
CN111611907B (en) Image-enhanced infrared target detection method
CN108205667A (en) Method for detecting lane lines and device, lane detection terminal, storage medium
CN113870233B (en) Binding yarn detection method, computer equipment and storage medium
CN108537787B (en) Quality judgment method for face image
CN112001299B (en) Tunnel vehicle finger device and lighting lamp fault identification method
CN111047624A (en) Image dim target detection method, device, equipment and storage medium
CN109271904A (en) A kind of black smoke vehicle detection method based on pixel adaptivenon-uniform sampling and Bayesian model
CN107832732B (en) Lane line detection method based on treble traversal
CN109815784A (en) A kind of intelligent method for classifying based on thermal infrared imager, system and storage medium
CN116156157B (en) Camera shielding abnormality detection method and electronic equipment
TWI498830B (en) A method and system for license plate recognition under non-uniform illumination
CN113344879A (en) Image target segmentation and color anomaly detection method based on pollution source discharge port
CN108537815A (en) A kind of video image foreground segmentation method and device
CN113221603A (en) Method and device for detecting shielding of monitoring equipment by foreign matters
CN114550069B (en) Piglet nipple counting method based on deep learning
CN115620259A (en) Lane line detection method based on traffic off-site law enforcement scene
CN114897766A (en) Code stream anomaly detection method and device and computer readable storage medium
CN115619873A (en) Track tracing-based radar vision automatic calibration method
CN106920398A (en) A kind of intelligent vehicle license plate recognition system

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
GR01 Patent grant
GR01 Patent grant