CN112893172A - Gasket size detection system and method based on machine vision, processing terminal and medium - Google Patents

Gasket size detection system and method based on machine vision, processing terminal and medium Download PDF

Info

Publication number
CN112893172A
CN112893172A CN202110064061.4A CN202110064061A CN112893172A CN 112893172 A CN112893172 A CN 112893172A CN 202110064061 A CN202110064061 A CN 202110064061A CN 112893172 A CN112893172 A CN 112893172A
Authority
CN
China
Prior art keywords
gasket
detection
camera
station
size
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
CN202110064061.4A
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.)
Fitow Tianjin Detection Technology Co Ltd
Original Assignee
Fitow Tianjin Detection 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 Fitow Tianjin Detection Technology Co Ltd filed Critical Fitow Tianjin Detection Technology Co Ltd
Priority to CN202110064061.4A priority Critical patent/CN112893172A/en
Publication of CN112893172A publication Critical patent/CN112893172A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B07SEPARATING SOLIDS FROM SOLIDS; SORTING
    • B07CPOSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
    • B07C5/00Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
    • B07C5/04Sorting according to size
    • B07C5/10Sorting according to size measured by light-responsive means
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B07SEPARATING SOLIDS FROM SOLIDS; SORTING
    • B07CPOSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
    • B07C5/00Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
    • B07C5/02Measures preceding sorting, e.g. arranging articles in a stream orientating
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B07SEPARATING SOLIDS FROM SOLIDS; SORTING
    • B07CPOSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
    • B07C5/00Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
    • B07C5/36Sorting apparatus characterised by the means used for distribution
    • B07C5/361Processing or control devices therefor, e.g. escort memory
    • B07C5/362Separating or distributor mechanisms
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B07SEPARATING SOLIDS FROM SOLIDS; SORTING
    • B07CPOSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
    • B07C5/00Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
    • B07C5/36Sorting apparatus characterised by the means used for distribution
    • B07C5/363Sorting apparatus characterised by the means used for distribution by means of air
    • B07C5/365Sorting apparatus characterised by the means used for distribution by means of air using a single separation means
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B07SEPARATING SOLIDS FROM SOLIDS; SORTING
    • B07CPOSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
    • B07C5/00Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
    • B07C5/36Sorting apparatus characterised by the means used for distribution
    • B07C5/38Collecting or arranging articles in groups

Landscapes

  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a system, a method, a processing terminal and a medium for detecting the size of a gasket based on machine vision, and relates to the technical field of gasket quality detection and visual optical design. In order to solve the problems that unqualified products cannot be removed in real time, random angle detection cannot be performed, and the problems of increased labor intensity and high maintenance cost in the prior art cannot be caused in practical production in the prior art, the number of products in an image is judged, and products at specific positions are selected for affine transformation to remove background interference; secondly, positioning the gasket to be detected, and extracting the outline of the measured position of the gasket to be detected; and finally, calculating the actual size of the gasket to be detected according to the proportional relation between the visual field range of the image acquisition equipment and the image pixels. The invention avoids the problem of light interference with noise; the camera size detection is used for detecting the random placement direction of the workpiece and the random placement direction of the workpiece in the collected image, and the position and angle of a detected object are corrected by utilizing an algorithm, so that the problem of feeding consistency is solved.

Description

