[0058] Such as figure 1 As shown, figure 1 It is a schematic diagram of the vibration image of the galvanometer. It should be noted that the vibration image referred to in this application is the image produced by using the red, green, and blue light sources to emit parallel light beams that are mixed and incident to the galvanometer and output by the galvanometer to the photosensitive chip. It is a galvanometer detection. The commonly used test images will not be explained in detail.
[0059] The vibration image includes a plurality of basic vibration images 01, and the content of the entire vibration image is a repetition of the plurality of basic vibration images 01. The basic vibration image 01 includes four groups of thick vibration lines and thin vibration lines, which are vibration line one 011, vibration line two 012, vibration line three 013, and vibration line four 014.
[0060] Among them, 011 kinds of vibration lines include thick red vibrating line 11, thin red vibrating line 21, thick green vibrating line 12, thin green vibrating line 22, thick blue vibrating line 13, and thin blue vibrating line 23. The lines and the thin vibrating lines are parallel to each other.
[0061] The distributions of the thick vibrating lines and the thin vibrating lines in the similar vibration line 2 012, vibration line 3 013, and vibration line 4 014 are the same; the difference is that each of the vibration line 2 012 and vibration line 3 013 has the same thick vibration line and vibration The thick vibrating lines and the thin vibrating lines in the thin line and the vibrating line 011 are perpendicular to each other. The thick vibrating lines and the thin vibrating lines in the vibrating line 2 012 and the vibrating line 3 013 are distributed in the opposite way, while the vibrating line The left and right distribution patterns of the vibrating thick line and the vibrating thin line of one 011 and four 014 are opposite.
[0062] Take the vibration line 011 as an example. In theory, if the gain parameters and duration parameters of the galvanometer are set very appropriately, two thick red vibration lines 11 and one thin red vibration line 21 of the same kind should be in a Y-shaped distribution, and the red vibration is fine. The symmetry axis of line 21 and the two red vibrating thick lines 11 of the same color are on the same straight line, and the similar green and blue vibrating thicknesses and thin vibrating lines are also distributed in the same manner; and vibrating line two 012, vibration line three The thick and thin vibrating lines of various colors in 013 and vibrating line 4014 are also distributed in a similar manner.
[0063] Such as figure 2 As shown, figure 2 It is a schematic diagram of the vibration shift in the vibration image of the galvanometer. When the gain parameter and duration parameter of the galvanometer are not set properly, the thin vibration line 2 and the thick vibration line 1 will face each other in the direction perpendicular to the thin vibration line 2. Translation, that is to say, there is an offset between the line of the thin vibrating line 2 and the line of the symmetry axis of the thick vibrating line 1, and the more inappropriate the gain and duration parameters are set, the greater the offset.
[0064] At present, when setting the gain parameter and duration parameter of the galvanometer, only the vibration image is observed by the human eyes and the parameters of the galvanometer are repeatedly adjusted. This adjustment defense line is obviously inefficient and inaccurate.
[0065] For this reason, this application provides a technical solution for automatically realizing adjustment of vibration parameters based on image recognition, which greatly improves the efficiency and accuracy of adjustment, and is beneficial to the wide application of galvanometers.
[0066] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
[0067] Such as image 3 As shown, image 3 This is a schematic flowchart of a method for adjusting parameters of a galvanometer provided in an embodiment of this application, and the method may include
[0068] S11: Collect each vibration image corresponding to the galvanometer under the set multiple different parameter states.
[0069] The parameters of the galvanometer may include gain parameters and duration parameters.
[0070] Before adjusting the parameters of the galvanometer, you can build as Figure 4 The shown optical path structure enables the vibration image of the galvanometer to be projected onto the projection screen 6 through the projector 4, and then the vibration image on the projection screen 6 is captured by the camera 5.
[0071] S12: Obtain the offset value between the thick vibration line and the thin vibration line in each vibration image.
[0072] As mentioned before, combine figure 1 with figure 2 , When the gain parameters and duration parameters of the galvanometer are set very reasonable, in a group of thick vibrating lines 1 and thin vibrating lines 2, the thin vibrating lines 2 of the same color should be on the symmetry axis of the two vibrating thick lines 1. On the straight line.
[0073] Correspondingly, when the parameter setting is not appropriate, the offset value between the vibrating thick line 1 and the vibrating thin line 2 should be an offset value that satisfies the following conditions:
[0074] The first refers to the offset value between the thick vibrating line and the thin vibrating line in the same group, for example, the vibrating line 011 is the thick vibrating line 1 and the thin vibrating line 2 belonging to the same group;
[0075] Second, it should refer to the offset value between the thick vibrating line 1 and the thin vibrating line 2 of the same color.
[0076] Third, it should be the pixel distance between the thick vibrating line 1 and the thin vibrating line 2 in the direction perpendicular to the thin vibrating line 2, which is equivalent to the line between the line of symmetry of the thick vibrating line 1 and the line where the thin vibrating line 2 is located. Pixel distance.
[0077] Optionally, refer to figure 1 with figure 2 It can be seen that in the vibration image, the distribution between the thick vibration lines 1 and the thin vibration lines 2 of different groups is not completely the same. E.g figure 1 The vibration lines in the middle vibration line 011 and the vibration line two 012 are perpendicular to each other. Therefore, in order to obtain the offset value between the thick vibration line 1 and the thin vibration line 2 to better reflect the imaging situation of the overall vibration image, when the offset value is obtained, two thick vibration lines 1 perpendicular to each other are also obtained. Offset value between and vibrating thin line 2. Such as figure 2 As shown, the first offset value can be figure 2 In L1, the second offset value can be L2.
[0078] Further, as figure 2 As shown, each group of thick vibrating lines 1 and thin vibrating lines 2 includes thick red vibrating lines 11 and thin red vibrating lines 21, thick green vibrating lines 12 and thin green vibrating lines 22, thick blue vibrating lines 13 and blue vibrating lines. 细线23. The offset value is two sets of thick vibration lines 1 and thin vibration lines 2 perpendicular to each other. In the actual calculation of the offset value, the offset value can be calculated for each color of the vibrating thick line 1 and the vibrating thin line 2. Accordingly, each group of vibrating thick line 1 and vibrating thin line 2 includes three colors, There are 3 offset values, and the two sets of vertical vibrating thick lines 1 and vibrating thin lines 2 include 6 offset values, and the final offset value can be the sum of the 6 offset values.
[0079] S13: Select the gain parameter and the duration parameter corresponding to the smallest offset value among the various offset values as the parameters of the galvanometer, and adjust the parameters of the galvanometer.
[0080] As mentioned above, when the parameter setting of the galvanometer is more appropriate, the relative offset between the vibrating thick line 1 and the vibrating thin line 2 is smaller. Therefore, the gain parameter and duration parameter corresponding to the minimum offset value are the vibration parameters. The parameters of the mirror can ensure the working performance of the galvanometer to a certain extent.
[0081] Further, considering that in the actual detection process, the first offset value L1 may be 0, while the second offset value L2 is relatively large, and the sum of the two is the smallest among the offset values corresponding to multiple different parameters, In this case, the parameter corresponding to the minimum offset value is not available.
[0082] For this reason, when selecting the minimum offset value, the offset value should also meet the condition that the first offset value L1 and the second offset value L2 are not too large, for example, it can be not greater than a certain threshold, It can also be no more than two-thirds of the offset value, etc., which can be set according to actual conditions, and there is no specific limitation in this application.
[0083] To sum up, in this application, the relationship between the relative positional relationship between the distribution of the thick vibrating line and the thin vibrating line in the vibration image of the galvanometer and the relationship between the gain parameter and the duration parameter of the vibration are used to perform multiple times on the parameters of the galvanometer. Adjust, and determine the most suitable galvanometer parameters according to the corresponding offset values under different parameters, which improves the accuracy of the gain parameters and duration parameters of the galvanometer to a certain extent, thereby improving the performance of the galvanometer.
[0084] The process of determining the first offset value and the second offset value of the thick vibrating line and the thin vibrating line in the foregoing embodiment will be described in detail below with a specific embodiment.
[0085] Such as Figure 5 As shown, Figure 5 This is a schematic diagram of the flow of determining the first offset value and the second offset value provided in this embodiment of the application, and the process may include:
[0086] S21: Identify the white point pixel coordinate value of the white point in the vibration image and obtain the standard white point pixel coordinate value of the white point in the standard vibration image.
[0087] Among them, each group of thick vibrating lines and thin vibrating lines of the standard vibration image is distributed in a horizontal direction and a vertical direction.
[0088] Such as figure 1 As shown, in addition to the thick vibrating line 1 and the thin vibrating line 2, the vibration image also includes a white dot 3, and the white dot 3 is located at the end of the thick vibrating line away from the thin vibrating line 2. There is a white dot 3 at the end of the thick line 1.
[0089] In addition, in order to be able to identify the white point 3 in the vibration image more clearly, the vibration image can be converted into a grayscale image, and then the grayscale image can be binarized to obtain a binarized vibration image; The binarized vibration image finds the contours of all white points 3 by looking for contours, and uses the contour centroid as the pixel coordinate value of the white point 3.
[0090] Because the vibrating thick line 1 and the vibrating thin line 2 in the vibrating image are darker in the vibrating image, after converting the vibrating image to a gray-scale image and performing the binarization process, the obtained binarized vibrating image only shows white Point 3 is conducive to the identification of white point 3; and when determining the position of white point 3, only the pixel coordinates of the white point's centroid are used to represent the pixel coordinates of white point 3, which simplifies the complexity of subsequent homography matrix operations.
[0091] S22: Obtain a homography matrix between the vibration image and the standard vibration image according to the white point pixel coordinate value and the standard white point pixel coordinate value.
[0092] It is understandable that to determine the homography matrix based on the white point pixel coordinate value and the standard white point pixel coordinate value, it is necessary to find a one-to-one correspondence between the white point 3 in the vibration image and the white point in the standard vibration image.
[0093] For this reason, in this embodiment, when determining the white points for the homography matrix operation in the vibration image, each white point is identified, which may specifically include:
[0094] According to the pixel coordinate values of each white point, identify a central white point and three adjacent white points that meet the preset conditions in the vibration image, where the preset conditions are the central white point and three adjacent white points. The adjacent white dots are connected respectively, and the angle between the three line segments formed is 105 o , 145 o , 110 o.
[0095] The homography matrix is obtained by the pixel coordinate values of a central white point and three adjacent white points, and the standard white point coordinate values of the four white points that meet the preset conditions in the standard vibration image.
[0096] Such as figure 1 Said, two groups of the two groups of thick vibration lines 1 and thin vibration lines 2 vertically distributed in the vibration image have white spots at the end of the thick vibration line 1, and a set of thick vibration lines 1 and 1 perpendicular to the group There is no white spot 3 at the end of the thick vibrating line 1 in the thin vibrating line 2. In addition, the two sets of horizontally distributed thick vibrating lines 1 and 2 are a set of thick vibrating lines 1 with two white spots 3 at the end. The other group of thick vibrating lines 1 has only one white dot 3 at the end. In this embodiment, each white point 3 is identified based on this characteristic.
[0097] reference Image 6 , Image 6 for figure 1 The schematic diagram of the local white point distribution in the vibration image is shown. In this embodiment, the most edge of the three white points 3 at the end of the thick vibration line 1 in the vertical direction is used as the center white point 31, which is closest to it. The three white dots 3 are adjacent white dots 32. In this way, the angles of the three line segments formed by connecting a central white dot 31 and three adjacent white dots 32 respectively are 105 degrees, 145 degrees, and 110 degrees, and there is no other positional relationship and a central white dot in the vibration image. The positional relationship between the white dots 31 and the three adjacent white dots 32 is different, and the white dots 3 with the same angle are formed. Therefore, in this embodiment, the white dots 3 are sequentially identified as the basis.
[0098] Of course, it is understandable that the angles of the three line segments formed by connecting a central white dot 31 and three adjacent white dots 32 respectively may have errors when calculating based on the white dot pixel coordinate values. As long as the error is within the allowable range, It is considered to be white point 3 that satisfies the condition.
[0099] In the actual application process, there may also be a variety of other identification methods, for example, three white dots 3 on the same horizontal line, white dots 3 on the same vertical line, etc., are identified. For this, in this application No specific restrictions.
[0100] S23: Perform coordinate transformation on the vibration image according to the homography matrix to obtain a transformed vibration image.
[0101] S24: Determine the offset value according to the pixel coordinate values of the thick vibration line and the thin vibration line in the transformed vibration image.
[0102] figure 1 with figure 2 In the vibration image shown in Figure 1, the thick vibrating lines 1 and the thin vibrating lines 2 are distributed in the horizontal direction or in the vertical direction. However, the vibration images actually collected by camera 5 are not necessarily figure 1 When shooting at the angle shown, the thick vibration line 1 and the thin vibration line 2 in the finally obtained vibration image may not be vertical. This means that the determination of the thick vibration line 1, the thin vibration line 2 and the offset value in the vibration image It's difficult.
[0103] To this end, in this embodiment, the pixel coordinate values of each known vibrating thick line 1, vibrating thin line 2, white dot 3, etc., and the vibrating thick line 1 and vibrating thin line 2 are all distributed in the horizontal and vertical directions. Standard vibration image as a reference, for example, figure 1 It is a partial image of the standard vibration image. The vibration image collected by the camera is converted, so that the distribution of the thick vibration line 1 and the thin vibration line 2 in the converted image is the same as that in the standard vibration image, then the thick vibration line 1 and the fine vibration line 2 are both horizontally and vertically distributed. When the first offset value L1 and the second offset value L2 of the thick vibration line 1 and the thin vibration line 2 are obtained, the vibration in the horizontal direction is coarse For line 1 and vibrating thin line 2, just compare the pixel ordinate values of the center pixel point of the two vibrating thick lines 1 and the center pixel point of vibrating thin line 2 to obtain the offset value; similarly, the vertical vibrating thick line 1 and vibrating thin line 2, as long as the pixel ordinate values of the center pixel point of two vibrating thick line 1 and the center pixel point of vibrating thin line 2 are compared, the offset value can be obtained.
[0104] As mentioned above, the vibration image contains multiple repeated basic image units 01, in order to simplify the difficulty of identifying a single group of thick and thin vibration lines in the converted image. Optionally, the unit vibration image in the transformed vibration image can be identified according to the area range of the standard unit vibration image in the standard vibration image.
[0105] Among them, such as figure 1 with figure 2 As shown, the unit vibration image 02 includes a set of thick horizontal vibration lines 1 and thin vibration lines 2 and a set of thick vertical vibration lines 1 and thin vibration lines 2;
[0106] It is difficult to identify and search for a unit vibration image 02 from a vibration image containing multiple repeated basic image units 01. However, in this embodiment, because the vibration image is converted into a format consistent with the standard vibration image, the position range of the unit vibration image 02 in the standard vibration image and the vibration image is similar. Therefore, the vibration image can be easily divided. The unit vibration image 02 simplifies the difficulty of dividing and identifying the unit vibration image 02.
[0107] After the unit vibration image 02 is identified, the center offset value of the horizontal vibration thick line and the vibration thin line can be collected as the first offset value L1, and the center offset of the vertical vibration thick line and the vibration thin line can be collected The shift value is the second shift value L2, and the sum of the first shift value L1 and the second shift value L2 is the final shift value.
[0108] In this embodiment, the pixel coordinate values of the thick vibrating line 1, the thin vibrating line 2, and the white point 3 are known, and the thick vibrating line 1 and the thin vibrating line 2 are standard vibration images distributed in the horizontal and vertical directions as Standard, convert the vibration image of the galvanometer into a form consistent with the standard vibration image, simplify the difficulty of dividing the unit vibration image 02 and the difficulty of calculating the first offset value L1 and the second offset value L2, thus to a large extent The above simplifies the implementation difficulty of this application.
[0109] Based on the above embodiment, in another embodiment of the present application, such as Figure 7 As shown, Figure 7 This is a schematic diagram of the process of obtaining multiple offset values provided by the embodiments of the present application. Regarding the above-mentioned adjustment of the gain parameter and duration parameter of the galvanometer, the process of collecting the vibration image of the galvanometer is repeated to obtain multiple offset values. , Can include:
[0110] S31: Keep the duration parameter unchanged and increase the gain parameter to obtain the offset value corresponding to the increased gain parameter;
[0111] S32: Judge whether the offset value corresponding to the current gain parameter is less than the offset value obtained last time, if yes, go to S33, if not, go to step S35;
[0112] Of course, it is also possible to reduce the gain parameter first, and it can be set based on experience in actual operation, which is not specifically limited in this application.
[0113] S33: Increase the current gain parameter and obtain the corresponding offset value;
[0114] S34: Determine whether the offset value corresponding to the current gain parameter is greater than the offset value obtained last time, if yes, go to S37, if not, go to S33;
[0115] S35: Reduce the current gain parameter and obtain the corresponding offset value;
[0116] S36: Determine whether the offset value corresponding to the current gain parameter is greater than the offset value obtained last time, if yes, go to S35, if not, go to S37;
[0117] S37: Keep the gain parameter of the galvanometer at the minimum offset value when the corresponding gain parameter remains unchanged, increase the duration parameter and obtain the offset value corresponding to the increased duration parameter;
[0118] S38: Determine whether the offset value corresponding to the current duration parameter is less than the offset value obtained last time, if yes, go to S39, if not, go to step S311;
[0119] S39: Increase the current duration parameter and obtain the corresponding offset value;
[0120] S310: Determine whether the offset value corresponding to the current duration parameter is greater than the offset value obtained last time, if yes, end, if not, proceed to S39;
[0121] S311: Decrease the current duration parameter and obtain a corresponding offset value;
[0122] S312: Determine whether the offset value corresponding to the current duration parameter is greater than the offset value obtained last time; if yes, end; if not, proceed to S311.
[0123] As mentioned above, the offset value is the smallest when the parameter setting of the galvanometer is most appropriate. Then when the gain parameter and the duration parameter change from suitable to inappropriate, the offset value must first decrease and then increase. In this embodiment According to this principle, the gain parameter and duration parameter are gradually adjusted, and finally the gain parameter and duration parameter with the smallest offset value are obtained.
[0124] It is understandable that when performing parameter adjustment, there is no inevitable order of adjusting the gain parameter or the duration parameter first. In this embodiment, the gain parameter is adjusted first as an example for illustration.
[0125] In addition, each time the gain parameter and the duration parameter increase or decrease the step length can be set to be consistent, to simplify the adjustment process, of course, in order to improve the accuracy of the determined gain parameter and duration parameter, you can determine the minimum deviation Set a smaller step size near the gain parameter and duration parameter corresponding to the shift value.
[0126] The parameter adjustment device of the galvanometer provided by the embodiment of the present invention will be introduced below. The parameter adjustment device of the galvanometer described below and the parameter adjustment method of the galvanometer described above can be referred to each other.
[0127] Figure 8 This is a structural block diagram of a device for adjusting parameters of a galvanometer provided by an embodiment of the present invention, refer to Figure 8 The parameter adjustment device of the galvanometer may include:
[0128] The data collection module 100 is used to collect the vibration image of the galvanometer;
[0129] The offset value module 200 is configured to obtain the offset value between the thick vibration line and the thin vibration line in each of the vibration images;
[0130] The parameter determination module 300 is configured to select the gain parameter and the duration parameter corresponding to the smallest offset value among the offset values as the parameters of the galvanometer, and adjust the parameters of the galvanometer.
[0131] The parameter adjustment device of the galvanometer in this embodiment is used to implement the aforementioned parameter adjustment method of the galvanometer. Therefore, the specific implementation of the parameter adjustment device of the galvanometer can be seen in the previous embodiment of the parameter adjustment method of the galvanometer, for example, , The data acquisition module 100, the offset value module 200, and the parameter determination module 300 are respectively used to implement steps S11 to S13 in the above-mentioned galvanometer parameter adjustment method. Therefore, the specific implementation can refer to the description of the respective parts of the embodiment. I will not repeat them here.
[0132] This application also provides an embodiment of a device for adjusting parameters of a galvanometer. The device may include a projector 4, a projection screen 6, a camera 5, and a processor;
[0133] The projector 4 is used to project the image generated by the vibration of the galvanometer to the projection screen 6;
[0134] The camera 5 is used to shoot an image on the projection screen 6 to obtain a vibration image;
[0135] The processor is configured to execute the steps of the method for adjusting parameters of the galvanometer described in any one of the above according to the vibration image.
[0136] Such as Figure 4 As shown, this embodiment provides a device for adjusting the parameters of the galvanometer. After the vibration image generated by the galvanometer is projected onto the projection screen 6 through the projector 4, the vibration image is captured by the camera 5, and the processor is based on the vibration in the vibration image. The offset value between the thick line and the vibrating thin line changes with the gain parameter and duration parameter of the galvanometer, and finally the most suitable gain parameter and duration parameter are obtained. The adjustment efficiency is too high and the adjustment result is accurate.
[0137] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply one of these entities or operations. There is any such actual relationship or order between. Moreover, the terms "including", "including" or any other variations thereof are intended to cover non-exclusive inclusions, so as to include elements inherent in a process, method, article, or equipment of a series of elements. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other same elements in the process, method, article, or equipment including the element. In addition, the parts of the foregoing technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail, so as to avoid redundant description.
[0138] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method part.