An image processing method and system for CCD image positioning

By constructing the center of gravity position sequence and offset sequence and setting the evaluation level, the problem of inaccurate placement of material trays in CCD image positioning is solved, and production efficiency and product quality are improved.

CN119625070BActive Publication Date: 2025-07-18SHENZHEN XIN MAO XIN IND CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, CCD image positioning methods lack accurate and efficient tray offset evaluation, resulting in inaccurate judgment on tray placement, affecting production efficiency and product quality.

Method used

The CCD camera collects the tray image, performs pre-processing, constructs the center of gravity position sequence, calculates the offset and generates the initial value of the offset evaluation, sets the final value level and identification level of the offset evaluation, and stores and displays it on the CNC loading and unloading equipment.

Benefits of technology

It improves the positioning accuracy of the material tray, simplifies the monitoring process, and realizes efficient and reliable automated production, ensuring the safety and operation efficiency of the production process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625070B_ABST
    Figure CN119625070B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and discloses an image processing method and system for CCD image positioning. The method includes: a CCD camera collects a plurality of tray images from a fixed angle, and constructs a sequence of the position of the center of gravity of the workpiece images of each tray; constructs a sequence of the offset of the center of gravity of the workpiece images of each tray; determines whether the placement of the tray is standard according to the sequence of the offset of the center of gravity, generates an initial offset evaluation value for each tray according to the offset in the sequence of the offset of the center of gravity, and adjusts the initial offset evaluation value according to the average value of the offset to obtain a final offset evaluation value; determines the offset evaluation identification level according to the final offset evaluation value level; stores and displays the sequence of the position of the center of gravity, the sequence of the offset of the center of gravity, the final offset evaluation value, and the offset evaluation identification level on the CNC loading and unloading equipment. The present invention improves the positioning accuracy while simplifying the monitoring process, and helps to achieve efficient and reliable automated production.
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] The CNC loading and unloading machine is an automated device used for the material loading and unloading operations during the processing of numerically controlled machine tools (CNC). It realizes the automatic picking and placing of workpieces through an automatic manipulator or a conveying device, thereby reducing manual intervention and improving production efficiency. The CNC loading and unloading machine is usually used in combination with equipment such as a numerical control machining center, a lathe, and a milling machine, and can automatically feed raw materials into the machine tool for processing, and take out the workpiece and place it at a specified position after processing. CCD image positioning is a technology that uses a CCD (Charge Coupled Device) camera to collect images and analyzes the image content through image processing technology to accurately locate the position of an object. This method is commonly used in industrial automation, machine vision, and precision manufacturing to help the equipment determine the position and posture of workpieces or components for precise operation.

[0003] In the prior art, the image processing method for CCD image positioning usually relies on manual operations or simple image processing algorithms, and it is difficult to accurately and real-time analyze and evaluate the tray image. Especially when dealing with the offset judgment of the tray, traditional methods often cannot provide accurate offset calculation and evaluation, and lack an effective automatic adjustment mechanism. In addition, the prior art lacks a unified standardized evaluation system, resulting in difficulty in efficiently judging 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 problems in the prior art that there is a lack of accurate and efficient CCD image positioning and offset evaluation methods, resulting in inaccurate judgment of tray placement, 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 problems in the prior art that there is a lack of 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 proposes an image processing method for CCD image positioning, including:

[0007] The CCD camera captures a number of images of the trays from a fixed angle, preprocesses the number of tray images, obtains the images of each workpiece to be processed and the center of gravity points of the images of each workpiece to be processed in each tray image based on the preprocessing results, and constructs a sequence of the center of gravity point positions of the images of the workpieces to be processed in each tray according to the position information of the center of gravity points of the images of each workpiece to be processed in each tray image;

[0008] Compare the sequences of the center of gravity point positions on a number of trays with the standard sequence of the center of gravity point positions in turn, calculate the offset of the center of gravity point position of the workpiece image to be processed in each tray image, and construct a sequence of the offset of the center of gravity point of the workpiece image to be processed in each tray;

[0009] Judge whether the placement of the tray is standard according to the sequence of the offset of the center of gravity point, generate an initial offset evaluation value for each tray according to the offset in the sequence of the offset of the center of gravity point, calculate the average value of the offset of the center of gravity point positions in each sequence of the offset of the center of gravity point, judge whether to adjust the initial offset evaluation value, and if the judgment is to adjust, adjust the initial offset evaluation value according to the average value of the offset to obtain a final offset evaluation value;

[0010] Set the final offset evaluation value level and the offset evaluation identification level, and determine the offset evaluation identification level according to the final offset evaluation value level;

[0011] Store and display the sequence of the center of gravity point positions, the sequence of the offset of the center of gravity point, the final offset evaluation value, and the offset evaluation identification level on the CNC loading and unloading equipment.

[0012] Further, when the CCD camera captures a number of images of the trays from a fixed angle, preprocesses the number of tray images, and obtains the images of each workpiece to be processed and the center of gravity points of the images of each workpiece to be processed in each tray image based on the preprocessing results, it includes:

