A dynamic stripe generation and optical-mechanical burning method and system based on a configuration file

CN122547374BActive Publication Date: 2026-10-27BEIJING BOVISION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610687887.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-19
Publication Date
2026-10-27
Estimated Expiration
2046-05-19

AI Technical Summary

Technical Problem

[0005]综上所述,现有技术将条纹方案的定义、配置、验证与烧录等环节割裂于不同工具与人工操作之中,这种技术现状已难以满足结构光系统在研发快速迭代、多场景自适应部署以及批量生产一致性方面日益增长的需求

Benefits of technology

[0018]本发明实现的有益效果如下:本发明实现了条纹投影方案从配置到烧录的全流程自动化,将方案迭代时间从数小时缩短至数秒,且能在投影前对条纹方案进行纯解析式的质量预判与参数自动寻优,无需物理采集即可筛选出解包裹置信度最优的频率组合。批量生产时,可自动拦截因误配导致的低质量方案,从根本上消除了人为操作差异,保障了所有产品配置的高度一致性。条纹生成算法与质量控制逻辑各自独立,支持即插即用和独立升级,对新算法或硬件的适配无需修改现有系统框架。自适应亮度校正和宽度校正有效补偿了光学系统不均与镜头畸变带来的条纹畸变,参数自动优化机制进一步保障了条纹方案本身的测量可靠性,双重质量保证显著提升了三维重建的精度和稳定性。远程升级仅需分发配置文件并执行烧录即可完成,大幅降低了产品的全生命周期维护成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122547374B_ABST
    Figure CN122547374B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on profile dynamic stripe generation and optical machine burning method and system, it is related to structured light three-dimensional measurement technical field.The method includes: constructing the stripe configuration file including basic parameter layer, scheme definition layer and system control layer, parsing stripe configuration file, target stripe projection scheme section in scheme definition layer is positioned, it is carried out pure analytical expression quality pre-judgment and memory state automatic optimization, obtain hardware timing parameter and algorithm execution parameter, hardware timing parameter is sent to the hardware control unit of optical machine and is configured, based on algorithm execution parameter, call preset stripe generation algorithm module, read the control field of system control layer, dynamically generate stripe image sequence, stripe image sequence is encapsulated as data packet, based on the burning control field of system control layer, data packet is carried out online burning or / with offline burning.The application can improve the precision and stability of three-dimensional reconstruction, greatly reduce the life cycle maintenance cost of product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of structured light three-dimensional measurement technology, and in particular to a method and system for dynamic stripe generation and optomechanical programming based on a configuration file. Background Technology

[0002] Structured light 3D measurement technology, especially structured light systems based on digital light processing (DLP) projectors, has been widely used in machine vision, industrial inspection, and other fields. Its core principle involves projecting a series of precisely coded fringe patterns onto the surface of the object being measured, then simultaneously acquiring the deformed fringes modulated by the object's surface topography using a camera, and finally reconstructing the object's 3D point cloud data using a decoding algorithm. In this process, the encoding strategy, phase quality, contrast, and uniformity of the projected fringes directly determine the accuracy and robustness of the 3D reconstruction.

[0003] In the traditional development, debugging, and production of structured light systems, the generation, configuration, and burning of stripe patterns typically rely on either firmware hard-coding or manual configuration via a dedicated host computer. The firmware hard-coding approach directly compiles the stripe generation algorithm and parameters into the device firmware. Any local adjustment to the stripe strategy requires modifying the underlying source code, recompiling, and burning the entire firmware, resulting in a lengthy development iteration cycle. The dedicated host computer manual configuration approach uses a PC software with a graphical interface for operators to input parameters one by one, which are then sent to the optomechanical hardware via a communication interface. During mass production, each device requires repeated manual operation, which is inefficient and prone to human error, making it difficult to guarantee configuration consistency between different devices. More significantly, both solutions suffer from high hardware-software coupling. The stripe generation algorithm, communication protocol, and hardware control logic are tightly intertwined, making it difficult to independently test, reuse, or replace the algorithm module. Even minor changes to the hardware platform can trigger large-scale refactoring of the host computer software.

[0004] Furthermore, in the formulation and verification of fringe schemes, existing technologies generally lack systematic prediction and automated optimization methods. When determining fringe frequency combinations and related parameters, technicians primarily rely on personal experience, unable to pre-assess the reliability and noise immunity of the selected scheme before programming. The merits of the scheme often only become apparent after a complete 3D reconstruction test, making the scheme debugging process highly trial-and-error, especially when facing different measurement distances, object surface characteristics, or ambient lighting conditions, lacking the ability for rapid adaptive adjustment. On the other hand, practical optomechanical projection systems are limited by factors such as non-uniform illumination of optical components, lens vignetting, and lens distortion, resulting in uneven brightness and width distribution of the stripes projected onto the target surface. Traditional schemes typically lack mechanisms to actively compensate for these systematic errors during the fringe generation stage, and the decline in fringe quality directly restricts further improvement in 3D reconstruction accuracy.

[0005] In summary, existing technologies separate the definition, configuration, verification, and programming of stripe schemes into different tools and manual operations. This current state of technology is no longer able to meet the growing demands of structured light systems in terms of rapid iteration in R&D, adaptive deployment in multiple scenarios, and consistency in mass production. Summary of the Invention

