Assembly method, device, computer equipment and storage medium of structured light camera
Through automated image acquisition and quality detection methods, the camera and optical camera lens positions of structured optical cameras are adjusted, and the problem of low assembly accuracy in the prior art is solved, and a higher precision structured optical camera assembly is achieved.
Patent Information
- Application Number
- CN202411906370.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-04
AI Technical Summary
In the existing structured optical camera assembly method, manual judgment of the imaging effect leads to poor assembly accuracy.
The camera collects images of the preset focus patterns, determines the camera's imaging quality, and adjusts the camera's lens position; also projectes the preset projection pattern through the optical machine, collects the projection image, determines the projection quality of the optical machine, and adjusts the lens position of the optical machine until the imaging and projection quality is achieved.
The accuracy of structured optical camera assembly is improved, manual intervention is reduced, and an automated assembly process is realized.
Smart Images

Figure CN119767127A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of structured light cameras, and in particular to an assembly method, apparatus, computer equipment and storage medium for a structured light camera. Background Art
[0002] 3D structured light camera is a system structure composed of a projector (optical machine) and a camera (camera). The projector projects a specific light signal onto the surface of the object, which is then collected by the camera. The position and depth of the object are calculated based on the changes in the light signal caused by the object, and the three-dimensional structure of the object is restored. Structured light cameras can be applied to many fields, such as industrial design and manufacturing, robot navigation and positioning, medical field, secure payment, etc. The intraoral scanner composed of a structured light camera can easily build a three-dimensional digital model of teeth, but the scanning area of the intraoral scanner is small, and the depth of field of camera imaging and optical machine projection is very small. In order to ensure the accuracy of intraoral scanning, the focus planes of the camera and optical machine need to be strictly aligned when assembling the structured light camera. In related technologies, the lens positions of the camera and optical machine are adjusted by manually judging the imaging effect to assemble the structured light camera, but this method has poor assembly accuracy. Summary of the invention
[0003] Based on this, it is necessary to provide an assembly method, device, computer equipment and storage medium for a structured light camera that can improve assembly accuracy in response to the above technical problems.
[0004] In a first aspect, the present application provides an assembly method of a structured light camera, which is applied to the assembly of a structured light camera, wherein the structured light camera includes a camera and an optical machine. The assembly method includes: acquiring an image of a preset focus pattern through the camera to obtain a focus image; determining the imaging quality of the camera based on the focus image; adjusting the lens position of the camera until the imaging quality of the camera is the set imaging quality; projecting a preset projection pattern through the optical machine; acquiring an image of the preset projection pattern through the camera to obtain a projection image; determining the projection quality of the optical machine based on the projection image; and adjusting the lens position of the optical machine until the projection quality of the optical machine is the set projection quality.
[0005] In one of the embodiments, the step of determining the imaging quality of the camera based on the focused image includes: performing image recognition on multiple feature points in the focused image to obtain multiple focused feature point images; detecting the clarity of the focused feature point images to obtain focus clarity; and determining the imaging quality of the camera based on the multiple focus clarity.
[0006] In one of the embodiments, the step of detecting the clarity of the focus feature point image to obtain the focus clarity includes: calculating a first Laplace operator value within a preset neighborhood in the focus feature point image; and taking the variance of all the first Laplace operator values as the focus clarity.
[0007] In one of the embodiments, the step of determining the projection quality of the optical machine based on the projection image includes: performing image recognition on multiple feature points in the projection image to obtain multiple projection feature point images; detecting the clarity of the projection feature point images to obtain projection clarity; and determining the projection quality of the optical machine based on the multiple projection clarity.
[0008] In one of the embodiments, the step of detecting the clarity of the projected feature point image to obtain the projection clarity includes: calculating a second Laplace operator value within a preset neighborhood in the projected feature point image; and taking the variance of all the second Laplace operator values as the projection clarity.
[0009] In one of the embodiments, the preset focus pattern is composed of a plurality of cross patterns rotated 45 degrees, and the preset projection pattern is a checkerboard pattern.
[0010] In one of the embodiments, the step of projecting a preset projection pattern through the optical machine includes: projecting the preset projection pattern onto the preset focus pattern through the optical machine; and the projection image is an overlapping image of the preset projection pattern and the preset focus pattern.
[0011] In a second aspect, the present application also provides an assembly device for a structured light camera, which is applied to the assembly of a structured light camera, wherein the structured light camera includes a camera and an optical machine. The device includes: a focus image acquisition module, which is used to acquire an image of a preset focus pattern through the camera to obtain a focus image; a camera imaging quality determination module, which is used to determine the imaging quality of the camera based on the focus image; a camera lens position adjustment module, which is used to adjust the lens position of the camera until the imaging quality of the camera is the set imaging quality; a projection control module, which is used to project a preset projection pattern through the optical machine; a projection image acquisition module, which is used to acquire an image of the preset projection pattern through the camera to obtain a projection image; an optical machine projection quality determination module, which is used to determine the projection quality of the optical machine based on the projection image; and an optical machine lens position adjustment module, which is used to adjust the lens position of the optical machine until the projection quality of the optical machine is the set projection quality.
[0012] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0013] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0014] The assembly method, device, computer equipment and storage medium of the structured light camera described above determine the imaging quality of the camera according to the focused image captured by the camera, so as to adjust the lens position of the camera until the imaging quality of the camera reaches the set imaging quality, and then project a preset pattern through an optical machine, and determine the projection quality of the optical machine according to the projection image captured by the camera, so as to adjust the lens position of the optical machine until the projection quality of the optical machine reaches the set projection quality. By adjusting the lens positions of the camera and the optical machine respectively, the focus planes of the camera and the optical machine can be adjusted to the set optimal positions, thereby completing the assembly of the structured light camera. In addition, in the process of determining the imaging quality of the camera and the projection quality of the optical machine, no manual work is required, thereby improving the assembly accuracy of the structured light camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 is a schematic flow chart of an assembly method of a structured light camera in one embodiment;
[0016] Figure 2 A schematic diagram of a process for determining the imaging quality of a camera in one embodiment;
[0017] Figure 3 is a schematic diagram of a preset focus pattern in an embodiment;
[0018] Figure 4 A schematic diagram of a process for determining the projection quality of an optical machine in one embodiment;
[0019] Figure 5 is a schematic diagram of a preset projection pattern in one embodiment;
[0020] Figure 6 is a schematic diagram of overlapping images in one embodiment;
[0021] Figure 7 is a schematic diagram of a module of an assembly device for a structured light camera in one embodiment;
[0022] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0024] The assembly method of the structured light camera provided in the embodiment of the present application can be applied to an assembly system. The assembly system can perform functions such as parameter acquisition, parameter processing, and adjustment of the lens position of the camera and the optical machine under the control of a computer device, thereby automatically completing the assembly of the structured light camera.
[0025] In one embodiment, Figure 1 As shown, a method for assembling a structured light camera is provided, and the method is applied to an assembly system as an example for description, and includes the following steps:
[0026] Step S110, capturing an image of a preset focus pattern through a camera to obtain a focus image.
[0027] Specifically, when assembling the structured light camera, the structured light camera needs to be installed on the assembly fixture first. The assembly system adjusts the lens position of the camera and the optical machine by controlling the assembly fixture. The assembly system first uses the camera to capture the image of the preset focus pattern to obtain a focused image. The preset focus pattern is a pre-set pattern with high contrast and clear edges for accurate camera focus. The preset focus pattern can be pre-printed on a flat plate, and the camera faces the flat plate at a certain initial distance.
[0028] Step S120: determining the imaging quality of the camera based on the focused image.
[0029] Specifically, after the assembly system acquires the focused image through the camera, it determines the imaging quality of the camera based on the focused image, thereby judging whether the camera lens position is accurate. The imaging quality can be quantitatively evaluated based on indicators such as the clarity, contrast, and resolution of the focused image, thereby more accurately judging the imaging quality of the camera.
[0030] Step S130, adjusting the position of the camera lens until the imaging quality of the camera reaches the set imaging quality.
[0031] Specifically, after determining the imaging quality of the camera at the current lens position, the assembly system adjusts the lens position of the camera by controlling the assembly fixture, and re-captures the image of the preset focus pattern through the camera to determine the imaging quality of the camera after the lens position is adjusted. By repeating the above steps and fine-tuning the lens position of the camera until the imaging quality of the camera is the set imaging quality, the adjustment of the camera lens position is completed. In some embodiments, the set imaging quality is a preset threshold value, and when it is greater than or equal to the set imaging quality, the imaging quality of the camera is better. In some other embodiments, the set imaging quality can also be determined during the lens adjustment process, which is the best imaging quality among multiple imaging qualities collected during the lens adjustment process.
[0032] Step S140, projecting a preset projection pattern through optical machine projection.
[0033] Specifically, when the assembly system completes the adjustment of the lens position of the camera, it means that the camera is in a set better focus position. At this time, the assembly system projects a preset projection pattern through the optical machine. The preset projection pattern is also a pre-set pattern with obvious features so that the camera can accurately capture the projection image. The preset projection pattern can also be projected onto a flat plate, and the distance between the flat plate and the camera is the same as the distance between the flat plate printed with the preset focus pattern and the camera. Alternatively, the optical machine can also project the preset projection pattern onto the same flat plate.
[0034] Step S150, capturing an image of a preset projection pattern through a camera to obtain a projection image.
[0035] Specifically, after the assembly system projects a preset projection pattern through the optical machine, the assembly system then collects images of the preset projection pattern through a camera with a properly adjusted lens position, thereby obtaining a projection image. The projection image is used to evaluate the projection quality of the optical machine.
[0036] Step S160, determining the projection quality of the optical machine based on the projected image.
[0037] Specifically, after the assembly system collects the projection image through the camera, it determines the projection quality of the optical machine based on the projection image, thereby judging whether the lens position of the optical machine is accurate. The projection quality can be quantitatively evaluated based on indicators such as the clarity, contrast, and resolution of the projection image, thereby more accurately judging the projection quality of the optical machine.
[0038] Step S170, adjusting the lens position of the optical machine until the projection quality of the optical machine reaches the set projection quality.
[0039] Specifically, after determining the projection quality of the optical machine at the current lens position, the assembly system adjusts the lens position of the optical machine by controlling the assembly fixture, and re-captures the image of the preset projection pattern through the camera to determine the projection quality of the optical machine after the lens position is adjusted. By repeating the above steps and fine-tuning the lens position of the optical machine until the projection quality of the optical machine is the set projection quality, the adjustment of the lens position of the optical machine is completed. In some embodiments, the projection quality is set to a preset threshold, and when it is greater than or equal to the set projection quality, the projection quality of the optical machine is better. In some other embodiments, the set projection quality can also be determined during the lens adjustment process, which is the best projection quality among multiple projection qualities collected during the lens adjustment process. It is understandable that the assembly system can control the assembly fixture to independently adjust the lens position of the camera or optical machine. After the lens positions of the camera and the optical machine are adjusted, the focus planes of the camera and the optical machine can be aligned, thereby completing the assembly of the structured light camera.
[0040] The assembly method of the structured light camera described above determines the imaging quality of the camera based on the focused image captured by the camera, and adjusts the lens position of the camera until the imaging quality of the camera reaches the set imaging quality. Then, a preset pattern is projected by an optical machine, and the projection quality of the optical machine is determined based on the projection image captured by the camera, and the lens position of the optical machine is adjusted until the projection quality of the optical machine reaches the set projection quality. By adjusting the lens positions of the camera and the optical machine respectively, the focus planes of the camera and the optical machine can be adjusted to the set optimal positions, thereby completing the assembly of the structured light camera. In addition, in the process of determining the imaging quality of the camera and the projection quality of the optical machine, no manual work is required, thereby improving the assembly accuracy of the structured light camera.
[0041] In one embodiment, Figure 2 As shown, in step S120, the step of determining the imaging quality of the camera based on the focused image includes:
[0042] Step S121 , performing image recognition on a plurality of feature points in the focused image to obtain a plurality of focused feature point images.
[0043] Specifically, when determining the imaging quality of the camera based on the focused image, firstly, image recognition is performed on multiple feature points in the focused image to detect local feature points. Local feature points often correspond to images with some intersecting lines and light and dark changes in the focused image, thereby obtaining multiple focused feature point images. When performing image recognition on the focused image, algorithms such as SIFT (Scale-Invariant Feature Transform), SURF (SpeededUp Robust Features), and ORB (Oriented FAST and Rotated BRIEF) can be used.
[0044] Step S122, detecting the clarity of the focus feature point image to obtain the focus clarity.
[0045] Specifically, after obtaining multiple focus feature point images, the clarity of each focus feature point image is detected respectively, so as to obtain multiple corresponding focus clarity. When determining the focus clarity, a gradient-based algorithm can be used to evaluate the local clarity of the focus feature point image. For example, the variance of gradient (Variance of Gradient, VoG), gradient magnitude and orientation (Gradient Magnitude and Orientation), Laplacian operator, etc.
[0046] Step S123, determining the imaging quality of the camera based on multiple focus sharpnesses.
[0047] Specifically, after obtaining multiple focus sharpnesses, the results of the multiple focus sharpnesses are summarized, and the imaging quality of the camera is determined by calculating the average value of the multiple focus sharpnesses. This embodiment determines the imaging quality of the camera by calculating the image sharpness, which can well reflect whether the focus plane position of the camera is in the best position.
[0048] In one embodiment, in step S122, the clarity of the focus feature point image is detected to obtain the focus clarity, including: calculating the first Laplace operator value in a preset neighborhood in the focus feature point image; and taking the variance of all the first Laplace operator values as the focus clarity.
[0049] Specifically, in this embodiment, the Laplacian operator is used to determine the clarity of the focus feature point image. First, in a preset neighborhood (K*K) centered on the center of the focus feature point image, the Laplacian operator value of each pixel is calculated and used as the first Laplacian operator value. After the calculation is completed, the variance of all first Laplacian operator values is calculated, and the variance is used as the corresponding focus clarity. When the imaging quality of the camera is subsequently determined, the average value of these variances is calculated, and the imaging quality of the camera is determined accordingly. Since the Laplacian operator is a second-order derivative operator, it is sensitive to edges, details, and rapidly changing areas in the image, so it can effectively detect the blur of the image. Especially in clarity evaluation, it can capture areas with rich details. And in the specific implementation, only one convolution operation is required, so that the result can be obtained relatively quickly, which is suitable for real-time clarity detection.
[0050] In one embodiment, Figure 3 As shown, the preset focus pattern is composed of multiple cross patterns rotated by 45 degrees. Therefore, the focus image obtained by image acquisition also includes multiple images of rotated crosses. When performing image recognition on the focus image, the SIFT algorithm is used to detect the feature points in the focus image. For each feature point, its descriptor is calculated, and the cross feature point is identified based on the degree of matching between the descriptor and the preset template. Among them, the preset template is a template of a cross rotated by 45 degrees. Then, in the K*K neighborhood centered on each cross feature point, the value of the Laplace operator is calculated, and the variance of all Laplace operator values is used as the focus clarity of the area. Finally, the average value of all variances is calculated, and this is used as the evaluation score of the camera imaging quality to quantitatively evaluate the camera imaging quality.
[0051] In one embodiment, Figure 4 As shown, in step S160, the step of determining the projection quality of the optical machine based on the projected image includes:
[0052] Step S161, performing image recognition on a plurality of feature points in the projection image to obtain a plurality of projection feature point images.
[0053] Specifically, when determining the imaging quality of the optical machine based on the projected image, firstly, image recognition is performed on multiple feature points in the projected image to detect local feature points. Local feature points often correspond to images with some line intersections and light and dark changes in the projected image, thereby obtaining multiple projected feature point images. When performing image recognition on the projected image, algorithms such as SIFT (Scale-Invariant Feature Transform), SURF (SpeededUp Robust Features), and ORB (Oriented FAST and Rotated BRIEF) can be used. Feature points in the projected image can also be automatically identified and extracted through image processing software or algorithm libraries (such as OpenCV).
[0054] Step S162, detecting the clarity of the projected feature point image to obtain the projection clarity.
[0055] Specifically, after obtaining multiple projected feature point images, the clarity of each projected feature point image is detected respectively, so as to obtain multiple corresponding projection clarity. When determining the projection clarity, a gradient-based algorithm can be used to evaluate the local clarity of the projected feature point image, such as the variance of gradient (Variance of Gradient, VoG), gradient magnitude and orientation, Laplacian, etc.
[0056] Step S163, determining the projection quality of the optical machine based on multiple projection deficiencies.
[0057] Specifically, after obtaining multiple projection sharpnesses, the results of the multiple projection sharpnesses are summarized, and the projection quality of the optical machine is determined by calculating the average value of the multiple projection sharpnesses. This embodiment determines the projection quality of the optical machine by calculating the image sharpness, which can well reflect whether the focus plane position of the optical machine is in the optimal position.
[0058] In one embodiment, in step S162, the clarity of the projected feature point image is detected to obtain the projection clarity, including: calculating the second Laplace operator value within a preset neighborhood in the projected feature point image; and taking the variance of all the second Laplace operator values as the projection clarity.
[0059] Specifically, in this embodiment, the clarity of the projected feature point image is determined by the Laplacian operator. First, in a preset neighborhood (K*K) centered on the center of the projected feature point image, the Laplacian operator value of each pixel is calculated and used as the second Laplacian operator value. After the calculation is completed, the variance of all second Laplacian operator values is calculated, and the variance is used as the corresponding projection clarity. When the projection quality of the optical machine is subsequently determined, the average value of these variances is calculated, and the projection quality of the optical machine is determined accordingly. Since the Laplacian operator is a second-order derivative operator and is sensitive to edges, details, and rapidly changing areas in the image, it can effectively detect the blurriness of the image. Especially in clarity evaluation, it can capture areas with rich details. And in the specific implementation, only one convolution operation is required, so that the result can be obtained relatively quickly, which is suitable for real-time clarity detection.
[0060] In one embodiment, Figure 5 As shown, the preset projection pattern is a checkerboard pattern. Therefore, the projection image obtained by image acquisition also includes a checkerboard image. When performing image recognition on the projection image, the checkerboard search algorithm in OpenCV is used to detect the feature points in the projection image, and the feature points are the intersections inside the checkerboard. Then, in the K*K neighborhood centered on each intersection feature point, the value of the Laplace operator is calculated, and the variance of all Laplace operator values is used as the projection clarity of the area. Finally, the average value of all variances is calculated, and this is used as the evaluation score of the optical machine projection quality to quantitatively evaluate the projection quality of the optical machine.
[0061] In one embodiment, in step S140, the step of projecting a preset projection pattern by means of an optical machine includes: projecting the preset projection pattern onto a preset focus pattern by means of an optical machine.
[0062] Specifically, in this embodiment, when a preset projection pattern is projected through an optical machine, the preset projection pattern is projected onto a flat plate having a preset focus pattern. At this time, when an image of the preset projection pattern is captured, the captured projection image is an overlapping image of the preset projection pattern and the preset focus pattern. When the projection quality of the optical machine is subsequently determined based on the projection image, the projected image can be distinguished from the overlapping image by an algorithm, thereby completing the evaluation of the projection quality of the optical machine. At the same time, the focus image can also be distinguished from the overlapping image by an algorithm, thereby evaluating the imaging quality of the camera in real time. In one embodiment, when the preset focus pattern is composed of multiple cross patterns rotated 45 degrees, and the preset projection pattern is a checkerboard pattern, the overlapping image of the preset projection pattern and the preset focus pattern is as follows: Figure 6 shown.
[0063] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0064] Based on the same inventive concept, the embodiment of the present application also provides an assembly device for implementing the assembly method of the structured light camera involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the assembly device for one or more structured light cameras provided below can refer to the limitations of the assembly method for the structured light camera above, and will not be repeated here.
[0065] In one embodiment, Figure 7 As shown, an assembly device for a structured light camera is provided, comprising: a focus image acquisition module 210, a camera imaging quality determination module 220, a camera lens position adjustment module 230, a projection control module 240, a projection image acquisition module 250, an optical-mechanical projection quality determination module 260 and an optical-mechanical lens position adjustment module 270, wherein:
[0066] A focus image acquisition module 210 is used to acquire a focus image by using a camera to acquire a preset focus pattern;
[0067] A camera imaging quality determination module 220, configured to determine the imaging quality of the camera based on the focused image;
[0068] A camera lens position adjustment module 230, used to adjust the camera lens position until the camera imaging quality reaches the set imaging quality;
[0069] The projection control module 240 is used to preset a projection pattern through optical machine projection;
[0070] The projection image acquisition module 250 is used to acquire an image of a preset projection pattern through a camera to obtain a projection image;
[0071] An optical machine projection quality determination module 260, configured to determine the projection quality of the optical machine based on the projection image;
[0072] The optical machine lens position adjustment module 270 is used to adjust the lens position of the optical machine until the projection quality of the optical machine reaches the set projection quality.
[0073] In one embodiment, the camera imaging quality determination module 220 is also used to perform image recognition on multiple feature points in the focused image to obtain multiple focused feature point images; detect the clarity of the focused feature point images to obtain the focus clarity; and determine the camera imaging quality based on the multiple focus clarity.
[0074] In one embodiment, the camera imaging quality determination module 220 is further configured to calculate a first Laplacian operator value within a preset neighborhood in the focus feature point image; and use the variance of all first Laplacian operator values as the focus clarity.
[0075] In one embodiment, the optical machine projection quality determination module 260 is also used to perform image recognition on multiple feature points in the projection image to obtain multiple projection feature point images; detect the clarity of the projection feature point images to obtain projection clarity; and determine the projection quality of the optical machine based on multiple projection clarity.
[0076] In one embodiment, the optical-mechanical projection quality determination module 260 is further used to calculate the second Laplacian operator value within a preset neighborhood in the projected feature point image; and use the variance of all the second Laplacian operator values as the projection clarity.
[0077] In one embodiment, the preset focus pattern is composed of a plurality of cross patterns rotated 45 degrees, and the preset projection pattern is a checkerboard pattern.
[0078] In one embodiment, the projection control module 240 is further configured to project a preset projection pattern onto a preset focus pattern through an optical machine; the projection image is an overlapping image of the preset projection pattern and the preset focus pattern.
[0079] Each module in the assembly device of the structured light camera can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0080] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for assembling a structured light camera is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0081] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0082] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0083] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented.
[0084] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0085] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0086] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for assembling a structured light camera, characterized in that: Applied to the assembly of a structured light camera, the structured light camera includes a camera and an optical machine, and the assembly method includes: Capturing a preset focus pattern through the camera to obtain a focus image; Determining the imaging quality of the camera based on the focused image; Adjusting the lens position of the camera until the imaging quality of the camera reaches the set imaging quality; Preset projection pattern through the optical machine projection; Capturing the preset projection pattern through the camera to obtain a projection image; Determining the projection quality of the optical machine based on the projected image; The lens position of the optical machine is adjusted until the projection quality of the optical machine reaches the set projection quality.
2. The method for assembling a structured light camera according to claim 1, characterized in that: The step of determining the imaging quality of the camera based on the focused image comprises: Performing image recognition on a plurality of feature points in the focused image to obtain a plurality of focused feature point images; Detecting the clarity of the focus feature point image to obtain focus clarity; The imaging quality of the camera is determined based on the multiple focus sharpnesses.
3. The method for assembling a structured light camera according to claim 2, characterized in that: The step of detecting the clarity of the focus feature point image to obtain the focus clarity comprises: Calculating a first Laplacian operator value within a preset neighborhood in the focus feature point image; The variance of all the first Laplacian operator values is used as the focus clarity.
4. The method for assembling a structured light camera according to claim 1, characterized in that: The step of determining the projection quality of the optical machine based on the projection image comprises: Performing image recognition on a plurality of feature points in the projection image to obtain a plurality of projection feature point images; Detecting the clarity of the projected feature point image to obtain projection clarity; The projection quality of the optical machine is determined based on the multiple projection sharpnesses.
5. The method for assembling a structured light camera according to claim 4, characterized in that: The step of detecting the clarity of the projected feature point image to obtain the projection clarity comprises: Calculating a second Laplacian operator value within a preset neighborhood in the projected feature point image; The variance of all the second Laplacian operator values is used as the projection clarity.
6. The method for assembling a structured light camera according to claim 1, characterized in that: The preset focus pattern is composed of a plurality of cross patterns rotated by 45 degrees, and the preset projection pattern is a checkerboard pattern.
7. The method for assembling a structured light camera according to claim 1, characterized in that: The step of projecting a preset projection pattern by means of the optical machine comprises: The preset projection pattern is projected onto the preset focus pattern by the optical machine; the projection image is an overlapping image of the preset projection pattern and the preset focus pattern.
8. An assembly device for a structured light camera, characterized in that: The device comprises: A focus image acquisition module, used to acquire an image of a preset focus pattern through the camera to obtain a focus image; A camera imaging quality determination module, used to determine the imaging quality of the camera based on the focused image; A camera lens position adjustment module, used for adjusting the lens position of the camera until the imaging quality of the camera reaches the set imaging quality; A projection control module, used for projecting a preset projection pattern through the optical machine; A projection image acquisition module, used to acquire an image of the preset projection pattern through the camera to obtain a projection image; An optical machine projection quality determination module, used to determine the projection quality of the optical machine based on the projection image; The optical machine lens position adjustment module is used to adjust the lens position of the optical machine until the projection quality of the optical machine reaches the set projection quality.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.