Sensor exposure control method, apparatus, device, and storage medium

CN116366999BActive Publication Date: 2026-10-27SUZHOU KEDA TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310308109.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-27
Publication Date
2026-10-27
Estimated Expiration
2043-03-27

AI Technical Summary

Technical Problem

[0004]但上述方案中,通过补充短行来控制传感器曝光的步进精度的误差较大

Benefits of technology

[0035]在本申请涉及的传感器曝光控制方法中,可以先获取到需要同步的电网频率以及采集图像所需要的目标曝光时间,此时可以在传感器的初始帧结构的处于曝光状态的第一区域中,插入曝光消隐区,使得传感器的实际曝光时间满足目标曝光时间的需求;另外由于插入曝光消隐区改变了传感器的帧结构的长度,因此可以在初始帧结构插入曝光消隐区得到的第一帧结构的基础上,再在未处于曝光状态的区域插入周期消隐区,使得不改变图像采集的情况下,使得传感器的帧周期与电网频率匹配,此时传感器更新后的第二帧结构对传感器进行图像采集时,只需要调整一定的时延,就可以保证传感器对在电网频率下的交通灯进行准确地图像采集。上述传感器曝光控制方法,通过插入曝光消隐区和周期消隐区对传感器的曝光时间与帧周期进行控制,其精度最高可达到主控制芯片系统时钟的纳秒级时间精度,提高了传感器的控制精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116366999B_ABST
    Figure CN116366999B_ABST
Patent Text Reader

Abstract

The application relates to a sensor exposure control method, in particular to the technical field of image acquisition. The method comprises the following steps: acquiring a power grid frequency and a target exposure time; based on the target exposure time, an exposure blanking area is inserted in a first area in an initial frame structure of a sensor to obtain a first frame structure; the first area is an area in which the sensor is in an exposure state; based on the power grid frequency and the size of the exposure blanking area, a periodic blanking area is inserted in a second area in the first frame structure of the sensor to obtain a second frame structure; the second area is an area in which the sensor is not in the exposure state; and the sensor is controlled to perform image acquisition according to the second frame structure of the sensor. The above scheme controls the exposure time and the frame period of the sensor by inserting the exposure blanking area and the periodic blanking area, the precision of which can reach the nanosecond level of the system clock of a main control chip, and the control precision of the sensor is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image acquisition technology, specifically to a sensor exposure control method, apparatus, device, and storage medium. Background Technology

[0002] In road surveillance cameras, since most traffic lights are powered by a certain AC power source from the roadside power grid, there is an unavoidable possibility that the video stream is sampled at the peaks and troughs, resulting in color distortion in the captured images.

[0003] To address the aforementioned issues, existing technologies may employ FPGAs to synchronize the power grid phase and sensor image acquisition points. Please refer to [reference needed]. Figure 1 This diagram illustrates the control principle of a sensor in slave mode in the prior art. Two falling edges of the XVS represent the frame length for each configuration, while the XHS represents the line length and number of lines per frame. The first four lines after the falling edge of the XVS are used for communication register configuration. Starting from the fourth line, the sensor shutter exposure time start point is determined based on the configuration register delay, continuing until the fourth line of the next frame marks the end point of the sensor shutter exposure time. At this point, the sensor's global photoelectric-to-analog conversion circuit is activated and stored in the embedded buffer. To synchronize image acquisition with the power grid, the XVS size for the current frame can be calculated by tracking the power grid frequency, and the actual shutter exposure time can be adjusted by adding short lines to the XHS.

[0004] However, in the above scheme, the error in controlling the step accuracy of sensor exposure by supplementing short rows is relatively large. Summary of the Invention

[0005] This application provides a sensor exposure control method, apparatus, device, and storage medium, which improves the stepping accuracy of sensor exposure. The technical solution is as follows.

[0006] On the one hand, a sensor exposure control method is provided, the method comprising:

[0007] Acquire the power grid frequency and target exposure time;

[0008] Based on the target exposure time, an exposure blanking region is inserted into the first region of the initial frame structure of the sensor to obtain the first frame structure; the first region is the region where the sensor is in the exposure state.

[0009] Based on the power grid frequency and the size of the exposure blanking area, a periodic blanking area is inserted into the second region of the first frame structure of the sensor to obtain the second frame structure; the second region is the region where the sensor is not in an exposed state.

[0010] Based on the second frame structure of the sensor, the sensor is controlled to acquire images.

[0011] In another aspect, a sensor exposure control device is provided, the device comprising:

[0012] The data acquisition module is used to acquire the power grid frequency and target exposure time;

[0013] The first insertion module is used to insert an exposure blanking region into a first region in the initial frame structure of the sensor based on the target exposure time to obtain the first frame structure; the first region is the region where the sensor is in the exposure state;

[0014] The second insertion module is used to insert a periodic blanking region into a second region in the frame structure of the sensor based on the power grid frequency and the size of the exposure blanking region to obtain a second frame structure; the second region is the area of ​​the sensor that is not in an exposed state.

[0015] The image acquisition module is used to control the sensor to acquire images based on the second frame structure of the sensor.

[0016] In one possible implementation, the initial frame structure includes M line synchronization signals; the Nth line synchronization signal in the initial frame structure is the end point of the exposure time of the previous frame structure;

[0017] The first region is the area between the (N-1)th line synchronization signal and the Nth line synchronization signal.

