Working area positioning method for preparing polymer optical waveguide

By optimizing the inner contour of the optical waveguide frame and the positioning of the working area through image processing technology, combined with hand-eye calibration, the accuracy and stability of polymer optical waveguides prepared by the Mosquito method are improved, and the problems of low precision and high cost in the existing technology are solved. Efficient polymer optical waveguide preparation.

CN118550035APending Publication Date: 2024-08-27709TH RESEARCH INSTITUTE CHINA STATE SHIPBUILDING CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410624299.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

The existing Mosquito method for preparing polymer optical waveguides suffers from low accuracy, poor stability, cumbersome positioning system, insufficient human-computer interaction interface support, complex editing robot arm motion paths, and poor visualization of prefabricated products, resulting in high cost and poor fit of the preparation system. The degree is low and it is difficult to improve the quality of polymer optical waveguides.

Method used

By obtaining the original grayscale image of the optical waveguide frame, using image processing technologies such as global threshold segmentation, opening operation, convex hull algorithm, and dynamic threshold segmentation, the inner contour and working area of ​​the optical waveguide frame are optimized and obtained, and combined with hand-eye calibration, the robot arm is obtained Transform matrix to improve positioning accuracy and operation accuracy.

Benefits of technology

The repeated positioning accuracy and visual positioning accuracy of the polymer optical waveguide have been achieved to the order of 0.001mm. It has good stability, simple operation, high degree of visualization and intelligence, reduced equipment and labor costs, and improved production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550035A
    Figure CN118550035A
Patent Text Reader

Abstract

The invention discloses a working area positioning method for preparing a polymer optical waveguide. The operation area positioning method comprises the following steps: S1, obtaining an original gray level image of an optical waveguide frame; s2, obtaining a first selected area and a second selected area according to the original grayscale image; the first selected area comprises the outer contour of the optical waveguide frame and an area surrounded by the outer contour, and the second selected area comprises the outer contour and the inner contour of the optical waveguide frame; s3, obtaining the inner contour of the optical waveguide frame according to the first selected area and the second selected area; and S4, filling the inner contour of the optical waveguide frame and finding a minimum enclosing rectangle to obtain an operation area. Through verification, the operation area positioning method is applied to preparation of the polymer optical waveguide through the Mosquito method, the repeated positioning precision and the visual positioning precision reach 0.001 mm order of magnitude, the stability is good, and the operation is simple.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of polymer optical waveguides, and more specifically, relates to a method for positioning an operation area for preparing a polymer optical waveguide. Background Art

[0002] Polymer optical waveguide is an optical transmission medium that can constrain optical signals to propagate within a channel. It is mainly composed of a core layer and a cladding layer. The refractive index of the core layer material is slightly higher than that of the cladding material, so that there is a guided mode in the optical waveguide, that is, the energy of this mode is not consumed in the cladding, it has an "evanescent" characteristic, and the mode can be transmitted along the axial direction.

[0003] The preparation process of polymer optical waveguides has been continuously developed. Currently, the four preparation processes of photolithography, laser direct writing, nano-imprinting and Mosquito have become the mainstream. Among them, the Mosquito method mainly uses the characteristics of high-viscosity UV-curable resin monomer materials with poor fluidity and slow diffusion between different materials. The core monomer material is continuously injected into the cladding monomer material through a three-axis high-precision automatic dispensing machine. As the dispensing machine mechanical arm moves according to the set trajectory, the corresponding core layer structure is formed. Finally, the uncured cladding and core monomer materials are uniformly cured by UV light to form a polymer optical waveguide.

[0004] like Figure 1 This is a schematic diagram of the operating principle of preparing optical waveguides by Mosquito method. The green part in the figure is the optical waveguide frame, and the red part is the channel of the optical waveguide. After the preparation is completed, the optical waveguide frame will be cut off. Since the optical waveguide frame is about the millimeter to decimeter level, the channel of the polymer optical waveguide is relatively close, generally around 250μm, and the accuracy must reach the order of 0.001mm to obtain a better effect. The optical waveguide frame is usually made of silicone material, and the inner edge is not completely smooth; the accuracy of the existing commercial automatic dispensing machine can only reach the order of 0.01mm, which cannot fit the preparation process of the Mosquito method well. Its open-loop control system has low accuracy, poor stability, and cumbersome positioning system. It still takes a lot of time for manual adjustment of the placement of the object to be prepared. At the same time, the human-computer interaction interface does not support the Mosquito method enough, the program for editing the motion path of the robot arm is complicated, the visualization of the prefabricated product is poor, and the degree of intelligence is insufficient. When the Mosquito method is used to prepare polymer optical waveguides, its preparation system has a narrow range of options, high cost, and low fit. If the quality of polymer optical waveguides is to be improved, it is necessary to improve the positioning accuracy of the optical waveguide frame and the operating accuracy of the robotic arm. Summary of the invention

[0005] In view of the above defects or improvement needs of the prior art, the present application provides a method for positioning an operation area for preparing a polymer optical waveguide, which aims to solve the problem of fine positioning in the process of preparing a polymer optical waveguide.

