Image processing method and system for CCD image positioning

By collecting and pre-processing the material tray images in the CCD image positioning system, constructing and comparing the center of gravity position sequence, calculating and adjusting the offset evaluation, the problem of inaccurate positioning of CCD images in the prior art is solved, efficient and accurate material tray placement evaluation and positioning are achieved, and production efficiency and product quality are improved.

CN119625070AActive Publication Date: 2025-03-14SHENZHEN XIN MAO XIN IND CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510153283.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-03-14
Estimated Expiration
2045-02-12

AI Technical Summary

Technical Problem

In the prior art, the image processing method of CCD image positioning is difficult to accurately and in real time to analyze the material tray image. Especially when processing the material tray offset judgment, it is impossible to provide accurate offset calculation and evaluation, and there is a lack of an automated adjustment mechanism, which affects production efficiency and product quality.

Method used

An image processing method for CCD image positioning is proposed. Multiple tray images are collected from a fixed angle through a CCD camera, pre-processing is performed to remove noise and enhance contrast, and the center of gravity position sequence is constructed to compare with the standard sequence, calculate the offset, generate the initial value of the offset evaluation and adjust it to the final value, set the level and identification level, and store and display the results.

Benefits of technology

It realizes accurate evaluation of the placement status of the material tray, improves positioning accuracy and production efficiency, simplifies the monitoring process, adapts to the high-precision needs of CNC loading and unloading equipment, and ensures consistency of product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625070A_ABST
    Figure CN119625070A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses an image processing method and system for CCD image localization, and the method comprises the steps: collecting a plurality of charging tray images from a fixed angle through a CCD camera, and constructing a center-of-gravity position sequence of a to-be-processed workpiece image of each charging tray; constructing a center-of-gravity offset sequence of the to-be-processed workpiece image of each tray; judging whether the placement of the charging trays is standard or not according to the gravity center point offset sequence, generating an initial offset evaluation value of each charging tray according to the offset in the gravity center point offset sequence, and adjusting the initial offset evaluation value according to the average offset to obtain a final offset evaluation value; determining an offset evaluation identification level according to the offset evaluation final value level; and storing and displaying the center-of-gravity position sequence, the center-of-gravity offset sequence, the offset evaluation final value and the offset evaluation identification level on CNC loading and unloading equipment. According to the invention, the monitoring process is simplified while the positioning precision is improved, and efficient and reliable automatic production can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image processing method and system for CCD image positioning. Background Art

[0002] CNC loading and unloading machine is an automated equipment used for material loading and unloading operations during the CNC machine tool (CNC) processing process. It realizes automatic pick-up and placement of workpieces through automatic manipulators or conveying devices, thereby reducing manual intervention and improving production efficiency. CNC loading and unloading machines are usually used in conjunction with CNC machining centers, lathes, milling machines and other equipment. They can automatically feed raw materials into machine tools for processing, and take out the workpieces and place them in the specified position after processing. CCD image positioning is a technology that uses CCD (charge-coupled device) cameras to capture images and analyze the image content through image processing technology to accurately locate the position of objects. This method is often used in industrial automation, machine vision and precision manufacturing to help equipment determine the position and posture of workpieces or components in order to achieve precise operation.

[0003] In the prior art, the image processing method of CCD image positioning usually relies on manual operation or simple image processing algorithms, which makes it difficult to accurately and real-time analyze and evaluate the tray image. Especially when dealing with the offset judgment of the tray, the traditional method often cannot provide accurate offset calculation and evaluation, and lacks an effective automatic adjustment mechanism. In addition, the prior art lacks a unified standardized evaluation system, which makes it difficult to efficiently judge the standardization of tray placement during the production process, affecting production efficiency and product quality.

[0004] Therefore, it is necessary to provide an image processing method and system for CCD image positioning to solve the problem that the prior art lacks accurate and efficient CCD image positioning and offset evaluation methods, resulting in inaccurate tray placement judgment, affecting production efficiency and product quality. Summary of the invention

[0005] In view of this, the present invention proposes an image processing method and system for CCD image positioning, aiming to solve the problem that the prior art lacks accurate and efficient CCD image positioning and offset evaluation methods, resulting in inaccurate judgment of tray placement, affecting production efficiency and product quality.

[0006] On the one hand, the present invention provides an image processing method for CCD image positioning, comprising: The CCD camera collects a number of tray images from a fixed angle, preprocesses the tray images, obtains each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the preprocessing result, and constructs a center of gravity position sequence of the image of the workpiece to be processed of each tray according to the center of gravity position information of each image of the workpiece to be processed in each tray image; Compare the center of gravity position sequences on several trays with the standard center of gravity position sequence in turn, calculate the center of gravity position offset of the image to be processed in each tray image, and construct the center of gravity offset sequence of the image to be processed of each tray; Determine whether the placement of the tray is standard according to the center of gravity offset sequence, generate an initial offset evaluation value of each tray according to the offset in the center of gravity offset sequence, calculate the average offset of the center of gravity position in each center of gravity offset sequence, determine whether to adjust the initial offset evaluation value, and if it is determined to be adjusted, adjust the initial offset evaluation value according to the average offset to obtain a final offset evaluation value; Setting a deviation assessment final value level and a deviation assessment identification level, and determining the deviation assessment identification level according to the deviation assessment final value level; The center of gravity position sequence, center of gravity offset sequence, offset evaluation final value and offset evaluation identification level are stored and displayed on the CNC loading and unloading equipment.

