CN109934839A - A kind of workpiece inspection method of view-based access control model - Google Patents

A kind of workpiece inspection method of view-based access control model Download PDF

Info

Publication number
CN109934839A
CN109934839A CN201910174178.0A CN201910174178A CN109934839A CN 109934839 A CN109934839 A CN 109934839A CN 201910174178 A CN201910174178 A CN 201910174178A CN 109934839 A CN109934839 A CN 109934839A
Authority
CN
China
Prior art keywords
workpiece
image
detection
camera
edge
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.)
Pending
Application number
CN201910174178.0A
Other languages
Chinese (zh)
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.)
Beijing University of Technology
Original Assignee
Beijing University of Technology
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 Beijing University of Technology filed Critical Beijing University of Technology
Priority to CN201910174178.0A priority Critical patent/CN109934839A/en
Publication of CN109934839A publication Critical patent/CN109934839A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a kind of workpiece inspection methods of view-based access control model, demarcate to industrial camera.Workpiece is placed into detection zone, is taken pictures using workpiece of the camera to detection zone, obtains workpiece in the original image of detection zone.Denoising is filtered to original image.Using iterative method by image binaryzation.Detection zone in the picture obtains workpiece multiple groups cross, vertical dimension data using edge detection principle.The detection at edge can be as accurate as unit pixel, so being also a unit pixel point using the precision that the method detects, precision is high.If two edges are more than the standard size of workpiece on same detector bar, can be determined that owe processing;On the contrary, if the distance at two edges is less than gauged distance, it can be assumed that measuring the defect part for workpiece;If the distance of two edges is equal to gauged distance or in the error range of permission, it is qualified that workpiece is considered as detection.This method can help enterprise to reduce production cost, push the raising of production automation rate.

Description

