Gray code coding rearrangement spatial light modulation method and system

By employing a collaborative approach of Gray code rearrangement and dual-path differential detection, the problems of hardware compatibility and imaging quality in single-pixel imaging systems were solved, achieving efficient and stable image reconstruction and improved signal-to-noise ratio.

CN121770631AActive Publication Date: 2026-03-31TIANFU JIANGXI LAB
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-27
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In existing single-pixel imaging systems, random modulation mode is hardware-incompatible, and deterministic orthogonal basis modulation mode has unstable reconstruction quality and low information acquisition efficiency at low sampling rates, making it difficult to balance hardware adaptability and imaging quality.

Method used

A spatial light modulation method using Gray code rearrangement is employed. The basic modulation matrix is ​​rearranged by generating a Gray code index sequence, and a new measurement matrix is ​​generated by combining dual-path differential detection. The target image is then reconstructed using a compressed sensing reconstruction algorithm.

Benefits of technology

Achieve efficient and stable image reconstruction at low sampling rates, improve system signal-to-noise ratio and imaging quality, enhance experimental repeatability, reduce hardware modification costs, and adapt to existing systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121770631A_ABST
    Figure CN121770631A_ABST
Patent Text Reader

Abstract

The invention provides a spatial light modulation method and system for Gray code coding rearrangement, and relates to the technical field of computational imaging and spatial light modulation. According to the method, a Gray code sequence and a high-performance basic modulation matrix are combined, a basic modulation matrix is constructed according to a target image resolution ratio and a sampling rate, a Gray code index sequence with only one different adjacent indexes is generated, a measurement matrix is obtained by rearranging the matrix through a mapping function, and the measurement matrix is loaded to a spatial light modulator to code a light signal; and the double-path detector collects transmitted and reflected light intensity response and performs differential processing, and inputs a compressed sensing reconstruction algorithm to restore an image. According to the invention, stable and efficient information capture at a low sampling rate is realized, the anti-interference capability and repeatability of the system are improved, the hardware compatibility is strong, the implementation cost is low, and the method is suitable for the fields of single-pixel imaging, three-dimensional measurement and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computational imaging and spatial light modulation technology, and in particular to a spatial light modulation method and system with Gray code rearrangement. Background Technology

[0002] In the field of single-pixel imaging technology, spatial light modulators encode the target scene by sequentially projecting a preset structured illumination pattern, while single-pixel detectors synchronously acquire the corresponding total light intensity response. Then, a computational reconstruction algorithm is used to restore the target image. The design of the modulation matrix directly determines the system's imaging quality, imaging speed, and operating efficiency. Currently, the mainstream modulation matrices are mainly divided into two categories: completely random modulation modes and deterministic orthogonal basis modulation modes.

[0003] The fully random modulation mode uses independent and identically distributed random numbers to construct the measurement matrix. From the perspective of compressed sensing theory, this mode has the best constrained isometry, which can guarantee the high probability of reconstructing sparse signals from undersampled measurement data, showing certain advantages at the theoretical level. However, this mode is highly sensitive to the randomness of random numbers, resulting in poor robustness of the fully random modulation matrix. Since about 50% of the modulation unit states change between adjacent random patterns, the spatial light modulator needs to frequently perform large-scale and irregular physical state switching. This not only significantly increases the dynamic power consumption of the system, but also introduces severe electrical noise and timing jitter during high-speed switching. This noise will be directly coupled into the detection signal, ultimately degrading the signal-to-noise ratio of the system.

[0004] Deterministic orthogonal basis modulation modes use orthogonal function bases such as Hadamard and Fourier bases, which have fast algorithms, as the modulation basis. These methods have the advantages of strong determinism and low storage requirements, and are relatively convenient in hardware implementation. However, the inherent limitations of this mode are also quite prominent: the row order of the basis matrix remains unchanged. In low sampling rate scenarios, this fixed sampling order cannot uniformly perceive all information dimensions like random sampling, making the information capture efficiency extremely sensitive to the sampling start point, thus causing unstable image reconstruction quality. In addition, in order to adapt to common spatial light modulators such as digital micromirror devices (DMDs) that can only present binary states, it is often necessary to map the original +1 / -1 Hadamard base linearly to a 1 / 0 binary form. This mapping process destroys the original strict orthogonality of the matrix, so that its theoretically optimal performance cannot be fully realized in practical hardware applications.

[0005] In summary, there is a fundamental contradiction between the two mainstream modulation modes in existing single-pixel imaging systems: the mathematically superior random modulation mode performs poorly in terms of hardware adaptability, and suffers from problems such as high power consumption and high noise; while the hardware-friendly deterministic orthogonal basis modulation mode cannot simultaneously achieve high reconstruction quality and high information capture efficiency at low sampling rates. This technical bottleneck severely restricts the promotion and application of single-pixel imaging technology in more scenarios, and there is an urgent need for a new spatial light modulation method that can systematically solve this contradiction. Summary of the Invention

[0006] In view of this, this application provides a spatial light modulation method and system for Gray code rearrangement, which is used to solve the contradictions in existing single-pixel imaging systems, such as the hardware incompatibility of random modulation mode and the unstable reconstruction quality and low information acquisition efficiency of deterministic orthogonal basis modulation mode at low sampling rate. At the same time, it is necessary to improve the anti-interference capability and repeatability of the system.

