Workpiece positioning method and device and workpiece rotating system
By determining the reference structure and rotation center of the workpiece, the workpiece positioning is directly solved, and the problems of low efficiency and poor accuracy in the prior art are achieved, and fast and accurate workpiece positioning is achieved.
Patent Information
- Application Number
- CN202411471331.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-01-03
AI Technical Summary
The existing workpiece positioning methods are inefficient and have low accuracy, especially during the rotational positioning process, which is large in calculation and difficult to accurately identify images with small angle differences, resulting in matching failures and affecting production efficiency and accuracy.
By acquiring the image of the workpiece, determining its multiple reference structures, calculating the rotation center, and directly positioning based on the rotation center, the machine learning model is used to detect circular holes and preprocess images to improve positioning accuracy.
It realizes fast and accurate positioning of the workpiece, improves positioning efficiency and accuracy, avoids multiple matching calculations and rotation operations, and enhances production efficiency.
Smart Images

Figure CN119251290A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of industrial technology, and in particular to a workpiece positioning method and device, and a workpiece rotation system. Background Art
[0002] In many industrial production processes, it is necessary to position the workpiece, especially to rotate the workpiece at an angle, in order to perform processing, testing, assembly, etc. As the requirements of industrial production processes become higher and higher, the requirements for the accuracy and efficiency of workpiece positioning are also getting higher and higher.
[0003] In the related art, angle recognition is mainly based on the matching of the workpiece captured image and the template image to locate the workpiece. For example, the template image is rotated in intervals of 1°, the matching scores of the captured workpiece image and the template image are calculated, and the angle of the workpiece is determined by comparing the matching scores of each angle.
[0004] In the above positioning method, since the template image needs to be continuously rotated and matching calculations need to be performed, the positioning method has a large amount of calculation and takes a long time, which may seriously affect the production efficiency.
[0005] In addition, the positioning method based on template matching cannot distinguish two images with very small angle differences according to the template matching score. When an error occurs in the workpiece, the matching may fail due to the reduction of the matching score, and the angle of the workpiece cannot be determined, resulting in low accuracy in workpiece positioning. Summary of the invention
[0006] In the related art, when positioning a workpiece, there are problems of low efficiency and low precision.
[0007] In view of this, the present disclosure provides a workpiece positioning method, which can effectively solve the above problems.
[0008] According to one aspect of the present disclosure, a workpiece positioning method is proposed, including: acquiring a first image of a workpiece; determining multiple reference structures of the workpiece based on the first image; determining a rotation center of the workpiece based on the multiple reference structures; and positioning the workpiece based on the rotation center.
[0009] In some embodiments, determining the rotation center of the workpiece includes: determining the positional relationship between multiple reference structures of the workpiece and the rotation center of the workpiece based on the model of the workpiece; and determining the rotation center of the workpiece based on at least a portion of the multiple reference structures and the positional relationship.
[0010] In some embodiments, determining the rotation center of the workpiece based on at least a portion of the multiple reference structures and the positional relationship includes: selecting at least a portion of the multiple reference structures as a combination of reference structures; determining candidate rotation centers of the workpiece based on different combinations of reference structures and the positional relationship; and determining the rotation center of the workpiece based on the candidate rotation centers.
[0011] In some embodiments, determining the rotation center of the workpiece according to the candidate rotation centers includes: determining the rotation center of the workpiece according to the median or average of the coordinates of the candidate rotation centers.
[0012] In some embodiments, the reference structure includes an auxiliary reference structure, and positioning the workpiece includes: determining a positioning point of the workpiece according to the auxiliary reference structure; and positioning the workpiece according to an angle between a vector formed by the rotation center and the positioning point and a preset direction.
[0013] In some embodiments, the positioning point includes the center point of the reference structure, and determining the positioning point of the workpiece based on the auxiliary reference structure includes: calculating the distance between the center point of the auxiliary reference structure and the center points of other reference structures; and determining the positioning point of the workpiece based on the center points of other reference structures that have the smallest distance from the center point of the auxiliary reference structure.
[0014] In some embodiments, determining the positioning point of the workpiece based on the center point of other reference structures having the smallest distance from the center point of the auxiliary reference structure includes: determining candidate positioning points of the workpiece based on the center point of other reference structures having the smallest distance from the center point of the auxiliary reference structure; adjusting the candidate positioning points based on the center points of the other reference structures, and determining the positioning point of the workpiece with the adjusted candidate positioning points.
[0015] In some embodiments, the reference structure includes a circular hole on the workpiece, and determining the reference structure of the workpiece includes: obtaining a radius range of the circular hole input by a user; and performing circular hole detection in the first image based on the radius range of the circular hole using a machine learning model.
[0016] In some embodiments, based on the radius range of the circular hole, using a machine learning model, performing circular hole detection in the first image includes: masking the first image of the workpiece; and using a machine learning model to perform circular hole detection on an unmasked area in the first image.
[0017] In some embodiments, determining the multiple reference structures of the workpiece according to the first image includes: preprocessing the first image; and determining the multiple reference structures of the workpiece according to the preprocessed first image.
[0018] In some embodiments, the preprocessing includes at least one of equalization, filtering, binarization, and noise removal.
[0019] In some embodiments, the workpiece positioning method further includes: acquiring a second image of the workpiece; and determining a rotation angle of the workpiece according to a positioning result of the workpiece in the first image and a position of the workpiece in the second image.
[0020] In some embodiments, the size of the second image is the same as that of the first image, and the workpiece positioning method further includes: determining the center points of the first image and the second image; rotating the first image along the center point according to the rotation angle to obtain the rotated first image; respectively determining the reference structure of the workpiece in the second image and the rotated first image; and determining whether to reposition the workpiece based on the degree of overlap between the reference structures.
[0021] According to another aspect of the present disclosure, there is provided a workpiece positioning device, comprising: an acquisition module, configured to acquire a first image of a workpiece; a first determination module, configured to determine a plurality of reference structures of the workpiece based on the first image; a second determination module, configured to determine a rotation center of the workpiece based on the plurality of reference structures; and a positioning module, configured to position the workpiece based on the rotation center.
[0022] According to another aspect of the present disclosure, a workpiece positioning device is provided, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the workpiece positioning method as described above based on instructions stored in the memory.
[0023] According to another aspect of the present disclosure, a workpiece rotation system is provided, comprising: an image acquisition device configured to acquire a first image of the workpiece; the workpiece positioning device as described above; and a rotation device configured to rotate the workpiece according to a positioning result.
[0024] In some embodiments, the workpiece rotation system further includes: a moving device configured to move the image acquisition device so that the distance between the image acquisition device and the workpiece remains unchanged.
[0025] According to another aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the workpiece positioning method as described above is implemented.
[0026] According to another aspect of the present disclosure, a computer program product is provided, wherein the computer program product stores computer instructions, and when the instructions are executed by a processor, the workpiece positioning method as described above is implemented.
[0027] The workpiece positioning method provided by the present disclosure determines reference structures on the workpiece, uses these reference structures to determine the rotation center of the workpiece, and then directly positions the workpiece according to the rotation center, thereby achieving accurate and rapid positioning of the workpiece. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0029] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0030] Figure 1 is a flow chart showing a method for positioning a workpiece according to some embodiments of the present disclosure;
[0031] Figure 2 is a flowchart illustrating determination of a reference structure according to some embodiments of the present disclosure;
[0032] Figure 3 is a flow chart showing circular hole detection according to some embodiments of the present disclosure;
[0033] Figure 4 is a schematic diagram illustrating mask processing according to some embodiments of the present disclosure;
[0034] Figure 5 is a flow chart illustrating determining a rotation center according to some embodiments of the present disclosure;
[0035] Figure 6 is a flow chart illustrating determining a rotation center based on a reference structure and a positional relationship according to some embodiments of the present disclosure;
[0036] Figure 7 is a flow chart illustrating positioning of a workpiece according to some embodiments of the present disclosure;
[0037] Figure 8 is a schematic diagram showing a workpiece according to some embodiments of the present disclosure;
[0038] Fig. 9 is a flow chart showing a workpiece positioning method according to other embodiments of the present disclosure;
[0039] Fig.10 is a flow chart showing a workpiece positioning method according to some further embodiments of the present disclosure;
[0040] Fig.11 is a schematic diagram showing the overlap of reference structures according to an embodiment of the present disclosure;
[0041] Fig.12 is a block diagram showing a workpiece positioning device according to some embodiments of the present disclosure;
[0042] Fig.13 is a block diagram showing a workpiece positioning device according to other embodiments of the present disclosure;
[0043] Fig.14 is a block diagram illustrating a workpiece rotation system according to some embodiments of the present disclosure;
[0044] Fig.15 is a schematic diagram showing a workpiece rotation system according to some embodiments of the present disclosure;
[0045] Fig.16 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.
[0046] It should be understood that the size of each part shown in the accompanying drawings is not drawn according to the actual proportional relationship. In addition, the same or similar reference numerals represent the same or similar components. DETAILED DESCRIPTION
[0047] Various embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. The description of the embodiments is merely illustrative and is in no way intended to limit the present disclosure and its application or use. The present disclosure can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to make the present disclosure thorough and complete and to fully express the scope of the present disclosure to those skilled in the art. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps described in these embodiments should be interpreted as being merely illustrative and not as a limitation.
[0048] The words "first", "second" and similar words used in this disclosure do not indicate any order, quantity or importance, but are only used to distinguish different parts. The words "include" and similar words mean that the elements before the word include the elements listed after the word, and do not exclude the possibility of including other elements.
[0049] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0050] All terms (including technical terms or scientific terms) used in the present disclosure have the same meanings as those understood by ordinary technicians in the field to which the present disclosure belongs, unless otherwise specifically defined. It should also be understood that terms defined in general dictionaries, such as general dictionaries, should be interpreted as having meanings consistent with their meanings in the context of the relevant technology, and should not be interpreted in an idealized or extremely formal sense, unless explicitly defined herein.
[0051] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0052] In the traditional workpiece positioning method, the rotation positioning of the workpiece requires multiple matching calculations, and the angles of rotation of the template and the stencil are relatively fixed, resulting in low positioning efficiency and poor positioning accuracy.
[0053] In view of this, the present disclosure proposes a workpiece positioning method, which can improve positioning efficiency and positioning accuracy.
[0054] First, combine Figure 1 The workpiece positioning method in the present disclosure is described. Figure 1 is a flow chart showing a method for positioning a workpiece according to some embodiments of the present disclosure. Figure 1 As shown, the workpiece positioning method includes: steps S1 to S4.
[0055] In step S1, a first image of a workpiece is acquired. The first image is, for example, a real-time image of the workpiece captured by a camera sensor.
[0056] In some embodiments, the clarity of the first image can be improved by changing parameters and debugging of the camera sensor to further highlight the details of the workpiece in the image.
[0057] In step S2, multiple reference structures of the workpiece are determined based on the first image. The reference structures of the workpiece refer to some structural features on the workpiece that are selected for positioning. The reference structures are, for example, features such as round holes, square holes, and bosses of the workpiece. By analyzing the first image of the workpiece, multiple reference structures of the workpiece can be determined.
[0058] In some embodiments, the reference structure includes a circular hole on the workpiece. Step S2 specifically includes: S21, obtaining the radius range of the circular hole input by the user; S22, performing circular hole detection on the first image based on the radius range of the circular hole using a machine learning model, such as Figure 2 shown. Figure 2 is a flow chart illustrating determining a reference structure according to some embodiments of the present disclosure.
[0059] In the above embodiment, for example, the user can input a radius range of 10 mm to 12 mm for the circular hole. Based on the radius range, a machine learning model can be used to perform circle detection, such as Hough circle detection, on the first image to determine multiple circular holes on the workpiece in the first image. These circular holes are the reference structures selected for positioning.
[0060] In addition, if Figure 3 As shown, the above step S22 may further include: S221, performing masking processing on the first image of the workpiece; S222, performing circular hole detection on the unmasked area in the first image using a machine learning model. Figure 3 is a flow chart showing circular hole detection according to some embodiments of the present disclosure.
[0061] For example, Figure 4 is a schematic diagram illustrating mask processing according to some embodiments of the present disclosure. Figure 4 As shown, the first image can be masked using means such as a mask ring. Figure 4 In the embodiment, the mask ring 41 and the mask ring 42 are used to mask the portion of the first image that is not related to the reference structure. Figure 4 The dotted part in the figure is the shape that the workpiece may have originally. By masking the image, only the part with the circular hole is retained in the image, thereby eliminating the interference of other parts on the circular hole detection.
[0062] Through the above arrangement, the circular hole on the workpiece can be accurately detected as a reference structure for positioning, thereby improving the accuracy of positioning.
[0063] In some embodiments, determining the multiple reference structures of the workpiece according to the first image may further include: preprocessing the first image; and determining the multiple reference structures of the workpiece according to the preprocessed first image.
[0064] In some embodiments, the preprocessing includes at least one of equalization, filtering, binarization, and noise removal.
[0065] The above-mentioned equalization is, for example, performing histogram equalization on the image, which adjusts the pixel intensity distribution of the image so as to enhance the contrast of the image.
[0066] The above filtering is, for example, bilateral filtering of an image, which makes the details of the image clearer by retaining edge information during the filtering process.
[0067] The above-mentioned binarization processing is, for example, performing binarization processing on an image, by converting pixel values to 0 or 255 to highlight the edges and features of the workpiece.
[0068] The above-mentioned noise elimination is, for example, performing morphological operations on the image to eliminate the noise in the image. For example, stains on the surface of the workpiece appear as black noise points in the image, which can be processed by a closing operation of first dilation and then corrosion; while bright spots on the surface of the workpiece appear as white noise points in the image, which can be processed by an opening operation of first corrosion and then dilation.
[0069] Through the above preprocessing, other irrelevant information in the first image can be removed, and information of multiple reference structures used for positioning can be retained, thereby improving the efficiency and accuracy of positioning.
[0070] Back to Figure 1 In step S3, the rotation center of the workpiece is determined according to the multiple reference structures. The rotation center of the workpiece refers to the center around which the workpiece rotates, which may be different from the geometric center of the workpiece. By determining the rotation center and then positioning the workpiece according to the rotation center, the positioning can be directly used for the rotation of the workpiece, while accurately positioning, it also avoids secondary conversion, and improves the efficiency and accuracy of positioning.
[0071] Combine the following Figure 5 Step S3 is further described. Figure 5 FIG. 4 is a flowchart illustrating determining a rotation center according to some embodiments of the present disclosure. Figure 5 As shown, determining the rotation center of the workpiece specifically includes: steps S31 to S32.
[0072] In step S31, the positional relationship between a plurality of reference structures of the workpiece and the rotation center of the workpiece is determined according to the model of the workpiece.
[0073] For different workpieces, the reference structure of the workpiece and the rotation center may have different positional relationships, such as the distance or symmetry relationship between the reference structure and the rotation center.
[0074] For example, for the above Figure 4 In the workpiece shown, the relationship between the multiple reference structures of the workpiece, i.e., multiple circular holes, and the rotation center 40 of the workpiece is that the distance between each reference structure and the rotation center is equal. In other words, the distance between the rotation center 40 of the workpiece and the center of each circular hole is equal.
[0075] In other examples, the positional relationship between the reference structure of the workpiece and the rotation center can be that the rotation center is 5 mm from the first square hole, 10 mm from the second square hole, and 7 mm from the third square hole, etc., wherein the sizes of the first square hole, the second square hole and the third square hole may be different, so they can be distinguished during calculation.
[0076] In step S32, the rotation center of the workpiece is determined based on at least a portion of the reference structures and the positional relationship among the plurality of reference structures.
[0077] The rotation center of the workpiece can be calculated from the above positional relationship and at least a portion of the reference structure. Figure 4 In the example of the workpiece shown, for example, three circular holes may be selected, points in the coordinate system that are equidistant from the three circular holes may be calculated, and the coordinates of the calculated points may be determined as the coordinates of the rotation center of the workpiece.
[0078] Combine the following Figure 6 Step S32 is further described. Figure 6 is a flow chart illustrating determining a rotation center based on a reference structure and a positional relationship according to some embodiments of the present disclosure.
[0079] like Figure 6 As shown, determining the rotation center based on the reference structure and the positional relationship specifically includes: step S321, selecting at least a part of the reference structures among the multiple reference structures as a combination of reference structures; step S322, determining the candidate rotation center of the workpiece according to different combinations of reference structures and positional relationships; step S323, determining the rotation center of the workpiece based on the candidate rotation centers.
[0080] By calculating the corresponding candidate rotation centers through different combinations of reference structures, and then using the candidate rotation centers to determine the rotation center, errors can be effectively reduced and positioning accuracy can be improved. The errors are caused by deviations of the reference structures during manufacturing, for example.
[0081] exist Figure 4 In the example of FIG. 1 , step S321 is, for example, to select 3 circular holes from the 7 circular holes of the workpiece as a combination. Therefore, the number of possible combinations of circular holes is indivual.
[0082] In step S322, the candidate rotation center coordinates of the workpiece are calculated by fitting the three circular holes in any combination. Assuming that the selected circular holes are circular holes 41, 42, and 43, the coordinates of their centers are , , , then the fitting calculation of the rotation center Coordinates The formula is:
[0083]
[0084]
[0085] By traversing each combination, the set of candidate rotation centers can be fitted and calculated separately. In this example, represents the number of calculated rotation centers, i.e., the number of possible combinations of reference structures, .
[0086] In step S323, the rotation center of the workpiece is determined by using the candidate rotation centers. For example, the rotation center of the workpiece can be determined based on the median or average value of the coordinates of the candidate rotation centers.
[0087] Continuing with the above example, after calculating the set of candidate rotation centers After obtaining the coordinates of each candidate rotation center, the median of the coordinate group of the candidate rotation center can be used as the coordinate of the final rotation center C:
[0088]
[0089]
[0090] Through the above steps, the error in determining the rotation center of the workpiece can be effectively reduced, thereby improving the positioning accuracy.
[0091] Back to Figure 1 In step S4, the workpiece is positioned according to the rotation center. Positioning based on the rotation center can enable positioning to be directly used for the rotation of the workpiece, which improves the positioning accuracy of the rotation process while avoiding secondary conversion, thereby improving the efficiency and accuracy of positioning.
[0092] Combine the following Figure 7 Step S4 is further described. Figure 7 is a flow chart showing positioning of a workpiece according to some embodiments of the present disclosure. Figure 7 In the illustrated embodiment, the reference structure of the workpiece includes an auxiliary reference structure.
[0093] like Figure 7 As shown, positioning the workpiece specifically includes steps S41 and S42.
[0094] In step S41, the positioning point of the workpiece is determined according to the auxiliary reference structure.
[0095] The auxiliary reference structure in the above-mentioned embodiment is, for example, a reference structure with a size different from that of other reference structures, and is used to assist in positioning but not to determine the rotation center of the workpiece. Figure 8 is a schematic diagram showing a workpiece according to some embodiments of the present disclosure, and will be referred to below Figure 8 Describes examples of auxiliary reference structures.
[0096] Figure 8 The reference structure 81 in the figure is an auxiliary reference structure, and the auxiliary reference structure 81 is a circular hole of a different size from the other reference structures. The auxiliary reference structure can also be determined by the circular hole detection described above. Figure 4The reference structure of the workpiece in the illustrated embodiment is different. Figure 8 In some other embodiments shown, the reference structure of the workpiece is a square hole.
[0097] In some embodiments, the positioning point includes the center point of the reference structure, and the method for determining the positioning point includes: calculating the distance between the center point of the auxiliary reference structure and the center points of other reference structures; and determining the positioning point of the workpiece based on the center points of other reference structures with the smallest distance from the center point of the auxiliary reference structure.
[0098] refer to Figure 8 In the example in FIG. 1 , the distance between the center point of the auxiliary reference structure 81 and the center points of other reference structures, including reference structures 82, 83, 84, and 85, is first calculated. By comparing the above distances, the center point 820 of the reference structure 82 closest to the auxiliary reference structure 81 can be determined as the positioning point.
[0099] In some further embodiments, the method for determining the positioning point may also include determining the candidate positioning point of the workpiece based on the center point of other reference structures that have the smallest distance from the center point of the auxiliary reference structure; adjusting the candidate positioning point based on the center point of the other reference structures, and determining the positioning point of the workpiece with the adjusted candidate positioning point.
[0100] Specifically, in the above embodiment, after the center point of the reference structure 82 closest to the auxiliary reference structure is determined as the candidate positioning point, the angles between the other reference structures 83, 84, 85 and 82 can be determined according to the model diagram of the workpiece, for example, Figure 8 In the embodiment, the angles between the other reference structures 83, 84, 85 and 82 are 90°, 180°, and 270°, respectively. According to the determined angles, the corresponding reference structures are rotated along the rotation center 80 of the workpiece, including rotating the reference structure 83 by 90°, rotating the reference structure 84 by 180°, and rotating the reference structure 85 by 270°. According to the center points of the rotated reference structures, the candidate positioning points are adjusted.
[0101] The above adjustment may include adjusting the coordinates of the candidate positioning points to the average or median of the coordinates of the center points of the reference structure 82 and the rotated reference structures 83 , 84 , 85 .
[0102] Through the above process and adjustment, errors in calculation or production process can be avoided and positioning accuracy can be improved.
[0103] In step S42, the workpiece is positioned according to the angle between the vector formed by the rotation center and the positioning point and the preset direction. The preset direction is a reference direction for positioning the workpiece. Positioning the workpiece means determining the angle formed by the vector formed by the rotation center and the positioning point and the plumb line direction in a clockwise direction, thereby determining the angle of the workpiece.
[0104] Continue to refer Figure 8 In the example of a workpiece in FIG. 8 , the preset direction 800 is the plumb line direction of the rotation center, and the angle formed by the vector 801 formed by the rotation center 80 and the positioning point 820 and the preset direction 800 is 90°, which is the result of workpiece positioning. The positioning result can be used in subsequent production processes such as workpiece rotation.
[0105] The above describes a basic workpiece positioning method according to some embodiments of the present disclosure. The workpiece positioning method determines the rotation center through a reference structure and then performs workpiece positioning, which can improve the efficiency and accuracy of workpiece positioning. Figures 9 to 11 The workpiece positioning method in other embodiments of the present disclosure is introduced. Fig. 9 is a flow chart showing a workpiece positioning method according to other embodiments of the present disclosure. Fig. 9 The workpiece positioning method in the illustrated embodiment can directly determine the rotation angle of the workpiece between different images based on the workpiece positioning.
[0106] like Fig. 9 As shown, the workpiece positioning method in other embodiments of the present disclosure includes steps S91 to S96. Among them, steps S91, S92, S93, and S94 are respectively Figure 1 Steps S1, S2, S3, and S4 are similar and will not be described again here. The following focuses on steps S95 to S96.
[0107] In step S95, a second image of the workpiece is acquired. The second image is, for example, a target image of the workpiece after rotation, in other words, an image of the angle at which the workpiece is expected to be rotated.
[0108] In step S96, the rotation angle of the workpiece is determined according to the positioning result of the workpiece in the first image and the position of the workpiece in the second image.
[0109] As described above, the result of workpiece positioning is, for example, the angle between the vector formed by the workpiece rotation center and the positioning point and the direction of the plumb line. For example, by presetting the association between the image and the angle or applying the workpiece positioning method to the second image, the positioning point of the workpiece and the above angle are also determined in the second image, and the angle of rotation of the workpiece around the rotation center from the first image to the second image can be directly determined.
[0110] The above positioning method can directly determine the angle of rotation of the workpiece around the rotation center between images, avoiding the need to convert to the rotation center coordinate system after usual positioning to determine the angle, thereby improving the efficiency and accuracy of positioning.
[0111] Combined with the above Fig. 9 The positioning method in some embodiments of the present disclosure is introduced, which can directly determine the rotation angle of the workpiece. Fig.10 The positioning methods in some further embodiments are introduced. Fig.10 The illustrated embodiment can evaluate the accuracy of workpiece positioning based on the image, and re-position the workpiece when the accuracy is insufficient.
[0112] Fig.10 FIG. 1 is a flow chart showing a workpiece positioning method according to some further embodiments of the present disclosure. Fig.10 As shown, the positioning method in the above embodiment also includes steps S97 to S100.
[0113] In step S97, the center points of the first image and the second image are determined, wherein the second image has the same size as the first image.
[0114] By acquiring a second image of the same size as the first image and determining the center point of the two images, the two images can be aligned and used in subsequent steps.
[0115] In step S98, the first image is rotated along the center point according to the rotation angle to obtain a rotated first image.
[0116] Because the rotation angle determined in the above steps is the rotation angle of the workpiece from the first image to the second image, the first image is rotated according to the rotation angle. Without considering the error, the workpiece in the rotated first image should be able to coincide with the workpiece in the second image.
[0117] In step S99, the reference structures of the workpiece in the second image and the rotated first image are determined respectively.
[0118] The reference structure of the workpiece in the second image and the rotated first image is determined by, for example, the circular hole recognition algorithm described above.
[0119] In step S100, it is determined whether to reposition the workpiece according to the degree of overlap between the reference structures.
[0120] As described above, since the workpiece in the rotated first image and the workpiece in the second image should be overlapped, the positioning accuracy of the workpiece positioning method can be evaluated by comparing the overlap degree between the reference structures.
[0121] For example, Fig.11 is a schematic diagram showing the overlap of reference structures according to an embodiment of the present disclosure, wherein the circular hole 111 is an auxiliary reference structure in the second image, the dotted circular holes 112' to 118' are the reference structures of the workpiece in the rotated first image, and the solid circular holes 112 to 118 are the reference structures of the workpiece in the second image. Fig.11 The schematic diagram shown may be a schematic diagram of a workpiece shown in other embodiments of the present disclosure.
[0122] The accuracy of workpiece positioning can be evaluated by the degree of overlap between the reference structures in the figure. For example, when the degree of overlap is lower than a certain threshold, the workpiece positioning accuracy is judged to be low, and the workpiece needs to be repositioned after modifying the parameters. When the degree of overlap is higher than or equal to a certain threshold, the workpiece positioning accuracy is judged to meet the requirements, and subsequent processes such as rotation based on the positioning results can be carried out.
[0123] The above workpiece positioning method further includes a workpiece positioning accuracy evaluation part based on workpiece positioning, which evaluates the accuracy of workpiece positioning. When the accuracy does not meet the requirements, the workpiece is re-positioned, thereby further improving the accuracy of workpiece positioning.
[0124] Combined with the above Figures 1 to 11 The workpiece positioning method proposed in this disclosure is introduced. Figure 12 to Figure 13 The workpiece positioning device proposed in the present disclosure is introduced.
[0125] Fig.12 is a block diagram showing a workpiece positioning device according to some embodiments of the present disclosure. Fig.12 As shown, the workpiece positioning device 12 includes an acquisition module 121, configured to acquire a first image of the workpiece; a first determination module 122, configured to determine multiple reference structures of the workpiece based on the first image; a second determination module 123, configured to determine the rotation center of the workpiece based on the multiple reference structures; and a positioning module 124, configured to position the workpiece based on the rotation center.
[0126] The acquisition module 121 of the workpiece positioning device can be used to perform Figure 1 The first determination module 122 of the workpiece positioning device can be used to perform Figure 1 The second determination module 123 of the workpiece positioning device can be used to perform Figure 1 The positioning module 124 of the workpiece positioning device can be used to perform Figure 1 Step S4 in .
[0127] Fig.13 is a block diagram showing a workpiece positioning device according to some other embodiments of the present disclosure. Fig.13As shown, the workpiece positioning device 13 includes a memory 131 and a processor 132 coupled to the memory 131 , wherein the processor 132 is configured to execute the workpiece positioning method as described in any of the above embodiments based on instructions stored in the memory.
[0128] During the workpiece positioning process, the workpiece positioning device determines the rotation center of the workpiece by using the reference structure of the workpiece, and then positions the workpiece based on the rotation center of the workpiece, thereby improving the efficiency and accuracy of workpiece positioning.
[0129] In addition to the workpiece method and device described above, the present disclosure also proposes a workpiece rotation system. Fig.14 is a block diagram illustrating a workpiece rotation system according to some embodiments of the present disclosure. Fig.14 As shown, the workpiece rotation system O includes: an image acquisition device AD, configured to acquire a first image of the workpiece; a workpiece positioning device LD, which can be the workpiece positioning device described in any of the above embodiments, such as the workpiece positioning device 12 or the workpiece positioning device 13; and a rotation device RD, configured to rotate the workpiece according to the positioning result.
[0130] The above-mentioned workpiece rotation system uses the workpiece positioning device described above in the present disclosure for the workpiece rotation process, and improves the success rate and efficiency of the workpiece rotation by positioning the workpiece more quickly and accurately.
[0131] The following will be combined Fig.15 A specific example of the workpiece rotation system proposed in the present disclosure is introduced. Fig.15 is a schematic diagram illustrating a workpiece rotation system according to some embodiments of the present disclosure.
[0132] Fig.15 The image acquisition device AD is, for example, an industrial camera sensor, which can acquire images of workpieces. The image acquisition device AD can be modified to change the parameters of the image acquisition device AD, adjust the clarity of the acquired image, etc., so that the image is more convenient for subsequent processing.
[0133] The workpiece positioning device LD is, for example, a programmable logic controller (PLC), which is communicatively connected with other components to position the workpiece and transmit the positioning result.
[0134] The rotating device RD can drive the workpiece to rotate by a certain angle, for example, according to the rotation angle of the workpiece from the first image to the second image determined by the workpiece positioning device 14, the workpiece is rotated so that the workpiece is at the position shown in the second image.
[0135] In some embodiments, the workpiece rotation system 1 further includes a moving device MD configured to move the image acquisition device AD so that the distance between the image acquisition device and the workpiece remains constant.
[0136] By moving the image acquisition device and keeping the distance between the image acquisition device and the workpiece unchanged, the first images acquired by the image acquisition device can be of a fixed size, which is convenient for subsequent processing.
[0137] The moving device can be, for example, a three-axis servo manipulator or a six-axis joint manipulator, which is used to clamp the workpiece in three directions in three dimensions or to move the image acquisition device to take pictures. The image acquisition device is installed on the vertical axis of the manipulator.
[0138] Fig.16 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.
[0139] like Fig.16 As shown, the computer system 16 may be embodied in the form of a general purpose computing device. The computer system 16 includes a memory 161, a processor 162, and a bus 160 that connects the various system components.
[0140] The memory 161 may be a computer-readable storage medium in various forms, such as a system memory, a non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader (BootLoader), and other programs. The system memory may include a volatile storage medium, such as a random access memory (RAM) and / or a cache memory. The non-volatile storage medium may store, for example, instructions for executing the corresponding embodiment of the workpiece positioning method. The non-volatile storage medium includes, but is not limited to, a disk memory, an optical memory, a flash memory, etc.
[0141] The processor 162 can be implemented by a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistors, etc. Discrete hardware components. Accordingly, each module can be implemented by a central processing unit (CPU) running instructions in a memory that execute corresponding steps, or by a dedicated circuit that executes corresponding steps.
[0142] The bus 160 may use any of a variety of bus architectures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.
[0143] The computer system 16 may also include an input / output interface 163, a network interface 164, a storage interface 165, etc. These interfaces 163, 164, 165, the memory 161, and the processor 162 may be connected via a bus 160. The input / output interface 163 may provide a connection interface for input / output devices such as a display, a mouse, and a keyboard. The network interface 164 may provide a connection interface for various networked devices. The storage interface 165 may provide a connection interface for external storage devices such as a floppy disk, a USB flash drive, and an SD card.
[0144] According to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which, when executed on a computer, enables the computer to implement the workpiece positioning method described in any of the foregoing embodiments. The computer program product includes a computer program carried on a computer-readable medium, the computer program including program code for executing the method shown in the flowchart.
[0145] So far, various embodiments of the present disclosure have been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed here.
[0146] Although some specific embodiments of the present disclosure have been described in detail by way of examples, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified or some technical features may be replaced by equivalents without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A workpiece positioning method, comprising: acquiring a first image of a workpiece; determining a plurality of reference structures of the workpiece according to the first image; determining a center of rotation of the workpiece based on the plurality of reference structures; The workpiece is positioned according to the rotation center.
2. The workpiece positioning method according to claim 1, wherein: Determining the center of rotation of the workpiece includes: Determining, according to the model of the workpiece, a positional relationship between a plurality of reference structures of the workpiece and a rotation center of the workpiece; A rotation center of the workpiece is determined based on at least a portion of the plurality of reference structures and the positional relationship.
3. The workpiece positioning method according to claim 2, wherein: Determining the rotation center of the workpiece according to at least a portion of the plurality of reference structures and the positional relationship comprises: Selecting at least a portion of the reference structures from the plurality of reference structures as a combination of reference structures; Determining candidate rotation centers of the workpieces according to different combinations of reference structures and the positional relationships; The rotation center of the workpiece is determined based on the candidate rotation centers.
4. The workpiece positioning method according to claim 3, wherein: Determining the rotation center of the workpiece according to the candidate rotation center includes: The rotation center of the workpiece is determined according to the median or average of the coordinates of the candidate rotation centers.
5. The workpiece positioning method according to claim 1, wherein: The reference structure includes an auxiliary reference structure, and positioning the workpiece includes: Determining a positioning point of the workpiece according to the auxiliary reference structure; The workpiece is positioned according to an angle between a vector formed by the rotation center and the positioning point and a preset direction.
6. The workpiece positioning method according to claim 5, wherein: The positioning point includes a center point of a reference structure, and determining the positioning point of the workpiece according to the auxiliary reference structure includes: Calculate the distance between the center point of the auxiliary reference structure and the center points of other reference structures; The positioning point of the workpiece is determined according to the center point of the other reference structure having the smallest distance from the center point of the auxiliary reference structure.
7. The workpiece positioning method according to claim 6, wherein: Determining the positioning point of the workpiece according to the center point of other reference structures having the smallest distance from the center point of the auxiliary reference structure comprises: Determining a candidate positioning point of the workpiece according to a center point of another reference structure having a minimum distance from a center point of the auxiliary reference structure; The candidate positioning point is adjusted according to the center point of other reference structures, and the adjusted candidate positioning point is determined as the positioning point of the workpiece.
8. The workpiece positioning method according to claim 1, wherein: The reference structure includes a circular hole on the workpiece, and determining the reference structure of the workpiece includes: Get the radius range of the circular hole input by the user; According to the radius range of the circular hole, circular hole detection is performed in the first image using a machine learning model.
9. The workpiece positioning method according to claim 8, wherein: According to the radius range of the circular hole, using a machine learning model, performing circular hole detection on the first image includes: performing mask processing on the first image of the workpiece; Using a machine learning model, circular hole detection is performed on the unmasked area in the first image.
10. The workpiece positioning method according to claim 1, wherein: Determining a plurality of reference structures of the workpiece according to the first image comprises: Preprocessing the first image; A plurality of reference structures of the workpiece are determined according to the preprocessed first image.
11. The workpiece positioning method according to claim 10, wherein: The preprocessing includes at least one of equalization, filtering, binarization, and noise elimination.
12. The workpiece positioning method according to claim 1, further comprising: acquiring a second image of the workpiece; The rotation angle of the workpiece is determined according to the positioning result of the workpiece in the first image and the position of the workpiece in the second image.
13. The workpiece positioning method according to claim 12, wherein: The size of the second image is the same as the size of the first image, and the workpiece positioning method further includes: determining center points of the first image and the second image; Rotate the first image along the center point according to the rotation angle to obtain a rotated first image; determining a reference structure of the workpiece in the second image and the rotated first image respectively; Whether to reposition the workpiece is determined according to the degree of overlap between the reference structures.
14. A workpiece positioning device, comprising: an acquisition module configured to acquire a first image of a workpiece; A first determining module, configured to determine a plurality of reference structures of the workpiece according to the first image; a second determination module configured to determine a rotation center of the workpiece according to the plurality of reference structures; The positioning module is configured to position the workpiece according to the rotation center.
15. A workpiece positioning device, comprising: Memory; and A processor coupled to the memory, the processor being configured to execute the workpiece positioning method according to any one of claims 1 to 13 based on instructions stored in the memory.
16. A workpiece rotation system, comprising: an image acquisition device configured to acquire a first image of the workpiece; The workpiece positioning device according to claim 14 or 15; The rotating device is configured to rotate the workpiece according to the positioning result.
17. The workpiece rotation system according to claim 16, wherein: Also includes: The moving device is configured to move the image acquisition device so that the distance between the image acquisition device and the workpiece remains unchanged.
18. A computer-readable storage medium, wherein: The computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the workpiece positioning method according to any one of claims 1 to 13 is implemented.
19. A computer program product, wherein: The computer program product stores computer instructions, and when the instructions are executed by a processor, the workpiece positioning method according to any one of claims 1 to 13 is implemented.
