Camera detection method, detection device, computer equipment and storage medium

By acquiring the preset point and current position images of the camera and performing image quality and offset detection, the problem of inability to effectively detect the camera image quality and acquisition angle offset in the prior art is solved, and the accuracy and reliability of the image processing and power detection system are improved.

CN114078124BActive Publication Date: 2025-04-11CHINA SOUTHERN POWER GRID CO LTD EHV TRANSMISSION CO NANNING MONITORING CENT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111418822.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2025-04-11
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

The prior art cannot effectively detect whether the image quality acquired by the camera and whether the camera acquisition angle is offset, which affects the accuracy of subsequent image processing and power detection systems.

Method used

By acquiring the camera preset point image and the current position image, image quality judgment, edge detection, Hough line transformation and coordinate determination are performed to determine whether the camera is offset.

Benefits of technology

The detection of image quality of the camera acquisition and the determination of the acquisition angle offset are realized, ensuring the accuracy of image processing and the reliability of the power detection system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114078124B_ABST
    Figure CN114078124B_ABST
Patent Text Reader

Abstract

The present application relates to a camera detection method, detection device, computer equipment and storage medium. The method includes: obtaining a camera preset point image and a camera current position image, judging whether the quality of the current position image is qualified, and if qualified, edge detection is performed on the preset point image to obtain a first image, edge detection is performed on the current position image to obtain a second image, Hough line transformation is performed on the first image to obtain a third image and Hough line transformation is performed on the second image to obtain a fourth image, and the coordinates of the two endpoints of the longest line in the third image and the fourth image are determined. Finally, based on the coordinates of the two endpoints of the longest line in the third image and the coordinates of the two endpoints of the longest line in the fourth image, it is judged whether the camera is offset. The above detection method first detects the image quality obtained by the camera, and if qualified, the camera's acquisition angle is detected, thereby realizing the detection of the image quality obtained by the camera and whether the camera position is offset.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of power system equipment detection, and in particular to a camera detection method, a detection device, a computer device and a storage medium. Background Art

[0002] With the development of intelligent substations, more and more image processing and image recognition technologies based on images obtained by cameras in substations have emerged in the process of substation operation, and the above images all rely on the cameras in the substation. Therefore, the quality of the images obtained by the camera directly affects the subsequent image processing or image recognition process. In addition, the acquisition angle of the camera usually also affects the image processing work in the subsequent power detection system.

[0003] In traditional technology, the detection of cameras in power detection systems is still limited to detecting whether the camera can obtain head images, and it is unable to detect the image quality collected by the camera and whether the camera's collection angle is offset. Summary of the invention

[0004] Based on this, it is necessary to provide a camera detection method, detection device, computer equipment, and computer-readable storage medium that can detect whether the image quality and the camera acquisition angle are offset in order to address the above technical problems.

[0005] In a first aspect, the present application provides a camera detection method. The method comprises:

[0006] Get the camera preset point image and the camera current position image;

[0007] Determining whether the image quality at the current position is qualified;

[0008] If qualified, edge detection is performed on the preset point image to obtain a first image, and edge detection is performed on the current position image to obtain a second image;

[0009] Performing Hough line transform on the first image to obtain a third image and performing Hough line transform on the second image to obtain a fourth image;

[0010] Determine the coordinates of two endpoints of the longest line in the third image;

[0011] Determine the coordinates of two endpoints of the longest line in the fourth image;

[0012] Whether the camera is offset is determined based on the coordinates of the two endpoints of the longest line in the third image and the coordinates of the two endpoints of the longest line in the fourth image.

[0013] In one embodiment, the two endpoint coordinates of the longest line in the third image are the first coordinate and the second coordinate, the two endpoint coordinates of the longest line in the fourth image are the third coordinate and the fourth coordinate, the first coordinate position point and the third coordinate position point are located on the same side of the perpendicular line of the longest line in the third image, and the step of determining whether the camera is offset based on the two endpoint coordinates of the longest line in the third image and the two endpoint coordinates of the longest line in the fourth image includes:

[0014] Calculating a first coordinate offset between the first coordinate and the third coordinate and a second coordinate offset between the second coordinate and the fourth coordinate;