[0007] According to one aspect of this application, a spatial light modulation method with Gray code rearrangement is provided, comprising: The total number of pixels N is determined based on the resolution of the target image, the number of measurements M is determined based on the preset sampling rate, and an N×N-dimensional basic modulation matrix suitable for compressed sensing reconstruction and with excellent algebraic properties is selected in combination with the physical characteristics of the pre-determined spatial light modulator. The natural binary sequence 0 to L-1 is encoded using standard reflective Gray code, where L is a positive integer not less than M, to generate a Gray code index sequence of length L. The binary representations of any adjacent index values ​​in the Gray code index sequence differ by only one bit. The Gray code index sequence is used to control the pattern loading order of the spatial light modulator. By using a preset mapping function, the first M indexes of the Gray code index sequence are systematically mapped onto the row index set of the basic modulation matrix to generate a new measurement matrix. The row order of the measurement matrix corresponds one-to-one with the pattern projection order of the spatial light modulator. Each row of the measurement matrix is ​​converted into a two-dimensional spatial light modulation pattern that matches the modulation unit array of the spatial light modulator. The pattern is then loaded onto the spatial light modulator in the order of the rows of the measurement matrix. After the light source is transmitted through the target object, it forms a light signal carrying the target object information. The spatial light modulator spatially encodes the light signal. Two single-pixel detectors with matching performance are used simultaneously to collect the total light intensity response of the scene corresponding to the encoded light signal in the transmission state and reflection state of the spatial light modulator, respectively, to obtain two measurement vectors containing the target object information. The difference vector is obtained by performing a difference operation on the two measurement vectors. The measurement matrix and the difference vector are then input into a compressed sensing reconstruction algorithm. By solving a constraint optimization problem, an estimate of the original target image reflecting the physical shape of the target object is reconstructed.

[0008] In one implementation, the basic modulation matrix is ​​selected from a Hadamard matrix, a Fourier matrix, or other deterministic measurement matrices with low coherence; wherein, when the basic modulation matrix is ​​a Hadamard matrix, if Where n is a positive integer, the Sylvester construction method is used to construct the system, and the construction process satisfies the following conditions: ;like where k is a positive integer. If the prime number is odd, then the Legendre symbolic construction method is used to construct it, and the construction process involves using odd prime numbers. The quadratic residue property generates matrix elements.

[0009] In one implementation, the Gray code index sequence is generated recursively using bitwise operations, and the expression for the bitwise recursion is: , where i is a natural number index starting from 1. This represents the i-th element in the Gray code index sequence; during the generation process, the natural binary sequence 0 to L-1 is first converted to... A binary sequence of bits, where satisfy Then, based on the bitwise operation recursive formula, the converted binary sequence is encoded bit by bit to obtain the Gray code index sequence.

[0010] In one implementation, the mapping function is implemented using linear modulo operation, hash mapping, or direct mapping based on a preset lookup table; when using linear modulo operation, the expression is: ,in For mapping functions, For the i-th element in the Gray code index sequence, ensure that the mapping result falls within the range of row indices 1 to N of the basic modulation matrix; when using hash mapping, convert the Gray code index into an integer using an improved hash algorithm based on MD5 or SHA, and then constrain it to the range of row indices 1 to N through modulo operation; when using a pre-set lookup table mapping, the lookup table pre-stores a one-to-one correspondence between the Gray code index and the row index of the basic modulation matrix, and the construction of the lookup table satisfies the adjacent single-bit transition characteristics of the Gray code sequence and the ordered mapping of the row index of the basic matrix.

[0011] In one implementation, the measurement matrix satisfies Where A is the measurement matrix, i=1,2,...,M, Based on the modulation matrix, For mapping functions, The i-th element in the Gray code index sequence; the element values ​​of the measurement matrix include -1 and 1, which are the binary working states adapted to the spatial light modulator. The binary working state can only present two physical states. Before being loaded onto the spatial light modulator, the -1 element in the measurement matrix is ​​mapped to 0 to obtain the loading matrix. In the loading matrix, 1 corresponds to the on state of the spatial light modulator and 0 corresponds to the off state.

[0012] In one implementation, the spatial light modulator includes a digital micromirror device (DMD) or a rotating mask; when a digital micromirror device is used, the on state of the micromirror corresponds to the transmission state, and the off state of the micromirror corresponds to the reflection state.

[0013] In one implementation, the compressed sensing reconstruction algorithm is selected from the Total Variation Minimization Algorithm (TVAL3) based on Augmented Lagrange and Alternating Direction Method, the Basis Pursuit Denoising Algorithm (BPDN), or the Approximate Message Passing Algorithm (AMP). During the solution process, the L1 norm constrained optimization problem is solved by the compressed sensing reconstruction algorithm, and the pixel grayscale information of the original target image is restored by utilizing the linear correspondence between the measurement matrix and the difference vector.

[0014] In one implementation, the preset sampling rate ranges from 10% to 50%, and the number of measurements... ,in The sampling rate is a preset sampling rate; wherein the sampling rate is adjusted based on the system modulation rate, imaging time requirements and / or the peak signal-to-noise ratio of imaging quality.

[0015] In one implementation, the single-pixel detector is selected from a superconducting nanowire single-photon detector, a single-photon avalanche diode, or a photomultiplier tube. By setting the values ​​of response speed, detection sensitivity, and noise level, the performance parameters of the two single-pixel detectors are ensured to be consistent. During the acquisition process, the two single-pixel detectors work synchronously through a synchronous trigger signal, and respectively acquire the total light intensity response of the scene in the transmission and reflection states of the spatial light modulator in real time, ensuring the time synchronization of the two detection signals.

