Machine vision-based to laser automatic production system and method
By using a machine vision-based automated production system for TO lasers, the pressing process can be monitored and adjusted in real time, solving the problems of unstable quality in manual pressing and poor consistency in mechanical automation, thus achieving efficient and stable laser production.
Patent Information
- Application Number
- CN202511121806.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-08-12
AI Technical Summary
The current laser pressing process relies heavily on manual labor, which makes it difficult to guarantee product quality and results in low production efficiency. Mechanical automated pressing methods cannot maintain high consistency due to factors such as material tolerance and differences in the consistency of TO lasers.
The TO laser automated production system, based on machine vision, includes automated laser equipment, industrial cameras, image backdrops, and machine vision modules. Through real-time image detection and automated control, it ensures that the pressing of each laser reaches the optimal state.
This improved product quality stability and production efficiency, reduced manual intervention, ensured that each laser met quality standards, adapted to the production needs of different batches of products, and enhanced the versatility and adaptability of the production line.
Smart Images

Figure CN120674909B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of semiconductor lasers, in particular to a TO laser automatic production system and method based on machine vision. BACKGROUND
[0002] The TO laser automatic production system based on machine vision is a system for precise manufacturing of TO packaged lasers using machine vision technology and automatic equipment. The system can ensure that the quality of the lasers meets the preset standards and improves the consistency and stability of the production line in an efficient and accurate production process.
[0003] With the increasing demand for intelligent home appliances and high-precision lasers, traditional manual or semi-automatic production methods cannot meet the requirements of efficiency and quality consistency. The TO laser automatic production system based on machine vision can accurately control the production process of lasers through real-time image detection, effectively improve production efficiency, reduce human errors, ensure product consistency and stability, and significantly improve the automation level of the production line, reduce production costs, and meet the market demand for high-quality and efficient production.
[0004] However, the existing laser compression process relies mainly on manual work, which cannot guarantee product quality and has low production efficiency. A small part relies on mechanical automation, using a fixed position parameter compression method for compression. However, due to factors such as material tolerance, TO laser consistency differences, assembly environment, and different product requirements, all lasers are compressed using a fixed position parameter method, which cannot keep the quality of each product stable and maintain high consistency. SUMMARY
[0005] In view of the above shortcomings of the prior art, the purpose of the embodiments of the present application is to provide a TO laser automatic production method based on machine vision, which can solve the technical problems that the existing laser compression process relies mainly on manual work, which cannot guarantee product quality and has low production efficiency. A small part relies on mechanical automation, using a fixed position parameter compression method for compression. However, due to factors such as material tolerance, TO laser consistency differences, assembly environment, and different product requirements, all lasers are compressed using a fixed position parameter method, which cannot keep the quality of each product stable and maintain high consistency.
[0006] In a first aspect of the embodiments of the present application, a TO laser automatic production system based on machine vision is provided, comprising: a laser automatic equipment, an industrial camera, an image background plate, and a machine vision module.
[0007] The laser automation equipment comprises a control motor, a start switch, a pressing device, a TO laser, a tooling table and a positioning clamp.
[0008] The industrial camera is installed on the side of the tooling table, and is used for collecting images projected by the TO laser on the image background plate in real time.
[0009] The image background plate is installed in front of the positioning clamp.
[0010] The machine vision module is used for processing the images collected by the industrial camera, and performing image processing on the images to output a control signal.
[0011] The control motor comprises a relay, which is used for controlling the pressing device to realize the pressing termination operation and the reset operation according to the control signal.
[0012] The second aspect of the embodiment of the application provides a TO laser automation production method based on machine vision, which is applied to the TO laser automation production system based on machine vision of the first aspect, and the method comprises the following steps:
[0013] S1: starting the laser automation equipment;
[0014] S2: collecting images projected by the TO laser on the background plate by the industrial camera;
[0015] S3: pre-processing the images to generate a mask;
[0016] S4: performing morphological processing on the mask to obtain a morphologically processed image;
[0017] S5: extracting a plurality of contours of the morphologically processed image;
[0018] S6: extracting all effective contours with contour areas in a preset area range from the contours, and calculating minimum circumscribed rectangles of the effective contours.
[0019] S7: screening the minimum circumscribed rectangles to determine a target area;
[0020] S8: judging whether the target area meets a width-height judgment principle and a circular area inclusion judgment principle; if yes, marking as a good product; otherwise, marking as a defective product;
[0021] S9: sending the judgment result as a control signal to the control motor;
[0022] S10: controlling the pressing device to perform the pressing termination operation and the reset operation according to the control signal.
[0023] In a third aspect, the present application provides a readable storage medium, which stores programs or instructions, and the programs or instructions are executed by a processor to implement the steps of the machine vision-based TO laser automatic production method according to the second aspect.
[0024] The technical scheme provided by the embodiments of the present application has at least the following beneficial effects:
[0025] In the embodiments of the present application, through the combination of the laser automatic equipment, the industrial camera, the image background plate and the machine vision module, the production process can be detected and adjusted in real time, so as to ensure that the press-fitting of each laser reaches the best state, improve the stability of product quality, significantly reduce the intervention of manual operation, improve the working efficiency of the production line, and through accurate image processing and real-time quality detection, the size, position and brightness of each TO laser can be efficiently detected, so as to ensure that each product meets the quality standard and each laser produced has consistent quality. Through the real-time judgment of the machine vision module on the state of the press-fitting process in the automatic press-fitting process, the press-fitting of each laser can reach the best state, and the machine vision module can reduce manual intervention through automatic image analysis and judgment, thereby reducing the quality fluctuation caused by human error, and can adapt to the production needs of different batches of products, and improve the universality and adaptability of the production line. BRIEF DESCRIPTION OF DRAWINGS
[0026] The accompanying drawings are included to provide a further understanding of the embodiments of the present application, and are incorporated herein and constitute a part of the detailed description. It should be apparent to those skilled in the art that the accompanying drawings are only some embodiments of the present application described in the embodiments of the present application, and other drawings can be obtained from the accompanying drawings without creative labor.
[0027] Figure 1 is a structural schematic diagram of a machine vision-based TO laser automatic production system provided by the embodiments of the present application;
[0028] Figure 2 is a structural schematic diagram of a laser automatic equipment provided by the embodiments of the present application;
[0029] Figure 3 is a flowchart of a machine vision-based TO laser automatic production method provided by the embodiments of the present application.
[0030] Reference signs: 1, laser automatic equipment; 2, industrial camera; 3, image background plate; 11, control motor; 12, pressing device; 13, positioning clamp; 14, start switch.
[0031] As shown in the drawings, in order to clearly realize the structure of the embodiments of the present application, specific structures and devices are marked in the drawings, but this is only for the need of illustration, and is not intended to limit the present application in the specific structures, devices and environments, and the devices and environments can be adjusted or modified by those skilled in the art according to specific needs. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions of the present application will be described clearly and completely in conjunction with the drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.
[0033] The machine vision-based TO laser automatic production method provided by the embodiments of the present application will be described in detail in conjunction with the drawings and specific embodiments and application scenarios.
[0034] Referring to the drawings attached to the specification, Figure 1 , a structural schematic diagram of a machine vision-based TO laser automatic production system provided by the embodiments of the present application is shown.
[0035] Referring to the drawings attached to the specification, Figure 2 , a structural schematic diagram of a laser automatic equipment provided by the embodiments of the present application is shown.
[0036] The embodiments of the present application provide a machine vision-based TO laser automatic production system, which comprises a laser automatic equipment, an industrial camera, an image background plate and a machine vision module.
[0037] The laser automatic equipment comprises a control motor, a start switch, a pressing device, a TO laser, a tooling table and a positioning clamp.
[0038] The industrial camera is installed on the side of the tooling table, and the industrial camera is used to collect images of the TO laser projected onto the image background plate in real time.
[0039] Specifically, the industrial camera collects laser images in real time, and through high-precision image data analysis, it can timely find the deviation in the production process, ensure that each laser meets the quality standard, and improve the consistency of the product.
[0040] The image background plate is installed in front of the positioning clamp.
[0041] The image background plate is spaced apart from the laser at a certain distance and serves as a target for the laser to project an image.
[0042] Specifically, the image background plate provides a clear reference background, ensures the accuracy of the image captured by the industrial camera, and provides reliable data sources for subsequent image processing of the machine vision module, thereby improving the accuracy of image analysis.
[0043] The machine vision module is used to process the image captured by the industrial camera and perform image processing on the image, and output a control signal.
[0044] The control motor includes a relay, which is used to control the pressing device to realize the pressing termination operation and the reset operation according to the control signal.
[0045] In the present application, first, the component to be produced is placed in the positioning clamp, the TO laser is placed in the pressing device, the switch is started, and the state of the laser is judged in real time during the pressing process through machine vision, and the control signal is obtained, and the control motor controls the pressing equipment to reset according to the control signal.
[0046] In one possible implementation, the laser is arranged inside the pressing device.
[0047] Specifically, arranging the TO laser inside the pressing device can ensure that the laser maintains a stable position during the pressing process, avoiding position deviation caused by external interference, thereby improving the precision and consistency of the pressing.
[0048] Referring to the accompanying drawings Figure 3 , a flowchart of a TO laser automatic production method based on machine vision is shown.
[0049] The embodiment of the present application provides a TO laser automatic production method based on machine vision, which comprises the following steps:
[0050] S1: Start the laser automatic production equipment.
[0051] S2: Capture the image of the TO laser projected on the background plate by the industrial camera.
[0052] It should be noted that the industrial camera can capture the image of the laser projected on the background plate with high precision, ensuring the accuracy and clarity of the image data.
[0053] S3: Preprocess the image to generate a mask.
[0054] It should be noted that through image preprocessing, the amount of calculation can be significantly reduced, and the area of interest in the image can be extracted, and the generated mask can clearly distinguish the target area and the background, simplifying the subsequent image analysis process.
[0055] In a possible implementation, the preprocessing includes: size adjustment and color space conversion.
[0056] The color space conversion is a process of converting an image from one color model to another color model, and the purpose of the color space conversion is to make the image more suitable for certain specific tasks in different spaces.
[0057] In a possible implementation, S3 specifically includes:
[0058] S301: crop the image, and determine the cropped image:
[0059] ;
[0060] wherein, W W represents the width of the image, H H represents the height of the image, x 1, y (1) represents the coordinates of the upper left corner of the cropped image, x 2, y (2) represents the coordinates of the upper right corner of the cropped image, I crop represents the pixel value of the cropped image;
[0061] S302: calculate the local region average gray of the cropped image:
[0062] ;
[0063] wherein, μ roi represents the local region average gray, N represents the total number of pixels in the local region, represents the pixel gray value of the coordinate point, x 0, y 0) represents the coordinates of the lower left corner of the cropped image, i.e. the coordinate origin, w represents the width of the local region, h represents the height of the local region.
[0064] The local region average gray refers to the average value of all pixel gray values in a certain region of the image, reflecting the overall brightness information of the region, and is usually used to describe the brightness distribution of the image in a local region.
[0065] It should be noted that by calculating the average gray value of the local area of the image, the influence of local noise can be effectively eliminated, more stable image features can be obtained, the influence of factors such as illumination change and background interference of the image on subsequent analysis is minimized, and the accuracy of image processing is improved.
[0066] S303: Determine the dynamic gray threshold according to the average gray value of the local area:
[0067] ;
[0068] wherein, T ( x , y ) represents the gray value after binarization at ( x , y ), I ( x , y ) represents the gray value of the cropped image at ( x , y ), T base represents the basic threshold value;
[0069] wherein the dynamic gray threshold is an adaptive threshold calculated according to the gray features of the local area of the image, which is used to distinguish the region of interest (such as the highlight region) in the image from the background, and can automatically adjust according to the specific content of the image (such as the brightness of the local area), so that the accuracy of image processing under different illumination conditions is higher.
[0070] S304: Extract the highlight white region in the cropped image according to the dynamic gray threshold to generate a mask.
[0071] Specifically, through the dynamic gray threshold calculation, the threshold value can be automatically adjusted according to the brightness change of different image regions, avoiding the error that may be caused by the fixed threshold value, so that the details in the image can be more accurately extracted, and at the same time, the influence of external conditions such as illumination change can also be adapted, thereby improving the accuracy of image segmentation and feature extraction.
[0072] Specifically, through the calculation of the dynamic gray threshold, the highlight region and the background in the image can be accurately distinguished, so as to generate a clear mask, which can automatically identify and extract the target region, reduce the background interference, and improve the accuracy of image segmentation.
[0073] S4: Perform morphological processing on the mask to obtain a morphologically processed image.
[0074] The morphological processing is an operation based on the shape of an image, usually used for binary images, which improves the structure of the image by using specific structural elements (such as rectangles, circles, ellipses, etc.) to perform dilation, erosion, opening operation, closing operation, etc. operations, which is often used for tasks such as removing noise, filling gaps, highlighting or removing specific shapes, etc.
[0075] It should be noted that the morphological operation can effectively remove noise and small holes in the mask, fill gaps and smooth boundaries, making the target region more clear and coherent, and can enhance the features in the image, eliminate unnecessary background interference, and improve the image quality.
[0076] In one possible implementation, S4 is specifically:
[0077] The morphological processing of the mask is performed by an elliptical kernel closing operation to obtain a morphologically processed image:
[0078] ;
[0079] Wherein, represents the morphologically processed image, represents the mask, represents the dilation operation, represents the erosion operation, and B represents the elliptical structural element.
[0080] The closing operation is an operation in morphological processing, which eliminates small holes, fills small gaps in the image or connects broken objects by first performing a dilation operation and then performing an erosion operation. The elliptical kernel is a structural element used in the closing operation, which is usually an elliptical matrix. The dilation and erosion operations will operate on the image based on this elliptical structure to change the foreground and background regions in the image.
[0081] It should be noted that the closing operation can effectively fill small holes and gaps in the mask, connect dispersed foreground regions, enhance the connectivity of the target region, reduce the influence of noise, not only clearly separate the target region, but also remove small objects or noise in the image, thereby improving the image quality.
[0082] S5: Extracting multiple contours of the morphologically processed image.
[0083] It should be noted that the contour extraction can accurately identify each independent object or region in the image, further analyze and judge the target in the image, and the contour extraction can clearly define the boundaries of different objects in the image, effectively remove irrelevant background information, making the subsequent size calculation, target screening and quality judgment more accurate, and enhancing the structural information of the image.
[0084] S6: In each contour, all valid contours with contour areas within a preset area range are extracted, and the minimum circumscribed rectangle of each valid contour is calculated.
[0085] Specifically, by screening valid contours within the preset area range, the target object can be accurately focused on, interference and noise can be excluded, misjudgment can be reduced, and the calculation of the minimum circumscribed rectangle provides a standardized bounding box for each valid contour, so that subsequent shape analysis, position calibration and quality determination are more accurate.
[0086] It should be noted that the size of the preset area range can be set by the person skilled in the art according to actual needs, and the present application does not limit it.
[0087] In the present application, invalid contours with too small or too large areas are filtered out, and all valid contours with contour areas within a preset area range are extracted.
[0088] S7: The minimum circumscribed rectangle is screened to determine the target region.
[0089] It should be noted that by screening the minimum circumscribed rectangle that meets certain conditions (such as aspect ratio, brightness, etc.), the target region that meets the quality standard can be accurately identified, contours that do not meet the requirements can be excluded, the real target region can be focused on, and the risk of false determination can be reduced.
[0090] In one possible implementation, S7 specifically comprises:
[0091] S701: Calculate the aspect ratio and brightness ratio of the minimum circumscribed rectangle;
[0092] S702: Screen the minimum circumscribed rectangle according to the aspect ratio and brightness ratio to determine the target region.
[0093] In one possible implementation, the aspect ratio specifically comprises:
[0094] ;
[0095] Wherein, aspect_ratio represents the aspect ratio, height represents the height of the minimum circumscribed rectangle, width represents the width of the minimum circumscribed rectangle, ε represents a positive infinitesimal variable approaching zero, avoiding a zero denominator;
[0096] The brightness ratio specifically comprises:
[0097] ;
[0098] Wherein, brightness_ratio represents the brightness ratio, A rectRepresents the area of the smallest bounding rectangle, where rect represents the region of the smallest bounding rectangle.
[0099] S8: Determine whether the target area meets the width and height determination principle and the circular area inclusion determination principle; if so, mark it as a good product; otherwise, mark it as a defective product.
[0100] It should be noted that by determining the width and height and the inclusion of circular areas, it is possible to accurately determine whether the target area meets the set size and shape requirements. The width and height determination ensures that the size of the target area is within a reasonable range, while the inclusion of circular areas helps to determine whether the shape of the target area is close to the ideal circle. These standardized determination steps reduce human error, improve the accuracy of quality inspection, and ensure that each product meets the predetermined specifications, thereby improving production efficiency and product consistency.
[0101] In one possible implementation, whether the target area conforms to the width and height determination principle is specifically as follows:
[0102] ;
[0103] in,( w min , w max ) indicates the allowed width range, ( h min , h max () indicates the permissible height range. Indicates the width of the rectangle. Indicates the height of the rectangle. The symbol represents the intersection.
[0104] The specific principles for determining the inclusion of a circular region are as follows:
[0105] ;
[0106] in,( c 1, c 2) Represents the coordinates of the center point, ( c x , c y () represents the center point of the effective rectangle. r 0 represents the radius of the circle.
[0107] S9: Send the judgment result as a control signal to the control motor;
[0108] S10: Control the pressing device to perform pressing termination operation and reset operation according to the control signal.
[0109] It should be noted that by automatically receiving the control signal, the action of the pressing device can be accurately controlled, the pressing process of the laser is ensured to stop at the appropriate time, the risk of over-pressing or incomplete pressing is avoided, the pressing termination operation effectively improves the stability and precision of the production process, and the reset operation ensures that the equipment can be quickly prepared for the next production, reducing the idle time of the equipment.
[0110] The technical scheme provided by the embodiment of the present application has at least the following beneficial effects:
[0111] In the embodiment of the present application, by combining the laser automation equipment, the industrial camera, the image background plate and the machine vision module, the production process can be detected and adjusted in real time, ensuring that the pressing of each laser reaches the best state, improving the stability of product quality, significantly reducing the intervention of manual operation, and improving the working efficiency of the production line. Through accurate image processing and real-time quality detection, the size, position and brightness of each TO laser can be efficiently detected, ensuring that each product meets the quality standard and ensuring that each laser produced has consistent quality. By using the machine vision module in the automatic pressing process, the state of the pressing process can be judged in real time, so that the pressing of each laser reaches the best state. The machine vision module can reduce manual intervention through automatic image analysis and judgment, thereby reducing the quality fluctuation caused by human error, and can adapt to the production needs of different batches of products, improving the universality and adaptability of the production line.
[0112] The above embodiments can be implemented in whole or in part by software, hardware (such as a circuit), firmware or any combination thereof. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the flow or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. containing one or more available medium collections. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid state disk.
[0113] It should be understood that the size of the sequence number of each process described above does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the application.
[0114] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0115] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the above-described device, apparatus and unit can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0116] In several embodiments provided by the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the above-described device embodiments are merely schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0117] The units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0118] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically independently, or two or more units can be integrated into one unit.
[0119] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art can be embodied in the form of software products. The computer software products are stored in a storage medium and include a plurality of instructions for causing 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 methods described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0120] The embodiment of the present application provides a readable storage medium, which comprises a program or instructions stored on the readable storage medium, the program or instructions are executed by a processor to realize the steps of the machine vision based TO laser automatic production method, and the same technical effects can be achieved. To avoid repetition, the present application will not be described again.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present application, and not to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed by the present application should be covered within the protection scope of the present application.
Claims
1. A machine vision-based automated production system for TO lasers, characterized in that, include: Laser automation equipment, industrial cameras, image backdrops, and machine vision modules; The laser automation equipment includes: a control motor, a start switch, a pressing device, a TO laser, a tooling table, and a positioning fixture; The industrial camera is mounted on the side of the tooling table and is used to acquire images projected by the TO laser onto the image background plate in real time. The image background plate is installed directly in front of the positioning fixture; The machine vision module is used to process the images captured by the industrial camera, perform image processing on the images, and output control signals; The control motor includes a relay, which is used to control the pressing device to perform pressing termination operation and reset operation according to the control signal.
2. The automated production system for TO lasers based on machine vision according to claim 1, characterized in that, The laser is located inside the pressure-down device.
3. A machine vision-based automated production method for TO lasers, characterized in that, The method applied to the machine vision-based automated production system for TO lasers according to any one of claims 1 to 2 includes: S1: Start the laser automation equipment; S2: The industrial camera captures the image projected onto the background plate by the TO laser; S3: Preprocess the image to generate a mask; S4: Perform morphological processing on the mask to obtain a morphologically processed image; S5: Extract multiple contours from the morphologically processed image; S6: Among each of the contours, extract all valid contours whose contour area conforms to the preset area range, and calculate the minimum bounding rectangle of each of the valid contours. S7: Filter the minimum bounding rectangle to determine the target area; S8: Determine whether the target area meets the width and height determination principle and the circular area inclusion determination principle; if yes, mark it as a good product; otherwise, mark it as a defective product. S9: Send the judgment result as a control signal to the control motor; S10: Control the pressing device to perform pressing termination operation and reset operation according to the control signal.
4. The automated production method for TO lasers based on machine vision according to claim 3, characterized in that, The preprocessing includes: size adjustment and color space conversion.
5. The automated production method for TO lasers based on machine vision according to claim 3, characterized in that, S3 specifically includes: S301: Crop the image and determine the cropped image: ; in, W Indicates the width of the image. H Indicates the height of the image, ( x 1, y 1) Represents the coordinates of the top-left corner of the cropped image, ( x 2, y 2) Represents the coordinates of the top right corner of the cropped image. I crop Represents the pixel values of the cropped image; S302: Calculate the average gray level of the local region of the cropped image: ; in, μ roi This represents the average gray level of a local area. N This represents the total number of pixels within the local domain. Representing coordinates The pixel grayscale value of the point, ( x 0, y 0) represents the coordinates of the bottom left corner of the cropped image, i.e., the origin. w Indicates the width of the cropped image. h Indicates the height of a local area; S303: Determine the dynamic grayscale threshold based on the average grayscale of the local area: ; in, T ( x , y )express( x , y The grayscale value after binarization at ) I ( x , y ) indicates that the image is cropped at ( x , y The grayscale value at ) T base Indicates the basic threshold; S304: Based on the dynamic grayscale threshold, extract the bright white areas in the cropped image and generate a mask.
6. The automated production method for TO lasers based on machine vision according to claim 3, characterized in that, Specifically, S4 is: The mask is morphologically processed using elliptic kernel closure operations to obtain a morphologically processed image: ; in, Represents morphologically processed images, Indicates the mask. This indicates an expansion operation. Indicates corrosion operation. B This represents an elliptical structural element.
7. The automated production method for TO lasers based on machine vision according to claim 3, characterized in that, Specifically, S7 is: S701: Calculate the aspect ratio and brightness ratio of the minimum bounding rectangle; S702: Determine the target area based on the aspect ratio and the brightness ratio.
8. The automated production method for TO lasers based on machine vision according to claim 7, characterized in that, The aspect ratio is specifically: ; Where aspect_ratio represents the aspect ratio, height represents the height of the minimum bounding rectangle, and width represents the width of the minimum bounding rectangle. ε Use variables that represent positive infinity approaching zero to avoid having a zero denominator; The brightness ratio is specifically: ; Wherein, brightness_ratio represents the brightness ratio. A rect Represents the area of the smallest bounding rectangle, where rect represents the region of the smallest bounding rectangle.
9. The automated production method for TO lasers based on machine vision according to claim 3, characterized in that, Whether the target area meets the width and height determination principle is specifically as follows: ; in,( w min , w max ) indicates the allowed width range, ( h min , h max () indicates the permissible height range. Indicates the width of the rectangle. Indicates the height of the rectangle. Intersection symbol; The specific principle for determining the inclusion of the circular region is as follows: ; in,( c 1, c 2) Represents the coordinates of the center point, ( c x , c y () indicates the center point of the target area. r 0 represents the radius of the circle.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the machine vision-based automated production method for TO lasers as described in any one of claims 3 to 9.
Citation Information
Patent Citations
Fast press-fit device for TO laser module
CN112751258A
TO semiconductor laser module rapid testing and curing device and working method
CN117928893A