A method for detecting the image quality of an electric meter box based on a mobile terminal
By using a strong classifier composed of multiple weak classifiers on the mobile terminal to conduct image quality detection of the meter box, the problem of inconvenience to front-line power workers in the prior art is solved, and high-precision and low-cost image quality detection is achieved.
Patent Information
- Application Number
- CN202111012203.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-31
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2041-08-31
AI Technical Summary
The existing power image monitoring methods require grid service platforms to process, which are not convenient for front-line power workers. Moreover, mobile terminal detection equipment based on deep learning is costly and is not suitable for promotion.
A strong classifier composed of multiple weak classifiers is used to detect the image quality of the meter box. By acquiring and classifying the sample images of the meter box, calculating the global feature value and texture feature value, iteratively trains the weak classifier and weight combinations to form a strong classifier for image quality detection.
It improves the accuracy of image recognition, reduces the dependence on hardware, reduces the demand for sample image quality, and improves the accuracy and efficiency of classification results.
Smart Images

Figure CN113936200B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and particularly relates to a method for detecting the image quality of an electric meter box based on a mobile terminal. Background Art
[0002] With the development of China's power industry and the promotion of the construction of smart grids, front-line production units in the power system are adopting a variety of monitoring means, such as drone image acquisition, video monitoring, infrared thermal imaging, etc. to assist workers in completing the inspection of transmission lines.
[0003] However, most of the current monitoring methods require the power grid service platform to process the power images collected by various devices, which is not convenient for front-line power workers to use. Although some mobile terminals for power image detection have emerged in recent years, most of them perform image processing through deep learning technology, which requires high hardware support capabilities, so the cost is huge and it is not easy to promote. Summary of the Invention
[0004] In view of the problems existing in the above-mentioned prior art, the present invention provides a method for detecting the image quality of an electric meter box based on a mobile terminal, which performs image quality detection through a strong classifier composed of multiple weak classifiers in cooperation, ensuring the accuracy of image recognition and reducing the dependence on hardware at the same time.
[0005] The first aspect of the embodiment of the present invention provides a method for detecting the image quality of an electric meter box based on a mobile terminal, and the detection method includes:
[0006] Obtain multiple sample images of the electric meter box, classify the sample images, and superimpose and average the classified sample images to obtain an average sample image;
[0007] Calculate the global feature value and texture feature value of the average sample image;
[0008] Use the global feature value and texture feature value as a training set, and sequentially iterate and train multiple weak classifiers;
[0009] Perform weighted combination on the multiple trained weak classifiers to obtain a strong classifier;
[0010] Use the strong classifier to perform quality detection on the electric meter box image.
[0011] The second aspect of the embodiment of the present invention provides a mobile terminal, and the mobile terminal includes:
[0012] An image processing module, configured to obtain multiple sample images of the electric meter box, classify the sample images, and superimpose and average the classified sample images to obtain an average sample image;
[0013] A feature extraction module, configured to calculate the global feature values and texture feature values of the average sample image;
[0014] A model construction module, configured to use the global feature values and texture feature values as a training set, iteratively train multiple weak classifiers in sequence, and perform weighted combination on the multiple trained weak classifiers to obtain a strong classifier;
[0015] An image analysis module, configured to perform quality detection on the electric meter box image by using the strong classifier.
[0016] A third aspect of the embodiments of the present invention provides a computer-readable storage medium, in which at least one program code is stored, and the at least one program code is loaded and executed by a processor to implement the above-mentioned method for detecting the quality of an electric meter box image based on a mobile terminal.
[0017] The method for detecting the quality of an electric meter box image based on a mobile terminal of the present invention has the following beneficial effects:
[0018] The present invention discloses a method for detecting the quality of an electric meter box image based on a mobile terminal, including obtaining multiple electric meter box sample images, classifying the sample images, superimposing and averaging the classified sample images to obtain an average sample image, then calculating the global feature values and texture feature values based on the average sample image, using the global feature values and texture feature values as a training set, iteratively training multiple weak classifiers in sequence, and then performing weighted combination on the weak classifiers to obtain a strong classifier, and performing quality detection on the electric meter box image through the strong classifier, reducing the quality requirements for the sample images, training the weak classifiers by using two types of feature values, reducing the hardware requirements, and at the same time, multiple weak classifiers work together, so that the accuracy and classification efficiency of the classification results are both improved. Description of the Drawings
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the embodiments. Obviously, the following described drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0020] Figure 1 is the overall flowchart of the method for detecting the quality of an electric meter box image based on a mobile terminal of the present invention;
[0021] Figure 2 is the flowchart of the combination process of the strong classifier. Detailed Embodiments
[0022] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present invention. However, those skilled in the art should clearly understand that the present invention can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present invention.
[0023] An embodiment of the present invention provides a method for detecting the image quality of an electric meter box based on a mobile terminal. The above detection method includes:
[0024] Obtain multiple sample images of the electric meter box, classify the sample images, and superimpose and average the classified sample images to obtain an average sample image;
[0025] Calculate the global feature value and texture feature value of the average sample image;
[0026] Use the global feature value and texture feature value as a training set to iteratively train multiple weak classifiers in sequence;
[0027] Perform weighted combination on the multiple trained weak classifiers to obtain a strong classifier;
[0028] Use the strong classifier to detect the quality of the electric meter box image.
[0029] Reference Figure 1 , in this embodiment, image quality detection is performed by training a strong classifier. Specifically, obtain multiple sample images of the electric meter box, classify the sample images, superimpose and average the classified sample images to obtain an average sample image, use the average sample as a classification benchmark, then calculate the global feature value and texture feature value based on the average sample image, use the global feature value and texture feature value as a training set to iteratively train multiple weak classifiers in sequence, and then perform weighted combination on the weak classifiers to obtain a strong classifier. Use this strong classifier to detect the quality of the electric meter box image, reducing the quality requirements for the sample images. At the same time, multiple weak classifiers work together, improving both the accuracy and classification efficiency of the classification results.
[0030] Based on the above detection method, the above calculation of the global feature value and texture feature value of the average sample image includes:
[0031] Scale the average sample image and perform grayscale processing to obtain a compressed sample image;
[0032] Calculate the average gray value of the pixel points of the compressed sample image, and reset the gray values of the pixel points of the compressed sample image based on the average gray value to obtain the hash value of the compressed sample image as the global feature value of the compressed sample image;
[0033] Select a pixel point in the compressed sample image and the adjacent pixel points as the feature extraction window, and calculate the feature value of the central pixel of the feature extraction window as the texture feature value.
[0034] In this embodiment, the average sample image is scaled and grayscaled to obtain the compressed sample image, where the compressed sample image is an 8*8 square image. Then calculate the average gray value of the pixel points of the compressed sample image, and then compare the gray values of each pixel point with the average value in turn. Record the gray value less than the average value as 0, and the gray value greater than the average value as 1 to construct a 64-bit hash value, which can represent the global features of the image. Then, based on the compressed sample image, select a pixel point and the adjacent pixel points as the feature extraction window, where the size of the feature extraction window is 3*3.
[0035] Then extract the texture features of the compressed sample graph through the feature extraction window, and the specific process is as follows:
[0036] Select a pixel point in the compressed sample image and the adjacent pixel points as the feature extraction window, and the size of the extraction window is 3*3;
[0037] Calculate the distances between the central pixel point of the feature extraction window and each adjacent pixel point, and perform a weighted operation on the gray values of each pixel point based on the distances between the central pixel point and each adjacent pixel point, where the closer the distance, the greater the weight;
[0038] Divide the weighted feature extraction window into three groups of data in the vertical direction, and compare the gray values of each data bit in each data group in turn;
[0039] Record the data bits with larger gray values as 1, and the data bits with smaller gray values as 0 to form an eight-bit binary number, and do not record the data bit where the central pixel point is located;
[0040] Convert the obtained eight-bit binary number into a decimal value, which is the texture feature value of the central pixel point of the feature extraction window.
[0041] Specifically, select a 3*3 feature extraction window in the compressed sample image. The feature extraction window is a square in the compressed image. Then calculate the distances between the central pixel point of the feature extraction window and each adjacent pixel point. Since the feature extraction window is a square, if the distance between the central pixel point and the pixel point at the midpoint of one side of the feature extraction window is S, then the distances between it and the pixel points at the four corners of the feature extraction window are The distances between the central pixel of the feature extraction window and each adjacent pixel can be calculated therefrom, and then the gray values of each pixel are weighted based on the calculated distances. The closer the distance is, the greater the weight. In this embodiment, the weight can be restored by the ratio of the distance between the pixel and the central pixel. For example, if the weight of the pixel at the midpoint of one side of the feature extraction window is 1, then the weights of the pixels at the four corners of the feature extraction window The weighted gray value of each pixel is H, and the calculation formula is as follows: H = a + w * c, where a represents the gray value of the pixel, w represents the weight of the pixel, and c represents the gray value of the central pixel. After adjustment, the gray value of the central pixel is 2c. After obtaining the weighted gray values of each pixel, the feature extraction window is divided into three groups of data, S 1 , S 2 , S 3 Then, the data group S 1 is compared with the data group S 2 bit by bit. If the gray value of the data bit in the data group S 1 is greater than that in S 2 , then this data bit is recorded as 1, otherwise it is recorded as 0. Then, S 3 is compared with S 2 , and the numbers on each bit of S 3 are recorded. Finally, the upper and lower two digits of S 2 are compared with the middle bit, and finally an eight-bit binary number is obtained. The obtained eight-bit binary number is converted into a decimal value, which is the texture feature value of the central pixel of the feature extraction window. In this embodiment, feature extraction is performed by two methods, reducing the dimension of the feature and the computational amount of subsequent defect recognition.
[0042] Based on the above calculation of the global feature value and texture feature value of the average sample image, the above-mentioned scaling of the average sample image includes:
[0043] Based on the size of the compressed sample image, determine the number of pixels to be selected. The compressed sample image is an n * n square image;
[0044] Read the size of the average sample image, and calculate the ratios of the length and width of the average sample image to the length of the compressed sample image respectively;
[0045] If there is a decimal part in the calculated ratio, determine whether the decimal part meets the set threshold;
[0046] If it meets, increase the length or width of the average sample image until the ratio of the length or width of the average sample image to the length of the compressed sample image is an integer;
[0047] If it does not meet, decrease the length or width of the average sample image until the ratio of the length or width of the average sample image to the side length of the compressed sample image is an integer;
[0048] Based on the adjusted sample image, select pixel points at equal intervals according to the calculated ratio to form a compressed sample image.
[0049] In this embodiment, the compressed sample image is an 8*8 square image. First, obtain an average sample image with a size of L*M, and then calculate the ratio of the length of the average sample image to the side length of the compressed sample image respectively. The ratio of the width of the average sample image to the side length of the compressed sample image Then judge the ratio and Whether the decimal part of is greater than the threshold. In this example, the threshold can be selected as 0.8. If the decimal part is greater than the threshold, increase the length L or width M of the average sample image by α pixel points so that the length and width of the image can be divisible by 8. If the decimal part is less than the threshold, reduce the length L or width M of the average sample image by α pixel points so that the length and width of the image can be divisible by 8. Then, based on the adjusted sample image, select a pixel point every or pixel points to form a compressed sample image.
[0050] Based on the above detection method, each of the above weak classifiers corresponds to a defect recognition, and the defects include appearance damage, peephole damage, appearance rust, missing sign, missing lock, and missing seal.
[0051] Based on the above detection method, the above strong classifier includes:
[0052] Extract the global feature value and texture feature value of the average sample image, and use the global feature value and texture feature value as the training set to train the weak classifier in turn;
[0053] Read the output results of each weak classifier, and obtain the correlation relationship between multiple weak classifiers according to the training results of each weak classifier for the training samples. The correlation relationship includes a positive proportional relationship and an inverse proportional relationship;
[0054] Perform a primary rejection screening on multiple weak classifiers with a positive proportional relationship;
[0055] Based on the weak classifiers with an inverse proportional relationship and the weak classifiers after the primary rejection screening, obtain the ratio of the error rates of the classification results of each weak classifier;
[0056] If the error rate of the classification result of the weak classifier is greater than the preset upper threshold, reject the weak classifier for the second time;
[0057] Based on all the weak classifiers after the second rejection, assign weights to each weak classifier according to the ratio of the error rates, where the smaller the error rate of the classification result, the greater the weight;
[0058] A strong classifier is obtained by combining the assigned weights of each weak classifier.
[0059] Reference Figure 2 , in this embodiment, each weak classifier identifies a type of defect, specifically appearance damage, damage to the viewing window, appearance rust, missing identification plate, missing lock, and missing seal. Multiple weak classifiers with a positive proportional relationship are used to characterize that the classification results of two weak classifiers have a positive correlation. For example, if the output result of weak classifier A (appearance damage classifier) is "yes" and the output result of weak classifier B (appearance rust classifier) is "yes", when classifying multiple training samples in the training set, the output results of weak classifiers A and B always remain consistent, that is, it is determined that weak classifiers A and B have a positive correlation. Similarly, weak classifiers with an inverse proportional relationship can be obtained.
[0060] The strong classifier is composed of multiple weak classifiers with weighted combination. Specifically, by averaging the global feature values and texture feature values of the sample images, different weak classifiers are iteratively trained. After each training is completed, the error rate of the classification result of this weak classifier is statistically recorded as Q i , where i represents the i-th weak classifier, and then calculate the ratio of the error rates of the classification results of each weak classifier, and assign weights u to each weak classifier according to the ratio of the error rates i , where the smaller the error rate of the classification result, the greater the weight, and the weight u i The calculation formula of is: where m represents the number of weak classifiers. Finally, linearly weight and combine the weak classifiers to obtain the strong classifier.
[0061] Of course, if the error rates of the classification results of all weak classifiers are greater than the preset upper threshold, the strong classifier is not obtained by combining the assigned weights of the above-mentioned multiple weak classifiers.
[0062] Based on the above detection method, the above detection method further includes: judging whether it is necessary to upload the image of the electric meter box to the cloud server based on the image quality analysis result.
[0063] Based on the above detection method, the above image quality analysis result judgment process is as follows:
[0064] The mobile terminal obtains the defects of the electric meter box based on the image quality analysis result;
[0065] It is judged by the user of the mobile terminal whether the defects of the electric meter box can be repaired;
[0066] If the user of the mobile terminal cannot repair it, the image of the electric meter box and the image quality analysis result can be uploaded to the cloud server through the mobile terminal;
[0067] Other users of the mobile terminal can view this information through the mobile terminal.
[0068] In this embodiment, the maintenance personnel of the electric meter box can view the defects of the electric meter box through a mobile terminal, and then determine whether the defects of the electric meter box can be repaired. If it can be repaired, they can go for repair. If it cannot be repaired, the image of the electric meter box and the image quality analysis result can be uploaded to the cloud server, and the cloud server will push this information to a nearby mobile terminal, and other mobile terminals can also view this information through the cloud server.
[0069] An embodiment of the present invention provides a mobile terminal, and the above mobile terminal includes:
[0070] An image processing module, configured to obtain multiple sample images of the electric meter box, classify the sample images, superimpose and average the classified sample images to obtain an average sample image;
[0071] A feature extraction module, configured to calculate the global feature value and texture feature value of the average sample image;
[0072] A model construction module, configured to use the global feature value and texture feature value as a training set, iteratively train multiple weak classifiers in sequence, and perform weighted combination on the trained multiple weak classifiers to obtain a strong classifier;
[0073] An image analysis module, configured to perform quality detection on the electric meter box image by using the strong classifier.
[0074] Based on the above mobile terminal, the above mobile terminal further includes:
[0075] A query module, configured to display the quality detection result of the image;
[0076] A result analysis module, configured to determine whether it is necessary to upload the electric meter box image to the cloud server based on the image quality detection result;
[0077] A communication module, configured to upload the electric meter box image and the image quality detection result to the cloud server and communicate with other mobile terminals.
[0078] Specifically, the maintenance personnel of the electric meter box can view the analysis result of the electric meter box image through the mobile terminal, query the type of defects existing in the electric meter box, which is convenient for the maintenance personnel of the electric meter box to go for maintenance in time. If the maintenance personnel of the electric meter box cannot perform maintenance, the electric meter box image and the image quality detection result can be uploaded to the cloud server, and the cloud server will notify other maintenance personnel based on the type of defects existing in the electric meter box, and the maintenance personnel can communicate through the mobile terminal.
[0079] An embodiment of the present invention provides a computer-readable storage medium, in which at least one program code is stored, and the at least one program code is loaded and executed by a processor to implement the above-mentioned method for detecting the image quality of an electric meter box based on a mobile terminal.
[0080] It can be understood that the memory can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. The memory in the embodiment of the present invention can store data to support the operation of the terminal. Examples of these data include: any computer programs for operating on the terminal, such as an operating system and application programs. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application programs can include various application programs.
[0081] The present invention is not limited to the above specific embodiments. Those of ordinary skill in the art starting from the above concepts and making various transformations without creative labor fall within the protection scope of the present invention.
Claims
1. A method for detecting the image quality of an electric meter box based on a mobile terminal, characterized in that, the detection method includes: Obtain multiple sample images of the electric meter box, classify the sample images, and superimpose and average the classified sample images to obtain an average sample image; Calculate the global feature value and texture feature value of the average sample image, including: scale the average sample image and perform grayscale processing to obtain a compressed sample image; calculate the average grayscale value of the pixel points of the compressed sample image, and reset the grayscale values of the pixel points of the compressed sample image based on the average grayscale value to obtain the hash value of the compressed sample image as the global feature value of the compressed sample image; select a pixel point in the compressed sample image and its adjacent pixel points as a feature extraction window, and calculate the feature value of the central pixel of the feature extraction window as the texture feature value; Use the global feature value and texture feature value as a training set to iteratively train multiple weak classifiers in sequence; Perform weighted combination on the multiple trained weak classifiers to obtain a strong classifier; Use the strong classifier to detect the quality of the electric meter box image.
2. The detection method according to claim 1, characterized in that, Scaling the average sample image includes: Based on the size of the compressed sample image, determine the number of pixel points to be selected. The compressed sample image is an n*n square image; Read the size of the average sample image, and calculate the ratios of the length and width of the average sample image to the length of the compressed sample image respectively; If there is a decimal part in the calculated ratio, determine whether the decimal part meets the set threshold; If it meets, increase the length or width of the average sample image until the ratio of the length or width of the average sample image to the length of the compressed sample image is an integer; If it does not meet, decrease the length or width of the average sample image until the ratio of the length or width of the average sample image to the side length of the compressed sample image is an integer; Based on the adjusted sample image, select pixel points at equal distances according to the calculated ratio to form a compressed sample image.
3. The detection method according to claim 1, characterized in that, Each weak classifier corresponds to a defect recognition. The defects include appearance damage, viewing window damage, appearance rust, missing identification plate, missing lock, and missing seal.
4. The detection method according to claim 1, characterized in that, The strong classifier includes: Extract the global feature value and texture feature value of the average sample image, and use the global feature value and texture feature value as a training set to train the weak classifiers in sequence; Read the output results of each weak classifier, and obtain the correlation relationship between multiple weak classifiers according to the training results of each weak classifier for the training samples. The correlation relationship includes a positive proportional relationship and an inverse proportional relationship; Perform primary rejection screening on multiple weak classifiers with a positive proportional relationship; Based on the weak classifiers with an inverse proportional relationship and the weak classifiers after the primary rejection screening, obtain the ratio of the error rates of the classification results of each weak classifier; If the error rate of the classification result of the weak classifier is less than the preset lower threshold, reject the weak classifier for the second time; Based on all the weak classifiers after the second rejection, weights are assigned to each weak classifier according to the ratio of the error rates, where the smaller the error rate of the classification result, the larger the weight; A strong classifier is obtained by combining the assigned weights of each weak classifier.
5. The detection method according to claim 1, wherein, the method further includes: judging whether it is necessary to upload the image of the electric meter box to the cloud server based on the image quality analysis result.
6. The detection method according to claim 5, wherein, the process of judging the image quality analysis result is as follows: The mobile terminal obtains the defects of the electric meter box based on the image quality analysis result; The user of the mobile terminal judges whether the defects of the electric meter box can be repaired; If the user of the mobile terminal cannot perform the repair, the image of the electric meter box and the image quality analysis result can be uploaded to the cloud server through the mobile terminal; Other users of the mobile terminal can view the image of the electric meter box and the image quality analysis result through the mobile terminal.
7. A mobile terminal, wherein, the mobile terminal includes: An image processing module, configured to obtain multiple sample images of the electric meter box, classify the sample images, and perform superposition and averaging on the classified sample images to obtain an average sample image; A feature extraction module, configured to calculate the global feature value and texture feature value of the average sample image, including: scaling the average sample image and performing grayscale processing to obtain a compressed sample image; calculating the average grayscale value of the pixel points of the compressed sample image, and resetting the grayscale values of the pixel points of the compressed sample image based on the average grayscale value to obtain the hash value of the compressed sample image as the global feature value of the compressed sample image; selecting a pixel point in the compressed sample image and its adjacent pixel points as a feature extraction window, and calculating the feature value of the central pixel of the feature extraction window as the texture feature value; A model construction module, configured to use the global feature value and texture feature value as a training set, iteratively train multiple weak classifiers in sequence, and perform weighted combination on the trained multiple weak classifiers to obtain a strong classifier; An image analysis module, configured to perform quality detection on the image of the electric meter box by using the strong classifier.
8. The mobile terminal according to claim 7, wherein, the mobile terminal further includes: A query module, configured to display the quality detection result of the image; A result analysis module, configured to judge whether it is necessary to upload the image of the electric meter box to the cloud server based on the image quality detection result; A communication module, configured to upload the image of the electric meter box and the image quality detection result to the cloud server and communicate with other mobile terminals.
9. A computer-readable storage medium, wherein , at least one program code is stored in the storage medium, and the at least one program code is loaded and executed by a processor to implement a method for detecting the image quality of an electric meter box based on a mobile terminal as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for detecting inner wall quality of via hole of printed circuit board
CN110175614A
Image recognition method for electric meter terminal fault recognition
CN110738170A