A TO optical device LD light strip positioning method and system

By using image processing technology to identify the bright spots and edges of the heat sink of TO devices, the problem of measuring the position of the light-emitting strip in the production of TO optical devices is solved, high-precision positioning of the light-emitting strip is achieved, and the welding accuracy and production efficiency of the device are improved.

CN115222719BActive Publication Date: 2025-09-23BEIJING KEXIN INST OF MASCH & ELECTRICITY TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210910015.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2025-09-23
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

The existing TO optical device production process lacks a high-precision and automated method for measuring the position of the light strip, resulting in welding accuracy that is difficult to meet high coupling efficiency requirements, and mechanical alignment and welding errors have a significant impact.

Method used

By collecting TO device images, using image processing technology to identify the bright spots and edges of the heat sink, combining Hough transform and edge detection, the position information of the light strip is determined to achieve high-precision positioning.

Benefits of technology

High-precision positioning of the center of the light strip is achieved, with a positioning accuracy of 2.0μm, which improves the production efficiency and quality of TO devices and meets the photoelectric conversion efficiency requirement of 95%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115222719B_ABST
    Figure CN115222719B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and system for locating a light strip of a TO optical device (LD). The method comprises: finding a heat sink bright spot on a TO device image using an identified TO device chassis, determining the range of the heat sink bright spot on the TO device image, and intercepting an image of the heat sink portion from a grayscale image after binarization of the TO device image based on the range of the heat sink bright spot; binarizing a local image of the heat sink to highlight the relatively dark LD light strip; extracting edge pixels of the heat sink based on the local binarized image, finding the straight line segment containing the most pixels as the lower edge of the heat sink rectangle, and then determining the rotation angle of the heat sink on the image; rotating the local image by the rotation angle, and then determining the upper end line segment of the heat sink based on the pixels of the local image, thereby obtaining the position information of the light strip. The method achieves high-precision measurement of the center position of the TO device LD light strip by acquiring a TO device image and performing relevant image processing and calculations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of high-end photoelectric conversion component production, and in particular to a method and system for positioning a TO (Transistor Outline) optical device LD light strip. Background Art

[0002] TO optical devices are photoelectric converters that convert electrical signals into optical signals for transmission. They are key components in optical communications and optoelectronic testing. Their structure primarily consists of a base and a cap, welded together. The base consists of a chassis, gasket, heat sink, and LD light strip. The chassis has a diameter of 6.0mm. The LD measures approximately 0.2mm x 0.1mm and is bonded to the heat sink using eutectic soldering. A microlens is machined into the cap.

[0003] Under ideal welding conditions, the center of the cap of the TO optical device should coincide with the center of the base, and then welding should be performed to achieve a tight combination of the two without gaps, thereby ensuring that the internal gas environment remains unchanged and improving the device yield rate. Current welding equipment uses a mechanical structure to clamp the base and a robotic arm to move the cap, relying on mechanical stability and motor movement accuracy to ensure accurate alignment of the two. However, the actual production process is affected by temperature, stress and mechanical wear, and long-term positioning repeatability is difficult to meet the accuracy requirements, requiring regular calibration of the clamping and motion mechanisms. In order to improve the production efficiency and quality of TO devices, there is an urgent need for an online positioning method for the light strip that can obtain high-precision position coordinates of the base center through digital means, thereby guiding the cap gripper to dynamically adjust the falling position and achieve high-precision measurement and alignment of the base and cap. However, there are currently no relevant technologies and equipment applied to the processing and production process of TO optical devices.

[0004] During actual production, due to mechanical alignment and welding errors, the LD light strip can deviate from the central rotation axis of the chassis. This also causes the light strip to deviate from the lens' focal point, impacting photoelectric conversion efficiency. To achieve 95% coupling efficiency in TO devices, the LD chip's lateral deviation should be within ±9μm. Currently, TO device production relies solely on mechanical and motion structures to ensure welding accuracy, without a corresponding positioning measurement method. Summary of the Invention

[0005] In order to address the problem that the position information of the LD light strip cannot be measured due to the lack of high-precision and automated measurement methods in the production process of TO devices, the purpose of the present invention is to provide a TO optical device LD light strip positioning method and system. By acquiring TO device images and performing relevant image processing and calculations, high-precision measurement of the center position of the TO device LD light strip can be achieved.