[0006] To achieve the above object, according to one aspect of the present application, a method for positioning an operating area for preparing a polymer optical waveguide is provided, which comprises the following steps:

[0007] S1: Acquire the original grayscale image of the optical waveguide frame;

[0008] S2: obtaining a first selected area and a second selected area according to the original grayscale image; the first selected area includes the outer contour of the optical waveguide frame and the area surrounded by it, and the second selected area includes the outer contour and the inner contour of the optical waveguide frame;

[0009] S3: obtaining an inner contour of the optical waveguide frame according to the first selected area and the second selected area;

[0010] S4: Fill the inner contour of the optical waveguide frame and find the minimum circumscribed rectangle to obtain the working area;

[0011] The method of obtaining the first selected area according to the original grayscale image in step S2 specifically includes:

[0012] A1: binarizing the original grayscale image by global threshold segmentation to obtain a first processed image;

[0013] A2: removing image noise of the first processed image by an opening operation to obtain a second processed image;

[0014] A3: Optimizing the rectangularity of the second processed image using a convex hull algorithm, and selecting a rectangular region with the largest pixel area in the optimized second processed image to obtain a first selected region.

[0015] Preferably, the structural element of the opening operation in step A2 is a rectangle.

[0016] Preferably, the method of obtaining the second selected area according to the original grayscale image in step S2 specifically includes:

[0017] The original grayscale image is subjected to a mean filtering algorithm to remove image noise, and then binarized by dynamic threshold segmentation to obtain a second selected area.

[0018] As further preferred, the method for obtaining the inner contour of the optical waveguide frame in step S3 specifically includes: taking the intersection of the first selected area and the second selected area, and selecting a connected area with the largest number of pixels therein to obtain the inner contour of the optical waveguide frame.

[0019] As a further preference, the offset of the dynamic threshold segmentation is less than or equal to 100.

[0020] According to another aspect of the present application, a method for preparing a polymer optical waveguide is provided, which, in addition to the above-mentioned method for locating the working area, further comprises obtaining a transformation matrix for robot arm operation by hand-eye calibration;

[0021] The robot arm prepares a polymer optical waveguide in the working area through the transformation matrix.

[0022] Preferably, the hand-eye calibration specifically comprises the following steps:

[0023] S1': Use the robotic arm to draw the calibration grid according to the preset coordinates;

[0024] S2': extract the coordinates of the intersection points of the calibration grid to obtain the calibration points;

[0025] S3': Obtain the transformation matrix according to the preset coordinates and the calibration points.

[0026] Preferably, the number of the preset coordinates in step S1 ′ is M rows×N columns, and both M and N are greater than or equal to 9.

[0027] Preferably, the step S2' specifically includes the following sub-steps:

[0028] S21': Acquire the original grayscale image of the calibration grid;

[0029] S22': acquiring all intersection areas of the calibration grid according to the original grayscale image;

[0030] S23': extract the average coordinates of all the intersection areas to obtain the calibration points.

[0031] In general, the working area positioning method of the present application is applied to the preparation of polymer optical waveguides by the Mosquito method. Since the working area positioning method is optimized, it has been verified that the repeat positioning accuracy and visual positioning accuracy have reached the order of 0.001 mm, with good stability, simple operation, high visualization and intelligence, which can reduce the equipment cost and labor cost in the process of preparing polymer optical waveguides by the Mosquito method and improve production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1It is a schematic diagram of the operating principle of preparing optical waveguide by dispensing using the Mosquito method in the prior art;

[0033] Figure 2 It is a schematic diagram of the process of the method for positioning the working area for preparing the polymer optical waveguide of the present application;

[0034] Figure 3 is a schematic diagram of a hardware system for preparing a polymer optical waveguide in an embodiment of the present application;

[0035] Figure 4 is a schematic diagram of the process of preparing a polymer optical waveguide according to an embodiment of the present application;

[0036] Figure 5 This is a schematic diagram of the effect before and after global threshold segmentation in an embodiment of the present application;

[0037] Figure 6 This is a schematic diagram of the first selected area in the embodiment of the present application;

[0038] Figure 7 It is a schematic diagram of the processing effect of the mean filtering algorithm in the operation area positioning step of the embodiment of the present application;

[0039] Figure 8 It is a schematic diagram of the dynamic threshold segmentation effect of the operation area positioning step in the embodiment of the present application;

[0040] Fig. 9 This is a schematic diagram of the effect after the first selected area and the second selected area are intersected in the embodiment of the present application;

[0041] Fig.10 This is a schematic diagram of obtaining the working area in the working area positioning of the embodiment of the present application;

[0042] Fig.11 It is a schematic diagram of the processing effect of the mean filtering algorithm in the hand-eye calibration step of the embodiment of the present application;

[0043] Fig.12 Schematic diagram of the closing operation processing effect of the hand-eye calibration step in the embodiment of the present application;