[0007] Furthermore, when a CCD camera collects a plurality of tray images from a fixed angle, preprocesses the plurality of tray images, and obtains each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the preprocessing result, the method includes: Use median filtering or Gaussian filtering algorithm to remove noise from the image; Converting the tray image into a grayscale image; By using the histogram equalization method, the contrast of the grayscale image is increased according to the following formula: In(x,y)=[Ig(x,y)−min(Ig)] / [max(Ig)−min(Ig)]×(L−1); In the above formula, In(x, y) represents the grayscale value of the image after equalization, Ig(x, y) represents the grayscale value of the image before equalization, min(Ig) represents the minimum grayscale value in the grayscale image before equalization, max(Ig) represents the maximum grayscale value in the grayscale image before equalization, and L represents the grayscale level, L=256.

[0008] Further, when each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image are obtained based on the preprocessing result, and according to the center of gravity position information of each image of the workpiece to be processed in each tray image, a center of gravity position sequence of the image of the workpiece to be processed of each tray is constructed, it includes: The contour of each workpiece to be processed is extracted through edge detection algorithm, and the workpiece area in the image is separated from the background; The coordinates of the center of gravity of each workpiece to be processed (xci, yci) are calculated by the following formula, where i=1,2,3,…,n: ; ; In the above formula, xci represents the x-axis coordinate of the centroid, I(xi,yi) represents the grayscale value of the i-th pixel, where i=1,2,3,…,n, xi represents the x-axis coordinate of the i-th pixel, yci represents the y-axis coordinate of the centroid, and yi represents the y-axis coordinate of the i-th pixel; Calculate the coordinates of the center of gravity of all workpieces to be processed on each tray respectively; Construct the center of gravity position sequence of the workpiece image to be processed for each tray: Sc={(xc1,yc1),(xc2,yc2),…,(xcn,ycn)}; In the above formula, Sc represents the center of gravity position sequence, (xci, yci) represents the coordinates of the center of gravity of the i-th workpiece to be processed, where i=1,2,3,…,n.

[0009] Furthermore, when the center of gravity position sequences on several trays are compared with the standard center of gravity position sequence in sequence, the center of gravity position offset of the image to be processed in each tray image is calculated, and the center of gravity offset sequence of the image to be processed of each tray is constructed, it includes: Set the standard centroid position sequence Ss={(xs1,ys1),(xs2,ys2),…,(xsn,ysn)}; In the above formula, Ss represents the standard center of gravity position sequence, (xsi, ysi) represents the coordinates of the i-th standard center of gravity, where i=1,2,3,…,n; According to the coordinates of the center of gravity of each workpiece to be processed and the coordinates of the standard center of gravity, the position offset pi of the center of gravity of each image to be processed is calculated by the following formula, i=1,2,3,…,n: ; The offset sequence is P=(p1,p2,p3,…,pn).

[0010] Further, when judging whether the placement of the tray is standard according to the center of gravity offset sequence, it includes: Setting a maximum offset value, and comparing the maximum offset value of the center of gravity point position of the image to be processed in the offset sequence with the maximum offset value; If the maximum value of the position offset of the center of gravity of the image to be processed is less than the maximum value of the offset, the placement standard of the tray; If the maximum value of the position offset of the center of gravity of the image to be processed is greater than or equal to the maximum value of the offset, the placement of the material tray is not standard.

[0011] Further, when generating the initial offset evaluation value of each tray according to the offset in the center of gravity offset sequence, it includes: Setting a threshold value of the number of the centroid position offsets of the image to be processed in the offset sequence that is greater than or equal to the maximum offset value; If the number of the offsets of the centroid position of the image to be processed in the offset sequence that is greater than or equal to the maximum offset value is greater than or equal to the number threshold, the initial offset evaluation value is the first evaluation value; If the number of the offsets of the centroid positions of the images to be processed in the offset sequence that is greater than or equal to the maximum offset value is less than the number threshold, the initial offset evaluation value is the second evaluation value; The first evaluation value is smaller than the second evaluation value.

[0012] Further, when calculating the mean value of the offset of the center of gravity position in each center of gravity offset sequence and determining whether to adjust the initial value of the offset evaluation, it includes: Setting a standard mean value of the offset, and if the standard mean value of the offset is less than the standard mean value of the offset, determining that there is no need to adjust the initial value of the offset assessment; If the offset mean is greater than or equal to the offset standard mean, it is determined that the offset assessment initial value needs to be adjusted.

[0013] Further, if it is determined to be an adjustment, the initial offset evaluation value is adjusted according to the offset mean value to obtain a final offset evaluation value, including: Setting a first mean and a second mean, wherein the first mean is smaller than the second mean, and the first mean is larger than the standard mean of the offset; If the offset mean is less than or equal to the first mean, adjusting the offset evaluation initial value by a first adjustment coefficient; If the offset mean is greater than the first mean and less than or equal to the second mean, adjusting the offset evaluation initial value by a second adjustment coefficient; If the offset mean is greater than the second mean, adjusting the offset evaluation initial value by a third adjustment coefficient; Among them, the first adjustment coefficient is smaller than the second adjustment coefficient, and the second adjustment coefficient is smaller than the third adjustment coefficient.