[0018] In one possible implementation, the second region is the region between the (N+1)th line synchronization signal and the (N+2)th line synchronization signal.

[0019] In one possible implementation, the device further includes:

[0020] The first comparison module is used to compare the target exposure time with the line length of the line synchronization signal and then round it to obtain a first ratio.

[0021] The starting point determination module is used to take the exposure starting point corresponding to the number of available exposure rows in the initial frame structure as the actual exposure starting point of the frame structure when the first ratio is greater than or equal to the number of available exposure rows in the initial frame structure.

[0022] The starting point determination module is further configured to, when the first ratio is less than the available exposure line length in the initial frame structure, take the first difference between the total line length of the frame structure and the first ratio as the actual exposure starting point of the initial frame structure.

[0023] In one possible implementation, the first insertion module is further configured to determine the entire exposure area based on a second difference between the first ratio and the number of available exposure lines when the first ratio is greater than or equal to the available exposure line length in the initial frame structure;

[0024] The difference between the target exposure time and the product of the line length of the line synchronization signal and the first ratio is determined as the unit step exposure area.

[0025] The size of the exposure blanking area is determined based on the unit step exposure area and the entire line exposure area, and the exposure blanking area is inserted into the first region in the initial frame structure of the sensor.

[0026] In one possible implementation, the first insertion module is further configured to determine the size of the exposure blanking region based on the target exposure time and the difference between the product of the line length of the line synchronization signal and the first ratio when the first ratio is less than the available exposure line length in the initial frame structure, so as to insert the exposure blanking region in a first region of the initial frame structure of the sensor.

[0027] In one possible implementation, the second insertion module is further configured to determine the target frame period based on the power grid frequency;

[0028] The length of the first cycle is determined by the number of rows and the length of the row synchronization signal.

[0029] The sum of the first cycle length and the length of the exposure blanking region is determined as the second cycle length;

[0030] The difference between the target frame period and the second period length is determined as the length of the period blanking region, so that the period blanking region is inserted in the second region of the first frame structure of the sensor.

[0031] In another aspect, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the sensor exposure control method described above.

[0032] In another aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored therein, the at least one instruction being loaded and executed by a processor to implement the sensor exposure control method described above.

[0033] In another aspect, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the aforementioned sensor exposure control method.

[0034] The technical solution provided in this application may include the following beneficial effects:

[0035] In the sensor exposure control method disclosed in this application, the required grid frequency for synchronization and the target exposure time for image acquisition can be obtained first. Then, an exposure blanking region can be inserted into the first region of the initial frame structure of the sensor, which is in the exposure state, so that the actual exposure time of the sensor meets the target exposure time requirement. Furthermore, since inserting the exposure blanking region changes the length of the sensor's frame structure, a periodic blanking region can be inserted into the region not in the exposure state of the first frame structure obtained by inserting the exposure blanking region into the initial frame structure. This allows the sensor's frame period to match the grid frequency without changing the image acquisition. When the sensor's updated second frame structure acquires images, only a certain time delay needs to be adjusted to ensure accurate image acquisition of traffic lights at the grid frequency. The above sensor exposure control method, by inserting exposure blanking regions and periodic blanking regions to control the sensor's exposure time and frame period, can achieve a precision up to the nanosecond level of the main control chip's system clock, thus improving the sensor's control accuracy. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0037] Figure 1 A schematic diagram of the control principle of a sensor in slave mode in the prior art is shown.

[0038] Figure 2 This is a schematic diagram of a sensor control system according to an exemplary embodiment.

[0039] Figure 3 This is a flowchart illustrating a sensor exposure control method according to an exemplary embodiment.

[0040] Figure 4This is a flowchart illustrating a sensor exposure control method according to an exemplary embodiment.

[0041] Figure 5 A schematic diagram of an adjusted frame structure according to an embodiment of this application is shown.

[0042] Figure 6 A schematic diagram of a sensor exposure control device according to an embodiment of this application is shown.

[0043] Figure 7 This is a schematic diagram of a computer device provided according to an exemplary embodiment of this application. Detailed Implementation

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

[0045] It should be understood that the term "instruction" mentioned in the embodiments of this application can be a direct instruction, an indirect instruction, or an indication of a relationship. For example, A instructing B can mean that A directly instructs B, such as B being able to obtain information through A; it can also mean that A indirectly instructs B, such as A instructing C, so B can obtain information through C; or it can mean that there is a relationship between A and B.

[0046] In the description of the embodiments of this application, the term "correspondence" may indicate that there is a direct or indirect correspondence between two things, or that there is an association between two things, or that there is a relationship of instruction and being instructed, configuration and being configured, etc.

[0047] In the embodiments of this application, "predefined" can be achieved by pre-storing corresponding codes, tables or other means that can be used to indicate relevant information in the device (e.g., including terminal devices and network devices). This application does not limit the specific implementation method.

[0048] Figure 2 This is a schematic diagram illustrating the structure of a sensor control system according to an exemplary embodiment. The system includes at least a main control chip 210 and a sensor 220.

[0049] In this embodiment, the main control chip 210 can implement the functions of at least three modules. Optionally, the main control chip 210 can be implemented by a computer device, such as a computer device with a central processing unit and memory; the main control chip 210 can also be implemented by a digital signal processor (DSP), a field-programmable gate array (FPGA), or other devices with data processing capabilities.

