Imaging method, apparatus, storage medium, and terminal

By acquiring and correcting the pixel values ​​of phase-shifted structured light images under multiple exposure times, the problem of low imaging quality in structured light 3D measurement technology is solved, achieving higher quality imaging and greater accuracy of 3D data.

CN116182732BActive Publication Date: 2026-03-27GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing structured light 3D measurement technology suffers from poor image quality due to the large differences in reflectivity of the target object during the imaging process, which leads to oversaturation or underexposure of pixels after imaging, introduces random noise.

Method used

By acquiring initial images of the target under multi-step phase-shifting structured light at multiple exposure times, obtaining the phase-shift vector and performing linear correction, the target exposure time and pixel values ​​are determined to form the target image.

Benefits of technology

It effectively suppresses random noise, improves image quality and the accuracy of 3D data, avoids pixel oversaturation or underexposure, and enhances imaging effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116182732B_ABST
    Figure CN116182732B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an imaging method and device, a storage medium and a terminal. The method comprises: acquiring each initial image of a target corresponding to a multi-step phase shift structured light collected by a camera at at least two exposure times; acquiring, for each step of phase shift, a phase shift vector composed of pixel values of a same pixel point in different exposure times in the initial images; performing linear correction on each pixel value in each phase shift vector to obtain a corrected target phase shift vector; determining a target exposure time in each exposure time based on each target phase shift vector; taking a pixel value corresponding to the target exposure time in each target phase shift vector as a target pixel value; and composing a target image corresponding to each step of phase shift of the target by each target pixel value. The present application can effectively suppress random noise fluctuating with time in the imaging process, and can improve the imaging quality in the structured light measurement technology.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision, and in particular to an imaging method and device, a storage medium, and a terminal. BACKGROUND

[0002] At present, in the industries of printed circuit board, flat panel display, semiconductor, photovoltaic and automotive electronics, the automated optical inspection (AOI) technology based on optical imaging and machine vision algorithm is becoming a key means for product quality control in the related industries. According to the different dimensions of the measured data, the AOI technology can be divided into 2D AOI and 3D AOI. However, 2D AOI is difficult to perform tasks involving depth information, which seriously limits the use range of related equipment. The 3D AOI technology based on structured light imaging can realize more perfect detection function through accurate measurement of depth information, and the structured light 3D measurement technology has been widely used in many fields due to its flexibility, efficiency and reliability. SUMMARY

[0003] Embodiments of the present application provide an imaging method, device, computer storage medium and terminal, which can improve the imaging quality in structured light three-dimensional measurement technology. The technical solution is as follows:

[0004] In a first aspect, the embodiments of the present application provide an imaging method, which comprises:

[0005] obtaining each initial image corresponding to the target under a plurality of steps of phase-shifted structured light respectively collected by a camera at at least two exposure times;

[0006] for each step of phase shift, obtaining a phase shift vector composed of pixel values of a same pixel point in different exposure times in the each initial image, and performing linear correction on each of the pixel values in each of the phase shift vectors to obtain each target phase shift vector after correction;

[0007] determining a target exposure time based on each of the target phase shift vectors in each of the exposure times;

[0008] taking the pixel value corresponding to the target exposure time in each of the target phase shift vectors as a target pixel value, and composing a target image corresponding to the target under each step of phase shift from each of the target pixel values.

[0009] In a second aspect, the embodiments of the present application provide an imaging device, which comprises:

[0010] an image acquisition module, configured to obtain each initial image corresponding to the target under a plurality of steps of phase-shifted structured light respectively collected by a camera at at least two exposure times;

[0011] The pixel correction module is configured to: for each step of phase shift, acquire a phase shift vector composed of pixel values of a same pixel point in different exposure times in each initial image, and perform linear correction on each pixel value in each phase shift vector to obtain each target phase shift vector after correction;

[0012] The exposure determination module is configured to determine a target exposure time based on each target phase shift vector in each exposure time.

[0013] The pixel imaging module is configured to: take a pixel value corresponding to the target exposure time in each target phase shift vector as a target pixel value, and compose a target image corresponding to each step of phase shift of the target from each target pixel value.

[0014] In a third aspect, an embodiment of the present application provides a computer storage medium, which has a plurality of instructions, and the instructions are suitable for being loaded by a processor and performing the method steps described above.