[0006] To achieve the above objectives, the present invention adopts the following technical solutions: a method for locating a LD light strip of a TO optical device, comprising: finding a heat sink bright spot on an image of the TO device using an identified chassis of the TO device, determining the range of the heat sink bright spot on the TO device image, and intercepting an image of the heat sink portion from a grayscale image after binarization of the TO device image based on the range of the heat sink bright spot; binarizing a local image of the heat sink to highlight the relatively dark LD light strip; extracting edge pixels of the heat sink based on the local binarized image, finding the straight line segment containing the most pixels as the lower edge of the heat sink rectangle, and then determining the rotation angle of the heat sink on the image; rotating the local image according to the rotation angle, determining the upper end line segment of the heat sink based on the pixels of the local image, and then obtaining the position information of the light strip.

[0007] Furthermore, determining the rotation angle of the heat sink on the image includes:

[0008] For the local binary image, the Canny operator is used to extract the edge pixels of the heat sink;

[0009] Hough transform is used to detect the straight line edge, and the straight line segment containing the most pixels is found to be the lower edge of the heat sink rectangle, and the angle of the lower edge of the heat sink is obtained at the same time;

[0010] Fit a straight line using all pixels on the lower edge and solve for the line's parameters A and B. The straight line model is described by Ax+By+1=0, where x and y are the pixel coordinates of the edge points.

[0011] The orientation of the lower edge of the heat sink is determined, and the rotation angle of the heat sink on the image is determined according to the angle theta and the orientation of the lower edge of the heat sink.

[0012] Furthermore, the method for determining the direction of the lower edge of the heat sink is:

[0013] Let numCol and numRow be the number of columns and rows of pixels in the local image of the heat sink, respectively. Substitute x = numCol / 2 into the linear model and solve for the corresponding y value.

[0014] If y<=numRow / 2, then the bottom edge is facing down, otherwise the bottom edge is facing up.

[0015] Furthermore, determining the rotation angle of the heat sink on the image includes:

[0016] If the angle theta of the lower edge of the heat sink is less than or equal to 0 and the bottom edge is facing upward, or the angle theta of the lower edge of the heat sink is greater than or equal to 0 and the bottom edge is facing downward, the rotation angle imgRoAngle=90+theta;

[0017] If the angle theta of the lower edge of the heat sink is > 0 and the bottom edge is upward, or the angle theta of the lower edge of the heat sink is < 0 and the bottom edge is downward, then the rotation angle imgRoAngle = -90 + theta.

[0018] Further, determining the upper segment of the heat sink according to the pixels of the local image includes:

[0019] After rotating the local image by the rotation angle, adjust the posture of the heat sink to the horizontal state;

[0020] Traverse each row of pixels in the local image, obtain the gray-scale data of each pixel in the row, and temporarily store it in a one-dimensional array;

[0021] Perform mean filtering on the original gray-scale data in this one-dimensional array, perform binaryzation operation on the gray-scale values of the filtered row pixels, and the bright line end in the binaryzation result of the row gray-scale data is the upper segment of the heat sink.

[0022] Further, determining the upper segment of the heat sink according to the pixels of the local image, and then obtaining the position information of the light-emitting bar includes:

[0023] Let the number of bright segments in the row gray-scale data be numSeg. If the number of bright segments numSeg < 4, then there is no light-emitting bar in this row, and search for bright segments in the next row;

[0024] ​​​​​​​​​​​​​​​At this time, the center of the j-th line segment is the possible center position of the light bar, and its row position rowLitImgClipRo and column position colLitImgClipRo in the local image are recorded.

[0030] Furthermore, the method for locating the center of the chassis adopts a circle fitting method for positioning and identification.

[0031] Furthermore, the method for locating the center of the chassis includes:

[0032] Read the TO device image and perform a binarization operation to obtain a binary image;

[0033] A square morphological template with a preset side length of pixels is created, and a graphics opening operation is applied to the binary image, followed by a graphics closing operation to eliminate discrete bright spot particles and fill the dark holes on the bright spots.

[0034] In binary images, connected region analysis is performed to identify and distinguish independent bright spots.

[0035] Traverse all connected bright spots and determine whether the bright spot is a rectangular heat sink based on its area;