Gasket size detection system and method based on machine vision, processing terminal and medium
Technical Field
The invention relates to the technical field of gasket quality detection and visual optical design, in particular to a system and a method for detecting gasket size based on machine vision, a processing terminal and a medium. In particular to a system which can realize image acquisition and quality detection of gasket products through optical design.
Background
At present, the gasket is refined from a high-precision and high-hardness sheet material and is generally used for adjustment and measurement of a precision die or precision hardware. After production is completed, the product passes through the cleaning station and is conveyed to the detection position by the conveyor belt. In order to ensure the smooth production of the product, the quality of each gasket needs to be accurately detected.
The method comprises the following detection items:
type of detection Unit of Detection accuracy Position of
Outer diameter Millimeter 0.01mm Front side
Inner diameter Millimeter 0.01mm Front side
Pitch diameter Millimeter 0.01mm Front side
Width of Millimeter 0.01mm Front side
Distance between openings Millimeter 0.01mm Front side
Opening angle Degree of rotation 0.5° Front side
Small opening circle radius Millimeter 0.01mm Front side
Thickness of Millimeter 0.01mm Side surface
However, the conventional size detection means, such as calipers, gauges, contourgraph and three-coordinate, play an important role in industrial production, but with the development and progress of modern industry, particularly high-precision industry, the conventional detection method cannot meet the production requirement, and the measurement means, such as calipers and gauges, has less detection data and low precision. Although the detection means such as a contourgraph and a three-coordinate system have high precision, the detection can only be carried out in a specific environment and out of a production line, the detection speed is low, the requirement on the level of an operator is high, and the detection method does not accord with the requirements on online detection and real-time monitoring required by modern industry.
Therefore, there is a need for a vision system for pad size detection that can be automated to reduce labor intensity, maintenance costs, and potential risks; the shooting precision and the detection speed are improved.
Through the above analysis, the problems and defects of the prior art are as follows:
(1) in the prior art, the size of each gasket produced on the production line cannot be measured efficiently, quickly and accurately, and unqualified products cannot be removed in real time.
(2) In the prior art, the placing directions of the gaskets are uniform, random angle detection cannot be performed, and the gasket cannot be adapted to actual production, so that the labor intensity is increased and the maintenance cost is high in the prior art.
(3) In the prior art, the manual detection detects the same piece according to different people, and the results are different due to different detection methods, force, proficiency and fatigue degrees, so that the detection data is inaccurate, and false detection and missed detection are easily caused.
(4) In the prior art, automatic detection cannot be completely realized, the inspection process needs manual participation, and the labor cost is increased.
The difficulty in solving the above problems and defects is:
(1) because it is fast to detect, when the product moved to the rejection station, the product detected the data that the station had already examined several pieces, leads to rejecting the data that the station can't the every piece of one-to-one, leads to the phenomenon of mistake kicking. The unique ID number needs to be set for each workpiece on the glass rotary disc, the detection data follows the ID number, and when the workpieces need to be removed, the ID numbers of the products need to be provided are sent, so that the workpieces can be accurately removed.
(2) The shapes of the gaskets are different, the detection positions of the gaskets with special shapes need to be distinguished, but the direction of the gaskets entering the detection station is random, and the problem to be solved is that the detection frame can be accurately positioned for the gaskets in any direction. In addition, the distinction of similarly shaped pieces is also a problem.
(3) In order to ensure the accuracy of the detection data, the detection precision needs to be 0.01 mm. High standards are put on the hardware requirements of the devices.
(4) In order to realize automatic detection, the whole process of the equipment from the detection feeding port to the discharging port does not need manual participation. The normal detection does not need manual intervention, and when an abnormal condition occurs, for example, a product is not successfully removed by a removing station, how to realize the self-checking of the equipment is also a difficulty.
The significance of solving the problems and the defects is as follows:
the invention can measure the size of each gasket produced on the production line efficiently, quickly and accurately, can meet the requirement of removing unqualified products in real time, and realizes the automatic full inspection of the products. The detection method does not need the uniform placement direction of the gasket, the detection of random angles, better adapts to the complex conditions in actual production, and has better robustness, thereby reducing the labor intensity, the maintenance cost and the potential risk. The product detection data has high precision and good stability, and has a data storage function to realize the tracking and tracing of the product data in the later period.
Disclosure of Invention
To overcome the problems in the related art, the disclosed embodiments of the present invention provide a system, method, processing terminal and medium for detecting a gasket size based on machine vision. The technical scheme is as follows:
according to a first aspect of the disclosed embodiment of the invention, the gasket visual detection system provided by the invention comprises two detection stations (a shot point laser detection station and a camera detection station), two rejection stations (a shot point laser detection rejection station and a camera detection rejection station), and three conveying mechanisms (a feeding conveying belt, a blanking conveying belt and a glass rotary table). The device is characterized by further comprising 5 sensors which are sequentially arranged in the conveying direction of the workpiece to be detected; the PLC is connected with the industrial camera, the sensor and the industrial personal computer and is used for receiving the signal sent by the sensor, triggering the industrial camera to acquire an image, sending and receiving a transmission signal of the industrial personal computer and controlling the equipment to operate; and the industrial personal computer is connected with the industrial camera, the light source controller and the PLC and is used for storing the image collected by the industrial camera, processing the image, controlling the on and off of the light source and sending the image detection result to the PLC or transmitting information.
In one embodiment of the invention, the gasket size detection system based on machine vision comprises two detection stations, wherein a shot point laser detection station is arranged beside a feeding port rear blanking sensor, the outer part of a glass conveying turntable is used for detecting the measurement of the thickness size of the gasket, shot point lasers respectively irradiate the upper surface and the lower surface of the gasket, and the thickness value of the gasket is obtained by solving the height difference between the upper surface and the lower surface. The data are sent to the acquisition card through sending a voltage value, the acquisition card sends the detection data to the industrial personal computer after processing, and the industrial personal computer receives the data, processes the detection data, and sends a final result value to the PLC, displays the final result value on the display screen and stores the final result value locally.
In one embodiment of the invention, the gasket size detection system based on machine vision comprises two detection stations, wherein the camera detection station is arranged beside a camera trigger sensor, and the upper part and the lower part of a glass rotary disc; a camera and a lens are arranged right above the glass rotary table, a light source is arranged at the lower part of the glass rotary table, and a constant interval is kept between the lower part of the glass rotary table and the height of the glass rotary table; the station is used for collecting images, sending the images to the industrial personal computer, storing the images, processing the images, transmitting and sending the processing results to the PLC, displaying the processing results on a display screen and storing the processing results to the local.
In one embodiment of the invention, the two rejecting stations are respectively positioned beside the laser detection station of the opposite shot point and the camera detection station; the electromagnetic air blowing valve is connected with the PLC and is used for receiving signals sent by the PLC; and the air compressor is connected with the electromagnetic blowing valve and is used for providing gas.
In one embodiment of the present invention, the machine vision based gasket size detection system, one of the three transport mechanisms being a feed transport mechanism, comprises: the conveying belt is used for conveying the gasket to the glass rotary table; and the motor controller is connected with the driving motor and is used for adjusting the rotating speed of the conveying belt.
In one embodiment of the present invention, the machine vision based pad size detection system, one of the three transport mechanisms being a glass carousel transport mechanism, comprises: the glass rotary table is used for conveying gaskets to a correlation point laser triggering station, a correlation point laser detection station, a correlation point laser removing station, a camera triggering station, a camera detection station, a camera removing station and a qualified product blanking station; and the motor controller is connected with the driving motor and is used for adjusting the rotating speed of the glass turntable.
In one embodiment of the present invention, the machine vision-based gasket size detection system, one of the three transport mechanisms being a blanking transport mechanism, comprises: a conveyor belt for conveying the gasket to a next process station; and the motor controller is connected with the driving motor and is used for adjusting the rotating speed of the conveying belt.
In an embodiment of the invention, in the gasket size detection system based on machine vision, the 5 sensors are respectively used for a shot point laser trigger sensor, a shot point laser rejection station detection sensor, a camera trigger sensor, a camera rejection station detection sensor and a qualified product blanking detection sensor; the sensors are all photoelectric sensors.
In one embodiment of the invention, the PLC controller is further connected to two rejection stations (a shot laser detection rejection station and a camera detection rejection station) in a machine vision based gasket size detection system.
According to a second aspect of the disclosed embodiments of the present invention, there is provided a method for detecting a size of a pad based on machine vision, comprising the steps of:
s1: the method comprises the following steps of powering on equipment, and initializing an industrial camera, a light source, an industrial personal computer, a PLC (programmable logic controller), a shot point laser sensor and the speed of a conveying belt;
s2: entering a correlation point laser detection mode, when a feeding conveyor belt transmits a gasket to a glass rotary table and approaches to the position of a correlation point laser detection sensor, triggering a signal, sending the triggering signal to an industrial personal computer through internet access communication after the PLC receives the signal of the sensor, collecting and reading thickness data in a collection card by the industrial personal computer, processing the data, and sending the data to a PLC detection result;
s3: according to the thickness detection result received by the PLC, if the thickness detection result is qualified, the eliminating station does not perform any operation, and the gasket enters the next detection station; if the gasket is not qualified, the PLC controls the rejection mechanism, and the electromagnetic air blowing valve blows the gasket into the NG material cylinder with the thickness;
s4: the product with qualified thickness detection triggers a signal when the glass turntable is rotated to the position where the camera triggers the sensor, and after the PLC receives the signal of the sensor, the industrial camera is triggered to collect an image, and the collected image is stored on the industrial personal computer;
s5: the industrial personal computer preprocesses the image, preliminarily detects the number and the position of products in the gray level image, selects the detected products and carries out affine transformation on the detected products;
s6: performing fine positioning on the picture processed in the step S5, taking the positioned center of the product as the center of the ROI, and setting the size of the ROI according to the size of the product to reduce the processing time of the searched point; fitting a circle or a straight line by the points found through the edges through a least square method;
s7: calculating the detection size of the gasket according to the proportional relation between the camera visual field and image pixels of the parameters (radius, central point, angle, position and the like) of the fitting circle and the straight line processed by the S6, wherein the gasket with the size judged to be qualified moves to a qualified product blanking station along with the glass turntable, and the gasket with the size judged to be unqualified is judged, and the industrial personal computer sends a rejection signal to the PLC;
s8: according to the camera detection result received by the PLC, if the camera detection result is qualified, the elimination station does not perform any operation, and the gasket enters the next station; if the gasket is not qualified, the PLC controls the rejection station, and the electromagnetic air blowing valve blows the gasket into the NG material cylinder detected by the camera;
s9: the camera detects qualified products, the products are discharged to the discharging conveyor belt from the glass rotary disc, the detection sensor of the discharging station detects the products, the products are sent to the PLC to count the qualified products, and the gasket flows to the next station from the discharging conveyor belt.
In one embodiment of the present invention, step S1: equipment is electrified, and the initialization process of industrial camera, light source, industrial computer, PLC controller, correlation point laser sensor and conveyer belt speed is:
s1.1: statically placing a standard part on a glass turntable right below the camera, adjusting the height of the industrial camera to obtain a clear image, and enabling the edge contour in the target to be clear;
s1.2: adjusting the intensity of the light source to reduce the interference of the background and simultaneously keep the complete and clear outline of the target;
s1.3: adjusting the speed of the feeding conveyor belt through the feeding speed; meanwhile, the speed of the glass rotary table is adjusted, and the speed of the glass rotary table is greater than that of the feeding conveyor belt, so that the gaskets are prevented from being accumulated; the speed of the blanking conveyor belt is determined according to the feeding speed of the next station;
s1.4: statically placing a standard block at the light-emitting position of the opposite-point laser sensor, comparing detection data on the opposite-point laser controller with the standard thickness of the standard block, and calibrating parameters;
in one embodiment of the present invention, step S2: entering a correlation point laser detection mode, when the gasket is conveyed to the glass rotary table by the feeding conveying belt and is close to the position of the correlation point laser detection sensor, triggering signals, sending the triggering signals to the industrial personal computer through internet access communication after the PLC receives the signals of the sensor, collecting and reading thickness data in the acquisition card by the industrial personal computer, processing the data, and sending the data to a PLC detection result. The operation logic is to collect data of the shot point laser sensor and the acquisition card all the time, and define an array with fixed length to store the detected effective data. When a product passes through the correlation point laser detection sensor, a trigger signal is sent to the industrial personal computer through network port communication after the PLC receives the trigger signal, and after the industrial personal computer receives the trigger signal and waits for a fixed time (the time when the gasket passes through the correlation point laser sensor), data in the array is extracted and reset, and the data is prepared for storing the data of the next gasket. Dividing the taken data into arrays of equal parts, respectively calculating the average value and the variance of each array, wherein the average value of the array with the minimum variance is the measured thickness data.
In one embodiment of the present invention, step S5: the industrial personal computer preprocesses the image, preliminarily detects the number and the position of products in the gray level image, selects the detected products and carries out affine transformation on the detected products; the specific process of pretreatment is as follows:
s5.1: firstly, carrying out gamma conversion to enhance the contrast of an image;
s=c·rγ
wherein r is an input value (original gray value) of the gray image, and the value range is [0,1 ]; s is a gray output value after gamma conversion; c is a gray scale factor, usually 1; gamma is the gamma factor magnitude. The degree of scaling of the entire transform is controlled.
The reason for carrying out the step is that when the gasket faces upwards, the chamfer of the detection position is lightened by the light source, and the detection algorithm is interfered; in order to eliminate interference, the gamma value is set to 1 or more, the region of the image having a higher gray level is stretched, and the portion having a lower gray level is compressed. The gasket faces down without this problem.
S5.2, calculating a gradient amplitude array M (x, y) and a gradient angle array alpha (x, y) of the input image f (x, y);
and | M (s, t) -M (x, y) | is less than or equal to E, wherein E is a positive threshold value.
And | alpha (s, t) -alpha (x, y) | is less than or equal to A, wherein A is a positive angle threshold value.
S5.3: a binary image g is formed, the values at any coordinate pair (x, y) being given by:
Figure RE-GDA0003011120570000071
where TM is a threshold, A is a specified angular direction, ± TAAn acceptable direction "bandwidth" is defined for a.
S5.4: the rows of g are scanned and all gaps are filled in each row not exceeding the specified length K.
S5.5: to detect a slit in any other direction θ, rotate g by this angle and apply the horizontal scanning procedure in S5.4. The result is then rotated back at-theta to find the area where the workpiece is located.
In one embodiment of the present invention, step S6: finely positioning the image after affine transformation, taking the center of the positioned product as the center of the ROI, and setting the size of the ROI according to the size of the product so as to reduce the processing time of searching points; s6.1: the method of fitting a circle by the least square method through the points found by the edges is as follows:
s6.1.1: fitting a circle by a least square method: r2=(x-A)2+(y-B)2
R2=x2-2Ax+A2+y2-2By+B2
Let a ═ 2A, B ═ 2B, c ═ A2+B2-R2
Another form of the circular curve equation can be derived: x is the number of2+y2+ax+by+c=0。
The parameters of the circle center radius can be obtained by only obtaining the parameters a, b and c:
Figure RE-GDA0003011120570000081
the distance from the searched edge point (Xi, Yi), i epsilon (1, 2, 3.. N) to the circle center is di:
di2=(Xi-A)2+(Yi-B)2
the square of the distance of the point (Xi, Yi) to the edge of the circle minus the squared difference of the radii is:
δi=di2-R2=(Xi-A)2+(Yi-B)2-R2=Xi2+Yi2+aXi+bYi+c
let Q (a, b, c) be the sum of the squares of δ i:
Q(a,b,c)=∑δi2=∑[(Xi2+Yi2+aXi+bYi+c)2]the parameters a, b, c are determined so that the value of Q (a, b, c) is minimized.
S6.1.2: the squared difference Q (a, b, c) is greater than 0, so there is a minimum of the function greater than or equal to 0. And (4) calculating partial derivatives of the a, the b and the c to obtain extreme points, and comparing the function values of all the extreme points to obtain a minimum value.
S6.2: the method of fitting a straight line by the least square method through the points found by the edges is as follows
S6.2.1: if the measured value x in the measurement column satisfies
Figure RE-GDA0003011120570000082
Then Xi is a bad value, where ks is the confidence limit, s is the standard deviation of the measured column, and k is related to the number of measurements n. And repeating the steps until all bad values are eliminated.
S6.2.2: the remaining data is used to calculate the measurement and estimation errors. Assuming that the approximate curve y ═ ψ (x) is such that the sum of squares of y ═ ψ (x) and y ═ f (x) is minimum, and the deviation values a and b are obtained by deviating the deviation so that the deviation value becomes 0, the minimum value can be obtained, and the estimated values of the slope and intercept of the fitted optimal straight line can be obtained.
ei=yi-ψ(xi)
Figure RE-GDA0003011120570000091
In one embodiment of the present invention, step S7: and (3) calculating the detection size of the gasket according to the proportional relation between the camera vision and the image pixel of the parameters (radius, central point, angle, position and the like) of the fitting circle and the straight line processed by the step (S6), wherein the gasket with the size judged to be qualified moves to a qualified product blanking station along with the glass turntable, the gasket with the size judged to be unqualified is judged, and the industrial personal computer sends a rejection signal to the PLC. According to the proportional relation between the camera visual field range and the image pixels, the process of calculating the final size of the part is as follows:
the actual size of each pixel point in the image is as follows:
Ratio=FOV/(SPS*NSP)
size_real_length=size_pixel_length*Ratio;
size_real_diameter=size_pixel_diameter*Ratio;
wherein, the FOV is the view field of the picture, the SPS is the camera pixel size, the NSP is the camera resolution, the size _ pixel _ length is the gasket length pixel size detected by the camera, and the size _ pixel _ diameter is the gasket diameter pixel size detected by the camera.
According to a third aspect of the disclosed embodiments of the present invention, there is provided an information data processing terminal for shim dimension detection, characterized in that the information data processing terminal comprises a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to execute a machine vision based shim dimension detection method.
According to a fourth aspect of the disclosed embodiments of the present invention, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform a machine vision based shim dimension detection method.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
the method adopts the correlation point laser to detect the thickness value of the gasket, sends data to the acquisition card through sending a voltage value, the acquisition card sends detection data to the industrial personal computer after processing, and the industrial personal computer processes the detection data after receiving the data to obtain a detection result. And the industrial personal computer sends a rejection signal to the PLC, rejects the gasket through the PLC control rejection station, judges the qualified gasket and feeds the qualified gasket to the next station through the glass turntable.
The invention adopts a single high-resolution industrial camera, a parallel backlight source and a large-field telecentric lens to collect images, and the collected images are stored on an industrial personal computer. The industrial personal computer processes the image, firstly, the number of products in the image is judged, and products at specific positions are selected for affine transformation so as to remove background interference; and secondly, positioning a detected product, extracting the outline of the measured position of the product, and finally calculating the actual size of the gasket according to the proportional relation between the visual field range of the camera and the image pixels. And the qualified products of the size detection are conveyed to the next station through the conveyor belt, unqualified gaskets are judged, the industrial personal computer sends a rejection signal to the PLC, and the gaskets are rejected by the PLC-controlled rejection station. And detecting and eliminating the gasket on the assembly line in real time.
The invention stores the detected data in the database, selectively stores the detected pictures in the industrial personal computer, and names the detected pictures according to the workpiece model, batch and date combination, thereby realizing the functions of data query, analysis, real-time tracking in the later period and the like of the product.
The invention is compatible with the detection of the gaskets with different sizes, and the detection can be started without adjusting the hardware position of the equipment and directly modifying the scheme when the models are replaced. The feeding position is connected with the discharging position of the cleaning equipment, and after cleaning is finished, the feeding position directly enters the detection station, and after detection is finished, the feeding position enters the qualified discharging station. And the blanking station of the detection equipment is connected with the feeding station of the next station and enters the next operation station. The whole process does not need human participation, and the automatic full inspection of the product is realized.
Compared with the prior art, the invention has the advantages that:
the invention adopts the method of machine vision and image processing, and adopts the 2D camera and the opposite point laser to detect and remove the gasket moving on the production line in real time, thereby realizing the requirement of automatic full detection and meeting the requirements of rapid, efficient and accurate factories; the thickness of the gasket is detected, the opposite light is irradiated on the upper surface and the lower surface of the gasket, and the point on a line of the workpiece can be detected by utilizing the movement of the workpiece on the glass turntable, so that the detection accuracy is improved, and the problem of noise caused by light interference is avoided; the camera size detection is used for detecting the random placement direction of the workpiece and the random placement direction of the workpiece in the collected image, and the position and angle of a detected object are corrected by utilizing an algorithm, so that the problem of feeding consistency is solved.
In the detection process, the rotation speed of the glass turntable is self-adapted through the algorithm, so that the problem that the photographing position of a camera is inaccurate or the laser detection data of a correlation point is inaccurate due to the change of the speed of the turntable in the actual detection process is solved.
According to the invention, through a non-contact measurement method, manual participation is reduced, the defects of the traditional manual gasket detection method are overcome, and the real-time measurement and elimination work of the gasket size is realized;
the invention has detailed description for the detection system and the method of the size of the gasket, the method can be applied to various workpieces similar to the gasket, and the whole system and the method for detecting the size of the gasket are completed by a 2D industrial camera and a point-of-opposite laser, thereby greatly reducing the production cost of a factory, improving the production efficiency and meeting the requirements of rapidness and accuracy of quality detection of the workpieces.
The effects and advantages obtained by combining experimental or experimental data with the prior art are: the method comprises the following steps:
(1) the increase of test item, to special gasket, test item such as opening angle and opening width in current manual detection, because the unable accurate detection of limitation of detection instrument, nevertheless accurate detection can be realized to this equipment.
(2) The detection speed is increased, 10000 products are detected by the equipment at the lowest time in one hour, about 1000 products are detected by one person in one hour, and the detection efficiency of the equipment is ten times that of the person; for a profiler, some high precision instruments such as three-coordinates detect more slowly.
(3) When the detected data continuously generate NG, the device gives an alarm to prompt a worker to check whether the previous process has a problem or not, the problem is fed back in time, and the number of unqualified parts is reduced; in addition, the detection data can be traced, and when the detection data of a certain day or the data of a certain batch of products needs to be checked, the equipment can realize real-time inquiry and downloading.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic diagram of a system for detecting a dimension of a pad based on machine vision according to an embodiment of the present invention.
In fig. 1: 1. a laser detection station of a correlation point; 2. a camera detection station; 3. a PLC controller; 4. an industrial camera; 5. an industrial personal computer; 6. a light source controller; 7. a sensor; 7-1, triggering a sensor by using a laser of a correlation point; 7-2, a correlation point laser rejection station detection sensor; 7-3, a camera trigger sensor; 7-4, removing a station detection sensor by the camera; 7-5, a qualified product blanking detection sensor; 8. collecting cards; 9. a light source; 10. A first electromagnetic air blowing valve; 11. a second electromagnetic air blowing valve; 12. detecting and rejecting stations by using laser of opposite points; 13. Detecting and rejecting stations by a camera; 14. a feeding and conveying mechanism; 15. a blanking conveying mechanism; 16. a glass rotary table conveying mechanism; 17. a first motor controller; 18. a second motor controller; 19. a third motor controller.
Fig. 2 is a flowchart of a method for detecting a size of a pad based on machine vision according to an embodiment of the present invention.
Fig. 3 is a diagram of a system for detecting a size of a shim based on machine vision according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of a shot point laser system, a camera detection system and a rejection station used in the method for detecting a gasket size based on machine vision according to the embodiment of the present invention.
FIG. 5 is an original gray scale image collected after adjusting the distance between the light source and the object according to an embodiment of the present invention;
wherein: (1) the method comprises the following steps of (1) detecting the inner diameter and the outer diameter of a ring product, (2) measuring the outer diameter and the small circle radius of an opening ring, (3) measuring the inner diameter and the outer diameter of the opening ring, the small circle radius and the opening interval, and (4) measuring the outer diameter, the width, the opening angle and the opening interval at an opening angle.
Figure 6 is a graph of the detected outer diameter dimensions of a workpiece provided by an embodiment of the present invention,
the method comprises the following steps of (1) drawing the detected outer diameter dimension of a workpiece, (2) drawing the detected inner diameter dimension of the workpiece, (3) drawing the detected width dimension of the workpiece, (4) drawing the detected opening width dimension of the workpiece, (5) drawing the detected opening angle dimension of the workpiece, (6) drawing the detected small circular radius dimension of the workpiece, and (7) drawing the detected middle diameter dimension of the workpiece.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The technical solution of the present invention is further described below with reference to the specific embodiments and the accompanying drawings.
Examples
As shown in fig. 1, the vision inspection system of the present invention includes two inspection stations (a correlation point laser inspection station 1 and a camera inspection station 2), two rejection stations (a correlation point laser inspection rejection station 12 and a camera inspection rejection station 13), and three conveying mechanisms (a feeding conveying mechanism 14, a blanking conveying mechanism 15, and a glass rotary table conveying mechanism 16). The device is characterized by further comprising 5 sensors which are sequentially arranged in the conveying direction of the workpiece to be detected; the device is respectively used for a correlation point laser trigger sensor 7-1, a correlation point laser rejection station detection sensor 7-2, a camera trigger sensor 7-3, a camera rejection station detection sensor 7-4 and a qualified product blanking detection sensor 7-5; the sensors are all photoelectric sensors.
The PLC 3 is connected with the industrial camera 4, the sensor and the industrial personal computer 5 and used for receiving signals sent by the sensor, triggering the industrial camera to acquire images, sending and receiving transmission signals of the industrial personal computer and controlling the equipment to operate;
and the industrial personal computer 5 is connected with the industrial camera 4, the light source controller 6 and the PLC and is used for storing the image collected by the industrial camera, processing the image, controlling the on and off of the light source 9 and sending the image detection result to the PLC or transmitting information.
In particular, in one embodiment of the present invention, a machine vision based shim dimension detection system,
and the two detection stations are arranged beside the feeding port rear blanking sensor, the outer part of the glass conveying turntable is used for detecting the thickness size measurement of the gasket, the shot point laser is respectively irradiated to the upper surface and the lower surface of the gasket, and the thickness value of the gasket is obtained by solving the height difference between the upper surface and the lower surface. The data are sent to the acquisition card 8 through sending voltage values, the acquisition card 8 sends detection data to the industrial personal computer 5 after processing, and the industrial personal computer 5 receives the data, processes the detection data, sends final result values to the PLC 3, displays the final result values on a display screen and stores the final result values locally.
In one embodiment of the invention, the gasket size detection system based on machine vision comprises two detection stations, wherein a camera detection station 2 is arranged beside a camera trigger sensor 7-3 and the upper part and the lower part of a glass rotary disc; an industrial camera 4 and a lens are arranged right above the glass rotary table 16, a light source 9 is arranged at the lower part of the glass rotary table, and a constant distance is kept between the lower part of the glass rotary table and the height of the glass rotary table; the station is used for collecting images, sending the images to an industrial personal computer, storing the images, processing the images, transmitting and sending the processing results to the PLC 3, displaying the processing results on a display screen and storing the processing results locally.
In one embodiment of the invention, the two rejecting stations are respectively positioned beside the laser detection station of the opposite shot point and the camera detection station; the first electromagnetic air blowing valve 10 and the second electromagnetic air blowing valve 11 are connected with the PLC 3 and are used for receiving signals sent by the PLC; and the air compressor is connected with the first electromagnetic air blowing valve 10 and the second electromagnetic air blowing valve 11 and is used for providing air.
In one embodiment of the present invention, the three transport mechanisms, one of which is the feeding transport mechanism 14, of the machine vision based shim dimension detection system comprises: the conveying belt is used for conveying the gasket to the glass rotary table; and a first motor controller 17 connected to the driving motor for adjusting the rotation speed of the conveyor belt.
In one embodiment of the present invention, the three conveyance mechanisms, one of which is a glass carousel conveyance mechanism 16, of the machine vision based pad size detection system, comprises: the glass rotary table is used for conveying gaskets to a correlation point laser triggering station, a correlation point laser detection station, a correlation point laser removing station, a camera triggering station, a camera detection station, a camera removing station and a qualified product blanking station; and the second motor controller 18 is connected with the driving motor and is used for adjusting the rotating speed of the glass rotary disc.
In one embodiment of the present invention, the machine vision-based gasket size detection system, one of the three transport mechanisms being the blanking transport mechanism 15, comprises: a conveyor belt for conveying the gasket to a next process station; and a third motor controller 19 connected to the driving motor for adjusting the rotation speed of the conveyor belt.
In one embodiment of the invention, the PLC controller is further connected to two rejection stations (a shot laser detection rejection station and a camera detection rejection station) in a machine vision based gasket size detection system.
Fig. 2 shows a method for detecting a gasket detection size according to the present invention, comprising the steps of:
the method comprises the following steps: the method comprises the following steps of powering on equipment, and initializing an industrial camera, a light source, an industrial personal computer, a PLC (programmable logic controller), a shot point laser sensor and the speed of a conveying belt;
step two: entering a correlation point laser detection mode, when a feeding conveyor belt transmits a gasket to a glass rotary table and approaches to the position of a correlation point laser detection sensor, triggering a signal, sending the triggering signal to an industrial personal computer through internet access communication after the PLC receives the signal of the sensor, collecting and reading thickness data in a collection card by the industrial personal computer, processing the data, and sending the data to a PLC detection result;
step three: according to the thickness detection result received by the PLC, if the thickness detection result is qualified, the eliminating station does not perform any operation, and the gasket enters the next detection station; if the thickness of the gasket is not qualified, the PLC controls the rejection station, and the electromagnetic air blowing valve blows the gasket into the NG material cylinder;
step four: the product with qualified thickness detection triggers a signal when the glass turntable is rotated to the position where the camera triggers the sensor, and after the PLC receives the signal of the sensor, the industrial camera is triggered to collect an image, and the collected image is stored on the industrial personal computer;
step five: the industrial personal computer preprocesses the image, preliminarily detects the number and the position of products in the gray level image, selects the detected products and carries out affine transformation on the detected products;
step six: finely positioning the picture processed in the fifth step, taking the positioned product center as the center of the ROI, and setting the size of the ROI according to the size of the product to reduce the processing time of the searched point; fitting a circle or a straight line by the points found through the edges through a least square method;
step seven: calculating the detection size of the gasket according to the proportional relation between the camera vision and the image pixel of the parameters (radius, central point, angle, position and the like) of the fitting circle and the straight line processed in the step six, wherein the gasket with the size judged to be qualified moves to a qualified product blanking station along with the glass turntable, the gasket with the size judged to be unqualified is judged, and the industrial personal computer sends out a rejection signal to the PLC;
step eight: according to the camera detection result received by the PLC, if the camera detection result is qualified, the elimination station does not perform any operation, and the gasket enters the next station; if the gasket is not qualified, the PLC controls the rejection station, and the electromagnetic air blowing valve blows the gasket into the NG material cylinder detected by the camera;
step nine: the camera detects qualified products, the products are discharged to the discharging conveyor belt from the glass rotary disc, the detection sensor of the discharging station detects the products, the products are sent to the PLC to count the qualified products, and the gasket flows to the next station from the discharging conveyor belt.
(3) As shown in FIG. 3, the appearance of the system for detecting the size of the gasket according to the present invention is shown, wherein the workpiece enters from the feeding conveyor belt, and after the laser and the camera detection, the qualified product enters from the discharging conveyor belt to the next process.
(4) FIG. 4 is an internal view of a main inspection apparatus, the apparatus is placed after a washer cleaning and drying machine and before an oiling machine, the washer is fed to an inspection disc through a feeding conveyor belt, a first station is thickness inspection, products with qualified thickness are fed to a camera inspection station, and unqualified products are removed to a thickness NG bin; the appearance (external diameter, internal diameter, pitch diameter, opening angle, opening size etc.) of camera detection station detection gasket, qualified product can be gone to next process through the unloading conveyer belt, and camera NG workbin can be rejected to unqualified.
(5) Fig. 5 shows a camera inspection raw image of a visual inspection system based on pad size measurement according to the present invention, here exemplified by several typical products. Considering that the gaskets have various models and different sizes, the lens compatible with all models of fields of vision is selected according to the diameter of the largest gasket. Fig. 5 (1) shows the inner and outer diameters of the ring product, fig. 5 (2) shows the outer diameter and the small circle radius of the opening ring, fig. 5 (3) shows the inner and outer diameters, the small circle radius and the opening pitch of the opening ring, and fig. 5 (4) shows the outer diameter, the width, the opening angle and the opening pitch of the opening angle.
(6) The invention extracts the gray image from the workpiece image to be detected, preprocesses the image, preliminarily detects the number and the position of products in the gray image, and selects the detected products.
Step 1: firstly, carrying out gamma conversion to enhance the contrast of an image;
s=c·rγ
wherein r is an input value (original gray value) of the gray image, and the value range is [0,1 ]; s is a gray output value after gamma conversion; c is a gray scale factor, usually 1; gamma is the gamma factor magnitude. The degree of scaling of the entire transform is controlled.
The reason for carrying out the step is that when the gasket faces upwards, the chamfer of the detection position is lightened by the light source, and the detection algorithm is interfered; in order to eliminate interference, the gamma value is set to 1 or more, the region of the image having a higher gray level is stretched, and the portion having a lower gray level is compressed. The gasket faces down without this problem.
Step 2, calculating a gradient amplitude array M (x, y) and a gradient angle array alpha (x, y) of the input image f (x, y)
And | M (s, t) -M (x, y) | is less than or equal to E, wherein E is a positive threshold value.
And | alpha (s, t) -alpha (x, y) | is less than or equal to A, wherein A is a positive angle threshold value.
A binary image g is formed, the values at any coordinate pair (x, y) being given by:
Figure RE-GDA0003011120570000171
wherein, TMIs a threshold value, A is a specified angular direction, ± TAAn acceptable direction "bandwidth" is defined for a.
And 4, step 4: the rows of g are scanned and all gaps are filled in each row not exceeding the specified length K.
And 5: to detect a slit in any other direction θ, rotate g by this angle and apply the horizontal scanning procedure in S5.4. The result is then rotated back at-theta to find the area where the workpiece is located.
According to the method, in the affine transformation image made according to the minimum circumscribed rectangle of the workpiece to be detected, the original image is subjected to affine transformation according to the central point and the length of the region where the workpiece is located, and the image is intercepted, so that background interference is prevented.
As shown in (1) - (7) in fig. 6, performing fine positioning on the image after affine transformation, taking the center of the positioned product as the center of the ROI, and setting the size of the ROI by the size of the product to reduce the processing time of finding points; fitting a circle or a straight line by the points found through the edges through a least square method;
the method of fitting a circle by the least square method through the points found by the edges is as follows:
fitting a circle by a least square method: r2=(x-A)2+(y-B)2
R2=x2-2Ax+A2+y2-2By+B2
Let a ═ 2A, B ═ 2B, c ═ A2+B2-R2
Another form of the circular curve equation can be derived: x is the number of2+y2+ax+by+c=0
The parameters of the circle center radius can be obtained by only obtaining the parameters a, b and c:
Figure RE-GDA0003011120570000181
the distance from the searched edge point (Xi, Yi), i epsilon (1, 2, 3.. N) to the circle center is di:
di2=(Xi-A)2+(Yi-B)2
the square of the distance of the point (Xi, Yi) to the edge of the circle minus the squared difference of the radii is:
δi=di2-R2=(Xi-A)2+(Yi-B)2-R2=Xi2+Yi2+aXi+bYi+c
let Q (a, b, c) be the sum of the squares of δ i:
Q(a,b,c)=∑δi2=∑[(Xi2+Yi2+aXi+bYi+c)2]the parameters a, b, c are determined so that the value of Q (a, b, c) is minimized.
S6.1.2: the squared difference Q (a, b, c) is greater than 0, so there is a minimum of the function greater than or equal to 0. And (4) calculating partial derivatives of the a, the b and the c to obtain extreme points, and comparing the function values of all the extreme points to obtain a minimum value.
S6.2: the method of fitting a straight line by the least square method through the points found by the edges is as follows:
s6.2.1: if the measured value x in the measurement column satisfies
Figure RE-GDA0003011120570000182
Then Xi is a bad value, where ks is the confidence limit, s is the standard deviation of the measured column, and k is related to the number of measurements n. And repeating the steps until all bad values are eliminated.
S6.2.2: the remaining data is used to calculate the measurement and estimation errors. Assuming that the approximate curve y ═ ψ (x) is such that the sum of squares of y ═ ψ (x) and y ═ f (x) is minimum, and the deviation values a and b are obtained by deviating the deviation so that the deviation value becomes 0, the minimum value can be obtained, and the estimated values of the slope and intercept of the fitted optimal straight line can be obtained.
ei=yi-ψ(xi)
Figure RE-GDA0003011120570000183
(9) And calculating the detection size of the gasket according to the proportional relation between the camera vision and the image pixels for the processed parameters (radius, central point, angle, position and the like) of the fitting circle and the straight line, wherein the gasket with the size judged to be qualified moves to a qualified product blanking station along with the glass turntable, the gasket with the size judged to be unqualified is judged, and the industrial personal computer sends a rejection signal to the PLC. According to the proportional relation between the camera visual field range and the image pixels, the process of calculating the final size of the part is as follows:
the actual size of each pixel point in the image is as follows:
Ratio=FOV/(SPS*NSP)
size_real_length=size_pixel_length*Ratio
size_real_diameter=size_pixel_diameter*Ratio。
wherein, the FOV is the view field of the picture, the SPS is the camera pixel size, the NSP is the camera resolution, the size _ pixel _ length is the gasket length pixel size detected by the camera, and the size _ pixel _ diameter is the gasket diameter pixel size detected by the camera.
The effects of the present invention will be further described below with reference to comparative data.
(1) Compared with the prior art:
Figure RE-GDA0003011120570000191
(2) the device has higher detection precision, and the following table shows the actual detection repeatability precision data of a certain product:
Figure RE-GDA0003011120570000201
(3) the equipment has a data query function, can query batch data in a certain time period according to time, and can also query detailed data of detection items of detection products in a certain batch.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure should be limited only by the attached claims.