[0044] Fig.13 It is a schematic diagram of the skeletonization processing effect of the hand-eye calibration step in the embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0046] The present application discloses a method for positioning an operation area for preparing a polymer optical waveguide. The method for positioning the operation area is combined with hand-eye calibration of a robot arm and can be used for preparing a polymer optical waveguide.

[0047] The working area positioning method comprises the following steps:

[0048] S1: Acquire the original grayscale image of the optical waveguide frame; in order to meet the positioning accuracy requirements, the imaging size captured by the lens needs to cover at least a range of 100 mm×100 mm to ensure that the size of the common optical waveguide frame is met; in some embodiments, the acquired DPI is above 750 and the bit depth is above 8; specifically, the target surface size and focal length can be calculated according to the actual working distance and field of view, and the required DPI can be calculated according to the resolution and actual field of view, and then a suitable camera and lens are selected for acquisition;

[0049] S2: obtaining a first selected area and a second selected area according to the original grayscale image; the first selected area includes the outer contour of the optical waveguide frame and the area surrounded by it, and the second selected area includes the outer contour and the inner contour of the optical waveguide frame;

[0050] S3: taking the intersection of the first selected area and the second selected area, and selecting a connected area with the largest number of pixels therein to obtain the inner contour of the optical waveguide frame;

[0051] S4: Fill the inner contour of the optical waveguide frame and find the minimum circumscribed rectangle to obtain the working area; the side length of the obtained minimum circumscribed rectangle may be slightly larger than the inner contour of the optical waveguide frame, but since after the polymer optical waveguide is prepared, the optical waveguide frame and part of the polymer adhered to the optical waveguide frame will be removed by cutting in the later processing, it will not affect the performance of the prepared polymer optical waveguide.

[0052] The method of obtaining the first selected area according to the original grayscale image in step S2 specifically includes:

[0053] A1: binarizing the original grayscale image by global threshold segmentation to obtain a first processed image;

[0054] A2: removing image noise of the first processed image by an opening operation to obtain a second processed image; in some embodiments, the opening operation preferably uses a rectangle as a structural element; preferably, the side length of the rectangular structural element is about 12% to 20% of the width of the optical waveguide frame; for example, when the width of the optical waveguide frame is 120 to 250 pixels, the side length of the rectangle as the structural element can be set to 10 to 50 pixels;

[0055] A3: The rectangularity of the second processed image is optimized using a convex hull algorithm, and then the rectangular area with the largest pixel area in the optimized second processed image is selected based on the two criteria of rectangularity and area to obtain a first selected area; the threshold selected using rectangularity is usually set to 0.9 to 1.

[0056] The method of obtaining the second selected area according to the original grayscale image in step S2 specifically includes:

[0057] B1: removing image noise from the original grayscale image by using a mean filtering algorithm to obtain a fourth processed image;

[0058] B2: binarization is performed through dynamic threshold segmentation to obtain the second selected area; since the first selected area includes the outer contour of the optical waveguide frame and the area surrounded by it, the second selected area includes the outer contour and inner contour of the optical waveguide frame; in step S3, after the intersection of the two is taken, it actually still includes two areas: the outer contour and inner contour of the modified optical waveguide frame; since the algorithms used in the first selected area and the second selected area are different, although the edge of the outer contour can be calculated in the same way, after the intersection is taken, the outer contour of the modified and the outer contour of the optical waveguide frame in the original second selected area are different; since in step S3, the inner contour of the optical waveguide frame is obtained by selecting the connected area with the largest pixel, it is necessary to ensure that After this step, the area of ​​the outer contour is further reduced; the parameters of the convex hull algorithm and the dynamic threshold segmentation are the key; the bit depth of the image and the light changes will affect the selection of parameters. After the parameters of the convex hull algorithm are fixed, the outer contour of the first selected area is fixed. The smaller the grayscale threshold of the dynamic threshold segmentation is set, the larger the area of ​​the inner contour will be after the intersection step, and the area of ​​the outer contour will not increase further. Therefore, as long as the grayscale threshold is small enough, the goal of only screening out the inner contour of the optical waveguide frame can be achieved; the parameters of the dynamic threshold that affect the grayscale threshold include the mean filter size and the offset; in some embodiments, when the bit depth is 12, the mean filter size is 250, the offset is less than 100, and preferably less than 40.

[0059] After positioning the working area, the transformation matrix used for the robot operation is obtained through hand-eye calibration; then the robot converts the mapping coordinates used for the operation through the transformation matrix, and the polymer optical waveguide can be prepared in the working area.

[0060] The hand-eye calibration specifically comprises the following steps:

[0061] S1': Use the robotic arm to draw M rows × N columns of calibration grids according to the preset coordinates; usually the number of grids should be greater than 9 rows × 9 columns;

[0062] S2': extract the coordinates of the intersection of the calibration grid to obtain the calibration point; the reason why the present application uses the calibration grid instead of directly using the calibration point for positioning is that if the calibration point is directly used for positioning, the pixel area of ​​the calibration point is too small and not connected. In the subsequent steps, when segmenting the unconnected area and using dynamic threshold segmentation for screening, it is easy to select the noise together, causing difficulty in calibration;