[0015] In a fourth aspect, an embodiment of the present application provides a terminal, which can include a memory and a processor, wherein the memory stores a computer program, and the computer program is suitable for being loaded by the memory and performing the method steps described above.

[0016] The technical scheme provided by the embodiment of the present application has at least the following beneficial effects:

[0017] When the scheme of the embodiment of the present application is executed, each initial image corresponding to a target under a plurality of steps of phase shift structure light is acquired by a camera collected at at least two exposure times, for each step of phase shift, a phase shift vector composed of pixel values of a same pixel point in different exposure times in each initial image is acquired, linear correction is performed on each pixel value in each phase shift vector to obtain each target phase shift vector after correction, a target exposure time is determined based on each target phase shift vector in each exposure time, a pixel value corresponding to the target exposure time in each target phase shift vector is taken as a target pixel value, and a target image corresponding to each step of phase shift of the target is composed from each target pixel value. By acquiring the stripe images modulated by the target under different exposure times collected by the camera and correcting the pixel values in the stripe images in the time domain, the technical scheme can be equivalent to filtering the pixel values in the time domain, can effectively suppress random noise fluctuating with time, and can select a pixel value corresponding to a suitable exposure time for each pixel point as a final pixel value of the pixel point in the image corresponding to each step of phase shift, thereby improving the imaging quality in the structured light measurement technology. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0019] Figure 1 is a flowchart of an imaging method provided by an embodiment of the present application;

[0020] Figure 2 is an application scenario diagram of an imaging method provided by an embodiment of the present application;

[0021] Figure 3 is a flowchart of another imaging method provided by an embodiment of the present application;

[0022] Figure 4 is a structural diagram of an imaging device provided by an embodiment of the present application;

[0023] Figure 5 is a structural diagram of a terminal provided by an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0025] In the description of the present application, it should be understood that the terms "first", "second" and the like are used only for descriptive purposes and are not intended to indicate or imply relative importance. In the description of the present application, it should be noted that unless otherwise expressly specified and limited, "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to such processes, methods, products or devices. The specific meaning of the above terms in the present application can be understood by the person skilled in the art according to the specific circumstances. In addition, in the description of the present application, "multiple" means two or more, unless otherwise specified. The association relationship between the associated objects is described, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after it.

[0026] In the related art, when the structured light 3D measurement technology is applied to an actual scene (such as an industrial scene), due to the large difference in reflectivity of the target to be measured, random noise is inevitably introduced in the imaging process, and the camera uses a fixed exposure time to collect images, which will cause the pixel points obtained after imaging to be overexposed or underexposed, resulting in low imaging quality.

[0027] The present application will be described in detail below with reference to specific embodiments.

[0028] In the following method embodiments, in order to facilitate description, only the execution subject of each step is introduced as a terminal.

[0029] Please refer to Figure 1 , a flowchart of an imaging method provided by an embodiment of the present application. As Figure 1 shown, the method of the embodiment of the present application can include the following steps:

[0030] S101, acquiring each initial image corresponding to the target under a plurality of phase-shifted structured lights collected by a camera at at least two exposure times, respectively.

[0031] It can be understood that the application scenario of the embodiment of the present application can refer to the scene diagram as Figure 2 shown, applied to structured light three-dimensional measurement technology, Figure 2The system includes a projector, a camera, a target (the object to be measured), and a terminal. The terminal is programmed to generate sinusoidal fringes, which are then projected onto the target using the projector. The camera then captures the curvature of the sinusoidal fringes as modulated by the target. In other words, the camera captures the curved fringes, and the terminal demodulates these curved fringes to obtain the phase corresponding to the pixels on the target. By using a phase-distance mapping model, the corresponding three-dimensional data of the target can be obtained. This is the structured light 3D measurement technology.

[0032] In one specific implementation, it is applied to Figure 2 In the scenario shown, while maintaining the structured light mode and projection intensity of the multi-step phase-shifting structured light, the camera can be adjusted to capture fringe images modulated by the target at multiple different exposure times. For ease of description, the fringe images corresponding to different phase-shifting steps modulated by the target can be referred to as initial images. It can be understood that maintaining the structured light mode of the multi-step phase-shifting structured light can mean maintaining the sinusoidal mode and period of the structured light. It can also be understood that the multiple different exposure times of the camera can be set as a set of arithmetically distributed values, for example, m exposure times with N phase-shifting steps. Each phase-shifting step corresponds to m initial images, and these m initial images correspond to m exposure times. Therefore, during the imaging process, m*N initial images can be obtained.