[0050] The main control chip 210 can be used to receive sinusoidal signals from the power grid in real time. Optionally, when the power grid sinusoidal signal passes through a voltage transformer and a zero-crossing detection circuit to generate an input signal i_power_wave, this input signal i_power_wave is input to the main control chip 210. The input signal i_power_wave is then processed by a filter to obtain a square wave signal. The filtering principle is as follows: continuously acquire data for a period of time T (µs). If the signal transitions between low and high levels and remains stable, it is considered an edge. If n frames (e.g., 25 frames) are continuously checked and the pulse width is within the national standard's allowable range, the power grid signal is locked; otherwise, if n frames (e.g., 25 frames) are not checked and the pulse width is not within the national standard's allowable range, the power grid signal is unlocked. After filtering, the quality of the acquired power grid signal is guaranteed to be stable, preventing misjudged frame signals and ensuring image quality under the national standard jitter requirements for the power grid.

[0051] In the main control chip 210, after obtaining the square wave signal generated by the power grid signal through the filter, the phase and period of the square wave signal can be determined. At this time, the input power grid period can be averaged and filtered to obtain a more accurate power grid period.

[0052] Once the accurate power grid cycle is obtained, the frame structure of the video frame signal can be adjusted according to the power grid cycle to make the frame cycle of the video frame signal consistent with the power grid cycle. At this time, the main control chip can also adjust the phase of the video frame signal and the phase of the power grid signal. When the phase of the video frame signal and the phase of the power grid signal are less than a certain phase difference, the image acquired by the video frame signal is the image when the power grid signal is close to the peak. Therefore, power grid synchronization can be stopped to ensure the stability of the video frame cycle.

[0053] Optionally, the sensor 220 can be an image sensor, which includes a configuration register. During the adjustment of the video frame structure by the main control chip 210, the main control chip 210 can adjust the configuration information stored in the configuration register, so that the sensor 220 can perform exposure operation according to the adjusted configuration information, thereby realizing exposure control of the sensor 220.

[0054] Figure 3 This is a flowchart illustrating a sensor exposure control method according to an exemplary embodiment. The method is executed by a computer device, which may optionally be such as... Figure 2 The main control chip 210 in the sensor control system shown can adjust the configuration registers in the sensor to control the sensor exposure. Figure 3 As shown, the sensor exposure control method may include the following steps:

[0055] Step 301: Obtain the power grid frequency and target exposure time.

[0056] The power grid frequency is the power grid frequency of the target area acquired by the sensor, and the target exposure time is the exposure time required for the sensor to acquire image data. Optionally, since the target area is the area where the sensor needs to acquire images, in this embodiment, the video frame period of the sensor needs to be matched with the power grid period of the target area while meeting the target exposure time.

[0057] Optionally, the sensor in this embodiment has multiple operating modes, each with different exposure accuracy requirements, and therefore corresponding to different exposure times. After determining the sensor's operating mode, the main control chip can determine the corresponding target exposure time based on that mode.

[0058] Optionally, the sensors in this embodiment can be different models of sensors, and the physical parameters of different models of sensors are also different. Therefore, the exposure accuracy requirements of different models of sensors are also different. In this embodiment, the main control chip can perform exposure control on different models of sensors. Therefore, the main control chip can first obtain the model and working mode of the sensor to be controlled, thereby determining the target exposure time.

[0059] Optionally, the target exposure time can be pre-stored in the storage module corresponding to the main control chip (e.g., internal register or external storage device). Once the main control chip determines the model and operating status of the sensor to be controlled, it can determine the corresponding target exposure time from the storage module. Alternatively, in another possible implementation, when the main control chip needs to control the exposure of the sensor, it can directly determine the target exposure time for the current operating mode from the sensor's configuration register.

[0060] Step 302: Based on the target exposure time, an exposure blanking region is inserted into the first region of the initial frame structure of the sensor to obtain the first frame structure.

[0061] Optionally, the initial frame structure of the sensor is the default frame structure of the sensor before it is modified by the main control chip.

[0062] In this embodiment, the first region is the region where the sensor is in exposure mode. In the existing frame structure of a sensor, there are usually several frame synchronization signals, each of which contains several line synchronization signals. The interval between two frame synchronization signals represents one frame cycle of the sensor, and there are several line synchronization signals between two frame synchronization signals. The sensor can perform operations such as communicating with the sensor's configuration register, sensor exposure, and image output between these line synchronization signals.

[0063] In one possible implementation, there are P line synchronization signals between every two frame synchronization signals. After the first frame synchronization signal is triggered, when Q line synchronization signals are triggered, the sensor begins the preset operations corresponding to this frame, such as communicating with the configuration register. After completing the preset operations corresponding to this frame, the exposure operation begins and continues until the Qth line synchronization signal is triggered after the next frame synchronization signal is triggered. When the Qth line synchronization signal is triggered after the next frame synchronization signal is triggered, the process of this frame ends, and the sensor continues to start the preset operations of the next frame.

[0064] Optional, for example, in such Figure 1 In the frame structure of the sensor shown, the frame synchronization signal is XVS, and the falling edge of XVS is valid. The line synchronization signal is XHS (which can also be valid on the falling edge). The sensor can be set so that when the falling edge of the fourth line synchronization signal after the first falling edge of XVS is reached, the exposure of the previous frame of the sensor ends and the sensor enters the processing of a new image frame.