[0036] After finding the heat sink bright spot, solve the geometric center coordinate vector of the heat sink bright spot;

[0037] Extract all edge pixels of the binary image, identify edge points on the chassis contour from all edge points, and perform outer contour fitting, optimization, and chassis center positioning.

[0038] A TO optical device LD light strip positioning system comprises: a first processing module, which uses an identified chassis of the TO device on a TO device image to locate a heat sink bright spot on the chassis, determine the range of the heat sink bright spot on the TO device image, and intercept an image of the heat sink portion from a grayscale image after binarization of the TO device image based on the range of the heat sink bright spot; a local binarization module, which binarizes a local image of the heat sink to highlight the relatively dark LD light strip; a second processing module, which extracts edge pixels of the heat sink based on the local binarized image, finds the straight line segment containing the most pixels as the lower edge of the heat sink rectangle, and further determines the rotation angle of the heat sink on the image; and a position information acquisition module, which rotates the local image according to the rotation angle, determines the upper end line segment of the heat sink based on the pixels of the local image, and further obtains the position information of the light strip.

[0039] The present invention has the following advantages due to the adoption of the above technical solution:

[0040] The present invention's automatic light bar identification and positioning method can accurately identify and locate the light bar's center position even when the TO device chassis is rotated at any angle. With a positioning accuracy of 1 pixel, the spatial positioning accuracy of the light bar's center can reach 2.0μm. By combining the positioning accuracy of the chassis and light bar, this method can accurately determine the light bar's deviation from the chassis center to 3.0μm, truly achieving automated and high-precision measurement of light bar positioning errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a flow chart of a method for positioning a TO optical device LD light strip in one embodiment of the present invention;

[0042] Figure 2 is a local binary image of a heat sink in one embodiment of the present invention;

[0043] Figure 3 is an edge pixel point of a heat sink in one embodiment of the present invention;

[0044] Figure 4 is the lower edge of the heat sink in one embodiment of the present invention;

[0045] Figure 5 is a partial image of the heat sink after rotation in one embodiment of the present invention;

[0046] Figure 6 is the grayscale of the pixels in the row where the light bar is located in one embodiment of the present invention;

[0047] Figure 7 is the grayscale of the pixels in the row where the light-emitting strip is located after filtering in one embodiment of the present invention;

[0048] Figure 8 is the correspondence between the binarization result of the row grayscale data and the upper end line segment of the heat sink in one embodiment of the present invention;

[0049] Figure 9 is a binary image of a TO device chassis in one embodiment of the present invention;

[0050] Figure 10 is a binary image after morphological opening and closing operations in one embodiment of the present invention;

[0051] Figure 11 is a schematic diagram of the geometric center of a heat sink in one embodiment of the present invention;

[0052] Figure 12 is an edge extraction result in one embodiment of the present invention;

[0053] Figure 13 Schematic diagram of possible edge points of the outer contour of the chassis in one embodiment of the present invention;

[0054] Figure 14 1 is a schematic diagram of a preliminary fitting algorithm flow in one embodiment of the present invention;

[0055] Figure 15 1 is a flow chart of an accurate iterative approximation algorithm in one embodiment of the present invention;

[0056] Figure 16 are the contour edge points after simplification and optimization in one embodiment of the present invention;

[0057] Figure 17 It is the optimal contour circle fitting result in one embodiment of the present invention. DETAILED DESCRIPTION

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the described embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of the present invention.

[0059] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0060] In one embodiment of the present invention, a method for positioning a light strip of a TO optical device LD is provided. In this embodiment, Figure 1 As shown, the method includes the following steps:

[0061] 1) On the TO device image, using the identified chassis of the TO device, find the heat sink bright spot on the chassis, determine the range of the heat sink bright spot on the TO device image, and then cut out the image of the heat sink portion from the grayscale image after binarization of the TO device image based on the range of the heat sink bright spot;

[0062] 2) For the local image of the heat sink, a new binarization threshold is used (for example, 70% of the binarization threshold used when binarizing the TO device image) to binarize the local image to highlight the relatively dark LD light strip. The result is as follows: Figure 2 shown.

[0063] 3) Based on the local binary image, the edge pixels of the heat sink are extracted, and the straight line segment containing the most pixels is found to be the lower edge of the heat sink rectangle, thereby determining the rotation angle of the heat sink on the image.

