[go: up one dir, main page]

CN119115763A - A method and system for self-positioning workpiece of polishing machine tool based on machine vision - Google Patents

A method and system for self-positioning workpiece of polishing machine tool based on machine vision Download PDF

Info

Publication number
CN119115763A
CN119115763A CN202411308849.5A CN202411308849A CN119115763A CN 119115763 A CN119115763 A CN 119115763A CN 202411308849 A CN202411308849 A CN 202411308849A CN 119115763 A CN119115763 A CN 119115763A
Authority
CN
China
Prior art keywords
workpiece
machine tool
coordinates
image
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
CN202411308849.5A
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.)
National University of Defense Technology
Original Assignee
National University of Defense 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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN202411308849.5A priority Critical patent/CN119115763A/en
Publication of CN119115763A publication Critical patent/CN119115763A/en
Pending legal-status Critical Current

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B24GRINDING; POLISHING
    • B24BMACHINES, DEVICES, OR PROCESSES FOR GRINDING OR POLISHING; DRESSING OR CONDITIONING OF ABRADING SURFACES; FEEDING OF GRINDING, POLISHING, OR LAPPING AGENTS
    • B24B29/00Machines or devices for polishing surfaces on work by means of tools made of soft or flexible material with or without the application of solid or liquid polishing agents
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B24GRINDING; POLISHING
    • B24BMACHINES, DEVICES, OR PROCESSES FOR GRINDING OR POLISHING; DRESSING OR CONDITIONING OF ABRADING SURFACES; FEEDING OF GRINDING, POLISHING, OR LAPPING AGENTS
    • B24B1/00Processes of grinding or polishing; Use of auxiliary equipment in connection with such processes
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B24GRINDING; POLISHING
    • B24BMACHINES, DEVICES, OR PROCESSES FOR GRINDING OR POLISHING; DRESSING OR CONDITIONING OF ABRADING SURFACES; FEEDING OF GRINDING, POLISHING, OR LAPPING AGENTS
    • B24B49/00Measuring or gauging equipment for controlling the feed movement of the grinding tool or work; Arrangements of indicating or measuring equipment, e.g. for indicating the start of the grinding operation
    • B24B49/12Measuring or gauging equipment for controlling the feed movement of the grinding tool or work; Arrangements of indicating or measuring equipment, e.g. for indicating the start of the grinding operation involving optical means

Landscapes

  • Engineering & Computer Science (AREA)
  • Mechanical Engineering (AREA)
  • Machine Tool Sensing Apparatuses (AREA)

Abstract

The invention discloses a self-locating method and a self-locating system for a polishing machine tool workpiece based on machine vision, wherein the method comprises the steps of S1, calibrating a machine vision system, calculating a conversion relation between a pixel coordinate and a machine coordinate, S2, acquiring a workpiece image acquired by the machine vision system and the machine coordinate corresponding to the machine vision system, detecting the pixel coordinate of the workpiece edge according to the workpiece image, and S3, obtaining the machine coordinate of the workpiece and the machine coordinate of the center of the workpiece according to the pixel coordinate of the workpiece edge, the machine coordinate corresponding to the machine vision system and the conversion relation between the pixel coordinate and the machine coordinate. The invention has the advantages of non-contact, high positioning precision, high efficiency and the like.

Description