[0013] Use the median filtering or Gaussian filtering algorithm to remove the noise in the image;

[0014] Convert the tray image into a grayscale image;

[0015] By the histogram equalization method, increase the contrast of the grayscale image according to the following formula:

[0016] In(x,y)=[Ig(x,y)−min(Ig)] / [max(Ig)−min(Ig)]×(L−1);

[0017] In the above formula, In(x,y) represents the grayscale value of the equalized image, 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, L represents the number of gray levels, and L = 256.

[0018] Further, when obtaining the images of each workpiece to be processed and the center-of-gravity points of the images of each workpiece to be processed in each tray image based on the preprocessing result, and constructing the sequence of the center-of-gravity point positions of the images of the workpieces to be processed in each tray according to the position information of the center-of-gravity points of the images of each workpiece to be processed in each tray image, it includes:

[0019] Extract the contour of each workpiece to be processed through an edge detection algorithm, and separate the area of the workpiece to be processed in the image from the background;

[0020] Calculate the coordinates (xci, yci) of the center of gravity of each workpiece to be processed through the following formula, where i = 1, 2, 3,..., n:

[0021] ;

[0022] ;

[0023] In the above formula, xci represents the x-axis coordinate of the center of gravity point, I(xi, yi) represents the gray value of the i-th pixel point, where i = 1, 2, 3,..., n, xi represents the x-axis coordinate of the i-th pixel point, yci represents the y-axis coordinate of the center of gravity point, and yi represents the y-axis coordinate of the i-th pixel point;

[0024] Calculate the coordinates of the center of gravity points of all workpieces to be processed on each tray respectively;

[0025] Construct the sequence of the center-of-gravity point positions of the images of the workpieces to be processed on each tray:

[0026] Sc = {(xc1, yc1), (xc2, yc2),..., (xcn, ycn)};

[0027] In the above formula, Sc represents the sequence of the center-of-gravity point positions, (xci, yci) represents the coordinates of the center of gravity point of the i-th workpiece to be processed, where i = 1, 2, 3,..., n.

[0028] Further, when comparing the sequences of the center-of-gravity point positions on several trays with the standard sequence of the center-of-gravity point positions in turn, calculating the offset of the center-of-gravity point positions of the images of the workpieces to be processed in each tray image, and constructing the sequence of the center-of-gravity point offsets of the images of the workpieces to be processed on each tray, it includes:

[0029] Set the standard sequence of the center-of-gravity point positions Ss = {(xs1, ys1), (xs2, ys2),..., (xsn, ysn)};

[0030] In the above formula, Ss represents the standard sequence of the center-of-gravity point positions, (xsi, ysi) represents the i-th standard center-of-gravity point coordinates, where i = 1, 2, 3,..., n;

[0031] According to the center of gravity point coordinates of each workpiece to be processed and the standard center of gravity point coordinates, calculate the offset pi of the center of gravity point position of each image to be processed through the following formula, where i = 1, 2, 3, …, n:

[0032] ;

[0033] The offset sequence is P = (p1, p2, p3, …, pn).

[0034] Further, when judging whether the placement of the tray is standard according to the center of gravity point offset sequence, it includes:

[0035] Set the maximum offset value, and compare the maximum value of the offset of the center of gravity point position of the image to be processed in the offset sequence with the maximum offset value;

[0036] If the maximum value of the offset of the center of gravity point position of the image to be processed is less than the maximum offset value, the placement of the tray is standard;

[0037] If the maximum value of the offset of the center of gravity point position of the image to be processed is greater than or equal to the maximum offset value, the placement of the tray is not standard.

[0038] Further, when generating the initial offset evaluation value of each tray according to the offset in the center of gravity point offset sequence, it includes:

[0039] Set the quantity threshold for the offset of the center of gravity point position of the image to be processed in the offset sequence that is greater than or equal to the maximum offset value;

[0040] If the quantity of the offset of the center of gravity point 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 quantity threshold, the initial offset evaluation value is the first evaluation value;

[0041] If the quantity of the offset of the center of gravity point position of the image to be processed in the offset sequence that is greater than or equal to the maximum offset value is less than the quantity threshold, the initial offset evaluation value is the second evaluation value;

[0042] Wherein, the first evaluation value is less than the second evaluation value.

[0043] Further, when calculating the mean value of the offset of the center of gravity point position in each center of gravity point offset sequence and judging whether to adjust the initial offset evaluation value, it includes:

[0044] Set the standard mean value of the offset. If the mean value of the offset is less than the standard mean value of the offset, it is judged that there is no need to adjust the initial offset evaluation value;

[0045] If the mean value of the offset is greater than or equal to the standard mean value of the offset, it is judged that the initial offset evaluation value needs to be adjusted.

[0046] Further, when it is determined to be adjusted and the initial offset evaluation value is adjusted according to the average offset to obtain the final offset evaluation value, it includes:

[0047] Set a first average value and a second average value, where the first average value is less than the second average value, and the first average value is greater than the standard average offset value;