[0063] S3': Obtain the transformation matrix according to the preset coordinates and the calibration points.

[0064] In some embodiments, the step S2' specifically includes the following sub-steps:

[0065] S21': Acquire the original grayscale image of the calibration grid;

[0066] S22': According to the original grayscale image, all the intersection areas of the calibration grid are obtained; specifically, firstly denoising is performed by a mean filtering algorithm, then the connected area composed of the calibration grid in the original grayscale image is extracted by dynamic threshold segmentation and the size of the pixel area, then a grid line with a width of 1 to 4 pixels is generated by a closing operation and skeletonization, and finally the intersection area of ​​the grid lines is obtained;

[0067] S23': respectively extracting the average coordinates of all the intersection areas to obtain the calibration points, where the number of the calibration points is M rows×N columns.

[0068] The following are examples:

[0069] Example

[0070] The embodiment of the present application adopts the Mosquito method to prepare the polymer optical waveguide. The hardware system includes an industrial camera, an industrial lens, a ring diffuse reflection light source, a motion controller, a host computer (including a human-computer interaction interface and various programs required, such as industrial camera driver, hand-eye calibration algorithm, operation area positioning algorithm, motion controller instructions, motion controller driver, etc.), an air pressure controller, a glue barrel, a needle and a three-axis motion platform, such as Figure 3 shown.

[0071] The industrial camera is fixed on the XY axis plane parallel to the three-axis motion platform through an integrated bracket extending from the side of the three-axis motion platform, and collects images of the object to be prepared (i.e., the silicone frame of the optical waveguide) from top to bottom; the industrial lens is installed on the industrial camera; the annular diffuse reflection light source is kept parallel to the XY axis plane and fixed on the industrial lens, thereby reducing direct strong light and eliminating the reflected light noise in the image collected by the industrial camera; the three-axis motion platform includes an XYZ three-axis mechanical actuator, and each axis mechanical actuator is composed of a servo motor with an encoder and a ball screw, the servo motor is connected to the matching servo driver, the servo driver is linked to the motion controller, and the motion controller is connected to the host computer to form a semi-closed loop control system.

[0072] like Figure 4 As shown, in this embodiment, it is necessary to first use the hardware system to position the silicone frame on the substrate, and then coat the silicone frame with monomer material to prepare the optical waveguide; in the positioning and preparation process, a position control method is adopted, and the upper computer sends an application program instruction to the motion controller, and the motion controller converts it into a low-level motion control instruction, that is, performs an equivalent transformation on the planned position, and finally outputs a control pulse signal to the servo driver, and the servo driver controls the rotation of the servo motor, and the rotation of the servo motor drives the load on the ball screw to perform linear motion in the axial direction, thereby realizing the free movement of the robot arm in three-dimensional space: X-axis machine The Y-axis mechanism is responsible for executing left and right movements in the horizontal direction; the Y-axis mechanism is responsible for executing forward and backward movements in the horizontal direction, and the multifunctional platform is placed on the Y-axis for placing the object to be prepared; the Z-axis mechanism is responsible for executing up and down movements in the vertical direction, and the hanging plate is placed on the Z-axis for fixing the glue barrel; the air pressure controller is connected to the motion controller, and the upper computer sends application instructions to the motion controller, and the motion controller outputs IO signals to the belt control air pressure controller to control the air pressure size, pressure duration and opening and closing of the dispensing valve, so as to realize the polymer monomer material in the glue barrel being squeezed out from the needle and coordinated with the three-axis motion platform to complete the positioning or the coating process of the entire core layer structure.

[0073] The host computer has a human-computer interaction interface, which controls the industrial camera to capture images of the silicone frame. The captured images are transmitted to the host computer for processing. The coordinates that the robot needs to operate are determined by the operating area positioning algorithm based on the characteristic points, characteristic lines or characteristic shapes of the optical waveguide.

[0074] In this embodiment, the parameters of the industrial camera are shown in Table 1, and the parameters of the camera lens are shown in Table 2.

[0075] Table 1 Industrial camera performance indicators

[0076] performance parameter sensor IMX226 Sensor Type 1 / 1.7”CMOS Shutter type Rolling Shutter Shutter exposure 143μS~1S Resolution 4000×3000 Frame rate 9 Bit Depth 12 Image Color Black and White Pixel 1.85×1.85 Pixel 12.4MP Lens mount C Data Interface GigE, PoE

[0077] Table 2 Industrial lens performance indicators

[0078]

[0079] The following content mainly describes in detail the process of equivalent transformation, which includes operation area positioning and hand-eye calibration; the purpose of the operation area positioning is to collect the image of the optical waveguide frame (silicone frame in this embodiment), set the operation area, and obtain the specific position of the optical waveguide channel in the operation area; the purpose of hand-eye calibration is to correspond the working area of ​​the manipulator to the specific position of the optical waveguide channel. For the convenience of description, this embodiment sets the area with a pixel gray value of 0 as the selected area. In actual operation, it can be set to the pixel with the highest gray value or other gray values ​​according to the specific algorithm.

