A method and device for detecting camera video signal status

Through pixel square difference matching and minimum matching coefficient interception technology, the camera video signal status is detected, which solves the problems of slow detection speed and low efficiency in the prior art, and achieves fast and accurate video signal status detection.

CN114973087BActive Publication Date: 2025-03-28SHENZHEN ZHENYOU SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210580599.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-25
Publication Date
2025-03-28
Estimated Expiration
2042-05-25

AI Technical Summary

Technical Problem

In the prior art, the detection of the video signal status of the camera is slow, low efficiency, and labor-intensive.

Method used

By acquiring the target video image, matching the similarity with the template image using the pixel square difference matching method, determining the first area image, and intercepting the second area image with the minimum matching coefficient, and finally comparing the second area image with the template image to obtain the detection result of the video signal status.

Benefits of technology

The speed and efficiency of camera video signal status detection are improved, labor consumption is reduced, and the accuracy of comparison results is ensured by reasonably and accurately intercepting the second area image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114973087B_ABST
    Figure CN114973087B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a method and device for detecting the state of a camera video signal, including: acquiring a target video image based on a camera to be tested; performing similarity matching between the target video image and a template image based on a pixel square difference matching method to determine a first region image in the target video image; obtaining a second region image by intercepting the first region image using a minimum matching coefficient method; comparing the second region image with the template image to obtain a comparison result; and detecting the state of a video signal based on the comparison result to obtain a detection result. The method in this embodiment can accurately detect the state of a video signal and improve the detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of multimedia data detection, and in particular to a method and device for detecting the state of a camera video signal. Background Art

[0002] With the development of smart city services, the use of cameras to shoot videos for monitoring is becoming more and more popular. The detection of camera abnormalities has also become crucial, especially the detection of the camera video signal status. By detecting the camera video signal status, cameras without video signals can be found in time, thereby providing a guarantee for real-time video images. However, the existing method of checking whether there is no video signal by naked eyes has the problems of low efficiency, slow speed, and labor consumption.

[0003] Therefore, there is an urgent need for a method for detecting the state of a camera video signal to solve the problem in the prior art that it is impossible to promptly and quickly determine whether a camera has no video signal. Summary of the invention

[0004] In view of this, the present invention provides a method and device for detecting the state of a camera video signal, which is used to solve the problems of slow detection speed, low efficiency and labor consumption in the prior art. In order to achieve one or part or all of the above purposes or other purposes, the present invention proposes a method for detecting the state of a camera video signal, comprising:

[0005] Acquire a target video image based on the camera to be tested;

[0006] Performing similarity matching between the target video image and the template image based on a pixel square difference matching method to determine a first area image in the target video image;

[0007] Using a minimum matching coefficient method to obtain a second region image from the first region image;

[0008] Comparing the second region image with the template image to obtain a comparison result;

[0009] The video signal state is detected based on the comparison result to obtain a detection result.

[0010] Optionally, before performing similarity matching between the target video image and the template image based on the pixel square difference matching method, the method further includes:

[0011] Based on the grayscale value of each pixel in the target video image, calculate the grayscale average value;

[0012] Determine the image type of the target video image based on the grayscale average value; the image type includes a completely black image type and a non-completely black image type;

[0013] In the case where the image type is determined to be a completely black image type, determining that the video signal state is a non-no-signal state;

[0014] The similarity matching of the target video image and the template image based on the pixel square difference matching method to determine the first area image in the target video image specifically includes:

[0015] When it is determined that the image type is a non-all-black image type, similarity matching is performed between the target video image and the template image based on a pixel square difference matching method to determine a first area image in the target video image.

[0016] Optionally, the method of obtaining the second region image by intercepting the first region image by using a minimum matching coefficient method specifically includes:

[0017] Based on the first area image, determining a target position corresponding to a global minimum value of the image;

[0018] The second area image is obtained by intercepting the first area image based on the target position and a predetermined interception range.

[0019] Optionally, comparing the second region image with the template image to obtain a comparison result specifically includes:

[0020] Calculate and obtain the first Hu moment corresponding to the second region image and the target Hu moment corresponding to the template image respectively;

[0021] A comparison value is calculated based on the first Hu moment and the target Hu moment to obtain the comparison result.

[0022] Optionally, the detecting of the video signal state based on the comparison result to obtain the detection result specifically includes:

[0023] comparing the comparison value with a predetermined comparison threshold;

[0024] When it is determined that the contrast value is greater than or equal to the contrast threshold, the video signal state is determined to be a non-no-signal state.

