Edge searching positioning method and device for laser cutting machine and medium
By automatically adjusting camera exposure and brightness, combined with semantic segmentation and edge defect compensation technology, high-precision edge-finding positioning of the laser cutting machine is achieved, solving the problems of illumination dependence and complex operation in the existing technology, and improving cutting accuracy and safety. .
Patent Information
- Application Number
- CN202411477379.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-01-21
AI Technical Summary
The edge search method of existing laser cutting machines has problems such as dependence on lighting conditions, complex operation and time-consuming, resulting in cutting accuracy and safety hazards.
By automatically adjusting the initial exposure parameters and brightness parameters of the camera, the brightness adjustment direction and amplitude are determined based on the pixel information of the initial image to achieve adaptive brightness adjustment, and combined with semantic segmentation and edge defect compensation technology, the corner coordinates and main direction of the plate are accurately determined. angle.
It improves the accuracy and automation of bordering positioning, reduces the time and cost of artificial adjustment, and enhances the safety and product quality of laser cutting.
Smart Images

Figure CN119338910A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of laser cutting technology, and in particular to an edge-finding and positioning method, device and medium for a laser cutting machine. Background Art
[0002] As a key technology in the field of modern industrial manufacturing, laser cutting machines are widely used in many industries such as metal processing, aerospace, automobile manufacturing, electronic devices, and medical devices due to their high precision, high speed, and non-contact cutting characteristics. In the laser cutting process, since metal and other materials may be deformed or shifted during production, transportation, and storage, edge finding is an indispensable step before precise cutting of metal plates or other hard materials. It is of great significance to ensure cutting accuracy, improve material utilization, and protect equipment safety.
[0003] The commonly used edge-finding method is generally the capacitive edge-finding method. Although the capacitive edge-finding process can meet certain processing requirements, there are many parameters in the operation interface and a lot of data that needs to be set. The skill level and proficiency of the debugging personnel affect the final use effect and stability. For example: if the plate size is set incorrectly, the plate is tilted too much, or the initial position of the laser head is improperly selected, it may cause mechanical damage and pose certain safety hazards. In addition, the existing visual edge-finding methods often have high requirements for lighting conditions. Too strong or too weak light may cause image quality to deteriorate, thereby affecting the accuracy of edge-finding positioning. Summary of the invention
[0004] In order to solve the above technical problems, one or more embodiments of the present specification provide an edge-finding and positioning method, device and medium for a laser cutting machine.
[0005] One or more embodiments of this specification adopt the following technical solutions:
[0006] One or more embodiments of this specification provide an edge finding and positioning method for a laser cutting machine, the method comprising:
[0007] Determine the initial exposure parameters and initial brightness parameters of the preset camera according to the light intensity value of the current environment of the laser cutting machine, and enable the preset camera to take pictures based on the initial exposure parameters and the initial brightness parameters to obtain an initial image;
[0008] Based on the pixel information of each point in the initial image, determining the distribution of image pixels in different brightness intervals, so as to determine the brightness adjustment direction and adjustment amplitude of the initial image according to the image pixel distribution;
[0009] The initial image is adjusted according to the brightness adjustment direction and the adjustment amplitude to obtain a current image, and the current image is semantically segmented to obtain a plate image;
[0010] Performing edge defect compensation on the plate image to determine the coordinate information of the plate corner points according to the compensated plate image;
[0011] The corners of the plate are roughly positioned according to the plate corner coordinate information and the camera parameters of the preset camera to move the corners to the middle of the field of view, and the preset camera is moved to take a second photo to calculate the main direction angle of the plate.
[0012] Optionally, in one or more embodiments of the present specification, before obtaining the light intensity value of the current environment of the laser cutting machine and determining the initial exposure parameter and initial brightness parameter of the preset camera according to the light intensity value, the method further includes:
[0013] Aligning the laser point emitted by the laser head of the current laser cutting machine with the center of a preset calibration plate to determine first coordinate data of the laser point based on the preset camera; wherein the preset calibration plate is located at a fixed position within the field of view of the preset camera;
[0014] Moving the laser head of the current laser cutting machine so that the center of the field of view coincides with the center of the preset calibration plate, and determining the second coordinate position of the laser point based on the preset camera;
[0015] Moving the laser head of the current laser cutting machine so that the upper left corner of the field of view coincides with the center of the preset calibration plate, and determining the third coordinate position of the laser point based on the preset camera;
[0016] Processing the first coordinate data, the second coordinate data, the third coordinate data and known geometric features of the preset calibration plate based on a camera calibration algorithm to obtain camera distortion parameters;
[0017] The image captured by the preset camera is corrected based on the camera distortion parameter, so as to extract the relative distance between the center point of the laser head and the center point of the camera field of view based on the corrected image.
[0018] Optionally, in one or more embodiments of the present specification, determining the initial exposure parameters and initial brightness parameters of the preset camera according to the light intensity value of the current environment of the laser cutting machine, and making the preset camera take pictures based on the initial exposure parameters and the initial brightness parameters to obtain the initial image, specifically includes:
[0019] Obtaining the light intensity value of the environment in which the laser cutting machine is currently located to determine the light intensity level corresponding to the light intensity value;
[0020] Based on a preset parameter mapping table, obtaining initial exposure parameters and initial brightness parameters corresponding to the corresponding light intensity level;
[0021] The found initial exposure parameters and initial brightness parameters are sent to the preset camera, and are set through the control interface of the camera so that the preset camera takes a picture based on the initial exposure parameters and the initial brightness parameters to obtain an initial image.
[0022] Optionally, in one or more embodiments of the present specification, based on the pixel information of each point in the initial image, determining the distribution of image pixels in different brightness intervals, so as to determine the brightness adjustment direction and adjustment amplitude of the initial image according to the image pixel distribution, specifically includes:
[0023] Traversing the pixel points in the initial image to obtain pixel information of each point, so as to determine the brightness value of each pixel point based on the pixel information;
[0024] Counting the number of pixels in each brightness interval to obtain a statistical result, and constructing a brightness distribution histogram corresponding to the initial image based on the statistical result;
[0025] Determine the distribution of image pixels in different brightness intervals according to the brightness distribution histogram; wherein the image pixel distribution includes: the number of pixels and the pixel ratio;
[0026] A weighted calculation is performed according to the number of pixels and the pixel proportions in different brightness intervals, so as to determine the brightness adjustment direction and adjustment range of the initial image according to the weighted calculation result.
[0027] Optionally, in one or more embodiments of the present specification, performing semantic segmentation on the current image to obtain a plate image specifically includes:
[0028] Performing semantic segmentation on the current image based on a segmentation algorithm of a convolutional neural network to obtain a plate image; wherein, before performing semantic segmentation on the current image based on a segmentation algorithm of a convolutional neural network to obtain a plate image, the method further includes:
[0029] Collecting scene images of the current laser cutting machine, and constructing an image data set based on the scene images; wherein each scene image in the image data set has a marking at the boundary edge between the plate and the background;
[0030] The image data set is input into the convolutional neural network for iterative training to obtain a convolutional neural network segmentation algorithm that meets the requirements.
[0031] Optionally, in one or more embodiments of the present specification, edge defect compensation is performed on the plate image to determine the plate corner point coordinate information according to the compensated plate image, specifically including:
[0032] Performing grayscale conversion on the plate image to determine a grayscale image corresponding to the plate image, and performing Gaussian filtering on the corresponding grayscale image to obtain a denoised grayscale image;
[0033] Performing corrosion processing and expansion processing on the denoised grayscale image to obtain an image of the plate to be compensated;
[0034] Performing edge detection on the image of the plate to be compensated according to an edge detection operator to determine an edge detection result of the image of the plate to be compensated;
[0035] Inputting the edge detection result into a preset machine learning model to compensate edge defects of the plate image to be compensated;
[0036] The compensated plate image is edge fitted according to the least squares algorithm to obtain edge lines, and the edge lines are processed based on the corner point detection algorithm to obtain the corner point coordinate information of the plate.
[0037] Optionally, in one or more embodiments of the present specification, the rough positioning of the corner point of the plate is performed according to the plate corner point coordinate information and the camera parameters of the preset camera to move the corner point position to the middle of the field of view, specifically including:
[0038] Based on the coordinate information of the corner point of the plate and the center position of the field of view, determine the offset between the corner point of the plate and the center position of the field of view, and obtain the angle value between the corner point of the plate and the center position of the field of view based on a preset inverse tangent function;
[0039] Determine the actual distance between the corner point of the plate and the center position of the field of view based on the product of the offset, the preset camera focal length and the preset zoom ratio;
[0040] Determine a proportional factor according to the ratio of the actual distance to the angle value, so as to determine the moving distance of the corner point of the plate relative to the center position of the field of view according to the proportional factor and the offset between the corner point of the plate and the center position of the field of view;
[0041] The corner point position is moved to the middle of the field of view according to the moving distance.
[0042] Optionally, in one or more embodiments of the present specification, moving the preset camera to take a second photo to calculate the main direction angle of the plate specifically includes:
[0043] Determine the size of the plate and the angle value of the plate based on the edge line, so as to determine the position of the second photo shooting according to the size of the plate and the angle value of the plate;
[0044] Moving the preset camera to the position for the secondary photographing to take a secondary photograph to obtain a secondary image, and performing semantic segmentation on the secondary image to obtain a secondary plate image;
[0045] Identifying an image edge of the secondary plate image to determine edge coordinate information corresponding to the image edge of the secondary plate image;
[0046] The main direction angle of the plate is determined based on the corner point coordinate information and the edge coordinate information of the plate.
[0047] One or more embodiments of this specification provide an edge-finding and positioning device for a laser cutting machine, the device comprising:
[0048] at least one processor; and,
[0049] a memory communicatively connected to the at least one processor; wherein,
[0050] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: execute any of the above-mentioned methods.
[0051] One or more embodiments of the present specification provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute any of the above-described methods.
[0052] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:
[0053] According to the light intensity value of the current environment of the laser cutting machine, the initial exposure parameters and initial brightness parameters of the preset camera are automatically adjusted. Based on this, the distribution of image pixels in different brightness intervals is determined based on the pixel information of each point in the initial image, and the brightness of the image is adjusted accordingly to obtain a more uniform and clear current image. The adaptive brightness adjustment process solves the problem that the existing manual adjustment of exposure time and camera brightness is time-consuming and labor-intensive. Compensating for edge defects in plate images can effectively reduce edge detection errors caused by image noise, shadows and other factors. The accuracy of edge detection is improved, and the accuracy of corner point coordinate information is thereby improved. By accurately calculating the main direction angle of the plate, an important reference basis is also provided for subsequent laser cutting processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0055] Figure 1 A schematic flow chart of an edge finding and positioning method for a laser cutting machine provided in an embodiment of this specification;
[0056] Figure 2 A schematic diagram of a scene of a first coordinate data acquisition process provided in an embodiment of this specification;
[0057] Figure 3 A schematic diagram of a scenario of a second coordinate data acquisition process provided in an embodiment of this specification;
[0058] Figure 4 A schematic diagram of a scenario of a third coordinate data acquisition process provided in an embodiment of this specification;
[0059] Figure 5 A schematic diagram of a brightness distribution histogram provided in an embodiment of this specification;
[0060] Figure 6 A schematic diagram of a semantic segmentation scenario provided in an embodiment of this specification;
[0061] Figure 7 A schematic diagram of the structure of an edge-finding and positioning device for a laser cutting machine provided in an embodiment of this specification;
[0062] Figure 8 A schematic diagram of the structure of a non-volatile storage medium provided in an embodiment of this specification. DETAILED DESCRIPTION
[0063] The embodiments of this specification provide an edge-finding and positioning method, device, and medium for a laser cutting machine.
[0064] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0065] like Figure 1As shown, the embodiment of this specification provides a schematic flow chart of an edge finding and positioning method for a laser cutting machine. Figure 1 It can be seen that in one or more embodiments of this specification, a method for edge finding and positioning of a laser cutting machine includes:
[0066] S101: determining initial exposure parameters and initial brightness parameters of a preset camera according to the light intensity value of the current environment of the laser cutting machine, and enabling the preset camera to take a picture based on the initial exposure parameters and the initial brightness parameters to obtain an initial image.
[0067] Different light intensities have a great impact on the imaging quality of the camera. Too strong or too weak light may cause the image to be overexposed or underexposed, thereby affecting the details and clarity of the image. Therefore, plate edge finding usually requires the operator to manually adjust the camera exposure time and brightness value according to the lighting environment, thereby ensuring that the traditional image segmentation algorithm can distinguish the plate outline from the background. However, manual adjustment of the exposure time and camera brightness requires the operator to observe and intervene with the naked eye, and may require multiple adjustments of the exposure time and camera brightness, which is time-consuming and labor-intensive. Therefore, in order to achieve adaptive adjustment of exposure brightness, in the embodiment of this specification, first determine the initial exposure parameters and initial brightness parameters of the preset camera according to the light intensity value of the current environment of the laser cutting machine, so that the preset camera can take pictures according to the initial exposure parameters and initial brightness parameters to obtain the initial image. It is helpful to ensure that high-quality initial images can be obtained under different lighting conditions by dynamically adjusting the exposure and brightness parameters of the camera in the future, providing a good foundation for subsequent image processing or analysis.
[0068] Furthermore, in one or more embodiments of the present specification, before determining the initial exposure parameters and initial brightness parameters of the preset camera according to the light intensity value of the current environment of the laser cutting machine, the method also includes a calibration process of the preset camera, and the specific calibration process is:
[0069] First, Figure 2 As shown, the laser point emitted by the laser head of the current laser cutting machine is aligned with the center of the preset calibration plate, so as to determine the first coordinate data of the laser point according to the preset camera; wherein, Figure 2 The preset calibration plate shown is located at a fixed position within the preset camera field of view. Then move the laser head of the current laser cutting machine, such as Figure 3 As shown, the center of the field of view is made to coincide with the center of the preset calibration plate, and the second coordinate position of the laser point is determined based on the preset camera. Then the laser head of the current laser cutting machine is moved, as shown in FIG. Figure 4As shown, the upper left corner of the field of view is made to coincide with the center of the preset calibration plate, so as to determine the third coordinate position of the laser point according to the preset camera. Then, the first coordinate data, the second coordinate data, the third coordinate data and the known geometric features of the preset calibration plate are processed according to the camera calibration algorithm to obtain the camera distortion parameters. At the same time, the image taken by the preset camera is corrected based on the camera distortion parameters to extract the relative distance between the center point of the laser head and the center point of the camera field of view based on the corrected image. By accurately aligning the laser point with the center of the calibration plate and obtaining the coordinate data of the laser point at different field of view positions, the positioning accuracy of the laser head position during the laser cutting process can be greatly improved. The camera is often affected by various factors and produces distortion during the imaging process, such as radial distortion, tangential distortion, etc. The camera distortion parameters obtained through the calibration process can be used to correct the captured image, eliminate or reduce these distortions, thereby improving the accuracy and reliability of the image. Different models of laser cutting machines and cameras may have different imaging characteristics and distortion laws. Through a targeted calibration process, the characteristics of different devices can be adapted to make the system more flexible and versatile.
[0070] In a certain application scenario, for a point (x, y, 1) on the normalized plane, due to the influence of distortion, the final value is (xdi storted ,y distorted , l)
[0071]
[0072] Among them, r 2 =x 2 +y 2 , k1, k2, k3, k4, k5, k6 are radial distortion parameters, p1, p2 are tangential distortion parameters. distorted is the x coordinate value of the point (x,y,1) after distortion correction, and y distorted is the y coordinate value of the point (x, y, 1) after distortion correction. 2 It is the square of the distance of the point (x,y,1) from the origin. The 1 in (x,y,1) means that the coordinates of the point in the three-dimensional space are projected onto the plane and the z-axis coordinates are normalized.
[0073] Specifically, in one or more embodiments of the present specification, according to the light intensity value of the current environment of the laser cutting machine, the initial exposure parameter and the initial brightness parameter of the preset camera are determined, and the preset camera is made to take pictures based on the initial exposure parameter and the initial brightness parameter to obtain the initial image, which specifically includes the following process:
[0074] First, obtain the light intensity value of the current environment of the laser cutting machine, so as to determine the light intensity level corresponding to the light intensity value. According to the preset parameter mapping table, obtain the initial exposure parameters and initial brightness parameters corresponding to the corresponding light intensity level. Then, send the found initial exposure parameters and initial brightness parameters to the preset camera, and set them through the control interface of the camera so that the preset camera takes pictures based on the initial exposure parameters and initial brightness parameters to obtain the initial image. In this process, by dynamically adjusting the exposure and brightness parameters of the camera according to the ambient light intensity, it can basically ensure that the initial image taken under different lighting conditions maintains clarity and details, reduces overexposure or underexposure, and thus improves the overall quality of the image. Automatically initializing the exposure brightness not only improves work efficiency, but also reduces the possibility of human errors, and improves the automation level of the entire laser cutting process.
[0075] S102: Determine the distribution of image pixels in different brightness intervals based on pixel information of each point in the initial image, so as to determine the brightness adjustment direction and adjustment range of the initial image according to the image pixel distribution.
[0076] Since brightness adjustment based only on preset light intensity levels is rough and difficult to adjust based on specific brightness conditions, in order to avoid the problem that manual adjustment of exposure time and camera brightness requires operator visual observation and intervention, it may be necessary to adjust exposure time and camera brightness multiple times in the embodiments of this specification. The distribution of image pixels in different brightness intervals will be determined based on the pixel information of each point in the initial image, and the brightness adjustment direction and adjustment range of the initial image will be determined based on the image pixel distribution. For example, Figure 5 As shown in , after obtaining the initial image, the distribution of image pixels with different brightness intervals in the image is calculated. Figure 5 The pixel statistical histogram shows that there are fewer pixels in the low-brightness range of the image, and the image is brighter overall. The camera exposure time or gain can be appropriately reduced. Through this image analysis algorithm, adaptive exposure can achieve adaptive image brightness adjustment. Based on the above adaptive adjustment method, by analyzing the pixel information of each point in the initial image, the distribution of different brightness ranges in the image can be understood in detail. This brightness adjustment method based on specific image content can more accurately identify areas that are too bright or too dark in the image, and determine the appropriate brightness adjustment direction and adjustment range accordingly, thereby achieving more accurate brightness adjustment. By automatically analyzing the image pixel information to determine the brightness adjustment parameters, the problem that the operator needs to observe the image with the naked eye and manually adjust the exposure time and camera brightness in the existing traditional method is solved, which is not only time-consuming and labor-intensive, but also prone to human errors.
[0077] Specifically, in one or more embodiments of the present specification, based on the pixel information of each point in the initial image, the distribution of image pixels in different brightness intervals is determined, so as to determine the brightness adjustment direction and adjustment range of the initial image according to the image pixel distribution, specifically including:
[0078] By traversing the pixel points in the initial image, the pixel information of each point is obtained, and the brightness value of each pixel point is determined according to the pixel information. By traversing each pixel point in the initial image and calculating the brightness value based on its pixel information, a refined analysis of the image brightness can be achieved. This method can capture every subtle brightness change in the image and provide more accurate data support for subsequent brightness adjustment. Then, the number of pixels in each brightness interval is counted to obtain statistical results, and then a brightness distribution histogram corresponding to the initial image is constructed according to the statistical results. According to the obtained brightness distribution histogram, the image pixel distribution in different brightness intervals can be determined; among them, it can be understood that the image pixel distribution includes: the number of pixels and the pixel ratio. Weighted calculation is performed according to the number of pixels and the pixel ratio in different brightness intervals, and then the brightness adjustment direction and adjustment amplitude of the initial image are determined based on the weighted calculation results.
[0079] For example, suppose an initial image in a certain application scenario has a brightness range divided into three intervals: dark area (brightness value 0-80), medium-bright area (brightness value 81-160) and bright area (brightness value 161-255). After traversing each pixel of the image, it can be determined that the number of pixels in the dark area = 1000, the pixel ratio = 1000 / total number of pixels; the number of pixels in the medium-bright area = 20000, the pixel ratio = 20000 / total number of pixels; the number of pixels in the bright area = 5000, the pixel ratio = 5000 / total number of pixels. Weighted calculation can be based on a variety of strategies, but a simple and intuitive method is to consider the central brightness value of each interval as a reference for the weight. For example, we can set the central brightness values of the dark area, medium-bright area and bright area to 40, 120 and 205 respectively, and use these values as weight factors for their respective intervals. Then the weighted value of the dark area = 40 * the percentage of dark area pixels; the weighted value of the medium-bright area = 120 * the percentage of medium-bright area pixels; the weighted value of the bright area = 205 * the percentage of bright area pixels; then, a weighted average value can be calculated. Since the weighted value of the medium-bright area is the highest, and assuming that the overall brightness of the image is expected to be close to the medium-bright area, if the weighted value of the dark area or the bright area is too high, we need to adjust the brightness to reduce the impact of these areas. In this example, although the weighted value of the bright area is not high, it is still high relative to the dark area, so you can consider reducing the overall brightness, that is, adjusting the brightness slider to the left, but the main goal is to reduce the brightness of the bright area while maintaining or slightly increasing the brightness of the dark area. The adjustment range can be determined based on the difference in weighted values. For example, a threshold can be set, and when the weighted value of a certain brightness interval exceeds or falls below the threshold, the corresponding adjustment is made. The adjustment range can be fixed or determined based on the proportion of the weighted value difference.
[0080] In the above method, weighted calculation is performed based on the number of pixels and pixel ratios in different brightness intervals to determine the direction and amplitude of brightness adjustment. The weighted calculation takes into account the influence of different brightness intervals on the overall image brightness, making the brightness adjustment more in line with the actual situation of the image and avoiding the problem of blind adjustment or over-adjustment. Through precise brightness adjustment, the problems of uneven brightness distribution, overexposure or darkness in the initial image can be improved, and the overall quality of the image can be improved. High-quality images provide a better foundation for subsequent image processing and cutting control, and help improve the processing accuracy and appearance quality of the product.
[0081] S103: adjusting the initial image according to the brightness adjustment direction and the adjustment amplitude to obtain a current image, and performing semantic segmentation on the current image to obtain a plate image.
[0082] After obtaining the brightness adjustment direction and adjustment amplitude based on the above step S102, the initial image is adjusted based on the brightness adjustment direction and adjustment amplitude to obtain the current image. Further, in order to obtain the relevant area image of the plate, the embodiment of this specification will perform semantic segmentation on the current image to obtain the plate image, that is, the plate and the background can be instance segmented through a deep learning semantic segmentation algorithm, and then the mask area and the background are binarized and segmented. The semantic segmentation-based method makes up for the problem that traditional image segmentation relies on a more accurate image binarization threshold, and requires the foreground and background in the image to have a more distinguishable contrast.
[0083] Specifically, in one or more embodiments of the present specification, semantic segmentation is performed on the current image to obtain a plate image, specifically including:
[0084] A segmentation algorithm based on a convolutional neural network performs semantic segmentation on the current image to obtain a plate image; wherein, before the segmentation algorithm based on the convolutional neural network performs semantic segmentation on the current image to obtain the plate image, the method further includes:
[0085] The scene images of the current laser cutting machine are collected, and an image data set is constructed based on the scene images; wherein each scene image in the image data set is labeled at the boundary edge between the plate and the background. Then the image data set is input into the convolutional neural network, and the data set feature extraction and learning are iteratively connected according to the segmentation algorithm of the convolutional neural network. The collected test set is used to evaluate and optimize the learning effect, so as to obtain a convolutional neural network segmentation algorithm that meets the requirements, such as Figure 6 The figure shows a plate image obtained by semantically segmenting the current image in the embodiment of this specification. This process achieves high-precision and high-automatic semantic segmentation of the plate in the current image by utilizing the powerful capabilities of the convolutional neural network. And because a large amount of image data in different scenes is used in the training process, the CNN model can learn the characteristics of the plate under various changing conditions, so it has strong robustness in practical applications and can cope with different lighting conditions, changes in viewing angles and other issues.
[0086] S104: edge defect compensation is performed on the plate image to determine the coordinate information of the plate corner points according to the compensated plate image.
[0087] After obtaining the plate image based on the above step S103, in order to correct and compensate for the defects on the edge of the image, the plate image is compensated for the edge defects in the embodiment of this specification, so as to determine the coordinate information of the plate corner points based on the compensated plate image. The specific correction and compensation process can first use traditional image processing methods to eliminate the interference caused by lighting, barbs, and cutting bed blades, and refine the features of the plate edge. Then use machine learning methods to eliminate noise points, and use clustering algorithms to eliminate the influence of noise points.
[0088] Specifically, in one or more embodiments of the present specification, edge defect compensation is performed on a plate image to determine the coordinate information of the plate corner points according to the compensated plate image, which specifically includes the following process:
[0089] The plate image is gray-scale converted to determine the gray-scale image corresponding to the plate image, and the corresponding gray-scale image is Gaussian filtered to obtain the denoised gray-scale image. Then the denoised gray-scale image is corroded and expanded to obtain the plate image to be compensated. The plate image to be compensated is edge detected according to edge detection operators such as Canny and Sobel to determine the edge detection result of the plate image to be compensated. The edge detection result is then input into the preset machine learning model to compensate the edge defects of the plate image to be compensated. The edge fitting of the compensated plate image is performed according to the least squares algorithm to obtain the edge line, and the edge line is processed based on the corner detection algorithm to obtain the corner point coordinate information of the plate. In this method, the plate corner point coordinate information is obtained by combining traditional image processing with machine learning methods. By first using traditional methods to process the image, preliminary processing can be performed based on the basic features of the image, and some basic interference factors such as uneven illumination and small-sized noise points can be effectively removed. The noise interference of the machine learning model during the training process can be reduced, making it easier to learn useful features, thereby improving the robustness and accuracy of the model. With the help of machine learning, we can learn more complex and abstract image features, further eliminate noise points, refine edge features, and have better generalization capabilities.
[0090] S105: performing coarse positioning of the corner points of the plate according to the plate corner point coordinate information and the camera parameters of the preset camera to move the corner point position to the middle of the field of view, and moving the preset camera to take a second photo to calculate the main direction angle of the plate.
[0091] In order to achieve the purpose of edge finding and positioning, the embodiment of this specification first roughly locates the corners of the plate according to the plate corner coordinate information and the camera parameters of the preset camera, so as to move the corner position to the middle of the field of view, and move the preset camera to take a second photo to calculate the main direction angle of the plate. In a certain application scenario, the image processing algorithm calculates the corner point coordinate value, and then the camera can be moved to a position 0.7 times the length of the plate to take a second photo to calculate the main direction angle of the plate.
[0092] Specifically, in one or more embodiments of the present specification, the corner point of the plate is roughly positioned according to the coordinate information of the plate corner point and the camera parameters of the preset camera to move the corner point position to the middle of the field of view, specifically including:
[0093] First, based on the known coordinate information of the plate corner point and the center position of the camera's current field of view, the offset between the two is calculated. This offset represents the relative position of the corner point in the current field of view. Next, the angle between the corner point and the center of the field of view is calculated using a preset inverse tangent function such as atan2, which takes into account the positive and negative signs of x and y and can return the correct angle value. This angle value is used to indicate the direction of the corner point relative to the center of the field of view. Based on the offset calculated above, the preset camera focal length, and a preset scaling ratio, which can be customized by considering the camera's zoom function or the image processing's scaling requirements, the actual distance between the corner point and the center of the field of view is estimated by the product relationship between them. Then, a scaling factor is determined by the ratio of the actual distance to the angle value. This scaling factor is used to normalize the "step" or "distance" required to move the corner point from the current position to the center of the field of view. In other words, it takes into account the degree of deviation of the corner point from the center represented by the actual distance and the direction of its deviation represented by the angle value, and calculates a suitable moving distance accordingly. Finally, according to the calculated moving distance, the position of the plate corner point is moved accordingly in the field of view until it is roughly located in the center of the field of view. This step may involve sending camera control instructions, such as adjusting the camera's translation mechanism or electronic image stabilization system to achieve rough positioning of the corner point.
[0094] The above process calculates the offset and angle between the corner point and the center of the field of view, and estimates the actual distance by combining the focal length and zoom ratio of the camera. This method can determine the position of the corner point relative to the center of the field of view more accurately. By gradually adjusting the position of the corner point until it is roughly in the center of the field of view, this method can reduce the overall error caused by the accumulation of continuous positioning errors. This helps to maintain the stability and reliability of the system. Compared with methods that rely on high-precision mechanical devices or complex sensors, this method mainly relies on preset functions and camera parameters, so it is cheaper and easier to implement and maintain.
[0095] Specifically, in one or more embodiments of the present specification, moving the preset camera to take a second photo to calculate the main direction angle of the plate specifically includes:
[0096] The size of the plate and the angle value of the plate are determined by the edge line obtained in the above process, so as to determine the position of the second photo according to the size of the plate and the angle value of the plate. Then, the preset camera is moved to the position of the second photo to take a second photo, and a second image is obtained, so as to perform semantic segmentation on the second image to obtain a second plate image. Then, the image edge of the second plate image is identified to determine the edge coordinate information corresponding to the image edge of the second plate image. The main direction angle of the plate is determined according to the above-obtained corner point coordinate information and edge coordinate information of the plate. For example, assuming that the plate corner point coordinates P1 (x1, y1) obtained by the first photo and the plate edge center coordinates P2 (x2, y2) obtained by the second photo, the angle between the connecting line between the two points and a reference direction such as the horizontal direction or vertical direction of the camera field of view is calculated. Then this angle is the main direction angle of the plate, which should be noted that it can be calculated using the vector dot product and vector angle formula, or calculated by simple trigonometric functions. By first determining the size and angle value of the plate, and then selecting the position of the second photo based on this information, it can be ensured that the camera captures the image of the plate at the most favorable position. Such a setting helps to reduce problems such as image distortion, shadows and reflections, thereby improving the accuracy of edge detection and angle calculation.
[0097] Specifically, in a certain application scenario, the laser cutting machine first moves the cutting head to the initial origin position. Then the laser head moves to a corner of the plate, and the coordinates of the center of the camera's field of view can be obtained. The image segmentation algorithm is used to achieve regional segmentation of the plate and the background, and the coordinate position of the plate corner point and the rough angle value of the plate edge can be calculated. Then, based on the size of the plate and the calculated rough angle value, the next photo position is calculated, and the camera is moved to take a second photo. Image segmentation is performed again to obtain edge coordinate information, and the relative angle value of the plate edge in the depth direction, that is, the main direction angle of the plate, is calculated by taking the center position of the plate edge obtained by the second photo and the coordinates of the plate corner obtained by the first photo.
[0098] like Figure 7 As shown, the embodiment of this specification provides a schematic diagram of the structure of an edge finding and positioning device for a laser cutting machine. Figure 7 It can be seen that in one or more embodiments of this specification, an edge finding and positioning device for a laser cutting machine includes:
[0099] at least one processor; and,
[0100] a memory communicatively connected to the at least one processor; wherein,
[0101] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: execute any of the above methods
[0102] like Figure 8 As shown, the present specification provides a schematic diagram of the structure of a non-volatile storage medium. Figure 8 It can be seen that in one or more embodiments of the present specification, a non-volatile storage medium stores computer executable instructions 801, and the computer executable instructions 801 can: execute any of the methods described above.
[0103] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0104] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0105] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.
Claims
1. A method for edge finding and positioning of a laser cutting machine, characterized in that: The method comprises: Determine the initial exposure parameters and initial brightness parameters of the preset camera according to the light intensity value of the current environment of the laser cutting machine, and enable the preset camera to take pictures based on the initial exposure parameters and the initial brightness parameters to obtain an initial image; Based on the pixel information of each point in the initial image, determining the distribution of image pixels in different brightness intervals, so as to determine the brightness adjustment direction and adjustment amplitude of the initial image according to the image pixel distribution; The initial image is adjusted according to the brightness adjustment direction and the adjustment amplitude to obtain a current image, and the current image is semantically segmented to obtain a plate image; Performing edge defect compensation on the plate image to determine the coordinate information of the plate corner points according to the compensated plate image; The corners of the plate are roughly positioned according to the plate corner coordinate information and the camera parameters of the preset camera to move the corners to the middle of the field of view, and the preset camera is moved to take a second photo to calculate the main direction angle of the plate.
2. The edge finding and positioning method for a laser cutting machine according to claim 1, characterized in that: Before determining the initial exposure parameters and initial brightness parameters of the preset camera according to the light intensity value of the current environment of the laser cutting machine, the method further includes: Aligning the laser point emitted by the laser head of the current laser cutting machine with the center of a preset calibration plate to determine first coordinate data of the laser point based on the preset camera; wherein the preset calibration plate is located at a fixed position within the field of view of the preset camera; Moving the laser head of the current laser cutting machine so that the center of the field of view coincides with the center of the preset calibration plate, and determining the second coordinate position of the laser point based on the preset camera; Moving the laser head of the current laser cutting machine so that the upper left corner of the field of view coincides with the center of the preset calibration plate, and determining the third coordinate position of the laser point based on the preset camera; Processing the first coordinate data, the second coordinate data, the third coordinate data and known geometric features of the preset calibration plate based on a camera calibration algorithm to obtain camera distortion parameters; The image captured by the preset camera is corrected based on the camera distortion parameter, so as to extract the relative distance between the center point of the laser head and the center point of the camera field of view based on the corrected image.
3. The edge finding and positioning method for a laser cutting machine according to claim 1, characterized in that: According to the light intensity value of the current environment of the laser cutting machine, the initial exposure parameter and the initial brightness parameter of the preset camera are determined, and the preset camera is made to take pictures based on the initial exposure parameter and the initial brightness parameter to obtain an initial image, which specifically includes: Obtaining the light intensity value of the environment in which the laser cutting machine is currently located to determine the light intensity level corresponding to the light intensity value; Based on a preset parameter mapping table, obtaining initial exposure parameters and initial brightness parameters corresponding to the corresponding light intensity level; The found initial exposure parameters and initial brightness parameters are sent to the preset camera, and are set through the control interface of the camera so that the preset camera takes a picture based on the initial exposure parameters and the initial brightness parameters to obtain an initial image.
4. The edge finding and positioning method for a laser cutting machine according to claim 1, characterized in that: Based on the pixel information of each point in the initial image, determining the distribution of image pixels in different brightness intervals, so as to determine the brightness adjustment direction and adjustment range of the initial image according to the image pixel distribution, specifically including: Traversing the pixel points in the initial image to obtain pixel information of each point, so as to determine the brightness value of each pixel point based on the pixel information; Counting the number of pixels in each brightness interval to obtain a statistical result, and constructing a brightness distribution histogram corresponding to the initial image based on the statistical result; Determine the distribution of image pixels in different brightness intervals according to the brightness distribution histogram; wherein the image pixel distribution includes: the number of pixels and the pixel ratio; A weighted calculation is performed according to the number of pixels and the pixel proportions in different brightness intervals, so as to determine the brightness adjustment direction and adjustment range of the initial image according to the weighted calculation result.
5. The edge finding and positioning method for a laser cutting machine according to claim 1, characterized in that: Performing semantic segmentation on the current image to obtain a plate image specifically includes: Performing semantic segmentation on the current image based on a segmentation algorithm of a convolutional neural network to obtain a plate image; wherein, before performing semantic segmentation on the current image based on a segmentation algorithm of a convolutional neural network to obtain a plate image, the method further includes: Collecting scene images of the current laser cutting machine, and constructing an image data set based on the scene images; wherein each scene image in the image data set has a marking at the boundary edge between the plate and the background; The image data set is input into the convolutional neural network for iterative training to obtain a convolutional neural network segmentation algorithm that meets the requirements.
6. The edge finding and positioning method for a laser cutting machine according to claim 1, characterized in that: The edge defect compensation is performed on the plate image to determine the plate corner point coordinate information according to the compensated plate image, specifically including: Performing grayscale conversion on the plate image to determine a grayscale image corresponding to the plate image, and performing Gaussian filtering on the corresponding grayscale image to obtain a denoised grayscale image; Performing corrosion processing and expansion processing on the denoised grayscale image to obtain an image of the plate to be compensated; Performing edge detection on the image of the plate to be compensated according to an edge detection operator to determine an edge detection result of the image of the plate to be compensated; Inputting the edge detection result into a preset machine learning model to compensate edge defects of the plate image to be compensated; The compensated plate image is edge fitted according to the least squares algorithm to obtain edge lines, and the edge lines are processed based on the corner point detection algorithm to obtain the corner point coordinate information of the plate.
7. The edge finding and positioning method for a laser cutting machine according to claim 1, characterized in that: The corner point of the plate is roughly positioned according to the plate corner point coordinate information and the camera parameters of the preset camera to move the corner point position to the middle of the field of view, specifically including: Based on the coordinate information of the corner point of the plate and the center position of the field of view, determine the offset between the corner point of the plate and the center position of the field of view, and obtain the angle value between the corner point of the plate and the center position of the field of view based on a preset inverse tangent function; Determine the actual distance between the corner point of the plate and the center position of the field of view based on the product of the offset, the preset camera focal length and the preset zoom ratio; Determine a proportional factor according to the ratio of the actual distance to the angle value, so as to determine the moving distance of the corner point of the plate relative to the center position of the field of view according to the proportional factor and the offset between the corner point of the plate and the center position of the field of view; The corner point position is moved to the middle of the field of view according to the moving distance.
8. The edge finding and positioning method for a laser cutting machine according to claim 6, characterized in that: The preset camera is moved to take a second photo to calculate the main direction angle of the plate, specifically including: Determine the size of the plate and the angle value of the plate based on the edge line, so as to determine the position of the second photo shooting according to the size of the plate and the angle value of the plate; Moving the preset camera to the position for the secondary photographing to take a secondary photograph to obtain a secondary image, and performing semantic segmentation on the secondary image to obtain a secondary plate image; Identifying an image edge of the secondary plate image to determine edge coordinate information corresponding to the image edge of the secondary plate image; The main direction angle of the plate is determined based on the corner point coordinate information and the edge coordinate information of the plate.
9. An edge finding and positioning device for a laser cutting machine, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: execute any of the methods described in claims 1-8.
10. A non-volatile storage medium storing computer executable instructions, characterized in that: The computer executable instructions can: execute the method described in any one of claims 1 to 8.