[0033] S102, for each phase shift, obtain the phase shift vector composed of the pixel values ​​of the same pixel point in each initial image under different exposure times, and perform linear correction on each pixel value in each phase shift vector to obtain each corrected target phase shift vector.

[0034] Understandably, theoretically, when a pixel's value is not oversaturated, there is a linear relationship between pixel value and exposure time. Oversaturation refers to a pixel value greater than 255 when stored as 8 bits. However, in practical industrial applications, factors such as large differences in the reflectivity of the target, random noise introduced during imaging, and camera exposure time can lead to oversaturation or underexposure of the imaged pixel value, resulting in a non-linear relationship between pixel value and exposure time.

[0035] In one specific implementation, for example, using m exposure times and N phase shift steps, for each phase shift corresponding to m initial images, the pixel value of each pixel in each of the m initial images can be determined, that is, the pixel value of each pixel at each of the m exposure times. Taking a single pixel as an example, the m pixel values ​​corresponding to a single pixel can be combined into a phase shift vector, which can be stored as a column vector or a row vector. Since the relationship between the m pixel values ​​and the m exposure times may be non-linear in practical applications, a linear fit can be performed on these m pixel values ​​and m exposure times to obtain a linear line corresponding to the pixel. In this linear line, the exposure time can be used as the independent variable, and the pixel value can be used as the function value. Therefore, the function values ​​corresponding to each of the m exposure times can be obtained. Furthermore, the m pixel values ​​can be corrected based on the function values ​​corresponding to the m exposure times. That is, the m pixel values ​​are replaced with m function values ​​according to the exposure time, so that a target phase shift vector can be obtained by forming a target phase shift vector with the m function values ​​corresponding to a pixel.

[0036] S103, determine the target exposure time based on the target phase shift vector in each of the exposure times.

[0037] Understandably, for a single pixel, the target exposure time corresponding to that pixel can be determined. Different pixels may have different target exposure times. To determine the target exposure time for each pixel, we can find the pixel value with the largest non-oversaturated value among n target phase shift vectors for the same pixel. Furthermore, we can determine the exposure time corresponding to each of these n pixel values, and the minimum of these exposure times can be taken as the target exposure time.

[0038] S104, the pixel value corresponding to the target exposure time in each target phase shift vector is taken as the target pixel value, and the target image corresponding to the target under each phase shift is composed of each target pixel value.

[0039] It's understandable that for a given pixel, there's a corresponding target exposure time. Therefore, we can determine the target pixel value for that pixel at each phase shift within that target exposure time. Clearly, for the nth phase shift, all pixels have a target pixel value corresponding to a target exposure time, and these target pixel values ​​can be used to construct the target image corresponding to the nth phase shift. In other words, in a target image, the pixel values ​​of all pixels are the target pixel values ​​at the target exposure time.

[0040] The scheme of the embodiment of the present application is executed, and each initial image corresponding to a target under a plurality of phase shift structured lights is acquired by a camera under at least two exposure times. For each phase shift, a phase shift vector composed of pixel values of a same pixel point under different exposure times in the initial images is acquired, and each pixel value in each phase shift vector is linearly corrected to obtain a corrected target phase shift vector. A target exposure time is determined in each exposure time based on the target phase shift vectors, and a pixel value corresponding to the target exposure time in each target phase shift vector is taken as a target pixel value. A target image corresponding to each phase shift of the target is composed of each target pixel value. The present application can be equivalent to filtering pixel values in time domain by acquiring stripe images modulated by a target under different exposure times and correcting pixel values in time domain, can effectively suppress random noise fluctuating with time, and can improve imaging quality in structured light measurement technology by selecting a pixel value corresponding to a suitable exposure time for each pixel point as a final pixel value of the pixel point in each phase shift corresponding image.

[0041] Please refer to Figure 3 , a flowchart of an imaging method provided by the embodiment of the present application is shown. As shown in the figure, Figure 3 the method of the embodiment of the present application can include the following steps:

[0042] S301, each initial image corresponding to a target under a plurality of phase shift structured lights is acquired by a camera under at least two exposure times.

[0043] Specifically, please refer to S101 in Figure 1 , which will not be repeated here.

[0044] S302, for each phase shift, a phase shift vector composed of pixel values of a same pixel point under different exposure times in the initial images is acquired.

