Quantitative detection method for layering defects of drilled holes

文档序号:340143 发布日期:2021-12-03 浏览:19次 中文

阅读说明:本技术 一种钻削孔分层缺陷定量检测方法 (Quantitative detection method for layering defects of drilled holes ) 是由 罗世通 武涛 张栋 董振 于 2021-10-19 设计创作,主要内容包括:本发明属于机械加工缺陷检测技术领域,具体涉及一种钻削孔分层缺陷定量检测方法,包括以下步骤:经CT扫描得到的分层缺陷灰度图像,通过软件对分层缺陷灰度图像进行纯黑白化;在图像中心选取一定数量连续取样点,取样点在宽度和高度方向上与图像中心距离不超过固定跨度,保证所有取样点位于分层缺陷内部,最终所有取样点以图像中心为中心成正方形,确定所有取样点的圆心坐标(x-(c),y-(c));在图像的四个边缘沿着x轴和y轴向圆心逐个历遍路径上的像素点,确定分层缺陷最外侧像素点所在位置;分别计算各个最外侧分层缺陷像素点与圆心之间的距离半径和角度值,从而确定实际分层缺陷区域面积。(The invention belongs to the technical field of machining defect detection, and particularly relates to a quantitative detection method for a layered defect of a drilled hole, which comprises the following steps: carrying out pure black whitening on the layered defect gray image obtained by CT scanning through software; selecting a certain number of continuous sampling points at the center of the image, ensuring that the distance between the sampling points and the center of the image in the width and height directions does not exceed a fixed span, ensuring that all the sampling points are positioned in the layered defect, finally forming a square by taking the center of the image as the center of all the sampling points, and determining the circle center coordinates (x) of all the sampling points c ,y c ) (ii) a The method comprises the steps that pixel points on paths are traversed one by one along the circle centers of the x axis and the y axis at the four edges of an image, and the positions of the outermost pixel points of the layered defects are determined; and respectively calculating the distance radius and the angle value between each outermost layered defect pixel point and the circle center, thereby determining the area of the actual layered defect region.)

1. A quantitative detection method for the layered defects of drilled holes is characterized by comprising the following steps: the method comprises the following steps:

s1, carrying out pure black and white on the layered defect gray image obtained by CT scanning through software;

s2, selecting a certain number of continuous sampling points at the center of the image, ensuring that the distance between the sampling points and the center of the image in the width and height directions does not exceed a fixed span, ensuring that all the sampling points are positioned in the layered defect, finally forming a square by taking the center of the image as the center of all the sampling points, and determining the circle center coordinates (x) of all the sampling pointsc,yc);

S3, gradually traversing pixel points on the path along the x-axis and y-axis circle centers at four edges of the image one by one, and determining the positions of the outermost pixel points of the layered defects;

and S4, respectively calculating the distance radius and the angle value between each outermost layered defect pixel point and the circle center, thereby determining the area of the actual layered defect area.

2. The method for quantitatively detecting the delamination defect of the drilled hole according to claim 1, wherein: in S1, performing pure black whitening on the hierarchical defect gray image by software, specifically including:

(1) introducing an image module of an image processing standard library PIL in a Python platform;

(2) opening a target image and setting a critical gray value;

(3) and performing logic judgment on each pixel point in the image according to the width and the height of the image, changing the gray value of each pixel point into pure white if the gray value is less than or equal to a critical value, and changing the gray value of each pixel point into pure black if the gray value is greater than the critical value.

3. The method for quantitatively detecting the delamination defect of the drilled hole according to claim 1, wherein: determining the center coordinates (x) of all the sample points as described in S2c,yc) The method comprises the following specific steps:

(1) taking the width direction of the layered defect image from left to right as the positive direction of an x axis, the leftmost side as 0, the height direction from top to bottom as the positive direction of a y axis and the uppermost side as 0, and selecting the central coordinate of the image as (x)0,y0);

(2) Starting to extend from x0 along the positive direction and the negative direction of the x axis in the sampling point range to each pixel point, carrying out logic judgment until a first pure white pixel point is found, writing the pixel point coordinate into a list inner _ x, stopping the circulation in the x axis direction, and entering the next y coordinate circulation;

(3) starting to extend from y0 along the positive direction and the negative direction of the y axis in the sampling point range to each pixel point, carrying out logic judgment until the first pure white pixel point is found, writing the pixel point coordinate into a list inner _ y, stopping the circulation of the y axis direction, and entering the next circulation of the x coordinate;

(4) sorting the coordinate elements in the list inner _ x according to the y coordinate value, and sorting the coordinate elements in the list inner _ y according to the x coordinate value;

