A kind of Weld pipe mill coordinate detection method based on region iteration

文档序号:1756787 发布日期:2019-11-29 浏览:15次 中文

阅读说明:本技术 一种基于区域迭代的焊缝中心坐标检测方法 (A kind of Weld pipe mill coordinate detection method based on region iteration ) 是由 刘洪飞 田应仲 李龙 于 2019-08-12 设计创作,主要内容包括:本发明涉及一种基于区域迭代的焊缝中心坐标检测方法,过程包括图像采集,区域设定,区域内图像处理和区域迭代。通过相机拍摄焊缝的单张图片,将图片传输到工业计算机处理数据,得到焊缝的坐标位置。通过对区域依次进行灰度处理,中值滤波,自适应阈值分割和焊缝中心坐标提取等算法处理精确得到单个区域内的焊缝中心坐标。本方法将图像处理计算集中于焊缝周围的一个个区域内,可以去除大量影响焊缝坐标提取精度的噪声点,同时提高焊缝坐标的识别精度。本发明适用于对接焊缝坐标的检测。(The present invention relates to a kind of Weld pipe mill coordinate detection method based on region iteration, process includes Image Acquisition, and region is set, image procossing and region iteration in region.Picture transfer to industrial computer is handled data, obtains the coordinate position of weld seam by the single picture that weld seam is shot by camera.By successively carrying out gray proces, median filtering to region, adaptive threshold fuzziness and Weld pipe mill coordinate extract scheduling algorithm and handle the Weld pipe mill coordinate being accurately obtained in single region.This method concentrates on image procossing calculating in the region one by one around weld seam, can remove a large amount of noise spots for influencing weld seam coordinate extraction accuracy, while improving the accuracy of identification of weld seam coordinate.The present invention is suitable for the detection of butt weld coordinate.)

1. a kind of Weld pipe mill coordinate detection method based on region iteration, including Image Acquisition, region setting, regional processing and Four steps of region iteration, which is characterized in that specific step is as follows:

Step 1, Image Acquisition: camera is mounted on right above workbench, weld image is shot by camera, by weld image Industrial computer is transferred to be handled;

Step 2, region are set: being set first, the upper left corner pixel of weld image as coordinate origin, be horizontally to the right x-axis Direction is y-axis direction downwards;A region is set on picture, shape is an a length of h, and width is the rectangle of w, the length of rectangle It is adjusted correspondingly with width according to the size of weld seam;The position set by moving area guarantees that first region is located at weldering It stitches around starting point and includes complete weld seam;Set region is expressed as [x0,y0, w, h], wherein x0And y0It is region respectively The upper left corner abscissa and ordinate;

Regional processing: step 3 successively carries out image gray processing, median filtering, adaptive threshold fuzziness in the region of setting Image processing method;It is two-value by image segmentation in region since the gray value of weld seam and weldment is variant in the picture Image, weld seam part gray value 255 indicate that rest part gray value 0 indicates, using grey scale centre of gravity method, press in region From top to bottom, from left to right successively scanned for by sequence, it is each arrange need to extract the column all gray values be 255 point simultaneously The center point coordinate of the column is obtained by gravity model appoach;It is denoted asIt is searched for by column, successively extracts center all in region Point;

Step 4, region iteration: after the completion of the Weld pipe mill coordinate in single region extracts, by the last one seat in the region Starting point of the punctuate as next coordinate points;

Wherein:Indicate the weld seam barycentric coodinates of i-th column in m-th of region,Indicate the m+1 region The 0th column weld seam barycentric coodinates;The m+1 region withRelationship pass through following formula determine:

By the centre coordinate for whether successfully obtaining weld seam in each region and region, whether iteration successfully judges whether to reach To the terminal of weld seam, whole Weld pipe mill coordinate identification is completed;When single picture reaches weld seam terminal, the sum of the grayscale values week of workpiece The gray value enclosed does not have significant difference, causes Weld pipe mill coordinate that cannot successfully obtain, and iteration failure is considered as and reaches weld seam end Point.

Technical field

The present invention relates to butt weld coordinate measurement technical fields, and in particular to a kind of Weld pipe mill based on region iteration Coordinate detection method.