[0064] The specific steps include:

[0065] 3.1) For the local binary image, the Canny operator is used to extract the edge pixels of the heat sink, such as Figure 3 shown.

[0066] 3.2) Use Hough transform to detect the straight line edge and find the straight line segment with the most pixels, which is the lower edge of the heat sink rectangle, such as Figure 4 At the same time, the angle theta of the lower edge of the heat sink is obtained.

[0067] 3.3) Fit a straight line using all pixels on the lower edge and solve for the parameters A and B of the line. The straight line model is described by Ax+By+1=0, where x and y are the pixel coordinates of the edge points, respectively.

[0068] 3.4) Determine the orientation of the lower edge of the heat sink and determine the rotation angle of the heat sink on the image based on the angle theta and orientation of the lower edge of the heat sink.

[0069] The method for determining the direction of the bottom edge of the heat sink is as follows: let numCol and numRow be the number of columns and rows of pixels in the local image of the heat sink, respectively. Then, substitute x = numCol / 2 into the linear model and solve for the corresponding y value. If y <= numRow / 2, the bottom edge is facing downward; otherwise, it is facing upward.

[0070] Calculate the heat sink's rotation angle imgRoAngle:

[0071] If the angle theta of the lower edge of the heat sink is less than or equal to 0 and the bottom edge is facing upward, or the angle theta of the lower edge of the heat sink is greater than or equal to 0 and the bottom edge is facing downward, the rotation angle imgRoAngle=90+theta;

[0072] If the angle theta of the lower edge of the heat sink is greater than 0 and the bottom edge is facing upward, or the angle theta of the lower edge of the heat sink is less than 0 and the bottom edge is facing downward, the rotation angle imgRoAngle = -90 + theta;

[0073] 4) After rotating the local image according to the rotation angle, the upper end line segment of the heat sink is determined based on the pixels of the local image, thereby obtaining the position information of the light strip;

[0074] The specific steps include:

[0075] 4.1) Rotate the local image by the imgRoAngle angle and adjust the heat sink posture to a horizontal state, such as Figure 5 As shown;

[0076] 4.2) Traverse each row of pixels in the local image, obtain the grayscale data of each pixel in the row, and temporarily store it in a one-dimensional array. The grayscale of the pixels in the row where the luminous bar is located is as Figure 6 shown.

[0077] 4.3) Perform mean filtering on the original grayscale data in this one-dimensional array. The grayscale values of the row pixels after filtering are as Figure 7 shown. Perform binarization on the grayscale values of the row pixels after filtering, with the threshold being grayThresh⁴SegDev. The bright line end in the binarization result of the row grayscale data is the upper segment of the heat sink, and the result is as Figure 8 shown. The four connected regions respectively describe the four straight segment microstructures on the upper surface of the heat sink.

[0078] In this embodiment, the window size is 6.

[0079] Due to the possible existence of interference light spots, the data binarization result may contain multiple (more than 4) bright line segments. The present invention adopts a 4-line segment recognition method based on cross-ratio invariance, including the following steps: <00.com /

[0080] 4.3.1) Let the number of bright line segments on the row grayscale data be numSeg. If the number of bright line segments numSeg < 4, then there is no luminous bar in this row, and search for bright line segments in the next row;

[0081] 4.3.2) When the number of bright line segments is greater than or equal to 4, solve the distance between two line segments, and calculate the cross-ratio cr according to the obtained distance;

[0082] For example, for four line segments i, j, k, and l, solve the distance between two line segments as follows:

[0083] Solve the distance disIK between line segments i and k;

[0084] Solve the distance disJK between line segments j and k;

[0085] Solve the distance disJL between line segments j and l;

[0086] Solve the distance disIL between line segments i and l;

[0087] Then calculate the cross-ratio cr = (disIK / disJK) / (disIL / disJL);

[0088] 4.3.3) Solve the absolute value absCR of the difference CR between the cross-ratio cr and the TO device design value;

[0089] If abscr < minCR and abscr < 0.1, then minCR = abscr;

[0090] At this time, the center of the j-th line segment is the possible center position of the light bar, and its row position rowLitImgClipRo and column position colLitImgClipRo in the local image are recorded.