(5) extracting and adding x coordinate values in adjacent coordinate elements (equal y coordinates) in the inner _ x list to obtain a chord length value x in the x-axis direction in the hole wall circles

(6) Calculating xsThe average value is integrated to obtain the coordinate value x of the circle center xc

(7) Extracting and adding y coordinate values in adjacent coordinate elements (equal x coordinates) in the inner _ y list to obtain a chord length value y in the y-axis direction in the hole wall circles

(8) Calculating ys average value and rounding to obtain circle center y coordinate value yc

4. The method for quantitatively detecting the delamination defect of the drilled hole according to claim 1, wherein: determining the position of the outermost pixel point of the layered defect in S4 specifically comprises the following steps:

(1) dividing the layered defect gray image into four areas according to 90 degrees through a horizontal line and a vertical line of the circle center, and clockwise increasing the area with the rightmost side as 0 degree;

(2) and (3) pixel points on the path are gradually traversed from the four edges of the gray level image of the layered defect along the x-axis and the y-axis to the circle center, and the coordinate of the first pure white pixel point searched is the position of the outermost side of the layered defect.

5. The method for quantitatively detecting the delamination defect of the drilled hole according to claim 1, wherein: in S5, the calculating of the distance radius and the angle value between each outermost layered defect pixel point and the circle center respectively includes the following steps:

(1) calculating the distance between the outermost pixel point of each hierarchical defect and the center of the circle, and storing the distance into a dictionary dists, wherein the key of each key-value pair in the dictionary is (x)i,yi) Angle relative to the center of the circle, the value being (x)i,yi) Distance from the center of the circle;

(2) and (5) sorting the dictionary dists, and drawing a chart to obtain the average distance radius, the maximum value of the distance radius and the corresponding angle of the distance radius.

Technical Field

The invention belongs to the technical field of machining defect detection, and particularly relates to a quantitative detection method for a layered defect of a drilled hole.

Background

The evaluation of the delamination defect is to evaluate the generation degree and influence of the delamination defect by calculating a delamination defect factor. The basic numerical values for calculating the delamination defect factor are mainly divided into two types: one is a one-dimensional size, and mainly comprises the pore diameter obtained by drilling and the corresponding diameter of a selected point in a layering area; the other is two-dimensional size, which is mainly the area of the drilled hole, the calculated area corresponding to the selected point of the delamination area and the area of the actual delamination defect area, as shown in fig. 1. D in FIG. 1nomFor drilling hole diameters, DmaxIn the region of the layered defect, the converted diameter of the corresponding point located at the outermost position of the hole center is twice the distance between the point and the hole center, AnomThe hole diameter corresponds to the area of the circle, AmaxIs warp DmaxCalculating the area of the resulting circle, AdIs the actual delamination defect area.

The most commonly used formula for calculating the delamination defect factor is as follows:

its advantages are easy measurement and calculation. For each hole, the hole diameter is generally the nominal diameter of the used drill bit, so that the layering defect factor can be calculated by measuring the distance between the outermost corresponding point of the layering defect area and the circle center. The disadvantage is that it is not sensitive to the actual generation area of the delamination defect. And measure DmaxThe most important is the determination of the hole center and the corresponding point at the outermost side of the delamination defect.

The calculation method of the delamination defect factor based on the area of the actual delamination defect area is as follows:

the method has the advantage of better meeting the practical situation of the layering defect. The disadvantages are that the area measurement and calculation of the actual delamination defect area are difficult, and D cannot be evaluated when the delamination defect width is extremely unevenmaxImpact on delamination defect factor.

To evaluate D simultaneouslymaxAnd AdFor the influence of the layered defect factor, the two layered defect factor calculation methods can be combined:

the advantages of the above formula are: when D is presentmaxWhen the influence on the delamination defect factor is dominant, FdaThe value approaches Fd. When A isdHaving an effect on the delamination defect factor greater than DmaxWhen F is presentdaValue closer to Fa. Its disadvantage is similar to formula (2.2), also AdMeasurement and calculation are difficult.

In summary, the calculation of the delamination defect factor is premised on the measurement and determination of the relevant size and area, and the key points of the calculation are the determination of the center of the hole and the corresponding point at the outermost side of the delamination defect area and the measurement and calculation of the actual delamination defect area.

Disclosure of Invention

The invention aims to provide a quantitative detection method for a layering defect of a drilled hole, which overcomes the defects of the prior art, and quickly and accurately determines the center of the hole and the determination of the corresponding point at the outermost side of a layering defect area and measures and calculates the area of the actual layering defect area after a software module of a Python platform is used for processing a layering defect gray image.

In order to solve the problems, the technical scheme adopted by the invention is as follows:

a quantitative detection method for the layered defects of drilled holes is characterized by comprising the following steps: the method comprises the following steps:

