Method and apparatus for optimizing product inspection trajectories
Patent Information
- Application Number
- CN202211696181.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2042-12-28
AI Technical Summary
相关技术中,主要通过在现场对产品拍照后进行2D建模来确定检测轨迹,但所确定的结果的精度误差较大
[0038] Based on the displacement deviation, the first correction point is translated to obtain the final correction point;
Smart Images

Figure CN116051600B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology, and in particular relates to a method and apparatus for optimizing product detection trajectories. Background Technology
[0002] Industrial vision is widely used in the appearance inspection of electronic devices. For the inspection of the mid-frame of electronic devices, machine vision inspection processes are gradually emerging in manufacturing to detect surface information of the product. This step requires a higher degree of precision in machine movement. Related technologies primarily determine the inspection trajectory by taking photos of the product on-site and then creating a 2D model, but the accuracy of the determined results has a relatively large margin of error. Summary of the Invention
[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method and apparatus for optimizing product detection trajectory, which can acquire detection trajectory data with relatively high precision and accuracy, high compensation efficiency, and wide applicability.
[0004] Firstly, this application provides a method for optimizing product detection trajectories, the method comprising:
[0005] Based on multiple first pixels extracted from the original contour image, the original trajectory data of the product under test is determined.
[0006] Collect multiple first contour images corresponding to the curve segments of the product under test under the original trajectory data;
[0007] Based on the plurality of first contour images, the original trajectory data is corrected.
[0008] According to the product detection trajectory optimization method of this application, the first contour image of the product under test is acquired by using the original trajectory data determined by the original contour image of the product under test, and the original trajectory data is corrected point by point based on the first contour image. The method of combining virtual and real products is realized to complete the trajectory data compensation. It can obtain high-precision and high-accuracy detection trajectory data without obtaining the real contour data of the product under test or the user's manual calibration. The compensation efficiency is high and the applicability is wide.
[0009] According to one embodiment of this application, correcting the original trajectory number based on the plurality of first contour images includes:
[0010] Image processing is performed on the plurality of first contour images to obtain the coordinate values of the target points in the first contour images and the angle deviation of the target points, wherein the angle deviation is the angle between the tangent of the target point and the horizontal direction.
[0011] Based on the aforementioned angle deviation, the original trajectory data is corrected.
[0012] According to one embodiment of this application, correcting the original trajectory data based on the angle deviation includes:
[0013] Based on the angular deviation, rotate the target point around the rotation center to obtain the first correction point and the coordinate value of the first correction point;
[0014] Based on the coordinate values of the first correction point, determine the displacement deviation between the first correction point and the theoretical point;
[0015] Based on the displacement deviation, the first correction point is translated to obtain the final correction point;
[0016] Based on the final correction point, the original trajectory data is corrected.
[0017] According to one embodiment of this application, the step of rotating the target point around the rotation center based on the angular deviation to obtain a first correction point and the coordinate values of the first correction point includes:
[0018] Based on the coordinates of the target point and the coordinates of the rotation center, determine the first distance and the first radian between the target point and the rotation center;
[0019] Based on the aforementioned angular deviation, the second radian is determined;
[0020] Based on the first radian and the second radian, determine the target radian between the first correction point and the rotation center;
[0021] The coordinates of the first correction point are determined based on the target radian, the first distance, and the coordinates of the rotation center.
[0022] According to one embodiment of this application, after correcting the original trajectory data based on the plurality of first contour images, the method further includes:
[0023] Obtain the deviation between the corrected trajectory data and the product under test;
[0024] If the deviation is greater than the target threshold, the corrected trajectory data is determined as the original trajectory data.
[0025] According to one embodiment of this application, determining the original trajectory data of the product under test based on a plurality of first pixels extracted from the original contour image includes:
[0026] Based on the target eccentricity data, trigonometric functions are used to convert the pixel coordinates of the plurality of first pixels into the original trajectory data; wherein, the target eccentricity data is the eccentricity data between the product under test and the platform.
[0027] Secondly, this application provides a device for optimizing product detection trajectories, the device comprising:
[0028] The first processing module is used to determine the original trajectory data of the product under test based on multiple first pixels extracted from the original contour image.
[0029] The second processing module is used to collect multiple first contour images corresponding to the curve segments of the product under test under the original trajectory data;
[0030] The third processing module is used to correct the original trajectory data based on the plurality of first contour images.
[0031] According to the product detection trajectory optimization device of this application, the first contour image of the product under test is acquired by the original trajectory data determined by the original contour image of the product under test, and the original trajectory data is corrected point by point based on the first contour image. The method of combining virtual and real products is realized to complete the trajectory data compensation. It can obtain high-precision and high-accuracy detection trajectory data without obtaining the real contour data of the product under test or the user's manual calibration. The compensation efficiency is high and the applicability is wide.
[0032] According to one embodiment of this application, the third processing module is used for:
[0033] Image processing is performed on the plurality of first contour images to obtain the coordinate values of the target points in the first contour images and the angle deviation of the target points, wherein the angle deviation is the angle between the tangent of the target point and the horizontal direction.
[0034] Based on the aforementioned angle deviation, the original trajectory data is corrected.
[0035] According to one embodiment of this application, the third processing module is used for:
[0036] Based on the angular deviation, rotate the target point around the rotation center to obtain the first correction point and the coordinate value of the first correction point;
[0037] Based on the coordinate values of the first correction point, determine the displacement deviation between the first correction point and the theoretical point;
[0038] Based on the displacement deviation, the first correction point is translated to obtain the final correction point;
[0039] Based on the final correction point, the original trajectory data is corrected.
[0040] According to the product detection trajectory optimization device of this application, an image sensor is installed above the product to be tested to take area array photos of each trajectory point of the arc segment. The Y pixel corresponding to the same X pixel coordinate in the photo and the angle deviation of the target point are analyzed. Then, the angle compensation and Y pixel direction compensation are performed in a targeted manner, so as to make the Y pixel corresponding to the same X pixel consistent and the angle of the point consistent, thereby improving the matching degree between the trajectory data and the real product, and having high detection accuracy and precision.
[0041] According to one embodiment of this application, the third processing module is used for:
[0042] Based on the coordinates of the target point and the coordinates of the rotation center, determine the first distance and the first radian between the target point and the rotation center;
[0043] Based on the aforementioned angular deviation, the second radian is determined;
[0044] Based on the first radian and the second radian, determine the target radian between the first correction point and the rotation center;
[0045] The coordinates of the first correction point are determined based on the target radian, the first distance, and the coordinates of the rotation center.
[0046] According to one embodiment of this application, the apparatus further includes:
[0047] The fourth processing module is used to obtain the deviation between the corrected trajectory data and the product under test after correcting the original trajectory data based on the plurality of first contour images;
[0048] The fifth processing module is used to determine the corrected trajectory data as the original trajectory data when the deviation is greater than the target threshold.
[0049] The product detection trajectory optimization device according to this application uses the corrected contour data as the original contour data for the next correction, and repeats contour compensation multiple times until the error is less than the target threshold. This can effectively reduce measurement error and thus significantly improve detection accuracy and detection effect.
[0050] According to an embodiment of this application, the first processing module is configured to:
[0051] Based on the target eccentricity data, trigonometric functions are used to convert the pixel coordinates of the plurality of first pixels into the original trajectory data; wherein, the target eccentricity data is the eccentricity data between the product under test and the platform.
[0052] Thirdly, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the product detection trajectory optimization method as described in the first aspect above.
[0053] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the product detection trajectory optimization method as described in the first aspect above.
[0054] Fifthly, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the product detection trajectory optimization method as described in the first aspect.
[0055] In a sixth aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the product detection trajectory optimization method as described in the first aspect above.
[0056] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects:
[0057] The original trajectory data is obtained by acquiring the first contour image of the product under test based on the original contour image of the product under test, and the original trajectory data is corrected point by point based on the first contour image. The method of combining virtual and real products is realized to complete the trajectory data compensation. It can obtain high-precision and high-accuracy detection trajectory data without obtaining the real contour data of the product under test or the user's manual calibration. The compensation efficiency is high and the applicability is wide.
[0058] Furthermore, by setting up an image sensor above the product under test to take area-array photos of each trajectory point of the arc segment, the Y pixel corresponding to the same X pixel coordinate in the photo and the angle deviation of the target point are analyzed. Then, targeted angle compensation and Y pixel direction compensation are performed to achieve the goal of making the Y pixel corresponding to the same X pixel consistent and the angle of the point consistent, thereby improving the matching degree between the trajectory data and the real product, and having high detection accuracy and precision.
[0059] Furthermore, by using the corrected contour data as the original contour data for the next correction, and repeating contour compensation multiple times until the error is less than the target threshold, measurement errors can be effectively reduced, thereby significantly improving detection accuracy and detection results.
[0060] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0061] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0062] Figure 1 This is a flowchart illustrating the product detection trajectory optimization method provided in the embodiments of this application;
[0063] Figure 2 This is one of the schematic diagrams illustrating the principle of the product detection trajectory optimization method provided in the embodiments of this application;
[0064] Figure 3 This is a second schematic diagram illustrating the principle of the product detection trajectory optimization method provided in the embodiments of this application;
[0065] Figure 4 This is the third schematic diagram illustrating the principle of the product detection trajectory optimization method provided in the embodiments of this application;
[0066] Figure 5 This is the fourth schematic diagram illustrating the principle of the product detection trajectory optimization method provided in the embodiments of this application;
[0067] Figure 6 This is the fifth schematic diagram illustrating the principle of the product detection trajectory optimization method provided in the embodiments of this application;
[0068] Figure 7 This is the sixth schematic diagram illustrating the principle of the product detection trajectory optimization method provided in the embodiments of this application;
[0069] Figure 8 This is the seventh schematic diagram illustrating the principle of the product detection trajectory optimization method provided in the embodiments of this application;
[0070] Figure 9 This is the eighth schematic diagram illustrating the principle of the product detection trajectory optimization method provided in the embodiments of this application;
[0071] Figure 10 This is the ninth schematic diagram illustrating the principle of the product detection trajectory optimization method provided in the embodiments of this application;
[0072] Figure 11 This is a schematic diagram of the structure of the product detection trajectory optimization device provided in the embodiments of this application;
[0073] Figure 12 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0074] Figure 13 This is a hardware schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0075] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0076] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0077] In related technologies, there are three ways to determine the detection trajectory:
[0078] Firstly, the mechanical design involves 3D modeling, exporting the product outline points, and then converting them into motion trajectory points. However, the product drawings are confidential information for the client, making it impossible to obtain the actual data.
[0079] Secondly, 2D modeling was performed after taking photos of the product on-site, but the accuracy error was relatively large, with the arc angle deviation being ±5 degrees and the distance between the arc point and the actual contour point deviation being 0.2 mm.
[0080] Thirdly, manually tracing the product trajectory points on-site using images is a labor-intensive process, and the accuracy cannot be guaranteed.
[0081] All three methods have the problem of poor precision and accuracy.
[0082] The following description, in conjunction with the accompanying drawings, details the product detection trajectory optimization method, product detection trajectory optimization device, electronic device, and readable storage medium provided in this application embodiment through specific embodiments and application scenarios.
[0083] Among them, the optimization method for product detection trajectory can be applied to the terminal, and can be executed by the hardware or software in the terminal.
[0084] The terminal includes, but is not limited to, portable communication devices such as mobile phones or tablets with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).
[0085] The following embodiments describe a terminal including a display and a touch-sensitive surface. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
[0086] The product detection trajectory optimization method provided in this application embodiment can be executed by an electronic device or a functional module or functional entity in an electronic device that can implement the product detection trajectory optimization method. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras and wearable devices. The following uses an electronic device as the execution subject to illustrate the product detection trajectory optimization method provided in this application embodiment.
[0087] like Figure 1 As shown, the optimization method for the product detection trajectory includes steps 110, 120, and 130.
[0088] Step 110: Determine the original trajectory data of the product under test based on multiple first pixels extracted from the original contour image;
[0089] In this step, the original contour image is an overall image of the product under test acquired by an image sensor, such as... Figure 2 As shown.
[0090] The original contour image includes the straight line segment contour and the curved line segment contour of the product under test.
[0091] Among them, the curved segment contour is a contour with changes in curvature, such as the rounded corners of a mobile phone.
[0092] The first pixel is the pixel on the outline of the product under test in the original outline image. Each first pixel corresponds to pixel coordinates.
[0093] Multiple first pixels can be all pixels in the contour region, or they can be some pixels in the contour region. They can be obtained through dense sampling, random sampling or other sampling methods. This application does not limit them.
[0094] In actual execution, after acquiring the original contour image, the original contour coordinate data (i.e., the pixel coordinates of the first pixel) of the product under test can be roughly extracted from the original contour image. The original contour data coordinates are as follows: Figure 2 As shown.
[0095] After obtaining the original contour coordinate data, the original contour coordinate data can be converted into original trajectory data that matches the platform.
[0096] In some embodiments, step 110 may include: converting the pixel coordinates of multiple first pixels into raw trajectory data using trigonometric functions based on the target eccentricity data; wherein the target eccentricity data is the eccentricity data between the product under test and the platform.
[0097] In this embodiment, the target eccentricity data is the eccentricity data between the product under test and the stage.
[0098] The stage is a platform that carries the product under test and is used to control the corresponding movements to test the product.
[0099] In actual execution, the original contour coordinate data of the product under test can be transformed into original trajectory data that matches the rotation center of the product under test by combining the eccentricity data of the product under test on the platform through trigonometric functions.
[0100] For example, continue to refer to Figure 2 The product under test can be divided into four quadrants according to the coordinate system. When calculating the position of the rounded corner of the product under test, the previous position is used as the origin to establish the coordinate system. Then, the deflection radians (or angles) of the current position are calculated, thus obtaining the deflection radians (or angles) of each position relative to the previous position, such as... Figure 3 As shown.
[0101] Continue to refer to Figure 3 Taking the current point coordinates (35.6393182, 60.8527172) and the previous point coordinates (35.6432916, 60.8015921) as an example, based on the coordinates of the two points, the radian deviation of the current point relative to the previous point can be calculated as (-0.0775632465299522) radians using the formula: Arctan((35.6393182-35.6432916) / (60.8527172-60.8015921). Converting the radian deviation to the angle, the angle of deviation of the current point relative to the previous point is (-4.44404667149899) degrees.
[0102] The deflection radius (or angle) can be used as the raw trajectory data and input into the motion controller to control the motion based on the raw trajectory data.
[0103] Step 120: Collect multiple first contour images corresponding to the curve segments of the product under test under the original trajectory data;
[0104] In this step, the first contour image includes the contour of the curved segment of the product to be tested.
[0105] Multiple first contour images are obtained by acquiring the contours of the curve segments of the image under test one by one based on the original trajectory data.
[0106] In actual execution, the raw trajectory data obtained in step 110 can be imported into the motion controller. Based on the raw trajectory data, the posture of each point on the curve segment trajectory of the product under test can be captured one by one to obtain multiple first contour images, such as... Figure 4 As shown.
[0107] For example, such as Figure 10 As shown, an area scan camera can be added above the product under test. The area scan camera takes pictures to obtain a set of motion posture photos (i.e., multiple first contour images) corresponding to an ordered set of trajectory points, so as to extract the coordinates of the contour points and calculate the angles in the photos in subsequent steps.
[0108] In this step, the first contour image of the product under test is obtained by using the raw trajectory data determined by multiple first pixels that are roughly extracted. This provides a basis for judging the accuracy of the motion trajectory and can be used as compensation data.
[0109] Step 130: Correct the original trajectory data based on multiple first contour images.
[0110] In this step, after acquiring multiple first contour images, such as Figure 5 As shown, multiple first contour images can be automatically analyzed in sequence using software to obtain the correction value corresponding to each pixel in the curve segment of the first contour image. This allows for point-by-point correction of the original trajectory data, making the corrected trajectory data fit the contour curve of the product under test better, reducing errors, and thus improving detection accuracy and detection effect.
[0111] The implementation process of step 130 will be explained in detail below.
[0112] In some embodiments, step 130 may include:
[0113] Image processing is performed on multiple first contour images to obtain the coordinate values of the target points in the first contour images and the angle deviation of the target points. The angle deviation is the angle between the tangent of the target point and the horizontal direction.
[0114] The original trajectory data is corrected based on the angle deviation.
[0115] In this embodiment, the target point can be any pixel in the first contour image.
[0116] The angular deviation is the angle between the tangent at the target point and the horizontal direction, i.e. Figure 6 The deviation in the direction of the R-angle is shown.
[0117] After obtaining the angle deviation, the original trajectory data can be corrected based on the angle deviation, such as... Figure 7 As shown.
[0118] In some embodiments, correcting the original trajectory data based on the angle deviation may include:
[0119] Based on the angular deviation, rotate the target point around the rotation center to obtain the first correction point and its coordinate values.
[0120] Based on the coordinate values of the first correction point, determine the displacement deviation between the first correction point and the theoretical point;
[0121] Based on the first correction point of displacement deviation, obtain the final correction point;
[0122] The original trajectory data is corrected based on the final correction point.
[0123] In this embodiment, the first correction point is the point obtained after the target point has rotated around the rotation center by an angle deviation.
[0124] The theoretical point is the theoretical value of the position of the test product where the trajectory matches the contour of the test product.
[0125] The displacement deviation is the deviation in the Y-axis direction, that is... Figure 6 The Y-pixel direction deviation is shown.
[0126] The final correction point is the optimal point that matches the test product with the trajectory.
[0127] For example, multiple first contour images can be automatically analyzed sequentially using software to generate a set of Y-pixel coordinates of product contour points corresponding to the same X-pixel coordinate, as well as the angle value (i.e., angle deviation) between the tangent direction and the horizontal direction at that point. The resulting image is as follows: Figure 5 As shown.
[0128] Then, based on the angular deviation, the relative error angle of the product under test is rotated with the rotation center as the origin. Next, the contour points are translated to the theoretical points (the points of the theoretical product matching the trajectory) to complete the angle compensation of the contour points. The position and orientation of the product under test after compensation are as follows: Figure 7 As shown.
[0129] In actual execution, the pixels in the curve segment can be identified one by one as target points for trajectory compensation based on the target sequence.
[0130] For example, the position information of the first straight edge of the product under test can be used as a reference to obtain the relative deviation between each point of the arc segment contour and the straight edge contour point. Taking each contour point of the arc segment as the center, the original trajectory data can be corrected based on the relative deviation to achieve trajectory compensation and reduce error.
[0131] According to the product detection trajectory optimization method provided in this application embodiment, an image sensor is installed above the product under test to take area array photos of each trajectory point of the arc segment. The method analyzes the Y pixel corresponding to the same X pixel coordinate in the photo and the angle deviation of the target point. Then, targeted angle compensation and Y pixel direction compensation are performed to ensure that the Y pixel corresponding to the same X pixel is consistent and the angle of the point is consistent. This improves the matching degree between the trajectory data and the real product, and has high detection accuracy and precision.
[0132] In some embodiments, obtaining a first correction point and its coordinate values based on rotating the target point around the rotation center according to the angular deviation may include:
[0133] Based on the coordinates of the target point and the center of rotation, determine the first distance and the first radian between the target point and the center of rotation;
[0134] The second radian is determined based on the angular deviation;
[0135] Based on the first radian and the second radian, determine the target radian between the first correction point and the rotation center;
[0136] Based on the target radian, the first distance, and the coordinates of the rotation center, determine the coordinates of the first correction point.
[0137] In this embodiment, reference continues. Figure 6 and Figure 7 The following example illustrates the rotation of the target point (x1, y1) around the rotation center (x, y) by an angle α (clockwise is positive).
[0138] (1) Calculate the first distance ρ between the target point and the center of rotation:
[0139] ρ=SQRT((x1-x)^2+(y1-y)^2)
[0140] (2) Calculate the first radian L1 between the target point and the center of rotation:
[0141] L1 = ArcTan((y1-y) / (x1-x))
[0142] (3) The rotation angle (i.e., the angle deviation) is converted into the second radian L2:
[0143] L2 = a / 180 * π
[0144] (4) Calculate the target radian L between the first correction point after rotation and the center of rotation:
[0145] L = L1 - L2
[0146] (5) The coordinates of the first correction point are (ρcosL+x,ρsinL+y).
[0147] In this application, trajectory data compensation is achieved by combining virtual and real products, which can realize the best matching between the trajectory and the real product, and has high detection accuracy and precision.
[0148] In addition, this application can accurately generate motion trajectories without obtaining the actual contour data of the product under test, and it does not require manual calibration by the user, thus having high correction efficiency, low design cost and easy implementation.
[0149] According to the product detection trajectory optimization method provided in the embodiments of this application, the first contour image of the product under test is acquired by using the original trajectory data determined by the original contour image of the product under test, and the original trajectory data is corrected point by point based on the first contour image. The method of combining virtual and real products is realized to complete the trajectory data compensation. It can obtain high-precision and high-accuracy detection trajectory data without obtaining the real contour data of the product under test or the user's manual calibration. The compensation efficiency is high and the applicability is wide.
[0150] In some embodiments, after step 130, the method may further include:
[0151] Obtain the deviation between the corrected trajectory data and the product under test;
[0152] If the deviation is greater than the target threshold, the corrected trajectory data will be identified as the original trajectory data.
[0153] In this embodiment, the deviation between the corrected trajectory data and the product under test can be expressed as the absolute value of the difference between the two.
[0154] The target threshold is used to determine the degree of deviation between the corrected trajectory data and the contour of the product under test.
[0155] The target threshold value can be customized based on the accuracy requirements, such as setting it to 0.1 degrees or 0.05 mm. It can be set according to the actual situation, and this application does not limit it.
[0156] If the deviation is greater than the target threshold, it is considered that the current corrected trajectory data still cannot meet the accuracy requirements and needs to be corrected again. At this time, the corrected trajectory data can be used as the original trajectory data, and multiple first contour images corresponding to the curve segments of the product under test under the corrected trajectory data can be collected. Based on the multiple first contour images, the trajectory data after the previous correction is corrected. This process continues until the deviation between the corrected trajectory data and the product under test is no greater than the target threshold.
[0157] In actual execution, after obtaining the trajectory data after the first compensation, steps 120 and 130 can be repeated based on the accuracy requirements to repeatedly compensate the trajectory data.
[0158] Based on the inventor's multiple tests, after three rounds of compensation, the angular deviation between the camera and the product contour points can be reduced to ±0.1 degrees. Figure 8 As shown; the Y-pixel deviation of the contour points is ±0.05mm, as... Figure 9 As shown, it has high testing accuracy.
[0159] According to the product detection trajectory optimization method provided in the embodiments of this application, by using the corrected contour data as the original contour data for the next correction, and repeating contour compensation multiple times until the error is less than the target threshold, the measurement error can be further reduced, thereby significantly improving the detection accuracy and detection effect.
[0160] The product detection trajectory optimization method provided in this application can be executed by a product detection trajectory optimization device. This application uses the product detection trajectory optimization device executing the product detection trajectory optimization method as an example to illustrate the product detection trajectory optimization device provided in this application.
[0161] This application also provides a device for optimizing product detection trajectories.
[0162] like Figure 11 As shown, the optimization device for the product detection trajectory includes: a first processing module 1110, a second processing module 1120, and a third processing module 1130.
[0163] The first processing module 1110 is used to determine the original trajectory data of the product under test based on multiple first pixels extracted from the original contour image.
[0164] The second processing module 1120 is used to collect multiple first contour images corresponding to the curve segments of the product under test under the original trajectory data.
[0165] The third processing module 1130 is used to correct the original trajectory data based on multiple first contour images.
[0166] According to the product detection trajectory optimization device provided in the embodiments of this application, the first contour image of the product under test is acquired by the original trajectory data determined by the original contour image of the product under test, and the original trajectory data is corrected point by point based on the first contour image. The method of combining virtual and real products is realized to complete the trajectory data compensation. It can obtain high-precision and high-accuracy detection trajectory data without obtaining the real contour data of the product under test or the user's manual calibration. The compensation efficiency is high and the applicability is wide.
[0167] In some embodiments, the third processing module 1130 can also be used for:
[0168] Image processing is performed on multiple first contour images to obtain the coordinate values of the target points in the first contour images and the angle deviation of the target points. The angle deviation is the angle between the tangent of the target point and the horizontal direction.
[0169] The original trajectory data is corrected based on the angle deviation.
[0170] In some embodiments, the third processing module 1130 can also be used for:
[0171] Based on the angular deviation, rotate the target point around the rotation center to obtain the first correction point and its coordinate values.
[0172] Based on the coordinate values of the first correction point, determine the displacement deviation between the first correction point and the theoretical point;
[0173] Based on the first correction point of displacement deviation, obtain the final correction point;
[0174] The original trajectory data is corrected based on the final correction point.
[0175] In some embodiments, the third processing module 1130 can also be used for:
[0176] Based on the coordinates of the target point and the center of rotation, determine the first distance and the first radian between the target point and the center of rotation;
[0177] The second radian is determined based on the angular deviation;
[0178] Based on the first radian and the second radian, determine the target radian between the first correction point and the rotation center;
[0179] Based on the target radian, the first distance, and the coordinates of the rotation center, determine the coordinates of the first correction point.
[0180] According to the product detection trajectory optimization device provided in the embodiments of this application, an image sensor is installed above the product to be tested to take area array photos of each trajectory point of the arc segment. The Y pixel corresponding to the same X pixel coordinate in the photo and the angle deviation of the target point are analyzed. Then, the angle compensation and Y pixel direction compensation are performed in a targeted manner, so as to make the Y pixel corresponding to the same X pixel consistent and the angle of the point consistent, thereby improving the matching degree between the trajectory data and the real product, and having high detection accuracy and detection precision.
[0181] In some embodiments, the device may further include:
[0182] The fourth processing module is used to obtain the deviation between the corrected trajectory data and the product under test after correcting the original trajectory data based on multiple first contour images.
[0183] The fifth processing module is used to determine the corrected trajectory data as the original trajectory data when the deviation is greater than the target threshold.
[0184] The product detection trajectory optimization device provided in the embodiments of this application uses the corrected contour data as the original contour data for the next correction, and repeats contour compensation multiple times until the error is less than the target threshold, which can further reduce the measurement error and thus significantly improve the detection accuracy and detection effect.
[0185] In some embodiments, the first processing module 1110 may also be used for:
[0186] Based on the target eccentricity data, trigonometric functions are used to convert the pixel coordinates of multiple first pixels into raw trajectory data; where the target eccentricity data is the eccentricity data between the product under test and the platform.
[0187] The product detection trajectory optimization device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.
[0188] The product detection trajectory optimization device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0189] The product detection trajectory optimization device provided in this application embodiment can achieve Figures 1 to 10 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0190] In some embodiments, such as Figure 12 As shown, this application embodiment also provides an electronic device 1200, including a processor 1201, a memory 1202, and a computer program stored in the memory 1202 and executable on the processor 1201. When the program is executed by the processor 1201, it implements the various processes of the above-described product detection trajectory optimization method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0191] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0192] Figure 13 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0193] The electronic device 1300 includes, but is not limited to, components such as: radio frequency unit 1301, network module 1302, audio output unit 1303, input unit 1304, sensor 1305, display unit 1306, user input unit 1307, interface unit 1308, memory 1309, and processor 1310.
[0194] Those skilled in the art will understand that the electronic device 1300 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1310 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 9 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0195] The processor 1310 is used for:
[0196] Based on multiple first pixels extracted from the original contour image, the original trajectory data of the product under test is determined.
[0197] Collect multiple first contour images corresponding to the curve segments of the product under test under the original trajectory data;
[0198] The original trajectory data is corrected based on multiple first contour images.
[0199] According to the electronic device provided in the embodiments of this application, the first contour image of the product under test is acquired by using the original trajectory data determined by the original contour image of the product under test, and the original trajectory data is corrected point by point based on the first contour image. The method of combining virtual and real products is realized to complete the trajectory data compensation. It can obtain high-precision and high-accuracy detection trajectory data without obtaining the real contour data of the product under test or the user's manual calibration. The compensation efficiency is high and the applicability is wide.
[0200] Optionally, the processor 1310 is also used for:
[0201] Image processing is performed on multiple first contour images to obtain the coordinate values of the target points in the first contour images and the angle deviation of the target points. The angle deviation is the angle between the tangent of the target point and the horizontal direction.
[0202] The original trajectory data is corrected based on the angle deviation.
[0203] Optionally, the processor 1310 is also used for:
[0204] Based on the angular deviation, rotate the target point around the rotation center to obtain the first correction point and its coordinate values.
[0205] Based on the coordinate values of the first correction point, determine the displacement deviation between the first correction point and the theoretical point;
[0206] Based on the first correction point of displacement deviation, obtain the final correction point;
[0207] The original trajectory data is corrected based on the final correction point.
[0208] Optionally, the processor 1310 is also used for:
[0209] Based on the coordinates of the target point and the center of rotation, determine the first distance and the first radian between the target point and the center of rotation;
[0210] The second radian is determined based on the angular deviation;
[0211] Based on the first radian and the second radian, determine the target radian between the first correction point and the rotation center;
[0212] Based on the target radian, the first distance, and the coordinates of the rotation center, determine the coordinates of the first correction point.
[0213] Optionally, the processor 1310 is also used for:
[0214] Obtain the deviation between the corrected trajectory data and the product under test;
[0215] If the deviation is greater than the target threshold, the corrected trajectory data will be identified as the original trajectory data.
[0216] Optionally, the processor 1310 is also used for:
[0217] Based on the target eccentricity data, trigonometric functions are used to convert the pixel coordinates of multiple first pixels into raw trajectory data; where the target eccentricity data is the eccentricity data between the product under test and the platform.
[0218] It should be understood that, in this embodiment, the input unit 1304 may include a graphics processing unit (GPU) 13041 and a microphone 13042. The GPU 13041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1306 may include a display panel 13061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1307 includes a touch panel 13071 and at least one of other input devices 13072. The touch panel 13071 is also called a touch screen. The touch panel 13071 may include a touch detection device and a touch controller. Other input devices 13072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0219] The memory 1309 can be used to store software programs and various data. The memory 1309 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1309 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1309 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0220] Processor 1310 may include one or more processing units; processor 1310 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1310.
[0221] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described product detection trajectory optimization method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0222] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0223] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for optimizing the product detection trajectory.
[0224] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0225] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described product detection trajectory optimization method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0226] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0227] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0228] From the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases...
[0229] The former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art 5, can be embodied in the form of a computer software product, which is stored in a...
[0230] The storage medium (such as ROM / RAM, magnetic disk, optical disk) includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0231] The embodiments of this application have been described above with reference to the accompanying drawings, but this application is not limited to the specific embodiments described above.
[0232] The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art, guided by the teachings of this application, can make further modifications without departing from the spirit and scope of the claims.
[0233] Many forms are protected under this application.
[0234] In the description of this specification, references are made to the terms "one embodiment," "some embodiments," and "illustrative embodiment."
[0235] The terms "example," "specific example," or "some examples," etc., refer to specific features described in connection with the embodiment or example.
[0236] Features, structures, materials, or characteristics are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above five terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, and materials described are not limited to these specific embodiments or examples.
[0237] Alternatively, features may be combined in any suitable manner in one or more embodiments or examples.
[0238] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for optimizing product detection trajectories, characterized in that, include: Based on multiple first pixels extracted from the original contour image, the original trajectory data of the product under test is determined. Collect multiple first contour images corresponding to the curve segments of the product under test under the original trajectory data; Based on the plurality of first contour images, the original trajectory data is corrected; The step of correcting the original trajectory number based on the plurality of first contour images includes: Image processing is performed on the plurality of first contour images to obtain the coordinate values of the target points in the first contour images and the angle deviation of the target points, wherein the angle deviation is the angle between the tangent of the target point and the horizontal direction. Based on the aforementioned angle deviation, the original trajectory data is corrected; The step of correcting the original trajectory data based on the angle deviation includes: Based on the angular deviation, rotate the target point around the rotation center to obtain the first correction point and the coordinate value of the first correction point; Based on the coordinate values of the first correction point, determine the displacement deviation between the first correction point and the theoretical point; Based on the displacement deviation, the first correction point is translated to obtain the final correction point; Based on the final correction point, the original trajectory data is corrected.
2. The method for optimizing product detection trajectory according to claim 1, characterized in that, The step of rotating the target point around the rotation center based on the angular deviation to obtain the first correction point and the coordinate values of the first correction point includes: Based on the coordinates of the target point and the coordinates of the rotation center, determine the first distance and the first radian between the target point and the rotation center; Based on the aforementioned angular deviation, the second radian is determined; Based on the first radian and the second radian, determine the target radian between the first correction point and the rotation center; The coordinates of the first correction point are determined based on the target radian, the first distance, and the coordinates of the rotation center.
3. The method for optimizing product detection trajectory according to any one of claims 1-2, characterized in that, After correcting the original trajectory data based on the plurality of first contour images, the method further includes: Obtain the deviation between the corrected trajectory data and the product under test; If the deviation is greater than the target threshold, the corrected trajectory data is determined as the original trajectory data.
4. The method for optimizing product detection trajectory according to any one of claims 1-2, characterized in that, The determination of the original trajectory data of the product under test based on multiple first pixels extracted from the original contour image includes: Based on the target eccentricity data, trigonometric functions are used to convert the pixel coordinates of the plurality of first pixels into the original trajectory data; wherein, the target eccentricity data is the eccentricity data between the product under test and the platform.
5. A device for optimizing product detection trajectory, characterized in that, include: The first processing module is used to determine the original trajectory data of the product under test based on multiple first pixels extracted from the original contour image. The second processing module is used to collect multiple first contour images corresponding to the curve segments of the product under test under the original trajectory data; The third processing module is used to correct the original trajectory data based on the plurality of first contour images; The third processing module is specifically used to perform image processing on the plurality of first contour images, obtain the coordinate values corresponding to the target points in the first contour images and the angle deviation corresponding to the target points, wherein the angle deviation is the angle between the tangent of the target point and the horizontal direction; and correct the original trajectory data based on the angle deviation. The third processing module is further configured to: rotate the target point around the rotation center based on the angle deviation, and obtain the first correction point and the coordinate value of the first correction point; Based on the coordinate values of the first correction point, determine the displacement deviation between the first correction point and the theoretical point; Based on the displacement deviation, the first correction point is translated to obtain the final correction point; Based on the final correction point, the original trajectory data is corrected.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the product detection trajectory optimization method as described in any one of claims 1-4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the product detection trajectory optimization method as described in any one of claims 1-4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the product detection trajectory optimization method as described in any one of claims 1-4.
Citation Information
Patent Citations
Visual edge finding method and device, readable storage medium and program product
CN113269728A
Gluing track correction method based on least square method
CN115464644A