[0025] Optionally, when it is determined that the comparison value is less than the comparison threshold, the method further includes:

[0026] Based on the gray value of each pixel in the second region image, a first pixel square difference corresponding to the second region image is calculated;

[0027] Based on the grayscale value of each pixel in the template image, a square difference of a target pixel corresponding to the template image is calculated;

[0028] A video signal state is checked based on the first pixel square difference and the target pixel square difference to obtain a detection result.

[0029] Optionally, the checking of the video signal state based on the first pixel square difference and the target pixel square difference to obtain a detection result specifically includes:

[0030] Calculating a difference value of the pixel square difference based on the first pixel square difference and the target pixel square difference;

[0031] Comparing the difference of the pixel square differences with a predetermined difference;

[0032] In the case where it is determined that the difference of the pixel square difference is less than the predetermined difference, determining that the video signal state is a no-signal state to obtain the detection result;

[0033] When it is determined that the difference value of the pixel square difference is greater than or equal to the predetermined difference value, the video signal state is determined to be a non-no-signal state to obtain the detection result.

[0034] In order to solve the above problems, the present application provides a device for detecting the state of a camera video signal, comprising:

[0035] An acquisition module, used for acquiring a target video image based on the camera to be tested;

[0036] A determination module, configured to perform similarity matching between the target video image and the template image based on a pixel square difference matching method, so as to determine a first area image in the target video image;

[0037] A capture module, used for capturing a second region image from the first region image by using a minimum matching coefficient;

[0038] A comparison module, used for comparing the second region image with the template image to obtain a comparison result;

[0039] The detection module is used to detect the state of the video signal based on the comparison result to obtain a detection result.

[0040] To solve the above problems, the present application provides a storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the method for detecting the camera video signal status described in any of the above items are implemented.

[0041] To solve the above problems, the present application provides an electronic device, comprising at least a memory and a processor, wherein a computer program is stored on the memory, and wherein the processor implements the steps of the camera video signal status detection method described in any one of the above items when executing the computer program on the memory.

[0042] Implementing the embodiments of the present invention will have the following beneficial effects:

[0043] The first area image is determined by matching the target video image with the template image for similarity, and then the second area image is cut out from the first area image by using the minimum matching coefficient method. This makes it possible to cut out the second area image more reasonable and accurate, laying the foundation for subsequently comparing the second area image with the template image, accurately obtaining the comparison result, and then accurately obtaining the detection result of the video signal status. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] in:

[0046] Figure 1 is a flow chart of a method for detecting a camera video signal state in one embodiment;

[0047] Figure 2 This is a flow chart of a method for detecting a camera video signal state in another embodiment of the present application;

[0048] Figure 3 This is a structural block diagram of a device for detecting the state of a camera video signal in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] This embodiment provides a method for detecting the state of a camera video signal. The method in this embodiment can be specifically applied to electronic devices such as terminals and servers. Figure 1As shown, the method in this embodiment includes the following steps:

[0051] Step S101, acquiring a target video image based on the camera to be tested;

[0052] Step S102, performing similarity matching between the target video image and the template image based on a pixel square difference matching method, so as to determine a first region image in the target video image;

[0053] In the specific implementation process of this step, the cv::matchTemplate function in the opencv library can be used to complete the similarity matching.

[0054] Step S103, using a minimum matching coefficient method to intercept the first region image to obtain a second region image;

[0055] In the specific implementation process of this step, the global minimum value of the image can be calculated, and then the position corresponding to the global minimum value of the image is determined as the target position, and then the image within a predetermined range is intercepted based on the target position, so as to obtain the second area image.

[0056] Step S104, comparing the second region image with the template image to obtain a comparison result;

[0057] In the specific implementation process of this step, the Hu distance can be used to match the second region image and the template image, so as to obtain a comparison value between the second region image and the template image, and then obtain a comparison result.

[0058] Step S105: Detect the state of the video signal based on the comparison result to obtain a detection result.

[0059] In this step, when the video signal state is detected based on the comparison result, the obtained comparison value can be specifically compared with a predetermined comparison threshold, and then when the comparison value is greater than or equal to the comparison threshold, the video signal state is determined to be a non-no-signal state, that is, the video signal state is determined to be a signal state and the camera is just in a relatively dark environment. When the comparison value is less than the comparison threshold, the video signal state is determined to be a no-signal state.