Background technique

In welding automatization technology field, welding track is planned not only to technical staff by off-line teaching programming There is higher operation level requirement that can also take a substantial amount of time.The cost of this planning is for large-scale production line can be with Receive, but is unreasonable for the planning of middle-size and small-size welding track.The trajectory planning of middle-size and small-size welding product has welding The features such as track is changeable, product diversity.Once scheduled track changes or the location of workpiece put it is incorrect, it is necessary to weight New teaching programming.

The features such as visual sensor has abundant information, contactless, low-loss.Welding image is shot by camera to be transferred to Industrial computer is handled to obtain the coordinate of weld seam.Current welding image Processing Algorithm is directed to whole picture or partial zones Domain carry out image procossing, a large amount of calculation amount be all used for how denoising, characteristics of weld seam is preferably embodied from image. The problems such as it is computationally intensive that this will cause algorithm, algorithm inadequate robust is poor so as to cause Weld pipe mill coordinate accuracy of identification.It needs The accuracy of identification of algorithm is improved while a kind of image processing algorithm reduction algorithm process time.

Summary of the invention

In view of the problems of the existing technology, the purpose of the present invention is to provide a kind of Weld pipe mills based on region iteration Coordinate detection method, solve to carry out image procossing to whole picture or regional area in above-mentioned Weld pipe mill coordinate extraction process and It not can effectively solve the problem of reducing the processing time while improving weld seam extraction accuracy.

In order to achieve the above objectives, the present invention adopts the following technical scheme:

A kind of Weld pipe mill coordinate detection method based on region iteration, including Image Acquisition, region setting, regional processing It is specific as follows with four steps of region iteration:

Step 1, Image Acquisition: camera is mounted on right above workbench, weld image is shot by camera, by weld seam Image transmitting is handled to industrial computer;

Step 2, region are set: set first, the upper left corner pixel of weld image as coordinate origin, horizontally to the right for X-axis direction is y-axis direction downwards;A region is set on picture, shape is an a length of h, and width is the rectangle of w, rectangle Long and width is adjusted correspondingly according to the size of weld seam;The position set by moving area, guarantees that first region is located at It around weld seam starting point and include complete weld seam;Set region is expressed as [x0,y0, w, h], wherein x0And y0It is area respectively The abscissa and ordinate in the upper left corner in domain;

Regional processing: step 3 successively carries out image gray processing, median filtering, adaptive threshold in the region of setting The image processing method of segmentation;Since the gray value of weld seam and weldment is variant in the picture, it is by image segmentation in region Bianry image, weld seam part gray value 255 indicates that rest part gray value 0 indicates, using grey scale centre of gravity method, in region Interior from left to right successively to scan for by sequence by from top to bottom, all gray values that each column need to extract the column are 255 It puts and passes through gravity model appoach and obtain the center point coordinate of the column;It is denoted asIt searches for, successively extracts all in region by column Central point;

Step 4, region iteration: after the completion of the Weld pipe mill coordinate in single region extracts, by last in the region Starting point of a coordinate points as next coordinate points;

Wherein:Indicate the weld seam barycentric coodinates of i-th column in m-th of region,Indicate m+1 The weld seam barycentric coodinates of 0th column in region;The m+1 region withRelationship pass through following formula determine:

By whether successfully obtained in each region weld seam centre coordinate and region whether iteration successfully judge be The no terminal for reaching weld seam completes whole Weld pipe mill coordinate identification;When single picture reaches weld seam terminal, the gray value of workpiece There is no significant difference with the gray value of surrounding, cause Weld pipe mill coordinate that cannot successfully obtain, iteration failure is considered as and reaches weldering Stitch terminal.

Compared with prior art, the Weld pipe mill coordinate detection method of the present invention based on region iteration, exist with Lower advantage:

By the method for region iteration, only the fraction region around processing welding lines, the region of image procossing become smaller, and reduce The operation of weld beam shape reduces the processing result image output time.It is smaller that image processing method is applied to weld seam Range areas in, can largely avoid such as scratch, the noise jammings such as spot, improve the accuracy of identification of Weld pipe mill coordinate.