[0015] If the first coordinate offset and the second coordinate offset are both (0, 0), it is determined that the camera is not offset;

[0016] If either the first coordinate offset or the second coordinate offset is not (0, 0), it is determined that the camera is offset.

[0017] In one embodiment, the step of determining the coordinates of two endpoints of the longest line in the third image comprises:

[0018] Finding the longest line in the third image based on the Pythagorean theorem;

[0019] Define the first coordinate system;

[0020] The coordinates of two endpoints of the longest line in the third image in the first coordinate system are determined.

[0021] In one embodiment, the step of determining the coordinates of two endpoints of the longest line in the fourth image comprises:

[0022] Find the longest line among the four images based on the Pythagorean theorem;

[0023] Define the first coordinate system;

[0024] The coordinates of two endpoints of the longest line in the fourth image in the first coordinate system are determined.

[0025] In one embodiment, before obtaining the camera preset point image and the camera current position image, the method further includes the following steps:

[0026] Obtain basic information of each camera based on the onvif protocol.

[0027] In one embodiment, the step of determining whether the quality of the image at the current position is qualified includes:

[0028] Determining whether the image clarity at the current position is qualified;

[0029] Determine whether the brightness of the image at the current position is qualified;

[0030] If both the clarity and the brightness are qualified, it is determined that the image quality at the current position is qualified.

[0031] In one embodiment, after determining whether the image quality at the current position is qualified, the method further includes the following steps:

[0032] If it fails, an alarm signal will be issued.

[0033] In a second aspect, the present application also provides a camera detection device. The above device includes:

[0034] An image acquisition module is used to acquire images of camera preset points and images of camera current position;

[0035] An image quality determination module is used to determine whether the image quality at the current position is qualified;

[0036] An edge detection module, used for performing edge detection on the preset point image to obtain a first image if the image is qualified, and performing edge detection on the current position image to obtain a second image;

[0037] A Hough line transform module, configured to perform a Hough line transform on the first image to obtain a third image and to perform a Hough line transform on the second image to obtain a fourth image;

[0038] A first coordinate determination module, used to determine the coordinates of two endpoints of the longest line in the third image;

[0039] A second coordinate determination module, used to determine the coordinates of two endpoints of the longest line in the fourth image;

[0040] The offset judgment module is used to judge whether the camera is offset based on the coordinates of the two endpoints of the longest line in the third image and the coordinates of the two endpoints of the longest line in the fourth image.

[0041] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned camera detection method are implemented.

[0042] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned camera detection method are implemented.

[0043] The camera detection method, device, computer equipment and storage medium obtain the camera preset point image and the camera current position image to determine whether the quality of the current position image is qualified. If qualified, edge detection is performed on the preset point image to obtain the first image, and edge detection is performed on the current position image to obtain the second image; the first image is subjected to Hough line transformation to obtain the third image and the second image is subjected to Hough line transformation to obtain the fourth image; then, the coordinates of the two endpoints of the longest line in the third image and the coordinates of the two endpoints of the longest line in the fourth image are determined, and finally, based on the coordinates of the two endpoints of the longest line in the third image and the coordinates of the two endpoints of the longest line in the fourth image, it is determined whether the camera is offset. The camera detection method first detects the image quality obtained by the camera, and after the image quality detection is qualified, the camera acquisition angle is detected, thereby realizing the detection of the image quality obtained by the camera and whether the camera position is offset. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a flowchart of a camera detection method in one embodiment;

[0045] Figure 2 It is a flowchart of a step of determining whether a camera is offset based on the coordinates of two endpoints of the longest line in the third image and the coordinates of two endpoints of the longest line in the fourth image in one embodiment;

[0046] Figure 3 A schematic diagram of a flow chart of a step of determining the coordinates of two endpoints of the longest line in the third image in one embodiment;

[0047] Figure 4 A schematic diagram of a flow chart of a step of determining the coordinates of two endpoints of the longest line in the fourth image in one embodiment;

[0048] Figure 5 is a flowchart of a camera detection method in another embodiment;

[0049] Figure 6 is a structural block diagram of a camera detection device in one embodiment;