[0080] The operation area positioning algorithm includes the following steps:

[0081] S1: Collecting the original grayscale image of the optical waveguide frame; the grayscale image of the optical waveguide frame can be collected by an industrial camera; since the size of the optical waveguide in this embodiment is 7mm×32mm, in order to ensure the positioning accuracy, the DPI used by the industrial camera is 750, and the collection range is about 40mm×50mm field of view;

[0082] S2: obtaining a first selected area and a second selected area according to the original grayscale image; the first selected area includes an area surrounded by the outer contour of the optical waveguide frame, and the second selected area includes the outer contour and the inner contour of the optical waveguide frame; the step A of obtaining the first selected area and the step B of obtaining the second selected area will be described in detail later in this embodiment;

[0083] S3: Obtaining the inner contour of the optical waveguide frame by taking the intersection of the first selected area and the second selected area;

[0084] S4: Finally, fill the inner contour of the selected optical waveguide frame to obtain the inner contour and the area it encloses, such as Fig.10 As shown in a, the minimum bounding rectangle is further obtained, which is the working area, as shown in Fig.10 As shown in b; it should be noted that in the working area, the black part in the figure is the original collected optical waveguide frame, the grayscale value of the red / blue part is 0, and the grayscale value of the other part is 255. The figure is used to indicate the effect without adopting a binary representation method.

[0085] A: Obtaining the first selected area includes the following sub-steps:

[0086] A1: performing global threshold segmentation on the original grayscale image according to formula (1) to obtain a first binary processed image;

[0087]

[0088] Wherein, (x, y) is the coordinate of the pixel point on the image, f0(x, y) is the original grayscale image, t is the preset threshold of the global threshold segmentation, and f1(x, y) is the first processed image; in this embodiment, the grayscale value of the pixel ranges from 0 to 255, and in actual operation, it can be set according to the value range of the grayscale image itself. The setting of the threshold t is related to the brightness of the image. In this embodiment, t is integrated into the upper computer human-computer interaction interface as a variable, and its value is controlled by the slider and the wheel selection box control, and the segmentation effect is observed in real time to achieve an ideal segmentation effect, that is, the segmented area contains only the inner contour of the optical waveguide frame as much as possible;

[0089] like Figure 5 As shown in the figure, a is the image before global threshold segmentation; b, c, d are the images after global threshold segmentation when t is 20, 30, and 80 respectively. It should be noted that the red part in the figure bd has a gray value of 0 after global threshold segmentation, while the gray value of the part other than red is 255 after global threshold segmentation. The figure is to indicate that the segmentation effect is not represented in a binary manner; Figure 5 It is obvious that when t=30, the optical waveguide frame is neither disconnected nor connected to the background, and the segmentation effect is the best.

[0090] A2: Performing an opening operation on the first processed image to obtain a second processed image f2(x, y) to remove small isolated noise points, smooth the region boundary, or disconnect two regions; the opening operation is divided into corrosion processing and expansion processing;

[0091] The corrosion process can be determined by formula (2), where set A = {f1(x, y)}; set B is a pre-set first structural element including the first anchor point; set B z is the new set obtained by translating the set B by z pixels. The principle is to first put the first structural element into the image C, traverse each pixel in the image C with the first anchor point, calculate the minimum gray value of all pixels in the area corresponding to / covered by the first structural element (the minimum gray value is 0 for the binary image), and assign this minimum gray value to the pixel corresponding to the anchor point, and obtain the first processed image f1′(x,y) after the corrosion process, f1′(x,y)∈C;

[0092]

[0093] In this embodiment, the first structural element selects a rectangular pixel area of ​​size 20×20, and the first anchor point is its central pixel. The size of the rectangular structural element should be selected according to the actual application and the resolution of the image. In actual operation, the side length of the rectangular pixel area can be set as a variable a, which is integrated into the upper computer human-computer interaction interface, and its value is controlled by the slider and the wheel selection box control. The size of the variable value can be adjusted in real time to achieve the ideal effect of removing image background noise; the first structural element is set as a rectangular pixel area because the rectangular pixel area tends to make the inflection point of the contour of the image to be processed have the characteristics of horizontal or vertical segmentation, and the boundaries in the four directions of up, down, left and right are straight. Objects smaller than the structural element (burrs, small protrusions) can be removed; by selecting structural elements of different sizes, image areas of different sizes can be removed in the original image; even if two image areas are connected in a small area, when the rectangular pixel area is large enough, the two objects can be separated. For example, in this embodiment, the pixel size of the outer contour of the entire optical waveguide frame is approximately 640×2440, the frame width is 100 to 170 pixels, and the side length of the rectangular structural element is approximately 12% to 20% of the frame width; if the rectangular structural element is too large, the components of the silicone frame itself may be eliminated; if the rectangular structural element is too small, the noise may not be effectively eliminated.