[0091] 4.3.4) Continue processing the grayscale data of the next row of pixels and searching for the light bar. After completing the row pixel traversal, the stored cr, rowLitImgClipRo, and colLitImgClipRo are the light bar cross ratio and position information that best matches the TO device design.

[0092] In the above step 1), the chassis identification method of the TO device can be positioned and identified using the existing circle fitting method. Alternatively, the following method can be used for positioning and identification, specifically including the following steps:

[0093] The method for locating the center of the chassis includes the following steps:

[0094] 1.1) Read the TO device image and perform binarization operation to obtain a binary image. The binary image is as follows Figure 9 As shown in the figure, although the grayscale image of the chassis is out of focus, the binary image has a very good contour roundness. At the same time, it can be seen that there are discrete tiny bright spots and dark holes in the image.

[0095] 1.2) Create a square morphological template with a preset side length of pixels, apply a graphics opening operation to the binary image, and then apply a graphics closing operation to eliminate discrete bright spot particles and fill the dark holes on the bright spots, such as Figure 10 As shown in FIG. 1 , it can be seen that in the binary image (denoted as I_BwBase) after the opening and closing operations, the outlines of each part of the TO device are clear and independent of each other.

[0096] In this embodiment, the preferred preset side length is 9 pixels.

[0097] 1.3) In the binary image, perform connected region analysis to identify and distinguish each independent bright spot.

[0098] 1.4) Traverse all connected bright spots and determine whether the bright spot is a rectangular heat sink based on its area.

[0099] 1.5) After finding the heat sink bright spot, solve the geometric center coordinate vector of the heat sink bright spot, denoted as rcCnt, as follows Figure 11 Indicated by the middle cross.

[0100] 1.6) Use the Canny operator to extract all edge pixels of the binary image I BwBase. The result is as follows: Figure 12As shown in the figure, the edge points on the chassis contour are identified from all edge points, and the outer contour is fitted, optimized, and the chassis center is located.

[0101] In this embodiment, possible edge points of the chassis outer contour are found. All edge pixels are traversed and the distance from all edge pixels to the center of the heat sink bright spot rcCnt is calculated. If the distance is greater than a first preset value, the edge pixel is considered to be a possible edge point of the disk and its coordinates are saved in an array basePoEdge. The edge pixels in the array basePoEdge are then further streamlined and optimized to identify an accurate subset of edge points. Figure 13 As shown, the cyan points show possible edge points of the chassis outer contour.

[0102] In this embodiment, the first preset value is a preset value set after collecting chassis images for multiple times.

[0103] from Figure 13 It can be seen that the array of possible chassis edge points, basePoEdge, contains a large amount of interference data, such as edge pixels of interfering bright spots in the background and edge pixels of the chassis recessed areas. This paper uses an iterative approximation contour circle recognition and fitting algorithm to constrain the optimized recognition of edge points through accurate mathematical expressions, thereby improving the accuracy of edge recognition.

[0104] The chassis outer contour fitting and optimization adopts the preliminary fitting of the chassis and the precise iterative approximation of the chassis circle, which includes the following steps:

[0105] 1.6.1) Perform preliminary fitting of the chassis outer contour;

[0106] like Figure 14 As shown, the specific steps include:

[0107] 1.6.1.1) Select any three points from the possible chassis edge point array basePoEdge and determine whether the distance between any two points is greater than a preset number of pixels. If so, proceed to the next step; otherwise, repeat the determination.

[0108] Preferably, the preset pixel is 200 pixels;

[0109] 1.6.1.2) Use the nonlinear least squares method to fit a circle using the three-point data;

[0110] Among them, the general circle equation is: (xa) 2 +(yb) 2 =r 2 , [ab] is the coordinate of the center of the circle, r is the radius of the circle; (x, y) is the pixel coordinate of the edge point.

[0111] 1.6.1.3) Traverse each edge point in the array basePoEdge and calculate its distance to the fitted circle. If the distance is within a certain tolerance, the point is considered to be on the fitted circle. Count the number of edge points on the fitted circle and record their distance D to the fitted circle. Determine whether distance D is less than a second preset value. If so, proceed to the next step; otherwise, return to step 1.6.1.1).

[0112] The second preset value is also a preset value set after collecting chassis images for multiple times.

[0113] 1.6.1.4) Calculate the mean e and variance σ of all distances D 2 , and save the fitted circle with center and radius data as [ab r].