[0065] Optionally, the solution in this embodiment can also be implemented in other sensors with similar logic. For example, the frame synchronization signal of the sensor involved in the solution in this embodiment can be active on the rising edge, and the line synchronization signal can be active on either the rising edge or the falling edge. Optionally, the exposure time of the sensor can continue until the triggering time of any line synchronization signal after the next frame synchronization signal; optionally, the exposure time of the sensor can also continue until the triggering time of the next frame synchronization signal.

[0066] Similarly, as Figure 1 Taking the sensor shown as an example, when the sensor enters the processing of a new image frame, it does not immediately begin a new round of exposure. Instead, it requires a delay before starting the new exposure process. This new round of exposure continues until the fourth line of the next image frame.

[0067] Therefore, in one possible implementation of this application embodiment, the first region can be the first N rows of the sensor's frame structure. In this case, an exposure blanking region (i.e., blanking) is inserted into the first region of the sensor's initial frame structure. The resulting first frame structure can change the duration of the sensor's exposure state so that the exposure duration of the sensor in each frame meets the target exposure duration. If short rows (i.e., line synchronization signals) are directly inserted into the sensor's frame structure, both the change in period and the change in exposure duration must be integer multiples of the duration of the line synchronization signal, resulting in lower control precision. Compared to directly inserting short rows, the size of the exposure blanking region can be flexibly controlled, allowing the control precision of the sensor's exposure duration to reach the nanosecond level of the main control chip's system clock.

[0068] Step 303: Based on the power grid frequency and the size of the exposure blanking area, a periodic blanking area is inserted into the second region of the first frame structure of the sensor to obtain the second frame structure; the second region is the area where the sensor is not in an exposed state.

[0069] In this embodiment, the initial frame structure contains a first region and a second region. The first region in the initial frame structure is the region where the sensor is configured to be in an exposure state; the second region in the initial frame structure is the region where the sensor is not configured to be in an exposure state. In step 302, the main control chip inserts an exposure blanking region into the first region in the initial frame structure. At this time, the first region of the initial frame structure changes, while the second region in the initial frame structure does not change, thus transforming into a new first frame structure.

[0070] Similarly, the main control chip can also insert a periodic blanking region into the second region of the first frame structure, thereby changing the second region of the first frame structure and transforming the first frame structure into the second frame structure.

[0071] In real-world applications, the power grid may experience fluctuations, causing changes in its frequency. Therefore, after acquiring the power grid frequency in real time, the frame structure of the sensor needs to be adjusted so that the frequency of the images acquired by the sensor corresponds to the real-time power grid frequency.

[0072] In this embodiment, the initial frame structure of the sensor is predetermined; that is, the duration of each line and the number of lines in the initial frame structure can be determined in advance. Furthermore, since the main control chip modifies the initial frame structure in step 302 by inserting an exposure blanking region in the first region, thereby changing the length of the initial frame structure, the main control chip can then insert a periodic blanking region in the second region of the first frame structure based on the changed length, thus ensuring that the image acquisition frequency corresponding to the frame structure corresponds to the power grid frequency.

[0073] Furthermore, since this second region is the area where the sensor is not in an exposed state, inserting a periodic blanking region in this second region will not affect the sensor's exposure process.

[0074] Step 304: Based on the second frame structure of the sensor, control the sensor to perform image acquisition.

[0075] Optionally, the main control chip can modify the information stored in the configuration register within the sensor to change the sensor's frame structure. When the sensor is in operation, based on the modified second frame structure, controlling the sensor to acquire images ensures that the image acquisition frame period corresponds to the power grid frequency in real time. When the power grid frequency fluctuates or shifts, the image acquisition frame period will also change accordingly. Furthermore, the exposure time during image acquisition can meet the set requirements.

[0076] In summary, the sensor exposure control method of this application first obtains the grid frequency to be synchronized and the target exposure time required for image acquisition. Then, an exposure blanking region can be inserted into the first region of the initial frame structure of the sensor, which is in the exposure state, so that the actual exposure time of the sensor meets the target exposure time requirement. Furthermore, since inserting the exposure blanking region changes the length of the sensor's frame structure, a periodic blanking region can be inserted into the region not in the exposure state of the first frame structure obtained by inserting the exposure blanking region into the initial frame structure. This allows the sensor's frame period to match the grid frequency without changing the image acquisition. When the sensor's updated second frame structure acquires images, only a certain time delay needs to be adjusted to ensure accurate image acquisition of traffic lights at the grid frequency. The above sensor exposure control method, by inserting exposure blanking regions and periodic blanking regions to control the sensor's exposure time and frame period, can achieve a precision up to the nanosecond level of the main control chip's system clock, thus improving the sensor's control accuracy.

[0077] Figure 4 This is a flowchart illustrating a sensor exposure control method according to an exemplary embodiment. The method is executed by a computer device, which may optionally be such as... Figure 1 The main control chip 210 in the sensor control system shown can adjust the configuration registers in the sensor to control the sensor exposure. Figure 4 As shown, the sensor exposure control method may include the following steps:

[0078] Step 401: Obtain the power grid frequency and target exposure time.