s1, carrying out pure black and white on the layered defect gray image obtained by CT scanning through software;

s2, selecting the center of the imageTaking a certain number of continuous sampling points, ensuring that the distance between each sampling point and the center of the image in the width and height directions does not exceed a fixed span, ensuring that all the sampling points are positioned in the layered defect, finally forming a square by taking the center of the image as the center of all the sampling points, and determining the circle center coordinates (x) of all the sampling pointsc,yc);

S3, gradually traversing pixel points on the path along the x-axis and y-axis circle centers at four edges of the image one by one, and determining the positions of the outermost pixel points of the layered defects;

and S4, respectively calculating the distance radius and the angle value between each outermost layered defect pixel point and the circle center, thereby determining the area of the actual layered defect area.

Further, in S1, the step of performing pure whitening on the layer defect gray image by software includes:

(1) introducing an image module of an image processing standard library PIL in a Python platform;

(2) opening a target image and setting a critical gray value;

(3) and performing logic judgment on each pixel point in the image according to the width and the height of the image, changing the gray value of each pixel point into pure white if the gray value is less than or equal to a critical value, and changing the gray value of each pixel point into pure black if the gray value is greater than the critical value.

Further, the center coordinates (x) of all the sampling points are determined as described in S2c,yc) The method comprises the following specific steps:

(1) taking the width direction of the layered defect image from left to right as the positive direction of an x axis, the leftmost side as 0, the height direction from top to bottom as the positive direction of a y axis and the uppermost side as 0, and selecting the central coordinate of the image as (x)0,y0);

(2) Starting to extend from x0 along the positive direction and the negative direction of the x axis in the sampling point range to each pixel point, carrying out logic judgment until a first pure white pixel point is found, writing the pixel point coordinate into a list inner _ x, stopping the circulation in the x axis direction, and entering the next y coordinate circulation;

(3) starting to extend from y0 along the positive direction and the negative direction of the y axis in the sampling point range to each pixel point, carrying out logic judgment until the first pure white pixel point is found, writing the pixel point coordinate into a list inner _ y, stopping the circulation of the y axis direction, and entering the next circulation of the x coordinate;

(4) sorting the coordinate elements in the list inner _ x according to the y coordinate value, and sorting the coordinate elements in the list inner _ y according to the x coordinate value;

(5) extracting and adding x coordinate values in adjacent coordinate elements (equal y coordinates) in the inner _ x list to obtain a chord length value x in the x-axis direction in the hole wall circles

(6) Calculating xsThe average value is integrated to obtain the coordinate value x of the circle center xc

(7) Extracting and adding y coordinate values in adjacent coordinate elements (equal x coordinates) in the inner _ y list to obtain a chord length value y in the y-axis direction in the hole wall circles

Calculating ys average value and rounding to obtain circle center y coordinate value yc

Further, the determining the position of the outermost layered defect pixel point in S4 specifically includes the following steps:

(1) dividing the layered defect gray image into four areas according to 90 degrees through a horizontal line and a vertical line of the circle center, and clockwise increasing the area with the rightmost side as 0 degree;

(2) and (3) pixel points on the path are gradually traversed from the four edges of the gray level image of the layered defect along the x-axis and the y-axis to the circle center, and the coordinate of the first pure white pixel point searched is the position of the outermost side of the layered defect.

Further, the step of calculating the distance radius and the angle value between each outermost layered defect pixel point and the circle center in S5 includes the following steps:

(1) calculating the distance between the outermost pixel point of each hierarchical defect and the center of the circle, and storing the distance into a dictionary dists, wherein the key of each key-value pair in the dictionary is (x)i,yi) Angle relative to the center of the circle, the value being (x)i,yi) Distance from the center of the circle;

(2) and (5) sorting the dictionary dists, and drawing a chart to obtain the average distance radius, the maximum value of the distance radius and the corresponding angle of the distance radius.

Compared with the prior art, the invention has the following beneficial effects:

1. according to the invention, after the software module of the Python platform is adopted to process the gray level image of the layered defect, the determination of the circle center of the hole and the corresponding point at the outermost side of the layered defect area and the measurement and calculation of the actual area of the layered defect area are rapidly and accurately determined.

2. The invention can be closer to the actual condition of the layering defect by determining the area of the actual layering defect area, thereby providing a more accurate measurement and evaluation means for the detection, quality control and parameter optimization of the drilling quality.

Drawings

FIG. 1 is a schematic view of a drilled hole delamination defect area.

FIG. 2 is a flow chart of a method for quantitatively detecting a layer defect of a drilled hole.

FIG. 3 is a black and white image of different layered defect regions.

Fig. 4 is a diagram of determining the hole center of a gray scale image of a layered defect.