[0014] Furthermore, when setting the deviation assessment final value level and the deviation assessment identification level, according to the deviation assessment final value level and the deviation assessment identification level, it includes: The final value levels of the deviation assessment are level one, level two and level three from high to low; A first final evaluation value is set, and if the final values ​​of the deviation evaluation of all the trays are greater than the first final evaluation value, the level of the final deviation evaluation value is determined to be level one; If there is a material tray whose final offset evaluation value is greater than the first final evaluation value, and at the same time there is a material tray whose final offset evaluation value is less than the first final evaluation value, it is determined that the final offset evaluation value level is level 2; If the final values ​​of the deviation evaluation of all the trays are less than the first final evaluation value, the final value of the deviation evaluation is determined to be level three; The offset assessment identification levels include standard, slight offset and heavy offset; If the final value level of the deviation assessment is level one, the deviation assessment identification level is determined to be standard; If the final value level of the deviation assessment is level 2, the deviation assessment identification level is determined to be a slight deviation; If the final value level of the deviation assessment is level three, the deviation assessment identification level is determined to be a heavy deviation.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention collects multiple tray images at a fixed angle to ensure the standardization of data collection, and removes noise and enhances contrast through image preprocessing, thereby improving the accuracy of image analysis. Secondly, the construction of the center of gravity position sequence and the comparison with the standard center of gravity position can accurately identify the offset of the workpiece to be processed in each tray, and can capture the slight deviation of the tray position. The established offset sequence and the initial value of the offset evaluation are further adjusted to the final value through the offset mean, and the standard of the offset evaluation can be adjusted in time according to the actual situation, which increases flexibility; the setting of the offset evaluation final value and the identification level facilitates automatic grading, thereby intuitively showing whether the tray placement status meets the standard. In addition, all results are stored and displayed, which realizes the traceability and visualization of data, facilitates status monitoring and record management in the production process, improves production safety and operating efficiency, and adapts to the high-precision requirements of CNC loading and unloading equipment. Overall, this method simplifies the monitoring process while improving positioning accuracy, which helps to achieve efficient and reliable automated production.

[0016] On the other hand, the present application also provides an image processing system for CCD image positioning, comprising: The image processing module is configured as a CCD camera to collect a plurality of tray images from a fixed angle, preprocess the plurality of tray images, obtain each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the preprocessing result, and construct a center of gravity position sequence of the image of the workpiece to be processed of each tray according to the center of gravity position information of each image of the workpiece to be processed in each tray image; An offset calculation module is configured to compare the center of gravity position sequence on different trays with the standard center of gravity position sequence in turn, calculate the center of gravity position offset of the image to be processed in each tray image, and construct the center of gravity offset sequence of the image to be processed of each tray; An evaluation value calculation module is configured to determine whether the placement of the material tray is standard according to the center of gravity offset sequence, generate an initial offset evaluation value of each material tray according to the offset in the center of gravity offset sequence, calculate the average offset of the center of gravity position in each center of gravity offset sequence, determine whether to adjust the initial offset evaluation value, and if it is determined to be adjusted, adjust the initial offset evaluation value according to the average offset to obtain a final offset evaluation value; An identification level determination module is configured to set a deviation assessment final value level and a deviation assessment identification level, and determine the deviation assessment identification level according to the number of each level in the deviation assessment final value level; The storage and display module is configured to store and display the center of gravity position sequence, center of gravity offset sequence, offset evaluation final value and offset evaluation identification level on the CNC loading and unloading equipment.

[0017] It can be understood that the image processing method and system for CCD image positioning provided in the present application have the same beneficial effects, which will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings: Figure 1 A flowchart of an image processing method for CCD image positioning provided by an embodiment of the present invention; Figure 2 A functional block diagram of an image processing system for CCD image positioning provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features described in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0020] In some embodiments of the present application, see Figure 1 As shown, this embodiment provides an image processing method for CCD image positioning, comprising the following steps: S100, a CCD camera collects a number of tray images from a fixed angle, preprocesses the number of tray images, obtains each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the preprocessing result, and constructs a center of gravity position sequence of the image of the workpiece to be processed of each tray according to the center of gravity position information of each image of the workpiece to be processed in each tray image; S200, sequentially comparing the center of gravity position sequences on a plurality of trays with the standard center of gravity position sequence, calculating the center of gravity position offset of the image to be processed in each tray image, and constructing the center of gravity offset sequence of the image to be processed of each tray; S300, judging whether the placement of the tray is standard according to the center of gravity offset sequence, generating the initial offset evaluation value of each tray according to the offset in the center of gravity offset sequence, calculating the mean offset of the center of gravity position in each center of gravity offset sequence, judging whether to adjust the initial offset evaluation value, and if it is judged to be adjusted, adjusting the initial offset evaluation value according to the mean offset to obtain the final offset evaluation value; S400, setting the deviation assessment final value level and the deviation assessment identification level, and determining the deviation assessment identification level according to the deviation assessment final value level; S500, storing and displaying the center of gravity position sequence, center of gravity offset sequence, offset evaluation final value and offset evaluation identification level on the CNC loading and unloading equipment.