[0079] In one possible implementation of this application embodiment, the sensor can be a sensor in a surveillance camera used for road traffic monitoring. When the surveillance camera collects data on traffic lights on the road in the target area, in order to avoid sampling peaks and troughs in the video stream, which could lead to a red-green color cast in the collected images, the sensor's image acquisition frequency needs to be consistent with the power grid frequency. However, since the power grid frequency may shift or fluctuate in real-world scenarios, this application embodiment can first collect the power grid frequency in the target area in real time through the main control chip.

[0080] Setting the sensor's image acquisition frequency to match the power grid frequency causes variations in the frame time of each image acquisition. Since the sensor typically requires a certain exposure time to ensure image acquisition accuracy, the exposure time must be guaranteed when changing the sensor's image acquisition frequency. Therefore, the main control chip needs to first obtain the preset target exposure time, and use the sensor's actual exposure time meeting the target exposure time and the sensor's image acquisition frequency matching the power grid as adjustment targets to configure the sensor's internal configuration registers.

[0081] In one possible implementation, when for such Figure 1 When the corresponding sensor performs exposure control, the initial frame structure of the sensor includes M line synchronization signals (that is, as shown in the image). Figure 1 In the XHS, the initial frame structure is the region between the two falling edges of XVS; the Nth line sync signal in the initial frame structure is the end point of the exposure time of the previous frame structure.

[0082] Specifically, in this sensor, every two falling edges of the XVS represent the sequential configuration of the frame length, while the XHS represents the number of line sync signals that make up each frame. The first four lines after the first falling edge of the XVS (i.e., the first four line sync signals) are generally used for communication with the configuration register. Starting from the fourth line, the exposure time start point of the current frame can be determined according to the delay time configured in the configuration register. The sensor starts the exposure from this exposure time start point until the fourth line at the second falling edge of the XVS ends the exposure.

[0083] Step 402: Compare the target exposure time with the line length of the line synchronization signal and round down to obtain the first ratio.

[0084] When the target exposure time is obtained, it can first be compared with the line length of the line synchronization signal to determine how many lines (that is, how many line synchronization signals) are needed for the target exposure time.

[0085] Step 403: When the first ratio is greater than or equal to the number of available exposure rows in the initial frame structure, the exposure start point corresponding to the number of available exposure rows is taken as the actual exposure start point of the initial frame structure.

[0086] In this embodiment, the initial frame structure contains a number of available exposure rows, which is the difference between the total number of rows in the initial frame structure and the minimum exposure start row number of the initial frame structure. Due to the characteristics of the sensor, it is known that before exposure, the sensor needs to communicate with the configuration register for a period of time to configure its own operating process. Therefore, the sensor has a minimum exposure start row number (generally a fixed value corresponding to the sensor model). Thus, based on the exposure requirements, the sensor determines the exposure start point after the minimum exposure start row number's line synchronization signal, starting from the initial frame structure, and ends the exposure at the exposure end point corresponding to the initial frame structure. Optionally, the exposure end point corresponding to the initial frame structure can be triggered at the Qth line synchronization signal of the next frame structure (corresponding to...). Figure 1 (The fourth line in the text).

[0087] When the first ratio is greater than or equal to the number of available exposure rows in the initial frame structure, the sensor may not be able to meet the target exposure time even after the line synchronization signal of the minimum exposure start row number has passed since the start of the initial frame structure. Therefore, it is necessary to use all available exposure rows in the initial frame structure for exposure. That is, the exposure start point corresponding to the number of available exposure rows (that is, the time after the minimum exposure start row number has passed since the start of the initial frame structure) is taken as the actual exposure start point. An exposure blanking area is then added based on the target exposure time and the actual exposure start point.

[0088] Step 404: When the first ratio is less than the available exposure line length in the initial frame structure, the first difference between the total line length of the initial frame structure and the first ratio is taken as the actual exposure starting point of the initial frame structure.

[0089] In another possible implementation, when the first ratio is less than the number of available exposure rows in the initial frame structure, the number of available exposure rows in the initial frame structure is already sufficient to meet the target exposure time. In this case, it is only necessary to select the number of rows of the first ratio before the fourth row of the next frame structure for exposure.

[0090] The above steps can be described by the following formula:

[0091]