[0006] This invention provides a method for dynamic stripe generation and optomechanical programming based on a configuration file, comprising: Step S1: Construct a stripe configuration file that includes a basic parameter layer, a scheme definition layer, and a system control layer; Step S2: Parse the stripe configuration file, locate the target stripe projection scheme segment in the scheme definition layer, perform pure analytical quality prediction and automatic memory-state optimization, and obtain hardware timing parameters and algorithm execution parameters. Step S3: Send the hardware timing parameters to the hardware control unit of the optical engine for configuration; Step S4: Based on the algorithm execution parameters, call the preset stripe generation algorithm module, read the control fields of the system control layer, and dynamically generate a stripe image sequence; Step S5: Encapsulate the stripe image sequence into a data packet, and perform online or / and offline burning of the data packet based on the burning control field of the system control layer.

[0007] The dynamic stripe generation and optomechanical programming method based on a configuration file, as described above, involves the following sub-steps in constructing the stripe configuration file, which includes a basic parameter layer, a scheme definition layer, and a system control layer: Step S11: Configure the basic parameter layer, including the stripe period mapping table and the phase shift step mapping table; Step S12: Configure a scheme definition layer that includes multiple independent fringe projection scheme segments; Step S13: Configure the system control layer, which includes multiple control fields.

[0008] The dynamic stripe generation and optomechanical programming method based on configuration files, as described above, includes the following sub-steps: parsing the stripe configuration file, locating the target stripe projection scheme segment in the scheme definition layer, performing purely analytical quality prediction and automatic memory-state optimization, and obtaining hardware timing parameters and algorithm execution parameters: Step S21: Analyze each level of the stripe configuration file, construct a memory data structure, locate the target stripe projection scheme segment, and extract hardware timing parameters and algorithm execution parameters; Step S22: Based on the algorithm execution parameters, construct a second-level analytical quality transfer function to quantitatively predict the target fringe projection scheme segment; Step S23: Based on the calibration frequency field in the fringe projection scheme segment, perform parameter optimization and automatically overwrite the algorithm execution parameters.

[0009] The dynamic fringe generation and optomechanical programming method based on configuration files, as described above, includes the following sub-steps: constructing a second-level analytical quality transfer function based on algorithm execution parameters and performing quantitative prediction on the target fringe projection scheme segment: Step S221: Based on the algorithm execution parameters, calculate the phase quality index of each single-frequency fringe in the target fringe projection scheme segment; Step S222: Based on the single-frequency fringe phase quality index, comprehensively evaluate the confidence level during multi-frequency unwrapping and make quantitative predictions on the target fringe projection scheme segment.

[0010] The above-described method for dynamic stripe generation and optical-mechanical programming based on configuration files includes the following sub-steps: Based on algorithm execution parameters, a preset stripe generation algorithm module is invoked, and control fields from the system control layer are read to dynamically generate a stripe image sequence. Step S41: Based on the algorithm execution parameters, call the corresponding pre-registered stripe generation algorithm module to generate the original stripe image sequence; Step S42: Based on the state of the control field of the system control layer, perform adaptive stripe correction on the original stripe image sequence to generate the corrected stripe image sequence.

[0011] The above-described dynamic stripe generation and optomechanical programming method based on configuration files includes the following sub-steps: encapsulating the stripe image sequence into a data packet, and performing online programming and / or offline programming of the data packet based on the programming control field of the system control layer. Step S51: Standardize and encapsulate the stripe image sequence to generate a data packet; Step S52: When the online programming control field in the system control layer is true, start the online programming process; Step S53: When the offline programming control field in the system control layer is true, start the offline programming process.

[0012] This invention also provides a dynamic stripe generation and optomechanical programming system based on a configuration file, comprising: The stripe configuration file building module constructs a stripe configuration file that includes a basic parameter layer, a scheme definition layer, and a system control layer. The parameter acquisition module generates a parameter, parses the stripe configuration file, locates the target stripe projection scheme segment in the scheme definition layer, performs pure analytical quality prediction and automatic memory-state optimization, and obtains hardware timing parameters and algorithm execution parameters. The hardware timing parameter configuration module sends the hardware timing parameters to the hardware control unit of the optical engine for configuration; The stripe image sequence generation module, based on the algorithm execution parameters, calls the preset stripe generation algorithm module, reads the control fields of the system control layer, and dynamically generates a stripe image sequence. The data packet burning module encapsulates the striped image sequence into a data packet and performs online or / and offline burning of the data packet based on the burning control field of the system control layer.

[0013] The above-described dynamic stripe generation and optomechanical programming system based on a configuration file includes a stripe configuration file construction module, which specifically comprises: The basic parameter layer configuration submodule configures the basic parameter layer, including the stripe period mapping table and the phase shift step mapping table. The scheme definition layer configuration submodule configures the scheme definition layer, which includes multiple independent fringe projection scheme segments; The system control configuration submodule configures the system control layer, which includes multiple control fields.