Polishing machine tool workpiece self-locating method and system based on machine vision
Technical Field
The invention mainly relates to the technical field of machine tool workpiece positioning, in particular to a polishing machine tool workpiece self-locating method and system based on machine vision.
Background
With the rapid development of optical design and optical processing technology, precision optical elements play a critical role in various fields of aerospace, military, industry, civil use and the like, and simultaneously, higher requirements on optical processing capability are also put on. The computer-controlled optical machining technology (CCOS) proposed in the last century is based on high-precision measurement technology and computer-controlled technology, and uses quantitative detection, quantitative machining instead of manual machining, so that the machining process can quantitatively develop in a deterministic direction. Currently, CCOS-based small grinding head polishing, jet polishing and magnetorheological polishing have been widely used in the processing of optical elements.
The premise of realizing fixed-point and quantitative processing is that the workpiece has higher positioning precision on a polishing machine bed, the clamping of the workpiece in the polishing process at the present stage still adopts a traditional manual tool setting mode, and workers realize the positioning of the workpiece by using a dial indicator or a dial indicator and a clamp. The manual clamping operation is complex, the efficiency is low, the manual clamping operation is greatly influenced by human factors, the precision and the stability of the manual clamping operation are difficult to ensure, and finally the surface shape error convergence rate is reduced.
Patent application CN105252376a discloses a workpiece self-locating method for a high-precision polishing machine tool, which uses a contact probe to measure one coordinate point at a time, obtains a measuring point set by multiple measurements, and finally realizes the locating of the surface shape of the workpiece on the machine tool through an algorithm. The method has low data acquisition efficiency, the positioning accuracy depends on the number of measuring points, the more the measuring points are, the higher the positioning accuracy is, the longer the time is consumed, and the contact type measuring head and the optical element can cause a certain degree of surface damage when in contact, so that the optical performance of a workpiece is affected.
Disclosure of Invention
Aiming at the technical problems existing in the prior art, the invention provides a non-contact high-efficiency and high-positioning self-locating method and system for a polishing machine tool workpiece based on machine vision.
In order to solve the technical problems, the technical scheme provided by the invention is as follows:
A polishing machine tool workpiece self-locating method based on machine vision comprises the following steps:
S1, calibrating a machine vision system, and calculating a conversion relation between pixel coordinates and machine tool coordinates;
S2, acquiring a workpiece image acquired by a machine vision system and machine tool coordinates corresponding to the machine vision system, and detecting pixel coordinates of the edge of the workpiece according to the workpiece image;
And S3, obtaining the machine tool coordinates of the workpiece and the machine tool coordinates of the center of the workpiece according to the pixel coordinates of the edge of the workpiece, the machine tool coordinates corresponding to the machine vision system and the conversion relation between the pixel coordinates and the machine tool coordinates.
Preferably, the specific process of step S2 is:
s201, acquiring a workpiece image and converting the workpiece image into a gray scale image;
S202, eliminating noise in an image;
S203, calculating an optimal segmentation threshold value of the background and the workpiece, and finishing image binarization to obtain a binary image;
S204, expanding and corroding the binary image, and differencing the expanded image and the corroded image to obtain an initial edge of the workpiece;
s205, dividing the denoised image into a plurality of small images along the initial edge of the workpiece, respectively detecting the workpiece edges of the small images, and splicing the workpiece edges of the small images to obtain the workpiece edges of the whole image;
s206, performing first-order difference on the edge of the workpiece of the whole image, and eliminating points with abrupt slope changes;
S207, according to the workpiece edge coordinates and the gradient direction of the whole image, sub-pixel workpiece edge detection is carried out in the original gray level image by using an interpolation method, and discrete points are fitted into a continuous workpiece edge by using a polynomial fitting method, so that the workpiece edge pixel coordinates are obtained.
Preferably, in step S203, a peak-to-valley between two peaks in the gray histogram is determined by using a peak-finding algorithm, and the gray value of the peak-to-valley is the optimal segmentation threshold for segmenting the background and the workpiece.
Preferably, in step S205, the workpiece edges of each small image are detected by a modified Canny algorithm that improves the non-maximal suppression process, expanding the local suppression in the gradient direction to a global suppression in the gradient direction to ultimately obtain a single discontinuous edge.
Preferably, in step S3, the center coordinates of the round workpiece are obtained by a four-point method according to the edge coordinates, and the corner coordinates are obtained according to the edge coordinates of the rectangular workpiece, wherein the intersection point of the diagonal lines is the center of the rectangle.
Preferably, the specific process of step S1 is:
S101, positioning a round workpiece in a machine tool by using a dial indicator, wherein a machine tool mechanical coordinate point at the center of the round workpiece is marked as (x 1,y1), the center of an image is regarded as the center of a contact measuring head, a circle center sitting mark of the round workpiece is marked as (x 2,y2) by using a four-point method, and the difference between the two marks is obtained (delta x, delta y);
S102, placing the calibration plate on a machine tool, taking a picture, detecting the circle centers of nine circles on the calibration plate, and recording the pixel coordinates (u 1,v1)、(u2,v2)…(u9,v9) of the circles;
S103, detecting the circle centers of all circles on the calibration plate in real time, moving the camera to enable the main image point to coincide with each circle center of the calibration plate, wherein the coordinates of the camera on the machine tool are mechanical coordinates of the circle centers of the calibration plate, and obtaining the circle center coordinates of nine circles, and recording the coordinates as (X M1,YM1)、(XM2,YM2)…(XM9,YM9);
S104, according to the measurement data and the formula (1), the undetermined parameter a, b, c, d, e, f can be solved by using a least square method, wherein the formula (1) is a conversion relation from a pixel coordinate to a machine tool coordinate, and specifically comprises the following steps:
Wherein X M、YM is the machine tool coordinate of the edge of the workpiece, a, b, c, d, e, f is the parameter to be calibrated, u and v are the pixel coordinates of the edge of the workpiece, u 0、v0 is the image center coordinate, and X Mc、YMc is the coordinate of the camera on the machine tool.
The invention also discloses a polishing machine tool workpiece self-locating system based on machine vision, which comprises a control unit, an industrial camera, a fixture mounting plate, a lens fixture, a point light source and a telecentric lens, wherein the fixture mounting plate is arranged on the A-axis supporting beam, the lens fixture is arranged on the fixture mounting plate, the lens fixture and the telecentric lens are connected through interference fit, and the control unit is connected with the industrial camera and a machine tool servo motion mechanism and is used for executing the steps of the method according to the picture shot by the industrial camera and the coordinate information of the machine tool servo motion mechanism so as to obtain the machine tool coordinates of the workpiece and the machine tool coordinates of the center of the workpiece.
The invention also discloses a computer program product comprising a computer program which, when run by a processor, performs the steps of the method as described above.
The invention further discloses a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, performs the steps of the method as described above.
The invention also discloses a polishing machine tool workpiece self-locating system based on machine vision, which comprises a memory and a processor which are connected with each other, wherein the memory is stored with a computer program which executes the steps of the method when being run by the processor.
Compared with the prior art, the invention has the advantages that:
In the image acquisition process, a visual system is controlled by a servo motion of a numerical control machine tool to acquire a plurality of images along the edge of a workpiece, and the current machine tool coordinates are recorded, and according to the position coordinates of the acquired images and the images, the machine tool coordinates corresponding to the edge of the workpiece in each image can be calculated, so that the super-view-field high-precision measurement is realized, the method is suitable for high-precision positioning of workpieces with any size, and the machine tool workpiece self-locating method can realize non-contact positioning, and is high in precision and efficiency.
The invention selects the telecentric lens with small distortion, the working distance is 220mm, interference phenomenon can not occur in the non-contact measurement, processing and positioning processes, the installation is simple, an additional device is not needed, the vision system and the numerical control system of the machine tool are mutually communicated, automatic image acquisition, workpiece center point calculation and workpiece offset setting can be realized, human factor intervention is reduced, the workpiece positioning stability is improved, the vision technology is applied to a polishing machine tool, the image acquisition is carried out based on the feedback of the numerical control machine tool, the limitation of camera view field can be broken, the high-precision positioning of workpieces with any size is realized, the image processing technology is used for detecting the edge coordinates of the workpieces, and compared with the traditional contact measuring head and dial gauge, the data of a plurality of points can be acquired at one time, and the workpiece positioning stability and efficiency are improved.
Drawings
FIG. 1 is a block diagram of the workpiece self-locating system of the polishing machine of the present invention in a specific application.
FIG. 2 is a schematic diagram of a workpiece positioning method of a workpiece self-locating system of a polishing machine according to an embodiment of the present invention.
FIG. 3 is a flow chart of an embodiment of a workpiece positioning method of the workpiece self-locating system of the polishing machine of the present invention.
FIG. 4 is a flowchart of image processing in the workpiece positioning method of the workpiece self-locating system of the polishing machine of the present invention.
Fig. 5 is a diagram of an original image acquired by the present invention.
Fig. 6 is a gray level histogram of an original image in the present invention.
Fig. 7 is a diagram of an edge image detected in the present invention.
FIG. 8 is a process diagram of the present invention for obtaining the mechanical coordinates of a calibration plate.
Fig. 9 is a binary image obtained by the Otsu threshold value and the triangle threshold value method in the prior art, (a) is a binary image obtained by the Otsu threshold value, and (b) is a binary image obtained by the triangle threshold value method.
FIG. 10 is a binary image obtained by the automatic simple thresholding method employed in the present invention.
Fig. 11 is a graph of the results of the Canny algorithm before and after modification, a graph of the Canny algorithm detection result after modification, and a graph of the Canny algorithm detection result.
The illustration is that 1, A axle supporting beam, 2, industrial camera, 3, mounting plate, 4, lens clamp, 5, point light source, 6, telecentric lens.
Detailed Description
The invention is further described below with reference to the drawings and specific examples.
As shown in fig. 1, the machine vision-based polishing machine tool workpiece self-locating method according to the embodiment of the invention comprises the following steps:
s1, calibrating a machine vision system (a camera and a lens) after determining an image acquisition mode and an installation position. The aim of calibration is to calculate the conversion relation between the pixel coordinates and the machine tool coordinates in the image;
S2, acquiring a workpiece image acquired by a machine vision system and machine tool coordinates corresponding to the machine vision system, detecting pixel coordinates of the edge of the workpiece according to the workpiece image, specifically, firstly performing morphological closing operation to eliminate noise, then calculating an optimal segmentation threshold value of each picture according to a simple threshold method, performing binarization, then obtaining the edge of the workpiece of a binary image by using a morphological algorithm, performing edge detection on an original image along the extracted edge by using an improved Canny algorithm to obtain a single workpiece edge, performing first-order difference on the edge of the workpiece to remove outlier noise points to obtain a point set, extracting edge sub-pixel coordinates in the original image by using an interpolation algorithm according to a known point set and gradient directions thereof, and finally obtaining a complete workpiece edge by polynomial fitting.
And S3, obtaining the machine tool coordinates of the workpiece and the machine tool coordinates of the center of the workpiece according to the pixel coordinates of the edge of the workpiece, the machine tool coordinates corresponding to the machine vision system and the conversion relation between the pixel coordinates and the machine tool coordinates.
In the image acquisition process, a visual system is controlled by a servo motion of a numerical control machine tool to acquire a plurality of images along the edge of a workpiece, and the current machine tool coordinates are recorded, and according to the position coordinates of the acquired images and the images, the machine tool coordinates corresponding to the edge of the workpiece in each image can be calculated, so that the super-view-field high-precision measurement is realized, the method is suitable for high-precision positioning of workpieces with any size, and the machine tool workpiece self-locating method can realize non-contact positioning, and is high in precision and efficiency.
In order to better understand the above technical solutions, the following detailed description will refer to the accompanying drawings and specific embodiments.
The mechanical structure of the invention is shown in fig. 1, and comprises an industrial camera 2, a fixture mounting plate 3, a lens fixture 4, a point light source 5 and a telecentric lens 6. The fixture mounting plate 4 is mounted on the A-axis supporting beam 1 through bolts, the lens fixture 4 and the fixture mounting plate 3 are fixed through bolts, the lens fixture 4 and the telecentric lens 6 are connected through interference fit, and the camera can move along with the A-axis supporting beam 1.
As shown in fig. 2, in the machine vision-based polishing machine tool workpiece self-locating method, in the image acquisition process, according to the size of a workpiece, a servo motion system drives an industrial camera to a designated position to acquire a picture of the edge of the workpiece and record the current machine tool coordinate, the picture is transmitted into an industrial personal computer and then subjected to image processing to obtain the pixel coordinate of the edge of the workpiece, the machine tool coordinate of the workpiece can be calculated by using the calibrated parameters and the recorded machine tool coordinate, and the machine tool coordinate of the center of the workpiece can be calculated according to the edge coordinate. By the workpiece self-locating method, high-precision locating of workpieces with any size can be met.
As shown in fig. 3, the specific steps of the machine vision-based polishing machine tool workpiece self-locating method are as follows:
s1, after the positioning system is installed on a machine tool, the camera and the lens are required to be calibrated for the first time. The angle of the axis A of the machine tool is kept constant during each use, and calibration is not needed.
The positioning accuracy of the workpiece is greatly affected by the calibrating accuracy. The invention improves a nine-point calibration method, deduces from a telecentric imaging model, introduces the machine tool coordinate of a camera into a calibration process, finally obtains the conversion relation from the pixel coordinate to the machine tool coordinate, can solve 6 unknown parameters by using a least square method through nine known coordinate points, and obtains the conversion relation from the pixel coordinate to the machine tool coordinate as shown in a formula 1:
Wherein X M、YM is the machine tool coordinate of the edge of the workpiece, a, b, c, d, e, f is the parameter to be calibrated, u and v are the pixel coordinates of the edge of the workpiece, u 0、v0 is the image center coordinate, and X Mc、YMc is the coordinate of the camera on the machine tool.
The specific calibration process is as follows:
S101, positioning a round workpiece in a machine tool by using a dial indicator, wherein a machine tool coordinate point at the center of the round workpiece is marked as (x 1,y1), the center of an image is regarded as the center of a contact measuring head, a circle center sitting mark of the round workpiece is marked as (x 2,y2) by using a four-point method, and the difference between the center sitting mark and the circle center sitting mark is (deltax, deltay), wherein the coordinate of a camera on the machine tool is the mechanical coordinate+ (deltax, deltay) of a numerical control system.
S102, placing the calibration plate on a machine tool, taking a picture, detecting the circle centers of nine circles on the calibration plate, recording the pixel coordinates (u 1,v1)、(u2,v2)…(u9,v9), and recording the current camera coordinates as (X Mc,YMc).
S103, detecting the circle centers of all circles on the calibration plate in real time, moving the camera to enable the main image point to coincide with the circle centers of the calibration plate, wherein as shown in FIG. 8, the coordinates of the camera on the machine tool are the mechanical coordinates of the circle centers of the calibration plate;
s104, according to the measurement data and the formula (1), the undetermined parameter a, b, c, d, e, f can be solved by using a least square method.
S2, the image acquisition can be automatically completed by inputting the shape and the size of the workpiece. After the image is transmitted into the industrial personal computer, the processing flow is as shown in fig. 4:
s201, acquiring a workpiece image and converting the workpiece image into a gray scale image;
S202, eliminating noise in an original image by using morphological closed operation, wherein filtering processing is performed by the closed operation, so that edge information in the image is not destroyed;
s203, calculating an optimal segmentation threshold value by using a peak searching algorithm, and finishing image binarization by adopting a simple threshold value method;
As shown in fig. 5, although the original image collected by the machine vision system is noisy, the background and the workpiece have a great difference in gray value, and the corresponding gray histogram is shown in fig. 6, so that it can be seen that two peaks exist in the gray histogram. The existing gray level segmentation threshold method mainly comprises an iteration method, an Otsu threshold value, a triangle threshold value segmentation method, a simple threshold value segmentation method and the like. The iterative method is low in calculation efficiency and is not suitable for scenes with larger differences between the foreground and the background, so that the iterative method is not suitable for the example. Otsu threshold value and triangle threshold value segmentation are widely applied to the field of graphic processing as mature automatic threshold value segmentation methods, and as shown in fig. 9, the segmentation results of the Otsu threshold value and the triangle threshold value are shown, so that the noise still exists greatly.
The gray histogram of the image is analyzed, two obvious peaks are attached to the application condition of simple threshold segmentation, but the segmentation threshold is generally obtained by a method of manually judging the gray value of the valley bottom at the present stage, and the defects of low automation degree and unstable result are overcome. Aiming at the problem, introducing a peak searching algorithm into an image processing process, and searching a gray value of a valley between two peaks in a gray histogram, namely an optimal threshold for segmenting a background and a workpiece, wherein the result is shown in fig. 10, and the picture quality is obviously higher than the Otsu threshold and the triangle threshold segmentation result;
S204, expanding and corroding the binary image, and differencing the expanded image and the corroded image to obtain the edge of the workpiece;
S205, dividing the workpiece edge in the whole image into a plurality of small images with resolution of 200 x 200 along the workpiece edge, detecting the edges by using an improved Canny algorithm respectively, and finally splicing to obtain a discontinuous single side.
Specifically, in the steps, the workpiece edge part in the whole image is divided into a plurality of small images according to the rough positioning edge, and edge searching is carried out on each small image, so that the operation speed is improved, and the noise of most areas in the image can be restrained;
Meanwhile, since the size of the segmented image is small and a single-chosen edge exists in each image, the existing Canny algorithm is optimized as follows:
a. Improving a non-maximum inhibition process, expanding local inhibition along the gradient direction into global inhibition along the gradient direction, and finally obtaining a single discontinuous edge;
b. the bilateral threshold is cancelled, the upper and lower limit thresholds are not required to be manually adjusted, and the universality of the algorithm is stronger.
As shown in fig. 11, comparing the edge map detected by the original Canny algorithm with the edge map detected by the modified Canny algorithm, it can be seen that the edge effect detected by the modified Canny algorithm is better.
S206, because the image collected each time is a part of the edge of the workpiece, the slope of the edge in the image is constant (rectangular) or gradually changed (circular), the obtained edge is subjected to first-order difference, and the point with the abrupt slope is the noise point, and the noise point is eliminated.
S207, performing sub-pixel edge detection in the original image by using an interpolation method from edge coordinates and gradient directions, and fitting discrete points into a continuous edge by using a polynomial fitting method, as shown in FIG. 7.
S3, according to the detected pixel coordinates of the edge of the workpiece, the pixel coordinates can be converted into machine tool coordinates by the formula (1).
For a round workpiece, the center coordinates of the round workpiece can be obtained by adopting a four-point method according to the edge coordinates, and for a rectangular workpiece, the corner coordinates are obtained according to the edge coordinates, and the intersection point of the diagonal connecting lines is the center of the rectangle.
After the calibration was completed, a repeatability test was performed, and the test results are shown in Table 1, with X-direction repeatability of 1.3um and Y-direction repeatability of 5.5um. When the manual centering is performed, the precision is always required to be within 20um, so that the locating system can meet the actual processing requirement.
TABLE 1 results of repeatability experiments
The embodiment of the invention also discloses a polishing machine tool workpiece self-locating system based on machine vision, which comprises a control unit, an industrial camera 2, a clamp mounting plate 3, a lens clamp 4, a point light source 5 and a telecentric lens 6, wherein the clamp mounting plate 4 is arranged on the A-axis supporting beam 1, the lens clamp 4 is arranged on the clamp mounting plate 3, the lens clamp 4 and the telecentric lens 6 are connected through interference fit, and the control unit is connected with the industrial camera 2 and a machine tool servo motion mechanism and is used for executing the steps of the method according to the picture shot by the industrial camera 2 and the coordinate information of the machine tool servo motion mechanism so as to obtain the machine tool coordinates of the workpiece and the machine tool coordinates of the center of the workpiece.
The invention selects the telecentric lens with small distortion, the working distance is 220mm, interference phenomenon can not occur in the non-contact measurement, processing and positioning processes, the installation is simple, an additional device is not needed, the vision system and the numerical control system of the machine tool are mutually communicated, automatic image acquisition, workpiece center point calculation and workpiece offset setting can be realized, human factor intervention is reduced, the workpiece positioning stability is improved, the vision technology is applied to a polishing machine tool, the image acquisition is carried out based on the feedback of the numerical control machine tool, the limitation of camera view field can be broken, the high-precision positioning of workpieces with any size is realized, the image processing technology is used for detecting the edge coordinates of the workpieces, and compared with the traditional contact measuring head and dial gauge, the data of a plurality of points can be acquired at one time, and the workpiece positioning stability and efficiency are improved.
The embodiments of the invention also disclose a computer program product comprising a computer program which, when run by a processor, performs the steps of the method as described above.
The embodiments of the present invention further disclose a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method as described above.
The embodiment of the invention also discloses a polishing machine tool workpiece self-locating system based on machine vision, which comprises a memory and a processor which are connected with each other, wherein the memory is stored with a computer program which executes the steps of the method when being run by the processor.
The media and system of the present invention correspond to the methods described above, as well as having the advantages described above.
The present invention may also be implemented in whole or in part by hardware associated with computer program instructions, which may be stored in a computer-readable storage medium, the computer program, when executed by a processor, implementing the steps of the method embodiments described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. Computer readable storage media includes any entity or device capable of carrying computer program code, recording media, USB flash disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random access Memory (RAM, random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. The memory is used for storing computer programs and/or modules, and the processor implements various functions by running or executing the computer programs and/or modules stored in the memory and invoking data stored in the memory. The memory may include high speed random access memory, but may also include non-volatile memory such as a hard disk, memory, plug-in hard disk, smart memory card (SMART MEDIA CARD, SMC), secure Digital (SD) card, flash memory card (FLASH CARD), at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device, etc.
The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above examples, and all technical solutions belonging to the concept of the present invention belong to the protection scope of the present invention. It should be noted that modifications and adaptations to the invention without departing from the principles thereof are intended to be within the scope of the invention as set forth in the following claims.

Claims (10)

1.一种基于机器视觉的抛光机床工件自寻位方法,其特征在于,包括步骤:1. A method for self-positioning of a workpiece of a polishing machine tool based on machine vision, characterized in that it comprises the steps of: S1、对机器视觉系统进行标定,解算出像素坐标与机床坐标之间的转换关系;S1. Calibrate the machine vision system and calculate the conversion relationship between pixel coordinates and machine tool coordinates; S2、获取机器视觉系统所采集的工件图像以及机器视觉系统相对应的机床坐标,并根据工件图像检测工件边缘的像素坐标;S2, acquiring a workpiece image acquired by a machine vision system and a machine tool coordinate corresponding to the machine vision system, and detecting the pixel coordinates of the edge of the workpiece according to the workpiece image; S3、根据工件边缘的像素坐标、机器视觉系统相对应的机床坐标以及像素坐标与机床坐标之间的转换关系,得到工件的机床坐标和工件中心的机床坐标。S3. According to the pixel coordinates of the edge of the workpiece, the machine tool coordinates corresponding to the machine vision system, and the conversion relationship between the pixel coordinates and the machine tool coordinates, the machine tool coordinates of the workpiece and the machine tool coordinates of the center of the workpiece are obtained. 2.根据权利要求1所述的基于机器视觉的抛光机床工件自寻位方法,其特征在于,步骤S2的具体过程为:2. The method for self-positioning a workpiece of a polishing machine tool based on machine vision according to claim 1, characterized in that the specific process of step S2 is: S201、获取工件图像并转换为灰度图;S201, acquiring a workpiece image and converting it into a grayscale image; S202、消除图像中的噪声;S202, eliminating noise in the image; S203、计算出背景与工件的最佳分割阈值,完成图像二值化,得到二值图像;S203, calculating the optimal segmentation threshold between the background and the workpiece, completing the image binarization, and obtaining a binary image; S204、对二值图像进行膨胀和腐蚀,将膨胀图像和腐蚀图像作差得到工件初始边缘;S204, dilating and corroding the binary image, and subtracting the dilated image from the corroded image to obtain an initial edge of the workpiece; S205、沿着工件初始边缘将去噪后的图像分割为若干个小图像,并分别检测各小图像的工件边缘,将各小图像的工件边缘进行拼接,得到整张图像的工件边缘;S205, dividing the denoised image into a plurality of small images along the initial edge of the workpiece, detecting the workpiece edge of each small image respectively, and splicing the workpiece edge of each small image to obtain the workpiece edge of the entire image; S206、对整张图像的工件边缘进行一阶差分,剔除斜率突变的点;S206, performing first-order difference on the edge of the workpiece in the entire image, and eliminating points with sudden slope changes; S207、根据整张图像的工件边缘坐标和梯度方向,使用插值法在原灰度图像中进行亚像素工件边缘检测,并采用多项式拟合的方法将离散点拟合为一条连续的工件边缘,得到工件边缘像素坐标。S207, according to the workpiece edge coordinates and gradient direction of the entire image, use the interpolation method to perform sub-pixel workpiece edge detection in the original grayscale image, and use the polynomial fitting method to fit the discrete points into a continuous workpiece edge to obtain the workpiece edge pixel coordinates. 3.根据权利要求2所述的基于机器视觉的抛光机床工件自寻位方法,其特征在于,在步骤S203中,采用寻峰算法确定灰度直方图中两个峰值之间的峰谷,峰谷的灰度值即为分割背景与工件的最佳分割阈值。3. The method for self-positioning a workpiece of a polishing machine tool based on machine vision according to claim 2 is characterized in that, in step S203, a peak-finding algorithm is used to determine the peak and valley between two peaks in the grayscale histogram, and the grayscale value of the peak and valley is the optimal segmentation threshold for segmenting the background and the workpiece. 4.根据权利要求2所述的基于机器视觉的抛光机床工件自寻位方法,其特征在于,在步骤S205中,通过改进的Canny算法来检测各小图像的工件边缘;其中改进的Canny算法改进非极大抑制过程,将沿梯度方向的局部抑制扩展为沿梯度方向的全局抑制,以最终获得单条不连续的边缘。4. According to the machine vision-based self-positioning method for polishing machine tools, the feature is that in step S205, the workpiece edge of each small image is detected by an improved Canny algorithm; wherein the improved Canny algorithm improves the non-maximum suppression process, and expands the local suppression along the gradient direction to the global suppression along the gradient direction, so as to finally obtain a single discontinuous edge. 5.根据权利要求1-4中任意一项所述的基于机器视觉的抛光机床工件自寻位方法,其特征在于,在步骤S3中,对于圆形工件,根据边缘坐标采用四点法求出其圆心坐标;对于矩形工件,根据边缘坐标求出角点坐标,对角连线的交点为矩形中心。5. The method for self-positioning a workpiece of a polishing machine tool based on machine vision according to any one of claims 1 to 4 is characterized in that, in step S3, for a circular workpiece, the coordinates of the center of the circle are calculated using the four-point method based on the edge coordinates; for a rectangular workpiece, the coordinates of the corner points are calculated based on the edge coordinates, and the intersection of the diagonal lines is the center of the rectangle. 6.根据权利要求1-4中任意一项所述的基于机器视觉的抛光机床工件自寻位方法,其特征在于,步骤S1的具体过程为:6. The method for self-positioning a workpiece of a polishing machine tool based on machine vision according to any one of claims 1 to 4, characterized in that the specific process of step S1 is as follows: S101、使用千分表在机床中定位一个圆形工件,圆形工件中心的机床机械坐标点记作(x1,y1),将图像中心视为接触式测头的中心,使用四点法测得圆形工件的圆心坐标记作(x2,y2),二者作差得到(Δx,Δy);则相机在机床上的坐标为:数控系统的机械坐标+(Δx,Δy);S101. Use a micrometer to locate a circular workpiece in a machine tool. The machine tool mechanical coordinate point of the center of the circular workpiece is recorded as (x 1 , y 1 ). The center of the image is regarded as the center of the contact probe. Use the four-point method to measure the center coordinate of the circular workpiece and record it as (x 2 , y 2 ). The difference between the two is (Δx, Δy). Then the coordinate of the camera on the machine tool is: the mechanical coordinate of the CNC system + (Δx, Δy). S102、将标定板放在机床上,拍摄一张图片,检测标定板上九个圆的圆心,并记录其像素坐标(u1,v1)、(u2,v2)…(u9,v9);记当前相机坐标为(XMc,YMc);S102, place the calibration plate on the machine tool, take a picture, detect the centers of the nine circles on the calibration plate, and record their pixel coordinates (u 1 , v 1 ), (u 2 , v 2 ) ... (u 9 , v 9 ); record the current camera coordinates as (X Mc , Y Mc ); S103、实时检测标定板上各圆的圆心,移动相机分别使像主点与标定板各圆心重合,相机在机床上的坐标即为标定板圆心的机械坐标,得到九个圆的圆心坐标,记作(XM1,YM1)、(XM2,YM2)…(XM9,YM9);S103, detect the center of each circle on the calibration plate in real time, move the camera so that the principal point coincides with the center of each circle on the calibration plate, the coordinates of the camera on the machine tool are the mechanical coordinates of the center of the calibration plate, and obtain the coordinates of the centers of the nine circles, recorded as (X M1 , Y M1 ), (X M2 , Y M2 )…(X M9 , Y M9 ); S104、根据测量数据和式(1),使用最小二乘法即可解出待定参数a、b、c、d、e、f,其中式(1)为从像素坐标到机床坐标的转换关系,具体为:S104. According to the measurement data and formula (1), the least square method can be used to solve the unknown parameters a, b, c, d, e, and f, wherein formula (1) is the conversion relationship from pixel coordinates to machine tool coordinates, specifically: 式中,XM、YM为工件边缘的机床坐标,a、b、c、d、e、f为待标定参数,u、v为工件边缘的像素坐标,u0、v0为图像中心坐标,XMc、YMc为相机在机床上的坐标。Where XM , YM are the machine tool coordinates of the workpiece edge, a, b, c, d, e, f are the parameters to be calibrated, u, v are the pixel coordinates of the workpiece edge, u0 , v0 are the image center coordinates, and XMc , YMc are the coordinates of the camera on the machine tool. 7.一种基于机器视觉的抛光机床工件自寻位系统,其特征在于,包括控制单元、工业相机(2)、夹具安装板(3)、镜头夹具(4)、点光源(5)和远心镜头(6);所述夹具安装板(4)安装在A轴支撑梁(1)上,所述镜头夹具(4)安装在夹具安装板(3)上,所述镜头夹具(4)和远心镜头(6)通过过盈配合相连;所述控制单元与所述工业相机(2)和机床伺服运动机构相连,用于根据工业相机(2)拍摄的图片和机床伺服运动机构的坐标信息,执行如权利要求1-6中任意一项所述方法的步骤以得到工件的机床坐标和工件中心的机床坐标。7. A machine vision-based workpiece self-positioning system for a polishing machine tool, characterized in that it comprises a control unit, an industrial camera (2), a fixture mounting plate (3), a lens fixture (4), a point light source (5) and a telecentric lens (6); the fixture mounting plate (4) is mounted on the A-axis support beam (1), the lens fixture (4) is mounted on the fixture mounting plate (3), and the lens fixture (4) and the telecentric lens (6) are connected by an interference fit; the control unit is connected to the industrial camera (2) and the machine tool servo motion mechanism, and is used to execute the steps of the method as described in any one of claims 1 to 6 to obtain the machine tool coordinates of the workpiece and the machine tool coordinates of the center of the workpiece according to the picture taken by the industrial camera (2) and the coordinate information of the machine tool servo motion mechanism. 8.一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器运行时执行如权利要求1-6中任意一项所述方法的步骤。8. A computer program product, comprising a computer program, characterized in that when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are executed. 9.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序在被处理器运行时执行如权利要求1-6中任意一项所述方法的步骤。9. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, executes the steps of the method according to any one of claims 1 to 6. 10.一种基于机器视觉的抛光机床工件自寻位系统,包括相互连接的存储器和处理器,所述存储器上存储有计算机程序,其特征在于,所述计算机程序在被处理器运行时执行如权利要求1-6中任意一项所述方法的步骤。10. A machine vision-based workpiece self-positioning system for a polishing machine tool, comprising a memory and a processor connected to each other, wherein a computer program is stored in the memory, and wherein the computer program executes the steps of the method as claimed in any one of claims 1 to 6 when executed by the processor.
CN202411308849.5A 2024-09-19 2024-09-19 A method and system for self-positioning workpiece of polishing machine tool based on machine vision Pending CN119115763A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411308849.5A CN119115763A (en) 2024-09-19 2024-09-19 A method and system for self-positioning workpiece of polishing machine tool based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411308849.5A CN119115763A (en) 2024-09-19 2024-09-19 A method and system for self-positioning workpiece of polishing machine tool based on machine vision

Publications (1)

Publication Number Publication Date
CN119115763A true CN119115763A (en) 2024-12-13

Family

ID=93765470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411308849.5A Pending CN119115763A (en) 2024-09-19 2024-09-19 A method and system for self-positioning workpiece of polishing machine tool based on machine vision

Country Status (1)

Country Link
CN (1) CN119115763A (en)

Similar Documents

Publication Publication Date Title
CN107341802B (en) Corner sub-pixel positioning method based on curvature and gray scale compounding
CN111047588A (en) A Graphical Measurement Method for Dimension of Small Shaft Parts
CN109934839A (en) A Vision-Based Workpiece Detection Method
US7257996B2 (en) Device and method for a quality test of a body
CN111062940A (en) Screw positioning and identifying method based on machine vision
CN111415376A (en) Automobile glass sub-pixel contour extraction method and automobile glass detection method
CN112697388B (en) Method for measuring attitude angle of hypersonic wind tunnel model based on schlieren image
JP2005538473A (en) A method for minimizing the influence of interference signals in the calculation of shape elements from coordinate points.
CN112907556A (en) Automatic measuring method for abrasion loss of rotary cutter based on machine vision
CN118875895B (en) Robot grinding method and system for local defects of blade
CN113222955A (en) Gear size parameter automatic measurement method based on machine vision
CN113538399A (en) A method, machine tool and storage medium for obtaining precise contour of workpiece
CN120107297A (en) A method and device for detecting the contour of a plunger ball head
CN117274040A (en) An image acquisition method suitable for automated image defect detection and its application
CN111415378B (en) Image registration method for automobile glass detection and automobile glass detection method
CN114140486B (en) A point cloud depth acquisition method based on normal projection
CN110864671B (en) A method for measuring the repeatability of robot positioning based on line-structured light fitting plane
CN119124047A (en) Flatness measurement method, device, equipment and storage medium
CN119115763A (en) A method and system for self-positioning workpiece of polishing machine tool based on machine vision
CN116399262B (en) Workpiece precision detection method, system and equipment
CN118196458A (en) A battery cover feature measurement method, device and storage medium based on line laser scanning
CN115713553B (en) Blind hole plate blind hole depth measuring method and related device
Yu et al. A Machine vision method for non-contact Tool Wear Inspection
CN110021027B (en) Edge cutting point calculation method based on binocular vision
CN114663455A (en) A Subpixel Extraction Method Based on Function Fitting

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