[0092] In the above formula, n 曝光启动行数 This refers to the exposure start line number, which is the number of lines from the end of the previous frame structure to the exposure start point of the current frame, T. 行长 The length of the horizontal synchronization signal. The first ratio, n 行数 n is the total number of rows in the initial frame structure. mindelay The minimum exposure start line number, (n 行数 - mindelay This represents the number of lines available for exposure; when the first ratio is greater than or equal to the number of lines available for exposure, 曝光启动行数 = mindelay When the first ratio is less than the number of available exposure rows,

[0093] Step 405: Based on the target exposure time, an exposure blanking region is inserted into the first region of the sensor's frame structure to obtain the first frame structure; the first region is the region where the sensor is in the exposure state.

[0094] The first region is the area between the (M-1)th line synchronization signal and the Mth line synchronization signal.

[0095] After calculating the actual exposure start point of the sensor in the current initial frame structure, the sensor can start the exposure operation from this actual exposure start point during actual operation until the Mth line synchronization signal in the next frame structure (e.g., the fourth line of the next frame structure) ends the exposure process corresponding to the current initial frame structure.

[0096] Since the exposure process of the current initial frame structure of the Mth line sync signal ends, inserting blanking (i.e., exposure blanking region) in the region between the (M-1)th and the Mth line sync signals and changing the initial frame structure to the first frame structure can extend the exposure time of the current frame and adjust the exposure accuracy.

[0097] Furthermore, the length of the blanking inserted between the (M-1)th line synchronization signal and the Mth line synchronization signal can be determined in the following way.

[0098] In one possible implementation, when the first ratio is greater than or equal to the available exposure line length in the initial frame structure, the entire line exposure area is determined based on the second difference between the first ratio and the number of available exposure lines; the difference between the target exposure time and the product of the line length of the line synchronization signal and the first ratio is determined as the unit step exposure area; the size of the exposure blanking area is determined based on the unit step exposure area and the entire line exposure area, and the exposure blanking area is inserted into the first region in the frame structure of the sensor.

[0099] In another possible implementation, when the first ratio is less than the available exposure line length in the initial frame structure, the size of the exposure blanking region is determined based on the target exposure time and the difference between the product of the line length of the line synchronization signal and the first ratio, so that the exposure blanking region is inserted in the first region of the sensor's frame structure.

[0100] The above process can be described using the following formula:

[0101]

[0102] In the above formula, The first ratio, (n) 行数 - mindelay () represents the number of available exposure rows.

[0103] When the first ratio is greater than or equal to the number of available exposure lines, it means that the number of available exposure lines may not be able to meet the exposure requirements. Therefore, blanking needs to be inserted into the initial frame structure to extend the exposure time. This blanking includes two parts: one part is the full line exposure, and the other part is the unit step exposure (that is, the part that is not long enough for the line synchronization signal).

[0104] The total number of rows exposed (n) 整行曝光 When the first ratio is greater than the number of available exposure rows, it can be taken as... Exposure time of a unit step exposure The total exposure time T of the hidden area at this point is... 额外曝光 =T 单位步进曝光 +T 行长 ×n 整行曝光 .

[0105] When the first ratio is less than the number of available exposure lines, it means that the number of available exposure lines can meet the exposure requirements. Therefore, it is only necessary to insert blanking corresponding to the unit step exposure portion in the initial frame structure to precisely adjust the exposure accuracy. At this time, the number of full line exposure lines n of the full line portion is... 整行曝光 The exposure time is 0; therefore, the total exposure time T of the blanking region is 0 at this point. 额外曝光 For T 单位步进曝光 .

[0106] Step 406: Based on the power grid frequency and the size of the exposure blanking area, a periodic blanking area is inserted into the second region of the sensor's frame structure to obtain a second frame structure; the second region is the area where the sensor is not in an exposed state.

[0107] In one possible implementation, the second region is the area between the (M+1)th line synchronization signal and the (M+2)th line synchronization signal. For example, in... Figure 1 In the corresponding sensor, the second region can be the area between the 5th and 6th rows after the falling edge of the XVS. Optionally, in other sensors, exposure begins after 8 line synchronization signals following the frame synchronization signal; in this case, the second region is the area between the 9th and 10th line synchronization signals.

[0108] By inserting a blanking segment (i.e., a periodic blanking region) in the area between the (M+1)th and (M+2)th line synchronization signals, the frame period variation caused by grid jitter can be adjusted. For example, by... Figure 1 As can be seen from the corresponding principle, the current frame exposure will start after a delay after the previous frame exposure ends in the fourth line. This is to protect the sensor so that it can stably acquire, convert and store the previous frame video data. Therefore, adjusting the frame period here will not affect the actual video image.

[0109] In one possible implementation, the target frame period is determined based on the power grid frequency; the first period length is determined by the number of lines of the line synchronization signal and the line length of the line synchronization signal; the sum of the first period length and the length of the exposure blanking region is determined as the second period length; the difference between the target frame period and the second period length is determined as the length of the periodic blanking region, so as to insert the periodic blanking region in the second region of the first frame structure of the sensor.

[0110] In other words, once the frame period T that needs to be adjusted is determined... 帧周期 When (that is, the period corresponding to the power grid frequency) is reached, the total number of rows n of the line synchronization signal in the current first frame structure can be used as a reference. 行数 And the line length T of the line synchronization signal 行长 And the increased exposure blanking area T 额外曝光 Through T 帧周期调整 =T 帧周期 -n 行数 ×T 行长 -T 额外曝光 Determine the length T of the periodic blanking region to be inserted. 帧周期调整 .

[0111] Step 407: Based on the second frame structure of the sensor, control the sensor to perform image acquisition.

[0112] The main control chip can change the frame structure by adjusting the configuration information in the sensor's configuration register. For example, to adjust the frame structure of sensor 1, please refer to [reference needed]. Figure 5 This illustrates a schematic diagram of an adjusted frame structure according to an embodiment of this application. Figure 5 As shown, the time between two falling edges of XVS is used as an initial frame structure. Blanking is inserted between the fifth and sixth rows of the first falling edge of XVS, and the size of the blanking can be dynamically adjusted according to the power grid frequency detected during power grid synchronization. Blanking is inserted between the third and fourth rows of the second falling edge of XVS to adjust the exposure time in the initial frame structure.

[0113] When the sensor is working, it can first communicate with the configuration register and then acquire images according to the configuration information recorded in the configuration register, thereby enabling the sensor's exposure to follow the power grid frequency.

[0114] In existing technologies, adjusting the video frame stream phase synchronization with the power grid and adjusting the exposure step accuracy are typically achieved by adding short lines. However, during sensor debugging, it was found that these sensors primarily use the edges of the XHS / XVS to determine the frame structure of each frame and use internal register parameters to determine the exposure start point. If the short line function is separated, it will have the same meaning as adding line blanking. Furthermore, adding line blanking has higher accuracy than adding short lines, without requiring extensive precision conversion. In extreme cases, its accuracy can reach the nanosecond level of the main control chip's system clock, thereby achieving a high-precision exposure control strategy. Moreover, in the solution shown in the embodiments of this application, it is not necessary to calculate the number of lines to be adjusted; the exposure time and frame period to be adjusted can be directly achieved by inserting blanking, reducing the computational load on the main control chip during the sensor exposure control process.

[0115] It should be noted that, Figure 1 The frame structure of the sensor in the embodiment is an illustrative frame structure. In each step shown in the embodiments of this application, except for the following... Figure 1 In addition to controlling the exposure of the corresponding sensor, other sensors with similar frame structures can also be controlled. The specific model of the sensor is not limited in the embodiments of this application.

[0116] In summary, the sensor exposure control method of this application first obtains the grid frequency to be synchronized and the target exposure time required for image acquisition. Then, an exposure blanking region can be inserted into the first region of the initial frame structure of the sensor, which is in the exposure state, so that the actual exposure time of the sensor meets the target exposure time requirement. Furthermore, since inserting the exposure blanking region changes the length of the sensor's frame structure, a periodic blanking region can be inserted into the region not in the exposure state of the first frame structure obtained by inserting the exposure blanking region into the initial frame structure. This allows the sensor's frame period to match the grid frequency without changing the image acquisition. When the sensor's updated second frame structure acquires images, only a certain time delay needs to be adjusted to ensure accurate image acquisition of traffic lights at the grid frequency. The above sensor exposure control method, by inserting exposure blanking regions and periodic blanking regions to control the sensor's exposure time and frame period, can achieve a precision up to the nanosecond level of the main control chip's system clock, thus improving the sensor's control accuracy.

[0117] Please refer to Figure 6The diagram illustrates a structural schematic of a sensor exposure control device according to an embodiment of this application. The device includes:

[0118] Data acquisition module 601 is used to acquire power grid frequency and target exposure time;

[0119] The first insertion module 602 is used to insert an exposure blanking region into a first region in the initial frame structure of the sensor based on the target exposure time to obtain a first frame structure; the first region is the region where the sensor is in the exposure state.

[0120] The second insertion module 603 is used to insert a periodic blanking region into a second region in the frame structure of the sensor based on the power grid frequency and the size of the exposure blanking region to obtain a second frame structure; the second region is the region where the sensor is not in an exposed state.

[0121] The image acquisition module 604 is used to control the sensor to acquire images based on the second frame structure of the sensor.

[0122] In one possible implementation, the initial frame structure includes M line synchronization signals; the Nth line synchronization signal in the initial frame structure is the end point of the exposure time of the previous frame structure;

[0123] The first region is the area between the (N-1)th line synchronization signal and the Nth line synchronization signal.

[0124] In one possible implementation, the second region is the region between the (N+1)th line synchronization signal and the (N+2)th line synchronization signal.

[0125] In one possible implementation, the device further includes:

[0126] The first comparison module is used to compare the target exposure time with the line length of the line synchronization signal and then round it to obtain a first ratio.

[0127] The starting point determination module is used to take the exposure starting point corresponding to the number of available exposure rows in the initial frame structure as the actual exposure starting point of the frame structure when the first ratio is greater than or equal to the number of available exposure rows in the initial frame structure.

[0128] The starting point determination module is further configured to, when the first ratio is less than the available exposure line length in the initial frame structure, take the first difference between the total line length of the frame structure and the first ratio as the actual exposure starting point of the initial frame structure.

[0129] In one possible implementation, the first insertion module is further configured to determine the entire exposure area based on a second difference between the first ratio and the number of available exposure lines when the first ratio is greater than or equal to the available exposure line length in the initial frame structure;

[0130] The difference between the target exposure time and the product of the line length of the line synchronization signal and the first ratio is determined as the unit step exposure area.

[0131] The size of the exposure blanking area is determined based on the unit step exposure area and the entire line exposure area, and the exposure blanking area is inserted into the first region in the initial frame structure of the sensor.

[0132] In one possible implementation, the first insertion module is further configured to determine the size of the exposure blanking region based on the target exposure time and the difference between the product of the line length of the line synchronization signal and the first ratio when the first ratio is less than the available exposure line length in the initial frame structure, so as to insert the exposure blanking region in a first region of the initial frame structure of the sensor.

[0133] In one possible implementation, the second insertion module is further configured to determine the target frame period based on the power grid frequency;

[0134] The length of the first cycle is determined by the number of rows and the length of the row synchronization signal.

[0135] The sum of the first cycle length and the length of the exposure blanking region is determined as the second cycle length;

[0136] The difference between the target frame period and the second period length is determined as the length of the period blanking region, so that the period blanking region is inserted in the second region of the first frame structure of the sensor.

[0137] In summary, the sensor exposure control method of this application first obtains the grid frequency to be synchronized and the target exposure time required for image acquisition. Then, an exposure blanking region can be inserted into the first region of the initial frame structure of the sensor, which is in the exposure state, so that the actual exposure time of the sensor meets the target exposure time requirement. Furthermore, since inserting the exposure blanking region changes the length of the sensor's frame structure, a periodic blanking region can be inserted into the region not in the exposure state of the first frame structure obtained by inserting the exposure blanking region into the initial frame structure. This allows the sensor's frame period to match the grid frequency without changing the image acquisition. When the sensor's updated second frame structure acquires images, only a certain time delay needs to be adjusted to ensure accurate image acquisition of traffic lights at the grid frequency. The above sensor exposure control method, by inserting exposure blanking regions and periodic blanking regions to control the sensor's exposure time and frame period, can achieve a precision up to the nanosecond level of the main control chip's system clock, thus improving the sensor's control accuracy.

[0138] Please see Figure 7 This is a schematic diagram of a computer device provided according to an exemplary embodiment of the present application. The computer device includes a memory and a processor. The memory is used to store a computer program, which is executed by the processor to implement the above-described method.

[0139] The processor can be a central processing unit (CPU). It can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof.

[0140] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the embodiments of this invention. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the methods described in the above embodiments.

[0141] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0142] In one exemplary embodiment, a computer-readable storage medium is also provided for storing at least one computer program, which is loaded and executed by a processor to implement all or part of the steps in the above-described method. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, or optical data storage device, etc.