[0045] In a specific embodiment, assuming that m exposure times and N phase shifts are used, the exposure times are denoted as t k (k=0, 1, 2,..., m), and a pixel point (i, j) in the initial image is taken as an example for explanation and description for the n-th (n=1, 2, 3,..., N) phase shift. The pixel value corresponding to the pixel point (i, j) under the exposure time t k is denoted as The pixel values corresponding to the pixel point (i, j) in the m initial images are taken as a column vector V i,j . i,j V i,j may be called a phase shift vector. Then, N V k may be obtained.

[0046] S303, based on the different exposure times in each of the phase shift vectors, and the pixel values corresponding to the different exposure times respectively, a fitting straight line is obtained with exposure time as the independent variable and pixel value as the dependent variable.

[0047] In a specific embodiment, for the calculation method of the fitting straight line, the difference between adjacent exposures can be denoted as δ, t k -t k-1 = δ, for the nth step of phase shift, the difference between the pixel values corresponding to exposure time t k and exposure time t k-1 is denoted as And in theory, as long as the pixel value is not saturated, that is, I MAX represents the maximum possible gray value of the camera sampling (when the gray value is stored in 8-bit data, I MAX = 255), the pixel value and the exposure time are linearly related, when k takes different values, In practical application, due to random noise and other factors, when k takes different values, the value of k is randomly fluctuated around the accurate value. Further, the least square method can be used to fit the pixel values and exposure times in the vector V i,j to obtain a linear straight line

[0048] S304, the initial pixel values corresponding to the different exposure times in each of the phase shift vectors are obtained, and the corrected pixel values of each of the exposure times in the fitting straight line are obtained.

[0049] S305, the initial pixel values corresponding to each of the exposure times are replaced one by one with the corrected pixel values respectively, and the target phase shift vector corresponding to each step of phase shift is composed of the corrected pixel values.

[0050] S304 and S305 are explained below.

[0051] In a specific embodiment, taking pixel point (i, j) as an example, the pixel values corresponding to the m exposure times in the vector V i,j are obtained, denoted as initial pixel values, and t k (k = 1, 2,..., m) is substituted into the linear straight line to obtain the corrected pixel value corresponding to t k , the initial pixel value corresponding to t k is replaced with the corrected pixel value corresponding to t k , which is the process of correcting the initial pixel value, and the vector composed of the corrected pixel values corresponding to the different exposure times after correction can be used as the target phase shift vector.

[0052] S306, selecting an unsaturated and maximum value pixel value from each of the target phase shift vectors as a first pixel value, and selecting a pixel value corresponding to the minimum exposure time from each of the target phase shift vectors as a second pixel value.

[0053] In a specific embodiment, an unsaturated and maximum value pixel value can be selected from the target phase shift vector, which can be denoted as The maximum value pixel value can be denoted as a first pixel value, and the first pixel value in each target phase shift vector can be found to obtain A N-dimensional row vector can be composed of the first pixel values in the target phase shift vectors, which can be denoted as In addition, a pixel value corresponding to t0(the minimum exposure time) can be selected from each target phase shift vector, which can be denoted as The pixel value corresponding to t0(the minimum exposure time) can be denoted as a second pixel value, and the second pixel value in each target phase shift vector can be found to obtain A N-dimensional row vector can be composed of the second pixel values in the target phase shift vectors, which can be denoted as

[0054] S307, calculating the difference between the first pixel value and the second pixel value corresponding to each step of phase shift to obtain the time sequence number corresponding to each first pixel value.

[0055] In a specific embodiment, the linear straight line can be calculated according to to obtain a gray scale interval satisfying , which can be denoted as ΔI n . For the nth step of phase shift, can be calculated by the formula to obtain Since is known, is known, ΔI n is known, can be calculated to obtain wherein, represents the sequence number of the corresponding exposure time, that is, the time sequence number corresponding to the first pixel value.

[0056] S308, for each time sequence number, calculating the product between the value of each time sequence number and the difference of adjacent exposure times, and calculating the sum value of the product and the minimum exposure time, taking the sum value as the first exposure time corresponding to the first pixel value.

[0057] In a specific embodiment, can be calculated by to obtain t k,n , t k,n represents the first exposure time corresponding to the first pixel value, δ represents the difference of adjacent exposure times, and the value of δ is a fixed value, t 0,n ​​​represents the minimum exposure time, and t 0,n The value of t