[0048] If the average offset is less than or equal to the first average value, adjust the initial offset evaluation value through a first adjustment coefficient;

[0049] If the average offset is greater than the first average value and less than or equal to the second average value, adjust the initial offset evaluation value through a second adjustment coefficient;

[0050] If the average offset is greater than the second average value, adjust the initial offset evaluation value through a third adjustment coefficient;

[0051] Among them, the first adjustment coefficient is less than the second adjustment coefficient, and the second adjustment coefficient is less than the third adjustment coefficient.

[0052] Further, when setting the final offset evaluation level and the offset evaluation identification level, according to the final offset evaluation level and the offset evaluation identification level, it includes:

[0053] The final offset evaluation levels are, from high to low, level one, level two, and level three;

[0054] Set a first final evaluation value. If the final offset evaluation values of all trays are greater than the first final evaluation value, it is determined that the final offset evaluation level is level one;

[0055] If there are trays with final offset evaluation values greater than the first final evaluation value and at the same time there are trays with final offset evaluation values less than the first final evaluation value, it is determined that the final offset evaluation level is level two;

[0056] If the final offset evaluation values of all trays are less than the first final evaluation value, it is determined that the final offset evaluation level is level three;

[0057] The offset evaluation identification levels include standard, micro-offset, and heavy-offset;

[0058] If the final offset evaluation level is level one, it is determined that the offset evaluation identification level is standard;

[0059] If the final offset evaluation level is level two, it is determined that the offset evaluation identification level is micro-offset;

[0060] If the final offset evaluation level is level three, it is determined that the offset evaluation identification level is heavy offset.

[0061] Compared with the prior art, the beneficial effects of the present invention are as follows: By collecting multiple tray images at a fixed angle, the present invention ensures the standardization of data collection, and through image preprocessing to remove noise and enhance contrast, the accuracy of image analysis is improved. Secondly, the construction of the center of gravity point position sequence and the comparison with the standard center of gravity point position accurately identify the offset of the workpieces to be processed in each tray, can capture the subtle deviation of the tray position, and the established offset sequence and initial offset evaluation value are further adjusted to the final value through the offset mean value, which can adjust the offset evaluation standard in a timely manner according to the actual situation, increasing flexibility; The setting of the final offset evaluation value and the identification level facilitates automatic grading, thus intuitively showing whether the tray placement state meets the standard. In addition, storing and displaying all results realizes the traceability and visualization of data, facilitating the status monitoring and record management in the production process, improving the safety and operation efficiency of production, and meeting the high-precision requirements of the CNC loading and unloading equipment. Overall, this method simplifies the monitoring process while improving the positioning accuracy, contributing to the realization of efficient and reliable automated production.

[0062] On the other hand, the present application also provides an image processing system for CCD image positioning, including:

[0063] An image processing module, configured to collect a plurality of tray images from a fixed angle by a CCD camera, preprocess the plurality of tray images, obtain the images of the workpieces to be processed and the center of gravity points of the images of the workpieces to be processed in each tray image based on the preprocessing results, and construct a center of gravity point position sequence of the images of the workpieces to be processed in each tray according to the center of gravity point position information of the images of the workpieces to be processed in each tray image;

[0064] An offset calculation module, configured to compare the center of gravity point position sequences on different trays with the standard center of gravity point position sequence in turn, calculate the offset of the center of gravity point position of the workpiece image to be processed in each tray image, and construct a center of gravity point offset sequence of the images of the workpieces to be processed in each tray;

[0065] An evaluation value calculation module, configured to determine whether the placement of the tray is standard according to the center of gravity point offset sequence, generate an initial offset evaluation value for each tray according to the offset in the center of gravity point offset sequence, calculate the offset mean value of the center of gravity point positions in each center of gravity point offset sequence, determine whether to adjust the initial offset evaluation value, and if it is determined to adjust, adjust the initial offset evaluation value according to the offset mean value to obtain a final offset evaluation value;

[0066] An identification level determination module, configured to set an offset evaluation final value level and an offset evaluation identification level, and determine the offset evaluation identification level according to the number of each level in the offset evaluation final value level;

[0067] A storage and display module, configured to store and display the center of gravity point position sequence, the center of gravity point offset sequence, the offset evaluation final value, and the offset evaluation identification level on the CNC loading and unloading device.

[0068] It can be understood that the image processing method and system for CCD image positioning provided by this application have the same beneficial effects and will not be elaborated here. Description of the Drawings

[0069] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered as a limitation of the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0070] Figure 1 is a flowchart of an image processing method for CCD image positioning provided by an embodiment of the present invention;

[0071] Figure 2 is a functional block diagram of an image processing system for CCD image positioning provided by an embodiment of the present invention. Detailed Embodiments

[0072] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully communicated to those skilled in the art. It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0073] In some embodiments of the present application, referring to Figure 1 as shown, this embodiment provides an image processing method for CCD image positioning, including the following steps:

[0074] S100. The CCD camera collects a plurality of tray images from a fixed angle, preprocesses the plurality of tray images, obtains the center of gravity points of each workpiece image in each tray image based on the preprocessing result, and constructs a center of gravity point position sequence of the workpiece images in each tray according to the center of gravity point position information of each workpiece image in each tray image;