[0094] The expansion process can be determined by formula (3), where set D is a pre-set second structural element including the second anchor point, and set D Δ is the new set obtained by translating the set D by Δ pixels. The principle is to put the same structural element into f1′(x,y), traverse each pixel in f1′(x,y) with the anchor point of the structural element, calculate the maximum grayscale value of the pixels in the corresponding / covered area of ​​the second structural element (the maximum grayscale value is 255 for the binary image), and assign this maximum grayscale value to the pixel corresponding to the anchor point to obtain the second processed image f2(x,y);

[0095]

[0096] A3: Segment the unconnected areas in the second processed image, and then use the convex hull algorithm to select the area within the entire outer edge of the optical waveguide frame, and the area will have a good rectangularity, so as to obtain the third processed image.

[0097] According to the rectangularity threshold of 0.9, the rectangularity of the discrete area of ​​the third processed image is selected. The threshold can be integrated into the human-computer interaction interface of the host computer as a variable, and its value is controlled by the slider and the wheel selection box control, thereby controlling the selected area; at this time, the selected area with the largest pixel area and the rectangularity that meets the requirements is selected as the first selected area, that is, the area surrounded by the outer contour of the optical waveguide frame.

[0098] like Figure 6 As shown, it can be seen that the final first selected area covers a rectangular area including the optical waveguide frame, namely the red area in the figure; the grayscale value of the red part in the figure is 0, while the grayscale value of the other part is 255. The figure is used to indicate that the segmentation effect is not represented in a binary manner.

[0099] B: Obtaining the second selected area, which includes the following sub-steps:

[0100] B1: Use the mean filtering algorithm to obtain the fourth processed image according to the original grayscale image; in formula (4), (x, y) is the pixel coordinate of a pixel point in the original grayscale image, f0(x, y) is the grayscale value of the pixel in the original grayscale image, S xy is a neighborhood with a size of m×n centered on the pixel, and the fourth processed image f4(x,y) is the grayscale value of the pixel after being processed by the mean filter algorithm. The values ​​of variables m and n are controlled by the slider and wheel selection box controls in the human-computer interaction interface of the host computer, and the size of the variable value can be adjusted in real time to achieve the ideal processing effect;

[0101]

[0102] like Figure 7 As shown, a is the original grayscale image and b is the fourth processed image; assuming that the pixel value of the optical waveguide frame width is G, the neighborhood side length of the filtering algorithm is usually set to 100% to 200% G; in this embodiment, the width of the optical waveguide frame is 100 to 170 pixels, and the outer contour size of the optical waveguide frame is about 640×2440 pixels. In this embodiment, m=n=250 is used for mean filtering algorithm processing, which is about twice the pixel value of the frame width; after processing, the overall image including the edge of the optical waveguide frame looks smoother.

[0103] B2: The fourth processed image is subjected to dynamic threshold segmentation by formula (5) to obtain a fifth processed image f5(x, y). The selected area in the fifth processed image is the second selected area, that is, the area including the outer contour and the inner contour of the optical waveguide frame. The dynamic threshold segmentation can screen out the target area, that is, the area of ​​light and dark contrast that already exists in the image, by comparing the gray value changes of the same pixel before and after smoothing and by setting the gray value offset. This embodiment can be determined by the following formula, where (x, y) is the pixel coordinate of a pixel point in image B, f0(x, y) is the gray value of the pixel in the original gray image, and f4(x, y) is the gray value in the fourth processed image. That is, the difference of the gray value of the same pixel before and after filtering is calculated to see whether it meets the set offset range. The output outer edge image f5 (x, y) is the binary image, and the area with a pixel gray value of 0 is called the selected area. Offset1 is the gray value offset, that is, the pixel points with a difference greater than offset1 are selected. Offset1 is usually 0 to 100. The value of the variable offset1 is integrated into the upper computer human-computer interaction interface, and its value is controlled by the slider and the wheel selection box control. The size of the variable value can be adjusted in real time. Because the optical waveguide frame is a black silicone frame, the inner and outer edges in its gray image have the characteristics of light and dark boundaries. This part of the area can be well segmented using mean filtering + dynamic threshold segmentation.

[0104]

[0105] like Figure 8 As shown in the figure, a, b, and c are the dynamic threshold segmentation results when the offset is set to 10, 30, and 50 respectively. It can be seen from the figure that Figure 8 The outline of the optical waveguide frame on a is integrated with the environment and difficult to distinguish. Figure 8 The outline of the optical waveguide frame in c is missing, and offset1=30 is finally selected. It should be noted that the red part in the figure has a grayscale value of 0 after dynamic threshold segmentation, while the grayscale value of the other parts is 255 after dynamic threshold segmentation. The figure is used to indicate that the segmentation effect is not represented in a binary manner.

[0106] The step S3 specifically includes:

[0107] S31: obtained in step A3 Figure 6 The first selected area is shown in step B2. Figure 8 b shows the second selected area, and the intersection of the two (or the union of the non-selected areas) is obtained Fig. 9 The blue area shown; it should be noted that the grayscale value of the blue part in the figure is 0, while the grayscale value of the other parts is 255. This is to indicate the effect without using a binary representation method.