[0143] In one exemplary embodiment, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned actions. Figure 3 or Figure 4 All or part of the steps of the method shown in any embodiment.

[0144] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0145] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A sensor exposure control method, characterized in that, The method includes: Acquire the power grid frequency and target exposure time; Based on the target exposure time, an exposure blanking region is inserted into the first region of the initial frame structure of the sensor to obtain the first frame structure; the first region is the region where the sensor is in the exposure state. The target frame period is determined based on the power grid frequency; The length of the first cycle is determined by the number of rows and the length of the row synchronization signal of the sensor. The sum of the first cycle length and the length of the exposure blanking region is determined as the second cycle length; The difference between the target frame period and the second period length is determined as the length of the periodic blanking region. The periodic blanking region is then inserted into the second region of the first frame structure of the sensor to obtain the second frame structure, so that the frame period of the sensor matches the power grid frequency. The second region is the area of ​​the sensor that is not in an exposed state. Based on the second frame structure of the sensor, the sensor is controlled to acquire images.

2. The method according to claim 1, characterized in that, The initial frame structure includes M line synchronization signals; the Nth line synchronization signal in the initial frame structure is the end point of the exposure time of the previous frame structure; The first region is the area between the (N-1)th line synchronization signal and the Nth line synchronization signal.

3. The method according to claim 2, characterized in that, The second region is the area between the (N+1)th line synchronization signal and the (N+2)th line synchronization signal.