[0060] In this embodiment, the first area image is determined by performing similarity matching between the target video image and the template image, and then the second area image is cut out from the first area image by using the minimum matching coefficient method. This makes it possible to cut out the second area image more reasonable and accurate, laying a foundation for subsequently comparing the second area image with the template image, accurately obtaining the comparison result, and further accurately obtaining the detection result of the video signal status.

[0061] Another embodiment of the present application provides a method for detecting the state of a camera video signal. In order to improve the accuracy of the detection result, the present embodiment can further combine the image type and the pixel square difference of the image to comprehensively judge the state of the video signal. The method in the present embodiment specifically includes the following steps:

[0062] Step S201, acquiring a target video image based on the camera to be tested;

[0063] Step S202, based on the gray value of each pixel in the target video image, calculate the gray average value; based on the gray average value, determine the image type of the target video image; the image type includes a completely black image type and a non-completely black image type;

[0064] Step S203, if it is determined that the image type is a completely black image type, execute step S204; if it is determined that the image type is a completely black image type, execute step S205;

[0065] Step S204, determining that the video signal state is not a no-signal state to obtain the detection result;

[0066] The non-no signal state in this step indicates that the camera is just in a relatively dark environment and the camera has a video signal.

[0067] Step S205, performing similarity matching between the target video image and the template image based on a pixel square difference matching method to determine a first region image in the target video image;

[0068] Step S206, based on the first region image, determining a target position corresponding to the global minimum value of the image; based on the target position and a predetermined interception range, intercepting the first region image to obtain the second region image;

[0069] In the specific implementation of this step, the interception range can be set according to needs, that is, the interception length and width are set. Subsequently, a rectangular area can be determined according to the target position and the interception length and width, and then the image of the rectangular area is intercepted to obtain the second area image.

[0070] Step S207, respectively calculating and obtaining a first Hu moment corresponding to the second region image and a target Hu moment corresponding to the template image; calculating and obtaining a contrast value based on the first Hu moment and the target Hu moment to obtain the contrast result;

[0071] Step S208, comparing the contrast value with a predetermined contrast threshold; if it is determined that the contrast value is greater than or equal to the contrast threshold, executing step S204; if it is determined that the contrast value is less than the contrast threshold, executing step S209;

[0072] Step S209, based on the gray value of each pixel in the second region image, calculating and obtaining the first pixel square difference corresponding to the second region image; based on the gray value of each pixel in the template image, calculating and obtaining the target pixel square difference corresponding to the template image;

[0073] Step S210, calculating a difference of the pixel square difference based on the first pixel square difference and the target pixel square difference;

[0074] Step S211, compare the difference of the squared pixel differences with a predetermined difference; if it is determined that the difference of the squared pixel differences is greater than or equal to the predetermined difference, execute step S204; if it is determined that the difference of the squared pixel differences is less than the predetermined difference, execute step S212.

[0075] Step S212, determining that the video signal state is a no-signal state to obtain the detection result.

[0076] In this embodiment, by determining the image type of the target video image before performing similarity matching and making a preliminary judgment on the video signal state based on the image type, the detection efficiency of the video signal can be improved. That is, when the image type is a completely black image type, it is determined that the camera is only in a relatively dark environment and the signal state of the camera is not a no-signal state, and there is no need to perform subsequent video signal state detection.

[0077] In this embodiment, by obtaining the contrast value between the second region image and the template image based on the Hu distance, the contrast result can be made more accurate, providing a guarantee for accurately detecting the video signal state. When the video signal state obtained based on the contrast value is a signal state, the second region image and the template image are further detected by further adopting a pixel square difference detection method, thereby improving the accuracy of the detection result.

[0078] Based on the above embodiments, another embodiment of the present application provides a method for detecting the state of a camera video signal, such as Figure 2 As shown, including:

[0079] Step 1: read the image into the memory and determine whether the reading is successful. If the reading is successful, obtain the target video image;

[0080] In this step, the target video image is shot based on the camera to be tested.

[0081] Step 2: Calculate the grayscale average value based on the grayscale value of each pixel in the target video image;

[0082] Step 3, comparing the grayscale average value with a predetermined grayscale average value;

[0083] Step 4: when the grayscale average value is greater than or equal to the predetermined grayscale average value, the image type is determined to be a completely black image type, and the video signal state is determined to be a non-no-signal state; when the grayscale average value is less than the predetermined grayscale average value, the image type is determined to be a non-completely black image type, and step 5 is executed;

[0084] In this step, the image is analyzed by calculating the grayscale average value to determine whether it is a black image (i.e., determine whether the image type is a non-completely black image type) or whether the image is completely black (i.e., determine whether the image type is a completely black image type), thereby making the judgment result more accurate. In this step, the predetermined grayscale average value can be set to 20, which can also be adjusted according to actual needs.