[0108] S32: From Fig. 9 It can be seen that in addition to the inner contour area with the largest area, the blue part also includes a part of the outer contour area and some discrete small areas. The area with the largest pixel area is selected as the inner contour of the optical waveguide frame.

[0109] Hand-eye calibration includes the following sub-steps:

[0110] The specific steps of hand-eye calibration are as follows:

[0111] S1': Teach the robot arm to draw N = α × β custom grid graphics on the XY working plane with a fixed z value, and you can get 4 + [(α-2) + (β-2)] × 2 + (α-2) × (β-2) = α × β grid intersections. Record the coordinates of the grid intersections in the robot arm coordinate system in order (x1, y1), (x2, y2), (x3, y3), ... (x N-1 ,y N-1 )、(x N ,y N ) and used as calibration points to obtain the matrix G composed of the calibration point coordinates N×3 ; In order to ensure the positioning accuracy α, β need to be at least greater than or equal to 9;

[0112] in,

[0113] This step specifically includes:

[0114] S11'. Use the input control in the upper computer human-computer interaction interface to customize the coordinates of the upper left corner of the grid boundary (x1, y1) as the starting point for grid drawing;

[0115] S12'. Use the input controls in the upper computer human-computer interaction interface to customize the number of grid rows α and row spacing ΔX, and the number of grid columns β and column spacing ΔY; the higher the required accuracy, the larger the set value; ΔXΔY needs to be an integer multiple of the robot arm's accuracy; in this embodiment, ΔX=5mm, ΔY=5.9mm, β=6, α=17.

[0116] S13'. The coordinates of each grid intersection in the robot coordinate system can be calculated by the host computer software and recorded in a certain order;

[0117] For example, if the order is recorded from top to bottom and from left to right, if (x1, y1) is (X O ,Y O ), then (x2,y2) is (X O ,Y O +ΔY),(x 1+α ,y 1+α ) is (X O+ΔX,Y O ), (x N ,y N ) is (X O +(β-1)ΔX,Y O +(α-1)ΔY). In this embodiment, (x1, y1) is (0, 0).

[0118] S2': The grid image is captured by an industrial camera and sent to the host computer for image processing. The pixel coordinates (x, y) of the grid intersection are identified and located to obtain the coordinates of the calibration points (x1', y1'), (x2', y2'), (x3', y3'), ... (x N-1 ',y N-1 ')、(x N ',y N '), obtain the matrix G' composed of the coordinates of the calibration points N×3 ;

[0119] Right now,

[0120] This step specifically includes the following sub-steps:

[0121] S21': Use an industrial camera to collect the original grayscale image g0(x,y) of the grid image;

[0122] S22': extracting the intersection points of the grid image to obtain calibration points, which specifically includes the following sub-steps;

[0123] S221': Use the same mean filter algorithm as step B1 to process the grayscale image and obtain g1(x,y). However, the values ​​of variables m and n are different. The same values ​​of m and n are controlled by the slider and wheel selection box controls in the upper computer human-computer interaction interface. The size of the variable value can be adjusted in real time to achieve the ideal processing effect. In this step of this embodiment, about twice the grid line width, m = n = 27, is used for mean filter algorithm processing. Fig.11 As shown. Fig.11 a is the value before the mean filter algorithm is used. Fig.11 b is after processing. It can be seen that the lines of the grid image are clearer after processing by the mean filtering algorithm.

[0124] S222': Perform dynamic threshold segmentation on the image processed by S22' according to formula (6), select the pixel points whose difference is greater than offset2, and obtain g2(x, y). Similarly, the area where the pixel gray value is 0 is called the selected area; the value of the variable offset2 can be controlled by the slider and the wheel selection box control in the upper computer human-computer interaction interface, and the size of the variable value can be adjusted in real time to achieve the ideal segmentation effect, that is, the segmented area only needs to include the connected area composed of the grid image; in this embodiment, offset2 is 5;

[0125]

[0126] S223': Since the selected area of ​​g2(x, y) may contain darker points in the background in addition to the grid image, the connected area composed of the grid image can be used as the selected area by taking the maximum pixel area as the feature to obtain g3(x, y);

[0127] S224': performing a closing operation on g3(x, y) to make the boundary of the connected area of ​​the grid image flat, and obtaining g4(x, y); the order of the opening operation is opposite to that of step A2 in the operation area positioning algorithm, and the closing operation is followed by dilation and erosion; Fig.12 The middle blue area is the selected area before and after the closing operation. It can be seen that before the processing (Figure a), there are breaks on some grid lines, while after the processing (Figure b), the grid lines are more complete.

[0128] S225': Further skeletonize the selected area of ​​g4(x,y) to generate grid lines with a width of 1 to 4 pixels; but since we need to locate the intersection of the grid lines themselves rather than the grid lines, we need to further extract the skeletonized grid line intersections as the selected area to obtain g5(x,y). Fig.13 As shown, the green points in the figure are the selected areas after being processed in this step, and the black points are the original grid lines that have not been processed in this step.