Claims (10)

1. A method for detecting the size of a gasket based on machine vision is characterized by comprising the following steps:
collecting an image of a gasket to be detected, and transmitting the collected image to an industrial personal computer for storage;
the industrial personal computer processes the stored images, judges the number of products in the processed images, selects products at specific positions to perform affine transformation, and removes background interference; then positioning the gasket to be detected, and extracting the outline of the measured position of the gasket to be detected; then calculating the actual size of the gasket to be detected according to the proportional relation between the visual field range of the image acquisition equipment and the image pixels;
conveying the gasket qualified in size detection to the next station through a conveyor belt;
and judging unqualified gaskets, sending a rejection signal to the PLC by the industrial personal computer, and rejecting the gaskets at a rejection station through the PLC control.
2. The method for detecting the size of the gasket based on the machine vision is characterized in that the steps of collecting the image of the gasket to be detected and transmitting the collected image to an industrial personal computer for storage comprise the following steps:
(1) the method comprises the following steps of powering on equipment, and initializing an industrial camera, a light source, an industrial personal computer, a PLC (programmable logic controller), a shot point laser sensor and the speed of a conveying belt;
(2) entering a correlation point laser detection mode, when a feeding conveyor belt transmits a gasket to a glass rotary table and approaches to the position of a correlation point laser detection sensor, triggering a signal, sending the triggering signal to an industrial personal computer through internet access communication after the PLC receives the signal of the sensor, collecting and reading thickness data in a collection card by the industrial personal computer, processing the data, and sending the data to a PLC detection result;
(3) according to the thickness detection result received by the PLC, if the thickness detection result is qualified, the station is rejected without any operation; if not, the PLC controls a rejection mechanism to reject the product;
(4) the qualified product of thickness detection, with the position that the camera was triggered to the glass carousel commentaries on classics to the sensor, trigger signal, PLC receives the signal of sensor after, triggers the industry camera and gathers the image, gathers the image that obtains and saves on the industrial computer.
3. The machine-vision-based gasket size detecting method according to claim 2,
the step (1) comprises the following steps:
(1.1) statically placing a standard part on a glass rotary table right below a camera, adjusting the height of the industrial camera to obtain a clear image, and enabling the edge contour in a target to be clear;
(1.2) adjusting the intensity of the light source to reduce the interference of the background, and simultaneously keeping the complete and clear outline of the target;
(1.3) adjusting the speed of the feeding conveyor belt through the feeding speed; meanwhile, the speed of the glass rotary table is adjusted, and the speed of the glass rotary table is greater than that of the feeding conveyor belt, so that the gaskets are prevented from being accumulated; the speed of the blanking conveyor belt is determined according to the feeding speed of the next station;
(1.4) statically placing a standard block at the light-emitting position of the opposite-point laser sensor, comparing detection data on the opposite-point laser controller with the standard thickness of the standard block, and calibrating parameters;
the step (2) comprises the following steps:
(2.1) entering a shot point laser detection mode, when the gasket is conveyed to the glass rotary table by the feeding conveyor belt and is close to the position of the shot point laser detection sensor, triggering a signal, after the PLC receives the signal of the sensor, sending the triggering signal to an industrial personal computer through internet access communication, and acquiring and reading thickness data in the acquisition card by the industrial personal computer, processing the data and sending the data to a PLC detection result;
(2.2) the operation logic is that data is always acquired by the shot point laser sensor and the acquisition card, and arrays with fixed lengths are defined to store the detected effective data;
(2.3) when the product passes through the correlation point laser detection sensor, triggering a signal, sending the triggering signal to an industrial personal computer through internet access communication after the PLC receives the signal, extracting data in the array after the industrial personal computer receives the triggering signal and waits for a fixed time, and resetting the array to prepare for storing data of the next gasket;
and (2.4) dividing the extracted data into arrays of equal parts, respectively calculating the average value and the variance of each array, wherein the average value of the array with the minimum variance is the measured thickness data.
4. The machine-vision-based gasket size detecting method according to claim 1,
the industrial personal computer processes the stored images, firstly, the number of products in the images is judged, products in specific positions are selected for affine transformation, and background interference is removed; the method comprises the following steps:
step 1: firstly, carrying out gamma conversion to enhance the contrast of an image;
s=c·rγ
wherein r is an input value of the gray image, and the value range is [0,1 ]; s is a gray output value after gamma conversion; c is a gray scale factor, usually 1; gamma is the gamma factor;
step 2, calculating a gradient amplitude array M (x, y) and a gradient angle array alpha (x, y) of the input image f (x, y);
i M (s, t) -M (x, y) | is less than or equal to E, wherein E is a positive threshold value;
| α (s, t) - α (x, y) | is less than or equal to A, wherein A is a positive angle threshold;
and step 3: a binary image g is formed, the values at any coordinate pair (x, y) being given by:
Figure FDA0002903700210000031
wherein, TMIs a threshold value, A is a specified angular direction, ± TADefining an acceptable directional bandwidth with respect to a;
and 4, step 4: scanning the rows of g and filling all gaps in each row not exceeding a specified length K;
and 5: to detect a gap in any other direction θ, rotate g by this angle and apply the horizontal scanning process in step 4; the result is then rotated back at-theta to find the area where the workpiece is located.
5. The method for detecting the size of the gasket to be detected based on the machine vision as claimed in claim 1, wherein the positioning the gasket to be detected and the extracting the outline of the measured position of the gasket to be detected comprises: finely positioning the processed picture, taking the positioned product center as the center of the ROI area, and setting the size of the ROI area according to the size of the product to reduce the processing time of the searched point; fitting a circle or a straight line by the points found through the edges through a least square method; the method specifically comprises the following steps:
1): the method of fitting a circle by the least square method through the points found by the edges is as follows:
1.1): fitting a circle by a least square method: r2=(x-A)2+(y-B)2
R2=x2-2Ax+A2+y2-2By+B2
Let a ═ 2A, B ═ 2B, c ═ A2+B2-R2
Get another form of the circular curve equation: x is the number of2+y2+ax+by+c=0;
Obtaining the parameters of the circle center radius through the parameters a, b and c:
Figure FDA0002903700210000041
the distance from the searched edge point (Xi, Yi), i epsilon (1, 2, 3.. N) to the circle center is di:
di2=(Xi-A)2+(Yi-B)2
the square of the distance of the point (Xi, Yi) to the edge of the circle minus the squared difference of the radii is:
δi=di2-R2=(Xi-A)2+(Yi-B)2-R2=Xi2+Yi2+aXi+bYi+c;
let Q (a, b, c) be the sum of the squares of δ i:
Q(a,b,c)=∑δi2=∑[(Xi2+Yi2+aXi+bYi+c)2]determining the parameters a, b, c so that the value of Q (a, b, c) is minimum;
1.2): the squared difference Q (a, b, c) is greater than 0, so there is a minimum of the function greater than or equal to 0; calculating partial derivatives of the a, the b and the c to obtain extreme points, and comparing function values of all the extreme points to obtain a minimum value;
2): the method of fitting a straight line by the least square method through the points found by the edges is as follows:
2.1): if the measured value x in the measurement column satisfies
Figure FDA0002903700210000042
When the measurement is carried out, Xi is a bad value, ks is a confidence limit, s is the standard deviation of a measurement column, and the k value is related to the measurement times n; repeating the step of judging that the Xi is a bad value until all bad values are eliminated;
2.2): calculating a measurement result and an estimation error using the remaining data; the approximate curve y ═ ψ (x) is such that the sum of square deviations of y ═ ψ (x) and y ═ f (x) is minimum, and the deviation is calculated for a and b such that the deviation value is 0, that is, the minimum value can be obtained, and the estimated values of the slope and intercept of the fitted optimal straight line are obtained;
ei=yi-ψ(Xi)
Figure FDA0002903700210000043
6. the method for detecting the size of the gasket based on the machine vision as claimed in claim 1, wherein the calculating the actual size of the gasket to be detected according to the proportional relation between the vision range of the image acquisition equipment and the image pixels comprises:
the actual size of each pixel point in the image is as follows:
Ratio=FOV/(SPS*NSP)
size_real_length=size_pixel_length*Ratio;
size_real_diameter=size_pixel_diameter*Ratio;
wherein, the FOV is the view field of the picture, the SPS is the camera pixel size, the NSP is the camera resolution, the size _ pixel _ length is the gasket length pixel size detected by the camera, and the size _ pixel _ diameter is the gasket diameter pixel size detected by the camera.
7. A system for implementing the machine vision-based gasket size detection method of any one of claims 1 to 6, wherein the machine vision-based gasket size detection system is provided with:
the system comprises a correlation point laser detection station, a camera detection station, a correlation point laser detection rejection station, a camera detection rejection station, a feeding conveyor belt, a blanking conveyor belt, a glass rotary table, a plurality of sensors arranged in the conveying direction of a workpiece to be detected, a PLC (programmable logic controller) and an industrial personal computer;
the PLC is connected with the shot point laser detection station, the camera detection station, the industrial camera, the sensors and the industrial personal computer, and is used for receiving signals sent by the sensors, triggering the industrial camera of the camera detection station to acquire images, sending and receiving transmission signals of the industrial personal computer and controlling the equipment to operate;
and the industrial personal computer is connected with the industrial camera, the light source controller and the PLC and is used for storing the image collected by the industrial camera, processing the image, controlling the on and off of the light source and sending the image detection result to the PLC or transmitting the information.
8. The system for detecting the size of the gasket based on the machine vision is characterized in that the shot point laser detection station is arranged beside a feeding port rear blanking sensor, the outer part of a glass conveying turntable is used for detecting the measurement of the thickness size of the gasket, shot point laser is respectively applied to the upper surface and the lower surface of the gasket, and the thickness value of the gasket is obtained by solving the height difference of the upper surface and the lower surface; sending the data to an acquisition card by sending a voltage value, processing the acquisition card and then sending the detection data to an industrial personal computer, and after receiving the data, the industrial personal computer processes the detection data and then sends a final result value to a PLC (programmable logic controller), displays the final result value on a display screen and stores the final result value locally;
the camera detection station is arranged beside the camera trigger sensor and outside the glass rotary table; the lower part of the glass rotary disc is provided with a light source and keeps a constant distance with the height of the glass rotary disc; the station is used for collecting images, sending the images to an industrial personal computer, storing the images, processing the images, transmitting and sending the processing results to a PLC (programmable logic controller), displaying the processing results on a display screen and storing the processing results to the local;
the correlation point laser detection rejection station and the camera detection rejection station are respectively positioned beside the correlation point laser detection station and the camera detection station; the electromagnetic air blowing valve is connected with the PLC and is used for receiving signals sent by the PLC; the air compressor is connected with the electromagnetic air blowing valve and is used for providing air;
the material loading transport mechanism includes: the conveying belt is used for conveying the gasket to the glass rotary table; the motor controller is connected with the driving motor and is used for adjusting the rotating speed of the conveying belt;
the glass carousel transport mechanism includes: the glass rotary table is used for conveying gaskets to an opposite-point laser trigger sensor, an opposite-point laser detection station, an opposite-point laser rejection station, a camera trigger sensor, a camera detection station, a camera rejection station and a qualified product blanking station; the motor controller is connected with the driving motor and is used for adjusting the rotating speed of the glass turntable;
unloading transport mechanism includes: a conveyor belt for conveying the gasket to a next process station; the motor controller is connected with the driving motor and is used for adjusting the rotating speed of the conveying belt;
the sensors are respectively used for a correlation point laser trigger sensor, a correlation point laser rejection station detection sensor, a camera trigger sensor, a camera rejection station detection sensor and a qualified product blanking detection sensor; the sensors are all photoelectric sensors;
the PLC controller is also connected with a shot point laser detection rejection station and a camera detection rejection station.
9. An information data processing terminal for shim dimension detection, characterized in that the information data processing terminal comprises a memory and a processor, the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute the machine vision based shim dimension detection method of any one of claims 1 to 6.
10. A computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the machine vision-based shim dimension detecting method of any one of claims 1 to 6.
CN202110064061.4A 2021-01-18 2021-01-18 Gasket size detection system and method based on machine vision, processing terminal and medium Pending CN112893172A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110064061.4A CN112893172A (en) 2021-01-18 2021-01-18 Gasket size detection system and method based on machine vision, processing terminal and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110064061.4A CN112893172A (en) 2021-01-18 2021-01-18 Gasket size detection system and method based on machine vision, processing terminal and medium