[0085] Step 5: Read in the template image ContrastItem;

[0086] Step 6: Find the region identical to the template image in the source image (template video image) to obtain a first region image;

[0087] In the specific implementation process of this step, the target video image and the template image can be matched for similarity based on the pixel square difference matching method to determine the first region image in the target video image. For example, the OpenCV library can be used to complete the matching based on the pixel square difference matching method using the cv::matchTemplate function in the OpenCV library to obtain the first region image.

[0088] Step 7: Find the position of the minimum matching coefficient;

[0089] In the specific implementation process of this step, the position of the minimum matching coefficient refers to the position corresponding to the global minimum value of the image, thereby obtaining the target position. For example, the cv::minMaxLoc function in the opencv library can be used to find the target position corresponding to the minimum matching coefficient.

[0090] Step 8: Save the region as a Mat object named ResultPicture, thereby obtaining the second region image;

[0091] In the specific implementation process of this step, the interception length and width may be set, and then a rectangular area may be determined based on the target position and the length and width, and then the image of the area may be intercepted, so as to obtain the second area image ResultPicture;

[0092] Step nine: respectively calculate and obtain a first Hu moment corresponding to the second region image and a target Hu moment corresponding to the template image; and calculate and obtain a contrast value based on the first Hu moment and the target Hu moment to obtain the contrast result.

[0093] In the specific implementation process of this step, the specific comparison process is: first calculate the spatial moment, then calculate the central moment based on the spatial moment, then use the central moment to calculate the normalized central moment, and finally calculate the comparison result based on the normalized central moment. For example, the cv::matchShapes function in the opencv library can be used to compare the second region image with ResultPicture and the template image ContrastItem to obtain the contrast value;

[0094] Step 10, comparing the contrast value with a predetermined contrast threshold; if it is determined that the contrast value is greater than or equal to the contrast threshold, determining that the video signal state is a non-no-signal state; if it is determined that the contrast value is less than the contrast threshold, executing step 11;

[0095] In this step, the predetermined comparison threshold may be 0.28, and may also be adjusted according to actual needs.

[0096] Step 11: Based on the grayscale value of each pixel in the second region image, a first pixel square difference corresponding to the second region image is calculated; based on the grayscale value of each pixel in the template image, a target pixel square difference corresponding to the template image is calculated;

[0097] Step 12: Calculate the difference of the pixel square difference based on the first pixel square difference and the target pixel square difference;

[0098] Step 13: compare the difference of the squared pixel differences with a predetermined difference; when it is determined that the difference of the squared pixel differences is less than the predetermined difference, determine that the video signal state is a no-signal state; when it is determined that the difference of the squared pixel differences is greater than or equal to the predetermined difference, determine that the video signal state is a non-no-signal state, so as to obtain the detection result.

[0099] In this step, the predetermined difference value can be specifically set to 10, or can be adjusted according to actual needs. Specifically, the absolute value of the difference of the pixel square difference can be compared with the predetermined difference value. In this step, when the absolute value of the difference value is less than 10, it means that the two pictures are similar, and then it is judged that the camera is in a state of no video signal; on the contrary, if the absolute value is greater than or equal to 10, the two images are different, indicating that the camera is just in a relatively dark environment, and the target image is not without video signal.

[0100] In this application, the average value of the grayscale value of the pixels in the image is first used to determine whether it is a dark image. If the image is dark, a detection is performed to determine whether there is no video signal. First, it is determined whether there is an area in the image that matches the template image, and then subsequent processing is performed. This can improve the detection efficiency and make the detection results more accurate and reliable. At the same time, the method in this application can also complete the detection under unfavorable conditions such as inconsistent image size, inconsistent image type, and inconsistent image content.

[0101] Another embodiment of the present application provides a device for detecting the state of a camera video signal, such as Figure 3 As shown, including:

[0102] An acquisition module 1 is used to acquire a target video image based on the camera to be tested;

[0103] Determination module 2, used for performing similarity matching between the target video image and the template image based on a pixel square difference matching method, so as to determine a first area image in the target video image;

[0104] A capture module 3, configured to capture a second region image from the first region image by using a minimum matching coefficient;

[0105] A comparison module 4, used for comparing the second region image with the template image to obtain a comparison result;

[0106] Detection module 5, used to detect the state of the video signal based on the comparison result and obtain the detection result