[0129] S23': Since the width of the grid line in the previous step may be more than one pixel, the scattered selected areas in g5(x,y) are not a single discrete point. At this time, the set of average coordinates of the scattered selected areas in g5(x,y) is G'. N×3 .

[0130] S3': Assume there is a 3×3 matrix Meet G N×3 ·K 3×3 =G′ N×3 ; It is known that G N×3 and G′ N×3Under the premise of , the mapping relationship matrix K determined by formula (7) is obtained 3×3 Value; that is, the transformation matrix of hand-eye calibration.

[0131]

[0132] The working area has been obtained in the working area positioning algorithm, so the coordinate position of the polymer optical waveguide to be prepared in the working area can naturally be obtained. Then, according to the mapping relationship matrix obtained by the hand-eye calibration algorithm, the position information of the polymer optical waveguide to be prepared in the robot arm coordinate system can be known. Therefore, automatic positioning can be achieved by directly placing the optical waveguide frame on the processing position, and then the robot arm can accurately prepare the polymer optical waveguide in the positioning area without the need for complex manual positioning operations.

[0133] According to the positioning information of the polymer optical waveguide to be prepared, the control component controls the execution component to perform the dispensing operation in the Mosquito polymer optical waveguide preparation process on the object to be prepared, wherein the control component includes a motion controller, a host computer and a human-computer interaction interface, and the execution component includes an air pressure controller and a three-axis motion platform. Specifically, according to the positioning information of the object to be prepared, the positioning information is displayed on the human-computer interaction interface, and a button is drawn in the interactive window to draw a two-dimensional plane structure of the polymer optical waveguide core layer containing straight lines, arcs and elliptical graphics, and the processing parameters are set in the path editing table of the coating core layer, so that the execution component executes the application instructions issued by the user through the human-computer interaction interface, so that the robot arm moves according to the designed trajectory and the air pressure controller works according to the set parameters to perform the dispensing operation on the object to be prepared.

[0134] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for positioning an operating area for preparing a polymer optical waveguide, It is characterized in that The following steps are involved: S1: Acquire the original grayscale image of the optical waveguide frame; S2: obtaining a first selected area and a second selected area according to the original grayscale image; the first selected area includes the outer contour of the optical waveguide frame and the area surrounded by it, and the second selected area includes the outer contour and the inner contour of the optical waveguide frame; S3: obtaining an inner contour of the optical waveguide frame according to the first selected area and the second selected area; S4: Fill the inner contour of the optical waveguide frame and find the minimum circumscribed rectangle to obtain the working area; The method of obtaining the first selected area according to the original grayscale image in step S2 specifically includes: A1: binarizing the original grayscale image by global threshold segmentation to obtain a first processed image; A2: removing image noise of the first processed image by an opening operation to obtain a second processed image; A3: Optimizing the rectangularity of the second processed image using a convex hull algorithm, and selecting a rectangular region with the largest pixel area in the optimized second processed image to obtain a first selected region.

2. The method for positioning the working area according to claim 1, It is characterized in that The structural element of the opening operation in step A2 is a rectangle.

3. The method for positioning the working area according to claim 1, It is characterized in that The method of obtaining the second selected area according to the original grayscale image in step S2 specifically includes: The original grayscale image is subjected to a mean filtering algorithm to remove image noise, and then binarized by dynamic threshold segmentation to obtain a second selected area.

4. The method for positioning the working area according to claim 3, It is characterized in that The method for obtaining the inner contour of the optical waveguide frame in step S3 specifically includes: taking the intersection of the first selected area and the second selected area, and selecting a connected area with the largest number of pixels therein to obtain the inner contour of the optical waveguide frame.

5. The method for positioning the working area according to claim 3, It is characterized in that The offset of the dynamic threshold segmentation is less than or equal to 100.

6. A method for preparing a polymer optical waveguide, It is characterized in that The method for locating an operation area comprises the method as claimed in any one of claims 1 to 5; It also includes obtaining a transformation matrix for robot arm operation through hand-eye calibration; The robot arm prepares a polymer optical waveguide in the working area through the transformation matrix.

7. The preparation method according to claim 6, It is characterized in that The hand-eye calibration specifically comprises the following steps: S1': Use the robotic arm to draw the calibration grid according to the preset coordinates; S2': extract the coordinates of the intersection points of the calibration grid to obtain the calibration points; S3': Obtain the transformation matrix according to the preset coordinates and the calibration points.

8. The preparation method according to claim 7, It is characterized in that The number of the preset coordinates in step S1 ′ is M rows×N columns, and both M and N are greater than or equal to 9.

9. The preparation method according to claim 7, It is characterized in that The step S2' specifically includes the following sub-steps: S21': Acquire the original grayscale image of the calibration grid; S22': acquiring all intersection areas of the calibration grid according to the original grayscale image; S23': extract the average coordinates of all the intersection areas to obtain the calibration points.

10. A polymer optical waveguide prepared by the method according to any one of claims 6 to 9.