[0050] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] In one embodiment, Figure 1As shown, a camera detection method is provided, the method comprising the following steps:

[0053] S200, obtaining a camera preset point image and a camera current position image.

[0054] Each camera is provided with a preset point, which is the position where the camera should be located. The preset point image is the image recorded when the camera is at the preset point.

[0055] S300, judging whether the image quality at the current position is qualified.

[0056] S500: If qualified, edge detection is performed on the preset point image to obtain a first image, and edge detection is performed on the current position image to obtain a second image.

[0057] The first image is obtained by using the Canny function in OpenCV (Open Source Computer Vision Library) to perform edge detection on the preset point image; the second image is obtained by using the Canny function in OpenCV to perform edge detection on the current position image. OpenCV is a cross-platform computer vision library that can be used to develop real-time image processing, computer vision, and pattern recognition programs. The Canny function is a function in OpenCV used to implement edge detection.

[0058] After edge detection is performed on the preset point and the current position image, the method further includes the following steps:

[0059] Convert the preset point and current position images into grayscale images.

[0060] The cvtColor function in OpenCV is used to convert the preset point image after edge detection into a grayscale image to obtain the first image, and the cvtColor function in OpenCV is used to convert the current position image into a grayscale image to obtain the second image.

[0061] S600, performing Hough line transform on the first image to obtain a third image and performing Hough line transform on the second image to obtain a fourth image.

[0062] The Hough line transform is a transform used to detect straight lines. The third image contains the straight lines in the first image detected by the Hough line transform, and the fourth image contains the straight lines in the second image detected by the Hough line transform.

[0063] Among them, performing Hough line transform on the first image to obtain the third image includes performing Hough line transform on the first image based on the HoughLines function in OpenCV to obtain the third image.

[0064] Among them, performing Hough line transform on the second image to obtain the fourth image includes performing Hough line transform on the second image based on the HoughLines function in OpenCV to obtain the fourth image.

[0065] S700, determining the coordinates of two endpoints of the longest line in the third image.

[0066] S800, determining the coordinates of two endpoints of the longest line in the fourth image.

[0067] When the camera position is offset by a small angle compared to the preset point, the longest lines in the third image and the fourth image can be considered to be the same object.

[0068] S900: Determine whether the camera is offset based on the coordinates of two endpoints of the longest line in the third image and the coordinates of two endpoints of the longest line in the fourth image.

[0069] The camera detection method obtains the camera preset point image and the camera current position image to determine whether the quality of the current position image is qualified. If qualified, edge detection is performed on the preset point image to obtain the first image, and edge detection is performed on the current position image to obtain the second image; the first image is subjected to Hough line transformation to obtain the third image and the second image is subjected to Hough line transformation to obtain the fourth image; then, the coordinates of the two endpoints of the longest line in the third image and the coordinates of the two endpoints of the longest line in the fourth image are determined, and finally, based on the coordinates of the two endpoints of the longest line in the third image and the coordinates of the two endpoints of the longest line in the fourth image, it is determined whether the camera is offset. The camera detection method first detects the image quality obtained by the camera, and after the image quality detection is qualified, the camera acquisition angle is detected, thereby realizing the detection of the image quality obtained by the camera and whether the camera position is offset.

[0070] like Figure 2 As shown, in one embodiment, the above step S900 includes:

[0071] S910, calculating a first coordinate offset of the first coordinate and the third coordinate and a second coordinate offset of the second coordinate and the fourth coordinate.

[0072] Among them, the coordinates of the two endpoints of the longest line in the third image are the first coordinate and the second coordinate, the coordinates of the two endpoints of the longest line in the fourth image are the third coordinate and the fourth coordinate, the first coordinate position point and the third coordinate position point are respectively located on the same side of the perpendicular bisector of the longest line in the third image and the fourth image, and the second coordinate position point and the fourth coordinate position point are respectively located on the same side of the perpendicular bisector of the longest line in the third image and the fourth image.

[0073] The first coordinate offset is obtained by subtracting the first coordinate from the third coordinate, and the second coordinate offset is obtained by subtracting the second coordinate from the fourth coordinate, wherein the offset is also in coordinate form.