[0021] It can be understood that the present invention collects multiple tray images at a fixed angle to ensure the standardization of data collection, and removes noise and enhances contrast through image preprocessing, thereby improving the accuracy of image analysis. Secondly, the construction of the center of gravity position sequence and the comparison with the standard center of gravity position can accurately identify the offset of the workpiece to be processed in each tray, and can capture the slight deviation of the tray position. The established offset sequence and the initial value of the offset evaluation are further adjusted to the final value through the offset mean, and the standard of the offset evaluation can be adjusted in time according to the actual situation, which increases flexibility; the setting of the offset evaluation final value and the identification level facilitates automatic grading, so as to intuitively display whether the tray placement status meets the standard. In addition, all results are stored and displayed, which realizes the traceability and visualization of data, facilitates status monitoring and record management in the production process, improves production safety and operating efficiency, and adapts to the high-precision requirements of CNC loading and unloading equipment. Overall, this method simplifies the monitoring process while improving positioning accuracy, which helps to achieve efficient and reliable automated production.

[0022] In some embodiments of the present application, when a CCD camera collects a plurality of tray images from a fixed angle, preprocesses the plurality of tray images, and obtains each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the preprocessing result, the method includes: Use median filtering or Gaussian filtering algorithm to remove noise from the image; Convert the tray image into a grayscale image; By using the histogram equalization method, the contrast of the grayscale image is increased according to the following formula: In(x,y)=[Ig(x,y)−min(Ig)] / [max(Ig)−min(Ig)]×(L−1); In the above formula, In(x, y) represents the grayscale value of the image after equalization, Ig(x, y) represents the grayscale value of the image before equalization, min(Ig) represents the minimum grayscale value in the grayscale image before equalization, max(Ig) represents the maximum grayscale value in the grayscale image before equalization, and L represents the grayscale level, L=256.

[0023] It can be understood that by using median filtering or Gaussian filtering algorithms to remove noise in the image, the image quality is effectively improved, so that the subsequent image processing process is not disturbed by noise, ensuring the accurate identification of the workpiece to be processed; after conversion to a grayscale image, the complexity of the image information is reduced, which is convenient for subsequent processing and analysis; and by increasing the contrast of the image through the histogram equalization method, the visual effect of the image can be significantly improved, making the details in the image more prominent, especially in areas with small grayscale differences, enhancing the contrast and brightness of the image, thereby improving the recognition accuracy of the contour of the workpiece to be processed. Using this method, the image is optimized in detail capture, especially for images with low contrast or complex backgrounds, which can improve the accuracy of center of gravity extraction, ensure that subsequent processing (such as center of gravity location and offset calculation) is more accurate, and further improve the reliability and accuracy of the CCD image positioning system.

[0024] In some embodiments of the present application, when obtaining each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the preprocessing result, and constructing a center of gravity position sequence of the image of the workpiece to be processed of each tray according to the center of gravity position information of each image of the workpiece to be processed in each tray image, the method includes: The contour of each workpiece to be processed is extracted through edge detection algorithm, and the workpiece area in the image is separated from the background; The coordinates of the center of gravity of each workpiece to be processed (xci, yci) are calculated by the following formula, where i=1,2,3,…,n: ; ; In the above formula, xci represents the x-axis coordinate of the centroid, I(xi,yi) represents the grayscale value of the i-th pixel, where i=1,2,3,…,n, xi represents the x-axis coordinate of the i-th pixel, yci represents the y-axis coordinate of the centroid, and yi represents the y-axis coordinate of the i-th pixel; Calculate the coordinates of the center of gravity of all workpieces to be processed on each tray respectively; Construct the center of gravity position sequence of the workpiece image to be processed for each tray: Sc={(xc1,yc1),(xc2,yc2),…,(xcn,ycn)}; In the above formula, Sc represents the center of gravity position sequence, (xci, yci) represents the coordinates of the center of gravity of the i-th workpiece to be processed, where i=1,2,3,…,n.

[0025] It is understandable that the present invention uses an edge detection algorithm to extract the outline of the workpiece to be processed and distinguish it from the background, which can significantly improve the positioning accuracy of the workpiece to be processed. Edge detection helps the system accurately determine the area of ​​each workpiece to be processed by highlighting the boundaries of the object, thereby reducing the interference of background noise on the extraction of the center of gravity. This processing method is particularly effective for images with complex backgrounds or overlapping objects. By calculating the coordinates of the center of gravity of each workpiece to be processed and constructing a center of gravity position sequence, the position of each workpiece to be processed can be accurately reflected, further improving the accuracy and stability of positioning. The constructed center of gravity position sequence provides a reliable basis for subsequent offset calculations, and can efficiently locate and compare multiple workpieces to be processed in a multi-tray environment, laying the foundation for realizing an automated and accurate production process. The implementation of this method greatly improves the accuracy and efficiency of CCD image positioning.

