CN-121973224-A - Mechanical arm track optimization method
Abstract
The application relates to a mechanical arm track optimization method which comprises the steps of obtaining an actual outer contour of a target flexible material, determining a transformation relation between the actual outer contour and a predefined template contour, respectively determining target information related to the predefined sewing track in the actual outer contour and the template contour as first target information and second target information, mapping the second target information and the sewing track to an actual outer contour coordinate system based on the transformation relation, and finally outputting optimized sewing track data adapting to the shape of the actual material by taking the difference between the mapped sewing track and the mapped second target information as a reference through optimizing the difference between the sewing track and the first target information in the coordinate system. The mechanical arm track optimization method provided by the application can effectively compensate the deformation and placement errors of the flexible material, and improves the sewing track fitting degree and sewing precision.
Inventors
- ZHANG LEI
Assignees
- 杭州钛维云创智能科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260310
Claims (10)
- 1. The mechanical arm track optimization method is characterized by comprising the following steps of: Acquiring an actual outer contour of a target flexible material, and determining a transformation relationship between the actual outer contour and a predefined template contour; determining target information associated with the predefined sewing track in the actual outline, wherein the target information is used as first target information; Mapping the second target information into a coordinate system of the actual outer contour based on a transformation relation between the actual outer contour and the predefined template contour to obtain mapped second target information, and mapping the predefined sewing track into the coordinate system of the actual outer contour to obtain mapped predefined sewing track; In the coordinate system of the actual outer contour, continuously optimizing the difference between the mapped predefined sewing track and the first target information by taking the difference between the mapped predefined sewing track and the mapped second target information as a reference to obtain optimized sewing track data; Outputting the optimized sewing track data.
- 2. The method of claim 1, wherein the acquiring the actual outer contour of the target flexible material and determining the coordinate transformation relationship between the actual outer contour and the predefined template contour comprises: converting the acquired image of the target flexible material into an HSV space to obtain an HSV image; performing binarization segmentation on the HSV image based on a preset pixel threshold value to obtain a mask image of the target flexible material; performing median filtering and open operation processing on the mask image of the target flexible material to obtain a processed mask image of the target flexible material, and defining the processed mask image of the target flexible material as a target image; And extracting a closed contour with the largest area in the target image as an actual outer contour.
- 3. The method of claim 1, wherein the steps of obtaining the actual outer contour of the target flexible material and determining the coordinate transformation relationship between the actual outer contour and the predefined template contour further comprise: calculating the area and the centroid position information of the actual outer contour and the predefined template contour respectively based on the original distance; And respectively calculating the main shaft directions of the actual outer contour and the predefined template contour based on the center distance.
- 4. The method of claim 3, wherein the steps of obtaining the actual outer contour of the target flexible material and determining the coordinate transformation relationship between the actual outer contour and the predefined template contour further comprise: Calculating a scaling ratio between the actual outer contour and the predefined template contour based on the square of the ratio of the area of the actual outer contour to the area of the predefined template contour, and scaling the predefined template contour based on the scaling ratio to obtain a scaled predefined template contour image; Based on the position relation between the mass center of the actual outer contour and the mass center of the predefined template contour, calculating to obtain the translation amount between the actual outer contour and the predefined template contour, and translating the scaled predefined template contour image based on the translation amount to obtain a translated predefined template contour image; And based on the main axis direction of the actual outer contour and the main axis direction of the predefined template contour, calculating a rotation angle between the actual outer contour and the predefined template contour through a covariance matrix, and rotating the translated predefined template contour image based on the rotation amount to obtain a rotated predefined template contour image.
- 5. The method of claim 4, wherein the steps of obtaining the actual outer contour of the target flexible material and determining the coordinate transformation relationship between the actual outer contour and the predefined template contour further comprise: Presetting an angle searching range and a searching step length, and searching around an angle value of a rotation angle between an actual outer contour and a predefined template contour to obtain a plurality of angle searching results; And calculating the IOU score of each angle search result, and selecting the angle search result with the highest IOU score to adjust the rotation angle between the actual outer contour and the predefined template contour to obtain the final rotation angle.
- 6. The method according to claim 1, wherein the determining the target information associated with the predefined sewing track in the actual outline, taking the target information as the first target information, and determining the target information associated with the predefined sewing track in the predefined template outline, taking the target information as the second target information, includes: Respectively carrying out segmentation processing on the actual outer contour and the predefined template contour to obtain a plurality of contour segments; mapping the predefined sewing track to a coordinate system of an actual outer contour and a coordinate system of a predefined template contour respectively; Determining a target segment associated with a sewing track from a plurality of contour segments of an actual outer contour in a coordinate system of the actual outer contour as a first target segment; In the coordinate system of the predefined template contour, a target segment associated with the sewing track is determined from a plurality of contour segments of the predefined template contour as a second target segment.
- 7. The method of claim 6, wherein mapping the second target information into the coordinate system of the actual outline based on the transformation relationship between the actual outline and the predefined template outline to obtain the mapped second target information, and mapping the predefined sewing track into the coordinate system of the actual outline to obtain the mapped predefined sewing track, comprises: And mapping the second target segment to a coordinate system of the actual outer contour to obtain a third target segment.
- 8. The method according to claim 7, wherein the step of continuously optimizing the difference between the mapped predefined sewing track and the first target information in the coordinate system of the actual outer contour with reference to the difference between the mapped predefined sewing track and the mapped second target information to obtain the optimized sewing track includes: Calculating a distance between a sewing track in a coordinate system of the actual outer contour and the first target segment as a first distance, and calculating a distance between the sewing track in the coordinate system of the actual outer contour and the third target segment as a second distance; the position of the track point in the sewing track is adjusted in the coordinate system of the actual outer contour, so that optimized sewing track data is generated, wherein the position of the track point in the sewing track is adjusted in the coordinate system of the actual outer contour, and the generation of the optimized sewing track data comprises the step of continuously adjusting the first distance by taking the second distance as a reference.
- 9. The method of claim 7, wherein before the mapping the second target segment to the coordinate system of the actual outer contour to obtain the third target segment, the method further comprises: And fitting the first target segment to obtain a fitted first target segment.
- 10. The method for optimizing a trajectory of a robot arm according to claim 1, the method is characterized in that the mechanical arm track optimization method further comprises the following steps: and converting the optimized sewing track data into a robot execution coordinate system to generate an executable sewing track.
Description
Mechanical arm track optimization method Technical Field The application relates to the technical field of robot control, in particular to a mechanical arm track optimization method. Background In the field of automated sewing, it is important to accurately acquire the sewing start point and track, especially for the processing of non-rigid materials such as cloth. The current solutions fall mainly into two categories. The first is absolute coordinate positioning, wherein the cloth is made of flexible materials, and when placed, the cloth is not only subjected to rigid transformation, but also subjected to stretching, shearing and local edge micro deformation. And secondly, characteristic point visual positioning, namely identifying corner points or marking points of cloth by a camera, and calculating a translation and rotation matrix to correct the track. However, the existing solutions applied to automatic sewing have the problems of poor adaptability and low precision, and the existing solutions cannot adapt to the conditions of rigid transformation, stretching and local micro deformation of the flexible material when the flexible material is sewn, so that the existing solutions are used for sewing the flexible material, and the sewing track is deviated and the sewing precision is reduced. Disclosure of Invention Based on the above, it is necessary to provide a method for optimizing the trajectory of a mechanical arm, which aims at solving the problems that the conventional method cannot adapt to rigid transformation, stretching and local micro deformation of a flexible material when the flexible material is sewn, and the conventional scheme is used for solving the problems that the sewing trajectory deviates and the sewing accuracy is reduced when the flexible material is sewn. The application provides a mechanical arm track optimization method, which comprises the following steps: Acquiring an actual outer contour of a target flexible material, and determining a transformation relationship between the actual outer contour and a predefined template contour; determining target information associated with the predefined sewing track in the actual outline, wherein the target information is used as first target information; Mapping the second target information into a coordinate system of the actual outer contour based on a transformation relation between the actual outer contour and the predefined template contour to obtain mapped second target information, and mapping the predefined sewing track into the coordinate system of the actual outer contour to obtain mapped predefined sewing track; In the coordinate system of the actual outer contour, continuously optimizing the difference between the mapped predefined sewing track and the first target information by taking the difference between the mapped predefined sewing track and the mapped second target information as a reference to obtain optimized sewing track data; Outputting the optimized sewing track data. Further, the acquiring the actual outer contour of the target flexible material and determining the coordinate transformation relation between the actual outer contour and the predefined template contour includes: converting the acquired image of the target flexible material into an HSV space to obtain an HSV image; performing binarization segmentation on the HSV image based on a preset pixel threshold value to obtain a mask image of the target flexible material; performing median filtering and open operation processing on the mask image of the target flexible material to obtain a processed mask image of the target flexible material, and defining the processed mask image of the target flexible material as a target image; And extracting a closed contour with the largest area in the target image as an actual outer contour. Further, the acquiring the actual outer contour of the target flexible material and determining the coordinate transformation relationship between the actual outer contour and the predefined template contour further includes: calculating the area and the centroid position information of the actual outer contour and the predefined template contour respectively based on the original distance; And respectively calculating the main shaft directions of the actual outer contour and the predefined template contour based on the center distance. Further, the acquiring the actual outer contour of the target flexible material and determining the coordinate transformation relationship between the actual outer contour and the predefined template contour further includes: Calculating a scaling ratio between the actual outer contour and the predefined template contour based on the square of the ratio of the area of the actual outer contour to the area of the predefined template contour, and scaling the predefined template contour based on the scaling ratio to obtain a scaled predefined template contour image; Based on the position relation between