Detailed description of the invention

Fig. 1 is the flow chart of Weld pipe mill coordinate detection method.

Fig. 2 is the experiment porch of Weld pipe mill coordinate detection method.

Fig. 3 is the bianry image in single region.

Fig. 4 is region alternative manner schematic diagram.

Specific embodiment

Specific embodiments of the present invention are described in detail with reference to the accompanying drawing.

As shown in Figure 1, a kind of Weld pipe mill coordinate detection method based on region iteration, including Image Acquisition, region are set It is fixed, four steps of regional processing and region iteration, the specific steps are as follows:

Step 1, Image Acquisition: camera is mounted on right above workbench, weld image is shot by camera, by weld seam Image transmitting is handled to industrial computer;

Step 2, region are set: set first, the upper left corner pixel of weld image as coordinate origin, horizontally to the right for X-axis direction is y-axis direction downwards;A region is set on picture, shape is an a length of h, and width is the rectangle of w, rectangle Long and width is adjusted correspondingly according to the size of weld seam;The position set by moving area, guarantees that first region is located at It around weld seam starting point and include complete weld seam;Set region is expressed as [x0,y0, w, h], wherein x0And y0It is area respectively The abscissa and ordinate in the upper left corner in domain;

Regional processing: step 3 successively carries out image gray processing, median filtering, adaptive threshold in the region of setting The image processing method of segmentation;Since the gray value of weld seam and weldment is variant in the picture, it is by image segmentation in region Bianry image, weld seam part gray value 255 indicates that rest part gray value 0 indicates, using grey scale centre of gravity method, in region Interior from left to right successively to scan for by sequence by from top to bottom, all gray values that each column need to extract the column are 255 It puts and passes through gravity model appoach and obtain the center point coordinate of the column;It is denoted asIt searches for, successively extracts all in region by column Central point;

Step 4, region iteration: after the completion of the Weld pipe mill coordinate in single region extracts, by last in the region Starting point of a coordinate points as next coordinate points;

Wherein:Indicate the weld seam barycentric coodinates of i-th column in m-th of region,Indicate m+1 The weld seam barycentric coodinates of 0th column in region;The m+1 region withRelationship pass through following formula determine:

By whether successfully obtained in each region weld seam centre coordinate and region whether iteration successfully judge be The no terminal for reaching weld seam completes whole Weld pipe mill coordinate identification;When single picture reaches weld seam terminal, the gray value of workpiece There is no significant difference with the gray value of surrounding, cause Weld pipe mill coordinate that cannot successfully obtain, iteration failure is considered as and reaches weldering Stitch terminal.

The specific implementation process of the method for the present invention is as follows:

As shown in Fig. 2, weldment is placed on workbench, the surface that camera is fixed on weldment carries out image and adopts Collection, by image transmitting to industrial computer.

After obtaining welding image, first region is set in picture.Zone set points are the square of 20 × 20 pixel sizes Shape indicates are as follows: [x0,y0,w,h].The size can include the width size of weld seam substantially, and actual size can be according to weld width Simple adjustment is done with image resolution ratio.

Figure gray processing, median filtering are successively carried out in region, adaptive threshold fuzziness only divides the rectangular area For bianry image, as shown in Figure 3.Weld seam part gray value 255 indicates that rest part gray value 0 indicates, utilizes gray scale weight Heart method extracts the Weld pipe mill coordinate of each column in regionWeld seam has certain width, after regional processing To the centre coordinate for being weld seam.After the completion of Weld pipe mill coordinate in single region extracts, by the last one seat in the region Starting point of the punctuate as next coordinate points:

Successively iteration from left to right, is illustrated in figure 4 iteration direction and iterative process.

When single picture reaches weld seam terminal, the gray value around the sum of the grayscale values of workpiece does not have significant difference, causes to weld Seam centre coordinate cannot be obtained successfully, and iteration failure is considered as and reaches weld seam terminal.Complete Weld pipe mill coordinate in the image It extracts.

The present invention is suitable for butt weld type, including but not limited to straight bead type, sawtooth weld seam and curved welding seam.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于TOF相机的栈板位姿确定方法、装置及计算机可读存储介质

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!