[0026] In some embodiments of the present application, when the center of gravity position sequences on a plurality of trays are sequentially compared with the standard center of gravity position sequence, the center of gravity position offset of the image to be processed in each tray image is calculated, and the center of gravity offset sequence of the image to be processed of each tray is constructed, it includes: Set the standard centroid position sequence Ss={(xs1,ys1),(xs2,ys2),…,(xsn,ysn)}; In the above formula, Ss represents the standard center of gravity position sequence, (xsi, ysi) represents the coordinates of the i-th standard center of gravity, where i=1,2,3,…,n; According to the coordinates of the center of gravity of each workpiece to be processed and the coordinates of the standard center of gravity, the position offset pi of the center of gravity of each image to be processed is calculated by the following formula, i=1,2,3,…,n: ; The offset sequence is P=(p1,p2,p3,…,pn).

[0027] It can be understood that the present invention can accurately calculate the center of gravity position offset of each workpiece to be processed by comparing the center of gravity position sequence on the tray with the standard center of gravity position sequence, which helps to determine whether the placement of the tray meets the standard, thereby providing a key basis for subsequent automated operations. By setting a standard center of gravity position sequence, the standard position of each workpiece to be processed is clearly specified, further improving the accuracy and reliability of the operation. By calculating the offset, the position error of each workpiece to be processed can be directly measured, which facilitates timely adjustment of placement problems in the production process. In addition, the offset sequence can provide data support for further process optimization and help discover potential production problems or deviations. Overall, the present invention ensures the precise positioning of each workpiece to be processed in the tray, so that the automation system can effectively identify and correct position deviations, greatly improving the accuracy and consistency of the production process, reducing the need for manual intervention, and improving production efficiency.

[0028] In some embodiments of the present application, when judging whether the placement of the tray is standard according to the center of gravity offset sequence, it includes: Set the maximum offset value, and compare the maximum offset value of the center of gravity of the image to be processed in the offset sequence with the maximum offset value; If the maximum value of the position offset of the center of gravity of the image to be processed is less than the maximum value of the offset, the placement standard of the tray; If the maximum value of the position offset of the center of gravity of the image to be processed is greater than or equal to the maximum value of the offset, the placement of the tray is not standard.

[0029] It can be understood that the present invention can efficiently determine whether the placement of the tray is standard by setting the maximum value of the offset and comparing it with the maximum value of the position offset of the center of gravity of the image to be processed. By setting a tolerance range (maximum value of the offset), trays with excessive offsets can be quickly screened out, and non-standard placement can be identified in a timely manner, which not only avoids complex calculation processes, but also can quickly discover potential problems in the production process, avoiding deviations or quality problems in subsequent processing due to improper placement of the tray. In addition, through this judgment standard, position checks can be performed automatically, reducing manual intervention, improving production efficiency and product consistency, and improving the response speed and accuracy of the system, thereby helping to achieve more refined quality control and ensure the smooth progress of the entire production process, which is particularly suitable for high-precision manufacturing environments.

[0030] In some embodiments of the present application, when generating the initial offset evaluation value of each tray according to the offset in the center of gravity offset sequence, it includes: Set the number threshold of the position offset of the center of gravity point of the image to be processed in the offset sequence that is greater than or equal to the maximum offset value; If the number of the offsets of the centroid position of the image to be processed in the offset sequence that is greater than or equal to the maximum offset value is greater than or equal to the number threshold, the initial offset evaluation value is the first evaluation value; If the number of the offsets of the centroid positions of the images to be processed in the offset sequence that is greater than or equal to the maximum offset value is less than the number threshold, the initial offset evaluation value is the second evaluation value; The first evaluation value is smaller than the second evaluation value.

[0031] It can be understood that by setting the number threshold for the offset of the center of gravity point position of the image to be processed in the offset sequence to be greater than or equal to the maximum offset value, the initial offset evaluation value of the tray can be flexibly generated according to the distribution of the offset. This method can more accurately evaluate the standardization of tray placement by introducing the setting of the number threshold. If the number of large offsets is large, a lower initial evaluation value is generated, indicating that the offset is more serious; on the contrary, if the number of large offsets is small, a higher initial evaluation value is generated, indicating that the placement offset is lighter. The evaluation process is more adaptive and can adjust the initial evaluation value according to the actual situation to avoid over-evaluation due to a small amount of offset. It can not only improve robustness and accuracy, but also provide a more flexible basis for subsequent adjustments and optimizations, thereby realizing accurate monitoring of the tray placement status and effectively improving production efficiency and product quality consistency.

[0032] In some embodiments of the present application, when calculating the mean offset of the center of gravity position in each center of gravity offset sequence and determining whether to adjust the initial offset evaluation value, the process includes: Set the offset standard mean. If the offset mean is less than the offset standard mean, it is determined that there is no need to adjust the initial value of the offset assessment. If the offset mean is greater than or equal to the offset standard mean, it is determined that the initial value of the offset assessment needs to be adjusted.

[0033] In some embodiments of the present application, if it is determined to be an adjustment, the initial offset evaluation value is adjusted according to the offset mean value to obtain the final offset evaluation value, including: Set a first mean and a second mean, and the first mean is smaller than the second mean, and the first mean is larger than the standard mean of the offset; If the offset mean is less than or equal to the first mean, the offset assessment initial value is adjusted by the first adjustment coefficient; If the offset mean is greater than the first mean and less than or equal to the second mean, the offset assessment initial value is adjusted by the second adjustment coefficient; If the offset mean is greater than the second mean, the offset assessment initial value is adjusted by the third adjustment coefficient; Among them, the first adjustment coefficient is smaller than the second adjustment coefficient, and the second adjustment coefficient is smaller than the third adjustment coefficient.