[0058] S309, based on the correspondence between different time sequence numbers and different exposure times, obtaining the first exposure time corresponding to each of the first pixel values.

[0059] In a specific embodiment, the correspondence between and exposure time can be set represents the sequence number of the corresponding exposure time, which can be found in the corresponding relationship corresponding exposure time, that is, the first exposure time corresponding to the first pixel value.

[0060] S310, taking the minimum value of each of the first exposure times as the target exposure time, taking the pixel value corresponding to the target exposure time in each of the target phase shift vectors as the target pixel value, and taking each of the target pixel values to compose the target image corresponding to the target under each step of the phase shift.

[0061] In a specific embodiment, the minimum value can be selected from each of the first exposure times, and the minimum first exposure time is taken as the target exposure time. For each pixel point, the value of the target exposure time may be different. Further, for pixel point (i, j), the target pixel value corresponding to the target exposure time can be determined in each of the n target phase shift vectors. Obviously, for each pixel point, the target pixel value corresponding to the n step phase shift can be determined. Therefore, for all pixel points in the target image corresponding to the n step phase shift, the pixel value of each pixel point can be the target pixel value corresponding to the n step of each pixel point.

[0062] The scheme of the embodiment of the present application is executed, and each initial image corresponding to a target under a multi-step phase shift structured light is acquired by a camera under at least two exposure times, a phase shift vector composed of pixel values of a same pixel point under different exposure times in each initial image is acquired for each step of phase shift, each pixel value in each phase shift vector is linearly corrected to obtain each target phase shift vector after correction, a target exposure time is determined in each exposure time based on each target phase shift vector, pixel values corresponding to the target exposure time in each target phase shift vector are taken as target pixel values, and each target pixel value is composed to obtain a target image corresponding to the target under each step of phase shift. The present application can be equivalent to filtering pixel values in time domain by acquiring stripe images modulated by a target under different exposure times and correcting pixel values in these stripe images in time domain, random noise fluctuating with time can be effectively inhibited, and a pixel value corresponding to a suitable exposure time is selected for each pixel point as a final pixel value in an image corresponding to each step of phase shift, the imaging quality in the structured light measurement technology can be improved, and the accuracy of three-dimensional data corresponding to the target can be improved. In addition, a pixel value corresponding to the most suitable exposure time is selected for each pixel point, the pixel value is not saturated, and the contrast between pixel values corresponding to different steps can be as large as possible.

[0063] See Figure 4 A structural schematic diagram of an imaging device is provided for the embodiment of the present application. The imaging device 400 can be realized as all or part of a terminal by software, hardware or a combination of both.

[0064] The device 400 comprises:

[0065] The image acquisition module 410 is configured to acquire each initial image corresponding to a target under a multi-step phase shift structured light by a camera under at least two exposure times.

[0066] The pixel correction module 420 is configured to acquire a phase shift vector composed of pixel values of a same pixel point under different exposure times in each initial image for each step of phase shift, and linearly correct each pixel value in each phase shift vector to obtain each target phase shift vector after correction.

[0067] The exposure determination module 430 is configured to determine a target exposure time in each exposure time based on each target phase shift vector.

[0068] The pixel imaging module 440 is configured to take pixel values corresponding to the target exposure time in each target phase shift vector as target pixel values, and compose each target pixel value to obtain a target image corresponding to the target under each step of phase shift.

[0069] Optionally, the pixel correction module 420 comprises:

[0070] a fitting unit, configured to obtain a fitting straight line corresponding to each of the phase shift vectors;

[0071] a correction unit, configured to correct pixel values corresponding to different exposure times in each of the phase shift vectors based on each of the fitting straight lines, to obtain each of the target phase shift vectors after correction.

[0072] Optionally, the fitting unit comprises:

[0073] a fitting sub-unit, configured to obtain a fitting straight line with exposure time as independent variable and pixel value as dependent variable based on different exposure times in each of the phase shift vectors and pixel values corresponding to the different exposure times respectively.

[0074] Optionally, the fitting sub-unit comprises:

[0075] a first fitting unit, configured to obtain initial pixel values corresponding to the different exposure times in each of the phase shift vectors, and to obtain correction pixel values of each of the exposure times in the fitting straight line;

[0076] a second fitting sub-unit, configured to replace initial pixel values corresponding to each of the exposure times one by one with each of the correction pixel values, to form each of the target phase shift vectors corresponding to each step of phase shift from each of the correction pixel values.

