Measurement method, equipment and medium
By calculating the distance between the target to be measured and the reference device using the reflected image in the structured light system and adjusting the focal length of the image projector, the problem of limited measurement range and accuracy of the structured light system is solved, and high-precision measurements are achieved in a larger range.
Patent Information
- Application Number
- CN202311281562.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-03-28
AI Technical Summary
The measurement range and accuracy of the structured light system are limited by the depth of field determined by the focal length of the image projector, resulting in the reflected image captured by the image collector blurring when the target to be tested is outside the depth of field range, affecting the measurement accuracy.
The distance between the target to be measured and the reference device is calculated by acquiring the first reflected image, and the focal length of the image projector is adjusted according to the distance to obtain a clear second reflected image for measurement.
It realizes clear measurement of the target to be measured within a larger measurement range, reduces the amount of data processing, shortens the measurement delay, and improves the measurement accuracy.
Smart Images

Figure CN119722772A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of measurement technology, and in particular to a measurement method, device, and medium. Background Art
[0002] In space, measurement using a structured light system is an active, non-contact measurement technology that can be applied to many fields such as morphological detection of the target to be measured, positioning of the target to be measured, face recognition, autonomous driving, and robots. The structured light system includes an image projector and an image collector. The image projector is used to project structured light, and the image collector is used to capture the projection image formed by the structured light projected on the surface of the target to be measured. During measurement, the image projector projects the measurement image. After the measurement image is projected on the surface of the target to be measured, it changes with the morphology of the surface of the target to be measured. The reflected image obtained by the projection image formed by the image collector projecting the measurement image on the surface of the target to be measured and the calibrated parameters of the structured light system can be used to measure the three-dimensional data of the target to be measured.
[0003] After the structured light system is calibrated, the measurement range and accuracy of the structured light system are limited by the depth of field determined by the focal length of the calibrated image projector. If the target to be measured is outside the depth of field, the projected image formed on the surface of the target to be measured will be in a blurred and out-of-focus state, causing the reflected image captured by the image collector to be blurred, affecting the measurement of the target to be measured.
[0004] In order to increase the measurement range of the structured light system, the image projector can use an image projector with adjustable focus. In some related technologies, the image projector can traverse multiple different focal lengths, and calibrate and project measurement images at multiple different focal lengths in succession, so that the surface of the target to be measured forms multiple projection images in succession, and the image collector successively shoots multiple projection images to obtain multiple reflection images, and obtains a corresponding image point cloud data according to each reflection image obtained by shooting, and then fuses multiple image point cloud data to obtain target point cloud data of the target to be measured, and measures the target to be measured according to the target point cloud data. However, the solutions in the related technologies have a large amount of data processing. Summary of the invention
[0005] The embodiments of the present application provide a measurement method, a device, and a medium, which can measure a target to be measured within a larger measurement range, and the amount of data processing during measurement is relatively small.
[0006] On the one hand, an embodiment of the present application provides a measurement method, including: obtaining a first reflected image, the first reflected image is an image captured by an image collector when an image projector projects a first focused image to a target to be measured based on a first focal length parameter. Based on the first reflected image and the first focal length parameter, a first distance between the target to be measured and a reference device is obtained, the reference device including at least one of an image projector and an image collector. A second focal length parameter is determined based on the first distance. A second reflected image is obtained, the second reflected image is an image captured by the image collector when the image projector projects a measurement image to the target to be measured based on a second focal length parameter. The target to be measured is measured based on the second reflected image.
[0007] The measurement method provided by the embodiment of the present application, when using the structured light system for measurement, first obtains the first distance between the target to be measured and the reference device by obtaining the first reflected image, and adjusts the image projector to a more appropriate focal length according to the obtained first distance. After the focusing is completed, the second reflected image obtained can be made clearer, which is conducive to measuring the target to be measured according to the obtained second reflected image. The image projector can be focused according to the first distance, so that the structured light system has a larger measurement range. In addition, after the focusing is completed, the target to be measured can be measured by obtaining a relatively clear second reflected image, without obtaining point cloud data at multiple different focal lengths and fusing the multiple point cloud data, and the data processing amount is small. In addition, when the first reflected image obtained is relatively clear, it is not necessary to focus (for example, when the determined target focal length parameter is the same as the focal length parameter when the image projector projects the focused image or the difference is small, the focusing amount can be zero), or only one or a few focusings are performed to obtain a relatively clear reflected image to measure the target to be measured, and it is not necessary to traverse multiple focal lengths for each measurement, which is conducive to shortening the delay during measurement and reducing the amount of data processing during measurement. Furthermore, the first focusing image and the measurement image projected by the image projector can be different. Focusing can be performed by projecting a first focusing image that is relatively robust to defocusing, which can reduce the amount of data processing during focusing, improve the focusing accuracy, and reduce the number of focusing operations. After focusing, different measurement images can be projected to meet different user needs. Furthermore, the image projector can be focused to any focal length, and a relatively clear second reflected image can be obtained at any position of the target to be measured within the measurement range, and relatively accurate measurements can be performed on the target to be measured at any position within the measurement range.
[0008] In a possible implementation, the first distance between the target to be measured and the reference device is obtained based on the first reflected image and the first focal length parameter, including: determining a first position relationship based on the first focal length parameter, the first position relationship being a relative position relationship between the light projected by the image projector when the image projector projects the first focused image based on the first focal length parameter and the image collector. The first distance between the target to be measured and the reference device is obtained based on the first reflected image and the first position relationship.
[0009] In a possible implementation, the method of obtaining the first distance between the target to be measured and the reference device based on the first reflected image and the first positional relationship includes: obtaining point cloud data of a first projection image based on the first reflected image and the first positional relationship, the first projection image being an image obtained by projecting the first focused image onto the target to be measured when the image projector projects the first focused image onto the target to be measured based on the first focal length parameter. The first distance is obtained based on the point cloud data of the first projection image.
[0010] In a possible embodiment, the above-mentioned determining the first position relationship based on the first focal length parameter includes: determining the first position relationship based on the first focal length parameter, and a pre-stored first calibrated focal length parameter, a first calibrated position relationship, a second calibrated focal length parameter, and a second calibrated position relationship, the first calibrated position relationship being the relative position relationship between the light projected by the image projector that has been calibrated in advance when projecting the first focused image based on the first calibrated focal length parameter and the image collector, and the second calibrated position relationship being the relative position relationship between the light projected by the image projector that has been calibrated in advance when projecting the first focused image based on the second calibrated focal length parameter and the image collector.
[0011] In a possible implementation, the determining of the first positional relationship based on the first focal length parameter includes: determining the internal and external parameters of the image projector based on the first focal length parameter based on the first focal length parameter, and the pre-stored first calibrated focal length parameter, the second calibrated focal length parameter, the internal and external parameters of the image projector based on the first calibrated focal length parameter, and the internal and external parameters of the image projector based on the second calibrated focal length parameter. The first positional relationship is determined based on the internal and external parameters of the image projector based on the first focal length parameter and the external parameters of the image collector.
[0012] In a possible implementation, the determining of the first positional relationship based on the first focal length parameter includes: determining the coordinates of the optical center of the image projector based on the first focal length parameter based on the first focal length parameter and the pre-stored correspondence between the coordinates of the optical center of the image projector and the focal length parameter of the image projector. Determining the internal and external parameters of the image projector based on the first focal length parameter based on the coordinates of the optical center of the image projector based on the first focal length parameter, and the pre-stored first calibrated focal length parameter, the internal and external parameters of the image projector based on the first calibrated focal length parameter. Determine the first positional relationship based on the internal and external parameters of the image projector based on the first focal length parameter and the external parameters of the image collector.
[0013] In a possible implementation, the determining the second focal length parameter based on the first distance includes: determining the second focal length parameter based on the first distance and a pre-stored correspondence between the measured distance and the focal length parameter of the image projector.
[0014] In a possible implementation manner, the density of the light spots in the first focused image is lower than the density of the light spots in the measurement image.
[0015] In a possible implementation, before acquiring the second reflected image, the method further includes: acquiring a third reflected image, the third reflected image being an image captured by the image collector when the image projector projects the second focused image to the target to be measured based on the second focal length parameter. The second position relationship is determined based on the second focal length parameter, the second position relationship being the relative position relationship between the light projected by the image projector when the second focused image is projected based on the second focal length parameter and the image collector. The second distance between the target to be measured and the reference device is obtained based on the third reflected image and the second position relationship. The acquiring of the second reflected image includes: acquiring the second reflected image when the difference between the first distance and the second distance is less than or equal to the first difference threshold.
[0016] In a possible embodiment, when the difference between the first distance and the second distance is less than or equal to the first difference threshold, before acquiring the second reflected image, the method further includes: determining the first difference threshold based on the second focal length parameter, and a pre-stored correspondence between the focal length parameter of the image projector and the difference threshold.
[0017] In a possible implementation, before acquiring the first reflected image, the method further includes: acquiring a fourth reflected image, the fourth reflected image being an image captured by the image collector when the image projector projects a third focused image to the target to be measured based on a third focal length parameter. Determine a third position relationship based on the third focal length parameter, the third position relationship being the relative position relationship between the light projected by the image projector when the image projector projects the third focused image based on the third focal length parameter and the image collector. Obtain a third distance between the target to be measured and the reference device based on the fourth reflected image and the third position relationship. Determine the first focal length parameter based on the third distance. Wherein, determining the second focal length parameter based on the first distance includes: determining the second focal length parameter based on the first distance when the difference between the third distance and the first distance is greater than a second difference threshold.
[0018] In a possible implementation, the above-mentioned measuring the target to be measured based on the second reflected image includes: determining a fourth position relationship based on the second focal length parameter, the fourth position relationship being the relative position relationship between the light projected by the image projector when projecting the measurement image based on the second focal length parameter and the image collector. The target to be measured is measured based on the second reflected image and the fourth position relationship.
[0019] Another aspect of the present application embodiment provides an electronic device, including a processor and a memory. The memory stores computer-executable instructions. The processor executes the computer-executable instructions stored in the memory, so that the electronic device executes the method in any of the above embodiments.
[0020] On the other hand, the embodiments of the present application provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method in any of the above embodiments is implemented.
[0021] Another aspect of the embodiments of the present application provides a computer program product, including a computer program, which enables a computer to execute any of the methods in the above-mentioned embodiments when the computer program is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of a structured light system provided in an embodiment of the present application when measuring a target to be measured;
[0023] Figure 2 A flow chart of a measurement method provided in an embodiment of the present application;
[0024] Figure 3 A flow chart of another measurement method provided in an embodiment of the present application;
[0025] Figure 4 A schematic diagram of light projected when projecting a focused image in a measurement method provided in an embodiment of the present application;
[0026] Figure 5 A flow chart of another measurement method provided in an embodiment of the present application;
[0027] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application.
[0028] Description of reference numerals:
[0029] 100. Image projector;
[0030] 200, image collector;
[0031] 300, target to be measured;
[0032] 400, projected image;
[0033] 500, focusing image; 510, first feature point; 520, second feature point;
[0034] 600, light heart;
[0035] 700, electronic device; 710, processor; 720, memory; 730, communication port; 740, communication line. DETAILED DESCRIPTION
[0036] The terms used in the implementation method part of this application are only used to explain the specific embodiments of this application, and are not intended to limit this application. The implementation method of the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0037] Structured light measurement is an active, non-contact measurement technology that can be used in many fields such as morphological detection, target positioning, target recognition (e.g., face recognition), autonomous driving, and robotics. For example, when using structured light for measurement, the three-dimensional dimensions of the object can be measured by projecting the structured light onto the surface of the object. For another example, when using structured light for measurement, the face can be recognized by projecting the structured light onto the face of the person.
[0038] An embodiment of the present application provides a terminal device including a structured light system, and the terminal device may include but is not limited to a mobile phone, a tablet computer, a wearable device, a projector, an access control device, a face-scanning cash register, a robot, a car, etc.
[0039] The terminal device may further include a structural member, and the structured light system may be fixedly mounted on the structural member. For example, when the terminal device is a mobile phone, the structural member may include a middle frame, and the structured light system may be fixedly mounted on the middle frame. For another example, when the terminal device is a projector, the structural member may include a base, and the structured light system may be fixedly mounted on the base.
[0040] Figure 1 A schematic diagram of a structured light system provided in an embodiment of the present application when measuring a target to be measured.
[0041] like Figure 1 As shown, the structured light system may include an image projector 100 and an image collector 200 , and both the image projector 100 and the image collector 200 may be fixedly mounted on a structural member (not shown).
[0042] The image projector 100 is used to project an image onto the target 300 to form a projection image 400 on the surface of the target 300. The projection image 400 formed on the surface of the target 300 will change as the shape of the surface of the target 300 changes. For example, when the target 300 is a cylindrical structure and the image projected by the image projector 100 to the side of the target 300 includes a straight line perpendicular to the axial direction of the target 300, the projection image 400 formed on the side of the target 300 includes an arc formed by the projection of the straight line.
[0043] The image collector 200 is used to capture the projection image 400 formed on the surface of the target 300 to collect the reflection image of the projection image 400 . The target 300 can be measured based on the collected reflection image and the calibrated parameters of the image projector 100 and the image collector 200 .
[0044] In the structured light system, after the parameters of the image projector 100 and the image collector 200 are calibrated, the measurement range and accuracy of the structured light system are limited by the depth of field determined by the focal length of the calibrated image projector 100. If the target 300 to be measured is outside the depth of field, the projected image 400 formed on the surface of the target 300 to be measured will be in a blurred out-of-focus state, causing the reflected image captured by the image collector 200 to be blurred, thereby affecting the measurement of the target 300 to be measured.
[0045] In order to increase the measurement range of the structured light system, the image projector 100 can use a focus-adjustable image projector 100. After the image projector 100 and the image collector 200 are fixedly installed on the structural member, the relative positions of the image projector 100 and the image collector 200 are fixed, and the intrinsic parameters and extrinsic parameters of the image collector 200 can be calibrated after the image projector 100 and the image collector 200 are installed, and the calibrated intrinsic parameters and extrinsic parameters of the image collector 200 are pre-stored, and then the intrinsic parameters and extrinsic parameters of the image projector 100 are calibrated according to the focal length of the image projector 100 in different application scenarios.
[0046] The focusable image projector 100 may include an image generating device, a focusing device and a projector lens (not shown), one of which is fixedly connected to the structural member, the image generating device is connected to the projector lens through the focusing device, the image generating device can be used to generate an image and project the image through the projector lens, and the focusing device can be used to change the distance between the image generating device and the projector lens to focus the image projector 100, so as to increase the measurement range of the structured light system. The focusing device may include a focusing motor, which may be used to drive the image generating device and the projector lens to move relative to each other to change the distance between the image generating device and the projector lens, so as to focus the image projector 100. The focusing motor may be a rotary motor or a linear motor.
[0047] In some related technologies, the image projector 100 can traverse multiple different focal lengths, and the image projector 100 can be calibrated and project measurement images at multiple different focal lengths in succession, so that multiple projection images 400 are formed on the surface of the target 300 to be measured in succession, and the image collector 200 successively shoots the multiple projection images 400 to obtain multiple reflection images, and obtains a corresponding image point cloud data based on each reflection image obtained by shooting, and then the multiple image point cloud data obtained based on the multiple reflection images are fused to obtain the target point cloud data of the target 300 to be measured, and the target 300 to be measured is measured based on the target point cloud data.
[0048] However, the scheme in the related art requires a large amount of data processing when fusing multiple image point cloud data to obtain target point cloud data. In addition, in order to fuse multiple image point cloud data, the image projector 100 needs to successively project the same measurement image at multiple different focal lengths. Under some measurement requirements, the image projector 100 needs to project a measurement image with a higher density of light spots, so that the amount of image point cloud data obtained based on the reflected image is large, which will increase the amount of data processing when fusing multiple image point cloud data to obtain target point cloud data. In addition, in order to make the structured light system have higher measurement accuracy, the image projector 100 often needs to traverse a larger number of steps with a smaller step diameter. The large number of steps traversed by the image projector 100 will result in a larger workload for calibration and a larger delay in measuring the target 300 to be measured. Fusion of a large number of image point cloud data will further increase the amount of data processing.
[0049] Figure 2 A flow chart of a measurement method provided in an embodiment of the present application.
[0050] like Figure 2 As shown, based on this, an embodiment of the present application provides a measurement method, which can be applied to a terminal device including a structured light system or a control device that is communicatively connected to the terminal device including the structured light system.
[0051] The method comprises:
[0052] S100: Control the image projector 100 to project the focus image 500 (as shown below) Figure 4 ).
[0053] S200: Acquire a current focused reflected image. The focused reflected image is an image captured by the image collector 200 when the image projector 100 projects the focused image 500 onto the target 300 to be measured.
[0054] It should be noted that the focused image 500 projected by the image projector 100 onto the target 300 to be measured will form a focused projection image when projected onto the surface of the target 300 to be measured, and the focused reflection image is an image obtained by the image collector 200 capturing the focused projection image formed by projecting the focused image 500 projected by the image projector 100 onto the surface of the target 300 to be measured.
[0055] S300: Obtaining a current processing distance between the target 300 to be measured and the reference device based on the acquired current focused reflected image and the focal length parameter when the current image projector 100 projects the focused image 500.
[0056] The focal length parameters of the image projector 100 may include, but are not limited to, the focal length of the image projector 100, the distance between the image generating device and the projector lens, the adjustment parameters of the focus motor of the image projector 100, etc. The adjustment parameters of the focus motor of the image projector 100 may be the rotation angle of the rotation output shaft of the focus motor relative to the preset zero position, the displacement of the linear moving end of the focus motor relative to the preset zero point position, etc.
[0057] The reference device may include at least one of the image projector 100 and the image collector 200 .
[0058] It should be noted that the focused projection image formed on the surface of the target 300 is located at the intersection of the light projected by the image projector 100 when projecting the focused image 500 and the light used to form the focused reflected image, based on which the current processing distance can be obtained.
[0059] S400: Determine a current target focal length parameter based on the current processing distance.
[0060] It should be noted that the focal length parameter when the current image projector 100 projects the focused image 500 may be the same as the target focal length parameter, or the focal length parameter when the current image projector 100 projects the focused image 500 may be different from the target focal length parameter.
[0061] S500: Controlling the image projector 100 to adjust the focus based on the current target focal length parameter.
[0062] It should be noted that the focus adjustment amount when controlling the image projector 100 to adjust the focus based on the current target focal length parameter may be a positive value, a negative value, or zero.
[0063] S600: After the image projector 100 has completed focusing, control the image projector 100 to project the measurement image.
[0064] It should be noted that the measurement image may be the same as the focusing image 500 , or the measurement image may be different from the focusing image 500 .
[0065] S700: Acquire a measurement reflection image, where the measurement reflection image is an image captured by the image collector 200 when the image projector 100 projects the measurement image onto the target 300 to be measured.
[0066] It should be noted that the measurement image projected by the image projector 100 onto the target 300 will form a measurement projection image on the surface of the target 300, and the measurement reflection image is an image obtained by the image collector 200 capturing the measurement projection image formed on the surface of the target 300 by the measurement image projected by the image projector 100.
[0067] S800: measuring the target 300 based on the measured reflection image.
[0068] In this way, when the structured light system is used for measurement, the processing distance between the target 300 to be measured and the reference device is first obtained by acquiring the focused reflected image, and the image projector 100 is adjusted to a more appropriate focal length according to the obtained processing distance. After the focusing is completed, the measurement projection image formed when the measurement image projected by the image projector 100 is projected on the surface of the target 300 to be measured can be clearer, so that the acquired measurement reflection image is clearer, which is conducive to measuring the target 300 to be measured according to the acquired measurement reflection image. The image projector 100 can be focused according to the processing distance, so that the structured light system has a larger measurement range. In addition, after the focusing is completed, the target 300 to be measured can be measured by acquiring a clearer measurement reflection image, without the need to obtain multiple point cloud data at different focal lengths and fuse the multiple point cloud data, and the data processing volume is small. In addition, when the acquired focused reflected image is relatively clear, it is not necessary to perform focusing (for example, when the determined target focal length parameter is the same as the focal length parameter when the image projector 100 projects the focused image 500 or the difference is small, the focusing amount can be zero), or only one or a few focusings are performed to obtain a relatively clear measurement reflected image to measure the target 300 to be measured, and it is not necessary to traverse multiple focal lengths for each measurement, which is conducive to shortening the delay during measurement and reducing the amount of data processing during measurement. Furthermore, the focused image 500 and the measurement image projected by the image projector 100 can be different, and focusing can be performed by projecting a focused image 500 that is relatively robust to defocusing (for example, an image with relatively sparse light spots such as points and lines), which can reduce the amount of data processing during focusing, improve the accuracy of focusing, and reduce the number of focusing times. After focusing is completed, different measurement images (for example, images with relatively dense or sparse light spots) can be projected to meet different needs of users. Furthermore, the image projector 100 can be focused to any focal length, and a relatively clear measurement projection image can be formed on the surface of the target 300 to be measured at any position within the measurement range. In other words, a relatively clear measurement reflection image can be obtained at any position of the target 300 to be measured within the measurement range, and relatively accurate measurement can be performed on the target 300 to be measured at any position within the measurement range.
[0069] Figure 3 A flowchart of another measurement method provided in an embodiment of the present application.
[0070] like Figure 3 As shown, in some examples, step S100 may include:
[0071] S1100: Control the image projector 100 to project a first focused image based on a first focal length parameter.
[0072] Step S200 may include:
[0073] S2100: Acquire a first reflected image, where the first reflected image is an image captured by the image collector 200 when the image projector 100 projects a first focused image onto the target 300 based on a first focal length parameter.
[0074] It should be noted that the first focused image projected by the image projector 100 to the target 300 based on the first focal length parameter is projected onto the surface of the target 300 to form a first projection image, and the first reflected image is an image obtained by the image collector 200 capturing the first projection image formed by projecting the first focused image projected by the image projector 100 based on the first focal length parameter onto the surface of the target 300. The first projection image is a focused projection image formed by projecting the first focused image projected by the image projector 100 based on the first focal length parameter, and the first reflected image is a focused reflected image obtained by capturing the first projection image.
[0075] Step S300 may include:
[0076] S3100: Obtain a first distance between the target 300 to be measured and a reference device based on the first reflected image and the first focal length parameter.
[0077] It can be understood that the first distance is a processing distance obtained based on the first reflected image and the first focal length parameter.
[0078] Step S400 may include:
[0079] S4100: Determine a second focal length parameter based on the first distance.
[0080] It can be understood that the second focal length parameter is a target focal length parameter determined based on the first distance.
[0081] It should be noted that the first focal length parameter may be the same as the second focal length parameter, or the first focal length parameter may be different from the second focal length parameter.
[0082] Step S500 may include:
[0083] S5100: Controlling the image projector 100 to adjust the focus based on the second focal length parameter.
[0084] Step S600 may include:
[0085] S6100: Control the image projector 100 to project a measurement image based on the second focal length parameter.
[0086] It should be noted that the measurement image may be the same as the first focusing image, or may be different from the first focusing image.
[0087] Step S700 may include:
[0088] S7100: Acquire a second reflected image, where the second reflected image is an image captured by the image collector 200 when the image projector 100 projects a measurement image onto the target 300 based on a second focal length parameter.
[0089] It should be noted that the measurement image projected by the image projector 100 based on the second focal length parameter to the target 300 to be measured will form a second projection image when projected on the surface of the target 300 to be measured, and the second reflected image is an image obtained by the image collector 200 photographing the second projection image formed by projecting the measurement image projected by the image projector 100 based on the second focal length parameter on the surface of the target 300 to be measured. The second projection image is a measurement projection image formed by projecting the measurement image projected by the image projector 100 based on the second focal length parameter, and the second reflected image is a measurement reflection image obtained by photographing the second projection image.
[0090] Step S800 may include:
[0091] S8100: Measure the target 300 based on the second reflected image.
[0092] In some examples, step S300 may include:
[0093] S310: The current processing distance between the target to be measured 300 and the reference device is obtained based on the coordinates of the preset feature points of the current focusing reflection image, the focal parameters of the current image projector 100 when projecting the focusing image 500, and the correspondence between the coordinates of the preset feature points of the focusing reflection image, the focal parameters of the image projector 100, and the processing distance between the target to be measured 300 and the reference device.
[0094] In some examples including step S3100, step S3100 may include:
[0095] S3110: Obtain the first distance between the target 300 to be measured and the reference device based on the coordinates of the preset feature points of the first reflected image, the first focal length parameters, the pre-stored coordinates of the preset feature points of the first reflected image, the focal length parameters of the image projector 100, and the correspondence between the processing distance between the target 300 to be measured and the reference device.
[0096] In some examples, step S300 may include:
[0097] S320 : determining a current focus position relationship based on a focal length parameter when the image projector 100 currently projects the focus image 500 , where the focus position relationship is a relative position relationship between the light projected by the image projector 100 when projecting the focus image 500 and the image collector 200 .
[0098] Exemplarily, the focus position relationship may include one or more of a light plane equation, a ray equation, and intrinsic and extrinsic parameters of the image projector 100 and the image collector 200. For example, when the projected focus image 500 is a point, the focus position relationship may be a ray equation. For another example, when the projected focus image 500 is a line, the focus position relationship may be a light plane equation. For another example, when the projected focus image 500 is a more complex image, the focus position relationship may be an intrinsic and extrinsic parameter of the image projector 100 and the image collector 200.
[0099] S330: Obtaining a current processing distance between the target 300 to be measured and the reference device based on the current focused reflected image and the current focused position relationship.
[0100] In this way, less pre-stored data is required to obtain the current processing distance between the target 300 and the reference device. In addition, the current processing distance between the target 300 and the reference device is more accurate, which is conducive to improving the focusing accuracy of the image projector 100 and reducing the number of focusing times.
[0101] In some examples including step S3100, step S3100 may include:
[0102] S3120: Determine a first position relationship based on the first focal length parameter, where the first position relationship is a relative position relationship between the light projected by the image projector 100 when projecting the first focus image based on the first focal length parameter and the image collector 200.
[0103] It can be understood that the first position relationship is a focus position relationship of the image projector 100 based on the first focal length parameter.
[0104] Exemplarily, the first positional relationship may include one or more of a light plane equation, a light ray equation, and intrinsic parameters and extrinsic parameters of the image projector 100 and the image collector 200 .
[0105] S3130: Obtain a first distance between the target 300 to be measured and the reference device based on the first reflected image and the first position relationship.
[0106] It can be understood that the first distance is a processed distance obtained based on the first reflected image and the first position relationship.
[0107] In some examples, step S330 may include:
[0108] S331: Obtaining point cloud data of the current focused projection image based on the current focused reflected image and the current focused position relationship.
[0109] S332: Obtaining a current processing distance based on the point cloud data of the current focused projection image.
[0110] In this way, it is easy to obtain the three-dimensional data of the current focused projection image, which is conducive to more accurately grasping the position of the current focused projection image in space, and the distance between the target 300 to be measured and the image projector 100 and the image collector 200 can be obtained, so that the current processing distance obtained is more accurate, which is conducive to improving the focusing accuracy and reducing the number of focusing times.
[0111] In some examples including S3130, step S3130 may include:
[0112] S3131: Obtaining point cloud data of a first projection image based on the first reflected image and the first position relationship.
[0113] S3132: Obtain a first distance based on the point cloud data of the first projection image.
[0114] In some examples, step S330 may include:
[0115] S333: Obtaining a depth map of the current focused projection image based on the current focused reflected image and the current focused position relationship.
[0116] S334: Obtaining a current processing distance based on the depth map of the current focused projection image.
[0117] In this way, the amount of data processing required to obtain the current processing distance is relatively small.
[0118] In some examples including S3130, step S3130 may include:
[0119] S3133: Obtain a depth map of the first projection image based on the first reflected image and the first position relationship.
[0120] S3134: Obtain a first distance based on the depth map of the first projection image.
[0121] In some examples, S320 may include:
[0122] S321: Based on the focal length parameter of the current image projector 100 when projecting the focused image 500, and the pre-stored first calibrated focal length parameter, the first calibrated position relationship, the second calibrated focal length parameter, and the second calibrated position relationship, determine the current focusing position relationship, the first calibrated position relationship being the relative position relationship between the light projected by the image projector 100 which has been calibrated in advance when projecting the focused image 500 based on the first calibrated focal length parameter and the image collector 200, and the second calibrated position relationship being the relative position relationship between the light projected by the image projector 100 which has been calibrated in advance when projecting the focused image 500 based on the second calibrated focal length parameter and the image collector 200.
[0123] In this way, the current focusing position relationship can be obtained based on the two calibrated sets of focal length parameters and position relationships, and the amount of data processing required to obtain the current focusing position relationship is relatively small.
[0124] Take the first calibrated position relationship, the second calibrated position relationship and the focus position relationship as an example, all of which are light plane equations. It is known that the first calibrated position relationship is: a1x+b1y+c1z+d1=0, the first calibrated focal length parameter is: F1, the second calibrated position relationship is: a2x+b2y+c2z+d2=0, the first calibrated focal length parameter is: F2, and the focal length parameter of the current image projector 100 when projecting the focus image 500 is: F0. The current focus position relationship that needs to be determined is: a0x+b0y+c0z+d0=0. Then, a0 can be obtained according to F0, F1, F2, a1 and a2 by interpolation method. Specifically, a0 can be obtained according to (F1+F2) / F0=(a1+a2) / a0. Similarly, b0 can be obtained according to F0, F1, F2, b1 and b2, c0 can be obtained according to F0, F1, F2, c1 and c2, and d0 can be obtained according to F0, F1, F2, d1 and d2. After obtaining a0, b0, c0 and d0, the focal length position relationship can be obtained.
[0125] In some examples including step S3120, step S3120 may include:
[0126] S3121: Determine a first position relationship based on a first focal length parameter, and a pre-stored first calibrated focal length parameter, a first calibrated position relationship, a second calibrated focal length parameter, and a second calibrated position relationship, wherein the first calibrated position relationship is a relative position relationship between the light projected by the image projector 100 that has been pre-calibrated when projecting the first focused image based on the first calibrated focal length parameter and the image collector 200, and the second calibrated position relationship is a relative position relationship between the light projected by the image projector 100 that has been pre-calibrated when projecting the first focused image based on the second calibrated focal length parameter and the image collector 200.
[0127] In some examples, step S320 may include:
[0128] S322: Based on the focal length parameter of the current image projector 100 when projecting the focused image 500, as well as the pre-stored first calibrated focal length parameter, the second calibrated focal length parameter, the intrinsic parameters and extrinsic parameters of the image projector 100 based on the first calibrated focal length parameter, and the intrinsic parameters and extrinsic parameters of the image projector 100 based on the second calibrated focal length parameter, determine the intrinsic parameters and extrinsic parameters of the image projector 100 when projecting the focused image 500.
[0129] S323 : Determine the current focus position relationship based on the intrinsic parameters and extrinsic parameters of the image projector 100 when projecting the focus image 500 and the extrinsic parameters of the image collector 200 .
[0130] In this way, the internal parameters and external parameters of the image projector 100 when projecting the focused image 500 can be obtained based on the two calibrated sets of focal length parameters and the internal parameters and external parameters of the image projector 100, which is helpful to determine the current focusing position relationship based on the optical path, and the obtained focusing position relationship is more accurate.
[0131] Figure 4 A schematic diagram of light projected when projecting a focused image in a measurement method provided in an embodiment of the present application.
[0132] like Figure 4 As shown, the focus position relationship is taken as an example of the light plane equation. The focus image 500 projected by the current image projector 100 has a first feature point 510 and a second feature point 520. The coordinates of the first feature point 510 and the second feature point 520 can be determined based on the intrinsic parameters and extrinsic parameters of the image projector when projecting the focus image 500 as (x1, y1, z1) and (x2, y2, z2). The coordinates of the optical center 600 when the current image projector 100 projects the focus image 500 are (x0, y0, z0). Since the first feature point 510, the second feature point 520 and the optical center 600 when the current image projector 100 projects the focus image 500 are on the same light plane, the light plane equation can be determined based on the coordinates of the first feature point 510, the coordinates of the second feature point 520, the coordinates of the optical center 600 when the current image projector 100 projects the focus image 500, and the extrinsic parameters of the image collector 200.
[0133] Exemplarily, the coordinates of the feature points on the focused image 500 projected by the current image projector 100 and the coordinates of the optical center 600 when the current image projector 100 projects the focused image 500 may be coordinates in the world coordinate system.
[0134] Exemplarily, the coordinates of the feature points on the focus image 500 currently projected by the image projector 100 and the coordinates of the optical center 600 when the image projector 100 currently projects the focus image 500 may also be the coordinates in the coordinate system of the image projector 100 .
[0135] Exemplarily, the coordinates of the feature points on the focused image 500 projected by the current image projector 100 and the coordinates of the optical center 600 when the current image projector 100 projects the focused image 500 may also be the coordinates in the coordinate system of the image collector 200 .
[0136] In some examples including step S3120, step S3120 may include:
[0137] S3122: Determine the internal and external parameters of the image projector 100 based on the first focal length parameter based on the first focal length parameter, as well as the pre-stored first calibrated focal length parameter, the second calibrated focal length parameter, the internal and external parameters of the image projector 100 based on the first calibrated focal length parameter, and the internal and external parameters of the image projector 100 based on the second calibrated focal length parameter.
[0138] S3123: Determine a first positional relationship based on the intrinsic parameters and extrinsic parameters of the image projector 100 based on the first focal length parameter and the extrinsic parameters of the image collector 200.
[0139] In some examples, step S320 may include:
[0140] S324 : Determine the coordinates of the optical center of the image projector 100 when projecting the focused image 500 based on the focal length parameters of the current image projector 100 when projecting the focused image 500 and the pre-stored correspondence between the coordinates of the optical center of the image projector 100 and the focal length parameters of the image projector 100 .
[0141] S325: Determine the internal and external parameters of the image projector 100 when projecting the focused image 500 based on the coordinates of the optical center when the image projector 100 projects the focused image 500, the pre-stored first calibrated focal length parameter, and the internal and external parameters of the image projector 100 based on the first calibrated focal length parameter.
[0142] S326 : Determine the current focus position relationship based on the intrinsic parameters and extrinsic parameters of the image projector 100 when projecting the focus image 500 and the extrinsic parameters of the image collector 200 .
[0143] In this way, when the optical center 600 of the image projector 100 moves non-linearly with the change of the focal length parameter, a more accurate focusing position relationship can be obtained, which is beneficial to improve the focusing accuracy and reduce the number of focusing times.
[0144] In some examples including step S3120, step S3120 may include:
[0145] S3124 : Based on the first focal length parameter and a pre-stored correspondence between the coordinates of the optical center of the image projector and the focal length parameter of the image projector 100 , determine the coordinates of the optical center of the image projector 100 based on the first focal length parameter.
[0146] S3125: Determine the internal and external parameters of the image projector 100 based on the first focal length parameter based on the coordinates of the optical center of the image projector 100 based on the first focal length parameter, the pre-stored first calibrated focal length parameter, and the internal and external parameters of the image projector 100 based on the first calibrated focal length parameter.
[0147] S3126: Determine the first positional relationship based on the intrinsic parameters and extrinsic parameters of the image projector 100 based on the first focal length parameter and the extrinsic parameters of the image collector 200.
[0148] In some examples, step S400 may include:
[0149] S410 : Determine a current target focal length parameter based on the current processing distance and the correspondence between the pre-stored measurement distance and the focal length parameter of the image projector 100 .
[0150] In this way, the amount of data processing for determining the current target focal length parameters is small and the time delay is short.
[0151] In some examples including step S4100, step S4100 may include:
[0152] S4111 : Determine a second focal length parameter based on the first distance and a correspondence relationship between a pre-stored measurement distance and a focal length parameter of the image projector 100 .
[0153] In some examples, step S400 may include
[0154] S420 : obtaining a current target focal length parameter based on the current processing distance and the internal parameters of the image projector 100 .
[0155] In some examples including step S4100, step S4100 may include:
[0156] S4112 : Obtain a second focal length parameter based on the first distance and an intrinsic parameter of the image projector 100 .
[0157] In some examples, the density of the light spots in the focused image 500 is lower than the density of the light spots in the measurement image.
[0158] In this way, when a measurement image with denser light spots is required to measure the target 300, the focus image 500 is relatively robust to defocusing, which can improve the accuracy of focusing and reduce the number of focusing adjustments. In addition, it is easy to identify the light spots in the acquired focus reflection image, which can reduce the amount of data processing and alleviate the difficulty of processing the focus reflection image.
[0159] For example, the focusing image 500 may be a point, a dot matrix, a line, a line matrix, a cross line, a checkerboard, etc., and the measuring image may be a Gray code, etc.
[0160] In some examples including step S1100, the density of the light spots in the first focused image is lower than the density of the light spots in the measurement image. For example, the first focused image may be a dot, a dot matrix, a line, a line matrix, a cross line, a checkerboard, or the like.
[0161] In some examples, steps S100 to S500 may be performed once, and the image projector 100 only needs to perform steps S100 to S500 once to complete the focusing.
[0162] In some examples, when the focused reflected image obtained after executing steps S100 to S500 once is relatively blurred, steps S100 to S500 may be repeated multiple times. For example, steps S100 to S500 may be repeated a preset number of times, and after steps S100 to S500 are repeated a preset number of times, the image projector 100 completes the focusing. The preset number of times may be 2, 3, 4 or more times.
[0163] Figure 5 A flowchart of another measurement method provided in an embodiment of the present application.
[0164] like Figure 5 As shown, in some examples, steps S100 to S300 may be repeated at least twice, and whether the focusing of the image projector 100 is completed may be determined based on the size relationship between the difference between the two processing distances obtained before and after the last focusing and a preset difference threshold.
[0165] At this time, the method further includes: before step S600, executing steps S100 to S300 again.
[0166] It is determined whether the difference between the two processing distances obtained before and after the last focusing is less than or equal to a preset difference threshold.
[0167] When the difference between the two processing distances obtained before and after the last focusing is greater than a preset difference threshold, steps S400, S500, S100, S200 and S300 are performed again.
[0168] When the difference between the two processing distances obtained before and after the last focusing is less than or equal to the preset difference threshold, the image projector 100 completes the focusing, and step S600 includes:
[0169] S610: When the difference between the two processing distances obtained before and after the last focusing is less than or equal to a preset difference threshold, the image projector 100 completes focusing and controls the image projector 100 to project a measurement image based on a measured focal length parameter, and the measured focal length parameter is equal to a target focal length parameter determined based on the processing distance obtained before the last focusing.
[0170] In this way, the image projector 100 has a high focusing accuracy, which is conducive to obtaining a clearer measurement reflection image, so as to improve the measurement accuracy of the target 300 to be measured.
[0171] In some examples including steps S1100, S2100, S3100, S4100, S5100, S6100, S7100, and S8100, before step S6100, the method further includes:
[0172] S1200: Control the image projector 100 to project a second focused image based on a second focal length parameter.
[0173] The second focused image may be the same as the first focused image, or may be different from the first focused image.
[0174] The second focused image may be the same as the measurement image, or may be different from the measurement image.
[0175] S2200: Acquire a third reflected image, where the third reflected image is an image captured by the image collector 200 when the image projector 100 projects the second focused image to the target 300 based on the second focal length parameter.
[0176] It should be noted that the second focused image projected by the image projector 100 to the target 300 based on the second focal length parameter will form a third projection image when projected on the surface of the target 300, and the third reflected image is an image obtained by the image collector 200 shooting the third projection image formed by the second focused image projected by the image projector 100 based on the second focal length parameter and projected on the surface of the target 300. The third projection image is a focused projection image formed by projecting the second focused image projected by the image projector 100 based on the second focal length parameter, and the third reflected image is a focused reflection image obtained by shooting the third projection image.
[0177] S3200: Obtain a second distance between the target 300 to be measured and the reference device based on the third reflected image and the second focal length parameter.
[0178] It can be understood that the second distance is a processing distance obtained based on the third reflected image and the second focal length parameter.
[0179] Wherein, step S3200 may include:
[0180] S3210: Determine a second position relationship based on a second focal length parameter, where the second position relationship is a relative position relationship between the light projected by the image projector 100 when projecting a second focused image based on the second focal length parameter and the image collector 200 .
[0181] It can be understood that the second positional relationship is a focusing positional relationship of the image projector 100 based on the second focal length parameter.
[0182] Exemplarily, the second positional relationship may include one or more of a light plane equation, a light equation, intrinsic parameters and extrinsic parameters of the image projector 100 and the image collector 200 , and the like.
[0183] S3220: Obtain a second distance between the target 300 to be measured and the reference device based on the third reflected image and the second position relationship.
[0184] It can be understood that the second distance is a processed distance obtained based on the third reflected image and the second positional relationship.
[0185] Wherein, step S6100 includes:
[0186] S6110: When the difference between the first distance and the second distance is less than or equal to the first difference threshold, the image projector 100 completes focusing and controls the image projector 100 to project the measurement image based on the second focal length parameter.
[0187] Step S7100 includes:
[0188] S7110: Acquire a second reflected image based on the fact that the difference between the first distance and the second distance is less than or equal to a first difference threshold.
[0189] In this way, whether the focusing is completed is determined based on the magnitude relationship between the difference between the first distance and the second distance and the first difference threshold, which is conducive to improving the focusing accuracy of the image projector 100 and obtaining a clearer second reflected image. In addition, the number of unnecessary repeated focusing can be reduced, which is conducive to shortening the measurement delay and reducing the amount of data processing.
[0190] Exemplarily, the second focused image is the same as the first focused image.
[0191] In this way, it is easier to determine the first positional relationship and the second positional relationship.
[0192] Exemplarily, the density of the light spots in the second focused image is lower than the density of the light spots in the measurement image.
[0193] In some examples including steps S1100, S1200, S2100, S2200, S3100, S3200, S4100, S5100, S6110, S7110, and S8100, before step S1100, the method further includes:
[0194] S1300: Control the image projector 100 to project a third focused image based on a third focal length parameter.
[0195] The third focused image may be the same as the first focused image, or the third focused image may be different from the first focused image.
[0196] The third focused image may be the same as the second focused image, or the third focused image may be different from the second focused image.
[0197] The third focused image may be the same as the measurement image, or the third focused image may be different from the measurement image.
[0198] S2300: Acquire a fourth reflected image, where the fourth reflected image is an image captured by the image collector 200 when the image projector 100 projects a third focused image to the target 300 based on a third focal length parameter.
[0199] It should be noted that the third focused image projected by the image projector 100 to the target 300 based on the third focal length parameter is projected on the surface of the target 300 to form a fourth projection image, and the fourth reflected image is an image obtained by the image collector 200 shooting the fourth projection image formed by the third focused image projected by the image projector 100 based on the third focal length parameter and projected on the surface of the target 300. The fourth projection image is a focused projection image formed by projecting the third focused image projected by the image projector 100 based on the third focal length parameter, and the fourth reflected image is a focused reflected image obtained by shooting the fourth projection image.
[0200] S3300: Obtain a third distance between the target 300 to be measured and the reference device based on the fourth reflected image and the third focal length parameter.
[0201] It can be understood that the third distance is a processing distance obtained based on the fourth reflected image and the third focal length parameter.
[0202] S4200: Determine a first focal length parameter based on the third distance.
[0203] It can be understood that the first focal length parameter is a target focal length parameter determined based on the third distance.
[0204] S5200: Controlling the image projector 100 to adjust the focus based on the first focal length parameter.
[0205] S6200: When the difference between the first distance and the third distance is less than or equal to the second difference threshold, the image projector 100 completes focusing and controls the image projector 100 to project the measurement image based on the first focal length parameter.
[0206] S7200: Acquire a fifth reflected image, where the fifth reflected image is an image captured by the image collector 200 when the image projector 100 projects a measurement image onto the target 300 based on the first focal length parameter.
[0207] It should be noted that the measurement image projected by the image projector 100 based on the first focal length parameter to the target 300 to be measured will form a fifth projection image when projected on the surface of the target 300 to be measured, and the fifth reflected image is an image obtained by the image collector 200 photographing the fifth projection image formed by projecting the measurement image projected by the image projector 100 based on the first focal length parameter on the surface of the target 300 to be measured. The fifth projection image is a measurement projection image formed by projecting the measurement image projected by the image projector 100 based on the first focal length parameter, and the fifth reflected image is a measurement reflection image obtained by photographing the fifth projection image.
[0208] S8200: Measure the target 300 based on the fifth reflected image.
[0209] Among them, S4100 includes:
[0210] S4110: When a difference between the third distance and the first distance is greater than a second difference threshold, determine a second focal length parameter based on the first distance.
[0211] In this way, when the difference between the third distance and the first distance is greater than the second difference threshold, focusing can be performed again, which is beneficial to improving the focusing accuracy.
[0212] Exemplarily, the first focused image, the second focused image and the third focused image are the same.
[0213] In this way, it is easier to determine the first positional relationship, the second positional relationship, and the third positional relationship.
[0214] Exemplarily, the density of the light spots in the third focused image is lower than the density of the light spots in the measurement image.
[0215] In some examples including step S3300, step S3300 may include:
[0216] S3310: Determine a third position relationship based on a third focal length parameter, where the third position relationship is a relative position relationship between the light projected by the image projector 100 and the image collector 200 when the image projector 100 projects a third focused image based on the third focal length parameter.
[0217] It can be understood that the third positional relationship is a focusing positional relationship of the image projector 100 based on the third focal length parameter.
[0218] Exemplarily, the third positional relationship may include one or more of a light plane equation, a light equation, intrinsic parameters and extrinsic parameters of the image projector 100 and the image collector 200 , and the like.
[0219] S3320: Obtain a third distance between the target 300 to be measured and the reference device based on the fourth reflected image and the third position relationship.
[0220] It can be understood that the third distance is a processed distance obtained based on the fourth reflected image and the third positional relationship.
[0221] In some examples, the difference threshold is a constant value, and the difference threshold does not change with the change of the focal length parameter of the image projector 100. In this case, the first difference threshold is equal to the second difference threshold.
[0222] In this way, the amount of data processed can be smaller.
[0223] In some examples, before S6110, the method further includes: determining a first difference threshold based on the second focal length parameter and a pre-stored correspondence between the focal length parameter of the image projector 100 and the difference threshold.
[0224] In this way, the determination of whether the conditions for completing focusing are met is more accurate, which is conducive to improving the accuracy of focusing.
[0225] The correspondence between the pre-stored focal length parameter of the image projector 100 and the difference threshold value may be determined according to the focal length parameter of the image projector 100 and the corresponding depth of field of the image projector 100 .
[0226] In some examples, before step S6200 and step S4110, the method further includes: determining a second difference threshold based on the first focal length parameter and a pre-stored correspondence between the focal length parameter of the image projector 100 and the difference threshold.
[0227] In some examples, step S800 includes:
[0228] S810: Determine the current measurement position relationship based on the focal length parameter of the current image projector 100 when projecting the measurement image. The measurement position relationship is the relative position relationship between the light projected by the image projector 100 when projecting the measurement image and the image collector 200.
[0229] Exemplarily, measuring the positional relationship may include one or more of a light plane equation, a light ray equation, and intrinsic and extrinsic parameters of the image projector 100 and the image collector 200 .
[0230] The method for determining the measurement position relationship can refer to the method for determining the focusing position relationship.
[0231] S820: Measure the target 300 based on the measured reflection image and the measured position relationship.
[0232] In this way, the object 300 to be measured can be measured with higher accuracy.
[0233] In some examples including steps S1100, S2100, S3100, S4100, S5100, S6100, S7100, and S8100, step S8100 includes:
[0234] S8110: Determine a fourth position relationship based on the second focal length parameter, where the fourth position relationship is a relative position relationship between the light projected by the image projector 100 when projecting the measurement image based on the second focal length parameter and the image collector 200 .
[0235] It can be understood that the fourth positional relationship is a measured positional relationship of the image projector 100 based on the second focal length parameter.
[0236] Exemplarily, the fourth positional relationship may include one or more of a light plane equation, a light ray equation, and intrinsic parameters and extrinsic parameters of the image projector 100 and the image collector 200 .
[0237] S8120: Measure the target 300 based on the second reflected image and the fourth position relationship.
[0238] In some examples, step S820 includes:
[0239] S821: Obtaining point cloud data of the measured projection image based on the measured reflection image and the measured position.
[0240] S822: Measure the target 300 based on the point cloud data of the measured projection image.
[0241] In some examples including step S8120, step S8120 includes:
[0242] S8121: Obtaining point cloud data of the second projection image based on the second reflected image and the fourth position relationship.
[0243] S8122: Measure the target 300 based on the point cloud data of the second projection image.
[0244] The method of the embodiment of the present application has been described above, and the device for executing the above method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided by the embodiment of the present application can execute the steps in the above method.
[0245] In order to realize the above functions, the device for realizing the above measurement method includes hardware structures and / or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the method steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0246] The embodiment of the present application can divide the functional modules of the device for implementing the measurement method according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0247] like Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application.
[0248] like Figure 6 An embodiment of the present application provides an electronic device 700, which may be the above-mentioned terminal device including the structured light system, or may be the above-mentioned control device that is communicatively connected to the terminal device including the structured light system.
[0249] The electronic device 700 may include one or more (including two) processors 710 , a communication line 740 , a communication port 730 , and a memory 720 .
[0250] The memory 720 may include a high-speed random-access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory. The memory 720 may store computer executable program code for performing various processing functions and implementing the method steps of the present application.
[0251] In some implementations, the memory 720 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0252] The method described in the above embodiment of the present application can be applied to the processor 710, or implemented by the processor 710. The processor 710 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 710 or an instruction in the form of software. The above processor 710 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 710 can implement or execute the methods, steps and logic block diagrams related to each processing in the embodiment of the present application.
[0253] The computer executable program code stored in the memory 720 includes computer executable instructions. When the processor 710 executes the computer executable instructions stored in the memory 720, the electronic device 700 can execute the steps in the above method embodiment.
[0254] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 720, and the processor 710 can read the information in the memory 720, and complete the steps in the above method embodiment in combination with its hardware.
[0255] The processor 710 , the memory 720 , and the communication port 730 may communicate with each other via the communication line 740 , and the processor 710 may send and receive signals via the communication port 730 .
[0256] In the above embodiment, the instructions stored in the memory 720 for execution by the processor 710 may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory 720 or downloaded and installed in the memory 720 in the form of software.
[0257] The present application embodiment also provides a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may 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 may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium may include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0258] The present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.
[0259] As a possible design, the computer readable storage medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while optical discs reproduce data optically using lasers.
[0260] In the description of the embodiments of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, or it can be an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific circumstances.
[0261] The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0262] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present application, rather than to limit them. Although the embodiments of the present application have been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A measurement method, characterized in that: include: Acquire a first reflected image, where the first reflected image is an image captured by the image collector when the image projector projects a first focused image to the target to be measured based on a first focal length parameter; Obtaining a first distance between the target to be measured and a reference device based on the first reflected image and the first focal length parameter, wherein the reference device includes at least one of the image projector and the image collector; determining a second focal length parameter based on the first distance; Acquire a second reflected image, where the second reflected image is an image captured by the image collector when the image projector projects a measurement image to the target based on the second focal length parameter; The target to be measured is measured based on the second reflected image.
2. The method according to claim 1, characterized in that The step of obtaining a first distance between the target to be measured and a reference device based on the first reflected image and the first focal length parameter includes: Determine a first position relationship based on the first focal length parameter, where the first position relationship is a relative position relationship between the light projected by the image projector when projecting the first focus image based on the first focal length parameter and the image collector; The first distance between the target to be measured and a reference device is obtained based on the first reflected image and the first positional relationship.
3. The method according to claim 2, characterized in that The obtaining the first distance between the target to be measured and the reference device based on the first reflected image and the first position relationship includes: obtaining point cloud data of a first projection image based on the first reflected image and the first positional relationship, wherein the first projection image is an image obtained by projecting the first focused image onto the target to be measured when the image projector projects the first focused image onto the target to be measured based on the first focal length parameter; The first distance is obtained based on point cloud data of the first projection image.
4. The method according to claim 2 or 3, characterized in that: The determining the first position relationship based on the first focal length parameter comprises: The first position relationship is determined based on the first focal length parameter, and a pre-stored first calibrated focal length parameter, a first calibrated position relationship, a second calibrated focal length parameter, and a second calibrated position relationship, wherein the first calibrated position relationship is the relative position relationship between the light projected by the image projector that has been calibrated in advance when projecting the first focused image based on the first calibrated focal length parameter and the image collector, and the second calibrated position relationship is the relative position relationship between the light projected by the image projector that has been calibrated in advance when projecting the first focused image based on the second calibrated focal length parameter and the image collector.
5. The method according to claim 2 or 3, characterized in that: The determining the first position relationship based on the first focal length parameter comprises: Determining the intrinsic parameters and extrinsic parameters of the image projector based on the first focal length parameter based on the first focal length parameter, and the pre-stored first calibrated focal length parameter, the second calibrated focal length parameter, the intrinsic parameters and extrinsic parameters of the image projector based on the first calibrated focal length parameter, and the intrinsic parameters and extrinsic parameters of the image projector based on the second calibrated focal length parameter; The first positional relationship is determined based on an intrinsic parameter and an extrinsic parameter of the image projector based on the first focal length parameter and an extrinsic parameter of the image collector.
6. The method according to claim 2 or 3, characterized in that: The determining the first position relationship based on the first focal length parameter comprises: Determining the coordinates of the optical center of the image projector based on the first focal length parameter based on the first focal length parameter and a pre-stored correspondence between the coordinates of the optical center of the image projector and the focal length parameter of the image projector; Determining the intrinsic parameters and extrinsic parameters of the image projector based on the first focal length parameter based on the coordinates of the optical center of the image projector based on the first focal length parameter, the pre-stored first calibrated focal length parameter, and the intrinsic parameters and extrinsic parameters of the image projector based on the first calibrated focal length parameter; The first positional relationship is determined based on an intrinsic parameter and an extrinsic parameter of the image projector based on the first focal length parameter and an extrinsic parameter of the image collector.
7. The method according to any one of claims 1 to 6, characterized in that: The determining a second focal length parameter based on the first distance comprises: The second focal length parameter is determined based on the first distance and a pre-stored correspondence between the measured distance and the focal length parameter of the image projector.
8. The method according to any one of claims 1 to 7, characterized in that: The density of the light spots in the first focusing image is lower than the density of the light spots in the measuring image.
9. The method according to any one of claims 1 to 8, characterized in that: Before acquiring the second reflected image, the method further includes: Acquire a third reflected image, where the third reflected image is an image captured by the image collector when the image projector projects the second focused image to the target based on the second focal length parameter; Determine a second positional relationship based on the second focal length parameter, where the second positional relationship is a relative positional relationship between the light projected by the image projector when projecting the second focused image based on the second focal length parameter and the image collector; Obtaining a second distance between the target to be measured and the reference device based on the third reflected image and the second position relationship; Wherein, acquiring the second reflected image comprises: When the difference between the first distance and the second distance is less than or equal to a first difference threshold, the second reflected image is acquired.
10. The method according to claim 9, characterized in that When the difference between the first distance and the second distance is less than or equal to a first difference threshold, before acquiring the second reflected image, the method further includes: The first difference threshold is determined based on the second focal length parameter and a pre-stored correspondence between the focal length parameter of the image projector and the difference threshold.
11. The method according to any one of claims 1 to 10, characterized in that: Before acquiring the first reflected image, the method further includes: Acquire a fourth reflected image, where the fourth reflected image is an image captured by the image collector when the image projector projects a third focused image to the target based on a third focal length parameter; Determine a third positional relationship based on the third focal length parameter, where the third positional relationship is a relative positional relationship between the light projected by the image projector when projecting the third focus image based on the third focal length parameter and the image collector; Obtaining a third distance between the target to be measured and the reference device based on the fourth reflected image and the third positional relationship; determining the first focal length parameter based on the third distance; Wherein, determining a second focal length parameter based on the first distance includes: When a difference between the third distance and the first distance is greater than a second difference threshold, the second focal length parameter is determined based on the first distance.
12. The method according to any one of claims 1 to 11, characterized in that: The measuring the target to be measured based on the second reflected image includes: Determine a fourth positional relationship based on the second focal length parameter, wherein the fourth positional relationship is a relative positional relationship between the light projected by the image projector when projecting the measurement image based on the second focal length parameter and the image collector; The target to be measured is measured based on the second reflected image and the fourth position relationship.
13. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 12.
14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
15. A computer program product, characterized in that The method comprises a computer program, which, when being executed, enables a computer to execute the method according to any one of claims 1 to 12.