[0074] For example, if the first coordinate is (X1, Y1) and the third coordinate is (X2, Y2), the first offset can be expressed as (X1-X2, Y1-Y2). If the second coordinate is (X3, Y3) and the fourth coordinate is (X4, Y4), the second offset can be expressed as (X3-X4, Y3-Y4).

[0075] S920: If both the first coordinate offset and the second coordinate offset are (0, 0), it is determined that the camera is not offset; if either the first coordinate offset or the second coordinate offset is not (0, 0), it is determined that the camera is offset.

[0076] For example, when the first offset is (X1-X2, Y1-Y2) and the second offset is (X3-X4, Y3-Y4), the camera is determined to be not offset only when X1-X2=0, Y1-Y2=0, and X3-X4=0, Y3-Y4=0.

[0077] like Figure 3 As shown, in one embodiment, the above step S700 includes:

[0078] S710, finding the longest line in the third image based on the Pythagorean theorem.

[0079] S720, define a first coordinate system.

[0080] S730, determining the coordinates of two endpoints of the longest line in the third image in the first coordinate system.

[0081] The third image contains all the lines in the third image detected by the Hough line transform. After the coordinate system is constructed on the third image, the lengths of all the above lines can be compared based on the Pythagorean theorem to find the longest line.

[0082] like Figure 4 As shown, in one embodiment, the above step S800 includes:

[0083] S810, finding the longest line in the fourth image based on the Pythagorean theorem.

[0084] S820, define a first coordinate system.

[0085] S830: Determine the coordinates of two endpoints of the longest line in the fourth image in the first coordinate system.

[0086] Among them, the fourth image contains all the lines in the fourth image detected by the Hough line transform. After constructing the coordinate system on the fourth image, the lengths of all the above lines can be compared based on the Pythagorean theorem to find the longest line. By comparing the coordinates of the two endpoints of the longest line in the third image and the coordinates of the two endpoints of the longest line in the fourth image under the same first coordinate system, it can be determined whether the two lines overlap. If they overlap, it means that the camera has not moved and is at the preset point. If they do not overlap, it means that the camera has moved, realizing camera offset detection.

[0087] like Figure 5 As shown, in one embodiment, before step S200, the following steps are included:

[0088] S100, obtains basic information of each camera based on the onvif protocol.

[0089] Among them, ONVIF (Open Network Video Interface Forum) is an open network video interface forum protocol. The ONVIF protocol defines a common protocol for information exchange between network video devices, covering functions such as device discovery, device configuration, events, PTZ control, video analysis, and real-time streaming.

[0090] The basic information of the camera includes the camera serial number, camera version number, IP, etc. Therefore, the basic information of the camera can be used to distinguish different cameras in the system.

[0091] Among them, based on the onvif protocol, the basic information of the above cameras can be automatically scanned and obtained. After the scan is completed, the staff can obtain the basic information of the above cameras through the onvif protocol according to the password of each camera.

[0092] Based on the basic information of the camera, when storing the preset point image and the current position image, the image can be matched with the basic information of the camera, so that the staff can query the current position image and the preset point image based on the basic information of the camera. In addition, by obtaining the basic information of the camera, the staff can realize the unified management of the camera.

[0093] like Figure 5 As shown, in one embodiment, step S300 includes:

[0094] S310, determining whether the image clarity at the current position is qualified.

[0095] The clarity of the image at the current position is determined based on the Laplace operator.

[0096] Specifically, the variance of the image after Laplace operator filtering can reflect the clarity of the image. The higher the clarity, the greater the above method. Specifically, a clarity threshold is set, the image at the current position is processed based on the Laplace operator, and the variance of the processed image is calculated. If the variance is greater than the clarity threshold, the image is determined to be clear.

[0097] S320, determining whether the image brightness at the current position is qualified.

[0098] Specifically, the mean of the current position image on the grayscale image is calculated. When the current position image has brightness abnormality, its mean will deviate from the preset mean point. Therefore, when the calculated mean of the current position image deviates from the preset mean point, it is determined that the current position image has brightness abnormality.

[0099] S330: If both the clarity and brightness are qualified, it is determined that the image quality at the current position is qualified.