[0075] S200. Sequentially compare the center of gravity point position sequences on several trays with the standard center of gravity point position sequence, calculate the offset of the center of gravity point position of the image to be processed in each tray image, and construct a center of gravity point offset sequence for the image to be processed of each tray.

[0076] S300. Determine whether the placement of the tray is standard according to the center of gravity point offset sequence, generate an initial offset evaluation value for each tray according to the offset in the center of gravity point offset sequence, calculate the average offset of the center of gravity point positions in each center of gravity point offset sequence, and determine whether to adjust the initial offset evaluation value. 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.

[0077] S400. Set the final offset evaluation level and the offset evaluation identification level, and determine the offset evaluation identification level according to the final offset evaluation level.

[0078] S500. Store and display the center of gravity point position sequence, the center of gravity point offset sequence, the final offset evaluation value, and the offset evaluation identification level on the CNC loading and unloading equipment.

[0079] 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, improving the accuracy of image analysis. Secondly, the construction of the center of gravity point position sequence and the comparison with the standard center of gravity point position accurately identify the offset of the workpiece to be processed in each tray, can capture the subtle deviation of the tray position, and the established offset sequence and the initial offset evaluation value are further adjusted to the final value according to the average offset, which can adjust the standard of offset evaluation in a timely manner according to the actual situation, increasing flexibility; the setting of the final offset evaluation value and the identification level facilitates automatic grading, so as to intuitively display whether the tray placement state meets the standard. In addition, storing and displaying all results realizes the traceability and visualization of data, facilitates the status monitoring and record management in the production process, improves the safety and operation efficiency of production, and meets the high-precision requirements of the CNC loading and unloading equipment. Generally speaking, this method simplifies the monitoring process while improving the positioning accuracy, and helps to achieve efficient and reliable automated production.

[0080] In some embodiments of the present application, when the CCD camera collects several tray images from a fixed angle, preprocesses the several tray images, and obtains the center of gravity of each workpiece image and each workpiece image in each tray image based on the preprocessing result, it includes:

[0081] Use the median filtering or Gaussian filtering algorithm to remove the noise points in the image.

[0082] Convert the tray image into a grayscale image.

[0083] By using the histogram equalization method, the contrast of the grayscale image is increased according to the following formula:

[0084] In(x,y)=[Ig(x,y)−min(Ig)] / [max(Ig)−min(Ig)]×(L−1);

[0085] 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, L represents the number of grayscale levels, and L = 256.

[0086] It can be understood that by using the median filtering or Gaussian filtering algorithm to remove the noise in the image, the quality of the image is effectively improved, so that the subsequent image processing process is not interfered by noise, ensuring the accurate recognition of the workpiece to be processed; after being converted into a grayscale image, the complexity of the image information is reduced, facilitating subsequent processing and analysis; and by using the histogram equalization method to increase the contrast of the image, the visual effect of the image can be significantly improved, making the details in the image more prominent, especially in the 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 terms of detail capture, especially for images with low contrast or complex backgrounds, which can improve the accuracy of the center of gravity point extraction and ensure that the subsequent processing (such as the center of gravity point positioning and offset calculation) is more accurate, further improving the reliability and accuracy of the CCD image positioning system.

[0087] In some embodiments of the present application, when obtaining the images of each workpiece to be processed and the center of gravity points of the images of each workpiece to be processed in each tray image based on the preprocessing result, and constructing the sequence of the center of gravity point positions of the images of the workpieces to be processed in each tray according to the position information of the center of gravity points of the images of each workpiece to be processed in each tray image, it includes:

[0088] Extract the contour of each workpiece to be processed through the edge detection algorithm, and separate the area of the workpiece to be processed in the image from the background;

[0089] Calculate the coordinates of the center of gravity point (xci, yci) of each workpiece to be processed through the following formula, where i = 1, 2, 3,..., n:

[0090] ;

[0091] ;

[0092] In the above formula, xci represents the x-axis coordinate of the center of gravity point, I(xi, yi) represents the gray value of the i-th pixel point, where i = 1, 2, 3, …, n, xi represents the x-axis coordinate of the i-th pixel point, yci represents the y-axis coordinate of the center of gravity point, and yi represents the y-axis coordinate of the i-th pixel point;

[0093] Calculate the coordinates of the center of gravity points of all workpieces to be processed on each tray respectively;

[0094] Construct the sequence of the positions of the center of gravity points of the images of the workpieces to be processed on each tray:

[0095] Sc = {(xc1, yc1), (xc2, yc2), …, (xcn, ycn)};

[0096] In the above formula, Sc represents the sequence of the positions of the center of gravity points, (xci, yci) represents the coordinates of the center of gravity point of the i-th workpiece to be processed, where i = 1, 2, 3, …, n.

