A method for detecting leakage points in the process of waterproof leakage control
By dividing and iteratively adjusting the infrared thermal image, the problem of poor accuracy in the detection of large-scale leakage areas is solved, and higher detection accuracy is achieved.
Patent Information
- Application Number
- CN202510157043.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-02-13
AI Technical Summary
The existing infrared thermal image detection method has poor accuracy when detecting large-scale leakage areas, and the edge areas and background areas are easily confused.
By dividing the thermal infrared image of the leakage area to be detected, analyzing the grayscale difference and gradient difference of pixel points in the block, filtering out edge blocks, internal blocks and background blocks, and iteratively adjusting the region to determine the leakage area.
It improves the detection accuracy of large-area leakage areas, effectively distinguishes edge areas and internal areas, and reduces the confusion between edges and backgrounds.
Smart Images

Figure CN119648694B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image analysis, and in particular to a method for detecting leakage points in a waterproof leakage control process. Background Art
[0002] Traditional methods of detecting house waterproof leakage usually require destructive operations, such as opening walls or drilling holes, which are costly and inefficient. Infrared thermal imaging detection is a non-destructive detection method. Its detection principle is that when water penetrates into a building, it changes its thermal conductivity. The leakage area in the infrared image usually appears as a lower temperature area. Therefore, water leakage detection can be achieved by analyzing the temperature changes of the wall in the infrared image.
[0003] In the existing infrared thermal image detection method, the CA (context-aware) saliency algorithm can be used to perform saliency detection on the infrared image, and the water seepage area can be identified based on the saliency detection results. However, since the CA saliency algorithm relies on the temperature difference and position of the area in the image to perform saliency calculation, it can achieve good detection results for small leakage areas, but due to the small temperature difference in large leakage areas, it is easy to cause confusion between the edge area and the background area, which ultimately leads to poor accuracy in water leakage detection. Summary of the invention
[0004] The purpose of the present invention is to provide a method for detecting leakage points in the process of waterproof leakage control, which is used to solve the problem that the existing infrared thermal image detection method has poor accuracy in leakage detection of a large leakage area.
[0005] In order to solve the above technical problems, in a first aspect, the present invention provides a method for detecting leakage points in a waterproof leakage control process, comprising the following steps:
[0006] Divide the grayscale image of the thermal infrared image of the leakage area to be detected into several blocks;
[0007] Analyze the grayscale difference and gradient difference distribution of pixels in the blocks, determine the significance value of the blocks, and then select edge blocks from several blocks;
[0008] The blocks other than the edge blocks in the plurality of blocks are taken as the blocks to be analyzed, and the internal blocks and background blocks in the blocks to be analyzed are screened out according to the distribution of the edge blocks in all directions of the blocks to be analyzed;
[0009] According to the inconsistency of the gradient direction of the internal edge of the edge block and the difference in the position distribution of different edge blocks relative to the same internal block, the edge block, the internal block and the background block are regionally iteratively adjusted to obtain the adjusted edge block, internal block and background block;
[0010] Analyze the grayscale difference and gradient difference distribution of the pixels in the adjusted edge blocks, internal blocks and background blocks, and determine the significance values of the adjusted edge blocks, internal blocks and background blocks;
[0011] According to the saliency value of the adjusted edge block and the distribution of the adjusted edge blocks of the adjusted internal blocks in various directions, the saliency value of the adjusted internal block is adjusted to obtain an adjusted saliency value of the adjusted internal block;
[0012] The leakage area is determined based on the adjusted saliency values of the edge blocks and the background blocks, and the adjusted saliency values of the adjusted internal blocks.
[0013] In combination with the first aspect, in some possible implementations, determining the significance value of the block includes:
[0014] Determine the difference between the maximum grayscale value and the minimum grayscale value of all pixels in the block to obtain the grayscale extreme difference value;
[0015] Determine the mean value, maximum value and minimum value of the gradient amplitude of all pixels in the block;
[0016] Determine the gradient amplitude difference between the gradient amplitude of each pixel point in the block and the gradient amplitude mean, and standardize the gradient amplitude difference according to the difference between the maximum gradient amplitude and the minimum gradient amplitude to obtain the standardized gradient amplitude difference;
[0017] The significance value of the block is determined according to the grayscale extreme difference value and the average distribution of the standardized gradient amplitude difference corresponding to all pixels in the block.
[0018] In combination with the first aspect, in some possible implementations, screening out internal blocks and background blocks in the blocks to be analyzed includes:
[0019] Determine each surrounding direction of the block to be analyzed. If the block to be analyzed has an edge block in a certain direction, then the certain direction is used as the surrounding direction;
[0020] Determine the target edge block of the block to be analyzed in each surrounding direction, and determine the distance from the target edge block to the block to be analyzed, the target edge block refers to the edge block closest to the block to be analyzed in the corresponding surrounding direction;
[0021] According to the proportion of each surrounding direction of the block to be analyzed in all directions and the difference in distances corresponding to adjacent surrounding directions of the block to be analyzed, the possibility of the block to be analyzed belonging to an internal block is determined;
[0022] According to the possibility of belonging to the internal block, the internal block and the background block in the block to be analyzed are screened out, the possibility of the internal block belonging to the internal block is greater than the set possibility threshold, and the possibility of the background block belonging to the internal block is less than or equal to the set possibility threshold.
[0023] In combination with the first aspect, in some possible implementations, the step of determining the inconsistency of the gradient direction of the internal edge of the edge block includes:
[0024] Determine the maximum gradient amplitude of all pixels in the edge block, and use the gradient direction of the pixel corresponding to the maximum gradient amplitude as the target gradient direction;
[0025] Determine the ratio of the gradient magnitude of each pixel in the edge block to the maximum gradient magnitude;
[0026] Determine the gradient direction difference between the gradient direction of each pixel in the edge block and the target gradient direction;
[0027] The ratios corresponding to all pixels in the edge block are used as weights, and the gradient direction differences corresponding to all pixels in the edge block are weighted summed up. The weighted summation result is normalized to obtain the gradient direction inconsistency of the internal edge of the edge block.
[0028] In combination with the first aspect, in some possible implementations, performing regional iterative adjustment on edge blocks, internal blocks, and background blocks to obtain adjusted edge blocks, internal blocks, and background blocks includes:
[0029] According to the inconsistency of the gradient direction of the internal edge of the edge block and the difference in the position distribution of different edge blocks relative to the same internal block, the edge block is resized to obtain an adjusted size length, and the adjusted edge block is determined according to the adjusted size length;
[0030] Based on the adjusted edge blocks, internal blocks and background blocks, regional integration correction of the edge blocks, internal blocks and background blocks is performed, so as to obtain edge blocks, internal blocks and background blocks after regional integration correction;
[0031] For the edge blocks, internal blocks and background blocks corrected by regional integration, several rounds of regional iterative adjustment are continued to be performed to obtain the final adjusted edge blocks, internal blocks and background blocks.
[0032] In combination with the first aspect, in some possible implementations, adjusting the size of the edge block to obtain the adjusted size length includes:
[0033] Determine the difference in number between each edge block and every other edge block in the surrounding direction corresponding to the same internal block;
[0034] Determine the current scale correction value of each edge block according to the average distribution of the corresponding quantity differences between each edge block and each other edge block, and the inconsistency of the gradient direction of the internal edge of each edge block;
[0035] The initial size length of each edge block is corrected using the current scale correction value to obtain the corrected size length of each edge block.
[0036] In combination with the first aspect, in some possible implementations, the edge blocks, internal blocks, and background blocks corrected by regional integration are subjected to several rounds of regional iterative adjustments to obtain the final adjusted edge blocks, internal blocks, and background blocks, including:
[0037] In the current round of regional iterative adjustment, the regional integration-corrected edge blocks obtained by size adjustment in the previous round of regional iterative adjustment are obtained as the first type of edge blocks, and the second type of edge blocks obtained in all previous rounds of regional iterative adjustment are obtained;
[0038] All first-class edge blocks are traversed, and the traversal process includes: analyzing the grayscale difference and gradient difference distribution of the pixels in each first-class edge block, determining the significance value of each first-class edge block, if the significance value is not less than the set significance threshold, the first-class edge block stops resizing, and the first-class edge block is used as a new second-class edge block; if the significance value is less than the set significance threshold, the first-class edge block is resized according to the inconsistency of the gradient direction of the internal edge of the first-class edge block, and the position distribution difference between the first-class edge block and each object edge block relative to the same internal block obtained in the previous round of regional iterative adjustment, to obtain the adjusted size length, thereby obtaining the adjusted edge block, the object edge block refers to other first-class edge blocks or second-class edge blocks;
[0039] After all the first-category edge blocks are traversed, if there are edge blocks after regional integration correction obtained by resizing in the first-category edge blocks, regional integration correction is performed on the adjusted edge blocks obtained by resizing in the first-category edge blocks and the internal blocks and background blocks obtained in the previous round of regional iterative adjustment to obtain edge blocks, internal blocks and background blocks after regional integration correction;
[0040] If there are edge blocks corrected by regional integration obtained by resizing in the first type of edge blocks, and the iterative adjustment termination condition is not satisfied, the next round of regional iterative adjustment is performed; otherwise, if there are edge blocks corrected by regional integration obtained by resizing in the first type of edge blocks, and the iterative adjustment termination condition is satisfied, the edge blocks corrected by regional integration obtained in the current round of regional iterative adjustment and the second type of edge blocks obtained in all rounds of regional iterative adjustment are used as the final adjusted edge blocks, and the internal blocks and background blocks corrected by regional integration obtained in the current round of regional iterative adjustment are used as the final adjusted internal blocks and background blocks in sequence; if there are no edge blocks corrected by regional integration obtained by resizing in the first type of edge blocks, the second type of edge blocks obtained in all current rounds of regional iterative adjustment, the internal blocks and background blocks obtained in the previous round of regional iterative adjustment are used as the final adjusted edge blocks, internal blocks and background blocks in sequence. In combination with the first aspect above, in some possible implementations, determining whether the iterative adjustment termination condition is satisfied includes:
[0041] Determine the change in significance value corresponding to the corrected edge blocks of each region in the current round of regional iterative adjustment;
[0042] Determine the iterative adjustment judgment value according to the discrete degree of the change in the significance value corresponding to the edge blocks after the integration and correction of all regions in the current round of regional iterative adjustment;
[0043] If the iterative adjustment judgment value is less than the set iterative adjustment judgment threshold, it is determined that the iterative adjustment termination condition is met, otherwise it is determined that the iterative adjustment termination condition is not met.
[0044] In combination with the first aspect, in some possible implementations, adjusting the adjusted saliency value of the internal block to obtain the adjusted saliency value of the internal block includes:
[0045] Determine each surrounding direction of the adjusted internal block, if the adjusted internal block has an adjusted edge block in a certain direction, then use the certain direction as the surrounding direction;
[0046] Determine a target edge block of the adjusted internal block in each surrounding direction thereof, and determine a distance from the target edge block to the adjusted internal block, wherein the target edge block refers to an adjusted edge block that is closest to the adjusted internal block in the corresponding surrounding direction;
[0047] Determine a saliency correction value according to the proportion of the occlusion direction of the target edge block in each surrounding direction of the adjusted internal block in all directions, the distance between the target edge block in each surrounding direction of the adjusted internal block and the adjusted internal block, and the saliency value of the target edge block in each surrounding direction of the adjusted internal block;
[0048] According to the significance correction value, the significance value of the adjusted internal block is adjusted to obtain the adjusted significance value of the adjusted internal block. The larger the significance correction value is, the larger the adjusted significance value of the corresponding adjusted internal block is.
[0049] In combination with the first aspect, in some possible implementations, determining the leakage area includes:
[0050] Based on the adjusted saliency values of the edge blocks and the background blocks, and the adjusted saliency values of the adjusted internal blocks, the CA saliency algorithm is used to determine each focus region, and based on each focus region, the leakage region is determined.
[0051] To solve the above technical problems, in a second aspect, the present invention also provides a leakage point detection system in a waterproof leakage control process, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the device executes the method in the above first aspect or any possible implementation of the first aspect.
[0052] To solve the above technical problems, in a third aspect, the present invention further provides a computer program product, which includes: a computer program code, which, when executed on a computer, enables the computer to execute the method in the above first aspect or any possible implementation of the first aspect.
[0053] To solve the above technical problems, in a fourth aspect, the present invention further provides a computer-readable storage medium, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above first aspect or any possible implementation of the first aspect.
[0054] The present invention has the following beneficial effects: firstly, the present invention divides the grayscale image of the thermal infrared image of the leakage area to be detected into several blocks, and determines the significance value by analyzing the grayscale difference and gradient difference distribution of the pixel points in the blocks, so that the temperature change in the image can be captured more finely, and the edge area and the internal area can be effectively distinguished, especially the edge of the leakage area usually has a large temperature gradient, so the significance value of the edge block is higher; at the same time, the significance is calculated according to the temperature gradient difference and grayscale difference of each block, which not only helps to highlight the edge area, but also can take into account the internal area of the leakage area to a certain extent, avoiding the misjudgment caused by relying solely on the temperature difference; secondly, according to the relationship between the internal block and the edge block, the internal block and the background block in the block to be analyzed are screened out by the distribution of the edge blocks in all directions of the blocks to be analyzed outside the edge blocks, so as to ensure that the internal leakage area will not be misjudged as the background area; then, in order to avoid the scale of the edge block being too large or too small, thereby affecting the detection accuracy, the scale of the edge block is further corrected to ensure that it can accurately correspond to the actual boundary of the leakage area. Finally, by correcting the saliency value of the edge blocks, the saliency value of the internal blocks is further adjusted to ensure that the saliency of the internal leakage area is improved, thereby improving the detection capability of large-area leakage areas. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 A flowchart of the steps of a method for detecting leakage points in a waterproof leakage control process according to an embodiment of the present invention;
[0057] Figure 2 A grayscale image showing a partial area of a ceiling according to an embodiment of the present invention;
[0058] Figure 3 A schematic diagram of the structure of a leakage point detection system in a waterproof leakage control process according to an embodiment of the present invention;
[0059] Wherein: A and B both represent smaller leakage areas; C represents a larger leakage area; 301 represents a memory; 302 represents a processor; and 303 represents a computer program. DETAILED DESCRIPTION
[0060] In order to clearly illustrate the technical features of the present invention, the present invention is described in detail below through specific implementation methods in conjunction with the accompanying drawings.
[0061] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.
[0062] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0063] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0064] It should be noted that the concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0065] Although operations or steps are described in a specific order in the drawings in the embodiments of the present invention, it should not be understood that it is required to perform these operations or steps in the specific order shown or in a serial order, or that all the operations or steps shown must be performed to obtain the desired results. In the embodiments of the present invention, these operations or steps may be performed in series; these operations or steps may also be performed in parallel; or some of these operations or steps may be performed.
[0066] At the same time, it is understood that the data involved in the technical solution of the present invention (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of the relevant laws, regulations and relevant provisions. Unless otherwise defined, all technical and scientific terms used in the present invention have the same meanings as those generally understood by technicians in the technical field of the present invention, and all parameters or indicators in the formulas involved in the present invention are normalized values that eliminate the influence of dimensions.
[0067] In order to solve the problem that the existing infrared thermal image detection method has poor accuracy in detecting water leakage in a large-scale leakage area, an embodiment of the present invention provides a leakage point detection method in the process of waterproof leakage control, which obtains several blocks in the grayscale image of the thermal infrared image of the leakage area to be detected, and then screens out edge blocks, internal blocks and background blocks in the several blocks; regional iterative adjustment is performed on the edge blocks, internal blocks and background blocks, so as to obtain adjusted edge blocks, internal blocks and background blocks, and the adjusted significance value of the adjusted internal blocks is determined according to the significance value of the adjusted edge blocks and the distribution of the adjusted edge blocks in various directions; based on the significance values of the adjusted edge blocks and background blocks, and the adjusted significance value of the adjusted internal blocks, the leakage area is determined. The present invention effectively improves the accuracy of detecting large-area leakage areas.
[0068] A leakage point detection method in a waterproof leakage control process provided by an embodiment of the present invention will be described in detail below with reference to the accompanying drawings.
[0069] Figure 1 FIG. 1 is a schematic diagram showing a basic flow chart of a method for detecting leakage points in a waterproof leakage treatment process provided by an embodiment of the present invention. Figure 1 As shown, the method specifically comprises the following steps:
[0070] Step S100: dividing the grayscale image of the thermal infrared image of the leakage area to be detected into a plurality of blocks.
[0071] The thermal infrared image of the water leakage area to be detected is obtained by a thermal infrared camera. The water leakage area to be detected can be the entire floor or ceiling or a part of it. The thermal infrared image is grayed to obtain a corresponding grayscale image. The brighter the area in the grayscale image, the higher its temperature value, and vice versa. Figure 2 A grayscale image of a partial area of the ceiling is shown, wherein the black area is the leakage area in the partial area of the ceiling.
[0072] In order to facilitate the subsequent saliency analysis of image blocks of different scales and obtain richer and more accurate saliency information, similar to the original CA algorithm, the grayscale image is first evenly divided into several smaller blocks according to a fixed size length K. At this time, the size of each block is The fixed size length K can be reasonably selected based on experience and actual conditions and is not limited here.
[0073] Step S200: Analyze the grayscale difference and gradient difference distribution of the pixels in the block, determine the significance value of the block, and then select edge blocks from the blocks.
[0074] In the original CA saliency algorithm, when detecting thermal infrared images, the saliency value of each area is calculated based on the temperature value (grayscale) in the image and the position of each area in the image. However, this method can only detect leakage areas in smaller areas. Figure 2 When you encounter a larger area, as above, Figure 2 The detection effect of area C in the figure is not ideal. Although the large black leakage area can be circled after block division, it is easy to include areas A and B within the block range, and the area also includes a large number of background areas, so the detection result is not accurate. It is necessary to modify the calculation method of saliency in the CA algorithm.
[0075] Through analysis, for the actual leakage area in the water leakage area to be detected, its edge part is at the junction of the background area and the leakage area in the image. The temperature value of the background area is higher, while the temperature value of the local area is lower due to the infiltration of water inside the leakage area. For the internal area and background area of the leakage area, the temperature values are relatively uniform, while the temperature value difference of the edge area is larger, and its gradient direction is from the background area to the internal area, and the gradient amplitude change at the edge area is also larger than that of other areas in the area. Therefore, in the grayscale image, the significance of the edge area can be calculated by the grayscale difference and the gradient amplitude difference in the area. Compared with the internal area and the background area, its significance is higher, but the internal area also belongs to the leakage area, so its significance value still needs to be adjusted so that the significance value of the internal area is also relatively high, so that the leakage area in the image can be detected.
[0076] Furthermore, the grayscale difference and gradient difference distribution of the pixels in the block are analyzed to determine the significance value of the block, and the implementation steps include:
[0077] Determine the difference between the maximum grayscale value and the minimum grayscale value of all pixels in the block to obtain the grayscale extreme difference value;
[0078] Determine the mean value, maximum value and minimum value of the gradient amplitude of all pixels in the block;
[0079] Determine the gradient amplitude difference between the gradient amplitude of each pixel point in the block and the gradient amplitude mean, and standardize the gradient amplitude difference according to the difference between the maximum gradient amplitude and the minimum gradient amplitude to obtain the standardized gradient amplitude difference;
[0080] The significance value of the block is determined according to the grayscale extreme difference value and the average distribution of the standardized gradient amplitude difference corresponding to all pixels in the block.
[0081] Further, in the embodiment of the present invention, the above-mentioned determination of the significance value of the block corresponds to the calculation formula:
[0082] ;
[0083] in, Indicates The significance value of each block; Indicates The grayscale extreme value of each block, that is, The difference between the maximum grayscale value and the minimum grayscale value of all pixels in a block; Indicates The number of pixels in a block; Indicates In the block The gradient amplitude of each pixel; , and Respectively represent The mean value, maximum value and minimum value of the gradient amplitude of the blocks, i.e. The mean, maximum and minimum values of the gradient amplitude of all pixels in a block; Represents the normalization function.
[0084] In the above calculation formula, by calculating the The average normalized difference between the gradient amplitude of each pixel in the first block and the average gradient amplitude of the block, combined with the The grayscale extreme value of each block is determined The significance value of each block reflects the The overall temperature change degree of each block. When the average standardized difference is larger and the grayscale range value is larger, the corresponding significance value is larger. The more likely a block is an edge block.
[0085] According to the above method, the significance value of all blocks can be determined. A significance threshold is set in advance, and the significance threshold can be reasonably set as needed. In this embodiment, the significance threshold is set to 0.9. The significance value of each block is compared with the significance threshold, and the blocks with significance values greater than the significance threshold are recorded as edge blocks. In this way, edge blocks among several blocks can be screened out.
[0086] Step S300: taking blocks other than edge blocks among the plurality of blocks as blocks to be analyzed, and screening out internal blocks and background blocks among the blocks to be analyzed according to the distribution of edge blocks in all directions of the blocks to be analyzed.
[0087] After determining the edge blocks among all the blocks, it is difficult to distinguish the two areas by analyzing the significance value because the temperature change in the internal area of the leakage area is stable and the temperature change in the background area is also relatively stable. And because the internal area also belongs to the leakage area, its significance value is similar to that of the edge area. At this time, it is necessary to correct its significance value by the significance value of the edge area. In order to correct the significance value of the internal area of the leakage area by the significance value of the edge area, it is necessary to first determine the internal block corresponding to the internal area of the leakage area and distinguish the internal block from the background block.
[0088] Considering that the internal area of the leakage area is located inside the leakage area, it will definitely be surrounded by the edge blocks corresponding to the edge area, and the distance from the adjacent edge blocks to their corresponding blocks will not change too much within a smaller angle. Therefore, it can be determined whether the other blocks among the several blocks other than the edge blocks, that is, the blocks to be analyzed, are internal blocks.
[0089] Furthermore, the above steps of screening out internal blocks and background blocks in the blocks to be analyzed according to the distribution of edge blocks in all directions of the blocks to be analyzed include:
[0090] Determine each surrounding direction of the block to be analyzed. If the block to be analyzed has an edge block in a certain direction, then the certain direction is used as the surrounding direction;
[0091] Determine the target edge block of the block to be analyzed in each surrounding direction, and determine the distance from the target edge block to the block to be analyzed, the target edge block refers to the edge block closest to the block to be analyzed in the corresponding surrounding direction;
[0092] According to the proportion of each surrounding direction of the block to be analyzed in all directions and the difference in distances corresponding to adjacent surrounding directions of the block to be analyzed, the possibility of the block to be analyzed belonging to an internal block is determined;
[0093] According to the possibility of belonging to the internal block, the internal block and the background block in the block to be analyzed are screened out, the possibility of the internal block belonging to the internal block is greater than the set possibility threshold, and the possibility of the background block belonging to the internal block is less than or equal to the set possibility threshold.
[0094] With respect to the above steps, in an embodiment of the present invention, for each block to be analyzed, each ray is determined with the regional center of the block to be analyzed as the origin, and the difference between adjacent rays is 1°. At this time, 360 rays can be determined between [0°360°), each ray corresponds to an angle, and the direction of each ray is the direction of the block to be analyzed. It is detected whether there is an edge block blocking the ray in each direction of the block to be analyzed. If so, the corresponding direction is used as the surrounding direction, and the edge block closest to the block to be analyzed in the surrounding direction is used as the target edge block of the block to be analyzed in the surrounding direction, and the distance from each target edge block to the block to be analyzed is determined. The distance can be the Euclidean distance from the regional center of each target edge block to the regional center of the block to be analyzed. Furthermore, based on the proportion of each surrounding direction of the block to be analyzed in all directions and the difference in distances corresponding to adjacent surrounding directions of the block to be analyzed, the possibility that the block to be analyzed belongs to an internal block is determined. When the proportion of each surrounding direction in all directions is greater and the difference in distances corresponding to adjacent surrounding directions of the block to be analyzed is smaller, the corresponding possibility that the block to be analyzed belongs to an internal block is greater.
[0095] Further, in the embodiment of the present invention, the above-mentioned possibility of determining whether the block to be analyzed belongs to an internal block corresponds to the calculation formula:
[0096] ;
[0097] in, Indicates The probability that the blocks to be analyzed belong to the internal blocks; M represents the total number of directions; Indicates The number of directions around the blocks to be analyzed, that is, the number of angles blocked by edge blocks in the direction of the rays corresponding to the 360 angles; and Respectively represent The first block to be analyzed and The target edge block around the direction to the The distance between the blocks to be analyzed, that is, The block to be analyzed is in and The direction of the ray with angle The Euclidean distance from the center of the region of the block to be analyzed to the center of the region of the corresponding target edge block; Represents the normalization function.
[0098] In the above calculation formula, To indicate the The degree to which the 360-degree angle direction of the block to be analyzed is surrounded by the edge blocks. The greater the degree of being surrounded, the The more likely the analyzed blocks are to belong to the internal area; To calculate the There are adjacent angles between the angles blocked by edge blocks in the blocks to be analyzed. The greater the difference, the greater the distance between the blocks to be analyzed. The greater the difference in distance between edge blocks between adjacent angles of the blocks to be analyzed, the greater the difference in distance between edge blocks, that is, these edge blocks may not be the edges of the same leakage point area. The smaller the probability that the block to be analyzed belongs to the internal area.
[0099] According to the above method, the possibility that all blocks to be analyzed belong to internal blocks can be determined. A set possibility threshold is set in advance, and the set possibility threshold can be reasonably set as needed. In this embodiment, the value of the set possibility threshold is set to 0.8. The possibility of each block to be analyzed belonging to an internal block is compared with the set possibility threshold, and the blocks to be analyzed whose possibility of belonging to an internal block is greater than the set possibility threshold are recorded as internal blocks, and the blocks to be analyzed whose possibility of belonging to an internal block is less than or equal to the set possibility threshold are recorded as background blocks. In this way, the internal blocks and background blocks in all blocks to be analyzed can be screened out.
[0100] Step S400: performing regional iterative adjustment on edge blocks, internal blocks and background blocks according to the inconsistency of the gradient direction of the internal edges of the edge blocks and the difference in the position distribution of different edge blocks relative to the same internal blocks, thereby obtaining adjusted edge blocks, internal blocks and background blocks.
[0101] For edge blocks, after all internal blocks are obtained, the saliency values of the internal blocks need to be corrected by the saliency values of the edge blocks. However, before the saliency values of the internal blocks are corrected, since the scale of each edge block may not be appropriate, if the scale is too large, it will cause too many background areas and internal areas to be included in it, and if the scale is too small, its saliency will not be obvious, which will eventually cause a large deviation between the saliency of the edge block and the actual value, so it is necessary to adjust the scale and saliency value of the edge block. When adjusting the scale and saliency value of the edge block, it can be determined whether each edge block is evenly distributed around the internal block according to the angle range of each edge block occluded in each internal block, and the gradient direction inconsistency of the edge of each edge block, to obtain the corrected value of the scale of each edge block, and adjust the size of the edge block based on the corrected value of the scale to obtain the adjusted edge block, and then re-determine the saliency value based on the adjusted edge block, so as to achieve the adjustment of the saliency value of the edge block.
[0102] Furthermore, the step of determining the inconsistency of the gradient direction of the internal edge of the edge block includes:
[0103] Determine the maximum gradient amplitude of all pixels in the edge block, and use the gradient direction of the pixel corresponding to the maximum gradient amplitude as the target gradient direction;
[0104] Determine the ratio of the gradient magnitude of each pixel in the edge block to the maximum gradient magnitude;
[0105] Determine the gradient direction difference between the gradient direction of each pixel in the edge block and the target gradient direction;
[0106] The ratios corresponding to all pixels in the edge block are used as weights, and the gradient direction differences corresponding to all pixels in the edge block are weighted summed up. The weighted summation result is normalized to obtain the gradient direction inconsistency of the internal edge of the edge block.
[0107] For the above steps, in the embodiment of the present invention, the calculation formula of the gradient direction inconsistency of the internal edge of the above edge block is:
[0108] ;
[0109] in, Indicates The gradient direction of the internal edges of the edge blocks is inconsistent; Indicates The number of pixels in an edge block; Indicates The edge blocks The gradient direction difference between the gradient direction of the pixel point and the target gradient direction, the gradient direction difference is the absolute value of the difference between the angles corresponding to the two gradient directions; Indicates The edge blocks The gradient amplitude of each pixel; Indicates The maximum gradient magnitude of all pixels in an edge block.
[0110] In the above calculation formula, by calculating The difference between the gradient direction of each pixel in the edge block and the maximum gradient direction To quantify the inconsistency in the gradient direction, the gradient amplitude of each pixel is used to perform a weighted summation of the gradient direction difference. The stronger the edge point, the larger the The pixel point with a greater contribution to the gradient direction difference is normalized, and the weighted summation result is finally obtained to obtain the gradient direction inconsistency of the edge within the edge block. The larger the value of the weighted summation result, the greater the gradient direction inconsistency of the edge within the edge block.
[0111] By the above method, the gradient direction inconsistency of the internal edges of all edge blocks can be determined. Considering that the fixed size length K is usually not suitable for each edge block, it is necessary to adjust the size of each edge block to obtain an adjusted edge block.
[0112] Further, the above-mentioned regional iterative adjustment of edge blocks, internal blocks and background blocks is performed according to the inconsistency of the gradient direction of the internal edge of the edge block, and the difference in the position distribution of different edge blocks relative to the same internal block, so as to obtain the adjusted edge blocks, internal blocks and background blocks, and the implementation steps include:
[0113] According to the inconsistency of the gradient direction of the internal edge of the edge block and the difference in the position distribution of different edge blocks relative to the same internal block, the edge block is resized to obtain an adjusted size length, and the adjusted edge block is determined according to the adjusted size length;
[0114] Based on the adjusted edge blocks, internal blocks and background blocks, regional integration correction of the edge blocks, internal blocks and background blocks is performed, so as to obtain edge blocks, internal blocks and background blocks after regional integration correction;
[0115] For the edge blocks, internal blocks and background blocks corrected by regional integration, several rounds of regional iterative adjustment are continued to be performed to obtain the final adjusted edge blocks, internal blocks and background blocks.
[0116] For the above steps, further, the edge blocks are resized to obtain the adjusted size length, and the implementation steps include:
[0117] Determine the difference in number between each edge block and every other edge block in the surrounding direction corresponding to the same internal block;
[0118] Determine the current scale correction value of each edge block according to the average distribution of the corresponding quantity differences between each edge block and each other edge block, and the inconsistency of the gradient direction of the internal edge of each edge block;
[0119] The initial size length of each edge block is corrected using the current scale correction value to obtain the corrected size length of each edge block.
[0120] In the embodiment of the present invention, the current scale correction value of each edge block is determined as follows:
[0121] ;
[0122] in, Indicates The current scale correction value of the edge block; Indicates The gradient direction of the edges within the edge blocks is inconsistent; Indicates the total number of internal blocks; Indicates the number of edge blocks; Indicates The edge blocks and The edge blocks correspond to The difference in the number of surrounding directions of the inner blocks, that is, The edge blocks are The number of angles corresponding to the blocked rays of the internal blocks is the same as The edge blocks are The absolute value of the difference in the number of angles corresponding to the occlusion rays of the internal blocks.
[0123] In the above calculation formula, Indicates The difference in the number of angles corresponding to the occlusion rays of the edge block and other edge blocks when each internal block is used as a reference, the larger the difference, the The larger the value of the gradient direction inconsistency of the edge in an edge block is, the higher the increase in the current scale of the edge block is, and the larger the correction value of the edge block at the current scale is.
[0124] By the above method, the current scale correction value of all edge blocks can be determined. Then, according to the current scale correction value of each edge block, the current size length of each edge block is corrected to obtain the corrected size length of each edge block. The corresponding calculation formula is:
[0125] ;
[0126] in, Indicates The corrected size length of each edge block; Indicates The current size length of the edge blocks; Indicates The current scale correction value of the edge block; Represents the normalization function, which is used to normalize the current scale correction value to between.
[0127] By the above method, the corrected size lengths of all edge blocks can be determined, and then the adjusted edge blocks are determined by taking the center of each edge block as the center of the adjusted edge block and the corrected size length as the size length of the adjusted edge block.
[0128] Through the above method, all the adjusted edge blocks can be determined. Since the size length of the edge blocks has changed, compared with before the adjustment, between the adjusted edge blocks and other edge blocks, and between the adjusted edge blocks and the internal blocks and background blocks, blank areas that do not belong to the three blocks may appear, and overlapping areas may also appear. Therefore, it is necessary to perform regional integration correction of edge blocks, internal blocks and background blocks based on the adjusted edge blocks, internal blocks and background blocks to avoid overlapping areas and blank areas between different blocks. When performing regional integration correction of edge blocks, internal blocks and background blocks, a suitable correction method can be selected as needed, which is not limited here. For example, based on the grayscale value and position of the pixel points in the overlapping area and the blank area, the overlapping area and the blank area can be allocated to the adjusted edge blocks, internal blocks and background blocks using the method of regional growing, so as to finally obtain the edge blocks, internal blocks and background blocks after regional integration correction. In order to speed up the correction efficiency, in other implementation methods, on the one hand, if a blank area appears between the adjusted edge block and the internal block, the blank area is divided into the internal block; if a blank area appears between the adjusted edge block and the background block, the blank area is divided into the blank block; if a blank area appears between the adjusted edge block and the edge block, if the blank area is small, the pixels in the blank area are divided into the adjusted edge block closest to it, and if the blank area is large, the blank area can be divided into a new edge block; on the other hand, if an overlapping area appears between the adjusted edge block and the internal block and the background block, the overlapping area is divided into the adjusted edge block; if an overlapping area appears between the adjusted edge block and the edge block, the pixels in the overlapping area can be divided into the adjusted edge block closest to it.
[0129] The best adjusted edge blocks cannot usually be obtained after one adjustment. Therefore, based on the edge blocks, internal blocks and background blocks corrected by regional integration, several rounds of regional iterative adjustment are continued to obtain the final adjusted edge blocks, internal blocks and background blocks.
[0130] Furthermore, the above-mentioned edge blocks, internal blocks and background blocks after regional integration correction are subjected to several rounds of regional iterative adjustment, so as to obtain the final adjusted edge blocks, internal blocks and background blocks, including:
[0131] In the current round of regional iterative adjustment, the regional integration-corrected edge blocks obtained by size adjustment in the previous round of regional iterative adjustment are obtained as the first type of edge blocks, and the second type of edge blocks obtained in all previous rounds of regional iterative adjustment are obtained;
[0132] All first-class edge blocks are traversed, and the traversal process includes: analyzing the grayscale difference and gradient difference distribution of the pixels in each first-class edge block, determining the significance value of each first-class edge block, if the significance value is not less than the set significance threshold, the first-class edge block stops resizing, and the first-class edge block is used as a new second-class edge block; if the significance value is less than the set significance threshold, the first-class edge block is resized according to the inconsistency of the gradient direction of the internal edge of the first-class edge block, and the position distribution difference between the first-class edge block and each object edge block relative to the same internal block obtained in the previous round of regional iterative adjustment, to obtain the adjusted size length, thereby obtaining the adjusted edge block, the object edge block refers to other first-class edge blocks or second-class edge blocks;
[0133] After all the first-category edge blocks are traversed, if there are edge blocks after regional integration correction obtained by resizing in the first-category edge blocks, regional integration correction is performed on the adjusted edge blocks obtained by resizing in the first-category edge blocks and the internal blocks and background blocks obtained in the previous round of regional iterative adjustment to obtain edge blocks, internal blocks and background blocks after regional integration correction;
[0134] If there are edge blocks corrected by regional integration obtained by resizing in the first category of edge blocks, and the iterative adjustment termination condition is not satisfied, the next round of regional iterative adjustment is performed; otherwise, if there are edge blocks corrected by regional integration obtained by resizing in the first category of edge blocks, and the iterative adjustment termination condition is satisfied, the edge blocks corrected by regional integration obtained in the current round of regional iterative adjustment and the second category of edge blocks obtained in all rounds of regional iterative adjustment are used as the final adjusted edge blocks, and the internal blocks and background blocks corrected by regional integration obtained in the current round of regional iterative adjustment are used as the final adjusted internal blocks and background blocks in sequence; if there are no edge blocks corrected by regional integration obtained by resizing in the first category of edge blocks, the second category of edge blocks obtained in all current rounds of regional iterative adjustment, the internal blocks and background blocks obtained in the previous round of regional iterative adjustment are used as the final adjusted edge blocks, internal blocks and background blocks in sequence.
[0135] For the above steps, based on the edge blocks, internal blocks and background blocks corrected by the regional integration obtained by the first adjustment, several rounds of regional iterative adjustment are continued to obtain the final adjusted edge blocks, internal blocks and background blocks. In each round of regional iterative adjustment, the edge blocks corrected by the regional integration obtained by the size adjustment in the previous round of regional iterative adjustment are first obtained as the first type of edge blocks, and the second type of edge blocks obtained in all previous rounds of regional iterative adjustment are obtained. The first type of edge blocks refers to the corresponding edge blocks obtained after the adjusted edge blocks obtained by the size adjustment in the previous round of regional iterative adjustment and then the regional integration correction. It should be understood that if new edge blocks are generated after the regional integration correction in the previous round of regional iterative adjustment, the new edge blocks are also regarded as the first type of edge blocks. For ease of understanding, the above process of obtaining the edge blocks, internal blocks and background blocks after regional integration and correction is regarded as the first round of regional iterative adjustment. In the second round of regional iterative adjustment, since all edge blocks are resized in the first round of regional iterative adjustment and the adjusted edge blocks are obtained, each regional integrated and corrected edge block finally obtained in the first round of regional iterative adjustment is a first-class edge block, and there is no second-class edge block at this time.
[0136] Then all the first-class edge blocks are traversed. At this time, for each first-class edge block, the grayscale difference and gradient difference distribution of the pixels in each first-class edge block are analyzed in the same way as the significance value of the block in the above step S200 to determine the significance value of each first-class edge block. It is judged whether the significance value of each first-class edge block has reached the standard, that is, a significance threshold is set in advance. In this embodiment, the value of the set significance threshold is set to 0.8. It is judged whether the significance value of each first-class edge block is less than the set significance threshold. If it is not less than the set significance threshold, it is considered that the first-class edge block has reached the optimal significance, and the first-class edge block stops performing the subsequent rounds of regional iterative adjustment, and the first-class edge block is determined as a new second-class edge block; if it is less than the set significance threshold, all other first-class edge blocks and second-class edge blocks other than the first-class edge block are obtained. The first type of edge blocks (excluding the new second type of edge blocks generated in the current round of regional iterative adjustment) are resized according to the first round of regional iterative adjustment to obtain the adjusted size length, and the same method of determining the adjusted edge blocks according to the adjusted size length is to resize the first type of edge blocks according to the inconsistency of the gradient direction of the internal edge of the first type of edge blocks and the position distribution difference between the first type of edge blocks and each object edge block relative to the same internal block obtained in the previous round of regional iterative adjustment to obtain the adjusted size length, thereby obtaining the adjusted edge blocks. Among them, the internal blocks obtained in the previous round of regional iterative adjustment refer to the internal blocks after regional integration correction.
[0137] After the above processing is completed for all first-category edge blocks, that is, after traversing all first-category edge blocks, on the one hand, if there are edge blocks obtained by regional integration correction by resizing in the first-category edge blocks, the second-category edge blocks (including newly generated second-category edge blocks) remain unchanged, and in the same manner as the adjusted edge blocks, internal blocks and background blocks in the first round of regional iterative adjustment mentioned above, regional integration correction is performed on the adjusted edge blocks, internal blocks and background blocks to obtain regional integration correction edge blocks, internal blocks and background blocks, and the first-category edge blocks whose significance values are less than the set significance threshold are subjected to regional integration correction by resizing, and the internal blocks and background blocks obtained in the previous round of regional iterative adjustment, so as to obtain regional integration correction edge blocks, internal blocks and background blocks. At this time, it is determined whether the iterative adjustment termination condition is met. If the iterative adjustment termination condition is not met, the next round of regional iterative adjustment is directly performed. If the iterative adjustment termination condition is met, the edge blocks obtained in the current round of regional iterative adjustment after regional integration correction and the second-class edge blocks obtained in all rounds of regional iterative adjustment are used as the final adjusted edge blocks, and the internal blocks and background blocks obtained in the current round of regional iterative adjustment after regional integration correction are used as the final adjusted internal blocks and background blocks in turn. On the other hand, if there is no regional integration correction edge block obtained by size adjustment in the first-class edge block, that is, there is no first-class edge block with a significance value less than the set significance threshold, it means that all the first-class edge blocks have reached the optimal significance at this time, and there is no need to perform regional integration correction at this time, and the second-class edge blocks obtained in all current rounds of regional iterative adjustment, the internal blocks and background blocks obtained in the previous round of regional iterative adjustment are used as the final adjusted edge blocks, internal blocks and background blocks in turn.
[0138] Furthermore, in this embodiment, determining whether the iterative adjustment termination condition is met includes:
[0139] Determine the change in significance value corresponding to the corrected edge blocks of each region in the current round of regional iterative adjustment;
[0140] Determine the iterative adjustment judgment value according to the discrete degree of the change in the significance value corresponding to the edge blocks after the integration and correction of all regions in the current round of regional iterative adjustment;
[0141] If the iterative adjustment judgment value is less than the set iterative adjustment judgment threshold, it is determined that the iterative adjustment termination condition is met, otherwise it is determined that the iterative adjustment termination condition is not met.
[0142] For the above steps, by recording the significance value of each regional integrated and corrected edge block in each round of regional iterative adjustment, the significance value change corresponding to each regional integrated and corrected edge block is obtained, and the significance value change refers to the difference between the significance value corresponding to each regional integrated and corrected edge block in the current round of regional iterative adjustment and the significance value corresponding to the corresponding regional integrated and corrected edge block in the previous round of regional iterative adjustment. Determine the variance of the significance value change corresponding to all regional integrated and corrected edge blocks in the current round of regional iterative adjustment, and use the variance to characterize the discrete degree of the significance value change. The smaller the variance, the smaller the discrete degree of the significance value change, and use the variance as the iterative adjustment judgment value.
[0143] The iterative adjustment determination threshold is preset, and the value of the iterative adjustment determination threshold can be reasonably selected as needed. In the embodiment of the present invention, the value of the iterative adjustment determination threshold is set to 0.2. The iterative adjustment determination value is compared with the set iterative adjustment determination threshold. If the iterative adjustment determination value is less than the set iterative adjustment determination threshold, it is determined that the iterative adjustment termination condition is met, otherwise it is determined that the iterative adjustment termination condition is not met.
[0144] By means of the above method, several rounds of regional iterative adjustment processes of the edge blocks, internal blocks and background blocks after regional integration correction can be implemented, thereby obtaining the final adjusted edge blocks, internal blocks and background blocks.
[0145] Step S500: analyzing the grayscale difference and gradient difference distribution of the pixels in the adjusted edge blocks, internal blocks and background blocks, and determining the significance values of the adjusted edge blocks, internal blocks and background blocks.
[0146] In the same manner as analyzing the grayscale difference and gradient difference distribution of pixels in the block in the above step S200 to determine the saliency value of the block, the saliency values of the adjusted edge block, internal block and background block can be determined.
[0147] Step S600: adjusting the significance value of the adjusted internal block according to the significance value of the adjusted edge block and the distribution of the adjusted edge blocks of the adjusted internal block in each direction to obtain the adjusted significance value of the adjusted internal block.
[0148] Since the significance value of the adjusted internal area determined by analyzing the grayscale difference and the gradient amplitude difference in the area is low, and the internal area also belongs to the leakage area, in order to accurately identify the leakage area, after determining the significance value of the adjusted edge block, it is necessary to adjust the significance value of the adjusted internal block according to the significance value of the adjusted edge block and the distribution of the adjusted internal block in various directions.
[0149] Furthermore, the above-mentioned adjusting the significance value of the adjusted internal block to obtain the adjusted significance value of the adjusted internal block is implemented by the following steps:
[0150] Determine each surrounding direction of the adjusted internal block, if the adjusted internal block has an adjusted edge block in a certain direction, then use the certain direction as the surrounding direction;
[0151] Determine a target edge block of the adjusted internal block in each surrounding direction thereof, and determine a distance from the target edge block to the adjusted internal block, wherein the target edge block refers to an adjusted edge block that is closest to the adjusted internal block in the corresponding surrounding direction;
[0152] Determine a saliency correction value according to the proportion of the occlusion direction of the target edge block in each surrounding direction of the adjusted internal block in all directions, the distance between the target edge block in each surrounding direction of the adjusted internal block and the adjusted internal block, and the saliency value of the target edge block in each surrounding direction of the adjusted internal block;
[0153] According to the significance correction value, the significance value of the adjusted internal block is adjusted to obtain the adjusted significance value of the adjusted internal block. The larger the significance correction value is, the larger the adjusted significance value of the corresponding adjusted internal block is.
[0154] For the above steps, in the same manner as determining the various surrounding directions of the block to be analyzed in the above step S300, and then determining the target edge block of the block to be analyzed in its various surrounding directions, and determining the distance from the target edge block to the block to be analyzed, the various surrounding directions of the adjusted internal block can be determined, and then the target edge block of the adjusted internal block in its various surrounding directions can be determined, and the distance from the target edge block to the adjusted internal block can be determined.
[0155] Further, in the embodiment of the present invention, the above-mentioned significance value of the adjusted internal block is adjusted to obtain the adjusted significance value of the adjusted internal block, and the corresponding calculation formula is:
[0156] ;
[0157] in, Indicates The adjusted significance value of the adjusted internal blocks; Indicates The pre-adjusted significance value of the adjusted internal blocks; Indicates The number of directions around the adjusted internal blocks, that is, the number of angles blocked by the adjusted edge blocks in the direction of the rays corresponding to the 360 angles; Indicates The adjusted internal blocks are The saliency value of the target edge block in the surrounding direction; Indicates The adjusted internal blocks are The number of occlusion directions of the target edge blocks in the surrounding direction; M represents the total number of directions; Indicates The adjusted internal block is located between the target edge block in the bth surrounding direction and the The distance between the adjusted internal blocks, i.e. The adjusted internal block is from the center of the target edge block in the bth surrounding direction to the The Euclidean distance between the center of the region of the adjusted internal blocks; Represents the normalization function.
[0158] In the above calculation formula, the saliency value of the target edge block in each surrounding direction of the adjusted internal block is To adjust the saliency value of the adjusted internal block. At the same time, the proportion of the occlusion direction of the target edge block in each surrounding direction of the adjusted internal block in all directions is calculated. , to quantify the "angle range" of the influence of the adjusted edge block on the adjusted internal block. The larger the angle of the internal block blocked by the edge block, the greater the influence of the significance of the edge block on the internal block; the reciprocal of the distance between the target edge block and the adjusted internal block in each surrounding direction of the adjusted internal block , to quantify the spatial relationship between the adjusted internal blocks and the adjusted edge blocks. A smaller distance means that the saliency of the edge blocks has a greater impact on the internal blocks, thus affecting the saliency value of the target edge blocks. The weighted average is performed to obtain a significance correction value, and the significance correction value is added to the significance value of the adjusted internal block to obtain an adjusted significance value of the adjusted internal block.
[0159] Step S700: determining the leakage area based on the adjusted saliency values of the edge blocks and the background blocks, and the adjusted saliency values of the internal blocks.
[0160] After obtaining the saliency values of the adjusted edge blocks and background blocks, and the adjusted saliency values of the adjusted internal blocks through the above steps, these saliency values and adjusted saliency values are brought into the saliency algorithm to determine the leakage area in the grayscale image.
[0161] Further, in an embodiment of the present invention, based on the adjusted significance values of the edge blocks and background blocks, and the adjusted significance values of the internal blocks, the CA significance algorithm is used to determine each region of interest, and based on each region of interest, the leakage region is determined. That is, the adjusted significance values of the edge blocks and background blocks, and the adjusted significance values of the internal blocks are substituted into the CA significance algorithm, and each region of interest is determined using the CA significance algorithm, and the regions of interest are merged, and the region obtained by merging is the leakage region. Since the implementation process of determining the leakage region using the CA significance algorithm belongs to the prior art, it will not be repeated here. All the leakage regions in the grayscale image are marked, and the marking information is transmitted to the relevant operator, and the operator further determines and repairs the marked leakage region.
[0162] Based on the same inventive concept, the embodiment of the present invention also provides a leakage point detection system in the process of waterproof leakage treatment, such as Figure 3 As shown, the system includes: a memory 301, a processor 302, and a computer program 303 stored in the memory 301 and running on the processor 302, wherein when the processor 302 executes the computer program 303, the system can execute any one of the leakage point detection methods in the waterproof leakage control process introduced above.
[0163] The embodiment of the present invention can divide the system into functional modules according to the above method example. For example, each functional module can be corresponded to, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0164] Based on the same inventive concept, an embodiment of the present invention also provides a computer program product, which includes: computer program code, when the computer program code runs on a computer, the computer executes any one of the leakage point detection methods in the waterproof leakage control process introduced above.
[0165] Based on the same inventive concept, an embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program code. When the computer program code runs on a computer, the computer executes any one of the leakage point detection methods in the waterproof leakage control process introduced above.
[0166] It should be noted that the above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for detecting leakage points in a waterproof leakage control process, characterized in that: The following steps are involved: Divide the grayscale image of the thermal infrared image of the leakage area to be detected into several blocks; Analyze the grayscale difference and gradient difference distribution of pixels in the blocks, determine the significance value of the blocks, and then select edge blocks from several blocks; The blocks other than the edge blocks in the plurality of blocks are taken as the blocks to be analyzed, and the internal blocks and background blocks in the blocks to be analyzed are screened out according to the distribution of the edge blocks in all directions of the blocks to be analyzed; According to the inconsistency of the gradient direction of the internal edge of the edge block and the difference in the position distribution of different edge blocks relative to the same internal block, the edge block, the internal block and the background block are regionally iteratively adjusted to obtain the adjusted edge block, internal block and background block; Analyze the grayscale difference and gradient difference distribution of the pixels in the adjusted edge blocks, internal blocks and background blocks, and determine the significance values of the adjusted edge blocks, internal blocks and background blocks; According to the saliency value of the adjusted edge block and the distribution of the adjusted edge blocks of the adjusted internal blocks in various directions, the saliency value of the adjusted internal block is adjusted to obtain an adjusted saliency value of the adjusted internal block; Determine the leakage area based on the adjusted saliency values of the edge blocks and the background blocks and the adjusted saliency values of the adjusted internal blocks; Filter out the internal blocks and background blocks in the blocks to be analyzed, including: Determine each surrounding direction of the block to be analyzed. If the block to be analyzed has an edge block in a certain direction, then the certain direction is used as the surrounding direction; Determine the target edge block of the block to be analyzed in each surrounding direction, and determine the distance from the target edge block to the block to be analyzed, the target edge block refers to the edge block closest to the block to be analyzed in the corresponding surrounding direction; According to the proportion of each surrounding direction of the block to be analyzed in all directions and the difference in distances corresponding to adjacent surrounding directions of the block to be analyzed, the possibility of the block to be analyzed belonging to an internal block is determined; According to the possibility of belonging to the internal block, the internal block and the background block in the block to be analyzed are screened out, the possibility of the internal block belonging to the internal block is greater than the set possibility threshold, and the possibility of the background block belonging to the internal block is less than or equal to the set possibility threshold.
2. A method for detecting leakage points in a waterproof leakage control process according to claim 1, characterized in that: Determine the saliency value of the block, including: Determine the difference between the maximum grayscale value and the minimum grayscale value of all pixels in the block to obtain the grayscale extreme difference value; Determine the mean value, maximum value and minimum value of the gradient amplitude of all pixels in the block; Determine the gradient amplitude difference between the gradient amplitude of each pixel point in the block and the gradient amplitude mean, and standardize the gradient amplitude difference according to the difference between the maximum gradient amplitude and the minimum gradient amplitude to obtain the standardized gradient amplitude difference; The significance value of the block is determined according to the grayscale extreme difference value and the average distribution of the standardized gradient amplitude difference corresponding to all pixels in the block.
3. The method for detecting leakage points in the process of waterproof leakage control according to claim 1, characterized in that: The steps for determining the inconsistency of the gradient direction of the internal edge of the edge block include: Determine the maximum gradient amplitude of all pixels in the edge block, and use the gradient direction of the pixel corresponding to the maximum gradient amplitude as the target gradient direction; Determine the ratio of the gradient magnitude of each pixel in the edge block to the maximum gradient magnitude; Determine the gradient direction difference between the gradient direction of each pixel in the edge block and the target gradient direction; The ratios corresponding to all pixels in the edge block are used as weights, and the gradient direction differences corresponding to all pixels in the edge block are weighted summed up. The weighted summation result is normalized to obtain the gradient direction inconsistency of the internal edge of the edge block.
4. The method for detecting leakage points in the process of waterproof leakage control according to claim 1, characterized in that: The edge blocks, the internal blocks and the background blocks are regionally iteratively adjusted to obtain the adjusted edge blocks, the internal blocks and the background blocks, including: According to the inconsistency of the gradient direction of the internal edge of the edge block and the difference in the position distribution of different edge blocks relative to the same internal block, the edge block is resized to obtain an adjusted size length, and the adjusted edge block is determined according to the adjusted size length; Based on the adjusted edge blocks, internal blocks and background blocks, regional integration correction of the edge blocks, internal blocks and background blocks is performed, so as to obtain edge blocks, internal blocks and background blocks after regional integration correction; For the edge blocks, internal blocks and background blocks corrected by regional integration, several rounds of regional iterative adjustment are continued to be performed to obtain the final adjusted edge blocks, internal blocks and background blocks.
5. A method for detecting leakage points in a waterproof leakage control process according to claim 4, characterized in that: The edge blocks are resized to obtain the adjusted size length, including: Determine the difference in number between each edge block and every other edge block in the surrounding direction corresponding to the same internal block; Determine the current scale correction value of each edge block according to the average distribution of the corresponding quantity differences between each edge block and each other edge block, and the inconsistency of the gradient direction of the internal edge of each edge block; The initial size length of each edge block is corrected using the current scale correction value to obtain the corrected size length of each edge block.
6. A method for detecting leakage points in a waterproof leakage control process according to claim 4, characterized in that: For the edge blocks, internal blocks and background blocks corrected by regional integration, several rounds of regional iterative adjustments are continued to obtain the final adjusted edge blocks, internal blocks and background blocks, including: In the current round of regional iterative adjustment, the regional integration-corrected edge blocks obtained by size adjustment in the previous round of regional iterative adjustment are obtained as the first type of edge blocks, and the second type of edge blocks obtained in all previous rounds of regional iterative adjustment are obtained; All first-class edge blocks are traversed, and the traversal process includes: analyzing the grayscale difference and gradient difference distribution of the pixels in each first-class edge block, determining the significance value of each first-class edge block, if the significance value is not less than the set significance threshold, the first-class edge block stops resizing, and the first-class edge block is used as a new second-class edge block; if the significance value is less than the set significance threshold, the first-class edge block is resized according to the inconsistency of the gradient direction of the internal edge of the first-class edge block, and the position distribution difference between the first-class edge block and each object edge block relative to the same internal block obtained in the previous round of regional iterative adjustment, to obtain the adjusted size length, thereby obtaining the adjusted edge block, the object edge block refers to other first-class edge blocks or second-class edge blocks; After all the first-category edge blocks are traversed, if there are edge blocks after regional integration correction obtained by resizing in the first-category edge blocks, regional integration correction is performed on the adjusted edge blocks obtained by resizing in the first-category edge blocks and the internal blocks and background blocks obtained in the previous round of regional iterative adjustment to obtain edge blocks, internal blocks and background blocks after regional integration correction; If there are edge blocks corrected by regional integration obtained by resizing in the first category of edge blocks, and the iterative adjustment termination condition is not satisfied, the next round of regional iterative adjustment is performed; otherwise, if there are edge blocks corrected by regional integration obtained by resizing in the first category of edge blocks, and the iterative adjustment termination condition is satisfied, the edge blocks corrected by regional integration obtained in the current round of regional iterative adjustment and the second category of edge blocks obtained in all rounds of regional iterative adjustment are used as the final adjusted edge blocks, and the internal blocks and background blocks corrected by regional integration obtained in the current round of regional iterative adjustment are used as the final adjusted internal blocks and background blocks in sequence; if there are no edge blocks corrected by regional integration obtained by resizing in the first category of edge blocks, the second category of edge blocks obtained in all current rounds of regional iterative adjustment, the internal blocks and background blocks obtained in the previous round of regional iterative adjustment are used as the final adjusted edge blocks, internal blocks and background blocks in sequence.
7. A method for detecting leakage points in a waterproof leakage control process according to claim 6, characterized in that: Determine whether the iterative adjustment termination conditions are met, including: Determine the change in significance value corresponding to the corrected edge blocks of each region in the current round of regional iterative adjustment; Determine the iterative adjustment judgment value according to the discrete degree of the change in the significance value corresponding to the edge blocks after the integration and correction of all regions in the current round of regional iterative adjustment; If the iterative adjustment judgment value is less than the set iterative adjustment judgment threshold, it is determined that the iterative adjustment termination condition is met, otherwise it is determined that the iterative adjustment termination condition is not met.
8. The method for detecting leakage points in the process of waterproof leakage control according to claim 1, characterized in that: The adjusted saliency value of the internal block is adjusted to obtain the adjusted saliency value of the internal block, including: Determine each surrounding direction of the adjusted internal block, if the adjusted internal block has an adjusted edge block in a certain direction, then use the certain direction as the surrounding direction; Determine a target edge block of the adjusted internal block in each surrounding direction thereof, and determine a distance from the target edge block to the adjusted internal block, wherein the target edge block refers to an adjusted edge block that is closest to the adjusted internal block in the corresponding surrounding direction; Determine a saliency correction value according to the proportion of the occlusion direction of the target edge block in each surrounding direction of the adjusted internal block in all directions, the distance between the target edge block in each surrounding direction of the adjusted internal block and the adjusted internal block, and the saliency value of the target edge block in each surrounding direction of the adjusted internal block; According to the significance correction value, the significance value of the adjusted internal block is adjusted to obtain the adjusted significance value of the adjusted internal block. The larger the significance correction value is, the larger the adjusted significance value of the corresponding adjusted internal block is.
9. The method for detecting leakage points in the process of waterproof leakage control according to claim 1, characterized in that: Identify the area of the leak, including: Based on the adjusted saliency values of the edge blocks and the background blocks, and the adjusted saliency values of the adjusted internal blocks, the CA saliency algorithm is used to determine each focus region, and based on each focus region, the leakage region is determined.
Citation Information
Patent Citations
Auxiliary data for artifacts-aware view synthesis
CN108475330A
Visual salience region detection method and device
CN109543701A