[0100] In one embodiment, step S300 further includes:

[0101] Determine whether the image at the current position has color cast.

[0102] Specifically, the current position image is converted to the CIE (Commission Internationale d'Eclairage) Lab space, and the mean of the a component and the b component of the current position image in the CIE Lab space is calculated. If the mean of the a component and the mean of the b component are both far away from the preset mean origin, it is determined that the current position image has color cast.

[0103] In one embodiment, step S300 further includes:

[0104] Determine whether the image at the current position is a black screen.

[0105] Specifically, the current position image is grayed out, and the proportion of dark pixels in the total is detected, thereby inferring whether the camera that obtains the current position image is black. Generally, pixels with gray values ​​in the range of 0 to 19 are dark pixels.

[0106] Among them, during the above-mentioned clarity, brightness, color cast and black screen detection process, if one indicator is unqualified, the image quality at the current position is judged to be unqualified, and the judgment of the remaining indicators is stopped.

[0107] In one embodiment, Figure 5 As shown, after step S300, the following steps are also included:

[0108] S400: If the image quality at the current position is unqualified, an alarm message is issued.

[0109] Among them, the staff can make timely adjustments or repairs to the camera that obtains the image of the current location according to the alarm information to ensure the quality of the image obtained by the camera.

[0110] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0111] Based on the same inventive concept, the embodiment of the present application also provides a camera detection device for implementing the camera detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more camera detection device embodiments provided below can refer to the limitations on the camera detection method above, and will not be repeated here.

[0112] In one embodiment, Figure 6 As shown, a camera detection device is provided, comprising: an image acquisition module 200, an image quality determination module 300, an edge detection module 500, a Hough line transformation module 600, a first coordinate determination module 700, a second coordinate determination module 800 and an offset determination module 900, wherein:

[0113] The image acquisition module 200 is used to acquire the camera preset point image and the camera current position image.

[0114] The image quality determination module 300 is used to determine whether the image quality at the current position is qualified.

[0115] The edge detection module 500 is used to perform edge detection on the preset point image to obtain a first image if it is qualified, and to perform edge detection on the current position image to obtain a second image.

[0116] The Hough line transform module 600 is used to perform a Hough line transform on the first image to obtain a third image and to perform a Hough line transform on the second image to obtain a fourth image.

[0117] The first coordinate determination module 700 is used to determine the coordinates of two endpoints of the longest line in the third image.

[0118] The second coordinate determination module 800 is used to determine the coordinates of two endpoints of the longest line in the fourth image.

[0119] The offset determination module 900 is used to determine whether the camera is offset based on the coordinates of the two endpoints of the longest line in the third image and the coordinates of the two endpoints of the longest line in the fourth image.

[0120] In one embodiment, the offset determination module 900 includes:

[0121] The offset acquisition unit is used to calculate the first coordinate offset of the first coordinate and the third coordinate and the second coordinate offset of the second coordinate and the fourth coordinate.

[0122] The offset determination unit is used to determine that the camera is not offset if both the first coordinate offset and the second coordinate offset are (0, 0); and to determine that the camera is offset if neither the first coordinate offset nor the second coordinate offset is (0, 0).

[0123] In one embodiment, the first coordinate determination module 700 includes:

[0124] The line determination unit is used to find the longest line in the third image based on the Pythagorean theorem.

[0125] The coordinate system definition unit is used to define the first coordinate system.

[0126] The coordinate determining unit is used to determine the coordinates of two endpoints of the longest line in the third image in the first coordinate system.

[0127] In one embodiment, the second coordinate determination module 800 includes:

[0128] The line determination unit is used to find the longest line in the fourth image based on the Pythagorean theorem.

[0129] The coordinate system definition unit is used to define the first coordinate system.

[0130] The coordinate determining unit is used to determine the coordinates of two endpoints of the longest line in the fourth image in the first coordinate system.

[0131] In one embodiment, the image quality determination module 300 includes:

[0132] The clarity judgment unit is used to judge whether the clarity of the image at the current position is qualified.

[0133] The brightness judgment unit is used to judge whether the brightness of the image at the current position is qualified.