[0114] 1.6.2) Perform precise iterative approximation based on the preliminary fitting results to determine the final edge points and fitting circle;

[0115] In this embodiment, by determining whether the edge point is on the fitting circle, the edge fitting circle with the highest probability is obtained by step-by-step iteration, thereby solving the problem of obtaining the maximum likelihood contour circle in data containing a large amount of errors. Figure 15 As shown, the following steps are included:

[0116] 1.6.2.1) Iterate over each edge point in the array basePoEdge and find the distance d from each edge point to the circle [abr];

[0117] 1.6.2.2) Determine whether the edge point is compatible with circle [abr]. If |de| < 3σ, then the edge point is compatible with circle [abr] and adds the edge point to the compatibility matrix C. Otherwise, return to step 1.6.2.1); complete the compatibility check for all edge points in the array basePoEdge; σ represents the square root of the variance of the distance D.

[0118] 1.6.2.3) Fit a new circle using all compatible data in the compatibility matrix C and update the data [abr eσ];

[0119] Among them, the compatibility matrix C is a set of edge point coordinate data. These edge points all meet the corresponding circle parameters [abre σ], that is, they are located on the circle within a certain threshold range, so these parameters are compatible data sets.

[0120] 1.6.2.4) Obtain the number of compatible data points in the compatibility matrix C (i.e., the number of edge points located on the new circle). If the data volume has increased compared to the previous iteration, return to step 1.6.2.1) and begin a new iteration, continuously expanding the amount of compatible data. If the data volume does not increase, the maximum likelihood circle and its compatible dataset have been found. At this point, [abr] is the parameter of the best-fit circle for the chassis outline, and the center of the circle is the center of the chassis.

[0121] Get the final edge points and fitting circles, such as Figure 16 、 Figure 17 shown.

[0122] In one embodiment of the present invention, a TO optical device LD light strip positioning system is provided, comprising:

[0123] The first processing module locates a heat sink bright spot on the TO device image using the identified chassis of the TO device, determines the range of the heat sink bright spot on the TO device image, and extracts an image of the heat sink portion from the grayscale image of the binarized TO device image based on the range of the heat sink bright spot.

[0124] The local binarization module performs binarization on the local image of the heat sink to highlight the relatively dark LD light strips;

[0125] The second processing module extracts the edge pixels of the heat sink based on the local binary image, finds the straight line segment containing the most pixels as the lower edge of the heat sink rectangle, and then determines the rotation angle of the heat sink on the image;

[0126] The third processing module rotates the local image according to the rotation angle, determines the upper end line segment of the heat sink based on the pixels of the local image, and then obtains the position information of the light strip;

[0127] The positioning module converts the position coordinates of the light bar in the locally rotated image into the global image coordinate system, and determines the positioning error of the light bar in the horizontal and vertical coordinate directions of the image.

[0128] The system provided in this embodiment is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for specific processes and detailed contents, which will not be repeated here.

[0129] In one embodiment of the present invention, a computing device structure is provided. The computing device may be a terminal and may include: a processor, a communications interface, a memory, a display, and an input device. The processor, communications interface, and memory communicate with each other via a communications bus. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. When the computer program is executed by the processor, it implements a method for positioning a light strip of a TO optical device LD. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The communications interface is used to communicate with an external terminal via wired or wireless communication. The wireless communication may be achieved via Wi-Fi, a management network, NFC (near field communication), or other technologies. The display may be a liquid crystal display or an electronic ink display. The input device may be a touch layer covering the display, or a key, trackball, or touchpad provided on the housing of the computing device, or an external keyboard, touchpad, or mouse. The processor may call logic instructions in the memory to execute the following method:

[0130] On the TO device image, using the identified chassis of the TO device, the heat sink bright spot is found on the chassis, and the range of the heat sink bright spot on the TO device image is determined. Based on the range of the heat sink bright spot, the image of the heat sink portion is intercepted in the grayscale image after the TO device image is binarized; the local image of the heat sink is binarized to highlight the relatively dark LD light strip; based on the local binarized image, the edge pixels of the heat sink are extracted, and the straight line segment containing the most pixels is found to be the lower edge of the heat sink rectangle, thereby determining the rotation angle of the heat sink on the image; after rotating the local image according to the rotation angle, the upper end line segment of the heat sink is determined based on the pixels of the local image, thereby obtaining the position information of the light strip; the position coordinates of the light strip in the locally rotated image are converted to the global image coordinate system, and the positioning error of the light strip in the horizontal and vertical coordinate directions of the image is determined.