[0077] Optionally, the exposure determination module 430 comprises:

[0078] a first determination unit, configured to select pixel values that are not saturated and have maximum values from each of the target phase shift vectors as each of the first pixel values, and to select pixel values corresponding to minimum exposure times from each of the target phase shift vectors as each of the second pixel values;

[0079] a second determination unit, configured to obtain first exposure times corresponding to each of the first pixel values based on each of the first pixel values and each of the second pixel values;

[0080] a third determination unit, configured to take a minimum value in each of the first exposure times as a target exposure time.

[0081] Optionally, the second determination unit comprises:

[0082] a first calculation unit, configured to calculate a difference value between the first pixel value and the second pixel value corresponding to each step of phase shift, to obtain a time serial number corresponding to each of the first pixel values;

[0083] a second calculation unit, configured to obtain first exposure times corresponding to each of the first pixel values based on each of the time serial numbers.

[0084] Optionally, the second calculation unit comprises:

[0085] a first time determination sub-unit configured to calculate, for each time sequence, a product of a value of the each time sequence and a difference value between adjacent exposure times, and calculate a sum value of the product and the minimum exposure time, and take the sum value as a first exposure time corresponding to the first pixel value; or

[0086] a second time determination sub-unit configured to obtain, based on a correspondence between different time sequences and different exposure times, a first exposure time corresponding to each of the first pixel values.

[0087] The scheme of the embodiment of the application is executed to obtain each initial image of a target corresponding to a multi-step phase-shift structured light collected by a camera at at least two exposure times, obtain, for each step of phase shift, a phase shift vector composed of pixel values of a same pixel point in different exposure times in the each initial image, perform linear correction on each of the pixel values in each of the phase shift vectors to obtain each target phase shift vector after correction, determine a target exposure time in each of the exposure times based on the each target phase shift vector, take a pixel value corresponding to the target exposure time in the each target phase shift vector as a target pixel value, and compose a target image corresponding to the target at each step of phase shift by each of the target pixel values. The application can be equivalent to filtering pixel values in time domain by obtaining stripe images modulated by a target at different exposure times collected by a camera and performing correction on the pixel values in time domain, can effectively suppress random noise fluctuating with time, and can improve imaging quality in structured light measurement technology by selecting a pixel value corresponding to a suitable exposure time for each pixel point as a final pixel value of the pixel point in an image corresponding to each step of phase shift.

[0088] Please refer to Figure 5 , Figure 5 A structure schematic diagram of a terminal is provided in the embodiment of the application. As shown in Figure 5 , the terminal 1300 can include at least one processor 1301, at least one network interface 1304, a user interface 1303, a memory 1305, and at least one communication bus 1302.

[0089] The communication bus 1302 is configured to realize connection and communication between the components.

[0090] The user interface 1303 can include a display screen (Display) and a camera (Camera). Optionally, the user interface 1303 can further include a standard wired interface and a wireless interface.

[0091] The network interface 1304 can optionally include a standard wired interface, a wireless interface (e.g., a WI-FI interface).

[0092] The processor 1301 can include one or more processing cores. The processor 1301 connects various parts within the terminal 1300 through various interfaces and lines, and performs various functions of the terminal 1300 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1305, and calling data stored in the memory 1305. The processor 1301 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1301 can be integrated with one or a combination of a central processing unit (CPU) and a modem. The CPU mainly processes operating systems and application programs. It can be understood that the above-mentioned modem can also not be integrated into the processor 1301, but can be implemented by a separate chip.

[0093] The memory 1305 can include a random access memory (RAM) and a read-only memory (ROM). The memory 1305 can include a non-transitory computer-readable storage medium. The memory 1305 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1305 can include a program storage area and a data storage area. The program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area can store data related to the above-mentioned various method embodiments, etc. The memory 1305 can optionally be at least one storage device located away from the above-mentioned processor 1301. As shown, the memory 1305 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a program of the imaging method. Figure 5

[0094] In Figure 5 ​The terminal 1300 shown, the user interface 1303 is mainly used for providing the interface for the user to input, obtaining the data input by the user; and the processor 1301 can be used for calling the program of the imaging method stored in the memory 1305, and specifically performing the following operations:

[0095] Obtaining each initial image corresponding to the target under each step of phase shift structure light collected by the camera at at least two exposure times respectively;