[0014] The dynamic stripe generation and optomechanical programming system based on a configuration file, as described above, includes a generation parameter acquisition module that specifically comprises: The parameter extraction submodule parses each level of the stripe configuration file, constructs a memory data structure, locates the target stripe projection scheme segment, and extracts hardware timing parameters and algorithm execution parameters. The quantitative prediction submodule constructs a two-level analytical quality transfer function based on the algorithm execution parameters to perform quantitative prediction on the target fringe projection scheme segment; The parameter optimization submodule optimizes parameters based on the calibration frequency field in the fringe projection scheme segment and automatically overwrites the algorithm execution parameters.

[0015] The dynamic stripe generation and optomechanical programming system based on configuration files described above includes a quantization prediction submodule, which specifically comprises: The single-frequency fringe phase quality index calculation submodule calculates the phase quality index of each single-frequency fringe in the target fringe projection scheme segment based on the algorithm execution parameters. The unwrapping confidence calculation submodule comprehensively evaluates the confidence level during multi-frequency unwrapping based on the single-frequency fringe phase quality index and performs quantitative prediction of the target fringe projection scheme segment.

[0016] The above-described configuration file-based dynamic stripe generation and optomechanical burning system includes a stripe image sequence generation module, specifically comprising: The original stripe image sequence generation submodule, based on the algorithm execution parameters, calls the corresponding pre-registered stripe generation algorithm module to generate the original stripe image sequence; The stripe image sequence correction submodule performs adaptive stripe correction on the original stripe image sequence based on the state of the control field in the system control layer, generating a corrected stripe image sequence.

[0017] The dynamic stripe generation and optomechanical programming system based on configuration files described above includes, in particular, a data packet programming module comprising: The data packet generation submodule standardizes and encapsulates the stripe image sequence to generate data packets. The online programming submodule starts the online programming process when the online programming control field in the system control layer is true. The offline programming submodule starts the offline programming process when the offline programming control field in the system control layer is true.

[0018] The beneficial effects achieved by this invention are as follows: This invention automates the entire process of fringe projection scheme configuration and programming, reducing the scheme iteration time from hours to seconds. Furthermore, it enables purely analytical quality prediction and automatic parameter optimization of the fringe scheme before projection, allowing for the selection of frequency combinations with optimal unwrapping confidence without physical data acquisition. During mass production, it automatically intercepts low-quality schemes caused by misconfiguration, fundamentally eliminating human error and ensuring high consistency across all product configurations. The fringe generation algorithm and quality control logic are independent, supporting plug-and-play and independent upgrades. Adaptation to new algorithms or hardware requires no modification to the existing system framework. Adaptive brightness and width correction effectively compensate for fringe distortion caused by optical system inconsistencies and lens distortion. The automatic parameter optimization mechanism further ensures the measurement reliability of the fringe scheme itself. This dual quality assurance significantly improves the accuracy and stability of 3D reconstruction. Remote upgrades only require distributing the configuration file and performing programming, greatly reducing the product's lifecycle maintenance costs. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0020] Figure 1 This is a flowchart of a dynamic stripe generation and optomechanical programming method based on a configuration file, provided in Embodiment 1 of this application; Figure 2 This is a schematic diagram of a dynamic stripe generation and optomechanical burning system based on a configuration file, provided in Embodiment 2 of this application. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] Example 1 like Figure 1 As shown, Embodiment 1 of this application provides a method for dynamic stripe generation and optomechanical programming based on a configuration file. The method includes the following steps: Step S1: Construct a stripe configuration file that includes a basic parameter layer, a scheme definition layer, and a system control layer; Specifically, the stripe configuration file is a custom declarative configuration file that adopts the INI (initialization file) syntax specification, with the file extension .dat. It is a plain text format that can be directly edited and read. The stripe configuration file adopts a hierarchical and segmented structure, which is divided into three logical levels from top to bottom: the basic parameter layer, the scheme definition layer, and the system control layer.

[0023] Furthermore, constructing the stripe configuration file, which includes a basic parameter layer, a scheme definition layer, and a system control layer, involves the following sub-steps: Step S11: Configure the basic parameter layer, including the stripe period mapping table and the phase shift step mapping table; Specifically, the basic parameter layer is a globally reusable atomic parameter carrier, which includes two independent configuration segments: the stripe period mapping table [PatternSetName] and the phase shift step mapping table [PatternSetStep]. The two configuration segments form a one-to-one strong binding relationship through the same index number. All stripe projection scheme segments in the scheme definition layer call the parameter mapping relationship of this layer.

[0024] The fringe period mapping table is used to establish a globally unique mapping between index number and fringe period value. Each row is a key-value pair format of "index number = fringe period value". The index number is a unique identifier for calling the fringe period, and the fringe period value is the pixel width of a single fringe period in structured light projection. The phase shift step mapping table is used to establish a globally unique mapping between index number and phase shift step number. Each row is a key-value pair format of "index number = phase shift step number". The phase shift step number is the number of phase-shifted images corresponding to a single period fringe. The fringe period and phase shift step number corresponding to the same index number together constitute a complete set of basic fringe parameters, which are called globally through the index number.

[0025] Step S12: Configure a scheme definition layer that includes multiple independent fringe projection scheme segments; Specifically, the scheme definition layer is a scenario-based scheme carrier, containing one or more independent stripe projection scheme segments named [SchemeX] (Scheme X), where X is the scheme number. Different scheme segments are independent of each other and do not interfere with each other. Multiple schemes on a single device can be preset and freely switched. Each scheme segment is configured with a complete set of stripe projection scheme parameter fields.

