Angle correction method and device for detection device and computer-readable storage medium
By acquiring and processing images in the detection equipment, determining the position of the light spot and adjusting the bearing device, the problem of being unable to accurately detect the angle of the bearing device in the existing technology is solved, and the detection precision and accuracy are improved.
Patent Information
- Application Number
- CN202110744342.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-30
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-06-30
AI Technical Summary
Existing detection equipment cannot accurately detect the angle change of the carrying device, resulting in abnormal detection results and reducing detection precision and accuracy.
By acquiring the detection image of the camera, the position of the light spot is determined, and the carrying device is adjusted according to the position of the light spot to move the detection light spot to a preset position, thereby correcting the angle of the carrying device. The method includes image processing, establishing a plane coordinate system, determining light spot profile information and adjusting the pitch and swing angles of the carrying device.
Accurately detect and correct the angular error of the carrying device, improving the angular accuracy of the detection equipment and ensuring the accuracy of the detection results.
Smart Images

Figure CN113379837B
Abstract
Description
Technical Field
[0001] The present application relates to the field of detection technology, and in particular to an angle correction method, device and computer-readable storage medium for a detection device. Background Art
[0002] In the detection equipment, a carrying device is usually used to carry the test piece, and the test piece on the carrying device is detected by the detection module. During the detection process, the position accuracy and angle accuracy of the carrying device directly affect the detection accuracy of the detection module. After calibrating the position of the carrying device, the deflection or pitch of the carrying device needs to be calibrated. In the prior art, there is no method that can detect the angle change of the carrying device. Therefore, when there is an angle error in the setting angle of the carrying device, it will cause abnormal detection results of the detection equipment, reducing the detection precision and accuracy of the detection equipment. Summary of the invention
[0003] Embodiments of the present application provide an angle correction method, device, and computer-readable storage medium.
[0004] In a first aspect, an embodiment of the present application provides an angle correction method, which is applied to a detection device, wherein the detection device includes a light source, a carrying device, and a camera, and the correction method includes:
[0005] Acquire a detection image of the camera;
[0006] Determining the light spot position on the detection image;
[0007] Determining an adjustment method of the carrying device according to the position of the light spot;
[0008] The carrying device is adjusted according to the adjustment method so that the detection light spot moves to a preset position.
[0009] Optionally, obtaining the light spot position on the detection image includes:
[0010] Performing image processing on the detection image;
[0011] Determining the contour information of the detection spot according to the detection image after image processing;
[0012] The light spot position is determined according to the contour information.
[0013] Optionally, performing image processing on the detection image includes:
[0014] According to the pixel value of the detection image, grayscale processing is performed on the detection image;
[0015] The detection image after grayscale processing is binarized.
[0016] Optionally, the light spot position includes first coordinate information and second coordinate information, the first coordinate information is used to indicate the position of the detection light spot along a first direction, and the second coordinate information is used to indicate the position of the detection light spot along a second direction, and determining the adjustment method of the carrying device according to the light spot position includes:
[0017] Determine a pitch angle of the carrying device along a first direction according to the first coordinate information;
[0018] The swing angle of the carrying device along the second direction is determined according to the second coordinate information.
[0019] Optionally, a plane coordinate system is established according to the detection image, wherein the plane coordinate system includes an X-axis along a first direction and a Y-axis along a second direction;
[0020] Determining the center position of the detection light spot according to the contour information of the detection light spot;
[0021] Determine first coordinate information of the center position along a first direction and second coordinate information along a second direction on the detection image.
[0022] Optionally, the above also includes,
[0023] The positions of the carrying device and the detection component are adjusted by the second moving component so that the carrying device is located at the focusing position of the focusing element.
[0024] Optionally, the method further comprises:
[0025] Adjusting the distance between the carrying device and the detection component by the second moving component, and obtaining the displacement distance of the light spot on the detection image after adjustment;
[0026] When the displacement distance is greater than the preset distance, a first prompt message is output, and after the carrying device is restored to the initial position, the angle of the carrying device is continuously adjusted;
[0027] When the unique distance is equal to the preset distance, a second prompt message is output.
[0028] Optionally, determining a first corresponding relationship between a pitch angle of the carrying device and a position change of the detection light spot along a first direction;
[0029] Determine a second corresponding relationship between the swing angle of the carrying device and the position change of the detection light spot along the second direction on the detection image;
[0030] An adjustment method of the carrying device is determined according to the light spot position, the first corresponding relationship, and the second corresponding relationship.
[0031] In a second aspect, an embodiment of the present application provides an angle correction device, comprising a processor, a memory, a transceiver, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the method described in any one of claims 1-5.
[0032] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute a method as described in any one of claims 1-5.
[0033] It can be seen that in one embodiment of the present embodiment, the angle correction method is applied to a detection device. The detection device includes a light source, a carrying device, an adjustment component and a camera. The adjustment component is connected to the carrying device, and the carrying device is connected to the adjustment component. The adjustment component is used to adjust the height and pitch or yaw angle of the carrying device. The light emitted by the light source irradiates the workpiece and is reflected by the workpiece to penetrate the camera. The detection device obtains the detection image of the camera; and determines the position of the light spot on the detection image; then determines the adjustment method of the carrying device according to the light spot position; finally, the carrying device is adjusted according to the adjustment method to move the detection light spot to a preset position. The angle error of the carrying device is determined by detecting the light spot position in the detection image, and the carrying device is adjusted in a manner that the light spot position corresponds to the angle of the carrying device, and the angle of the carrying device is corrected, thereby solving the problem that the angle error of the carrying device cannot be accurately determined in the prior art, and improving the angle accuracy of the carrying device in the detection device. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 It is a flow chart of an angle correction method for a detection device provided in an embodiment of the present application;
[0036] Figure 2 is another schematic flow chart of an angle correction method for a detection device provided in an embodiment of the present application;
[0037] Figure 3 is a structural schematic diagram of an angle correction device provided in an embodiment of the present application;
[0038] Figure 4 is a structural schematic diagram of an angle correction device provided in an embodiment of the present application;
[0039] Figure 5 is a schematic diagram of an embodiment of detecting a light spot in an image provided by an embodiment of the present application;
[0040] Figure 6 is a schematic diagram of an embodiment of detecting a light spot in an image provided by an embodiment of the present application;
[0041] Figure 7 is a schematic diagram of an embodiment of detecting a light spot in an image provided by an embodiment of the present application;
[0042] Figure 8 is a schematic diagram of an embodiment of detecting a light spot in an image provided by an embodiment of the present application;
[0043] Fig. 9 It is a schematic diagram of an embodiment of detecting a light spot in an image provided by an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0045] The following are detailed descriptions of each.
[0046] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0047] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0048] See also Figures 1 to 9 , Figure 1 The present invention provides an angle correction method for a detection device, wherein the detection device includes a light source, a carrying device, an adjustment component, and a camera. The carrying device is used to carry a test piece, the carrying device is connected to the adjustment component, the adjustment component has multiple degrees of freedom, and the adjustment component is used to adjust the position and angle of the carrying device. The light emitted by the light source is reflected on the test piece of the carrying device and transmitted to the camera. The angle correction method includes:
[0049] Step 10, obtaining a detection image of the camera;
[0050] In order to facilitate the determination of the position of the light spot through the camera, the light source is set to a laser light source, and the detection image formed on the camera by the light emitted by the laser light source is an approximately circular light spot, thereby facilitating the determination of the position of the light spot on the detection image according to the shape of the light spot.
[0051] Among them, when the supporting device does not have a pitch angle or yaw angle error, and the supporting device is located at the focusing position of the detection equipment, the light spot in the detection image captured by the camera is located at a preset position of the detection image. Specifically, the preset position can be any position on the detection image. In a preferred embodiment, the preset position is the center position of the detection image.
[0052] When the supporting device has a pitch angle error, the light spot in the detection image is located at a position above or below the preset position in the detection image; when the supporting device has a yaw angle error, the light spot in the detection image is located at a region to the left or right of the preset position in the detection image. Therefore, the pitch angle error and yaw angle error of the supporting device can be judged according to the position of the light spot in the detection image. Specifically, the pitch angle is used to indicate the angle of rotation along the X-axis, and the yaw angle is used to indicate the angle of rotation along the Y-axis.
[0053] Step 20, determining the light spot position on the detection image;
[0054] The light spot position is used to indicate the position of the light spot in the detection image. Specifically, in order to determine the light spot position on the detection image, a coordinate system may be established on the detection image, and the light spot position may be indicated by coordinates, and the light spot position may be (4, 5), (5, 9) or other positions.
[0055] Wherein, obtaining the light spot position on the detection image includes:
[0056] Step 21, performing image processing on the detection image;
[0057] Among them, image processing is used to indicate processing the detection image, so as to convert the detection image into one of a binary image, a grayscale image, an indexed image and a true color RGB image. Specifically, in order to facilitate the determination of the position of the light spot on the detection image, the detection image may be preferentially processed, so as to facilitate the determination of the light spot contour in the detection image. Specifically, the image processing may be grayscale processing or binary processing.
[0058] Wherein, performing image processing on the detection image includes:
[0059] According to the pixel value of the detection image, grayscale processing is performed on the detection image;
[0060] Among them, when performing grayscale processing on the detection image, the RGB components of each pixel on the detection image can be first obtained, and each pixel can be processed according to the formula G(x, y)=R(x, y)*0.299+G(x, y)*0.587+B(x, y)*0.114, wherein G(x, y) is the grayscale value of the pixel corresponding to the (x, y) position, R(x, y) is the red component of the pixel, G(x, y) is the green component of the pixel, and B(x, y) is the blue component of the pixel.
[0061] Specifically, after acquiring the detection image, the detection image is converted into a grayscale image, and the grayscale value of each pixel in the detection image is acquired. When the grayscale value of the pixel is greater than a preset grayscale value, the pixel is determined to be a light spot pixel; when the grayscale value of the pixel is less than the preset grayscale value, the pixel is determined to be a background pixel.
[0062] Among them, after the detection image is grayscale processed, in order to further determine the light spot pixel points and the background pixel points, the detection image after grayscale processing can be binarized to improve the determination of the light spot pixel points and the background pixel points. Specifically, in order to avoid errors in individual pixel points in the detection image due to dirt, the noise points in the detection image can be first processed by the XX algorithm. Specifically, the grayscale gradient of each pixel point in the detection image and the grayscale gradient of the adjacent pixel points around the pixel point are obtained. When the difference between the grayscale gradient direction of the pixel point and the grayscale gradient direction of more than two adjacent pixel points around the pixel point is less than a preset difference, it indicates that the point is a normal pixel point. When the difference between the grayscale gradient direction of the pixel point and the grayscale gradient direction of more than two adjacent pixel points around the pixel point is greater than or equal to the preset difference, it indicates that the point is a noise point.
[0063] The detection image after grayscale processing is binarized.
[0064] Among them, when the detection image is binarized, the brightness or grayscale value of each pixel on the detection image can be first obtained. When the brightness of a pixel is greater than or equal to the preset brightness or the grayscale value is greater than the preset grayscale, the brightness value or grayscale value of the pixel is adjusted to the maximum value. When the brightness value of the pixel is less than the preset brightness or the grayscale value is less than the preset grayscale, the brightness value of the pixel is adjusted to the minimum value. Specifically, when the grayscale value range is 0-255, after the detection image is binarized, the brightness value of the pixel is 0 or 255. The pixel with a brightness value of 0 is the background pixel, and the pixel with a brightness value of 255 is the light spot pixel.
[0065] Step 22, determining the contour information of the detection spot according to the detection image after image processing;
[0066] Among them, after determining the light spot pixel points and the background pixel points, the contour information of the light spot in the detection image is determined according to the light spot pixel points. Specifically, since the light spot is circular, the contour of the light spot is fitted according to the position information of each of the light spot pixel points, and the fitted light spot contour is the contour information of the light spot in the detection image.
[0067] Step 23, establishing a coordinate system according to the detection image, wherein the coordinate system includes an X-axis along the first direction and a Y-axis along the second direction;
[0068] Among them, in order to facilitate the determination of the position of the light spot on the detection image, so as to determine the position of the light spot in the detection image according to the coordinate system, a rectangular coordinate system can be established on the detection image, and the rectangular coordinate system includes an X-axis and a Y-axis that are perpendicular to each other. Due to the specific position of the light spot in the detection image, the position of the light spot on the detection image can be represented by the coordinate system on the detection image. Specifically, the first direction is parallel to the direction of the X-axis, and the second direction is parallel to the direction of the Y-axis.
[0069] Step 24: determine the light spot position according to the coordinate system and the contour information.
[0070] Wherein, determining the light spot position according to the coordinate system and the contour information includes:
[0071] Determining the center position of the light spot according to the contour information of the light spot;
[0072] The light spot position is a preset position of the light spot, and preferably, the position information of the light spot is identified by the center position of the light spot. In a specific implementation, after determining the position information of each light spot pixel point in the light spot pixel point set, shape fitting is performed according to the distribution of the light spot pixel points. Specifically, since the shape of the calibration point of the calibration sheet is a circle, when performing shape fitting, a circle is preferably selected as the fitting contour, and therefore the center of the fitting contour is determined to be the center position of the light spot.
[0073] A first coordinate of the center position along a first direction and a second coordinate of the center position along a second direction in the coordinate system are determined.
[0074] Among them, after determining the center position of the light spot, in order to facilitate the determination of the position of the light spot in the detection image, it can be represented by the coordinates along the X-axis and the Y-axis in the coordinate system. Specifically, the first coordinate is used to represent the position of the light spot along the first direction, and the second coordinate is used to represent the position of the light spot along the second direction.
[0075] In a specific embodiment, Figure 5 As shown, the coordinate position of the light spot in the coordinate system corresponding to the detection image is (4, 5). In another specific implementation, as shown in FIG. Figure 6 As shown, the coordinate position of the light spot in the coordinate system corresponding to the detection image is (-6, -2). In another specific implementation, as shown in FIG. Figure 7 As shown, the coordinate position of the light spot in the coordinate system corresponding to the detection image is (-1, 1. In another specific embodiment, as shown in FIG. Figure 8As shown, the coordinate position of the light spot in the coordinate system corresponding to the detection image is (0, 4). In another specific implementation, as shown in FIG. Fig. 9 As shown, the coordinate position of the light spot in the coordinate system corresponding to the detection image is (4, 0).
[0076] In a specific embodiment, the preset position on the detection image is the center position of the detection image, the center position of the detection image is the origin of the coordinate system, and the first direction is set as the X-axis, the second direction is set as the Y-axis, and the first direction and the second direction are perpendicular to each other, so that the X-axis and the Y-axis are perpendicular. When the light spot on the detection image is located at the origin of the coordinate system, it indicates that the supporting device is located at a preset height and there is no error in the pitch or yaw direction. When the light spot in the detection image is not located at the origin of the coordinate system, it indicates that there is an error in the pitch or yaw direction of the supporting device, and the angle of the supporting device needs to be adjusted by the adjustment component.
[0077] Step 30: determining an adjustment method of the carrying device according to the light spot position.
[0078] Wherein, the adjustment method includes deflecting the carrying device along the X-axis or the Y-axis.
[0079] Among them, when the carrying device has an error in the pitch or yaw direction, in order to adjust the light spot position to the preset position, it is necessary to adjust according to the light spot position. Specifically, the carrying device is adjusted by the adjustment component, and the adjustment component is used to drive the carrying device to deflect along the X-axis or Y-axis. In a specific embodiment, when the light spot position is represented by coordinates, since the x-axis in the coordinate system is parallel to the first direction and the Y-axis is parallel to the second direction, it can be understood that the position of the light spot along the X-axis in the detection image can be changed by adjusting the yaw angle of the carrying device, and the position of the light spot along the Y-axis in the detection image can be changed by adjusting the pitch angle of the carrying device, so that the light spot position in the detection image is moved to the preset position (i.e., the center position) of the detection image.
[0080] In an optional implementation, a rectangular coordinate system is established on the detection image, and then the position of the light spot on the detection image is represented by coordinates. Specifically, the light spot position includes a first coordinate and a second coordinate, the first coordinate is used to represent the position of the detection light spot along a first direction, and the second coordinate is used to represent the position of the light spot along a second direction. Specifically, determining the adjustment method of the carrying device according to the light spot position includes:
[0081] Determine a pitch angle of the carrying device along a first direction according to the first coordinate;
[0082] The swing angle of the carrying device along the second direction is determined according to the second coordinate.
[0083] Among them, when the carrying device has an angular error along the X-axis as the center axis, the light spot reflected on the camera by the piece to be tested on the carrying device will move along the first direction of the coordinate system, so that the position of the light spot in the X-axis direction in the detection image can be adjusted by adjusting the carrying device to rotate along the X-axis direction; when the carrying device has an angular error along the Y-axis as the center axis, the light spot reflected on the camera by the piece to be tested on the carrying device will move along the second direction of the coordinate system, so that the position of the light spot in the Y-axis direction in the detection image can be adjusted by adjusting the carrying device to rotate along the Y-axis direction.
[0084] Wherein, determining the adjustment method of the carrying device according to the light spot position further includes:
[0085] Determine a first corresponding relationship between the pitch angle of the carrying device and the position change of the detection light spot along the first direction;
[0086] Determine a second corresponding relationship between the swing angle of the carrying device and the position change of the detection light spot along the second direction on the detection image;
[0087] Among them, when establishing the coordinate system, in order to determine the relationship between the pitch angle of the carrying device and the position change of the detection light spot, in one embodiment, it can be determined by actual adjustment. For example, when the x-axis of the coordinate system on the detection image is not parallel to the yaw direction of the carrying device, when the carrying device yaws in the left and right directions, the light spot moves not only along the first direction, but also along the second direction. Similarly, it can be understood that when the y-axis of the coordinate system on the detection image is not parallel to the pitch direction of the carrying device, when the carrying device yaws in the up and down directions, the light spot moves not only along the first direction, but also along the second direction.
[0088] In a preferred embodiment, in order to facilitate determination of the correspondence between the coordinate system and the coordinate position on the detection image and the angle adjustment of the carrying device, since the pitch direction and the yaw direction are perpendicular to each other when the carrying device is moving at a pitch angle or a yaw angle, the x-axis direction is made the same as the yaw direction, and the y-axis direction is made the same as the pitch direction, so that when the carrying device is adjusted in pitch, only the position of the light spot in the y-axis direction will change, and when the carrying device is adjusted in yaw, only the position of the light spot in the x-axis direction will change. Therefore, a first correspondence between the pitch angle of the carrying device and the position change of the detection light spot along the first direction, and a second correspondence between the yaw angle and the position change of the detection light spot along the second direction on the detection image can be quickly determined.
[0089] The step of determining the pitch angle of the carrying device along a first direction according to the first coordinate comprises:
[0090] Determine a pitch angle of the carrying device along a first direction according to the first coordinate and the first corresponding relationship;
[0091] Among them, after determining the first corresponding relationship, the adjustment angle of the pitch angle of the carrying device can be determined according to the first coordinate of the light spot. Specifically, when the first corresponding relationship is determined as: the first coordinate changes by 1, the pitch angle of the carrying device changes by 0.2 degrees, then when the first coordinate of the light spot is 4, the pitch angle of the carrying device needs to be adjusted by 0.8 degrees.
[0092] Determining the swing angle of the carrying device along the second direction according to the second coordinate includes:
[0093] According to the second coordinate and the second corresponding relationship, a deflection angle of the carrying device along the second direction is determined.
[0094] Among them, after determining the second corresponding relationship, the adjustment angle of the yaw angle of the supporting device can be determined according to the second coordinate of the light spot. Specifically, when the second corresponding relationship is determined as: the second coordinate changes by 1, the pitch angle of the supporting device changes by 0.3 degrees, then when the first coordinate of the light spot is 3, the yaw angle of the supporting device needs to be adjusted by 0.9 degrees.
[0095] Step 40: adjusting the carrying device according to the adjustment method so that the light spot of the detection image moves to a preset position.
[0096] Wherein, when determining the adjustment method of the carrying device, the carrying device can be adjusted by the adjustment component so that the detection light spot is located at a preset position. When the light spot in the detection image is located at the preset position, it means that the error of the carrying device in the pitch angle and yaw angle direction is eliminated or is less than the angle error required for detection.
[0097] In an optional implementation manner, the acquiring the detection image of the camera further includes:
[0098] The relative distance between the carrying device and the detection component is adjusted by the adjusting component so that the carrying device is located at the focusing position of the detection component.
[0099] Among them, when the carrying device is not located at the preset height of the detection component, the light emitted by the light source irradiates the workpiece of the carrying device. Since the workpiece is not located at the preset height, the light spot in the detection image transmitted to the camera after being reflected by the workpiece is not located at the preset position. When the workpiece is higher or lower than the preset height, the light spot moves along the first direction in the detection image. Only when the workpiece is located at the preset height, the light spot is at the center position of the detection image. Therefore, in order to avoid the carrying device not being at the focusing height, thereby affecting the position of the light spot in the detection image, when correcting the angle of the carrying device, it is necessary to first adjust the position of the carrying device so that the light emitted by the light source, after being reflected by the test piece on the carrying device, the light spot on the detection image captured by the camera is located at the preset position.
[0100] In an optional embodiment, the carrying device is adjusted according to the adjustment method to move the light spot to a preset position, and then the method further includes:
[0101] Adjusting the distance between the carrying device and the detection component by the adjustment component, and obtaining the displacement distance of the light spot on the detection image after adjustment;
[0102] When the displacement distance is greater than the preset distance, a first prompt message is output, and after the carrying device is restored to the initial position, the angle of the carrying device is continuously adjusted;
[0103] When the unique distance is equal to the preset distance, a second prompt message is output.
[0104] Among them, the adjustment component is connected to the carrying device, and the adjustment component is a mobile device with multiple degrees of freedom. In a preferred embodiment, the adjustment component has six degrees of freedom. The adjustment component can drive the carrying device to move along the height direction or adjust the pitch angle or yaw angle of the carrying device.
[0105] After the pitch angle and yaw angle of the carrying device are corrected, in order to detect the correction effect of the carrying device, the carrying device can be moved for detection. When the carrying device is adjusted along the height direction, the position of the light spot in the detection image moves along the first direction. Specifically, when the carrying device moves away from the detection component, the light spot moves downward along the first direction in the detection image, and when the carrying device moves toward the detection component, the light spot moves upward along the first direction in the detection image.
[0106] Specifically, when the carrying device does not have a pitch angle error and a yaw angle error, when the carrying device moves to one side by a preset height, the position of the light spot on the detection image moves relatively by a preset distance. When the carrying device has a pitch angle error and a yaw angle error, when the carrying device moves to one side by a preset height, the relative movement distance of the light spot on the detection image is greater than the preset distance. Therefore, when it is detected that the movement distance of the light spot is greater than the preset distance, it indicates that the carrying device at this time has an angle error. Therefore, when the carrying device needs to be moved to a preset height, the pitch angle and yaw angle of the carrying device need to be recalibrated.
[0107] See also Figure 3 , Figure 3 : is a structural schematic diagram of a detection device provided by an embodiment of the present application. As shown in the figure, the calibration device includes a stage and a calibration sheet. The stage is used to carry the calibration piece. The calibration piece includes multiple detection areas along a first direction, and each of the detection areas includes a dot matrix composed of multiple calibration points of the same size. The calibration device is applied to a detection component, and the detection component includes a light source, a detection lens and a camera. The detection lens is connected to the camera. The light emitted by the light source is reflected on the calibration piece and transmitted through the detection lens to the camera to form a detection image. The calibration device also includes a processor, a memory, a transceiver port and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the processor. The program includes instructions for executing the following steps:
[0108] Acquire a detection image of the camera;
[0109] Determining the light spot position on the detection image;
[0110] Determining an adjustment method of the carrying device according to the position of the light spot;
[0111] The carrying device is adjusted according to the adjustment method so that the detection light spot moves to a preset position.
[0112] In one implementation of the present application, in terms of obtaining the light spot position on the detection image, the above program includes instructions for executing the following steps:
[0113] Performing image processing on the detection image;
[0114] Determining the contour information of the detection spot according to the detection image after image processing;
[0115] Establishing a coordinate system according to the detection image, the coordinate system comprising an X-axis along a first direction and a Y-axis along a second direction;
[0116] The light spot position is determined according to the coordinate system and the contour information.
[0117] In one implementation of the present application, in terms of performing image processing on the detection image, the program includes instructions for executing the following steps:
[0118] According to the pixel value of the detection image, grayscale processing is performed on the detection image;
[0119] The detection image after grayscale processing is binarized.
[0120] In an implementation of the present application, in terms of determining the light spot position according to the coordinate system and the contour information, the program includes instructions for executing the following steps:
[0121] Determining the center position of the detection light spot according to the contour information of the detection light spot;
[0122] A first coordinate of the center position along a first direction and a second coordinate of the center position along a second direction in the coordinate system are determined.
[0123] In an implementation of the present application, in terms of determining the adjustment method of the carrying device according to the light spot position, the above program includes instructions specifically for executing the following steps:
[0124] Determine a pitch angle of the carrying device along a first direction according to the first coordinate;
[0125] The swing angle of the carrying device along the second direction is determined according to the second coordinate.
[0126] In an implementation of the present application, in terms of determining the adjustment method of the carrying device according to the light spot position, the above program includes instructions for executing the following steps:
[0127] Determine a first corresponding relationship between the pitch angle of the carrying device and the position change of the detection light spot along the first direction;
[0128] Determine a second corresponding relationship between the swing angle of the carrying device and the position change of the detection light spot along the second direction on the detection image;
[0129] The step of determining the pitch angle of the carrying device along a first direction according to the first coordinate comprises:
[0130] Determine a pitch angle of the carrying device along a first direction according to the first coordinate and the first corresponding relationship;
[0131] Determining the swing angle of the carrying device along the second direction according to the second coordinate includes:
[0132] According to the second coordinate and the second corresponding relationship, a deflection angle of the carrying device along the second direction is determined.
[0133] In one implementation of the present application, in terms of acquiring the detection image of the camera, the above program includes instructions for executing the following steps:
[0134] The positions of the carrying device and the detection component are adjusted by the second moving component so that the carrying device is located at the focusing position of the focusing element.
[0135] In an implementation of the present application, in terms of adjusting the carrying device according to the adjustment method to move the detection light spot to a preset position, the program includes instructions for executing the following steps:
[0136] Adjusting the distance between the carrying device and the detection component by the second moving component, and obtaining the displacement distance of the light spot on the detection image after adjustment;
[0137] When the displacement distance is greater than the preset distance, a first prompt message is output, and after the carrying device is restored to the initial position, the angle of the carrying device is continuously adjusted;
[0138] When the unique distance is equal to the preset distance, a second prompt message is output.
[0139] See also Figure 4 , Figure 4 An angle correction device provided in an embodiment of the present application is applied to an angle correction device, and the device includes:
[0140] An acquisition unit 410 is used to acquire a detection image of the camera;
[0141] A determination unit 420, configured to determine a light spot position on the detection image;
[0142] The determining unit 420 is further configured to determine an adjustment method of the carrying device according to the light spot position;
[0143] The correction unit 430 is used to adjust the carrying device according to the adjustment method so that the detection light spot moves to a preset position.
[0144] In an implementation of the present application, in terms of obtaining the light spot position on the detection image, the determination unit 420 is specifically used to:
[0145] Performing image processing on the detection image;
[0146] Determining the contour information of the detection spot according to the detection image after image processing;
[0147] Establishing a coordinate system according to the detection image, the coordinate system comprising an X-axis along a first direction and a Y-axis along a second direction;
[0148] The light spot position is determined according to the coordinate system and the contour information.
[0149] In an implementation of the present application, in terms of performing image processing on the detection image, the determination unit 420 is specifically used to:
[0150] According to the pixel value of the detection image, grayscale processing is performed on the detection image;
[0151] The detection image after grayscale processing is binarized.
[0152] In an implementation of the present application, in determining the light spot position according to the coordinate system and the contour information, the determining unit 420 is further configured to:
[0153] Determining the center position of the detection light spot according to the contour information of the detection light spot;
[0154] A first coordinate of the center position along a first direction and a second coordinate of the center position along a second direction in the coordinate system are determined.
[0155] In an implementation of the present application, in terms of determining the adjustment method of the carrying device according to the light spot position, the determining unit 420 is specifically used to:
[0156] Determine a pitch angle of the carrying device along a first direction according to the first coordinate;
[0157] The swing angle of the carrying device along the second direction is determined according to the second coordinate.
[0158] In an implementation of the present application, in determining the adjustment method of the carrying device according to the light spot position, the determining unit 420 is further used to:
[0159] Determine a first corresponding relationship between the pitch angle of the carrying device and the position change of the detection light spot along the first direction;
[0160] Determine a second corresponding relationship between the swing angle of the carrying device and the position change of the detection light spot along the second direction on the detection image;
[0161] The step of determining the pitch angle of the carrying device along a first direction according to the first coordinate comprises:
[0162] Determine a pitch angle of the carrying device along a first direction according to the first coordinate and the first corresponding relationship;
[0163] Determining the swing angle of the carrying device along the second direction according to the second coordinate includes:
[0164] According to the second coordinate and the second corresponding relationship, a deflection angle of the carrying device along the second direction is determined.
[0165] In an implementation of the present application, in terms of obtaining the detection image of the camera, the determination unit 420 is also used to:
[0166] The positions of the carrying device and the detection component are adjusted by the second moving component so that the carrying device is located at the focusing position of the focusing element.
[0167] In an implementation of the present application, in adjusting the carrying device according to the adjustment method to move the detection light spot to a preset position, the determining unit 420 is further used to:
[0168] Adjusting the distance between the carrying device and the detection component by the second moving component, and obtaining the displacement distance of the light spot on the detection image after adjustment;
[0169] When the displacement distance is greater than the preset distance, a first prompt message is output, and after the carrying device is restored to the initial position, the angle of the carrying device is continuously adjusted;
[0170] When the unique distance is equal to the preset distance, a second prompt message is output.
[0171] It should be noted that the determination unit 420 and the correction unit 430 may be implemented by a processor, and the acquisition unit 410 may be implemented by a transceiver.
[0172] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described by the service device in the above method embodiment.
[0173] The embodiment of the present application also provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described by the service device in the above method. The computer program product can be a software installation package.
[0174] The steps of the method or algorithm described in the embodiment of the present application can be implemented in a hardware manner, or can be implemented by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory (Random Access Memory, RAM), a flash memory, a read-only memory (Read Only Memory, ROM), an erasable programmable read-only memory (Erasable Programmable ROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), a register, a hard disk, a mobile hard disk, a read-only compact disk (CD-ROM) or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in an access network device, a target network device, or a core network device. Of course, the processor and the storage medium can also be present in an access network device, a target network device, or a core network device as discrete components.
[0175] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0176] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only the specific implementation method of the embodiments of the present application and is not intended to limit the protection scope of the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A method for angle correction of a detection device, characterized in that: The detection device includes a light source, a carrying device, an adjustment component and a camera, the adjustment component is connected to the carrying device, and the calibration method includes: Acquire a detection image of the camera; Determining the light spot position on the detection image; Determining an adjustment method of the carrying device according to the position of the light spot; The carrying device is adjusted according to the adjustment method so that the detection light spot moves to a preset position; The light spot position includes a first coordinate and a second coordinate, the first coordinate is used to represent the position of the detection light spot along a first direction, and the second coordinate is used to represent the position of the detection light spot along a second direction. The determining the adjustment method of the carrying device according to the light spot position includes: Determine a pitch angle of the carrying device along a first direction according to the first coordinate; Determining a swing angle of the carrying device along a second direction according to the second coordinate; The step of determining the adjustment method of the carrying device according to the light spot position further includes: Determine a first corresponding relationship between the pitch angle of the carrying device and the position change of the detection light spot along the first direction; Determine a second corresponding relationship between the swing angle of the carrying device and the position change of the detection light spot along the second direction on the detection image; The step of determining the pitch angle of the carrying device along a first direction according to the first coordinate comprises: Determine a pitch angle of the carrying device along a first direction according to the first coordinate and the first corresponding relationship; The step of determining the swing angle of the carrying device along the second direction according to the second coordinate comprises: According to the second coordinate and the second corresponding relationship, a deflection angle of the carrying device along the second direction is determined.
2. The angle correction method according to claim 1, characterized in that: The step of obtaining the light spot position on the detection image comprises: Performing image processing on the detection image; Determining the contour information of the detection spot according to the detection image after image processing; Establishing a coordinate system according to the detection image, the coordinate system comprising an X-axis along a first direction and a Y-axis along a second direction; The light spot position is determined according to the coordinate system and the contour information.
3. The angle correction method according to claim 2, characterized in that: The performing image processing on the detection image comprises: According to the pixel value of the detection image, grayscale processing is performed on the detection image; The detection image after grayscale processing is binarized.
4. The angle correction method according to claim 2, characterized in that: The step of determining the light spot position according to the coordinate system and the contour information includes: Determining the center position of the detection light spot according to the contour information of the detection light spot; A first coordinate of the center position along a first direction and a second coordinate of the center position along a second direction in the coordinate system are determined.
5. The angle correction method according to claim 1, characterized in that: The step of acquiring the detection image of the camera also includes: The positions of the carrying device and the detection assembly are adjusted so that the carrying device is located at the focusing position of the detection equipment.
6. The angle correction method according to claim 1, characterized in that: The carrying device is adjusted according to the adjustment method so that the detection light spot moves to a preset position, and then the method further includes: Adjusting the distance between the carrying device and the detection component, and obtaining the displacement distance of the light spot on the detection image after adjustment; When the displacement distance is greater than the preset distance, a first prompt message is output, and the carrying device is restored to the initial position, and the angle of the carrying device is continued to be adjusted; When the displacement distance is equal to the preset distance, a second prompt message is output.
7. An angle correction device, characterized in that: The method comprises a processor, a memory, a transceiver, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for executing the steps in the method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 6.