[0134] The final determination unit is used to determine that the image quality at the current position is qualified if both the clarity and the brightness are qualified.

[0135] In one embodiment, the camera detection device further includes:

[0136] The alarm module is used to issue an alarm message if the image quality at the current position is unqualified.

[0137] Each module in the camera detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0138] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store preset point images and current position images. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a camera detection method is implemented.

[0139] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0140] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0141] S200, obtaining a camera preset point image and a camera current position image.

[0142] S300, judging whether the image quality at the current position is qualified.

[0143] S500: If qualified, edge detection is performed on the preset point image to obtain a first image, and edge detection is performed on the current position image to obtain a second image.

[0144] S600, performing Hough line transform on the first image to obtain a third image and performing Hough line transform on the second image to obtain a fourth image.

[0145] S700, determining the coordinates of two endpoints of the longest line in the third image.

[0146] S800, determining the coordinates of two endpoints of the longest line in the fourth image.

[0147] S900: Determine whether the camera is offset based on the coordinates of two endpoints of the longest line in the third image and the coordinates of two endpoints of the longest line in the fourth image.

[0148] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0149] S910, calculating a first coordinate offset of the first coordinate and the third coordinate and a second coordinate offset of the second coordinate and the fourth coordinate.

[0150] S920: If both the first coordinate offset and the second coordinate offset are (0, 0), it is determined that the camera is not offset; if either the first coordinate offset or the second coordinate offset is not (0, 0), it is determined that the camera is offset.

[0151] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0152] S710, finding the longest line in the third image based on the Pythagorean theorem.

[0153] S720, define a first coordinate system.

[0154] S730: Determine the coordinates of two endpoints of the longest line in the third image in the first coordinate system.

[0155] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0156] S810, finding the longest line in the fourth image based on the Pythagorean theorem.

[0157] S820, define a first coordinate system.

[0158] S830: Determine the coordinates of two endpoints of the longest line in the fourth image in the first coordinate system.

[0159] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0160] S310, determining whether the image clarity at the current position is qualified.

[0161] S320, determining whether the image brightness at the current position is qualified.

[0162] S330: If both the clarity and brightness are qualified, it is determined that the image quality at the current position is qualified.

[0163] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0164] S400: If the image quality at the current position is unqualified, an alarm message is issued.

[0165] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0166] S200, obtaining a camera preset point image and a camera current position image.

[0167] S300, judging whether the image quality at the current position is qualified.

[0168] S500: If qualified, edge detection is performed on the preset point image to obtain a first image, and edge detection is performed on the current position image to obtain a second image.

[0169] S600, performing Hough line transform on the first image to obtain a third image and performing Hough line transform on the second image to obtain a fourth image.

[0170] S700, determining the coordinates of two endpoints of the longest line in the third image.

[0171] S800, determining the coordinates of two endpoints of the longest line in the fourth image.

[0172] S900: Determine whether the camera is offset based on the coordinates of two endpoints of the longest line in the third image and the coordinates of two endpoints of the longest line in the fourth image.

[0173] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0174] S910, calculating a first coordinate offset of the first coordinate and the third coordinate and a second coordinate offset of the second coordinate and the fourth coordinate.

[0175] S920: If both the first coordinate offset and the second coordinate offset are (0, 0), it is determined that the camera is not offset; if either the first coordinate offset or the second coordinate offset is not (0, 0), it is determined that the camera is offset.

[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0177] S710, finding the longest line in the third image based on the Pythagorean theorem.

[0178] S720, define a first coordinate system.

[0179] S730, determining the coordinates of two endpoints of the longest line in the third image in the first coordinate system.

[0180] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0181] S810, finding the longest line in the fourth image based on the Pythagorean theorem.

[0182] S820, define a first coordinate system.

[0183] S830: Determine the coordinates of two endpoints of the longest line in the fourth image in the first coordinate system.

[0184] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0185] S310, determining whether the image clarity at the current position is qualified.

[0186] S320, determining whether the image brightness at the current position is qualified.

[0187] S330: If both the clarity and brightness are qualified, it is determined that the image quality at the current position is qualified.

[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0189] S400: If the image quality at the current position is unqualified, an alarm message is issued.