A kind of workpiece inspection method of view-based access control model
Technical field
The present invention relates to a kind of detection methods that the machine vision for workpiece defect is combined with image recognition, are suitable for Occasion more particularly to a kind of workpiece inspection method of view-based access control model of various workpiece automation processing and detection.
Background technique
As manufacturing automatization level is being continuously improved, more and more factories start to introduce automatic production line, The automated production of workpiece gradually replaces old artificial production, and production efficiency also greatly improves therewith.But in workpiece Automation processing after its size whether meet regulation, again or whether occur defect and process it is not in place the problems such as, at present major part Or using compare foozle's work sampling observation mode, there are low efficiency, accuracy is low, randomness is big the problems such as so that every production Product cannot obtain absolutely quality assurance.This detection mode is increasingly difficult to meet product quality and require to step up The market demand.
Meet more harsh market demands to improve the yields of product warehouse-out, is badly in need of a kind of high-efficient, accuracy It is high, practicability is big, low-cost workpiece automatic testing method, improve the yields and the quality of production of enterprise.Meanwhile also to pushing away The upgrading of dynamic China's manufacturing industry has great importance.
Summary of the invention
It is an object of the invention to: it is led for artificial sampling observation is carried out to product workpiece during existing automated production The problems such as production efficiency of cause is low, accuracy is poor, randomness is big provides a kind of workpiece defect based on machine vision and processing not The detection method of situation in place is realized and is detected to the real-time online high-precision of workpiece, and can be adapted for most of machinings Part.It helps enterprise to reduce production cost, pushes the raising of production automation rate.
In order to solve the problems, such as that technique described above, the present invention provide a kind of workpiece inspection method of view-based access control model, the party The realization step of method is specific as follows:
S1 demarcates industrial camera.First camera must be demarcated before in detection system, purpose has two: Firstly, the inside and outside parameter of camera is obtained by calibration, to eliminate camera lens and other components to caused by acquisition image Radial distortion, it is ensured that the accuracy of the acquired image of camera;Secondly, converting world coordinates for camera coordinates system by demarcating System, finds the actual physics distance in the pixel equivalent and image of camera between any two points.
Workpiece is placed detection zone by S2, is taken pictures using workpiece of the camera to detection zone, is obtained workpiece and is being detected The original image in region.
S3 is filtered denoising to original image.Made in image due to the bounce of each pixel of the sensor of camera There are a large amount of noises, so that image brings the data much mixed in processing, while the edge of work is relatively not clear enough.Cause This needs to introduce 2-d gaussian filters device and is filtered to original image:
(x, y) is the pixel coordinate point in image in formula (1), and σ is the variance yields of x.
S4 uses iterative method by image binaryzation.Color image after denoising is converted into only black, white two kinds of colors Image, to remove most useless region in picture and retain interest region.
An initial threshold T (j) is selected first, usually can choose the average gray value of general image as initial threshold Value.J is the number of iterations, j=0. when initial
With T (j) segmented image, two regions are divided the image intoWith
In the average gray value for calculating two regions, whereinFor iteration j time domain C1And C2Pixel Number, f (x, y) indicate the gray value of (x, y) point in image.
Then threshold value is recalculated, it may be assumed that
J=j+1 is enabled, above two steps is repeated and calculates, until the difference of T (j+1) and T (j) reach maximum less than defined threshold or j The number of iterations.
The detection zone of S5 in the picture obtains workpiece multiple groups cross, vertical dimension data using edge detection principle.This step Particular content are as follows: first in a plurality of horizontal, the vertical detector bar of the workpiece sensing region of picture setting, the setting of detector bar number is more, It is then bigger to workpiece cross, the detection density of longitudinal direction;Each detector bar is a line segment with detection limbic function, is led to Start edge and terminating edge that detection is located at workpiece on the line segment are crossed, the length of workpiece on the line segment is further calculated out, from And calculate whether the part workpiece defect or deficient machining state occurs;The detection function at edge is located at the line segment by calculating The amplitude situation of change of upper pixel gray level finally determines the side of workpiece to judge whether the step phenomenon for gray scale occur Edge.
Pixel is calculated first in the gradient magnitude in the direction x and the direction y:
Further obtain amplitude and the direction of image gradient:
Work as amplitudeWhen reaching preset value, it is just regarded as the one edge at Gray step and Gray step for workpiece. The detection at edge is accurate to unit pixel, so being also a unit pixel point using the precision that the method detects, precision is high.
The complete detection to workpiece may be implemented in more intensive detector bar, if two edges are more than on same detector bar The standard size of workpiece then can be determined that owe processing;On the contrary, assert if the distance at two edges is less than gauged distance Measure the defect part for workpiece;If the distance of two edges is equal to gauged distance or in the error range of permission, workpiece It can be considered that detection is qualified.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of the workpiece inspection method of view-based access control model of the present invention.
Fig. 2 is the composition explanation of acquisition image of the invention.Entire image is obtained by video camera, in the fixed bit of image Detection zone is installed, the workpiece in region is measured, is detected comprising a plurality of horizontal, vertical detector bar in detection zone.
Specific embodiment
Following is a specific embodiment of the present invention in conjunction with the accompanying drawings, technical scheme of the present invention will be further described, However, the present invention is not limited to these examples.
It is also understood that specific embodiment described herein is used only for understanding the present invention, it is not used to limit this hair It is bright.
The target image that the present invention is handled derives from the industrial camera of industrial robot, and the industrial camera is for detecting production Workpiece on line.
As shown in Figure 1, a kind of workpiece inspection method of view-based access control model proposed by the present invention, comprising the following steps:
Step 1: carrying out optical calibrating to camera first, first camera must be demarcated before in system.It is connecting The image of industrial camera can be read after industrial camera and computer, but image at this time has more serious distortion and produces Raw, the main source of this distortion has error brought by the distortion of optics module bring and sensor foozle of camera lens. In order to eliminate error, it is necessary to be demarcated to camera, the checkerboard calibration plate of standard is shot by camera, while repeatedly transformation mark The distance between fixed board and camera and angle then obtain the inside and outside parameter of camera to correct image, make the figure of camera shooting Picture more standard.Relationship between pixel and actual physical size can be found by calibration simultaneously, further to utilize image Workpiece is measured, detects and carries out place mat preparation.
Step 2: more accurately image can be shot by calibrated camera, can carry out to workpiece at this time Shoot work.Workpiece on production line is placed in detection zone by certain mode, rear camera is placed and workpiece is carried out certainly It is dynamic to take pictures, obtain the image information of workpiece.
Step 3: can't directly be used after the image of shooting finished piece(s), because there are hesitation sensing datas in image The much noise points that bounce two generates, especially in the insufficient situation of illumination, the noise meeting that is determined by digital camera characteristic It is a large amount of to occur in the picture.It is long there are some tiny textures or stain on the surface of workpiece simultaneously, influence the later period Visual determination and graphics process.The above noise spot has seriously affected the quality of picture, increases to image a large amount of useless Data or interference data, have upset the effective information in image, bring greatly shadow with detection to the measurement of subsequent workpiece size It rings.
It needs to be filtered figure thus, removes the noise spot in image.Traditional Gaussian filter is usually used in The filtering processing of signal removes the jitter noise in waveform signal, is a kind of for handling the filter type of one-dimensional signal.It will One-dimensional Gaussian filter is expanded to two-dimensional surface, and not only the signal of simple consideration x-axis, needs to handle the letter of x-axis and y-axis simultaneously Number, it is calculated by the data to two above dimension, crosses the mutation noise in filter data:
(x, y) is the pixel coordinate point in image in formula, and σ is the variance yields of x
Step 4: by the color image binaryzation after denoising.Binaryzation can greyscale image transitions at bianry image, Pixel grey scale greater than some threshold grey scale value is set as gray scale maximum, and it is minimum that the pixel grey scale for being less than this value is set as gray scale Value, to realize binaryzation.According to the difference that threshold value is chosen, the algorithm of binaryzation is divided into fixed threshold and adaptive threshold.Than More common binarization method then has: Two-peak method, P parametric method, iterative method and OTSU method etc..The different calculated thresholds of algorithm institute Value would also vary from, to removed in image useless region and retain interest region effect it is different.The present invention is in order to retain work The complete profile information of part, using the preferable iterative method of effect:
An initial threshold T (j) is selected first, usually can choose the average gray value of general image as initial threshold Value.J is the number of iterations, j=0. when initial
With T (j) segmented image, two regions are divided the image intoWith
Above-mentioned formula is in the average gray value for calculating two regions.WhereinFor iteration j time domain C1And C2 Pixel number, f (x, y) indicate image in (x, y) point gray value.
Then threshold value is recalculated, it may be assumed that
J=j+1 is enabled, above two steps is repeated and calculates, until the difference of T (j+1) and T (j) reach maximum less than defined threshold or j The number of iterations.
Step 5: measuring, detecting to workpiece.As shown in Fig. 2, the present invention is equipped with detection zone in the picture, at this Region obtains workpiece multiple groups cross, vertical dimension data using edge detection principle.The particular content of this step are as follows: first in picture A plurality of horizontal, the vertical detector bar of workpiece sensing region setting, the setting of detector bar number is more, then close to workpiece cross, the detection of longitudinal direction It spends bigger;Each detector bar is a line segment with detection limbic function, is located at workpiece on the line segment by detecting Start edge and terminating edge further calculate out the length of workpiece on the line segment, are so as to calculate the part workpiece It is no defect or deficient machining state occur;The detection function at edge is located at the amplitude change of pixel gray level on the line segment by calculating Change situation to judge whether the step phenomenon for gray scale occur, finally determines the edge of workpiece.
Pixel is calculated first in the gradient magnitude in the direction x and the direction y:
Further obtain amplitude and the direction of image gradient:
Work as amplitudeWhen reaching preset value, so that it may be regarded as a line at Gray step and Gray step for workpiece Edge.The coordinate that its point is recorded after algorithm detects one edge on detector bar, continues thereafter with and carries out edge on detector bar Search, its coordinate is recorded when searching Article 2 edge.Two edges detected by it can be considered as two sides of bow and arrow The pixel distance for obtaining workpiece is subtracted each other on boundary by the coordinate of two edges, by the full-size(d) that can calculate workpiece after conversion. The detection at edge can be as accurate as unit pixel, so being also a unit pixel point, precision using the precision that the method detects It is high.
The complete detection to workpiece may be implemented in more intensive detector bar, if two edges are more than on same detector bar The standard size of workpiece then can be determined that owe processing;On the contrary, if the distance at two edges is less than gauged distance, it can be with Assert the defect part measured as workpiece;If the distance of two edges is equal to gauged distance or in the error range of permission, Workpiece can be considered that detection is qualified.