4. The method according to claim 2, characterized in that, The method further includes: The first ratio is obtained by comparing the target exposure time with the line length of the line synchronization signal and rounding the result. When the first ratio is greater than or equal to the number of available exposure rows in the initial frame structure, the exposure start point corresponding to the number of available exposure rows is taken as the actual exposure start point of the initial frame structure. When the first ratio is less than the available exposure line length in the initial frame structure, the first difference between the total line length of the frame structure and the first ratio is taken as the actual exposure starting point of the initial frame structure.

5. The method according to claim 4, characterized in that, The step of inserting an exposure blanking region in the first region of the initial frame structure of the sensor based on the target exposure time includes: When the first ratio is greater than or equal to the available exposure line length in the initial frame structure, the entire line exposure area is determined based on the second difference between the first ratio and the number of available exposure lines. The difference between the target exposure time and the product of the line length of the line synchronization signal and the first ratio is determined as the unit step exposure area. The size of the exposure blanking area is determined based on the unit step exposure area and the entire line exposure area, and the exposure blanking area is inserted into the first region in the initial frame structure of the sensor.

6. The method according to claim 4, characterized in that, The step of inserting an exposure blanking region in the first region of the initial frame structure of the sensor based on the target exposure time includes: When the first ratio is less than the available exposure line length in the initial frame structure, the size of the exposure blanking region is determined based on the target exposure time and the difference between the product of the line length of the line synchronization signal and the first ratio, so as to insert the exposure blanking region in the first region of the initial frame structure of the sensor.

7. A sensor exposure control device, characterized in that, The device includes: The data acquisition module is used to acquire the power grid frequency and target exposure time; The first insertion module is used to insert an exposure blanking region into a first region in the initial frame structure of the sensor based on the target exposure time to obtain the first frame structure; the first region is the region where the sensor is in the exposure state; The second insertion module is used to determine the target frame period based on the power grid frequency; determine the first period length by the number of lines and the line length of the line synchronization signal of the sensor; determine the second period length by the sum of the first period length and the length of the exposure blanking area; determine the length of the period blanking area by the difference between the target frame period and the second period length, so as to insert the period blanking area into the second region of the first frame structure of the sensor to obtain the second frame structure, so that the frame period of the sensor matches the power grid frequency; the second region is the region of the sensor that is not in the exposure state; The image acquisition module is used to control the sensor to acquire images based on the second frame structure of the sensor.

8. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one instruction, which is loaded and executed by the processor to implement the sensor exposure control method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by a processor to implement the sensor exposure control method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for eliminating image flicker, electronic equipment and storage medium

    CN111818272A

  • Image processing device, image processing method, and program

    JP2014138401A