[0190] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0191] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0192] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A camera detection method, characterized in that: The method comprises: Get the camera preset point image and the camera current position image; Determining whether the image quality at the current position is qualified; If qualified, edge detection is performed on the preset point image to obtain a first image, and edge detection is performed on the current position image to obtain a second image; Performing Hough line transform on the first image to obtain a third image and performing Hough line transform on the second image to obtain a fourth image; Determine the coordinates of two endpoints of the longest line in the third image; the coordinates of the two endpoints of the longest line in the third image are the first coordinate and the second coordinate; Determine the coordinates of two endpoints of the longest line in the fourth image; the coordinates of the two endpoints of the longest line in the fourth image are the third coordinate and the fourth coordinate; the first coordinate position point and the third coordinate position point are respectively located on the same side of the perpendicular line of the longest line in the third image and the fourth image; Calculating a first coordinate offset between the first coordinate and the third coordinate and a second coordinate offset between the second coordinate and the fourth coordinate; If both the first coordinate offset and the second coordinate offset are (0, 0), it is determined that the camera is not offset; if either the first coordinate offset or the second coordinate offset is not (0, 0), it is determined that the camera is offset.

2. The method according to claim 1, characterized in that The step of determining the coordinates of two endpoints of the longest line in the third image comprises: Finding the longest line in the third image based on the Pythagorean theorem; Define the first coordinate system; The coordinates of two endpoints of the longest line in the third image in the first coordinate system are determined.

3. The method according to claim 1, characterized in that The step of determining the coordinates of two endpoints of the longest line in the fourth image comprises: Finding the longest line in the fourth image based on the Pythagorean theorem; Define the first coordinate system; The coordinates of two endpoints of the longest line in the fourth image in the first coordinate system are determined.

4. The method according to claim 1, characterized in that: The method of obtaining the camera preset point image and the camera current position image also includes the following steps: Obtain basic information of each camera based on the onvif protocol.

5. The method according to claim 1, characterized in that The step of judging whether the image quality at the current position is qualified comprises: Determining whether the image clarity at the current position is qualified; Determine whether the brightness of the image at the current position is qualified; If both the clarity and the brightness are qualified, it is determined that the image quality at the current position is qualified.

6. The method according to any one of claims 1 to 5, characterized in that: The step of determining whether the image quality at the current position is qualified also includes: If the image quality at the current position is unqualified, an alarm message is issued.

7. A camera detection device, characterized in that: The device comprises: An image acquisition module is used to acquire images of camera preset points and images of camera current position; An image quality determination module is used to determine whether the image quality at the current position is qualified; An edge detection module, used for performing edge detection on the preset point image to obtain a first image if the image is qualified, and performing edge detection on the current position image to obtain a second image; A Hough line transform module, configured to perform a Hough line transform on the first image to obtain a third image and to perform a Hough line transform on the second image to obtain a fourth image; A first coordinate determination module, used to determine the coordinates of two endpoints of the longest line in the third image; the coordinates of the two endpoints of the longest line in the third image are the first coordinate and the second coordinate; A second coordinate determination module is used to determine the coordinates of two endpoints of the longest line in the fourth image; the coordinates of the two endpoints of the longest line in the fourth image are the third coordinate and the fourth coordinate; the first coordinate position point and the third coordinate position point are respectively located on the same side of the perpendicular line of the longest line in the third image and the fourth image; An offset judgment module is used to calculate the first coordinate offset of the first coordinate and the third coordinate and the second coordinate offset of the second coordinate and the fourth coordinate; if the first coordinate offset and the second coordinate offset are both (0,0), it is determined that the camera is not offset; if either the first coordinate offset or the second coordinate offset is not (0,0), it is determined that the camera is offset.

8. The device according to claim 7, characterized in that The first coordinate determination module also includes: a line determination unit, for finding the longest line in the third image based on the Pythagorean theorem; A coordinate system definition unit, used for defining a first coordinate system; The coordinate determination unit is used to determine the coordinates of two end points of the longest line in the third image in the first coordinate system.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method and device for calibrating preset position deviation of camera

    CN102937816A

  • Camera preset position correction method

    CN109769116A