[0016] According to one aspect of this application, a spatial light modulation system with Gray code rearrangement is provided, the system comprising a light source, an optical transmission module, a spatial light modulation module, a dual-path detection module, a signal conversion module, and a data processing module; The light source is used to provide stable incident light and is selected from LED array light source, infrared laser light source or pseudo-thermal light source, with appropriate wavelength and light intensity selected according to the imaging scene requirements; The optical transmission module includes a collimating lens, an imaging lens, and two collecting lenses. The collimating lens is used to convert divergent light emitted from the light source into parallel light and project it onto the target object. The imaging lens is used to accurately transmit the light transmitted through the target object to the modulation unit array of the spatial light modulation module. The two collecting lenses are respectively set to correspond to the transmission state light output direction and the reflection state light output direction of the spatial light modulator, and are used to collect the encoded light signal and converge it to the detection surface of the dual-path detection module. The spatial light modulation module is the spatial light modulator in the aforementioned Gray code rearrangement spatial light modulation method. It is used to receive the light transmitted by the optical transmission module, load the two-dimensional spatial light modulation pattern generated by the aforementioned Gray code rearrangement spatial light modulation method, and spatially encode the incident light through the physical state switching of the modulation unit. The dual-path detection module includes two single-pixel detectors with matched performance, which are respectively set to correspond to the two collection lenses. They are used to convert the converged light signals into electrical signals, collect the total light intensity response of the scene corresponding to the transmission state and reflection state of the spatial light modulation module, and obtain two measurement vectors containing target object information. The signal conversion module is a time-to-digital converter, used to convert the analog electrical signal output by the dual-channel detection module into a digital electrical signal and transmit it synchronously to the data processing module; The data processing module pre-stores the measurement matrix generated by the aforementioned spatial light modulation method with Gray code rearrangement. It receives the digital electrical signal transmitted by the signal conversion module and restores it to two measurement vectors. It performs a difference operation on the two measurement vectors to obtain a difference vector. It inputs the pre-stored measurement matrix and the difference vector into the compressed sensing reconstruction algorithm to solve for the estimated value of the original target image. The reconstructed image is then output through the display unit or stored in the storage unit.

[0017] By employing the above technical solutions, the spatial light modulation method and system for Gray code rearrangement provided in this application, through the synergy of Gray code index rearrangement and dual-path differential detection, achieves multi-dimensional technical improvements: In terms of imaging performance, the adjacent single-bit jump characteristics of the Gray code sequence endow the basic modulation matrix with a deterministic and smooth sampling trajectory, avoiding the problem of uneven information acquisition in random sampling, enabling uniform and efficient acquisition of image information even at low sampling rates, and improving the stability of reconstruction quality and information acquisition efficiency; in terms of anti-interference capability, the dual-path differential detection mechanism accurately cancels common-mode noise such as ambient light background and light source intensity fluctuations, while retaining and enhancing effective signals related to the target object, thus improving data acquisition efficiency. The system's signal-to-noise ratio is improved at the source, ensuring stable imaging under complex lighting conditions. Regarding experimental repeatability, the Gray code index sequence and its mapping can be pre-calculated offline, eliminating the uncertainty of traditional pseudo-random sampling and enabling precise reproduction of imaging experimental conditions. This makes it suitable for scenarios with high repeatability requirements, such as scientific research and industrial non-destructive testing. In terms of hardware adaptability, the improvements focus on the algorithm logic level, requiring no modification to core hardware such as spatial light modulators, light sources, and detectors, nor the generation of massive new modulation pattern libraries. It can be integrated into existing single-pixel imaging systems through software upgrades or simple circuit expansion, resulting in low implementation costs and high scalability, while retaining the high-speed modulation advantages of the original system.

[0018] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0019] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This illustration shows a schematic diagram of an example spatial light modulation method based on Gray code index rearrangement provided in an embodiment of this application. Figure 2 This illustration shows a schematic diagram of a DMD-based differential dual-path spatial light modulation system provided in an embodiment of this application; Figure 3 The illustration shows the image reconstruction effects of different modulation matrices in the embodiments of this application. Detailed Implementation