FIG. 5 is a search graph of the outermost pixels of the hierarchical defect.

Fig. 6 is a schematic diagram of processing results of different layered defect images.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

As shown in fig. 2, the method for quantitatively detecting the delamination defect of the drilled hole according to the present invention comprises the following steps:

s1, carrying out pure black and white on the layered defect gray image obtained by CT scanning through software;

s2, selecting a certain number of continuous sampling points in the center of the image, wherein the sampling points are in the width and height directions with the center of the imageThe distance does not exceed a fixed span, all sampling points are ensured to be positioned in the layered defect, finally all sampling points form a square by taking the image center as the center, and the circle center coordinates (x) of all sampling points are determinedc,yc);

S3, gradually traversing pixel points on the path along the x-axis and y-axis circle centers at four edges of the image one by one, and determining the positions of the outermost pixel points of the layered defects;

and S4, respectively calculating the distance radius and the angle value between each outermost layered defect pixel point and the circle center, thereby determining the area of the actual layered defect area.

As shown in fig. 3, in order to facilitate subsequent processing such as hole center determination, searching for outermost points of the hierarchical regions, and area measurement, pure black and white processing is performed on the hierarchical defect gray image by software in S1, which includes the specific steps of:

(1) introducing an image module of an image processing standard library PIL in a Python platform;

(2) opening a target image and setting a critical gray value;

(3) and performing logic judgment on each pixel point in the image according to the width and the height of the image, changing the gray value of each pixel point into pure white if the gray value is less than or equal to a critical value, and changing the gray value of each pixel point into pure black if the gray value is greater than the critical value.

As shown in fig. 4, to determine the center of the circle, the center coordinates (x) of all the sample points are determined as described in S2c,yc) The method comprises the following specific steps:

(1) taking the width direction of the layered defect image from left to right as the positive direction of an x axis, the leftmost side as 0, the height direction from top to bottom as the positive direction of a y axis and the uppermost side as 0, and selecting the central coordinate of the image as (x)0,y0);

(2) Starting to extend from x0 along the positive direction and the negative direction of the x axis in the sampling point range to each pixel point, carrying out logic judgment until a first pure white pixel point is found, writing the pixel point coordinate into a list inner _ x, stopping the circulation in the x axis direction, and entering the next y coordinate circulation;

(3) starting to extend from y0 along the positive direction and the negative direction of the y axis in the sampling point range to each pixel point, carrying out logic judgment until the first pure white pixel point is found, writing the pixel point coordinate into a list inner _ y, stopping the circulation of the y axis direction, and entering the next circulation of the x coordinate;

(4) sorting the coordinate elements in the list inner _ x according to the y coordinate value, and sorting the coordinate elements in the list inner _ y according to the x coordinate value;

(5) extracting and adding x coordinate values in adjacent coordinate elements (equal y coordinates) in the inner _ x list to obtain a chord length value x in the x-axis direction in the hole wall circles

(6) Calculating xsThe average value is integrated to obtain the coordinate value x of the circle center xc

(7) Extracting and adding y coordinate values in adjacent coordinate elements (equal x coordinates) in the inner _ y list to obtain a chord length value y in the y-axis direction in the hole wall circles

(8) Calculating ys average value and rounding to obtain circle center y coordinate value yc

As shown in fig. 5, the determining the position of the outermost pixel point of the hierarchical defect in S4 specifically includes the following steps:

(1) dividing the layered defect gray image into four areas according to 90 degrees through a horizontal line and a vertical line of the circle center, and clockwise increasing the area with the rightmost side as 0 degree;

(2) and (3) pixel points on the path are gradually traversed from the four edges of the gray level image of the layered defect along the x-axis and the y-axis to the circle center, and the coordinate of the first pure white pixel point searched is the position of the outermost side of the layered defect.

In S5, the calculating of the distance radius and the angle value between each outermost layered defect pixel point and the circle center respectively includes the following steps:

(1) calculating the distance between the outermost pixel point of each hierarchical defect and the center of the circle, and storing the distance into a dictionary dists, wherein the key of each key-value pair in the dictionary is (x)i,yi) Angle relative to the center of the circle, the value being (x)i,yi) Distance from the center of the circle;

(2) sorting the dictionaries dists, and drawing a chart to obtain an average distance radius, a maximum distance radius value and a corresponding angle of the maximum distance radius value; in the Python platform, the keys of the dictionary have uniqueness, but the values corresponding to different keys can be the same, so that the corresponding points of each key value pair in the dists dictionary are not repeated;

(3) as shown in fig. 6, graphs are prepared based on the statistical results, and the average distance radius, the maximum distance radius value, and the corresponding angle are read from the graphs.

It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:非破坏检查装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类