Claims (2)

1. a kind of workpiece inspection method of view-based access control model, it is characterised in that: the realization step of this method is specific as follows,
S1 demarcates industrial camera;First camera must be demarcated before in detection system;
Workpiece is placed detection zone by S2, is taken pictures using workpiece of the camera to detection zone, obtains workpiece in detection zone Original image;
S3 is filtered denoising to original image;Make to exist in image due to the bounce of each pixel of the sensor of camera A large amount of noise, so that image brings the data much mixed in processing, while the edge of work is relatively not clear enough;Therefore it needs 2-d gaussian filters device is introduced to be filtered original image:
(x, y) is the pixel coordinate point in image, and σ is the variance yields of x;
S4 uses iterative method by image binaryzation;Color image after denoising is converted to the image of only black, white two kinds of colors, To remove most useless region in picture and retain interest region;
An initial threshold T (j) is selected first, selects the average gray value of general image as initial threshold;J is iteration time Number, j=0 when initial;
With T (j) segmented image, two regions are divided the image intoWith
In the average gray value for calculating two regions, whereinFor iteration j time domain C1And C2Pixel number, F (x, y) indicates the gray value of (x, y) point in image;
Then threshold value is recalculated, it may be assumed that
J=j+1 is enabled, is computed repeatedly, until the difference of T (j+1) and T (j) reach maximum the number of iterations less than defined threshold or j;
The detection zone of S5 in the picture obtains workpiece multiple groups cross, vertical dimension data using edge detection principle;First in picture A plurality of horizontal, the vertical detector bar of workpiece sensing region setting, the setting of detector bar number is more, then horizontal to workpiece, longitudinal direction detection Density is bigger;Each detector bar is a line segment with detection limbic function, is located at workpiece on the line segment by detection Start edge and terminating edge, the length of workpiece on the line segment is further calculated out, to whether calculate the part workpiece There is defect or deficient machining state;The detection function at edge is located at the amplitude variation of pixel gray level on the line segment by calculating Situation finally determines the edge of workpiece to judge whether the step phenomenon for gray scale occur;
Pixel is calculated first in the gradient magnitude in the direction x and the direction y:
Further obtain amplitude and the direction of image gradient:
Work as amplitudeWhen reaching preset value, it is just regarded as the one edge at Gray step and Gray step for workpiece;Edge Detection be accurate to unit pixel;
Intensive detector bar is able to achieve the complete detection to workpiece, if two edges are more than the standard of workpiece on same detector bar Size is then judged to owing processing;On the contrary, assert if the distance at two edges is less than gauged distance and measuring lacking for workpiece Damage part;If the distance of two edges is equal to gauged distance or in the error range of permission, it is qualified that workpiece is considered as detection.
2. a kind of workpiece inspection method of view-based access control model according to claim 1, it is characterised in that: used in detection system Before first camera must be demarcated, firstly, by calibration obtain camera inside and outside parameter, thus eliminate camera lens and its His component is to radial distortion caused by acquisition image, it is ensured that the accuracy of the acquired image of camera;Secondly, will by calibration Camera coordinates system is converted into world coordinate system, find actual physics in the pixel equivalent and image of camera between any two points away from From.
CN201910174178.0A 2019-03-08 2019-03-08 A kind of workpiece inspection method of view-based access control model Pending CN109934839A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910174178.0A CN109934839A (en) 2019-03-08 2019-03-08 A kind of workpiece inspection method of view-based access control model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910174178.0A CN109934839A (en) 2019-03-08 2019-03-08 A kind of workpiece inspection method of view-based access control model