[0096] For each step of phase shift, obtaining a phase shift vector composed of pixel values of the same pixel point in different exposure times in each initial image, and performing linear correction on each pixel value in each phase shift vector to obtain each target phase shift vector after correction;

[0097] Determining a target exposure time based on each target phase shift vector in each exposure time;

[0098] Taking the pixel value corresponding to the target exposure time in each target phase shift vector as a target pixel value, and composing a target image corresponding to the target under each step of phase shift from each target pixel value.

[0099] In one embodiment, the processor 1301 specifically performs the following operations when performing the step of performing linear correction on each pixel value in each phase shift vector to obtain each target phase shift vector after correction:

[0100] Obtaining a fitting straight line corresponding to each phase shift vector respectively;

[0101] Based on each fitting straight line, correcting the pixel values corresponding to different exposure times in each phase shift vector respectively to obtain each target phase shift vector after correction.

[0102] In one embodiment, the processor 1301 specifically performs the following operations when performing the step of obtaining a fitting straight line corresponding to each phase shift vector respectively:

[0103] Based on different exposure times in each phase shift vector and pixel values corresponding to the different exposure times respectively, a fitting straight line with exposure time as independent variable and pixel value as dependent variable is obtained.

[0104] In one embodiment, the processor 1301 specifically performs the following operations when performing the step of correcting the pixel values corresponding to different exposure times in each phase shift vector respectively based on each fitting straight line to obtain each target phase shift vector after correction:

[0105] Obtaining initial pixel values corresponding to the different exposure times in each phase shift vector respectively, and obtaining correction pixel values of each exposure time in the fitting straight line;

[0106] Each of the initial pixel values corresponding to each of the exposure times is replaced by a corresponding one of the corrected pixel values, and each of the target phase shift vectors corresponding to each step of phase shift is composed of the corrected pixel values.

[0107] In one embodiment, when performing the step of determining a target exposure time based on the target phase shift vectors, the processor 1301 specifically performs the following operations:

[0108] Selecting, from each of the target phase shift vectors, an unsaturated pixel value with the maximum value as a first pixel value, and selecting, from each of the target phase shift vectors, a pixel value corresponding to the minimum exposure time as a second pixel value;

[0109] Based on the first pixel values and the second pixel values, obtaining first exposure times corresponding to the first pixel values, respectively;

[0110] Taking the minimum value of the first exposure times as the target exposure time.

[0111] In one embodiment, when performing the step of obtaining first exposure times corresponding to the first pixel values based on the first pixel values and the second pixel values, the processor 1301 specifically performs the following operations:

[0112] Calculating the difference between the first pixel value and the second pixel value corresponding to each step of phase shift to obtain a time sequence number corresponding to the first pixel value, respectively;

[0113] Based on each of the time sequence numbers, obtaining first exposure times corresponding to the first pixel values, respectively.

[0114] In one embodiment, when performing the step of obtaining first exposure times corresponding to the first pixel values based on the time sequence numbers, the processor 1301 specifically performs the following operations:

[0115] For each time sequence number, calculating the product between the value of each time sequence number and the difference of adjacent exposure times, and calculating the sum of the product and the minimum exposure time, and taking the sum as the first exposure time corresponding to the first pixel value; or,

[0116] Based on the corresponding relationship between different time sequence numbers and different exposure times, obtaining first exposure times corresponding to the first pixel values, respectively.

[0117] In addition, those skilled in the art can understand that the structure of the terminal 1300 shown in the above-described drawings does not constitute a limitation on the terminal 1300, and the terminal can include more or fewer components than those shown, or combine certain components, or different component arrangements. For example, the terminal 1300 also includes radio frequency circuitry, audio circuitry, WiFi components, power supplies, Bluetooth components, and the like, which are not described here.

[0118] The embodiments of the present application further provide a computer readable storage medium, which stores at least one instruction, and the at least one instruction is used for being executed by a processor to implement the imaging method according to the above various embodiments.

[0119] The embodiments of the present application further provide a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the imaging method according to the above various embodiments.