[0034] It can be understood that by setting the standard mean of the offset, the overall level of the tray placement offset can be effectively judged. If the mean of the offset is small, it means that the offset is relatively slight, and you can choose not to adjust the initial evaluation value, thereby avoiding unnecessary adjustments and saving computing resources and time; when the mean of the offset is large, it means that the offset is more serious and the initial evaluation value needs to be adjusted. At this time, by setting different mean intervals and adjustment coefficients, different degrees of adjustment can be made according to the specific mean of the offset. Using multiple adjustment coefficients can refine the adjustment process, ensure the accuracy of the final value of the offset evaluation, and avoid inaccurate evaluation results due to excessive or insufficient adjustments. In addition, hierarchical adjustment makes the evaluation process more flexible and adaptable, and can make reasonable responses to different actual situations, thereby effectively improving the detection accuracy of tray placement and improving the stability and reliability of the production process.

[0035] In some embodiments of the present application, when setting the deviation assessment final value level and the deviation assessment identification level, the deviation assessment identification level is shifted according to the deviation assessment final value level, including: The final value levels of the deviation assessment are level one, level two and level three from high to low; A first final evaluation value is set. If the final values ​​of the offset evaluation of all trays are greater than the first final evaluation value, the final value level of the offset evaluation is determined to be level one. If there is a material tray whose final offset evaluation value is greater than the first final evaluation value, and at the same time, there is a material tray whose final offset evaluation value is less than the first final evaluation value, then the final offset evaluation value level is determined to be level 2; If the final values ​​of the offset assessment of all trays are less than the first final assessment value, the final value level of the offset assessment is determined to be level three; The offset assessment identification levels include standard, slight offset and heavy offset; If the final value level of the deviation assessment is level 1, the deviation assessment identification level is determined to be standard; If the final value level of the deviation assessment is level 2, the deviation assessment identification level is determined to be a slight deviation; If the final value level of the offset assessment is level three, the offset assessment identification level is determined to be heavy offset.

[0036] It can be understood that by setting the final value level of the offset assessment and the identification level of the offset assessment, the placement of the trays can be effectively classified and graded, thereby improving accuracy and adaptability. The final value level of the offset assessment classifies trays with smaller offsets into level one and trays with larger offsets into level three by setting the first final assessment value, which helps to quickly identify situations where the offset is more serious and take corresponding treatment measures. In addition, the setting of the offset assessment identification level further refines the assessment results, marking trays with standard placement as "standard", trays with smaller offsets as "micro-offset", and trays with larger offsets as "heavy offset", which not only helps to quickly locate the problem, but also facilitates subsequent tracking and processing. By converting the assessment results into different identification levels, operators can have a clearer understanding of the placement status of each tray, so as to make targeted adjustments and optimizations to ensure the stable operation of the equipment during the production process and reduce the potential risks and losses caused by non-standard placement.

[0037] On the other hand, see Figure 2 As shown, the present application also provides an image processing system for CCD image positioning, which is used to apply the above-mentioned image processing method for CCD image positioning, including: The image processing module is configured as a CCD camera to collect a number of tray images from a fixed angle, pre-process the number of tray images, obtain each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the pre-processing result, and construct a center of gravity position sequence of the image of the workpiece to be processed of each tray according to the center of gravity position information of each image of the workpiece to be processed in each tray image; An offset calculation module is configured to compare the center of gravity position sequence on different trays with the standard center of gravity position sequence in turn, calculate the center of gravity position offset of the image to be processed in each tray image, and construct the center of gravity offset sequence of the image to be processed of each tray; An evaluation value calculation module is configured to determine whether the placement of the tray is standard according to the center of gravity offset sequence, generate an initial offset evaluation value of each tray according to the offset in the center of gravity offset sequence, calculate the average offset of the center of gravity position in each center of gravity offset sequence, determine whether to adjust the initial offset evaluation value, and if it is determined to be adjusted, adjust the initial offset evaluation value according to the average offset to obtain a final offset evaluation value; An identification level determination module is configured to set a deviation assessment final value level and a deviation assessment identification level, and determine the deviation assessment identification level according to the number of each level in the deviation assessment final value level; The storage and display module is configured to store and display the center of gravity position sequence, center of gravity offset sequence, offset evaluation final value and offset evaluation identification level on the CNC loading and unloading equipment.