[0097] It can be understood that the present invention uses an edge detection algorithm to extract the contour 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 object boundary, thereby reducing the interference of background noise on the extraction of the center of gravity point. This processing method is particularly effective for images with complex backgrounds or overlapping objects. By calculating the coordinates of the center of gravity points of each workpiece to be processed and constructing the sequence of the positions of the center of gravity points, the position of each workpiece to be processed can be accurately reflected, further improving the accuracy and stability of positioning. The constructed sequence of the positions of the center of gravity points provides a reliable basis for the subsequent calculation of the offset amount, and can efficiently perform the positioning and comparison of multiple workpieces to be processed in a multi-tray environment, laying a foundation for realizing an automated and precise production process. The implementation of this method greatly improves the accuracy and efficiency of CCD image positioning.

[0098] In some embodiments of the present application, when comparing the sequences of the positions of the center of gravity points on several trays with the standard sequence of the positions of the center of gravity points in turn, calculating the offset amount of the position of the center of gravity point of the image to be processed in each tray image, and constructing the sequence of the offset amounts of the center of gravity points of the images of the workpieces to be processed on each tray, it includes:

[0099] Set the standard sequence of the positions of the center of gravity points Ss = {(xs1, ys1), (xs2, ys2), …, (xsn, ysn)};

[0100] In the above formula, Ss represents the standard sequence of the positions of the center of gravity points, (xsi, ysi) represents the i-th standard center of gravity point coordinates, where i = 1, 2, 3, …, n;

[0101] According to the center of gravity point coordinates of each workpiece to be processed and the standard center of gravity point coordinates, calculate the position offset pi of the center of gravity point of each image to be processed through the following formula, where i = 1, 2, 3, …, n:

[0102] ;

[0103] The offset sequence is P = (p1, p2, p3, …, pn).

[0104] It can be understood that by comparing the center of gravity point position sequence on the tray with the standard center of gravity point position sequence, the present invention can accurately calculate the position offset of the center of gravity point of each workpiece to be processed, which helps to determine whether the placement of the tray meets the standard, thereby providing a key basis for subsequent automated operations. Setting the standard center of gravity point position sequence clearly defines the standard position of each workpiece to be processed, 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, facilitating timely adjustment of the placement problem in the production process. In addition, the offset sequence can provide data support for further process optimization, helping to discover potential production problems or deviations. Overall, the present invention ensures the precise positioning of each workpiece to be processed in the tray, enabling the automated system to effectively identify and correct position deviations, greatly improving the accuracy and consistency in the production process, reducing the need for manual intervention, and improving production efficiency.

[0105] In some embodiments of the present application, when determining whether the placement of the tray is standard according to the center of gravity point offset sequence, it includes:

[0106] Set the maximum offset value, and compare the maximum value of the position offset of the center of gravity point of the image to be processed in the offset sequence with the maximum offset value;

[0107] If the maximum value of the position offset of the center of gravity point of the image to be processed is less than the maximum offset value, the placement of the tray is standard;

[0108] If the maximum value of the position offset of the center of gravity point of the image to be processed is greater than or equal to the maximum offset value, the placement of the tray is not standard.

[0109] It can be understood that by setting the maximum offset value and comparing it with the maximum offset value of the centroid position of the image to be processed, the present invention can efficiently determine whether the placement of the tray is standard. By setting a tolerance range (maximum offset value), trays with excessive offsets can be quickly screened out, and situations where the placement is not standard can be promptly identified. This not only avoids complex calculation processes but also enables the rapid discovery of potential problems during the production process, preventing subsequent processing deviations or quality issues caused by improper tray placement. In addition, through this judgment criterion, position checks can be automatically performed, reducing manual intervention, improving production efficiency and product consistency, enhancing the system's response speed and accuracy, thus contributing to more precise quality control and ensuring the smooth progress of the entire production process, especially suitable for high-precision manufacturing environments.

[0110] In some embodiments of the present application, when generating the initial offset evaluation value for each tray based on the offsets in the centroid offset sequence, it includes:

[0111] Setting a quantity threshold for the offsets of the centroid positions of the images to be processed in the offset sequence that are greater than or equal to the maximum offset value;

[0112] If the quantity of the offsets of the centroid positions of the images to be processed in the offset sequence that are greater than or equal to the maximum offset value is greater than or equal to the quantity threshold, the initial offset evaluation value is the first evaluation value;

[0113] If the quantity of the offsets of the centroid positions of the images to be processed in the offset sequence that are greater than or equal to the maximum offset value is less than the quantity threshold, the initial offset evaluation value is the second evaluation value;

[0114] Wherein, the first evaluation value is less than the second evaluation value.

[0115] It can be understood that by setting a quantity threshold for the offsets of the centroid positions of the images to be processed in the offset sequence, the initial offset evaluation value of the tray can be flexibly generated according to the distribution of the offsets. This method can more accurately evaluate the standardness of the tray placement by introducing the setting of the quantity threshold. If the quantity of larger offsets is relatively large, a lower evaluation value is generated, indicating a more serious offset; on the contrary, if the quantity of larger offsets is relatively small, a higher evaluation value is generated, indicating a lighter placement offset. The evaluation process is more adaptable and can adjust the evaluation value according to the actual situation, avoiding over-evaluation due to a small amount of offset. This can not only improve robustness and precision but also provide a more flexible basis for subsequent adjustments and optimizations, thereby achieving precise monitoring of the tray placement state and effectively improving production efficiency and product quality consistency.