[0120] Those skilled in the art should be aware that, in the above one or more examples, the functions described in the embodiments of the present application can be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions can be stored in a computer readable medium or transmitted as one or more instructions or codes on a computer readable medium. The computer readable medium includes computer storage medium and communication medium, and the communication medium includes any medium that facilitates the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0121] The above description is only optional embodiments of the present application, and does not limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An imaging method, characterized in that, The method includes: Acquire initial images of the target under multi-step phase-shifting structured light, captured by the camera at at least two exposure times. For each phase shift, a phase shift vector is obtained, which is composed of the pixel values ​​of the same pixel in each initial image under different exposure times. The pixel values ​​in each phase shift vector are linearly corrected to obtain the corrected target phase shift vectors. From each target phase shift vector, the pixel value with the largest unsaturated value is selected as the first pixel value, and the pixel value corresponding to the minimum exposure time is selected as the second pixel value. Based on the first pixel value and the second pixel value, the first exposure time corresponding to each first pixel value is obtained, and the minimum value among the first exposure times is taken as the target exposure time; wherein, the first pixel value is the pixel value of the pixel in the initial image acquired at the first exposure time; The pixel value corresponding to the target exposure time in each target phase shift vector is used as the target pixel value, and the target image corresponding to the target under each phase shift is composed of each target pixel value.

2. The method according to claim 1, characterized in that, The step of linearly correcting each pixel value in each phase shift vector to obtain corrected target phase shift vectors includes: Obtain the fitted straight line corresponding to each of the phase shift vectors; Based on the fitted straight lines, the pixel values ​​corresponding to different exposure times in each phase shift vector are corrected to obtain the corrected target phase shift vectors.

3. The method according to claim 2, characterized in that, The step of obtaining the fitted straight line corresponding to each of the phase shift vectors includes: Based on the different exposure times in each of the phase shift vectors, and the pixel values ​​corresponding to the different exposure times, a fitted straight line is obtained with exposure time as the independent variable and pixel value as the dependent variable.

4. The method according to claim 2 or 3, characterized in that, The step of correcting the pixel values ​​corresponding to different exposure times in each phase shift vector based on each of the fitted straight lines to obtain the corrected target phase shift vectors includes: Obtain the initial pixel values ​​corresponding to the different exposure times in each of the phase shift vectors, and obtain the corrected pixel values ​​of each of the exposure times in the fitted line; The initial pixel values ​​corresponding to each exposure time are replaced one by one with the corresponding correction pixel values, and the target phase shift vector corresponding to each phase shift is composed of the correction pixel values.

5. The method according to claim 1, characterized in that, The step of obtaining the first exposure time corresponding to each of the first pixel values ​​based on each of the first pixel values ​​and each of the second pixel values ​​includes: Calculate the difference between the first pixel value and the second pixel value corresponding to each phase shift step to obtain the time sequence number corresponding to each first pixel value; Based on the time sequence number, the first exposure time corresponding to each first pixel value is obtained.

6. The method according to claim 5, characterized in that, The step of obtaining the first exposure time corresponding to each first pixel value based on each of the time sequence numbers includes: For each time index, calculate the product of the value of each time index and the difference between adjacent exposure times, and calculate the sum of the product and the minimum exposure time. Use this sum as the first exposure time corresponding to the first pixel value; or, Based on the correspondence between different time numbers and different exposure times, the first exposure time corresponding to each first pixel value is obtained.

7. An imaging device, characterized in that, The device includes: The image acquisition module is used to acquire the initial images of the target under multi-step phase-shifting structured light, which are captured by the camera at at least two exposure times. The pixel correction module is used to obtain the phase shift vector composed of the pixel values ​​of the same pixel in each initial image under different exposure times for each phase shift step, and to perform linear correction on each pixel value in each phase shift vector to obtain each corrected target phase shift vector. The exposure determination module selects the pixel value with the largest unsaturated value from each target phase shift vector as each first pixel value, and selects the pixel value corresponding to the minimum exposure time from each target phase shift vector as each second pixel value. Based on each first pixel value and each second pixel value, it obtains the first exposure time corresponding to each first pixel value, and takes the minimum value among each first exposure time as the target exposure time; wherein, the first pixel value is the pixel value of the pixel point in the initial image acquired at the first exposure time; The pixel imaging module is used to take the pixel value corresponding to the target exposure time in each target phase shift vector as the target pixel value, and to form the target image corresponding to the target under each phase shift by each target pixel value.

8. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions, which are adapted to be loaded by a processor and executed as method steps as claimed in any one of claims 1 to 6.

9. A terminal, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed the method steps as claimed in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Calibration device, calibration method, sensor, display device, calibration processing program and recording medium recording the calibration processing program

    JP2010057142A

  • Wide Dynamic Range Depth Imaging

    US20150022693A1