[0107] In the specific implementation process of this embodiment, the detection device of the camera video signal state also includes an image type determination module, which is used to: before the target video image and the template image are matched for similarity based on the pixel square difference matching method, calculate the grayscale average value based on the grayscale value of each pixel in the target video image; determine the image type of the target video image based on the grayscale average value; the image type includes a completely black image type and a non-completely black image type; when it is determined that the image type is a completely black image type, determine that the video signal state is a non-no signal state;

[0108] The determination module is specifically used for: when the image type determination module determines that the image type is a non-total black image type, similarity matching is performed between the target video image and the template image based on a pixel square difference matching method to determine a first area image in the target video image.

[0109] In the specific implementation of this embodiment, the capture module is specifically used to: determine the target position corresponding to the global minimum value of the image based on the first area image; and capture the second area image from the first area image based on the target position and a predetermined capture range.

[0110] In the specific implementation process of this embodiment, the comparison module is specifically used to: respectively calculate and obtain the first Hu moment corresponding to the second area image and the target Hu moment corresponding to the template image; calculate and obtain a comparison value based on the first Hu moment and the target Hu moment to obtain the comparison result.

[0111] Specifically, the comparison module is used to: compare the comparison value with a predetermined comparison threshold;

[0112] In a specific implementation process of this embodiment, the detection module is used to: when it is determined that the contrast value is greater than or equal to the contrast threshold, determine that the video signal state is a non-no-signal state.

[0113] In the specific implementation process of this embodiment, the detection device of the camera video signal status also includes: a calculation module, which is used to: when it is determined that the contrast value is less than the contrast threshold, calculate the first pixel square difference corresponding to the second area image based on the grayscale value of each pixel in the second area image; calculate the target pixel square difference corresponding to the template image based on the grayscale value of each pixel in the template image; the detection module is specifically used to: check the video signal status based on the first pixel square difference and the target pixel square difference to obtain a detection result.

[0114] In the specific implementation process of this embodiment, the detection module is specifically used to: calculate the difference of pixel square differences based on the first pixel square difference and the target pixel square difference; compare the difference of pixel square differences with a predetermined difference; when it is determined that the difference of pixel square differences is less than the predetermined difference, determine that the video signal state is a no-signal state; when it is determined that the difference of pixel square differences is greater than or equal to the predetermined difference, determine that the video signal state is a non-no-signal state, so as to obtain the detection result.

[0115] In this embodiment, the first area image is determined by performing similarity matching between the target video image and the template image, and then the second area image is cut out from the first area image by using the minimum matching coefficient method. This makes the cutting of the second area image more reasonable and accurate, and lays a foundation for subsequently comparing the second area image with the template image, accurately obtaining the comparison result, and then accurately obtaining the detection result of the video signal state.

[0116] Another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the following method steps are implemented:

[0117] Step 1: Acquire the target video image based on the camera to be tested;

[0118] Step 2: performing similarity matching between the target video image and the template image based on a pixel square difference matching method to determine a first area image in the target video image;

[0119] Step 3: Using a minimum matching coefficient method to obtain a second region image from the first region image;

[0120] Step 4: Compare the second region image with the template image to obtain a comparison result;

[0121] Step 5: Detect the state of the video signal based on the comparison result to obtain a detection result.

[0122] The specific implementation process of the above method steps can be found in the above-mentioned embodiment of the method for detecting the state of any camera video signal, and this embodiment will not be repeated here.

[0123] In this embodiment, the first area image is determined by performing similarity matching between the target video image and the template image, and then the second area image is cut out from the first area image by using the minimum matching coefficient method. This makes it possible to cut out the second area image more reasonable and accurate, laying a foundation for subsequently comparing the second area image with the template image, accurately obtaining the comparison result, and further accurately obtaining the detection result of the video signal status.

[0124] Another embodiment of the present application provides an electronic device, comprising at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the following method steps when executing the computer program in the memory:

[0125] Step 1: Acquire the target video image based on the camera to be tested;

[0126] Step 2: performing similarity matching between the target video image and the template image based on a pixel square difference matching method to determine a first area image in the target video image;

[0127] Step 3: Using a minimum matching coefficient method to obtain a second region image from the first region image;

[0128] Step 4: Compare the second region image with the template image to obtain a comparison result;

[0129] Step 5: Detect the state of the video signal based on the comparison result to obtain a detection result.

[0130] The specific implementation process of the above method steps can be found in the above-mentioned embodiment of the method for detecting the state of any camera video signal, and this embodiment will not be repeated here.

