Methods, devices and equipment for assessing video quality of closed-circuit television inspection of drainage pipelines
By performing perspective conversion and image quality assessment on CCTV inspection videos of drainage pipes, the accuracy problem caused by the influence of camera perspective and environmental distance in existing technologies has been solved, achieving a more accurate video quality assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-04
- Publication Date
- 2026-03-10
AI Technical Summary
Existing methods for assessing the quality of CCTV inspection videos of drainage pipes fail to effectively consider the effects of camera angle and environmental distance, resulting in low accuracy of assessment results.
By performing a perspective transformation on the target image in the closed-circuit television detection video file, a frontal view image of the drainage pipe unfolded along the busbar is obtained. Based on grayscale information and camera imaging model parameters, image quality is assessed. Image quality information and scores are calculated using a preset algorithm, and the final video quality assessment result is obtained.
It improves the accuracy of video quality assessment for closed-circuit television inspection of drainage pipelines and overcomes the adverse effects of limited camera angle and long environmental distance on video image quality.
Smart Images

Figure CN117173127B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of video quality evaluation, and particularly relates to a sewer closed circuit television (CCTV) detection video quality evaluation method, device and equipment. BACKGROUND
[0002] The sewer network is a prominent short board in the management of urban drainage systems, and understanding the sewer network background is the basis for implementing the quality improvement and efficiency increase of the drainage system. Closed circuit television (CCTV) detection is a commonly used technology for investigating mixed connections and detecting defects in sewer networks. CCTV detection can intuitively and comprehensively understand the internal conditions of the pipeline through real-time image monitoring, recording, video playback, image capture and video file recording. CCTV detection personnel evaluate and analyze the state of the sewer pipeline based on the recorded video files and issue a pipeline condition evaluation report. Therefore, the quality of the CCTV detection video directly affects the reliability of the detection result analysis and the accuracy of the pipeline state evaluation result. Therefore, quality analysis of the CCTV detection video of the sewer pipeline is an important task for the quality management of pipeline CCTV detection.
[0003] The processing flow of the existing sewer pipeline CCTV detection video quality evaluation method is generally as follows: the video is decomposed into a sequence of frame images; the texture features of each frame image are evaluated for image quality; and the quality of the entire video is evaluated by integrating the quality of all images. However, the sewer pipeline CCTV detection image has scene characteristics such as long distance, weak texture features, and limited camera angle, which affect the video quality evaluation. When evaluating the quality of the video image, directly evaluating the texture features of the decomposed image will not consider the key factors affecting the video quality such as the camera angle of the sewer pipeline CCTV detection, which will result in low accuracy of the video quality evaluation result. SUMMARY
[0004] Therefore, the present application provides a sewer closed circuit television (CCTV) detection video quality evaluation method, device and equipment to solve the problem of low accuracy of the video quality evaluation result caused by directly evaluating the texture features of the decomposed image.
[0005] In a first aspect, the present invention provides a method for evaluating the quality of closed-circuit television (CCTV) inspection videos of drainage pipelines. The method involves acquiring CCTV inspection video files of drainage pipelines, camera imaging model parameters of a preset reference viewpoint, and camera imaging model parameters of a preset virtual viewpoint. The preset reference viewpoint is a simulated viewpoint corresponding to the actual shooting process of the CCTV inspection video file, and the direction of the preset virtual viewpoint is perpendicular to the direction of the preset virtual viewpoint. Multiple target images are obtained based on the CCTV inspection video files of the drainage pipelines. The viewpoint transformation equation is solved sequentially using the grayscale information of each target image, the camera imaging model parameters of the preset reference viewpoint, and the camera imaging model parameters of the preset virtual viewpoint to obtain pixel information of the images to be analyzed corresponding to the multiple target images. The images to be analyzed are frontal views of the drainage pipeline unfolded along the generatrix in the target images. Image quality information of the corresponding images to be analyzed is determined based on a preset algorithm and the pixel information of each image to be analyzed. A quality score is determined based on the image quality information of each image to be analyzed. The quality evaluation result of the CCTV inspection video of the drainage pipeline is obtained based on the quality scores of multiple images to be analyzed.
[0006] The method for evaluating the quality of CCTV inspection videos of drainage pipelines provided in this invention involves obtaining multiple target images from a CCTV inspection video file of a drainage pipeline. The method then sequentially solves the perspective transformation equation using the grayscale information of each target image, camera imaging model parameters of a preset reference viewpoint, and camera imaging model parameters of a preset virtual viewpoint. This yields the pixel information of the images to be analyzed corresponding to each of the multiple target images. Based on the pixel information of each image to be analyzed, a quality score is determined for that image. Finally, the quality evaluation result of the CCTV inspection video of the drainage pipeline is obtained based on the quality scores corresponding to different images to be analyzed. This method, by performing perspective transformation on the target images in the CCTV inspection video file to obtain the corresponding images to be analyzed (the front view of the drainage pipeline unfolded along the generatrix in the target image), overcomes the adverse effects of limited camera perspective and long environmental distance on video image quality in CCTV inspection video files, resulting in a more accurate quality evaluation result for the CCTV inspection video of the drainage pipeline.
[0007] In one optional implementation, the step of obtaining multiple target images from a closed-circuit television detection video file of a drainage pipe includes: performing frame-by-frame decomposition processing on the closed-circuit video detection file of the drainage pipe to obtain multiple grayscale images; setting N=1, determining the pixel difference between the first grayscale image and a standard image, and if the pixel difference is greater than a preset threshold, then using the first grayscale image as the standard image; determining whether N is less than M, and if N is less than M, setting N=N+1, determining the pixel difference between the (N+1)th grayscale image and the standard image; if the pixel difference between the (N+1)th grayscale image and the standard image is greater than a preset threshold, then using the (N+1)th grayscale image as the standard image, and if the pixel difference between the (N+1)th grayscale image and the standard image is less than a preset threshold, then deleting the (N+1)th grayscale image; returning to the step of determining whether N is less than M, until N=M, and using the remaining multiple grayscale images as multiple target images.
[0008] The method provided in this optional embodiment, by comparing multiple frames of grayscale images with standard images and deleting duplicate images based on the comparison results, helps to improve the efficiency of quality assessment of closed-circuit television inspection videos of drainage pipelines.
[0009] In one optional implementation, the step of determining the image quality information of the corresponding image to be analyzed based on a preset algorithm and the pixel information of each image to be analyzed includes: calculating the image gradient of the corresponding image to be analyzed based on the preset algorithm and the pixel information of each image to be analyzed; calculating the image gradient variance value of the corresponding image to be analyzed based on the image gradient of each image to be analyzed; and determining the image quality information of the corresponding image to be analyzed based on the image gradient variance value of each image to be analyzed.
[0010] The method provided by this optional implementation can accurately evaluate the image quality of the image to be analyzed.
[0011] In one optional implementation, the step of obtaining a quality assessment result of a closed-circuit television inspection video of a drainage pipeline based on the quality scores of multiple images to be analyzed includes: calculating a coefficient of variation based on the quality scores of multiple images to be analyzed; determining a quality score of the closed-circuit television inspection video of the drainage pipeline based on the coefficient of variation; and obtaining a quality assessment result of the closed-circuit television inspection video of the drainage pipeline based on the quality score of the closed-circuit television inspection video of the drainage pipeline.
[0012] In one alternative implementation, the viewpoint transformation equation is:
[0013]
[0014] Among them, X C Y C Z C X represents the three-dimensional coordinates of the target image in the camera coordinate system from the reference viewpoint; S YS Z S For the coordinates of the image to be analyzed; X * C Y * C Z * C ΔZ represents the three-dimensional coordinates of the target image in the camera coordinate system of the virtual viewpoint; f0 is the set value of the scale factor; and F is the projection transformation function of the pipe wall.
[0015] In one optional implementation, the step of decomposing the closed-circuit video detection file of the drainage pipe frame by frame to obtain multiple grayscale images includes: decomposing the closed-circuit video detection file of the drainage pipe frame by frame to obtain multiple original images; and converting each original image into a corresponding grayscale image.
[0016] Secondly, the present invention provides a device for evaluating the video quality of closed-circuit television (CCTV) inspections of drainage pipelines. The device includes an acquisition module for acquiring CCTV inspection video files of drainage pipelines, camera imaging model parameters of a preset reference viewpoint, and camera imaging model parameters of a preset virtual viewpoint. The preset reference viewpoint is a simulated viewpoint corresponding to the actual shooting process of the CCTV inspection video file, and the direction of the preset virtual viewpoint is perpendicular to the direction of the preset virtual viewpoint. A first determination module is used to obtain multiple target images based on the CCTV inspection video files of drainage pipelines. A solution module is used to solve the viewpoint transformation equation sequentially using the grayscale information of each target image frame, the camera imaging model parameters of the preset reference viewpoint, and the camera imaging model parameters of the preset virtual viewpoint, to obtain pixel information of the images to be analyzed corresponding to the multiple target images. The images to be analyzed are frontal views of the drainage pipeline unfolded along the generatrix in the target images. A second determination module is used to determine the image quality information of the corresponding image to be analyzed based on a preset algorithm and the pixel information of each image to be analyzed. A third determination module is used to determine the quality score of the corresponding image to be analyzed based on the image quality information of each image to be analyzed. A fourth determination module is used to obtain the quality evaluation result of the CCTV inspection video of the drainage pipeline based on the quality scores of multiple images to be analyzed.
[0017] In one optional implementation, the first determining module includes: a processing unit, configured to perform frame-by-frame decomposition processing on the closed-circuit video detection file of the drainage pipe to obtain multiple frames of grayscale images; a first determining unit, configured to set N=1, determine the pixel difference between the first frame of grayscale image and the standard image, and if the pixel difference is greater than a preset threshold, then the first frame of grayscale image is used as the standard image; a judging unit, configured to judge whether N is less than M, and if N is less than M, set N=N+1, and determine the pixel difference between the (N+1)th frame of grayscale image and the standard image; a second determining unit, configured to, if the pixel difference between the (N+1)th frame of grayscale image and the standard image is greater than the preset threshold, then the (N+1)th frame of grayscale image is used as the standard image, and if the pixel difference between the (N+1)th frame of grayscale image and the standard image is less than the preset threshold, then the (N+1)th frame of grayscale image is deleted; and a third determining unit, configured to return to the step of judging whether N is less than M until N=M, and use the remaining multiple frames of grayscale images as multiple frames of target images.
[0018] In one optional implementation, the second determining module includes: a first calculation unit, used to calculate the image gradient of the corresponding image to be analyzed based on a preset algorithm and the pixel information of each image to be analyzed; a second calculation unit, used to calculate the image gradient variance value of the corresponding image to be analyzed based on the image gradient of each image to be analyzed; and a fourth determining unit, used to determine the image quality information of the corresponding image to be analyzed based on the image gradient variance value of each image to be analyzed.
[0019] In one optional implementation, the fourth determining module includes: a third calculation unit for calculating the coefficient of variation based on the quality scores of multiple images to be analyzed; a fifth determining unit for determining the quality score of the closed-circuit television inspection video of the drainage pipeline based on the coefficient of variation; and a sixth calculation unit for obtaining the quality assessment result of the closed-circuit television inspection video of the drainage pipeline based on the quality score of the closed-circuit television inspection video of the drainage pipeline.
[0020] In one alternative implementation, the viewpoint transformation equation is:
[0021]
[0022] Among them, X C Y C Z C X represents the three-dimensional coordinates of the target image in the camera coordinate system from the reference viewpoint; S Y S Z S For the coordinates of the image to be analyzed; X * C Y * C Z * CΔZ represents the three-dimensional coordinates of the target image in the camera coordinate system of the virtual viewpoint; f0 is the set value of the scale factor; and F is the projection transformation function of the pipe wall.
[0023] In one optional implementation, the processing unit includes: a decomposition subunit for decomposing the closed-circuit video detection file of the drainage pipe frame by frame to obtain multiple frames of original images; and a conversion subunit for converting each frame of original image into a corresponding grayscale image.
[0024] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the drainage pipeline closed-circuit television detection video quality assessment method of the first aspect or any corresponding embodiment described above.
[0025] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the drainage pipeline closed-circuit television detection video quality assessment method of the first aspect or any corresponding embodiment described above. Attached Figure Description
[0026] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0027] Figure 1 This is a flowchart illustrating the video quality assessment method for closed-circuit television inspection of drainage pipelines according to an embodiment of the present invention.
[0028] Figure 2 This is a flowchart illustrating another method for evaluating the video quality of closed-circuit television inspection of drainage pipelines according to an embodiment of the present invention.
[0029] Figure 3 This is a flowchart illustrating another method for evaluating the video quality of closed-circuit television inspection of drainage pipelines according to an embodiment of the present invention.
[0030] Figure 4 This is a structural block diagram of a closed-circuit television detection video quality assessment device for drainage pipelines according to an embodiment of the present invention.
[0031] Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] In related technologies, when assessing the quality of CCTV inspection videos of drainage pipes, the video is decomposed into a sequence of frame-by-frame images. The texture features of each frame are then evaluated to assess the image quality, and the overall quality of the video is assessed by combining the quality of all images. However, CCTV inspection images of drainage pipes are affected by scene features such as long environmental distances, weak texture features, and limited camera angles. Therefore, directly assessing the quality of the decomposed images by focusing on texture features without considering key factors affecting video quality, such as the camera angle, leads to low accuracy in the video quality assessment results.
[0034] In view of this, embodiments of the present invention provide a method for quality assessment of closed-circuit television (CCTV) inspection videos of drainage pipelines. This method can be applied to a processor to achieve quality assessment of CCTV inspection videos of drainage pipelines. The method provided by this invention transforms the viewpoint of the target image in the CCTV inspection video file to obtain the corresponding image to be analyzed. The image to be analyzed is a frontal view of the drainage pipeline unfolded along the generatrix in the target image. After converting multiple frames of target images into the image to be analyzed, image quality scoring is performed. This overcomes the adverse effects on video image quality caused by limited camera viewpoint and long environmental distance in CCTV inspection video files, resulting in a more accurate quality assessment result for the CCTV inspection video of drainage pipelines.
[0035] According to an embodiment of the present invention, a method for evaluating the video quality of closed-circuit television inspection of drainage pipes is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0036] This embodiment provides a method for evaluating the video quality of closed-circuit television (CCTV) inspection of drainage pipes, which can be used in the aforementioned processor. Figure 1 This is a flowchart of a closed-circuit television (CCTV) video quality assessment method for drainage pipelines according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0037] Step S101: Obtain the closed-circuit television detection video file of the drainage pipe, the camera imaging model parameters of the preset reference viewpoint, and the camera imaging model parameters of the preset virtual viewpoint. The preset reference viewpoint is the simulated viewpoint corresponding to the actual shooting process of the closed-circuit television detection video file, and the direction of the preset virtual viewpoint is perpendicular to the direction of the preset virtual viewpoint.
[0038] For example, the CCTV video file of the drainage pipe can be any CCTV video file of the drainage pipe that needs to be quality assessed; in this embodiment, the preset reference viewpoint can be the camera viewpoint corresponding to the camera always facing forward in the direction of the pipe centerline and maintaining a constant speed; the camera imaging model of the preset reference viewpoint is an ideal pinhole camera imaging model that ignores camera lens distortion, and the parameter settings of the reference camera imaging model include the parameter settings of the intrinsic parameter matrix and the extrinsic parameter matrix of the reference camera. The intrinsic parameter matrix includes the following parameter settings: the scale factor of the horizontal axis and the vertical axis of the image is set to an equal fixed value f0, which can be set to half of the image height, and the horizontal and vertical coordinates of the center principal point of the image are set to half of the image width and half of the image height, respectively; the viewpoint of the preset virtual viewpoint camera imaging model is perpendicular to the direction of the reference camera, and the virtual viewpoint camera is always stationary relative to the reference camera during movement, the distance from the virtual viewpoint to the pipe centerline is equal to the set value f0 of the scale factor, and the set value of the intrinsic parameter matrix of the preset virtual viewpoint camera imaging model is the same as that of the preset reference viewpoint camera imaging model.
[0039] Step S102: Obtain multiple frames of target images from the closed-circuit television detection video file based on the drainage pipe.
[0040] For example, in this embodiment of the application, the closed-circuit television detection video file of the drainage pipe can be split frame by frame to obtain multiple frames of images. The multiple frames of images are then filtered based on a pre-set filtering rule, and multiple target images are obtained based on the filtering results.
[0041] Step S103: The perspective transformation equation is solved sequentially using the grayscale information of each frame of the target image, the camera imaging model parameters of the preset reference viewpoint, and the camera imaging model parameters of the preset virtual viewpoint to obtain the pixel information of the image to be analyzed corresponding to the multiple frames of the target image. The image to be analyzed is the front view of the drainage pipe unfolded along the busbar in the target image.
[0042] For example, the viewpoint transformation equation is a parametric equation describing the projection transformation of the pipe wall, consisting of two specific independent variables: the coordinate values along the axes with non-zero translational degrees of freedom, and the ratio of the coordinate values along the two axes with zero translational degrees of freedom. The viewpoint transformation equation is solved based on the grayscale information of any frame of the target image, the camera imaging model parameters of a preset reference viewpoint, and the camera imaging model parameters of a preset virtual viewpoint, yielding the corresponding image to be analyzed. The image to be analyzed is the front view of the drainage pipe unfolded along the generatrix in the target image.
[0043] Step S104: Determine the image quality information of the corresponding image to be analyzed based on the preset algorithm and the pixel information of each image to be analyzed.
[0044] For example, in the embodiments of this application, the preset algorithm may include, but is not limited to, the Laplacian operator; the Laplacian operator is used to perform calculations and analysis on the image to be analyzed to obtain the texture information of the corresponding image to be analyzed.
[0045] Step S105: Determine the quality score of the corresponding image to be analyzed based on the image quality information of each image to be analyzed.
[0046] For example, in the embodiments of this application, the image quality information of the image to be analyzed can be the corresponding image texture information. The texture information is used to reflect the texture features of the image. The stronger the texture features, the better the image quality.
[0047] Step S106: Obtain the quality assessment result of the closed-circuit television inspection video of the drainage pipeline based on the quality scores of multiple images to be analyzed.
[0048] For example, the quality of the CCTV inspection video of the drainage pipeline is evaluated based on the quality score of each image to be analyzed. The higher the quality score of a single image to be analyzed, the better the quality of the CCTV inspection video of the drainage pipeline.
[0049] The drainage pipeline closed-circuit television inspection video quality assessment method provided in this embodiment obtains the corresponding image to be analyzed by performing a perspective transformation on the target image in the closed-circuit television inspection video file. The image to be analyzed is the front view image of the drainage pipeline unfolded along the busbar in the target image. After converting multiple frames of target images into the image to be analyzed, image quality scoring is performed. This overcomes the adverse effects on video image quality caused by the limited camera angle and the long distance of the environment in the closed-circuit television inspection video file, making the final quality assessment result of the drainage pipeline closed-circuit television inspection video more accurate.
[0050] This embodiment provides a method for evaluating the video quality of closed-circuit television (CCTV) inspection of drainage pipes, which can be used in the aforementioned processor. Figure 2 This is a flowchart of a closed-circuit television (CCTV) video quality assessment method for drainage pipelines according to an embodiment of the present invention, such as...Figure 2 As shown, the process includes the following steps:
[0051] Step S201: Obtain the closed-circuit television (CCTV) video file of the drainage pipe, camera imaging model parameters of a preset reference viewpoint, and camera imaging model parameters of a preset virtual viewpoint. The preset reference viewpoint is the simulated viewpoint corresponding to the actual shooting process of the CCTV video file, and the direction of the preset virtual viewpoint is perpendicular to the direction of the preset virtual viewpoint. For details, please refer to [link to relevant documentation]. Figure 1 Step S101 of the illustrated embodiment will not be described again here.
[0052] Step S202: Multiple frames of target images are obtained from the closed-circuit television video file detected based on the drainage pipe. For details, please refer to [link to relevant documentation]. Figure 1 Step S102 of the illustrated embodiment will not be described again here.
[0053] Specifically, step S202 includes:
[0054] Step S2021: Perform frame-by-frame decomposition processing on the closed-circuit video detection file of the drainage pipe to obtain multiple grayscale images.
[0055] For example, in this embodiment of the application, the closed-circuit video detection file of the drainage pipe is decomposed frame by frame to obtain the grayscale image corresponding to each frame of the video file.
[0056] In some optional implementations, step S2021 above includes:
[0057] Step a1 involves decomposing the closed-circuit video detection file of the drainage pipe frame by frame to obtain multiple original images. For example, by decomposing the closed-circuit video detection file of the drainage pipe frame by frame, each frame of the video file can be extracted to obtain multiple original images.
[0058] Step a2: Convert each original image frame into a corresponding grayscale image. For example, perform grayscale conversion on each original image frame to obtain the grayscale image corresponding to each original image frame.
[0059] Step S2022: Let N=1, determine the pixel difference between the first grayscale image and the standard image. If the pixel difference is greater than a preset threshold, then the first grayscale image is used as the standard image.
[0060] For example, N is the identifier of the grayscale image whose pixel difference is to be determined; in this embodiment of the application, the original standard image is a zero-value grayscale image with the same size as the video image, that is, a completely black image. When the pixel difference between the first frame image and the standard image is greater than a preset threshold, it can be determined that the difference between the first frame image and the standard image is large, and the first frame image is used as the standard image; when the pixel difference between the first frame image and the standard image is less than the preset threshold, the first frame image is deleted.
[0061] Step S2023: Determine whether N is less than M. If N is less than M, let N = N+1 and determine the pixel difference between the (N+1)th frame grayscale image and the standard image.
[0062] For example, M is the number of grayscale images, M is a positive integer, and N is also a positive integer and less than or equal to M; in this embodiment of the application, the average value of the absolute difference between the reference image and the current grayscale image can be compared with a preset threshold to determine the magnitude of the difference between the current grayscale image and the standard image.
[0063] Step S2024: If the pixel difference between the (N+1)th grayscale image and the standard image is greater than a preset threshold, then the (N+1)th grayscale image is used as the standard image; if the pixel difference between the (N+1)th grayscale image and the standard image is less than a preset threshold, then the (N+1)th grayscale image is deleted.
[0064] Step S2025: Return to the step of determining whether N is less than M, until N = M, and use the remaining multiple grayscale images as multiple target images.
[0065] For example, by removing duplicate images from multiple grayscale images to obtain multiple target images, the efficiency of video quality assessment can be effectively improved.
[0066] Step S203: The viewpoint transformation equation is solved sequentially using the grayscale information of each frame of the target image, the camera imaging model parameters of the preset reference viewpoint, and the camera imaging model parameters of the preset virtual viewpoint. This yields the pixel information of the image to be analyzed corresponding to each of the multiple target images. The image to be analyzed is the front view of the drainage pipe unfolded along the generatrix in the target image. For details, please refer to [link to details]. Figure 1 Step S103 of the illustrated embodiment will not be described again here.
[0067] In some alternative implementations, the viewpoint transformation equation is:
[0068]
[0069] Among them, X C Y C Z C X represents the three-dimensional coordinates of the target image in the camera coordinate system from the reference viewpoint; S Y S Z S For the coordinates of the image to be analyzed; X * C Y * C Z * CΔZ represents the three-dimensional coordinates of the target image in the camera coordinate system of the virtual viewpoint; f0 is the set value of the scale factor; and F is the projection transformation function of the pipe wall.
[0070] For example, F is the transformation function for the projection of the pipe wall, which varies depending on the type of pipe cross-section, as shown in Table 1 below:
[0071] Table 1
[0072]
[0073] Step S204: Determine the image quality information of the corresponding image to be analyzed based on a preset algorithm and the pixel information of each image to be analyzed. For details, please refer to [link to relevant documentation]. Figure 1 Step S104 of the illustrated embodiment will not be described again here.
[0074] Step S205: Determine the quality score of each image to be analyzed based on its image quality information. For details, please refer to [link to relevant documentation]. Figure 1 Step S105 of the illustrated embodiment will not be described again here.
[0075] Step S206: Based on the quality scores of multiple images to be analyzed, obtain the quality assessment results of the closed-circuit television inspection video of the drainage pipeline. For details, please refer to [link to relevant documentation]. Figure 1 Step S106 of the illustrated embodiment will not be described again here.
[0076] This embodiment provides a method for evaluating the video quality of closed-circuit television (CCTV) inspection of drainage pipes, which can be used in the aforementioned processor. Figure 3 This is a flowchart of a closed-circuit television (CCTV) video quality assessment method for drainage pipelines according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0077] Step S301: Obtain the closed-circuit television (CCTV) video file of the drainage pipe, camera imaging model parameters of a preset reference viewpoint, and camera imaging model parameters of a preset virtual viewpoint. The preset reference viewpoint is the simulated viewpoint corresponding to the actual shooting process of the CCTV video file, and the direction of the preset virtual viewpoint is perpendicular to the direction of the preset virtual viewpoint. For details, please refer to [link to relevant documentation]. Figure 1 Step S101 of the illustrated embodiment will not be described again here.
[0078] Step S302: Multiple frames of target images are obtained from the closed-circuit television video file based on the drainage pipe. For details, please refer to [link to relevant documentation]. Figure 1 Step S102 of the illustrated embodiment will not be described again here.
[0079] Step S303: The viewpoint transformation equation is solved sequentially using the grayscale information of each frame of the target image, the camera imaging model parameters of the preset reference viewpoint, and the camera imaging model parameters of the preset virtual viewpoint. This yields the pixel information of the image to be analyzed corresponding to each of the multiple target images. The image to be analyzed is the front view of the drainage pipe unfolded along the generatrix in the target image. For details, please refer to [link to details]. Figure 1 Step S103 of the illustrated embodiment will not be described again here.
[0080] Step S304: Determine the image quality information of the corresponding image to be analyzed based on a preset algorithm and the pixel information of each image to be analyzed. For details, please refer to [link to relevant documentation]. Figure 1 Step S104 of the illustrated embodiment will not be described again here.
[0081] Specifically, step S304 includes:
[0082] Step S3041: Calculate the image gradient of the corresponding image to be analyzed based on the preset algorithm and the pixel information of each image to be analyzed.
[0083] For example, in this embodiment of the application, the image gradient of each image to be analyzed can be calculated based on the Laplacian operator, and the image gradient can be used to evaluate the sharpness of the image. The calculation formula of the convolution kernel of the Laplacian operator is as follows. The kernel is a function used in machine learning to measure the similarity between samples, and is often used in nonparametric estimation and decision functions.
[0084]
[0085] Step S3042: Calculate the image gradient variance value of the corresponding image to be analyzed based on the image gradient of each image to be analyzed.
[0086] Step S3043: Determine the image quality information of the corresponding image to be analyzed based on the image gradient variance value corresponding to each image to be analyzed.
[0087] For example, the variance of the calculated image gradient is used as the quality evaluation score for a single frame of the detected video.
[0088] Step S305: Determine the quality score of each image to be analyzed based on its image quality information. For details, please refer to [link to relevant documentation]. Figure 1 Step S105 of the illustrated embodiment will not be described again here.
[0089] Step S306: Obtain the quality assessment result of the closed-circuit television inspection video of the drainage pipeline based on the quality scores of multiple images to be analyzed. For details, please refer to [link to relevant documentation]. Figure 1 Step S106 of the illustrated embodiment will not be described again here.
[0090] Specifically, step S306 includes:
[0091] Step S3061: Calculate the coefficient of variation based on the quality scores of multiple images to be analyzed.
[0092] For example, in the embodiments of this application, the coefficient of variation can be calculated by the following formula:
[0093]
[0094] Among them, std s The standard deviation of the quality scores for all single-frame target images. is the arithmetic mean of the quality scores of all single-frame target images, and cv is the coefficient of variation of the corresponding target image.
[0095] Step S3062: Determine the quality score of the CCTV inspection video of the drainage pipeline based on the coefficient of variation. Exemplarily, in this embodiment, the derivative of the coefficient of variation can be used as the quality score of the CCTV inspection video of the drainage pipeline.
[0096] Step S3063: Obtain the quality assessment result of the closed-circuit television (CCTV) inspection video of the drainage pipeline based on the quality score. For example, the quality assessment of the CCTV inspection video of the drainage pipeline is performed based on the quality score; the higher the score, the better the quality of the video.
[0097] The following specific embodiment illustrates the video quality assessment method for closed-circuit television inspection of drainage pipelines provided by the present invention.
[0098] Example:
[0099] The quality assessment results of closed-circuit television (CCTV) inspection videos of drainage pipes are determined through the following steps:
[0100] Step 1: Collect CCTV inspection video files of drainage pipes and decompose the video frame by frame into images;
[0101] Step 2: Perform frame difference motion detection on the acquired video images and delete duplicate images in non-moving states;
[0102] Step 3: Set the camera imaging model parameters of the reference viewpoint of the detection video, set the camera imaging model parameters of the virtual viewpoint, calculate the image to be evaluated through the viewpoint transformation equation, and calculate the quality score of a single frame image.
[0103] Step 4: Calculate the quality score of the detected video based on the quality scores of all motion frame images.
[0104] This embodiment also provides a video quality assessment device for closed-circuit television inspection of drainage pipelines. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0105] This embodiment provides a video quality assessment device for closed-circuit television (CCTV) inspection of drainage pipelines, such as... Figure 4 As shown, it includes:
[0106] The acquisition module 401 is used to acquire the closed-circuit television detection video file of the drainage pipe, the camera imaging model parameters of the preset reference view and the camera imaging model parameters of the preset virtual view. The preset reference view is the simulated view corresponding to the actual shooting process of the closed-circuit television detection video file, and the direction of the preset virtual view is perpendicular to the direction of the preset virtual view.
[0107] The first determining module 402 is used to obtain multiple frames of target images from a closed-circuit television detection video file based on the drainage pipeline;
[0108] The solution module 403 is used to solve the perspective transformation equation by using the grayscale information of each frame of the target image, the camera imaging model parameters of the preset reference viewpoint and the camera imaging model parameters of the preset virtual viewpoint in sequence, so as to obtain the pixel information of the image to be analyzed corresponding to the multiple frames of target images. The image to be analyzed is the front view image of the drainage pipe unfolded along the generatrix in the target image.
[0109] The second determining module 404 is used to determine the image quality information of the corresponding image to be analyzed based on a preset algorithm and the pixel information of each image to be analyzed.
[0110] The third determining module 405 is used to determine the quality score of the corresponding image to be analyzed based on the image quality information of each image to be analyzed.
[0111] The fourth determining module 406 is used to obtain the quality assessment result of the closed-circuit television inspection video of the drainage pipeline based on the quality scores of multiple images to be analyzed.
[0112] In some alternative implementations, the first determining module includes:
[0113] The processing unit is used to decompose the closed-circuit video detection file of the drainage pipeline frame by frame to obtain multiple grayscale images.
[0114] The first determining unit is used to set N=1 and determine the pixel difference between the first grayscale image and the standard image. When the pixel difference is greater than a preset threshold, the first grayscale image is used as the standard image.
[0115] The judgment unit is used to determine whether N is less than M. If N is less than M, let N = N+1 and determine the pixel difference between the (N+1)th frame grayscale image and the standard image.
[0116] The second determining unit is used to take the N+1 frame grayscale image as the standard image if the pixel difference between the N+1 frame grayscale image and the standard image is greater than a preset threshold, and to delete the N+1 frame grayscale image if the pixel difference between the N+1 frame grayscale image and the standard image is less than a preset threshold.
[0117] The third determining unit is used to return to the step of determining whether N is less than M, until N = M, and the remaining multiple frames of grayscale images are used as multiple frames of target images.
[0118] In some alternative implementations, the second determining module includes:
[0119] The first calculation unit is used to calculate the image gradient of the corresponding image to be analyzed based on a preset algorithm and the pixel information of each image to be analyzed;
[0120] The second calculation unit is used to calculate the image gradient variance value of the corresponding image to be analyzed based on the image gradient of each image to be analyzed.
[0121] The fourth determining unit is used to determine the image quality information of the corresponding image to be analyzed based on the image gradient variance value corresponding to each image to be analyzed.
[0122] In some alternative implementations, the fourth determining module includes:
[0123] The third calculation unit is used to calculate the coefficient of variation based on the quality scores of multiple images to be analyzed.
[0124] The fifth determining unit is used to determine the quality score of the closed-circuit television inspection video of the drainage pipeline based on the coefficient of variation.
[0125] The sixth calculation unit is used to obtain the quality assessment result of the closed-circuit television inspection video of the drainage pipeline based on the quality score of the video.
[0126] In some alternative implementations, the viewpoint transformation equation is:
[0127]
[0128] Among them, X C Y C Z C X represents the three-dimensional coordinates of the target image in the camera coordinate system from the reference viewpoint; S Y S Z S For the coordinates of the image to be analyzed; X *C Y * C Z * C ΔZ represents the three-dimensional coordinates of the target image in the camera coordinate system of the virtual viewpoint; f0 is the set value of the scale factor; and F is the projection transformation function of the pipe wall.
[0129] In some optional implementations, the processing unit includes:
[0130] The decomposition subunit is used to decompose the closed-circuit video detection file of the drainage pipeline frame by frame to obtain multiple frames of original images.
[0131] The conversion subunit is used to convert each frame of the original image into a corresponding grayscale image.
[0132] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0133] In this embodiment, the drainage pipeline closed-circuit television detection video quality assessment device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0134] This invention also provides a computer device having the above-described features. Figure 4 The device shown is a closed-circuit television (CCTV) video quality assessment device for drainage pipelines.
[0135] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 5 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5Take a processor 10 as an example.
[0136] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GPA), or any combination thereof.
[0137] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0138] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0139] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0140] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0141] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0142] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method of sewer CCTV inspection video quality assessment, characterized in that, The method comprises: obtaining a closed-circuit television detection video file of a drainage pipeline, camera imaging model parameters of a preset reference view angle and camera imaging model parameters of a preset virtual view angle, the preset reference view angle being a simulated view angle corresponding to a real shooting process of the closed-circuit television detection video file, and the preset virtual view angle being perpendicular to the preset reference view angle in direction; obtaining a plurality of target images based on the closed-circuit television detection video file of the drainage pipeline; sequentially solving a view angle transformation equation by using gray information of each target image, the camera imaging model parameters of the preset reference view angle and the camera imaging model parameters of the preset virtual view angle, to obtain pixel information of an image to be analyzed corresponding to each target image, the image to be analyzed being an orthographic image of the drainage pipeline after being unfolded along a generatrix in the target image; determining image quality information of each image to be analyzed based on a preset algorithm and the pixel information of each image to be analyzed; determining a quality score of each image to be analyzed based on the image quality information of each image to be analyzed; obtaining a quality evaluation result of the closed-circuit television detection video of the drainage pipeline based on the quality scores of the plurality of images to be analyzed. The view angle transformation equation is: wherein, X C , Y C , Z C is a three-dimensional coordinate value of the target image in the camera coordinate system of the reference view angle; X S , Y S , Z S is a coordinate value corresponding to the image to be analyzed; X * C , Y * C , Z * C is a three-dimensional coordinate value of the target image in the camera coordinate system of the virtual view angle, is a width of the observation field of view of the virtual view angle; f 0 is a set value of a scale factor; F is a pipe wall surface projection transformation function.
2. The method of claim 1, wherein, The step of obtaining a plurality of target images based on the closed-circuit television detection video file of the drainage pipeline comprises: frame-by-frame decomposing the closed-circuit television detection video file of the drainage pipeline to obtain a plurality of gray images; setting N=1, determining a pixel difference between a first gray image and a standard image, and if the pixel difference is greater than a preset threshold, taking the first gray image as the standard image; determining whether N is less than M, if N is less than M, setting N=N+1, and determining a pixel difference between an N+1th gray image and the standard image; if the pixel difference between the N+1th gray image and the standard image is greater than the preset threshold, taking the N+1th gray image as the standard image, and if the pixel difference between the N+1th gray image and the standard image is less than the preset threshold, deleting the N+1th gray image; returning to the step of determining whether N is less than M until N=M, and taking the remaining plurality of gray images as the plurality of target images.
3. The method of claim 1, wherein, The step of determining image quality information of each image to be analyzed based on a preset algorithm and the pixel information of each image to be analyzed comprises: calculating an image gradient of each image to be analyzed based on the preset algorithm and the pixel information of each image to be analyzed; calculating an image gradient variance value of each image to be analyzed based on the image gradient of each image to be analyzed; determining image quality information of each image to be analyzed based on the image gradient variance value corresponding to each image to be analyzed.
4. The method of claim 1, wherein, The step of obtaining a quality evaluation result of the closed-circuit television detection video of the drainage pipeline based on the quality scores of the plurality of images to be analyzed comprises: calculating a coefficient of variation based on the quality scores of the plurality of images to be analyzed; determining a quality score of the closed-circuit television detection video of the drainage pipeline based on the coefficient of variation; obtaining the quality evaluation result of the closed-circuit television detection video of the drainage pipeline based on the quality score of the closed-circuit television detection video of the drainage pipeline.
5. The method of claim 2, wherein, The step of frame-by-frame decomposing the closed-circuit video detection file of the drainage pipeline to obtain multiple frames of gray scale images comprises: frame-by-frame decomposing the closed-circuit video detection file of the drainage pipeline to obtain multiple frames of original images; converting each of the original images into a corresponding gray scale image.
6. A sewer closed circuit television inspection video quality assessment device, characterized by, The device comprises: an acquisition module configured to acquire a closed-circuit television detection video file of a drainage pipeline, camera imaging model parameters of a preset reference view angle, and camera imaging model parameters of a preset virtual view angle, wherein the preset reference view angle is an analog view angle corresponding to an actual shooting process of the closed-circuit television detection video file, and the preset virtual view angle is perpendicular to the preset reference view angle; a first determination module configured to obtain multiple target images based on the closed-circuit television detection video file of the drainage pipeline; a solving module configured to solve a view angle transformation equation by using, in sequence, gray scale information of each of the target images, the camera imaging model parameters of the preset reference view angle, and the camera imaging model parameters of the preset virtual view angle, to obtain pixel information of images to be analyzed corresponding to the multiple target images, wherein the images to be analyzed are orthographic images of the drainage pipeline after being unfolded along a generatrix in the target images; a second determination module configured to determine image quality information of each of the images to be analyzed based on a preset algorithm and the pixel information of each of the images to be analyzed; a third determination module configured to determine a quality score of each of the images to be analyzed based on the image quality information of each of the images to be analyzed; a fourth determination module configured to obtain a quality evaluation result of the closed-circuit television detection video of the drainage pipeline based on the quality scores of the multiple images to be analyzed; the view angle transformation equation is: wherein, X C , Y C , Z C is a three-dimensional coordinate value of the target image in the camera coordinate system of the reference view angle; X S , Y S , Z S is a coordinate value corresponding to the image to be analyzed; X * C , Y * C , Z * C is a three-dimensional coordinate value of the target image in the camera coordinate system of the virtual view angle, is a width of the observation field of view of the virtual view angle; f 0 is a set value of a scale factor; F is a pipe wall surface projection transformation function.
7. The apparatus of claim 6, wherein, the first determination module comprises: a processing unit configured to perform frame-by-frame decomposing processing on the closed-circuit video detection file of the drainage pipeline to obtain multiple frames of gray scale images; a first determination unit configured to set N=1, determine a pixel difference between a first frame of the gray scale images and a standard image, and set the first frame of the gray scale images as the standard image when the pixel difference is greater than a preset threshold value; a judgment unit configured to determine whether N is less than M, and set N=N+1 when N is less than M to determine a pixel difference between an (N+1)th frame of the gray scale images and the standard image; a second determination unit configured to set the (N+1)th frame of the gray scale images as the standard image when the pixel difference between the (N+1)th frame of the gray scale images and the standard image is greater than the preset threshold value, and delete the (N+1)th frame of the gray scale images when the pixel difference between the (N+1)th frame of the gray scale images and the standard image is less than the preset threshold value; a third determination unit configured to return to the step of determining whether N is less than M until N=M, and set the remaining multiple frames of the gray scale images as the multiple target images.
8. The apparatus of claim 6, wherein, the second determination module comprises: a first calculation unit configured to calculate an image gradient of each of the images to be analyzed based on a preset algorithm and the pixel information of each of the images to be analyzed; a second calculation unit configured to calculate an image gradient variance value of each of the images to be analyzed based on the image gradient of each of the images to be analyzed; a fourth determination unit configured to determine the image quality information of each of the images to be analyzed based on the image gradient variance value corresponding to each of the images to be analyzed.
9. The apparatus of claim 6, wherein, the fourth determination module comprises: The third calculation unit is configured to calculate a coefficient of variation based on the quality scores of the plurality of images to be analyzed; The fifth determination unit is configured to determine the quality score of the sewer CCTV inspection video based on the coefficient of variation; The sixth calculation unit is configured to obtain a quality evaluation result of the sewer CCTV inspection video based on the quality score of the sewer CCTV inspection video.
10. The apparatus of claim 7, wherein, The processing unit comprises: The decomposition sub-unit is configured to decompose the sewer CCTV inspection file frame by frame to obtain a plurality of original images; The conversion sub-unit is configured to convert each of the original images into a corresponding grayscale image.
11. A computer device, comprising: The processing unit comprises: A memory and a processor, which are in communication connection with each other, and the memory stores computer instructions; the processor executes the computer instructions to perform the sewer CCTV inspection video quality evaluation method according to any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the sewer CCTV inspection video quality evaluation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Pipeline inner wall image generation method and device and terminal equipment
CN113393381A
Image generation method, device and system
CN113592704A
Inspection image acquisition method and device, electronic equipment and storage medium
CN113727022A