[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present application can be combined with each other.

[0021] To address the shortcomings of the aforementioned background technology, this application aims to provide a spatial light modulation method based on Gray code index rearrangement to solve the following technical problems: while preserving the excellent reconstruction performance of the measurement basis mathematics, the projection order of its modulation mode is optimized to achieve more stable and efficient information capture at low sampling rates; through deterministic and non-random sampling order design, the system control complexity is reduced, the experimental repeatability is improved, and the convergence characteristics of the reconstruction algorithm are potentially improved.

[0022] To achieve the above objectives, this application provides a spatial light modulation method based on Gray code index rearrangement. By combining the determinism and hardware-friendliness of Gray code sequences with the mathematical advantages of high-performance fundamental modulation matrices, and introducing a differential detection mechanism, it achieves high-quality and robust image reconstruction within the compressed sensing framework. This application's solution includes at least two core improvements. First, it provides a system method for deterministically rearranging the fundamental measurement matrix based on Gray code sequences. The protected method uses a Gray code sequence—a sequence where adjacent indices change by only one bit—to rearrange the row or column index order of a pre-selected fundamental measurement matrix to generate the final measurement matrix for spatial light modulation. The key is utilizing the sequential characteristics of Gray code sequences to control the systemic sampling order. This method is applicable to all computational imaging systems based on sequentially projected structured patterns, such as single-pixel imaging, structured light 3D imaging, and through-scattering medium imaging. Regardless of the fundamental modulation matrix... This method can be applied to Hadamard matrices, Fourier matrices, random Bernoulli matrices, noisy speckle matrices, or chaotic matrices. It is applicable regardless of whether the spatial light modulator is a DMD, a rotating mask, or another type, as long as the patterns are loaded sequentially. Secondly, there is a dual-path differential detection and information processing mechanism that works in conjunction with the above coding method. This protects the specific system architecture and data processing steps in a single-pixel imaging system combined with the above rearrangement coding method, where at least two detectors are used to collect the light intensity of the spatial light modulator under different states, and their responses are differentially processed to eliminate common-mode noise and obtain the final measurement value used for reconstruction.

[0023] The spatial light modulation method based on Gray code index rearrangement provided in this application specifically includes the following steps 1-5.

[0024] Step 1: Construct the basic modulation matrix.

[0025] Specifically, the total number of pixels N is determined based on the resolution of the target image, the number of measurements M is determined based on the preset sampling rate, and an N×N-dimensional basic modulation matrix suitable for compressed sensing reconstruction and with excellent algebraic characteristics is selected by combining the pre-determined physical characteristics of the spatial light modulator (number of modulation units, working state type and response rate).

[0026] For example, based on the resolution of the target image Determine the size of the modulation matrix This dimension corresponds to the number of complete modulation units in the spatial light modulator. Based on the physical characteristics of the imaging system's core hardware, the spatial light modulator, a fundamental modulation matrix with excellent algebraic properties suitable for compressed sensing reconstruction is selected. This matrix is ​​usually a The square matrix, whose row vectors form a complete set of basis functions with excellent mathematical properties, provides a theoretical guarantee for high-quality reconstruction. In practical applications, in order to overcome the limitations of the traditional Nyquist sampling theorem and achieve fast imaging, this application adopts the compressed sensing principle. Based on the requirements for system modulation rate and imaging time, a sampling rate lower than the conventional requirement is preset, and the actual number of measurements is determined accordingly. This enables efficient subsampling capture of image information.

[0027] In this application, the spatial light modulator includes, but is not limited to, digital micromirror devices (DMDs) and rotating masks. When a digital micromirror device is used, the on state of the micromirror corresponds to the transmission state, and the off state of the micromirror corresponds to the reflection state. In one setting, the deflection angle of the micromirror is +12° when it is on and -12° when it is off, and the accuracy of the deflection angle is controlled within ±0.1°.

[0028] In one implementation, the basic modulation matrix The matrix can be selected from, but is not limited to, the Hadamard matrix, the Fourier matrix, or other deterministic measurement matrices with low coherence. Specifically, when the fundamental modulation matrix is ​​the Hadamard matrix, if N=2 n Where n is a positive integer, the Sylvester construction method is used to construct the system, and the construction process satisfies the following conditions: If N = 4k and N = p + 1, where k is a positive integer and p is an odd prime, then the Legendre symbolic construction method is used to construct the matrix, and the matrix elements are generated through the quadratic residue property of the odd prime p during the construction process.

[0029] Step 2: Generate Gray code index sequence.

[0030] This step is one of the key steps. Specifically, the natural binary sequence 0 to L-1 is encoded using standard reflective Gray code, where L is a positive integer not less than M, to generate a Gray code index sequence of length L. The binary representation of any adjacent index value in the Gray code index sequence differs by only one bit. The Gray code index sequence is used to control the pattern loading order of the spatial light modulator.

[0031] To achieve the basic modulation matrix To optimize access, this application first generates a digital control sequence decoupled from physical modulation. Specifically, it uses a natural binary sequence... to Perform standard reflective Gray code encoding, where For a not less than A sufficiently large number. This process can be achieved using an efficient bitwise recursive formula. Direct implementation, in which For natural number indices starting from 1, Let be the i-th element in the Gray code index sequence. During generation, the natural binary sequence 0 to L-1 is first converted into an n_bit binary sequence, where n_bit is the smallest integer not less than log₂N. Then, based on the bitwise operation recursive formula, the converted binary sequence is encoded bit by bit to obtain the Gray code index sequence. This generates a Gray code index sequence of length L. The core mathematical property of this sequence is that any two adjacent index values... and The binary representations of the modulation sequences differ by exactly one bit. While this characteristic does not directly change the modulation content, it lays the mathematical foundation for constructing modulation sequences with smooth transition characteristics.

[0032] Step 3: Rearrange and map the modulation matrix.

[0033] This step is also one of the key steps. Specifically, through a preset mapping function, the first M indexes of the Gray code index sequence are systematically mapped onto the row index set of the basic modulation matrix, generating a new measurement matrix. The row order of the measurement matrix corresponds one-to-one with the pattern projection order of the spatial light modulator. This step achieves an organic combination of hardware-friendly sequences and mathematically optimal basis.

[0034] For example, the Gray code index sequence generated above The front of the middle A valid index, through a preset, flexibly adjustable mapping function. Systematically mapped to the fundamental modulation matrix On the set of row indices. Mapping function The design is diverse, but its core purpose is to transfer the asymptotic, low-jump ergodic characteristics inherent in Gray code sequences in binary space to the fundamental matrix. The order in which rows are accessed. A simple and efficient implementation is to use modulo operation, that is... Through this mapping, a new, ordered measurement matrix is ​​obtained. Its definition ,in .matrix It not only inherits the basic matrix The excellent mathematical reconstruction properties of each row vector are important, but more importantly, their row order is endowed with a deterministic, approximately smoothly varying access structure by the Gray code sequence. This structure simulates structured random sampling at the system level, which helps to acquire image information more uniformly and efficiently at low sampling rates, thereby improving the information entropy and stability of the measurement.

[0035] Furthermore, for ,make Mapping function This function is used to establish the correspondence between Gray code indices and matrix row indices. Implementation methods include linear modulo operation, hash mapping, or direct mapping based on a pre-defined lookup table. The aim is to transfer the traversal characteristics of the Gray code sequence to the access order of the base matrix rows. Therefore, in one implementation, the mapping function can be implemented using linear modulo operation, hash mapping, or direct mapping based on a pre-defined lookup table; when using linear modulo operation, the expression is... ,in For mapping functions, For the i-th element in the Gray code index sequence, ensure that the mapping result falls within the range of row indices 1 to N of the basic modulation matrix; when using hash mapping, convert the Gray code index into an integer using an improved hash algorithm based on MD5 or SHA, and then constrain it to the range of row indices 1 to N through modulo operation; when using a pre-set lookup table mapping, the lookup table pre-stores a one-to-one correspondence between the Gray code index and the row index of the basic modulation matrix, and the construction of the lookup table satisfies the adjacent single-bit transition characteristics of the Gray code sequence and the ordered mapping of the row index of the basic matrix.

[0036] In one implementation, the measurement matrix satisfies Where A is the measurement matrix, i=1,2,...,M, Based on the modulation matrix, For mapping functions, The i-th element in the Gray code index sequence; the elements of the measurement matrix include -1 and 1, which are the binary working states adapted to the spatial light modulator. The binary working state can only present two physical states. Before being loaded onto the spatial light modulator, the -1 elements in the measurement matrix are mapped to 0 to obtain the loading matrix. In the loading matrix, 1 corresponds to the on state of the spatial light modulator and 0 corresponds to the off state.

[0037] Step 4: Spatial light modulation and differential image acquisition.

[0038] This step is one of the important steps. Specifically, each row of the measurement matrix is ​​converted into a two-dimensional spatial light modulation pattern that matches the modulation unit array of the spatial light modulator. The pattern is then loaded into the spatial light modulator in the order of the rows of the measurement matrix. After the light source is transmitted through the target object, it forms a light signal carrying the target object information. The spatial light modulator spatially encodes the light signal. Simultaneously, two single-pixel detectors with matching performance are used to collect the total light intensity response of the scene corresponding to the encoded light signal in the transmission and reflection states of the spatial light modulator, respectively, to obtain two measurement vectors containing the target object information.

[0039] For example, measurement matrix Each row vector is reconstructed into a corresponding two-dimensional spatial light modulation pattern, strictly following the matrix... The patterns are sequentially loaded onto the spatial light modulator in the order of rows. In the transmissive imaging optical path, the light emitted from the light source is spatially encoded by the spatial light modulator after passing through the target object. To effectively suppress ambient light noise and improve the signal-to-noise ratio, this application innovatively adopts a dual-path differential detection mechanism: two single-pixel detectors with matched performance are used simultaneously to accurately acquire the patterns corresponding to the transmission states of the spatial light modulator. With reflection state The total light intensity response of the scene under two working states. For each measurement, two one-dimensional measurements are obtained simultaneously. and Ultimately, measurement vectors are formed respectively. and This design ensures that each modulation simultaneously incorporates two sets of complementary light intensity information.

[0040] Step 5: Calculate the reconstructed image.

[0041] Specifically, a difference vector is obtained by performing a difference operation on two measurement vectors. The measurement matrix and the difference vector are then input into a compressed sensing reconstruction algorithm. By solving a constraint optimization problem, an estimate of the original target image reflecting the physical shape of the target object is reconstructed.

[0042] To fully utilize the dual-path detection information and maximize the elimination of common-mode noise, this application first converts the acquired two-path measurement vectors into... and Perform a difference operation to obtain the difference vector. This operation is mathematically equivalent to subtracting the responses of the two detection channels, effectively canceling out the common ambient light background components in both signals, thus significantly improving the signal-to-noise ratio of the effective signal and simultaneously expanding the amount of information. Finally, the known measurement matrix is... The difference vector after difference processing The images are input together into a selected compressed sensing reconstruction algorithm for solving. The algorithm solves a constrained optimization problem and ultimately reconstructs a high-precision estimate of the original target image. .

[0043] In this application, the reconstruction algorithms include, but are not limited to, the Total Variation Minimization Algorithm (TVAL3) based on the Augmented Lagrange method and the Alternating Direction method, the Basis Pursuit Denoising (BPDN) algorithm, or the Approximate Message Passing (AMP) algorithm. For example, during the solution process, the L1 norm constrained optimization problem is solved by the compressed sensing reconstruction algorithm, and the pixel grayscale information of the original target image is restored by utilizing the linear correspondence between the measurement matrix and the difference vector.

[0044] In summary, the spatial light modulation method based on Gray code index rearrangement provided in this application has the following beneficial effects: 1. Regarding imaging quality and information acquisition efficiency, intelligent reconstruction of the access order of the fundamental modulation matrix is ​​achieved through the core step of Gray code index rearrangement. Specifically, Gray code sequences with adjacent single-bit transition characteristics are systematically applied to the fundamental matrix through a mapping function. The row index is used. This operation does not generate new primitives, but rather assigns a deterministic, asymptotically smooth sampling trajectory to the high-performance mathematical basis. Compared to completely random sampling, this rearranged order can guide the measurement system to explore the information space of the image in a more ordered way at low sampling rates, avoiding the problem of uneven early information acquisition that may occur with random sampling; 2. To improve the system's anti-interference capability and signal-to-noise ratio, a dual-path differential detection mechanism is adopted. This works synergistically with the aforementioned coding scheme to suppress noise. The dual-path differential detection mechanism can accurately cancel common-mode noise such as ambient light background and light source intensity fluctuations in both signals, because these noise components are... and The high correlation is significantly reduced during the difference process. Meanwhile, the matrix is ​​rearranged using Gray code. The encoded effective signals related to the target object are preserved or even enhanced after differential processing. Therefore, this scheme significantly improves the effective signal-to-noise ratio of the system from the source of data acquisition, enabling the imaging system to maintain stable performance in complex lighting environments. This effect is difficult to achieve independently by a single coding optimization or detection scheme. 3. Regarding system determinism and repeatability, the core control sequence of the entire imaging process is the Gray code index sequence. The mappings are completely predetermined and can be computed offline. This completely eliminates the measurement sequence uncertainty caused by different random seeds in traditional compressed sensing imaging based on pseudo-random number generators. The resulting technical effect is that the conditions of any imaging experiment can be accurately reproduced. This is crucial for scientific research requiring rigorous comparison, non-destructive testing of industrial products, and calibration and performance evaluation of imaging systems, enhancing the scientific rigor and engineering practicality of the method. 4. In terms of hardware compatibility and implementation efficiency, this solution demonstrates high user-friendliness and flexibility. The core innovation of the entire solution lies in the algorithm and logic level: Gray code index rearrangement only requires modification of memory addressing or pattern calling order in the controller; dual-channel differential detection is a classic and efficient circuit design. These improvements do not require changes to the core hardware of the spatial light modulator, light source, and detector, nor do they require the generation of entirely new, massive modulation pattern libraries. Therefore, this solution can be easily integrated into existing single-pixel imaging systems, achieving a performance leap through software upgrades or simple circuit expansions. It has low implementation costs, is easy to promote, and maintains the high-speed modulation advantages of the original system.

[0045] The specific implementation of the embodiments of this application is described below through examples.

[0046] See Figure 1 This is a schematic diagram illustrating a spatial light modulation method based on Gray code index rearrangement, as described in this application.

[0047] Step S01: Construction of the basic modulation matrix. Based on the resolution of the target image. Determine the total number of pixels The number of measurements is determined based on the preset sampling rate. Based on the physical characteristics of the spatial light modulator, a fundamental modulation matrix with excellent algebraic properties suitable for compressed sensing reconstruction is selected. Its size is .

[0048] Step S02: Gray code index sequence generation. For the natural binary sequence... to Perform standard reflective Gray code encoding to generate a string of length... Gray code index sequence ,in ,sequence The binary representations of adjacent index values ​​differ by only one bit.

[0049] Step S03: Serialization and rearrangement mapping. The Gray code index sequence... The former Each index is mapped using a predefined mapping function. Systematically mapped to the fundamental modulation matrix On the row index set, a new, ordered measurement matrix is ​​generated. .

[0050] Step S04: Spatial light modulation and image acquisition. The measurement matrix... Each row is converted into a corresponding two-dimensional spatial light modulation pattern. According to the matrix... The patterns are sequentially loaded into the spatial light modulator in row order. After the light source is transmitted through the target object, it is encoded by the spatial light modulator. Two single-pixel detectors are used simultaneously to collect the state of each pattern under projection. and state The total light intensity response of the scene is used to obtain a one-dimensional measurement vector. and .

[0051] Step S05: Calculate the reconstructed image. The acquired measurement vectors... and Differences yield difference vectors Using the measurement matrix and difference vector The compressed sensing reconstruction algorithm is used to solve for the estimated value of the original image. .

[0052] For example, a DMD is selected as the spatial light modulator, and a Hadamard matrix is ​​used as the basic modulation matrix. The image size is set to... Then the number of pixels in the modulation matrix .when satisfy The Hadamard matrix is ​​constructed using the Sylvester construction method and the following formula:

[0053] when satisfy ,and When the prime number is odd, the Hadamard matrix is ​​constructed using the Legendre symbolic construction method. Let the initial complete Hadamard matrix be denoted as . , Size is They possess strict orthogonality.

[0054] Set the sampling rate to Then the number of measurements In one implementation, the preset sampling rate ranges from 10% to 50%. The sampling rate can be adjusted based on the system modulation rate, imaging time requirements, and / or the peak signal-to-noise ratio (PSNR) of the imaging quality. For example, when the system modulation rate is ≥1000Hz and the imaging time requirement is ≤50ms, a sampling rate of 10%-20% is selected; when the PSNR requirement for imaging quality is ≥20dB, a sampling rate of 30%-50% is selected. (The length is...) The decimal index sequence is , ,Require .remember ,Will Convert to A binary sequence of bits Denote the Gray code sequence. It is generated by the following formula:

[0055] The mapping function is:

[0056] To correct Gray code sequences The initial complete Hadamard matrix Rearrange to get Because the number of samples is compressed to Next, the measurement matrix .at this time The initial complete Hadamard matrix is ​​reassembled into a new matrix determined by the Gray code sequence, exhibiting determinism and smooth changes in adjacent row numbers. This facilitates loading the measurement matrix onto the DMD. ,Will middle Element mapping , obtain the loading matrix ,but Corresponding to the opening of the microscope, Corresponding to the microscopic switch.

[0057] This application also provides a differential dual-path spatial light modulation system based on DMD, such as... Figure 2 As shown, it includes: a high-stability light source 1, a collimating lens 2, a target object 3, an imaging lens 4, a digital micromirror device 5, a first collecting lens 6, a first single-photon detector 7, a second collecting lens 8, a second single-photon detector 9, a time-to-digital converter 10, and a data processing device 11.

[0058] The light source 1 is required to have high stability, and the appropriate light source is selected according to different actual imaging requirements such as high-speed imaging, low-light imaging, photon counting imaging, and non-visible light band imaging.

[0059] The collimating lens 2 converts the divergent light emitted by the light source into parallel light, which then passes through the target object 3. The imaging lens 4 precisely loads the light beam passing through the target object 3 onto the digital micromirror device 5. The host computer of the digital micromirror device 5 controls the matrix... Each row is rearranged in order as follows The two-dimensional binary images are generated and sent to the controller of the digital micromirror device 5. The controller then sequentially loads these patterns onto its micromirror array. Each micromirror of the digital micromirror device switches between two states, guiding the incident light in different directions. The light in the micromirror opening direction (+12°) is denoted as the transmitted light. The light at the micromirror's indirection (-12°) is reflected light. .

[0060] The first collecting lens 6 collects to the maximum extent. The collected light is then focused onto the effective photosensitive area of ​​the first single-photon detector 7; the second collecting lens 8 collects the light to the maximum extent possible. The collected light rays are then focused onto the effective photosensitive area of ​​the second single-photon detector 9. The signals from the first single-photon detector 7 and the second single-photon detector 9 are then converted into a transmission light path measurement vector by the time-to-digital converter 10. and reflected light path measurement vector The data is then input into data processing device 11. The modulation model can be expressed as: ; in To load the matrix, This refers to the noise of the first single-photon detector 7 in the transmission optical path. The noise of the second single-photon detector 9 in the reflected optical path. For ambient light noise, Represents a matrix of all ones. , , , .Will and By taking the difference, we get: .

[0061] Differential processing effectively eliminates common ambient light background noise and laser power fluctuations in both signals, significantly improving the signal-to-noise ratio. The noise of the single-photon detector is negligible if properly selected; therefore, the image reconstruction model can be expressed as: ;in Represents the reconstructed image vector. express The pseudo-inverse matrix, , .Depend on The structural characteristics of, then , For the measurement matrix, we have: Then, switching back to the basic image reconstruction model, since this system is undersampled, for The pseudo-inverse matrix.

[0062] Optionally, the light source 1 can be any one of an LED array light source, an infrared laser light source, or a pseudo-thermal light source; Optionally, the single-photon detector is any one of a superconducting nanowire single-photon detector, a single-photon avalanche diode, and a photomultiplier tube.

[0063] Measurement matrix Sum of difference vectors As input, the TVAL3 reconstruction algorithm is invoked. The image size is set to 64×64, and the sampling rate is 30%. The reconstruction results of different coding modes and modulation optical paths are compared from three indicators: relative error, peak signal-to-noise ratio, and structural similarity.

[0064] See Table 1 below for a comparison of metrics for single-pixel reconstruction of the test_running image at a 30% sampling rate.

[0065] Table 1

[0066] Furthermore, using a subset of images from the Set12 dataset as tests, the image reconstruction effects of different modulation matrices were obtained as follows: Figure 3 As shown, under a 30% sampling rate, the differential Gray-Hadamard matrix modulation reconstruction performance is significantly better than that of the traditional matrix.

[0067] The spatial light modulation method for Gray code rearrangement disclosed in this application can be used in fields such as single-pixel imaging, structured light three-dimensional measurement, through-scattering medium imaging, and optical encrypted communication. It is beneficial to the development of computational optical imaging and advanced light field manipulation technology towards high efficiency, high robustness, and intelligence.

[0068] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A spatial light modulation method of Gray code encoding rearrangement, characterized by, The application relates to a method for reconstructing a target image based on compressive sensing. The total pixel number N is determined according to the resolution of the target image, the measurement number M is determined according to a preset sampling rate, and an NxN-dimensional basis modulation matrix suitable for compressive sensing reconstruction and having excellent algebraic characteristics is selected in combination with the physical characteristics of a spatial light modulator. A natural binary sequence 0 to L-1 is subjected to standard reflection Golay code coding, wherein L is a positive integer not less than M, a Golay code index sequence with a length of L is generated, the binary representation of any adjacent index values in the Golay code index sequence is only different by one bit, and the Golay code index sequence is used for controlling the pattern loading sequence of the spatial light modulator. The first M indexes of the Golay code index sequence are systematically mapped onto the row index set of the basis modulation matrix through a preset mapping function, a new measurement matrix is generated, and the row sequence of the measurement matrix is one-to-one corresponding to the pattern projection sequence of the spatial light modulator. Each row of the measurement matrix is converted into a two-dimensional spatial light modulation pattern matched with the array of modulation units of the spatial light modulator, is sequentially loaded into the spatial light modulator in the row sequence of the measurement matrix, a light source forms a light signal carrying target object information after being transmitted through a target object, the spatial light modulator performs spatial coding on the light signal, two performance-matched single-pixel detectors are synchronously used, the total light intensity responses of the coded light signals under the transmission state and the reflection state of the spatial light modulator are respectively collected, and two measurement vectors containing target object information are obtained. Difference operation is performed on the two measurement vectors to obtain a difference vector, the measurement matrix and the difference vector are input into a compressive sensing reconstruction algorithm, a constrained optimization problem is solved, and an estimated value of an original target image reflecting the physical form of the target object is obtained through reconstruction.

2. The method of claim 1, wherein, The base modulation matrix is selected from Hadamard matrix, Fourier matrix or other deterministic measurement matrix with low coherence; wherein, when the base modulation matrix is Hadamard matrix, if , wherein n is a positive integer, then it is constructed by Sylvester construction method, and the construction process satisfies ; if , wherein k is a positive integer, is an odd prime number, then it is constructed by Legendre symbol construction method, and the matrix elements are generated by the quadratic residue characteristics of the odd prime number .

3. The method of claim 1, wherein, The Gray code index sequence is generated by a bit operation recursion, and an expression of the bit operation recursion is where i is a natural number index starting from 1, is the i th element in the Gray code index sequence. In the generating process, the natural binary sequence 0 to L-1 is first converted into a bit binary sequence, where satisfies satisfies and then the converted binary sequence is encoded bit by bit based on the bit operation recursive formula to obtain a Gray code index sequence.

4. The method of claim 1, wherein, The implementation mode of the mapping function includes linear modulo operation, hash mapping or direct mapping based on a preset lookup table; when the linear modulo operation is adopted, the expression is , wherein is a mapping function, is the i-th element in the Gray code index sequence, ensuring that the mapping result falls within the row index range of 1 to N of the base modulation matrix; when the hash mapping is adopted, the Gray code index is converted into an integer through an improved hash algorithm based on MD5 or SHA, and then is constrained to the row index range of 1 to N through the modulo operation. When a preset lookup table is used for mapping, a one-to-one corresponding relationship between Golay code indexes and basis modulation matrix row indexes is pre-stored in the lookup table, and the construction of the lookup table satisfies the adjacent single-bit jump characteristics of the Golay code sequence and the ordered mapping of the basis matrix row indexes.

5. The method of claim 1, wherein, The measurement matrix satisfies where A is the measurement matrix, i = 1, 2, …, M, is a basis modulation matrix, is a mapping function, is the i-th element in a Gray code index sequence; the elements of the measurement matrix take values including -1 and 1, which are binary working states of a spatial light modulator, wherein the binary working states can only present two physical states, before being loaded to the spatial light modulator, the elements of -1 in the measurement matrix are mapped to 0 to obtain a loading matrix, wherein 1 in the loading matrix corresponds to an opening state of the spatial light modulator, and 0 corresponds to a closing state.

6. The method of claim 1, wherein, The spatial light modulator comprises a digital micromirror device (DMD) or a rotating mask plate; when the digital micromirror device is used, the open state of the micromirror corresponds to the transmission state, and the closed state of the micromirror corresponds to the reflection state.

7. The method of claim 1, wherein, The compressive sensing reconstruction algorithm is selected from a total variation minimization algorithm (TVAL3) based on an augmented Lagrange method and an alternating direction method, a basis pursuit denoising algorithm (BPDN) or an approximate message passing algorithm (AMP); in the solving process, an L1 norm constrained optimization problem is solved through the compressive sensing reconstruction algorithm, the linear corresponding relationship between the measurement matrix and the difference vector is utilized, and the pixel gray value information of the original target image is restored.

8. The method of claim 1, wherein, The preset sampling rate ranges from 10% to 50%, and the measurement frequency is wherein is a preset sampling rate; wherein the sampling rate is adjusted based on a system modulation rate, an imaging time requirement, and / or a peak signal-to-noise ratio of imaging quality.

9. The method of claim 1, wherein, The single-pixel detector is selected from a superconducting nanowire single-photon detector, a single-photon avalanche diode or a photomultiplier tube, the performance parameters of the two single-pixel detectors are ensured to be consistent by setting the values of response speed, detection sensitivity and noise level, in the collection process, the two single-pixel detectors realize synchronous work through a synchronous trigger signal, the total light intensity responses of the scenes under the transmission state and the reflection state of the spatial light modulator are respectively collected in real time, and the time synchronization of the two detection signals is ensured.

10. A spatial light modulation system with Gray code encoding rearrangement, characterized by, The system comprises a light source, an optical transmission module, a spatial light modulation module, a dual-path detection module, a signal conversion module and a data processing module. The light source is used to provide stable incident light, and is selected from an LED array light source, an infrared laser light source or a pseudo-thermal light source, and the wavelength and light intensity are selected according to the requirements of the imaging scene; The optical transmission module comprises a collimating lens, an imaging lens and two collection lenses, the collimating lens is used to convert the divergent light emitted by the light source into parallel light and project it to the target object, the imaging lens is used to accurately transmit the light transmitted through the target object to the modulation unit array of the spatial light modulation module, and the two collection lenses are respectively arranged corresponding to the transmission state light output direction and the reflection state light output direction of the spatial light modulator, and are used to collect the encoded light signals and converge them to the detection surface of the dual-path detection module; The spatial light modulation module is used to receive the light transmitted by the optical transmission module, load a two-dimensional spatial light modulation pattern, and spatially encode the incident light through the physical state switching of the modulation unit; The dual-path detection module comprises two single-pixel detectors with matched performance, which are respectively arranged corresponding to the two collection lenses, and are used to convert the converged light signals into electrical signals, collect the total light intensity responses of the scene corresponding to the transmission state and the reflection state of the spatial light modulation module, and obtain two measurement vectors containing target object information; The signal conversion module is a time-to-digital converter, which is used to convert the analog electrical signals output by the dual-path detection module into digital electrical signals, and synchronously transmit them to the data processing module; The data processing module pre-stores a measurement matrix, receives the digital electrical signals transmitted by the signal conversion module and restores them into two measurement vectors, performs difference operation on the two measurement vectors to obtain a difference vector, inputs the pre-stored measurement matrix and the difference vector into a compressive sensing reconstruction algorithm, solves to obtain the estimated value of the original target image, and outputs the reconstructed image through a display unit or stores the reconstructed image in a storage unit.

Citation Information

Patent Citations

  • Fringe projection three-dimensional shape measurement method based on frequency domain and time domain joint coding

    CN121026011A

  • Low-cost three-dimensional live-action measurement and holographic reconstruction method and system for fringe projection

    CN121067760A

  • Method and system for optimizing depth imaging

    US20210241475A1

  • Imaging system for imaging a scene comprising one or more objects with trasparent surfaces

    WO2024246172A1