Publications (1)

Publication Number Publication Date
CN112893172A true CN112893172A (en) 2021-06-04

Family

ID=76115634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110064061.4A Pending CN112893172A (en) 2021-01-18 2021-01-18 Gasket size detection system and method based on machine vision, processing terminal and medium

Country Status (1)

Country Link
CN (1) CN112893172A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113245240A (en) * 2021-06-17 2021-08-13 深圳市杰普特光电股份有限公司 Material sorting control device and control method
CN113790685A (en) * 2021-11-17 2021-12-14 湖南苏科智能科技有限公司 Automatic size detection method of to-be-detected article for double-light-source X-ray security inspection machine
CN114998204A (en) * 2022-04-24 2022-09-02 启东亦大通自动化设备有限公司 Self-adaptive adjustment method for processing quality of fisheye gasket
CN116147506A (en) * 2023-04-23 2023-05-23 钛玛科(北京)工业科技有限公司 Dual CCD camera width measurement method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101329725A (en) * 2008-07-30 2008-12-24 电子科技大学 Method for dividing fingerprint image based on gradient projection and morphology
CN209102002U (en) * 2018-11-13 2019-07-12 北新弹性地板有限公司 To penetrating laser thickness measurement online device
CN110751156A (en) * 2019-10-17 2020-02-04 上海眼控科技股份有限公司 Method, system, device and medium for table line bulk interference removal
CN110766684A (en) * 2019-10-30 2020-02-07 江南大学 Stator surface defect detection system and detection method based on machine vision
CN110935644A (en) * 2019-12-27 2020-03-31 江南大学 Bearing needle roller size detection system and method based on machine vision
CN112102232A (en) * 2020-07-31 2020-12-18 深圳大学 Method and device for automatically evaluating colony quality of induced pluripotent stem cells

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101329725A (en) * 2008-07-30 2008-12-24 电子科技大学 Method for dividing fingerprint image based on gradient projection and morphology
CN209102002U (en) * 2018-11-13 2019-07-12 北新弹性地板有限公司 To penetrating laser thickness measurement online device
CN110751156A (en) * 2019-10-17 2020-02-04 上海眼控科技股份有限公司 Method, system, device and medium for table line bulk interference removal
CN110766684A (en) * 2019-10-30 2020-02-07 江南大学 Stator surface defect detection system and detection method based on machine vision
CN110935644A (en) * 2019-12-27 2020-03-31 江南大学 Bearing needle roller size detection system and method based on machine vision
CN112102232A (en) * 2020-07-31 2020-12-18 深圳大学 Method and device for automatically evaluating colony quality of induced pluripotent stem cells

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
崔明等: "基于机器视觉的轴承滚动体缺陷检测算法研究", 《组合机床与自动化加工技术》 *
葛致磊等: "《导弹导引系统原理》", 31 March 2016, 国防工业出版社 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113245240A (en) * 2021-06-17 2021-08-13 深圳市杰普特光电股份有限公司 Material sorting control device and control method
CN113790685A (en) * 2021-11-17 2021-12-14 湖南苏科智能科技有限公司 Automatic size detection method of to-be-detected article for double-light-source X-ray security inspection machine
CN113790685B (en) * 2021-11-17 2022-01-18 湖南苏科智能科技有限公司 Automatic size detection method of to-be-detected article for double-light-source X-ray security inspection machine
CN114998204A (en) * 2022-04-24 2022-09-02 启东亦大通自动化设备有限公司 Self-adaptive adjustment method for processing quality of fisheye gasket
CN116147506A (en) * 2023-04-23 2023-05-23 钛玛科(北京)工业科技有限公司 Dual CCD camera width measurement method and system

