[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN118691847B - Transformer substation defect detection method, system and storage medium based on positive sample image - Google Patents

Transformer substation defect detection method, system and storage medium based on positive sample image Download PDF

Info

Publication number
CN118691847B
CN118691847B CN202411169130.8A CN202411169130A CN118691847B CN 118691847 B CN118691847 B CN 118691847B CN 202411169130 A CN202411169130 A CN 202411169130A CN 118691847 B CN118691847 B CN 118691847B
Authority
CN
China
Prior art keywords
image
positive sample
points
detected
difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202411169130.8A
Other languages
Chinese (zh)
Other versions
CN118691847A (en
Inventor
李倩
曹思远
周彦朝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changsha Nengchuan Information Technology Co ltd
Original Assignee
Changsha Nengchuan Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changsha Nengchuan Information Technology Co ltd filed Critical Changsha Nengchuan Information Technology Co ltd
Priority to CN202411169130.8A priority Critical patent/CN118691847B/en
Publication of CN118691847A publication Critical patent/CN118691847A/en
Application granted granted Critical
Publication of CN118691847B publication Critical patent/CN118691847B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/757Matching configurations of points or features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • G06V10/763Non-hierarchical techniques, e.g. based on statistics of modelling distributions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30232Surveillance
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

本发明涉及变电站数字孪生技术领域,尤其涉及一种基于正样本图像的变电站缺陷检测方法与系统。所述方法包括步骤:S1,通过SIFT算法进行关键特征点信息的提取:S2,采取knnMatch的特征匹配算法进行关键特征点的匹配:S3,差异点计算:S4,获取候选差异区域:以及S5,利用哈希感知算法进行差异程度计算。本发明整体上采取对传统图像处理算法的优化思路,较深度学习方法降低了数据成本,避免耗时耗力的收集变电站缺陷样本以及数据标注,较传统的图像处理算法加入了改良的聚类机器学习算法用于处理中间数据,在最后的结果判断上引用了图像信息编码降低了环境干扰,总体上降低了误判概率,提升了精度。

The present invention relates to the technical field of digital twins of substations, and in particular to a method and system for detecting substation defects based on positive sample images. The method comprises the steps of: S1, extracting key feature point information by SIFT algorithm; S2, matching key feature points by knnMatch feature matching algorithm; S3, calculating difference points; S4, obtaining candidate difference regions; and S5, calculating the degree of difference by using hash perception algorithm. The present invention adopts the optimization idea of traditional image processing algorithms as a whole, reduces data costs compared with deep learning methods, avoids time-consuming and labor-intensive collection of substation defect samples and data annotation, adds an improved clustering machine learning algorithm to process intermediate data compared with traditional image processing algorithms, and uses image information encoding to reduce environmental interference in the final result judgment, which reduces the probability of misjudgment and improves accuracy overall.

Description

基于正样本图像的变电站缺陷检测方法、系统及存储介质Substation defect detection method, system and storage medium based on positive sample images

技术领域Technical Field

本发明涉及变电站数字孪生技术领域,尤其涉及一种基于正样本图像的变电站缺陷检测方法、系统及存储介质。The present invention relates to the technical field of substation digital twin, and in particular to a substation defect detection method, system and storage medium based on positive sample images.

背景技术Background Art

数字孪生变电站是指利用先进的数字技术模拟和复制实际变电站的各个组成部分和运行状态的一种技术,通过数学建模和仿真技术,将实际变电站的物理设备、电气参数、运行状态等信息数字化,形成一个与实际变电站完全一致的虚拟模型。A digital twin substation refers to a technology that uses advanced digital technology to simulate and replicate the various components and operating conditions of an actual substation. Through mathematical modeling and simulation technology, the physical equipment, electrical parameters, operating conditions and other information of the actual substation are digitized to form a virtual model that is completely consistent with the actual substation.

其中,基于数字孪生的集中监控功能,可以实现对设备状态、环境状态的虚拟映射和在线监测,通过使用人工智能图像识别算法可以快速自动的检出缺陷影像,实现了原有人工报送模式的机器替代。Among them, the centralized monitoring function based on digital twins can realize virtual mapping and online monitoring of equipment status and environmental status. By using artificial intelligence image recognition algorithms, defective images can be detected quickly and automatically, realizing machine replacement of the original manual reporting mode.

目前,数字孪生变电站中基于正样本的缺陷检测核心问题是图像相似度的判断以及差异区域的位置判断。At present, the core problem of defect detection based on positive samples in digital twin substations is the judgment of image similarity and the location of difference areas.

对于图像相似度的计算方法,通常分为传统图像算法以及基于深度学习的方式两大类。基于像素点分布的直方图法、基于特征向量的余弦相似度法、基于图像编码距离的全局哈希法、基于特征点匹配的SIFT算法与ORB 算法等都是属于传统图像算法范畴, 而孪生神经网络是基于深度学习的方式。The methods for calculating image similarity are usually divided into two categories: traditional image algorithms and methods based on deep learning. The histogram method based on pixel distribution, the cosine similarity method based on feature vectors, the global hash method based on image coding distance, the SIFT algorithm and ORB algorithm based on feature point matching are all traditional image algorithms, while the twin neural network is based on deep learning.

同样,对于差异位置的判断,也可以根据特征点匹配或者图像编码寻找正样本图像与待检测图像之间的差异区域。而对于变电站内这种特定场景下的缺陷检测,也可以采用目标检测的深度学习方式来处理。Similarly, for the determination of the difference position, the difference area between the positive sample image and the image to be detected can also be found based on feature point matching or image encoding. For defect detection in such a specific scenario as the substation, the deep learning method of target detection can also be used to handle it.

然而,传统方法的效率和精度不够高, 其泛化能力较深度学习方法相对不足, 而且对于一些复杂的图像特征提取效果也不够充分。深度学习方法虽然准确度和泛化能力都比较高,但是需要大量特定场景下的图像数据进行训练,而变电站相关缺陷样本难以收集,样本量小的深度学习模型识别能力较弱。However, the efficiency and accuracy of traditional methods are not high enough, their generalization ability is relatively insufficient compared to deep learning methods, and the effect of extracting some complex image features is not sufficient. Although deep learning methods have high accuracy and generalization ability, they require a large amount of image data in specific scenarios for training. However, it is difficult to collect samples of substation-related defects, and deep learning models with small sample sizes have weak recognition capabilities.

发明内容Summary of the invention

基于此,本发明有必要提供一种基于正样本图像的变电站缺陷检测方法与系统,以解决至少一个上述技术问题。Based on this, it is necessary for the present invention to provide a substation defect detection method and system based on positive sample images to solve at least one of the above technical problems.

为实现上述目的,一种基于正样本图像的变电站缺陷检测方法,包括以下步骤:To achieve the above object, a substation defect detection method based on positive sample images comprises the following steps:

步骤S1,关键特征点信息的提取:将正样本模板图像与待检测图像转换成灰度图后,用SIFT算法分别在所述正样本模板图像和待检测图像中获取关键特征点和计算关键特征点的描述符;其中,所述描述符包括所述关键特征点的位置、方向、尺度以及以所述关键特征点为中心的16*16的窗口的像素的梯度幅值和方向上形成的128维的特征向量信息;Step S1, extraction of key feature point information: after converting the positive sample template image and the image to be detected into grayscale images, the SIFT algorithm is used to obtain key feature points in the positive sample template image and the image to be detected and calculate the descriptors of the key feature points respectively; wherein the descriptors include the position, direction, scale of the key feature points and the 128-dimensional feature vector information formed by the gradient amplitude and direction of the pixels of the 16*16 window centered on the key feature points;

步骤S2,关键特征点的匹配:采取knnMatch的特征匹配算法对所述正样本模板图像的所有的关键特征点的描述符与所述待检测图像的所有的关键特征点的描述符进行一对多的匹配,获得匹配点对,并通过RANSAC算法,剔除离群的匹配点对并计算所述待检测图像对于所述正样本模板图像的单应性矩阵;所述单应性矩阵包括所述待检测图像与所述正样本模板图像之间点的坐标的对应关系;Step S2, matching of key feature points: using the knnMatch feature matching algorithm to perform one-to-many matching on the descriptors of all key feature points of the positive sample template image and the descriptors of all key feature points of the image to be detected, obtaining matching point pairs, and using the RANSAC algorithm to remove outlier matching point pairs and calculate the homography matrix of the image to be detected for the positive sample template image; the homography matrix includes the corresponding relationship between the coordinates of the points of the image to be detected and the positive sample template image;

步骤S3,差异点计算:Step S3, difference point calculation:

S31,在所述正样本模板图像上选取S个第一检测点,并通过所述单应性矩阵将所述S个第一检测点仿射到所述待检测图像上的对应位置,获得与所述S个第一检测点对应的S个第二检测点;S31, selecting S first detection points on the positive sample template image, and affine-mapping the S first detection points to corresponding positions on the image to be detected through the homography matrix, to obtain S second detection points corresponding to the S first detection points;

S32,通过所述SIFT算法分别在所述正样本模板图像计算所述S个第一检测点的描述符以及在所述待检测图像中计算所述S个第二检测点的描述符;S32, calculating descriptors of the S first detection points in the positive sample template image and calculating descriptors of the S second detection points in the image to be detected respectively by using the SIFT algorithm;

S33,计算每对所述第一检测点和所述第二检测点的特征向量之间的欧氏距离,若所述欧氏距离大于预设的差异阈值,则将该对第一检测点和第二检测点定义为差异点;S33, calculating the Euclidean distance between the feature vectors of each pair of the first detection point and the second detection point, and if the Euclidean distance is greater than a preset difference threshold, defining the pair of the first detection point and the second detection point as a difference point;

步骤S4,获取候选差异区域:根据所述差异点的坐标获取所述待检测图像与所述正样本模板图像上的候选差异区域;Step S4, obtaining candidate difference regions: obtaining candidate difference regions between the image to be detected and the positive sample template image according to the coordinates of the difference points;

步骤S5,计算差异程度:利用哈希感知算法分别计算所述待检测图像与所述正样本模板图像上的每一对所述候选差异区域的差异程度,将差异程度大于设定阈值的差异区域判定为所述待检测图像的缺陷。Step S5, calculating the degree of difference: using a hash perception algorithm to respectively calculate the degree of difference between each pair of the candidate difference regions on the image to be detected and the positive sample template image, and determining the difference region with a degree of difference greater than a set threshold as a defect of the image to be detected.

进一步的,所述步骤S1具体包括:Furthermore, the step S1 specifically includes:

S11,将正样本模板图像与待检测图像均转换成灰度图;S11, converting the positive sample template image and the image to be detected into grayscale images;

S12,构建多尺度空间:对转换后的所述灰度图构建高斯金字塔,对原始图像做高斯平滑,去除高频噪声,接着对平滑后的图像做下采样,对下采样后的图像进行重复滤波和下采样获得多组图像,每组图像包括多层图像,其中,二维图像的尺度空间定义为:L(x,y,σ)=G(x,y,σ)*I(x,y);差分尺度空间的定义为:D(x,y,σ)=L(x,y,kσ)-L(x,y,σ);σ为高斯正态分布的标准差,x为横轴坐标,y为纵轴坐标;S12, constructing a multi-scale space: constructing a Gaussian pyramid for the converted grayscale image, performing Gaussian smoothing on the original image to remove high-frequency noise, then downsampling the smoothed image, repeatedly filtering and downsampling the downsampled image to obtain multiple groups of images, each group of images includes multiple layers of images, wherein the scale space of the two-dimensional image is defined as: L(x,y,σ)=G(x,y,σ)*I(x,y); the difference scale space is defined as: D(x,y,σ)=L(x,y,kσ)-L(x,y,σ); σ is the standard deviation of the Gaussian normal distribution, x is the horizontal axis coordinate, and y is the vertical axis coordinate;

S13,通过不同尺度DoG空间检测在所述多组图像中检测出具有方向信息的局部极值点作为关键特征点;S13, detecting local extreme points with directional information in the multiple groups of images as key feature points through DoG space detection at different scales;

S14,获取所述关键特征点的所述描述符。S14, obtaining the descriptor of the key feature point.

进一步的,所述步骤S13包括:将所述多组图像中的每个像素点与该像素点对应的尺度空间以及相邻的尺度空间的所有相邻点进行比较,当该像素点的像素值大于或者小于所有相邻点时,该像素点作为极值点;在所述多组图像的不同尺度下均存在的极值点作为所述关键特征点。Furthermore, the step S13 includes: comparing each pixel point in the multiple groups of images with all adjacent points in the scale space corresponding to the pixel point and the adjacent scale space; when the pixel value of the pixel point is greater than or less than all adjacent points, the pixel point is taken as an extreme point; and the extreme points that exist at different scales of the multiple groups of images are taken as the key feature points.

进一步的,所述步骤S14包括:Furthermore, the step S14 includes:

获取所述关键特征点在不同尺度的所述图像中的尺度信息和位置信息;Acquire scale information and position information of the key feature points in the images at different scales;

通过所述关键特征点的领域像素的梯度分布特性确定该关键特征点的方向信息;Determine the direction information of the key feature point by using the gradient distribution characteristics of the area pixels of the key feature point;

以所述关键特征点为中心的16*16的窗口的像素的梯度幅值和方向,将窗口内的像素分为16块单元,每块单元是其像素内8个方向的直方图统计,共形成所述关键特征点的128维的特征向量信息。The gradient amplitude and direction of the pixels of a 16*16 window centered on the key feature point divide the pixels in the window into 16 blocks, each of which is a histogram statistic of 8 directions within its pixels, forming a 128-dimensional feature vector information of the key feature point.

进一步的,所述步骤S2包括:Furthermore, the step S2 includes:

采取knnMatch的特征匹配算法对所述正样本模板图像的所有的关键特征点的描述符与所述待检测图像的所有的关键特征点的描述符进行一对多的匹配,取所述knnMatch的特征匹配算法中的k=2,得到所述待检测图像与所述正样本模板图像之间的特征空间上互相最近邻的和次临近的2个描述符;Using the knnMatch feature matching algorithm to perform one-to-many matching on the descriptors of all key feature points of the positive sample template image and the descriptors of all key feature points of the image to be detected, taking k=2 in the knnMatch feature matching algorithm, and obtaining the two descriptors of the nearest neighbor and the second nearest neighbor in the feature space between the image to be detected and the positive sample template image;

在所述最近邻的描述符和所述次临近的描述符之间的特征空间的相似距离的比值在0.4~0.6之间时,将所述最近邻的描述符和所述次临近的描述符对应的所述关键特征点确定为匹配点对;When the ratio of the similarity distance in the feature space between the nearest neighbor descriptor and the second nearest descriptor is between 0.4 and 0.6, determining the key feature points corresponding to the nearest neighbor descriptor and the second nearest descriptor as a matching point pair;

将所有匹配点对通过RANSAC算法,剔除离群的匹配点对并计算所述待检测图像对于所述正样本模板图像的单应性矩阵。All matching point pairs are passed through the RANSAC algorithm, outlier matching point pairs are eliminated, and the homography matrix of the image to be detected for the positive sample template image is calculated.

进一步的,所述步骤S31中,在所述正样本模板图像上以固定间隔i选取检测点,每个检测点与上下左右的检测点直线距离都为i;其中,第一检测点的个数为S = (w/i+1)*(h/i+1),w和h分别为所述正样本模板图像的长和宽。Furthermore, in step S31, detection points are selected at a fixed interval i on the positive sample template image, and the straight-line distance between each detection point and the detection points above, below, left and right is i; wherein the number of the first detection points is S = (w/i+1)*(h/i+1), where w and h are the length and width of the positive sample template image, respectively.

进一步的,所述步骤S4包括:Further, the step S4 includes:

S41,将所有的所述差异点数据作为数据集Q,所述数据集Q中每个点与所有点的欧氏距离记为;其中,所述差异点的个数为n;对中的每一行元素进行升序排序,则第1列的元素所组成的距离向量D1,表示对象到自身的距离,全为0;第K列的元素构成所有点的K-最近邻距离的向量Dk;对所述向量Dk中的元素求平均,得到向量Dk的K-平均最近邻距离D,并将其作为候选Eps参数,计算所有的K-平均最近邻距离D得到Eps参数列表S41, all the difference point data are taken as a data set Q, and the Euclidean distance between each point in the data set Q and all the points is recorded as , ; Wherein, the number of difference points is n; Sort the elements of each row in ascending order, then the distance vector D1 composed of the elements in the first column represents the distance from the object to itself, all of which are 0; the elements in the Kth column constitute the vector Dk of the K-nearest neighbor distances of all points; average the elements in the vector Dk to obtain the K-average nearest neighbor distance D of the vector Dk, and use it as a candidate Eps parameter, calculate all the K-average nearest neighbor distances D to obtain the Eps parameter list ;

S42,对于所述Eps参数列表,依次求出每个候选Eps参数对应的Eps邻域对象数量,并计算所有对象的Eps邻域对象数量的数学期望值,作为数据集Q的邻域密度值MinPts参数S42, for the Eps parameter list, find out the number of Eps neighborhood objects corresponding to each candidate Eps parameter in turn, and calculate the mathematical expectation value of the number of Eps neighborhood objects of all objects as the neighborhood density value MinPts parameter of the data set Q , ;

S43,依次选用不同的所述向量Dk中的元素作为Eps参数和对应的所述MinPts参数,输入DBSCAN算法对数据集Q进行聚类分析,分别得到不同K值下所生成的簇数,当生成的簇数连续三次相同时认为聚类结果趋于稳定,记该簇数 N为最优数;S43, sequentially selecting different elements in the vector Dk as Eps parameters and the corresponding MinPts parameters, inputting the DBSCAN algorithm to perform clustering analysis on the data set Q, and obtaining the number of clusters generated under different K values, respectively. When the number of generated clusters is the same for three consecutive times, it is considered that the clustering result is stable, and the number of clusters N is recorded as the optimal number;

S44,继续执行上述步骤S43,直到生成的簇数不再为N,并选用当簇数为N时所对应的最大K值作为最优K值,所述最优K值对应的K-平均最近邻距离D则为最优Eps参数,对应的MinPis参数则为最优MinPts参数;S44, continue to execute the above step S43 until the number of generated clusters is no longer N, and select the maximum K value corresponding to the number of clusters N as the optimal K value, the K-average nearest neighbor distance D corresponding to the optimal K value is the optimal Eps parameter, and the corresponding MinPis parameter is the optimal MinPts parameter;

S45,将所述待检测图像选出的最优Eps参数和最优MinPts参数带入计算出聚类结果,并将所述待检测图像每个聚类区域的外接矩形作为所述候选差异区域;S45, bringing the optimal Eps parameter and the optimal MinPts parameter selected for the image to be detected into the calculation of the clustering result, and taking the circumscribed rectangle of each cluster area of the image to be detected as the candidate difference area;

S46,计算所述所有的匹配点对之间的坐标偏移量的平均偏移量,并根据所述平均偏移量在所述正样本模板图像中找出与所述待检测图的候选差异区域对应的区域作为所述正样本模板图像的所述候选差异区域。S46, calculating the average offset of the coordinate offsets between all the matching point pairs, and finding an area corresponding to the candidate difference area of the image to be detected in the positive sample template image according to the average offset as the candidate difference area of the positive sample template image.

进一步的,所述步骤S5包括:Furthermore, the step S5 comprises:

S51,将所述待检测图像与所述正样本模板图像上的所述候选差异区域进行哈希感知处理生成对应的哈希码;S51, performing hash perception processing on the candidate difference region between the image to be detected and the positive sample template image to generate a corresponding hash code;

S52,计算两个哈希码之间的汉明距离;S52, calculating the Hamming distance between two hash codes;

S531,若所有的所述候选差异区域的汉明距离都小于5,判定整图无缺陷;S531, if the Hamming distances of all the candidate difference regions are less than 5, it is determined that the entire image has no defects;

S532,若有多个所述候选差异区域的汉明距离大于等于5的所述候选差异区域,则选取汉明距离最大的所述候选差异区域以及所有的汉明距离与最大汉明距离差值小于等于2的所述候选差异区域作为所述待检测图像的缺陷区域。S532, if there are multiple candidate difference regions whose Hamming distances are greater than or equal to 5, select the candidate difference region with the largest Hamming distance and all the candidate difference regions whose Hamming distances differ from the maximum Hamming distance by less than or equal to 2 as the defect region of the image to be detected.

本发明还提供一种基于正样本图像的变电站缺陷检测系统,包括存储器、处理器、存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上任一项所述的基于正样本图像的变电站缺陷检测方法的步骤。The present invention also provides a substation defect detection system based on positive sample images, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the substation defect detection method based on positive sample images as described in any one of the above items are implemented.

本发明还提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现如上任一项所述的基于正样本图像的变电站缺陷检测方法的步骤。The present invention also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the steps of the substation defect detection method based on positive sample images as described in any one of the above items are implemented.

本发明的基于正样本图像的变电站缺陷检测方法为了降低变电站缺陷检测中深度学习技术对数据成本较高的要求,整体上采取对传统图像处理算法的优化思路,通过SIFT特征提取关键点的方式下,筛选出正样本图和待检测图之间匹配点对,并将差异点初步分划为若干候选差异区域,再对所有候选差异区域采取哈希感知算法进行编码,通过阈值设定决定最终的区域差异性判断,以及异常位置的锁定,解决了使用深度学习方法对数据的要求高的问题,提高了传统图像算法精度的精度;本发明较深度学习方法降低了数据成本,避免耗时耗力的收集变电站缺陷样本以及数据标注,较传统的图像处理算法加入了改良的聚类机器学习算法用于处理中间数据,在最后的结果判断上引用了图像信息编码降低了环境干扰,总体上降低了误判概率,提升了精度。In order to reduce the high data cost requirements of deep learning technology in substation defect detection, the substation defect detection method based on positive sample images of the present invention adopts an overall optimization idea for traditional image processing algorithms. By extracting key points through SIFT features, matching point pairs between the positive sample image and the image to be detected are screened out, and the difference points are preliminarily divided into several candidate difference areas. Then, a hash perception algorithm is used to encode all candidate difference areas, and the final regional difference judgment and abnormal position locking are determined by threshold setting, which solves the problem of high data requirements for using deep learning methods and improves the accuracy of traditional image algorithms. Compared with deep learning methods, the present invention reduces data costs and avoids time-consuming and labor-intensive collection of substation defect samples and data labeling. Compared with traditional image processing algorithms, an improved clustering machine learning algorithm is added to process intermediate data. Image information encoding is used in the final result judgment to reduce environmental interference, which reduces the probability of misjudgment overall and improves accuracy.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

通过阅读参照以下附图所作的对非限制性实施所作的详细描述,本发明的其它特征、目的和优点将会变得更明显。Other features, objectives and advantages of the present invention will become more apparent from a reading of the detailed description of a non-limiting implementation made with reference to the following accompanying drawings.

图1是本发明提供的一种基于正样本图像的变电站缺陷检测方法的流程示意图。FIG1 is a schematic flow chart of a method for detecting substation defects based on positive sample images provided by the present invention.

图2是图1中步骤S3的子流程图。FIG. 2 is a sub-flow chart of step S3 in FIG. 1 .

图3是图1中步骤S4的子流程图。FIG. 3 is a sub-flow chart of step S4 in FIG. 1 .

具体实施方式DETAILED DESCRIPTION

下面结合附图对本发明专利的技术方法进行清楚、完整的描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域所属的技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following is a clear and complete description of the technical method of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.

此外,附图仅为本发明的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器方法和/或微控制器方法中实现这些功能实体。In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and/or processor methods and/or microcontroller methods.

应当理解的是,虽然在这里可能使用了术语“第一”、“第二”等等来描述各个单元,但是这些单元不应当受这些术语限制。使用这些术语仅仅是为了将一个单元与另一个单元进行区分。举例来说,在不背离示例性实施例的范围的情况下,第一单元可以被称为第二单元,并且类似地第二单元可以被称为第一单元。这里所使用的术语“和/或”包括其中一个或更多所列出的相关联项目的任意和所有组合。It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and/or" used herein includes any and all combinations of one or more of the listed associated items.

为实现上述目的,请参阅图1至图3,本发明提供了一种基于正样本图像的变电站缺陷检测方法,包括以下步骤:To achieve the above object, referring to FIG. 1 to FIG. 3 , the present invention provides a substation defect detection method based on a positive sample image, comprising the following steps:

步骤S1,关键特征点信息的提取:将正样本模板图像与待检测图像转换成灰度图后,用SIFT算法分别在所述正样本模板图像和待检测图像中获取关键特征点和计算关键特征点的描述符;其中,所述描述符包括所述关键特征点的位置、方向、尺度以及以所述关键特征点为中心的16*16的窗口的像素的梯度幅值和方向上形成的128维的特征向量信息;Step S1, extraction of key feature point information: after converting the positive sample template image and the image to be detected into grayscale images, the SIFT algorithm is used to obtain key feature points in the positive sample template image and the image to be detected and calculate the descriptors of the key feature points respectively; wherein the descriptors include the position, direction, scale of the key feature points and the 128-dimensional feature vector information formed by the gradient amplitude and direction of the pixels of the 16*16 window centered on the key feature points;

步骤S2,关键特征点的匹配:采取knnMatch的特征匹配算法对所述正样本模板图像的所有的关键特征点的描述符与所述待检测图像的所有的关键特征点的描述符进行一对多的匹配,获得匹配点对,并通过RANSAC算法,剔除离群的匹配点对并计算所述待检测图像对于所述正样本模板图像的单应性矩阵;所述单应性矩阵包括所述待检测图像与所述正样本模板图像之间点的坐标的对应关系;Step S2, matching of key feature points: using the knnMatch feature matching algorithm to perform one-to-many matching on the descriptors of all key feature points of the positive sample template image and the descriptors of all key feature points of the image to be detected, obtaining matching point pairs, and using the RANSAC algorithm to remove outlier matching point pairs and calculate the homography matrix of the image to be detected for the positive sample template image; the homography matrix includes the corresponding relationship between the coordinates of the points of the image to be detected and the positive sample template image;

步骤S3,差异点计算:Step S3, difference point calculation:

S31,在所述正样本模板图像上选取S个第一检测点,并通过所述单应性矩阵将所述S个第一检测点仿射到所述待检测图像上的对应位置,获得与所述S个第一检测点对应的S个第二检测点;S31, selecting S first detection points on the positive sample template image, and affine-mapping the S first detection points to corresponding positions on the image to be detected through the homography matrix, to obtain S second detection points corresponding to the S first detection points;

S32,通过所述SIFT算法分别在所述正样本模板图像计算所述S个第一检测点的描述符以及在所述待检测图像中计算所述S个第二检测点的描述符;S32, calculating descriptors of the S first detection points in the positive sample template image and calculating descriptors of the S second detection points in the image to be detected respectively by using the SIFT algorithm;

S33,计算每对所述第一检测点和所述第二检测点的特征向量之间的欧氏距离,若所述欧氏距离大于预设的差异阈值,则将该对第一检测点和第二检测点定义为差异点;S33, calculating the Euclidean distance between the feature vectors of each pair of the first detection point and the second detection point, and if the Euclidean distance is greater than a preset difference threshold, defining the pair of the first detection point and the second detection point as a difference point;

步骤S4,获取候选差异区域:根据所述差异点的坐标获取所述待检测图像与所述正样本模板图像上的候选差异区域;Step S4, obtaining candidate difference regions: obtaining candidate difference regions between the image to be detected and the positive sample template image according to the coordinates of the difference points;

步骤S5,计算差异程度:利用哈希感知算法分别计算所述待检测图像与所述正样本模板图像上的每一对所述候选差异区域的差异程度,将差异程度大于设定阈值的差异区域判定为所述待检测图像的缺陷。Step S5, calculating the degree of difference: using a hash perception algorithm to respectively calculate the degree of difference between each pair of the candidate difference regions on the image to be detected and the positive sample template image, and determining the difference region with a degree of difference greater than a set threshold as a defect of the image to be detected.

具体来说,在步骤S1中,在获取了正样本模板图像和待检测图像后,要充分获取正样本模板图像的特征信息,目的是与待检测图像中的相应的特征信息进行向量相关性计算,从而匹配内容相似的关键特征点。通过将正样本模板图像与待检测图像转换成灰度图后,用SIFT算法分别在所述正样本模板图像和待检测图像中获取关键特征点和计算关键特征点的描述符。Specifically, in step S1, after obtaining the positive sample template image and the image to be detected, the feature information of the positive sample template image is fully obtained, the purpose is to calculate the vector correlation with the corresponding feature information in the image to be detected, so as to match the key feature points with similar content. After converting the positive sample template image and the image to be detected into grayscale images, the SIFT algorithm is used to obtain the key feature points and calculate the descriptors of the key feature points in the positive sample template image and the image to be detected.

进一步的,在一较佳的实施例中,所述步骤S1具体包括:Furthermore, in a preferred embodiment, the step S1 specifically includes:

S11,将正样本模板图像与待检测图像均转换成灰度图。S11, converting the positive sample template image and the image to be detected into grayscale images.

S12,构建多尺度空间:对转换后的所述灰度图构建高斯金字塔,对原始图像做高斯平滑,去除高频噪声,接着对平滑后的图像做下采样,对下采样后的图像进行重复滤波和下采样获得多组图像,每组图像包括多层图像,其中,二维图像的尺度空间定义为:L(x,y,σ)=G(x,y,σ)*I(x,y);差分尺度空间的定义为:D(x,y,σ)=L(x,y,kσ)-L(x,y,σ)。S12, constructing a multi-scale space: constructing a Gaussian pyramid for the converted grayscale image, performing Gaussian smoothing on the original image to remove high-frequency noise, then downsampling the smoothed image, and repeatedly filtering and downsampling the downsampled image to obtain multiple groups of images, each group of images includes multiple layers of images, wherein the scale space of the two-dimensional image is defined as: L(x,y,σ)=G(x,y,σ)*I(x,y); the difference scale space is defined as: D(x,y,σ)=L(x,y,kσ)-L(x,y,σ).

具体的,本领域技术人员应当知道SIFT算法从图像中获取关键特征点和计算关键特征点的描述符的方法。以下仅做简单说明,首先对图片构建高斯金字塔,对原始图像做高斯平滑,以去除高频噪声,接着对平滑后的图像做下采样,下采样会缩小图片的尺寸,重复滤波和下采样,一幅图像可以产生几组图像,一组图像包括几层图像,使得高斯金字塔一组的多个层之间的尺度是不一样的,也就是使用的高斯参数σ不同,σ为高斯正态分布的标准差,每组高斯金字塔为一个高斯尺度空间。Specifically, those skilled in the art should know the method of obtaining key feature points from an image and calculating the descriptors of key feature points by the SIFT algorithm. The following is a brief description. First, a Gaussian pyramid is constructed for the image, and Gaussian smoothing is performed on the original image to remove high-frequency noise. Then, the smoothed image is downsampled. Downsampling will reduce the size of the image. Repeating filtering and downsampling, one image can generate several groups of images. A group of images includes several layers of images, so that the scales of multiple layers in a group of Gaussian pyramids are different, that is, the Gaussian parameters σ used are different, σ is the standard deviation of the Gaussian normal distribution, and each group of Gaussian pyramids is a Gaussian scale space.

本领域上一组图像的最底层图像是由下一组中尺度为2σ的图像进行步长为2的下采样得到的,高斯金字塔构建完成之后,将相邻高斯空间的图像相减就得到了DoG高斯差分金字塔,由于上一组图像的底层是由前一组图像的倒数第二层图像隔点采样生成的,这样可以保证尺度的连续性。In this field, the bottom layer of the previous group of images is obtained by downsampling the images with a scale of 2σ in the next group with a step size of 2. After the Gaussian pyramid is constructed, the images in adjacent Gaussian spaces are subtracted to obtain the DoG Gaussian difference pyramid. Since the bottom layer of the previous group of images is generated by sampling the second to last layer of the previous group of images at alternate points, the continuity of the scale can be guaranteed.

二维图像的尺度空间定义为:L(x,y,σ)=G(x,y,σ)*I(x,y);The scale space of a two-dimensional image is defined as: L(x,y,σ)=G(x,y,σ)*I(x,y);

差分尺度空间的定义为:D(x,y,σ)=L(x,y,kσ)-L(x,y,σ)。The difference scale space is defined as: D(x,y,σ)=L(x,y,kσ)-L(x,y,σ).

S13,通过不同尺度DoG空间检测在所述多组图像中检测出具有方向信息的局部极值点作为关键特征点。S13, detecting local extreme points with directional information in the multiple groups of images as key feature points through DoG space detection at different scales.

进一步的,所述步骤S13包括:Furthermore, the step S13 includes:

将所述多组图像中的每个像素点与该像素点对应的尺度空间以及相邻的尺度空间的所有相邻点进行比较,当该像素点的像素值大于或者小于所有相邻点时,该像素点作为极值点,通常这些极值点是一些十分突出的点,不会因光照条件的改变而消失,比如角点、边缘点、暗区域的亮点和亮区域的暗点;Compare each pixel point in the plurality of groups of images with all adjacent points in the scale space corresponding to the pixel point and the adjacent scale space. When the pixel value of the pixel point is greater than or less than all adjacent points, the pixel point is regarded as an extreme point. Usually, these extreme points are very prominent points that will not disappear due to changes in lighting conditions, such as corner points, edge points, bright spots in dark areas, and dark spots in bright areas.

在所述多组图像的不同尺度下均存在的极值点作为所述关键特征点。The extreme points existing at different scales of the multiple groups of images are used as the key feature points.

S14,获取所述关键特征点的所述描述符。S14, obtaining the descriptor of the key feature point.

进一步的,所述步骤S14包括:Furthermore, the step S14 includes:

S141,获取所述关键特征点在不同尺度的所述图像中的尺度信息和位置信息,具体来说,找到了在不同尺度下都存在的关键特征点,就可以得到特征点所在的尺度图像。S141, obtaining scale information and position information of the key feature points in the images at different scales. Specifically, by finding the key feature points that exist at different scales, the scale image where the feature points are located can be obtained.

S142,通过所述关键特征点的领域像素的梯度分布特性确定该关键特征点的方向信息。S142, determining direction information of the key feature point according to the gradient distribution characteristics of the area pixels of the key feature point.

具体来说,为了实现图像旋转不变性,需要给关键特征点的方向进行赋值。通常利用关键特征点的邻域像素的梯度分布特性来确定其方向参数,再利用图像的梯度直方图求取关键特征点局部结构的稳定方向。Specifically, in order to achieve image rotation invariance, it is necessary to assign a value to the direction of the key feature point. Usually, the gradient distribution characteristics of the neighborhood pixels of the key feature point are used to determine its direction parameter, and then the gradient histogram of the image is used to obtain the stable direction of the local structure of the key feature point.

以关键特征点的为中心、以3×1.5σ * 3×1.5σ为半径的领域内计算各个像素点的梯度的幅角和幅值,然后使用直方图对梯度的幅角进行统计。直方图的横轴是梯度的方向,纵轴为梯度方向对应梯度幅值的累加值,直方图中最高峰所对应的方向即为关键特征点的方向。The angle and magnitude of the gradient of each pixel are calculated in the area with the key feature point as the center and 3×1.5σ * 3×1.5σ as the radius, and then the angle of the gradient is counted using a histogram. The horizontal axis of the histogram is the direction of the gradient, and the vertical axis is the cumulative value of the gradient magnitude corresponding to the gradient direction. The direction corresponding to the highest peak in the histogram is the direction of the key feature point.

坐标和角度旋转到以主方向为X轴的计算公式为:The calculation formula for coordinates and angles rotated to the main direction as the X axis is:

xrot=x*cos(Oris)-y*sin(Oris);xrot=x*cos(Oris)-y*sin(Oris);

yrot=x*sin(Oris)+y*cos(Oris);yrot=x*sin(Oris)+y*cos(Oris);

thetarot=theta-Oris。thetarot=theta-Oris.

S143,以所述关键特征点为中心的16*16的窗口的像素的梯度幅值和方向,将窗口内的像素分为16块单元,每块单元是其像素内8个方向的直方图统计,共形成所述关键特征点的128维的特征向量信息。S143, the gradient amplitude and direction of the pixels of a 16*16 window centered on the key feature point, divide the pixels in the window into 16 blocks, each block is a histogram statistic of 8 directions within its pixels, and form a 128-dimensional feature vector information of the key feature point.

进一步的,所述步骤S2包括:Furthermore, the step S2 comprises:

采取knnMatch的特征匹配算法对所述正样本模板图像的所有的关键特征点的描述符与所述待检测图像的所有的关键特征点的描述符进行一对多的匹配,取所述knnMatch的特征匹配算法中的k=2,得到所述待检测图像与所述正样本模板图像之间的特征空间上互相最近邻的和次临近的2个描述符;Using the knnMatch feature matching algorithm to perform one-to-many matching on the descriptors of all key feature points of the positive sample template image and the descriptors of all key feature points of the image to be detected, taking k=2 in the knnMatch feature matching algorithm, and obtaining the two descriptors of the nearest neighbor and the second nearest neighbor in the feature space between the image to be detected and the positive sample template image;

在所述最近邻的描述符和所述次临近的描述符之间的特征空间的相似距离的比值在0.4~0.6之间时,将所述最近邻的描述符和所述次临近的描述符对应的所述关键特征点确定为匹配点对;When the ratio of the similarity distance in the feature space between the nearest neighbor descriptor and the second nearest descriptor is between 0.4 and 0.6, determining the key feature points corresponding to the nearest neighbor descriptor and the second nearest descriptor as a matching point pair;

将所有合适的匹配点对通过RANSAC算法,剔除离群的匹配点对并计算所述待检测图像对于所述正样本模板图像的单应性矩阵。All suitable matching point pairs are passed through the RANSAC algorithm, outlier matching point pairs are eliminated, and the homography matrix of the image to be detected for the positive sample template image is calculated.

进一步的,所述步骤S31中,在所述正样本模板图像上以固定间隔i选取检测点,每个检测点与上下左右的检测点直线距离都为i;其中,第一检测点的个数为S = (w/i+1)*(h/i+1),w和h分别为所述正样本模板图像的长和宽。Furthermore, in step S31, detection points are selected at a fixed interval i on the positive sample template image, and the straight-line distance between each detection point and the detection points above, below, left and right is i; wherein the number of the first detection points is S = (w/i+1)*(h/i+1), where w and h are the length and width of the positive sample template image, respectively.

所述步骤S33中,预设的差异阈值可以是固定比例,也可以是所有的S对所述第一检测点和所述第二检测点的特征向量之间的欧氏距离中大于最大差异距离(欧氏距离中最大的值)的50%~80%(例如70%)的某对所述第一检测点和所述第二检测点定义为差异点。In step S33, the preset difference threshold may be a fixed ratio, or a pair of the first detection point and the second detection point whose Euclidean distances between the feature vectors of all S pairs of the first detection point and the second detection point are greater than 50% to 80% (for example, 70%) of the maximum difference distance (the largest value in the Euclidean distance) is defined as a difference point.

可选地,在所述步骤S4中候选差异区域的划定,可以直接划定苏搜狐差异点附近的预设大小的像素。Optionally, in the step S4, the candidate difference area may be directly delineated by defining pixels of a preset size near the difference point.

进一步的,在一较优的实施方式中,所述步骤S4包括:Furthermore, in a preferred embodiment, step S4 includes:

S41,将所有的所述差异点数据作为数据集Q,所述数据集Q中每个点与所有点的欧氏距离记为;其中,所述差异点的个数为n;对中的每一行元素进行升序排序,则第1列的元素所组成的距离向量D1,表示对象到自身的距离,全为0;第K列的元素构成所有点的K-最近邻距离的向量Dk;对所述向量Dk中的元素求平均,得到向量Dk的K-平均最近邻距离D,并将其作为候选Eps参数,计算所有的K-平均最近邻距离D得到Eps参数列表S41, all the difference point data are taken as a data set Q, and the Euclidean distance between each point in the data set Q and all the points is recorded as , ; Wherein, the number of difference points is n; Sort the elements of each row in ascending order, then the distance vector D1 composed of the elements in the first column represents the distance from the object to itself, all of which are 0; the elements in the Kth column constitute the vector D k of the K-nearest neighbor distances of all points; average the elements in the vector D k to obtain the K-average nearest neighbor distance D of the vector D k , and use it as a candidate Eps parameter, calculate all the K-average nearest neighbor distances D to obtain the Eps parameter list .

S42,对于所述Eps参数列表,依次求出每个候选Eps参数对应的Eps邻域对象数量,并计算所有对象的Eps邻域对象数量的数学期望值,作为数据集Q的邻域密度值MinPts参数S42, for the Eps parameter list, find out the number of Eps neighborhood objects corresponding to each candidate Eps parameter in turn, and calculate the mathematical expectation value of the number of Eps neighborhood objects of all objects as the neighborhood density value MinPts parameter of the data set Q , ;

S43,依次选用不同的所述向量Dk中的元素作为Eps参数和对应的所述MinPts参数(即依次选用生成Eps参数列表中的元素作为Eps参数和相应的MinPts参数),输入DBSCAN算法对数据集Q进行聚类分析,分别得到不同K值下所生成的簇数,当生成的簇数连续三次相同时认为聚类结果趋于稳定,记该簇数 N为最优数;S43, sequentially selecting different elements in the vector Dk as Eps parameters and the corresponding MinPts parameters (i.e., sequentially selecting elements in the generated Eps parameter list as Eps parameters and the corresponding MinPts parameters), inputting the DBSCAN algorithm to perform clustering analysis on the data set Q, and obtaining the number of clusters generated under different K values. When the number of generated clusters is the same for three consecutive times, it is considered that the clustering result is stable, and the number of clusters N is recorded as the optimal number;

S44,继续执行上述步骤S43,直到生成的簇数不再为N,并选用当簇数为N时所对应的最大K值作为最优K值,所述最优K值对应的K-平均最近邻距离D则为最优Eps参数,对应的MinPis参数则为最优MinPts参数;S44, continue to execute the above step S43 until the number of generated clusters is no longer N, and select the maximum K value corresponding to the number of clusters N as the optimal K value, the K-average nearest neighbor distance D corresponding to the optimal K value is the optimal Eps parameter, and the corresponding MinPis parameter is the optimal MinPts parameter;

S45,将所述待检测图像选出的最优Eps参数和最优MinPts参数带入计算出聚类结果,并将所述待检测图像每个聚类区域的外接矩形作为所述候选差异区域;S45, bringing the optimal Eps parameter and the optimal MinPts parameter selected for the image to be detected into the calculation of the clustering result, and taking the circumscribed rectangle of each cluster area of the image to be detected as the candidate difference area;

S46,计算所述所有的匹配点对之间的坐标偏移量的平均偏移量,并根据所述平均偏移量在所述正样本模板图像中找出与所述待检测图的候选差异区域对应的区域作为所述正样本模板图像的所述候选差异区域。S46, calculating the average offset of the coordinate offsets between all the matching point pairs, and finding an area corresponding to the candidate difference area of the image to be detected in the positive sample template image according to the average offset as the candidate difference area of the positive sample template image.

进一步的,所述步骤S5包括:Furthermore, the step S5 comprises:

S51,将所述待检测图像与所述正样本模板图像上的所述候选差异区域进行哈希感知处理生成对应的哈希码。S51, performing hash perception processing on the candidate difference region between the image to be detected and the positive sample template image to generate a corresponding hash code.

具体来说,首先将图像(候选差异区域)缩小到一个固定大小的像素图像,这一步是为了去除图片的细节,只保留结构、明暗等基本信息,摒弃不同尺寸、比例带来的图片差异。将缩小后的图像转换为灰度图像,简化为64级灰度,即所有像素点总共有64种颜色,计算所有64个像素点的灰度平均值,将每个像素的灰度与平均值进行比较,大于或等于DCT均值的像素记为1,小于DCT均值的像素记为0,将比较结果组合在一起,构成一个64位的整数,每四位形成一个16进制编码。Specifically, the image (candidate difference area) is first reduced to a pixel image of a fixed size. This step is to remove the details of the image, retain only basic information such as structure and brightness, and discard the image differences caused by different sizes and proportions. The reduced image is converted into a grayscale image and simplified to 64 levels of grayscale, that is, all pixels have a total of 64 colors. The grayscale average of all 64 pixels is calculated, and the grayscale of each pixel is compared with the average value. Pixels greater than or equal to the DCT mean are recorded as 1, and pixels less than the DCT mean are recorded as 0. The comparison results are combined to form a 64-bit integer, and every four bits form a hexadecimal code.

DCT均值的计算公式为:The calculation formula of DCT mean is:

cos cos ,

;

f(i,j)为原始的信号,F(u,v)是DCT变换后的系数,N为原始信号的点数,c(u)、c(v)是补偿系数。f(i,j) is the original signal, F(u,v) is the coefficient after DCT transformation, N is the number of points of the original signal, and c(u) and c(v) are compensation coefficients.

S52,计算两个哈希码之间的汉明距离。S52, calculating the Hamming distance between the two hash codes.

具体来说,汉明距离即两个哈希码不同位置上的位数之和,根据计算出的汉明距离,可以得到两个图像之间的差异程度。一般情况下,汉明距离越大,说明两个图像之间的差异越大。两个图像哈希值的汉明距离d,则两图片相似度为(64-d)/64。一般认为汉明距离小于5则认为两张图片相似。Specifically, the Hamming distance is the sum of the number of bits at different positions of the two hash codes. Based on the calculated Hamming distance, the degree of difference between the two images can be obtained. In general, the larger the Hamming distance, the greater the difference between the two images. The Hamming distance d between the hash values of the two images, the similarity of the two images is (64-d)/64. It is generally believed that if the Hamming distance is less than 5, the two images are considered similar.

S531,若所有的所述候选差异区域的汉明距离都小于5,判定整图无缺陷;S531, if the Hamming distances of all the candidate difference regions are less than 5, it is determined that the entire image has no defects;

S532,若有多个所述候选差异区域的汉明距离大于等于5的所述候选差异区域,则选取汉明距离最大的所述候选差异区域以及所有的汉明距离与最大汉明距离差值小于等于2的所述候选差异区域作为所述待检测图像的缺陷区域。S532, if there are multiple candidate difference regions whose Hamming distances are greater than or equal to 5, select the candidate difference region with the largest Hamming distance and all the candidate difference regions whose Hamming distances differ from the maximum Hamming distance by less than or equal to 2 as the defect region of the image to be detected.

本发明的基于正样本图像的变电站缺陷检测方法为了降低变电站缺陷检测中深度学习技术对数据成本较高的要求,且正常场景下的样本图中拥有丰富的特征信息,分利用这些特征信息,匹配所述待检测图像与所述正样本模板图像中间的关键信息,并进行差异化计算,将差异量化为数值进行判断。The substation defect detection method based on positive sample images of the present invention is to reduce the high data cost requirements of deep learning technology in substation defect detection, and the sample images under normal scenarios have rich feature information. These feature information are used to match the key information between the image to be detected and the positive sample template image, and perform differential calculations to quantify the differences into numerical values for judgment.

本发明整体上采取对传统图像处理算法的优化思路,综合了几种常见的图像处理算法的优点,较深度学习方法降低了数据成本,避免耗时耗力的收集变电站缺陷样本以及数据标注,较传统的图像处理算法加入了改良的聚类机器学习算法用于处理中间数据,在最后的结果判断上引用了图像信息编码降低了环境干扰,总体上降低了误判概率,提升了精度。通过SIFT特征提取关键点的方式下,筛选出正样本图和待检测图之间匹配点对,并将差异点初步分划为若干候选差异区域,再对所有候选差异区域采取哈希感知算法进行编码,通过阈值设定决定最终的区域差异性判断,以及异常位置的锁定,解决了使用深度学习方法对数据的要求高的问题,提高了传统图像算法精度的精度。The present invention adopts the optimization idea of the traditional image processing algorithm as a whole, combines the advantages of several common image processing algorithms, reduces the data cost compared with the deep learning method, avoids the time-consuming and labor-intensive collection of substation defect samples and data annotation, adds an improved clustering machine learning algorithm to process intermediate data compared with the traditional image processing algorithm, and uses image information encoding in the final result judgment to reduce environmental interference, which reduces the probability of misjudgment and improves accuracy. By extracting key points through SIFT features, matching point pairs between the positive sample image and the image to be detected are screened, and the difference points are preliminarily divided into several candidate difference areas, and then all candidate difference areas are encoded using a hash perception algorithm. The final regional difference judgment and the locking of abnormal positions are determined by threshold setting, which solves the problem of high data requirements for using deep learning methods and improves the accuracy of traditional image algorithms.

本发明还提供一种基于正样本图像的变电站缺陷检测系统,包括存储器、处理器、存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上任一项所述的基于正样本图像的变电站缺陷检测方法的步骤。The present invention also provides a substation defect detection system based on positive sample images, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the substation defect detection method based on positive sample images as described in any one of the above items are implemented.

示例性的,所述计算机程序可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器中,并由所述处理器执行,以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序在所述计算机中的执行过程。Exemplarily, the computer program may be divided into one or more modules/units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the computer.

所称处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

所述存储器可以是内部存储单元,例如硬盘或内存;所述存储器也可以是外部存储设备,例如配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(SecureDigital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器还可以既包括内部存储单元也包括外部存储设备。所述存储器用于存储所述计算机程序以及终端设备所需的其他程序和数据。所述存储器还可以用于暂时地存储已经输出或者将要输出的数据。The memory may be an internal storage unit, such as a hard disk or a memory; the memory may also be an external storage device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory may include both an internal storage unit and an external storage device. The memory is used to store the computer program and other programs and data required by the terminal device. The memory may also be used to temporarily store data that has been output or is to be output.

本发明还提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现如上任一项所述的基于正样本图像的变电站缺陷检测方法的步骤。The present invention also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the steps of the substation defect detection method based on positive sample images as described in any one of the above items are implemented.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

在本发明所提供的实施例中,应该理解到,所揭露的装置/系统和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided by the present invention, it should be understood that the disclosed devices/systems and methods can be implemented in other ways. For example, the device/terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。If the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在申请文件的等同要件的含义和范围内的所有变化涵括在本发明内。Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.

以上所述仅是本发明的具体实施方式,使本领域技术人员能够理解或实现本发明。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所发明的原理和新颖特点相一致的最宽的范围。The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims (10)

1. The transformer substation defect detection method based on the positive sample image is characterized by comprising the following steps of:
Step S1, extracting key feature point information: after converting a positive sample template image and an image to be detected into a gray level image, acquiring key feature points and descriptors for calculating the key feature points from the positive sample template image and the image to be detected respectively by using a SIFT algorithm; the descriptor comprises 128-dimensional feature vector information formed in the gradient amplitude and direction of pixels of a window of 16 x 16 taking the key feature point as a center, wherein the position, the direction and the scale of the key feature point are included in the descriptor;
Step S2, matching key feature points: adopting a knnMatch feature matching algorithm to carry out one-to-many matching on descriptors of all key feature points of the positive sample template image and descriptors of all key feature points of the image to be detected, obtaining matching point pairs, removing outlier matching point pairs through a RANSAC algorithm, and calculating a homography matrix of the image to be detected on the positive sample template image; the homography matrix comprises the corresponding relation of coordinates of points between the image to be detected and the positive sample template image;
step S3, calculating a difference point:
S31, selecting S first detection points on the positive sample template image, affining the S first detection points to corresponding positions on the image to be detected through the homography matrix, and obtaining S second detection points corresponding to the S first detection points;
s32, calculating descriptors of the S first detection points in the positive sample template image and descriptors of the S second detection points in the image to be detected respectively through the SIFT algorithm;
S33, calculating Euclidean distance between the feature vectors of each pair of the first detection point and the second detection point, and defining the pair of the first detection point and the second detection point as difference points if the Euclidean distance is larger than a preset difference threshold;
Step S4, obtaining candidate difference areas: acquiring candidate difference areas on the image to be detected and the positive sample template image according to the coordinates of the difference points;
step S5, calculating the difference degree: and respectively calculating the difference degree of each pair of candidate difference regions on the image to be detected and the positive sample template image by using a hash perception algorithm, and judging the difference region with the difference degree larger than a set threshold value as the defect of the image to be detected.
2. The positive sample image-based substation defect detection method according to claim 1, wherein the step S1 specifically includes:
S11, converting the positive sample template image and the image to be detected into a gray level image;
S12, constructing a multi-scale space: constructing a Gaussian pyramid for the converted gray level image, performing Gaussian smoothing on an original image, removing high-frequency noise, performing downsampling on the smoothed image, and performing repeated filtering and downsampling on the downsampled image to obtain a plurality of groups of images, wherein each group of images comprises a plurality of layers of images, and the scale space of the two-dimensional image is defined as: l (x, y, σ) =g (x, y, σ) ×i (x, y); definition of the differential scale space is: d (x, y, σ) =l (x, y, kσ) -L (x, y, σ); sigma is standard deviation of Gaussian normal distribution, x is a horizontal axis coordinate, and y is a vertical axis coordinate;
S13, detecting local extreme points with direction information in the multiple groups of images through different-scale DoG space detection to serve as the key feature points;
S14, acquiring the descriptors of the key feature points.
3. The positive sample image-based substation defect detection method according to claim 2, wherein the step S13 includes: comparing each pixel point in the multiple groups of images with the scale space corresponding to the pixel point and all adjacent points in the adjacent scale space, and taking the pixel point as an extreme point when the pixel value of the pixel point is larger or smaller than all the adjacent points; and taking the extreme points existing under different scales of the plurality of groups of images as the key characteristic points.
4. The positive sample image-based substation defect detection method according to claim 3, wherein the step S14 includes:
acquiring scale information and position information of the key feature points in the images with different scales;
determining the direction information of the key feature point through the gradient distribution characteristics of the field pixels of the key feature point;
And dividing the pixels in the window into 16 block units by taking the gradient amplitude and the gradient direction of the pixels of the window with the key feature points as centers, wherein each block unit is the histogram statistics of 8 directions in the pixels, and 128-dimensional feature vector information of the key feature points is formed in a conformal mode.
5. The positive sample image-based substation defect detection method according to claim 1, wherein the step S2 comprises:
adopting a knnMatch feature matching algorithm to carry out one-to-many matching on descriptors of all key feature points of the positive sample template image and descriptors of all key feature points of the image to be detected, and taking k=2 in the knnMatch feature matching algorithm to obtain 2 descriptors which are nearest to each other and next nearest to each other in feature space between the image to be detected and the positive sample template image;
When the ratio of the similarity distance of the feature space between the nearest neighbor descriptor and the next-nearest neighbor descriptor is between 0.4 and 0.6, determining the key feature points corresponding to the nearest neighbor descriptor and the next-nearest neighbor descriptor as matching point pairs;
And removing outlier matching point pairs through a RANSAC algorithm, and calculating a homography matrix of the image to be detected on the positive sample template image.
6. The method for detecting defects in a transformer substation based on a positive sample image according to claim 1, wherein in the step S31, detection points are selected at a fixed interval i on the positive sample template image, and each detection point has a linear distance i from the detection points in the up-down and left-right directions; the number of the first detection points is s= (w/i+1) ×h/i+1, and w and h are the length and width of the positive sample template image respectively.
7. The positive sample image-based substation defect detection method according to claim 1, wherein the step S4 includes:
S41, taking all the difference point data as a data set Q, wherein Euclidean distance between each point and all points in the data set Q is recorded as ; Wherein the number of the difference points is n; for a pair ofIf the elements in each row are ordered in ascending order, the distance vector D1 formed by the elements in the 1 st row represents the distance from the object to the object, and the distance is 0; the elements of column K form the vector D k of the K-nearest distances of all points; averaging the elements in the vector D k to obtain the K-average nearest neighbor distance D of the vector D k, taking the K-average nearest neighbor distance D as a candidate Eps parameter, and calculating all the K-average nearest neighbor distances D to obtain an Eps parameter list
S42, for the Eps parameter list, sequentially solving the number of Eps neighborhood objects corresponding to each candidate Eps parameter, and calculating the mathematical expectation value of the number of Eps neighborhood objects of all objects to serve as the neighborhood density value MinPts parameter of the data set Q
S43, sequentially selecting elements in different vectors Dk as Eps parameters and corresponding MinPts parameters, inputting a DBSCAN algorithm to perform cluster analysis on a data set Q to respectively obtain the number of clusters generated under different K values, considering that a clustering result tends to be stable when the number of clusters generated is three times continuously the same, and recording the number of clusters N as an optimal number;
S44, continuing to execute the step S43 until the generated cluster number is no longer N, and selecting a maximum K value corresponding to the N cluster number as an optimal K value, wherein the K-average nearest neighbor distance D corresponding to the optimal K value is an optimal Eps parameter, and the corresponding MinPis parameter is an optimal MinPts parameter;
S45, introducing the optimal Eps parameter and the optimal MinPts parameter selected by the image to be detected into a clustering result, and taking the circumscribed rectangle of each clustering area of the image to be detected as the candidate difference area;
S46, calculating average offset of the coordinate offsets between all the matching point pairs, and finding out a region corresponding to the candidate difference region of the image to be detected from the positive sample template image according to the average offset to serve as the candidate difference region of the positive sample template image.
8. The positive sample image-based substation defect detection method according to claim 1, wherein the step S5 includes:
S51, carrying out hash perception processing on the image to be detected and the candidate difference area on the positive sample template image to generate a corresponding hash code;
s52, calculating the Hamming distance between the two hash codes;
S531, if the Hamming distance of all the candidate difference areas is less than 5, judging that the whole graph is defect-free;
S532, if a plurality of candidate difference areas with the Hamming distance greater than or equal to 5 exist, selecting the candidate difference area with the largest Hamming distance and the candidate difference area with the difference value between all Hamming distances and the largest Hamming distance less than or equal to 2 as defect areas of the image to be detected.
9. A positive sample image based substation defect detection system, comprising a memory, a processor, a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the positive sample image based substation defect detection method according to any of claims 1 to 8.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the positive sample image based substation defect detection method according to any one of claims 1 to 8.
CN202411169130.8A 2024-08-23 2024-08-23 Transformer substation defect detection method, system and storage medium based on positive sample image Active CN118691847B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411169130.8A CN118691847B (en) 2024-08-23 2024-08-23 Transformer substation defect detection method, system and storage medium based on positive sample image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411169130.8A CN118691847B (en) 2024-08-23 2024-08-23 Transformer substation defect detection method, system and storage medium based on positive sample image

Publications (2)

Publication Number Publication Date
CN118691847A CN118691847A (en) 2024-09-24
CN118691847B true CN118691847B (en) 2024-10-29

Family

ID=92769923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411169130.8A Active CN118691847B (en) 2024-08-23 2024-08-23 Transformer substation defect detection method, system and storage medium based on positive sample image

Country Status (1)

Country Link
CN (1) CN118691847B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111553265A (en) * 2020-04-27 2020-08-18 河北天元地理信息科技工程有限公司 Method and system for detecting internal defects of drainage pipeline
CN111639713A (en) * 2020-06-01 2020-09-08 广东小天才科技有限公司 Page turning detection method and device, electronic equipment and storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9141871B2 (en) * 2011-10-05 2015-09-22 Carnegie Mellon University Systems, methods, and software implementing affine-invariant feature detection implementing iterative searching of an affine space
CN113160029B (en) * 2021-03-31 2022-07-05 海南大学 A Medical Image Digital Watermarking Method Based on Perceptual Hashing and Data Augmentation
CN114332498A (en) * 2021-12-30 2022-04-12 中北大学 Multi-size image change detection device and method based on multi-feature extraction
CN115147723B (en) * 2022-07-11 2023-05-09 武汉理工大学 Method, system, medium, equipment and terminal for identification and ranging of inland ships
CN117132648B (en) * 2023-04-28 2024-07-12 荣耀终端有限公司 Visual positioning method, electronic equipment and computer readable storage medium
CN116667531B (en) * 2023-05-19 2024-09-13 国网江苏省电力有限公司泰州供电分公司 Acousto-optic-electric collaborative inspection method and device based on digital twin transformer substation
CN117253062A (en) * 2023-09-27 2023-12-19 湖南科技大学 Relay contact image characteristic quick matching method under any gesture
CN117076935B (en) * 2023-10-16 2024-02-06 武汉理工大学 Digital twin-assisted lightweight generation method and system of mechanical fault data
CN117592332B (en) * 2023-11-21 2024-11-01 江苏省特种设备安全监督检验研究院 Digital twinning-based gearbox model high-fidelity method, system and storage medium
CN118334373A (en) * 2024-04-17 2024-07-12 华能海南发电股份有限公司文昌风电厂 Wind turbine nacelle feature point matching method and system based on SIFT algorithm

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111553265A (en) * 2020-04-27 2020-08-18 河北天元地理信息科技工程有限公司 Method and system for detecting internal defects of drainage pipeline
CN111639713A (en) * 2020-06-01 2020-09-08 广东小天才科技有限公司 Page turning detection method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN118691847A (en) 2024-09-24

Similar Documents

Publication Publication Date Title
CN109299720B (en) A Target Recognition Method Based on Spatial Relationship of Contour Segments
CN106355577B (en) Fast Image Matching Method and System Based on Feature State and Global Consistency
CN109711416B (en) Target identification method and device, computer equipment and storage medium
CN101408932A (en) Method for matching finger print image based on finger print structure feature and veins analysis
CN102693409A (en) Method for quickly identifying two-dimension code system type in images
CN102799859A (en) Method for identifying traffic sign
CN114170418B (en) Multi-feature fusion image retrieval method for automobile harness connector by means of graph searching
CN107578011A (en) The decision method and device of key frame of video
CN117474918B (en) Abnormality detection method and device, electronic device, and storage medium
CN108830283B (en) Image feature point matching method
Huynh et al. Plant identification using new architecture convolutional neural networks combine with replacing the red of color channel image by vein morphology leaf
CN110705569A (en) Image local feature descriptor extraction method based on texture features
CN104268550A (en) Feature extraction method and device
CN113011498B (en) Feature point extraction and matching methods, systems and media based on color images
CN118691847B (en) Transformer substation defect detection method, system and storage medium based on positive sample image
CN113963295A (en) Method, device, equipment and storage medium for recognizing landmark in video clip
CN108960246A (en) A kind of binary conversion treatment device and method for image recognition
CN113435479A (en) Feature point matching method and system based on regional feature expression constraint
CN116843909B (en) Power line extraction method and device, storage medium and computer equipment
CN111127407A (en) A style transfer forgery image detection device and method based on Fourier transform
Partio et al. An ordinal co-occurrence matrix framework for texture retrieval
CN110135360A (en) A Parking Space Recognition Method Based on Local Binary Pattern and Support Vector Machine
CN116843946A (en) A method and device for identifying the main structural planes of tunnel rock mass based on image recognition
CN113326790A (en) Capsule robot drain pipe disease detection method based on abnormal detection thinking
CN111753723A (en) Fingerprint identification method and device based on density calibration

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant