CN-115187563-B - Method and system for detecting and identifying seal on seam for electric power instrument inspection
Abstract
The embodiment of the application provides a method and a system for detecting and identifying a seal of an electric power instrument, which comprise image processing methods for positioning the positions of the seal of the electric power instrument and a seal bean target area, carrying out Hough circle transformation, polar coordinate transformation and the like, and enhancing edge profile information and filtering extraneous noise interference by carrying out morphological open operation and bilateral filtering in a converted HSV space, so that the area positioning of the seal is further carried out by carrying out Hough circle transformation, and the treatments of binary analysis, pixel statistics and the like after the polar coordinate transformation, finally obtaining a threshold score, and referring the threshold score to a set fixed value, thereby effectively and accurately judging a finally output detection result.
Inventors
- LIN XU
- LI MI
- CHEN XU
- CHEN JIAQI
- TANG GUANGTIE
- ZENG YUANQIANG
- LU YUTIAN
- ZHOU XIAOBAO
Assignees
- 福建省海峡智汇科技有限公司
- 福建省海峡智汇科技有限公司
Dates
- Publication Date
- 20260421
- Application Date
- 20220722
- Priority Date
- 20220722
Claims (8)
- 1. The method for detecting and identifying the seal of the saddle for the electric power instrument inspection is characterized by comprising the following steps of: S110, converting an original RGB image into an HSV color space image, and preprocessing the HSV color space image; s120, carrying out Hough circle transformation on the preprocessed image to obtain a circular fitting set, and sequencing the circular fitting set according to the number of pixel points to obtain a largest circular area, wherein the Hough circle transformation comprises the following substeps: S121, calculating the gradient of the preprocessed image by using a Sobel operator, drawing a line segment along the gradient direction and the opposite direction of the preprocessed image, wherein the starting point and the length of the line segment are determined by set parameters, counting the points passing by the line segment in an accumulator, and the more points are more likely to be circle centers; s122, sorting the distances from the circle center to all non-0 points from small to large, counting the distances from the small radius to large, and counting the points which are the same in a certain amount, wherein the differences are approximately regarded as the same circle at the points of a certain amount; S130, cutting the rectangle at the outermost periphery according to the largest circular area to obtain a rectangular image, converting the rectangular image into a gray level image, carrying out threshold binarization processing on the gray level image, adjusting the binarized numerical parameters, realizing image polar coordinate transformation based on OpenCV, and finally carrying out normalization processing on pixels of the image subjected to the polar coordinate transformation, and And S140, carrying out averaging and bit reversal on all pixels in the normalized image, calculating the number of black pixels, setting a fixed threshold value, judging the number of black pixels, and finally obtaining an identification result.
- 2. The method for detecting and identifying a saddle stitch seal for power meter inspection according to claim 1, wherein in step S110, preprocessing the HSV color space image includes performing a morphological open operation and a bilateral filtering operation on the HSV color space image, and then performing Canny edge detection.
- 3. The method according to claim 1, wherein in step 130, image polar coordinate transformation is implemented based on OpenCV to convert a sector area into a rectangular area, and nearest neighbor interpolation processing is performed according to the width and height of the rectangular area.
- 4. The method for detecting and identifying a saddle stitch chapter for power meter inspection according to claim 1, characterized in that in step S130, the pixels of the image subjected to polar coordinate transformation are finally normalized, comprising the following sub-steps: S131, normalizing the image gray gradient amplitude after the polar coordinate transformation, and S132, a gray gradient calculating method in Canny edge detection is adopted to obtain a gray gradient amplitude image M (x, y) of a gray image I (x, y), and M (x, y) is normalized to scale and expressed as: where Ms (x, y) is the normalized image gradient magnitude image, (x, y) represents the pixel coordinates of the image, Represents the maximum value of the gray gradient amplitude image, and scale represents the maximum range value set according to the design requirement.
- 5. The method for detecting and identifying the seal on the saddle stitch for the electric power meter inspection according to claim 1, wherein in step S140, a fixed threshold is set to judge the number of the black pixels to finally obtain an identification result, and the method comprises outputting a True if the number of the black pixels is within the fixed threshold, otherwise outputting a False.
- 6. The method for detecting and identifying the seal on the saddle for electric power instrument inspection according to claim 1, wherein in step S120, a circular fitting set is obtained, the circular fitting set is sorted according to the number of pixels, specifically, circles in the circular fitting set are sorted from large to small by area calculation and comparison, and finally, the largest circular area is obtained.
- 7. A saddle stitch detection and identification system for power meter inspection, the system comprising: The preprocessing module is used for converting the original RGB image into an HSV color space image and preprocessing the HSV color space image; the Hough circle transformation module is used for carrying out Hough circle transformation on the preprocessed image to obtain a circle fitting set, and sequencing the circle fitting set according to the number of pixel points to obtain a largest circular area, wherein the Hough circle transformation comprises the following substeps: calculating the gradient of the preprocessed image by using a Sobel operator, drawing a line segment along the gradient direction and the opposite direction of the preprocessed image, determining the starting point and the length of the line segment by set parameters, counting the points passing by the line segment in an accumulator, wherein the more points are likely to be circle centers; Sequentially counting the distances from the non-0 points to the circle center from small to large, counting the points with the differences of a certain amount as the same circle, and counting all the points belonging to the circle, gradually amplifying the radius to continue counting, comparing the linear density = point number/radius of the two radius points, wherein the higher the linear density is, the greater the reliability of the radius is, and repeatedly executing the step S121 and the step S122 within the parameter allowable range until the optimal radius is obtained; The conversion module is used for intercepting the rectangle at the outermost periphery according to the largest circular area to obtain a rectangular image, converting the rectangular image into a gray level image, carrying out threshold binarization processing on the gray level image, adjusting the binarized numerical parameters, realizing image polar coordinate transformation based on OpenCV, and finally carrying out normalization processing on pixels of the image subjected to the polar coordinate transformation, and And the output module is used for carrying out averaging and bit reversal on all pixels in the normalized image, calculating the number of black pixels, setting a fixed threshold value to judge the number of the black pixels and finally obtaining an identification result.
- 8. A computer readable storage medium having stored therein a computer program which, when executed by a processor, performs the method of any of claims 1-6.
Description
Method and system for detecting and identifying seal on seam for electric power instrument inspection Technical Field The application relates to the technical field of industrial vision and energy power, in particular to a method and a system for detecting and identifying a seal of a saddle for electric power instrument inspection. Background In recent years, with the development of industrial production and modernization, energy safety, particularly power guarantee and safety, has become a non-negligible problem. From top to bottom, the power meter equipment from a power plant, a transmission line and a transformer substation to the tail end plays an important role. In an actual scene, whether sealing beans are abnormal or not is detected through manual detection on a seal-riding area on the electric power instrument equipment, a large amount of human resources are consumed, and a worker also needs to bear high-pressure risks. In view of the above, the application provides a machine vision-based method and a system for detecting and identifying a seal on electric power instrument, which can rapidly and effectively detect the seal area on the electric power instrument to detect whether the seal beans are abnormal or not. Disclosure of Invention The embodiment of the application provides a method and a system for detecting and identifying a seal of a saddle for electric power instrument inspection, which are used for solving the technical problems mentioned in the background art. In a first aspect, an embodiment of the present application provides a method for detecting and identifying a saddle seal for electric power meter inspection, which is characterized by comprising the following steps: S110, converting an original RGB image into an HSV color space image, and preprocessing the HSV color space image; S120, carrying out Hough circle transformation on the preprocessed image to obtain a circular fitting set, and sequencing the circular fitting set according to the number of pixel points to obtain a maximum circular area; S130, cutting out the rectangle at the outermost periphery according to the largest circular area to obtain a rectangular image, converting the rectangular image into a gray level image, performing binarization processing on the gray level image and normalizing pixels of the binarized image, and And S140, carrying out averaging and bit reversal on all pixels in the normalized image, calculating the number of black pixels, setting a fixed threshold value, judging the number of black pixels, and finally obtaining an identification result. Through the technical scheme, various preprocessing methods in the imaging are utilized to obtain the image meeting the requirements, then the Hough circle transformation is adopted to identify the target object area, the feasibility of accurately identifying the seal beans is high, and the conversion from manual inspection to machine inspection can be preliminarily realized. In a specific embodiment, in step S110, preprocessing the HSV color space image includes performing morphological open operation and bilateral filtering operation on the HSV color space image, and then performing Canny edge detection. In a specific embodiment, in step S120, the hough-circle transform is performed on the preprocessed image, including the following sub-steps: S121, calculating the gradient of the preprocessed image by using a Sobel operator, drawing a line segment along the gradient direction and the opposite direction of the preprocessed image, wherein the starting point and the length of the line segment are determined by set parameters, counting the points passing by the line segment in an accumulator, and the more points are more likely to be circle centers; S122, sorting the distances from the non-0 points to the circle center from small to large, counting the distances from the small radii, counting the points with the differences being approximately regarded as the same circle at a certain amount, counting the points belonging to the circle, gradually amplifying the radii, continuously counting, comparing the linear density = point number/radius of the two radius points, wherein the higher the linear density is, the higher the reliability of the radius is, and repeatedly executing the step S121 and the step S122 within the parameter allowable range until the optimal radius is obtained. In a specific embodiment, in step S130, a rectangle at the outermost periphery is cut according to the largest circular area, a rectangular image is obtained, the rectangular image is converted into a gray image, threshold binarization processing is performed on the gray image, meanwhile, binarized numerical parameters are adjusted, polar coordinate transformation of the image is achieved based on OpenCV, and finally, normalization processing is performed on pixels of the image subjected to polar coordinate transformation. In a specific embodiment, the polar coordinate transformatio