Similar Documents

Publication Publication Date Title
CN112893172A (en) Gasket size detection system and method based on machine vision, processing terminal and medium
CN110935644B (en) Bearing needle roller size detection system and method based on machine vision
CN101365144B (en) Regulating and calibrating method for linear array CCD scanning detection system
RU2763417C2 (en) System and related method for detecting small defects on/in glass sheet on process line
Lahajnar et al. Machine vision system for inspecting electric plates
US9047657B2 (en) Method and system for optically inspecting outer peripheral surfaces of parts
US5917602A (en) System and method for image acquisition for inspection of articles on a moving conveyor
US9486840B2 (en) High-speed, triangulation-based, 3-D method and system for inspecting manufactured parts and sorting the inspected parts
EP2710354A1 (en) Method and system for optically inspecting parts
US9851200B2 (en) Non-contact gaging system and method for contoured panels having specular surfaces
US7777871B2 (en) Apparatus for measuring physical properties of golf balls and cores
CN110987932A (en) Automatic assembly coordinate vision measurement method
JPH09101125A (en) Article shape measuring method and device
CN110645911A (en) Device and method for obtaining complete outer surface 3D contour through rotary scanning
CN113847881A (en) Free-form surface profile tolerance detection method based on machine vision
WO2020079694A1 (en) Optimizing defect detection in an automatic visual inspection process
CN117649404A (en) Medicine packaging box quality detection method and system based on image data analysis
CN114119483A (en) Image processing technology-based quality detection method and device for light wallboard for building
US9933251B2 (en) Non-contact gaging system and method for contoured glass sheets
CN211122578U (en) Glass surface flaw detection device
CN114383505A (en) Automatic detection device for dimension of short shaft type part
CN114486732B (en) Ceramic tile defect online detection method based on line scanning three-dimension
CN112345540B (en) Method for detecting inner hole interference fit surface disassembly damage based on circular structure light detection
CN109701890A (en) Magnetic tile surface defect detection and method for sorting
CN113205499A (en) Bearing defect modular detection device and method based on machine vision

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210604