[0131] In addition, the logical instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0132] Those skilled in the art will understand that the structure of the above-mentioned computing device is only a partial structure related to the solution of the present application, and does not constitute a limitation on the computing device to which the solution of the present application is applied. The specific computing device may include more or fewer components, or combine certain components, or have a different component arrangement.

[0133] In one embodiment of the present invention, a computer program product is provided. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided by the above-mentioned method embodiments, for example, including: finding a heat sink bright spot on the chassis of the TO device using an identified TO device, determining the range of the heat sink bright spot on the TO device image, and intercepting an image of the heat sink portion from a grayscale image of the TO device after binarization based on the range of the heat sink bright spot; binarizing a local image of the heat sink to highlight a relatively dark LD light strip; extracting edge pixels of the heat sink based on the local binarized image, finding the straight line segment containing the most pixels as the lower edge of the heat sink rectangle, and thereby determining the rotation angle of the heat sink in the image; rotating the local image by the rotation angle, determining the upper end line segment of the heat sink based on the pixels of the local image, and thereby obtaining position information of the light strip; converting the position coordinates of the light strip in the locally rotated image to a global image coordinate system, and determining the positioning error of the light strip in the horizontal and vertical coordinate directions of the image.

[0134] In one embodiment of the present invention, a non-transitory computer-readable storage medium is provided. The non-transitory computer-readable storage medium stores server instructions, which cause a computer to execute the methods provided in the above embodiments, for example, including: finding a heat sink bright spot on an image of a TO device using an identified chassis of the TO device, determining the range of the heat sink bright spot on the TO device image, and intercepting an image of the heat sink portion from a grayscale image of the TO device after binarization based on the range of the heat sink bright spot; binarizing a local image of the heat sink to highlight a relatively dark LD light strip; extracting edge pixels of the heat sink based on the local binarized image, finding the straight line segment containing the most pixels as the lower edge of the heat sink rectangle, and thereby determining the rotation angle of the heat sink on the image; rotating the local image by the rotation angle, and determining the upper end line segment of the heat sink based on the pixels of the local image, thereby obtaining position information of the light strip; and converting the position coordinates of the light strip in the locally rotated image to a global image coordinate system to determine the positioning error of the light strip in the horizontal and vertical coordinate directions of the image.

[0135] The above embodiment provides a computer-readable storage medium, whose implementation principle and technical effects are similar to those of the above method embodiment, and will not be repeated here.

[0136] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0137] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for positioning a TO optical device LD light strip, characterized in that: include: On the TO device image, using the identified chassis of the TO device, the heat sink bright spot is found on the chassis, the range of the heat sink bright spot on the TO device image is determined, and the image of the heat sink portion is intercepted from the grayscale image after the TO device image is binarized based on the range of the heat sink bright spot; Binarize the local image of the heat sink to highlight the relatively dark LD light strips; The edge pixels of the heat sink are extracted based on the local binary image. The straight line segment containing the most pixels is the lower edge of the heat sink rectangle, and the rotation angle of the heat sink on the image is then determined. After the local image is rotated according to the rotation angle, the upper end line segment of the heat sink is determined according to the pixels of the local image, thereby obtaining the position information of the light strip.

2. The method for positioning a TO optical device LD light strip according to claim 1, wherein: Determining the rotation angle of the heat sink on the image includes: For the local binary image, the Canny operator is used to extract the edge pixels of the heat sink; Hough transform is used to detect the straight line edge, and the straight line segment containing the most pixels is found to be the lower edge of the heat sink rectangle, and the angle of the lower edge of the heat sink is obtained at the same time; Fit a straight line using all pixels on the lower edge and solve for the line's parameters A and B. The straight line model is described by Ax+By+1=0, where x and y are the pixel coordinates of the edge points. The orientation of the lower edge of the heat sink is determined, and the rotation angle of the heat sink on the image is determined according to the angle theta and the orientation of the lower edge of the heat sink.

