Encoding Method, Decoding Method and Device for Timing Signal
By decoupling the integration process and sampling process, and using reset flags for encoding, the problem of difficult to express high-frequency signals and wide dynamic range signals in traditional sampling methods is solved, and efficient signal expression and signal-to-noise ratio improvement are achieved.
Patent Information
- Application Number
- CN202110432425.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-21
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-04-21
AI Technical Summary
When traditional sampling methods process timing signals, it is difficult to effectively express high-frequency signals and signals with wide dynamic range, resulting in small dynamic range or blurred motion of the image.
By decoupling the integration process and the sampling process, the signal integration process and sampling frequency are independently carried out, the integral reset state is recorded using the reset flag, and encoded according to the reset flag and the integral signal.
The encoding expression of high-frequency sampling rate and high dynamic range is realized, and the noise reduction is smoothed, the signal-to-noise ratio of weak signals is improved, and the sampling frequency can be freely arranged according to the time sensitivity.
Smart Images

Figure CN115225898B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technologies, and specifically relates to a method and device for encoding and decoding timing signals. Background Art
[0002] The process of converting a time-continuous signal into a series of time-discontinuous pulse signals is called sampling. The pulse signal after sampling is called a sampling signal. The sampling signal is discrete on the time axis but remains continuous on the function axis. When the sampling frequency is high enough, the sampling signal can reproduce the original signal. The process of quantizing the sampling signal into a digital signal is called the quantization process. The quantization process is a numerical stratification process, such as a rounding process. Encoding is the process of converting the quantized signal into a code according to certain rules, such as converting the quantized signal into a binary code.
[0003] There are usually two ways to obtain a sampling signal. One is to take the signal at a certain moment within the sampling interval or the average value of the signals within the sampling interval. The other is the integral value obtained by integrating the signal within the sampling interval. The advantage of the second method is that a signal expression with a higher signal-to-noise ratio can be obtained through noise cancellation, so it is widely used. For example, video signals use this method. The value of each pixel in a video frame is the accumulation of the signal within the exposure time (i.e., the sampling interval). In this way, the timing signal is integrated within the sampling interval and reset at the end of each sampling. Thus, the length of the sampling interval (corresponding to the level of the sampling frequency) determines the dynamic range of the sampling signal: the shorter the sampling interval, the better it can express high-frequency signals, but the narrower the signal dynamic range. For video, the image dynamic range is small; the longer the sampling interval, the wider the signal dynamic range, but high-frequency signals cannot be effectively expressed. For video, fast movement will cause motion blur. This is the dilemma of the traditional sampling method. Summary of the Invention
[0004] In view of this, the embodiments of this application are committed to providing a method and device for encoding timing signals and a method and device for decoding timing signals. By decoupling the integration process and the sampling process, the sampling frequency can be freely arranged according to the time sensitivity requirements, thereby greatly expanding the dynamic range of the encoding expression. Specifically, the core of the method proposed in the embodiments of this application to solve the above dilemma lies in decoupling the signal integration process and the sampling frequency, and achieving better signal expression through encoding the integration reset state and directly encoding the integration signal (i.e., the first sampling method above): simultaneously achieving a high-frequency sampling rate and a high dynamic range.
[0005] The first aspect of the present application provides a method for encoding a timing signal, including: integrating the timing signal in sequence, automatically resetting whenever the integration value reaches a preset threshold, and using a reset flag to record the reset state; at each sampling, encoding according to the reset flag to obtain an encoding result, and resetting the reset flag to its initial state.
[0006] The second aspect of the present application provides a method for encoding a timing signal, including: an integrator integrating the timing signal in sequence; a flagger recording the state of the integrator, when the integrator accumulates the intensity of the timing signal to the preset threshold, triggering a change in the state of the flagger, and the integrator resets, where the initial value of the flagger is 0; a sampler sampling the state of the flagger and / or the intensity of the integrator in sequence; an encoder encoding according to the state of the flagger and / or the intensity of the integrator to obtain an encoding result, where after each sampling, the flagger resets to 0; the encoder sequentially outputting the encoding results in the sampling order as the encoding of the timing signal.
[0007] The third aspect of the present application provides an apparatus for encoding a timing signal, including: an integration module for integrating the timing signal in sequence, automatically resetting whenever the integration value reaches a preset threshold, and using a reset flag to record the reset state; an encoding module for encoding according to the reset flag at each sampling to obtain an encoding result, and resetting the reset flag to its initial state.
[0008] The fourth aspect of the present application provides an apparatus for encoding a timing signal, including: an integrator for integrating the timing signal in sequence; a flagger for recording the state of the integrator, when the integrator accumulates the intensity of the timing signal to the preset threshold, triggering a change in the state of the flagger, where the initial value of the flagger is 0, and when the integrator accumulates the intensity of the timing signal to the preset threshold, the integrator resets; a sampler for sampling the state of the flagger and / or the intensity of the integrator in sequence; an encoder for encoding according to the state of the flagger and / or the intensity of the integrator to obtain an encoding result, where after each sampling, the flagger resets to 0, and the encoder is further configured to sequentially output the encoding results in the sampling order as the encoding of the timing signal.
[0009] The fifth aspect of the present application provides a method for decoding a timing signal, including: receiving a code stream, the code stream including an encoding result, the encoding result being used to represent the state where the integration value reaches the preset threshold when integrating the timing signal in the current sampling interval; reconstructing the timing signal according to the encoding result.
[0010] The sixth aspect of the present application provides a decoding device for timing signals, including: a receiving module for receiving a code stream, the code stream including an encoding result for indicating a state where an integration value reaches a preset threshold when integrating a timing signal within a current sampling interval; and a reconstruction module for reconstructing the timing signal according to the encoding result.
[0011] The seventh aspect of the present application provides a computer-readable storage medium storing a computer program for executing the encoding method for timing signals described in the first aspect or the second aspect above or the decoding method for timing signals described in the fifth aspect above.
[0012] The eighth aspect of the present application provides an electronic device, including: a processor; a memory for storing processor-executable instructions; and the processor for executing the encoding method for timing signals described in the first aspect or the second aspect above or the decoding method for timing signals described in the fifth aspect above.
[0013] The encoding method and encoding device for timing signals, decoding method and decoding device provided by the present application separate the integration process and the sampling process, avoiding the limitation of the integration period by the sampling period, making the integration process independent of the sampling process. In addition, by setting a preset threshold for the integration value, it is ensured that the integration process can be cycled, and a reset flag is used to record the reset state corresponding to the integration process within the sampling period, and then encoding is performed according to the reset flag. Since the integration process is independent of the sampling process and resets when the integration value reaches the preset threshold, it is beneficial for smoothing and denoising to improve the signal-to-noise ratio of weak signals. In addition, since the sampling process is decoupled from the integration process, the sampling frequency can be freely arranged according to the time sensitivity requirement without considering the strength of the signal and the signal-to-noise ratio, and adaptive encoding is performed based on the reset flag according to the strength of the timing signal, greatly expanding the dynamic range of the encoding expression. Description of the Drawings
[0014] Figure 1 The system architecture diagram of the encoding system for timing signals provided by an embodiment of the present application is shown.
[0015] Figure 2 The flowchart of the encoding method for timing signals provided by an embodiment of the present application is shown.
[0016] Figure 3 The flowchart of the encoding method for timing signals provided by another embodiment of the present application is shown.
[0017] Figure 4 The flowchart of the encoding method for timing signals provided by another embodiment of the present application is shown.
[0018] Figure 5The figure shows a schematic flowchart of a method for encoding a timing signal provided by another embodiment of the present application.
[0019] Figure 6 The figure shows a schematic structural diagram of an encoding device for a timing signal provided by an embodiment of the present application.
[0020] Figure 7 The figure shows a schematic structural diagram of an encoding device for a timing signal provided by another embodiment of the present application.
[0021] Figure 8 The figure shows a block diagram of an electronic device for performing a method for encoding a timing signal or a method for decoding a timing signal provided by an exemplary embodiment of the present application.
[0022] Figure 9 The figure shows a schematic flowchart of a method for decoding a timing signal provided by an embodiment of the present application.
[0023] Figure 10 The figure shows a schematic flowchart of a method for decoding a timing signal provided by another embodiment of the present application.
[0024] Figure 11 The figure shows a schematic structural diagram of a decoding device for a timing signal provided by an embodiment of the present application. Detailed implementation manners
[0025] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0026] Overview of the Application
[0027] Traditional methods for representing dynamic images are two-dimensional images and videos as image sequences. Traditional images are two-dimensional information forms. In the narrow sense, an image is the result of light being projected onto a photographic plane after processes such as reflection, diffuse reflection, refraction, and scattering in the physical world. In the broad sense, an image includes any information form distributed on a two-dimensional plane. Images represented in digital form are more convenient for processing, transmission, and storage, which requires converting images existing in analog signal form into images represented in digital form, namely digital images. The process of image digitization mainly includes three steps: sampling, quantization, and encoding. Sampling is the process of discretizing the space where the image is distributed. For two-dimensional images, the most common way is to equally divide the rectangular area covered by the image into sampling points of the same size. The number of rows of the sampling points obtained in this way and the number of sampling points in each row are the so-called digital image resolution (a more accurate resolution refers to the number of sampling points per unit physical size). Quantization is the process of discretizing parameters such as the color, brightness, or contrast (or other physical quantities) of the image at each sampling point, usually characterized by the quantization level. The quantization value of each sampling point and its color, brightness, or contrast (or other physical quantities) form a pixel of the image, and all pixels are arranged in row and column form to form a digital image.
[0028] The traditional concept of video is an image sequence obtained at regular time intervals. An image in the sequence is also called a frame image. Therefore, a video also becomes an image sequence. The division of the time interval between images is also part of sampling, usually also equally divided. The number of images collected per second is called the frame rate. To ensure that information is not lost during the digitization process, that is, to be able to be completely restored when restored to analog form, according to the sampling theorem, it is necessary to sample at least twice the frequency of the image spatial signal.
[0029] Traditional image sensors usually take frames as units and sample the scene completely at a preset fixed frequency. This fixed-frequency-based sampling cannot reflect the dynamic changes of the scene, and is prone to over-sampling or under-sampling of the current scene, resulting in problems such as large video data redundancy, low temporal resolution, and easy blurring under high-speed movement. Inspired by the visual sampling mechanism of the biological retina, new cameras that collect pulsed array signals have come into view, including sensors that emit signals based on the cumulative intensity of light intensity, such as light intensity cumulative sensors. The sensors of this kind of camera collect the information of light signals within a certain time and a certain area, and have advantages such as high dynamic range and high temporal resolution.
[0030] Specifically, the light intensity can be accumulated (i.e., integrated) according to a certain sampling period. When the integrated value of the light intensity within one sampling period is greater than or equal to a certain threshold, a pulse signal is output, and then the integrated value is reset to accumulate the light intensity in the next sampling period. Here, the integration period is the same as the sampling period, that is, the integration period is fixed and restricted by the sampling period. However, in actual situations, the light intensity in a certain local space may be very high during a certain period of time, far greater than the threshold. At this time, if only sampled through a fixed sampling period and a pulse signal (such as outputting 1) is output based on the fixed threshold, it is difficult to obtain the light intensity level at this time. Similarly, the light intensity in a certain local space may be very weak (such as infrared light) during a certain period of time, far less than the threshold. At this time, if only sampled through a fixed sampling period and a pulse signal (such as outputting 0) is output based on the fixed threshold, it is difficult to obtain the light intensity level at this time. That is, the existing coding mechanisms (including the sampling mechanism and the integration mechanism) are difficult to quantify the intensity values when the light is strong or weak.
[0031] Exemplary System
[0032] Figure 1 The system architecture diagram of the encoding system for the timing signal provided by an embodiment of the present application is shown, which shows an application scenario for encoding the timing signal. As Figure 1 shown, the encoding system includes a collection device 1 and an encoding device 2. The collection device 1 is used to collect the optical signal in a certain local space to obtain a timing signal (electrical signal), and the encoding device 2 is used to encode the timing signal to obtain an encoding result.
[0033] In one embodiment, the encoding device 2 can be connected to one collection device or multiple collection devices. When the encoding device 2 is connected to multiple collection devices, the multiple collection devices can respectively collect the optical signals in different local spaces to obtain the timing signals corresponding to different local spaces. The encoding device 2 can encode the timing signals corresponding to different local spaces to obtain an encoding result.
[0034] Here, the collection device 1 and the encoding device 2 can be independent devices, and are connected through a data line or a wireless network. For example, the collection device 1 can be set on a camera, and the encoding device 2 can be set on a computing device (such as a server) connected to the camera, or the two are integrated on the same device. For example, the device can be a camera.
[0035] Exemplary Method
[0036] Figure 2 The flowchart of the encoding method for the timing signal provided by an embodiment of the present application is shown. AsFigure 2 As shown, the encoding method includes the following content.
[0037] S110: Integrate the timing signal in sequence. Whenever the integrated value reaches a preset threshold, it is automatically reset, and a reset flag is used to record the reset state.
[0038] The timing signal can be an electrical signal reflecting the light intensity change of a certain local space within a certain period of time. The position of this local space can correspond to a certain local area in an image or video, such as a certain pixel area.
[0039] Integrating the timing signal in sequence means integrating the intensity of the electrical signal in sequence. When the integrated value obtained by integration reaches the preset threshold, this round of integration ends (i.e., the integrated value is reset), and the next round of integration is started. When the integrated value obtained by the next round of integration reaches the preset threshold, the next round of integration ends and a new round of integration is started, and so on in a cycle. Here, the preset threshold can be set according to actual needs.
[0040] The light intensity change of the local space within a certain period of time can be regular or irregular. For example, when the light intensity remains constant, the time required for the integrated value of each round of integration to reach the preset threshold is the same. When the light intensity changes with time, the time required for the integrated value of each round of integration to reach the preset threshold may be different. Therefore, the integration period in the embodiments of the present application is not a preset fixed duration, but variable.
[0041] Each time the integrated value is reset, the reset state at this time can be recorded. The reset state can be represented by a reset flag. Specifically, a marker can be used to record the reset state. For example, the marker can be a counter.
[0042] In one embodiment, the reset state can reflect whether the integrated value has reached the preset threshold within a certain sampling time period (the interval time between two samplings). For example, within the sampling time period, the number of times the integrated value reaches the preset threshold is one, that is, one round of integration is completed within this sampling time period; or, within the sampling time period, the number of times the integrated value reaches the preset threshold is greater than one, that is, multiple rounds of integration are completed within this sampling time period; or, within the sampling time period, the number of times the integrated value reaches the preset threshold is zero, that is, no round of integration is completed within this sampling time period. When the number of times the integrated value reaches the preset threshold within the sampling time period is greater than or equal to 1, the reset state can be represented by one kind of reset flag; when the number of times the integrated value reaches the preset threshold within the sampling time period is 0, the reset state can be represented by another kind of reset flag.
[0043] Optionally, in another embodiment, the reset state may reflect the number of times the integral value reaches a preset threshold within a certain sampling time period. The reset state may be represented by different reset flags, and the reset flag may directly represent the number of times the integral value reaches the preset threshold within the sampling time period.
[0044] S120: At each sampling, encode according to the reset flag to obtain an encoding result, and reset the reset flag to its initial state.
[0045] At each sampling, encode according to the reset flag at the current sampling to obtain the encoding result corresponding to the current sampling. After the current sampling ends, the reset flag returns to its initial state. From the end of the current sampling to the next sampling moment, the integration is continuously performed, and the reset state changes with the progress of the integration. Record the reset flag at the next sampling. Encode the reset flag at the next sampling to obtain the encoding result corresponding to the next sampling. By cycling in this way, the encoding result corresponding to the timing signal can be obtained.
[0046] The embodiment of the present application provides a method for encoding a timing signal, which separates the integration process and the sampling process, avoids the limitation of the integration period by the sampling period, makes the integration process independent of the sampling process. In addition, by setting a preset threshold for the integral value, it is ensured that the integration process can be cycled, and the reset flag is used to record the reset state corresponding to the integration process within the sampling period, and then encoding is performed according to the reset flag. Since the integration process is independent of the sampling process and resets when the integral value reaches the preset threshold, it is beneficial to smooth and denoise to improve the signal-to-noise ratio of weak signals. In addition, since the sampling process is decoupled from the integration process, the sampling frequency can be freely arranged according to the time sensitivity requirement without considering the strength of the signal and the signal-to-noise ratio, and adaptive encoding is performed based on the reset flag according to the strength of the timing signal, so that the dynamic range of the encoding expression is greatly expanded.
[0047] According to an embodiment of the present application, encoding according to the reset flag to obtain an encoding result includes: if the reset flag at the sampling is in the initial state, encode according to the integral value at the sampling to obtain a first encoding.
[0048] The reset flag at the sampling being in the initial state indicates that from the end of the previous sampling to the current sampling moment, the integral value has not reached the preset threshold. At this time, encode according to the integral value at the current sampling to obtain a first encoding.
[0049] In this embodiment, during the period from the end of the previous sampling to the current sampling moment, the light intensity corresponding to the local space may be relatively weak. Therefore, within the time interval between two adjacent samplings, the integral value does not reach the preset threshold. At this time, directly encoding based on the integral value to obtain the first encoding can more accurately obtain the electrical signal intensity at the current sampling. That is to say, even if the light is weak and does not reach the light intensity corresponding to the preset threshold, the first encoding can accurately reflect the accumulated light intensity at the current sampling.
[0050] According to an embodiment of the present application, encoding based on the integral value during sampling to obtain the first encoding includes: quantifying the integral value during sampling to obtain a quantization value; encoding according to the quantization value to obtain the first encoding.
[0051] When the reset flag during sampling is in the initial state, the integral value is quantified to obtain a quantization value. Here, the quantization method can be rounding or other methods.
[0052] In this embodiment, since the integral value is generally irregular, directly encoding the integral value will increase the encoding difficulty. Therefore, by first quantifying the sampled integral value to obtain a quantization value and then encoding the quantization value, the encoding process can be simplified.
[0053] For example, the sampled integral value can be compared with a preset threshold to determine what fraction of the preset threshold the integral value is to obtain a fraction ratio, or determine the percentage of the integral value in the preset threshold to obtain a percentage ratio. Here, the fraction ratio or the percentage ratio can be used as the quantization value. In this way, the integral value can be related to the preset threshold, and the first encoding obtained based on the quantization value subsequently can reflect the relative strength of the accumulated light intensity at the current sampling. For example, directly using the quantization value as the first encoding, or further processing the quantization value to obtain the first encoding.
[0054] According to an embodiment of the present application, quantifying the integral value during sampling to obtain a quantization value includes: quantifying the integral value during sampling using binary to obtain a quantization value of n bits. Here, encoding according to the quantization value to obtain the first encoding includes: using the n bits as the first encoding.
[0055] Specifically, quantifying the integral value using binary to obtain a quantization value and using this quantization value as the first encoding can simplify the encoding process, that is, the quantization process is also equivalent to the encoding process, which can improve the efficiency of the timing signal encoding process.
[0056] In one embodiment, for the integral values at different sampling times, numerical values with the same number of bits can be used for quantization. For example, n bits. When n = 3, if the integral value is 2, the quantization value is 010; if the integral value is 4, the quantization value is 100. By encoding the integral value with n bits, it can be ensured that the number of bits of the first encoding corresponding to the integral value of each sampling is the same, which is convenient for the recognition and management of the encoding result.
[0057] Of course, other counting systems can also be used to quantize the integral value, and the embodiments of the present application do not limit this.
[0058] According to an embodiment of the present application, encoding according to the integral value at the time of sampling to obtain a first encoding includes: comparing the quantization value of the integral value at each sampling with the quantization value of the integral value at the previous sampling to obtain a difference; determining the first encoding according to the difference.
[0059] Specifically, the difference between the quantization value corresponding to the integral value at the current sampling time and the quantization value corresponding to the integral value at the previous sampling time can be determined first, and then the first encoding at the current sampling time can be determined based on the difference. In this way, the quantization values corresponding to two adjacent samplings can be associated, improving the security of the encoding result. In addition, determining the encoding result by the difference can reduce the magnitude of the encoding result and simplify the encoding result.
[0060] It should be understood that the first encoding corresponding to the first sampling can be determined according to the difference between the quantization value corresponding to the integral value at the first sampling and the quantization value corresponding to the initial integral value. The quantization value corresponding to the initial integral value can be a preset value, for example, it can be 0 or other values.
[0061] According to an embodiment of the present application, determining the first encoding according to the difference includes: quantizing the difference to obtain a quantization value of n bits and using the n bits as the first encoding; or, if the difference is x, using x 0s or 1s to represent the first encoding.
[0062] Specifically, after determining the difference between the quantization value corresponding to the integral value at the current sampling time and the quantization value corresponding to the integral value at the previous sampling time, the difference can be further quantized to obtain a quantization value of n bits, and the n bits are used as the first encoding. Here, by quantizing the difference with n bits to obtain the first encoding, it can be ensured that the number of bits of the first encoding corresponding to the integral value of each sampling is the same, which is convenient for the recognition and management of the encoding result.
[0063] Optionally, after determining the difference between the quantization value corresponding to the integral value at the current sampling moment and the quantization value corresponding to the integral value at the previous sampling moment, the first encoding can be directly determined based on the value of the difference. For example, if the difference is x, the first encoding is x zeros or ones or other numerical values or letters, etc. Such an encoding result can more intuitively reflect the difference, that is, reflect the gap between the integral values (light intensities) corresponding to two adjacent samplings.
[0064] According to an embodiment of the present application, encoding is performed according to a reset flag to obtain an encoding result, including: if the reset flag at the time of sampling is in a non-initial state, encoding is performed according to the value corresponding to the reset flag to obtain a second encoding, where the value represents the number of times the integral value reaches a preset threshold.
[0065] Specifically, the reset flag being in a non-initial state means that from the end of the previous sampling to the current sampling moment, the number of times the integral value reaches the preset threshold is greater than or equal to 1, and the value corresponding to the reset flag represents the number of times the integral value of the integrator reaches the preset threshold. That is, the integrator can integrate the timing signal during the period from the end of the previous sampling to the current sampling moment. When the integral value reaches the preset threshold, the value corresponding to the reset flag becomes larger (for example, increases by 1), and the integrator resets and starts integrating again. Encoding is performed according to the value corresponding to the reset flag at the current sampling moment to obtain the second encoding.
[0066] In this embodiment, during the period from the end of the previous sampling to the current sampling moment, the light intensity corresponding to the local space may be relatively strong. Therefore, within the interval between two adjacent samplings, the number of times the integral value reaches the preset threshold may be once or multiple times, and the corresponding reset flag is in a non-initial state. At this time, encoding is performed based on the value corresponding to the reset flag to obtain the second encoding, which can more accurately obtain the electric signal intensity at the current sampling. For example, it can be learned how many times the electric signal intensity at the current sampling is relative to the preset threshold. Since there is a certain correspondence between the electric signal intensity and the light intensity, according to this correspondence, the preset threshold also corresponds to a certain preset light intensity. Therefore, the second encoding can also more accurately reflect how many times the accumulated light intensity at the current sampling is relative to the preset light intensity, and thus the specific intensity value of the timing signal within the sampling unit (interval between two adjacent samplings) with strong light intensity can be obtained. Therefore, in this embodiment, by recording the number of integrations within the sampling period using the reset flag and then encoding according to the reset flag, the acquisition of detailed information in the timing signal can be achieved, avoiding the limitation of information acquisition by a fixed sampling frequency.
[0067] According to an embodiment of the present application, encoding according to the value corresponding to the reset flag to obtain a second encoding includes: if the value corresponding to the reset flag is less than M, using the value corresponding to the reset flag as the encoding value for encoding to obtain the second encoding; if the value corresponding to the reset flag is greater than or equal to M, using M as the encoding value for encoding to obtain the second encoding.
[0068] Specifically, within a sampling unit, as the number of times the integration value of the integrator reaches the preset threshold increases, the value corresponding to the reset flag gradually becomes larger. During sampling, if the value corresponding to the reset flag is less than M, using the value corresponding to the reset flag as the encoding value for encoding to obtain the second encoding; if the value corresponding to the reset flag is greater than or equal to M, using M as the encoding value for encoding to obtain the second encoding. In this way, for the case where the reset flag is greater than or equal to M, it is only necessary to judge the value of the reset flag, that is, judge that it is greater than or equal to M, and then directly encode based on M to obtain the second encoding, thus simplifying the encoding process.
[0069] In this embodiment, for the case where the light intensity is greater than or equal to a preset specific value (i.e., the reset flag is greater than or equal to M), the second encoding obtained through the encoding process is the same and does not need to be specifically distinguished, so the computational amount in the data processing process can be reduced and the encoding efficiency can be improved.
[0070] According to an embodiment of the present application, encoding according to the value corresponding to the reset flag to obtain a second encoding includes: using the corresponding natural number of the value as the second encoding; or converting the value into m bits in binary as the second encoding; or if the value is x, using x 1s or 0s as the second encoding.
[0071] Specifically, if the value corresponding to the reset flag is an integer, the integer can be directly used as the second encoding. If the value corresponding to the reset flag is a decimal, the decimal can be rounded to an integer, and then the rounded value can be used as the second encoding.
[0072] In this embodiment, the natural number corresponding to the value of the reset flag can be directly used as the second encoding, so there is no need to set complex encoding rules, simplifying the encoding process and improving the encoding efficiency.
[0073] Optionally, the value corresponding to the reset flag can be converted into m bits according to binary, and the m bits are used as the second encoding. By encoding the value corresponding to the reset flag with m bits, it can be ensured that the number of bits of the second encoding corresponding to the reset flag is the same each time a sample is taken, facilitating the recognition and management of the encoding result. Further, both the first encoding with the reset flag in the initial state and the second encoding with the reset flag in the non-initial state can be represented in binary. The first encoding includes n bits, and the second encoding includes m bits, where m = n. This can ensure that the number of bits of the encoding result corresponding to each sample is the same, further facilitating the recognition and management of the encoding result.
[0074] Optionally, x 1s or 0s can be used as the second encoding, where x is the value corresponding to the reset flag. Such an encoding result can more intuitively reflect the value corresponding to the reset flag, that is, it can more accurately reflect the multiple of the accumulated light intensity at the current sampling relative to the preset light intensity. Thus, the specific intensity value within the sampling unit (interval between two adjacent samplings) with stronger light intensity of the timing signal can be obtained.
[0075] In one embodiment, if the reset flag at the time of sampling is in a non-initial state, encoding is performed according to the value corresponding to the reset flag to obtain a second encoding, where the value represents the number of times the integral value of the integrator reaches a preset threshold. At the same time, encoding is performed according to the integral value at the current sampling to obtain a first encoding. The combined second encoding and first encoding represent the accumulated light intensity at the current sampling. Because within the current sampling unit, the number of times the integral value reaches the preset threshold is greater than or equal to 1, for example, it is A, and the (A + 1)-th integration is still in progress. Just within the current sampling unit, the integral value of the (A + 1)-th integration does not reach the preset threshold and is less than the preset threshold, but there is still a certain integral value. Therefore, at the current sampling moment, encoding the value corresponding to the reset flag to obtain a second encoding, encoding the integral value at the current sampling to obtain a first encoding, and combining the second encoding and the first encoding can more accurately represent the accumulated light intensity at the current sampling.
[0076] According to an embodiment of the present application, the reset flag corresponding to the initial state is 0, and the reset flag is incremented by 1 each time the integral value reaches the preset threshold.
[0077] Specifically, in a sampling unit, in the initial state, the value corresponding to the reset flag is 0. As the number of times the integral value reaches the preset threshold increases, the value corresponding to the reset flag is continuously incremented by 1. In this way, the reset flag can directly represent the multiple of the accumulated light intensity at the current sampling relative to the preset light intensity, that is, it can represent the level of the accumulated light intensity at the current sampling. For example, if the preset light intensity is Q and the reset flag is 2, then the reset flag represents that the accumulated light intensity at the current sampling is 2Q.
[0078] In other embodiments, the reset flag corresponding to the initial state may be represented by other values, and each time the integral value reaches the preset threshold, the value corresponding to the reset flag may increase proportionally or non - proportionally. That is, the specific representation rule of the reset flag can be set according to actual needs.
[0079] According to an embodiment of the present application, the encoding result includes a third encoding, and the third encoding is used to indicate whether the reset state is the initial state.
[0080] Specifically, each time a sample is taken, the third encoding can be obtained according to the reset flag. If the reset state is the initial state, the third encoding is 0; otherwise, the third encoding is 1. Here, the third encoding is used to indicate whether the reset state is the initial state. Therefore, in addition to being represented by the set of values 0 and 1, the third encoding can also be represented by other values or letters. The embodiments of the present application do not limit this.
[0081] In this embodiment, the third encoding being 0 indicates that the integral value in the sampling unit has not reached the preset threshold, that is, the accumulated light intensity at the current sampling is less than Q; the third encoding being 1 indicates that the number of times the integral value in the sampling unit reaches the preset threshold is greater than or equal to 1, that is, the accumulated light intensity at the current sampling is greater than or equal to Q. Here, the preset light intensity Q corresponds to the preset threshold. The preset light intensity Q can be regarded as the boundary line between weak light and strong light. If the accumulated light intensity at the current sampling is less than Q, it means that in the sampling unit, the light intensity is small and the accumulated light intensity is difficult to reach the preset light intensity Q; if the accumulated light intensity at the current sampling is greater than or equal to Q, it means that in the sampling unit, the light intensity is strong and the accumulated light intensity is equal to or exceeds the preset light intensity Q. Therefore, the third encoding can characterize whether the accumulated light intensity at the current sampling is strong light or weak light. Here, the preset light intensity Q can be set according to actual needs.
[0082] Furthermore, the encoding result may include the first encoding and the third encoding, or the second encoding and the third encoding. That is, when the accumulated light intensity is weak light, the encoding result includes the first encoding and the third encoding; when the accumulated light intensity is strong light, the encoding result includes the second encoding and the third encoding. The third encoding may be located before or after the first encoding or at other positions in the first encoding. Similarly, the third encoding may be located before or after the second encoding or at other positions in the second encoding.
[0083] For example, when the accumulated light intensity is weak light, the coding result is 0 1 / 2. Here, 0 is the third coding, indicating that the accumulated light intensity at the current sampling is less than Q, which is weak light, and 1 / 2 is the first coding, indicating that the specific light intensity is 1 / 2Q; when the accumulated light intensity is strong light, the coding result is 1 1 1 1. Here, the first 1 is the third coding, indicating that the accumulated light intensity at the current sampling is greater than or equal to Q, which is strong light, and the following three 1s are the second coding, indicating that the specific light intensity is 3Q. In this embodiment, the first coding is determined based on the fraction of the integral value to the preset threshold, and the second coding is determined by using x 1s to represent the reset flag (the reset flag is 3 in this embodiment). However, this is only an example, and the first coding and the second coding can be determined by any coding method described in the above embodiments.
[0084] In this embodiment, the coding result is represented by using the third coding in combination with the first coding or the second coding. This coding result can not only provide information on whether the accumulated light intensity at the current sampling is strong light or weak light, but also further provide specific numerical information on the strong light or weak light intensity, which is convenient for obtaining detailed light intensity information.
[0085] According to an embodiment of the present application, the acquisition device of the timing signal is one of a plurality of acquisition devices arranged in at least a two-dimensional form.
[0086] Specifically, the acquisition device of the timing signal can be a photosensitive sensor. The timing signal is an electrical signal converted from continuous or discontinuous optical signals collected by the photosensitive sensor.
[0087] When collecting optical signals in a specific area, the specific area may include one or more local spaces. Each local space corresponds to an acquisition device, and the acquisition device is used to collect the light intensity change in the local space within a certain period of time, that is, the photosensitive sensor collects continuous or discontinuous optical signals in the local space within a certain period of time and converts them into electrical signals to obtain the timing signal. For example, the specific area includes a plurality of local spaces, and the plurality of local spaces are arranged in a matrix, so the plurality of acquisition devices are also arranged in a matrix accordingly. Each local space may correspond to a local area in an image or video, such as a pixel area.
[0088] Optionally, the acquisition device of the timing signal can be a thermosensitive device, and the timing signal is an electrical signal converted from continuous or discontinuous temperature signals collected by the thermosensitive device. When collecting temperature signals in a specific area, the specific area may include one or more local spaces. Each local space corresponds to an acquisition device, and the acquisition device is used to collect the temperature change in the local space within a certain period of time.
[0089] Optionally, the signal collected by the acquisition device may be an electromagnetic wave signal of any wavelength, such as an electromagnetic wave signal with a wavelength wider than that of an optical signal. The signal collected by the acquisition device may also be a thermal signal, such as the thermal signal collected by a thermal infrared camera.
[0090] In this embodiment, each acquisition device may correspond to one or more pixel regions. When each acquisition device corresponds to multiple pixel regions, the acquisition devices can be saved. When each acquisition device corresponds to one pixel region, precise control over the color and brightness changes of each pixel region can be achieved, avoiding interference between adjacent pixels.
[0091] Decoding the encoding result obtained by using the encoding method of the timing signal provided in the embodiments of the present application can obtain the change of the light intensity corresponding to each local space in a specific region over time. Furthermore, based on the change of the light intensity over time, an image or video related to the specific region can be acquired.
[0092] Figure 3 The following is a schematic flowchart of the encoding method of the timing signal provided in another embodiment of the present application. Figure 3 is Figure 2 an example. To avoid repetition, for the same parts, reference can be made to the descriptions in the above embodiments, and no specific explanations will be given here. As Figure 3 shown, the encoding method includes the following content.
[0093] S210: Integrate the timing signal in sequence. Whenever the integration value reaches a preset threshold, it is automatically reset, and a reset flag is used to record the reset state.
[0094] The reset flag corresponding to the initial state is 0, and the reset flag is incremented by 1 whenever the integration value reaches the preset threshold.
[0095] S220: Determine whether the reset flag is in the initial state.
[0096] If the reset flag is in the initial state, execute S230; otherwise, execute S240.
[0097] S230: Determine the third encoding based on the initial state of the reset flag, perform encoding according to the integration value during sampling to obtain the first encoding, and determine the encoding result based on the third encoding and the first encoding.
[0098] S240: Determine the third encoding based on the non-initial state of the reset flag, perform encoding according to the value corresponding to the reset flag to obtain the second encoding, determine the encoding result based on the third encoding and the second encoding, and reset the reset flag to the initial state.
[0099] The value corresponding to the reset flag indicates the number of times the integral value of the integrator reaches a preset threshold within the sampling unit. If the reset state is the initial state, the third code is 0; otherwise, the third code is 1.
[0100] In this embodiment, the specific coding processes of the first code and the second code can be referred to the descriptions in the above embodiments, which will not be elaborated here.
[0101] Figure 4 The following is a schematic flowchart of a coding method for a timing signal provided by another embodiment of the present application. As Figure 4 shown, the coding method includes the following contents.
[0102] S310: The integrator integrates the timing signal in sequence.
[0103] The timing signal can be an electrical signal reflecting the light intensity change of a certain local space within a certain period of time. The position of this local space can correspond to a certain local area in an image or video, such as a certain pixel area.
[0104] The integrator integrating the timing signal in sequence means integrating the intensity of the electrical signal in sequence.
[0105] S320: The flag recorder records the state of the integrator. When the integrator accumulates the intensity of the timing signal to the preset threshold, it triggers a change in the state of the flag recorder, and the integrator is reset, where the initial value of the flag recorder is 0.
[0106] When the integral value (the intensity of the integrator) obtained by integration reaches the preset threshold, this round of integration ends and the integrator is reset, and the next round of integration is started. When the integral value obtained by the next round of integration reaches the preset threshold, the next round of integration ends and a new round of integration is started, and so on in a cycle. The initial value of the flag recorder is 0, which can record the state of the integrator. The state of the integrator can represent the number of times the integral value of the integrator reaches the preset threshold. Here, the preset threshold can be set according to actual needs.
[0107] The light intensity change of a local space within a certain period of time can be regular or irregular. For example, when the light intensity remains constant, the time required for the integral value to reach the preset threshold in each round of integration is the same, while when the light intensity changes with time, the time required for the integral value to reach the preset threshold in each round of integration may be different. Therefore, the integration period in the embodiments of the present application is not a preset fixed duration, but variable.
[0108] S330: The sampler samples the state of the flag recorder and / or the intensity of the integrator in sequence.
[0109] The sampling period can be a preset fixed period. The sampler samples the status of the marker and / or the intensity of the integrator according to the sampling period in sequence. For example, the sampler can obtain the status of the marker and / or the intensity of the integrator at this time.
[0110] S340: The encoder encodes according to the status of the marker and / or the intensity of the integrator to obtain an encoding result. After each sampling, the marker is reset to 0.
[0111] During each sampling, an encoding result corresponding to the current sampling is obtained by encoding according to the status of the marker and / or the intensity of the integrator at the current sampling. After the current sampling ends, the marker is reset to 0. From the end of the current sampling to the next sampling moment (one sampling unit), the integration is always in progress, and the status of the marker will change with the progress of the integration. Record the status of the marker at the next sampling. Encode the status of the marker at the next sampling to obtain an encoding result corresponding to the next sampling. By cycling in this way, an encoding result corresponding to the timing signal can be obtained.
[0112] S350: The encoder sequentially outputs the encoding results in the sampling order as the encoding of the timing signal.
[0113] The embodiment of the present application provides a method for encoding a timing signal, which separates the integration process and the sampling process, avoids the limitation of the integration period by the sampling period, makes the integration process independent of the sampling process. In addition, by setting a preset threshold for the integration value, it is ensured that the integration process can be cycled, and the marker is used to record the integration status corresponding to the integration process within the sampling period, and then encoding is performed according to the status of the marker and / or the intensity of the integrator. Since the integration process is independent of the sampling process and resets when the integration value reaches the preset threshold, it is beneficial to smooth and denoise to improve the signal-to-noise ratio of weak signals. In addition, since the sampling process is decoupled from the integration process, the sampling frequency can be freely arranged according to the time sensitivity requirements without considering the strength of the signal and the signal-to-noise ratio, and adaptive encoding is performed based on the status of the marker according to the strength of the timing signal, so that the dynamic range of the encoding expression is greatly expanded.
[0114] According to an embodiment of the present application, the sampler samples the status of the marker and / or the intensity of the integrator according to the timing, including: if the value of the marker at the time of sampling is 0, the sampler samples the intensity of the integrator according to the timing to obtain a sampling result, where the encoder encodes according to the status of the marker and / or the intensity of the integrator to obtain an encoding result, including: the encoder encodes according to the sampling result to obtain a first encoding.
[0115] Specifically, during sampling, the value of the flag is 0, indicating that from the end of the previous sampling to the current sampling moment, the intensity of the integrator (i.e., the integral value) has not reached the preset threshold. At this time, the sampler samples according to the intensity of the integrator at the current sampling to obtain a sampling result, and the sampling result can be the integral value. The encoder encodes according to the sampling result to obtain a first encoding.
[0116] In this embodiment, during the period from the end of the previous sampling to the current sampling moment, the light intensity corresponding to the local space may be relatively weak. Therefore, within the interval time between two adjacent samplings, the intensity of the integrator does not reach the preset threshold. At this time, the sampler obtains the integral value through sampling, and the encoder directly encodes according to the integral value to obtain a first encoding, which can more accurately obtain the intensity of the electrical signal at the current sampling. That is to say, even if the light is weak and does not reach the light intensity corresponding to the preset threshold, the first encoding can accurately reflect the accumulated light intensity at the current sampling.
[0117] According to an embodiment of the present application, the encoder encodes according to the sampling result to obtain a first encoding, including: the quantizer quantizes the sampling result to obtain a quantization value; the encoder determines the first encoding according to the quantization value.
[0118] Specifically, in the case where the value of the flag is 0, the quantizer can quantize the integral value to obtain a quantization value, where the quantization method can be rounding or other methods.
[0119] In this embodiment, since the integral value is generally irregular, directly encoding the integral value will increase the encoding difficulty. Therefore, the integral value of the sampling is first quantized by the quantizer to obtain a quantization value, and then the encoder encodes the quantization value, which can simplify the encoding process.
[0120] For example, the integral value of the sampling can be compared with the preset threshold to determine what fraction of the preset threshold the integral value is to obtain a fraction ratio, or to determine the percentage of the integral value in the preset threshold to obtain a percentage ratio. Here, the fraction ratio or the percentage ratio can be used as the quantization value. In this way, the integral value can be related to the preset threshold, and the first encoding obtained based on the quantization value subsequently can reflect the relative strength of the accumulated light intensity at the current sampling. For example, directly using the quantization value as the first encoding, or further processing the quantization value to obtain the first encoding.
[0121] According to an embodiment of the present application, the quantizer quantizes the sampling result to obtain a quantization value, including: the quantizer quantizes the sampling result using binary to obtain a quantization value of n bits, where the encoder determines the first encoding according to the quantization value, including: the encoder uses the n bits as the first encoding.
[0122] Specifically, the quantizer quantizes the integral value using binary to obtain a quantization value, and the encoder directly uses this quantization value as the first encoding, which can simplify the encoding process and improve the efficiency of the timing signal encoding process.
[0123] In one embodiment, for the integral values at different sampling times, numerical values with the same number of bits can be used for quantization. For example, n bits. When n = 3, if the integral value is 2, the quantization value is 010; if the integral value is 4, the quantization value is 100. By encoding the integral value with n bits, it can be ensured that the number of bits of the first encoding corresponding to the integral value of each sampling is the same, which is convenient for the recognition and management of the encoding results.
[0124] Of course, other number systems can also be used to quantize the integral value, and the embodiments of the present application do not limit this.
[0125] According to an embodiment of the present application, the encoder encodes according to the sampling result to obtain the first encoding, including: the encoder compares the quantization value of the sampling result with the quantization value of the sampling result at the previous sampling to obtain a difference, and determines the first encoding according to the difference.
[0126] Specifically, the encoder can first determine the difference between the quantization value corresponding to the integral value at the current sampling time and the quantization value corresponding to the integral value at the previous sampling time, and then determine the first encoding at the current sampling time based on the difference, which can associate the quantization values corresponding to two adjacent samplings and improve the security of the encoding result. In addition, determining the encoding result by the difference can reduce the magnitude of the encoding result and simplify the encoding result.
[0127] It should be understood that the first encoding corresponding to the first sampling can be determined according to the difference between the quantization value corresponding to the integral value at the first sampling and the quantization value corresponding to the initial integral value. The quantization value corresponding to the initial integral value can be a preset value, for example, it can be 0 or other values.
[0128] According to an embodiment of the present application, the encoder determines the first encoding according to the difference, including: the encoder quantizes the difference to obtain a quantization value of n bits and uses the n bits as the first encoding; or, if the difference is x, the encoder uses x 0s or 1s to represent the first encoding.
[0129] Specifically, after the encoder determines the difference between the quantization value corresponding to the integral value at the current sampling time and the quantization value corresponding to the integral value at the previous sampling time, it can further quantize the difference to obtain a quantization value of n bits and use the n bits as the first encoding. Here, by quantizing the difference with n bits to obtain the first encoding, it can be ensured that the number of bits of the first encoding corresponding to the integral value of each sampling is the same, which is convenient for the recognition and management of the encoding results.
[0130] Optionally, after determining the difference between the quantization value corresponding to the integral value at the current sampling moment and the quantization value corresponding to the integral value at the previous sampling moment, the encoder can directly determine the first encoding based on the value of the difference. For example, if the difference is x, the first encoding is x number of 0s or 1s or other numerical values or letters, etc. Such an encoding result can more intuitively reflect the difference, that is, the gap between the integral values (light intensities) corresponding to two adjacent samplings.
[0131] According to an embodiment of the present application, the sampler samples the state of the marker and / or the intensity of the integrator in sequence, including: if the marker is in a non-zero state during sampling, the sampler reads the corresponding value of the marker in sequence, wherein the encoder encodes according to the state of the marker and / or the intensity of the integrator to obtain an encoding result, including: the encoder encodes according to the value corresponding to the marker to obtain a second encoding, wherein the value represents the number of times the integral value of the integrator reaches a preset threshold.
[0132] Specifically, the marker being in a non-zero state means that from the end of the previous sampling to the current sampling moment, the number of times the integral value reaches the preset threshold is greater than or equal to 1, and the value corresponding to the marker represents the number of times the integral value of the integrator reaches the preset threshold. That is, the integrator can integrate the timing signal during the period from the end of the previous sampling to the current sampling moment. When the integral value reaches the preset threshold, the value corresponding to the marker becomes larger (for example, incremented by 1), and the integrator resets and starts integrating again. The encoder encodes according to the value corresponding to the marker at the current sampling moment to obtain the second encoding.
[0133] In this embodiment, during the period from the end of the previous sampling to the current sampling moment, the light intensity corresponding to the local space may be relatively strong. Therefore, within the time interval between two adjacent samplings, the number of times the integral value reaches the preset threshold may be once or multiple times, and the corresponding marker is in a non-initial state, that is, a non-zero state. At this time, encoding based on the value corresponding to the marker to obtain the second encoding can more accurately obtain the electrical signal intensity at the current sampling. For example, it can be learned how many times the electrical signal intensity at the current sampling is relative to the preset threshold. Since there is a certain correspondence between the electrical signal intensity and the light intensity, according to this correspondence, the preset threshold also corresponds to a certain preset light intensity. Therefore, the second encoding can also more accurately reflect how many times the accumulated light intensity at the current sampling is relative to the preset light intensity, and thus the specific intensity value of the timing signal within the sampling unit (the interval between two adjacent samplings) with strong light intensity can be obtained. Therefore, in this embodiment, by recording the number of integral times within the sampling period using the marker and then encoding according to the value corresponding to the marker, the acquisition of detailed information in the timing signal can be realized, avoiding the limitation of information acquisition by a fixed sampling frequency.
[0134] According to an embodiment of the present application, the encoder encodes according to the value corresponding to the marker to obtain a second encoding, including: if the value corresponding to the marker is less than M, the encoder uses the value corresponding to the marker as the encoding value for encoding to obtain the second encoding; if the value corresponding to the marker is greater than or equal to M, the encoder uses M as the encoding value for encoding to obtain the second encoding.
[0135] Specifically, within a sampling unit, as the number of times the integration value of the integrator reaches the preset threshold increases, the value corresponding to the marker gradually becomes larger. During sampling, if the value corresponding to the marker is less than M, the value corresponding to the marker is used as the encoding value for encoding to obtain the second encoding; if the value corresponding to the marker is greater than or equal to M, M is used as the encoding value for encoding to obtain the second encoding. In this way, for the case where the value of the marker is greater than or equal to M, only the value of the marker needs to be judged, that is, judged to be greater than or equal to M, and then directly encoded based on M to obtain the second encoding, thus simplifying the encoding process.
[0136] In this embodiment, for the case where the light intensity is greater than or equal to a preset specific value (that is, the value of the marker is greater than or equal to M), the second encoding obtained through the encoding process is the same and does not need to be particularly distinguished, so the computational amount in the data processing process can be reduced and the encoding efficiency can be improved.
[0137] According to an embodiment of the present application, the encoder encodes according to the value corresponding to the marker to obtain a second encoding, including: the encoder uses the natural number corresponding to the value corresponding to the marker as the second encoding; or, the encoder converts the value corresponding to the marker into m bits according to binary as the second encoding; or, if the value corresponding to the marker is x, the encoder uses x 1s or 0s as the second encoding.
[0138] Specifically, if the value corresponding to the marker is an integer, the encoder can directly use the integer as the second encoding. If the value corresponding to the marker is a decimal, the encoder can round the decimal to an integer, and then use the rounded value as the second encoding.
[0139] In this embodiment, the encoder can directly use the natural number corresponding to the value of the marker as the second encoding, so there is no need to set complex encoding rules, simplifying the encoding process and improving the encoding efficiency.
[0140] Optionally, the encoder may convert the value corresponding to the marker into m bits in binary, and use the m bits as the second encoding. By encoding the value corresponding to the marker with m bits, it can be ensured that the number of bits of the second encoding corresponding to the marker is the same for each sampling, which is convenient for the recognition and management of the encoding results. Further, both the first encoding when the marker is in the initial state (i.e., the value of the marker is 0) and the second encoding when the marker is in a non-initial state may be represented in binary. The first encoding includes n bits, and the second encoding includes m bits, where m = n. This can ensure that the number of bits of the encoding result corresponding to each sampling is the same, and further facilitate the recognition and management of the encoding results.
[0141] Optionally, x 1s or 0s may be used as the second encoding, where x is the value corresponding to the marker. Such an encoding result can more intuitively reflect the value corresponding to the marker, that is, it can more accurately reflect the multiple of the accumulated light intensity at the current sampling relative to the preset light intensity. Thus, the specific intensity value of the timing signal within the sampling unit (interval between two adjacent samplings) with stronger light intensity can be obtained.
[0142] In an embodiment, if the marker is in a non-zero state during sampling, the sampler reads the value corresponding to the marker, and the encoder encodes according to the value corresponding to the marker to obtain the second encoding, where the value represents the number of times the integration value of the integrator reaches the preset threshold. At the same time, the sampler samples the intensity of the integrator to obtain a sampling result, and the encoder encodes according to the sampling result to obtain the first encoding. Combining the second encoding and the first encoding represents the accumulated light intensity at the current sampling. Because within the current sampling unit, the number of times the integration value reaches the preset threshold is greater than or equal to 1, for example, it is A, and the (A + 1)-th integration is still in progress. Just within the current sampling unit, the (A + 1)-th integration value does not reach the preset threshold and is less than the preset threshold, but there is still a certain integration value. Therefore, at the current sampling moment, encoding the value corresponding to the marker to obtain the second encoding, encoding the intensity of the integrator at the current sampling to obtain the first encoding, and combining the second encoding and the first encoding can more accurately represent the accumulated light intensity at the current sampling.
[0143] According to an embodiment of the present application, the marker is a counter, and the marker is incremented by 1 whenever the intensity of the integrator reaches the preset threshold.
[0144] Specifically, in a sampling unit, in the initial state, the value corresponding to the marker is 0. As the number of times the integration value reaches the preset threshold increases, the value corresponding to the marker is continuously incremented by 1. In this way, the value of the marker can directly represent the multiple of the accumulated light intensity at the current sampling relative to the preset light intensity, that is, it can represent the level of the accumulated light intensity at the current sampling. For example, if the preset light intensity is Q and the value of the marker is 2, then the value of the marker represents that the accumulated light intensity at the current sampling is 2Q.
[0145] In other embodiments, the value of the marker corresponding to the initial state may be represented by other values, and whenever the integral value reaches a preset threshold, the value corresponding to the marker may increase proportionally or non-proportionally. That is, the specific representation rule of the marker may be set according to actual needs.
[0146] According to an embodiment of the present application, the encoding method of the timing signal further includes: in each sampling unit, if the value of the marker is 0, the encoder obtains a base code encoded as 0, otherwise, it obtains a base code encoded as 1, where the encoder outputs the encoding results in sequence according to the sampling order as the encoding of the timing signal, including: the encoder outputs the encoding results and the base code in sequence according to the sampling order as the encoding of the timing signal.
[0147] Specifically, each time of sampling, the encoder can obtain the base code (i.e., the third encoding in the above text) according to the value of the marker. If the marker is in the initial state, the base code is 0, otherwise, the base code is 1. Here, the base code is used to indicate whether the marker is in the initial state. Therefore, in addition to being represented by the set of values 0 and 1, the base code can also be represented by other values or letters, and the embodiments of the present application do not limit this.
[0148] In this embodiment, the base code being 0 indicates that the integral value has not reached the preset threshold within the sampling unit, that is, the accumulated light intensity at the current sampling is less than Q; the base code being 1 indicates that the number of times the integral value reaches the preset threshold within the sampling unit is greater than or equal to 1, that is, the accumulated light intensity at the current sampling is greater than or equal to Q. Here, the preset light intensity Q corresponds to the preset threshold. The preset light intensity Q can be regarded as the boundary line between weak light and strong light. If the accumulated light intensity at the current sampling is less than Q, it means that within the sampling unit, the light intensity is small and the accumulated light intensity is difficult to reach the preset light intensity Q; if the accumulated light intensity at the current sampling is greater than or equal to Q, it means that within the sampling unit, the light intensity is strong and the accumulated light intensity is equal to or exceeds the preset light intensity Q. Therefore, the base code can characterize whether the accumulated light intensity at the current sampling is strong light or weak light. Here, the preset light intensity Q can be set according to actual needs.
[0149] The combination of the base code and the first encoding or the second encoding corresponding to the same sampling moment can be regarded as the final encoding result at the current sampling moment. The base code can be located before or after the first encoding or at other positions in the first encoding. Similarly, the base code can be located before or after the second encoding or at other positions in the second encoding. The encoder outputs the final encoding results corresponding to different sampling moments in sequence according to the sampling order as the encoding of the timing signal.
[0150] In this embodiment, the encoding result is represented by using a base code in combination with a first encoding or a second encoding. This encoding result can not only provide information on whether the cumulative light intensity at the current sampling is strong light or weak light, but also further provide specific numerical information when the light intensity is strong light or weak light, which is convenient for obtaining detailed light intensity information.
[0151] According to an embodiment of the present application, the sampler samples the status of the marker and / or the intensity of the integrator in sequence, including: when the base code is 0, the sampler samples the intensity of the integrator in sequence to obtain a sampling result. Among them, the encoder encodes according to the status of the marker and / or the intensity of the integrator, including: the encoder encodes according to the sampling result to obtain a microcode.
[0152] Specifically, when the base code is 0, it means that from the end of the previous sampling to the current sampling moment, the intensity (i.e., the integral value) of the integrator has not reached the preset threshold. At this time, the sampler samples according to the intensity of the integrator at the current sampling to obtain a sampling result, and the sampling result can be the integral value. The encoder can obtain a microcode (i.e., the first encoding in the above text) by encoding according to the sampling result.
[0153] The sampler obtains the integral value through sampling, and the encoder directly encodes according to the integral value to obtain a microcode, so that the electric signal intensity at the current sampling can be obtained more accurately, that is, the microcode can more accurately reflect the cumulative light intensity at the current sampling.
[0154] According to an embodiment of the present application, the sampler samples the status of the marker and / or the intensity of the integrator in sequence, including: when the base code is 1, the sampler reads the corresponding value of the marker in sequence. Among them, the encoder encodes according to the status of the marker and / or the intensity of the integrator, including: the encoder encodes according to the corresponding value of the marker to obtain a macrocode, where the value represents the number of times the integral value of the integrator reaches the preset threshold.
[0155] Specifically, when the base code is 1, it means that from the end of the previous sampling to the current sampling moment, the number of times the integral value reaches the preset threshold is greater than or equal to 1, and the corresponding value of the marker represents the number of times the integral value of the integrator reaches the preset threshold. That is, the integrator can integrate the timing signal during the period from the end of the previous sampling to the current sampling moment. When the integral value reaches the preset threshold, the corresponding value of the marker becomes larger (for example, increased by 1), and the integrator resets and starts integrating again. The encoder can obtain a macrocode (i.e., the second encoding in the above text) by encoding according to the corresponding value of the marker at the current sampling moment.
[0156] In this embodiment, during the period from the end of the previous sampling to the current sampling moment, the light intensity corresponding to the local space may be relatively strong. Therefore, within the interval between two adjacent samplings, the number of times the integral value reaches the preset threshold may be one or more, and the corresponding marker is in a non-initial state, that is, a non-zero state. At this time, encoding is performed based on the value corresponding to the marker to obtain a macro code, and the electrical signal intensity at the current sampling can be accurately obtained. For example, it can be learned how many times the electrical signal intensity at the current sampling is relative to the preset threshold. Since there is a certain correspondence between the electrical signal intensity and the light intensity, according to this correspondence, the preset threshold also corresponds to a certain preset light intensity. Therefore, the macro code can also accurately reflect how many times the accumulated light intensity at the current sampling is relative to the preset light intensity, and thus the specific intensity value of the timing signal within the sampling unit (interval between two adjacent samplings) with strong light intensity can be obtained. Therefore, in this embodiment, by recording the number of integrations within the sampling period using a marker and then encoding according to the value corresponding to the marker, the acquisition of detailed information in the timing signal can be realized, and the limitation of information acquisition by a fixed sampling frequency can be avoided.
[0157] According to an embodiment of the present application, the sampler samples the state of the marker and / or the intensity of the integrator in sequence, including: when the base code is 0, the sampler samples the intensity of the integrator in sequence to obtain a sampling result; when the base code is 1, the sampler reads the value corresponding to the marker in sequence, where the encoder encodes according to the state of the marker and / or the intensity of the integrator, including: the encoder encodes according to the sampling result to obtain a micro code and encodes according to the value corresponding to the marker to obtain a macro code, where the value represents the number of times the integral value of the integrator reaches the preset threshold.
[0158] Specifically, when encoding the timing signal, the sampler samples the timing signal multiple times and obtains multiple sampling results. The encoder can obtain the encoding result corresponding to the entire timing signal by encoding according to the multiple sampling results. The light intensity corresponding to different sampling moments may be different. At some sampling moments, the light intensity is relatively weak, the value of the marker is 0, and the base code is 0. At this time, the sampler samples the intensity of the integrator in sequence to obtain a sampling result (i.e., the integral value), and the encoder encodes according to the integral value to obtain a micro code. At some sampling moments, the light intensity is relatively strong, the value of the marker is not 0, and the base code is 1. At this time, the sampler reads the value corresponding to the marker in sequence, and the encoder encodes according to the value corresponding to the marker to obtain a macro code.
[0159] In this embodiment, by using the base code in combination with the micro code or the macro code to represent the encoding result, the encoding result can not only provide information on whether the accumulated light intensity at the current sampling is strong light or weak light, but also further provide specific numerical information when the light intensity is strong light or weak light, which is convenient for obtaining detailed light intensity information.
[0160] According to an embodiment of the present application, both the microcode and the macrocode are encoded in binary. The macrocode is encoded using m bits, the microcode is encoded using n bits, and n = m.
[0161] Specifically, both the microcode and the macrocode are encoded in binary, and both are represented by binary values of the same number of bits, which can ensure that the number of bits of the encoding result corresponding to each sampling is the same, facilitating the identification and management of the encoding result.
[0162] According to an embodiment of the present application, the acquisition device for the timing signal is one of multiple acquisition devices arranged in at least a two-dimensional form.
[0163] Specifically, the acquisition device for the timing signal can be a photosensitive sensor. The timing signal is an electrical signal converted from continuous or discontinuous optical signals collected by the photosensitive sensor.
[0164] When collecting optical signals in a specific area, the specific area may include one or more local spaces. Each local space corresponds to an acquisition device, which is used to collect the light intensity change in the local space within a certain period of time, that is, the photosensitive sensor collects continuous or discontinuous optical signals in the local space within a certain period of time and converts them into electrical signals to obtain the timing signal. For example, the specific area includes multiple local spaces, and the multiple local spaces are arranged in a matrix, so the multiple acquisition devices are correspondingly arranged in a matrix. Each local space may correspond to a local area in an image or video, such as a pixel area.
[0165] Optionally, the acquisition device for the timing signal can be a thermosensitive device, and the timing signal is an electrical signal converted from continuous or discontinuous temperature signals collected by the thermosensitive device. When collecting temperature signals in a specific area, the specific area may include one or more local spaces. Each local space corresponds to an acquisition device, which is used to collect the temperature change in the local space within a certain period of time.
[0166] Optionally, the signal collected by the acquisition device can be an electromagnetic wave signal of any wavelength, such as an electromagnetic wave signal with a wavelength wider than the optical signal. The signal collected by the acquisition device can also be a thermal signal, such as a thermal signal collected by a thermal infrared camera.
[0167] In this embodiment, each acquisition device may correspond to one or more pixel areas. When each acquisition device corresponds to multiple pixel areas, the acquisition device can be saved. When each acquisition device corresponds to one pixel area, precise control of the color and brightness change of each pixel area can be achieved, avoiding interference between adjacent pixels.
[0168] Decoding the encoding result obtained by using the encoding method of the timing signal provided in the embodiment of the present application can obtain the change of the light intensity corresponding to each local space in a specific area over time. Furthermore, based on the change of the light intensity over time, the acquisition of an image or video related to the specific area can be realized.
[0169] Figure 5 The following is a schematic flowchart of the encoding method of the timing signal provided in another embodiment of the present application. Figure 5 is Figure 4 an example. To avoid repetition, the same parts can be referred to the descriptions in the above embodiments and will not be specifically explained here. As Figure 5 shown, the encoding method includes the following content.
[0170] S410: The integrator integrates the timing signal according to the timing.
[0171] S420: The marker records the state of the integrator. When the integrator accumulates the intensity of the timing signal to a preset threshold, it triggers a change in the state of the marker, and the integrator is reset, where the initial value of the marker is 0.
[0172] Whenever the integral value reaches the preset threshold, the corresponding value of the marker is incremented by 1.
[0173] S430: The sampler determines whether the value of the marker is 0.
[0174] If the value of the marker is 0, then S440 is executed; otherwise, S460 is executed.
[0175] S440: The encoder determines that the base code is 0, and the sampler samples the intensity of the integrator according to the timing to obtain a sampling result.
[0176] S450: The encoder encodes according to the sampling result to obtain a microcode, and determines the encoding result at the current sampling moment based on the base code and the microcode.
[0177] The sampling result can be the intensity of the integrator (i.e., the integral value). The process of obtaining the microcode based on the intensity of the integrator can be referred to the description of the process of obtaining the first encoding based on the intensity of the integrator in the above embodiments and will not be elaborated here.
[0178] S460: The encoder determines that the base code is 1, and the sampler reads the value corresponding to the marker according to the timing.
[0179] S470: The encoder encodes according to the value corresponding to the marker to obtain a macrocode, and determines the encoding result at the current sampling moment based on the base code and the macrocode.
[0180] The value corresponding to the marker represents the number of times the integral value of the integrator reaches the preset threshold.
[0181] The process of obtaining the macro code based on the value corresponding to the integrator can refer to the description of the process of obtaining the second code based on the value corresponding to the flagger in the above embodiments, which will not be elaborated here.
[0182] S480: The encoder outputs the coding results corresponding to different sampling times in sequence according to the sampling order as the coding of the timing signal.
[0183] Figure 9 The figure shows a schematic flowchart of a decoding method for a timing signal provided by an embodiment of the present application. As Figure 9 shown, the decoding method includes the following content.
[0184] S910: Receive a bitstream, where the bitstream includes a coding result, and the coding result is used to represent the state where the integral value reaches a preset threshold when integrating the timing signal within the current sampling interval.
[0185] The timing signal can be an electrical signal reflecting the light intensity change in a certain local space within a certain period of time. The position of this local space can correspond to a certain local area in an image or video, such as a certain pixel area.
[0186] Integrating the timing signal in sequence means integrating the intensity of the electrical signal in sequence. When the integrated value obtained by integration reaches the preset threshold, this round of integration ends (i.e., the integrated value is reset), and the next round of integration is started. When the integrated value obtained by the next round of integration reaches the preset threshold, the next round of integration ends and a new round of integration is started, and so on in a cycle. Here, the preset threshold can be set according to actual needs.
[0187] The light intensity change in a certain local space within a certain period of time can be regular or irregular. For example, when the light intensity remains constant, the time required for the integrated value of each round of integration to reach the preset threshold is the same, while when the light intensity changes with time, the time required for the integrated value of each round of integration to reach the preset threshold may be different. Therefore, the integration period in the embodiments of the present application is not a preset fixed duration but variable.
[0188] Collecting the timing signal according to a certain sampling period to obtain a collection result, and coding the collection result according to a certain rule can obtain a bitstream. A sampling period can be understood as a sampling interval. The bitstream can correspond to multiple sampling intervals, and each sampling interval corresponds to a coding result.
[0189] Within any sampling interval, the timing signal is sampled, and the sampling result obtained can be the integral value of the timing signal within the current sampling interval, or the number of times the integral value of the timing signal within the current sampling interval reaches a preset threshold. For example, within the current sampling interval, the integral value of the timing signal has not reached the preset threshold; or, within the current sampling interval, the number of times the integral value of the timing signal reaches the preset threshold is one or more. Encoding the acquisition result of the current sampling interval can obtain an encoding result, and the encoding result can represent the state where the integral value reaches the preset threshold when integrating the timing signal within the current sampling interval.
[0190] S920: Reconstruct the timing signal according to the encoding result.
[0191] The encoding result can represent the state where the integral value of the timing signal reaches the preset threshold within the current sampling interval, and the state where the integral value of the timing signal reaches the preset threshold within the current sampling interval can characterize the signal strength (electrical signal strength) of the timing signal within the current sampling interval. Therefore, by decoding the encoding result, the signal strength corresponding to the current sampling interval can be obtained. Decoding the encoding results corresponding to each sampling interval in the bitstream can obtain the signal strengths corresponding to each sampling interval, thereby reconstructing the timing signal.
[0192] In one embodiment, the encoding result can be obtained according to the above-mentioned encoding method of the timing signal.
[0193] The embodiment of the present application provides a decoding method for a timing signal. By decoupling the sampling process and the integration process, an encoding result with a large expression dynamic range is obtained. Furthermore, by decoding this encoding result, the details of the timing signal can be reconstructed.
[0194] In one embodiment, the decoding method of the timing signal reconstructs the signal at a specific moment through the encoding of each sampling interval (including the integrator reset state and / or quantization value) within a certain time period, thereby reconstructing the timing signal.
[0195] According to an embodiment of the present application, the encoding result includes a first encoding for representing the quantization value when the integral value of the timing signal within the current sampling interval does not reach the preset threshold.
[0196] Specifically, the first encoding indicates that within the current sampling interval, the integral value of the timing signal has not reached the preset threshold. When encoding, the quantization value of the integral value is encoded according to certain rules to obtain the first encoding. That is, the first encoding can represent the quantization value of the integral value of the timing signal within the current sampling interval. When encoding the timing signal, the determination process of the quantization value of the integral value can refer to the relevant description in the above-mentioned encoding method of the timing signal, which will not be elaborated here.
[0197] In this embodiment, during the period from the end of the previous sampling to the current sampling moment (the current sampling interval), the light intensity corresponding to the local space may be relatively weak. Therefore, within the time interval between two adjacent samplings, the integral value does not reach the preset threshold. By decoding the first encoding, the quantization value of the integral value of the timing signal within the current sampling interval can be obtained. Based on the quantization value, the electrical signal intensity corresponding to the current sampling moment can be accurately obtained. In this way, the timing signal can be reconstructed based on the electrical signal intensity corresponding to the current sampling moment. The decoding method provided in this embodiment can effectively reconstruct the part of the timing signal with relatively weak electrical signal intensity (because the corresponding light intensity is weak).
[0198] According to an embodiment of the present application, the encoding result includes a second encoding, which is used to represent the number of times the integral value of the timing signal reaches the preset threshold when the integral value of the timing signal within the current sampling interval exceeds the preset threshold.
[0199] Specifically, the second encoding represents that the number of times the integral value of the timing signal reaches the preset threshold within the current sampling interval is one or more. When encoding, the number of times the integral value reaches the preset threshold is encoded according to certain rules to obtain the second encoding. That is, the second encoding can represent the number of times the integral value of the timing signal reaches the preset threshold within the current sampling interval. When encoding the timing signal, the determination process of the number of times the integral value reaches the preset threshold can refer to the relevant description in the above-mentioned encoding method of the timing signal, which will not be elaborated here.
[0200] In this embodiment, during the period from the end of the previous sampling to the current sampling moment (the current sampling interval), the light intensity corresponding to the local space may be relatively strong. Therefore, within the time interval between two adjacent samplings, the number of times the integral value reaches the preset threshold may be one or more. By decoding the second encoding, the number of times the integral value of the timing signal reaches the preset threshold within the current sampling interval can be obtained. Based on the number of times the integral value reaches the preset threshold, the electrical signal intensity corresponding to the current sampling moment can be accurately obtained. For example, it can be learned how many times the electrical signal intensity corresponding to the current sampling moment is relative to the preset threshold. In this way, the timing signal can be reconstructed based on the electrical signal intensity corresponding to the current sampling moment. The decoding method provided in this embodiment can effectively reconstruct the part of the timing signal with relatively strong electrical signal intensity (because the corresponding light intensity is strong).
[0201] According to an embodiment of the present application, the encoding result includes a third encoding and a first encoding. The third encoding is used to represent whether the integral value of the timing signal within the current sampling interval reaches the preset threshold, and the first encoding is used to represent the quantization value of the integral value of the timing signal when it does not reach the preset threshold. Among them, reconstructing the timing signal according to the encoding result includes: determining the signal intensity corresponding to the current sampling interval according to the third encoding and the first encoding to reconstruct the timing signal.
[0202] Specifically, the first encoding indicates that within the current sampling interval, the integrated value of the timing signal has not reached a preset threshold. When encoding, the quantization value of the integrated value can be encoded according to certain rules to obtain the first encoding. That is, the first encoding can represent the quantization value of the integrated value of the timing signal within the current sampling interval. When encoding the timing signal, the determination process of the quantization value of the integrated value can refer to the relevant description in the above-mentioned encoding method of the timing signal, which will not be elaborated here.
[0203] In this embodiment, within the period from the end of the previous sampling to the current sampling moment (the current sampling interval), the light intensity corresponding to the local space may be relatively weak. Therefore, within the time interval between two adjacent samplings, the integrated value has not reached the preset threshold. By decoding the first encoding, the quantization value of the integrated value of the timing signal within the current sampling interval can be obtained. Based on the quantization value, the electric signal intensity corresponding to the current sampling moment can be more accurately obtained. In this way, the timing signal can be reconstructed based on the electric signal intensity corresponding to the current sampling moment. The decoding method provided in this embodiment can effectively reconstruct the part of the timing signal with a relatively weak electric signal intensity (because the corresponding light intensity is weak).
[0204] Furthermore, the encoding result further includes a third encoding, which is used to indicate whether the integrated value of the timing signal has reached the preset threshold within the current sampling interval. For example, if the third encoding is 0, it indicates that the integrated value of the timing signal has not reached the preset threshold within the current sampling interval; if the third encoding is 1, it indicates that the integrated value of the timing signal has reached the preset threshold within the current sampling interval.
[0205] The first encoding can be one or more digits obtained by encoding the quantization value of the integrated value according to certain rules. The third encoding can be located before, after, or at other positions within the first encoding. In this way, when decoding, according to the value of the third encoding, it is convenient to determine that the one or more digits correspond to the first encoding. In this way, the decoding rule corresponding to the first encoding can be directly used to decode the one or more digits to obtain the quantization value of the integrated value of the timing signal within the current sampling interval, and then the electric signal intensity corresponding to the current sampling moment can be more accurately obtained based on the quantization value.
[0206] In this embodiment, the first encoding in the encoding result can be conveniently determined through the third encoding. Especially in some cases, the encoding result may include other encodings, and the other encodings are also represented by one or more digits. In this way, when decoding, for the one or more digits in the encoding result, it can be determined whether to use the decoding rule corresponding to the first encoding to decode the encoding result through the third encoding.
[0207] In this embodiment, in addition to being represented by the set of values 0 and 1, the third encoding can also be represented by other numerical values or letters, and the embodiments of the present application do not limit this. The third encoding can be referred to as the base code, and the first encoding can be referred to as the micro code.
[0208] According to an embodiment of the present application, the decoding method of the timing signal further includes: normalizing the first encoding to a value in the interval [0, 1], wherein determining the signal strength corresponding to the current sampling interval according to the third encoding and the first encoding to reconstruct the timing signal includes: determining the signal strength corresponding to the current sampling interval according to the third encoding and the value to reconstruct the timing signal.
[0209] Specifically, since the integral value corresponding to the first encoding is less than the preset threshold, the first encoding is normalized to a value in the interval [0, 1], and this value can vividly represent that the light intensity corresponding to the current sampling interval is weak. That is, when decoding the first encoding, the first encoding can be first normalized to a value in the interval [0, 1], and then this value is multiplied by the preset threshold to obtain the electrical signal strength corresponding to the current sampling moment.
[0210] In one embodiment, the encoding result corresponding to the current sampling interval can be determined as the first encoding according to the value of the third encoding first, and then the first encoding is normalized to a value in the interval [0, 1], and then this value is multiplied by the preset threshold to obtain the signal strength (electrical signal strength) corresponding to the current sampling moment.
[0211] In another embodiment, the first encoding can be first normalized to a value in the interval [0, 1], and then the encoding result corresponding to the current sampling interval is determined as the first encoding according to the value of the third encoding, and then this value is multiplied by the preset threshold to obtain the signal strength (electrical signal strength) corresponding to the current sampling moment.
[0212] According to an embodiment of the present application, the encoding result includes a third encoding and a second encoding. The third encoding is used to represent whether the integral value of the timing signal in the current sampling interval has reached the preset threshold, and the second encoding is used to represent the number of times the integral value reaches the preset threshold when the integral value of the timing signal in the current sampling interval exceeds the preset threshold. Wherein, reconstructing the timing signal according to the encoding result includes: determining the signal strength corresponding to the current sampling interval according to the third encoding and the second encoding to reconstruct the timing signal.
[0213] Specifically, the second encoding indicates that within the current sampling interval, the number of times the integral value of the timing signal reaches a preset threshold is one or more. When encoding, the number of times the integral value reaches the preset threshold is encoded according to certain rules to obtain the second encoding. That is, the second encoding can represent the number of times the integral value of the timing signal reaches the preset threshold within the current sampling interval. When encoding the timing signal, the determination process of the number of times the integral value reaches the preset threshold can refer to the relevant description in the above-mentioned encoding method of the timing signal, which will not be elaborated here.
[0214] In this embodiment, within the period from the end of the previous sampling to the current sampling moment (the current sampling interval), the light intensity corresponding to the local space may be relatively strong. Therefore, within the interval between two adjacent samplings, the number of times the integral value reaches the preset threshold may be one or more. By decoding the second encoding, the number of times the integral value of the timing signal reaches the preset threshold within the current sampling interval can be obtained. Based on the number of times the integral value reaches the preset threshold, the electric signal intensity corresponding to the current sampling moment can be more accurately obtained. For example, it can be learned how many times the electric signal intensity corresponding to the current sampling moment is relative to the preset threshold. In this way, the timing signal can be reconstructed based on the electric signal intensity corresponding to the current sampling moment. The decoding method provided in this embodiment can effectively reconstruct the part of the timing signal with a strong electric signal intensity (because the corresponding light intensity is strong).
[0215] Furthermore, the encoding result further includes a third encoding, which is used to indicate whether the integral value of the timing signal reaches the preset threshold within the current sampling interval. For example, if the third encoding is 0, it means that the integral value of the timing signal does not reach the preset threshold within the current sampling interval; if the third encoding is 1, it means that the integral value of the timing signal reaches the preset threshold within the current sampling interval.
[0216] The second encoding can be one or more digits obtained by encoding the number of times the integral value reaches the preset threshold according to certain rules. The third encoding can be located before, after the second encoding, or at other positions within the second encoding. In this way, when decoding, according to the value of the third encoding, it is very convenient to determine that the one or more digits correspond to the second encoding. In this way, the decoding rule corresponding to the second encoding can be directly used to decode the one or more digits to obtain the number of times the integral value of the timing signal reaches the preset threshold within the current sampling interval, and then based on this number, the electric signal intensity corresponding to the current sampling moment can be more accurately obtained.
[0217] In this embodiment, the second encoding in the encoding result can be conveniently determined through the third encoding. Especially in some cases, the encoding result may include other encodings, and the other encodings are also represented by one or more digits. In this way, when decoding, for one or more digits in the encoding result, it can be determined whether to decode the encoding result using the decoding rule corresponding to the second encoding through the third encoding.
[0218] In this embodiment, the third encoding can be represented by other numerical values or letters in addition to being represented by the set of numerical values 0 and 1. The embodiments of the present application do not limit this. The third encoding can be called the base code, and the second encoding can be called the macro code.
[0219] According to an embodiment of the present application, reconstructing a timing signal according to an encoding result includes: when the encoding result of the current sampling interval only includes the third encoding and is 0, determining the number of multiple sampling intervals that are connected before and after the current sampling interval and whose third encoding is 0, and determining that the signal strength corresponding to each sampling interval in the multiple sampling intervals is the reciprocal of the number, where the third encoding is used to represent whether the integral value of the timing signal in the current sampling interval has reached a preset threshold.
[0220] Specifically, the third encoding is used to represent whether the integral value of the timing signal in the current sampling interval has reached a preset threshold. If the third encoding is 0, it means that the integral value of the timing signal in the current sampling interval has not reached the preset threshold, which indicates that the light intensity corresponding to the local space may be relatively weak in the current sampling interval. Due to the relatively weak light intensity, the integral value may not have reached the preset threshold in several consecutive sampling intervals before and after the current sampling interval, and the integral value continues to integrate and accumulate in these consecutive sampling intervals. For example, the number of these consecutive sampling intervals is 4, and the integral values corresponding to the 4 consecutive sampling intervals are 1 / 4, 2 / 4, 3 / 4, 1 respectively. Here, it is assumed that the preset threshold is 1. The third encoding corresponding to the first three sampling intervals among the 4 consecutive sampling intervals is 0, and the third encoding corresponding to the fourth sampling interval is 1. The current sampling interval is the second sampling interval among the 4 consecutive sampling intervals.
[0221] In this embodiment, the encoding result only includes the third encoding, that is, when encoding the timing signal, only the third encoding is used to encode the timing signal, which can simplify the encoding result. When decoding this simplified encoding result, by comprehensively considering the number of multiple sampling intervals that are connected before and after the current sampling interval and whose third encoding is 0, the signal strength corresponding to the current sampling interval can be determined according to this number. That is, the signal strength corresponding to the current sampling interval is determined according to the encoding result of the current sampling interval and the encoding results of the sampling intervals before and / or after the current sampling interval.
[0222] Of course, the actual light intensity may not be constant within these 4 consecutive sampling intervals, that is, the integral value may not increase proportionally within these 4 consecutive sampling intervals. Therefore, the signal intensity corresponding to the current sampling interval can be estimated by the methods provided in the following two embodiments.
[0223] In one embodiment, when decoding the current sampling interval, it can be determined that the number of consecutive sampling intervals with only the third coding and the third coding being 0 before and after the current sampling interval is 3. Furthermore, it can be determined that the signal intensity corresponding to each of these 3 sampling intervals is 1 / 3. Here, although the integral value reaches the preset threshold in the fourth sampling interval, the integral value may have been almost reaching the preset threshold in the third sampling interval. Therefore, only the sampling intervals with the third coding being 0 can be considered to determine the signal intensity corresponding to the current sampling interval.
[0224] In another embodiment, when decoding the current sampling interval, it can be determined that the number of consecutive sampling intervals with only the third coding and the third coding being 0 before and after the current sampling interval is 3. Since the integral value will continue to accumulate in the fourth sampling interval before the integral value reaches the preset threshold, it can be determined that the signal intensity corresponding to each of these 4 sampling intervals is 1 / 4. That is, determine the number of consecutive sampling intervals with only the third coding and the third coding being 0 before and after the current sampling interval, and use the reciprocal of the number plus 1 as the signal intensity corresponding to the current sampling interval.
[0225] The signal intensity (such as 1 / 3, 1 / 4) mentioned in the embodiments of the present application can be a coefficient. By multiplying the signal intensity corresponding to the preset threshold by this coefficient, the actual signal intensity corresponding to the sampling interval can be obtained.
[0226] According to an embodiment of the present application, reconstructing a timing signal according to a coding result includes: when the coding result of the current sampling interval only includes the third coding and is 1, determining the number of consecutive sampling intervals with only the third coding and being 0 before the current sampling interval, and determining the signal intensity corresponding to the current sampling interval as the reciprocal of the number plus 1, where the third coding is used to indicate whether the integral value of the timing signal has reached a preset threshold within the current sampling interval.
[0227] Specifically, the third code is used to indicate whether the integral value of the timing signal has reached a preset threshold within the current sampling interval. If the third code is 1, it indicates that the integral value of the timing signal has reached the preset threshold within the current sampling interval. In the case of relatively weak light intensity, the integral value may not have reached the preset threshold in several consecutive sampling intervals before the current sampling interval, and the integral value continues to integrate until the current sampling interval, at which point the integral value reaches the preset threshold. For example, the number of several consecutive sampling intervals before the current sampling interval is 3, that is, the integral value continues to integrate in 4 consecutive sampling intervals until it reaches the preset threshold in the fourth sampling interval. The integral values corresponding to these 4 consecutive sampling intervals are 1 / 4, 2 / 4, 3 / 4, 1 respectively, where it is assumed that the preset threshold is 1. The third code corresponding to any of the first 3 sampling intervals is 0, and the third code corresponding to the current sampling interval is 1.
[0228] In this embodiment, the encoding result only includes the third code. That is, when encoding the timing signal, only the third code is used to encode the timing signal, which can simplify the encoding result. When decoding the simplified encoding result, by comprehensively considering the number of sampling intervals that are connected before the current sampling interval and have only the third code with the third code being 0, the signal intensity corresponding to the current sampling interval with the third code being 1 can be determined according to this number. That is, the signal intensity corresponding to the current sampling interval is determined based on the encoding result of the current sampling interval and the encoding results of the sampling intervals before the current sampling interval.
[0229] Of course, the actual light intensity may not be constant within these 4 consecutive sampling intervals, that is, the integral value may not increase in equal proportion within these 4 consecutive sampling intervals. Therefore, the method provided in this embodiment can estimate the signal intensity corresponding to the current sampling interval.
[0230] For example, when decoding the current sampling interval, it can be determined that the number of sampling intervals that are connected before the current sampling interval and have only the third code with the third code being 0 is 3. Since the integral value will continue to accumulate in the fourth sampling interval before the integral value reaches the preset threshold, it is determined that the signal intensity corresponding to the current sampling interval is the reciprocal of the number of sampling intervals that are connected before the current sampling interval and have only the third code with the third code being 0 plus 1, that is, 1 / 4.
[0231] In this embodiment, it can be determined that the signal intensity corresponding to each of these 4 sampling intervals is 1 / 4.
[0232] The signal intensity (such as 1 / 4) mentioned in the embodiments of the present application can be a coefficient. By multiplying the signal intensity corresponding to the preset threshold by this coefficient, the actual signal intensity corresponding to the sampling interval can be obtained.
[0233] According to an embodiment of the present application, reconstructing a timing signal according to a coding result includes: determining a signal strength corresponding to a current sampling interval according to the coding result of the current sampling interval and the coding results of the sampling intervals before and / or after the current sampling interval.
[0234] Specifically, the coding process of the timing signal is executed according to a certain sampling period, and one sampling period (sampling interval) corresponds to one coding result. The coding result is related to the state where the integral value reaches a preset threshold. Here, the sampling interval is fixed, while the period for integrating the timing signal is not fixed. The integration process is only related to the preset threshold. Whenever the integral value reaches the preset threshold, the integration process restarts. The number of times the integral value reaches the preset threshold within each sampling interval is counted separately. Since the intensity and the change of the intensity of the timing signal are different at different time periods, the period for integrating the timing signal is not fixed.
[0235] In an embodiment, the integral value corresponding to the current sampling interval may include the integral values corresponding to several previous consecutive sampling intervals. Therefore, when decoding the coding result of the current sampling interval to determine the signal strength corresponding to the current sampling interval, the integral value corresponding to the current sampling interval can be subtracted from the integral value corresponding to the previous sampling interval to obtain a difference, and then the signal strength corresponding to the current sampling interval can be determined according to the difference.
[0236] For example, the coding result corresponding to the current sampling interval includes a third coding and a first coding. The third coding of the current sampling interval is 0, and the integral value corresponding to the first coding of the current sampling interval is 1 / 2. Here, it is assumed that the preset threshold is 1. The third coding of the previous sampling interval is 0, and the integral value corresponding to the first coding of the previous sampling interval is 1 / 4. By decoding the coding result of the current sampling interval, it can be determined that the signal strength corresponding to the current sampling interval is (1 / 2 - 1 / 4), that is, 1 / 4.
[0237] For another example, the coding result corresponding to the current sampling interval includes a third coding and a second coding. The third coding of the current sampling interval is 1, and the number of times the integral value corresponding to the second coding of the current sampling interval reaches the preset threshold is 2. Here, it is assumed that the preset threshold is 1. The coding result corresponding to the previous sampling interval includes a third coding and a first coding. The third coding of the previous sampling interval is 0, and the integral value corresponding to the first coding of the previous sampling interval is 1 / 4. By decoding the coding result of the current sampling interval, it can be determined that the signal strength corresponding to the current sampling interval is (2 - 1 / 4), that is, 7 / 4.
[0238] For still another example, the coding result corresponding to the current sampling interval only includes a third coding and the third coding is 0. The signal strength corresponding to the current sampling interval can be determined according to the number of multiple sampling intervals that are connected before and after the current sampling interval and only include the third coding and the third coding is 0.
[0239] The meanings of the first encoding, the second encoding, and the third encoding in the embodiments of the present application can be referred to the descriptions in the above embodiments. The signal strengths (such as 1 / 4, 7 / 4) mentioned in the embodiments of the present application can be coefficients, and the actual signal strength corresponding to the sampling interval can be obtained by multiplying the signal strength corresponding to the preset threshold by the coefficient.
[0240] In this embodiment, determining the signal strength corresponding to the current sampling interval according to the encoding result of the current sampling interval and the encoding results of the sampling intervals before and / or after the current sampling interval can more accurately determine the signal strength corresponding to the current sampling interval.
[0241] According to an embodiment of the present application, the acquisition device of the timing signal is one of a plurality of acquisition devices arranged in at least a two-dimensional form.
[0242] Specifically, the acquisition device of the timing signal can be a photosensitive sensor. The timing signal is an electrical signal converted from continuous or discontinuous optical signals collected by the photosensitive sensor.
[0243] When collecting optical signals for a specific area, the specific area may include one or more local spaces. Each local space corresponds to an acquisition device, and the acquisition device is used to collect the light intensity change in the local space within a certain period of time, that is, the photosensitive sensor collects continuous or discontinuous optical signals in the local space within a certain period of time and converts them into electrical signals to obtain the timing signal. For example, the specific area includes a plurality of local spaces, and the plurality of local spaces are arranged in a matrix, so the plurality of acquisition devices are correspondingly arranged in a matrix. Each local space may correspond to a local area in an image or video, such as a pixel area.
[0244] Optionally, the acquisition device of the timing signal can be a thermosensitive device, and the timing signal is an electrical signal converted from continuous or discontinuous temperature signals collected by the thermosensitive device. When collecting temperature signals for a specific area, the specific area may include one or more local spaces. Each local space corresponds to an acquisition device, and the acquisition device is used to collect the temperature change in the local space within a certain period of time.
[0245] Optionally, the signal collected by the acquisition device can be an electromagnetic wave signal of any wavelength, such as an electromagnetic wave signal with a wavelength wider than the optical signal. The signal collected by the acquisition device can also be a thermal signal, such as the thermal signal collected by a thermal infrared camera.
[0246] In this embodiment, each acquisition device may correspond to one or more pixel regions. When each acquisition device corresponds to multiple pixel regions, the acquisition devices can be saved. When each acquisition device corresponds to one pixel region, precise control over the color and brightness changes of each pixel region can be achieved, avoiding interference between adjacent pixels.
[0247] Decoding the encoded timing signal can reconstruct the timing signal. The reconstructed timing signal can reflect the change of light intensity over time in each local space within a specific region during a certain period. Based on the change of light intensity over time, acquisition of an image or video related to the specific region can be achieved.
[0248] Figure 10 The following is a schematic flowchart of a method for decoding a timing signal provided in another embodiment of the present application. Figure 10 is Figure 9 an example. To avoid repetition, the same parts can be referred to the descriptions in the above embodiments and will not be specifically explained here. As Figure 10 shown, the decoding method includes the following content.
[0249] S1010: Receive a bitstream. The bitstream includes multiple encoding results.
[0250] The bitstream may correspond to multiple sampling intervals, and each sampling interval corresponds to an encoding result. The encoding result is used to represent the state where the integration value reaches a preset threshold when integrating the timing signal within the current sampling interval.
[0251] The encoding result corresponding to each sampling interval may include a third encoding, and the third encoding is used to represent whether the integration value of the timing signal has reached the preset threshold within the sampling interval. If the third encoding is 0, it means that the integration value of the timing signal has not reached the preset threshold within the sampling interval; if the third encoding is 1, it means that the integration value of the timing signal has reached the preset threshold within the sampling interval.
[0252] When the integration value of the timing signal within the sampling interval does not exceed the preset threshold, the encoding result corresponding to the sampling interval may further include a first encoding, and the first encoding is used to represent the quantization value of the integration value of the timing signal when it has not reached the preset threshold within the current sampling interval.
[0253] When the integration value of the timing signal within the sampling interval exceeds the preset threshold, the encoding result corresponding to the sampling interval may further include a second encoding, and the second encoding is used to represent the number of times the integration value reaches the preset threshold when the integration value of the timing signal exceeds the preset threshold within the sampling interval.
[0254] S1020: Determine the signal strength corresponding to each encoding result according to each encoding result.
[0255] When the coding result includes a third code and a first code, the first code can be a numerical value greater than or equal to 0 and less than 1, which is used to represent the proportion of the integral value to the preset threshold. If the third code of the previous coding result of this coding result is 1, the first code of this coding result can be directly multiplied by the preset threshold to determine the signal strength corresponding to this coding result. If the third code of the previous coding result of this coding result is 0, the difference can be obtained by subtracting the first code corresponding to the previous coding result from the first code corresponding to this coding result, and the difference is multiplied by the preset threshold to determine the signal strength corresponding to this coding result.
[0256] When the coding result includes a third code and a second code, based on the second code, the number of times the integral value of the timing signal reaches the preset threshold within the sampling interval corresponding to this coding result can be determined. If the third code of the previous coding result of this coding result is 1, the numerical value corresponding to this number of times can be directly multiplied by the preset threshold to determine the signal strength corresponding to this coding result. If the third code of the previous coding result of this coding result is 0, the difference can be obtained by subtracting the first code corresponding to the previous coding result from the numerical value corresponding to this number of times, and the difference is multiplied by the preset threshold to determine the signal strength corresponding to this coding result.
[0257] S1030: Reconstruct the timing signal according to the signal strength corresponding to each coding result.
[0258] Exemplary Device
[0259] Figure 6 The following shows a schematic structural diagram of a coding device 600 for a timing signal provided by an embodiment of the present application. As Figure 6 shown, the coding device 600 includes: an integration module 610 and a coding module 620.
[0260] The integration module 610 is used to integrate the timing signal in sequence, automatically reset whenever the integral value reaches the preset threshold, and record the reset state with a reset flag. The coding module 620 is used for each sampling, coding according to the reset flag to obtain a coding result, and resetting the reset flag to the initial state.
[0261] An embodiment of the present application provides an encoding device for timing signals, which separates the integration process and the sampling process, avoiding the limitation of the integration period by the sampling period, making the integration process independent of the sampling process. In addition, by setting a preset threshold for the integration value, it is ensured that the integration process can be cycled, and the reset flag is used to record the reset state corresponding to the integration process within the sampling period, and then encoding is performed according to the reset flag. Since the integration process is independent of the sampling process and resets when the integration value reaches the preset threshold, it is beneficial for smoothing and denoising to improve the signal-to-noise ratio of weak signals. In addition, since the sampling process is decoupled from the integration process, the sampling frequency can be freely arranged according to the requirements of time sensitivity, without considering the strength of the signal and the signal-to-noise ratio, and adaptive encoding is performed based on the reset flag according to the strength of the timing signal, greatly expanding the dynamic range of the encoding expression.
[0262] According to an embodiment of the present application, the encoding module 620 is configured to: if the reset flag at the time of sampling is in the initial state, encode according to the integration value at the time of sampling to obtain a first encoding.
[0263] According to an embodiment of the present application, the encoding module 620 is configured to: quantize the integration value at the time of sampling to obtain a quantization value; and encode according to the quantization value to obtain the first encoding.
[0264] According to an embodiment of the present application, the encoding module 620 is configured to: quantize the integration value at the time of sampling using binary to obtain a quantization value of n bits; and use the n bits as the first encoding.
[0265] According to an embodiment of the present application, the encoding module 620 is configured to: compare the quantization value of the integration value at each sampling with the quantization value of the integration value at the previous sampling to obtain a difference value; and determine the first encoding according to the difference value.
[0266] According to an embodiment of the present application, the encoding module 620 is configured to: quantize the difference value to obtain a quantization value of n bits, and use the n bits as the first encoding; or, if the difference value is x, use x 0s or 1s to represent the first encoding.
[0267] According to an embodiment of the present application, the encoding module 620 is configured to: if the reset flag at the time of sampling is in a non-initial state, encode according to the value corresponding to the reset flag to obtain a second encoding, where the value represents the number of times the integration value reaches the preset threshold.
[0268] According to an embodiment of the present application, the encoding module 620 is configured to: if the value corresponding to the reset flag is less than M, use the value corresponding to the reset flag as the encoding value to encode to obtain a second encoding; if the value corresponding to the reset flag is greater than or equal to M, use M as the encoding value to encode to obtain a second encoding.
[0269] According to an embodiment of the present application, the encoding module 620 is configured to: use the corresponding natural number of the numerical value as the second encoding; or convert the numerical value into m bits in binary as the second encoding; or if the numerical value is x, use x 1s or 0s as the second encoding.
[0270] According to an embodiment of the present application, the reset flag corresponding to the initial state is 0, and the reset flag is incremented by 1 whenever the integral value reaches a preset threshold.
[0271] According to an embodiment of the present application, the encoding result includes a third encoding, and the third encoding is used to indicate whether the reset state is the initial state.
[0272] According to an embodiment of the present application, if the reset state is the initial state, the third encoding is 0; otherwise, the third encoding is 1.
[0273] According to an embodiment of the present application, the acquisition device of the timing signal is one of a plurality of acquisition devices arranged in at least a two-dimensional form.
[0274] According to an embodiment of the present application, the timing signal is an electrical signal converted from an optical signal collected by a photosensitive sensor or a temperature signal collected by a thermosensitive device.
[0275] It should be understood that the operations and functions of the integration module 610 and the encoding module 620 in the above embodiments can be referred to the description in the encoding method of the timing signal provided in the above Figures 2 to 3 embodiment. To avoid repetition, it will not be elaborated here.
[0276] Figure 7 The following shows a schematic structural diagram of a timing signal encoding device 700 provided by another embodiment of the present application. As Figure 7 shown, the encoding device 700 includes: an integrator 710, a flagger 720, a sampler 730, and an encoder 740.
[0277] The integrator 710 is configured to integrate the timing signal in sequence. The flagger 720 is configured to record the state of the integrator. When the integrator accumulates the intensity of the timing signal to a preset threshold, it triggers a change in the state of the flagger. Among them, the initial value of the flagger is 0. When the integrator accumulates the intensity of the timing signal to the preset threshold, the integrator is reset. The sampler 730 is configured to sample the state of the flagger and / or the intensity of the integrator in sequence. The encoder 740 is configured to perform encoding according to the state of the flagger and / or the intensity of the integrator to obtain an encoding result. Among them, after each sampling ends, the flagger is reset to 0. The encoder 740 is further configured to sequentially output the encoding result in the sampling order as the encoding of the timing signal.
[0278] An embodiment of the present application provides an encoding device for timing signals, which separates the integration process and the sampling process, avoiding the limitation of the integration period by the sampling period, making the integration process independent of the sampling process. In addition, by setting a preset threshold for the integration value, it is ensured that the integration process can be cycled, and a flag is used to record the integration state corresponding to the integration process within the sampling period, and then encoding is performed according to the state of the flag and / or the strength of the integrator. Since the integration process is independent of the sampling process and is reset when the integration value reaches the preset threshold, it is beneficial for smoothing and denoising to improve the signal-to-noise ratio of weak signals. In addition, since the sampling process is decoupled from the integration process, the sampling frequency can be freely arranged according to the time sensitivity requirement without considering the strength of the signal and the signal-to-noise ratio, and adaptive encoding is performed based on the state of the flag according to the strength of the timing signal, greatly expanding the dynamic range of the encoding expression.
[0279] According to an embodiment of the present application, the sampler 730 is configured to: if the value of the flag at the time of sampling is 0, sample the strength of the integrator according to the timing to obtain a sampling result, where the encoder 740 is configured to: perform encoding according to the sampling result to obtain a first encoding.
[0280] According to an embodiment of the present application, the encoding device 700 further includes a quantizer 750. The quantizer 750 is configured to: quantize the sampling result to obtain a quantization value. The encoder 740 is configured to determine the first encoding according to the quantization value.
[0281] According to an embodiment of the present application, the quantizer 750 is configured to: quantize the sampling result using binary to obtain a quantization value of n bits, where the encoder 740 is configured to: use the n bits as the first encoding.
[0282] According to an embodiment of the present application, the encoder 740 is configured to: compare the quantization value of the sampling result with the quantization value of the sampling result at the previous sampling to obtain a difference, and determine the first encoding according to the difference.
[0283] According to an embodiment of the present application, the encoder 740 is configured to: quantize the difference to obtain a quantization value of n bits, and use the n bits as the first encoding; or, if the difference is x, use x 0s or 1s to represent the first encoding.
[0284] According to an embodiment of the present application, the sampler 730 is configured to: if the flag at the time of sampling is in a non-zero state, read the value corresponding to the flag according to the timing, where the encoder 740 is configured to: perform encoding according to the value corresponding to the flag to obtain a second encoding, where the value represents the number of times the integration value of the integrator reaches the preset threshold.
[0285] According to an embodiment of the present application, the encoder 740 is configured to: if the value corresponding to the flag is less than M, encode the value corresponding to the flag as an encoding value to obtain a second encoding; if the value corresponding to the flag is greater than or equal to M, encode M as an encoding value to obtain a second encoding.
[0286] According to an embodiment of the present application, the encoder 740 is configured to: use the natural number corresponding to the value of the flag as the second encoding; or, convert the value corresponding to the flag into m bits according to binary as the second encoding; or, if the value corresponding to the flag is x, use x 1s or 0s as the second encoding.
[0287] According to an embodiment of the present application, the flag is a counter, and the flag is incremented by 1 whenever the intensity of the integrator reaches a preset threshold.
[0288] According to an embodiment of the present application, the encoder 740 is further configured to: in each sampling unit, if the value of the flag 720 is 0, obtain a base code encoded as 0, otherwise obtain a base code encoded as 1, where the encoder 740 is configured to: output the encoding result and the base code in sequence according to the sampling order as the encoding of the timing signal.
[0289] According to an embodiment of the present application, the sampler 730 is configured to: when the base code is 0, sample the intensity of the integrator according to the timing to obtain a sampling result, where the encoder 740 is configured to: perform encoding according to the sampling result to obtain a microcode.
[0290] According to an embodiment of the present application, the sampler 730 is configured to: when the base code is 1, read the value corresponding to the flag according to the timing, where the encoder 740 is configured to: the encoder performs encoding according to the value corresponding to the flag to obtain a macrocode, where the value represents the number of times the integration value of the integrator reaches the preset threshold.
[0291] According to an embodiment of the present application, the sampler 730 is configured to: when the base code is 0, the sampler samples the intensity of the integrator according to the timing to obtain a sampling result; when the base code is 1, the sampler reads the value corresponding to the flag according to the timing, where the encoder 740 is configured to: the encoder performs encoding according to the sampling result to obtain a microcode and performs encoding according to the value corresponding to the flag to obtain a macrocode, where the value represents the number of times the integration value of the integrator reaches the preset threshold.
[0292] According to an embodiment of the present application, both the microcode and the macrocode are encoded in binary, the macrocode is encoded with m bits, the microcode is encoded with n bits, and n = m.
[0293] According to an embodiment of the present application, the acquisition device of the timing signal is one of a plurality of acquisition devices arranged in at least a two-dimensional form.
[0294] According to an embodiment of the present application, the timing signal is an electrical signal converted from an optical signal collected by a photosensitive sensor or a temperature signal collected by a thermosensitive device.
[0295] It should be understood that the operations and functions of the integrator 710, marker 720, sampler 730, encoder 740, and quantizer 750 in the above embodiments can be referred to the description in the encoding method of the timing signal provided in the above Figures 4 to 5 embodiment. To avoid repetition, it will not be elaborated here.
[0296] Figure 11 The following shows a schematic structural diagram of a decoding device 1100 for a timing signal provided by an embodiment of the present application. As Figure 11 shown, the encoding device 1100 includes: a receiving module 1110 and a reconstructing module 1120.
[0297] The receiving module 1110 is configured to receive a bitstream, where the bitstream includes an encoding result, and the encoding result is used to represent a state where an integration value reaches a preset threshold when integrating the timing signal in a current sampling interval. The reconstructing module 1120 is configured to reconstruct the timing signal according to the encoding result.
[0298] The embodiment of the present application provides a decoding device for a timing signal. By decoupling the sampling process and the integration process, an encoding result with a large expression dynamic range is obtained, and then the encoding result is decoded to reconstruct the details of the timing signal.
[0299] According to an embodiment of the present application, the encoding result includes a first encoding, which is used to represent a quantization value when the integration value of the timing signal in a current sampling interval does not reach the preset threshold.
[0300] According to an embodiment of the present application, the encoding result includes a second encoding, which is used to represent the number of times the integration value reaches the preset threshold when the integration value of the timing signal in a current sampling interval exceeds the preset threshold.
[0301] According to an embodiment of the present application, the encoding result includes a third encoding and a first encoding. The third encoding is used to represent whether the integration value of the timing signal in a current sampling interval reaches the preset threshold, and the first encoding is used to represent a quantization value when the integration value of the timing signal in a current sampling interval does not reach the preset threshold. Wherein, the reconstructing module 1120 is configured to determine the signal strength corresponding to the current sampling interval according to the third encoding and the first encoding to reconstruct the timing signal.
[0302] According to an embodiment of the present application, the decoding method of the timing signal further includes a normalization module 1130, which is configured to normalize the first encoding to a numerical value in the interval [0, 1]. Wherein, the reconstructing module 1120 is configured to determine the signal strength corresponding to the current sampling interval according to the third encoding and the numerical value to reconstruct the timing signal.
[0303] According to an embodiment of the present application, the encoding result includes a third encoding and a second encoding. The third encoding is used to indicate whether the integral value of the timing signal has reached a preset threshold within the current sampling interval, and the second encoding is used to indicate the number of times the integral value reaches the preset threshold when the integral value of the timing signal exceeds the preset threshold within the current sampling interval. Among them, the reconstruction module 1120 is used to determine the signal strength corresponding to the current sampling interval according to the third encoding and the second encoding to reconstruct the timing signal.
[0304] According to an embodiment of the present application, the reconstruction module 1120 is configured to: when the encoding result of the current sampling interval only includes the third encoding and is 0, determine the number of multiple sampling intervals that are connected before and after the current sampling interval and only have the third encoding and are 0, and determine that the signal strength corresponding to each sampling interval in the multiple sampling intervals is the reciprocal of the number, where the third encoding is used to indicate whether the integral value of the timing signal has reached a preset threshold within the current sampling interval.
[0305] According to an embodiment of the present application, the reconstruction module 1120 is configured to: when the encoding result of the current sampling interval only includes the third encoding and is 1, determine the number of sampling intervals that are connected before the current sampling interval and only have the third encoding and are 0, and determine that the signal strength corresponding to the current sampling interval is the reciprocal of the number plus 1, where the third encoding is used to indicate whether the integral value of the timing signal has reached a preset threshold within the current sampling interval.
[0306] According to an embodiment of the present application, the reconstruction module 1120 is configured to: determine the signal strength corresponding to the current sampling interval according to the encoding result of the current sampling interval and the encoding results of the sampling intervals before and / or after the current sampling interval.
[0307] According to an embodiment of the present application, the acquisition device of the timing signal is one of multiple acquisition devices arranged in at least a two-dimensional form.
[0308] According to an embodiment of the present application, the timing signal is an electrical signal converted from an optical signal collected by a photosensitive sensor or a temperature signal collected by a thermosensitive device.
[0309] It should be understood that the operations and functions of the receiving module 1110, the reconstruction module 1120, and the normalization module 1130 in the above embodiments can be referred to the description in the decoding method of the timing signal provided in the above Figures 9 to 10 embodiment. To avoid repetition, it will not be elaborated here.
[0310] Exemplary Electronic Device
[0311] Figure 8 The block diagram of an electronic device 800 for executing the encoding method of the timing signal or the decoding method of the timing signal provided by an exemplary embodiment of the present application is shown.
[0312] Reference Figure 8 , the electronic device 800 includes a processing component 810, which further includes one or more processors, and memory resources represented by a memory 820 for storing instructions executable by the processing component 810, such as application programs. The application programs stored in the memory 820 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 810 is configured to execute instructions to perform the above-mentioned encoding method or decoding method of the timing signal.
[0313] The electronic device 800 may further include a power supply component configured to perform power management of the electronic device 800, a wired or wireless network interface configured to connect the electronic device 800 to a network, and an input / output (I / O) interface. The electronic device 800 may be operated based on an operating system stored in the memory 820, such as Windows Server TM , Mac OSX TM , Unix TM , Linux TM , FreeBSD TM or the like.
[0314] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the above-mentioned electronic device 800, enables the above-mentioned electronic device 800 to execute an encoding method or a decoding method of a timing signal. The encoding method of the timing signal includes: integrating the timing signal according to the timing, automatically resetting whenever the integration value reaches a preset threshold, and using a reset flag to record the reset state; at each sampling, encoding according to the reset flag to obtain an encoding result, and resetting the reset flag to the initial state. Alternatively, the encoding method of the timing signal includes: an integrator integrating the timing signal according to the timing; a flagger recording the state of the integrator, when the integrator accumulates the intensity of the timing signal to a preset threshold, triggering a change in the state of the flagger, and the integrator resets, where the initial value of the flagger is 0; a sampler sampling the state of the flagger and / or the intensity of the integrator according to the timing; an encoder encoding according to the state of the flagger and / or the intensity of the integrator to obtain an encoding result, where the flagger is reset to 0 after each sampling; the encoder sequentially outputs the encoding results in the sampling order as the encoding of the timing signal. The decoding method of the timing signal includes: receiving a code stream, the code stream includes an encoding result, and the encoding result is used to represent the state that the integration value reaches a preset threshold when integrating the timing signal in the current sampling interval; reconstructing the timing signal according to the encoding result.
[0315] All of the above optional technical solutions can be combined arbitrarily to form optional embodiments of the present application, which will not be elaborated one by one here.
[0316] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled professionals may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0317] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0318] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0319] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0320] In addition, the functional units in each embodiment of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0321] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program verification codes.
[0322] It should be noted that in the description of this application, the terms "first", "second", "third", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "a plurality of" is two or more.
[0323] The foregoing are only the preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent replacements, etc. made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims
1. A coding method for timing signals, characterized in that, Including: Integrating the timing signal in sequence, automatically resetting whenever the integrated value reaches a preset threshold, and using a reset flag to record the reset state, where the timing signal represents an electrical signal reflecting the light intensity change in a certain local space within a certain period of time; For each sampling, encoding according to the reset flag to obtain an encoding result, and resetting the reset flag to its initial state, The encoding according to the reset flag to obtain an encoding result includes: If the reset flag at the time of sampling is in a non-initial state, encoding according to the value corresponding to the reset flag to obtain a second encoding, where the value represents the number of times the integrated value reaches the preset threshold, The encoding according to the value corresponding to the reset flag to obtain a second encoding includes: If the value corresponding to the reset flag is less than M, using the value corresponding to the reset flag as the encoding value for encoding to obtain the second encoding; If the value corresponding to the reset flag is greater than or equal to M, using M as the encoding value for encoding to obtain the second encoding.
2. The coding method according to claim 1, characterized in that, The encoding according to the reset flag to obtain an encoding result includes: If the reset flag at the time of sampling is in the initial state, encoding according to the integrated value at the time of sampling to obtain a first encoding.
3. The coding method according to claim 2, characterized in that, The encoding according to the integrated value at the time of sampling to obtain a first encoding includes: Quantifying the integrated value at the time of sampling to obtain a quantization value; Encoding according to the quantization value to obtain the first encoding.
4. The coding method according to claim 3, characterized in that, The quantifying the integrated value at the time of sampling to obtain a quantization value includes: Quantifying the integrated value at the time of sampling using binary to obtain a quantization value of n bits, Wherein, the encoding according to the quantization value to obtain the first encoding includes: Using the n bits as the first encoding.
5. The coding method according to claim 2, characterized in that, The encoding according to the integrated value at the time of sampling to obtain a first encoding includes: Comparing the quantization value of the integrated value at each sampling with the quantization value of the integrated value at the previous sampling to obtain a difference; Determining the first encoding according to the difference.
6. The coding method according to claim 5, characterized in that, The determining the first encoding according to the difference includes: Quantifying the difference to obtain a quantization value of n bits and using the n bits as the first encoding; or, If the difference is x, using x 0s or 1s to represent the first encoding.
7. The coding method according to claim 1, characterized in that, The encoding according to the value corresponding to the reset flag to obtain a second encoding includes: Using the corresponding natural number of the value as the second encoding; or Converting the value into m bits in binary as the second encoding; or If the value is x, using x 1s or 0s as the second encoding.
8. The coding method according to claim 1, characterized in that, The reset flag corresponding to the initial state is 0, and the reset flag is incremented by 1 whenever the integrated value reaches the preset threshold.
9. The coding method according to any one of claims 1 to 8, characterized in that, The encoding result includes a third encoding, and the third encoding is used to indicate whether the reset state is the initial state.
10. The coding method according to claim 9, characterized in that,If the reset state is the initial state, the third encoding is 0, otherwise, the third encoding is 1.
11. The encoding method according to any one of claims 1 to 8, characterized in that, The acquisition device of the timing signal is one of a plurality of acquisition devices arranged in at least a two-dimensional form.
12. The encoding method according to any one of claims 1 to 8, characterized in that, The timing signal is an electrical signal converted from an optical signal collected by a photosensitive sensor or a temperature signal collected by a thermosensitive device.
13. An encoding method for a timing signal, characterized in that, It includes: An integrator integrates the timing signal in sequence, and the timing signal represents an electrical signal reflecting the light intensity change in a certain local space within a certain period of time; A marker records the state of the integrator. When the integrator accumulates the intensity of the timing signal to a preset threshold, it triggers a change in the state of the marker, and the integrator is reset, where the initial value of the marker is 0; A sampler samples the state of the marker and / or the intensity of the integrator in sequence; An encoder encodes according to the state of the marker and / or the intensity of the integrator to obtain an encoding result, where the marker is reset to 0 after each sampling; The encoder sequentially outputs the encoding result in the sampling order as the encoding of the timing signal, where, if the marker is in a non-zero state during sampling, the sampler reads the corresponding value of the marker in sequence; the encoder encodes according to the corresponding value of the marker to obtain a second encoding, and the value represents the number of times the integration value of the integrator reaches the preset threshold; if the corresponding value of the marker is less than M, the encoder encodes the corresponding value of the marker as the encoding value to obtain the second encoding; if the corresponding value of the marker is greater than or equal to M, the encoder encodes the M as the encoding value to obtain the second encoding.
14. An encoding device for a timing signal, characterized in that, It includes: An integration module is used to integrate the timing signal in sequence. Whenever the integration value reaches the preset threshold, it automatically resets and uses a reset flag to record the reset state. The timing signal represents an electrical signal reflecting the light intensity change in a certain local space within a certain period of time; A coding module is used for each sampling, encodes according to the reset flag to obtain an encoding result, and resets the reset flag to the initial state, Specifically, the coding module, if the reset flag is in a non-initial state during sampling, encodes according to the corresponding value of the reset flag to obtain a second encoding, where the value represents the number of times the integration value reaches the preset threshold, Specifically, the coding module, if the corresponding value of the reset flag is less than M, encodes the corresponding value of the reset flag as the encoding value to obtain the second encoding; if the corresponding value of the reset flag is greater than or equal to M, encodes the M as the encoding value to obtain the second encoding.
15. An encoding device for a timing signal, characterized in that, It includes: An integrator is used to integrate the timing signal in sequence. The timing signal represents an electrical signal reflecting the light intensity change in a certain local space within a certain period of time; A marker is used to record the state of the integrator. When the integrator accumulates the intensity of the timing signal to the preset threshold, it triggers a change in the state of the marker, where the initial value of the marker is 0. When the integrator accumulates the intensity of the timing signal to the preset threshold, the integrator is reset; A sampler is used to sample the state of the marker and / or the intensity of the integrator in sequence; An encoder, which is used to perform encoding according to the state of the marker and / or the intensity of the integrator to obtain an encoding result. After each sampling ends, the marker is reset to 0. The encoder is further used to sequentially output the encoding results in the sampling order as the encoding of the timing signal. Wherein, if the marker is in a non-zero state during sampling, the sampler is specifically used to read the value corresponding to the marker according to the timing; the encoder is specifically used to perform encoding according to the value corresponding to the marker to obtain a second encoding, and the value represents the number of times that the integral value of the integrator reaches a preset threshold. If the value corresponding to the marker is less than M, the encoder is specifically used to use the value corresponding to the marker as the encoding value to perform encoding to obtain the second encoding; if the value corresponding to the marker is greater than or equal to M, the encoder is specifically used to use M as the encoding value to perform encoding to obtain the second encoding.
16. A decoding method for a timing signal, characterized in that, It includes: A received code stream, which includes an encoding result, and the encoding result is used to represent the state where the integral value reaches a preset threshold when integrating the timing signal in the current sampling interval, and the timing signal represents an electrical signal reflecting the light intensity change of a certain local space within a certain period of time. Reconstruct the timing signal according to the encoding result. The reconstructing the timing signal according to the encoding result includes: Determine the signal intensity corresponding to the current sampling interval according to the encoding result of the current sampling interval and the encoding results of the sampling intervals before and / or after the current sampling interval.
17. The decoding method according to claim 16, characterized in that, The encoding result includes a first encoding, which is used to represent the quantization value when the integral value of the timing signal in the current sampling interval does not reach the preset threshold.
18. The decoding method according to claim 16, characterized in that, The encoding result includes a second encoding, which is used to represent the number of times that the integral value reaches the preset threshold when the integral value of the timing signal in the current sampling interval exceeds the preset threshold.
19. The decoding method according to claim 16, wherein, The encoding result includes a third encoding and a first encoding. The third encoding is used to represent whether the integral value of the timing signal in the current sampling interval has reached the preset threshold, and the first encoding is used to represent the quantization value when the integral value of the timing signal in the current sampling interval does not reach the preset threshold. Wherein, The reconstructing the timing signal according to the encoding result includes: Determine the signal intensity corresponding to the current sampling interval according to the third encoding and the first encoding to reconstruct the timing signal.
20. The decoding method according to claim 19, wherein, It further includes: Normalize the first encoding to a value in the interval [0, 1]. Wherein, The determining the signal intensity corresponding to the current sampling interval according to the third encoding and the first encoding to reconstruct the timing signal includes: Determine the signal intensity corresponding to the current sampling interval according to the third encoding and the value to reconstruct the timing signal.
21. The decoding method according to claim 16, wherein, The encoding result includes a third encoding and a second encoding. The third encoding is used to indicate whether the integral value of the timing signal has reached the preset threshold within the current sampling interval, and the second encoding is used to indicate the number of times the integral value reaches the preset threshold when the integral value of the timing signal exceeds the preset threshold within the current sampling interval. Among them, The reconstructing the timing signal according to the encoding result includes: Determining the signal strength corresponding to the current sampling interval according to the third encoding and the second encoding to reconstruct the timing signal.
22. The decoding method according to claim 16, wherein, The reconstructing the timing signal according to the encoding result includes: If the encoding result of the current sampling interval only includes the third encoding and is 0, determining the number of multiple sampling intervals that are connected before and after the current sampling interval and only have the third encoding and are 0, and determining that the signal strength corresponding to each sampling interval in the multiple sampling intervals is the reciprocal of the number. Among them, the third encoding is used to indicate whether the integral value of the timing signal has reached the preset threshold within the current sampling interval.
23. The decoding method according to claim 16, wherein, The reconstructing the timing signal according to the encoding result includes: If the encoding result of the current sampling interval only includes the third encoding and is 1, determining the number of sampling intervals that are connected before the current sampling interval and only have the third encoding and are 0, and determining that the signal strength corresponding to the current sampling interval is the reciprocal of the number plus 1. Among them, the third encoding is used to indicate whether the integral value of the timing signal has reached the preset threshold within the current sampling interval.
24. The decoding method according to any one of claims 16 to 23, wherein, The acquisition device of the timing signal is one of multiple acquisition devices arranged in at least a two-dimensional form.
25. The decoding method according to any one of claims 16 to 23, wherein, The timing signal is an electrical signal converted from an optical signal collected by a photosensitive sensor or a temperature signal collected by a thermosensitive device.
26. A decoding device for a timing signal, wherein, Including: A receiving module, configured to receive a bitstream, where the bitstream includes an encoding result, and the encoding result is used to indicate the state where the integral value reaches the preset threshold when integrating the timing signal within the current sampling interval, and the timing signal represents an electrical signal reflecting the light intensity change in a certain local space within a certain period of time; A reconstructing module, configured to reconstruct the timing signal according to the encoding result, The reconstructing module is specifically configured to determine the signal strength corresponding to the current sampling interval according to the encoding result of the current sampling interval and the encoding results of the sampling intervals before and / or after the current sampling interval.
27. A computer-readable storage medium, wherein, The storage medium stores a computer program, and the computer program is used to execute the encoding method according to any one of claims 1 to 13 or the decoding method according to any one of claims 16 to 25 above.
28. An electronic device, wherein, Including: A processor; A memory for storing instructions executable by the processor; The processor is configured to execute the encoding method according to any one of claims 1 to 13 or the decoding method according to any one of claims 16 to 25 above.
Citation Information
Patent Citations
System for pixel readout with partitioned analog-to-digital conversion
CN212012845U