[0026] The stripe projection scheme parameter fields specifically include the following fields: index, cT (calibration frequency), rT (reconstruction frequency), step (cycle steps), displayId (display channel number), model (stripe generation mode), exposure (optical engine exposure time), preExposure (waiting time before optical engine exposure), and postExposure (waiting time after optical engine exposure). Among these, index specifies the stripe index sequence used in this scheme, corresponding to the index numbers defined in the stripe period mapping table, and the sequence order is the stripe projection playback order; cT defines the device's global calibration frequency sequence, which is the reciprocal of the stripe period value and includes all stripe period values ​​used in all stripe projection scheme segments of this stripe configuration file; the cT field value is completely consistent across all scheme segments within the same stripe configuration file; rT is used to define... The frequency sequence used in the 3D reconstruction of this fringe projection scheme corresponds one-to-one with the index sequence in the index field, and all values ​​are included in the calibration frequency sequence in the cT field; step is used to define the phase shift step sequence corresponding to the period value of each fringe in this fringe projection scheme, which corresponds one-to-one with the index sequence in the index field; displayId is used to specify the display channel number of the fringe image in video mode, which is compatible with multi-output channel DLP (Digital Light Processing) optical engines; model is used to select the fringe generation mode of this fringe projection scheme, including phase shift mode, complementary binary mode, corrected phase shift mode, binary mode, binary phase shift mode, and cyclic binary phase shift mode. Different modes correspond to different fringe generation algorithms. exposure, preExposure, and postExposure define the exposure time, pre-exposure waiting time, and post-exposure waiting time of a single fringe of the optical engine, respectively, in microseconds.

[0027] Step S13: Configure the system control layer, which includes multiple control fields; Specifically, the system control layer serves as the global control center for the entire workflow, corresponding to the [System] configuration section. All configurations are globally effective, and the global configuration has higher priority than the individual scheme configurations in the scheme definition layer. The control fields configured within this section include isHorizontal (stripe direction control), bitDepth (bit depth control), model (stripe generation mode control), generateBin (offline burning control), burnBin (online burning control), currentScheme (current active scheme number), isB (brightness correction control), isT (width correction control), and isF (reverse image usage control). Among these, isHorizontal specifies the horizontal and vertical direction of the stripes, taking a Boolean value: true for horizontal stripes and false for vertical stripes; bitDepth defines the global stripe image bit depth, controlling the image data storage format and compression method; mod... `el` is the global stripe generation mode, which is the highest priority configuration globally. After configuration, it can override the `model` field in all stripe projection scheme segments. `generateBin` is the switch for generating local offline burning binary files (.bin files). Its value is a boolean value; `true` indicates generating local offline burning files, and `false` indicates disabling. `burnBin` is the switch for online burning via the optical engine. Its value is a boolean value; `true` indicates automatically performing online burning via the serial port, and `false` indicates disabling. The `generateBin` and `burnBin` switches are independent of each other and can be enabled individually or simultaneously. `currentScheme` is used to specify the scheme number activated in this workflow, corresponding to the `[SchemeX]` segment of the scheme definition layer. Only one scheme is activated in a single workflow. `isB`, `isT`, and `isF` are the stripe brightness adaptive correction switch, width adaptive correction switch, and stripe inversion image enable switch, respectively. Their values ​​are boolean values; `true` enables the corresponding function, and `false` disables it.

[0028] Step S2: Parse the stripe configuration file, locate the target stripe projection scheme segment in the scheme definition layer, perform pure analytical quality prediction and automatic memory-state optimization, and obtain hardware timing parameters and algorithm execution parameters. Furthermore, the stripe configuration file is parsed, the target stripe projection scheme segment in the scheme definition layer is located, and pure analytical quality prediction and automatic memory-state optimization are performed on it to obtain hardware timing parameters and algorithm execution parameters, including the following sub-steps: Step S21: Analyze each level of the stripe configuration file, construct a memory data structure, locate the target stripe projection scheme segment, and extract hardware timing parameters and algorithm execution parameters; Specifically, the stripe configuration file is read line by line, and all key-value pairs are stored according to segment names. The plain text configuration content is transformed into a structured data structure that can be directly called in memory. The structure contains three independent data fields, corresponding to the basic parameter layer, scheme definition layer, and system control layer, respectively. The key-value pairs in each data field correspond one-to-one with the segments and fields in the stripe configuration file. After parsing, the currentScheme field value in the system control layer data field is read to determine the target scheme number activated in this workflow. The corresponding [SchemeX] segment is located in the scheme definition layer data field, and two types of generated parameters are extracted: the first type is hardware timing parameters, including exposure, preExposure, postExposure, and displayId; the second type is algorithm execution parameters, including index, cT, rT, step, and model. The model field value in the system control layer data field is read. If it exists and is not empty, its value is used to overwrite the model of the algorithm execution parameters.