[0038] It is understandable that the image processing system for CCD image positioning provided by the present application can efficiently and accurately process the tray image, judge the standard of placement, and evaluate its offset in real time by integrating multiple modules to work together. The function of the image processing module is to obtain the tray image from the CCD camera and perform preprocessing, and to provide basic data for subsequent offset calculation by extracting the coordinates of the center of gravity of the workpiece to be processed. The offset calculation module compares the center of gravity position of each tray with the standard center of gravity sequence to calculate the offset, thereby obtaining the center of gravity offset sequence of each tray. The evaluation value calculation module further analyzes the offset sequence, determines whether the tray placement meets the standard, and adjusts the initial value of the offset evaluation as needed to obtain the final value of the offset evaluation to ensure the accuracy of the evaluation result. The identification level determination module classifies the evaluation results, identifies the tray as different levels according to different offset conditions, and provides a more intuitive offset evaluation. Finally, the storage and display module stores all data results in real time and displays them on the CNC loading and unloading equipment, which is convenient for operators to monitor and adjust. This systematic image processing and evaluation mechanism can effectively improve the level of automation in the production process, reduce manual intervention, and improve production efficiency and product quality.

[0039] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

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

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

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

[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. An image processing method for CCD image positioning, characterized in that: include: The CCD camera collects a number of tray images from a fixed angle, preprocesses the tray images, obtains each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the preprocessing result, and constructs a center of gravity position sequence of the image of the workpiece to be processed of each tray according to the center of gravity position information of each image of the workpiece to be processed in each tray image; Compare the center of gravity position sequences on several trays with the standard center of gravity position sequence in turn, calculate the center of gravity position offset of the image to be processed in each tray image, and construct the center of gravity offset sequence of the image to be processed of each tray; Determine whether the placement of the tray is standard according to the center of gravity offset sequence, generate an initial offset evaluation value of each tray according to the offset in the center of gravity offset sequence, calculate the average offset of the center of gravity position in each center of gravity offset sequence, determine whether to adjust the initial offset evaluation value, and if it is determined to be adjusted, adjust the initial offset evaluation value according to the average offset to obtain a final offset evaluation value; Setting a deviation assessment final value level and a deviation assessment identification level, and determining the deviation assessment identification level according to the deviation assessment final value level; The center of gravity position sequence, center of gravity offset sequence, offset evaluation final value and offset evaluation identification level are stored and displayed on the CNC loading and unloading equipment.

2. The image processing method for CCD image positioning according to claim 1, characterized in that: When a CCD camera collects a plurality of tray images from a fixed angle, preprocesses the plurality of tray images, and obtains each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the preprocessing result, the method includes: Use median filtering or Gaussian filtering algorithm to remove noise from the image; Converting the tray image into a grayscale image; By using the histogram equalization method, the contrast of the grayscale image is increased according to the following formula: In(x,y)=[Ig(x,y)−min(Ig)] / [max(Ig)−min(Ig)]×(L−1); In the above formula, In(x, y) represents the grayscale value of the image after equalization, Ig(x, y) represents the grayscale value of the image before equalization, min(Ig) represents the minimum grayscale value in the grayscale image before equalization, max(Ig) represents the maximum grayscale value in the grayscale image before equalization, and L represents the grayscale level, L=256.

3. The image processing method for CCD image positioning according to claim 2, characterized in that: When obtaining each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the preprocessing result, and constructing a center of gravity position sequence of the image of the workpiece to be processed in each tray according to the center of gravity position information of each image of the workpiece to be processed in each tray image, the method includes: The contour of each workpiece to be processed is extracted through edge detection algorithm, and the workpiece area in the image is separated from the background; The coordinates of the center of gravity of each workpiece to be processed (xci, yci) are calculated by the following formula, where i=1,2,3,…,n: ; ; In the above formula, xci represents the x-axis coordinate of the centroid, I(xi,yi) represents the grayscale value of the i-th pixel, where i=1,2,3,…,n, xi represents the x-axis coordinate of the i-th pixel, yci represents the y-axis coordinate of the centroid, and yi represents the y-axis coordinate of the i-th pixel; Calculate the coordinates of the center of gravity of all workpieces to be processed on each tray respectively; Construct the center of gravity position sequence of the workpiece image to be processed for each tray: Sc={(xc1,yc1),(xc2,yc2),…,(xcn,ycn)}; In the above formula, Sc represents the center of gravity position sequence, (xci, yci) represents the coordinates of the center of gravity of the i-th workpiece to be processed, where i=1,2,3,…,n.

4. The image processing method for CCD image positioning according to claim 3, characterized in that: When the center of gravity position sequences on several trays are compared with the standard center of gravity position sequence in sequence, the center of gravity position offset of the image to be processed in each tray image is calculated, and the center of gravity offset sequence of the image to be processed of each tray is constructed, it includes: Set the standard centroid position sequence Ss={(xs1,ys1),(xs2,ys2),…,(xsn,ysn)}; In the above formula, Ss represents the standard center of gravity position sequence, (xsi, ysi) represents the coordinates of the i-th standard center of gravity, where i=1,2,3,…,n; According to the coordinates of the center of gravity of each workpiece to be processed and the coordinates of the standard center of gravity, the position offset pi of the center of gravity of each image to be processed is calculated by the following formula, i=1,2,3,…,n: ; The offset sequence is P=(p1,p2,p3,…,pn).

5. The image processing method for CCD image positioning according to claim 4, characterized in that: When judging whether the placement of the tray is standard according to the center of gravity offset sequence, it includes: Setting a maximum offset value, and comparing the maximum offset value of the center of gravity point position of the image to be processed in the offset sequence with the maximum offset value; If the maximum value of the position offset of the center of gravity of the image to be processed is less than the maximum value of the offset, the placement standard of the tray; If the maximum value of the position offset of the center of gravity of the image to be processed is greater than or equal to the maximum value of the offset, the placement of the material tray is not standard.

6. The image processing method for CCD image positioning according to claim 5, characterized in that: When generating the initial offset evaluation value of each tray according to the offset in the center of gravity offset sequence, it includes: Setting a threshold value of the number of the centroid position offsets of the image to be processed in the offset sequence that is greater than or equal to the maximum offset value; If the number of the offsets of the centroid position of the image to be processed in the offset sequence that is greater than or equal to the maximum offset value is greater than or equal to the number threshold, the initial offset evaluation value is the first evaluation value; If the number of the offsets of the centroid positions of the images to be processed in the offset sequence that is greater than or equal to the maximum offset value is less than the number threshold, the initial offset evaluation value is the second evaluation value; The first evaluation value is smaller than the second evaluation value.

7. The image processing method for CCD image positioning according to claim 6, characterized in that: When calculating the mean offset of the center of gravity position in each center of gravity offset sequence and determining whether to adjust the initial offset evaluation value, it includes: Setting a standard mean value of the offset, and if the standard mean value of the offset is less than the standard mean value of the offset, determining that there is no need to adjust the initial value of the offset assessment; If the offset mean is greater than or equal to the offset standard mean, it is determined that the offset assessment initial value needs to be adjusted.

8. The image processing method for CCD image positioning according to claim 7, characterized in that: If it is determined to be an adjustment, the initial offset evaluation value is adjusted according to the offset mean value to obtain a final offset evaluation value, including: Setting a first mean and a second mean, wherein the first mean is smaller than the second mean, and the first mean is larger than the standard mean of the offset; If the offset mean is less than or equal to the first mean, adjusting the offset evaluation initial value by a first adjustment coefficient; If the offset mean is greater than the first mean and less than or equal to the second mean, adjusting the offset evaluation initial value by a second adjustment coefficient; If the offset mean is greater than the second mean, adjusting the offset evaluation initial value by a third adjustment coefficient; Among them, the first adjustment coefficient is smaller than the second adjustment coefficient, and the second adjustment coefficient is smaller than the third adjustment coefficient.

9. The image processing method for CCD image positioning according to claim 8, characterized in that: When setting the deviation assessment final value level and the deviation assessment identification level, according to the deviation assessment final value level and the deviation assessment identification level, it includes: The final value levels of the deviation assessment are level one, level two and level three from high to low; A first final evaluation value is set, and if the final values ​​of the deviation evaluation of all the trays are greater than the first final evaluation value, the level of the final deviation evaluation value is determined to be level one; If there is a material tray whose final offset evaluation value is greater than the first final evaluation value, and at the same time there is a material tray whose final offset evaluation value is less than the first final evaluation value, it is determined that the final offset evaluation value level is level 2; If the final values ​​of the deviation evaluation of all the trays are less than the first final evaluation value, the final value of the deviation evaluation is determined to be level three; The offset assessment identification levels include standard, slight offset and heavy offset; If the final value level of the deviation assessment is level one, the deviation assessment identification level is determined to be standard; If the final value level of the deviation assessment is level 2, the deviation assessment identification level is determined to be a slight deviation; If the final value level of the deviation assessment is level three, the deviation assessment identification level is determined to be a heavy deviation.

10. An image processing system for CCD image positioning, used for applying the image processing method for CCD image positioning according to any one of claims 1 to 9, characterized in that: include: The image processing module is configured as a CCD camera to collect a plurality of tray images from a fixed angle, preprocess the plurality of tray images, obtain each image of the workpiece to be processed and the center of gravity of each image of the workpiece to be processed in each tray image based on the preprocessing result, and construct a center of gravity position sequence of the image of the workpiece to be processed of each tray according to the center of gravity position information of each image of the workpiece to be processed in each tray image; An offset calculation module is configured to compare the center of gravity position sequence on different trays with the standard center of gravity position sequence in turn, calculate the center of gravity position offset of the image to be processed in each tray image, and construct the center of gravity offset sequence of the image to be processed of each tray; An evaluation value calculation module is configured to determine whether the placement of the material tray is standard according to the center of gravity offset sequence, generate an initial offset evaluation value of each material tray according to the offset in the center of gravity offset sequence, calculate the average offset of the center of gravity position in each center of gravity offset sequence, determine whether to adjust the initial offset evaluation value, and if it is determined to be adjusted, adjust the initial offset evaluation value according to the average offset to obtain a final offset evaluation value; An identification level determination module is configured to set a deviation assessment final value level and a deviation assessment identification level, and determine the deviation assessment identification level according to the number of each level in the deviation assessment final value level; The storage and display module is configured to store and display the center of gravity position sequence, center of gravity offset sequence, offset evaluation final value and offset evaluation identification level on the CNC loading and unloading equipment.

Citation Information

Patent Citations

  • Adjustment control method for automatic centering width adjustment assembly line

    CN117148803A

  • High-speed article visual detection method based on artificial intelligence

    CN118134923A

  • Food placing position indication method and device, equipment and storage medium

    CN119399280A

  • Circuit board inspection equipment

    JP1993256620A