Power visualization image processing method based on block compression
By adopting block compression and multi-objective tracking technology in power equipment monitoring, combining fast speed and high-precision models, the problems of low monitoring efficiency and insufficient accuracy of traditional power equipment are solved, and efficient and accurate power equipment fault detection is achieved. Reduce costs and meet real-time monitoring needs.
Patent Information
- Application Number
- CN202411342643.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-13
AI Technical Summary
Traditional power equipment monitoring methods are low efficiency, insufficient accuracy and high cost. Traditional image processing technology is slow in computing speed and insufficient accuracy in large-scale power visual image processing, making it difficult to meet the real-time monitoring needs.
Two models are constructed using the power visual image processing method based on block compression: a faster but lower accuracy model for preliminary detection, and a high-precision model for slow calculation speed for detection after block compression , combining multi-objective tracking, dynamic area detection, rectangular box rearrangement and high-precision models for fault detection.
It improves the efficiency and accuracy of power equipment fault detection, reduces detection costs, meets the real-time monitoring needs of the power system, and provides efficient and accurate fault detection support.
Smart Images

Figure CN119131086A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of electric power detection, and in particular to an electric power visualization image processing method based on block compression. Background Art
[0002] As the complexity and scale of power systems continue to increase, the monitoring and maintenance of power equipment has become increasingly important. Traditional power equipment monitoring methods mainly rely on manual inspections, which is not only inefficient but also easily affected by environmental factors, resulting in inaccurate detection results. Therefore, the development of an efficient and accurate power equipment fault detection method has become an important demand in the power industry.
[0003] Generally speaking, manual inspections have great limitations, such as: low efficiency: manual inspections require a lot of manpower and time, and it is difficult to meet the real-time monitoring needs of large-scale power systems; low accuracy: manual inspections are easily affected by factors such as the experience and fatigue of the inspectors, resulting in inaccurate detection results; high cost: long-term manual inspections are costly and difficult to cover all equipment.
[0004] However, traditional image processing technology also has certain limitations. For example, its processing speed is slow: when processing large-scale power visualization images, traditional image processing technology has a slow calculation speed and cannot meet the needs of real-time monitoring. Its accuracy is insufficient when detecting power equipment faults, and it is easy to miss or misdetect. Its complexity is high: traditional image processing technology requires complex algorithms and a large amount of computing resources, making it difficult to promote in practical applications.
[0005] The current improvement direction of existing technologies is mainly to introduce deep learning technology. First, it is used to improve accuracy: deep learning technology has high accuracy in target detection and image recognition, which can effectively improve the accuracy of power equipment fault detection; second, it is used to improve efficiency: deep learning technology can improve the efficiency of image processing through parallel computing and optimization algorithms to meet the needs of real-time monitoring. However, the processing of power images is still not perfect, and there are still some problems, such as huge data volume, processing of key information, and the accuracy of processing is not combined with efficiency improvement. Summary of the invention
[0006] The purpose of the invention is to provide a power visualization image processing method based on block compression to solve the above-mentioned problems existing in the prior art.
[0007] Technical solution: A method for processing electric power visualization images based on block compression, comprising the following steps:
[0008] Step S1, constructing two power visualization image processing models, including:
[0009] The first power visualization image processing model: select a model with faster speed but relatively lower accuracy to preliminarily detect power equipment in the power visualization image;
[0010] The second power visualization image processing model: a model with high accuracy but slow calculation speed is selected to detect power equipment faults in the power visualization image after block compression;
[0011] Step S2, acquiring power visualization images and storing them in a database to form a power visualization image data set; preprocessing the images in the power visualization image data set to ensure that the image format and resolution are suitable for subsequent processing;
[0012] Step S3, obtaining the pre-processed power visualization image, using the first power visualization image processing model for detection, obtaining the power equipment detection frame, and marking it as t , t is a natural number;
[0013] Step S4: Check the power equipment frame O t The block compression is performed, and the multi-target tracking and dynamic area detection algorithms are used for detection. The binary image is used to represent the potential power equipment fault area of the current power visualization image. t move ;
[0014] Step S5: for each potential power equipment fault area O t move , using the binary image expansion algorithm to determine the motion area frame O of the image t bbox , to extract the significant areas in the potential power equipment failure area:
[0015] Step S6: using a binary reduction rectangular frame rearrangement algorithm to resize the moving area frame O t bbox Rearrange the image to obtain the rearranged power visualization image P t new , and the motion area frame O t bbox In the image P t new Position O t new ;
[0016] Step S7, using the second power visualization image processing model to process the rearranged power visualization image O t new Perform fault detection and output fault detection result O t det , the test result is O tdet Include the location and size of each electrical equipment fault area;
[0017] Step S8, comparing the fault detection results of the power visualization images after the weighting is rearranged one by one. t det and the motion region frame O of the image before rearrangement t bbox The corresponding relationship of the rectangular frame is constructed, and the position and size of the current fault detection result in the original image are calculated accordingly, that is, O t final ; t is a natural number;
[0018] Step S9, repeating steps S4 to S8 until the power visualization image detection work is completed.
[0019] According to another aspect of the present application, the step S1 is further:
[0020] Step S11, constructing a first power visualization image processing model M1 and a second power visualization image processing model M2, wherein the parameter quantity of M1 is greater than that of M2, the accuracy is lower than that of M2, and the calculation speed is higher than that of M2;
[0021] Step S12, initializing at least one square box B to place the target area in the image, the side length of the box is S, and the initial value is 0;
[0022] Step S13, initializing a variable Q used to record whether the placement is successful, and the initial value of Q is True;
[0023] Step S14: Initialize the upper bound U and lower bound L used to determine the minimum side length of the box, where the initial value of the upper bound is the motion area box O. t bbox The maximum total length of the width and height of all rectangular boxes in the . The initial value of the lower bound is 0.
[0024] According to another aspect of the present application, step S4 is further:
[0025] S41, the power equipment detection frame O obtained in step S3 t Divide into blocks, the size of each block is a fixed value, and the power equipment detection box O t The coordinates of the blocks are (x1, y1, x2, y2), and the block coordinates after segmentation are (x i1 ,y i1 ,x i2 ,y i2 ), where i represents the i-th block, which is specifically expressed as:
[0026] x i1 =x1+(i-1)×block_size;
[0027] y i1 =y1+(i-1)×block_size;
[0028] x i2 =x i1 +block_size;
[0029] y i2 =y i1 +block_size;
[0030] Among them, block_sizeblock_size is the block size;
[0031] S42, using the JPEG compression algorithm to compress each block to reduce the amount of image data, the image after the block is 1 block , the compressed image is I compressed , the compression quality is q, then I compressed =JPEG_compress(I block ,q), where JPEG_compress represents the JPEG compression operation;
[0032] S43, using multi-target tracking and dynamic area detection algorithms for detection, including:
[0033] Step S431: Use the YOLOv3 model to detect the target and obtain the target frame B t ={bt1,bt2,…,bt n};
[0034] Step S432: Use the Hungarian algorithm to perform target matching. The formula is as follows:
[0035] cost_matrix = IoU(B t ,B t-1 );
[0036] Among them, IoU(B t ,B t-1 ) represents the intersection-over-union ratio between target boxes;
[0037] Step S433: Calculate the optical flow field F using the Lucas-Kanade optical flow method t , the formula is as follows:
[0038] F t =LK(I t ,I t-1 );
[0039] Among them, I t and I t-1Represent the images of the current frame and the previous frame respectively;
[0040] Step S434: extract the salient area in the optical flow field and generate a binary image O t move ;
[0041] Step S44: convert the dynamic area detection result into a binary image to represent the potential power equipment fault area of the current power visualization image. t move , the dynamic area detection result is D t , the binary image is O t move :
[0042] O t move (x,y)=1, if D t (x,y)>threshold; otherwise, O t move (x,y)=0;
[0043] Among them, threshold is the binarization threshold.
[0044] According to another aspect of the present application, the step 5 is further:
[0045] Step S51: Use the morphological expansion algorithm to expand the potential power equipment fault area. t move is the input image, and the expanded image is O t dilated , the expansion kernel is K:
[0046] O t dilated =Dilate(O t mov e ,K); where Dilate represents the dilation operation and K represents the dilation kernel;
[0047] Step S52: extract the salient area from the expanded binary image and determine the motion area frame of the image. t bbox , the expanded binary image O t dilated , motion area frame O t bbox The coordinates of (x min ,y min ,x max ,y max ):
[0048] x min =minx,y∈Ot dilated x;
[0049] y min =minx,y∈O t dilated y;
[0050] x max =maxx,y∈O t dilated x;
[0051] y max =maxx,y∈O t dilated y
[0052] Among them, x min and min Indicates the minimum coordinate of the motion area box, x max and max Indicates the maximum coordinate of the motion area box;
[0053] Step S53, extracting a salient region using a saliency detection algorithm, the input image is I, the saliency map is S, then S=SR(I), where SR represents a spectral residual method;
[0054] Step S54: merge the salient region and the motion region frame to obtain the final motion region frame. t bbox The specific method is: the salient area is S, and the motion area box is O t bbox ,but
[0055] O t bbox =Merge(S,O t bbox );
[0056] Among them, MergeMerge represents the region merge operation.
[0057] According to another aspect of the present application, the step 6 is further:
[0058] Step S61: Use a binary reduction algorithm to reduce the motion region frame O t bbox Reduce the redundant area by: t bbox The coordinates of (x min ,y min ,x max ,y max ), the reduced area frame is O t reduced,but
[0059] O t reduced =Reduce(O t bbox ,factor);
[0060] Among them, Reduce represents the reduction operation, and factor represents the reduction factor;
[0061] Step S62: rearrange the reduced rectangular frames to obtain a rearranged power visualization image P t new , and the motion area frame O t bbox In the image P t new Position O t new The specific method is: the reduced area frame is O t reduced , the rearranged image is P t new , the rearranged region box is O t new ,but
[0062] P t new ,O t new =Rearrange(O t reduced );
[0063] Among them, Rearrange represents the rearrangement operation;
[0064] Step S63: designing a rearrangement algorithm, including:
[0065] Step S631, initialization: Initialize an empty image P t new , the size is the same as the original image;
[0066] Step S632, traverse the area frame: traverse the reduced area frame O t reduced , place it on image P t new middle;
[0067] Step S633, placement strategy: using a greedy algorithm or a dynamic programming algorithm to select the best placement position to ensure that the rearranged image is as compact as possible;
[0068] Step S634, placement formula: current area box is 0 treduced [i], the placement is (x new ,y new ),but
[0069] P t new [x new :x new +w,y new :y new + h]=O t reduced [i];
[0070] Among them, w and h represent the width and height of the region box respectively;
[0071] Step S64: update the position of the rearranged area frame. The specific method is: the rearranged area frame is 0 t new , update its position to (x new ,y new ),but
[0072] O t new [i]=(x new ,y new ,x new +w,y new +h);
[0073] Among them, w and h represent the width and height of the region box respectively.
[0074] According to another aspect of the present application, the step 7 is further:
[0075] Step S71, loading a second power visualization image processing model;
[0076] Step S72: input the rearranged power visualization image P t new ;
[0077] Step S73: Output fault detection result O t det .
[0078] According to another aspect of the present application, the step 8 is further:
[0079] Step S81: Compare the fault detection results of the rearranged power visualization image with the motion region frame of the image before rearrangement, and compare the fault detection results of the rearranged power visualization image one by one. t det and the motion region frame O of the image before rearrangement t bboxThe specific method is: the fault detection result after rearrangement is O t det , the motion area frame before rearrangement is O t bbox ,but
[0080] comparison_result = compare( t det ,O t bbox );
[0081] Among them, compare represents a comparison operation;
[0082] Step S82: construct the corresponding relationship of the rectangular frame, and calculate the position and size of the current fault detection result in the original image. t final , the specific method is: the comparison result is comparison_result, the corresponding relationship is correspondence, then
[0083] correspondence=build_correspondence(comparison_result)
[0084] Among them, build_correspondence means building a corresponding relationship operation;
[0085] Step S83, calculate the position and size in the original image: According to the corresponding relationship, calculate the position and size of the current fault detection result in the original image, the method is: the corresponding relationship is correspondence, the position and size in the original image are O t final ,but
[0086] O t final =calculate_position_size(correspondence)
[0087] Wherein, calculate_position_size indicates the operation of calculating position and size.
[0088] According to another aspect of the present application, a power visualization image processing system based on block compression is also provided, comprising:
[0089] at least one processor; and
[0090] a memory communicatively connected to at least one of the processors; wherein,
[0091] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement a power visualization image processing method based on block compression as described in any of the above technical solutions.
[0092] Beneficial effects: By introducing deep learning technology, block compression technology, multi-target tracking and dynamic area detection technology, an efficient and accurate power visualization image processing method is constructed. This method not only improves the efficiency and accuracy of power equipment fault detection, but also reduces the detection cost, providing strong support for real-time monitoring and maintenance of power systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] Figure 1 It is the overall flow chart of the present invention.
[0094] Figure 2 This is a flow chart of step S4 of the present invention.
[0095] Figure 3 This is a flow chart of step S5 of the present invention.
[0096] Figure 4 This is a flowchart of step S6 of the present invention.
[0097] Figure 5 This is a flowchart of step S8 of the present invention. DETAILED DESCRIPTION
[0098] like Figure 1 As shown, according to one aspect of the present application, a method for processing electric power visualization images based on block compression includes the following steps:
[0099] Step S1, constructing two power visualization image processing models, including:
[0100] The first power visualization image processing model: select a model with faster speed but relatively lower accuracy to preliminarily detect power equipment in the power visualization image;
[0101] The second power visualization image processing model: a model with high accuracy but slow calculation speed is selected to detect power equipment faults in the power visualization image after block compression;
[0102] Step S2, acquiring power visualization images and storing them in a database to form a power visualization image data set; preprocessing the images in the power visualization image data set to ensure that the image format and resolution are suitable for subsequent processing;
[0103] Step S3, obtaining the pre-processed power visualization image, using the first power visualization image processing model for detection, obtaining the power equipment detection frame, and marking it ast , t is a natural number;
[0104] Step S4: Check the power equipment frame O t The block compression is performed, and the multi-target tracking and dynamic area detection algorithms are used for detection. The binary image is used to represent the potential power equipment fault area of the current power visualization image. t move ;
[0105] Step S5: for each potential power equipment fault area O t move , using the binary image expansion algorithm to determine the motion area frame O of the image t bbox , to extract the significant areas in the potential power equipment failure area:
[0106] Step S6: using a binary reduction rectangular frame rearrangement algorithm to resize the moving area frame O t bbox Rearrange the image to obtain the rearranged power visualization image P t new , and the motion area frame O t bbox In the image P t new Position O t new ;
[0107] Step S7, using the second power visualization image processing model to process the rearranged power visualization image O t new Perform fault detection and output fault detection result O t det , the test result is O t det Include the location and size of each electrical equipment fault area;
[0108] Step S8, comparing the fault detection results of the power visualization images after the weighting is rearranged one by one. t det and the motion region frame O of the image before rearrangement t bbox The corresponding relationship of the rectangular frame is constructed, and the position and size of the current fault detection result in the original image are calculated accordingly, that is, O t final ; t is a natural number;
[0109] Step S9, repeating steps S4 to S8 until the power visualization image detection work is completed.
[0110] This embodiment realizes the division of labor between preliminary detection and fine detection by selecting a model with faster speed but relatively low accuracy (such as YOLOv3) and a model with higher accuracy but slower calculation speed (such as Faster R-CNN), thereby improving the overall detection efficiency. The image is converted in format and the resolution is adjusted to ensure that the image is suitable for subsequent processing, reducing the computational complexity of subsequent processing. A faster model is used for preliminary detection to quickly locate the potential fault area, reducing the amount of calculation for subsequent processing. At the same time, the amount of image data is reduced by block compression technology, the computational complexity is reduced, and the processing speed is improved. The potential fault area is expanded by a binary image expansion algorithm to ensure the integrity of the detection results and reduce the possibility of missed detection. The image layout is optimized by a binary reduction and rearrangement algorithm to improve the detection efficiency. A high-precision model is used for fine detection to ensure the accuracy of the detection results. By constructing the corresponding relationship of the rectangular box, the position and size of the fault detection result in the original image are calculated to ensure the accuracy of the detection result.
[0111] By selecting high-precision models (such as Faster R-CNN) for fine detection, the accuracy of the detection results is ensured. The image is preprocessed to ensure that the image format and resolution are suitable for subsequent processing, reducing the detection error caused by image quality problems. A faster model is used for preliminary detection to quickly locate potential fault areas, providing a basis for subsequent fine detection. At the same time, the amount of image data is reduced through block compression technology, key information is retained, and the accuracy of the detection results is ensured. The potential fault area is expanded through the binary image expansion algorithm to ensure the integrity of the detection results and reduce the possibility of missed detection. The image layout is optimized through binary reduction and rearrangement algorithms to improve detection efficiency and accuracy.
[0112] The solution achieves efficient and accurate power equipment fault detection by building two power visualization image processing models with different speeds and accuracies, and combining algorithms such as block compression, multi-target tracking, dynamic area detection, binary image expansion, and rectangular frame rearrangement. The solution not only improves detection efficiency and accuracy, but also has high flexibility and can adapt to different scenarios and needs, providing strong support for real-time monitoring and maintenance of power systems.
[0113] According to another aspect of the present application, the step S1 is further:
[0114] Step S11, constructing a first power visualization image processing model M1 and a second power visualization image processing model M2, wherein the parameter quantity of M1 is greater than that of M2, the accuracy is lower than that of M2, and the calculation speed is higher than that of M2;
[0115] Step S12, initializing at least one square box B to place the target area in the image, the side length of the box is S, and the initial value is 0;
[0116] Step S13, initializing a variable Q used to record whether the placement is successful, and the initial value of Q is True;
[0117] Step S14: Initialize the upper bound U and lower bound L used to determine the minimum side length of the box, where the initial value of the upper bound is the motion area box O. t bbox The maximum total length of the width and height of all rectangular boxes in the . The initial value of the lower bound is 0.
[0118] This embodiment constructs two power visualization image processing models with different precision and speed, and initializes the square box B used to place the target area, the variable Q that records whether the placement is successful, and the upper bound U and lower bound L of the minimum side length of the box. These initialization steps provide a basis for subsequent power equipment fault detection.
[0119] like Figure 2 As shown, according to another aspect of the present application, the step S4 is further:
[0120] S41, the power equipment detection frame O obtained in step S3 t Divide into blocks, the size of each block is a fixed value, and the power equipment detection box O t The coordinates of the blocks are (x1, y1, x2, y2), and the block coordinates after segmentation are (x i1 ,y i1 ,x i2 ,y i2 ), where i represents the i-th block, which is specifically expressed as:
[0121] x i1 =x1+(i-1)×block_size;
[0122] y i1 =y1+(i-1)×block_size;
[0123] x i2 =x i1 +block_size;
[0124] y i2 =y i1 +block_size;
[0125] Among them, block_sizeblock_size is the block size;
[0126] S42, using the JPEG compression algorithm to compress each block to reduce the amount of image data, the image after the block is 1 block , the compressed image is I compressed , the compression quality is q, then I compressed=JPEG_compress(I block ,q), where JPEG_compress represents the JPEG compression operation;
[0127] S43, using multi-target tracking and dynamic area detection algorithms for detection, including:
[0128] Step S431: Use the YOLOv3 model to detect the target and obtain the target frame B t ={bt1,bt2,…,bt n};
[0129] Step S432: Use the Hungarian algorithm to perform target matching. The formula is as follows:
[0130] cost_matrix = IoU(B t ,B t-1 );
[0131] Among them, IoU(B t ,B t-1 ) represents the intersection-over-union ratio between target boxes;
[0132] Step S433: Calculate the optical flow field F using the Lucas-Kanade optical flow method t , the formula is as follows:
[0133] F t =LK(I t ,I t-1 );
[0134] Among them, I t and I t-1 Represent the images of the current frame and the previous frame respectively;
[0135] Step S434: extract the salient area in the optical flow field and generate a binary image O t move ;
[0136] Step S44: convert the dynamic area detection result into a binary image to represent the potential power equipment fault area of the current power visualization image. t move , the dynamic area detection result is D t , the binary image is O t move :
[0137] O t move (x,y)=1, if D t (x,y)>threshold; otherwise, O t move (x,y)=0;
[0138] Among them, threshold is the binarization threshold.
[0139] This embodiment divides and compresses the power equipment detection frame, reducing the amount of image data and facilitating subsequent processing. At the same time, combined with multi-target tracking and dynamic area detection algorithms, a binary image representing the potential power equipment fault area is generated. These steps provide a basis for subsequent power equipment fault detection.
[0140] like Figure 3 As shown, according to another aspect of the present application, the step 5 is further:
[0141] Step S51: Use the morphological expansion algorithm to expand the potential power equipment fault area. t move is the input image, and the expanded image is O t dilated , the expansion kernel is K:
[0142] O t dilated =Dilate(O t mov e ,K); where Dilate represents the dilation operation and K represents the dilation kernel;
[0143] Step S52: extract the salient area from the expanded binary image and determine the motion area frame of the image. t bbox , the expanded binary image O t dilated , motion area frame O t bbox The coordinates of (x min ,y min ,x max ,y max ):
[0144] x min =minx,y∈O t dilated x;
[0145] y min =minx,y∈O t dilated y;
[0146] x max =maxx,y∈O t dilated x;
[0147] y max =maxx,y∈Ot dilated y
[0148] Among them, x min and min Indicates the minimum coordinate of the motion area box, x max and max Indicates the maximum coordinate of the motion area box;
[0149] Step S53, extracting a salient region using a saliency detection algorithm, the input image is I, the saliency map is S, then S=SR(I), where SR represents a spectral residual method;
[0150] Step S54: merge the salient region and the motion region frame to obtain the final motion region frame. t bbox The specific method is: the salient area is S, and the motion area box is O t bbox ,but
[0151] O t bbox =Merge(S,O t bbox );
[0152] Among them, MergeMerge represents the region merge operation.
[0153] This embodiment uses a morphological expansion algorithm to expand the potential power equipment fault area, and combines it with a saliency detection algorithm to extract the saliency area, and finally determines the motion area frame of the image. These steps provide a basis for subsequent power equipment fault detection.
[0154] like Figure 4 As shown, according to another aspect of the present application, the step 6 is further:
[0155] Step S61: Use a binary reduction algorithm to reduce the motion region frame O t bbox Reduce the redundant area by: t bbox The coordinates of (x min ,y min ,x max ,y max ), the reduced area frame is O t reduced ,but
[0156] O t reduced =Reduce(O t bbox ,factor);
[0157] Among them, Reduce represents the reduction operation, and factor represents the reduction factor;
[0158] Step S62: rearrange the reduced rectangular frames to obtain a rearranged power visualization image P t new , and the motion area frame O t bbox In the image P t new Position O t new The specific method is: the reduced area frame is O t reduced , the rearranged image is P t new , the rearranged region box is O t new ,but
[0159] P t new ,O t new =Rearrange(O t reduced );
[0160] Among them, Rearrange represents the rearrangement operation;
[0161] Step S63: designing a rearrangement algorithm, including:
[0162] Step S631, initialization: Initialize an empty image P t new , the size is the same as the original image;
[0163] Step S632, traverse the area frame: traverse the reduced area frame O t reduced , place it on image P t new middle;
[0164] Step S633, placement strategy: using a greedy algorithm or a dynamic programming algorithm to select the best placement position to ensure that the rearranged image is as compact as possible;
[0165] Step S634, placement formula: current area box is 0 t reduced [i], the placement is (x new ,y new ),but
[0166] P t new [xnew :x new +w,y new :y new + h]=O t reduced [i];
[0167] Among them, w and h represent the width and height of the region box respectively;
[0168] Step S64: update the position of the rearranged area frame. The specific method is: the rearranged area frame is 0 t new , update its position to (x new ,y new ),but
[0169] O t new [i]=(x new ,y new ,x new +w,y new +h);
[0170] Among them, w and h represent the width and height of the region box respectively.
[0171] This embodiment uses a binary reduction algorithm to reduce the motion region frame, and combines it with a rearrangement algorithm to obtain a rearranged power visualization image and a new position of the motion region frame. These steps provide a basis for subsequent power equipment fault detection.
[0172] According to another aspect of the present application, the step 7 is further:
[0173] Step S71, loading a second power visualization image processing model;
[0174] Step S72: input the rearranged power visualization image P t new ;
[0175] Step S73: Output fault detection result O t det .
[0176] like Figure 5 As shown, according to another aspect of the present application, the step 8 is further:
[0177] Step S81: Compare the fault detection results of the rearranged power visualization image with the motion region frame of the image before rearrangement, and compare the fault detection results of the rearranged power visualization image one by one. t det and the motion region frame O of the image before rearrangement t bboxThe specific method is: the fault detection result after rearrangement is O t det , the motion area frame before rearrangement is O t bbox ,but
[0178] comparison_result = compare( t det ,O t bbox );
[0179] Among them, compare represents a comparison operation;
[0180] Step S82: construct the corresponding relationship of the rectangular frame, and calculate the position and size of the current fault detection result in the original image. t final , the specific method is: the comparison result is comparison_result, the corresponding relationship is correspondence, then
[0181] correspondence=build_correspondence(comparison_result)
[0182] Among them, build_correspondence means building a corresponding relationship operation;
[0183] Step S83, calculate the position and size in the original image: According to the corresponding relationship, calculate the position and size of the current fault detection result in the original image, the method is: the corresponding relationship is correspondence, the position and size in the original image are O t final ,but
[0184] O t final =calculate_position_size(correspondence)
[0185] Wherein, calculate_position_size indicates the operation of calculating position and size.
[0186] This embodiment builds a corresponding relationship between the rectangular frames by comparing the fault detection results of the rearranged power visualization image with the rectangular frames of the motion region frame of the image before rearrangement one by one, ensuring that the position and size of the detection result in the original image are accurate. The rearranged image may have position offset or scaling. By building a corresponding relationship, the detection error caused by image transformation can be effectively reduced, and the accuracy of the detection result can be improved.
[0187] By constructing the correspondence of the rectangular boxes, it is ensured that each detected fault area has a corresponding position and size in the original image, avoiding missed detection or false detection due to image transformation. The correspondence construction can ensure that all potential fault areas are covered, thereby improving the integrity of the detection results.
[0188] By constructing the correspondence of the rectangular boxes, the position and size of the fault detection results in the original image can be quickly calculated, reducing the amount of calculation for subsequent processing and improving detection efficiency. The construction of the correspondence can reduce unnecessary repeated calculations and improve the overall processing speed of the system.
[0189] By constructing the correspondence of rectangular boxes, the system can adapt to different image transformation and processing scenarios and enhance the robustness of the system. The correspondence construction can ensure that the system can accurately detect the fault area in images with different resolutions and compression ratios, thereby improving the adaptability of the system.
[0190] In summary, this embodiment ensures that the position and size of the detection results in the original image are accurate, improves the accuracy and completeness of the detection results, enhances the robustness and adaptability of the system, and improves the detection efficiency. These benefits provide strong support for power equipment fault detection and ensure the reliability and practicality of the detection results.
[0191] According to another aspect of the present application, a power visualization image processing system based on block compression is also provided, comprising:
[0192] at least one processor; and
[0193] a memory communicatively connected to at least one of the processors; wherein,
[0194] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement a power visualization image processing method based on block compression as described in any of the above technical solutions.
[0195] It should be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further describe various possible combinations.
Claims
1. A method for processing electric power visualization images based on block compression, characterized in that: The steps include: Step S1, constructing two power visualization image processing models, including: The first power visualization image processing model: select a model with faster speed but relatively lower accuracy to preliminarily detect power equipment in the power visualization image; The second power visualization image processing model: a model with high accuracy but slow calculation speed is selected to detect power equipment faults in the power visualization image after block compression; Step S2, acquiring power visualization images and storing them in a database to form a power visualization image data set; preprocessing the images in the power visualization image data set to ensure that the image format and resolution are suitable for subsequent processing; Step S3, obtaining the pre-processed power visualization image, using the first power visualization image processing model for detection, obtaining the power equipment detection frame, and marking it as t , t is a natural number; Step S4: Check the power equipment frame O t The block compression is performed, and the multi-target tracking and dynamic area detection algorithms are used for detection. The binary image is used to represent the potential power equipment fault area of the current power visualization image. t move ; Step S5: for each potential power equipment fault area O t move , using the binary image expansion algorithm to determine the motion area frame O of the image t bbox , to extract the significant areas in the potential power equipment failure area: Step S6: using a binary reduction rectangular frame rearrangement algorithm to resize the moving area frame O t bbox Rearrange the image to obtain the rearranged power visualization image P t new , and the motion area frame O t bbox In the image P t new Position O t new ; Step S7, using the second power visualization image processing model to process the rearranged power visualization image O t new Perform fault detection and output fault detection result O t det , the test result is O t det Include the location and size of each electrical equipment fault area; Step S8, comparing the fault detection results of the power visualization images after the weighting is rearranged one by one. t det and the motion region frame O of the image before rearrangement t bbox The corresponding relationship of the rectangular frame is constructed, and the position and size of the current fault detection result in the original image are calculated accordingly, that is, O t final ; t is a natural number; Step S9, repeating steps S4 to S8 until the power visualization image detection work is completed.
2. The method for processing electric power visualization images based on block compression according to claim 1, characterized in that: The step S1 is further as follows: Step S11, constructing a first power visualization image processing model M1 and a second power visualization image processing model M2, wherein the parameter quantity of M1 is greater than that of M2, the accuracy is lower than that of M2, and the calculation speed is higher than that of M2; Step S12, initializing at least one square box B to place the target area in the image, the side length of the box is S, and the initial value is 0; Step S13, initializing a variable Q used to record whether the placement is successful, and the initial value of Q is True; Step S14: Initialize the upper bound U and lower bound L used to determine the minimum side length of the box, where the initial value of the upper bound is the motion area box O. t bbox The maximum total length of the width and height of all rectangular boxes in the . The initial value of the lower bound is 0.
3. The method for processing electric power visualization images based on block compression according to claim 2, characterized in that: The step S4 is further as follows: S41, the power equipment detection frame O obtained in step S3 t Divide into blocks, the size of each block is a fixed value, and the power equipment detection box O t The coordinates of the blocks are (x1, y1, x2, y2), and the block coordinates after segmentation are (x i1 ,y i1 ,x i2 ,y i2 ), where i represents the i-th block, which is specifically expressed as: x i1 =x1+(i-1)×block_size; y i1 =y1+(i-1)×block_size; x i2 =x i1 +block_size; y i2 =y i1 +block_size; Among them, block_sizeblock_size is the block size; S42, using the JPEG compression algorithm to compress each block to reduce the amount of image data, the image after the block is 1 block , the compressed image is I compressed , the compression quality is q, then I compressed =JPEG_compress(I block ,q), where JPEG_compress represents the JPEG compression operation; S43, using multi-target tracking and dynamic area detection algorithms for detection, including: Step S431: Use the YOLOv3 model to detect the target and obtain the target frame B t ={bt1,bt2,…,bt n }; Step S432: Use the Hungarian algorithm to perform target matching. The formula is as follows: cost_matrix=IoU(B t ,B t-1 ); Among them, IoU(B t ,B t-1 ) represents the intersection-over-union ratio between target boxes; Step S433: Calculate the optical flow field F using the Lucas-Kanade optical flow method t , the formula is as follows: F t =LK(I t ,I t-1 ); Among them, I t and I t-1 Represent the images of the current frame and the previous frame respectively; Step S434: extract the salient area in the optical flow field and generate a binary image O t move ; Step S44: convert the dynamic area detection result into a binary image to represent the potential power equipment fault area of the current power visualization image. t move , the dynamic area detection result is D t , the binary image is O t move : O t move (x,y)=1, if D t (x,y)>threshold; otherwise, O t move (x,y)=0; Among them, threshold is the binarization threshold.
4. The method for processing electric power visualization images based on block compression according to claim 3, characterized in that: The step S5 is further as follows: Step S51: Use the morphological expansion algorithm to expand the potential power equipment fault area. t move is the input image, and the expanded image is O t dilated , the expansion kernel is K: O t dilated =Dilate(O t mov e ,K); where Dilate represents the dilation operation and K represents the dilation kernel; Step S52: extract the salient area from the expanded binary image and determine the motion area frame of the image. t bbox , the binary image O after expansion t dilated , motion area frame O t bbox The coordinates of (x min ,y min ,x max ,y max ): x min =minx,y∈O t dilated x; and min =minx,y∈O t dilated and; x max =maxx,y∈O t dilated x; and max =maxx,y∈O t dilated and Among them, x min and min Indicates the minimum coordinate of the motion area box, x max and max Indicates the maximum coordinate of the motion area box; Step S53, extracting a salient region using a saliency detection algorithm, the input image is I, the saliency map is S, then S=SR(I), where SR represents a spectral residual method; Step S54: merge the salient region and the motion region frame to obtain the final motion region frame. t bbox The specific method is: the salient area is S, and the motion area box is O t bbox ,but A t bbox =Go(S,O t bbox ); MergeMerge indicates a region merge operation.
5. The method for processing electric power visualization images based on block compression according to claim 4, characterized in that: The step S6 is further as follows: Step S61: Use a binary reduction algorithm to reduce the motion region frame O t bbox Reduce the redundant area by: t bbox The coordinates of (x min ,y min ,x max ,y max ), the reduced area frame is O t reduced ,but O t reduced =Reduce(O t bbox ,factor); Among them, Reduce represents the reduction operation, and factor represents the reduction factor; Step S62: rearrange the reduced rectangular frames to obtain a rearranged power visualization image P t new , and the motion area frame O t bbox In the image P t new Position O t new The specific method is: the reduced area frame is O t reduced , the rearranged image is P t new , the rearranged region box is O t new ,but P t new ,O t new =Rearrange(O t reduced ); Among them, Rearrange represents the rearrangement operation; Step S63: designing a rearrangement algorithm, including: Step S631, initialization: Initialize an empty image P t new , the size is the same as the original image; Step S632, traverse the area frame: traverse the reduced area frame O t reduced , place it on image P t new middle; Step S633, placement strategy: using a greedy algorithm or a dynamic programming algorithm to select the best placement position to ensure that the rearranged image is as compact as possible; Step S634, placement formula: current area box is 0 t reduced [i], the placement is (x new ,y new ),but P t new [x new :x new +w,y new :y new +h]=O t reduced [i]; Among them, w and h represent the width and height of the region box respectively; Step S64: Update the position of the rearranged area frame. The specific method is: the rearranged area frame is 0 t new , update its position to (x new ,y new ),but O t new [i]=(x new ,y new ,x new +w,y new +h); Among them, w and h represent the width and height of the region box respectively.
6. The method for processing electric power visualization images based on block compression according to claim 5, characterized in that: The step S7 is further as follows: Step S71, loading a second power visualization image processing model; Step S72: input the rearranged power visualization image P t new ; Step S73: Output fault detection result O t det .
7. The method for processing electric power visualization images based on block compression according to claim 6, characterized in that: The step S8 is further as follows: Step S81: Compare the fault detection results of the rearranged power visualization image with the motion region frame of the image before rearrangement, and compare the fault detection results of the rearranged power visualization image one by one. t det and the motion region frame O of the image before rearrangement t bbox The specific method is as follows: the fault detection result after rearrangement is O t det , the motion area frame before rearrangement is O t bbox ,but comparison_result=compare(O t det ,O t bbox ); Among them, compare represents a comparison operation; Step S82: construct the corresponding relationship of the rectangular frame, and calculate the position and size of the current fault detection result in the original image. t final , the specific method is: the comparison result is comparison_result, the corresponding relationship is correspondence, then correspondence=build_correspondence(comparison_result) Among them, build_correspondence means building a corresponding relationship operation; Step S83, calculate the position and size in the original image: According to the corresponding relationship, calculate the position and size of the current fault detection result in the original image, the method is: the corresponding relationship is correspondence, the position and size in the original image are O t final ,but O t final =calculate_position_size(correspondence) Wherein, calculate_position_size indicates the operation of calculating position and size.
8. A power visualization image processing system based on block compression, characterized in that: include: at least one processor; as well as a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the power visualization image processing method based on block compression as described in any one of claims 1 to 7.