Publications (1)

Publication Number Publication Date
CN109934839A true CN109934839A (en) 2019-06-25

Family

ID=66986641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910174178.0A Pending CN109934839A (en) 2019-03-08 2019-03-08 A kind of workpiece inspection method of view-based access control model

Country Status (1)

Country Link
CN (1) CN109934839A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110533731A (en) * 2019-08-30 2019-12-03 无锡先导智能装备股份有限公司 The scaling method of camera resolution and the caliberating device of camera resolution
CN111964549A (en) * 2020-07-08 2020-11-20 航天科工防御技术研究试验中心 Detection method for judging defect of large-volume monolithic capacitor
CN112581473A (en) * 2021-02-22 2021-03-30 常州微亿智造科技有限公司 Method for realizing surface defect detection gray level image positioning algorithm

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102538672A (en) * 2011-12-16 2012-07-04 中北大学 CMOS (complementary metal-oxide-semiconductor)-machine-vision-based component size measuring system and measurement test method
CN103292701A (en) * 2013-06-24 2013-09-11 哈尔滨工业大学 Machine-vision-based online dimensional measurement method of precise instrument
CN105352449A (en) * 2015-09-17 2016-02-24 中北大学 Measurement system of shape and overall size of part on the basis of machine vision and measurement testing method of shape and overall size of part on the basis of machine vision

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102538672A (en) * 2011-12-16 2012-07-04 中北大学 CMOS (complementary metal-oxide-semiconductor)-machine-vision-based component size measuring system and measurement test method
CN103292701A (en) * 2013-06-24 2013-09-11 哈尔滨工业大学 Machine-vision-based online dimensional measurement method of precise instrument
CN105352449A (en) * 2015-09-17 2016-02-24 中北大学 Measurement system of shape and overall size of part on the basis of machine vision and measurement testing method of shape and overall size of part on the basis of machine vision

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
廖维: ""基于机器视觉的工件加工尺寸在线测量方法与系统研究"", 《中国优秀硕士学位论文全文数据库信息科技辑》 *
杨光: ""基于机器视觉的精密零件尺寸检测关键技术研究"", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110533731A (en) * 2019-08-30 2019-12-03 无锡先导智能装备股份有限公司 The scaling method of camera resolution and the caliberating device of camera resolution
CN111964549A (en) * 2020-07-08 2020-11-20 航天科工防御技术研究试验中心 Detection method for judging defect of large-volume monolithic capacitor
CN112581473A (en) * 2021-02-22 2021-03-30 常州微亿智造科技有限公司 Method for realizing surface defect detection gray level image positioning algorithm
CN112581473B (en) * 2021-02-22 2021-05-18 常州微亿智造科技有限公司 Method for realizing surface defect detection gray level image positioning algorithm