[0029] Step S22: Based on the algorithm execution parameters, construct a second-level analytical quality transfer function to quantitatively predict the target fringe projection scheme segment; Furthermore, based on the algorithm execution parameters, a second-level analytical quality transfer function is constructed to perform quantitative prediction of the target fringe projection scheme segment, including the following sub-steps: Step S221: Based on the algorithm execution parameters, calculate the phase quality index of each single-frequency fringe in the target fringe projection scheme segment; Specifically, based on the algorithm execution parameters rT, step, and model, through Calculate the single-frequency fringe phase quality index for each frequency in the rT field of the target fringe projection scheme segment, where, The single-frequency fringe phase quality index. The number of phase shift steps is derived from the step field. for The solution matrix for the standard phase shift step. for The condition number measures the upper bound of the amplification of light intensity measurement error to phase error. For from The stripe generation mode of the field. For stripe generation mode The non-sinusoidal distortion energy of the encoded waveform is the normalized mean square deviation between the actual encoded waveform and the ideal sine wave under the corresponding mode, and different fringe generation modes. The non-sinusoidal distortion energy of the encoded waveform Directly derived from the mathematical definition of stripe coding, when M=0 (phase-shifting mode) or 2 (corrected phase-shifting mode), the ideal waveform is a sine wave. When M=1 (complementary binary mode) or 3 (binary mode), This is the sum of harmonic energies truncated to the 10th order based on the square wave Fourier series; when M=4 (binary phase-shifting mode), The phase shift component is sinusoidal with a distortion energy of 0. The Gray code component takes half of the non-sinusoidal distortion energy of the binary encoded waveform, and the results are synthesized using the root mean square (RMS) method. When M=5 (cyclic binary phase shift mode), To convert the equivalent phase jitter introduced by cyclic coding Hamming distance into distortion energy, The normalized reference energy is a constant, and the energy within one period of an ideal sine wave is taken as the reference energy. For from The stripe frequency of the field is the reciprocal of the stripe period value. For optical-mechanical projection systems at frequency The modulation transfer function value at that point is a system preset, obtained through optomechanical optical characteristic calibration. The optical attenuation compensation factor is determined by the frequency; the higher the frequency, the better. The lower the value, the larger the factor, and the more severely the corresponding equivalent light intensity noise is amplified.

[0030] Step S222: Based on the single-frequency fringe phase quality index, comprehensively evaluate the confidence level during multi-frequency unwrapping and make quantitative predictions on the target fringe projection scheme segment. For each frequency in the rT field sequence The value is stored in a memory data structure and then... Converted to normalized quality weights, where, For the first The quality weight of each stripe frequency For the rT field sequence, the first Each stripe frequency, For frequency The corresponding single-frequency fringe phase quality index, , The total number of frequencies in the rT field sequence. For frequency The corresponding single-frequency fringe phase quality index.