[0116] In some embodiments of the present application, when calculating the offset mean value of the center of gravity position in each center of gravity point offset sequence and determining whether to adjust the initial offset evaluation value, it includes:

[0117] Set the standard offset mean value. If the offset mean value is less than the standard offset mean value, it is determined that there is no need to adjust the initial offset evaluation value;

[0118] If the offset mean value is greater than or equal to the standard offset mean value, it is determined that the initial offset evaluation value needs to be adjusted.

[0119] In some embodiments of the present application, when, if it is determined to be an adjustment, adjusting the initial offset evaluation value according to the offset mean value to obtain the final offset evaluation value, it includes:

[0120] Set the first mean value and the second mean value, and the first mean value is less than the second mean value, and the first mean value is greater than the standard offset mean value;

[0121] If the offset mean value is less than or equal to the first mean value, adjust the initial offset evaluation value through the first adjustment coefficient;

[0122] If the offset mean value is greater than the first mean value and less than or equal to the second mean value, adjust the initial offset evaluation value through the second adjustment coefficient;

[0123] If the offset mean value is greater than the second mean value, adjust the initial offset evaluation value through the third adjustment coefficient;

[0124] Wherein, the first adjustment coefficient is less than the second adjustment coefficient, and the second adjustment coefficient is less than the third adjustment coefficient.

[0125] It can be understood that by setting the standard offset mean value, the overall level of the tray placement offset can be effectively judged. If the offset mean value is small, it means that the offset is relatively slight, and it can be chosen not to adjust the initial evaluation value, thus avoiding unnecessary adjustments and saving computing resources and time; while when the offset mean value is large, it indicates that the offset is relatively serious and the initial evaluation value needs to be adjusted. At this time, by setting different mean value intervals and adjustment coefficients, different degrees of adjustment can be made according to the specific offset mean value. Using multiple adjustment coefficients can refine the adjustment process, ensure the accuracy of the final offset evaluation value, and avoid inaccurate evaluation results caused by 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 enhancing the stability and reliability of the production process.

[0126] In some embodiments of the present application, when setting the final offset evaluation level and the offset evaluation identification level and offset evaluation identification level according to the final offset evaluation level, it includes:

[0127] The final offset evaluation levels, from high to low, are level one, level two, and level three in sequence;

[0128] Set a first final evaluation value. If the final offset evaluation values of all trays are greater than the first final evaluation value, then determine that the final offset evaluation level is level one;

[0129] If there are trays with final offset evaluation values greater than the first final evaluation value and at the same time there are trays with final offset evaluation values less than the first final evaluation value, then determine that the final offset evaluation level is level two;

[0130] If the final offset evaluation values of all trays are less than the first final evaluation value, then determine that the final offset evaluation level is level three;

[0131] The offset evaluation identification levels include standard, micro-offset, and heavy-offset;

[0132] If the final offset evaluation level is level one, then determine that the offset evaluation identification level is standard;

[0133] If the final offset evaluation level is level two, then determine that the offset evaluation identification level is micro-offset;

[0134] If the final offset evaluation level is level three, then determine that the offset evaluation identification level is heavy-offset.

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

[0136] On the other hand, as shown in Figure 2 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, and includes:

[0137] The image processing module is configured to collect a plurality of tray images from a fixed angle by a CCD camera, preprocess the plurality of tray images, obtain the images of each workpiece to be processed and the center of gravity points of the images of each workpiece to be processed based on the preprocessing results, and construct a sequence of the center of gravity point positions of the images of the workpieces to be processed for each tray according to the position information of the center of gravity points of the images of each workpiece to be processed in each tray image;

[0138] The offset calculation module is configured to compare the sequence of the center of gravity point positions on different trays with the standard sequence of the center of gravity point positions in turn, calculate the offset of the center of gravity point positions of the images of the workpieces to be processed in each tray image, and construct a sequence of the center of gravity point offsets of the images of the workpieces to be processed for each tray;

[0139] The evaluation value calculation module is configured to judge whether the placement of the tray is standard according to the sequence of the center of gravity point offsets, generate an initial offset evaluation value for each tray according to the offsets in the sequence of the center of gravity point offsets, calculate the average value of the offsets of the center of gravity point positions in each sequence of the center of gravity point offsets, judge whether to adjust the initial offset evaluation value, and if it is judged to be adjusted, adjust the initial offset evaluation value according to the average value of the offsets to obtain a final offset evaluation value;

[0140] The identification level determination module is configured to set the final offset evaluation level and the offset evaluation identification level, and determine the offset evaluation identification level according to the number of each level in the final offset evaluation level;

[0141] The storage and display module is configured to store and display the sequence of the center of gravity point positions, the sequence of the center of gravity point offsets, the final offset evaluation value, and the offset evaluation identification level on the CNC loading and unloading equipment.