Similar Documents

Publication Publication Date Title
CN109934839A (en) A kind of workpiece inspection method of view-based access control model
CN109141232B (en) Online detection method for disc castings based on machine vision
Shahabi et al. Noncontact roughness measurement of turned parts using machine vision
CN109003258B (en) High-precision sub-pixel circular part measuring method
Lim et al. Edge detection and measurement of nose radii of cutting tool inserts from scanned 2-D images
CN109060836B (en) Machine vision-based high-pressure oil pipe joint external thread detection method
CN108132017B (en) Planar weld joint feature point extraction method based on laser vision system
CN110458785B (en) Magnetic levitation ball levitation gap detection method based on image sensing
CN110672007A (en) Workpiece surface quality detection method and system based on machine vision
CN110675376A (en) PCB defect detection method based on template matching
CN102496161A (en) Method for extracting contour of image of printed circuit board (PCB)
CN107036560B (en) The Surface Roughness Detecting Method of optical glass accurate grinding processing
Fu et al. Medicine glass bottle defect detection based on machine vision
CN108629775B (en) Thermal state high-speed wire rod surface image processing method
CN110544235A (en) Flexible circuit board image area identification method based on differential geometry
CN107796826B (en) Micro duplicate gear broken tooth defect detection method based on tooth center distance curve analysis
CN111062940A (en) Screw positioning and identifying method based on machine vision
Li et al. The detection and sorting system design of three-dimensional size
JP6620477B2 (en) Method and program for detecting cracks in concrete
CN108416790A (en) A kind of detection method for workpiece breakage rate
CN108844469B (en) Method and system for testing workpiece step height based on laser
Chao et al. Parameters of small pitch thread measured by an intelligent detection method
CN110021027B (en) Edge cutting point calculation method based on binocular vision
Songwen et al. Woodworking Saw Blade Size Detection System Based on Machine Vision
Yeong et al. Measurement of nose radii of multiple cutting tool inserts from scanned images using sub-pixel edge detection

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