[0031] pass Comprehensive evaluation of the frequency sequence of the rT field The confidence level during multi-frequency unpacking, where... The product of minimum ambiguity distance and frequency gap. The synthesized wave number (the least common multiple of all fringe period values) represents the maximum unambiguous depth range that can be uniquely determined by multi-frequency combination for a frequency sequence. Corresponding periodic sequence (in (i.e., the stripe period value defined in [PatternSetName]). The larger the value, the larger the unambiguous measurement range that the frequency combination can uniquely cover, and the lower the probability of order ambiguity during unpacking. The maximum measurement depth is the maximum measurement depth corresponding to the system's preset projection area in the physical world, determined by the optical-mechanical resolution and measurement distance. This is the exponential saturation term, taking values ​​between 0 and 1, representing the coverage ratio of the unambiguous range relative to the measurement requirement; when Much larger When this term tends to 1, the ambiguity suppression ability is sufficient. much smaller When this term approaches 0, the confidence level is lowered; This represents the total number of frequencies in the rT field sequence. , For the first The quality weight of each stripe frequency The frequency gap is the frequency. With frequency sequence The minimum period difference between other frequencies; For frequency uncertainty, for period measurement uncertainty estimated by the system based on projection resolution, camera resolution and signal-to-noise ratio, and for preset constant; The arctangent mapping maps the ratio of frequency gap to uncertainty to the interval (0, π / 2). When the frequency gap is much larger than the uncertainty, the arctangent tends to π / 2, and the frequency can be clearly distinguished; when the frequency gap is much smaller than the uncertainty, the arctangent tends to 0, and the frequency is almost impossible to reliably distinguish from adjacent frequencies.

[0032] The The value ranges from 0 to 1. The closer the value is to 1, the higher the confidence level of the unwrapping of that frequency combination. The system's preset confidence threshold is 0.9. If the confidence threshold is ≥, skip step S23 and proceed to step S3; when When the confidence threshold is reached, step S23 is automatically triggered to perform parameter optimization.

[0033] Step S23: Based on the calibration frequency field in the fringe projection scheme segment, perform parameter optimization and automatically overwrite the algorithm execution parameters; Specifically, based on the inherent property that the cT field contains all the fringe period values ​​used by all fringe projection scheme segments in this fringe configuration file, the calibration frequency sequence of the cT field of the target fringe projection scheme segment in the current memory data structure is used as the candidate pool. With maximizing the unwrapping confidence as the sole objective, parameter optimization is performed in the candidate pool, and an enumeration search or greedy search strategy is automatically selected according to the sequence length of the cT field.

[0034] When the sequence length of the cT field does not exceed 8, an enumeration search is used. From the cT field sequence, the number of elements with the same length as the original rT field sequence is randomly selected to form multiple candidate frequency combinations (elements within the subset are not selected repeatedly). Since the frequency is the reciprocal of the period value, for each candidate frequency combination, the index number corresponding to each candidate frequency is determined from the stripe period mapping table based on the candidate frequencies. Based on the index number, the phase shift step number corresponding to each frequency is matched from the phase shift step mapping table. The second-level analytical quality transfer function is called to calculate the unwrapping confidence score for each frequency combination, and the optimal frequency combination with the highest unwrapping confidence score is selected. When the sequence length of the cT field is not less than 8, a greedy search strategy is adopted. Taking the original rT field sequence as the initial value, the candidate frequencies in the cT field sequence are replaced bit by bit. Each time a replacement is made, the index number corresponding to the candidate frequency is determined from the stripe period mapping table. According to the index number, the corresponding phase shift number is matched from the phase shift step mapping table. The second-level analytical quality transfer function is called to calculate the unwrapping confidence once. The replacement result with the increased unwrapping confidence is retained until the traversal is completed or the confidence reaches 100%. After the optimization is completed, an optimal frequency combination with a higher unwrapping confidence than the current original rT field sequence is automatically selected.

[0035] In the target fringe projection scheme segment data field of the current memory data structure, the sequence that overwrites the rT field is the optimal frequency combination. Based on the optimal frequency combination, the corresponding index number and phase shift step number are matched one by one from the fringe period mapping table and phase shift step mapping table of the basic parameter layer, and the index field and step field of the algorithm execution parameters are updated. The original fringe configuration file is not modified.

[0036] Step S3: Send the hardware timing parameters to the hardware control unit of the optical engine for configuration; Specifically, hardware timing parameters, including exposure, preExposure, postExposure, and displayId, are extracted from the target fringe projection scheme segment data field of the memory data structure. These parameters are packaged into a standard format configuration instruction frame and sent to the FPGA (hardware control unit) at the optomechanical end via a pre-established serial communication protocol. After receiving the instruction frame, the FPGA parses and updates the configuration values ​​of the corresponding internal function registers, initializes the parameters of the optomechanical projection timing generator, display channel switching module, and exposure control module, and puts the optomechanical into a standby working state that is completely matched with the current fringe projection scheme segment.

[0037] Step S4: Based on the algorithm execution parameters, call the preset stripe generation algorithm module, read the control fields of the system control layer, and dynamically generate a stripe image sequence; Furthermore, based on the algorithm execution parameters, the preset stripe generation algorithm module is called, and the control fields of the system control layer are read to dynamically generate a stripe image sequence, including the following sub-steps: Step S41: Based on the algorithm execution parameters, call the corresponding pre-registered stripe generation algorithm module to generate the original stripe image sequence; Specifically, after the hardware timing parameters of the optical engine are configured, the value of the `model` field in the algorithm execution parameters is read from the memory data structure, and the corresponding pre-registered fringe generation algorithm module is automatically scheduled: when `model` is 0, the standard sinusoidal phase-shift fringe generation module is called; when `model` is 1, the complementary binary fringe generation algorithm module is called; when `model` is 2, the phase-shift fringe generation algorithm module with pre-correction is called; when `model` is 3, the standard binary fringe generation algorithm module is called; when `model` is 4, the Gray code and phase-shift combined fringe generation algorithm module is called; and when `model` is 5, the cyclic binary phase-shift fringe generation algorithm module is called.

[0038] Following the order of the indexes, based on the rT and step fields, the stripe period value and phase shift step number corresponding to each stripe index are obtained sequentially. Combined with the isHorizontal field of the system control layer, an original stripe image with the corresponding stripe period and specified phase shift step number is generated for each stripe index. All original stripe images are stored in memory sequentially according to the projection playback order, forming a continuous sequence of original stripe images.

[0039] Step S42: Based on the state of the control field of the system control layer, perform adaptive stripe correction on the original stripe image sequence to generate a corrected stripe image sequence; Specifically, the isB, isT, and isF fields in the system control layer data domain are read. When isB is true, a pre-acquired standard whiteboard texture image is read, the light field distribution of the entire image is analyzed, and the ratio of the maximum brightness value of the entire image to the actual brightness value of each pixel in the standard whiteboard texture image is calculated to obtain the brightness compensation coefficient for each pixel position. The brightness compensation coefficient is then embedded into the original stripe image. When isT is true, a pre-acquired standard planar wrapping phase image is read, the stripe width variation trend of the entire image is analyzed, and the ratio of the ideal phase gradient of each pixel position to the actual phase gradient of the corresponding pixel in the standard planar wrapping phase image is calculated to obtain the width compensation coefficient for each pixel position. The width compensation coefficient is then embedded into the original stripe image. When both isB and isT are true, brightness correction is performed first, followed by width correction, and the double-corrected stripe image is output. When isF is true, a corresponding grayscale inverted image is generated synchronously for each corrected stripe image, sorted in the order of original image-inverted image, and a high-quality stripe image sequence is output.

[0040] Step S5: Encapsulate the stripe image sequence into a data packet, and perform online or / and offline burning of the data packet based on the burning control field of the system control layer; Furthermore, the stripe image sequence is encapsulated into a data packet, and online or / and offline programming of the data packet is performed based on the programming control field of the system control layer, including the following sub-steps: Step S51: Standardize and encapsulate the stripe image sequence to generate a data packet; Specifically, the stripe image is converted to bit width according to the bitDepth field of the system control layer. When bitDepth is 8, each pixel data occupies 1 byte for direct storage; when bitDepth is 1, bit compression is used to compress 1 bit of data of 8 consecutive pixels into 1 byte for storage, and standardized encapsulation is performed according to the format that can be recognized by the optomechanical hardware to generate data packets.

[0041] Step S52: When the online programming control field in the system control layer is true, start the online programming process; Specifically, the burnBin field value in the system control layer data domain is read. When burnBin is true, the 32-bit cyclic redundancy check (CRC32) value of the encapsulated data packet is calculated and appended to the end of the data packet as a global check. The complete data packet is split into fixed-size (default 1024 bytes) data blocks, each with a unique block number and an independent checksum. Each data block is sent sequentially through the serial communication interface. After each data block is sent, a timeout is started. If a write success confirmation signal is received from the FPGA within the specified time, the next data block is sent. If the data block verification fails or no confirmation signal is received within the timeout, the data block is automatically retransmitted, with a maximum of three retransmissions. If all three retransmissions fail, the programming process is terminated and detailed error information is reported to the user. After all data blocks are successfully sent and the write is confirmed, a programming completion command is sent to the FPGA. Upon receiving the command, the FPGA performs the write completion work of the non-volatile memory and executes a hardware global reset operation to make the newly programmed data packet effective immediately. When burnBin is false, this step is skipped.

[0042] Step S53: When the offline programming control field in the system control layer is true, start the offline programming process; Specifically, the generateBin field value in the system control layer data field is read. When generateBin is true, the encapsulated data packet is serialized according to the binary format specified by the optical engine hardware, generating an offline burning file with the .bin extension and saving it to the local disk. This file can be used for offline distribution, configuration version backup, or subsequent burning operations through a third-party dedicated burning tool. When generateBin is false, this step is skipped.

[0043] Example 2 like Figure 2 As shown, Embodiment 2 of this application provides a dynamic stripe generation and optomechanical programming system based on a configuration file, comprising: Stripe configuration file construction module 21 constructs a stripe configuration file that includes a basic parameter layer, a scheme definition layer, and a system control layer. Furthermore, the stripe configuration file construction module 21 includes the following sub-modules: The basic parameter layer configuration submodule configures the basic parameter layer, including the stripe period mapping table and the phase shift step mapping table. The scheme definition layer configuration submodule configures the scheme definition layer, which includes multiple independent fringe projection scheme segments; The system control configuration submodule configures the system control layer, which includes multiple control fields. The parameter acquisition module 22 generates parameters, parses the stripe configuration file, locates the target stripe projection scheme segment in the scheme definition layer, performs pure analytical quality prediction and automatic memory-state optimization, and obtains hardware timing parameters and algorithm execution parameters. Furthermore, the parameter acquisition module 22 includes the following sub-modules: The parameter extraction submodule parses each level of the stripe configuration file, constructs a memory data structure, locates the target stripe projection scheme segment, and extracts hardware timing parameters and algorithm execution parameters. The quantitative prediction submodule constructs a two-level analytical quality transfer function based on the algorithm execution parameters to perform quantitative prediction on the target fringe projection scheme segment; Furthermore, the quantitative prediction submodule includes the following submodules: The single-frequency fringe phase quality index calculation submodule calculates the phase quality index of each single-frequency fringe in the target fringe projection scheme segment based on the algorithm execution parameters. The unwrapping confidence calculation submodule comprehensively evaluates the confidence level during multi-frequency unwrapping based on the single-frequency fringe phase quality index and performs quantitative prediction of the target fringe projection scheme segment. The parameter optimization submodule optimizes parameters based on the calibration frequency field in the fringe projection scheme segment and automatically overwrites the algorithm execution parameters. The hardware timing parameter configuration module 23 sends the hardware timing parameters to the hardware control unit of the optical engine for configuration; The stripe image sequence generation module 24, based on the algorithm execution parameters, calls the preset stripe generation algorithm module, reads the control fields of the system control layer, and dynamically generates a stripe image sequence. Furthermore, the stripe image sequence generation module 24 includes the following sub-modules: The original stripe image sequence generation submodule, based on the algorithm execution parameters, calls the corresponding pre-registered stripe generation algorithm module to generate the original stripe image sequence; The stripe image sequence correction submodule performs adaptive stripe correction on the original stripe image sequence based on the state of the control field in the system control layer, and generates a corrected stripe image sequence. The data packet burning module 25 encapsulates the striped image sequence into a data packet and performs online burning or / and offline burning of the data packet based on the burning control field of the system control layer; Furthermore, the data packet programming module 25 includes the following sub-modules: The data packet generation submodule standardizes and encapsulates the stripe image sequence to generate data packets. The online programming submodule starts the online programming process when the online programming control field in the system control layer is true. The offline programming submodule starts the offline programming process when the offline programming control field in the system control layer is true. The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for dynamic stripe generation and optomechanical programming based on configuration files, characterized in that, include: Step S1: Construct a stripe configuration file that includes a basic parameter layer, a scheme definition layer, and a system control layer; including the following sub-steps: Step S11: Configure the basic parameter layer, including the stripe period mapping table and the phase shift step mapping table; Step S12: Configure a scheme definition layer that includes multiple independent fringe projection scheme segments; Step S13: Configure the system control layer, which includes multiple control fields; Step S2: Parse the stripe configuration file, locate the target stripe projection scheme segment in the scheme definition layer, perform pure analytical quality prediction and automatic memory-state optimization, and obtain hardware timing parameters and algorithm execution parameters; including the following sub-steps: Step S21: Analyze each level of the stripe configuration file, construct a memory data structure, locate the target stripe projection scheme segment, and extract hardware timing parameters and algorithm execution parameters; Step S22: Based on the algorithm execution parameters, construct a second-level analytical quality transfer function to quantitatively predict the target fringe projection scheme segment; Step S23: Based on the calibration frequency field in the fringe projection scheme segment, perform parameter optimization and automatically overwrite the algorithm execution parameters; Step S3: Send the hardware timing parameters to the hardware control unit of the optical engine for configuration; Step S4: Based on the algorithm execution parameters, call the preset stripe generation algorithm module, read the control fields of the system control layer, and dynamically generate a stripe image sequence; Step S5: Encapsulate the stripe image sequence into a data packet, and perform online or / and offline burning of the data packet based on the burning control field of the system control layer.

2. The method for dynamic stripe generation and optomechanical programming based on a configuration file as described in claim 1, characterized in that, Based on the algorithm execution parameters, a second-level analytical quality transfer function is constructed to perform quantitative prediction of the target fringe projection scheme segment, including the following sub-steps: Step S221: Based on the algorithm execution parameters, calculate the phase quality index of each single-frequency fringe in the target fringe projection scheme segment; Step S222: Based on the single-frequency fringe phase quality index, comprehensively evaluate the confidence level during multi-frequency unwrapping and make quantitative predictions on the target fringe projection scheme segment.

3. The method for dynamic stripe generation and optomechanical programming based on a configuration file as described in claim 1, characterized in that, Based on the algorithm execution parameters, the preset stripe generation algorithm module is called, and the control fields of the system control layer are read to dynamically generate a stripe image sequence, including the following sub-steps: Step S41: Based on the algorithm execution parameters, call the corresponding pre-registered stripe generation algorithm module to generate the original stripe image sequence; Step S42: Based on the state of the control field of the system control layer, perform adaptive stripe correction on the original stripe image sequence to generate the corrected stripe image sequence.

4. The method for dynamic stripe generation and optomechanical programming based on a configuration file as described in claim 1, characterized in that, Encapsulating the striped image sequence into a data packet, and performing online or / and offline programming of the data packet based on the programming control field of the system control layer, includes the following sub-steps: Step S51: Standardize and encapsulate the stripe image sequence to generate a data packet; Step S52: When the online programming control field in the system control layer is true, start the online programming process; Step S53: When the offline programming control field in the system control layer is true, start the offline programming process.

5. A dynamic stripe generation and optomechanical programming system based on a configuration file, characterized in that, include: The stripe configuration file building module constructs a stripe configuration file that includes a basic parameter layer, a scheme definition layer, and a system control layer. The stripe configuration file construction module specifically includes: The basic parameter layer configuration submodule configures the basic parameter layer, including the stripe period mapping table and the phase shift step mapping table. The scheme definition layer configuration submodule configures the scheme definition layer, which includes multiple independent fringe projection scheme segments; The system control configuration submodule configures the system control layer, which includes multiple control fields. The parameter acquisition module parses the stripe configuration file, locates the target stripe projection scheme segment in the scheme definition layer, performs purely analytical quality prediction and automatic memory-state optimization on it, and obtains hardware timing parameters and algorithm execution parameters; the parameter acquisition module specifically includes: The parameter extraction submodule parses each level of the stripe configuration file, constructs a memory data structure, locates the target stripe projection scheme segment, and extracts hardware timing parameters and algorithm execution parameters. The quantitative prediction submodule constructs a two-level analytical quality transfer function based on the algorithm execution parameters to perform quantitative prediction on the target fringe projection scheme segment; The parameter optimization submodule optimizes parameters based on the calibration frequency field in the fringe projection scheme segment and automatically overwrites the algorithm execution parameters. The hardware timing parameter configuration module sends the hardware timing parameters to the hardware control unit of the optical engine for configuration; The stripe image sequence generation module, based on the algorithm execution parameters, calls the preset stripe generation algorithm module, reads the control fields of the system control layer, and dynamically generates a stripe image sequence. The data packet burning module encapsulates the striped image sequence into a data packet and performs online or / and offline burning of the data packet based on the burning control field of the system control layer.

6. The dynamic stripe generation and optomechanical programming system based on a configuration file as described in claim 5, characterized in that, The quantitative prediction submodule specifically includes: The single-frequency fringe phase quality index calculation submodule calculates the phase quality index of each single-frequency fringe in the target fringe projection scheme segment based on the algorithm execution parameters. The unwrapping confidence calculation submodule comprehensively evaluates the confidence level during multi-frequency unwrapping based on the single-frequency fringe phase quality index and performs quantitative prediction of the target fringe projection scheme segment.

Citation Information

Patent Citations

  • Structured light measurement method, device, equipment, storage medium and system

    CN109443239A

  • Configuration file deployment method, system and device, storage medium and electronic equipment

    CN119847626A