3. The method for positioning a TO optical device LD light strip according to claim 2, wherein: The method for determining the direction of the lower edge of the heat sink is: Let numCol and numRow be the number of columns and rows of pixels in the local image of the heat sink, respectively. Substitute x = numCol / 2 into the linear model and solve for the corresponding y value. If y<=numRow / 2, then the bottom edge is facing down, otherwise the bottom edge is facing up.

4. The method for positioning a TO optical device LD light strip according to claim 2, wherein: Determining the rotation angle of the heat sink on the image includes: If the angle theta of the lower edge of the heat sink is less than or equal to 0 and the bottom edge is facing upward, or the angle theta of the lower edge of the heat sink is greater than or equal to 0 and the bottom edge is facing downward, the rotation angle imgRoAngle=90+theta; If the angle theta of the lower edge of the heat sink is greater than 0 and the bottom edge faces upward, or the angle theta of the lower edge of the heat sink is less than 0 and the bottom edge faces downward, the rotation angle imgRoAngle=-90+theta.

5. The method for positioning a TO optical device LD light strip according to claim 1, wherein: The step of determining the upper end line segment of the heat sink according to the pixels of the local image includes: After rotating the local image according to the rotation angle, the heat sink posture is adjusted to a horizontal state; Traverse each row of pixels in the local image, obtain the grayscale data of each pixel in the row, and temporarily store it in a one-dimensional array; The original grayscale data in the one-dimensional array is mean filtered, and the filtered row pixel grayscale values ​​are binarized. The bright line end in the binarized result of the row grayscale data is the upper end line segment of the heat sink.

6. The method for positioning a TO optical device LD light strip according to claim 1, wherein: The step of determining the upper end line segment of the heat sink according to the pixels of the local image, and then obtaining the position information of the light bar, includes: Let the number of bright line segments on the grayscale data row be numSeg. If the number of bright line segments numSeg is less than 4, then there is no light bar in this row, and the search for bright line segments in the next row is performed. When the number of bright line segments is greater than or equal to 4, solve the distance between each pair of line segments and calculate the intersection ratio cr based on the obtained distance; Calculate the absolute value absCR of the difference CR between the cross ratio cr and the TO device design value, and determine the row position rowLitImgClipRo and column position colLitImgClipRo of the possible center position of the light strip in the partial image; Continue to process the grayscale data of the next row of pixels and search for the light strip; after completing the row pixel traversal, the stored cr, rowLitImgClipRo, and colLitImgClipRo are the light strip cross ratio and position information that best matches the TO device design.

7. The method for positioning a TO optical device LD light strip according to claim 1, wherein: The method for locating the center of the chassis adopts a circle fitting method for positioning and identification.

8. The method for positioning a TO optical device LD light strip according to claim 1, wherein: The method for locating the center of the chassis comprises: Read the TO device image and perform a binarization operation to obtain a binary image; A square morphological template with a preset side length of pixels is created, and a graphics opening operation is applied to the binary image, followed by a graphics closing operation to eliminate discrete bright spot particles and fill the dark holes on the bright spots. In binary images, connected region analysis is performed to identify and distinguish independent bright spots; Traverse all connected bright spots and determine whether the bright spot is a rectangular heat sink based on its area; After finding the heat sink bright spot, solve the geometric center coordinate vector of the heat sink bright spot; Extract all edge pixels of the binary image, identify edge points on the chassis contour from all edge points, and perform outer contour fitting, optimization, and chassis center positioning.

9. A TO optical device LD light strip positioning system, characterized in that: include: The first processing module locates a heat sink bright spot on the TO device image using the identified chassis of the TO device, determines the range of the heat sink bright spot on the TO device image, and extracts an image of the heat sink portion from the grayscale image of the binarized TO device image based on the range of the heat sink bright spot. The local binarization module performs binarization on the local image of the heat sink to highlight the relatively dark LD light strips; The second processing module extracts the edge pixels of the heat sink based on the local binary image, finds the straight line segment containing the most pixels as the lower edge of the heat sink rectangle, and then determines the rotation angle of the heat sink on the image; The position information acquisition module rotates the local image according to the rotation angle, determines the upper end line segment of the heat sink based on the pixels of the local image, and then obtains the position information of the light strip.

Citation Information

Patent Citations

  • Peak value-based light spot image positioning method and system

    CN113554699A

  • Three-dimensional measurement apparatus

    US6181424B1