[0131] In this embodiment, the first area image is determined by performing similarity matching between the target video image and the template image, and then the second area image is cut out from the first area image by using the minimum matching coefficient method. This makes it possible to cut out the second area image more reasonable and accurate, laying a foundation for subsequently comparing the second area image with the template image, accurately obtaining the comparison result, and further accurately obtaining the detection result of the video signal status.

[0132] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A method for detecting a camera video signal state, characterized in that: include: Acquire a target video image based on the camera to be tested; Performing similarity matching between the target video image and the template image based on a pixel square difference matching method to determine a first area image in the target video image; The method of obtaining the second region image by intercepting the first region image by using the minimum matching coefficient comprises: Based on the first area image, determining a target position corresponding to a global minimum value of the image; Based on the target position and a predetermined interception range, intercepting the first area image to obtain the second area image; Comparing the second region image with the template image to obtain a comparison result; The video signal state is detected based on the comparison result to obtain a detection result.

2. The method according to claim 1, characterized in that Before similarity matching is performed between the target video image and the template image based on the pixel square difference matching method, the method further includes: Based on the grayscale value of each pixel in the target video image, calculate the grayscale average value; Determine the image type of the target video image based on the grayscale average value; the image type includes a completely black image type and a non-completely black image type; In the case where the image type is determined to be a completely black image type, determining that the video signal state is a non-no-signal state; The similarity matching of the target video image and the template image based on the pixel square difference matching method to determine the first area image in the target video image specifically includes: When it is determined that the image type is a non-total black image type, similarity matching is performed between the target video image and the template image based on a pixel square difference matching method to determine a first area image in the target video image.

3. The method according to claim 1, characterized in that The comparing the second region image with the template image to obtain a comparison result specifically includes: Calculate and obtain the first Hu moment corresponding to the second region image and the target Hu moment corresponding to the template image respectively; A comparison value is calculated based on the first Hu moment and the target Hu moment to obtain the comparison result.

4. The method according to claim 3, characterized in that The detecting of the video signal state based on the comparison result to obtain the detection result specifically includes: comparing the comparison value with a predetermined comparison threshold; When it is determined that the contrast value is greater than or equal to the contrast threshold, the video signal state is determined to be a non-no-signal state.

5. The method according to claim 4, characterized in that In the case where it is determined that the comparison value is less than the comparison threshold, the method further includes: Based on the gray value of each pixel in the second region image, a first pixel square difference corresponding to the second region image is calculated; Based on the grayscale value of each pixel in the template image, a square difference of a target pixel corresponding to the template image is calculated; A video signal state is checked based on the first pixel square difference and the target pixel square difference to obtain a detection result.

6. The method according to claim 5, characterized in that The checking of the video signal state based on the first pixel square difference and the target pixel square difference to obtain a detection result specifically includes: Calculating a difference value of the pixel square difference based on the first pixel square difference and the target pixel square difference; Comparing the difference of the pixel square differences with a predetermined difference; In the case where it is determined that the difference of the pixel square difference is less than the predetermined difference, determining that the video signal state is a no-signal state to obtain the detection result; When it is determined that the difference value of the pixel square difference is greater than or equal to the predetermined difference value, the video signal state is determined to be a non-no-signal state to obtain the detection result.

7. A device for detecting the state of a camera video signal, characterized in that: include: An acquisition module, used for acquiring a target video image based on the camera to be tested; A determination module, configured to perform similarity matching between the target video image and the template image based on a pixel square difference matching method, so as to determine a first area image in the target video image; The interception module is used to intercept the second region image from the first region image by adopting a minimum matching coefficient method, wherein the interception module adopts a minimum matching coefficient method to intercept the second region image from the first region image, specifically comprising: Based on the first area image, determining a target position corresponding to a global minimum value of the image; Based on the target position and a predetermined interception range, intercepting the first area image to obtain the second area image; A comparison module, used for comparing the second region image with the template image to obtain a comparison result; The detection module is used to detect the state of the video signal based on the comparison result to obtain a detection result.

8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for detecting the camera video signal status described in any one of claims 1 to 6 are implemented.

9. An electronic device, characterized in that: The method comprises at least a memory and a processor, wherein a computer program is stored in the memory, and is characterized in that the processor implements the steps of the method for detecting the camera video signal status as described in any one of claims 1 to 6 when executing the computer program in the memory.

Citation Information

Patent Citations

  • Intelligent detection system and method for video surveillance

    CN103856774A

  • Method and device for detecting video lag, computer equipment and storage medium

    CN110996094A