[0142] It can be understood that the image processing system for CCD image positioning provided by this application can efficiently and accurately process the tray images, judge the standardness of the placement, and evaluate its offset in real time by integrating multiple modules to work together. The role of the image processing module is to obtain the tray image from the CCD camera and perform preprocessing, and 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 calculates the offset by comparing the position of the center of gravity of each tray with the standard center of gravity sequence, so as to obtain the center of gravity offset sequence of each tray. The evaluation value calculation module further analyzes the offset sequence, judges whether the tray placement meets the standard, and adjusts the initial offset evaluation value as needed to obtain the final offset evaluation value to ensure the accuracy of the evaluation result. The identification level determination module then classifies the evaluation result, marks the trays as different levels according to different offset situations, and provides a more intuitive offset evaluation. Finally, the storage and display module stores and displays all data results in real time on the CNC loading and unloading equipment, facilitating the operator to monitor and adjust. Through this systematic image processing and evaluation mechanism, the automation level in the production process can be effectively improved, manual intervention can be reduced, and production efficiency and product quality can be enhanced.

[0143] Those skilled in the art should understand that the embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can 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 code.

[0144] This application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0145] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions specified in one or more of the procedures Figure 1 one or more procedures and / or blocks Figure 1 specified in a block or blocks.

[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one or more of the procedures Figure 1 one or more procedures and / or blocks Figure 1 specified in a block or blocks.

[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: the specific implementation manners of the present invention can still be modified or equivalently replaced, and any modification or equivalent replacement that does not depart from the spirit and scope of the present invention shall be covered by the protection scope of the claims of the present invention.

Claims

1. An image processing method for CCD image positioning, characterized in that Including: The CCD camera acquires a plurality of tray images from a fixed angle, preprocesses the plurality of tray images, obtains the images of each workpiece to be processed and the center of gravity points of the images of each workpiece to be processed based on the preprocessing results, and constructs a sequence of the center of gravity point positions of the images of the workpieces to be processed for each tray according to the position information of the center of gravity points of the images of each workpiece to be processed in each tray image; Compare the sequences of the center of gravity point positions on a plurality of trays with the standard sequence of the center of gravity point positions in turn, calculate the offset of the center of gravity point positions of the images of the workpieces to be processed in each tray image, and construct a sequence of the offset of the center of gravity point positions of the images of the workpieces to be processed for each tray; Judge whether the placement of the tray is standard according to the sequence of the offset of the center of gravity point, generate an initial offset evaluation value for each tray according to the offset in the sequence of the offset of the center of gravity point, calculate the average value of the offset of the center of gravity point positions in each sequence of the offset of the center of gravity point, set the standard average value of the offset, if the average value of the offset is less than the standard average value of the offset, it is judged that there is no need to adjust the initial offset evaluation value; if the average value of the offset is greater than or equal to the standard average value of the offset, it is judged that the initial offset evaluation value needs to be adjusted; If it is judged to be adjusted, adjust the initial offset evaluation value according to the average value of the offset to obtain a final offset evaluation value: set a first average value and a second average value, and the first average value is less than the second average value, and the first average value is greater than the standard average value of the offset; if the average value of the offset is less than or equal to the first average value, adjust the initial offset evaluation value through a first adjustment coefficient; if the average value of the offset is greater than the first average value and less than or equal to the second average value, adjust the initial offset evaluation value through a second adjustment coefficient; if the average value of the offset is greater than the second average value, adjust the initial offset evaluation value through a third adjustment coefficient; The first adjustment coefficient is less than the second adjustment coefficient, and the second adjustment coefficient is less than the third adjustment coefficient; Set the final offset evaluation level and the offset evaluation identification level, and the final offset evaluation level is, from high to low, level one, level two, and level three in turn; Set a first final evaluation value, if the final offset evaluation values of all trays are greater than the first final evaluation value, it is determined that the final offset evaluation level is level one; if there are trays with final offset evaluation values greater than the first final evaluation value and at the same time there are trays with final offset evaluation values less than the first final evaluation value, it is determined that the final offset evaluation level is level two; If the final offset evaluation values of all trays are less than the first final evaluation value, it is determined that the final offset evaluation level is level three; Determine the offset evaluation identification level according to the final offset evaluation level.

2. The image processing method for CCD image positioning according to claim 1, characterized in that, Store and display the sequence of the center of gravity point positions, the sequence of the offset of the center of gravity point, the final offset evaluation value, and the offset evaluation identification level on the CNC loading and unloading equipment.

3. The image processing method for CCD image positioning according to claim 1, wherein When the CCD camera acquires a plurality of tray images from a fixed angle and preprocesses the plurality of tray images, and obtains the images of each workpiece to be processed and the center of gravity points of the images of each workpiece to be processed based on the preprocessing results, it includes: Use median filtering or Gaussian filtering algorithm to remove noise in the image; Convert the tray image into a grayscale image; By the histogram equalization method, increase the contrast of the grayscale image 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 equalized image, 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 number of gray levels, L = 256.

4. The image processing method for CCD image positioning according to claim 3, characterized in that When obtaining the images of each workpiece to be processed and the centroid points of the images of each workpiece to be processed in each tray image based on the preprocessing results, and constructing the centroid point position sequence of the images of the workpieces to be processed of each tray according to the position information of the centroid points of the images of each workpiece to be processed in each tray image, it includes: Extract the contour of each workpiece to be processed through the edge detection algorithm, and separate the area of the workpiece to be processed in the image from the background; Calculate the centroid point coordinates (xci, yci) of each workpiece to be processed, where i = 1, 2, 3,..., n; Calculate the centroid point coordinates of all workpieces to be processed on each tray respectively; Construct the centroid point position sequence of the images of the workpieces to be processed of each tray: Sc={(xc1,yc1),(xc2,yc2),…,(xcn,ycn)}; In the above formula, Sc represents the centroid point position sequence, (xci,yci) represents the centroid point coordinates of the i-th workpiece to be processed, where i = 1, 2, 3,..., n.

5. The image processing method for CCD image positioning according to claim 4, wherein, When judging whether the placement of the tray is standard according to the centroid point offset sequence, it includes: Set the standard centroid point position sequence Ss={(xs1,ys1),(xs2,ys2),…,(xsn,ysn)}; In the above formula, Ss represents the standard centroid point position sequence, (xsi,ysi) represents the i-th standard centroid point coordinates; Calculate the centroid point position offset pi of each workpiece to be processed according to the centroid point coordinates of each workpiece to be processed and the standard centroid point coordinates; Calculate the centroid point position offset pi of each workpiece to be processed through the following formula, i = 1, 2, 3,..., n: pi= ; The offset sequence is P=(p1,p2,p3,…,pn); Set the maximum offset value, and compare the maximum value of the centroid point position offset of the workpiece to be processed image in the offset sequence with the maximum offset value; If the maximum value of the centroid point position offset of the workpiece to be processed image is less than the maximum offset value, the placement of the tray is standard; If the maximum value of the centroid point position offset of the workpiece to be processed image is greater than or equal to the maximum offset value, the placement of the 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 centroid point offset sequence, it includes: Set the quantity threshold of the centroid point position offset of the workpiece to be processed image in the offset sequence that is greater than or equal to the maximum offset value; If the number of the offset amounts of the center-of-gravity points of the workpiece images to be processed in the offset amount sequence that are greater than or equal to the maximum offset amount is greater than or equal to the quantity threshold, the initial offset evaluation value is the first evaluation value; If the number of the offset amounts of the center-of-gravity points of the workpiece images to be processed in the offset amount sequence that are greater than or equal to the maximum offset amount is less than the quantity threshold, the initial offset evaluation value is the second evaluation value; Wherein, the first evaluation value is less than the second evaluation value.

7. The image processing method for CCD image positioning according to claim 6, wherein, When setting the final offset evaluation level and the offset evaluation identification level, according to the final offset evaluation level and the offset evaluation identification level, it includes: The offset evaluation identification level includes standard, micro-offset and heavy-offset; If the final offset evaluation level is level one, it is determined that the offset evaluation identification level is standard; If the final offset evaluation level is level two, it is determined that the offset evaluation identification level is micro-offset; If the final offset evaluation level is level three, it is determined that the offset evaluation identification level is heavy-offset.

8. An image processing system for CCD image positioning, which is used to apply the image processing method for CCD image positioning according to any one of claims 1-7, characterized in that, It includes: An image processing module, configured to collect a plurality of tray images by a CCD camera from a fixed angle, preprocess the plurality of tray images, obtain the center-of-gravity points of each workpiece image and each workpiece image in each tray image based on the preprocessing result, and construct a sequence of the center-of-gravity point positions of the workpiece images to be processed in each tray according to the center-of-gravity point position information of each workpiece image in each tray image; An offset amount calculation module, configured to compare the sequence of the center-of-gravity point positions on different trays with the standard sequence of the center-of-gravity point positions in turn, calculate the offset amounts of the center-of-gravity points of the workpiece images in each tray image, and construct a sequence of the offset amounts of the center-of-gravity points of the workpiece images to be processed in each tray; An evaluation value calculation module, configured to judge whether the placement of the tray is standard according to the sequence of the center-of-gravity point offset amounts, generate an initial offset evaluation value for each tray according to the offset amounts in the sequence of the center-of-gravity point offset amounts, calculate the average value of the offset amounts of the center-of-gravity point positions in each sequence of the center-of-gravity point offset amounts, judge whether to adjust the initial offset evaluation value, and if it is judged to be adjusted, adjust the initial offset evaluation value according to the average value of the offset amounts to obtain a final offset evaluation value; An identification level determination module, configured to set the final offset evaluation level and the offset evaluation identification level, and determine the offset evaluation identification level according to the quantity of each level in the final offset evaluation level; A storage and display module, configured to store and display the sequence of the center-of-gravity point positions, the sequence of the center-of-gravity point offset amounts, the final offset evaluation value and the 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