WO2022141351A1 - 一种视觉传感器芯片、操作视觉传感器芯片的方法以及设备 - Google Patents

一种视觉传感器芯片、操作视觉传感器芯片的方法以及设备 Download PDF

Info

Publication number
WO2022141351A1
WO2022141351A1 PCT/CN2020/141973 CN2020141973W WO2022141351A1 WO 2022141351 A1 WO2022141351 A1 WO 2022141351A1 CN 2020141973 W CN2020141973 W CN 2020141973W WO 2022141351 A1 WO2022141351 A1 WO 2022141351A1
Authority
WO
WIPO (PCT)
Prior art keywords
bit
data
light intensity
event
circuit
Prior art date
Application number
PCT/CN2020/141973
Other languages
English (en)
French (fr)
Inventor
董思维
刘闯闯
方舒
方运潭
陈褒扬
刘畅
张慧敏
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202080104370.3A priority Critical patent/CN116530092A/zh
Priority to PCT/CN2020/141973 priority patent/WO2022141351A1/zh
Publication of WO2022141351A1 publication Critical patent/WO2022141351A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof

Definitions

  • the present application relates to the field of computers, and in particular, to a visual sensor chip, a method and apparatus for operating the visual sensor chip.
  • Visual sensing technology is widely used in video surveillance, digital cameras, robot navigation, automotive autonomous navigation, biomedical pixel analysis, human-machine interface, virtual reality, industrial control, wireless long-distance sensing, microscope technology, scientific instruments and many other fields. .
  • vision sensors can acquire image information from the external environment, and realize operations such as image processing, image storage, and image output.
  • a bionic vision sensor the principle is to use an integrated circuit to simulate the biological retina, and each pixel in the pixel array circuit simulates a biological neuron, and the changes in light intensity are expressed in the form of events.
  • event expression methods including using light intensity information to represent events and using polarity information to represent events.
  • a single visual sensor can only use one event representation method.
  • Embodiments of the present application provide an image processing method and apparatus for obtaining a clearer image.
  • the present application provides a switching method, which is applied to an electronic device, where the electronic device includes an RGB sensor and a motion sensor, the RGB (red green bule) sensor is used to collect images within a shooting range, and the motion sensor
  • the method includes: selecting at least one from the RGB sensor and the motion sensor based on scene information, and The data is collected by the selected sensor, and the scene information includes at least one of the status information of the electronic device, the type of the application in the electronic device that requests to collect the image, or the environment information.
  • different sensors in the electronic device can be selected and activated according to different scenarios, so as to adapt to more scenarios and have a strong generalization ability.
  • the corresponding sensor can be activated according to the actual scene, without activating all the sensors, and the power consumption of the electronic device is reduced.
  • the status information includes the remaining power and storage capacity of the electronic device;
  • the environment information includes the change value of the light intensity within the shooting range of the color RGB sensor and the motion sensor, or Information about moving objects within the shooting range.
  • the activated sensor can be selected according to the state of the electronic device or the environmental information, so as to adapt to more scenarios and have a strong generalization ability.
  • the activated sensors may be different.
  • the sensor has been activated, which will not be repeated below.
  • the present application provides a visual sensor chip, which may include: a pixel array circuit configured to generate at least one data signal corresponding to a pixel in the pixel array circuit by measuring a change in light intensity, the at least one data signal indicating light Strong change event, the light intensity change event indicates that the measured light intensity change amount of the corresponding pixel in the pixel array circuit exceeds a predetermined threshold.
  • a readout circuit is coupled to the pixel array circuit for reading at least one data signal from the pixel array circuit in a first event representation. The reading circuit is also used for providing at least one data signal to the control circuit.
  • the read circuit is further configured to switch to read at least one data signal from the pixel array circuit in a second event representation manner when receiving a conversion signal generated based on the at least one data signal from the control circuit.
  • the vision sensor can adaptively switch between the two event representation modes, so that the read data rate always remains within the predetermined read data rate threshold, thereby reducing the data transmission, parsing and processing of the vision sensor.
  • the performance of the sensor is significantly improved at the cost of storage.
  • such a visual sensor can perform data statistics on events generated in a period of time to predict the possible rate of event generation in the next period of time, so it is possible to select a reading that is more suitable for the current external environment, application scenario and motion state. model.
  • the first event representation method is to represent the event through polarity information
  • the pixel array circuit may include a plurality of pixels, and each pixel may include a threshold value comparison unit, a threshold value comparison unit, which is used for the light intensity transformation amount
  • polarity information is output, and the polarity information is used to indicate whether the light intensity variation is increased or decreased.
  • the reading circuit is specifically used for reading the polarity information output by the threshold comparison unit.
  • the first event is represented by polarity information representing an event, and the polarity information is usually represented by 1-2 bits, carrying less information to avoid large-area object motion due to a large amount of data.
  • the vision sensor will face the problem of sudden events.
  • the preset maximum bandwidth of the vision sensor hereinafter referred to as the bandwidth
  • the first event representation method is to represent the event by light intensity information
  • the pixel array may include a plurality of pixels, and each pixel may include a threshold value comparison unit, a readout control unit and a light intensity collection unit, and the light intensity
  • the intensity detection unit is used for outputting an electrical signal corresponding to the light signal irradiated on it, and the electrical signal is used to indicate the light intensity.
  • the threshold value comparison unit is configured to output a first signal when it is determined according to the electrical signal that the light intensity transformation amount exceeds a predetermined threshold value.
  • the readout control unit is configured to, in response to receiving the first signal, instruct the light intensity collection unit to collect and buffer the electrical signal corresponding to the moment of receiving the first signal.
  • the reading circuit is specifically used to read the electrical signal buffered by the light intensity collection unit.
  • the first event representation manner is to represent the event through light intensity information.
  • the light intensity information is used to represent the event.
  • the light intensity information is usually represented by multiple bits, such as 8-12 bits. Compared with the polarity information, the light intensity information can be It carries more information, which is conducive to the processing and analysis of events, such as improving the quality of image reconstruction.
  • control circuit is further configured to: determine statistical data based on the at least one data signal received from the read circuit. If it is determined that the statistical data satisfies a predetermined switching condition, a switching signal is sent to the reading circuit, and the predetermined switching condition is determined based on the preset bandwidth of the vision sensor chip.
  • a method for converting two event representations is provided, and the conversion conditions are obtained according to the amount of data to be transmitted. For example, when the amount of transmitted data is large, it is switched to represent events by polarity information to ensure that the entire amount of data can be transmitted, and to avoid the situation that the event data cannot be read out, resulting in event loss. When the amount of transmitted data is small, it is switched to represent events by light intensity information, so that the transmitted events can carry more information, which is conducive to the processing and analysis of events, such as improving the quality of image reconstruction.
  • the predetermined conversion condition is to use the first event representation method to represent the event from the pixel array circuit
  • the total amount of data read is greater than the preset bandwidth, or the predetermined conversion condition is that the number of at least one data signal is greater than the ratio of the preset bandwidth to the first bit, where the first bit is a preset bit of the data format of the data signal.
  • a specific condition for switching the event represented by the light intensity information to the event represented by the polarity information is given.
  • the amount of transmitted data is greater than the preset bandwidth, it is switched to represent the event by polarity information to ensure that the complete amount of data can be transmitted, and to avoid the situation that the event data cannot be read out, resulting in event loss.
  • the predetermined conversion condition is that if the second event representation method is used to represent the event from the pixel array
  • the circuit reads at least one data signal, and the total amount of data read is not greater than the preset bandwidth, or the predetermined conversion condition is that the number of at least one data signal is not greater than the ratio of the preset bandwidth and the first bit, and the first bit is the data signal. Preset bits for the data format.
  • a specific condition for switching the event represented by the polarity information to the event represented by the light intensity information is given. When the amount of transmitted data is not greater than the preset bandwidth, it is switched to represent events by light intensity information, so that the transmitted events can carry more information, which is conducive to the processing and analysis of events, such as improving the quality of image reconstruction.
  • the present application provides a decoding circuit, which may include: a reading circuit for reading a data signal from a vision sensor chip.
  • the decoding circuit is used for decoding the data signal according to the first decoding mode.
  • the decoding circuit is further configured to decode the data signal according to the second decoding mode when receiving the conversion signal from the control circuit.
  • the decoding circuit provided in the third aspect corresponds to the visual sensor chip provided in the second aspect, and is used for decoding the data signal output by the visual sensor chip provided in the second aspect.
  • a decoding circuit provided by the third aspect can switch different decoding modes for different event representation modes.
  • control circuit is further configured to: determine statistical data based on the data signal read from the read circuit. If it is determined that the statistical data satisfies a predetermined conversion condition, a conversion signal is sent to the encoding circuit, and the predetermined conversion condition is determined based on the preset bandwidth of the vision sensor chip.
  • the first decoding method is to decode the data signal according to the first bit corresponding to the first event representation method
  • the first event representation method is to represent the event by light intensity information
  • the second decoding method In order to decode the data signal according to the second bit corresponding to the second event representation mode, the second event representation mode is to represent the event through polarity information, and the polarity information is used to indicate whether the light intensity change is increased or decreased, and the conversion condition
  • the total amount of data decoded according to the first decoding method is greater than the preset bandwidth, or the predetermined conversion condition is that the number of data signals is greater than the ratio of the preset bandwidth to the first bit, the first bit being a preset bit of the data format of the data signal.
  • the first decoding method is to decode the data signal according to the first bit corresponding to the first event representation method
  • the first event representation method is to represent the event by polarity information
  • the polarity information uses
  • the second decoding method is to decode the data signal through the second bit corresponding to the second event expression method
  • the second event expression method is to express the event through the light intensity information. If the data signal is decoded according to the second decoding method, the total data amount is not greater than the preset bandwidth, or the predetermined conversion condition is that the number of data signals is greater than the ratio of the preset bandwidth and the first bit, and the first bit is the data format of the data signal. Preset bits.
  • the present application provides a method for operating a visual sensor chip, which may include: generating at least one data signal corresponding to a pixel in the pixel array circuit by measuring the amount of light intensity change through a pixel array circuit of the visual sensor chip, at least one The data signal indicates a light intensity change event, and the light intensity change event indicates that the amount of light intensity change measured by a corresponding pixel in the pixel array circuit exceeds a predetermined threshold. At least one data signal is read from the pixel array circuit in a first event representation by a read circuit of the vision sensor chip. At least one data signal is provided to the control circuit of the vision sensor chip through the readout circuit. When the switching signal generated based on the at least one data signal is received from the control circuit through the reading circuit, switching is performed to read the at least one data signal from the pixel array circuit in a second event representation.
  • the first event is represented by polarity information
  • the pixel array circuit may include a plurality of pixels, each pixel may include a threshold comparison unit, and the reading circuit of the visual sensor chip uses the first
  • An event representation method to read at least one data signal from the pixel array circuit may include: when the light intensity change amount exceeds a predetermined threshold, outputting polarity information through the threshold value comparison unit, and the polarity information is used to indicate whether the light intensity change amount is enhanced or weakened .
  • the polarity information output by the threshold comparison unit is read by the read circuit.
  • the first event representation method is to represent the event by light intensity information
  • the pixel array may include a plurality of pixels, and each pixel may include a threshold value comparison unit, a readout control unit and a light intensity collection unit.
  • the reading circuit of the visual sensor chip reads at least one data signal from the pixel array circuit in a first event representation manner, which may include: outputting an electrical signal corresponding to the light signal irradiated on the light intensity collecting unit, and the electrical signal is used to indicate light intensity.
  • the threshold comparison unit outputs a first signal.
  • the light intensity collection unit is instructed by the readout control unit to collect and buffer the electrical signal corresponding to the moment of receiving the first signal.
  • the electrical signal buffered by the light intensity collection unit is read through the reading circuit.
  • the method may further comprise determining statistical data based on the at least one data signal received from the read circuit. If it is determined that the statistical data satisfies a predetermined switching condition, a switching signal is sent to the reading circuit, and the predetermined switching condition is determined based on the preset bandwidth of the vision sensor chip.
  • the predetermined conversion condition is to use the first event representation method to represent the event from the pixel array circuit
  • the total amount of data read is greater than the preset bandwidth, or the predetermined conversion condition is that the number of at least one data signal is greater than the ratio of the preset bandwidth to the first bit, where the first bit is a preset bit of the data format of the data signal.
  • the predetermined conversion condition is that if the second event representation method is used to represent the event from the pixel array
  • the circuit reads at least one data signal, and the total amount of data read is not greater than the preset bandwidth, or the predetermined conversion condition is that the number of at least one data signal is not greater than the ratio of the preset bandwidth and the first bit, and the first bit is the data signal. Preset bits for the data format.
  • the present application provides a decoding method, comprising: reading a data signal from a visual sensor chip through a reading circuit; decoding the data signal according to a first decoding method through a decoding circuit; when receiving a conversion signal from a control circuit, The data signal is decoded by the decoding circuit according to the second decoding method.
  • the method further includes: determining statistical data based on the data signal read from the reading circuit; if it is determined that the statistical data meets a predetermined conversion condition, sending a conversion signal to the encoding circuit, and the predetermined conversion condition is based on the visual sensor chip The preset bandwidth is determined.
  • the first decoding method is to decode the data signal according to the first bit corresponding to the first event representation method
  • the first event representation method is to represent the event by light intensity information
  • the second decoding method In order to decode the data signal according to the second bit corresponding to the second event representation mode, the second event representation mode is to represent the event through polarity information, and the polarity information is used to indicate whether the light intensity change is increased or decreased, and the conversion condition
  • the total amount of data decoded according to the first decoding method is greater than the preset bandwidth, or the predetermined conversion condition is that the number of data signals is greater than the ratio of the preset bandwidth to the first bit, the first bit being a preset bit of the data format of the data signal.
  • the first decoding method is to decode the data signal according to the first bit corresponding to the first event representation method
  • the first event representation method is to represent the event by polarity information
  • the polarity information uses
  • the second decoding method is to decode the data signal through the second bit corresponding to the second event expression method
  • the second event expression method is to express the event through the light intensity information. If the data signal is decoded according to the second decoding method, the total data amount is not greater than the preset bandwidth, or the predetermined conversion condition is that the number of data signals is greater than the ratio of the preset bandwidth and the first bit, and the first bit is the data format of the data signal. Preset bits.
  • the present application provides a visual sensor chip, which may include: a pixel array circuit configured to generate at least one data signal corresponding to a pixel in the pixel array circuit by measuring a change in light intensity, the at least one data signal indicating light Strong change event, the light intensity change event indicates that the measured light intensity change amount of the corresponding pixel in the pixel array circuit exceeds a predetermined threshold.
  • the first encoding unit is configured to encode at least one data signal according to the first bits to obtain first encoded data.
  • the first encoding unit is further configured to encode at least one data signal according to the second bit indicated by the first control signal when receiving the first control signal from the control circuit, and the first control signal is determined by the control circuit according to the first encoded data of.
  • the first control signal is determined by the control circuit according to the first encoded data and the preset bandwidth of the vision sensor chip.
  • the second bit indicated by the control signal is smaller than the first bit, so that the total data amount of the at least one data signal encoded by the second bit is not smaller than the bandwidth. greater than the bandwidth.
  • the second bit indicated by the control signal is larger than the first bit, and the total data amount of at least one data signal encoded by the second bit is not larger than the bandwidth . If the rate of event generation becomes smaller, the bit width representing light intensity feature information can be increased without exceeding the bandwidth limit, so as to better achieve the purpose of transmitting all events with greater representation accuracy.
  • the pixel array may include N regions, at least two regions in the N regions have different maximum bits, and the maximum bits represent a preset maximum value for encoding at least one data signal generated in one region.
  • bit the first encoding unit, specifically configured to encode at least one data signal generated in the first region according to the first bit to obtain first encoded data, the first bit is not greater than the maximum bit of the first region, and the first region is any one of the N regions.
  • the first encoding unit is specifically configured to encode at least one data signal generated in the first region according to the second bit indicated by the first control signal when the first control signal is received from the control circuit. The first encoded data is determined.
  • the pixel array can also be divided into regions, and different weights can be used to set the maximum bit width of different regions to adapt to different regions of interest in the scene.
  • the weight of makes the region including the target object correspond to the output event with higher representation accuracy, and sets a smaller weight in the background region, so that the background region corresponds to the output event with lower representation accuracy.
  • control circuit is further configured to: determine that the total data volume of the at least one data signal encoded by the third bit is greater than the bandwidth, and the total data volume of the at least one data signal encoded by the second bit is not When the bandwidth is greater than the bandwidth, the first control signal is sent to the first coding unit, and the difference between the third bit and the second bit is 1 bit unit. In such an embodiment, all events can be transmitted with greater representational precision without exceeding bandwidth limitations.
  • the present application provides a decoding device, which may include: a reading circuit for reading a data signal from a vision sensor chip.
  • the decoding circuit is used for decoding the data signal according to the first bit.
  • the decoding circuit is further configured to decode the data signal according to the second bit indicated by the first control signal when the first control signal is received from the control circuit.
  • the decoding circuit provided in the seventh aspect corresponds to the visual sensor chip provided in the sixth aspect, and is used for decoding the data signal output by the visual sensor chip provided in the sixth aspect.
  • the decoding circuit provided by the seventh aspect can dynamically adjust the decoding method according to the coding bits used by the visual sensor.
  • the first control signal is determined by the control circuit according to the first encoded data and the preset bandwidth of the vision sensor chip.
  • the second bit when the total data amount of the data signal decoded according to the first bit is not less than the bandwidth, the second bit is smaller than the first bit.
  • the second bit when the total data amount of the data signal decoded according to the first bit is less than the bandwidth, the second bit is greater than the first bit, and the total data amount of the data signal decoded by using the second bit is not greater than the bandwidth.
  • the reading circuit is specifically configured to read the data signal corresponding to the first area from the vision sensor chip, where the first area is any one of the N areas that the pixel array of the vision sensor may include , the maximum bits of at least two regions in the N regions are different, and the maximum bits represent the preset maximum bits for encoding at least one data signal generated in one region.
  • the decoding circuit is specifically configured to decode the data signal corresponding to the first region according to the first bit.
  • control circuit is further configured to: when it is determined that the total data volume of the data signal decoded by the third bit is greater than the bandwidth, and the total data volume of the data signal decoded by the second bit is not greater than the bandwidth, send the The first coding unit sends the first control signal, and the difference between the third bit and the second bit is 1 bit unit.
  • the present application provides a method for operating a vision sensor chip, which may include: generating at least one data signal corresponding to a pixel in the pixel array circuit by measuring the amount of light intensity change through a pixel array circuit of the vision sensor chip, at least one The data signal indicates a light intensity change event, and the light intensity change event indicates that the amount of light intensity change measured by a corresponding pixel in the pixel array circuit exceeds a predetermined threshold.
  • the at least one data signal is encoded by the first encoding unit of the visual sensor chip according to the first bit to obtain first encoded data.
  • the first control signal When receiving the first control signal from the control circuit of the visual sensor chip through the first encoding unit, at least one data signal is encoded according to the second bit indicated by the first control signal, and the first control signal is the control circuit according to the first encoded data definite.
  • the first control signal is determined by the control circuit according to the first encoded data and the preset bandwidth of the vision sensor chip.
  • the second bit indicated by the control signal is smaller than the first bit, so that the total data amount of the at least one data signal encoded by the second bit is not smaller than the bandwidth. greater than the bandwidth.
  • the second bit indicated by the control signal is larger than the first bit, and the total data amount of at least one data signal encoded by the second bit is not larger than the bandwidth .
  • the pixel array may include N regions, at least two regions in the N regions have different maximum bits, and the maximum bits represent a preset maximum value for encoding at least one data signal generated in one region.
  • encoding the at least one data signal according to the first bit by the first encoding unit of the visual sensor chip which may include: encoding the at least one data signal generated in the first region by the first encoding unit according to the first bit, to obtain For the first encoded data, the first bit is not greater than the largest bit of the first region, and the first region is any one of the N regions.
  • encoding at least one data signal according to the second bit indicated by the first control signal may include: receiving from the control circuit through the first encoding unit When the first control signal is reached, at least one data signal generated in the first region is encoded according to the second bit indicated by the first control signal, and the first control signal is determined by the control circuit according to the first encoded data.
  • it may further include: when it is determined that the total data volume of at least one data signal encoded by the third bit is greater than the bandwidth, and the total data volume of the at least one data signal encoded by the second bit is not greater than the bandwidth , the first control signal is sent to the first coding unit through the control circuit, and the difference between the third bit and the second bit is 1 bit unit.
  • the present application provides a decoding method, which may include: reading a data signal from a vision sensor chip through a reading circuit.
  • the data signal is decoded according to the first bit by the decoding circuit.
  • the first control signal is received from the control circuit through the decoding circuit, the data signal is decoded according to the second bit indicated by the first control signal.
  • the first control signal is determined by the control circuit according to the first encoded data and the preset bandwidth of the vision sensor chip.
  • the second bit when the total data amount of the data signal decoded according to the first bit is not less than the bandwidth, the second bit is smaller than the first bit.
  • the second bit when the total data amount of the data signal decoded according to the first bit is less than the bandwidth, the second bit is greater than the first bit, and the total data amount of the data signal decoded by using the second bit is not greater than the bandwidth.
  • reading the data signal from the vision sensor chip through the reading circuit may include: reading the data signal corresponding to the first area from the vision sensor chip through the reading circuit, and the first area is the visual sensor chip.
  • the pixel array may include any one of the N regions, at least two regions in the N regions have different maximum bits, and the maximum bits represent the preset maximum bits for encoding at least one data signal generated in one region.
  • Decoding the data signal according to the first bit by the decoding circuit may include: decoding the data signal corresponding to the first region according to the first bit by the decoding circuit.
  • the method may further include: when it is determined that the total data volume of the data signal decoded by the third bit is greater than the bandwidth, and the total data volume of the data signal decoded by the second bit is not greater than the bandwidth, sending the A coding unit transmits the first control signal, and the difference between the third bit and the second bit is 1 bit unit.
  • the present application provides a visual sensor chip, which may include: a pixel array circuit configured to generate a plurality of data signals corresponding to a plurality of pixels in the pixel array circuit by measuring a change in light intensity, and the plurality of data signals At least one light intensity change event is indicated, and the at least one light intensity change event indicates that the amount of light intensity change measured by a corresponding pixel in the pixel array circuit exceeds a predetermined threshold.
  • the third encoding unit is configured to encode the first difference value according to the first preset bit, where the first difference value is the difference between the light intensity transformation amount and the predetermined threshold value.
  • the method of reducing the precision of event representation may not be suitable for all scenarios, that is, in some scenarios, it is necessary to use high-bit bit width to represent events, but events represented by high-bit bit width can carry more data, but the amount of data It is also large.
  • the preset maximum bandwidth of the vision sensor is certain, the event data may not be read out, resulting in data loss.
  • the solution provided in the tenth aspect adopts the method of encoding the differential value, which reduces the cost of data transmission, analysis and storage of the visual sensor, and also transmits events with the highest precision, and significantly improves the performance of the sensor.
  • the pixel array circuit may include a plurality of pixels, and each pixel may include a threshold value comparison unit, a threshold value comparison unit for outputting polarity information when the light intensity transformation amount exceeds a predetermined threshold value, and the polarity information Used to indicate whether the change in light intensity is increased or decreased.
  • the third encoding unit is further configured to encode the polarity information according to the second preset bit.
  • the polarity information can also be encoded, and the polarity information can be used to indicate whether the light intensity is increased or decreased, which is helpful for obtaining the current light intensity information according to the light intensity signal and the polarity information obtained by the previous decoding. .
  • each pixel may include a light intensity detection unit, a readout control unit, and a light intensity collection unit, and the light intensity detection unit is configured to output an electrical signal corresponding to the light signal irradiated thereon. Signal, electrical signal is used to indicate light intensity.
  • the threshold value comparison unit is specifically configured to output polarity information when it is determined according to the electrical signal that the light intensity transformation amount exceeds a predetermined threshold value.
  • the readout control unit is used, in response to receiving the polarity signal, to instruct the light intensity collection unit to collect and buffer the electrical signal corresponding to the receiving moment of the polarity information.
  • the third encoding unit is further configured to encode the first electrical signal according to the third preset bit, where the first electrical signal is the electrical signal at the first reception moment of the corresponding polarity information collected by the light intensity collecting unit, and the third The set bit is the maximum bit preset by the vision sensor to represent the characteristic information of the light intensity.
  • the full encoding refers to encoding an event by using the maximum bit width predefined by the vision sensor. In addition, by using the light intensity information of the previous event, as well as the decoded polarity information and differential value, the light intensity information at the current moment can be reconstructed losslessly.
  • the third encoding unit is further configured to: encode the electrical signal collected by the light intensity collection unit according to a third preset bit every preset time period. Full encoding is performed every preset duration to reduce decoding dependence and prevent bit errors.
  • the third encoding unit is specifically configured to encode the first difference value according to a first preset bit when the first difference value is smaller than a predetermined threshold.
  • the third encoding unit is further configured to: when the first difference value is not less than a predetermined threshold value, encode the first remaining difference value and the predetermined threshold value according to a first preset bit, and the first residual difference value and the predetermined threshold value are encoded according to the first preset bit.
  • the difference value is the difference between the difference value and a predetermined threshold value.
  • the third encoding unit is specifically configured to: when the first residual difference value is not less than a predetermined threshold, encode the second residual difference value according to the first preset bit, and the second residual difference value is the difference between the first residual difference value and the predetermined threshold.
  • the predetermined threshold is first encoded according to the first preset bits.
  • the predetermined threshold is coded a second time according to the first preset bits. Since the visual sensor may have a certain delay, an event may be generated only if the light intensity transformation amount is greater than a predetermined threshold twice or more than twice. This will cause the problem that the difference value is greater than or equal to the predetermined threshold value, and the light intensity change is at least twice the predetermined threshold value.
  • the first residual difference value may not be less than the predetermined threshold value, then encode the second residual difference value. If the second residual difference value is If the difference value is still not less than the predetermined threshold value, the third residual difference value can be encoded, the third difference value is the difference between the second residual difference value and the predetermined threshold value, and the predetermined threshold value is encoded for the third time, and the above process is repeated, until the remaining difference value is less than a predetermined threshold.
  • the present application provides a decoding device, which may include: an acquisition circuit for reading a data signal from a vision sensor chip.
  • the decoding circuit is used to decode the data signal according to the first bit to obtain a difference value, the difference value is less than a predetermined threshold, the difference value is the difference between the light intensity transformation measured by the vision sensor and the predetermined threshold, and the light intensity change exceeds At a predetermined threshold, the vision sensor generates at least one light intensity change event.
  • the decoding circuit provided in the eleventh aspect corresponds to the vision sensor chip provided in the tenth aspect, and is used for decoding the data signal output by the vision sensor chip provided in the tenth aspect.
  • the decoding circuit provided in the eleventh aspect can adopt a corresponding differential decoding method for the differential encoding method adopted by the vision sensor.
  • the decoding circuit is further configured to: decode the data signal according to the second bit to obtain polarity information, where the polarity information is used to indicate whether the light intensity variation is increased or decreased.
  • the decoding circuit is further configured to: decode the data signal received at the first moment according to the third bit, so as to obtain the electrical signal corresponding to the optical signal irradiated on it output by the visual sensor,
  • the third bit is the largest bit preset by the vision sensor to represent the characteristic information of the light intensity.
  • the decoding circuit is further configured to: decode the data signal received at the first moment according to the third bit every preset time period.
  • the decoding circuit is specifically configured to: decode the data signal according to the first bit to obtain a difference value and at least one predetermined threshold.
  • the present application provides a method for operating a visual sensor chip, which may include: generating a plurality of pixels corresponding to a plurality of pixels in the pixel array circuit by measuring the amount of light intensity change through a pixel array circuit of the visual sensor chip
  • the data signal, the plurality of data signals indicate at least one light intensity change event, and the at least one light intensity change event indicates that the measured light intensity change amount of the corresponding pixel in the pixel array circuit exceeds a predetermined threshold.
  • the third encoding unit of the visual sensor chip encodes the first difference value according to the first preset bit, where the first difference value is the difference between the light intensity transformation amount and the predetermined threshold value.
  • the pixel array circuit may include a plurality of pixels, and each pixel may include a threshold value comparison unit, and the method may further include: when the light intensity transformation amount exceeds a predetermined threshold value, outputting polarity information through the threshold value comparison unit, The polarity information is used to indicate whether the change in light intensity is increasing or decreasing.
  • the polarity information is encoded according to the second preset bit by the third encoding unit.
  • each pixel may include a light intensity detection unit, a readout control unit and a light intensity collection unit, and the method may further include: outputting an optical signal irradiated thereon through the light intensity detection unit Corresponding electrical signal, the electrical signal is used to indicate the light intensity.
  • Outputting the polarity information through the threshold comparison unit may include: outputting the polarity information through the threshold comparison unit when it is determined according to the electrical signal that the light intensity transformation amount exceeds a predetermined threshold.
  • the method may further include: in response to receiving the polarity signal, instructing the light intensity collection unit to collect and buffer the electrical signal corresponding to the reception moment of the polarity information through the readout control unit.
  • the first electrical signal is encoded according to the third preset bit, where the first electrical signal is the electrical signal at the first reception time of the corresponding polarity information collected by the light intensity collection unit, and the third preset bit is the preset of the visual sensor
  • the maximum bits used to represent the characteristic information of light intensity is the third preset bit.
  • the method may further include: encoding the electrical signal collected by the light intensity collection unit according to a third preset bit every preset time period.
  • the third encoding unit of the visual sensor chip encodes the first differential value according to a first preset bit, which may include: when the first differential value is smaller than a predetermined threshold, according to the first preset bits encode the first differential value.
  • the third encoding unit of the visual sensor chip encodes the first differential value according to a first preset bit, and may further include: when the first differential value is not less than a predetermined threshold, according to the first The preset bits encode the first residual difference value and the predetermined threshold value, and the first residual difference value is the difference between the difference value and the predetermined threshold value.
  • encoding the first remaining difference value and the predetermined threshold according to a first preset bit may include: the first remaining difference value is not less than the predetermined threshold
  • the second residual difference value is encoded according to the first preset bit
  • the second residual difference value is the difference between the first residual difference value and the predetermined threshold.
  • the predetermined threshold is first encoded according to the first preset bits.
  • the predetermined threshold is coded for the second time according to the first preset bits, and the first residual difference value may include the second residual difference value and two predetermined threshold values.
  • the present application provides a decoding method, which may include: reading a data signal from a vision sensor chip through an acquisition circuit.
  • the data signal is decoded according to the first bit by the decoding circuit to obtain the difference value, the difference value is less than the predetermined threshold, the difference value is the difference between the light intensity transformation measured by the vision sensor and the predetermined threshold, and the light intensity change exceeds the predetermined threshold , the vision sensor generates at least one light intensity change event.
  • the method may further include: decoding the data signal according to the second bit to obtain polarity information, where the polarity information is used to indicate whether the light intensity variation is increased or decreased.
  • the method may further include: decoding the data signal received at the first moment according to the third bit to obtain the electrical signal corresponding to the optical signal irradiated on the visual sensor outputted by the third bit. It is the maximum bit preset by the vision sensor to represent the characteristic information of the light intensity.
  • the method may further include: decoding the data signal received at the first moment according to the third bit every preset time period.
  • decoding the data signal according to the first bit by the decoding circuit to obtain the differential value may include: decoding the data signal according to the first bit to obtain the differential value and at least one predetermined threshold.
  • the present application provides an image processing method, comprising: acquiring motion information, the motion information including information on a motion trajectory of a target object when moving within a detection range of a motion sensor; generating at least one based on the motion information
  • One frame of event images, the at least one frame of event images is an image representing the motion trajectory of the target object when it moves within the detection range; acquire a target task, and obtain the iteration duration according to the target task;
  • At least one frame of event image is iteratively updated to obtain an updated at least one frame of event image, and the duration of iteratively updating the at least one frame of event image does not exceed the iterative duration.
  • the moving object can be monitored by the motion sensor, and the information of the motion trajectory of the object when the object is moving within the detection range can be collected by the motion sensor.
  • the target task determines the iteration duration, and the event image is iteratively updated within the iteration duration to obtain the event image matching the target task.
  • performing any iterative update in the iterative update of the at least one frame of event image includes: acquiring a motion parameter, where the motion parameter represents a relationship between the motion sensor and the target object parameters of relative motion between the two; iteratively update the target event image in the at least one frame of event images according to the motion parameter to obtain an updated target event image.
  • the update can be performed based on the parameters of the relative motion between the object and the motion sensor, so as to compensate the event image and obtain a clearer event image.
  • the acquiring the motion parameter includes: acquiring the value of the optimization model preset in the last iterative update process; and calculating the motion parameter according to the value of the optimization model.
  • the event image can be updated based on the value of the optimization model, and better motion parameters can be calculated according to the optimization model, and then the event image can be updated by using the motion parameters to obtain a clearer event image. image.
  • the iteratively updating the target event image in the at least one frame of event images according to the motion parameter includes: updating the target event image in the target event image according to the motion parameter.
  • the motion trajectory of the object is compensated, and the target event image obtained by the current iteration update is obtained.
  • the motion parameter can be used to compensate the motion trajectory of the target object in the event image, so that the motion trajectory of the target object in the event image is clearer, and thus the event image is clearer.
  • the motion parameters include one or more of the following: depth, optical flow information, acceleration of motion of the motion sensor, or angular velocity of motion of the motion sensor, and the depth represents the the distance between the motion sensor and the target object, and the optical flow information represents the information of the relative movement speed between the motion sensor and the target object.
  • motion compensation can be performed on the target object in the event image through various motion parameters, so as to improve the clarity of the event image.
  • the method further includes: if the result of the current iteration satisfies a preset condition, terminating the iteration, and the termination condition includes at least one of the following: The number of times of iteratively updating the at least one frame of event image reaches a preset number of times, or the change in the value of the optimization model in the process of updating the at least one frame of event image is less than a preset value.
  • convergence conditions related to the number of iterations or the value of the optimization model can also be set, so as to obtain event images that meet the convergence conditions under the constraints of the iteration duration.
  • the present application provides an image processing method, comprising: generating at least one frame of event images according to motion information, the motion information including information on a motion trajectory of a target object when it moves within a detection range of a motion sensor, so The at least one frame of event image is an image representing the motion trajectory of the target object when it moves within the detection range; acquiring motion parameters, the motion parameters representing the relative motion between the motion sensor and the target object parameter; initialize the value of the preset optimization model according to the motion parameter to obtain the value of the optimization model; update the at least one frame of event image according to the value of the optimization model to obtain the updated at least one frame event image.
  • the parameters of the relative motion between the motion sensor and the target object can be used to initialize the optimization model, thereby reducing the number of initial iterations of the event image and accelerating the convergence speed of the iteration of the event image. Sharper event images with fewer cases.
  • the motion parameters include one or more of the following: depth, optical flow information, acceleration of motion of the motion sensor, or angular velocity of motion of the motion sensor, and the depth represents the the distance between the motion sensor and the target object, and the optical flow information represents the information of the relative movement speed between the motion sensor and the target object.
  • the acquiring the motion parameter includes: acquiring data collected by an inertial measurement unit IMU sensor; and calculating the motion parameter according to the data collected by the IMU sensor. Therefore, in the embodiments of the present application, the motion parameters can be calculated by the IMU, so as to obtain more accurate motion parameters.
  • the method further includes: updating the parameters of the IMU sensor according to the value of the optimization model, the The parameters of the IMU sensor are used for the IMU sensor to collect data.
  • the parameters of the IMU can also be updated according to the value of the optimization model, so as to implement the deviation correction of the IMU, so that the data collected by the IMU is more accurate.
  • the present application provides an image processing device, the image processing device having the function of implementing the method of the fourteenth aspect or any of the possible implementation manners of the fourteenth aspect, or the image processing device having the function of implementing the above-mentioned first
  • the function of the method of the fifteenth aspect or any possible implementation manner of the fifteenth aspect can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the present application provides an image processing method, including: acquiring motion information, where the motion information includes information on a motion trajectory of a target object when moving within a detection range of a motion sensor; generating a method according to the motion information an event image, the event image is an image representing the motion trajectory of the target object when it moves within the detection range; a first reconstructed image is obtained according to at least one event included in the event image, wherein the first pixel The color type of the point is different from that of at least one second pixel point, the first pixel point is a pixel point corresponding to any one event in the at least one event in the first reconstructed image, and the at least one second pixel point includes in a plurality of pixel points adjacent to the first pixel point in the first reconstructed image.
  • image reconstruction can be performed based on the data collected by the motion sensor to obtain a reconstructed image, even if the RGB sensor is not clearly photographed , you can also get a clear image.
  • the determining, according to at least one event included in the event image, a color type corresponding to each pixel in the event image to obtain the first reconstructed image includes: according to the first Scan each pixel in the event image in a direction, determine the color type corresponding to each pixel in the event image, and obtain a first reconstructed image, wherein if the first pixel is scanned to have an event, then determine The color type of the first pixel is the first color type, and if the second pixel arranged in the first direction before the first pixel does not have an event, then the second pixel corresponds to The color type is the second color type, the first color type and the second color type are different color types, and the pixel point with the event indicates that the position where the change is detected by the motion sensor is in the event image corresponding pixels.
  • image reconstruction can be performed based on the event of each pixel in the event image, thereby obtaining a clearer event image. Therefore, in the embodiment of the present application, the information collected by the motion sensor can be used for image reconstruction, and the reconstructed image can be obtained efficiently and quickly, thereby improving the efficiency of subsequent image recognition and image classification of the reconstructed image. Even if a clear RGB image cannot be captured in some scenes such as shooting moving objects or shooting jitter, the information collected by the motion sensor can be used for image reconstruction, which can quickly and accurately reconstruct a clearer image, so as to facilitate the reconstruction of the image. Perform subsequent tasks such as identification or classification.
  • the first direction is a preset direction, or the first direction is determined according to data collected by the IMU, or the first direction is captured by a color RGB camera image ok. Therefore, in the embodiment of the present application, the direction of scanning the event image can be determined in various ways, which is suitable for more scenarios.
  • the color type corresponding to the plurality of third pixel points for the first color type is the same, so as to avoid unclear edges caused by the movement of the same object in the actual scene.
  • the color types corresponding to the fourth pixel and the fifth pixel are both the The first color type.
  • the reconstructed color type may not be changed, so as to avoid the edge of the reconstructed image caused by the wide edge of the target object.
  • scanning each pixel in the event image according to the first direction, determining a color type corresponding to each pixel in the event image, and after obtaining the first reconstructed image the The method further includes: scanning the event image according to a second direction, determining a color type corresponding to each pixel in the event image, and obtaining a second reconstructed image, the second direction being different from the first direction; The first reconstructed image and the second reconstructed image are fused to obtain the updated first reconstructed image.
  • the event image may be scanned in different directions, so as to obtain multiple reconstructed images from multiple directions, and then fuse the multiple reconstructed images to obtain a more accurate reconstructed image.
  • the method further includes: if the first reconstructed image does not meet the preset requirements, updating the motion information, and updating the event image according to the updated motion information, and according to the updated event The image gets the updated first reconstructed image.
  • the event image can be updated in combination with the information collected by the motion sensor, so that the updated event image is clearer.
  • the method it also includes: compensating the event image according to the motion parameters during relative motion between the target object and the motion sensor to obtain the compensated event image, the motion parameters including one or more of the following Items: depth, optical flow information, acceleration of motion of the motion sensor or angular velocity of motion of the motion sensor, the depth represents the distance between the motion sensor and the target object, and the optical flow information represents Information about the motion speed of the relative motion between the motion sensor and the target object.
  • motion compensation can also be performed on the event image in combination with the motion parameters, so that the event image is clearer, and the reconstructed image obtained by reconstruction is also clearer.
  • the color type of the pixel in the reconstructed image is determined according to the color collected by the color RGB camera.
  • the color in the actual scene can be determined according to the RGB camera, so that the color of the reconstructed image matches the color in the actual scene, and the user experience is improved.
  • the method further includes: obtaining an RGB image according to data collected by an RGB camera; and fusing the RGB image and the first reconstructed image to obtain the updated first reconstruction image. Therefore, in the embodiment of the present application, the RGB image and the reconstructed image can be fused, so that the finally obtained reconstructed image is clearer.
  • the present application further provides an image processing apparatus, the image processing apparatus having the function of implementing the method of the eighteenth aspect or any of the possible implementation manners of the eighteenth aspect.
  • This function can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the present application provides an image processing method, comprising: acquiring a first event image (event image) and a plurality of captured first images, wherein the first event image is included in the plurality of first images Information about objects moving in a preset range within the shooting time period of the image, the exposure durations corresponding to the multiple first images are different, and the preset range is the shooting range of the camera; a first degree of shaking corresponding to each of the first images, where the first degree of shaking is used to indicate the degree of camera shake when shooting the multiple first images; according to each first image The corresponding first degree of shaking determines the fusion weight of each first image in the plurality of first images, wherein the first degree of shaking corresponding to the plurality of first images and the fusion weight are in a negative correlation; according to the The fusion weight of each first image fuses the plurality of first images to obtain a target image.
  • a first event image event image
  • the degree of shaking when shooting RGB images can be quantified by using event images, and the fusion weight of each RGB image is determined according to the degree of shaking of each RGB image.
  • the RGB image with a low degree of jitter corresponds to a higher fusion weight, so that the information included in the final target image is more inclined to a clearer RGB image, thereby obtaining a clearer target image.
  • the RGB image with a higher degree of jitter has a smaller corresponding weight value
  • an RGB image with a low degree of jitter has a larger corresponding weight value, so that the information contained in the final target image tends to be clearer.
  • the information contained in the RGB image makes the final target image clearer and improves the user experience. And if the target image is used for subsequent image recognition or feature extraction, etc., the obtained recognition results or extracted features are also more accurate.
  • the method before the determining of the fusion weight of each of the first images in the plurality of first images according to the first degree of shaking, the method further includes: if the first shaking If the degree is not higher than the first preset value and higher than the second preset value, then debounce processing is performed on each first image to obtain each debounced first image.
  • the determining the fusion weight of each first image in the plurality of first images according to the first degree of shaking includes: if the first degree of shaking is higher than a first predetermined degree set the value, then re-shoot to obtain a second image, and the second degree of shaking of the second image is not higher than the first preset value;
  • the fusion weight of the first image, and the fusion weight of the second image is calculated according to the second degree of jitter; the fusion weight of each first image is used to fuse the plurality of first images to obtain a target image , which includes: fusing the multiple first images and the second images according to the fusion weight of each first image and the fusion weight of the second image to obtain the target image.
  • the RGB image with a higher degree of jitter has a smaller corresponding weight value, and an RGB image with a low degree of jitter has a larger corresponding weight value, so that the information contained in the final target image tends to be clearer.
  • the information contained in the RGB image makes the final target image clearer and improves the user experience.
  • the target image is used for subsequent image recognition or feature extraction, etc., the obtained recognition results or extracted features are also more accurate.
  • RBG images can be supplemented to obtain RGB images with lower degree of jitter and clearer, so that in subsequent image fusion, clearer images can be used for fusion, so that the final target can be obtained.
  • the image is also sharper.
  • the method before obtaining the second image by re-shooting, the method further includes: obtaining a second event image, where the second event image is obtained before obtaining the first event image; according to The information included in the second event image is calculated to obtain exposure parameters, and the exposure parameters are used to capture the second image.
  • the exposure strategy is adaptively adjusted by using the information collected by the dynamic perception camera (that is, the motion sensor), that is, the dynamic perception information is used to adaptively supplement the high dynamic range perception characteristics of the texture within the shooting range by using the dynamic perception information.
  • the dynamic perception camera that is, the motion sensor
  • the dynamic perception information is used to adaptively supplement the high dynamic range perception characteristics of the texture within the shooting range by using the dynamic perception information.
  • Shooting images with appropriate exposure time improves the camera's ability to capture texture information in bright or dark areas.
  • the re-shooting to obtain the second image further includes: dividing the first event image into multiple regions, and dividing the third image into multiple regions, and the first event image is divided into multiple regions.
  • the three images are the first images with the smallest exposure value among the first images, and the multiple regions included in the first event image correspond to the positions of the multiple regions included in the third image, and the The exposure value includes at least one of exposure duration, exposure amount or exposure level; calculating whether each area in the first event image includes the first texture information, and whether each area in the third image includes the first texture information; Two texture information; if the first area in the first event image includes the first texture information, and the area corresponding to the first area in the third image does not include the second texture information, then Shooting is performed according to the exposure parameters to obtain the second image, and the first area is any area in the first dynamic area.
  • the RGB image with the smallest exposure value does not include texture information in the same area as this area, it means that the texture information in the RGB image is not included.
  • This area has a high degree of blur, and can make up for RGB images.
  • each region in the first event image does not include texture information, it is not necessary to make up the RGB image.
  • the present application provides an image processing method, including: first, detecting motion information of a target object, where the motion information may include information on a motion trajectory of the target object when it moves within a preset range, and the preset motion information may include: The range is set as the shooting range of the camera; then, the focus information is determined according to the motion information, and the focus information includes parameters for focusing on the target object within the preset range; then, the target object is focused in the preset range according to the focus information, and the shooting is performed. Preset range of images.
  • the movement trajectory of the target object within the shooting range of the camera can be detected, and then the focus information can be determined according to the movement trajectory of the target object and the focus can be completed, so that a clearer image can be captured. Even if the target object is in motion, the target object can be accurately focused, and a clear moving image can be captured to improve user experience.
  • the above-mentioned determination of the focus information according to the motion information may include: according to the motion information, that is, the information of the motion trajectory of the target object when the target object moves within the preset range, the target object within the preset duration is determined. Predict the trajectory of the movement to obtain a prediction area, where the prediction area is the area where the target object is located within the predicted preset time length; determine the focus area according to the prediction area, and the focus area includes at least one target object that focuses on the target object.
  • a focus point, the focus information includes position information of at least one focus point.
  • the future motion trajectory of the target object can be predicted, and the focus area is determined according to the predicted area, so that the focus on the target object can be accurately completed. Even if the target object is moving at a high speed, the embodiments of the present application can focus on the target object in advance in a predictive manner, so that the target object is in the focus area, so that a clearer target object moving at a high speed can be photographed.
  • determining the focus area according to the prediction area may include: if the prediction area meets the preset condition, determining the prediction area as the focus area; if the prediction area does not meet the preset condition, re-according to The motion information predicts the motion trajectory of the target object within a preset time period, obtains a new prediction area, and determines the focus area according to the new prediction area.
  • the preset condition may be that the prediction area includes a complete target object, or the area of the prediction area is larger than a preset value, or the like.
  • the focus area is determined according to the prediction area, and the camera is triggered to shoot, and when the prediction area does not meet the preset conditions, the camera is not triggered to shoot, thereby An incomplete target object in the captured image can be avoided, or pointless shots can be avoided.
  • the camera may be in an inactive state when not shooting, and the camera is triggered to shoot only when the predicted area satisfies the preset condition, which can reduce the power consumption generated by the camera.
  • the motion information further includes at least one of the motion direction and motion speed of the target object; the above-mentioned motion information is used to predict the motion trajectory of the target object within a preset time period to obtain the prediction area, which can be
  • the method includes: predicting the movement trajectory of the target object within a preset period of time according to the movement trajectory of the target object when the target object moves within a preset range, and the movement direction and/or movement speed to obtain a prediction area.
  • the motion trajectory of the target object within a preset time period in the future can be predicted according to the motion trajectory of the target object within the preset range, as well as the motion direction and/or motion speed, so that the target object can be predicted.
  • the target object can accurately predict the area where the target object is located within a preset time period in the future, so that the target object can be more accurately focused, and a clearer image can be captured.
  • the above-mentioned movement trajectory of the target object when it moves within a preset range, and the movement direction and/or movement speed are predicted to predict the movement trajectory of the target object within the preset time period to obtain the predicted area , which can include: according to the movement trajectory of the target object when it moves within a preset range, and the movement direction and/or movement speed, fitting the change function of the center point of the area where the target object is located with time; then according to the change function
  • the prediction center point is calculated, and the prediction center point is the center point of the area where the target object is located within the predicted preset time period; the prediction area is obtained according to the prediction center point.
  • the change function of the center point of the area where the target object is located over time can be fitted according to the motion trajectory of the target object when moving, and then the area where the target object is located at a certain moment in the future can be predicted according to the change function.
  • the prediction area is determined, so that the target object can be more accurately focused, and a clearer image can be captured.
  • the image in the predicted range may be captured by an RGB camera
  • the above-mentioned focusing on the target object in the preset range according to the focusing information may include: combining the multiple focusing points of the RGB camera with the focusing At least one point with the smallest norm distance from the center point of the area is used as the focus point for focusing.
  • At least one point with the closest norm distance to the center point of the focus area may be selected as the focus point, and focus is performed, thereby completing the focus on the target object.
  • the motion information includes the current area of the target object
  • the above-mentioned determining the focus information according to the motion information may include: determining the current area of the target object as the focus area, and the focus area includes the focus area. At least one focus point on which the target object is focused, and the focus information includes position information of the at least one focus point.
  • the information on the movement trajectory of the target object within the preset range may include the area where the target object is currently located and the area where the target object is historically located. The focus on the target object is completed, and a clearer image can be captured.
  • the above method may further include: acquiring an exposure parameter; the foregoing capturing an image in a preset range may include: capturing an image in a preset range according to the exposure parameter.
  • exposure parameters can also be adjusted, so that shooting is completed through the exposure parameters, and a clear image is obtained.
  • obtaining the exposure parameters above may include: determining the exposure parameters according to motion information, wherein the exposure parameters include exposure duration, the movement information includes the movement speed of the target object, the exposure duration and the movement of the target object Speed is negatively correlated.
  • the exposure duration can be determined by the movement speed of the target object, so that the exposure duration matches the movement speed of the target object. For example, the faster the movement speed, the shorter the exposure duration, and the slower the movement speed, the longer the exposure duration the longer. Overexposure or underexposure can be avoided, so that a clearer image can be captured in the follow-up and the user experience can be improved.
  • the obtaining of the exposure parameters may include: determining the exposure parameters according to the light intensity, wherein the exposure parameters include exposure duration, and the magnitude of the illumination intensity within a preset range is negatively correlated with the exposure duration.
  • the exposure duration can be determined according to the detected light intensity.
  • the exposure time is shorter, and the smaller the light intensity is, the longer the exposure time is, so that an appropriate amount of exposure can be guaranteed. to a clearer image.
  • the above method may further include: merging the images in the preset range according to the monitored motion information corresponding to the target object and the image to obtain a preset range. Set the target image within the range.
  • the movement of the target object within a preset range can also be monitored, and information about the corresponding movement of the target object in the image, such as the outline of the target object, the target object information such as the position within a preset range, and enhance the captured image through the information to obtain a clearer target image.
  • the above-mentioned detecting the motion information of the target object within the preset range may include: monitoring the motion situation of the target object within the preset range through a dynamic vision sensor (DVS) , get motion information.
  • DVD dynamic vision sensor
  • the DVS can be used to monitor the moving objects in the shooting range of the camera, so as to obtain accurate motion information. Even if the target object is in a state of high-speed movement, the movement of the target object can be captured in time through the DVS. information.
  • the present application further provides an image processing apparatus, the image processing apparatus having the function of implementing the method of the nineteenth aspect or any one of the possible implementation manners of the nineteenth aspect, or the image processing apparatus having The functions of the method of the foregoing twentieth aspect or any possible implementation manner of the twentieth aspect are implemented.
  • This function can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • an embodiment of the present application provides a graphical user interface GUI, wherein the graphical user interface is stored in an electronic device, and the electronic device includes a display screen, a memory, and one or more processors, and the one or more processors are configured to execute one or more computer programs stored in the memory, and the graphical user interface includes: in response to a trigger operation for shooting a target object, and shooting an image of a preset range according to the focus information, displaying the An image of a preset range, the preset range is the shooting range of the camera, the focus information includes parameters for focusing on the target object within the preset range, and the focus information is determined according to the motion information of the target object, the motion The information includes information on the movement track of the target object when it moves within a preset range.
  • the graphical user interface may further include: in response to the motion information, predicting the motion trajectory of the target object within a preset time period to obtain a prediction area, where the prediction area is the predicted area.
  • the focus area includes at least one focus point for focusing on the target object, and the focus information includes at least one focus area. Information about the position of a focus point.
  • the graphical user interface may specifically include: if the prediction area meets a preset condition, in response to determining the focus area according to the prediction area, displaying the focus area on the display screen; If the prediction area does not meet the preset conditions, in response to re-predicting the motion trajectory of the target object within the preset time period according to the motion information, a new prediction area is obtained, and the focus area is determined according to the new prediction area, The focus area is displayed in the monitor.
  • the movement information further includes at least one of the movement direction and movement speed of the target object;
  • the graphical user interface may specifically include: in response to the movement of the target object within a preset range The movement trajectory during movement, and the movement direction and/or the movement speed are used to predict the movement trajectory of the target object within a preset time period to obtain the predicted area, which is displayed on the display screen.
  • the graphical user interface may specifically include: in response to the movement trajectory when the target object moves within a preset range, and the movement direction and/or the movement speed, Fitting out the change function of the center point of the area where the target object is located over time, and calculating the predicted center point according to the change function, and the predicted center point is the predicted area where the target object is located.
  • the center point is obtained, and the prediction area is obtained according to the prediction center point, and the prediction area is displayed on the display screen.
  • the image of the prediction range is captured by an RGB camera
  • the graphical user interface may specifically include: in response to combining the multiple focus points of the RGB camera with a center point of the focus area At least one point with the smallest norm distance is used as the focus point to focus, and the image captured after focusing based on the at least one point as the focus point is displayed on the display screen.
  • the motion information includes the current region of the target object
  • the graphical user interface may specifically include: in response to taking the current region of the target object as the focus region, the focus region includes At least one focus point on which the target object is focused, the focus information includes position information of the at least one focus point, and the focus area is displayed on the display screen.
  • the graphical user interface may further include: in response to the detected motion information corresponding to the target object and the image, fusing the images within the preset range to obtain the preset The target image within the range is displayed on the display screen.
  • the motion information is obtained by monitoring the motion of the target object within the preset range through a dynamic vision sensor DVS.
  • the graphical user interface may specifically include: in response to acquiring exposure parameters before the shooting of the image in the preset range, and displaying the exposure parameters in the display screen;
  • the exposure parameter captures the image in the preset range, and the image in the preset range captured according to the exposure parameter is displayed on the display screen.
  • the exposure parameter is determined according to the motion information, the exposure parameter includes an exposure duration, and the exposure duration is negatively correlated with the movement speed of the target object.
  • the exposure parameter is determined according to the light intensity
  • the light intensity may be the light intensity detected by the camera, or the light intensity detected by the motion sensor
  • the exposure parameter includes the exposure duration, so The magnitude of the light intensity within the preset range is negatively correlated with the exposure duration.
  • the present application provides an image processing method, the method comprising: first, acquiring an event stream and a frame of RGB image (which may be referred to as the first RGB image) through a camera equipped with a motion sensor (eg, DVS) and an RGB sensor, respectively. an RGB image), wherein the acquired event stream includes at least one frame of event images, and each frame of event images in the at least one frame of event images is caused by a target object (ie a moving object) moving within the monitoring range of the motion sensor
  • the first RGB image is a superposition of the shooting scenes at each moment captured by the camera during the exposure duration.
  • the mask is used to determine the motion area of each frame of event image in the event stream, that is, to determine the location of the moving object in the RGB image. Location.
  • the first RGB image and the mask are obtained according to the above steps, a second RGB image can be obtained according to the event stream, the first RGB image and the mask, and the second RGB image is the RGB image from which the target object is removed.
  • moving objects can be removed based on only one RGB image and an event stream, thereby obtaining an RGB image without moving objects.
  • multiple RGB images and event streams are required to remove moving objects. In this way, the user only needs to shoot an RGB image, and the user experience is better.
  • the method may further include: triggering the camera to shoot when the motion sensor detects a sudden movement in the monitoring range at the first moment a third RGB image; the obtaining the second RGB image according to the event stream, the first RGB image and the mask includes: according to the event stream, the first RGB image, and the third RGB image and the mask to get the second RGB image.
  • obtaining the second RGB image according to the event stream, the first RGB image and the mask may be: according to the event stream, the first RGB image, the third RGB image The image and the mask result in a second RGB image.
  • the camera is triggered to shoot a third RGB image, and then the event stream and a frame are obtained in a similar manner as described above.
  • the first RGB image is constructed, and a mask is constructed according to the event stream, and finally a second RGB image without motion foreground is obtained according to the event stream, the first RGB image, the third RGB image and the mask.
  • the obtained third RGB image is triggered automatically by the camera in the case of sudden movement, and has high sensitivity, so that a frame of image can be obtained when the user perceives the change of moving objects. Based on the third RGB image and the first RGB images can achieve better removal of moving objects.
  • the detection by the motion sensor of a sudden movement in the monitoring range at the first moment includes: within the monitoring range, the generation area of the first event stream collected by the motion sensor at the first moment The overlapping part with the generation area of the second event stream collected by the motion sensor at the second moment is smaller than a preset value.
  • the method of constructing the mask according to the event flow may be: first, the monitoring range of the motion sensor may be divided into a plurality of preset neighborhoods (set as neighborhood k), and then, in each Within the range of neighborhood k, when the number of event images in the event flow within the preset duration ⁇ t exceeds the threshold P, the corresponding neighborhood is determined to be a motion region, and the motion region can be marked as 0. If the event flow is within the preset duration If the number of event images within the range of ⁇ t does not exceed the threshold P, the corresponding neighborhood is determined to be the background area, and the background area can be marked as 1.
  • the present application further provides an image processing apparatus, the image processing apparatus having the function of implementing the method of the twenty-second aspect or any one of the possible implementation manners of the twenty-second aspect.
  • This function can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the present application provides a pose estimation method, which is applied to a simultaneous localization and mapping (SLAM) scenario.
  • the method includes: the terminal acquires a first event image and a first RGB image, the first event image is time-series aligned with the first target image, and the first target image includes an RGB image or a depth image.
  • the first event image is an image representing a motion trajectory of the target object when the target object moves within the detection range of the motion sensor.
  • the terminal determines the integration time of the first event image. If the integration time is less than the first threshold, the terminal determines not to perform pose estimation through the first target image.
  • the terminal performs pose estimation according to the first event image.
  • the terminal determines that it is currently in a scene where it is difficult for the RGB camera to collect valid environmental information based on the integration time of the event image being less than the threshold, the terminal determines not to perform pose estimation through RGB images with poor quality, so as to improve the pose estimation accuracy.
  • the method further includes: determining the acquisition time of the first event image and the acquisition time of the first target image; according to the acquisition time of the first target image When the time difference from the acquisition time of the first event image is smaller than the second threshold, it is determined that the first event image and the first target image are time-sequentially aligned.
  • the second threshold may be determined according to the accuracy of the SLAM and the frequency of collecting RGB images by the RGB camera. For example, the second threshold may be 5 milliseconds or 10 milliseconds.
  • the acquiring the first event image includes: acquiring N consecutive DVS events; integrating the N consecutive DVS events into a first event image; the method It also includes: determining the acquisition time of the first event image according to the acquisition times of the N consecutive DVS events.
  • the determining the integration time of the first event image includes: determining N consecutive DVS events for integration into the first event image; The acquisition time of the first DVS event and the last DVS event in the consecutive DVS events determines the integration time of the first event image. Since the first event image is obtained by integrating N consecutive DVS events, the terminal can determine the acquisition time of the first event image according to the acquisition time corresponding to the N consecutive DVS events, that is, determine the acquisition time of the first event image The time period from the first DVS event to the last DVS event is obtained from the N consecutive DVS events.
  • the method further includes: acquiring a second event image, where the second event image is a motion trajectory representing the movement of the target object within the detection range of the motion sensor. Image.
  • the time period during which the motion sensor detects and obtains the first event image is different from the time period during which the motion sensor detects and obtains the second event image. If there is no RGB image that is time-series aligned with the second event image, it is determined that the second event image does not have an RGB image for jointly performing pose estimation; and pose estimation is performed according to the second event image.
  • the method before determining the pose according to the second event image, further includes: if it is determined that the second event image has time-aligned inertial measurement unit IMU data. , then the pose is determined according to the second event image and the IMU data corresponding to the second event image; if it is determined that the second event image does not have time-aligned inertial measurement unit IMU data, then the pose is determined only according to the second event image The event image determines the pose.
  • the method further includes: acquiring a second target image, where the second target image includes an RGB image or a depth image; If the event images are aligned, it is determined that the second target image does not have an event image for jointly performing pose estimation; the pose is determined according to the second target image.
  • the method further includes: performing loop closure detection according to the first event image and a dictionary, where the dictionary is a dictionary constructed based on the event image. That is, before performing the loop closure detection, the terminal may construct a dictionary based on the event image in advance, so that the loop closure detection can be performed based on the dictionary in the process of performing the loop closure detection.
  • the method further includes: acquiring multiple event images, where the multiple event images are event images used for training, and the multiple event images may be images of the terminal at different locations.
  • the event image captured in the scene.
  • the visual features of the multiple event images are acquired, and the visual features may include, for example, features such as textures, patterns, or grayscale statistics of the images.
  • the visual features are clustered by a clustering algorithm to obtain the clustered visual features, and the clustered visual features have corresponding descriptors. By clustering the visual features, similar visual features can be grouped into one group to facilitate the subsequent matching of visual features.
  • the dictionary is constructed according to the clustered visual features.
  • the performing loop closure detection according to the first event image and a dictionary includes: determining a descriptor of the first event image; determining the first event image in the dictionary A visual feature corresponding to a descriptor of an event image; determining a bag of words vector corresponding to the first event image based on the visual feature; determining the difference between the bag of words vector corresponding to the first event image and the bag of words vectors of other event images similarity between the two to determine the event image matched by the first event image.
  • the present application provides a key frame selection method, comprising: acquiring an event image; determining first information of the event image, where the first information includes events and/or features in the event image; If it is determined based on the first information that the event image satisfies at least a first condition, the event image is determined to be a key frame, and the first condition is related to the number of events and/or the number of features.
  • whether the current event image is a key frame is determined by determining the number of events, distribution of events, number of features and/or distribution of features in the event image, which can realize the rapid selection of key frames, with a small amount of algorithms and can satisfy the Quick selection of key frames for scenarios such as video analysis, video codec or security monitoring.
  • the first condition includes: the number of events in the event image is greater than a first threshold, the number of event valid areas in the event image is greater than a second threshold, all One or more of the number of features in the event image is greater than a third threshold and the feature effective area in the event image is greater than a fourth threshold.
  • the method further includes: acquiring a depth image that is time-series aligned with the event image; if it is determined based on the first information that the event image at least meets the first condition, then The event image and the depth image are determined as key frames.
  • the method further includes: acquiring an RGB image that is time-series aligned with the event image; acquiring the feature quantity and/or feature effective area of the RGB image; The first information determines that the event image satisfies at least the first condition, and the number of features of the RGB image is greater than the fifth threshold and/or the number of feature effective areas of the RGB image is greater than the sixth threshold, then determine the event image and the RGB image as keyframe.
  • the determining that the event image is a key frame if it is determined based on the first information that the event image meets at least a first condition includes: if based on the first information One piece of information determines that the event image meets at least the first condition, then determines second information of the event image, where the second information includes motion features and/or pose features in the event image; The second information determines that the event image satisfies at least a second condition, and determines that the event image is a key frame, and the second condition is related to the motion change amount and/or the pose change amount.
  • the method further includes: determining a clarity and/or brightness consistency index of the event image; if it is determined based on the second information that the event image at least meets the requirements The second condition is met, and the definition of the event image is greater than a definition threshold and/or the brightness consistency index of the event image is greater than a preset index threshold, then the event image is determined to be a key frame.
  • the determining the brightness consistency index of the event image includes: if a pixel in the event image represents a polarity of light intensity change, calculating the brightness consistency of the event image. The absolute value of the difference between the number of events and the number of events in adjacent key frames, and dividing the absolute value by the number of pixels of the event image to obtain the brightness consistency index of the event image; if the event image If the pixel in the pixel represents the light intensity, then the difference between the event image and the adjacent key frame is calculated pixel by pixel, and the absolute value of the difference is calculated, and the absolute value corresponding to each group of pixels is summed, and the obtained The sum result is divided by the number of pixels to obtain the brightness consistency index of the event image.
  • the method further includes: acquiring an RGB image that is time-sequentially aligned with the event image; determining a clarity and/or brightness consistency index of the RGB image; The second information determines that the event image meets at least the second condition, and the sharpness of the RGB image is greater than a sharpness threshold and/or the brightness consistency index of the RGB image is greater than a preset index threshold, then determine the event
  • the image and the RGB image are keyframes.
  • the second condition includes: the distance between the event image and the last key frame exceeds a preset distance value, and the rotation angle between the event image and the last key frame exceeds The preset angle value and the distance between the event image and the last key frame exceed the preset distance value and the rotation angle between the event image and the last key frame exceeds one or more of the preset angle values.
  • the present application provides a pose estimation method, comprising: acquiring a first event image and a target image corresponding to the first event image, the first event image and environmental information captured by the image The same, the target image includes a depth image or an RGB image; a first motion region in the first event image is determined; a corresponding second motion region in the image is determined according to the first motion region; according to the image pose estimation in the second motion region.
  • the dynamic region in the scene is captured by the event image, and the pose is determined based on the dynamic region, so that the pose information can be determined in preparation.
  • the determining the first motion region in the first event image includes: if the dynamic vision sensor DVS that collects the first event image is static, acquiring There are event-responsive pixels in the first event image; and the first motion region is determined according to the event-responsive pixels.
  • the determining the first motion region according to the event-responsive pixels includes: determining that the first motion region is composed of event-responsive pixels in the first event image. If the area enclosed by the outline is greater than the first threshold, the area enclosed by the outline is determined as the first motion area.
  • the determining the first motion region in the first event image includes: if the DVS that collects the first event image is moving, acquiring a second event image, the second event image is the event image of the previous frame of the first event image; calculate the displacement size and displacement direction of the pixels in the first event image relative to the second event image; if the The displacement direction of the pixel in the first event image is different from the displacement direction of the surrounding pixels, or the difference between the displacement size of the pixel in the first event image and the displacement size of the surrounding pixels is greater than the second threshold, then determine The pixels belong to the first motion area.
  • the method further includes: determining a corresponding still area in the image according to the first motion area; and determining a pose according to the still area in the image.
  • the present application further provides a data processing device, the data processing device having the function of implementing the method of the twenty-fifth aspect or any of the possible implementation manners of the twenty-fifth aspect, or the data
  • the processing device has the function of implementing the method of the twenty-sixth aspect or any one of the possible implementation manners of the twenty-sixth aspect, or the data processing device has the function of implementing any one of the twenty-seventh aspect or the twenty-seventh aspect.
  • the functionality of the methods of possible implementations. This function can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • an embodiment of the present application provides an apparatus, including: a processor and a memory, wherein the processor and the memory are interconnected through a line, and the processor invokes program codes in the memory to execute the above-mentioned first to second aspects Processing-related functions in the method of any one of the seventeenth aspects.
  • the device may be a chip.
  • the present application provides an electronic device, the electronic device comprising: a display module, a processing module and a storage module.
  • the display module is used to display the graphical user interface of the application program stored in the storage module, and the graphical user interface can be any one of the above-mentioned graphical user interface.
  • an embodiment of the present application provides a device, which may also be referred to as a digital processing chip or a chip.
  • the chip includes a processing unit and a communication interface.
  • the processing unit obtains program instructions through the communication interface, and the program instructions are processed by the processing unit.
  • the processing unit is configured to execute the processing-related functions in any one of the optional implementation manners of the first aspect to the twenty-seventh aspect.
  • an embodiment of the present application provides a computer-readable storage medium, including instructions that, when executed on a computer, cause the computer to execute any optional implementation of the first to twenty-seventh aspects above method in method.
  • an embodiment of the present application provides a computer program product including instructions, which, when run on a computer, enables the computer to execute any one of the optional implementation manners of the foregoing first aspect to the twenty-seventh aspect.
  • FIG. 1A is a schematic diagram of a system architecture provided by this application.
  • 1B is a schematic structural diagram of an electronic device provided by the application.
  • Fig. 2 is another kind of system architecture schematic diagram provided by this application.
  • Figure 3-a is a schematic diagram of the relationship between the amount of data read and time in an event stream-based asynchronous read mode
  • Figure 3-b is a schematic diagram of the relationship between the amount of data read and time in the synchronous read mode based on frame scanning;
  • 4-a is a block diagram of a visual sensor provided by the application.
  • FIG. 4-b is a block diagram of another visual sensor provided by the application.
  • FIG. 5 is a schematic diagram of the principles of a frame scan-based synchronous read mode and an event stream-based asynchronous read mode according to an embodiment of the present application;
  • 6-a is a schematic diagram of a vision sensor operating in a frame scan-based reading mode according to an embodiment of the present application
  • 6-b is a schematic diagram of a vision sensor operating in an event stream-based reading mode according to an embodiment of the present application
  • 6-c is a schematic diagram of a vision sensor operating in an event stream-based reading mode according to an embodiment of the present application
  • 6-d is a schematic diagram of a vision sensor operating in a frame scan-based reading mode according to an embodiment of the present application
  • FIG. 7 is a flowchart of a method for operating a vision sensor chip according to a possible embodiment of the present application.
  • FIG. 8 is a block diagram of a control circuit provided by the application.
  • FIG. 9 is a block diagram of an electronic device provided by the application.
  • FIG. 10 is a schematic diagram of the data volume of a single data read mode and an adaptive switching read mode according to a possible embodiment of the present application changing with time;
  • FIG. 11 is a schematic diagram of a pixel circuit provided by the application.
  • Figure 11-a is a schematic diagram of representing an event by light intensity information and representing an event by polarity information
  • 12-a is a schematic structural diagram of a data format control unit in a reading circuit in the application;
  • 12-b is another schematic structural diagram of the data format control unit in the reading circuit in the application.
  • 13 is a block diagram of another control circuit provided by the application.
  • 15 is a block diagram of another control circuit provided by the application.
  • 16 is a block diagram of another control circuit provided by the application.
  • 17 is a block diagram of another control circuit provided by the application.
  • 18 is a schematic diagram showing the difference between a single event representation and an adaptive conversion event representation provided according to the present application.
  • 19 is a block diagram of another electronic device provided by the application.
  • FIG. 20 is a flowchart of a method for operating a vision sensor chip according to a possible embodiment of the present application
  • 21 is a schematic diagram of another pixel circuit provided by the application.
  • 23 is a block diagram of another visual sensor provided by the application.
  • FIG. 24 is a schematic diagram of region division of a pixel array
  • 25 is a block diagram of another control circuit provided by the application.
  • Figure 26 is a block diagram of another electronic device provided by the application.
  • 27 is a schematic diagram of a binary data stream
  • Figure 29-a is a block diagram of another visual sensor provided by the application.
  • Figure 29-b is a block diagram of another visual sensor provided by the application.
  • Figure 29-c is a block diagram of another visual sensor provided by the application.
  • FIG. 30 is a schematic diagram of another pixel circuit provided by the application.
  • FIG. 31 is a schematic block diagram of a third encoding unit provided by the application.
  • 33 is a block diagram of another electronic device provided by the application.
  • Figure 35 is a schematic diagram of an event provided by this application.
  • Figure 36 is a schematic diagram of an event at a certain moment provided by this application.
  • 41 is a schematic diagram of an event image provided by this application.
  • 46A is a schematic diagram of another event image provided by this application.
  • 46B is a schematic diagram of another event image provided by this application.
  • 47A is a schematic diagram of another event image provided by this application.
  • 47B is a schematic diagram of another event image provided by this application.
  • 49 is a schematic flowchart of another image processing method provided by the application.
  • 51 is a schematic diagram of a reconstructed image provided by this application.
  • 53 is a schematic diagram of a method of fitting a motion trajectory provided by the application.
  • 54 is a schematic diagram of a method for determining a focus point provided by the application.
  • 55 is a schematic diagram of a method for determining a prediction center provided by this application.
  • 57 is a schematic diagram of a shooting range provided by this application.
  • Figure 58 is a schematic diagram of a prediction area provided by this application.
  • 59 is a schematic diagram of a focus area provided by the application.
  • 60 is a schematic flowchart of another image processing method provided by the application.
  • 61 is a schematic diagram of an image enhancement method provided by this application.
  • FIG. 64 is a schematic diagram of a scenario applied by the application.
  • Figure 65 is a schematic diagram of another scenario applied by the application.
  • 66 is a schematic display diagram of a GUI provided by this application.
  • 67 is a schematic display diagram of another GUI provided by this application.
  • FIG. 68 is a schematic display diagram of another GUI provided by this application.
  • FIG. 69A is a schematic display diagram of another GUI provided by this application.
  • FIG. 69B is a schematic display diagram of another GUI provided by this application.
  • 69C is a schematic display diagram of another GUI provided by this application.
  • FIG. 70 is a schematic display diagram of another GUI provided by this application.
  • FIG. 71 is a schematic display diagram of another GUI provided by this application.
  • FIG. 72A is a schematic display diagram of another GUI provided by this application.
  • FIG. 72B is a schematic display diagram of another GUI provided by this application.
  • 73 is a schematic flowchart of another image processing method provided by the application.
  • 74 is a schematic diagram of an RGB image with a low degree of jitter provided by the application.
  • 76 is a schematic diagram of an RGB image in a large light ratio scene provided by the application.
  • FIG. 77 is a schematic diagram of another event image provided by this application.
  • Figure 78 is a schematic diagram of a RGB image provided by the application.
  • Figure 79 is another schematic diagram of RGB images provided by the application.
  • Figure 80 is another GUI schematic diagram provided by this application.
  • 81 is a schematic diagram of the relationship between the photosensitive unit and the pixel value provided by the application.
  • Figure 83 is a schematic diagram of an event flow provided by this application.
  • FIG. 84 is a schematic diagram of obtaining a blurred image after exposure and superposition of multiple shooting scenes provided by the application;
  • Figure 85 is a schematic diagram of the mask provided by the application.
  • Figure 86 is a schematic diagram of the construction mask provided by the application.
  • Figure 87 is an effect diagram of removing moving objects from image I to obtain image I' provided by the application.
  • Figure 89 is a schematic diagram of a small movement of a moving object during the photographing process provided by the application.
  • Fig. 90 is a schematic diagram of triggering a camera to capture a third RGB image provided by the application.
  • Figure 91 is a schematic diagram of the image B k captured by the camera based on the sudden change of motion triggered by the application and the image I obtained by the user's active shooting within a certain exposure time;
  • FIG. 92 is a schematic flowchart of obtaining a second RGB image without moving objects based on a frame of the first RGB image and event stream E provided by the present application;
  • FIG. 93 is a schematic flowchart of obtaining a second RGB image without a moving object based on a frame of the first RGB image, the third RGB image and the event stream E provided for this application;
  • Figure 94A provides another GUI schematic diagram for this application.
  • Figure 94B is another GUI schematic diagram provided by this application.
  • FIG. 95 is a schematic diagram of the comparison of the scene captured by the traditional camera provided by the application and the DVS
  • Figure 96 is a schematic diagram of the comparison of the scenes taken by the traditional camera provided by the application and the DVS;
  • FIG. 97 is a schematic diagram of outdoor navigation using DVS provided by this application.
  • Figure 98a is a schematic diagram of station navigation using DVS provided by this application.
  • Fig. 98b is a kind of scenic spot navigation diagram applying DVS provided by this application.
  • Fig. 99 is a kind of shopping mall navigation schematic diagram applying DVS provided by this application.
  • FIG. 100 is a schematic flowchart of executing SLAM provided by this application.
  • FIG. 101 is a schematic flowchart of a pose estimation method 10100 provided by this application.
  • Figure 102 is a schematic diagram of integrating DVS events into event images provided by the application.
  • Figure 103 is a schematic flowchart of a key frame selection method 10300 provided by this application.
  • Figure 104 is a schematic diagram of region division of an event image provided by this application.
  • Figure 105 is a schematic flowchart of a key frame selection method 10500 provided by this application.
  • FIG. 106 is a schematic flowchart of a pose estimation method 1060 provided by the present application.
  • Figure 107 is a schematic flowchart of performing pose estimation based on a static area of an image provided by the application
  • Figure 108a is a schematic flowchart of performing pose estimation based on a motion region of an image provided by the application
  • Figure 108b is a schematic flowchart of performing pose estimation based on the overall region of an image provided by the application.
  • Figure 109 is a schematic structural diagram of a kind of AR/VR glasses provided by this application.
  • Figure 110 is a schematic diagram of a gaze perception structure provided by the application.
  • Figure 111 is a schematic diagram of a network architecture provided by this application.
  • 112 is a schematic structural diagram of an image processing apparatus provided by this application.
  • 113 is a schematic structural diagram of another image processing apparatus provided by this application.
  • 115 is a schematic structural diagram of another image processing apparatus provided by this application.
  • 116 is a schematic structural diagram of another image processing apparatus provided by this application.
  • 117 is a schematic structural diagram of another image processing apparatus provided by this application.
  • FIG. 120 is another schematic structural diagram of the data processing apparatus provided by the application.
  • FIG. 121 is another schematic structural diagram of the electronic device provided by this application.
  • the method provided in this application can be applied to various electronic devices, or the electronic device can execute the method provided in this application, and the electronic device can be applied to shooting scenarios, such as photography, security, automatic driving, and drone shooting.
  • Electronic devices in this application may include, but are not limited to: smart mobile phones, TVs, tablet computers, wristbands, Head Mount Display (HMD), augmented reality (AR) devices, mixed reality (mixed reality) reality, MR) devices, cellular phones, smart phones, personal digital assistants (PDAs), in-vehicle electronic devices, laptop computers, personal computers, PC), monitoring equipment, robots, in-vehicle terminals, autonomous vehicles, etc.
  • HMD Head Mount Display
  • AR augmented reality
  • MR mixed reality
  • PDAs personal digital assistants
  • in-vehicle electronic devices laptop computers, personal computers, PC
  • monitoring equipment robots
  • robots in-vehicle terminals
  • autonomous vehicles etc.
  • FIG. 1A Exemplarily, the architecture of the electronic device application provided by the present application is shown in FIG. 1A .
  • electronic equipment such as cars, mobile phones, AR/VR glasses, security monitoring equipment, cameras or other smart home terminals as shown in Figure 1A
  • the server may include a centralized server or a distributed server, and the electronic device may communicate with the server of the cloud platform through a wired or wireless network, thereby realizing data transmission. For example, after the electronic device collects the device, it can be saved or backed up on the cloud platform to prevent data loss.
  • Access points or base stations can be accessed through electronic devices to achieve wireless or wired access to the cloud platform.
  • the access point may be a base station, a SIM card is set in the electronic device, and the network authentication of the operator is implemented through the SIM card, thereby accessing the wireless network.
  • the access point may include a router, and the electronic device is connected to the router through a 2.4GHz or 5GHz wireless network, so as to access the cloud platform through the router.
  • the electronic device can perform data processing alone, or can realize data processing by coordinating the cloud, which can be adjusted according to the actual application scenario.
  • a DVS can be set in the electronic device, and the DVS can work in conjunction with a camera or other sensors in the electronic device, or it can work independently. It can also process data collected by DVS or other sensors in cooperation with cloud devices.
  • FIG. 1B a specific structure is taken as an example to illustrate the structure of the electronic device provided by the present application.
  • the electronic device provided in the present application may include more or less components than those shown in FIG. 1B .
  • the electronic device shown in FIG. 1B is only an exemplary illustration, and those skilled in the art can use the electronic device as required.
  • the addition or subtraction of components is not limited in this application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • SIM Subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light.
  • the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • baseband processor baseband processor
  • neural-network processing unit neural-network processing unit
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may contain multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate with each other through the I2C bus interface, so as to realize the touch function of the electronic device 100 .
  • the I2S interface can be used for audio communication.
  • the processor 110 may contain multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is typically used to connect the processor 110 with the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 110 communicates with the camera 193 through a CSI interface, so as to realize the photographing function of the electronic device 100 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to implement the display function of the electronic device 100 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like.
  • the GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
  • the interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 charges the battery 142 , it can also supply power to the electronic device through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
  • the modem processor may be a separate device.
  • the modulation and demodulation processor may be independent of the processor 110, and be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include but is not limited to: the fifth generation mobile communication technology (5th-Generation, 5G) system, the global system for mobile communications (global system for mobile communications, GSM), the general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA) ), long term evolution (LTE), Bluetooth (bluetooth), global navigation satellite system (the global navigation satellite system, GNSS), wireless fidelity (wireless fidelity, WiFi), near field communication (near field communication, NFC), FM (also known as FM radio), Zigbee, radio frequency identification (radio frequency identification, RFID) and/or infrared (infrared,
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS), etc.
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 may also include a wired communication module (not shown in FIG. 1B ), or the mobile communication module 150 or the wireless communication module 160 here may be replaced with a wired communication module (not shown in FIG. 1B ) out), the wired communication module can enable the electronic device to communicate with other devices through a wired network.
  • the wired network may include, but is not limited to, one or more of the following: optical transport network (OTN), synchronous digital hierarchy (SDH), passive optical network (PON), Ethernet network (Ethernet), or flexible Ethernet (flex Ethernet, FlexE).
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 194 is used to display images, videos, and the like.
  • Display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED diode AMOLED
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
  • the electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the ISP is used to process the data fed back by the camera 193 .
  • the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • the DSP converts the digital image signal into a standard RGB camera (or called RGB sensor) 0, YUV and other formats of image signals.
  • the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos of various encoding formats, such as: Moving Picture Experts Group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG Moving Picture Experts Group
  • MPEG2 moving picture experts group
  • MPEG3 MPEG4
  • MPEG4 Moving Picture Experts Group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 .
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100 and the like.
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
  • the audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also referred to as a "speaker" is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also referred to as "earpiece" is used to convert audio electrical signals into sound signals.
  • the voice can be answered by placing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through a human mouth, and input the sound signal into the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
  • the earphone jack 170D is used to connect wired earphones.
  • the earphone interface 170D may be the USB interface 130, or may be a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
  • the pressure sensor 180A may be provided on the display screen 194 .
  • the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the motion attitude of the electronic device 100 .
  • the angular velocity of electronic device 100 about three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse motion to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenarios.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 can detect the opening and closing of the flip holster using the magnetic sensor 180D.
  • the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the electronic device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the electronic device 100 emits infrared light to the outside through the light emitting diode.
  • Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • Proximity light sensor 180G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket, so as to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
  • the temperature sensor 180J is used to detect the temperature.
  • the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection.
  • the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by the low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch device”.
  • the touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to touch operations may be provided through display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 180M can also contact the pulse of the human body and receive the blood pressure beating signal.
  • the bone conduction sensor 180M can also be disposed in the earphone, combined with the bone conduction earphone.
  • the audio module 170 can analyze the voice signal based on the vibration signal of the vocal vibration bone block obtained by the bone conduction sensor 180M, so as to realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M, and realize the function of heart rate detection.
  • Image sensor 180N is a device that converts optical images into electronic signals. It is widely used in digital cameras and other electronic optical devices. Image sensors are photoelectric conversion using photoelectric devices. The function converts the light image on the photosensitive surface into an electrical signal that is proportional to the light image. Compared with the photosensitive elements of "point" light sources such as photodiodes and phototransistors, the image sensor is a function of dividing the light image on its light-receiving surface into many small units (ie pixels) and converting them into usable electrical signals. device, wherein each small unit corresponds to a photosensitive unit in the image sensor, and the photosensitive unit may also be referred to as a sensor pixel.
  • Image sensors are classified into light guide tubes and solid-state image sensors. Compared with light guide tubes, solid-state image sensors have the characteristics of small size, light weight, high integration, high resolution, low power consumption, long life, and low price. According to the different components, it can be divided into two categories: charge coupled device (CCD) and metal-oxide semiconductor (complementary metal-oxide semiconductor, CMOS). Depending on the type of optical image captured, it can be divided into two categories: color sensor 1801N and motion sensor 1802N.
  • CCD charge coupled device
  • CMOS complementary metal-oxide semiconductor
  • the color sensor 1801N can be used to detect objects within the range captured by the camera.
  • Each photosensitive unit corresponds to an image point in the image sensor. Since the photosensitive unit can only sense the intensity of light , cannot capture color information, so a color filter must be covered over the photosensitive unit.
  • a color filter must be covered over the photosensitive unit.
  • different sensor manufacturers have different solutions. The most commonly used method is to cover the RGB red, green and blue three-color filter, in a 1:2:1 composition, which consists of four image points to form a color filter. Pixels (that is, the red and blue filters cover one image point respectively, and the remaining two image points cover the green filter), the reason for this ratio is that the human eye is more sensitive to green.
  • the photosensitive unit After receiving the light, the photosensitive unit generates a corresponding current, and the current size corresponds to the light intensity, so the electrical signal directly output by the photosensitive unit is analog, and then the output analog electrical signal is converted into a digital signal, and finally all digital signals are obtained In the form of a digital image matrix, it is output to a special DSP processing chip for processing.
  • This conventional color sensor outputs a full-frame image of the captured area in frame format.
  • the motion sensor 1802N may include a variety of different types of vision sensors, such as a frame-based motion detection vision sensor (MDVS) and an event-based motion detection vision sensor. It can be used to detect moving objects within the range captured by the camera, and collect the motion contours or motion trajectories of the moving objects.
  • MDVS frame-based motion detection vision sensor
  • event-based motion detection vision sensor an event-based motion detection vision sensor. It can be used to detect moving objects within the range captured by the camera, and collect the motion contours or motion trajectories of the moving objects.
  • the motion sensor 1802N may include a motion detection (Motion Detection, MD) vision sensor, which is a type of vision sensor that detects motion information.
  • the motion information originates from the relative motion between the camera and the target, and may be a camera. Movement, it can also be the movement of the target, or both the camera and the target are moving.
  • Motion detection vision sensors include frame-based motion detection and event-based motion detection. Frame-based motion detection vision sensors require exposure integration to obtain motion information through frame differences. Event-based motion detection vision sensors do not require integration and obtain motion information through asynchronous event detection.
  • the motion sensor 1802N may include a motion detection vision sensor (MDVS), a dynamic vision sensor (DVS), an active pixel sensor (APS), an infrared sensor, Laser sensor or inertial measurement unit (Inertial Measurement Unit, IMU), etc.
  • the DVS may specifically include sensors such as DAVIS (Dynamic and Active-pixel Vision Sensor), ATIS (Asynchronous Time-based Image Sensor), or CeleX sensor. DVS draws on the properties of biological vision, where each pixel simulates a neuron that responds independently to relative changes in light intensity (hereafter referred to as "light intensity").
  • the motion sensor when the relative change of light intensity exceeds a threshold, the pixel will output an event signal, including the pixel's position, time stamp, and characteristic information of light intensity.
  • the mentioned motion information, dynamic data or dynamic images, etc. can all be acquired by a motion sensor.
  • the motion sensor 1802N may include an Inertial Measurement Unit (IMU), which is a device that measures the three-axis angular velocity and acceleration of an object.
  • IMU Inertial Measurement Unit
  • the IMU usually consists of three single-axis accelerometers and three single-axis gyroscopes, which measure the acceleration signal of the object and the angular velocity signal relative to the navigation coordinate system respectively, and then calculate the attitude of the object.
  • the aforementioned IMU may specifically include the aforementioned gyro sensor 180B and acceleration sensor 180E.
  • the advantage of IMU is that the acquisition frequency is high.
  • the data collection frequency of the IMU can generally reach more than 100HZ, and the consumer-grade IMU can capture data up to 1600HZ. In a relatively short period of time, the IMU can give high-precision measurements.
  • APS active pixel sensor
  • the keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
  • the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
  • Motor 191 can generate vibrating cues.
  • the motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • the motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
  • the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the electronic device 100 employs an eSIM, ie: an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • Data can be collected through brain-like cameras, RGB cameras, or a combination thereof.
  • the brain-like camera can include a release vision sensor, which uses an integrated circuit to simulate the biological retina, each pixel simulates a biological neuron, and expresses changes in light intensity in the form of events.
  • a variety of different types of bionic vision sensors have emerged.
  • the common feature is that the pixel array independently and asynchronously monitors the light intensity change, and outputs the change as an event signal, such as the aforementioned motion sensor DVS or DAVIS.
  • An RGB camera converts an analog signal into a digital signal, which is then stored in a storage medium.
  • the value of each pixel can be based on the brain-like camera and/or RGB camera feedback
  • the value of , or the value of each pixel can include the value of the brain-like camera and RGB as independent channels respectively.
  • the optical signal can be converted into an electrical signal through a brain-like camera, an RGB camera, or a combination thereof, so as to obtain a frame-based data stream or an event-based event stream.
  • the image collected by the RGB camera is referred to as the RGB image
  • the image collected by the brain-like camera is referred to as the event image.
  • Data encoding and decoding including data encoding and data decoding.
  • the data encoding may include, after data collection, encoding the collected data, and saving the encoded data to a storage medium.
  • Data decoding may include reading data from a storage medium, decoding the data, and decoding the data into data that can be used for subsequent identification, detection, and the like.
  • the method of data collection can also be adjusted according to the method of data encoding and decoding, so as to achieve more efficient data collection and data encoding and decoding.
  • Data encoding and decoding can be divided into various types, including encoding and decoding based on brain-like cameras, encoding and decoding based on brain-like cameras and RGB cameras, or encoding and decoding based on RGB cameras.
  • the data collected by the brain-like camera, the RGB camera, or a combination thereof may be encoded, so that it is stored in the storage medium in a certain format.
  • the data stored in the storage medium is decoded and decoded into data available for subsequent use. For example, on the first day, a user can collect video or image data through a brain-like camera, an RGB camera, or a combination thereof, encode the video or image data, and store it in a storage medium. The next day, the data can be read from the storage medium and decoded to obtain a playable video or image.
  • Image optimization that is, after the aforementioned brain-like camera or RGB camera captures the image, read the captured image, and then perform optimization processing such as enhancement or reconstruction on the captured image, so as to facilitate subsequent processing based on the optimized image .
  • image enhancement and reconstruction may include image reconstruction or motion compensation, among others.
  • Motion compensation for example, through the motion parameters of the moving object collected by DVS, compensates the moving object in the event image or RGB image, so that the obtained event image or RGB image is clearer.
  • Image reconstruction such as the image captured by a brain-like vision camera, to reconstruct RGB images, so that even in motion scenes, clear RGB images can be obtained from the data collected by DVS.
  • the optimized RGB image or event image can be used for further application, of course, the collected RGB image or event image can also be used for further application. , which can be adjusted according to the actual application scenario.
  • the application scenarios may include: motion photography enhancement, DVS image and RGB image fusion, detection and recognition, simultaneous localization and mapping (SLAM), eye tracking, key frame selection or pose estimation, etc.
  • sports photography enhancement is to perform enhancement processing on a captured image in a scene of shooting a moving object, so as to capture a clearer moving object.
  • DVS image and RGB image fusion that is, the moving objects collected by DVS are used to enhance the RGB image, and the moving objects in the RGB image or the objects affected by the large light ratio are compensated to obtain a clearer RGB image.
  • Detection and recognition is to perform target detection or target recognition based on RGB images or event images.
  • Eye tracking is to track the user's eye movements according to the collected RGB images, event images or optimized RGB images, event images, etc., to determine the user's gaze point, gaze direction and other information.
  • the key frame selection is to select certain frames as key frames from the video data collected by the RGB camera in combination with the information collected by the brain-like camera.
  • the sensors that need to be activated may be different in different embodiments.
  • a motion sensor when collecting data, when optimizing the event image through motion compensation, a motion sensor can be activated, and optionally an IMU or a gyroscope can also be activated.
  • the motion sensor can be activated to capture events. The image is then optimized in conjunction with the event image, or, in motion photography-enhanced embodiments, motion sensors and RGB sensors, etc. may be activated, so in different embodiments, the corresponding sensor may be selected to be activated.
  • the method provided in this application can be applied to an electronic device, and the electronic device can include an RGB sensor and a motion sensor, etc.
  • the RGB sensor is used to collect images within a shooting range
  • the motion sensor is used to collect objects within the detection range of the motion sensor.
  • the method includes: selecting at least one from the RGB sensor and the motion sensor based on the scene information, and collecting data through the selected sensor, where the scene information includes the state information of the electronic device, and the information of the electronic device. At least one of the type of the application requesting to capture the image or the context information.
  • the aforementioned status information includes information such as remaining power, remaining storage (or available storage), or CPU load of the electronic device.
  • the aforementioned environment information may include the change value of the light intensity within the shooting range of the color RGB sensor and the motion sensor or the information of the moving object within the shooting range.
  • the environmental information may include changes in the light intensity within the shooting range of the RGB sensor or DVS sensor, or the movement of the object within the shooting range, such as the object's movement speed, movement direction and other information, or the shooting range
  • the abnormal movement of the object within the object such as the sudden change of the speed of the object, the sudden change of the direction, etc.
  • the type of the application program that requests to collect images in the aforementioned electronic device can be understood as that the electronic device carries systems such as Android, Linux or Hongmeng, and the application program can be run in the system, and the programs running in the system can be divided into: Various types, such as photo-taking applications or target detection applications.
  • motion sensors are sensitive to motion changes, but not to static scenes, and respond to motion changes by sending events. Since static areas rarely emit events, their data only express the light intensity information of motion-change areas, which is not complete. full-scene light intensity information. RGB color cameras are good at making complete color recordings of natural scenes and reproducing the texture details in the scene.
  • the default configuration is that the DVS camera (ie, the DVS sensor) is turned off.
  • the camera according to the currently called application type, such as the camera APP calling the camera, if it is in a high-speed motion state, you need to open the DVS camera and RGB camera (ie RGB sensor) at the same time; if the APP that requests to call the camera is for objects APPs for detection or motion detection do not need to take pictures of objects and recognize faces. You can choose to open the DVS camera instead of the RGB camera.
  • the camera startup mode can also be selected according to the current device status. For example, when the current battery is lower than a certain threshold, the latter user starts the power saving mode and cannot take pictures normally, so only the DVS camera can be turned on, because although the DVS camera takes pictures Not clear, but low power consumption, and high-definition imaging is not required for moving object detection.
  • the device can perceive the surrounding environment to decide whether to switch the camera mode, for example, when the device is in a night scene, or when the current device is in high-speed motion, the DVS camera can be turned on. If it is a static scene, the DVS camera may not be turned on.
  • the camera function startup mode is determined, and during operation, it can decide whether to trigger the camera mode switch, so that different sensors can be activated in different scenarios, with strong adaptability.
  • a camera in a security scene has a motion detection function, and the camera only stores the video when it detects a moving object, thereby reducing storage space and extending the storage time of the hard disk.
  • DVS and RGB cameras are used in home or security cameras, only the DVS camera is enabled for motion detection and analysis by default.
  • the DVS camera detects abnormal motion and abnormal behavior (such as sudden object movement, sudden change of movement direction, etc.) For example, there is a person approaching, or there is a significant change in light intensity, start the RGB camera to shoot, and record the full-scene texture image during this period as a monitoring credential.
  • the abnormal movement is over, it is switched to DVS work, and the RGB camera is in the standby working state, which significantly saves the amount of data and the power consumption of monitoring equipment.
  • the above intermittent camera method takes advantage of the low power consumption of the DVS, and at the same time, the DVS event-based motion detection is faster, has a faster response and more accurate detection than the image-based motion detection. Achieve 24/7 uninterrupted detection. A method to achieve more accurate, low power consumption, and save storage space.
  • the RGB cameras may not be able to capture effective scenes when the high beams are turned on for oncoming vehicles, or when the sun shines directly, or when entering and exiting tunnels during driving.
  • the DVS cannot obtain the texture information, it can obtain the general outline information in the scene, which has great auxiliary value for the driver's judgment.
  • the contour information captured by DVS can also assist in judging road conditions. Therefore, the DVS and the RGB camera can be triggered to switch between master and slave working states in specific scenarios, such as when the light intensity changes drastically, or in extreme weather.
  • the camera activation mode can be determined based on the device state and surrounding environment.
  • vision sensors ie, the aforementioned motion sensors
  • an event stream-based asynchronous reading mode hereinafter also referred to as “event stream-based reading mode” or “asynchronous reading mode”
  • frame scanning-based Synchronous read mode hereinafter also referred to as “frame scan-based read mode” or “synchronized read mode”.
  • image stream-based reading mode or “asynchronous reading mode”
  • frame scanning-based Synchronous read mode hereinafter also referred to as “frame scan-based read mode” or “synchronized read mode”.
  • FIG. 3-a and FIG. 3-b are schematic diagrams showing the relationship between the amount of read data and time in the asynchronous read mode based on event flow and the synchronous read mode based on frame scan, respectively.
  • the event stream means that the events are arranged in a certain order.
  • the asynchronous read mode is exemplarily described below by taking DVS as an example.
  • DVS by comparing the current light intensity with the light intensity at the time of the previous event, when the change amount reaches the predetermined firing threshold C (hereinafter referred to as the predetermined threshold), an event is generated and output. That is, when the difference between the current light intensity and the light intensity at the time of the previous event exceeds a predetermined threshold C, the DVS will generate an event, which can be described by formula 1-1:
  • L and L' represent the light intensity of the current moment and the light intensity of the last event, respectively.
  • each event can be represented as ⁇ x,y,t,m>, (x,y) represents the pixel position where the event was generated, t represents the time when the event was generated, and m represents the characteristic information of light intensity .
  • the pixels in the vision sensor's pixel array circuit measure the amount of light intensity variation in the environment. If the measured amount of change in light intensity exceeds a predetermined threshold, the pixel may output a data signal indicative of the event. Therefore, in the event stream based asynchronous read mode, the pixels of the vision sensor are further differentiated into pixels that generate light intensity change events and pixels that do not.
  • the light intensity change event can be characterized by the coordinate information (x, y) of the pixel generating the event, the characteristic information of the light intensity at the pixel, and the time t when the characteristic information of the light intensity is read.
  • the coordinate information (x, y) can be used to uniquely identify a pixel in the pixel array circuit, eg, x represents the row index in the pixel array circuit where the pixel is located, and y represents the column index in the pixel array circuit where the pixel is located.
  • m represents the change trend of light intensity, which can also be called polarity information, usually represented by 1-2 bits, and the value can be ON/OFF, where ON means that the light intensity is increased, and OFF means that the light intensity is weakened, that is, when the light intensity increases and exceeds a predetermined threshold, an ON pulse is generated; when the light intensity decreases and exceeds a predetermined threshold, an OFF pulse is generated ("+1" is used in this application to represent the light Strong enhancement, use "-1" to indicate that the light intensity is weakened).
  • m represents absolute light intensity information, which can also be called light intensity information, and is usually represented by multiple bits, such as 8-12 bits.
  • the event data to be read is sparse and asynchronous.
  • the vision sensor works in an event stream-based asynchronous reading mode.
  • the rate of light intensity change events in the pixel array circuit changes, the amount of data that the vision sensor needs to read Also changes over time.
  • the data volume of each frame read by the vision sensor has the same size, and the data volume remains unchanged over time. For example, assuming that 8 bits are used to represent the light intensity value of one pixel, and the total number of pixels in the vision sensor is 66, the data amount of one frame of data is 528 bits.
  • the frames are output at equal time intervals, for example, they can be output at a rate of 30 frames per second, 60 frames per second, and 120 frames per second.
  • the current vision sensor still has shortcomings, including at least the following aspects:
  • the vision sensor works in an event stream-based asynchronous reading mode.
  • the rate of light intensity change events in the pixel array circuit changes, the amount of data that the vision sensor needs to read Also changes over time. In a static scene, fewer light-intensity-change events are generated, so the total amount of data that the vision sensor needs to read is lower. In dynamic scenes, such as during vigorous exercise, a large number of light intensity change events are generated, and the total amount of data that the vision sensor needs to read increases accordingly. Bandwidth limitations, event loss or delayed readout may occur.
  • the vision sensor operates in a frame-based synchronous readout mode, and needs to represent the state or intensity value of the pixel in one frame regardless of whether the pixel changes. This representation is expensive when only a few pixels change.
  • the output and storage costs of using the two modes may have significant differences. For example, when shooting a static scene, only a small number of pixels produce light intensity change events over a period of time. By way of example, for example, in one scan, only three pixels in the pixel array circuit generate light intensity change events. In the asynchronous reading mode, only the coordinate information (x, y), time information t and light intensity change amount of the three pixels are read, and three light intensity change events can be represented. Assuming that in the asynchronous reading mode, 4, 2, 2, and 2 bits are allocated for the coordinates, reading time stamp, and light intensity change of a pixel, respectively, the total amount of data to be read in this reading mode is 30 bits.
  • the data signals output by all pixels in the entire array still need to be read to form a complete frame of data.
  • the total number of pixels of the pixel array circuit is 66
  • the total amount of data to be read is 528 bits. It can be seen that even if there are a large number of unevented pixels in the pixel array circuit, so many bits still need to be allocated in the synchronous read mode. It is uneconomical from the standpoint of presentation cost and increases the pressure on data transmission and storage. Therefore, in this case, it is more economical to use the asynchronous read mode.
  • a large number of pixels in the vision sensor measure the light in a short period of time when there is a lot of motion within the scene or when the light intensity in the environment changes drastically, such as a large number of people walking around, or suddenly switching lights on and off, etc. strong changes and generate data signals indicative of light intensity change events. Since the amount of data that characterizes a single event in asynchronous read mode is greater than that of a single event in synchronous read mode, the use of asynchronous read mode in this case may have a significant representation cost. Specifically, in each row of the pixel array circuit, there may be multiple consecutive pixels generating light intensity change events, and for each event, coordinate information (x, y), time information t, and characteristic information m of light intensity need to be transmitted.
  • Coordinate changes between these events tend to be off by only one unit, and read times are about the same.
  • the asynchronous read mode is expensive for the representation of coordinate and time information, which will cause a surge in data volume.
  • each pixel outputs a data signal that only indicates the light intensity change, without the need for coordinate information for each pixel. and time information allocation bits. Therefore, it is more economical to use the synchronous read mode for event-heavy situations.
  • a single event representation method cannot adapt to all scenarios. Using light intensity information to represent events is not conducive to alleviating the pressure on data transmission and storage. Using polarity information to represent events affects the processing and analysis of events.
  • the synchronous read mode and the asynchronous read mode are described above.
  • the read events need to be represented by the characteristic information m of the light intensity, and the characteristic information of the light intensity includes the polarity information and the light intensity information.
  • events represented by polarity information are called events in polar format
  • events represented by light intensity information are called events in light intensity format.
  • For a vision sensor that has already been manufactured only one of two event formats can be used, that is, using polarity information to represent events, or using light intensity information to represent events.
  • the advantages and disadvantages of events in polar format and events in light intensity format are described below by taking the asynchronous reading mode as an example.
  • the polarity information p is usually represented by 1-2 bits, which carries less information and can only indicate whether the change trend of the light intensity is increasing or decreasing.
  • Sexual information indicates that the event affects the processing and analysis of the event.
  • the event represented by polarity information is difficult to reconstruct and the accuracy of object recognition is also poor.
  • light intensity information is used to represent an event, it is usually represented by multiple bits, such as 8-12 bits.
  • light intensity information can carry more information, which is beneficial to the processing and analysis of events. , for example, the quality of image reconstruction can be improved, but due to the large amount of data, it takes longer to obtain events represented by light intensity information.
  • an event will be generated when the light intensity of a pixel changes beyond a predetermined threshold, then when there is a large area of object movement or light intensity fluctuations in the scene (such as entering and exiting tunnel entrances, room switching lights, etc.), the vision sensor
  • the bandwidth When the preset maximum bandwidth of the vision sensor (hereinafter referred to as the bandwidth) is certain, there is a situation that the event data cannot be read out. At present, it is usually processed by random discarding. If random discarding is adopted, although the amount of transmitted data can be guaranteed not to exceed the bandwidth, it will cause data loss. In some special application scenarios (such as autonomous driving, etc.), the randomly discarded data may be of high importance.
  • an embodiment of the present application provides a visual sensor, which compares the amount of data in two reading modes based on the statistical results of light intensity change events generated by a pixel array circuit, so that it can be switched to suit the current application scene and motion Status read mode.
  • the relationship between the data amount of the event represented by the light intensity information and the bandwidth is compared, so as to adjust the representation accuracy of the event.
  • the representation of the event is transmitted, and all events are transmitted with greater representation precision as much as possible.
  • Figure 4-a shows a block diagram of a vision sensor provided by the present application.
  • the vision sensor may be implemented as a vision sensor chip and capable of reading data signals indicative of events in at least one of a frame scan based read mode and an event stream based read mode.
  • the vision sensor 200 includes a pixel array circuit 210 and a readout circuit 220 .
  • the vision sensor is coupled to the control circuit 230 .
  • the vision sensor shown in Figure 4-a is for exemplary purposes only and does not imply any limitation on the scope of the present application. Embodiments of the present application may also be embodied in different sensor architectures.
  • the visual sensor may also include other elements or entities for realizing image acquisition, image processing, image transmission and other purposes, which are not shown for the convenience of description, but do not mean that the embodiments of the present application do not have these elements. component or entity.
  • the pixel array circuit 210 may include one or more pixel arrays, and each pixel array includes a plurality of pixels, each pixel having position information for unique identification, such as coordinates (x, y).
  • the pixel array circuit 210 can be used to measure the variation of light intensity and generate a plurality of data signals corresponding to a plurality of pixels.
  • each pixel is configured to respond independently to changes in light intensity in the environment.
  • the pixel compares the measured light intensity change to a predetermined threshold, and if the measured light intensity change exceeds the predetermined threshold, the pixel generates a first data signal indicative of a light intensity change event,
  • the first data signal includes polarity information, such as +1 or -1, or the first data signal may also be absolute light intensity information.
  • the first data signal may indicate a light intensity variation trend or an absolute light intensity value at the corresponding pixel.
  • the pixel generates a second data signal that is different from the first data signal, eg, 0, if the measured light intensity change does not exceed a predetermined threshold.
  • the data signal may indicate including, but not limited to, the polarity of light intensity, the absolute light intensity value, the change value of the light intensity, and the like.
  • Light intensity polarity can indicate the tendency of light intensity to change, for example, increase or decrease, and is usually represented by +1 and -1.
  • the absolute light intensity value may represent the light intensity value measured at the current moment. Depending on the structure, use and kind of the sensor, there may be different physical meanings regarding the light intensity or the amount of light intensity change. The scope of this application is not limited in this regard.
  • Readout circuitry 220 is coupled to, and can communicate with, pixel array circuitry 210 and control circuitry 230 .
  • the reading circuit 220 is configured to read the data signal output by the pixel array circuit 210 , which can be understood as the reading circuit 220 reading the data signal output by the pixel array 210 into the control circuit 230 .
  • the control circuit 230 is configured to control the mode in which the reading circuit 220 reads the data signal, and the control circuit 230 may also be configured to control the representation of the output data signal, in other words, control the representation accuracy of the data signal, such as the control circuit
  • the visual sensor can be controlled to output an event represented by polarity information, or an event represented by light intensity information, or an event represented by a fixed number of bits, etc., which will be described below in conjunction with specific embodiments.
  • the control circuit 230 may be an independent circuit or chip outside the vision sensor 200 as shown in FIG. 4-a, and be connected to the vision sensor 200 through a bus interface. In other possible embodiments, the control circuit 230 can also be used as a circuit or chip inside the vision sensor, integrated with the pixel array circuit and the reading circuit therein.
  • Figure 4-b shows a block diagram of another vision sensor 300 according to a possible embodiment of the present application. Vision sensor 300 may be implemented as an example of vision sensor 200 . As shown in Fig. 4-b, another block diagram of a visual sensor provided by the present application. The vision sensor includes a pixel array circuit 310 , a reading circuit 320 and a control circuit 330 .
  • the pixel array circuit 310 , the reading circuit 320 and the control circuit 330 are functionally the same as the pixel array circuit 210 , the reading circuit 220 and the control circuit 230 shown in FIG. 4 - a , and thus will not be repeated here.
  • the vision sensor is for exemplary purposes only and does not imply any limitation on the scope of this application. Embodiments of the present application may also be embodied in different vision sensors. In addition, it should also be understood that the visual sensor may also include other elements, modules or entities, which are not shown for the purpose of clarity, but do not mean that the embodiments of the present application do not have these elements or entities.
  • the reading circuit 220 may be configured to scan the pixels in the pixel array circuit 210 in a predetermined order to read data signals generated by the corresponding pixels.
  • the reading circuit 220 is configured to be able to read the data signals output by the pixel array circuit 210 in more than one signal reading mode.
  • the reading circuit 220 may perform reading in one of the first reading mode and the second reading mode.
  • the first read mode and the second read mode correspond to one of the frame scan-based read mode and the event stream-based read mode, respectively, and further, the first read mode
  • the current read mode of the read circuit 220 may be referred to, and the second read mode may be referred to as a switchable alternate read mode.
  • FIG. 5 shows a schematic diagram of the principles of the frame scan-based synchronous read mode and the event stream-based asynchronous read mode according to an embodiment of the present application.
  • the black dots represent pixels that generate light intensity change events
  • the white dots represent pixels that do not generate light intensity change events.
  • the dotted box on the left represents the synchronous reading mode based on frame scanning, in which all pixels generate voltage signals based on the received optical signals, and then output data signals after analog-to-digital conversion.
  • the reading circuit 220 reads The data signals generated by all the pixels are taken to form one frame of data.
  • the dotted box on the right represents the asynchronous reading mode based on the event stream.
  • the reading circuit 220 scans the pixel that generates the light intensity change event, the coordinate information (x, y) of the pixel can be obtained. Then, only the data signal generated by the pixel generating the light intensity change event is read, and the read time t is recorded.
  • the reading circuit 220 sequentially reads the data signals generated by the multiple pixels according to the scanning sequence, and forms an event stream as an output.
  • the lower part of Figure 5 describes the two read modes in terms of representation cost (eg, the amount of data required to read).
  • representation cost eg, the amount of data required to read.
  • the amount of data read by the read circuit 220 each time is the same, for example, one frame of data.
  • 1st frame data 401-1 and 2nd frame data 401-2 are shown.
  • the amount of data representing a single pixel eg, the number of bits B p
  • the total number M of pixels in the pixel array circuit the amount of data to be read in one frame can be determined as M ⁇ B p .
  • the read circuit 220 reads the data signal indicating the light intensity change event, and then forms an event stream 402 for all events in the order of occurrence.
  • the amount of data read each time by the read circuit 220 is related to the amount of event data B ev for representing a single event (eg, coordinates (x, y) representing the pixel generating the event, read time stamp t and The sum of the number of bits of characteristic information of light intensity) and the number of light intensity change events N ev are related.
  • the read circuit 220 may be configured to provide the read at least one data signal to the control circuit 230 .
  • the reading circuit 220 may provide the control circuit 230 with data signals read within a period of time for the control circuit 230 to perform historical data statistics and analysis.
  • the read circuit 220 when the currently adopted first read mode is an event stream-based read mode, the read circuit 220 reads the data generated by the pixels in the pixel array circuit 210 that generate light intensity change events For the convenience of description, these data signals are also referred to as first data signals hereinafter. Specifically, the reading circuit 220 scans the pixel array circuit 210 to determine the position information (x, y) of the pixels related to the light intensity change event. Based on the position information (x, y) of the pixel, the reading circuit 220 reads the first data signal generated by the pixel among the plurality of data signals to obtain characteristic information of the light intensity indicated by the first data signal and read time information t.
  • the amount of event data read by the read circuit 220 per second can be expressed as B ev ⁇ N ev bits, that is, the read data rate of the read circuit 220 is B ev ⁇ N ev bits per second (bit per second, bps), where B ev is the amount of event data (eg, the number of bits) allocated for each light intensity change event in the event stream-based read mode, where the first b The x and b y bits are used to represent the pixel coordinates (x, y), the next b t bits are used to represent the timestamp t at which the data signal was read, and the last b f bits are used to represent the data signal indicated
  • the amount of data per frame read by the reading circuit 220 can be expressed as M ⁇ Bp bits, and the amount of data read per second is M ⁇ Bp ⁇ f bits, that is, The read data rate of the read circuit 220 is M ⁇ Bp ⁇ f bps, where the total number of pixels in a given vision sensor 200 is M, and Bp is the pixel assigned for each pixel in the frame scan-based read mode
  • the amount of data (eg, the number of bits), f is the predetermined frame rate of the read circuit 220 in the frame scan-based read mode, that is, the read circuit 220 scans the pixel array circuit 210 at the predetermined frame rate f Hz in this mode,
  • M, B p and f are all known quantities, and the read data rate of the read circuit 220 in the frame scan-based read mode can be directly obtained.
  • the read circuit 220 when the currently adopted first read mode is a frame scan-based read mode, the read circuit 220 is based on the detection of light intensity change events generated in the pixel array circuit 210 within a period of time.
  • the average number of events generated per second, N ev can be obtained from historical statistics of the number. According to the N ev obtained in the reading mode of frame scanning, it can be calculated that in the reading mode based on the event stream, the reading circuit 220 reads the readings per second.
  • the amount of event data is Bev ⁇ Nev bits, that is, in the event stream-based read mode, the read data rate of the read circuit 220 is Bev ⁇ Nev bps.
  • the read data rate of the read circuit 220 in the frame scan-based read mode can be directly calculated according to predefined parameters, and the read data rate of the read circuit 220 in the event stream-based read mode
  • the data rate can be calculated from the N ev obtained in either of the two modes.
  • the control circuit 230 is coupled to the read circuit 220 and is configured to control the read circuit 220 to read the data signals generated by the pixel array circuit 210 in a particular read mode.
  • the control circuit 230 may obtain at least one data signal from the read circuit 220, and determine which one of the current read mode and the alternative read mode is more preferred based on at least the at least one data signal. It is suitable for the current application scene and motion state. Further, in some embodiments, the control circuit 230 may instruct the read circuit 220 to switch from the current data read mode to another data read mode based on the determination.
  • control circuit 230 may send an indication to the reading circuit 220 to switch the reading mode based on historical statistics of light intensity change events. For example, control circuit 230 may determine statistical data related to at least one light intensity change event based on at least one data signal received from read circuit 220 . If the statistical data is determined to satisfy the predetermined switching condition, the control circuit 230 sends a mode switching signal to the reading circuit 220 to cause the reading circuit 220 to switch to the second reading mode. For ease of comparison, the statistics may be used to measure the read data rate of the first read mode and the second read mode, respectively.
  • the statistical data may include the total data volume of the number of events measured by the pixel array circuit 210 per unit time. If the total data volume of the light intensity change events read by the reading circuit 220 in the first reading mode has been greater than or equal to the total data volume of the light intensity change events in the second reading mode, it indicates that the reading circuit 220 should The first read mode is switched to the second read mode.
  • the given first read mode is a frame scan based read mode and the second read mode is an event stream based read mode.
  • the control circuit 230 may determine the total data amount M ⁇ Bp ⁇ f of light intensity change events read in the first read mode based on the pixel number M, the frame rate f, and the pixel data amount Bp of the pixel array circuit.
  • the control circuit 230 may determine the total data amount of light intensity change events B ev ⁇ N ev based on the number of light intensity change events N ev and the event data amount B ev associated with the event stream-based read mode, that is, The total data amount B ev ⁇ N ev of light intensity change events read in the second reading mode.
  • a switching parameter can be used to adjust the relationship between the total data amount in the two reading modes, as shown in the following formula (1), the light intensity change event read in the first reading mode If the total data volume M ⁇ B p ⁇ f is greater than or equal to the total data volume B ev ⁇ N ev of the light intensity change event of the second reading mode, the reading circuit 220 should switch to the second reading mode:
  • the first threshold data amount d 1 M ⁇ Bp ⁇ f ⁇ . That is, if the total data volume B ev ⁇ N ev of the light intensity change events is less than or equal to the threshold data volume d 1 , it indicates that the total data volume of the light intensity change events read in the first reading mode has been greater than or equal to the second data volume
  • the control circuit 230 may determine that the statistical data of the light intensity change events in the read mode satisfy a predetermined switching condition.
  • the threshold data amount d 1 may be determined based on at least the pixel number M of the pixel array circuit, the frame rate f associated with the frame scan based read mode, and the pixel data amount B p .
  • the total data amount M ⁇ B p ⁇ f of the light intensity change events read in the first reading mode is greater than or equal to the total data of the light intensity change events in the second reading mode
  • the quantity B ev ⁇ N ev can be expressed as the following formula (2):
  • the control circuit 230 may determine that the statistical data of the light intensity change event satisfies a predetermined switching condition.
  • the threshold data amount d 2 may be determined based on at least the pixel number M of the pixel array circuit, the frame rate f associated with the frame scan based read mode, and the pixel data amount B p .
  • the first read mode is an event stream based read mode and the second read mode is a frame scan based read mode.
  • the read circuit 220 only reads the data signals generated by the pixels generating the event.
  • the control circuit 230 can directly determine the number N ev of light intensity change events generated in the pixel array circuit 210 based on the number of data signals provided by the read circuit 220 .
  • the control circuit 230 may determine the total data volume of light intensity change events, that is, the total number of events read in the first reading mode, based on the event number N ev and the event data volume B ev associated with the event stream-based reading mode. The amount of data B ev ⁇ N ev .
  • control circuit 230 can also determine the total data amount M ⁇ B p of the light intensity change event read in the second reading mode based on the pixel number M, the frame rate f and the pixel data amount B p of the pixel array circuit ⁇ f. As shown in the following formula (3), the total data volume B ev ⁇ N ev of the light intensity change events read in the first reading mode is greater than or equal to the total data volume M ⁇ of the light intensity change events in the second reading mode B p f, the read circuit 220 should switch to the second read mode:
  • the control circuit 230 determines that the statistical data of the light intensity change event satisfies a predetermined switching condition.
  • the threshold data amount d 1 may be determined based on at least the pixel number M of the pixel array circuit, the frame rate f, and the pixel data amount B p .
  • the total data volume B ev ⁇ N ev of the light intensity change events read in the first reading mode is greater than or equal to the total data volume of the light intensity change events in the second reading mode M ⁇ B p ⁇ f can be expressed as the following formula (4):
  • the control circuit 230 determines that the statistical data of the light intensity change event satisfies the predetermined switching condition.
  • the threshold data amount d 2 may be determined based on at least the pixel number M of the pixel array circuit, the frame rate f, and the pixel data amount B p .
  • the statistical data may include the number of events N ev measured by the pixel array circuit 210 per unit time. If the first read mode is the frame scan-based read mode and the second read mode is the event stream-based read mode, the control circuit 230 is based on the difference of the first data signal among the plurality of data signals provided by the read circuit 220 . number to determine the number of light intensity change events N ev .
  • the control circuit 230 determines that the statistics of light intensity change events satisfy the predetermined switching condition may be based at least on the number M of pixels of the pixel array circuit, and based on the frame The frame rate f and the amount of pixel data Bp associated with the scanned read mode, and the event data amount Bev associated with the event stream-based read mode determine the first threshold number n 1 .
  • the following formula (5) can be further obtained based on formula (1):
  • the first threshold number n 1 may be determined as
  • the second threshold number n 2 can be determined as
  • the control circuit 230 is based on at least one data signal provided by the read circuit 220
  • the number of light intensity change events, N ev can be directly determined. If the statistical data indicates that the number N ev of light intensity change events is greater than or equal to the first threshold number n 1 , the control circuit 230 determines that the statistical data of the light intensity change events satisfies the predetermined switching condition.
  • n 1 M ⁇ B p ⁇ f/( ⁇ B ev ).
  • formula (7) can be further obtained based on formula (3):
  • the first threshold number n 1 may be determined as
  • the second threshold number n 2 can be determined as
  • Figure 6-a shows a schematic diagram of a vision sensor operating in a frame scan based reading mode according to an embodiment of the present application.
  • Figure 6-b shows a schematic diagram of a vision sensor operating in an event stream based reading mode according to an embodiment of the present application.
  • the readout circuit 220 or 320 is currently operating in a first readout mode, a frame scan based readout mode. Since the control circuit 230 or 330 determines that the number of events generated in the pixel array circuit 210 or 310 is currently relatively small, for example, there are only four valid data in one frame of data, based on historical statistics, and then predicts the possible event generation rate in the next time period lower.
  • the control circuit 230 or 330 sends a mode switching signal to the reading circuit 220 or 320 to switch the reading circuit 220 or 320 from the first reading mode to the second reading mode. After switching, as shown in FIG. 6-b, the read circuit 220 or 320 operates in the second read mode and only reads valid data signals, thereby avoiding the transmission bandwidth and storage resources occupied by a large number of invalid data signals.
  • Figure 6-c shows a schematic diagram of a vision sensor operating in an event stream based reading mode according to an embodiment of the present application.
  • Figure 6-d shows a schematic diagram of a vision sensor operating in a frame scan based reading mode according to an embodiment of the present application.
  • the read circuit 220 or 320 is currently operating in a first read mode, ie an event stream based read mode.
  • the control circuit 230 or 330 determines based on historical statistics, the current number of events generated in the pixel array circuit 210 or 310 is relatively large. For example, in a short period of time, almost all the pixels in the pixel array circuit 210 or 310 generate an indication that the amount of change in light intensity is high. data signal at a predetermined threshold.
  • the read circuit 220 or 320 can predict that the likely event generation rate is higher in the next time period. Since a large amount of redundant data exists in the read data signal, for example, nearly the same pixel position information, read time stamp, etc., if the read circuit 220 or 320 continues to use the event stream-based read mode to read, Will cause a surge in the amount of read data. Thus, in this case, the control circuit 230 or 330 sends a mode switching signal to the reading circuit 220 or 320 to switch the reading circuit 220 or 320 from the first reading mode to the second reading mode. After switching, as shown in Fig. 6-d, the read circuit 220 or 320 operates in a frame scan based mode to read data signals in a read mode with a less expensive representation of a single pixel, alleviating the storage and transfer of data signal pressure.
  • the vision sensor 200 or 300 may further include a parsing circuit, which may be configured to parse the data signal output by the reading circuit 220 or 320 .
  • the parsing circuit may employ an parsing mode that is compatible with the current data reading mode of the reading circuit 220 or 320 to parse the data signal. This will be described in detail below.
  • a visual sensor chip which can adaptively switch between multiple reading modes according to historical statistics of light intensity change events generated in a pixel array circuit. In this way, no matter in dynamic scenes or static scenes, the vision sensor chip can always achieve good reading and parsing performance, avoid the generation of redundant data, and relieve the pressure of image processing, transmission and storage.
  • Figure 7 shows a flowchart of a method for operating a vision sensor chip according to a possible embodiment of the present application.
  • the method can be implemented in the visual sensor 200 shown in FIG. 4-a or the visual sensor 300 shown in FIG. 4-b and the electronic device shown in FIG. 9 below, or can also be used Any suitable device, including various devices currently known or to be developed in the future.
  • the method will be described below in conjunction with the vision sensor 200 shown in Figure 4-a.
  • a method for operating a visual sensor chip provided by an embodiment of the present application may include the following steps:
  • the pixel array circuit 210 generates a plurality of data signals corresponding to the plurality of pixels in the pixel array circuit 210 by measuring the amount of light intensity variation.
  • data signal indications may include, but are not limited to, light intensity polarity, absolute light intensity values, changes in light intensity values, and the like.
  • the reading circuit 220 reads at least one data signal among the plurality of data signals from the pixel array circuit 210 in the first reading mode, and these data signals occupy certain storage and transmission resources in the vision sensor 200 after being read. Depending on the particular reading mode, the way in which the vision sensor chip 200 reads the data signals may vary. In some possible embodiments, eg, in an event stream-based read mode, the read circuit 220 scans the pixel array circuit 210 to determine the position information (x, y) of the pixel associated with the light intensity change event. Based on the position information, the readout circuit 220 may read out the first data signal among the plurality of data signals. In this embodiment, the reading circuit 220 obtains characteristic information of light intensity, position information (x, y) of the pixel generating the light intensity change event, time stamp t of the read data signal, etc. by reading the data signal.
  • the first read mode may be a frame scan-based read mode.
  • vision sensor 200 scans pixel array circuit 210 at the frame frequency associated with the frame scan based read mode to read all data signals generated by pixel array circuit 210 .
  • the reading circuit 220 obtains characteristic information of light intensity by reading the data signal.
  • the reading circuit 220 provides the read at least one data signal to the control circuit 230 for the control circuit 230 to perform data statistics and analysis.
  • the control circuit 230 may determine statistics related to at least one light intensity change event based on the at least one data signal.
  • the control circuit 230 may utilize the switching strategy module to analyze the statistical data. If it is determined that the statistical data satisfies the predetermined switching condition, the control circuit 230 sends a mode switching signal to the reading circuit 220 .
  • the control circuit 230 may be based on the first read mode of the plurality of data signals.
  • the number of a data signal determines the number of light intensity change events.
  • the control circuit 230 compares the number of light intensity change events with a first threshold number. If the statistical data indicates that the number of light intensity change events is less than or equal to the first threshold number, the control circuit 230 determines that the statistical data of the light intensity change events satisfies a predetermined switching condition, and sends a mode switch signal.
  • control circuit 230 may be based on the number of pixels of the pixel array circuit, the frame rate and amount of pixel data associated with the frame scan based read mode, and the event data associated with the event stream based read mode amount to determine or adjust the first threshold number.
  • the control circuit 230 may The first data signal determines statistical data related to the light intensity change event. In turn, the control circuit 230 compares the number of light intensity change events to a second threshold number. If the number of light intensity change events is greater than or equal to the second threshold number, the control circuit 230 determines that the statistical data of the light intensity change events satisfy a predetermined switching condition, and sends a mode switching signal.
  • control circuit 230 may be based on the number of pixels of the pixel array circuit, the frame rate and amount of pixel data associated with the frame scan based read mode, and the event data associated with the event stream based read mode amount to determine or adjust the second threshold number.
  • the reading circuit 220 switches the first reading mode to the second reading mode based on the mode switching signal received from the control circuit 220 . Further, the read circuit 220 reads at least one data signal generated by the pixel array circuit 210 in the second read mode. The control circuit 230 can then continue to perform historical statistics on the light intensity change events generated by the pixel array circuit 210, and when the switching conditions are met, send a mode switching signal to make the reading circuit 220 switch from the second reading mode to the first reading mode. .
  • the control circuit continuously performs historical statistics and real-time analysis on the light intensity change events generated in the pixel array circuit during the entire reading and parsing process, and sends the mode once the switching condition is satisfied.
  • the switching signal causes the read circuit to switch from the current read mode to a more appropriate alternate switching mode. This adaptive switching process is repeated until the reading of all data signals is completed.
  • Figure 8 shows a block diagram of a control circuit of a possible embodiment of the present application.
  • the control circuit may be used to implement the control circuit 230 in FIG. 4-a, the control circuit 330 in FIG. 5, etc., and may also be implemented using other suitable devices.
  • the control circuit is for exemplary purposes only and does not imply any limitation on the scope of the present application. Embodiments of the present application may also be embodied in different control circuits.
  • the control circuit may also include other elements, modules or entities, which are not shown for the purpose of clarity, but do not mean that the embodiments of the present application do not have these elements or entities.
  • the control circuit includes at least one processor 602 , at least one memory 604 coupled to the processor 602 , and a communication mechanism 612 coupled to the processor 602 .
  • the memory 604 is used to store at least the computer program and the data signals obtained from the reading circuit.
  • a statistical model 606 and a policy module 608 are preconfigured on the processor 602 .
  • the control circuit 630 may be communicatively coupled to the reading circuit 220 of the vision sensor 200 as shown in FIG. 4-a or a reading circuit external to the vision sensor through the communication mechanism 612 to implement a control function thereof.
  • FIG. 4-a For the convenience of description, reference is made to the read circuit 220 in FIG. 4-a below, but the embodiments of the present application are also applicable to the configuration of the peripheral read circuit.
  • the control circuit may be configured to control the read circuit 220 in a particular data read mode (eg, frame scan-based synchronous read mode, A plurality of data signals generated by the pixel array circuit 210 are read based on an asynchronous read mode of an event stream, etc.). Additionally, the control circuit may be configured to obtain data signals from the read circuit 220, which may indicate, but are not limited to, light intensity polarity, absolute light intensity values, changes in light intensity, and the like. For example, light intensity polarity can indicate the trend of light intensity change, such as increase or decrease, usually expressed as +1/-1. The absolute light intensity value may represent the light intensity value measured at the current moment. Information about light intensity or changes in light intensity can have different physical meanings, depending on the structure, use, and kind of sensor.
  • the control circuit determines statistical data related to the at least one light intensity change event based on obtaining the data signal from the readout circuit 220 .
  • the control circuit may obtain data signals generated by the pixel array circuit 210 over a period of time from the read circuit 220 and store these data signals in the memory 604 for historical statistics and analysis.
  • the first read mode and the second read mode may be one of an event stream based asynchronous read mode and a frame scan based synchronous read mode, respectively. It should be noted, however, that all features described herein with regard to adaptively switching read modes are equally applicable to other types of sensors and data read modes now known or developed in the future, as well as any of more than two data read modes. switch between.
  • control circuit may utilize one or more preconfigured statistical models 606 to perform historical statistics of light intensity change events generated by the pixel array circuit 210 provided by the readout circuit 220 over a period of time.
  • the statistical model 606 may then transmit the statistical data to the policy module 608 as output.
  • the statistical data may indicate the number of light intensity change events, or may indicate the total data volume of light intensity change events. It should be understood that any suitable statistical model and statistical algorithm can be applied to the possible embodiments of the present application, and the scope of the present application is not limited in this respect.
  • the strategy module 608 can be used by the strategy module 608 to analyze and predict the occurrence rate of the event in the next period of time.
  • Policy module 608 may be preconfigured with one or more handover decisions.
  • the control circuit can select one of the multiple switching decisions for analysis according to the needs, for example, according to the type of the vision sensor 200, the characteristics of the light intensity change event, the properties of the external environment, the motion state, etc. and decision-making.
  • other suitable strategy modules and mode switching conditions or strategies may also be adopted, and the scope of the present application is not limited in this respect.
  • the policy module 608 determines that the statistics satisfy the mode switching condition, an indication is output to the reading circuit 220 to switch the reading mode. In another embodiment, if the policy module 608 determines that the statistics do not satisfy the mode switch condition, no indication is output to the read circuit 220 to switch the read mode. In some embodiments, the indication to switch the read mode may take an explicit form as described in the above embodiments, for example in the form of a switch signal or flag bit to notify the read circuit 220 to switch the read mode.
  • Figure 9 shows a block diagram of an electronic device according to a possible embodiment of the application.
  • the electronic device includes a visual sensor chip 901 , communication interfaces 902 and 903 , a control circuit 930 , and an analysis circuit 904 .
  • the electronics are used for exemplary purposes and may be implemented using any suitable device, including various sensor devices currently known and developed in the future. Embodiments of the present application may also be embodied in different sensor systems.
  • the electronic device may also include other elements, modules or entities, which are not shown for the purpose of clarity, but does not mean that the embodiments of the present application do not have these elements, modules or entities.
  • the vision sensor includes a pixel array circuit 710 and a readout circuit 720, wherein readout components 720-1 and 720-2 of the readout circuit 720 are coupled to a control circuit 730 via communication interfaces 702 and 703, respectively.
  • the reading components 720-1 and 720-2 may be implemented by separate devices respectively, or may be integrated in the same device.
  • the read circuit 220 shown in Figure 4-a is an example implementation of integration.
  • the reading components 720-1 and 720-2 may be configured to implement a data reading function in a frame scan-based reading mode and an event stream-based reading mode, respectively.
  • the pixel array circuit 710 can be implemented using the pixel array circuit 210 in FIG. 4-a or the pixel array circuit 310 in FIG. 5 , or can be implemented using any suitable other device, and the present application is not limited in this respect. The features of the pixel array circuit 710 will not be repeated here.
  • the read circuit 720 may read the data signals generated by the pixel array circuit 710 in a specific read mode. For example, in the example where the read component 720-1 is turned on and the read component 720-2 is turned off, the read circuit 720 initially reads the data signal using a frame scan based read mode. In the example where read component 720-2 is turned on and read component 720-1 is turned off, read circuit 720 initially reads the data signal using an event stream based read mode.
  • the reading circuit 720 can be implemented by using the reading circuit 220 in FIG. 4-a or the reading circuit 320 in FIG. 5 , and can also be implemented by using any suitable other device, and the characteristics of the reading circuit 720 are not described here. Repeat.
  • the control circuit 730 may instruct the reading circuit 720 to switch from the first reading mode to the second reading mode by means of an indication signal or a flag bit.
  • the reading circuit 720 may receive an instruction from the control circuit 730 to switch the reading mode, eg, turn on the reading component 720-1 and turn off the reading component 720-2, or turn on the reading component 720-2 and disconnect the read assembly 720-1.
  • the electronic device may also include parsing circuitry 704 as previously described.
  • the parsing circuit 704 may be configured to parse the data signals read by the reading circuit 720 .
  • the parsing circuit may adopt an parsing mode compatible with the current data reading mode of the reading circuit 720 . As an example, if the read circuit 720 initially reads the data signal in an event stream-based read mode, the parsing circuit parses the data accordingly based on the first amount of data Bev ⁇ Nev associated with the read mode.
  • the parsing circuit starts parsing according to the second data amount, that is, the data size of one frame M ⁇ B p data signal and vice versa.
  • the parsing circuit 704 can implement switching of parsing modes of the parsing circuit without explicitly switching signals or flag bits.
  • parsing circuit 704 may employ the same or corresponding statistical model and switching strategy as control circuit 730 to perform the same statistical analysis of data signals provided by read circuit 720 as control circuit 730 and make consistent switching predictions.
  • the parsing circuit initially parses the data based on the first amount of data B ev ⁇ N ev associated with the read mode.
  • the first b x bits parsed by the parsing circuit indicate the coordinate x of the pixel
  • the next b y bits indicate the coordinate y of the pixel
  • the following b t bits indicate the reading time
  • b f bits indicate the light strong feature information.
  • the parsing circuit obtains the at least one data signal from the reading circuit 720 and determines statistical data related to the at least one light intensity change event. If the parsing circuit 704 determines that the statistical data satisfies the switching condition, it switches to the parsing mode corresponding to the frame scan-based reading mode, and parses the data signal with the frame data size M ⁇ B p .
  • the parsing circuit 704 sequentially fetches the data signals in the frame according to each B p bit in the parsing mode corresponding to the read mode. The value for each pixel location, where pixel locations that did not generate light intensity change events have the value 0.
  • the parsing circuit 704 can count the non-zero numbers in a frame based on the data signal, that is, the number of light intensity change events in the frame.
  • the parsing circuit 704 obtains at least one data signal from the reading circuit 720, and determines, based on at least the at least one data signal, which one of the current parsing mode and the alternative parsing mode is related to the reading circuit 720's read mode corresponds. Further, in some embodiments, the parsing circuit 704 may switch from the current parsing mode to another parsing mode based on the determination.
  • the parsing circuit 704 may determine whether to switch parsing modes based on historical statistics of light intensity change events. For example, parsing circuit 704 may determine statistics related to at least one light intensity change event based on at least one data signal received from read circuit 720 . If the statistics are determined to satisfy the switching condition, the parsing circuit 704 switches from the current parsing mode to an alternate parsing mode. For ease of comparison, the statistics may be used to measure the read data rates of the first read mode and the second read mode of the read circuit 720, respectively.
  • the statistical data may include the total data volume of the number of events measured by the pixel array circuit 710 per unit time. If the parsing circuit 704 determines based on at least one data signal that the total data volume of the light intensity change events read by the reading circuit 720 in the first read mode has been greater than or equal to the total data of the light intensity change events of its second read mode amount, it indicates that the read circuit 720 has switched from the first read mode to the second read mode. In this case, the parsing circuit 704 should switch to the parsing mode corresponding to the current reading mode accordingly.
  • the given first read mode is a frame scan based read mode and the second read mode is an event stream based read mode.
  • parsing circuit 704 initially parses the data signals acquired from reading circuit 720 in a frame-based parsing mode corresponding to the first reading mode.
  • the parsing circuit 704 can determine the total data amount M ⁇ B of the light intensity change event read by the reading circuit 720 in the first reading mode based on the pixel number M, the frame rate f and the pixel data amount B p of the pixel array circuit 710 . p ⁇ f.
  • the parsing circuit 704 may determine the light intensity change read by the read circuit 720 in the second read mode based on the number of light intensity change events N ev and the amount of event data B ev associated with the event stream-based read mode The total data volume of the event B ev ⁇ N ev . In some embodiments, a switching parameter may be used to adjust the relationship between the total data volume in the two read modes. Further, the parsing circuit 704 can determine whether the total data amount M ⁇ B p ⁇ f of the light intensity change events read by the reading circuit 720 in the first reading mode is greater than or It is equal to the total data amount B ev ⁇ N ev of the light intensity change events of the second reading mode. If so, the parsing circuit 704 determines that the reading circuit 720 has switched to the event stream based read mode, and switches from the frame based parsing mode to the event stream based parsing mode accordingly.
  • the analysis circuit 704 can determine the total data amount M ⁇ B of the light intensity change events read by the reading circuit 720 in the first reading mode according to the above formula (2). Whether p ⁇ f is greater than or equal to the total data amount B ev ⁇ N ev of light intensity change events read in the second reading mode.
  • the parsing circuit 704 determines that the reading circuit 720 has switched to the event stream based read mode, and switches from the frame based parsing mode to the event stream based parsing mode accordingly.
  • the first read mode is an event stream based read mode and the second read mode is a frame scan based read mode.
  • parsing circuit 704 initially parses data signals acquired from reading circuit 720 in an event stream-based parsing mode corresponding to the first reading mode. As mentioned above, the parsing circuit 704 can directly determine the number N ev of light intensity change events generated in the pixel array circuit 710 based on the number of the first data signals provided by the reading circuit 720 . The parsing circuit 704 may determine the total amount of data Bev of events read by the read circuit 720 in the first read mode based on the number of events N ev and the amount of event data B ev associated with the event stream-based read mode. Nev .
  • the parsing circuit 704 can also determine the total data amount of the light intensity change event read by the read circuit 720 in the second read mode based on the pixel number M, the frame rate f and the pixel data amount B p of the pixel array circuit M ⁇ B p ⁇ f. Then, the parsing circuit 704 may, for example, determine whether the total data amount B ev ⁇ N ev of the light intensity change events read in the first reading mode is greater than or equal to the second reading mode according to the formula (3) above The total amount of data M ⁇ B p ⁇ f of light intensity change events.
  • the parsing circuit 704 determines that the total data volume B ev ⁇ N ev of the light intensity change events read by the reading circuit 720 in the first reading mode is greater than or equal to the total light intensity change events of the second reading mode When the amount of data is M ⁇ Bp ⁇ f, the parsing circuit 704 determines that the reading circuit 720 has switched to the frame scan-based reading mode, and switches from the event stream-based parsing mode to the frame-based parsing mode accordingly.
  • the parsing circuit 704 may determine the total data amount B ev ⁇ Whether N ev is greater than or equal to the total data amount M ⁇ B p ⁇ f of light intensity change events read in the second reading mode. Similarly, after determining that the total data amount B ev ⁇ N ev of the light intensity change events read by the reading circuit 720 in the first read mode is greater than or equal to the total data amount M of the light intensity change events in the second read mode In the case of ⁇ Bp ⁇ f, the parsing circuit 704 determines that the reading circuit 720 has switched to the frame scan based read mode, and switches from the event stream based parsing mode to the frame scan based parsing mode accordingly.
  • T 0 is the start time of the first frame
  • k is the frame serial number
  • the time required for digital-to-analog conversion for one pixel in the M pixels can be determined by the following formula (10):
  • the time when the light intensity change event occurs at the i-th pixel in the k-th frame can be determined by the following formula (11):
  • the current read mode is the synchronous read mode, switch to the asynchronous read mode, and parse the data according to the B ev bits of each event.
  • the switching of parsing modes can be implemented without an explicit switching signal or flag bit.
  • the parsing circuit can also parse the data in a similar manner suitable for the data reading mode, which will not be repeated here.
  • FIG. 10 is a schematic diagram showing the variation of the data amount with time in a single data read mode and an adaptively switched read mode according to a possible embodiment of the present application.
  • the left half of FIG. 10 depicts a schematic diagram of the amount of read data over time for a conventional vision sensor or sensor system simply using a synchronous read mode or an asynchronous read mode.
  • the synchronous read mode as shown in the curve 1001
  • the read data rate the read data per unit time
  • the right half of FIG. 10 depicts a schematic diagram of the change in data volume over time in an adaptive data read mode according to a possible embodiment of the present application.
  • the adaptive data reading mode can be implemented using the vision sensor 200 shown in Fig. 4-a, the vision sensor 300 shown in Fig. 4-b, or the electronics shown in Fig. 9, or a conventional vision sensor or sensor system can be implemented by
  • the adaptive data read mode is implemented using the control circuit shown in FIG. 8 .
  • the vision sensor 200 selects eg an asynchronous read mode in the initialization state.
  • the vision sensor 200 can Calculates the read data rate in the current mode.
  • the number of bits B p used to represent each pixel of each frame in the synchronous read mode is also predetermined, so that the read data rate using the synchronous read mode during this period can be calculated.
  • Vision sensor 200 can then determine whether the relationship between the data rates in the two read modes satisfies the mode switching condition. For example, vision sensor 200 may compare which of the two read modes has a lower read data rate based on a predefined threshold.
  • the vision sensor 200 switches to another reading mode, eg, from an initial asynchronous reading mode to a synchronous reading mode.
  • the above steps are continued during the process of reading and parsing the data signal until the output of all data is completed.
  • the vision sensor 200 adaptively selects the optimal reading mode during the entire data reading process, and the two reading modes appear alternately, so that the reading data rate of the vision sensor 200 always keeps not exceeding the synchronous reading rate. This reduces the cost of data transmission, parsing, and storage for vision sensors.
  • the visual sensor 200 can perform historical data statistics on events to predict the possible event generation rate in the next time period, so it is possible to select a more suitable application scenario and a Read mode for motion status.
  • the vision sensor can adaptively switch between multiple data reading modes, so that the reading data rate always does not exceed the predetermined reading data rate threshold, thereby reducing the data transmission, parsing and storage of the vision sensor at the expense of significantly improving the performance of the sensor.
  • a visual sensor can perform data statistics on events generated in a period of time to predict the possible rate of event generation in the next period of time, so it is possible to select a reading that is more suitable for the current external environment, application scenario and motion state. model.
  • the pixel array circuit can be used to measure the variation of light intensity and generate multiple data signals corresponding to multiple pixels.
  • Data signal indications include, but are not limited to, light intensity polarity, absolute light intensity value, change in light intensity value, and the like. The data signal output by the pixel array circuit will be described in detail below.
  • FIG. 11 shows a schematic diagram of a pixel circuit 900 provided by the present application.
  • Each of the pixel array circuit 210, the pixel array circuit 310, and the pixel array circuit 710 may include one or more pixel arrays, and each pixel array includes a plurality of pixels, and each pixel may be regarded as a pixel circuit , each pixel circuit is used to generate a data signal corresponding to the pixel.
  • FIG. 11 it is a schematic diagram of a preferred pixel circuit according to an embodiment of the present application. In this application, a pixel circuit is sometimes referred to simply as a pixel.
  • a preferred pixel circuit in this application includes a light intensity detection unit 901 , a threshold value comparison unit 902 , a readout control unit 903 and a light intensity collection unit 904 .
  • the light intensity detection unit 901 is configured to convert the obtained light signal into a first electrical signal.
  • the light intensity detection unit 901 can monitor the light intensity information irradiated on the pixel circuit in real time, and convert the acquired light signal into an electrical signal in real time and output it.
  • the light intensity detection unit 901 may convert the acquired light signal into a voltage signal.
  • the present application does not limit the specific structure of the light intensity detection unit, and a structure capable of converting an optical signal into an electrical signal can be used in any embodiment of the present application.
  • the light intensity detection unit may include a photodiode and a transistor. The anode of the photodiode is connected to ground, the cathode of the photodiode is connected to the source of the transistor, and the drain and gate of the transistor are connected to the power supply.
  • Threshold comparison unit 902 configured to determine whether the first electrical signal is greater than the first target threshold, or whether the first electrical signal is less than the second target threshold, the first electrical signal is greater than the first target threshold, or the first electrical signal is less than the second target
  • the threshold value comparison unit 902 outputs a first data signal, where the first data signal is used to indicate that the pixel has a light intensity transformation event.
  • the threshold value comparison unit 902 is configured to compare whether the difference between the current light intensity and the light intensity when the last event occurred exceeds a predetermined threshold, which can be understood with reference to Formula 1-1.
  • the first target threshold may be understood as the sum of the first predetermined threshold and the second electrical signal
  • the second target threshold may be understood as the sum of the second predetermined threshold and the second electrical signal.
  • the second electrical signal is the electrical signal output by the intensity detection unit 901 when the last event occurred.
  • the threshold comparison unit in the embodiment of the present application may be implemented in a hardware manner, or may be implemented in a software manner, which is not limited in the embodiment of the present application.
  • the type of the first data signal output by the threshold comparison unit 902 may be different: in some possible embodiments, the first data signal includes polarity information, such as +1 or -1, which is used to indicate that the light intensity is increased or the light intensity is weakened .
  • the first data signal may be an activation signal, used to instruct the readout control unit 903 to control the light intensity collection unit 904 to collect the first electrical signal and buffer the first electrical signal.
  • the first data signal may also be polarity information, and when the readout control unit 903 acquires the first data signal, the light intensity collection unit 904 is controlled to collect the first electrical signal.
  • the readout control unit 903 is further configured to notify the readout circuit to read the first electrical signal stored in the light intensity collection unit 904 . Or notify the reading circuit to read the first data signal output by the threshold comparison unit 902, where the first data signal is polarity information.
  • the readout circuit 905 may be configured to scan the pixels in the pixel array circuit in a predetermined order to read data signals generated by the corresponding pixels.
  • the read circuit 905 can be understood with reference to the read circuit 220, the read circuit 320, the read circuit 720, that is, the read circuit 905 is configured to be capable of reading in more than one signal reading mode Read the data signal output by the pixel circuit.
  • the reading circuit 905 may perform reading in one of a first reading mode and a second reading mode, respectively corresponding to frame scan-based reading One of the fetch mode and event stream-based read mode.
  • the read circuit 905 can also read the data signal output by the pixel circuit in only one signal read mode, for example, the read circuit 905 is configured to read only in the frame scan-based read mode The data signal output by the pixel circuit is read, or the read circuit 905 is configured to read the data signal output by the pixel circuit only in an event stream based read mode.
  • the read circuit 905 can also read the data signal output by the pixel circuit in only one signal read mode, for example, the read circuit 905 is configured to read only in the frame scan-based read mode The data signal output by the pixel circuit is read, or the read circuit 905 is configured to read the data signal output by the pixel circuit only in an event stream based read mode.
  • the representation of the data signal read by the read circuit 905 is different, that is, in some possible embodiments, the data signal read by the read circuit is represented by polarity information, for example, read
  • the circuit can read the polarity information output by the threshold comparison unit; in some possible embodiments, the data signal read by the reading circuit can be represented by the light intensity information, for example, the reading circuit can read the electricity buffered by the light intensity collecting unit. Signal.
  • the event is represented by the light intensity information and the event is represented by the polarity information.
  • the black dots represent the pixels that generate light intensity change events.
  • Figure 11-a includes a total of 8 events, of which the first 5 events are represented by light intensity information, and the last 3 events are represented by light intensity information. Events are represented by polarity information.
  • the events represented by the light intensity information and the events represented by the polarity information both need to include coordinate information (x, y) and time information t.
  • the characteristic information m of the light intensity is the light intensity information a
  • the event represented by the polarity information the characteristic information m of the light intensity is the polarity information p.
  • the difference between the light intensity information and the polarity information has been introduced above, and the description will not be repeated here. It is only emphasized that the data amount of the event represented by the polarity information is smaller than the data amount represented by the light intensity information.
  • the read circuit 905 may be configured to provide the read at least one data signal to the control circuit 906 .
  • the reading circuit 905 may provide the control circuit 906 with the total data amount of the data signals read within a period of time for the control circuit 906 to perform historical data statistics and analysis.
  • the reading circuit 906 can obtain the number of events N ev generated by the pixel array circuit per second based on statistics of the number of light intensity change events generated by each pixel circuit 900 in the pixel array circuit over a period of time. Among them, N ev can be obtained by one of the frame scan-based read mode and the event stream-based read mode.
  • Control circuit 906 is coupled to read circuit 905 and is configured to control read circuit 906 to read data signals generated by pixel circuit 900 in a particular event representation.
  • the control circuit 906 may acquire at least one data signal from the reading circuit 905, and determine which of the current event representation mode and the alternative event representation mode at least based on the at least one data signal It is more suitable for the current application scenario and motion state. Further, in some embodiments, the control circuit 906 may instruct the read circuit 905 to switch from the current event representation to another event representation based on the determination.
  • control circuit 906 may send an indication to the read circuit 905 regarding the representation of the conversion event based on historical statistics of light intensity change events. For example, control circuit 906 may determine statistics related to at least one light intensity change event based on at least one data signal received from read circuit 905 . If the statistical data is determined to satisfy the predetermined conversion condition, the control circuit 906 sends an instruction signal to the read circuit 905 to cause the read circuit 905 to convert the read event format.
  • the read circuit 905 is configured to read the data signal output by the pixel circuit only in the event stream-based read mode, and the data provided by the read circuit 905 to the control circuit 906 is a unit time The total amount of data for the number of events (light intensity transition events) measured by the pixel array circuit.
  • the current control circuit 906 controls the reading circuit 905 to read the data output by the threshold comparison unit 902, that is, the event is represented by the polarity information
  • the reading circuit 905 can, according to the number N ev of light intensity change events, the bit width H of the data format to determine the total data volume N ev ⁇ H of light intensity change events.
  • is the conversion parameter used for adjustment. It can be further obtained from the above formula (12) that if the total amount of event data represented by the light intensity information is less than or equal to the bandwidth, the control circuit 906 can determine that the statistical data of the light intensity change event satisfies the predetermined switching condition.
  • Some possible application scenarios include when the pixel acquisition circuit generates fewer events in a period of time, or when the rate of events generated by the pixel acquisition circuit is slow in one end of the time period. In these cases, events can be represented by light intensity information, because the light intensity information The represented event can carry more information, which is beneficial to the subsequent processing and analysis of the event, for example, it can improve the quality of image reconstruction.
  • the reading circuit 905 can change the number N of events according to the light intensity ev , the bit width H of the data format to determine the total data amount N ev ⁇ H of the light intensity change event.
  • b a bits are used to represent the light intensity information indicated by the data signal, which is usually Multiple bits, such as 8 bits - 12 bits.
  • a conversion parameter can be used to adjust the relationship between the data amount and the bandwidth K in an event representation manner. As shown in the following formula (13), the total data amount N of the event represented by the light intensity information If ev ⁇ H is greater than, the reading circuit 220 should read the data output by the threshold comparison unit 902, that is, convert it into an event represented by polarity information:
  • the control circuit 905 can determine that the statistical data of the light intensity change event satisfies the predetermined conversion condition.
  • Some possible application scenarios include a large number of events generated by the pixel acquisition circuit in a period of time, or when the rate of events generated by the pixel acquisition circuit is relatively fast in a period of time. In these cases, if the light intensity information continues to be used to represent events, events may be generated. In case of loss, events can be represented by polarity information, which relieves the pressure of data transmission and reduces data loss.
  • the data provided by the read circuit 905 to the control circuit 906 is the number of events Nev measured by the pixel array circuit per unit time.
  • the control circuit can determine the number of light intensity change events N ev and The relationship between them determines whether the predetermined conversion conditions are met. if N ev is less than or equal to
  • the reading circuit 220 should read the electrical signal buffered in the light intensity collection unit 904 , that is, convert it to represent an event by light intensity information, and convert the current event represented by polarity information into an event represented by light intensity information.
  • the following formula (14) can be further obtained based on formula (12):
  • the control circuit 906 can change the number of events according to the light intensity N ev and The relationship between them determines whether the predetermined conversion conditions are met. If N ev is greater than The reading circuit 220 should read the signal output from the threshold value comparison unit 902, that is, convert the event to be represented by the polarity information, and convert the current event represented by the light intensity information to the event represented by the polarity information.
  • N ev the light intensity of the light intensity
  • the reading circuit 220 should read the signal output from the threshold value comparison unit 902, that is, convert the event to be represented by the polarity information, and convert the current event represented by the light intensity information to the event represented by the polarity information.
  • the following formula (15) can be further obtained based on formula (12):
  • the read circuit 905 is configured to read the data signal output by the pixel circuit only in a frame scan-based read mode, and the data provided by the read circuit 905 to the control circuit 906 is a unit time The total amount of data for the number of events (light intensity transition events) measured by the pixel array circuit.
  • B p is the amount of pixel data (eg, the number of bits) allocated for each pixel in the frame scan-based read mode.
  • B p is usually 1 to 2 bits
  • events are represented by light intensity information, it is usually 8 to 12 bits.
  • the readout circuit 905 can determine the total data amount M ⁇ H of the light intensity change event, where M represents the total number of pixels. It is assumed that the current control circuit 906 controls the reading circuit 905 to read the data output by the threshold comparison unit 902, that is, the event is represented by the polarity information.
  • the total data volume of the events represented by the polarity information must be less than the bandwidth. In order to ensure that higher-precision event data can be transmitted as far as possible without exceeding the bandwidth limit, if the total data volume of the events represented by the light intensity information is also less than Or equal to the bandwidth, which translates to representing events through light intensity information.
  • a conversion parameter can be used to adjust the relationship between the data amount and the bandwidth K in an event representation manner. As shown in the following formula (16), the total data amount N of the event represented by the light intensity information ev ⁇ H is less than or equal to the bandwidth.
  • the reading circuit 905 can determine the total data of the light intensity change event Quantity M ⁇ H, in some embodiments, the conversion parameter can be used to adjust the relationship between the data quantity and the bandwidth K in an event representation mode, as shown in the following formula (17), the event represented by the light intensity information
  • the read circuit 220 should read the data output by the threshold comparison unit 902, that is, convert it into an event represented by polarity information:
  • the read circuit 905 is configured to read in one of a first read mode and a second read mode, the first read mode and the second read mode
  • the modes correspond to one of the frame scan-based read mode and the event stream-based read mode, respectively.
  • the read circuit 905 currently reads the data signal output by the pixel circuit in the event stream-based read mode
  • the control circuit 906 controls the read circuit 905 to read the data output by the threshold comparison unit 902, that is, through the polar
  • the property information represents the combined pattern of events and describes how the control circuit determines whether the switching conditions are met:
  • a read mode can be selected arbitrarily, for example, a frame scan-based read mode, or an event stream-based read mode can be selected; in addition, in the initial state, an event representation can be selected arbitrarily
  • the control circuit 906 controls the reading circuit 905 to read the electrical signal buffered by the light intensity collection unit 904, that is, the event is represented by light intensity information, or the control circuit 906 controls the reading circuit 905 to read the data output by the threshold comparison unit 902, That is, events are represented by polarity information.
  • the control circuit 906 controls the read circuit 905 to read the data output by the threshold comparison unit 902, that is, the event is represented by polarity information.
  • the data provided by the read circuit 905 to the control circuit 906 may be the first total data amount of the number of events (light intensity change events) measured by the pixel array circuit per unit time. Since the total number of pixels M is known, the amount of pixel data B p allocated to each pixel in the frame scan-based reading mode is known, and the bit width H of the data format when an event is represented by light intensity information is known .
  • the reading mode based on the event stream can be obtained to read the data signal output by the pixel circuit, and the pixel array circuit measures the unit time in the combined mode of the light intensity information to represent the event.
  • the second total data volume of the number of events; the frame scan-based reading model can be obtained to read the data signal output by the pixel circuit, and the event is represented by the polarity information.
  • the unit time measurement of the pixel array circuit in this combination mode The third total data amount of the number of events received; the data signal output by the pixel circuit is read based on the reading model of frame scanning, and the light intensity information represents the event in the unit time measured by the pixel array circuit in this combination mode.
  • the fourth total amount of data for the number of events The specific manner of calculating the second data amount, the third data amount, and the fourth data amount according to M, B p , and H has been described above, and will not be repeated here. Whether the switching condition is satisfied is determined by the first total data volume provided by the above-mentioned reading circuit 905, the second total data volume, the third total data volume and the fourth total number obtained by calculation, and their relationship with the bandwidth K . If the current combination mode cannot guarantee that the event data with higher accuracy can be transmitted as far as possible without exceeding the bandwidth limit, it is determined that the switching conditions are met, and the switching is made to ensure that the transmission of higher-precision event data can be guaranteed without exceeding the bandwidth limit.
  • the combined schema of the event data is determined by the first total data volume provided by the above-mentioned reading circuit 905, the second total data volume, the third total data volume and the fourth total number obtained by calculation, and their relationship with the bandwidth K . If the current combination mode cannot guarantee that the event data with higher accuracy can be transmitted as far as
  • bp is usually 1 bit to 2 bits
  • b a is usually 8 bits to 12 bits.
  • the read mode based on event flow is adopted by default, and the event is expressed in polarity mode.
  • the reading mode based on the event stream and the event is represented by the polarity information is abbreviated as the asynchronous polarity mode
  • the reading mode based on the event stream and the event is represented by the light intensity information is abbreviated as the asynchronous light intensity mode
  • the frame scan-based reading mode is abbreviated as the asynchronous light intensity mode.
  • the read mode and the event represented by the polarity information are abbreviated as the sync polarity mode
  • the frame scan-based read mode and the event represented by the light intensity information are abbreviated as the sync light intensity mode.
  • N ev 10
  • Nev ⁇ H ⁇ K which satisfies the bandwidth limitation.
  • the asynchronous light intensity mode is selected in the first second, and the light intensity information of all 10 events is transmitted with a small amount of data (270bit) without exceeding the bandwidth limit.
  • the control circuit 906 determines that the current combination mode cannot guarantee the transmission of event data with higher precision without exceeding the bandwidth limit, and determines that the switching condition is satisfied, and controls to switch the asynchronous polarity mode to the asynchronous light intensity mode. For example, an instruction signal is sent to instruct the reading circuit 905 to switch from the current event representation mode to another event representation mode.
  • control circuit 906 determines that the current combination mode can ensure the transmission of event data with higher precision as far as possible without exceeding the bandwidth limit, and determines that the switching condition is not satisfied, and still selects the asynchronous light intensity mode.
  • the synchronous light intensity mode can transmit the light intensity information of all 30 events with a data volume of 800bit.
  • the current combined mode (asynchronous light intensity mode) cannot guarantee the transmission of event data with higher precision without exceeding the bandwidth limit. If it is determined that the switching conditions are met, the control will switch the asynchronous light intensity mode to synchronous. Light intensity mode. For example, an instruction signal is sent to instruct the reading circuit 905 to switch from the current event reading mode to another event reading mode.
  • the reading circuit 905 includes a data format control unit 9051 for controlling the reading circuit to read the signal output from the threshold comparison unit 902 or to read the electrical signal buffered in the light intensity collection unit 904 .
  • the data format control unit 9051 will be introduced below with reference to two preferred embodiments.
  • the data format control unit may include AND gate 951 and AND gate 954 , OR gate 953 , and NOT gate 952 .
  • the input terminal of the AND gate 951 is used to receive the conversion signal sent by the control circuit 906 and the polarity information output by the threshold comparison unit 902
  • the input terminal of the AND gate 954 is used to receive the conversion signal sent by the control circuit 906 after passing through the NOT gate 952 . signal, and the electrical signal (light intensity information) output by the light intensity collection unit 904 .
  • the output terminals of the AND gate 951 and the AND gate 954 are connected to the input terminal of the OR gate 953 , and the output terminal of the OR gate 953 is coupled to the control circuit 906 .
  • the conversion signal may be 0 or 1
  • the data format control unit 9051 may control the read polarity information output by the threshold comparison unit 902, or control the read light intensity information output by the light intensity collection unit 904 .
  • the data format control unit 9051 can control the polarity information in the output threshold comparison unit 902, and if the conversion signal is 1, the data format control unit 9051 can control the output light intensity information in the light intensity acquisition unit 904 .
  • the data format control unit 9051 may be connected to the control unit 906 through a format signal line, and receive the conversion signal sent by the control unit 906 through the format signal line.
  • the reading circuit 905 may include reading components 955 and 956, wherein the reading component 955 and the reading component 956 may be implemented by separate devices respectively, or may be integrated in the same device.
  • the reading component 955 can be used to read the data outputted by the threshold comparison 902, and the reading component 956 can be used to read the electrical signal buffered by the light intensity collecting unit.
  • the read circuit 905 may read the data signals generated by the pixel array circuit in a specific event representation.
  • the control circuit can control the reading component 955 to be turned on and the reading component 956 to be turned off. represented event.
  • the reading circuit 905 reads the event represented by the light intensity information by reading the electrical signal buffered in the light intensity collecting unit 904 .
  • the reading circuit may further include other circuit structures, for example, may further include an analog-to-digital conversion unit for converting an analog signal into a digital signal.
  • a statistical unit may be included for counting the number of events N ev measured by the pixel array circuit in a unit time, and for another example, a calculation unit may be included for calculating the events (lights) measured by the pixel array circuit in a unit time. The total amount of data for the number of strong transformation events).
  • connection in this application may represent a direct connection or coupling, for example, the OR gate 953 is connected to the control circuit 906, and in a possible implementation, the OR gate 953 and the control circuit 906 may be coupled, The OR gate 953 may be connected to the input of the statistics unit, and the control circuit 906 may be connected to the output of the statistics unit.
  • the control circuit 906 continuously performs historical statistics and real-time analysis on the light intensity change events generated in the pixel array circuit during the whole process of reading and parsing, and sends the data once the conversion conditions are met. Convert the signal so that the read circuit 905 converts from reading the information in the threshold comparison unit 902 to read the information in the light intensity collection unit 904 , or causes the read circuit 905 to convert from reading the information in the light intensity collection unit 904 To read the information in the threshold comparison unit 902, the adaptive conversion process is repeated until the reading of all data signals is completed.
  • FIG. 13 shows a block diagram of a control circuit of a possible embodiment of the present application.
  • the control circuit may be used to implement the control circuit 906 in FIG. 11, FIG. 12-a, etc.
  • the control circuit includes at least one processor 1101, at least one memory 1102 coupled to the processor 1101, and coupled to the processor Communication mechanism 1103 of 1101.
  • the memory 1102 is used to store at least computer programs and data signals obtained from the reading circuit.
  • a statistical model 111 and a policy module 112 are preconfigured on the processor 1101 .
  • the control circuit may be communicatively coupled to the reading circuit 905 of the vision sensor as in Figs. 11, 12-a, or a reading circuit external to the vision sensor, through a communication mechanism 1103, to implement control functions therewith.
  • control circuit may be configured to control the read circuit 905 to read the plurality of data signals generated by the pixel array circuit in a particular event representation. Additionally, the control circuit may be configured to obtain a data signal from the read circuit 905, and when the control circuit controls the read circuit 905 to read an event represented by light intensity information, the data signal may indicate an absolute light intensity value, the absolute light intensity value The light intensity value measured at the current moment can be represented.
  • the data signal may indicate the light intensity polarity and the like. For example, light intensity polarity can indicate the trend of light intensity change, such as increase or decrease, usually expressed as +1/-1.
  • the control circuit determines statistical data related to the at least one light intensity change event based on obtaining the data signal from the readout circuit.
  • the statistical data mentioned above may be the total data volume of the number of events (light intensity conversion events) measured by the pixel array circuit per unit time, or the statistical data may also be the number of events measured by the pixel array circuit per unit time. Nev .
  • the control circuit may obtain data signals generated by the pixel array circuit over a period of time from the read circuit 905 and store these data signals in the memory 1102 for historical statistics and analysis.
  • control circuit may utilize one or more preconfigured statistical models 111 to perform historical statistics of light intensity change events generated by the pixel array circuit provided by the readout circuit 906 over a period of time.
  • the statistical model 111 may then transmit the statistical data to the policy module 112 .
  • the statistical data may indicate the number of light intensity change events, or may indicate the total data volume of light intensity change events. It should be understood that any suitable statistical model and statistical algorithm can be applied to the possible embodiments of the present application, and the scope of the present application is not limited in this respect.
  • the statistical data is the statistical result of the history of light intensity change events generated by the vision sensor within a period of time, it can be used by the strategy module 112 to analyze and predict the rate or data volume of the event occurrence in the next period of time.
  • the policy module 112 may be preconfigured with one or more transition decisions. When there are multiple switching decisions, the control circuit can select one of the multiple switching decisions for analysis and analysis based on factors such as the type of vision sensor, the characteristics of the light intensity change event, the properties of the external environment, the state of motion, etc. decision making.
  • the processor may include multiple statistical models and policy modules corresponding to the multiple statistical models.
  • FIG. 14 it is a block diagram of another control circuit provided in this embodiment of the present application.
  • the statistical model 1 ( 121 ) can be understood by referring to the statistical model 111 corresponding to FIG. 13
  • the strategy module 1 ( 122 ) can be understood by referring to the strategy module 112 corresponding to FIG. 13 .
  • the statistical model 2 ( 123 ) can be understood by referring to the statistical model 606 corresponding to FIG. 8
  • the strategy module 2 ( 124 ) can be understood by referring to the corresponding policy module 608 in FIG. 8 .
  • the communication mechanism 1203 can be understood with reference to the communication mechanism 1103 corresponding to FIG.
  • the control circuit may be configured to control the read circuit 220 to read the pixel array in a particular data read mode (eg, frame scan based synchronous read mode, event stream based asynchronous read mode, etc.) Multiple data signals generated by the circuit.
  • the control circuit may be configured to acquire data signals in different representations from the read circuit (eg, acquire data signals represented by polarity information, data signals represented by light intensity information, etc.).
  • the memory 1202 is used to store at least computer programs and data signals obtained from the reading circuit.
  • the computer program stored in the memory 1202 may include a program related to switching the data reading mode, and a program related to switching the representation of the event.
  • the statistical model 1 and the statistical model 2 can perform statistics based on different data.
  • the statistical model 1 performs statistics based on the number of events N ev measured by the pixel array circuit per unit time and outputs the results to the strategy module 1.
  • Statistical model 2 performs statistics based on the total data volume of the number of events (light intensity transformation events) measured by the pixel array circuit per unit time and outputs the results to the strategy module 2, or the statistical model 1 is based on the events measured by the pixel array circuit per unit time. The total data volume of the number of (light intensity conversion events) is counted and the result is output to the strategy module 1.
  • the statistical model 2 is based on the number of events N ev measured by the pixel array circuit per unit time.
  • processors eg, processor 1301 and processor 1302
  • processors are used to output a control strategy, respectively
  • statistical model 1 ( 131 ), strategy module 1 ( 132 ), statistical model 2 ( 133 ) and strategy module 2 ( 134 ) can refer to the corresponding embodiment in FIG. 14 .
  • the statistical model 1, the strategy module 1, the statistical model 2, and the strategy module 2 are understood, and details are not repeated here.
  • a plurality of memories such as memory 1303 and memory 1304) may be included, each of which is used to store a computer program related to a control strategy, or a data signal obtained from a reading circuit, respectively.
  • the memory 1 is used to store the data signal obtained from the reading circuit and the program related to the conversion event representation
  • the memory 2 is used to store the data signal obtained from the reading circuit and the program related to switching the data reading mode.
  • one memory is used to store the data signal obtained from the reading circuit
  • the other memory is used to store the computer program related to the control strategy (this solution is not shown in the figure).
  • only one communication mechanism may be included, or multiple communication mechanisms may be included.
  • the communication mechanism 1305 and the communication mechanism 1306 in FIG. 15 may be understood as one communication mechanism, or may be understood as two different communication mechanisms , can be understood with reference to the communication mechanism 1203 and the communication mechanism 1204 corresponding to FIG. 14 .
  • the policy module determines that the statistic satisfies the transition condition, an indication of how the transition event is represented is output to the read circuit. In another embodiment, if the policy module determines that the statistics do not meet the transition conditions, no indication of how the transition event is represented is not output to the read circuit. In some embodiments, the indication about the representation of the conversion event may be in an explicit form as described in the above embodiments, for example, the conversion signal is 0 or the conversion signal is 1.
  • control circuit is for exemplary purposes only and does not imply any limitation on the scope of the present application. Embodiments of the present application may also be embodied in different control circuits. In addition, it should also be understood that the control circuit may also include other elements, modules or entities, which are not shown for the purpose of clarity, but do not mean that the embodiments of the present application do not have these elements or entities. Exemplarily, a solution for implementing the control circuit to control the reading circuit to read events of different representations by means of hardware is given below.
  • FIG. 16 it is a block diagram of a control circuit provided by an embodiment of the present application.
  • the control circuit 1400 can be used to implement the control circuit 906 in FIG. 11 or FIG. 12-a, and the like.
  • the control circuit 1400 may include a counter 1401 and a comparator 1402 .
  • the counter and the comparator are coupled, the counter can communicate with the reading circuit 1403 through a communication mechanism, and the comparator can also communicate with the reading circuit 1403 through a communication mechanism.
  • the control circuit 1400 may be configured to control the read circuit 1403 to read the plurality of data signals generated by the pixel array circuit in a particular event representation.
  • the control circuit 1400 can obtain the data signal transmitted by the reading circuit 1403 through the counter 1401, and each time the counter 1401 receives an event, the value of the counter increases by one.
  • the counter can send the counted number of events to the comparator 1402 , and the comparator 1402 determines whether to output the conversion signal to the read circuit 1403 based on the conversion condition and the number of events transmitted by the counter. For example, if the current event is represented by polarity information, the transition condition can be understood by referring to formula (14).
  • the comparator 1402 When the comparator determines that the value output by the counter is less than or equal to When , the comparator 1402 outputs the conversion signal to the reading circuit 1403, and controls the reading circuit 1403 to read the electrical signal buffered in the light intensity collecting unit. For another example, if the current event is represented by light intensity information, the conversion condition can be understood by referring to formula (15). If the comparator determines that the value output by the counter is greater than or equal to , the comparator 1402 outputs the conversion signal to the reading circuit 1403, and controls the reading circuit 1403 to read the signal output by the threshold comparison unit. Comparator 1402 is reset by notifying counter 1401 after each completion of comparison.
  • the reading circuit 1403 can be understood with reference to FIG. 11 and the corresponding reading circuit 905 of FIG. 12-a.
  • FIG. 17 it is a block diagram of another control circuit 1500 provided in this embodiment of the present application.
  • the fixed signal is used to instruct the reading circuit to read the data signal according to a certain fixed event representation, such as instructing the reading circuit to read the signal output by the threshold unit (event represented by the polarity information), or to read the light intensity collection Cell buffered signals (events represented by light intensity information).
  • the selector 1503 is used for receiving the fixed signal and the signal output by the comparator 1502. When the selector 1503 receives the fixed signal, it controls the reading circuit according to the instructions of the fixed signal.
  • the read circuit is controlled according to the conversion signal output by the comparator 1502 .
  • the counter 1501 can be understood with reference to the counter 1401 in FIG. 16
  • the comparator 1502 can be understood with reference to the comparator 1402 in FIG. 16
  • the read circuit 1503 can be understood with reference to the read circuit 1403 in FIG. 16 .
  • FIG. 18 a schematic diagram showing the difference between the single event representation and the adaptive conversion event representation provided according to the present application is shown.
  • a single event representation method for example, using light intensity information to represent events (represented by light intensity mode in Figure 18)
  • the amount of data that the vision sensor needs to transmit exceeds the preset maximum bandwidth of the vision sensor
  • a portion of the data will be randomly discarded.
  • the curve 1601 in FIG. 18 when a large number of events are generated in the pixel array circuit, and the amount of data transmitted is larger than the bandwidth, as shown by the dotted line in the curve 1901, there is a situation where the event data cannot be read out, that is, there is case of data loss.
  • the relationship between the data amount of the event represented by the light intensity information and the bandwidth is compared, so as to adjust the representation precision of the event.
  • the amount of data is small and the data transmission will not exceed the bandwidth
  • the light intensity information is used to represent the event, and the sampled changed pixel brightness information can be output as much as possible.
  • the event representation accuracy is high, and the light intensity information will be processed in subsequent , such as in luminance reconstruction, it can be used directly without complex processing.
  • the event is switched to polarity information (represented by the polarity mode in Figure 18), and the representation precision of the event is low, because the polarity information usually only needs 1 bit-2 Bit, can greatly reduce the amount of data, the reduction of the amount of data can ease the transmission pressure and reduce the loss of data.
  • polarity information represented by the polarity mode in Figure 18
  • the event is generated because the change of brightness is greater than a certain threshold C.
  • x and y represent the row and column coordinates (coordinate information) of the pixel
  • t is the timestamp (time information) of the reconstruction time.
  • ep represents the current event represented by polarity information.
  • I(x,y,t pre ) represents the brightness information at a certain moment before the reconstruction moment. If more accurate brightness information needs to be obtained, it can be estimated according to the spatial information and time domain information of the pixel. For example, linear interpolation method can be used. Cubic interpolation.
  • I(x, y, t pre ) represents the previous moment of the reconstruction moment, which can further reduce the quantization error.
  • the preset maximum bandwidth of the vision sensor is 200bps, and both ⁇ and ⁇ are set to 1.
  • the initial event representation method is to represent events through light intensity information, each event is represented by 8 bits, and the pixel array circuit is within 4 seconds.
  • the amount of data is: 30 events in the first second, 60 events in the second second, 40 events in the third second, 20 events in the fourth second, and 15 events in the fifth second. . If events are always represented by light intensity information, in the first second, since the amount of data generated is 240 bits greater than the bandwidth of 200 bits, only 25 events may be transmitted normally, and other events will be lost due to limited bandwidth.
  • the probability of event loss can be reduced by representing events by polarity information.
  • the event is represented by the polarity information, and the total amount of data to be transmitted is less than the bandwidth, but the event is represented by the light intensity information, and the amount of data to be transmitted exceeds the bandwidth, so the event is still represented by the polarity information, reducing the The probability of event loss, at the 3rd second, because the amount of data that needs to be transmitted through the light intensity information to represent the event still exceeds the bandwidth, the event is still represented by the polarity information, reducing the probability of event loss, at the 4th second, due to the Polarity information indicates an event, the total amount of data to be transmitted is less than the bandwidth, and the light intensity information indicates that the amount of data to be transmitted for an event is less than the bandwidth, if the conversion conditions are met, then the event is converted to be represented by light intensity information, improving the accuracy of event representation , so
  • the data loss rate is 36.4%.
  • the event is converted to represent the event by polarity information, which greatly reduces the probability of event loss, and when the bandwidth is not limited, it is possible to make the event carry as much information as possible.
  • Figure 19 shows a block diagram of an electronic device according to a possible embodiment of the application.
  • the electronic device includes a visual sensor chip 1700 , a control circuit 1701 , and an analysis circuit 1702 .
  • the control circuit 1701 can be understood with reference to the control circuit 906 .
  • the electronics are used for exemplary purposes and may be implemented using any suitable device, including various sensor devices currently known and developed in the future. Embodiments of the present application may also be embodied in different sensor systems.
  • the electronic device may also include other elements, modules or entities, which are not shown for the purpose of clarity, but does not mean that the embodiments of the present application do not have these elements, modules or entities.
  • Parsing circuitry 1702 may be configured to parse data signals read by read circuitry in vision sensor chip 1700 .
  • the parsing circuit 1702 may adopt an parsing mode that is compatible with the current event representation of the reading circuit in the vision sensor chip 1700 .
  • the parsing circuit parses the event accordingly based on the number of bits associated with the representation, for example, the predetermined polarity information is represented by 1 bit, then The parsing circuit parses the event based on 1 bit accordingly.
  • the parsing circuit parses the event accordingly based on the number of bits associated with the representation. For example, the predetermined light intensity information is represented by 12 bits, the parsing circuit correspondingly Events are parsed based on 12 bits.
  • the parsing circuit 1702 can implement switching of parsing modes of the parsing circuit without explicitly switching signals or flag bits.
  • the parsing circuit 1702 may employ the same or corresponding statistical models and conversion strategies as the control circuit 1701 to perform the same statistical analysis as the control circuit 1701 and make consistent conversion predictions on the data signals provided by the read circuit.
  • the reading circuit reads data signals in the event stream-based read mode as an example.
  • each event can be represented as ⁇ x, y, t ,m>, (x, y) represents the pixel position where the event is generated, t represents the time when the event is generated, m represents the characteristic information of the light intensity, and m includes the polarity information and the light intensity information. It is assumed that x is represented by b x bits, y is represented by by bits, t is represented by b t bits, m is represented by 1 bit when polarity information is represented, and 12 bits are represented by m when light intensity information is represented.
  • the control circuit 1701 controls the initial state of the reading circuit to read the event represented by the polarity information
  • the parsing circuit 1702 when the parsing circuit 1702 is in the initial state, the first b x bits parsed out indicate the coordinates x of the pixel, The next b y bits indicate the coordinate y of the pixel, the following b t bits indicate the reading time, and finally one bit is taken to indicate the characteristic information of the light intensity, and the specific characteristic information of the light intensity is the polarity information.
  • the parsing circuit 1702 obtains the data signal from the reading circuit and determines statistics related to the light intensity change event.
  • the parsing circuit 1702 determines that the statistical data satisfies the conversion condition, it switches to the parsing mode corresponding to the event represented by the light intensity information. For example, when the event represented by the polarity information is converted into the event represented by the light intensity information, the parsing circuit 1702 analyzes The first b x bits of the output indicate the coordinate x of the pixel, the next b y bits indicate the coordinate y of the pixel, the following b t bits indicate the reading time, and finally 12 bits are taken to indicate the characteristic information of the light intensity. Yes, the characteristic information of the light intensity is the light intensity information.
  • the parsing circuit 1702 is in a parsing mode corresponding to the way the event is represented. For example, the first b x bits parsed out indicate the coordinate x of the pixel, the next b y bits indicate the coordinate y of the pixel, the following b t bits indicate the reading time, and finally 12 bits are taken to indicate the light intensity information.
  • the parsing circuit 1702 obtains the data signal from the reading circuit and determines statistics related to the light intensity change event. If the parsing circuit 1702 determines that the statistical data satisfies the conversion condition, it switches to the parsing mode corresponding to the event represented by the polarity information.
  • the parsing circuit 1702 parses the The first b x bits of the output indicate the coordinate x of the pixel, the next b y bits indicate the coordinate y of the pixel, the following b t bits indicate the reading time, and the last bit is taken to indicate the polarity information.
  • the parsing circuit 1702 will use the read mode with the The reading mode, the parsing mode corresponding to the event representation mode, for example, the data signal obtained from the reading circuit 905 is parsed using the mode corresponding to the reading mode of the event stream, and the first b x bits of the parsed out indicate the coordinates of the pixel x, the next b y bits indicate the coordinate y of the pixel, the following b t bits indicate the reading time, and finally 12 bits are taken to indicate the light intensity information.
  • the parsing circuit 1702 obtains the data signal from the reading circuit and determines statistics related to the light intensity change event. If the parsing circuit 1702 determines that the statistical data satisfies the conversion condition, it switches to the parsing mode corresponding to the event represented by the polarity information. For example, when the event represented by the polarity information is converted into an event represented by the light intensity information, the parsing circuit 1702 parses the The first b x bits of the output indicate the coordinate x of the pixel, the next b y bits indicate the coordinate y of the pixel, the following b t bits indicate the reading time, and the last bit is taken to indicate the polarity information.
  • the parsing circuit 704 obtains a data signal from the reading circuit 905, and based on the data signal, determines which of the current parsing mode and the alternative parsing mode and the event read by the reading circuit 905 corresponding to the representation. Further, in some embodiments, the parsing circuit 704 may switch from the current parsing mode to another parsing mode based on the determination.
  • Embodiments of the present application also provide a method for operating a visual sensor chip.
  • FIG. 20 it is a flowchart of a method for operating a vision sensor chip according to a possible embodiment of the present application, which may include the following steps:
  • the pixel array circuit generates at least one data signal corresponding to a pixel in the pixel array circuit by measuring the amount of light intensity change, the at least one data signal indicates a light intensity change event, and the light intensity change event represents the measured value of the corresponding pixel in the pixel array circuit.
  • the amount of change in light intensity exceeds a predetermined threshold.
  • the pixel array circuit may include one or more pixel arrays, and each pixel array includes multiple pixels, each pixel may be regarded as a pixel circuit, and the pixel circuit may be understood with reference to the pixel circuit 900 .
  • the read circuit reads at least one data signal from the pixel array circuit in a first event representation.
  • the readout circuit can be understood with reference to readout circuit 905.
  • the first event representation method is to represent the event through polarity information
  • the pixel array circuit includes a plurality of pixels, each pixel includes a threshold value comparison unit, and the threshold value comparison unit is used for the light intensity transformation amount exceeding a predetermined threshold value
  • the polarity information is output, and the polarity information is used to indicate whether the light intensity change is increased or decreased.
  • the reading circuit is specifically used for reading the polarity information output by the threshold comparison unit.
  • the first event representation method is to represent the event by light intensity information
  • the pixel array includes a plurality of pixels, each pixel includes a threshold value comparison unit, a readout control unit and a light intensity collection unit,
  • the light intensity detection unit is used for outputting an electrical signal corresponding to the light signal irradiated on it, and the electrical signal is used to indicate the light intensity.
  • the threshold value comparison unit is configured to output a first signal when it is determined according to the electrical signal that the light intensity transformation amount exceeds a predetermined threshold value.
  • the readout control unit is configured to, in response to receiving the first signal, instruct the light intensity collection unit to collect and buffer the electrical signal corresponding to the moment of receiving the first signal.
  • the reading circuit is specifically used to read the electrical signal buffered by the light intensity collection unit.
  • the light intensity detection unit can be understood with reference to the light intensity detection unit 901
  • the threshold comparison unit can be understood with reference to the threshold comparison unit 902
  • the readout control unit can be understood with reference to the readout control unit 903
  • the light intensity collection unit can be understood with reference to the light intensity
  • the acquisition unit 904 comprehends.
  • the reading circuit is also used for providing at least one data signal to the control circuit.
  • the control circuit can be understood with reference to the control circuit 906 .
  • the read circuit is configured to switch to read the at least one data signal from the pixel array circuit in a second event representation manner when receiving the conversion signal generated based on the at least one data signal from the control circuit.
  • control circuit is further configured to determine statistical data based on the at least one data signal received from the read circuit. If it is determined that the statistical data satisfies a predetermined switching condition, a switching signal is sent to the reading circuit, and the predetermined switching condition is determined based on the preset bandwidth of the vision sensor chip.
  • the predetermined conversion condition is that if the second event representation method is used to represent the event from the pixel array circuit Read at least one data signal, and the total amount of data read is not greater than the preset bandwidth, or the predetermined conversion condition is that the number of at least one data signal is not greater than the ratio of the preset bandwidth and the first bit, and the first bit is the data of the data signal. format preset bits.
  • the predetermined conversion condition is to read the event from the pixel array circuit by the first event representation.
  • the taken total data amount is greater than the preset bandwidth, or the predetermined conversion condition is that the number of at least one data signal is greater than the ratio of the preset bandwidth and the first bit, where the first bit is a preset bit of the data format of the data signal.
  • the visual sensor can perform historical data statistics on events to predict the possible event generation rate in the next time period, so events that are more suitable for application scenarios and motion states can be selected. way of representation.
  • the vision sensor can adaptively switch between the two event representation modes, so that the read data rate always keeps not exceeding the predetermined read data rate threshold, thereby reducing the data transmission, parsing and storage of the vision sensor.
  • the performance of the sensor is significantly improved.
  • such a visual sensor can perform data statistics on events generated in a period of time to predict the possible rate of event generation in the next period of time, so it is possible to select a reading that is more suitable for the current external environment, application scenario and motion state. model.
  • the visual sensor can adaptively switch between two event representation modes, wherein the two event representation modes include an event represented by polarity information and an event represented by light intensity information.
  • the adaptive event representation method provided by this application the relationship between the data amount of the event represented by the light intensity information and the bandwidth is compared, so as to adjust the representation accuracy of the event, and on the premise of satisfying the bandwidth limitation, the Events are transmitted, all events are transmitted with as much representational precision as possible.
  • the visual sensor can adaptively switch between multiple event representation modes, so as to better achieve the purpose of transmitting all events with greater representation accuracy, which will be described below with reference to some specific embodiments. .
  • FIG. 21 shows a schematic diagram of a pixel circuit 1900 provided by the present application.
  • Each of the pixel array circuit 210, the pixel array circuit 310, and the pixel array circuit 710 may include one or more pixel arrays, and each pixel array includes a plurality of pixels, and each pixel may be regarded as a pixel circuit , each pixel circuit is used to generate a data signal corresponding to the pixel.
  • FIG. 21 it is a schematic diagram of another preferred pixel circuit provided by the embodiment of the present application. In this application, a pixel circuit is sometimes referred to simply as a pixel.
  • a preferred pixel circuit in this application includes a light intensity detection unit 1901 , a threshold value comparison unit 1902 , a readout control unit 1903 and a light intensity collection unit 1904 .
  • the light intensity detection unit 1901 is configured to convert the obtained light signal into a first electrical signal.
  • the light intensity detection unit 1901 can be understood with reference to the light intensity detection unit 901 in the embodiment corresponding to FIG. 11 , and details are not repeated here.
  • Threshold comparison unit 1902 configured to determine whether the first electrical signal is greater than the first target threshold, or whether the first electrical signal is less than the second target threshold, the first electrical signal is greater than the first target threshold, or the first electrical signal is less than the second target
  • the threshold comparison unit 1902 outputs a first data signal, where the first data signal is used to indicate that the pixel has a light intensity change event.
  • the threshold value comparison unit 1902 is configured to compare whether the difference between the current light intensity and the light intensity when the last event occurred exceeds a predetermined threshold, which can be understood with reference to Formula 1-1.
  • the first target threshold may be understood as the sum of the first predetermined threshold and the second electrical signal
  • the second target threshold may be understood as the sum of the second predetermined threshold and the second electrical signal.
  • the second electrical signal is the electrical signal output by the intensity detection unit 901 when the last event occurred.
  • the threshold comparison unit in the embodiment of the present application may be implemented in a hardware manner, or may be implemented in a software manner, which is not limited in the embodiment of the present application.
  • the readout control unit 1903 controls the light intensity collection unit 904 to collect the first electrical signal when the first data signal is obtained.
  • the readout control unit 1903 is also used to notify the readout circuit 1905 to read the data signal output by the pixel circuit.
  • the readout circuit 1905 may be configured to scan the pixels in the pixel array circuit in a predetermined order to read data signals generated by the corresponding pixels.
  • the read circuit 905 can be understood with reference to the read circuit 220, the read circuit 320, the read circuit 720, that is, the read circuit 905 is configured to be capable of reading in more than one signal reading mode Read the data signal output by the pixel circuit.
  • the reading circuit 1905 may perform reading in one of a first reading mode and a second reading mode, respectively corresponding to frame scan-based reading One of the fetch mode and event stream-based read mode.
  • the read circuit 1905 can also read the data signal output by the pixel circuit in only one signal read mode, for example, the read circuit 1905 is configured to read only in the frame scan-based read mode The data signal output by the pixel circuit is read, or the read circuit 1905 is configured to read the data signal output by the pixel circuit only in the event stream based read mode.
  • the first encoding unit 1907 is configured to perform encoding processing on the first electrical signal buffered by the light intensity collection unit 1904 according to the currently obtained bit width.
  • the reading circuit 1905 is also used for reading the data signal encoded by the first encoding unit 1907 . How the first encoding unit 1907 encodes the first electrical signal according to the acquired bit width requires the control circuit 1906 to control it, which will be described in detail below.
  • the read circuit 1905 may be configured to provide the read at least one data signal to the control circuit 1906 .
  • the control circuit 1906 can control the first encoding unit 1907 to encode the event with a certain bit width according to the data signal obtained from the reading circuit 1905 .
  • the reading circuit 1905 can provide the control circuit 1906 with a data signal read within a period of time for the control circuit 1906 to infer, and instruct the first encoding unit 1902 to use a certain bit width to encode the event.
  • the control circuit 1906 may acquire at least one data signal from the reading circuit 1905, and determine whether the encoding method currently used by the first encoding unit 1907 is suitable for the current application scenario and based on at least the at least one data signal. motion state, and then adjust the encoding method of the first encoding unit 1907.
  • the first encoding unit 1907 can also directly interact with the control circuit 1906 without going through the reading circuit, for example, the first encoding unit sends the encoded data signal to the control circuit 1906, and the control circuit 1906 Based on the received encoded data signal, it is determined whether the encoding method currently adopted by the first encoding unit 1907 is suitable for the current application scene and motion state, and then the encoding method of the first encoding unit 1907 is adjusted.
  • the data provided by the read circuit 1905 to the control circuit 1906 is the number of events (light intensity transition events) N ev measured by the pixel array circuit per unit time.
  • the currently used bit width representing the light intensity feature information is H 1
  • the control circuit 1906 controls the first encoding unit 1907 to currently use H 1 bits to encode the light intensity feature information of each event (hereinafter referred to as Encoding each event)
  • the control circuit 1906 determines to reduce the bit width of the light intensity characteristic information.
  • the bit width of the light intensity feature information calculated by the control circuit is H 2
  • the data provided by the read circuit 1905 to the control circuit 1906 may be the total data amount of the number of events (light intensity transition events) measured by the pixel array circuit per unit time. For example, assuming that the currently used bit width of the light intensity characteristic information is H 1 , the total data amount of the number of events measured by the pixel array circuit per unit time provided by the read circuit 1905 to the control circuit 1906 is N ev ⁇ H 1 .
  • the bit width of the light intensity feature information is fixed.
  • the present application also provides a solution that dynamically adjusts Compared with Figure 11 to Figure 20, there are only two event representations for the bit width of the light intensity characteristic information.
  • the scheme of dynamically adjusting the bit width of the light intensity characteristic information can meet the bandwidth limitation and be able to use a larger
  • the representation precision transmits all events.
  • the scheme of dynamically adjusting the bit width of the light intensity characteristic information when the amount of data that the vision sensor needs to transmit in a period of time (such as a unit time) exceeds the bandwidth, the bit width of the light intensity characteristic information is reduced, that is, the event representation is reduced.
  • the event is encoded with the bit width of the light intensity characteristic information satisfying the bandwidth limitation (specifically, the light intensity characteristic information of the event is encoded).
  • the bit width of the light intensity characteristic information satisfying the bandwidth limitation (also referred to as the bit width, or the bit width representing the light intensity characteristic information) can be determined in various ways, which will be described below with reference to several preferred embodiments.
  • the optimal bit width representing the light intensity characteristic information may be determined in a manner of decreasing the bit width.
  • the first encoding unit 1907 can first encode an event according to the maximum bit width B, and the control circuit 1906 calculates the rate of event generation according to the data provided by the reading circuit 1905 per unit time Whether it exceeds the bandwidth limit, if it exceeds the bandwidth, gradually reduce the quantization accuracy, that is, gradually reduce the bit width of the light intensity characteristic information, for example, adjust the bit width representing the light intensity characteristic information to be (B-1), and determine the bit width to be (B- 1), whether the rate of event generation exceeds the bandwidth, whether the rate of event generation exceeds the bandwidth when the bit width is (B-2), whether the rate of event generation exceeds the bandwidth when the bit width is (B-n), and n is a positive integer.
  • the control circuit 1906 compares the adjusted estimated event occurrence rate with the bandwidth; if the bandwidth limit is satisfied (that is, not greater than the bandwidth), the first encoding unit 1907 is controlled to use the current bit width of this level to encode the event, For example, when it is determined that the bit width representing the light intensity characteristic information is (B-1), the rate of event generation does not exceed the bandwidth limit, that is, (B-1) is used to encode the event.
  • the maximum bit width B is 12 bits, that is, it is pre-specified that only 12 bits can be used to encode one event.
  • the bandwidth is limited to 3000bps (the maximum allowable transmission of 3000 bits per second), that is, the preset maximum bandwidth is 3000bps, assuming In the actual scenario, 100 events are generated in the 1st second, 300 events in the 2nd second, 400 events in the 3rd second, and 180 events in the 4th second.
  • the first second 100 events are transmitted, 0 events are lost, the event loss rate is 0, and the vision sensor transmits a total of 1200 bits.
  • Second second 250 events are transmitted, 50 events are lost, the event loss rate is 16.7%, and the vision sensor transmits a total of 3000 bits.
  • 3rd second 250 events are transmitted, 150 events are lost, the event loss rate is 37.5%, and the vision sensor transmits a total of 3000 bits.
  • the 4th second 180 events are transmitted, 0 events are lost, the event loss rate is 0, and the vision sensor transmits a total of 2160 bits.
  • the above scheme loses 200 events and transmits a total of 9360 bits, with a loss rate of 20.4%.
  • the parameter s represents the number of events encoded by s bits
  • the parameter i represents the bit width of the light intensity feature information represented by i-bit encoding. Since the maximum bit width B is 12 bits, the bit width only needs to be Bits can be represented, here Indicates that it is rounded up, that is, i can be up to 4. In addition, it is assumed here that s is 32, that is, the number of events is encoded by 32 bits.
  • the scheme of dynamically adjusting the light intensity characteristic information provided by this application can reduce the event loss rate:
  • the control circuit controls the first coding unit to use 9 bits to encode an event.
  • the 3rd second first calculate the event generation rate 400 ⁇ 12>3000 according to the maximum bit width of 12 bits, which exceeds the bandwidth limit; then decrease the bit width and use 11 bits to calculate the event generation rate of 400 ⁇ 11>3000, which still exceeds the bandwidth limit; then use 10 bits to calculate the event generation rate of 400 ⁇ 10>3000, which still exceeds the bandwidth limit, then use 9 bits to calculate the event generation rate of 400 ⁇ 9>3000, still exceeding the bandwidth limit, then use 8 bits to calculate the event
  • the control circuit controls the first coding unit to use 7 bits to encode an event.
  • the control circuit calculates the rate of event generation with the maximum bit width every second.
  • the maximum bit width is decreased to meet the bandwidth limit. All events are transmitted with maximum representation accuracy provided that events are lost.
  • the current bit width can be used to calculate the rate of event generation every second, and when the bandwidth limit is not met, the current bit width is decremented to meet the bandwidth limit, and when the bandwidth limit is met, it can be Under the conditions, the bandwidth is increased to realize the transmission of all events with the maximum representation precision, and the following description will be continued with the above examples.
  • the control circuit controls the first coding unit to use 9 bits to encode an event.
  • the 4th second First calculate the rate of event generation according to the current bit width, that is, calculate the rate of event generation according to 7 bits 180 ⁇ 7 ⁇ 3000, and considering that the number of events 32 bits and the bit width size of 4 bits need to be transmitted, generally still not enough If the bandwidth limit is exceeded, increase the bit width, and use 8 bits to calculate the event generation rate of 180 ⁇ 8 ⁇ 3000.
  • the bandwidth limit is not exceeded, continue to increase the bit width, and use 9 bits to calculate the event generation rate of 180 ⁇ 9 ⁇ 3000, generally still not ultra-wide bandwidth limit, continue to increase bit width, use 10 bits to calculate the rate of event generation 180 ⁇ 10 ⁇ 3000, generally still not ultra-wide bandwidth limit, continue to increase bit width, use 11 bits
  • bit width of the feature information is described below with reference to several preferred embodiments.
  • a binary search method can also be used to determine the bit width representing light intensity feature information that satisfies the bandwidth limitation. For example, taking 400 events generated in the third second as an example, firstly, 12 bits are used for one event. For encoding, the control circuit determines that the rate of event generation is 400 ⁇ 12>3000; then calculates the rate of event generation 400 ⁇ 6 ⁇ 3000 according to half of 12 bits, that is, 6 bits, which exceeds the bandwidth limit; then calculate the rate of 12 bits and 6 bits.
  • the midpoint that is, the rate of event generation when 9 bits is 400 ⁇ 9>3000, still exceeds the bandwidth limit; then calculate the midpoint of 9 bits and 6 bits, that is, the rate of event generation when 8 bits is 400 ⁇ 8>3000, still Exceed the bandwidth limit; calculate the midpoint between 8 bits and 6 bits, that is, the rate of event generation at 7 bits is 400 ⁇ 7 ⁇ 3000, which is less than the bandwidth limit; since the rate of events at 8 bits exceeds the bandwidth limit, 6 bits and The rate of event generation at 7 bits does not exceed the bandwidth limit, so 7 bits with higher quantization precision are used to encode events.
  • the above process only needs to go through 5 comparisons, and the algorithm complexity is O(logB).
  • an approximate value estimation method can also be used to determine the bit width representing light intensity characteristic information that satisfies the bandwidth limitation. For example, in the third second, a total of 400 events are generated, then according to the bandwidth limitation of 3000bps, it can be roughly It is calculated that the bit width of each event cannot exceed bit, here Indicates rounded down. Then the control circuit controls the first coding unit to use 7 bits to encode an event.
  • the event generation rate when the event generation rate is small and the bandwidth limit has not been reached, the event is quantized according to the maximum bit width, and the event is encoded.
  • the event generation rate is large, the event is gradually reduced
  • the bit width representing the light intensity feature information is to satisfy the bandwidth limitation. After that, if the rate of event generation becomes smaller again, the bit width representing the light intensity feature information can be increased under the premise of not exceeding the bandwidth limit.
  • the pixel array can also be divided into regions, and different weights can be used to set the maximum bit width of different regions to adapt to different regions of interest in the scene. Weight, so that the region including the target object corresponds to the output event with higher representation accuracy, setting a smaller weight in the background region makes the background region corresponding to the output event with lower representation accuracy, which is described below in conjunction with specific embodiments.
  • FIG. 23 it is a block diagram of another visual sensor provided by the present application.
  • the pixel array circuit is divided into regions, and different regions adopt different coding methods, that is, the representation precision of events output by different regions is different.
  • two pixel circuits are used as an example for description.
  • pixel circuit 1900 is a pixel circuit in a first area of pixel array circuits of the vision sensor
  • pixel circuit 2100 is a pixel circuit in a second area of pixel array circuits.
  • the first area and the second area are two different areas in the pixel array circuit, and the representation precision of the time output by the first area and the second area is different.
  • the reading circuit 2105 can be used to read the data signal generated by the pixel circuit 1900 and the data signal generated by the pixel circuit 2100, respectively, and transmit the encoded data signal output by the first encoding unit 1907 to the control circuit 2106, and the second encoding The encoded data signal output by the unit 2107 is transmitted to the control circuit 2106 .
  • the control circuit 2106 can respectively control the number of bits used by the first encoding unit 1907 to encode the event according to the data transmitted by the reading circuit, and the number of bits used by the second encoding unit 2107 to encode the event, that is, the control circuit 2106 can control the pixels respectively.
  • Circuit 1900 and pixel circuit 2100 output the representation precision of the event.
  • the light intensity detection unit 2101, the threshold value comparison unit 2102, the reading control unit 2103, the light intensity acquisition unit 2104 and the second encoding unit 2107 can refer to the light intensity detection unit 1901, the threshold value comparison unit 1902, the reading control unit 1903, the light intensity respectively
  • the acquisition unit 1904 and the first encoding unit 1907 can understand, and details are not repeated here.
  • FIG. 24 it is a schematic diagram of region division of the pixel array.
  • the pixel array circuit is divided into 6 areas, namely A area, B area, C area, D area, E area and F area.
  • Different weights can be set for different regions. For example, a larger weight can be set for the region that may include the target object, and a smaller weight is set for the background region.
  • the D region, the E region and the F region are set Set a larger weight, and set a smaller weight for the A area, B area, and C area.
  • the weight of the A area is 0.05
  • the weight of the B area is 0.1
  • the weight of the C area is 0.05
  • the weight of the D area is 0.2
  • the weight of E area is 0.4
  • the weight of F area is 0.2.
  • the maximum bit width is 12 bits
  • the E region with the largest weight is set to have a maximum bit width of 12 bits.
  • the maximum bit width set in the A region is 2 bits
  • the maximum bit width set in the B region is 2 bits.
  • the bit width is 3 bits
  • the maximum bit width set in the C region is 2 bits
  • the maximum bit width set in the D region is 6 bits
  • the maximum bit width set in the F region is 6 bits.
  • the pixel array is divided into 6 regions, and the weights set in each region are for illustration purposes and do not represent a limitation on the solution. Different regions set different maximum bit widths.
  • the way the control circuit determines the optimal bit width corresponding to each region is the same as the above-mentioned control circuit determines the optimal bit width corresponding to the pixel circuit 1900 . Exemplarily, further explanation is given below in a manner of decreasing bit width.
  • the total number of bits transmitted in 1 second is 2736 bits. If compared with the original data, that is, ignoring event loss, each event is encoded with 12 bits, and this solution can save 50.4% of the data volume.
  • FIG. 25 shows a block diagram of a control circuit of a possible embodiment of the present application.
  • the control circuit can be used to implement the control circuit 1906 in FIG. 21 , FIG. 23 , etc.
  • the control circuit includes at least one processor 2301 , at least one memory 2302 coupled to the processor 2301 , and a Communication Mechanism 2303.
  • the memory 2302 is used to store at least the computer program and the data signals obtained from the reading circuit.
  • the control circuit may be communicatively coupled to the reading circuit 2105 of the vision sensor as in Figs. 21, 23 or a reading circuit external to the vision sensor, the first encoding unit 1907, the second encoding unit 2109, through the communication mechanism 2303 to communicate with them. Realize the control function.
  • the processor reads the computer program stored in the memory 2302, it executes the actions performed by the control circuit described in the above-described FIGS. 21 to 24.
  • control circuit shown in FIG. 25 may further include a preconfigured statistical model 231 and a strategy module 232 .
  • Historical statistics are performed on the light intensity change events generated by the pixel array circuit provided by the reading circuit 2105 within a period of time (eg, a unit time).
  • the statistical model 231 may then transmit the statistical data to the policy module 232 .
  • Statistics can indicate the number of light intensity change events or the total amount of data for light intensity change events.
  • the processor may include multiple statistical models, and policy modules corresponding to the multiple statistical models.
  • the control circuit shown in FIG. 25 can be combined with the control circuit shown in FIG. 8 .
  • the processor of the control circuit includes statistical model 606 , policy module 608 , statistical model 231 , and policy module 232 .
  • Figure 26 shows a block diagram of an electronic device according to a possible embodiment of the application.
  • the electronic device includes a visual sensor chip 2400 , a control circuit 2401 , and an analysis circuit 2402 .
  • the electronics are used for exemplary purposes and may be implemented using any suitable device, including various sensor devices currently known and developed in the future. Embodiments of the present application may also be embodied in different sensor systems.
  • the electronic device may also include other elements, modules or entities, which are not shown for the purpose of clarity, but does not mean that the embodiments of the present application do not have these elements, modules or entities.
  • Parsing circuitry 2402 may be configured to parse data signals read by read circuitry in vision sensor chip 2400 .
  • the parsing circuit 2402 can parse the data signal transmitted by the vision sensor using a bit width that is compatible with the data format bit width currently adopted by the vision sensor chip 2400 .
  • bit width that is compatible with the data format bit width currently adopted by the vision sensor chip 2400 .
  • the maximum bit width B is 12 bits
  • the bandwidth is limited to 3000bps (the maximum allowable transmission of 3000 bits per second)
  • the number of events is encoded by 32 bits
  • the light intensity characteristic information is represented by 4 bits.
  • Bit wide the vision sensor produced 100 events in the 1st second, 300 events in the 2nd second, 400 events in the 3rd second, and 180 events in the 4th second.
  • 12 bits are used to encode an event in the 1st second
  • 9 bits are used to encode an event in the 2nd second
  • 7 bits are used to encode an event in the 3rd second
  • 12 bits are used to encode an event in the 4th second.
  • the data output by the vision sensor chip may be a binary data stream, and the binary data stream may include three parts, which are respectively used to represent the number of events, the bit width, and each encoded event.
  • Figure 27 it is a schematic diagram of a binary data stream.
  • the first s bits of the binary data stream output by the vision sensor chip are used to indicate the number of events. For example, in the previous example, if s is 32, the parsing circuit can read The first 32 bits of the binary data stream are used to parse out the number of events. By parsing the first 32 bits of the binary data stream corresponding to the first second, the number of events in the first second can be parsed as 100, and then i bits are parsed to obtain Indicates the bit width of the light intensity feature information.
  • s is 4.
  • the width is 12 bits, that is, 1 event is represented by 12 bits in the first second, and then 100 events are sequentially parsed according to 12 bits according to the binary data stream corresponding to the first second.
  • the number of events in the second second can be parsed as 300, and then 4 bits are read to parse the bit width as 9. bits, and then parsed out 300 events in sequence according to 9 bits.
  • the number of events in the 3rd second can be parsed as 400, and then 4 bits are read to parse the bit width as 7 bits, and then the 7 bits are parsed in sequence out 400 events.
  • the number of events in the 4th second can be parsed as 180, and then 4 bits are read to parse the bit width as 12 bits, and then parsed out according to the 12 bits. 180 events.
  • each event is represented as ⁇ x, y, t, m>
  • (x, y) represents the pixel position where the event is generated
  • t represents the generated event.
  • the time of the event, m represents the characteristic information of the light intensity. It is assumed that x is represented by b x bits, y is represented by b y bits, t is represented by b t bits, and m is the bit width representing light intensity feature information.
  • the first b x bits that can be parsed out indicate the coordinate x of the pixel
  • the next b y bits indicate the coordinate y of the pixel
  • the following b t bits indicate the reading time
  • the parsing The s bits represent the number of events
  • the i bits represent the bit width representing the light intensity feature information
  • the event is parsed according to the bit width indicated by the i bits, and the feature information of the light intensity of the event is specifically parsed.
  • a bit-width analysis data signal representing light intensity characteristic information corresponding to the region is used respectively.
  • the parsing circuit reads 32 bits to parse the number of events as 50, then reads 4 bits to parse the bit width to 2, and then parses 50 events in sequence according to 2 bits for each event.
  • area B read 32 bits to parse out the number of events as 80, then read 4 bits to parse out the bit width size of 3, and then parse out 80 events with 3 bits per event in turn.
  • region C read 32 bits to parse out the number of events as 60, read 4 bits to parse out the bit width size of 1, and then parse out 60 events by 1 bit per event.
  • area D read 32 bits to resolve the number of events as 90, then read 4 bits to resolve the bit width size to 6, and then analyze 90 events in sequence with 6 bits per event.
  • area E read and read 32 bits to resolve the number of events as 100, then read 4 bits to resolve the bit width size to be 11, and then resolve 100 events in sequence with 11 bits of each event.
  • the parsing circuit 2400 may use the same control strategy as that in the vision sensor chip 2400 to determine an parsing mode suitable for the current event representation of the reading circuit.
  • the vision sensor chip 2400 initially represents an event by R bits
  • the parsing circuit parses the event accordingly based on the number of bits associated with the representation (such as R bits in the initial state).
  • the sensor adjusts the event representation mode according to the amount of data to be transmitted and the preset maximum bandwidth of the vision sensor, and the parsing circuit 2400 adopts the same adjustment strategy as the vision sensor to determine to parse the event through the associated number of bits.
  • Embodiments of the present application also provide a method for operating a visual sensor chip.
  • FIG. 28 it is a flowchart of a method for operating a vision sensor chip according to a possible embodiment of the present application, which may include the following steps:
  • the pixel array circuit generates at least one data signal corresponding to a pixel in the pixel array circuit by measuring the amount of light intensity change, the at least one data signal indicating a light intensity change event, and the light intensity change event indicates that the corresponding pixel in the pixel array circuit measures the The amount of light intensity change exceeds a predetermined threshold.
  • Step 2601 can be understood with reference to step 1801 in the embodiment corresponding to FIG. 20 , and details are not repeated here.
  • 2602. Encode at least one data signal according to the first bit to obtain first encoded data.
  • the first encoding unit encodes the at least one data signal according to the first bits to obtain first encoded data.
  • the first coding unit can be understood with reference to the steps performed by the first coding unit 1907 in FIG. 21 .
  • the first encoding unit When the first encoding unit receives the first control signal from the control circuit, it encodes at least one data signal according to the second bit indicated by the first control signal, and the first control signal is determined by the control circuit according to the first encoded data.
  • the first coding unit can be understood with reference to the steps performed by the first coding unit 1907 in FIG. 21 .
  • control signal is determined by the control circuit according to the first encoded data and the bandwidth preset by the vision sensor chip.
  • the second bit indicated by the control signal when the data amount of the first encoded data is not less than the bandwidth, the second bit indicated by the control signal is smaller than the first bit, so that the total data amount of at least one data signal encoded by the second bit is not greater than bandwidth.
  • the second bit indicated by the control signal is larger than the first bit, and the total data amount of at least one data signal encoded by the second bit is not larger than the bandwidth .
  • the pixel array includes Y regions, at least two regions in the Y regions have different maximum bits, and the maximum bits represent the preset generated for one of the regions.
  • the largest bit for encoding at least one data signal the first encoding unit is specifically configured to encode the at least one data signal generated in the first region according to the first bit to obtain first encoded data, The first bit is not greater than the maximum bit of the first area, and the first area is any one of the Y areas; the first encoding unit is specifically used for receiving from the control circuit When the first control signal is used, the at least one data signal generated in the first region is encoded according to the second bit indicated by the first control signal, and the first control signal is the control circuit according to the determined by the first encoded data.
  • control circuit is further configured to: determine that the total data amount of the at least one data signal encoded by the third bit is greater than one bit, and the total data amount of the at least one data signal encoded by the second bit is not greater than
  • the first control signal is sent to the first coding unit, and the difference between the third bit and the second bit is 1 bit unit. This ensures that events are encoded in larger bits and all events are transmitted as much as possible while meeting bandwidth constraints.
  • the scheme introduced above adjusts the precision of event representation, and transmits all events with greater representation precision under the condition of meeting the bandwidth limitation.
  • reducing the precision of event representation that is, reducing the bit width of representing the event
  • the preset maximum bandwidth of the vision sensor is certain, the event data may not be read out, resulting in data loss.
  • an embodiment of the present application further provides a visual sensor, which will be described in detail below.
  • FIG. 29-a for a block diagram of another vision sensor provided by the present application.
  • the vision sensor in the present application can be implemented as a vision sensor chip, which will not be repeated herein.
  • the vision sensor includes a pixel array circuit 2701 and a readout circuit 2702.
  • the reading circuit 2702 can read the data signal output by the pixel array circuit 2701, and transmit the data signal to the third encoding unit 2703 for the third encoding unit 2703 to encode the acquired data signal.
  • the third encoding unit 2703 How the 2703 encodes the acquired data signal will be described below.
  • the data signal encoded by the third code 2703 can be read to the outside of the vision sensor.
  • the third encoding unit 2703 may be arranged inside the visual sensor, refer to FIG. 29-b, which is a block diagram of another visual sensor provided in this embodiment of the application, as shown in FIG. 29-b,
  • the visual sensor 2800 further includes a third encoding unit 2703, where the third encoding unit 2703 may be implemented by software or hardware, which is not limited in this embodiment of the present application.
  • the vision sensor may further include a control circuit.
  • the vision sensor 2900 further includes Control circuit 2704, which may be configured to control the mode in which the read circuit 2704 reads the data signal.
  • the reading circuit 905 may perform reading in one of a first reading mode and a second reading mode, respectively corresponding to frame scan-based reading One of the fetch mode and event stream-based read mode.
  • the control circuit 2704 may not be configured inside the visual sensor.
  • the reading circuit 2704 may only read the data output by the pixel circuit in one signal reading mode. Signals, such as the read circuit 2704 is configured to read data signals output by the pixel circuit only in a frame scan based read mode, or the read circuit 2704 is configured to read pixels only in an event stream based read mode circuit output data signal.
  • each pixel array circuit can include one or more pixel arrays, and each pixel array includes a plurality of pixels, each pixel can be regarded as a pixel circuit, and each pixel circuit is used to generate a corresponding data signal.
  • FIG. 30 is a schematic diagram of another preferred pixel circuit according to an embodiment of the present application.
  • the pixel circuit 3000 includes a light intensity detection unit 3001 , a threshold value comparison unit 3002 , a readout control unit 3003 , and a light intensity collection unit 3004 .
  • the light intensity collection unit 3001 is used to convert the obtained light signal into an electrical signal.
  • the light intensity detection unit 3001 can be understood with reference to the light intensity detection unit 901 in the embodiment corresponding to FIG. 11 , and details are not repeated here.
  • the threshold comparison unit 3002 is configured to determine whether the first electrical signal is greater than the first target threshold, or whether the first electrical signal is less than the second target threshold.
  • the first electrical signal is the electrical signal currently output by the light intensity collection unit.
  • the threshold comparison unit 3002 outputs polarity information, the polarity information It is used to indicate whether the light intensity transformation is enhanced or weakened, for example, the polarity information can be +1 or -1, +1 is used to indicate that the light intensity is enhanced, and -1 is used to indicate that the light intensity is weakened.
  • the threshold value comparison unit 3002 is used to compare whether the difference between the current light intensity and the light intensity when the last event occurred exceeds a predetermined threshold, which can be understood with reference to Formula 1-1.
  • the first target threshold may be understood as the sum of the first predetermined threshold and the second electrical signal
  • the second target threshold may be understood as the sum of the second predetermined threshold and the second electrical signal.
  • the second electrical signal is the electrical signal output by the intensity detection unit 3001 when the last event occurred.
  • the threshold comparison unit in this embodiment of the present application may be implemented in a hardware manner, or may be implemented in a software manner.
  • the readout control unit 3003 When the readout control unit 3003 obtains the polarity information, it controls the light intensity collection unit 3004 to collect the first electrical signal.
  • the readout control unit 3003 is further configured to notify the readout circuit to read the first electrical signal stored in the light intensity collection unit 3004 . And notify the read circuit 3005 to read the polarity information output by the threshold value comparison unit 3002 .
  • the readout circuit 3005 may be configured to scan the pixels in the pixel array circuit in a predetermined order to read data signals generated by the corresponding pixels.
  • read circuit 3005 can be understood with reference to read circuit 220, read circuit 320, read circuit 720, ie read circuit 905 is configured to be capable of reading in more than one signal read mode Read the data signal output by the pixel circuit.
  • the reading circuit 3005 may perform reading in one of a first reading mode and a second reading mode, respectively corresponding to frame scan-based reading One of the fetch mode and event stream-based read mode.
  • the read circuit 905 can also read the data signal output by the pixel circuit only in one signal read mode, for example, the read circuit 3005 is configured to read only in the frame scan-based read mode The data signal output by the pixel circuit is read, or the read circuit 3005 is configured to read the data signal output by the pixel circuit only in an event stream based read mode.
  • the third encoding unit 3007 encodes the polarity information and the difference value between the light intensity variation and a predetermined threshold according to the data signal obtained from the reading circuit 3005 .
  • the working principle of the bionic vision sensor has been introduced above. Taking DVS as an example, by comparing the current light intensity with the light intensity at the time of the previous event, when the change amount reaches the predetermined firing threshold C, an event is generated and output. That is, the DVS will generate an event when the difference between the current light intensity and the light intensity when the last event is generated exceeds a predetermined threshold value C.
  • the present application fully considers the working principle of the bionic vision sensor, and uses a predetermined threshold to reduce the cost of event representation. The principle of the light intensity information is described below.
  • the absolute light intensity L is encoded in the initial state (that is, when the event is read out for the first time). After that, if a new event occurs, it is only necessary to encode the light intensity change amount and a predetermined threshold.
  • the difference value between K and the polarity information The principle is that the condition for a new event is that the light intensity change at the current moment compared with the light intensity of the previous event reaches a predetermined threshold. Considering possible delays and noise effects, the light intensity change is not exactly equal to the predetermined threshold, but Its difference value should fluctuate around 0; therefore, encoding and delivering this difference value will significantly reduce the data representation cost.
  • the third encoding unit 2703 may include a storage module 271 , a comparison module 272 and an encoding module 273 .
  • the storage module 271 can be used to store the data signal obtained from the reading circuit 2702, the data signal can include the polarity information obtained by the reading circuit 2702 from the threshold comparison unit 3002, and the light intensity obtained from the light intensity collection unit 3004 information.
  • the comparison module 272 is used to compare the amount of light intensity change, that is, to compare the difference between the currently acquired light intensity information and the last acquired light intensity information. The difference between them is called the light intensity transformation.
  • the comparison module 272 is further configured to determine the difference between the light intensity transformation amount and a predetermined threshold, wherein the predetermined threshold may be different according to whether the light intensity indicated by the polarity information is increased or decreased.
  • the encoding module 273 encodes the polarity information stored in the storage module. For example, usually 1-2 bits can be used to encode the polarity information.
  • the encoding module 273 is also used to encode the differential value output by the comparison module. This method is hereinafter referred to as The encoding method is differential encoding.
  • the number of bits for encoding the differential value can be determined according to a predetermined threshold. For example, if the predetermined threshold is 30, then theoretically the differential value should not be greater than the predetermined threshold of 30. Therefore, the maximum number of bits required for the differential value is bits.
  • the difference value may still be greater than the predetermined threshold, and the remaining difference value (difference between the difference value and the predetermined threshold) may continue to be encoded until the remaining difference value is not greater than the predetermined threshold.
  • the first difference value may be encoded as the second difference value and the predetermined threshold, and the second difference value is the first difference value and the predetermined threshold.
  • the difference between the thresholds, the absolute light intensity information is represented by the second difference value and two predetermined thresholds, that is, the second difference value is encoded, and the predetermined threshold is encoded twice to obtain the encoded absolute light intensity. information.
  • FIG. 32 In order to better understand the process of encoding the difference value in the embodiment of the present application, refer to FIG. 32 below, and describe with a specific example:
  • the absolute light intensity information is represented by 10 bits
  • the maximum bit width representing light intensity feature information is 10 bits
  • the predetermined threshold is 30.
  • the difference value should be less than or equal to the event emission threshold of 30.
  • the absolute light intensities of the 10 events to be transmitted are ⁇ 80, 112, 150, 100, 65 , 24, 81, 123, 170, 211 ⁇ , then in the initial state, the event is coded according to the maximum bit width, and the absolute light intensity of the first event is 80 coded according to 10 bits.
  • the polarity information is encoded in 1 bit, and the difference between the light intensity change and the firing threshold 30 is encoded in 5 bits.
  • the second event its light intensity change compared to the absolute light intensity 80 of the first event is
  • the light intensity change compared to the absolute light intensity 150 of the third event is
  • the light intensity change compared to the absolute light intensity 100 of the fourth event is
  • the light intensity change compared to the absolute light intensity 65 of the fifth event is
  • the seventh event its light intensity change compared to the absolute light intensity 24 of the sixth event is
  • the eighth event its light intensity change compared to the absolute light intensity 81 of the seventh event is
  • the ninth event its light intensity change compared to the absolute light intensity 123 of the eighth event is
  • the light intensity change compared to the absolute light intensity 170 of the ninth event is
  • the first event in the initial state is encoded with 10 bits
  • the subsequent 9 events are encoded with 1 bit for the polarity of the light intensity
  • Existing vision sensors do not consider efficient coding strategies in event transmission and storage.
  • the coordinate information (x, y) of pixels, the time t when the characteristic information of light intensity is read, and the characteristics of light intensity are based on a fixed bit width.
  • the light intensity characteristic information is light intensity information
  • the light intensity information often needs a large number of bits to be represented.
  • the light intensity information of the events before and after has a certain correlation, especially considering that the predetermined threshold is determined, this information can be used to reduce the redundancy of event data and achieve efficient compression.
  • the solution provided by the present application utilizes the above-mentioned data correlation, reduces the correlation through event differential coding, and reduces the amount of data.
  • Specific improvements include that after the initial state is fully encoded, subsequent events only need to encode polarity information and the difference between the light intensity change and a predetermined threshold, which can effectively reduce the amount of encoded data.
  • the full encoding refers to encoding an event by using the maximum bit width predefined by the vision sensor.
  • the decoded polarity information and differential value the light intensity information at the current moment can be reconstructed losslessly.
  • the decoding process will be described below with reference to FIG. 33 .
  • Figure 33 shows a block diagram of an electronic device according to a possible embodiment of the application.
  • the electronic device includes a visual sensor chip 3100 and an analysis circuit 3101 .
  • the electronics are used for exemplary purposes and may be implemented using any suitable device, including various sensor devices currently known and developed in the future. Embodiments of the present application may also be embodied in different sensor systems.
  • the electronic device may also include other elements, modules or entities, which are not shown for the purpose of clarity, but does not mean that the embodiments of the present application do not have these elements, modules or entities.
  • the visual sensor chip 3100 can be understood with reference to the visual sensors described in FIGS. 29-a to 32 , and details are not repeated here.
  • the parsing circuit 3101 may be configured to parse the data signals read by the read circuit in the vision sensor chip 3100 .
  • the parsing circuit 3101 can decode the polarity information and the difference value according to a preset decoding method, so as to obtain the light intensity information at the current moment.
  • the parsing circuit 3101 parses the data signal transmitted by the vision sensor chip, the following description will be given in conjunction with the above example.
  • the parsing circuit 3101 decodes the obtained binary data stream, and for the first event, decodes it according to the maximum bit width to obtain the absolute light intensity at the moment corresponding to the first second. For example, in the previous example, according to The 10 bits decode the absolute light intensity of the first event of 80.
  • the parsing circuit 3101 reads the first 1 bit in the binary data stream, and decodes the 1 bit to obtain the polarity information, which is expressed according to the light intensity information under differential coding.
  • the bit width decodes the difference value. Then, according to the absolute light intensity of the last event of the same pixel and the predetermined threshold, the absolute light intensity at the current moment is reconstructed.
  • the absolute light intensity of the first event, 2 is the difference value, and 30 is the event firing threshold.
  • full encoding may be performed every preset time period to reduce decoding dependence and prevent bit errors.
  • the above example is also used as an example to continue the description.
  • Full encoding it is also necessary to indicate whether the parsing circuit 3101 is currently using full encoding or differential encoding. For example, 2 bits can be used to indicate whether the parsing circuit 3101 is full encoding or differential encoding. For example, when the parsing circuit 3101 decodes +1 and -1 through 2 bits, Make sure to use the decoding method corresponding to the differential encoding for decoding.
  • +1 means that the light intensity is increased
  • -1 means that the light intensity is weakened. If the parsing circuit 3101 parses 0 through 2 bits, it is determined to follow the decoding method corresponding to the full encoding. decoding. An example is given below, the first event uses 10-bit encoding, the second to seventh events use 2-bit encoding for polarity information, and 5-bit encoding is used for the difference value.
  • the differential encoding method is adopted, that is, instead of using 2 bits to encode the polarity information and 5 bits to encode the differential value, full encoding is adopted, that is, 10 bits are used to represent the light intensity information 123 corresponding to the eighth event.
  • the ninth event and the tenth event still use differential coding, wherein the polarity information is coded with 2 bits, and the difference value is coded with 5 bits.
  • the parsing circuit 3101 can determine which decoding method should be used according to the polarity information, and determine which decoding method should be used according to the difference value, the polarity information, the predetermined threshold and the decoded
  • the light intensity at the time of the last event release is used to reconstruct the light intensity at the current moment.
  • the first event decode it according to the maximum bit width of 10 bits to obtain the absolute light intensity at the moment corresponding to the first second. After that, all events first decode the light intensity polarity according to 2 bits. If the light polarity information indicates that differential coding is used, for example, if the polarity information is not 0, the differential value is decoded according to 5 bits. Light intensity information.
  • the difference between the light intensity change and the difference value is not less than 0.
  • full encoding is used, that is, the light intensity change
  • the full quantity coding is used, and when the difference between the light intensity change and the differential value is not less than 0, the differential coding is used.
  • the visual sensor there may be a certain delay in the visual sensor, which may lead to two or more times that the amount of light intensity change is greater than a predetermined threshold before an event is generated.
  • the difference value is greater than or equal to the predetermined threshold value, and the light intensity change amount is at least twice the predetermined threshold value.
  • it can be solved by recursive index coding, which will be described below.
  • the third encoding unit 2703 can first determine whether the difference value exceeds the predetermined threshold, and if the difference value is smaller than the predetermined threshold, then directly encode the difference value according to the above-mentioned difference encoding method, assuming that the difference value is not less than the predetermined threshold value, and the difference value and The difference value of the predetermined threshold value (the first residual difference value) is M1. If the first residual difference value M1 is smaller than the predetermined threshold value, M1 is encoded, and the differential value is encoded. In order to better understand this scheme, the following is an example to illustrate:
  • the initial state for the first event, encodes the absolute light intensity of 80 in 10 bits.
  • the absolute light intensity of the second event is 150.
  • One predetermined threshold value 30 is subtracted from the difference value 40 to the remaining difference value 10, then the one predetermined threshold value 30 is encoded, and the remaining difference value 10 is encoded. That is, the code polarity information +1, the predetermined threshold value of 30, and the residual difference value of 10.
  • the absolute light intensity of the third event is 100.
  • the light intensity change is
  • the example method can save at least 10% of the data volume.
  • the third encoding unit 2703 determines to use full encoding for the event, because if the difference between the first remaining difference value M1 and the predetermined threshold continues to be calculated until the remaining difference value is less than A predetermined threshold, for example, the second residual differential value M2 is smaller than the predetermined threshold, and the differential value is obtained by subtracting n predetermined thresholds M2, then the predetermined threshold is encoded n times to obtain n encoded predetermined thresholds, and M2 is encoded.
  • the cost of event representation may exceed the cost of full encoding, so when the first residual difference value M1 is still greater than the predetermined threshold, the third encoding unit 2703 determines to use full encoding for the event.
  • the light intensity information of the fourth event is 200, compared with the third event, the light intensity change is
  • the code polarity information +1, the first predetermined threshold value of 30, the second predetermined threshold value of 30, and the remaining difference value of 10. Then if the differential encoding method is still used, the total data amount of the above encoding process is 10+(1+5+5)+(1+5)+(1+5+5+5) 43 bits, and the original event data is as follows:
  • the decoding method corresponding to the recursive index coding method is described below.
  • the parsing circuit 3101 decodes the obtained binary data stream, and for the first event, decodes it according to the maximum bit width to obtain the absolute light intensity at the moment corresponding to the first second.
  • the absolute light intensity of the first event is 80.
  • the polarity information is first parsed. For example, the parsing circuit 3101 reads the first 1 bit in the binary data stream, and decodes the 1 bit to obtain the polarity information, which is expressed according to the light intensity information under differential coding.
  • the bit width decodes the difference value. If the decoded difference value is equal to the predetermined threshold, continue decoding according to the bit width indicated by the light intensity information to obtain the remaining difference value.
  • the absolute light intensity of the first event is decoded with 10 bits of 80.
  • Embodiments of the present application also provide a method for operating a visual sensor chip.
  • FIG. 34 it is a flowchart of a method for operating a visual sensor chip according to a possible embodiment of the present application, which may include the following steps:
  • the pixel array circuit generates a plurality of data signals corresponding to the plurality of pixels in the pixel array circuit by measuring the amount of light intensity change, the plurality of data signals indicate at least one light intensity change event, and the at least one light intensity change event represents the pixel array circuit.
  • the measured light intensity variation of the corresponding pixel exceeds a predetermined threshold.
  • the third encoding unit encodes the difference value according to the first preset bit width, where the difference value is the difference between the light intensity transformation amount and a predetermined threshold.
  • the third coding unit can be understood with reference to the third coding unit 2703, and details are not repeated here.
  • the pixel array circuit includes a plurality of pixels, each pixel includes a threshold comparison unit, and the threshold comparison unit is configured to output polarity information when the light intensity transformation amount exceeds a predetermined threshold, and the polarity information is used to indicate The amount of light intensity change is increased or decreased.
  • the third encoding unit is further configured to encode the polarity information according to the second preset bit width.
  • each pixel further includes a light intensity detection unit, a readout control unit, and a light intensity collection unit.
  • the light intensity detection unit is configured to output an electrical signal corresponding to the light signal irradiated thereon, and the electrical Signals are used to indicate light intensity.
  • the threshold value comparison unit is specifically configured to output polarity information when it is determined according to the electrical signal that the light intensity transformation amount exceeds a predetermined threshold value.
  • the readout control unit is used, in response to receiving the polarity signal, to instruct the light intensity collection unit to collect and buffer the electrical signal corresponding to the receiving moment of the polarity information.
  • the third encoding unit is further configured to encode the first electrical signal according to the third preset bit width, where the first electrical signal is the electrical signal collected and buffered by the light intensity collection unit at the time corresponding to the first reception of the polarity information, the first electrical signal is
  • the three preset bit widths are the maximum bit widths preset by the vision sensor to represent the characteristic information of light intensity.
  • the third encoding unit is further configured to: encode the difference value according to a third preset bit width every preset time period.
  • the third encoding unit is specifically configured to: when the difference value is greater than a predetermined threshold, encode the difference value according to the first preset bit width.
  • the third encoding unit is further configured to: when the difference value is not greater than the predetermined threshold value, encode the remaining difference value and the predetermined threshold value according to the first preset bit width, and the remaining difference value is the difference value and difference between predetermined thresholds.
  • the CeleX sensor is an existing visual sensor.
  • the CeleX sensor adopts the asynchronous reading mode, that is, the reading mode based on the event stream is adopted.
  • the events transmitted by the CeleX sensor are represented by light intensity information.
  • the CeleX sensor uses 8-13 bits. Indicates light intensity information, that is, the maximum bit width of light intensity characteristic information is 8-13 bits.
  • the parameters of the CeleX sensor are set to the spatial resolution of 1280 ⁇ 800, the temporal resolution of 14us, the sampling mode of Fixed Event-Intensity Mode, and the maximum bit width representing light intensity feature information is set to 12 bits.
  • the average compression ratio corresponding to 7 sets of data is 1.645.
  • the differential encoding method proposed in this application obtains an average lossless compression ratio of 1.654 times, saving about 41.1% of the data volume;
  • the existing encoding method can only obtain an average compression ratio of 1.306 times (saving about 26.6% of the data volume).
  • the reading circuit outside the vision sensor can read the data signal encoded by the encoding module 273 to the outside of the vision sensor, for example, the vision sensor is assembled in an electronic device, and the electronic device may include a processor and memory, the reading circuit of the electronic device can read the data signal encoded by the third encoding unit 3007 into the processor of the electronic device or the memory.
  • the descriptions about encoding in this article all refer to encoding the characteristic information of light intensity. This application does not limit the encoding or other processing methods of other information lines used to represent an event, such as other information It may include the coordinate information (x, y) of the pixel generating the event, the time t when the characteristic information of the light intensity is read, and the like.
  • the visual sensor provided by the embodiment of the present application has been introduced above.
  • the visual sensor can adaptively switch between multiple data reading modes, so that the read data rate always remains within the predetermined reading rate.
  • Data rate threshold and can also adaptively switch between the two event representations, so that the read data rate always remains within the predetermined read data rate threshold, thereby reducing the cost of data transmission, parsing and storage for vision sensors , significantly improving the performance of the sensor.
  • the vision sensor provided by the present application can also adjust the accuracy of event representation, and transmit all events with greater representation accuracy under the condition that bandwidth constraints are met.
  • the vision sensor provided by the present application can also use the method of encoding the differential value, which reduces the cost of data transmission, parsing and storage of the vision sensor, and at the same time transmits events with the highest precision, and significantly improves the performance of the sensor.
  • the visual sensor provided in this application can be installed on any device that needs to use visual information, for example, the visual sensor provided in this application can be installed in smartphones, televisions, tablet devices, monitoring devices, camera modules, security equipment, etc. .
  • RGB images can be collected by an RGB camera, and the data can be encoded by the aforementioned encoding and decoding methods.
  • the data can be decoded to obtain a usable RGB image.
  • the event image can be collected through DVS, and the event image can be stored in the storage medium through the encoding method provided above.
  • the DVS image can be read through the aforementioned decoding method for subsequent follow-up. deal with.
  • the flow of the method for image optimization provided by the present application is exemplarily described below.
  • the motion sensor can monitor the movement of the target object within a certain range due to the change of the light intensity, which will cause a series of pixels to generate event output, and obtain the event flow within a period of time.
  • the motion information mentioned in the embodiments of the present application means that a motion sensor can be used to monitor the motion of the target object within a preset range to obtain information when the target object moves within the detection range.
  • the way of generating events can be shown in Figure 35.
  • the DVS generates events in response to changes in motion. Since events are not triggered in static areas, most events are generated in areas where there are moving objects. Generally, when the difference between the current light intensity and the light intensity at the time of the previous event generation exceeds a threshold, the DVS will generate an event, such as events N1, N2 and N3 as shown in Figure 3, and the generation of the event is only related to the light intensity. relative changes in .
  • each event can be represented as ⁇ x, y, t, f>, (x, y) represents the pixel position where the event was generated, t represents the time when the event was generated, and f represents the characteristic information of light intensity.
  • f represents the change trend of light intensity, which can also be called polarity, usually represented by 1bit, and the value can be ON/OFF, where ON means light intensity enhancement, OFF means the light intensity is weakened.
  • f represents the absolute light intensity, which is usually represented by multiple bits, such as 9bit representing the light intensity value in the range of 0-511.
  • DVS only generates events when the light intensity change exceeds the threshold, so moving objects can be detected by DVS, while DVS is not sensitive to static areas.
  • the event image may include the image generated by the data collected by the aforementioned motion sensor, specifically including the image generated based on the motion trajectory information of the target object when moving within the monitoring range of the motion sensor, or the event image may be used to identify a segment. Time information when the target object moves within the detection range of the motion sensor.
  • an image composed of data collected by DVS can be expressed as in (x, y) represents the coordinates of a certain position in the image, t represents the time, t 1 is the time when the exposure image is started minus 50 milliseconds (that is, a time window), t 2 is the time when the exposure image starts to be captured, events Represents data collected by motion sensors, such as DVS.
  • the motion information may include information when the target object moves within a preset range.
  • the motion of the target object within the preset range can be monitored by the motion sensor, so as to obtain the motion information of the target object within the preset range.
  • the target object is an object moving within a preset range
  • the number of target objects may be one or more
  • the motion information may include information on the motion trajectory of the target object when it moves within the preset range.
  • the motion information may include information such as the size of the area where the target object is located when the target object moves within the preset range, and the coordinates of the frame or corner points within the preset range.
  • a time window can be generated from the data monitored by DVS, and then the events in the time window can be segmented according to the short-term window, the events in the short-term window can be accumulated, and the motion trajectory obtained after calculating the connected domain. Further, a series of motion trajectories in the time window are analyzed, and the motion characteristics of the moving target object, such as motion direction and motion speed, are obtained by calculating the optical flow or motion vector.
  • the time window may be divided into multiple short-term windows, such as k short-term windows as shown in FIG. 37 .
  • the method of segmentation may be to perform segmentation according to a set duration, or to perform segmentation according to a random duration, or to perform segmentation according to changes in motion trajectories, etc., which can be adjusted according to actual application scenarios.
  • After obtaining k short-term windows analyze the location of the events in each short-term window, and determine the area where the target object is located in each short-term window.
  • the motion area in short-term window 1 is: The motion area 1 shown in FIG. 37
  • the motion area in the short-term window k is the motion area k shown in FIG. 37 .
  • the motion area and motion characteristics of the target area are determined.
  • the motion characteristics included in the motion information may include motion speed or motion direction.
  • the movement speed can be the change trend of the speed of the target object compared to the previous short-term window, including but not limited to speed trend state quantities such as faster and slower, or even more levels of speed trend state quantities, such as fast , faster, very fast, slow, slower, very slow, etc.
  • the movement direction can also be a direction change compared to the previous short-term window, including but not limited to directional trend state quantities such as left, right, upward, downward, unchanged, or even more levels of directional trend state quantities, Such as up left, down left, up right, down right, left, right, up, down, unchanged, etc.
  • RGB image enhancement and reconstruction is to obtain a clearer RGB image or event image, and some possible implementations will be described below.
  • the information collected by the motion sensor can be used for image reconstruction, target detection, shooting moving objects, shooting with moving equipment, shooting deblurring, motion estimation, depth estimation, or target detection and recognition, etc. Therefore, how to Obtaining more accurate motion information has become an urgent problem to be solved.
  • the present application provides an image processing method for updating motion information by using motion parameters to obtain more accurate motion information.
  • the specific flow of the image processing method provided by the present application may include: using a motion sensor to collect motion information when the target object within the detection range moves, and the motion information may be derived from frame-based motion detection or Event-based motion detection, etc., then generate an event image based on the motion information, then calculate motion parameters, the motion parameters include the parameters of the relative motion between the motion sensor and the target object, and then update the event image according to the motion parameters, Get the updated event image.
  • the event image may be updated based on a preset optimization model, for example, the event image is updated with the goal of optimizing the value of the optimization model to obtain an updated event image.
  • the initial value of the optimization model can be determined according to the motion parameters, so that the value of the optimization model can be initialized with the motion information monitored by the motion sensor as the constraint, so that the initial value used when updating the event image can be realized. The value can be more accurate.
  • the method provided by the present application initializes the optimization model based on the obtained motion parameters, which can significantly improve the update speed for the event image, improve the update efficiency of the event image, and It can give a better initialization update direction and improve the optimization effect under the limited number of iterations.
  • iterative updates can usually be performed multiple times, so that the event image finally obtained is better.
  • the motion parameters output during the previous iterative update can be used to perform the current iterative update, thereby avoiding recalculating the motion parameters for each iterative update and improving the update efficiency.
  • Process 1 The process of using the motion parameters to initialize the optimization model
  • FIG. 38 a schematic flowchart of an image processing method provided by the present application.
  • the motion of the target object within the preset range can be monitored by the motion sensor, so as to obtain the motion information of the target object within the preset range.
  • the target object is an object moving within a preset range
  • the number of target objects may be one or more
  • the motion information may include information on the motion trajectory of the target object when it moves within the preset range.
  • the motion information may include information such as the size of the area where the target object is located, and the coordinates of the frame or corner points within the preset range when the target object moves within the preset range.
  • the movement area of the target object when the target object moves within a preset range, the area where the target object is located at each detected moment is referred to as the movement area of the target object.
  • the motion area may include the pedestrian's whole body.
  • the target object may only be the pedestrian's arm, and the motion area may include the pedestrian's entire body. arm part.
  • the preset range is related to the focal length or field angle of the camera.
  • the larger the field of view of the camera the larger the area of the photographed range, and the smaller the field of view of the camera, the smaller the area of the photographed area.
  • the larger the focal length of the camera the farther the shooting range will be. It can also be understood that the objects that are far away are clearer. The smaller the focal length of the camera, the closer the shooting range will be.
  • the range monitored by the motion sensor includes the shooting range of the camera
  • the preset range may be the shooting range of the camera
  • the range monitored by the motion sensor includes the preset range, that is, the range monitored by the motion sensor may be greater than or equal to the preset range.
  • the motion information may include the area where the target object is currently located and the area where the target object is located historically after entering the preset range, and may also include the movement speed or movement direction of the target object.
  • the motion information in this embodiment may be data obtained through the aforementioned data collection and encoding/decoding methods. Decoding process to get usable motion information.
  • At least one frame of event image can be generated from the information collected by the motion sensor within the detection range.
  • the motion information may include information about the trajectory of the target object moving within the detection range for a period of time, so an image corresponding to the detection range is generated, and the trajectory of the target object included in the motion information is mapped to the image to obtain at least one frame. event image.
  • the at least one frame of the event image can be understood as an image representing the movement trajectory of the target object when the target object moves within the detection range.
  • At least one frame of event image mentioned in this application is a multi-frame event image, it may be an event image of the same time window, or may be an event image of different event windows.
  • event image 1 is in the [t1, t2] period
  • event image 2 is the event image in the period [t2, t3].
  • the at least one frame of event images may also be event images of different regions within the same time period.
  • the monitoring area of the DVS may be divided into multiple areas, and corresponding event images may be generated based on events detected in each area.
  • the event image can be directly read in the storage medium, then it is not necessary to perform steps 3801-3802 at this time, and the event image can be directly read from the storage medium.
  • the at least one frame of event images is merely illustrative and not limited in this application.
  • the motion parameter represents the relative motion parameters between the sensor and the target object, such as the motion speed, motion direction, motion acceleration, optical flow information of the target object in the image plane, the depth of the target object from the motion sensor, the motion sensor Acceleration or the angular velocity of the motion sensor, etc., where the optical flow information represents the speed of the relative motion between the motion sensor and the target object.
  • the motion parameters include not only the parameters related to the motion sensor itself, but also the motion speed, motion direction or motion acceleration of the target object, the information collected by the motion sensor can be used. Calculate the motion parameters.
  • the motion parameters include the related parameters of the motion sensor itself, such as optical flow information, the acceleration of the motion sensor, the angular velocity or depth of the motion sensor, etc.
  • the information collected by the motion sensor or the IMU, gyroscope or accelerometer can be used. etc., to get the relevant parameters of the motion sensor itself.
  • the motion parameters can be calculated from the information collected by the motion sensor.
  • the motion parameters include the related parameters of the motion sensor itself, such as optical flow information, the acceleration of the motion sensor, the angular velocity of the motion sensor, etc., the information collected by the motion sensor or the IMU, gyroscope or accelerometer, etc. Get the relevant parameters of the motion sensor itself.
  • the data collected by the IMU may include the angular velocity ⁇ or the acceleration ⁇ of the IMU, and the like.
  • One or more items can be selected from the angular velocity ⁇ or the acceleration ⁇ and the like as the motion parameter.
  • the motion parameters may be acquired by motion sensors.
  • the motion sensors may be affected by noise or offset, etc., causing the motion parameters to shift. Therefore, the motion parameters may be offset by using Some rectification parameters correct the motion parameters, thereby improving the accuracy of the motion parameters.
  • the motion parameters are corrected to obtain the corrected motion parameters, or the motion sensor is configured to perform correction based on the correction parameters when collecting data, and the corrected data is obtained from the motion sensor.
  • the motion parameters after de-biasing can be directly extracted from the collected data. Therefore, in the embodiment of the present application, the motion parameters after the deviation correction can be obtained, thereby making the motion parameters more accurate.
  • the zero-bias parameters are affected by random walks and therefore need to be continuously updated and corrected. Therefore, when extracting motion parameters, the influence of noise or zero-bias parameters can be removed based on the data collected by the IMU.
  • the true value of the angular velocity Denote the true value of the sum acceleration as: in, Represents the transformation matrix, the transformation matrix of the camera from time i to time j: Specifically, it can represent the transformation from the space coordinate system to the camera body coordinate system, g represents the gravitational acceleration, n is the noise, and b is a zero bias parameter.
  • the relative motion between the target object and the motion sensor can be represented by a uniform linear motion model, and the motion parameter can be a velocity vector v.
  • the motion parameters can be a motion vector v and acceleration a p .
  • the initial velocity vector is calculated from the transformation matrix calculated from the IMU data and the depth Z of the phase plane and the projection model ⁇ : where E represents the identity matrix, Represents the origin of the phase plane. ⁇ t is a period of time.
  • the white in Figure 36 represents the events monitored by the DVS, that is, the DVS can monitor the outline and position of the moving objects within the preset range, and can monitor the contours and positions of the moving objects within the preset range.
  • the obtained movement trajectory of the target object within the preset range is calculated, the movement speed of the target object is calculated, and the movement direction of the target object is extracted.
  • a time window can be generated from the data monitored by DVS, and then the events in the time window are divided according to the short-term window, and the events in the short-term window are accumulated, and the accumulated events in each time window can be understood as a Frame event image. Further, a series of motion trajectories in the time window can be analyzed, and the motion characteristics of the moving target object, such as motion direction and motion speed, can be obtained by calculating optical flow and motion vector.
  • the time window may be divided into multiple short-term windows, such as k short-term windows shown in FIG. 37 , and each time window may correspond to one frame of event image.
  • the method of segmentation may be to perform segmentation according to a set duration, or to perform segmentation according to a random duration, or to perform segmentation according to changes in motion trajectories, etc., which can be adjusted according to actual application scenarios.
  • After obtaining k short-term windows analyze the location of the events in each short-term window, and determine the area where the target object is located in each short-term window.
  • the motion area in short-term window 1 is: The motion area 1 shown in FIG.
  • the motion area in the short-term window k is the motion area k shown in FIG. 37 . Then, through the change of the motion area in the short-term window 1-k, the motion area and motion characteristics of the target area, such as motion direction or motion speed, are determined.
  • the motion parameters can be used to compensate the event image, so as to obtain the compensated event image.
  • the DVS capture position at time t k in the time window [t,t+ ⁇ t] is x k
  • the movement trajectory of the target object can be divided into multiple segments Linear motion
  • the moving speed of the target object in the event image is represented by ⁇ (that is, the motion parameter)
  • the compensated event image can be obtained.
  • the event images can be compensated using the motion parameters to obtain the compensated event images, and then the initial values of the optimized model, or initial optimal values, are calculated according to the compensated event images.
  • the optimization model may include multiple types, and different optimization models may be selected according to different scenarios.
  • the optimization model may include, but is not limited to, one or more of the following: variance, mean square, image entropy, gradient magnitude, Laplacian, SoS loss function, R2 loss function or uniform linear motion model, etc.
  • Variance can also be called contrast.
  • the algorithm for maximizing contrast can include gradient ascent, Newton's method, etc. Iteratively calculates the updated motion parameters once, and then repeats the above process until the optimal contrast is achieved.
  • the contrast algorithm is used as an optimization model for exemplary description.
  • the greater the contrast of the event image the better the compensation effect or update effect of the event image, while in other scenarios, the optimization
  • the optimal value of the model may be the minimum value, that is, the smaller the value of the optimized model, the better the update effect of the event image.
  • At least one frame of event image is iteratively updated based on the value of the optimization model, so as to obtain the updated at least one frame of event image.
  • the motion parameters can be reversed according to the initial value, and the event image can be compensated according to the reversely obtained motion parameters, and the compensation can be obtained.
  • the optimal value of the optimization model is calculated according to the compensated event image, and the above steps are repeated until the conditions for terminating the iteration are met, such as the number of iterations reaches the preset number of times, the iteration duration reaches the preset duration, and the adjacent times.
  • the difference between the iteratively obtained event images is smaller than the preset value, or the difference between the optimal values of the optimization model obtained in adjacent iterations is smaller than the preset difference, etc., and the event image finally obtained is output.
  • the process of compensating the moving image can be understood as, the event image in the time window [t, t+ ⁇ t] is reversely pushed back to time t according to the motion model, so as to realize the motion compensation.
  • the DVS capture position at time t k in the time window [t,t+ ⁇ t] is x k
  • the movement trajectory of the target object can be divided into multiple segments of linear motion, and events are represented by ⁇
  • the position in the event image after compensation can be obtained once the updated event image.
  • the optimization algorithm may adopt algorithms such as gradient ascent, Newton's method, Conjugate Gradient method (Conjugate Gradient) or Momentum optimization method (Momentum), which can be adjusted according to actual application scenarios, which is not limited in this application.
  • step 3805 can be understood as, after obtaining the motion parameters, use the motion parameters to compensate the event image, and calculate the optimal value (ie, the initial value) of the optimization model based on the compensated event image, and then based on the optimal value of the event image.
  • the figure of merit reverses the optimal motion parameters, uses the optimal motion parameters obtained by inversion to re-compensate the event image, and iterates the preceding steps to obtain the final updated event image.
  • the optimization model before updating the event image, can be initialized by using the motion parameters, so that the event image can be updated based on the value of the initialized optimization model, without the need to start from the value of the smallest optimization model Or a random initial value is used to update the event image, so the number of iterative updates to the event image can be reduced, the iterative update efficiency of the event image can be improved, and the optimal event image can be obtained quickly.
  • the deviation correction parameter in the process of obtaining the value of the optimal optimization model each time, can be updated, and the deviation correction parameter can be used to obtain the corrected motion parameter.
  • the deviation correction parameter can be used to obtain the corrected motion parameter.
  • the motion sensor collects the data Then, the collected data is rectified by using the rectification parameter, so as to obtain the rectified data, so that more accurate motion parameters can be extracted from the rectified data subsequently.
  • the deflection correction parameters can be used to correct the motion parameters to obtain more accurate motion parameters.
  • the motion parameters may be collected by the IMU, and in the process of obtaining the optimal optimized model value each time, the IMU parameters may be updated, or referred to as bias correction parameters, and the IMU parameters may be used for the IMU to collect data.
  • the IMU parameters may be updated, or referred to as bias correction parameters, and the IMU parameters may be used for the IMU to collect data.
  • the true value of the angular velocity is usually expressed as: Denote the true value of the sum acceleration as: b and n g are the IMU parameters, which are used to revise the collected data to obtain more accurate motion parameters.
  • the IMU parameters in the process of updating the event image, can also be updated, so that the updated IMU parameters can be used to obtain more accurate motion parameters.
  • the motion parameters can be obtained by integrating the data collected by the IMU, and the error will gradually accumulate. The longer the time is, the greater the drift of the calculated motion parameters will be.
  • the data of the IMU cannot be analyzed in a short time.
  • the optimal value can be used to update the IMU parameters, so that the motion parameters can be obtained based on the more accurate IMU parameters in the future, and the accuracy of the motion parameters can be improved. Rate.
  • the flow of the image processing method provided by the present application is exemplarily described below by taking the motion parameters obtained from the data collected by the IMU, referring to FIG. 39 , where the motion sensor is a DVS as an example.
  • the IMU data 3901 is the data collected by the IMU, which can specifically include the angular velocity, acceleration or velocity of the IMU, etc.
  • the IMU and the DVS can be set in the same device or have a connection relationship, etc.
  • the angular velocity, acceleration or velocity of the IMU, etc. It can also be expressed as the angular velocity, acceleration or velocity of the DVS.
  • Motion parameters 3902 may be data derived from IMU data, such as angular velocity, acceleration, or velocity.
  • the data collected by the IMU is easily affected by the noise n and the zero-bias parameter b, and the zero-bias parameter is affected by random walks, so it needs to be updated and corrected continuously.
  • the true value of the angular velocity is usually expressed as: Express the true value of acceleration as: in, Represents the transformation matrix, the transformation matrix of the camera from time i to time j: Specifically, it can represent the transformation from the space coordinate system to the camera body coordinate system, g represents the gravitational acceleration, n is the noise, and b is a zero bias parameter.
  • the contrast 3904 can be initialized using the motion parameters 3901, and at the same time, the event image 3903 can be compensated using the motion parameters to obtain a compensated event image.
  • the events in the time window [t, t+ ⁇ t] can be reversely pushed back to time t according to the motion model, thereby realizing motion compensation.
  • the pixels of the compensated event image are denoted as h ij .
  • the optimization model is used as an algorithm for contrast (or variance) for exemplary illustration.
  • the contrast can be substituted for other indicators, such as variance, mean square square), image entropy (image entropy), gradient magnitude (gradient magnitude), Laplacian (Laplacian), etc., which can be adjusted according to actual application scenarios.
  • the maximum contrast can be calculated based on the compensated event image, the maximum contrast can be used to update the motion parameters, and the updated motion parameters can be used to compensate the event image to obtain the updated event image, and repeat the above steps until the conditions for terminating the iteration are met, and output the final event image.
  • N p represents the number of pixels in the event image
  • represents the pixel mean of the event image. Then calculate the motion parameter ⁇ that maximizes F(x, ⁇ ), that is, on the basis of which value of ⁇ F can be maximized. Therefore, the event image can be further iteratively compensated on the basis of the motion parameter ⁇ obtained during maximization, so as to obtain an updated image.
  • the IMU parameters can also be updated at the same time, and the IMU parameters can be used for the IMU to collect data or to correct the data collected by the IMU.
  • the IMU parameters may include noise n and zero offset parameter b.
  • b′ a ,b′ g arg min F(G(b a ,b g ),x)
  • the updated noise n and zero bias parameter b are obtained.
  • motion parameters can be obtained based on data collected by the IMU, so as to perform contrast initialization based on the motion parameters, and then update the event image based on the initialized contrast to obtain an updated event image. It is equivalent to setting the initial value of the contrast based on the motion parameters, which reduces the number of iterations for the event image and improves the efficiency of obtaining the final event image.
  • FIG. 40 a schematic flowchart of another image processing method provided by the present application is as follows.
  • the target task may include the duration of iteratively updating at least one frame of event images, or the target task may be performed using at least one frame of event images, including the duration of iteratively updating at least one frame of event images, etc. .
  • the target task may directly carry the duration of iteratively updating at least one frame of event images, for example, the duration of iteratively updating each frame of event images may be set by the user as 30ms.

Abstract

一种视觉传感器芯片(200),包括:像素阵列电路(210),用于通过测量光强变化量来生成与像素阵列电路(210)中的像素对应的至少一个数据信号,至少一个数据信号指示光强变化事件,光强变化事件表示像素阵列电路(210)中的对应像素测量到的光强变化量超过预定阈值。读取电路(220),读取电路(220)与像素阵列电路(210)耦合,用于以第一事件表示方式从像素阵列电路(210)读取至少一个数据信号。读取电路(220),还用于向控制电路(230)提供至少一个数据信号。读取电路(220),还用于从控制电路(230)接收到基于至少一个数据信号而生成的转换信号时,转换到以第二事件表示方式从像素阵列电路(210)读取至少一个数据信号。

Description

一种视觉传感器芯片、操作视觉传感器芯片的方法以及设备 技术领域
本申请涉及计算机领域,尤其涉及一种视觉传感器芯片、操作视觉传感器芯片的方法以及设备。
背景技术
视觉传感技术在视频监控、数码相机、机器人导航、汽车自主导航、生物医学像素分析、人机界面、虚拟现实、工业控制、无线远距离传感、显微镜技术、科学仪器等诸多领域具有广泛用途。通过利用光学元件和成像装置,视觉传感器可以从外部环境获取图像信息,并实现图像处理、图像存储和图像输出等操作。
经过数十年的发展,已经出现了许多不同类型的视觉传感器。例如,对于仿生视觉传感器而言,其原理是利用集成电路对生物视网膜进行仿真,像素阵列电路中的每个像素模拟生物神经元,对光强度的变化以事件的形式进行表达。在实践中,包括采用光强信息表示事件以及采用极性信息表示事件两种事件表达方式。目前由于硬件设计、芯片结构等因素,单个视觉传感器仅能使用一种事件表示方式。然而,采用单一的事件表示方式的视觉传感器很难适应各种环境变化及运动状态,导致在某些应用场景下视觉传感器的性能较差。
发明内容
本申请实施例提供了一种图像处理方法以及装置,用于得到更清晰的图像。
第一方面,本申请提供一种切换方法,应用于电子设备,所述电子设备包括RGB传感器和运动传感器,所述RGB(red green bule)传感器用于采集拍摄范围内的图像,所述运动传感器用于采集对象在所述运动传感器的检测范围内相对于所述运动传感器运动时产生的信息,所述方法包括:基于场景信息从所述RGB传感器和所述运动传感器中选择至少一种,并通过选择出的传感器采集数据,所述场景信息包括所述电子设备的状态信息、所述电子设备中请求采集图像的应用程序的类型或者环境信息中的至少一种。
因此,在本申请实施方式中,可以根据不同的场景选择启动电子设备中的不同的传感器,适应更多的场景,泛化能力强。并且,可根据实际场景启动相应的传感器,无需启动所有的传感器,降低电子设备的功耗。
在一种可能的实施方式中,所述状态信息包括所述电子设备的剩余电量、剩余存储量;所述环境信息包括所述彩色RGB传感器和运动传感器的拍摄范围内的光照强度的变化值或所述拍摄范围内的运动的对象的信息。
因此,在本申请实施方式中,可以根据电子设备的状态或者环境信息来选择启动的传感器,适应更多的场景,泛化能力强。
此外,在以下不同的实施方式中,启动的传感器可能不相同,在所提及的某个传感器采集到的数据时,即已开启该传感器,以下不再赘述。
第二方面,本申请提供一种视觉传感器芯片,可以包括:像素阵列电路,用于通过测量光强变化量来生成与像素阵列电路中的像素对应的至少一个数据信号,至少一个数据信号指示光强变化事件,光强变化事件表示像素阵列电路中的对应像素测量到的光强变化量超过预定阈值。读取电路,读取电路与像素阵列电路耦合,用于以第一事件表示方式从像 素阵列电路读取至少一个数据信号。读取电路,还用于向控制电路提供至少一个数据信号。读取电路,还用于从控制电路接收到基于至少一个数据信号而生成的转换信号时,转换到以第二事件表示方式从像素阵列电路读取至少一个数据信号。由第一方面可知,视觉传感器能够自适应地在两种事件表示方式之间切换,使得读取数据速率始终保持未超过预定的读取数据速率阈值,从而降低了视觉传感器的数据传输、解析和存储的代价,显著提高了传感器的性能。另外,这样的视觉传感器可以对一段时间内产生的事件进行数据统计以用于预测下一时间段内可能的事件产生速率,因而能够选出更加适合当前外部环境、应用场景和运动状态的读取模式。
在一种可能的实施方式中,第一事件表示方式为通过极性信息表示事件,像素阵列电路可以包括多个像素,每个像素可以包括阈值比较单元,阈值比较单元,用于光强变换量超过预定阈值时,输出极性信息,极性信息用于指示光强变化量是增强或者减弱。读取电路,具体用于读取阈值比较单元输出的极性信息。在这种实施方式中,第一事件表示方式为极性信息表示事件,极性信息通常由1比特-2比特表示,携带的信息较少,避免由于数据量较大,出现大面积的物体运动或光强波动时(例如进出隧道口,房间开关灯等场景),视觉传感器将面临事件突增的问题,在视觉传感器的预置最大带宽(以下简称为带宽)一定的情况下,避免出现事件数据无法被读出的情况,导致事件丢失的情况。
在一种可能的实施方式中,第一事件表示方式为通过光强信息表示事件,像素阵列可以包括多个像素,每个像素可以包括阈值比较单元,读出控制单元和光强采集单元,光强检测单元,用于输出照射在其上的光信号对应的电信号,电信号用于指示光强。阈值比较单元,用于根据电信号确定光强变换量超过预定阈值时,输出第一信号。读出控制单元,用于响应于接收到第一信号,指示光强采集单元采集并缓存对应第一信号接收时刻的电信号。读取电路,具体用于读取光强采集单元缓存的电信号。在这种实施方式中,第一事件表示方式为通过光强信息表示事件。当传输的数据量不超过带宽限制时,采用光强信息表示事件,通常光强信息通常由多比特进行表示,比如采用8比特-12比特进行表示,相比于极性信息,光强信息可以携带的信息更多,有利于对事件的处理和分析,比如可以提升图像重构的质量。
在一种可能的实施方式中,控制电路,还用于:基于从读取电路接收的至少一个数据信号,确定统计数据。如果确定统计数据满足预定转换条件,向读取电路发送转换信号,预定转换条件基于视觉传感器芯片的预置带宽确定。在这种实施方式中,给出了一种转换两种事件表示方式的方式,根据需要传输的数据量获取转换条件。比如当传输的数据量较大时,切换为通过极性信息表示事件,保证能够完整的传输数据量,避免避免出现事件数据无法被读出的情况,导致事件丢失的情况。当传输的数据量较小时,切换为通过光强信息表示事件,使得传输的事件可以携带更多信息,有利于对事件的处理和分析,比如可以提升图像重构的质量。
在一种可能的实施方式中,第一事件表示方式为通过光强信息表示事件,第二事件表示方式为通过极性信息表示事件时,预定转换条件为通过第一事件表示方式从像素阵列电路读取的总数据量大于预置带宽,或者预定转换条件为至少一个数据信号的数目大于预置 带宽和第一比特的比值,第一比特是数据信号的数据格式的预置比特。在这种实施方式中,给出了一种具体的由光强信息表示事件切换为由极性信息表示事件的条件。当传输的数据量大于预置带宽时,切换为通过极性信息表示事件,保证能够完整的传输数据量,避免避免出现事件数据无法被读出的情况,导致事件丢失的情况。
在一种可能的实施方式中,第一事件表示方式为通过极性信息表示事件,第二事件表示方式为通过光强信息表示事件时,预定转换条件为若通过第二事件表示方式从像素阵列电路读取至少一个数据信号,读取的总数据量不大于预置带宽,或者预定转换条件为至少一个数据信号的数目不大于预置带宽和第一比特的比值,第一比特是数据信号的数据格式的预置比特。在这种实施方式中,给出了一种具体的由极性信息表示事件切换为由光强信息表示事件的条件。当传输的数据量不大于预置带宽时,切换为通过光强信息表示事件,使得传输的事件可以携带更多信息,有利于对事件的处理和分析,比如可以提升图像重构的质量。
第三方面,本申请提供一种解码电路,可以包括:读取电路,用于从视觉传感器芯片读取数据信号。解码电路,用于根据第一解码方式对数据信号进行解码。解码电路,还用于从控制电路接收到转换信号时,根据第二解码方式对数据信号进行解码。第三方面提供的一种解码电路和第二方面提供的一种视觉传感器芯片相对应,用于对第二方面提供的视觉传感器芯片输出的数据信号进行解码。第三方面提供的一种解码电路可以针对于不同的事件表示方式,切换不同的解码方式。
在一种可能的实施方式中,控制电路,还用于:基于从读取电路读取的数据信号,确定统计数据。如果确定统计数据满足预定转换条件,向编码电路发送转换信号,预定转换条件基于视觉传感器芯片的预置带宽确定。
在一种可能的实施方式中,第一解码方式为根据与第一事件表示方式相对应的第一比特对数据信号进行解码,第一事件表示方式为通过光强信息表示事件,第二解码方式为根据与第二事件表示方式相对应的第二比特对数据信号进行解码,第二事件表示方式为通过极性信息表示事件,极性信息用于指示光强变化量是增强或者减弱,转换条件为根据第一解码方式解码的总数据量大于预置带宽,或者预定转换条件为数据信号的数目大于预置带宽和第一比特的比值,第一比特是数据信号的数据格式的预置比特。
在一种可能的实施方式中,第一解码方式为根据与第一事件表示方式相对应的第一比特对数据信号进行解码,第一事件表示方式为通过极性信息表示事件,极性信息用于指示光强变化量是增强或者减弱,第二解码方式为通过与第二事件表示方式相对应的第二比特对数据信号进行解码,第二事件表示方式为通过光强信息表示事件,转换条件为若根据第二解码方式解码数据信号,总数据量不大于预置带宽,或者预定转换条件为数据信号的数目大于预置带宽和第一比特的比值,第一比特是数据信号的数据格式的预置比特。
第四方面,本申请提供一种操作视觉传感器芯片的方法,可以包括:通过视觉传感器芯片的像素阵列电路测量光强变化量来生成与像素阵列电路中的像素对应的至少一个数据信号,至少一个数据信号指示光强变化事件,光强变化事件表示像素阵列电路中的对应像素测量到的光强变化量超过预定阈值。通过视觉传感器芯片的读取电路以第一事件表示方 式从像素阵列电路读取至少一个数据信号。通过读取电路向视觉传感器芯片的控制电路提供至少一个数据信号。通过读取电路从控制电路接收到基于至少一个数据信号而生成的转换信号时,转换到以第二事件表示方式从像素阵列电路读取至少一个数据信号。
在一种可能的实施方式中,第一事件表示方式为通过极性信息表示事件,像素阵列电路可以包括多个像素,每个像素可以包括阈值比较单元,通过视觉传感器芯片的读取电路以第一事件表示方式从像素阵列电路读取至少一个数据信号,可以包括:光强变换量超过预定阈值时,通过阈值比较单元输出极性信息,极性信息用于指示光强变化量是增强或者减弱。通过读取电路读取阈值比较单元输出的极性信息。
在一种可能的实施方式中,第一事件表示方式为通过光强信息表示事件,像素阵列可以包括多个像素,每个像素可以包括阈值比较单元,读出控制单元和光强采集单元,通过视觉传感器芯片的读取电路以第一事件表示方式从像素阵列电路读取至少一个数据信号,可以包括:通过光强采集单元输出照射在其上的光信号对应的电信号,电信号用于指示光强。电信号确定光强变换量超过预定阈值时,通过阈值比较单元输出第一信号。响应于接收到第一信号,通过读出控制单元指示光强采集单元采集并缓存对应第一信号接收时刻的电信号。通过读取电路读取光强采集单元缓存的电信号。
在一种可能的实施方式中,该方法还可以包括:基于从读取电路接收的至少一个数据信号,确定统计数据。如果确定统计数据满足预定转换条件,向读取电路发送转换信号,预定转换条件基于视觉传感器芯片的预置带宽确定。
在一种可能的实施方式中,第一事件表示方式为通过光强信息表示事件,第二事件表示方式为通过极性信息表示事件时,预定转换条件为通过第一事件表示方式从像素阵列电路读取的总数据量大于预置带宽,或者预定转换条件为至少一个数据信号的数目大于预置带宽和第一比特的比值,第一比特是数据信号的数据格式的预置比特。
在一种可能的实施方式中,第一事件表示方式为通过极性信息表示事件,第二事件表示方式为通过光强信息表示事件时,预定转换条件为若通过第二事件表示方式从像素阵列电路读取至少一个数据信号,读取的总数据量不大于预置带宽,或者预定转换条件为至少一个数据信号的数目不大于预置带宽和第一比特的比值,第一比特是数据信号的数据格式的预置比特。
第五方面,本申请提供一种解码方法,包括:通过读取电路从视觉传感器芯片读取数据信号;通过解码电路根据第一解码方式对数据信号进行解码;从控制电路接收到转换信号时,通过解码电路根据第二解码方式对数据信号进行解码。
在一种可能的实施方式中,还包括:基于从读取电路读取的数据信号,确定统计数据;如果确定统计数据满足预定转换条件,向编码电路发送转换信号,预定转换条件基于视觉传感器芯片的预置带宽确定。
在一种可能的实施方式中,第一解码方式为根据与第一事件表示方式相对应的第一比特对数据信号进行解码,第一事件表示方式为通过光强信息表示事件,第二解码方式为根据与第二事件表示方式相对应的第二比特对数据信号进行解码,第二事件表示方式为通过极性信息表示事件,极性信息用于指示光强变化量是增强或者减弱,转换条件为根据第一 解码方式解码的总数据量大于预置带宽,或者预定转换条件为数据信号的数目大于预置带宽和第一比特的比值,第一比特是数据信号的数据格式的预置比特。
在一种可能的实施方式中,第一解码方式为根据与第一事件表示方式相对应的第一比特对数据信号进行解码,第一事件表示方式为通过极性信息表示事件,极性信息用于指示光强变化量是增强或者减弱,第二解码方式为通过与第二事件表示方式相对应的第二比特对数据信号进行解码,第二事件表示方式为通过光强信息表示事件,转换条件为若根据第二解码方式解码数据信号,总数据量不大于预置带宽,或者预定转换条件为数据信号的数目大于预置带宽和第一比特的比值,第一比特是数据信号的数据格式的预置比特。
第六方面,本申请提供一种视觉传感器芯片,可以包括:像素阵列电路,用于通过测量光强变化量来生成与像素阵列电路中的像素对应的至少一个数据信号,至少一个数据信号指示光强变化事件,光强变化事件表示像素阵列电路中的对应像素测量到的光强变化量超过预定阈值。第一编码单元,用于根据第一比特对至少一个数据信号进行编码,以得到第一编码数据。第一编码单元,还用于从控制电路接收到第一控制信号时,根据第一控制信号指示的第二比特对至少一个数据信号进行编码,第一控制信号是控制电路根据第一编码数据确定的。由第六方面提供的方案可知,通过动态调整表示光强特征信息的位宽的方案,当事件产生速率较小时,尚未达到带宽限制,则按照最大位宽量化事件,对事件进行编码,当事件产生速率较大时,则逐渐降低表示光强特征信息的位宽,以满足带宽限制,此后,若事件产生的速率又变小时,则可以在不超过带宽限制的前提下,递增表示光强特征信息的位宽。视觉传感器可以自适应地在多种事件表示方式之间切换,以更好实现以更大的表示精度传输所有事件这一目的。
在一种可能的实施方式中,第一控制信号是控制电路根据第一编码数据以及视觉传感器芯片预置的带宽确定的。
在一种可能的实施方式中,第一编码数据的数据量不小于带宽时,控制信号指示的第二比特小于第一比特,以使通过第二比特编码的至少一个数据信号的总数据量不大于带宽。当事件产生速率较大时,则逐渐降低表示光强特征信息的位宽,以满足带宽限制。
在一种可能的实施方式中,第一编码数据的数据量小于带宽时,控制信号指示的第二比特大于第一比特,且通过第二比特编码的至少一个数据信号的总数据量不大于带宽。若事件产生的速率变小时,则可以在不超过带宽限制的前提下,递增表示光强特征信息的位宽,以更好实现以更大的表示精度传输所有事件这一目的。
在一种可能的实施方式中,像素阵列可以包括N个区域,N个区域中的至少两个区域的最大比特不同,最大比特表示预设的对一个区域生成的至少一个数据信号进行编码的最大比特,第一编码单元,具体用于根据第一比特对第一区域生成的至少一个数据信号进行编码,以得到第一编码数据,第一比特不大于第一区域的最大比特,第一区域是N个区域中的任意一个区域。第一编码单元,具体用于从控制电路接收到第一控制信号时,根据第一控制信号指示的第二比特对第一区域生成的至少一个数据信号进行编码,第一控制信号是控制电路根据第一编码数据确定的。在这种实施方式中,还可以对像素阵列进行区域划分,采用不同的权重设定不同区域的最大位宽,以适应场景中不同的感兴趣区域,比如在 可能包括目标对象的区域设置更大的权重,使包括目标对象的区域对应输出的事件的表示精度更高,在背景区域设置更小的权重,使背景区域对应输出的事件的表示精度更低。
在一种可能的实施方式中,控制电路,还用于:确定通过第三比特编码的至少一个数据信号的总数据量大于带宽,且通过第二比特编码的至少一个数据信号的总数据量不大于带宽时,向第一编码单元发送第一控制信号,第三比特和第二比特之间相差1个比特单位。在这种实施方式中,可以在不超过带宽限制的前提下,以更大的表示精度传输所有事件。
第七方面,本申请提供一种解码设备,可以包括:读取电路,用于从视觉传感器芯片读取数据信号。解码电路,用于根据第一比特对数据信号进行解码。解码电路,还用于从控制电路接收到第一控制信号时,根据所第一控制信号指示的第二比特对数据信号进行解码。第七方面提供的一种解码电路和第六方面提供的一种视觉传感器芯片相对应,用于对第六方面提供的视觉传感器芯片输出的数据信号进行解码。第七方面提供的一种解码电路可以针对视觉传感器采用的编码比特,动态的调整解码方式。
在一种可能的实施方式中,第一控制信号是控制电路根据第一编码数据以及视觉传感器芯片预置的带宽确定的。
在一种可能的实施方式中,根据第一比特解码的数据信号的总数据量不小于带宽时,第二比特小于第一比特。
在一种可能的实施方式中,根据第一比特解码的数据信号的总数据量小于带宽时,第二比特大于第一比特,且通过第二比特解码数据信号的总数据量不大于带宽。
在一种可能的实施方式中,读取电路,具体用于从视觉传感器芯片读取第一区域对应的数据信号,第一区域是视觉传感器的像素阵列可以包括的N个区域中的任意一个区域,N个区域中的至少两个区域的最大比特不同,最大比特表示预设的对一个区域生成的至少一个数据信号进行编码的最大比特。解码电路,具体用于根据第一比特对第一区域对应的数据信号进行解码。
在一种可能的实施方式中,控制电路,还用于:确定过第三比特解码的数据信号的总数据量大于带宽,且通过第二比特解码数据信号的总数据量不大于带宽时,向第一编码单元发送第一控制信号,第三比特和第二比特之间相差1个比特单位。
第八方面,本申请提供一种操作视觉传感器芯片的方法,可以包括:通过视觉传感器芯片的像素阵列电路测量光强变化量来生成与像素阵列电路中的像素对应的至少一个数据信号,至少一个数据信号指示光强变化事件,光强变化事件表示像素阵列电路中的对应像素测量到的光强变化量超过预定阈值。通过视觉传感器芯片的第一编码单元根据第一比特对至少一个数据信号进行编码,以得到第一编码数据。通过第一编码单元从视觉传感器芯片的控制电路接收到第一控制信号时,根据第一控制信号指示的第二比特对至少一个数据信号进行编码,第一控制信号是控制电路根据第一编码数据确定的。
在一种可能的实施方式中,第一控制信号是控制电路根据第一编码数据以及视觉传感器芯片预置的带宽确定的。
在一种可能的实施方式中,第一编码数据的数据量不小于带宽时,控制信号指示的第二比特小于第一比特,以使通过第二比特编码的至少一个数据信号的总数据量不大于带宽。
在一种可能的实施方式中,第一编码数据的数据量小于带宽时,控制信号指示的第二比特大于第一比特,且通过第二比特编码的至少一个数据信号的总数据量不大于带宽。
在一种可能的实施方式中,像素阵列可以包括N个区域,N个区域中的至少两个区域的最大比特不同,最大比特表示预设的对一个区域生成的至少一个数据信号进行编码的最大比特,通过视觉传感器芯片的第一编码单元根据第一比特对至少一个数据信号进行编码,可以包括:通过第一编码单元根据第一比特对第一区域生成的至少一个数据信号进行编码,以得到第一编码数据,第一比特不大于第一区域的最大比特,第一区域是N个区域中的任意一个区域。通过第一编码单元从视觉传感器芯片的控制电路接收到第一控制信号时,根据第一控制信号指示的第二比特对至少一个数据信号进行编码,可以包括:通过第一编码单元从控制电路接收到第一控制信号时,根据第一控制信号指示的第二比特对第一区域生成的至少一个数据信号进行编码,第一控制信号是控制电路根据第一编码数据确定的。
在一种可能的实施方式中,还可以包括:确定通过第三比特编码的至少一个数据信号的总数据量大于带宽,且通过第二比特编码的至少一个数据信号的总数据量不大于带宽时,通过控制电路向第一编码单元发送第一控制信号,第三比特和第二比特之间相差1个比特单位。
第九方面,本申请提供一种解码方法,可以包括:通过读取电路从视觉传感器芯片读取数据信号。通过解码电路根据第一比特对数据信号进行解码。通过解码电路从控制电路接收到第一控制信号时,根据所第一控制信号指示的第二比特对数据信号进行解码。
在一种可能的实施方式中,第一控制信号是控制电路根据第一编码数据以及视觉传感器芯片预置的带宽确定的。
在一种可能的实施方式中,根据第一比特解码的数据信号的总数据量不小于带宽时,第二比特小于第一比特。
在一种可能的实施方式中,根据第一比特解码的数据信号的总数据量小于带宽时,第二比特大于第一比特,且通过第二比特解码数据信号的总数据量不大于带宽。
在一种可能的实施方式中,通过读取电路从视觉传感器芯片读取数据信号,可以包括:通过读取电路从视觉传感器芯片读取第一区域对应的数据信号,第一区域是视觉传感器的像素阵列可以包括的N个区域中的任意一个区域,N个区域中的至少两个区域的最大比特不同,最大比特表示预设的对一个区域生成的至少一个数据信号进行编码的最大比特。通过解码电路根据第一比特对数据信号进行解码,可以包括:通过解码电路根据第一比特对第一区域对应的数据信号进行解码。
在一种可能的实施方式中,该方法还可以包括:确定过第三比特解码的数据信号的总数据量大于带宽,且通过第二比特解码数据信号的总数据量不大于带宽时,向第一编码单元发送第一控制信号,第三比特和第二比特之间相差1个比特单位。
第十方面,本申请提供一种种视觉传感器芯片,可以包括:像素阵列电路,用于通过测量光强变化量来生成与像素阵列电路中的多个像素对应的多个数据信号,多个数据信号指示至少一个光强变化事件,至少一个光强变化事件表示像素阵列电路中的对应像素测量到的光强变化量超过预定阈值。第三编码单元,用于根据第一预设的比特对第一差分值进 行编码,第一差分值是光强变换量和预定阈值的差值。降低事件表示的精度,即降低表示事件的位宽使得事件可以携带的信息变少了,在一些场景中不利于对事件的处理和分析。所以降低事件表示精度的方式可能不适用所有场景,即在某些场景中,需要采用高比特的位宽表示事件,但是高比特位宽表示的事件,虽然可以携带更多的数据,但是数据量也较大,在视觉传感器预置最大带宽一定的情况下,可能存在事件数据无法被读出的情况,造成数据的丢失。第十方面提供的方案采用对差分值进行编码的方式,降低了视觉传感器的数据传输、解析和存储的代价的同时还能以最高的精度传输事件,显著提高了传感器的性能。
在一种可能的实施方式中,像素阵列电路可以包括多个像素,每个像素可以包括阈值比较单元,阈值比较单元,用于光强变换量超过预定阈值时,输出极性信息,极性信息用于指示光强变化量是增强或者减弱。第三编码单元,还用于根据第二预设的比特对极性信息进行编码。在这种实施方式中,还可以对极性信息编码,通过极性信息表示光强是增强还是减弱,有助于对根据上一次解码获取的光强信号以及极性信息获取当前的光强信息。
在一种可能的实施方式中,每个像素可以包括还可以包括光强检测单元,读出控制单元和光强采集单元,光强检测单元,用于输出照射在其上的光信号对应的电信号,电信号用于指示光强。阈值比较单元,具体用于根据电信号确定光强变换量超过预定阈值时,输出极性信息。读出控制单元,用于响应于接收到极性信号,指示光强采集单元采集并缓存对应极性信息接收时刻的电信号。第三编码单元,还用于根据第三预设的比特对第一电信号进行编码,第一电信号是光强采集单元采集的对应极性信息第一次接收时刻的电信号,第三预设的比特是视觉传感器预置的用于表示光强的特征信息的最大比特。初始状态全量编码之后,后续事件仅需编码极性信息,以及光强变化量与预定阈值之间的差分值,即可以有效降低编码数据量。其中,全量编码是指利用视觉传感器预定义的最大位宽对一个事件进行编码。此外利用上一个事件的光强信息,以及解码出的极性信息和差分值,即可无损重建出当前时刻的光强信息。
在一种可能的实施方式中,第三编码单元,还用于:每隔预设时长根据第三预设的比特对光强采集单元采集的电信号进行编码。每隔预设时长进行一次全量编码,以降低解码依赖并防止误码。
在一种可能的实施方式中,第三编码单元,具体用于:第一差分值小于预定阈值时,根据第一预设的比特对第一差分值进行编码。
在一种可能的实施方式中,第三编码单元,还用于:第一差分值不小于预定阈值时,根据第一预设的比特对第一剩余差分值和预定阈值进行编码,第一剩余差分值是差分值和预定阈值的差值。
在一种可能的实施方式中,第三编码单元,具体用于:第一剩余差分值不小于预定阈值时,根据第一预设的比特对第二剩余差分值进行编码,第二剩余差分值是第一剩余差分值和预定阈值的差值。根据第一预设的比特对预定阈值进行第一次编码。根据第一预设的比特对预定阈值进行第二次编码。由于视觉传感器可能存在一定的延迟,可能导致两次或者两次以上满足光强变换量大于预定阈值,才产生了一次事件。这会出现差分值大于等于 预定阈值,光强变化量至少是预定阈值的两倍的问题,比如第一剩余差分值可能不小于预定阈值,则对第二剩余差分值进行编码,若第二剩余差分值仍然不小于预定阈值,则可以对第三剩余差分值进行编码,第三差分值是第二剩余差分值和预定阈值的差值,并且对预定阈值进行第三次编码,重复上述过程,直至剩余差分值小于预定阈值。
第十一方面,本申请提供一种解码设备,可以包括:获取电路,用于从视觉传感器芯片读取数据信号。解码电路,用于根据第一比特对数据信号进行解码,以获取差分值,差分值小于预定阈值,差分值是视觉传感器测量到的光强变换量和预定阈值的差值,光强变化量超过预定阈值,视觉传感器产生至少一个光强变化事件。第十一方面提供的一种解码电路和第十方面提供的一种视觉传感器芯片相对应,用于对第十方面提供的视觉传感器芯片输出的数据信号进行解码。第十一方面提供的一种解码电路可以针对视觉传感器采用的差分编码方式采用相应的差分解码方式。
在一种可能的实施方式中,解码电路,还用于:根据第二比特对数据信号进行解码,以获取极性信息,极性信息用于指示光强变化量是增强或者减弱。
在一种可能的实施方式中,解码电路,还用于:根据第三比特对第一时刻接收到的数据信号进行解码,以获取视觉传感器输出的照射在其上的光信号对应的电信号,第三比特是视觉传感器预置的用于表示光强的特征信息的最大比特。
在一种可能的实施方式中,解码电路,还用于:每隔预设时长根据第三比特对第一时刻接收到的数据信号进行解码。
在一种可能的实施方式中,解码电路,具体用于:根据第一比特对数据信号进行解码,以获取差分值和至少一个预定阈值。
第十二方面,本申请提供一种一种操作视觉传感器芯片的方法,可以包括:通过视觉传感器芯片的像素阵列电路测量光强变化量来生成与像素阵列电路中的多个像素对应的多个数据信号,多个数据信号指示至少一个光强变化事件,至少一个光强变化事件表示像素阵列电路中的对应像素测量到的光强变化量超过预定阈值。通过视觉传感器芯片的第三编码单元根据第一预设的比特对第一差分值进行编码,第一差分值是光强变换量和预定阈值的差值。
在一种可能的实施方式中,像素阵列电路可以包括多个像素,每个像素可以包括阈值比较单元,方法还可以包括:光强变换量超过预定阈值时,通过阈值比较单元输出极性信息,极性信息用于指示光强变化量是增强或者减弱。通过第三编码单元根据第二预设的比特对极性信息进行编码。
在一种可能的实施方式中,每个像素可以包括还可以包括光强检测单元,读出控制单元和光强采集单元,方法还可以包括:通过光强检测单元输出照射在其上的光信号对应的电信号,电信号用于指示光强。通过阈值比较单元输出极性信息,可以包括:根据电信号确定光强变换量超过预定阈值时,通过阈值比较单元输出极性信息。方法还可以包括:响应于接收到极性信号,通过读出控制单元指示光强采集单元采集并缓存对应极性信息接收时刻的电信号。根据第三预设的比特对第一电信号进行编码,第一电信号是光强采集单元采集的对应极性信息第一次接收时刻的电信号,第三预设的比特是视觉传感器预置的用于 表示光强的特征信息的最大比特。
在一种可能的实施方式中,方法还可以包括:每隔预设时长根据第三预设的比特对光强采集单元采集的电信号进行编码。
在一种可能的实施方式中,通过视觉传感器芯片的第三编码单元根据第一预设的比特对第一差分值进行编码,可以包括:第一差分值小于预定阈值时,根据第一预设的比特对第一差分值进行编码。
在一种可能的实施方式中,通过视觉传感器芯片的第三编码单元根据第一预设的比特对第一差分值进行编码,还可以包括:第一差分值不小于预定阈值时,根据第一预设的比特对第一剩余差分值和预定阈值进行编码,第一剩余差分值是差分值和预定阈值的差值。
在一种可能的实施方式中,第一差分值不小于预定阈值时,根据第一预设的比特对第一剩余差分值和预定阈值进行编码,可以包括:第一剩余差分值不小于预定阈值时,根据第一预设的比特对第二剩余差分值进行编码,第二剩余差分值是第一剩余差分值和预定阈值的差值。根据第一预设的比特对预定阈值进行第一次编码。根据第一预设的比特对预定阈值进行第二次编码,第一剩余差分值可以包括第二剩余差分值和两个预定阈值。
第十三方面,本申请提供一种解码方法,可以包括:通过获取电路从视觉传感器芯片读取数据信号。通过解码电路根据第一比特对数据信号进行解码,以获取差分值,差分值小于预定阈值,差分值是视觉传感器测量到的光强变换量和预定阈值的差值,光强变化量超过预定阈值,视觉传感器产生至少一个光强变化事件。
在一种可能的实施方式中,还可以包括:根据第二比特对数据信号进行解码,以获取极性信息,极性信息用于指示光强变化量是增强或者减弱。
在一种可能的实施方式中,还可以包括:根据第三比特对第一时刻接收到的数据信号进行解码,以获取视觉传感器输出的照射在其上的光信号对应的电信号,第三比特是视觉传感器预置的用于表示光强的特征信息的最大比特。
在一种可能的实施方式中,还可以包括:每隔预设时长根据第三比特对第一时刻接收到的数据信号进行解码。
在一种可能的实施方式中,通过解码电路根据第一比特对数据信号进行解码,以获取差分值,可以包括:根据第一比特对数据信号进行解码,以获取差分值和至少一个预定阈值。
第十四方面,本申请提供一种图像处理方法,包括:获取运动信息,所述运动信息包括目标对象在运动传感器的检测范围内进行运动时的运动轨迹的信息;根据所述运动信息生成至少一帧事件图像,所述至少一帧事件图像为表示所述目标对象在所述检测范围内产生运动时的运动轨迹的图像;获取目标任务,并根据所述目标任务获取迭代时长;对所述至少一帧事件图像进行迭代更新,得到更新后的至少一帧事件图像,且对所述至少一帧事件图像进行迭代更新的时长不超过所述迭代时长。
因此,在本申请实施方式中,可以通过运动传感器对运动的对象进行监控,并通过运动传感器采集到对象在检测范围内进行运动时的运动轨迹的信息,在得到目标任务之后,即可根据该目标任务确定迭代时长,在迭代时长内对事件图像进行迭代更新,从而得到与 目标任务匹配的事件图像。
在一种可能的实施方式中,所述对所述至少一帧事件图像进行迭代更新中的任意一次迭代更新,包括:获取运动参数,所述运动参数表示所述运动传感器与所述目标对象之间的相对运动的参数;根据所述运动参数对所述至少一帧事件图像中的目标事件图像进行迭代更新,得到更新后的目标事件图像。
因此,在本申请实施方式中,在对事件图像进行迭代更新时,可以基于对象和运动传感器之间的相对运动的参数进行更新,从而对事件图像进行补偿,得到更清晰的事件图像。
在一种可能的实施方式中,所述获取运动参数,包括:获取上一次迭代更新过程中预设的优化模型的值;根据所述优化模型的值计算得到所述运动参数。
因此,在本申请实施方式中,可以基于优化模型的值来对事件图像进行更新,并根据优化模型计算得到更优的运动参数,进而使用该运动参数对事件图像进行更新,得到更清晰的事件图像。
在一种可能的实施方式中,所述根据所述运动参数对所述至少一帧事件图像中的目标事件图像进行迭代更新,包括:根据所述运动参数对所述目标事件图像中所述目标对象的运动轨迹进行补偿,得到当前次迭代更新得到的目标事件图像。
因此,在本申请实施方式中,具体可以使用运动参数对事件图像中目标对象的运动轨迹进行补偿,使事件图像中目标对象的运动轨迹更清晰,从而事件图像更清晰。
在一种可能的实施方式中,所述运动参数包括以下一项或者多项:深度、光流信息、所述运动传感器进行运动的加速度或所述运动传感器进行运动的角速度,所述深度表示所述运动传感器和所述目标对象之间的距离,所述光流信息表示所述运动传感器和所述目标对象之间的相对运动的运动速度的信息。
因此,在本申请实施方式中,可以通过多种运动参数对事件图像中的目标对象进行运动补偿,提高事件图像的清晰度。
在一种可能的实施方式中,在所述任意一次迭代更新过程中,所述方法还包括:若当前次迭代的结果满足预设条件,则终止迭代,所述终止条件包括以下至少一项:对所述至少一帧事件图像进行迭代更新的次数达到预设次数或者对所述至少一帧事件图像更新过程中优化模型的值变化小于预设值。
因此,在本申请实施方式中,除了设置迭代时长,还可以设置与迭代次数或优化模型的值等相关的收敛条件,从而在迭代时长的约束下,得到符合收敛条件的事件图像。
第十五方面,本申请提供一种图像处理方法,包括:根据运动信息生成至少一帧事件图像,所述运动信息包括目标对象在运动传感器的检测范围内产生运动时的运动轨迹的信息,所述至少一帧事件图像为表示所述目标对象在所述检测范围内产生运动时的运动轨迹的图像;获取运动参数,所述运动参数表示所述运动传感器与所述目标对象之间的相对运动的参数;根据所述运动参数对预设的优化模型的值进行初始化,得到优化模型的值;根据所述优化模型的值更新所述至少一帧事件图像,得到更新后的所述至少一帧事件图像。
本申请实施方式中,可以使用运动传感器与所述目标对象之间的相对运动的参数来初始化优化模型,从而减少对事件图像的初始迭代次数,加快对事件图像进行迭代的收敛速 度,在迭代次数更少的情况下得到更清晰的事件图像。
在一种可能的实施方式中,所述运动参数包括以下一项或者多项:深度、光流信息、所述运动传感器进行运动的加速度或所述运动传感器进行运动的角速度,所述深度表示所述运动传感器和所述目标对象之间的距离,所述光流信息表示所述运动传感器和所述目标对象之间的相对运动的运动速度的信息。
在一种可能的实施方式中,所述获取运动参数,包括:获取惯性测量单元IMU传感器采集到的数据;根据所述IMU传感器采集到的数据计算得到所述运动参数。因此,在本申请实施方式中,可以通过IMU计算运动参数,从而得到更准确的运动参数。
在一种可能的实施方式中,所述根据所述运动参数对预设的优化模型的值进行初始化之后,所述方法还包括:根据所述优化模型的值更新所述IMU传感器的参数,所述IMU传感器的参数用于所述IMU传感器采集数据。
因此,在本申请实施方式中,还可以根据优化模型的值来更新IMU的参数,实现对IMU的纠偏,使IMU采集到的数据更准确。
第十六方面,本申请提供一种图像处理装置,该图像处理装置具有实现上述第十四方面或第十四方面任意一种可能实现方式的方法的功能,或者该图像处理装置具有实现上述第十五方面或第十五方面任意一种可能实现方式的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第十七方面,本申请提供一种图像处理的方法,包括:获取运动信息,所述运动信息包括目标对象在运动传感器的检测范围内进行运动时的运动轨迹的信息;根据所述运动信息生成事件图像,所述事件图像为表示所述目标对象在所述检测范围内运动时的运动轨迹的图像;根据所述事件图像中包括的至少一个事件,得到第一重建图像,其中,第一像素点与至少一个第二像素点的颜色类型不相同,所述第一像素点是所述第一重建图像中所述至少一个中任意一个事件对应的像素点,所述至少一个第二像素点包括于所述第一重建图像中与所述第一像素点相邻的多个像素点中。
因此,在本申请实施方式中,在拍摄对象和运动传感器存在相对运动的情况下,可以基于运动传感器采集到的数据来进行图像重建,得到重建后的图像,即使在RGB传感器拍摄不清楚的情况下,也可以得到清晰的图像。
在一种可能的实施方式中,所述根据所述事件图像中包括的至少一个事件,确定与所述事件图像中每个像素点对应的颜色类型,得到第一重建图像,包括:按照第一方向扫描所述事件图像中每个像素点,确定与所述事件图像中每个像素点对应的颜色类型,得到第一重建图像,其中,若扫描到所述第一像素点具有事件,则确定所述第一像素点的颜色类型为第一颜色类型,且若按照所述第一方向排列在所述第一像素点之前的第二像素点不具有事件,则所述第二像素点对应的颜色类型为第二颜色类型,所述第一颜色类型和所述第二颜色类型是不同的颜色类型,具有事件的像素点表示由所述运动传感器监测到存在变化的位置在所述事件图像中对应的像素点。
本申请实施方式中,可以通过对事件图像进行扫描的方式,基于事件图像中每个像素 点的事件来进行图像重建,从而得到更清晰的事件图像。因此,在本申请实施方式中,可以使用运动传感器采集到的信息来进行图像重建,高效快速地得到重建图像,从而提高后续对重建图像进行图像识别、图像分类等的效率。即使在一些拍摄运动物体或者存在拍摄抖动等场景中,拍摄不到清晰的RGB图像,也可以通过对运动传感器采集到的信息来进行图像重建,可以快速准确地重建出更清晰的图像,以便于进行后续的识别或者分类等任务。
在一种可能的实施方式中,所述第一方向是预先设置的方向、或者所述第一方向是根据IMU采集到的数据确定的,或者,所述第一方向是根据色彩RGB摄像头拍摄到的图像确定的。因此,在本申请实施方式中,扫描事件图像的方向可以通过多种方式确定,适应更多的场景。
在一种可能的实施方式中,若按照所述第一方向排列在所述第一像素点之后的连续多个第三像素点不具有事件,则所述多个第三像素点对应的颜色类型为所述第一颜色类型。因此,本申请实施方式中,当存在多个连续的像素点不具有事件时,则连续的像素点对应的颜色类型相同,避免因实际场景中同一物体运动导致的边缘不清晰的情况。
在一种可能的实施方式中,若按照所述第一方向排列在所述第一像素点之后且与所述第一像素点相邻的第四像素点具有事件,且按照所述第一方向排列在所述第四像素点之后且与所述第四像素点相邻的第五像素点不具有事件,则所述第四像素点和所述第五像素点对应的颜色类型都为所述第一颜色类型。
因此,当事件图像中存在至少两个连续的像素点都具有事件时,在扫描到第二个事件时,可以不改变重建颜色类型,从而避免因目标对象的边缘过宽而导致的重建图像边缘不清晰。
在一种可能的实施方式中,所述按照第一方向扫描所述事件图像中每个像素点,确定与所述事件图像中每个像素点对应的颜色类型,得到第一重建图像之后,所述方法还包括:按照第二方向扫描所述事件图像,确定与所述事件图像中每个像素点对应的颜色类型,得到第二重建图像,所述第二方向与所述第一方向不同;对所述第一重建图像和所述第二重建图像进行融合,得到更新后的所述第一重建图像。
在本申请实施方式中,可以按照不同的方向对事件图像进行扫描,从而从多个方向得到多个重建图像,然后对该多个重建图像进行融合,得到更准确的重建图像。
在一种可能的实施方式中,所述方法还包括:若所述第一重建图像不符合预设要求,则更新运动信息,并根据更新后的运动信息更新事件图像,并根据更新后的事件图像得到更新后的第一重建图像。
在本申请实施方式中,可以结合运动传感器采集到的信息对事件图像进行更新,使更新后的事件图像更清晰。
在一种可能的实施方式中,在所述根据所述事件图像中包括的至少一个事件,确定与所述事件图像中每个像素点对应的颜色类型,得到第一重建图像之前,所述方法还包括:根据所述目标对象与所述运动传感器之间进行相对运动时的运动参数,对所述事件图像进行补偿,得到补偿后的所述事件图像,所述运动参数包括以下一项或者多项:深度、光流信息、所述运动传感器进行运动的加速度或所述运动传感器进行运动的角速度,所述深度 表示所述运动传感器和所述目标对象之间的距离,所述光流信息表示所述运动传感器和所述目标对象之间的相对运动的运动速度的信息。
因此,在本申请实施方式中,还可以结合运动参数对事件图像进行运动补偿,从而使事件图像更清晰,进而重建得到的重建图像也更清晰。
在一种可能的实施方式中,重建图像中的像素点的颜色类型,是根据色彩RGB摄像头采集到的颜色确定的。本申请实施方式中,可以根据RGB摄像头来确定实际场景中的色彩,从而使重建后的图像的颜色与实际场景中的颜色相匹配,提高用户体验。
在一种可能的实施方式中,所述方法还包括:根据RGB摄像头采集到的数据得到RGB图像;对所述RGB图像与所述第一重建图像进行融合,得到更新后的所述第一重建图像。因此,本申请实施方式中,可以融合RGB图像和重建图像,使最终得到的重建图像更清晰。
第十八方面,本申请还提供了一种图像处理装置,该图像处理装置具有实现上述第十八方面或第十八方面任意一种可能实现方式的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第十九方面,本申请提供一种图像处理的方法,包括:获取第一事件图像(事件图像)和拍摄到的多张第一图像,所述第一事件图像包括在所述多张第一图像的拍摄时间段内预设范围中运动的对象的信息,所述多张第一图像对应的曝光时长不相同,所述预设范围为摄像头的拍摄范围;根据所述第一事件图像计算所述多张第一图像中每张第一图像对应的第一抖动程度,所述第一抖动程度用于表示拍摄所述多张第一图像时摄像头抖动的程度;根据所述每张第一图像对应的第一抖动程度确定所述多张第一图像中每张第一图像的融合权重,其中,所述多张第一图像对应的第一抖动程度和融合权重呈负相关关系;根据所述每张第一图像的融合权重融合所述多张第一图像,得到目标图像。
因此,在本申请实施方式中,可以通过事件图像,来量化拍摄RGB图像时的抖动程度,并根据每张RGB图像的抖动程度,确定每张RGB图像的融合权重。通常,抖动程度低的RGB图像对应的融合权重也就越高,从而使最终得到的目标图像包括的信息更倾向于更清晰的RGB图像,从而得到更清晰的目标图像。通常,抖动程度较高的RGB图像,对应的权重值也越小,抖动程度低的RGB图像,对应的权重值也就越大,从而使最终得到的目标图像所包括的信息更倾向于更清晰的RGB图像所包括的信息,使最终得到的目标图像更清晰,提高用户体验。且若该目标图像用于后续的图像识别或者特征提取等,得到的识别结果或者提取到的特征也更准确。
在一种可能的实施方式中,在所述根据所述第一抖动程度确定所述多张第一图像中每张第一图像的融合权重之前,所述方法还包括:若所述第一抖动程度不高于第一预设值且高于第二预设值,则对所述每张第一图像进行去抖动处理,得到去抖动后的所述每张第一图像。
因此,在本申请实施方式中,可以基于动态数据区分抖动情况,在没有抖动时直接融合,在抖动不强时自适应地对RGB图像进行去抖动,而在抖动强烈时补充拍摄RGB图像,使用了多种抖动程度的场景,泛化能力强。
在一种可能的实施方式中,所述根据所述第一抖动程度确定所述多张第一图像中每张第一图像的融合权重,包括:若所述第一抖动程度高于第一预设值,则重新拍摄得到第二图像,所述第二图像的第二抖动程度不高于所述第一预设值;根据所述每张第一图像的第一抖动程度计算所述每张第一图像的融合权重,以及根据所述第二抖动程度计算所述第二图像的融合权重;所述根据所述每张第一图像的融合权重融合所述多张第一图像,得到目标图像,包括:根据所述每张第一图像的融合权重和所述第二图像的融合权重,融合所述多张第一图像和所述第二图像,得到所述目标图像。
通常,抖动程度较高的RGB图像,对应的权重值也越小,抖动程度低的RGB图像,对应的权重值也就越大,从而使最终得到的目标图像所包括的信息更倾向于更清晰的RGB图像所包括的信息,使最终得到的目标图像更清晰,提高用户体验。且若该目标图像用于后续的图像识别或者特征提取等,得到的识别结果或者提取到的特征也更准确。针对抖动程度高的RGB图像,可以补拍RBG图像,得到抖动程度更低、更清晰的RGB图像,以使后续再进行图像融合时,可以使用更清晰的图像进行融合,进而使最终得到的目标图像也更清晰。
在一种可能的实施方式中,所述重新拍摄得到第二图像之前,所述方法还包括:获取第二事件图像,所述第二事件图像为在获取所述第一事件图像之前得到;根据所述第二事件图像包括的信息计算得到曝光参数,所述曝光参数用于拍摄所述第二图像。
因此,在本申请实施方式中,利用动态感知摄像头(即运动传感器)采集到的信息自适应地调整曝光策略,即利用动态感知信息对拍摄范围内的纹理的高动态范围感知特性,自适应补充拍摄曝光时长合适的图像,提升相机捕捉强光区或者暗光区纹理信息的能力。
在一种可能的实施方式中,所述重新拍摄得到第二图像,还包括:将所述第一事件图像切分为多个区域,以及将第三图像切分为多个区域,所述第三图像为所述多张第一图像中曝光值最小的第一图像,且所述第一事件图像所包括的多个区域与所述第三图像包括的多个区域的位置相对应,所述曝光值包括曝光时长、曝光量或者曝光级数中的至少一种;计算所述第一事件图像中的每个区域是否包括第一纹理信息,以及所述第三图像中每个区域是否包括第二纹理信息;若所述第一事件图像中的第一区域包括所述第一纹理信息,且所述第三图像中与所述第一区域对应的区域不包括所述第二纹理信息,则根据所述曝光参数进行拍摄,得到所述第二图像,所述第一区域时所述第一动态区域中的任一区域。
因此,在本申请实施方式中,若第一动态区域中的某一个区域包括了纹理信息,且曝光值最小的RGB图像中与该区域相同的区域中不包括纹理信息,则表示RGB图像中的该区域模糊程度较高,可以补拍RGB图像。而若第一事件图像中每个区域都不包括纹理信息,则无需补拍RGB图像。
第二十方面,本申请提供一种图像处理方法,包括:首先,检测目标对象的运动信息,该运动信息中可以包括目标对象在预设范围内的进行运动时的运动轨迹的信息,该预设范围为摄像头拍摄范围;然后,根据运动信息确定对焦信息,对焦信息包括对预设范围内的目标对象进行对焦的参数;随后,根据对焦信息在预设范围中对目标对象进行对焦,并拍摄预设范围的图像。
因此,在本申请实施方式中,可以检测摄像头的拍摄范围内目标对象的运动轨迹,然后根据目标对象的运动轨迹确定对焦信息并完成对焦,从而可以拍摄到更清晰的图像。即使目标对象处于运动中,也可以准确地对目标对象进行对焦,拍摄到清晰的运动状态的图像,提高用户体验。
在一种可能的实施方式中,上述的根据运动信息确定对焦信息,可以包括:根据运动信息,即目标对象在预设范围内的进行运动时的运动轨迹的信息,对预设时长内目标对象的运动轨迹进行预测,得到预测区域,所述预测区域为预测得到的所述预设时长内所述目标对象所在的区域;根据预测区域确定对焦区域,对焦区域包括对目标对象进行对焦的至少一个对焦点,对焦信息包括至少一个对焦点的位置信息。
因此,在本申请实施方式中,可以对目标对象未来的运动轨迹进行预测,并根据预测区域确定对焦区域,可以准确地完成对目标对象的对焦。即使目标对象处于高速运动,本申请实施方式也可以通过预测的方式提前对目标对象进行对焦,使目标对象处于对焦区域,从而拍摄到更清晰的高速运动的目标对象。
在一种可能的实施方式中,根据所述预测区域确定对焦区域,可以包括:若预测区域符合预设条件,则将预测区域确定为对焦区域;若预测区域不符合预设条件,则重新根据运动信息对预设时长内目标对象的运动轨迹进行预测,得到新的预测区域,并根据新的预测区域确定对焦区域。该预设条件可以是预测区域中包括完整的目标对象,或者预测区域的面积大于预设值等。
因此,在本申请实施方式中,只有当预测区域符合预设条件时,才根据预测区域确定对焦区域,并触发摄像头拍摄,当预测区域不符合预设条件时,则不触发摄像头进行拍摄,从而可以避免拍摄到的图像中目标对象不完整,或者可以避免无意义的拍摄。并且,在未进行拍摄时,摄像头可以处于未启动状态,仅当预测区域满足预设条件时,才触发摄像头进行拍摄,可以降低摄像头产生的功耗。
在一种可能的实施方式中,运动信息还包括目标对象的运动方向和运动速度中的至少一种;上述的根据运动信息对预设时长内目标对象的运动轨迹进行预测,得到预测区域,可以包括:根据目标对象在预设范围内进行运动时的运动轨迹,以及运动方向和/或运动速度对预设时长内目标对象的运动轨迹进行预测,得到预测区域。
因此,本申请实施方式中,可以根据目标对象在预设范围内的运动轨迹,以及运动方向和/或运动速度等,对未来的预设时长内目标对象的运动轨迹进行预测,从而可以对目标对象未来预设时长内目标对象所在的区域进行准确的预测,进而可以对目标对象进行更准确的对焦,进而可以拍摄到更清晰的图像。
在一种可能的实施方式中,上述的根据目标对象在预设范围内进行运动时的运动轨迹,以及运动方向和/或运动速度对预设时长内目标对象的运动轨迹进行预测,得到预测区域,可以包括:根据目标对象在预设范围内进行运动时的运动轨迹,以及运动方向和/或运动速度,拟合出目标对象的所在区域的中心点随时间变化的变化函数;随后根据变化函数计算出预测中心点,预测中心点为预测得到的预设时长内目标对象所在的区域的中心点;根据预测中心点得到预测区域。
因此,本申请实施方式中,可以根据目标对象进行运动时的运动轨迹,拟合目标对象所在的区域中心点随时间变化的变化函数,然后根据该变化函数预测出未来某一时刻目标对象所在区域的中心点,根据该中心点确定预测区域,进而可以对目标对象进行更准确的对焦,进而可以拍摄到更清晰的图像。
在一种可能的实施方式中,预测范围的图像可以由RGB摄像头拍摄,上述的根据对焦信息在预设范围中对目标对象进行对焦,可以包括:将RGB摄像头的多个对焦点中,与对焦区域的中心点的范数距离最小的至少一个点作为对焦点进行对焦。
因此,在本申请实施方式中,可以选择与对焦区域的中心点的范数距离最近的至少一个点作为对焦点,并进行对焦,从而完成对目标对象的对焦。
在一种可能的实施方式中,运动信息中包括目标对象的当前所在的区域,上述的根据运动信息确定对焦信息,可以包括:将目标对象的当前所在的区域确定为对焦区域,对焦区域包括对目标对象进行对焦的至少一个对焦点,对焦信息包括至少一个对焦点的位置信息。
因此,本申请实施方式中,目标对象在预设范围内的运动轨迹的信息可以包括目标对象当前所在的区域和目标对象历史所在的区域,可以将目标对象当前所在的区域,作为对焦区域,从而完成对目标对象的对焦,进而可以拍摄到更清晰的图像。
在一种可能的实施方式中,在拍摄预设范围的图像之前,上述方法还可以包括:获取曝光参数;上述的拍摄预设范围的图像,可以包括:根据曝光参数拍摄预设范围的图像。
因此,本申请实施方式中,还可以调整曝光参数,从而通过曝光参数完成拍摄,得到清晰的图像。
在一种可能的实施方式中,上述的获取曝光参数,可以包括:根据运动信息确定曝光参数,其中,曝光参数包括曝光时长,运动信息中包括目标对象的运动速度,曝光时长与目标对象的运动速度呈负相关关系。
因此,在本申请实施方式中,可以通过目标对象的运动速度确定曝光时长,使曝光时长与目标对象的运动速度匹配,如运动速度越快,曝光时长越短,运动速度越慢,则曝光时长越长。可以避免过曝或者曝光不足等,从而使后续可以拍摄到更清晰的图像,提高用户体验。
在一种可能的实施方式中,上述的获取曝光参数,可以包括:根据光照强度确定曝光参数,其中,曝光参数包括曝光时长,预设范围内的光照强度的大小与曝光时长呈负相关关系。
因此,本申请实施方式中,可以根据检测到的光照强度确定曝光时长,当光照强度越大时,曝光时长越短,光照强度越小时,曝光时长越长,从而可以保障适量的曝光量,拍摄到更清晰的图像。
在一种可能的实施方式中,在摄预设范围的图像之后,上述方法还可以包括:根据监测到的目标对象与图像对应的运动的信息,对预设范围内的图像进行融合,得到预设范围内的目标图像。
因此,本申请实施方式中,在拍摄图像的同时,还可以对预设范围内目标对象的运动 情况进行监测,获取到目标对象在图像中对应的运动的信息,如目标对象的轮廓、目标对象在预设范围内的位置等信息,并通过该信息对拍摄到的图像进行增强处理,得到更清晰的目标图像。
在一种可能的实施方式中,上述的检测预设范围内的目标对象的运动信息,可以包括:通过动态视觉传感器(dynamic vision sensor,DVS)对预设范围内的目标对象的运动情况进行监测,得到运动信息。
因此,本申请实施方式中,可以通过DVS对摄像头的拍摄范围进行运动的对象的监测,从而得到准确的运动信息,即使目标对象处于高速运动的状态,也可以通过DVS及时捕获到目标对象的运动信息。
第二十一方面,本申请还提供了一种图像处理装置,该图像处理装置具有实现上述第十九方面或第十九方面任意一种可能实现方式的方法的功能,或者该图像处理装置具有实现上述第二十方面或第二十方面任意一种可能实现方式的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第二十二方面,本申请实施例提供一种图形用户界面GUI,其特征在于,该图形用户界面存储在电子设备中,该电子设备包括显示屏、存储器、一个或多个处理器,该一个或多个处理器用于执行存储在该存储器中的一个或多个计算机程序,该图形用户界面包括:响应于针对目标对象进行拍摄的触发操作,以及根据对焦信息拍摄预设范围的图像,显示该预设范围的图像,该预设范围为摄像头拍摄范围,该对焦信息包括对该预设范围内的该目标对象进行对焦的参数,该对焦信息为根据该目标对象的运动信息确定,所述运动信息包括所述目标对象在预设范围内的进行运动时的运动轨迹的信息。
第二十二方面及第二十二方面任一种可能的实施方式产生的有益效果可参照第二十方面及第二十方面任一种可能实施方式的描述。
在一种可能的实施方式中,该图形用户界面还可以包括:响应于该运动信息对预设时长内该目标对象的运动轨迹进行预测,得到预测区域,所述预测区域为预测得到的所述预设时长内所述目标对象所在的区域,以及根据该预测区域确定该对焦区域,在该显示屏中显示该对焦区域,对焦区域包括对目标对象进行对焦的至少一个对焦点,对焦信息包括至少一个对焦点的位置信息。
在一种可能的实施方式中,该图形用户界面具体可以包括:若该预测区域符合预设条件,则响应于根据该预测区域确定该对焦区域,在该显示屏中显示该对焦区域;若该预测区域不符合预设条件,则响应于重新根据该运动信息对预设时长内该目标对象的运动轨迹进行预测,得到新的预测区域,以及根据该新的预测区域确定该对焦区域,在该显示屏中显示该对焦区域。
在一种可能的实施方式中,该运动信息还包括该目标对象的运动方向和运动速度中的至少一种;该图形用户界面具体可以包括:响应于根据该目标对象在预设范围内的进行运动时的运动轨迹,以及该运动方向和/或该运动速度对预设时长内该目标对象的运动轨迹进行预测,得到该预测区域,在该显示屏中显示该预测区域。
在一种可能的实施方式中,该图形用户界面具体可以包括:响应于根据所述目标对象在预设范围内的进行运动时的运动轨迹,以及所述运动方向和/或所述运动速度,拟合出所述目标对象的所在的区域的中心点随时间变化的变化函数,以及根据所述变化函数计算出预测中心点,所述预测中心点为预测得到的所述目标对象所在的区域的中心点,并根据所述预测中心点得到所述预测区域,在显示屏中显示该预测区域。
在一种可能的实施方式中,所述预测范围的图像由RGB摄像头拍摄,该图形用户界面具体可以包括:响应于将所述RGB摄像头的多个对焦点中,与所述对焦区域的中心点的范数距离最小的至少一个点作为对焦点进行对焦,在显示屏中显示基于该至少一个点作为对焦点进行对焦后拍摄到的图像。
在一种可能的实施方式中,该运动信息中包括该目标对象的当前所在的区域,该图形用户界面具体可以包括:响应于将目标对象的当前所在的区域作为该对焦区域,对焦区域包括对目标对象进行对焦的至少一个对焦点,对焦信息包括至少一个对焦点的位置信息,在该显示屏中显示该对焦区域。
在一种可能的实施方式中,该图形用户界面还可以包括:响应于根据监测到的该目标对象与该图像对应的运动的信息,对该预设范围内的图像进行融合,得到该预设范围内的目标图像,在该显示屏中显示该目标图像。
在一种可能的实施方式中,该运动信息为通过动态视觉传感器DVS对该预设范围内的目标对象的运动情况进行监测得到。
在一种可能的实施方式中,该图形用户界面具体可以包括:响应于在所述拍摄所述预设范围的图像之前,获取曝光参数,在显示屏中显示该曝光参数;响应于根据所述曝光参数拍摄所述预设范围的图像,在显示屏中显示该根据所述曝光参数拍摄所述预设范围的图像。
在一种可能的实施方式中,曝光参数为根据所述运动信息确定,所述曝光参数包括曝光时长,所述曝光时长与所述目标对象的运动速度呈负相关关系。
在一种可能的实施方式中,曝光参数为根据光照强度确定,该光照强度可以是由摄像头检测到的光照强度,也可以是运动传感器检测到的光照强度,所述曝光参数包括曝光时长,所述预设范围内的光照强度的大小与所述曝光时长呈负相关关系。
第二十三方面,本申请提供一种图像处理方法,该方法包括:首先,通过具备运动传感器(如,DVS)和RGB传感器的摄像头分别获取到事件流和一帧RGB图像(可称为第一RGB图像),其中,获取到的事件流包括至少一帧事件图像,该至少一帧事件图像中的每帧事件图像都是由目标对象(即运动物体)在运动传感器的监视范围内进行运动时的运动轨迹信息生成,而该第一RGB图像为在曝光时长内被摄像头捕捉到的每个时刻下拍摄场景的叠加。获取到事件流和第一RGB图像后,就可以根据事件流构建蒙版,蒙版用于确定事件流中的每帧事件图像的运动区域,也就是用于确定RGB图像中运动物体所处的位置。根据上述步骤得到事件流、第一RGB图像和蒙版之后,就可以根据该事件流、第一RGB图像和蒙版得到第二RGB图像,第二RGB图像为去除目标对象的RGB图像。
在本申请上述实施方式中,可以只基于一张RGB图像和事件流去除运动物体,从而得 到无运动物体的RGB图像,相比现有技术中需要通过多张RGB图像和事件流才能去除运动物体的方式,只需要用户拍摄一张RGB图像,用户体验更佳。
在一种可能的实现方式中,在根据事件流构建蒙版之前,所述方法还可以包括:当所述运动传感器在第一时刻监测到所述监视范围内出现运动突变,触发所述摄像头拍摄第三RGB图像;所述根据所述事件流、所述第一RGB图像和所述蒙版得到第二RGB图像包括:根据所述事件流、所述第一RGB图像、所述第三RGB图像和所述蒙版得到第二RGB图像。在这种情况下,根据所述事件流、所述第一RGB图像和所述蒙版得到第二RGB图像则可以是:根据所述事件流、所述第一RGB图像、所述第三RGB图像和所述蒙版得到第二RGB图像。
在本申请上述实施方式中,可以通过判断运动传感器采集的运动数据是否存在运动突变,当存在运动突变时,则触发摄像头拍摄第三RGB图像,之后再根据上述类似的方式获取事件流和一帧第一RGB图像,并根据事件流构建蒙版,最后再根据事件流、第一RGB图像、第三RGB图像和蒙版得到无运动前景的第二RGB图像。得到的第三RGB图像由于是通过运动突变情况下触发摄像头自动抓拍的,灵敏度高,从而可以在用户察觉到有运动物体变化之初就能得到一帧图像,基于该第三RGB图像和第一RGB图像可以对运动物体实现更好的移除效果。
在一种可能的实现方式中,运动传感器在第一时刻监测到所述监视范围内出现运动突变包括:在所述监视范围内,运动传感器在第一时刻采集到的第一事件流的产生区域与运动传感器在第二时刻采集到的第二事件流的产生区域之间的重叠部分小于预设值。
在本申请上述实施方式中,具体阐述了运动突变的判定条件,具备可实现性。
在一种可能的实现方式中,根据事件流构建蒙版的方式可以是:首先,可将运动传感器的监视范围划分为多个预设邻域(设为邻域k),然后,在每个邻域k范围内,当事件流在预设时长Δt范围内的事件图像数量超过阈值P,则确定对应的该邻域为运动区域,该运动区域可标记为0,若事件流在预设时长Δt范围内的事件图像数量没有超过阈值P,则确定对应的该邻域为背景区域,该背景区域可标记为1。
在本申请上述实施方式中,具体阐述了一种构建蒙版的方法,简单易操作。
第二十四方面,本申请还提供了一种图像处理装置,该图像处理装置具有实现上述第二十二方面或第二十二方面任意一种可能实现方式的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第二十五方面,本申请提供一种位姿估计方法,应用于同步定位与建图(simultaneous localization and mapping,SLAM)场景。该方法包括:终端获取第一事件图像和第一RGB图像,所述第一事件图像与所述第一目标图像时序对齐,所述第一目标图像包括RGB图像或深度图像。所述第一事件图像为表示所述目标对象在运动传感器的检测范围内产生运动时的运动轨迹的图像。终端确定第一事件图像的积分时间。若所述积分时间小于第一阈值,则终端确定不通过所述第一目标图像来执行位姿估计。终端根据所述第一事件图像执行位姿估计。
本方案中,在终端基于事件图像的积分时间小于阈值来确定当前处于RGB相机难以采集有效环境信息的场景时,终端确定不通过质量较差的RGB图像来执行位姿估计,以提高位姿估计的精度。
可选的,在一种可能的实现方式中,所述方法还包括:确定所述第一事件图像的获取时间和所述第一目标图像的获取时间;根据所述第一目标图像的获取时间与所述第一事件图像的获取时间之间的时间差小于第二阈值,确定第一事件图像与第一目标图像时序对齐。其中,第二阈值可以根据SLAM的精度以及RGB相机采集RGB图像的频率来决定,例如第二阈值可以取值为5毫秒或10毫秒。
可选的,在一种可能的实现方式中,所述获取第一事件图像,包括:获取N个连续的DVS事件;将所述N个连续的DVS事件积分为第一事件图像;所述方法还包括:根据所述N个连续的DVS事件的获取时间确定所述第一事件图像的获取时间。
可选的,在一种可能的实现方式中,所述确定第一事件图像的积分时间,包括:确定用于积分为所述第一事件图像的N个连续的DVS事件;根据所述N个连续的DVS事件中的第一个DVS事件和最后一个DVS事件的获取时间,确定所述第一事件图像的积分时间。由于第一事件图像是由N个连续的DVS事件积分得到的,终端可以根据N个连续的DVS事件所对应的获取时间来确定第一事件图像的获取时间,即确定第一事件图像的获取时间为所述N个连续的DVS事件中获取到第一个DVS事件至最后一个DVS事件的时间段。
可选的,在一种可能的实现方式中,所述方法还包括:获取第二事件图像,所述第二事件图像为表示所述目标对象在运动传感器的检测范围内产生运动时的运动轨迹的图像。其中,运动传感器检测获得第一事件图像的时间段与运动传感器检测获得第二事件图像的时间段不相同。若不存在有与所述第二事件图像时序对齐的RGB图像,则确定所述第二事件图像不具有用于共同执行位姿估计的RGB图像;根据所述第二事件图像执行位姿估计。
可选的,在一种可能的实现方式中,所述根据所述第二事件图像确定位姿之前,所述方法还包括:若确定所述第二事件图像具有时序对齐的惯性测量单元IMU数据,则根据所述第二事件图像和所述第二事件图像对应的IMU数据确定位姿;若确定所述第二事件图像不具有时序对齐的惯性测量单元IMU数据,则仅根据所述第二事件图像确定位姿。
可选的,在一种可能的实现方式中,所述方法还包括:获取第二目标图像,所述第二目标图像包括RGB图像或深度图像;若不存在有与所述第二目标图像时序对齐的事件图像,则确定所述第二目标图像不具有用于共同执行位姿估计的事件图像;根据所述第二目标图像确定位姿。
可选的,在一种可能的实现方式中,所述方法还包括:根据所述第一事件图像和字典执行回环检测,所述字典为基于事件图像所构建的字典。也就是说,在执行回环检测之前,终端可以预先基于事件图像构建字典,以便于在执行回环检测的过程中能够基于字典执行回环检测。
可选的,在一种可能的实现方式中,所述方法还包括:获取多个事件图像,所述多个事件图像为用于训练的事件图像,所述多个事件图像可以是终端在不同的场景下所拍摄的事件图像。获取所述多个事件图像的视觉特征,视觉特征例如可以包括图像的纹理、图案 或灰度统计等特征。通过聚类算法对所述视觉特征进行聚类,得到聚类后的视觉特征,所述聚类后的视觉特征具有对应的描述子。通过对视觉特征进行聚类,可以将相似的视觉特征归为一类,以便于后续执行视觉特征的匹配。最后,根据所述聚类后的视觉特征,构建所述字典。
可选的,在一种可能的实现方式中,所述根据所述第一事件图像和字典执行回环检测,包括:确定所述第一事件图像的描述子;在所述字典中确定所述第一事件图像的描述子对应的视觉特征;基于所述视觉特征确定所述第一事件图像对应的词袋向量;确定所述第一事件图像对应的词袋向量与其他事件图像的词袋向量之间的相似度,以确定所述第一事件图像所匹配的事件图像。
第二十六方面,本申请提供一种关键帧选择方法,包括:获取事件图像;确定所述事件图像的第一信息,所述第一信息包括所述事件图像中的事件和/或特征;若基于所述第一信息确定所述事件图像至少满足第一条件,则确定所述事件图像为关键帧,所述第一条件与事件数量和/或特征数量相关。
本方案中,通过确定事件图像中的事件数量、事件分布、特征数量和/或特征分布等信息,来判断当前事件图像是否为关键帧,能够实现关键帧的快速选择,算法量小,能够满足视频分析、视频编解码或安防监控等场景的关键帧快速选择。
可选的,在一种可能的实现方式中,所述第一条件包括:所述事件图像中的事件数量大于第一阈值、所述事件图像中的事件有效区域的数量大于第二阈值、所述事件图像中的特征数量大于第三阈值和所述事件图像中的特征有效区域大于第四阈值中的一个或多个。
可选的,在一种可能的实现方式中,所述方法还包括:获取与所述事件图像时序对齐的深度图像;若基于所述第一信息确定所述事件图像至少满足第一条件,则确定所述事件图像和所述深度图像为关键帧。
可选的,在一种可能的实现方式中,所述方法还包括:获取与所述事件图像时序对齐的RGB图像;获取所述RGB图像的特征数量和/或特征有效区域;若基于所述第一信息确定所述事件图像至少满足第一条件,且所述RGB图像的特征数量大于第五阈值和/或所述RGB图像的特征有效区域的数量大于第六阈值,则确定所述事件图像和所述RGB图像为关键帧。
可选的,在一种可能的实现方式中,所述若基于所述第一信息确定所述事件图像至少满足第一条件,则确定所述事件图像为关键帧,包括:若基于所述第一信息确定所述事件图像至少满足所述第一条件,则确定所述事件图像的第二信息,所述第二信息包括所述事件图像中的运动特征和/或位姿特征;若基于所述第二信息确定所述事件图像至少满足第二条件,确定所述事件图像为关键帧,所述第二条件与运动变化量和/或位姿变化量相关。
可选的,在一种可能的实现方式中,所述方法还包括:确定所述事件图像的清晰度和/或亮度一致性指标;若基于所述第二信息确定所述事件图像至少满足所述第二条件,且所述事件图像的清晰度大于清晰度阈值和/或所述事件图像的亮度一致性指标大于预设指标阈值,则确定所述事件图像为关键帧。
可选的,在一种可能的实现方式中,所述确定所述事件图像的亮度一致性指标,包括:若所述事件图像中的像素表示光强变化极性,则计算所述事件图像的事件数量与相邻的关 键帧的事件数量的差值的绝对值,并将所述绝对值除以所述事件图像的像素数量,得到所述事件图像的亮度一致性指标;若所述事件图像中的像素表示光强,则将所述事件图像和相邻的关键帧逐像素求差,并计算差值的绝对值,对每组像素对应的绝对值进行求和运算,并将得到的求和结果除以像素数量,得到所述事件图像的亮度一致性指标。
可选的,在一种可能的实现方式中,所述方法还包括:获取与所述事件图像时序对齐的RGB图像;确定所述RGB图像的清晰度和/或亮度一致性指标;若基于所述第二信息确定所述事件图像至少满足第二条件,且所述RGB图像的清晰度大于清晰度阈值和/或所述RGB图像的亮度一致性指标大于预设指标阈值,则确定所述事件图像和所述RGB图像为关键帧。
可选的,在一种可能的实现方式中,所述第二条件包括:所述事件图像与上一个关键帧的距离超过预设距离值、所述事件图像与上一个关键帧的旋转角度超过预设角度值以及所述事件图像与上一个关键帧的距离超过预设距离值且所述事件图像与上一个关键帧的旋转角度超过预设角度值中的一个或多个。
第二十七方面,本申请提供一种位姿估计方法,包括:获取第一事件图像和所述第一事件图像对应的目标图像,所述第一事件图像和所述图像所捕捉的环境信息相同,所述目标图像包括深度图像或RGB图像;确定所述第一事件图像中的第一运动区域;根据所述第一运动区域确定所述图像中对应的第二运动区域;根据所述图像中的第二运动区域进行位姿估计。
本方案中,通过事件图像来捕捉场景中的动态区域,并基于该动态区域进行位姿确定,从而能够准备地确定位姿信息。
可选的,在一种可能的实现方式中,所述确定所述第一事件图像中的第一运动区域,包括:若采集所述第一事件图像的动态视觉传感器DVS为静止的,则获取所述第一事件图像中有事件响应的像素点;根据所述有事件响应的像素点确定所述第一运动区域。
可选的,在一种可能的实现方式中,所述根据所述有事件响应的像素点确定所述第一运动区域,包括:确定由所述第一事件图像中有事件响应的像素点构成的轮廓;若所述轮廓所包围的面积大于第一阈值,则确定所述轮廓所包围的区域为第一运动区域。
可选的,在一种可能的实现方式中,所述确定所述第一事件图像中的第一运动区域,包括:若采集所述第一事件图像的DVS为运动的,则获取第二事件图像,所述第二事件图像为所述第一事件图像的前一帧事件图;计算所述第一事件图像中的像素相对于所述第二事件图像的位移大小以及位移方向;若所述第一事件图像中的像素的位移方向与周围像素的位移方向不相同,或所述第一事件图像中的像素的位移大小与周围像素的位移大小之间的差值大于第二阈值,则确定所述像素属于第一运动区域。
可选的,在一种可能的实现方式中,所述方法还包括:根据所述第一运动区域确定所述图像中对应的静止区域;根据所述图像中的静止区域确定位姿。
第二十八方面,本申请还提供了一种数据处理装置,该数据处理装置具有实现上述第二十五方面或第二十五方面任意一种可能实现方式的方法的功能,或者,该数据处理装置具有实现上述第二十六方面或第二十六方面任意一种可能实现方式的方法的功能,或者,该数据处理装置具有实现上述第二十七方面或第二十七方面任意一种可能实现方式的方法 的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第二十九方面,本申请实施例提供一种装置,包括:处理器和存储器,其中,处理器和存储器通过线路互联,处理器调用存储器中的程序代码用于执行上述第一方面至第二十七方面中任一项所示的方法中与处理相关的功能。可选地,该装置可以是芯片。
第三十方面,本申请提供一种电子设备,该电子设备包括:显示模块、处理模块和存储模块。
该显示模块用于显示存储在存储模块中的应用程序的图形用户界面,该图形用户界面可以是前述任一项所述的图形用户界面。
第三十一方面,本申请实施例提供了一种装置,该装置也可以称为数字处理芯片或者芯片,芯片包括处理单元和通信接口,处理单元通过通信接口获取程序指令,程序指令被处理单元执行,处理单元用于执行如上述第一方面至第二十七方面中任一可选实施方式中与处理相关的功能。
第三十二方面,本申请实施例提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行上述第一方面至第二十七方面中任一可选实施方式中的方法。
第三十三方面,本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面至第二十七方面中任一可选实施方式中的方法。
附图说明
图1A为本申请提供的一种系统架构示意图;
图1B为本申请提供的一种电子设备的结构示意图;
图2为本申请提供的另一种系统架构示意图;
图3-a为基于事件流的异步读取模式读取数据量与时间的关系的示意图;
图3-b为基于帧扫描的同步读取模式读取数据量与时间的关系的示意图;
图4-a为本申请提供的一种视觉传感器的框图;
图4-b为本申请提供的另一种视觉传感器的框图;
图5为根据本申请的实施例的基于帧扫描的同步读取模式和基于事件流的异步读取模式的原理的示意图;
图6-a为根据本申请的实施例的视觉传感器在基于帧扫描的读取模式下操作的示意图;
图6-b为根据本申请的实施例的视觉传感器在基于事件流的读取模式下操作的示意图;
图6-c为根据本申请的实施例的视觉传感器在基于事件流的读取模式下操作的示意图;
图6-d为根据本申请的实施例的视觉传感器在基于帧扫描的读取模式下操作的示意图;
图7为根据本申请的可能的实施例的用于操作视觉传感器芯片的方法的流程图;
图8为本申请提供的一种控制电路的框图;
图9为本申请提供的一种电子设备的框图;
图10为单一数据读取模式与根据本申请的可能的实施例的自适应切换读取模式的数 据量随时间变化的示意图;
图11为本申请提供的一种像素电路的示意图;
图11-a为通过光强信息表示事件和通过极性信息表示事件的示意图;
图12-a为本申请中读取电路中数据格式控制单元的一种结构示意图;
图12-b为本申请中读取电路中数据格式控制单元的另一种结构示意图;
图13为本申请提供的另一种控制电路的框图;
图14为本申请提供的另一种控制电路的框图;
图15为本申请提供的另一种控制电路的框图;
图16为本申请提供的另一种控制电路的框图;
图17为本申请提供的另一种控制电路的框图;
图18为单一事件表示方式与根据本申请提供的自适应转换事件表示方式的区别示意图;
图19为本申请提供的另一种电子设备的框图;
图20为根据本申请的可能的实施例的用于操作视觉传感器芯片的方法的流程图;
图21为本申请提供的另一种像素电路的示意图;
图22为本申请提供的一种编码方式的流程示意图;
图23为本申请提供的另一种视觉传感器的框图;
图24为对像素阵列进行区域划分的示意图;
图25为本申请提供的另一种控制电路的框图;
图26为本申请提供的另一种电子设备的框图;
图27为一种二进制数据流的示意图;
图28为根据本申请的可能的实施例的用于操作视觉传感器芯片的方法的流程图;
图29-a为本申请提供的另一种视觉传感器的框图;
图29-b为本申请提供的另一种视觉传感器的框图;
图29-c为本申请提供的另一种视觉传感器的框图;
图30为本申请提供的另一种像素电路的示意图;
图31为本申请提供的一种第三编码单元的框图示意图;
图32为本申请提供的另一种编码方式的流程示意图;
图33为本申请提供的另一种电子设备的框图;
图34为根据本申请的可能的实施例的用于操作视觉传感器芯片的方法的流程图;
图35为本申请提供的一种事件示意图;
图36为本申请提供的某一个时刻的事件示意图;
图37为本申请提供的一种运动区域示意图;
图38为本申请提供的一种图像处理方法的流程示意图;
图39为本申请提供的另一种图像处理方法的流程示意图;
图40为本申请提供的另一种图像处理方法的流程示意图;
图41为本申请提供的一种事件图像示意图;
图42为本申请提供的另一种图像处理方法的流程示意图;
图43为本申请提供的另一种图像处理方法的流程示意图;
图44为本申请提供的另一种图像处理方法的流程示意图;
图45为本申请提供的一种图像处理的方法的流程示意图;
图46A为本申请提供的另一种事件图像示意图;
图46B为本申请提供的另一种事件图像示意图;
图47A为本申请提供的另一种事件图像示意图;
图47B为本申请提供的另一种事件图像示意图;
图48为本申请提供的另一种图像处理的方法的流程示意图;
图49为本申请提供的另一种图像处理的方法的流程示意图;
图50为本申请提供的另一种事件图像示意图;
图51为本申请提供的一种重建图像示意图;
图52为本申请提供的一种图像处理方法的流程示意图;
图53为本申请提供的一种拟合运动轨迹的方式示意图;
图54为本申请提供的一种确定对焦点的方式示意图;
图55为本申请提供的一种确定预测中心的方式示意图;
图56为本申请提供的另一种图像处理方法的流程示意图;
图57为本申请提供的一种拍摄范围示意图;
图58为本申请提供的一种预测区域示意图;
图59为本申请提供的一种对焦区域示意图;
图60为本申请提供的另一种图像处理方法的流程示意图;
图61为本申请提供的一种图像增强方式示意图;
图62为本申请提供的另一种图像处理方法的流程示意图;
图63为本申请提供的另一种图像处理方法的流程示意图;
图64为本申请应用的一种场景示意图;
图65为本申请应用的另一种场景示意图;
图66为本申请提供的一种GUI的显示示意图;
图67为本申请提供的另一种GUI的显示示意图;
图68为本申请提供的另一种GUI的显示示意图;
图69A为本申请提供的另一种GUI的显示示意图;
图69B为本申请提供的另一种GUI的显示示意图;
图69C为本申请提供的另一种GUI的显示示意图;
图70为本申请提供的另一种GUI的显示示意图;
图71为本申请提供的另一种GUI的显示示意图;
图72A为本申请提供的另一种GUI的显示示意图;
图72B为本申请提供的另一种GUI的显示示意图;
图73为本申请提供的另一种图像处理方法的流程示意图;
图74为本申请提供的一种抖动程度较低的RGB图像示意图;
图75为本申请提供的一种抖动程度较高的RGB图像示意图;
图76为本申请提供的一种大光比场景下的RGB图像示意图;
图77为本申请提供的另一种事件图像示意图;
图78为本申请提供的一种RGB图像示意图;
图79为本申请提供的另一种RGB图像示意图;
图80为本申请提供的另一种GUI示意图;
图81为本申请提供的感光单元与像素值之间关系的一个示意图;
图82为本申请提供的图像处理方法的流程示意图;
图83为本申请提供的事件流的一个示意图;
图84为本申请提供的多个拍摄场景曝光叠加后得到一张模糊图像的示意图;
图85为本申请提供的蒙版一个示意图;
图86为本申请提供的构建蒙版一个示意图;
图87为本申请提供的从图像I中去除运动物体得到图像I′的一个效果图;
图88为本申请提供的从图像I中去除运动物体得到图像I′的一个流程示意图;
图89为本申请提供的拍照过程中运动物体运动较小的一个示意图;
图90为本申请提供的触发摄像头拍摄第三RGB图像的一个示意图;
图91为本申请提供的基于运动突变触发摄像头抓拍到的图像B k和用户在一定曝光时间内主动拍摄得到的图像I的一个示意图;
图92为为本申请提供的基于一帧第一RGB图像和事件流E得到无运动物体的第二RGB图像的一个流程示意图;
图93为为本申请提供的基于一帧第一RGB图像、第三RGB图像和事件流E得到无运动物体的第二RGB图像的一个流程示意图;
图94A为本申请提供的另一种GUI示意图;
图94B为本申请提供的另一种GUI示意图;
图95为本申请提供的传统摄像头与DVS所拍摄的场景对比示意图
图96为本申请提供的传统摄像头与DVS所拍摄的场景对比示意图;
图97为本申请提供的一种应用了DVS的室外导航示意图;
图98a为本申请提供的一种应用了DVS的车站导航示意图;
图98b为本申请提供的一种应用了DVS的景点导航示意图;
图99为本申请提供的一种应用了DVS的商场导航示意图;
图100为本申请提供的一种执行SLAM的流程示意图;
图101为本申请提供的一种位姿估计方法10100的流程示意图;
图102为本申请提供的一种将DVS事件积分成事件图像的示意图;
图103为本申请提供的一种关键帧选择方法10300的流程示意图;
图104为本申请提供的一种事件图像的区域划分示意图;
图105为本申请提供的一种关键帧选择方法10500的流程示意图;
图106为本申请提供的一种位姿估计方法1060的流程示意图;
图107为本申请提供的一种基于图像的静止区域来执行位姿估计的流程示意图;
图108a为本申请提供的一种基于图像的运动区域来执行位姿估计的流程示意图;
图108b为本申请提供的一种基于图像的整体区域来执行位姿估计的流程示意图;
图109为本申请提供的一种AR/VR眼镜结构示意图;
图110为本申请提供的一种注视感知结构的示意图;
图111为本申请提供的一种网络架构示意图;
图112为本申请提供的一种图像处理装置的结构示意图;
图113为本申请提供的另一种图像处理装置的结构示意图;
图114为本申请提供的另一种图像处理装置的结构示意图;
图115为本申请提供的另一种图像处理装置的结构示意图;
图116为本申请提供的另一种图像处理装置的结构示意图;
图117为本申请提供的另一种图像处理装置的结构示意图;
图118为本申请提供的另一种图像处理装置的结构示意图;
图119为本申请提供的数据处理装置的另一种结构示意图;
图120为本申请提供的数据处理装置的另一种结构示意图;
图121为本申请提供的电子设备的另一种结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
下面从不同的角度对本申请提供的电子设备、系统架构以及方法流程等进行详细介绍。
一、电子设备
本申请提供的方法可以应用于各种电子设备,或者说由电子设备来执行本申请提供的方法,该电子设备可以应用于拍摄场景,如拍照、安防、自动驾驶、无人机拍摄等场景。
本申请中的电子设备可以包括但不限于:智能移动电话、电视、平板电脑、手环、头戴显示设备(Head Mount Display,HMD)、增强现实(augmented reality,AR)设备,混合现实(mixed reality,MR)设备、蜂窝电话(cellular phone)、智能电话(smart phone)、个人数字助理(personal digital assistant,PDA)、车载电子设备、膝上型电脑(laptop computer)、个人电脑(personal computer,PC)、监控设备、机器人、车载终端、自动驾驶车辆等。当然,在以下实施例中,对该电子设备的具体形式不作任何限制。
示例性地,本申请提供的电子设备应用的架构如图1A所示。
其中,电子设备,如图1A中所述的车、手机、AR/VR眼镜、安防监控设备、摄像头或其他智能家居终端等设备,可以通过有线或者无线网络接入云端平台,云端平台中设置有服务器,该服务器可以包括集中式服务器,也可以包括分布式服务器,电子设备可以通过 有线或者无线网络和云端平台的服务器进行通信,从而实现数据的传输。例如,电子设备在采集到的设备之后,可以在云端平台进行保存或者备份,以防止数据丢失。
可以通过电子设备接入接入点或者基站,实现无线或者有线接入云端平台。例如,该接入点可以是基站,电子设备内设置有SIM卡,通过该SIM卡实现运营商的网络认证,从而接入无线网络。或者,该接入点可以包括路由器,电子设备通过2.4GHz或者5GHz无线网络接入路由器,从而通过路由器接入云端平台。
此外,电子设备可以单独进行数据处理,也可以通过协同云端实现数据处理,具体可以根据实际应用场景进行调整。例如,电子设备中可以设置DVS,DVS可以与电子设备中的摄像头或者其他传感器协同工作,也可以独立工作,由DVS内设置的处理器或者电子设备内设置的处理器针对DVS或其他传感器采集到的数据进行处理,还可以协同云端设备对DVS或其他传感器采集到的数据进行处理。
下面对电子设备的具体结构进行示例性介绍。
示例性地,参阅图1B,下面以一个具体的结构为例,对本申请提供的电子设备的结构进行示例性说明。
需要说明的是,本申请提供的电子设备可以包括比图1B更多或者更少的部件,图1B中所示的电子设备仅仅是示例性说明,本领域技术人员可以根据需求在该电子设备中增加或者减少部件,本申请对此并不作限定。
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M,图像传感器180N等,其中,图像传感器180N可以是包括独立的彩色传感器1801N和独立的运动传感器1802N,也可以是包括彩色传感器的感光单元(可称为彩色传感器像素,图1B中未示出)和运动传感器的感光单元(可称为运动传感器像素,图1B中未示出)。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器 (neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100 的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信 号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括但不限于:第五代移动通信技术(5th-Generation,5G)系统,全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),蓝牙(bluetooth),全球导航卫星系统(the global navigation satellite system,GNSS),无线保真(wireless fidelity,WiFi),近距离无线通信(near field communication,NFC),FM(也可以称为调频广播),紫蜂协议(Zigbee),射频识别技术(radio frequency identification,RFID)和/或红外(infrared,IR)技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)等。
在一些实施方式中,电子设备100也可以包括有线通信模块(图1B中未示出),或者,此处的移动通信模块150或者无线通信模块160可以替换为有线通信模块(图1B中未示出),该有线通信模块可以使电子设备通过有线网络与其他设备进行通信。该有线网络可以包括但不限于以下一项或者多项:光传送网(optical transport network,OTN)、同步数字体系(synchronous digital hierarchy,SDH)、无源光网络(passive optical network,PON)、以太网(Ethernet)、或灵活以太网(flex Ethernet,FlexE)等。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形 渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB摄像头(或者称为RGB传感器)0,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存 储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪 传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
图像传感器180N,或称为感光器件或感光元件,是一种将光学图像转换成电子信号的设备,它被广泛地应用在数码相机和其他电子光学设备中,图像传感器是利用光电器件的光电转换功能将感光面上的光像转换为与光像成相应比例关系的电信号。与光敏二极管,光敏三极管等“点”光源的光敏元件相比,图像传感器是将其受光面上的光像,分成许多小单元(即像素),将其转换成可用的电信号的一种功能器件,其中,每个小单元对应图像传感器内的一个感光单元,感光单元也可称为传感器像素。图像传感器分为光导摄像管和固态图像传感器。与光导摄像管相比,固态图像传感器具有体积小、重量轻、集成度高、分辨率高、功耗低、寿命长、价格低等特点。若根据元件的不同,可分为电荷耦合元件(charge coupled device,CCD)和金属氧化物半导体元件(complementary metal-oxide semiconductor,CMOS)两大类;若根据拍摄的光学图像类型的不同,若根据拍摄的光学图像类型的不同,则可分为彩色传感器1801N和运动传感器1802N两大类。
具体地,彩色传感器1801N,包括传统的RGB图像传感器,可以用于对摄像头拍摄的范围内的物体进行检测,每个感光单元对应图像传感器中的一个像点,由于感光单元只能感应光的强度,无法捕获色彩信息,因此必须在感光单元上方覆盖彩色滤光片。至于如何覆盖彩色滤光片,不同的传感器厂商有不同的解决方案,最常用的做法是覆盖RGB红绿蓝三色滤光片,以1:2:1的构成由四个像点构成一个彩色像素(即红蓝滤光片分别覆盖一个像点,剩下的两个像点都覆盖绿色滤光片),采取这种比例的原因是人眼对绿色较为敏感。在接受光照之后,感光单元产生对应的电流,电流大小与光强对应,因此感光单元直接输出的电信号是模拟的,之后再将输出的模拟电信号转换为数字信号,最终得到的所有数字信号以数字图像矩阵的形式输出给专门的DSP处理芯片处理。该传统的彩色传感器是按帧格式输出拍摄区域的全幅图像。
具体地,运动传感器1802N,可以包括多种不同类型的视觉传感器,如可以包括基于帧的运动检测视觉传感器(motion detection vision sensor,MDVS)和基于事件的运动检测视觉传感器。可以用于对摄像头拍摄的范围内的运动物体进行检测,采集运动物体的运动轮廓或者运动轨迹等。
在一种可能的场景中,运动传感器1802N可以包括运动检测(Motion Detection,MD)视觉传感器,是一类检测运动信息的视觉传感器,运动信息源于摄像头和目标之间的相对运动,可以是摄像头运动,也可以是目标运动,还可以是摄像头和目标都在运动。运动检测视觉传感器包括基于帧的运动检测和基于事件的运动检测。基于帧的运动检测视觉传感器需要曝光积分,通过帧差获得运动信息。基于事件的运动检测视觉传感器无需积分,通过异步事件检测获得运动信息。
在一种可能的场景中,运动传感器1802N可以包括检测视觉传感器(motion detection vision sensor,MDVS)、动态视觉传感器(dynamic vision sensor,DVS)、主动式传感器(active pixel sensor,APS)、红外传感器、激光传感器或者惯性测量单元(Inertial Measurement Unit,IMU)等。该DVS具体可以包括DAVIS(Dynamic and Active-pixel Vision Sensor)、ATIS(Asynchronous Time-based Image Sensor)或者CeleX传感器等传感器。DVS借鉴了生物视觉的特性,每个像素模拟一个神经元,独立地对光照强度(以下简称“光强”)的相对变化做出响应。例如,若运动传感器为DVS时,当光强的相对变化超过阈值时,像素会输出一个事件信号,包括像素的位置、时间戳以及光强的特征信息。应理解,在本申请以下实施方式中,所提及的运动信息、动态数据或者动态图像等,都可以通过运动传感器采集得到。
例如,运动传感器1802N可以包括惯性测量单元(Inertial Measurement Unit,IMU)是测量物体三轴角速度以及加速度的装置。IMU通常由三个单轴加速度计和三个单轴陀螺组成,分别测量物体的加速度信号和相对于导航坐标系的角速度信号,并以此解算出物体的姿态。例如,前述的该IMU具体可以包括前述的陀螺仪传感器180B和加速度传感器180E。IMU的优点是采集频率高。IMU的数据采集频率一般可以达到100HZ以上,消费级的IMU可以捕捉高达1600HZ的数据。在较短时间内,IMU可以给出高精度的测量结果。
例如,运动传感器1802N可以包括主动式传感器(active pixel sensor,APS)。例如,以>100HZ的高频率捕捉RGB图像,并对相邻两帧图像做减法得到变化的值。这个变化值大于阈值的,如>0就设置为1,不大于阈值,如=0则设置为0,最终得到的数据与DVS得到的数据类似,完成对运动对象的图像的捕获。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
二、系统架构
电子设备在实现图像拍摄、读取或者保存的过程中,涉及到多个部件之间的变化,下面本申请对从数据采集、数据编解码、图像增强、图像重构或应用的场景等进行详细介绍。
示例性地,以一种图像的采集和处理的场景为例,如图2所示,对电子设备的处理流程进行示例性说明。
数据采集:可以通过类脑摄像头、RGB摄像头或其结合来采集数据。类脑摄像头可以包括放生视觉传感器,利用集成电路对生物视网膜进行仿真,每个像素模拟了生物神经元,对光强的变化以事件的形式进行表达。经过发展,出现了多种不同类型的仿生视觉传感器,其共同特征都是像素阵列独立异步监测光强变化,将变化作为事件信号输出,如前述的运动传感器DVS或者DAVIS等。RGB摄像头将模拟信号转换成数字信号,进而将其储存在存储介质里。还可以通过类脑摄像头和RGB摄像头结合来采集数据,例如,将类脑摄像头和RGB采集到的数据投射至同一画布中,每个像素点的值可以是基于类脑摄像头和/或RGB摄像头反馈的值确定的,或者每个像素点的值可以包括类脑摄像头和RGB分别作为独立的通道的值。通过类脑摄像头、RGB摄像头或其结合可以将光信号转换为电信号,从而得到以帧为单位的数据流或者以事件为单位的事件流。本申请以下将RGB摄像头采集到的图像称为RGB图像,将类脑摄像头采集到的图像称为事件图像。
数据编解码:包括了数据编码和数据解码。数据编码可以包括在数据采集之后,对采集到的数据进行编码,并将编码后的数据保存至存储介质中。数据解码可以包括从存储介质中读取数据,并对该数据进行解码,将数据解码为可供后续的识别、检测等使用的数据。此外,还可以根据数据编解码的方式,来调整数据采集的方式,从而实现更高效的数据采集和数据编解码。数据的编解码可以分为多种,包括基于类脑摄像头的编解码、基于类脑摄像头和RGB摄像头的编解码或者基于RGB摄像头的编解码等。具体地,在进行编码的过程中,可以是对类脑摄像头、RGB摄像头或其结合采集到的数据进行编码,使之按照一定的格式存储在存储介质中,在进行解码的过程中,可以对存储在存储介质中的数据进行解码,解码为可供后续使用的数据。例如,用户在第一天可以通过类脑摄像头、RGB摄像头或其结合来采集视频或者图像数据,并对该视频或者图像数据进行编码,存储在存储介质中。第二天可以从存储介质中读取数据,并对数据进行解码,从而得到可播放的视频或者图像。
图像优化:即在前述的类脑摄像头或者RGB摄像头采集到图像之后,读取采集到的图像,然后对采集到的图像进行增强或者重构等优化处理,以便于后续基于优化后的图像进行处理。示例性地,图像增强和重构可以包括图像重建或运动补偿等。运动补偿,例如通过DVS采集到的运动的对象的运动参数,对事件图像或者RGB图像中运动的对象进行补偿,从而使得到的事件图像或者RGB图像更清晰。图像重建,例如通过类脑视觉摄像头采集到的图像,来重建RGB图像,从而即使在运动场景下也可以通过DVS采集到的数据来得到清晰的RGB图像。
应用场景:在通过图像优化得到优化后的RGB图像或者事件图像之后,可以使用优化后的RGB图像或者事件图像进行进一步的应用,当然,也可以是对采集到的RGB图像或者事件图像进行进一步应用,具体可以根据实际应用场景来调整。
具体地,应用的场景可以包括:运动摄影增强、DVS图像和RGB图像融合、检测识别、 同步定位与建图(simultaneous localization and mapping,SLAM)、眼动跟踪、关键帧选择或者位姿估计等。例如,运动摄影增强即在拍摄具有运动的对象的场景下,对拍摄到的图像进行增强处理,从而拍摄到更清晰的运动对象。DVS图像和RGB图像融合,即通过DVS采集到的运动中的对象,对RGB图像进行增强,对RGB图像中存在运动的对象或者受大光比影响的对象进行补偿,从而得到更清晰的RGB图像。检测识别即基于RGB图像或者事件图像来进行目标检测或者目标识别。眼动跟踪即根据采集到的RGB图像、事件图像或者优化后的RGB图像、事件图像等对用户的眼动来进行跟踪,确定用户的注视点、注视方向等信息。关键帧选择即结合类脑摄像头采集到的信息,从RGB摄像头采集到的视频数据中来选择某些帧作为关键帧。
此外,在本申请以下实施方式中,在不同的实施方式中可能需要启动的传感器不同。例如,在采集数据时,在通过运动补偿对事件图像进行优化时,可以启动运动传感器,可选地还可以启动IMU或者陀螺仪等,在图像重建的实施方式中,可以启动运动传感器来采集事件图像,然后结合事件图像进行优化,或者,在运动摄影增强的实施方式中,可以启动运动传感器和RGB传感器等,因此,在不同的实施方式中,可以选择启动相应的传感器。
具体地,本申请提供的方法可以应用于电子设备,该电子设备可以包括RGB传感器和运动传感器等,RGB传感器用于采集拍摄范围内的图像,运动传感器用于采集对象在运动传感器的检测范围内相对于运动传感器运动时产生的信息,该方法包括:基于场景信息从RGB传感器和运动传感器中选择至少一种,并通过选择出的传感器采集数据,场景信息包括电子设备的状态信息、电子设备中请求采集图像的应用程序的类型或者环境信息中的至少一种。
在一种可能的实施方式中,前述的状态信息包括电子设备的剩余电量、剩余存储量(或者说可用存储量)或者CPU负载等信息。
在一种可能的实施方式中,前述的环境信息可以包括彩色RGB传感器和运动传感器的拍摄范围内的光照强度的变化值或拍摄范围内的运动的对象的信息。例如,该环境信息可以包括RGB传感器或者DVS传感器的拍摄范围内的光照强度的变化情况,或者,该拍摄范围内的对象的运动情况,如对象的运动速度、运动方向等信息,或者该拍摄范围内的对象的异常运动情况,如对象的速度突变、方向突变等情况。
前述的电子设备中请求采集图像的应用程序的类型可以理解为,该电子设备中承载了安卓、Linux或者鸿蒙等系统,可以在该系统中运行应用程序,且该系统中运行的程序可以分为多种类型,如拍照类型的应用程序或者目标检测的应用程序等。
通常,运动传感器对运动变化敏感,而对静态场景不敏感,通过发放事件对运动变化做出响应,由于静态区域几乎不发放事件,因此其数据仅表达运动变化区域的光强信息,并不是完整的全场景光强信息。RGB彩色摄像头则擅长对自然场景进行完整的色彩记录,再现场景中的纹理细节。
以前述的电子设备为手机为例,缺省配置为DVS摄像头(即DVS传感器)关闭。当使用摄像头时,根据当前被调用的应用类型,如拍照APP调用摄像头,如果为高速运动状态,则需要同时开启DVS摄像头和RGB摄像头(即RGB传感器);如果请求调用摄像头的APP是 用于物体检测或者运动检测的APP,不需要进行物体拍照和人脸识别,则可以选择开启DVS摄像头,不开启RGB摄像头。
可选的,还可以根据当前设备的状况选择摄像头启动模式,例如当前电量低于一定阈值时,后者用户启动省电模式,无法进行正常拍照,可以仅开启DVS摄像头,因为虽然DVS摄像头照片成像不清晰,但是功耗低,并且在运动物体检测时,不需要进行高清成像。
可选的,设备可以感知周围环境,来决定是否切换摄像头模式,例如夜景时,或者当前设备处于高速运动时,可以开启DVS摄像头。如果是静态场景,则可不开启DVS摄像头。
综合以上的应用类型,环境信息,设备状态,确定摄像头功启动模式,并且在运行过程中,可以决策是否触发摄像头模式切换,从而在不同的场景中启动不同的传感器,适应能力强。
可以理解为,启动模式包括3种,只开启RGB摄像头,只开启DVS摄像头,RGB和DVS摄像头同时开启。并且,针对不同的产品,检测应用类型和环境检测的参考因素可以不同。
例如,安防场景下的摄像机具有移动侦测(motion detection)功能,只有在检测到运动物体时摄像机才存储录像,从而减少存储空间,延长硬盘存储时长。具体的,当DVS和RGB摄像头应用于家居或者安防摄像头时,缺省仅开启DVS摄像头进行运动检测和分析,当DVS摄像头检测到异常运动、异常行为(如对象突然运动、突然改变运动方向等),例如有人员靠近,或有显著的光强变化,启动RGB摄像头进行拍摄,记录这一时段的全场景纹理图像,作为监控凭证。当异常运动结束后,又切换为DVS工作,RGB摄像头待机的工作状态,显著节省数据量以及监控设备功耗。
以上间歇式摄像方法,利用了DVS低功耗的优势,同时DVS基于事件运动检测更快,相比基于图像的运动检测具有更快的响应,检测更准。实现全天候不间断检测。实现更加精准,低功耗,节省存储空间的方法。
又例如,当DVS和RGB摄像头应用于车载辅助/自动驾驶,行车过程中,当遇到对向来车开启远光灯,或夕阳直射,或进出隧道的情况,RGB摄像头可能无法拍摄到有效的场景信息,此时DVS虽然无法获取纹理信息,但可以获得场景内的大致轮廓信息,这对于驾驶员的判断具有极大的辅助价值。此外,大雾天气下,DVS拍摄的轮廓信息也可以辅助判断路况。因此,可在特定场景下触发DVS与RGB摄像头进行主从工作状态切换,如在光强剧烈变化时触发,或在极端天气下触发。
当DVS摄像头应用于AR/VR眼镜时,以上流程同样成立。当使用DVS用于SLAM或者眼动跟踪时,可以根据设备状态和周围环境,决定摄像头的启动模式。
在本申请以下实施方式中,在使用某一传感器采集到的数据时,即打开了该传感器,以下不再赘述。
下面结合上述的不同工作模式以及前述图2对本申请提供的不同实施方式进行说明。
三、方法流程
前述对本申请提供的电子设备以及系统架构进行了示例性说明,下面结合前述图1A-图2,对本申请提供的方法进行详细说明。具体地,结合前述图2的架构,分别对各个模块对应的方法进行分别说明,应理解,本申请以下所提及的方法步骤,可以单独实施,也可 以是组合起来在一个设备中实施,具体可以根据实际应用场景调整。
1、数据采集和编解码
下面对数据采集和数据编解码的过程结合起来进行示例性说明。
在传统技术中,视觉传感器(即前述的运动传感器)普遍采用基于事件流的异步读取模式(下文也简称“基于事件流的读取模式”或“异步读取模式”)和基于帧扫描的同步读取模式(下文也简称“基于帧扫描的读取模式”或“同步读取模式”)。对于已经制造完成的视觉传感器,仅能够采用两种模式中的一种。根据具体的应用场景及运动状态,上述两种读取模式在单位时间内所需读取的信号数据量可能具有显著差异,进而输出读取数据所需的代价也不尽相同。图3-a和图3-b分别示出了基于事件流的异步读取模式和基于帧扫描的同步读取模式下读取数据量与时间的关系的示意图。
一方面,仿生视觉传感器,因其具有对运动敏感的特性,而环境中的静态区域通常不产生光强变化事件(在本文在也被称为“事件”),这类传感器几乎全部采用基于事件流的异步读取模式,事件流是指事件按照一定顺序排列。下面以DVS为例,对异步读取模式进行示例性说明。根据DVS的采样原理,通过比较当前光强与上一次事件发生时的光强,当其变化量达到预定发放阈值C(以下简称为预定阈值)时,产生并输出一个事件。即通常在当前光强与上一次事件产生时的光强的差异超过预定阈值C时,DVS将产生一个事件,可用公式1-1进行描述:
|L-L′|≥C  (1-1)
其中L和L'分别表示当前时刻的光强和上一次事件发生时的光强。
其中,对于异步读取模式,每个事件可以表示为<x,y,t,m>,(x,y)表示产生事件的像素位置,t表示产生事件的时间,m表示光强的特征信息。具体而言,视觉传感器的像素阵列电路中的像素测量环境中的光强变化量。如果测量到的光强变化量超过预定阈值,则像素可以输出指示事件的数据信号。因此,在基于事件流的异步读取模式下,视觉传感器的像素被进一步区分为产生光强变化事件的像素和未产生光强变化事件的像素。光强变化事件可以通过产生事件的像素的坐标信息(x,y)、该像素处的光强的特征信息以及光强的特征信息被读取的时间t等来表征。坐标信息(x,y)可用于在像素阵列电路中惟一地标识像素,例如,x表示像素在像素阵列电路中所位于的行索引,y表示像素在像素阵列电路中所位于的列索引。通过标识与像素相关联的坐标和时间戳,能够唯一地确定发生光强变化事件的时空位置,继而可以将所有的事件按发生的先后顺序构成一个事件流。
在部分DVS传感器(如DAVIS传感器、ATIS传感器等)中,m表示光强的变化趋势,也可以称为极性信息,通常用1比特-2比特进行表示,取值可以为ON/OFF,其中ON表示光强增强,OFF表示光强减弱,即当光强增加并超过预定阈值时,产生ON脉冲;当光强减少并超过预定阈值时,产生OFF脉冲(本申请用“+1”表示光强增强,用“-1”表示光强减弱)。在某些DVS传感器,如CeleX传感器进行运动对象监测的场景中m表示绝对光强信息,也可以称为光强信息,通常用多个比特表示,比如采用8比特-12比特进行表示。
在异步读取模式下,只有产生光强变化事件的像素处的数据信号才会被读取。因而,对于仿生视觉传感器而言,所需读取的事件数据具有稀疏异步的特性。如图3-a的曲线101 所示,视觉传感器工作在基于事件流的异步读取模式下,当像素阵列电路中发生的光强变化事件的速率变化时,视觉传感器所需读取的数据量也随时间变化。
另一方面,传统的视觉传感器,诸如手机摄像头、数字摄像机等通常采用基于帧扫描的同步读取模式。该读取模式并未对视觉传感器的像素是否产生光强变化事件进行区分。无论在某一像素处是否产生光强变化事件,该像素所生成的数据信号均被读取。在读取数据信号时,视觉传感器按照预定顺序扫描像素阵列电路,同步读取各个像素处的指示光强的特征信息m(光强的特征信息m在上文已经进行了介绍,这里不再重复赘述),并按照顺序输出为第1帧数据、第2帧数据等等。因而,如图3-b的曲线102所示,在同步读取模式下,视觉传感器读取的每一帧数据量具有相同的大小,数据量随时间保持不变。例如,假定采用8比特来表示一个像素的光强度值,而视觉传感器中的像素总数为66个,则一帧数据的数据量为528比特。通常,帧与帧之间按照相等的时间间隔输出,例如可以按照每秒30帧、每秒60帧、每秒120帧等速率输出。
申请人发现目前的视觉传感器仍然存在缺陷,至少包括以下几个方面:
首先、单一的读取模式无法适应所有场景,不利于缓解数据传输和存储方面的压力。
如图3-a的曲线101所示,视觉传感器工作在基于事件流的异步读取模式下,当像素阵列电路中发生的光强变化事件的速率变化时,视觉传感器所需读取的数据量也随时间变化。在静态场景中产生的光强变化事件较少,因而视觉传感器所需读取的总数据量也较低。而在动态场景中,例如剧烈运动时,大量产生光强变化事件,视觉传感器所需读取的总数据量也随之上升,在一些场景中,大量产生光强变换事件,导致总数据量超过带宽限制,可能会出现事件丢失或者延迟读出的情况。如图3-b的曲线102所示,视觉传感器工作在基于帧的同步读出模式下,无论像素是否发生变化,都需要在一帧表示该像素的状态或强度值。当只有少量像素发生变化时,这种表示代价较大。
在不同应用场景以及运动状态下,采用两种模式的输出和存储代价可能具有显著的差异。例如,拍摄静态场景时,在一段时间内仅有少量像素产生光强变化事件。通过示例的方式,例如,在一次扫描中,像素阵列电路中只有三个像素处产生光强变化事件。在异步读取模式下只需读取这三个像素的坐标信息(x,y)、时间信息t以及光强变化量,就可以表征着三个光强变化事件。假定在异步读取模式中,针对一个像素的坐标、读取时间戳和光强变化量分别分配4、2、2、2个比特,则该读取模式下所需读取的总数据量为30比特。而在同步读取模式下,尽管仅有三个像素产生指示光强变化事件的有效数据信号,但是仍需读取整个阵列的所有像素输出的数据信号,以形成完整的一帧数据。假定在同步读取模式中,针对每个像素分配8比特,像素阵列电路的像素总数为66,则所需读取的总数据量为528比特。由此可见,即便像素阵列电路中存在大量未产生事件的像素,在同步读取模式中仍需分配如此之多的比特。从表示代价的角度来看是不经济的,并且增加了数据传输和存储方面的压力。因而,在这种情况下,采用异步读取模式更为经济。
在另一示例中,当场景内发生剧烈运动或者环境中的光强度发生剧烈变化时,诸如有大量人员走动、或突然开关灯等等,视觉传感器中有大量像素在短时间内测量到光强变化并产生指示光强变化事件的数据信号。由于在异步读取模式下表征单个事件的数据量多于 在同步读取模式下表征单个事件的数据量,在这种情况下采用异步读取模式可能需要极大表示代价。具体而言,像素阵列电路中的每一行可能存在连续多个像素产生光强变化事件,对于每个事件均需传输坐标信息(x,y)、时间信息t以及光强的特征信息m。这些事件之间的坐标变化往往只有一个单位的偏差,读取时间也基本相同。在这种情况下,异步读取模式对于坐标和时间信息的表示代价较大,会引起数据量激增。而在同步读取模式中,无论任一时刻在像素阵列电路中产生的光强变化事件的数目为多少,各个像素都输出仅指示光强变化量的数据信号,无需为每个像素的坐标信息和时间信息分配比特。因而,对于事件稠密的情形,采用同步读取模式更为经济。
其次、单一的事件表示方式无法适应所有场景,采用光强信息表示事件不利于缓解数据传输和存储方面的压力,采用极性信息表示事件影响对事件的处理和分析。
上文介绍了同步读取模式以及异步读取模式,读出的事件均需要通过光强的特征信息m表示,光强的特征信息包括极性信息和光强信息。本文将通过极性信息表示的事件称为极性格式的事件,将通过光强信息表示的事件称为光强格式的事件。对于已经制造完成的视觉传感器,仅能够采用两种事件格式中的一种,即采用极性信息表示事件,或者采用光强信息表示事件。下面以异步读取模式为例对极性格式的事件和光强格式的事件的优缺点进行说明。
在异步读取模式下,采用极性信息表示事件时,极性信息p通常由1比特-2比特表示,携带的信息较少,仅能表示光强的变化趋势是增加还是减弱,所以采用极性信息表示事件影响对事件的处理和分析,比如采用极性信息表示的事件,在图像重构时难度较大,用于物体识别的精度也较差。采用光强信息表示事件时,通常由多比特进行表示,比如采用8比特-12比特进行表示,相比于极性信息,光强信息可以携带的信息更多,有利于对事件的处理和分析,比如可以提升图像重构的质量,但由于数据量较大,获取光强信息表示的事件需要的时间也更长。根据DVS采样原理,当像素的光强变化超过预定阈值时将产生事件,那么当场景中出现大面积的物体运动或光强波动时(例如进出隧道口,房间开关灯等场景),视觉传感器将面临事件突增的问题,在视觉传感器的预置最大带宽(以下简称为带宽)一定的情况下,存在事件数据无法被读出的情况。目前通常采用随机丢弃的方式处理。若采用随机丢弃,虽然能够保证传输数据量不超过带宽,但造成了数据丢失,在某些特殊应用场景下(例如自动驾驶等),随机丢弃的数据可能具有较高的重要性。换句话说,在事件大量触发的时候,数据量超过带宽,光强格式的数据无法完全输出到DVS的外部,导致部分事件丢失。这些丢失的事件可能不利于对事件的处理和分析,比如在亮度重建过程中可能会带来拖影,轮廓不完整的情况。
为了解决上述问题,本申请实施例提供一种视觉传感器,基于像素阵列电路产生的光强变化事件的统计结果,比较两种读取模式下的数据量,从而可以切换至适合当前应用场景和运动状态的读取模式。此外,基于像素阵列电路产生的光强变化事件的统计结果,比较光强信息表示的事件的数据量与带宽之间的关系,从而调整事件的表示精度,在满足带宽限制的前提下,以合适的表示方式将事件都传输出来,尽可能以更大的表示精度传输所有事件。
下面对本申请实施例提供的一种视觉传感器进行介绍。
图4-a示出了本申请提供的一种视觉传感器的框图。视觉传感器可以被实现为视觉传感器芯片,并能够以至少基于帧扫描的读取模式和基于事件流的读取模式中的一种来读取指示事件的数据信号。如图4-a所示,视觉传感器200包括像素阵列电路210以及读取电路220。视觉传感器与控制电路230相耦合。应当理解,图4-a所示的视觉传感器仅用于示例性目的,而不暗示对于本申请的范围的任何限制。本申请的实施例还可以被体现在不同的传感器架构中。另外,还应当理解,视觉传感器还可以包括用于实现图像采集、图像处理、图像传输等目的的其他元件或实体,为了便于描述未被示出,但不意味着本申请的实施例不具备这些元件或实体。
像素阵列电路210可以包括一个或多个像素阵列,并且每个像素阵列包括多个像素,每个像素具有用于唯一标识的位置信息,例如坐标(x,y)。像素阵列电路210可用于测量光强变化量,生成与多个像素对应的多个数据信号。在一些可能的实施例中,每个像素被配置为独立地对环境中的光强变化做出响应。在一些可能的实施例中,像素将所测量的光强变化量与预定阈值进行比较,如果测量到的光强变化量超过预定阈值,则该像素生成指示光强变化事件的第一数据信号,例如,该第一数据信号包括极性信息,比如+1或-1,或者该第一数据信号也可以是绝对光强信息。在该示例中,第一数据信号可以指示对应像素处的光强变化趋势或绝对光强度值。在一些可能的实施例中,如果测量到的光强变化量未超过预定阈值,则该像素生成与第一数据信号不同的第二数据信号,例如0。在本申请的实施例中,数据信号可以指示包括,但不限于光强极性、绝对光强度值、光强度的变化值等等。光强极性可以表示光强变化的趋势,例如,增强或减弱,通常用+1和-1表示。绝对光强度值可以表示在当前时刻测量的光强度值。取决于传感器的结构、用途和种类,关于光强度或光强变化量可以具有不同的物理意义。本申请的范围在此方面不受限制。
读取电路220被耦合至像素阵列电路210和控制电路230,并且可以与二者通信。读取电路220被配置为读取像素阵列电路210输出的数据信号,可以理解为读取电路220读取像素阵列210输出的数据信号到控制电路230中。控制电路230被配置为可以控制读取电路220读取数据信号的模式,控制电路230还可以被配置为控制输出的数据信号的表示方式,换句话说,控制数据信号的表示精度,比如控制电路可以控制视觉传感器输出通过极性信息表示的事件,或者通过光强信息表示的事件,或者通过某个固定的比特位数表示的事件等等,将在下文结合具体的实施方式进行说明。
根据本申请的可能的实施例,控制电路230可以如图4-a所示的作为视觉传感器200外部的独立电路或芯片,通过总线接口连接到视觉传感器200。在另一些可能的实施例中,控制电路230也可以作为视觉传感器内部的电路或芯片,与其中的像素阵列电路和读取电路集成在一起。图4-b示出了根据本申请的可能的实施例的另一视觉传感器300的框图。视觉传感器300可以作为视觉传感器200的一种示例实现。如图4-b所示,为本申请提供的一种视觉传感器的另一种框图。视觉传感器包括像素阵列电路310、读取电路320和控制电路330。像素阵列电路310、读取电路320和控制电路330在功能上与图4-a所示的像素阵列电路210、读取电路220以及控制电路230相同,因而在此不再进行赘述。应当理 解的是,视觉传感器仅用于示例性目的,而不暗示对于本申请的范围的任何限制。本申请的实施例还可以被体现在不同的视觉传感器中。另外,还应当理解,视觉传感器还可以包括其他元件、模块或实体,出于清楚的目的未被示出,但不意味着本申请的实施例不具备这些元件或实体。
基于前述的视觉传感器的架构,下面对本申请提供的视觉传感器进行详细说明。
读取电路220可以被配置为按照预定顺序扫描像素阵列电路210中的像素,以读取对应像素生成的数据信号。在本申请的实施例中,读取电路220被配置为能够以多于一种信号读取模式来读取像素阵列电路210输出的数据信号。例如,读取电路220可以以第一读取模式和第二读取模式中的其中一种读取模式进行读取。在本文的上下文中,第一读取模式和第二读取模式分别对应于基于帧扫描的读取模式和基于事件流的读取模式中的其中一种模式,进一步地,第一读取模式可以指代读取电路220的当前读取模式,第二读取模式可以指代可切换的备选读取模式。
参考图5,其示出了根据本申请的实施例的基于帧扫描的同步读取模式和基于事件流的异步读取模式的原理的示意图。如图5的上半部分所示,黑色圆点表示产生光强变化事件的像素,白色圆点表示未产生光强变化事件的像素。左侧虚线方框表示基于帧扫描的同步读取模式,其中所有像素基于所接收的光信号生成的电压信号,继而经过模数转换后输出数据信号,在该模式下,读取电路220通过读取所有像素生成的数据信号来构成一帧数据。右侧虚线方框表示基于事件流的异步读取模式,在该模式下,当读取电路220扫描到产生光强变化事件的像素时,可以获取该像素的坐标信息(x,y)。然后,仅读取产生光强变化事件的像素所生成的数据信号,并记录读取时间t。在像素阵列电路中存在多个产生光强变化事件的像素的情况下,读取电路220按照扫描顺序,依次读取多个像素生成的数据信号,并构成事件流作为输出。
图5的下半部分从表示代价(例如,所需读取的数据量)的角度来描述两种读取模式。如图5所示,在同步读取模式下,读取电路220每次读取的数据量是相同的,例如1帧数据。在图5中示出为第1帧数据401-1和第2帧数据401-2。根据表示单个像素的数据量(例如,比特数目B p)和像素阵列电路中的像素总数M即可确定要读取的一帧数据量为M·B p。在异步读取模式下,读取电路220读取指示光强变化事件的数据信号,继而将所有的事件按发生的先后顺序构成一个事件流402。在此情况下,读取电路220每次读取的数据量与用于表示单个事件的事件数据量B ev(例如,表示产生事件的像素的坐标(x,y)、读取时间戳t以及光强的特征信息的比特数目的总和)以及光强变化事件的数目N ev有关。
在一些实施方式中,读取电路220可以被配置向控制电路230提供所读取的至少一个数据信号。例如,读取电路220可以向控制电路230提供在一段时间内读取的数据信号,以供控制电路230进行历史数据统计和分析。
在一些可能的实施例中,在当前采用的第一读取模式为基于事件流的读取模式的情况下,读取电路220读取像素阵列电路210中产生光强变化事件的像素生成的数据信号,为了描述方便,以下将这些数据信号也称为第一数据信号。具体而言,读取电路220通过扫描像素阵列电路210,确定与光强变化事件有关的像素的位置信息(x,y)。基于像素的位 置信息(x,y),读取电路220读取多个数据信号中的、由像素生成的第一数据信号,以获取该第一数据信号指示的光强的特征信息和读取时间信息t。通过示例的方式,在基于事件流的读取模式中,读取电路220每秒读取的事件数据量可以表示为B ev·N ev个比特,即读取电路220的读取数据速率为B ev·N ev比特每秒(bit per second,bps),其中B ev为基于事件流的读取模式下针对每个光强变化事件所分配的事件数据量(例如,比特数目),其中前b x和b y个比特用于表示像素坐标(x,y),接下来的b t个比特用于表示数据信号被读取的时间戳t,最后b f个比特用于表示数据信号所指示的光强的特征信息,即B ev=b x+b y+b t+b f,N ev为读取电路220基于一段时间内对像素阵列电路210中产生的光强变化事件的数目历史统计而得出的每秒产生的平均事件数目。由于基于帧扫描的读取模式,读取电路220所读取的每一帧数据量可以表示为M·B p个比特,每秒读取的数据量为M·B p·f比特,即,读取电路220的读取数据速率为M·B p·f bps,其中给定视觉传感器200中的像素总数为M,B p为与基于帧扫描的读取模式下针对每个像素分配的像素数据量(例如,比特数目),f为读取电路220在基于帧扫描的读取模式下的预定帧速率,即读取电路220以该模式下的预定帧速率f Hz扫描像素阵列电路210,以读取像素阵列电路210中的所有像素生成的数据信号。所以,M,B p以及f均为已知量,可以直接得到基于帧扫描的读取模式下读取电路220的读取数据速率。
在一些可能的实施例中,在当前采用的第一读取模式为基于帧扫描的读取模式的情况下,读取电路220基于一段时间内对像素阵列电路210中产生的光强变化事件的数目历史统计可以得出的每秒产生的平均事件数目N ev,根据帧扫描的读取模式获取的N ev,可以计算出在基于事件流的读取模式中,读取电路220每秒读取的事件数据量为B ev·N ev个比特,即基于事件流的读取模式中,读取电路220的读取数据速率为B ev·N evbps。
通过上述两个实施方式可知,基于帧扫描的读取模式下读取电路220的读取数据速率可以根据预定义的参数直接计算得到,基于事件流的读取模式下读取电路220的读取数据速率可以根据两种模式下的任意一种模式获取的N ev计算得到。
控制电路230耦合至读取电路220,并且被配置为控制读取电路220以特定读取模式来读取像素阵列电路210生成的数据信号。在一些可能的实施例中,控制电路230可以从读取电路220获取至少一个数据信号,并至少基于该至少一个数据信号来判断当前读取模式和备选的读取模式中的哪一种更适合当前的应用场景和运动状态。进而,在一些实施例中,控制电路230可以基于该判断来指示读取电路220从当前数据读取模式切换到另一数据读取模式。
在一些可能的实施例中,控制电路230可以基于对光强变化事件的历史统计来向读取电路220发送关于切换读取模式的指示。例如,控制电路230可以基于从读取电路220接收的至少一个数据信号,确定与至少一个光强变化事件有关的统计数据。如果统计数据被确定为满足预定切换条件,则控制电路230向读取电路220发送模式切换信号,以使读取电路220切换到第二读取模式。为了便于比较,统计数据可以分别用于衡量第一读取模式和第二读取模式的读取数据速率。
在一些实施例中,统计数据可以包括单位时间内像素阵列电路210测量到的事件数目 的总数据量。如果读取电路220在第一读取模式下读取的光强变化事件的总数据量已经大于或等于第二读取模式的光强变化事件的总数据量,则表明读取电路220应当从第一读取模式切换至第二读取模式。在一些实施例中,给定第一读取模式为基于帧扫描的读取模式并且第二读取模式为基于事件流的读取模式。控制电路230可以基于像素阵列电路的像素数目M、帧速率f和像素数据量B p来确定与第一读取模式下读取的光强变化事件的总数据量M·B p·f。控制电路230可以基于光强变化事件的数目N ev和与基于事件流的读取模式相关联的事件数据量B ev,来确定光强变化事件的总数据量B ev·N ev,也即,在第二读取模式下读取的光强变化事件的总数据量B ev·N ev。在一些实施例中,可以利用切换参数来调节两个读取模式下的总数据量之间的关系,如以下公式(1)所示,第一读取模式下读取的光强变化事件的总数据量M·B p·f大于或等于第二读取模式的光强变化事件的总数据量B ev·N ev,读取电路220应当切换到第二读取模式:
η·M·B P·f≥B ev·N ev  (1)
其中η为用于调节的切换参数。由以上公式(1)可以进一步得出,第一阈值数据量d 1=M·B p·f·η。即,如果光强变化事件的总数据量B ev·N ev小于或等于阈值数据量d 1,则表明第一读取模式下读取的光强变化事件的总数据量已经大于或等于第二读取模式的光强变化事件的总数据量,控制电路230可以确定光强变化事件的统计数据满足预定切换条件。在该实施例中,可以至少基于像素阵列电路的像素数目M、与基于帧扫描的读取模式相关联的帧速率f和像素数据量B p来确定阈值数据量d 1
作为上述实施例的备选实施方式中,第一读取模式下读取的光强变化事件的总数据量M·B p·f大于或等于第二读取模式的光强变化事件的总数据量B ev·N ev可以如以下公式(2)所示:
M·B P·f-B ev·N ev≥θ  (2)
其中θ为用于调节的切换参数。由以上公式(2)可以进一步得出,第二阈值数据量
d 2=M·B p·f-θ
即,如果光强变化事件的总数据量B ev·N ev小于或等于第二阈值数据量d 2,则表明第一读取模式下读取的光强变化事件的总数据量已经大于或等于第二读取模式的光强变化事件的总数据量,控制电路230可以确定光强变化事件的统计数据满足预定切换条件。在该实施例中,可以至少基于像素阵列电路的像素数目M、与基于帧扫描的读取模式相关联的帧速率f和像素数据量B p来确定阈值数据量d 2
在一些实施例中,第一读取模式为基于事件流的读取模式并且第二读取模式为基于帧扫描的读取模式。由于在基于事件流的读取模式,读取电路220仅读取产生事件的像素生成的数据信号。因而,控制电路的230基于读取电路220所提供的数据信号的数目可以直接确定像素阵列电路210中产生的光强变化事件的数目N ev。控制电路230可以基于事件数目N ev和与基于事件流的读取模式相关联的事件数据量B ev,确定光强变化事件的总数据量,即第一读取模式下读取的事件的总数据量B ev·N ev。类似地,控制电路230还可以基于像素阵列电路的像素数目M、帧速率f和像素数据量B p来确定与第二读取模式下读取的光强变化事件的总数据量M·B p·f。如以下公式(3)所示,第一读取模式下读取的光强变化事件 的总数据量B ev·N ev大于或等于第二读取模式的光强变化事件的总数据量M·B p·f,读取电路220应当切换到第二读取模式:
B ev·N ev≥η·M·B P·f  (3)
其中η为用于调节的切换参数。由以上公式(3)可以进一步得出,第一阈值数据量d 1=η·M·B P·f。如果光强变化事件的总数据量B ev·N ev大于或等于阈值数据量d 1,则控制电路230确定光强变化事件的统计数据满足预定切换条件。在该实施例中,可以至少基于像素阵列电路的像素数目M、帧速率f和像素数据量B p来确定阈值数据量d 1
作为上述实施例的备选实施方式中,第一读取模式下读取的光强变化事件的总数据量B ev·N ev大于或等于第二读取模式的光强变化事件的总数据量M·B p·f可以如以下公式(4)所示:
M·B P·f-B ev·N ev≤θ  (4)
其中θ为用于调节的切换参数。由以上公式(4)可以进一步得出,第二阈值数据量d 2=M·B P·f-θ,如果光强变化事件的总数据量B ev·N ev大于或等于阈值数据量d 2,则控制电路230确定光强变化事件的统计数据满足预定切换条件。在该实施例中,可以至少基于像素阵列电路的像素数目M、帧速率f和像素数据量B p来确定阈值数据量d 2
在另一些实施例中,统计数据可以包括单位时间内像素阵列电路210测量到的事件数目N ev。如果第一读取模式为基于帧扫描的读取模式并且第二读取模式为基于事件流的读取模式,控制电路230基于读取电路220提供的多个数据信号中的第一数据信号的数目,确定光强变化事件的数目N ev。如果统计数据指示光强变化事件的数目N ev小于第一阈值数目n 1,则控制电路230确定光强变化事件的统计数据满足预定切换条件可以至少基于像素阵列电路的像素数目M、与基于帧扫描的读取模式相关联的帧速率f和像素数据量B p、以及与基于事件流的读取模式相关联的事件数据量B ev来确定第一阈值数目n 1。例如,在前述实施例中,基于公式(1)可以进一步得到如下公式(5):
Figure PCTCN2020141973-appb-000001
即,第一阈值数目n 1可以被确定为
Figure PCTCN2020141973-appb-000002
作为上述实施例的备选实施方式中,基于公式(2)可以进一步得到如下公式(6):
Figure PCTCN2020141973-appb-000003
相应地,第二阈值数目n 2可以被确定为
Figure PCTCN2020141973-appb-000004
在又一些实施例中,如果第一读取模式为基于事件流的读取模式并且第二读取模式为基于帧扫描的读取模式,控制电路230基于读取电路220提供的至少一个数据信号的数目,可以直接确定光强变化事件的数目N ev。如果统计数据指示光强变化事件的数目N ev大于或等于第一阈值数目n 1,则控制电路230确定光强变化事件的统计数据满足预定切换条件。可以至少基于像素阵列电路210的像素数目M、与基于帧扫描的读取模式相关联的帧速率f 和像素数据量B p、以及与基于事件流的读取模式相关联的事件数据量B ev来确定第一阈值数目n 1=M·B p·f/(η·B ev)。例如,在前述实施例中,基于公式(3)可以进一步得到如下公式(7):
Figure PCTCN2020141973-appb-000005
即,第一阈值数目n 1可以被确定为
Figure PCTCN2020141973-appb-000006
作为上述实施例的备选实施方式中,基于公式(4)可以进一步得到如下公式(8):
Figure PCTCN2020141973-appb-000007
相应地,第二阈值数目n 2可以被确定为
Figure PCTCN2020141973-appb-000008
应当理解的是,以上给出的公式、切换条件及相关的计算方法仅仅是本申请的实施例的一种示例实现,其他合适的模式切换条件、切换策略及计算方法也可以被采用,本申请的范围在此方面不受限制。
图6-a示出了根据本申请的实施例的视觉传感器在基于帧扫描的读取模式下操作的示意图。图6-b示出了根据本申请的实施例的视觉传感器在基于事件流的读取模式下操作的示意图。如图6-a所示,读取电路220或320当前以第一读取模式,即基于帧扫描的读取模式操作。由于控制电路230或330基于历史统计,确定当前像素阵列电路210或310中产生的事件数目较少,例如一帧数据中仅有四个有效数据,继而预测下一时间段内可能的事件产生速率较低。如果读取电路220或320继续采用基于帧扫描的读取模式进行读取,将需要重复地为生成事件的像素分配比特,从而产生大量冗余数据。在这种情况下,控制电路230或330向读取电路220或320发送模式切换信号,以使读取电路220或320从第一读取模式切换为第二读取模式。在切换后,图6-b所示,读取电路220或320在第二读取模式下操作,仅读取有效的数据信号,从而避免了大量无效数据信号所占用的传输带宽和存储资源。
图6-c示出了根据本申请的实施例的视觉传感器在基于事件流的读取模式下操作的示意图。图6-d示出了根据本申请的实施例的视觉传感器在基于帧扫描的读取模式下操作的示意图。如图6-c所示,读取电路220或320当前以第一读取模式,即基于事件流的读取模式操作。由于控制电路230或330基于历史统计,确定当前像素阵列电路210或310中产生的事件数目较多,例如,短时间内像素阵列电路210或310中的近乎所有像素均生成指示光强变化量高于预定阈值的数据信号。继而,读取电路220或320可以预测下一时间段内可能的事件产生速率较高。由于所读取的数据信号中存在大量冗余数据,例如,近乎相同的像素位置信息、读取时间戳等等,如果读取电路220或320继续采用基于事件流的读取模式进行读取,将造成读取数据量激增。因而,在这种情况下,控制电路230或330向读取电路220或320发送模式切换信号,以使读取电路220或320从第一读取模式切换为第二读取模式。在切换后,图6-d所示,读取电路220或320在基于帧扫描的模式下操 作,以单个像素的表示代价更小的读取模式来读取数据信号,缓解了存储和传输数据信号的压力。
在一些可能的实施例中,视觉传感器200或300还可以包括解析电路,其可以被配置为针对读取电路220或320输出的数据信号进行解析。在一些可能的实施例中,解析电路可以采用与读取电路220或320的当前数据读取模式相适应的解析模式来解析数据信号。这将在下面进行详细描述。
应当理解的是,其他现有的或未来待开发的数据读取模式、数据读取模式、数据解析模式等也适用于本申请的可能的实施例,并且本申请的实施例中的所有数值均是说明性而非限制性的,例如,本申请的可能的实施例可以在多于两种数据读取模式之间进行切换。
根据本申请的可能的实施例,提供了一种视觉传感器芯片,能够根据对像素阵列电路中产生的光强变化事件的历史统计情况,自适应地在多种读取模式之间进行切换。这样,无论在动态场景还是静态场景中,视觉传感器芯片始终可以实现良好的读取和解析性能,避免冗余数据的产生,缓解了图像处理、传输和存储的压力。
图7示出了根据本申请的可能的实施例的用于操作视觉传感器芯片的方法的流程图。在一些可能的实施例中,该方法可以在图4-a所示的视觉传感器200或者图4-b所示的视觉传感器300以及下文的图9所示的电子设备中实现,或者也可以使用任意适当的设备来实现,包括目前已知的或将来待开发的各种设备。为了方便讨论,下面将结合图4-a所示的视觉传感器200来描述方法。
参阅图7,本申请实施例提供的一种用于操作视觉传感器芯片的方法,可以包括以下步骤:
501、生成与像素阵列电路中的多个像素对应的多个数据信号。
像素阵列电路210通过测量光强变化量来生成与像素阵列电路210中的多个像素对应的多个数据信号。在本文的上下文中,数据信号可以指示包括,但不限于光强极性、绝对光强度值、光强度的变化值等等。
502、以第一读取模式从像素阵列电路读取多个数据信号中的至少一个数据信号。
读取电路220以第一读取模式从像素阵列电路210读取多个数据信号中的至少一个数据信号,并且这些数据信号经读取之后在视觉传感器200内占用一定的存储和传输资源。取决于特定的读取模式,视觉传感器芯片200读取数据信号的方式可以不同。在一些可能的实施例中,例如,在基于事件流的读取模式中,读取电路220通过扫描像素阵列电路210,确定与光强变化事件有关的像素的位置信息(x,y)。基于该位置信息,读取电路220可以读出多个数据信号中的第一数据信号。在该实施例中,读取电路220通过读取数据信号,获取光强的特征信息、产生光强变化事件的像素的位置信息(x,y)、读取数据信号的时间戳t等。
在另一些可能的实施例中,第一读取模式可以是基于帧扫描的读取模式。在该模式下,视觉传感器200以与基于帧扫描的读取模式相关联的帧频率扫描像素阵列电路210,来读取像素阵列电路210产生的所有数据信号。在该实施例中,读取电路220通过读取数据信号,获取光强的特征信息。
503、向控制电路提供至少一个数据信号。
读取电路220向控制电路230提供所读取的至少一个数据信号,以供控制电路230进行数据统计和分析。在一些实施例中,控制电路230可以基于该至少一个数据信号,确定与至少一个光强变化事件有关的统计数据。控制电路230可以利用切换策略模块来分析统计数据。如果确定统计数据满足预定切换条件,则控制电路230向读取电路220发送模式切换信号。
在第一读取模式为基于帧扫描的读取模式并且第二读取模式为基于事件流的读取模式的情况下,在一些实施例中,控制电路230可以基于多个数据信号中的第一数据信号的数目,确定光强变化事件的数目。进而,控制电路230将光强变化事件的数目与第一阈值数目比较。如果统计数据指示光强变化事件的数目小于或等于第一阈值数目,则控制电路230确定光强变化事件的统计数据满足预定切换条件,并发送模式切换信号。在该实施例中,控制电路230可以基于像素阵列电路的像素数目、与基于帧扫描的读取模式相关联的帧速率和像素数据量、以及与基于事件流的读取模式相关联的事件数据量来确定或调整第一阈值数目。
在第一读取模式为基于事件流的读取模式并且第二读取模式为基于帧扫描的读取模式的情况下,在一些实施例中,控制电路230可以基于从读取电路220接收的第一数据信号,确定与光强变化事件有关的统计数据。进而,控制电路230将光强变化事件的数目与第二阈值数目比较。如果光强变化事件的数目大于或等于第二阈值数目,则控制电路230确定光强变化事件的统计数据满足预定切换条件,并发送模式切换信号。在该实施例中,控制电路230可以基于像素阵列电路的像素数目、与基于帧扫描的读取模式相关联的帧速率和像素数据量、以及与基于事件流的读取模式相关联的事件数据量来确定或调整第二阈值数目。
504、基于模式切换信号,将第一读取模式切换为第二读取模式。
读取电路220基于从控制电路220接收的模式切换信号,将第一读取模式切换为第二读取模式。进而,读取电路220以第二读取模式来读取像素阵列电路210生成的至少一个数据信号。控制电路230随后可以继续对像素阵列电路210产生的光强变化事件进行历史统计,当满足切换条件时,发送模式切换信号以使读取电路220从第二读取模式切换为第一读取模式。
根据本申请的可能的实施例提供的方法,控制电路在整个读取和解析的过程中持续地对像素阵列电路中产生的光强变化事件进行历史统计和实时分析,一旦满足切换条件就发送模式切换信号,以使读取电路从当前读取模式切换为更为合适的备选切换模式。该自适应地切换过程不断重复,直至对所有数据信号的读取完成。
图8示出了本申请的可能的实施例的控制电路的框图。控制电路可以用于实现图4-a中的控制电路230、图5中的控制电路330等,也可以利用其他合适的设备来实现。应当理解的是,控制电路仅用于示例性目的,而不暗示对于本申请的范围的任何限制。本申请的实施例还可以被体现在不同的控制电路中。另外,还应当理解,控制电路还可以包括其他元件、模块或实体,出于清楚的目的未被示出,但不意味着本申请的实施例不具备这些 元件或实体。
如图8所示,控制电路包括至少一个处理器602、耦合到处理器602的至少一个存储器604以及耦合到处理器602的通信机制612。存储器604至少用于存储计算机程序以及从读取电路获取的数据信号。在处理器602上预配置有统计模型606和策略模块608。控制电路630可以通过通信机制612被通信耦合到如图4-a所示的视觉传感器200的读取电路220或者视觉传感器外部的读取电路,以对其实现控制功能。为了便于描述,下面参考图4-a中的读取电路220,但是本申请的实施例同样适用于外设读取电路的配置。
与图4-a所示的控制电路230类似,在一些可能的实施例中,控制电路可以被配置为控制读取电路220以特定数据读取模式(例如,基于帧扫描的同步读取模式、基于事件流的异步读取模式等)来读取像素阵列电路210生成的多个数据信号。另外,控制电路可以被配置为从读取电路220获取数据信号,数据信号可以指示,但不限于光强极性、绝对光强度值、光强度的变化值等等。例如,光强极性可以表示光强变化的趋势,如增强或减弱,通常用+1/-1表示。绝对光强度值可以表示在当前时刻测量的光强度值。取决于传感器的结构、用途和种类,关于光强度或光强变化的信息可以具有不同的物理意义。
控制电路基于从读取电路220获取数据信号,确定与至少一个光强变化事件有关的统计数据。在一些实施例中,控制电路可以从读取电路220获取像素阵列电路210在一段时间内生成的数据信号,并将这些数据信号存储在存储器604中,以供历史统计和分析。在本申请的上下文中,第一读取模式和第二读取模式可以分别是基于事件流的异步读取模式和基于帧扫描的同步读取模式中的一者。但是应当注意,本文关于自适应地切换读取模式所描述的所有特征同样适用于其他目前已知的或将来开发的其他类型的传感器以及数据读取模式,以及多于两种数据读取模式之间的切换。
在一些可能的实施例中,控制电路可以利用预配置的一个或多个统计模型606,对由读取电路220提供的像素阵列电路210在一段时间内产生光强变化事件进行历史统计。统计模型606然后可以向策略模块608传输统计数据以作为输出。如前文所述,统计数据可以指示光强变化事件的数目,也可以指示光强变化事件的总数据量。应当理解,任何合适的统计模型、统计算法均可应用于本申请的可能的实施例,本申请的范围在此方面不受限制。
由于统计数据是对视觉传感器在一段时间内产生光强变化事件的历史情况的统计结果,因而可供策略模块608分析和预测下一时间段内事件发生的速率。策略模块608可以预配置有一个或多个切换决策。当存在多个切换决策时,控制电路可以根据需要,例如根据视觉传感器200的类型、光强变化事件的特性、外部环境的属性、运动状态等因素,从多个切换决策中选择一个用于分析和决策。在本申请的可能的实施例中,其他合适的策略模块及模式切换条件或策略也可以被采用,本申请的范围在此方面不受限制。
在一些实施例中,如果策略模块608确定统计数据满足模式切换条件,则向读取电路220输出关于切换读取模式的指示。在另一实施例中,如果策略模块608确定统计数据不满足模式切换条件,则不向读取电路220输出关于切换读取模式的指示。在一些实施例中,关于切换读取模式的指示可以如以上实施例所述的采用显式形式,例如以切换信号或标记 位的形式通知读取电路220切换读取模式。
图9示出了根据本申请的可能的实施例的电子设备的框图。如图9所示,电子设备包括视觉传感器芯片901、通信接口902和903、控制电路930、以及解析电路904。应当理解的是,电子设备用于示例性目的,其可以利用任何合适的设备来实现,包括当前已知的和未来开发的各种传感器设备。本申请的实施例还可以被体现在不同的传感器系统中。另外,还应当理解,电子设备还可以包括其他元件、模块或实体,出于清楚的目的未被示出,但不意味着本申请的实施例不具备这些元件、模块或实体。
如图9所示,视觉传感器包括像素阵列电路710以及读取电路720,其中读取电路720的读取组件720-1和720-2分别经由通信接口702和703耦合至控制电路730。在本申请的实施例中,读取组件720-1和720-2可以分别利用独立的设备实现,也可以被集成在同一设备中。例如,图4-a所示的读取电路220是一种集成的示例实现。为了便于描述,读取组件720-1和720-2可以分别被配置为以基于帧扫描的读取模式和基于事件流的读取模式实现数据读取功能。
像素阵列电路710可以利用图4-a中的像素阵列电路210或图5中的像素阵列电路310来实现,也可以利用任何合适的其他设备来实现,本申请在这方面不受限制。关于像素阵列电路710的特征在此不再进行赘述。
读取电路720可以以特定的读取模式读取像素阵列电路710生成的数据信号。例如,在接通读取组件720-1并断开读取组件720-2的示例中,读取电路720初始采用基于帧扫描的读取模式读取数据信号。在接通读取组件720-2并断开读取组件720-1的示例中,读取电路720初始采用基于事件流的读取模式读取数据信号。读取电路720以利用图4-a中的读取电路220或图5中的读取电路320来实现,也可以利用任何合适的其他设备来实现,关于读取电路720的特征在此不再进行赘述。
在本申请的实施例中,控制电路730可以通过指示信号或标记位的方式指示读取电路720从第一读取模式切换到第二读取模式。在这种情况下,读取电路720可以从控制电路730接收关于切换读取模式的指示,例如,接通读取组件720-1并断开读取组件720-2,或接通读取组件720-2并断开读取组件720-1。
如前文所述,电子设备还可以包括解析电路704。解析电路704可以被配置为解析由读取电路720读取的数据信号。在本申请的可能的实施例中,解析电路可以采用与读取电路720的当前数据读取模式相适应的解析模式。作为示例,如果读取电路720初始以基于事件流的读取模式读取数据信号,则解析电路相应地基于与该读取模式相关联的第一数据量B ev·N ev来解析数据。当读取电路720基于控制电路730的指示从基于事件流的读取模式切换为基于帧扫描的读取模式时,解析电路开始按照第二数据量,即一帧数据大小M·B p来解析数据信号,反之亦然。
在一些实施例中,解析电路704可以在无需显式切换信号或标记位的情况下实现解析电路的解析模式的切换。例如,解析电路704可以采用与控制电路730相同或相应的统计模型和切换策略,以对读取电路720提供的数据信号做出与控制电路730相同的统计分析并做出一致的切换预测。作为示例,如果读取电路720初始以基于事件流的读取模式读取 数据信号,相应地,解析电路初始基于与该读取模式相关联的第一数据量B ev·N ev来解析数据。例如,解析电路解析出的前b x个比特指示像素的坐标x,接下来b y个比特指示像素的坐标y,其后的b t个比特指示读取时间,最后取b f个比特指示光强的特征信息。解析电路从读取电路720获取至少一个数据信号,并确定与至少一个光强变化事件有关的统计数据。如果解析电路704确定该统计数据满足切换条件,则切换至与基于帧扫描的读取模式相对应的解析模式,以帧数据大小M·B p来解析数据信号。
作为另一示例,如果读取电路720初始以基于帧扫描的读取模式读取数据信号,则解析电路704以与该读取模式相对应的解析模式,按照每B p比特依次取出帧内的每个像素位置的值,其中未产生光强变化事件的像素位置的值为0。解析电路704基于数据信号可以统计出一帧内的非0个数,即该帧内的光强变化事件的数目。
在一些可能的实施例中,解析电路704从读取电路720获取至少一个数据信号,并至少基于该至少一个数据信号来判断当前解析模式和备选的解析模式中的哪一种与读取电路720的读取模式相对应。进而,在一些实施例中,解析电路704可以基于该判断来从当前解析模式切换到另一解析模式。
在一些可能的实施例中,解析电路704可以基于对光强变化事件的历史统计来确定是否切换解析模式。例如,解析电路704可以基于从读取电路720接收的至少一个数据信号,确定与至少一个光强变化事件有关的统计数据。如果统计数据被确定为满足切换条件,则解析电路704从当前解析模式切换到备选的解析模式。为了便于比较,统计数据可以分别用于衡量读取电路720的第一读取模式和第二读取模式的读取数据速率。
在一些实施例中,统计数据可以包括单位时间内像素阵列电路710测量到的事件数目的总数据量。如果解析电路704基于至少一个数据信号确定读取电路720在第一读取模式下读取的光强变化事件的总数据量已经大于或等于其第二读取模式的光强变化事件的总数据量,则表明读取电路720已从第一读取模式切换至第二读取模式。这种情况下,解析电路704应当相应地切换至与当前读取模式相对应的解析模式。
在一些实施例中,给定第一读取模式为基于帧扫描的读取模式并且第二读取模式为基于事件流的读取模式。在该实施例中,解析电路704初始以与第一读取模式相对应的、基于帧的解析模式来解析从读取电路720获取的数据信号。解析电路704可以基于像素阵列电路710的像素数目M、帧速率f和像素数据量B p来确定读取电路720在第一读取模式下读取的光强变化事件的总数据量M·B p·f。解析电路704可以基于光强变化事件的数目N ev和与基于事件流的读取模式相关联的事件数据量B ev,来确定读取电路720在第二读取模式下读取的光强变化事件的总数据量B ev·N ev。在一些实施例中,可以利用切换参数来调节两个读取模式下的总数据量之间的关系。进而,解析电路704可以根据,例如,上文中的公式(1)来确定读取电路720在第一读取模式下读取的光强变化事件的总数据量M·B p·f是否大于或等于第二读取模式的光强变化事件的总数据量B ev·N ev。如果是,则解析电路704确定读取电路720已切换至基于事件流的读取模式,并相应地从基于帧的解析模式切换到基于事件流的解析模式。
作为上述实施例的备选实施方式中,解析电路704可以根据上文中的公式(2)来确定 读取电路720在第一读取模式下读取的光强变化事件的总数据量M·B p·f是否大于或等于其在第二读取模式下读取的光强变化事件的总数据量B ev·N ev。类似地,在确定读取电路720在第一读取模式下读取的光强变化事件的总数据量M·B p·f大于或等于第二读取模式的光强变化事件的总数据量B ev·N ev的情况下,解析电路704确定读取电路720已切换至基于事件流的读取模式,并相应地从基于帧的解析模式切换到基于事件流的解析模式。
在一些实施例中,第一读取模式为基于事件流的读取模式并且第二读取模式为基于帧扫描的读取模式。在该实施例中,解析电路704初始以与第一读取模式相对应的、基于事件流的解析模式来解析从读取电路720获取的数据信号。如前所述,解析电路704基于读取电路720所提供的第一数据信号的数目可以直接确定像素阵列电路710中产生的光强变化事件的数目N ev。解析电路704可以基于事件数目N ev和与基于事件流的读取模式相关联的事件数据量B ev,确定读取电路720在第一读取模式下读取的事件的总数据量B ev·N ev。类似地,解析电路704还可以基于像素阵列电路的像素数目M、帧速率f和像素数据量B p来确定读取电路720在第二读取模式下读取的光强变化事件的总数据量M·B p·f。然后,解析电路704可以,例如,根据上文中的公式(3)来确定第一读取模式下读取的光强变化事件的总数据量B ev·N ev是否大于或等于第二读取模式的光强变化事件的总数据量M·B p·f。类似地,当解析电路704确定读取电路720在第一读取模式下读取的光强变化事件的总数据量B ev·N ev大于或等于第二读取模式的光强变化事件的总数据量M·B p·f时,解析电路704确定读取电路720已切换至基于帧扫描的读取模式,并相应地从基于事件流的解析模式切换到基于帧的解析模式。
作为上述实施例的备选实施方式中,解析电路704可以根据上文中的公式(4)来确定读取电路720在第一读取模式下读取的光强变化事件的总数据量B ev·N ev是否大于或等于其在第二读取模式下读取的光强变化事件的总数据量M·B p·f。类似地,在确定读取电路720在第一读取模式下读取的光强变化事件的总数据量B ev·N ev大于或等于第二读取模式的光强变化事件的总数据量M·B p·f的情况下,解析电路704确定读取电路720已切换至基于帧扫描的读取模式,并相应地从基于事件流的解析模式切换到基于帧扫描的解析模式。
对于基于帧扫描的读取模式下事件的读取时间t,默认同一帧内的所有事件均具有相同的读取时间t。在对事件读取时间的精度要求较高的情况下,可以进一步通过如下方式来确定每个事件的读取时间。以上述实施例为例,在基于帧扫描的读取模式下,读取电路720扫描像素阵列电路的频率为f Hz,则读取相邻两帧数据的时间间隔为S=1/f,并且给定每一帧的起始时间为:
T k=T 0+kS  (9)
其中T 0为第一帧的起始时间,k为帧序号,则针对M个像素中的一个像素进行数模转换所需的时间可由如下公式(10)来确定:
Figure PCTCN2020141973-appb-000009
第k帧中的第i个像素处产生光强变化事件的时间可由如下公式(11)来确定:
Figure PCTCN2020141973-appb-000010
其中i为正整数。如当前读取模式为同步读取模式,则切换为异步读取模式,按照每个事件B ev比特解析数据。在上述实施例中,解析模式的切换可以在没有显式切换信号或标记位的情况下实现。对于其他目前已知或未来开发的数据读取模式,解析电路也可采用类似的与数据读取模式相适应的方式解析数据,在此不再赘述。
图10示出了单一数据读取模式与根据本申请的可能的实施例的自适应切换读取模式的数据量随时间变化的示意图。图10的左半部分描绘了单纯采用同步读取模式或异步读模式的传统的视觉传感器或传感器系统的读取数据量随时间变化的示意图。在单纯采用同步读取模式的情形中,如曲线1001所示,由于每帧具有固定的数据量,读取的数据量随时间保持不变,即,读取数据速率(单位时间内读取的数据量)稳定。如前所述,当像素阵列电路中产生大量事件时,采用基于帧扫描的读取模式来读取数据信号较为合理,帧数据中绝大部分为表示产生事件的有效数据,存在的冗余较少。而当像素阵列电路中产生的事件较少时,一帧中存在大量表示并产生事件的无效数据,此时仍以帧数据结构表示和读取像素处的光强度信息将产生冗余,浪费传输带宽和存储资源。
在单纯采用异步读取模式的情形中,如曲线1002所示,读取的数据量随事件产生的速率而发生变化,因而读取数据速率不是固定的。当像素阵列电路中产生的事件较少时,仅需要为少量事件分配用于表示像素的坐标信息(x,y)、数据信号被读取的时间戳t和光强的特征信息f的比特,所需读取的总数据量较小,在这种情况下采用异步读取模式较为合理。当短时间内在像素阵列电路中产生大量事件时,需要分配大量用于表示这些事件的比特。然而,这些像素坐标几乎相邻,数据信号的读取时间也几乎相同。换言之,读取的事件数据中存在大量重复的数据,因而在异步读取模式中同样存在冗余的问题,在这种情况下的读取数据速率甚至超过同步读取模式下的读取数据速率,如果仍旧采用异步读取模式是不合理的。
图10的右半部分描绘了根据本申请的可能的实施例的自适应数据读取模式下的数据量随时间变化的示意图。自适应数据读取模式可以利用图4-a所示的视觉传感器200、图4-b所示的视觉传感器300或者图9所示的电子设备来实现,或者传统的视觉传感器或传感器系统可以通过利用图8所示的控制电路来实现自适应的数据读取模式。为了便于描述,下面参照图4-a所示的视觉传感器200来描述关于自适应数据读取模式的特征。如曲线1003所示,视觉传感器200在初始化状态下选择例如异步读取模式。由于该模式下用于表示每个事件的比特数目B ev是预定的(例如,B ev=b x+b y+b t+b f),随着事件的产生和读取,视觉传感器200可以统计出当前模式下的读取数据速率。另一方面,同步读取模式中用于表示每一帧的每个像素的比特数目B p也是预定的,因此可以计算出在该段时间内使用同步读取模式的读取数据速率。视觉传感器200然后可以确定两种读取模式下的数据速率之间的关系是否满足模式切换条件。例如,视觉传感器200可以基于预定义的阈值比较两种读取模式中哪种模式的读取数据速率更小。一旦确定满足模式切换条件,则视觉传感器200切换为另一种读取模式,例如从初始的异步读取模式切换为同步读取模式。上述步骤在数据信号的读取和解析的过程中持续进行,直至完成所有数据的输出。如曲线1003所示,视觉传感器200在整个数据读取过程中自适应地选择最优的读取模式,两种读取模式交替出 现,使得视觉传感器200的读取数据速率始终保持未超过同步读取模式的读取数据速率,从而降低了视觉传感器的数据传输、解析和存储的代价。
另外,根据本申请的实施例所提出的自适应数据读取方式,视觉传感器200可以对事件进行历史数据统计以预测下一时间段内可能的事件产生速率,因此能够选出更加适合应用场景和运动状态的读取模式。
通过上述方案,视觉传感器能够自适应地在多种数据读取模式之间切换,使得读取数据速率始终保持未超过预定的读取数据速率阈值,从而降低了视觉传感器的数据传输、解析和存储的代价,显著提高了传感器的性能。另外,这样的视觉传感器可以对一段时间内产生的事件进行数据统计以用于预测下一时间段内可能的事件产生速率,因而能够选出更加适合当前外部环境、应用场景和运动状态的读取模式。
上文介绍了像素阵列电路可用于测量光强变化量,生成与多个像素对应的多个数据信号。数据信号可以指示包括,但不限于光强极性、绝对光强度值、光强度的变化值等等。下面对像素阵列电路输出数据信号进行详细说明。
图11示出了本申请提供的一种像素电路900的示意图。像素阵列电路210、像素阵列电路310以及像素阵列电路710中的每一个像素阵列电路都可以包括一个或多个像素阵列,并且每个像素阵列包括多个像素,每个像素可以视为一个像素电路,每一个像素电路用于生成与该像素对应的数据信号。参阅图11,为本申请实施例提供的一种优选的像素电路的示意图。本申请有时也将一个像素电路简称为一个像素。如图11所示,本申请中一种优选的像素电路包括光强检测单元901,阈值比较单元902,读出控制单元903以及光强采集单元904。
光强检测单元901,用于将获取到的光信号转换为第一电信号。光强检测单元901可以实时监测照射在像素电路上的光强信息,并实时将获取的光信号转换为电信号并输出。在一些可能的实施例中,光强检测单元901可以将获取到的光信号转换为电压信号。本申请对光强检测单元的具体结构并不进行限定,能实现将光信号转换为电信号的结构本申请实施例都可以采用,比如光强检测单元可以包括光电二极管和晶体管。光电二极管的阳极接地,光电二极管的阴极与晶体管的源极连接,晶体管的漏极与栅极连接到电源。
阈值比较单元902,用于判断第一电信号是否大于第一目标阈值,或者第一电信号是否小于第二目标阈值,第一电信号大于第一目标阈值,或者第一电信号小于第二目标阈值时,阈值比较单元902输出第一数据信号,该第一数据信号用于指示该像素有光强变换事件。阈值比较单元902用于比较当前光强与上一次事件产生时的光强的差异是否超过预定阈值,可以参考公式1-1进行理解。第一目标阈值可以理解为第一预定阈值和第二电信号的和,第二目标阈值可以理解为第二预定阈值和第二电信号的和。第二电信号是上一次事件发生时光强检测单元901输出的电信号。本申请实施例中的阈值比较单元可以通过硬件的方式实现,也可以通过软件的方式实现,本申请实施例对此并不进行限定。阈值比较单元902输出的第一数据信号的类型可能不同:在一些可能的实施例中,该第一数据信号包括极性信息,比如+1或-1,用于指示光强增强或者光强减弱。在一些可能的实施例中,该第一数据信号可以是激活信号,用于指示读出控制单元903控制光强采集单元904采集第 一电信号,并缓存第一电信号。当第一数据信号是激活信号时,第一数据信号也可以是极性信息,则读出控制单元903获取到第一数据信号时,控制光强采集单元904采集第一电信号。
读出控制单元903还用于通知读取电路读取光强采集单元904中存储的第一电信号。或者通知读取电路读取阈值比较单元902输出的第一数据信号,该第一数据信号是极性信息。
读取电路905可以被配置为按照预定顺序扫描像素阵列电路中的像素,以读取对应像素生成的数据信号。在一些可能的实施例中,读取电路905可以参照读取电路220,读取电路320,读取电路720进行理解,即读取电路905被配置为能够以多于一种信号读取模式来读取像素电路输出的数据信号。例如,读取电路905可以以第一读取模式和第二读取模式中的其中一种读取模式进行读取,第一读取模式和第二读取模式分别对应于基于帧扫描的读取模式和基于事件流的读取模式中的其中一种模式。在一些可能的实施例中,读取电路905也可以仅以一种信号读取模式来读取像素电路输出的数据信号,比如读取电路905被配置为仅以基于帧扫描的读取模式来读取像素电路输出的数据信号,或者读取电路905被配置为仅以基于事件流的读取模式来读取像素电路输出的数据信号。在图11对应的实施例中,读取电路905读取的数据信号的表示方式不同,即在一些可能的实施例中,读取电路读取的数据信号通过极性信息表示,比如,读取电路可以读取阈值比较单元输出的极性信息;在一些可能的实施例中,读取电路读取的数据信号可以通过光强信息表示,比如读取电路可以读取光强采集单元缓存的电信号。
参阅图11-a,以基于事件流的读取模式来读取像素电路输出的数据信号为例,对通过光强信息表示事件和通过极性信息表示事件进行说明。如图11-a的上半部分所示,黑色圆点表示产生光强变化事件的像素,图11-a中一共包括8个事件,其中前5个事件通过光强信息进行表示,后3个事件通过极性信息进行表示。如图11-a的下半部分所示,通过光强信息表示的事件以及通过极性信息表示的事件均需包括坐标信息(x,y)、时间信息t,不同之处在于,通过光强信息表示的事件,光强的特征信息m是光强信息a,通过极性信息表示的事件,光强的特征信息m是极性信息p。关于光强信息和极性信息的差别已经在上文进行了介绍,这里不再重复说明,仅强调采用极性信息表示的事件的数据量小于采用光强信息表示的数据量。
关于如何确定读取电路读取的数据信号是以哪种信息进行表示,需要根据控制电路发出的指示确定,将在下文进行详细介绍。
在一些实施方式中,读取电路905可以被配置向控制电路906提供所读取的至少一个数据信号。例如,读取电路905可以向控制电路906提供在一段时间内读取的数据信号的总数据量,以供控制电路906进行历史数据统计和分析。在一个实施方式中,读取电路906基于一段时间内对像素阵列电路中的每个像素电路900产生的光强变化事件的数目进行统计可以得出像素阵列电路每秒产生的事件数目N ev。其中,N ev可以通过基于帧扫描的读取模式和基于事件流的读取模式中的其中一种模式获取。
控制电路906耦合至读取电路905,并且被配置为控制读取电路906以特定事件表示 方式来读取像素电路900生成的数据信号。在一些可能的实施例中,控制电路906可以从读取电路905获取至少一个数据信号,并至少基于该至少一个数据信号来判断当前事件的表示方式和备选的事件表示方式中的哪一种更适合当前的应用场景和运动状态。进而,在一些实施例中,控制电路906可以基于该判断来指示读取电路905从当前事件表示方式切换到另一种事件表示方式。
在一些可能的实施例中,控制电路906可以基于对光强变化事件的历史统计来向读取电路905发送关于转换事件表示方式的指示。例如,控制电路906可以基于从读取电路905接收的至少一个数据信号,确定与至少一个光强变化事件有关的统计数据。如果统计数据被确定为满足预定转换条件,则控制电路906向读取电路905发送指示信号,以使读取电路905转换读取的事件格式。
在一些可能的实施例中,假设读取电路905被配置为仅以基于事件流的读取模式来读取像素电路输出的数据信号,读取电路905提供给控制电路906的数据是单位时间内像素阵列电路测量到的事件(光强变换事件)数目的总数据量。假设当前控制电路906控制读取电路905读取阈值比较单元902输出的数据,即通过极性信息表示事件,则读取电路905可以根据光强变化事件的数目N ev,数据格式的位宽H来确定光强变化事件的总数据量N ev×H。其中,数据格式的位宽H=b x+b y+b t+b p,b p个比特用于表示数据信号所指示的光强的极性信息,通常为1比特至2比特。由于光强的极性信息通常为1比特至2比特表示,因此通过极性信息表示的事件的总数据量一定小于带宽,为了保证能够在不超过带宽限制的情况下,尽量传输更高精度的事件数据,所以如果通过光强信息表示的事件的总数据量也小于或者等于带宽,则转换为通过光强信息表示事件。在一些实施例中,可以利用转换参数来调节一种事件表示方式下的数据量与带宽K之间的关系,如以下公式(12)所示,通过光强信息表示的事件的总数据量N ev×H小于或等于带宽。
N ev×H≤α×K  (12)
其中α为用于调节的转换参数。由以上公式(12)可以进一步得出,如果通过光强信息表示的事件总数据量小于或者等于带宽,控制电路906可以确定光强变化事件的统计数据满足预定切换条件。一些可能的应用场景包括一段时间内像素采集电路产生较少的事件,或者一端时间内像素采集电路产生事件的速率较慢时,在这些情况下,可以通过光强信息表示事件,由于光强信息表示的事件可以携带更多的信息,有利于对事件的后续处理和分析,比如可以提升图像重构的质量。
在一些实施方式中,假设当前控制电路906控制读取电路905读取光强采集单元904缓存的电信号,即通过光强信息表示事件,则读取电路905可以根据光强变化事件的数目N ev,数据格式的位宽H来确定光强变化事件的总数据量N ev×H。其中,当采用基于事件流的读取模式时,数据格式的位宽H=b x+b y+b t+b a,b a个比特用于表示数据信号所指示的光强信息,通常为多个比特,比如8比特-12比特。在一些实施例中,可以利用转换参数来调节一种事件表示方式下的数据量与带宽K之间的关系,如以下公式(13)所示,通过光强信息表示的事件的总数据量N ev×H大于,读取电路220应当读取阈值比较单元902输出的数据,即转换为通过极性信息表示事件:
N ev×H>β×K  (13)
其中β为用于调节的转换参数。由以上公式(13)可以进一步得出,如果光强变化事件的总数据量N ev×H大于阈值数据量β×K,则表明通过光强信息表示光强变化事件的总数据量大于等于带宽,控制电路905可以确定光强变化事件的统计数据满足预定转换条件。一些可能的应用场景包括一段时间内像素采集电路产生大量的事件,或者一段时间内像素采集电路产生事件的速率较快时,在这些情况下,如果继续采用光强信息表示事件,可能会产生事件丢失的情况,所以可以通过极性信息表示事件,缓解数据传输的压力,减少数据的丢失。
在一些实施方式中,读取电路905提供给控制电路906的数据是单位时间内像素阵列电路测量到的事件数目N ev。在一些可能的实施例中,假设当前控制电路906控制读取电路905读取阈值比较单元902输出的数据,即通过极性信息表示事件,则控制电路可以判断光强变化事件的数目N ev
Figure PCTCN2020141973-appb-000011
之间的关系,确定是否满足预定转换条件。如果N ev小于或等于
Figure PCTCN2020141973-appb-000012
读取电路220应当读取光强采集单元904中缓存的电信号,即转换为通过光强信息表示事件,将当前的通过极性信息表示事件转换为通过光强信息表示事件。例如,在前述实施例中,基于公式(12)可以进一步得到如下公式(14):
Figure PCTCN2020141973-appb-000013
在一些实施方式中,假设当前控制电路906控制读取电路905读取光强采集单元904缓存的电信号,即通过光强信息表示事件,则控制电路906可以根据光强变化事件的数目N ev
Figure PCTCN2020141973-appb-000014
之间的关系,确定是否满足预定转换条件。如果N ev大于
Figure PCTCN2020141973-appb-000015
读取电路220应当读取阈值比较单元902中输出的信号,即转换为通过极性信息表示事件,将当前的通过光强信息表示事件转换为通过极性信息表示事件。例如,在前述实施例中,基于公式(12)可以进一步得到如下公式(15):
Figure PCTCN2020141973-appb-000016
在一些可能的实施例中,假设读取电路905被配置为仅以基于帧扫描的读取模式来读取像素电路输出的数据信号,读取电路905提供给控制电路906的数据是单位时间内像素阵列电路测量到的事件(光强变换事件)数目的总数据量。当采用基于帧扫描的读取模式时,数据格式的位宽H=B p,B p为与基于帧扫描的读取模式下针对每个像素分配的像素数据量(例如,比特数目),通过极性信息表示事件时,B p通常为1比特至2比特,通过光强信息表示事件时,通常为8比特至12比特。读取电路905可以确定光强变化事件的总数据量M×H,其中M表示像素总数。假设当前控制电路906控制读取电路905读取阈值比较单元902输出的数据,即通过极性信息表示事件。通过极性信息表示的事件的总数据量一定小于带宽,为了保证能够在不超过带宽限制的情况下,尽量传输更高精度的事件数据,如果通过光强信息表示的事件的总数据量也小于或者等于带宽,则转换为通过光强信息表示事件。在一些实施例中,可以利用转换参数来调节一种事件表示方式下的数据量与带宽K之间的关系,如以下公式(16)所示,通过光强信息表示的事件的总数据量N ev×H小于或等于带宽。
M×H≤α×K  (16)
在一些实施方式中,假设当前控制电路906控制读取电路905读取光强采集单元904 缓存的电信号,即通过光强信息表示事件,则读取电路905可以确定光强变化事件的总数据量M×H,在一些实施例中,可以利用转换参数来调节一种事件表示方式下的数据量与带宽K之间的关系,如以下公式(17)所示,通过光强信息表示的事件的总数据量M×H大于带宽,读取电路220应当读取阈值比较单元902输出的数据,即转换为通过极性信息表示事件:
M×H>α×K  (17)
在一些可能的实施例中,假设读取电路905被配置为以第一读取模式和第二读取模式中的其中一种读取模式进行读取,第一读取模式和第二读取模式分别对应于基于帧扫描的读取模式和基于事件流的读取模式中的其中一种模式。示例性的,下面以读取电路905当前以基于事件流的读取模式来读取像素电路输出的数据信号,控制电路906控制读取电路905读取阈值比较单元902输出的数据,即通过极性信息表示事件这种组合模式,对控制电路如何确定是否满足切换条件进行说明:
在初始状态下,可以任意选取一种读取模式,比如可以选取基于帧扫描的读取模式,或者可以选择基于事件流的读取模式;此外,在初始状态下,可以任意选取一种事件表示方式,比如控制电路906控制读取电路905读取光强采集单元904缓存的电信号,即通过光强信息表示事件,或者控制电路906控制读取电路905读取阈值比较单元902输出的数据,即通过极性信息表示事件。假设读取电路905当前以基于事件流的读取模式来读取像素电路输出的数据信号,控制电路906控制读取电路905读取阈值比较单元902输出的数据,即通过极性信息表示事件。读取电路905提供给控制电路906的数据可以是单位时间内像素阵列电路测量到的事件(光强变换事件)数目的第一总数据量。由于像素总数M是已知的,基于帧扫描的读取模式下针对每个像素分配的像素数据量B p是已知的,通过光强信息表示事件时数据格式的位宽H是已知的。根据上述已知的M、B p、H可以获取基于事件流的读取模式来读取像素电路输出的数据信号,且通过光强信息表示事件这种组合模式下单位时间内像素阵列电路测量到的事件数目的第二总数据量;可以获取基于帧扫描的读取模型来读取像素电路输出的数据信号,且通过极性信息表示事件这种组合模式下的的单位时间内像素阵列电路测量到的事件数目的第三总数据量;基于帧扫描的读取模型来读取像素电路输出的数据信号,且通过光强信息表示事件这种组合模式下的单位时间内像素阵列电路测量到的事件数目的第四总数据量。其中具体的根据M、B p、H计算第二数据量、第三数据量以及第四数据量的方式已经在上文进行了介绍,这里不再重复赘述。通过上述读取电路905提供的第一总数据量,以及通过计算获取的第二总数据量、第三总数据量以及第四总数量,以及他们与带宽K之间的关系确定是否满足切换条件。若当前的组合模式无法保证在不超过带宽限制的情况下,尽量传输更高精度的事件数据,则确定满足切换条件,切换为能够保证在不超过带宽限制的情况下,尽量传输更高精度的事件数据的组合模式。
为了更好的理解上述过程,下面结合一个具体的例子进行说明:
假设带宽限制为K,带宽调节因子α。基于事件流的读取模式下,通过极性信息表示事件时,数据格式的位宽H=b x+b y+b t+b p,通过光强信息表示事件时,数据格式的位宽H=b x+b y+b t+b a。通常1≤b p<b a,比如b p通常为1比特至2比特,b a通常为8比特至12比 特。
基于帧扫描的读取模式下,事件无需表示坐标和时间,根据每个像素的状态确定事件,假设每个像素分配的数据位宽在极性模式下为b sp,光强模式下为b sa,像素总数为M。假设带宽限制K=1000bps,b x=5bit b y=4bit,b t=10bit,b p=1bit,b a=8bit,b sp=1bit,b sa=8bit,像素总数为M=100个,带宽调节因子α=0.9。假设第1秒产生了10个事件,第2秒产生了15个事件,第3秒产生了30个事件。
假设初始状态下,默认采用基于事件流的读取模式,事件采用极性模式表示。
以下将基于事件流的读取模式且通过极性信息表示事件简称为异步极性模式、将基于事件流的读取模式且通过光强信息表示事件简称为异步光强模式、将基于帧扫描的读取模式且通过极性信息表示事件简称为同步极性模式、将基于帧扫描的读取模式且通过光强信息表示事件简称为同步光强模式。
第1秒:产生10个事件
异步极性模式:N ev=10,H=b x+b y+b t+b p=5+4+10+1=20bit,预估数据量为N ev·H=200bit,N ev·H<α·K,满足带宽限制。
异步光强模式:此时H=b x+b y+b t+b a=5+4+10+8=27bit,则光强模式下预估数据量为N ev·H=270bit,N ev·H<α·K,仍满足带宽限制。
同步极性模式:M=100,H=b sp=1bit,此时预估数据量为M·H=100bit,M·H<α·K,仍满足带宽限制。
同步光强模式:M=100,H=b sa=8bit,此时预估数据量为M·H=800bit,M·H<α·K,仍满足带宽限制。
综上,第1秒选用异步光强模式,在不超过带宽限制的情况下,以较小的数据量(270bit)传输了所有10个事件的光强信息。控制电路906确定当前的组合模式无法保证在不超过带宽限制的情况下,尽量传输更高精度的事件数据,则确定满足切换条件,则控制将异步极性模式切换为异步光强模式。比如发送指示信号,指示读取电路905从当前事件表示方式切换到另一种事件表示方式。
第2秒:产生15个事件
异步极性模式:预估数据量为N ev·H=15×20=300bit,满足带宽限制。
异步光强模式:预估数据量为N ev·H=15×27=405bit,满足带宽限制。
同步极性模式:预估数据量为M·H=100×1=100bit,满足带宽限制。
同步光强模式:预估数据量为M·H=100×8=800bit,满足带宽限制。
综上,第2秒,控制电路906确定当前的组合模式能够保证在不超过带宽限制的情况下,尽量传输更高精度的事件数据,则确定不满足切换条件,仍选用异步光强模式。
第3秒:产生30个事件
异步极性模式:预估数据量为N ev·H=30×20=600bit,满足带宽限制。
异步光强模式:预估数据量为N ev·H=30×27=810bit,满足带宽限制。
同步极性模式:预估数据量为M·H=100×1=100bit,满足带宽限制。
同步光强模式:预估数据量为M·H=100×8=800bit,满足带宽限制。
第3秒时,同步光强模式,能够以800bit的数据量传输所有30个事件的光强信息。第3秒采用当前的组合模式(异步光强模式)无法保证在不超过带宽限制的情况下,尽量传输更高精度的事件数据,则确定满足切换条件,则控制将异步光强模式切换为同步光强模式。比如发送指示信号,指示读取电路905从当前事件读取模式切换到另一种事件读取模式。
应当理解的是,以上给出的公式、转换条件及相关的计算方法仅仅是本申请的实施例的一种示例实现,其他合适的事件表示方式的转换条件、转换策略及计算方法也可以被采用,本申请的范围在此方面不受限制。
在一些实施方式中,读取电路905中包括数据格式控制单元9051,用于控制读取电路读取阈值比较单元902中输出的信号,或者读取光强采集单元904中缓存的电信号。示例性的,下面结合两个优选的实施方式对数据格式控制单元9051进行介绍。
参阅图12-a,为本申请实施例中读取电路中数据格式控制单元的一种结构示意图。该数据格式控制单元可以包括与门951和与门954,或门953,以及非门952。其中与门951的输入端用于接收控制电路906发送的转换信号,以及阈值比较单元902输出的极性信息,与门954的输入端用于接收经过非门952后的控制电路906发送的转换信号,以及光强采集单元904输出的电信号(光强信息)。与门951和与门954的输出端连接或门953的输入端,或门953的输出端与控制电路906耦合连接。在一个可能的实施方式中,转换信号可以是0或者1,则数据格式控制单元9051可以控制读取阈值比较单元902输出的极性信息,或者控制读取光强采集单元904输出的光强信息。例如由转换信号为0,则数据格式控制单元9051可以控制输出阈值比较单元902中的极性信息,转换信号为1,则数据格式控制单元9051可以控制输出光强采集单元904中的光强信息。在一个可能的实施方式中,数据格式控制单元9051可以通过格式信号线与控制单元906连接,通过格式信号线接收控制单元906发送的转换信号。
需要说明的是,图12-a所示的数据格式控制单元仅为一种可能的结构,其他能够实现线路切换的逻辑结构,本申请实施例也可以采用。如图12-b所示,读取电路905可以包括读取组件955和956,其中读取组件955和读取组件956可以分别利用独立的设备实现,也可以被集成在同一设备中。读取组件955可以用于读取阈值比较902输出的数据,读取组件956可以用于读取光强采集单元缓存的电信号。
读取电路905可以以特定的事件表示方式读取像素阵列电路生成的数据信号。例如,控制电路可以控制接通读取组件955并断开读取组件956的示例中,读取电路905通过读取区间读取阈值比较单元902输出的数据,读取电路读取由极性信息表示的事件。在接通读取组件956并断开读取组件955的示例中,读取电路905通过读取光强采集单元904中缓存的电信号,读取电路读取由光强信息表示的事件。
然后,需要说明的是,在一些可能的实施方式中,读取电路还可以包括其他电路结构,比如还可以包括模数转换单元,用于将模拟信号转换为数字信号。再比如,还可以包括统计单元,用于统计单位时间内像素阵列电路测量到的事件数目N ev,再比如,还可以包括计算单元,用于计算单位时间内像素阵列电路测量到的事件(光强变换事件)数目的总数据量。 此外,需要说明的是,本申请中的连接可以表示直接连接或者耦接,比如或门953和控制电路906连接,在一个可能的实施方式中,可以表示或门953和控制电路906耦接,或门953可以连接统计单元的输入端,控制电路906可以连接统计单元的输出端。
根据本申请的可能的实施例提供的方法,控制电路906在整个读取和解析的过程中持续地对像素阵列电路中产生的光强变化事件进行历史统计和实时分析,一旦满足转换条件就发送转换信号,以使读取电路905从读取阈值比较单元902中的信息转换为读取光强采集单元904中的信息,或者使读取电路905从读取光强采集单元904中的信息转换为读取阈值比较单元902中的信息,该自适应地转换过程不断重复,直至对所有数据信号的读取完成。
图13示出了本申请的可能的实施例的控制电路的框图。控制电路可以用于实现图11、图12-a中的控制电路906等,如图13所示,控制电路包括至少一个处理器1101、耦合到处理器1101的至少一个存储器1102以及耦合到处理器1101的通信机制1103。存储器1102至少用于存储计算机程序以及从读取电路获取的数据信号。在处理器1101上预配置有统计模型111和策略模块112。控制电路可以通过通信机制1103被通信耦合到如图11、图12-a中的的视觉传感器的读取电路905或者视觉传感器外部的读取电路,以对其实现控制功能。
在一些可能的实施例中,控制电路可以被配置为控制读取电路905以特定事件表示方式来读取像素阵列电路生成的多个数据信号。另外,控制电路可以被配置为从读取电路905获取数据信号,且当控制电路控制读取电路905读取以光强信息表示的事件时,数据信号可以指示绝对光强度值,绝对光强度值可以表示在当前时刻测量的光强度值。当控制电路控制读取电路905读取以极性信息表示的事件时,数据信号可以指示光强极性等等。例如,光强极性可以表示光强变化的趋势,如增强或减弱,通常用+1/-1表示。
控制电路基于从读取电路获取数据信号,确定与至少一个光强变化事件有关的统计数据。比如,上文提到的统计数据可以是单位时间内像素阵列电路测量到的事件(光强变换事件)数目的总数据量,或者统计数据还可以是单位时间内像素阵列电路测量到的事件数目N ev。在一些实施例中,控制电路可以从读取电路905获取像素阵列电路在一段时间内生成的数据信号,并将这些数据信号存储在存储器1102中,以供历史统计和分析。
在一些可能的实施例中,控制电路可以利用预配置的一个或多个统计模型111,对由读取电路906提供的像素阵列电路在一段时间内产生光强变化事件进行历史统计。统计模型111然后可以向策略模块112传输统计数据。如前文所述,统计数据可以指示光强变化事件的数目,也可以指示光强变化事件的总数据量。应当理解,任何合适的统计模型、统计算法均可应用于本申请的可能的实施例,本申请的范围在此方面不受限制。
由于统计数据是对视觉传感器在一段时间内产生光强变化事件的历史情况的统计结果,因而可供策略模块112分析和预测下一时间段内事件发生的速率或者数据量。策略模块112可以预配置有一个或多个转换决策。当存在多个转换决策时,控制电路可以根据需要,例如根据视觉传感器的类型、光强变化事件的特性、外部环境的属性、运动状态等因素,从多个转换决策中选择一个用于分析和决策。
在一些实施例中,处理器中可以包括多个统计模型,和与该多个统计模型对应的策略 模块,参阅图14,为本申请实施例提供的另一种控制电路的框图。其中,统计模型1(121)可以参阅图13对应的统计模型111进行理解,策略模块1(122)可以参阅图13对应的策略模块112进行理解。统计模型2(123)可以参阅图8对应的统计模型606进行理解,策略模块2(124)可以参阅图8对应的策略模块608进行理解。通信机制1203可以参照图13对应的通信机制1103,以及图8对应的通信机制612进行理解。在这些实施方式中,控制电路可以被配置为控制读取电路220以特定数据读取模式(例如,基于帧扫描的同步读取模式、基于事件流的异步读取模式等)来读取像素阵列电路生成的多个数据信号。同时,控制电路可以被配置为从读取电路获取不同表示方式的数据信号(例如,获取由极性信息表示的数据信号,由光强信息表示的数据信号等)。存储器1202至少用于存储计算机程序以及从读取电路获取的数据信号。其中,存储器1202存储的计算机程序可以包括与切换数据读取模式相关的程序,以及与转换事件表示方式相关的程序。此外,需要说明的是,统计模型1和统计模型2可以基于不同的数据进行统计,比如统计模型1基于单位时间内像素阵列电路测量到的事件数目N ev进行统计并输出结果至策略模块1,统计模型2基于单位时间内像素阵列电路测量到的事件(光强变换事件)数目的总数据量进行统计并输出结果至策略模块2,或者统计模型1基于单位时间内像素阵列电路测量到的事件(光强变换事件)数目的总数据量进行统计并输出结果至策略模块1,统计模型2基于单位时间内像素阵列电路测量到的事件数目N ev进行统计并输出结果至策略模块2。
在一些实施例中,参阅图15,可以包括多个处理器(比如处理器1301和处理器1302)。每一个处理器分别用于输出一种控制策略,统计模型1(131)、策略模块1(132)、统计模型2(133)以及策略模块2(134)可以参照图14对应的实施例中的统计模型1,策略模块1,统计模型2,策略模块2进行理解,这里不再重复赘述。在一些实施例中,参阅图15,可以包括多个存储器(比如存储器1303和存储器1304),每一个存储器分别用于存储一种与控制策略相关的计算机程序,或者从读取电路获取的数据信号,比如存储器1用于存储从读取电路获取的数据信号以及转换事件表示方式相关的程序,存储器2用于存储从读取电路获取的数据信号以及与切换数据读取模式相关的程序。再比如,一个存储器用于存储从读取电路获取的数据信号,另一个存储器用于存储与控制策略相关的计算机程序(图中未示出此种方案)。
在一些实施例中,可以只包括一个通信机制,也可以包括多个通信机制,图15中的通信机制1305和通信机制1306可以理解为一个通信机制,也可以理解为是两个不同的通信机制,可以参照图14对应的通信机制1203和通信机制1204进行理解。
在一些实施例中,如果策略模块确定统计数据满足转换条件,则向读取电路输出关于转换事件表示方式的指示。在另一实施例中,如果策略模块确定统计数据不满足转换条件,则不向读取电路输出关于转换事件表示方式的指示。在一些实施例中,关于转换事件表示方式的指示可以如以上实施例所述的采用显式形式,例如转换信号为0或者转换信号为1的方式。
应当理解的是,控制电路仅用于示例性目的,而不暗示对于本申请的范围的任何限制。本申请的实施例还可以被体现在不同的控制电路中。另外,还应当理解,控制电路还可以 包括其他元件、模块或实体,出于清楚的目的未被示出,但不意味着本申请的实施例不具备这些元件或实体。示例性的,下面给出一种通过硬件方式实现控制电路控制读取电路读取不同表示方式的事件的方案。
参阅图16,为本申请实施例提供的一种控制电路的框图。该控制电路1400可以用于实现图11或图12-a中的控制电路906等。如图16所示,控制电路1400可以包括计数器1401和比较器1402。计数器和比较器耦接,计数器可以通过通信机制和读取电路1403进行通信,比较器也可以通过通信机制和读取电路1403进行通信。
控制电路1400可以被配置为控制读取电路1403以特定事件表示方式来读取像素阵列电路生成的多个数据信号。控制电路1400可以通过计数器1401获取读取电路1403传输的数据信号,计数器1401每接收到一个事件时,计数器的值加一。计数器可以将统计的事件数目发送至比较器1402中,比较器1402基于转换条件以及计数器传输的事件数目,判断是否输出转换信号至读取电路1403。比如,若当前通过极性信息表示事件,则转换条件可以参阅公式(14)进行理解,当比较器判断计数器输出的值小于等于
Figure PCTCN2020141973-appb-000017
时,则比较器1402输出转换信号至读取电路1403,控制读取电路1403读取光强采集单元中缓存的电信号。再比如,若当前通过光强信息表示事件,则转换条件可以参阅公式(15)进行理解,若比较器判断计数器输出的值大于等于
Figure PCTCN2020141973-appb-000018
时,则比较器1402输出转换信号至读取电路1403,控制读取电路1403读取阈值比较单元输出的信号。比较器1402每次完成比较后,通过通知计数器1401复位。读取电路1403可以参照图11以及图12-a对应的读取电路905进行理解。
在一些实施例中,还可以允许用户自定义选择选择某一种事件的表示方式,参阅图17,为本申请实施例提供的另一种控制电路1500的框图。固定信号用于指示读取电路按照某一种固定的事件表示方式读取数据信号,比如指示读取电路读取阈值单元输出的信号(由极性信息表示的事件),或者读取光强采集单元缓存的信号(由光强信息表示的事件)。选择器1503用于接收固定信号和比较器1502输出的信号,当选择器1503接收到固定信号时,则按照固定信号的指示,控制读取电路。若选择器1503没有接收到固定信号,则按照比较器1502输出的转换信号,控制读取电路。计数器1501可以参照图16中的计数器1401进行理解,比较器1502可以参照图16中的比较器1402进行理解,读取电路1503可以参照图16中的读取电路1403进行理解。
参阅图18示出了单一事件表示方式与根据本申请提供的自适应转换事件表示方式的区别示意图。如图18所示,采用单一事件表示方式,比如采用光强信息表示事件的方式(图18中用光强模式表示),当视觉传感器需要传输的数据量超过视觉传感器的预置最大带宽时,有一部分的数据将被随机丢弃。如图18中的曲线1601所示,当像素阵列电路中产生大量事件时,传输的数据量大于带宽时,如曲线1901中的虚线部分所示,存在事件数据无法被读出的情况,即存在数据丢失的情况。当采用本申请提供的方案时,比较光强信息表示的事件的数据量与带宽之间的关系,从而调整事件的表示精度。在数据量较少时,数据传输不会超过带宽,则采用光强信息表示事件,可以尽可能的将采样到的变化像素亮度信息输出,事件的表示精度较高,该光强信息在后续处理中,比如在亮度重建时,可以直接 使用,不需要做复杂的处理。在事件大量触发时,事件的数据量超过带宽,则切换为极性信息表示事件(图18中用极性模式表示),事件的表示精度较低,由于极性信息通常只需要1比特-2比特,可以极大的减少数据量,数据量的减少可以缓解传输压力,减少数据的丢失。需要说明的是,通过极性信息进行亮度重建的方式本申请实施例都可以采用,示例性的,可以通过建模估计的方法。事件的产生是由于亮度的变化大于定阈值C,当知道重建时刻之前某一个时刻的亮度,则可以根据两个时刻之间的极性信息,结合事件产生的原理,对亮度进行重建可以通过公式1-2表示:
Figure PCTCN2020141973-appb-000019
其中,x,y代表像素的行、列坐标(坐标信息),t为重建时刻的时间戳(时间信息)。e p代表为当前通过极性信息表示的事件。I(x,y,t pre)代表重建时刻之前某一个时刻的亮度信息,如果需要得到更加精确的亮度信息可以根据该像素的空间信息和时域信息进行估计,比如可以采用线性插值法,双立方插值法。在一些可能的实施例中,I(x,y,t pre)代表重建时刻的上一时刻,可以进一步减少量化误差。需要说明的是,现有技术中的通过极性信息进行亮度重建难度较大,物体识别的精度也较差,区别于现有技术,本申请提供的方案由于采用在极性信息表示的事件和光强信息进行表示的事件进行转换,在通过极性信息进行亮度重建的过程中,可以结合重建时刻之前某一个时刻的亮度(光强信息),相比于现有技术,也可以降低亮度重建的难度,提升物体识别的精度。需要说明的,本申请有时也将光强信息称为亮度信息,二者表示相同的意思。
为了更好的展示自适应转换事件表示方式的优势,下面结合一个具体的例子进行说明。假设视觉传感器的预置的最大带宽为200bps,设置α和β均为1,假设初始的事件表示方式为通过光强信息表示事件,每一个事件由8比特进行表示,像素阵列电路在4秒内的数据量分别为:第1秒产生了30个事件,第2秒产生了60个事件,第3秒产生了40个事件,第4秒产生了20个事件,第5秒产生了15个事件。则如果一直通过光强信息表示事件,第1秒,由于产生的数据量240比特大于带宽200比特,所以可能只有25个事件可以正常传输,其他事件由于带宽受限会丢失。在第2秒,基于相同的原因,由于产生的数据量大于带宽,受限于带宽,仍然只有部分事件正常传输,部分事件会丢失。在第3秒,同样地,由于带宽的限制,仍然只有部分事件正常传输,部分事件会丢失。在第4秒,全部的数据量可以正常传输。在第5秒,全部的数据量可以正常传输。当采用本申请提供的自适应转换事件表示方式的方案时,由于第1秒需要传输的数据量超过了带宽,因此满足了转换条件,将转换为通过极性信息表示事件,假设通过极性信息表示事件时,每一个事件由2比特进行表示,由于极性信息表示一个事件所需的比特数目小于通过光强信息表示的一个事件,通过极性信息表示事件,可以降低事件的丢失概率。在第2秒时,通过极性信息表示事件,需要传输的总数据量小于带宽,但是通过光强信息表示事件,需要传输的数据量又超过了带宽,所以仍然通过极性信息表示事件,降低事件的丢失概率,在第3秒时,由于通过光强信息表示事件需要传输的数据量仍然超过了带宽,仍然通过极性信息表示事件, 降低事件的丢失概率,在第4秒时,由于通过极性信息表示事件,需要传输的总数据量小于带宽,并且通过光强信息表示事件需要传输的数据量小于带宽,满足了转换条件,则转换为通过光强信息表示事件,提升事件表示的精度,使事件可以携带更多的信息,在第5秒时,由于需要传输的数据量小于带宽,且当前采用的是通过光强信息表示事件,所以不满足切换条件,仍然采用光强信息表示事件,使事件可以携带更多的信息。
通过这一例子可以看出,采用单一的事件表示方式,比如仅采用光强信息表示事件,数据的丢失率为36.4%,而采用了本申请提供的自适应转换事件表示方式的方案时,可以在传输的数据量大于带宽时,转换为通过极性信息表示事件,大大的降低了事件的丢失概率,并且在带宽不受限的情况下,尽可能采用使事件携带更多的信息。
图19示出了根据本申请的可能的实施例的电子设备的框图。如图19所示,电子设备包括视觉传感器芯片1700、控制电路1701、以及解析电路1702。其中,控制电路1701可以参照控制电路906进行理解。应当理解的是,电子设备用于示例性目的,其可以利用任何合适的设备来实现,包括当前已知的和未来开发的各种传感器设备。本申请的实施例还可以被体现在不同的传感器系统中。另外,还应当理解,电子设备还可以包括其他元件、模块或实体,出于清楚的目的未被示出,但不意味着本申请的实施例不具备这些元件、模块或实体。
其中,视觉传感器芯片1700和控制电路1701可以参照图11至图18所描述的视觉传感器和控制电路进行理解,这里不再重复赘述。解析电路1702可以被配置为解析由视觉传感器芯片1700中的读取电路读取的数据信号。在本申请的可能的实施例中,解析电路1702可以采用与视觉传感器芯片1700中的读取电路的当前事件表示方式相适应的解析模式。作为示例,如果读取电路初始读取由极性信息表示的事件,则解析电路相应地基于与该表示方式相关联的比特位数来解析事件,比如预定极性信息采用1比特进行表示,则解析电路相应地基于1比特来解析事件。当读取电路读取由光强信息表示的事件,则解析电路相应的基于与该表示方式相关联的比特位数来解析事件,比如预定光强信息采用12比特进行表示,则解析电路相应地基于12比特来解析事件。
在一些实施例中,解析电路1702可以在无需显式切换信号或标记位的情况下实现解析电路的解析模式的切换。例如,解析电路1702可以采用与控制电路1701相同或相应的统计模型和转换策略,以对读取电路提供的数据信号做出与控制电路1701相同的统计分析并做出一致的转换预测。作为示例,以读取电路基于事件流的读取模式读取数据信号为例进行说明,上文已经介绍过,基于事件流的读取模式时,每个事件可以表示为<x,y,t,m>,(x,y)表示产生事件的像素位置,t表示产生事件的时间,m表示光强的特征信息,m包括极性信息和光强信息。假设x通过b x个比特表示,y通过b y个比特表示,t通过b t个比特表示,m表示极性信息时通过1个比特表示,m表示光强信息时通过12个比特表示。相应的,如何控制电路1701控制读取电路的初始状态时读取由极性信息表示的事件时,相应地,解析电路1702初始状态时,解析出的前b x个比特指示像素的坐标x,接下来b y个比特指示像素的坐标y,其后的b t个比特指示读取时间,最后取1个比特指示光强的特征信息,具体的该光强的特征信息是极性信息。解析电路1702从读取电路获取数据信号,并确定与光强变化 事件有关的统计数据。如果解析电路1702确定该统计数据满足转换条件,则转换至与由光强信息表示事件相对应的解析模式,比如,由极性信息表示事件转换为由光强信息表示事件时,解析电路1702解析出的前b x个比特指示像素的坐标x,接下来b y个比特指示像素的坐标y,其后的b t个比特指示读取时间,最后取12个比特指示光强的特征信息,具体的,该光强的特征信息是光强信息。
作为另一示例,如果读取电路905初始以读取由光强信息表示的数据信号,则解析电路1702以与该事件表示方式相对应的解析模式。比如解析出的前b x个比特指示像素的坐标x,接下来b y个比特指示像素的坐标y,其后的b t个比特指示读取时间,最后取12个比特指示光强信息。解析电路1702从读取电路获取数据信号,并确定与光强变化事件有关的统计数据。如果解析电路1702确定该统计数据满足转换条件,则转换至与由极性信息表示事件相对应的解析模式,比如,由极性信息表示事件转换为由光强信息表示事件时,解析电路1702解析出的前b x个比特指示像素的坐标x,接下来b y个比特指示像素的坐标y,其后的b t个比特指示读取时间,最后取1个比特指示极性信息。
作为另一示例,如果读取电路905初始以基于事件流的读取模式来读取像素阵列电路输出的数据信号,具体的读取由光强信息表示的数据信号,则解析电路1702以与该读取模式、该事件表示方式相对应的解析模式,比如采用与事件流的读取模式对应的模式解析从读取电路905获取的数据信号,并解析出的前b x个比特指示像素的坐标x,接下来b y个比特指示像素的坐标y,其后的b t个比特指示读取时间,最后取12个比特指示光强信息。解析电路1702从读取电路获取数据信号,并确定与光强变化事件有关的统计数据。如果解析电路1702确定该统计数据满足转换条件,则转换至与由极性信息表示事件相对应的解析模式,比如,由极性信息表示事件转换为由光强信息表示事件时,解析电路1702解析出的前b x个比特指示像素的坐标x,接下来b y个比特指示像素的坐标y,其后的b t个比特指示读取时间,最后取1个比特指示极性信息。
在一些可能的实施例中,解析电路704从读取电路905获取数据信号,并基于该数据信号来判断当前解析模式和备选的解析模式中的哪一种与读取电路905读取的事件的表示方式相对应。进而,在一些实施例中,解析电路704可以基于该判断来从当前解析模式切换到另一解析模式。
本申请实施例还提供一种用于操作视觉传感器芯片的方法。参阅图20,为根据本申请的可能的实施例的用于操作视觉传感器芯片的方法的流程图,可以包括以下步骤:
1801、通过测量光强变化量来生成与像素阵列电路中的像素对应的至少一个数据信号。
像素阵列电路通过测量光强变化量来生成与像素阵列电路中的像素对应的至少一个数据信号,至少一个数据信号指示光强变化事件,光强变化事件表示像素阵列电路中的对应像素测量到的光强变化量超过预定阈值。其中,像素阵列电路可以包括一个或多个像素阵列,并且每个像素阵列包括多个像素,每个像素可以视为一个像素电路,像素电路可以参照像素电路900进行理解。
1802、以第一事件表示方式从像素阵列电路读取至少一个数据信号。
读取电路以第一事件表示方式从像素阵列电路读取至少一个数据信号。读取电路可以 参照读取电路905进行理解。
在一些可能的实施例中,第一事件表示方式为通过极性信息表示事件,像素阵列电路包括多个像素,每个像素包括阈值比较单元,阈值比较单元,用于光强变换量超过预定阈值时,输出极性信息,极性信息用于指示光强变化量是增强或者减弱。读取电路,具体用于读取阈值比较单元输出的极性信息。
在一些可能的实施例中,第一事件表示方式为通过光强信息表示事件,像素阵列包括多个像素,每个像素包括阈值比较单元,读出控制单元和光强采集单元,
光强检测单元,用于输出照射在其上的光信号对应的电信号,电信号用于指示光强。
阈值比较单元,用于根据电信号确定光强变换量超过预定阈值时,输出第一信号。
读出控制单元,用于响应于接收到第一信号,指示光强采集单元采集并缓存对应第一信号接收时刻的电信号。
读取电路,具体用于读取光强采集单元缓存的电信号。
其中,光强检测单元可以参照光强检测单元901进行理解,阈值比较单元可以参照阈值比较单元902进行理解,读出控制单元可以参照读出控制单元903进行理解,光强采集单元可以参照光强采集单元904进行理解。
1803、向控制电路提供至少一个数据信号。
读取电路,还用于向控制电路提供至少一个数据信号。控制电路可以参照控制电路906进行理解。
1804、从控制电路接收到基于至少一个数据信号而生成的转换信号时,转换到以第二事件表示方式从像素阵列电路读取至少一个数据信号。
读取电路用于从控制电路接收到基于至少一个数据信号而生成的转换信号时,转换到以第二事件表示方式从像素阵列电路读取至少一个数据信号。
在一些可能的实施例中,控制电路,还用于基于从读取电路接收的至少一个数据信号,确定统计数据。如果确定统计数据满足预定转换条件,向读取电路发送转换信号,预定转换条件基于视觉传感器芯片的预置带宽确定。
在一些可能的实施例中,第一事件表示方式为通过极性信息表示事件,第二事件表示方式为通过光强信息表示事件时,预定转换条件为若通过第二事件表示方式从像素阵列电路读取至少一个数据信号,读取的总数据量不大于预置带宽,或者预定转换条件为至少一个数据信号的数目不大于预置带宽和第一比特的比值,第一比特是数据信号的数据格式的预置比特。
在一些可能的实施例中,第一事件表示方式为通过光强信息表示事件,第二事件表示方式为通过极性信息表示事件时,预定转换条件为通过第一事件表示方式从像素阵列电路读取的总数据量大于预置带宽,或者预定转换条件为至少一个数据信号的数目大于预置带宽和第一比特的比值,第一比特是数据信号的数据格式的预置比特。根据本申请的实施例所提出的自适应事件表示方式,视觉传感器可以对事件进行历史数据统计以预测下一时间段内可能的事件产生速率,因此能够选出更加适合应用场景和运动状态的事件表示方式。
通过上述方案,视觉传感器能够自适应地在两种事件表示方式之间切换,使得读取数 据速率始终保持未超过预定的读取数据速率阈值,从而降低了视觉传感器的数据传输、解析和存储的代价,显著提高了传感器的性能。另外,这样的视觉传感器可以对一段时间内产生的事件进行数据统计以用于预测下一时间段内可能的事件产生速率,因而能够选出更加适合当前外部环境、应用场景和运动状态的读取模式。
以上介绍了视觉传感器能够自适应地在两种事件表示方式之间切换,其中,该两种事件表示方式包括极性信息表示的事件以及光强信息表示的事件。采用本申请提供的自适应事件表示方式时,比较光强信息表示的事件的数据量与带宽之间的关系,从而调整事件的表示精度,在满足带宽限制的前提下,以合适的表示方式将事件都传输出来,尽可能以更大的表示精度传输所有事件。在一些实施方式中,视觉传感器可以自适应地在多种事件表示方式之间切换,以更好实现以更大的表示精度传输所有事件这一目的,下面结合一些具体的实施例对此进行说明。
图21示出了本申请提供的一种像素电路1900的示意图。像素阵列电路210、像素阵列电路310以及像素阵列电路710中的每一个像素阵列电路都可以包括一个或多个像素阵列,并且每个像素阵列包括多个像素,每个像素可以视为一个像素电路,每一个像素电路用于生成与该像素对应的数据信号。参阅图21,为本申请实施例提供的另一种优选的像素电路的示意图。本申请有时也将一个像素电路简称为一个像素。如图21所示,本申请中一种优选的像素电路包括光强检测单元1901,阈值比较单元1902,读出控制单元1903以及光强采集单元1904。
光强检测单元1901,用于将获取到的光信号转换为第一电信号。光强检测单元1901可以参照图11对应的实施例中的光强检测单元901进行理解,这里不再重复赘述。
阈值比较单元1902,用于判断第一电信号是否大于第一目标阈值,或者第一电信号是否小于第二目标阈值,第一电信号大于第一目标阈值,或者第一电信号小于第二目标阈值时,阈值比较单元1902输出第一数据信号,该第一数据信号用于指示该像素有光强变换事件。阈值比较单元1902,用于比较当前光强与上一次事件产生时的光强的差异是否超过预定阈值,可以参考公式1-1进行理解。第一目标阈值可以理解为第一预定阈值和第二电信号的和,第二目标阈值可以理解为第二预定阈值和第二电信号的和。第二电信号是上一次事件发生时光强检测单元901输出的电信号。本申请实施例中的阈值比较单元可以通过硬件的方式实现,也可以通过软件的方式实现,本申请实施例对此并不进行限定。
读出控制单元1903,获取到第一数据信号时,控制光强采集单元904采集第一电信号。读出控制单元1903还用于通知读取电路1905读取像素电路输出的数据信号。
读取电路1905可以被配置为按照预定顺序扫描像素阵列电路中的像素,以读取对应像素生成的数据信号。在一些可能的实施例中,读取电路905可以参照读取电路220,读取电路320,读取电路720进行理解,即读取电路905被配置为能够以多于一种信号读取模式来读取像素电路输出的数据信号。例如,读取电路1905可以以第一读取模式和第二读取模式中的其中一种读取模式进行读取,第一读取模式和第二读取模式分别对应于基于帧扫描的读取模式和基于事件流的读取模式中的其中一种模式。在一些可能的实施例中,读取电路1905也可以仅以一种信号读取模式来读取像素电路输出的数据信号,比如读取电路 1905被配置为仅以基于帧扫描的读取模式来读取像素电路输出的数据信号,或者读取电路1905被配置为仅以基于事件流的读取模式来读取像素电路输出的数据信号。
第一编码单元1907,用于根据当前获取到的位宽对光强采集单元1904缓存的第一电信号进行编码处理。读取电路1905,还用于读取第一编码单元1907编码后的数据信号。关于第一编码单元1907如何根据获取到的位宽对第一电信号进行编码处理,需要控制电路1906对其进行控制,将在下文进行详细介绍。
在一些实施方式中,读取电路1905可以被配置向控制电路1906提供所读取的至少一个数据信号。控制电路1906根据从读取电路1905获取的数据信号,可以控制第一编码单元1907采用某个比特位宽对事件进行编码。
读取电路1905可以向控制电路1906提供在一段时间内读取的数据信号,以供控制电路1906进行推理,并指示第一编码单元1902采用某个比特位宽对事件进行编码。在一些可能的实施例中,控制电路1906可以从读取电路1905获取至少一个数据信号,并至少基于该至少一个数据信号来判断第一编码单元1907当前采用的编码方式是否适合当前的应用场景和运动状态,进而调整第一编码单元1907的编码方式。在一些可能的实施方式中,第一编码单元1907也可以直接和控制电路1906进行交互,而不通过读取电路,比如第一编码单元将编码后的数据信号向控制电路1906发送,控制电路1906基于接收到的编码后的数据信号来判断第一编码单元1907当前采用的编码方式是否适合当前应用场景和运动状态,进而调整第一编码单元1907的编码方式。
在一些可能的实施例中,读取电路1905提供给控制电路1906的数据是单位时间内像素阵列电路测量到的事件(光强变换事件)数目N ev。假设当前采用的表示光强特征信息的位宽是H 1,即假设控制电路1906控制第一编码单元1907当前采用H 1个比特为每个事件的光强的特征信息进行编码(以下简称为为每个事件进行编码),假设预置通过i个比特编码光强特征信息的位宽,通过s个比特编码事件数目,则视觉传感器一共需要传输的比特数N=N ev×H 1+i+s。如果视觉传感器一共需要传输的比特数N大于或等于带宽K时,则控制电路1906确定要降低光强特征信息的位宽。控制电路计算光强特征信息的位宽是H 2时视觉传感器一共需要传输的比特数,具体的,当采用H 2个比特为每个事件进行编码时,视觉传感器一共需要传输的比特数N=N ev×H 2+i+s。如果此时视觉传感器一共需要传输的比特数N小于或等于带宽K时,则控制电路1906控制第一编码单元1907采用H 2个比特为每个事件进行编码,H 2小于H 1
在一些可能的实施例中,读取电路1905提供给控制电路1906的数据可以是单位时间内像素阵列电路测量到的事件(光强变换事件)数目的总数据量。比如,假设当前采用的光强特征信息的位宽是H 1,读取电路1905提供给控制电路1906的单位时间内像素阵列电路测量到的事件数目的总数据量为N ev×H 1
上文介绍到在视觉传感器的带宽一定的情况下,存在事件数据无法被读出的情况。目前通常采用随机丢弃的方式处理。若采用随机丢弃,虽然能够保证传输数据量不超过带宽,但造成了数据丢失,在某些特殊应用场景下(例如自动驾驶等),随机丢弃的数据可能具有较高的重要性。图11至图20所描述的方案,比较光强信息表示的事件的数据量与带宽之 间的关系,从而调整事件的表示精度,通过自适应地在两种事件表示方式之间切换的方式解决这一问题,在满足带宽限制的前提下,以合适的表示方式将事件都传输出来,尽可能以更大的表示精度传输所有事件。图11至图20所描述的方案以及目前已有的方案中,光强特征信息的位宽都是固定不变的,考虑到现有技术存在的问题,本申请还提供一种方案,动态调整光强特征信息的位宽,相比于图11至图20只有两种事件表示方式来说,动态调整光强特征信息的位宽这一方案可以在满足带宽限制的前提下,能够以更大的表示精度传输所有事件。动态调整光强特征信息的位宽这一方案,当视觉传感器在一段时间内(比如单位时间内)需要传输的数据量超过带宽时,则降低光强特征信息的位宽,即降低事件表示的精度,直到满足带宽限制,则采用满足带宽限制的光强特征信息的位宽对事件进行编码(具体的是对事件的光强的特征信息进行编码)。其中,可以采用多种方式确定满足带宽限制的光强特征信息的位宽(以下也称为位宽,或者表示光强特征信息的位宽),下面结合几个优选的实施方式进行说明。
在一些可能的实施例中,可以采用位宽递减的方式确定最优的表示光强特征信息的位宽。如图22所示,在初始状态下,第一编码单元1907可以首先按照最大位宽B对一个事件进行编码,控制电路1906根据读取电路1905提供的单位时间内的数据,计算事件产生的速率是否超过带宽限制,如果超过带宽,则逐步降低量化精度,即逐步降低光强特征信息的位宽,例如调整表示光强特征信息的位宽为(B-1),确定位宽为(B-1)时,事件产生的速率是否超过带宽,位宽为(B-2)时事件产生的速率是否超过带宽,位宽为(B-n)时事件产生的速率是否超过带宽,n为正整数。控制电路1906将调整后的预估事件发生的速率与带宽进行比较;如果满足带宽限制(即不大于带宽),则控制第一编码单元1907采用当前这一级的比特位宽对事件进行编码,比如确定表示光强特征信息的位宽为(B-1)时,事件产生的速率不超过带宽限制,即采用(B-1)对事件进行编码。为了更好的理解这一实施例,下面举例说明。假设最大位宽B为12比特,即预先规定最高只能采用12比特对一个事件进行编码,假设带宽限制为3000bps(每一秒最大允许传输3000比特),即预置的最大带宽为3000bps,假设在实际场景中,第1秒产生了100个事件,第2秒产生了300个事件,第3秒产生了400个事件,第4秒产生了180个事件。
若采用现有技术的随机丢弃方案,则会出现以下情况:
第1秒:传输100个事件,丢失0个事件,事件丢失率为0,视觉传感器一共传输1200比特。
第2秒:传输250个事件,丢失50个事件,事件丢失率为16.7%,视觉传感器一共传输3000比特。
第3秒:传输250个事件,丢失150个事件,事件丢失率为37.5%,视觉传感器一共传输3000比特。
第4秒:传输180个事件,丢失0个事件,事件丢失率为0,视觉传感器一共传输2160比特。
上述方案丢失200个事件,共传输9360比特,丢失率为20.4%。
若采用本申请提供的方案,动态调整表示光强特征信息的位宽,比如采用位宽递减的 方式确定最优的表示光强特征信息的位宽的方式,可以有效的降低事件的丢失率,结合上述例子继续说明。上文介绍到参数s代表通过s个比特编码事件数目,参数i表示通过i个比特编码表示光强特征信息的位宽,由于最大位宽B为12比特,因此位宽大小只需
Figure PCTCN2020141973-appb-000020
比特即可表示,这里
Figure PCTCN2020141973-appb-000021
表示向上取整,即i最大可以是4,此外,这里假设s为32,即通过32个比特编码事件数目。
则采用本申请提供的动态调整表示光强特征信息的方案,可以降低事件丢失率:
第1秒:由于产生了100个事件,首先按最大位宽B进行计算,即事件产生的速率100×12<3000比特,不超过带宽限制,因此传输事件数100(32比特)和位宽大小12(4比特),随后传输100个事件,每个事件按12比特编码,一共需传输32+4+100×12=1236比特。
第2秒:首先按最大位宽12比特计算事件产生的速率300×12>3000,超过了带宽限制,如果继续按照最大位宽对一个事件进行编码,将会产生事件丢失;则递减位宽,采用11比特计算机计算事件产生的速率300×11>3000,仍然超过了带宽限制;则继续递减位宽,采用10比特计算事件产生的速率300×10=3000,考虑到还有事件数32比特和位宽大小4比特需要传输,总体上仍超过带宽;则继续递减位宽,采用9比特计算事件产生的速率300×9=2700,考虑到事件数32比特和位宽4比特,仍然不超过带宽限制。因此,确定9比特为最优位宽,则控制电路控制第一编码单元采用9比特对一个事件进行编码,此外,还需要传输事件数300(32比特)和位宽大小9(4比特),随后传输300个事件,每个事件按9比特编码,一共需传输32+4+300×9=2736比特。
第3秒:首先按最大位宽12比特计算事件产生的速率400×12>3000,超过了带宽限制;则递减位宽,采用11比特计算事件产生的速率400×11>3000,仍然超过了带宽限制;则采用10比特计算事件产生的速度400×10>3000,仍然超过了带宽限制,则按9比特计算事件产生的速率400×9>3000,仍然超过了带宽限制,则按8比特计算事件产生的速率400×8>3000,仍然超过了带宽限制,则按7比特计算事件产生的速率400×7=2800。因此,确定7比特为最优位宽,则控制电路控制第一编码单元采用7比特对一个事件进行编码,此外,还需要传输事件数300(32比特)和位宽大小9(4比特),随后传输300个事件,每个事件按7比特编码,一共需传输32+4+400×7=2836比特,即事件产生的速度为2836bps。
第4秒:首先按最大位宽12比特计算事件产生的速率180×12=2160,未超过带宽限制,则控制电路控制第一编码单元采用12比特对一个事件进行编码。一共需传输32+4+180×12=2196比特。
通过本申请提供的动态调整表示光强特征信息的位宽的方案,在上述例子中丢失了0个事件,总共只传输9004比特,还节省了3.8%数据量,同时还保证了每个事件能以不同精度传输出来。如果与原始数据相比,即不考虑事件丢失,每个事件按12比特编码的方案,本方案能够节省23.4%的数据量。
在上述例子中,控制电路在每一秒都是以最大位宽计算事件产生的速率,当不满足带宽限制时,递减最大位宽,以满足带宽限制,通过这样的方式,可以始终保证在不丢失事件的前提条件下,采用最大的表示精度传输所有事件。在一些可能的实施例中,每一秒可 以当前位宽计算事件产生的速度,当不满足带宽限制时,递减当前位宽,以满足带宽限制,当满足带宽限制时,可以在满足带宽限制的条件下,递增带宽,以实现采用最大的表示精度传输所有事件,下面结合上述例子继续说明。
第1秒:由于产生了100个事件,首先按最大位宽B进行计算,即事件产生的速率100×12<3000比特,不超过带宽限制,因此传输事件数100(32比特)和位宽大小12(4比特),随后传输100个事件,每个事件按12比特编码,一共需传输32+4+100×12=1236比特。
第2秒:首先按当前位宽计算事件产生的速率,即按照位宽12比特计算事件产生的速率300×12>3000,超过了带宽限制,如果继续按照12比特对一个事件进行编码,将会产生事件丢失;则递减位宽,采用11比特计算机计算事件产生的速率300×11>3000,仍然超过了带宽限制;则继续递减位宽,采用10比特计算事件产生的速率300×10=3000,考虑到还有事件数32比特和位宽大小4比特需要传输,总体上仍超过带宽;则继续递减位宽,采用9比特计算事件产生的速率300×9=2700,考虑到事件数32比特和位宽4比特,仍然不超过带宽限制。因此,确定9比特为最优位宽,则控制电路控制第一编码单元采用9比特对一个事件进行编码,此外,还需要传输事件数300(32比特)和位宽大小9(4比特),随后传输300个事件,每个事件按9比特编码,一共需传输32+4+300×9=2736比特。
第3秒:首先按当前位宽计算事件产生的速率,即按照9比特计算事件产生的速率400×9>3000,超过了带宽限制,则按8比特计算事件产生的速率400×8>3000,仍然超过了带宽限制,则按7比特计算事件产生的速率400×7=2800。因此,确定7比特为最优位宽,则控制电路控制第一编码单元采用7比特对一个事件进行编码,此外,还需要传输事件数300(32比特)和位宽大小9(4比特),随后传输300个事件,每个事件按7比特编码,一共需传输32+4+400×7=2836比特,即事件产生的速度为2836bps。
第4秒:首先按照当前位宽计算事件产生的速率,即按照7比特计算事件产生的速率180×7<3000,且考虑到事件数32比特和位宽大小4比特需要传输,总体上仍然不超过带宽限制,则递增位宽,则采用8比特计算事件产生的速率180×8<3000,总体上仍然不超宽带宽限制,则继续递增位宽,采用9比特计算事件产生的速率180×9<3000,总体上仍然不超宽带宽限制,则继续递增位宽,采用10比特计算事件产生的速率180×10<3000,总体上仍然不超宽带宽限制,则继续递增位宽,采用11比特计算事件产生的速率180×11<3000,总体上仍然不超宽带宽限制,则继续递增位宽,采用12比特计算事件产生的速率180×12=2160,未超过带宽限制,由于12比特已经是最大位宽,所以确定12比特为最优的位宽,则控制电路控制第一编码单元采用12比特对一个事件进行编码,一共需传输32+4+180×12=2196比特。
除了上述提到的采用位宽递减的方式动态调整表示光强特征信息的位宽,确定满足带宽限制的表示光强特征信息的位宽,还可以通过其他的方式确定满足带宽限制的表示光强特征信息的位宽,下面结合几个优选的实施方式继续说明。
在一些可能的实施例中,还可按照二分搜索法确定满足带宽限制的表示光强特征信息的位宽,例如以第3秒产生了400个事件为例进行说明,首先按照12比特对一个事件进行 编码,控制电路确定事件产生的速率400×12>3000;然后按照12比特的一半即6比特计算事件产生的速率400×6<3000,超过了带宽的限制;则计算12比特和6比特的中点,即9比特时事件产生的速率400×9>3000,仍然超过了带宽的限制;则计算9比特和6比特的中点,即8比特时事件产生的速率400×8>3000,仍然超过了带宽的限制;计算8比特和6比特的中点,即7比特时事件产生的速率400×7<3000,小于带宽的限制;由于8比特时事件产生的速率超过带宽限制,6比特和7比特时的事件产生的速率都不超过带宽限制,因此采用更高量化精度的7比特对事件进行编码。上述过程只需经过5次比较,算法复杂度为O(logB)。
在一些可能的实施例中,还可以采用近似值估算的方法确定满足带宽限制的表示光强特征信息的位宽,例如,第3秒时总共产生了400个事件,那么根据带宽限制3000bps,可以大致计算出每个事件的比特位宽不能超过
Figure PCTCN2020141973-appb-000022
比特,这里
Figure PCTCN2020141973-appb-000023
表示向下取整。则控制电路控制第一编码单元采用7比特对一个事件进行编码。
通过动态调整表示光强特征信息的位宽的方案,当事件产生速率较小时,尚未达到带宽限制,则按照最大位宽量化事件,对事件进行编码,当事件产生速率较大时,则逐渐降低表示光强特征信息的位宽,以满足带宽限制,此后,若事件产生的速率又变小时,则可以在不超过带宽限制的前提下,递增表示光强特征信息的位宽。
在一些实施例中,还可以对像素阵列进行区域划分,采用不同的权重设定不同区域的最大位宽,以适应场景中不同的感兴趣区域,比如在可能包括目标对象的区域设置更大的权重,使包括目标对象的区域对应输出的事件的表示精度更高,在背景区域设置更小的权重,使背景区域对应输出的事件的表示精度更低,下面结合具体的实施例进行说明。
参阅图23,为本申请提供的另一种视觉传感器的框图。该视觉传感器中,对像素阵列电路进行区域划分,不同的区域采用不同的编码方式,即不同的区域输出的事件的表示精度不同。如图23所示,以两个像素电路为例进行说明。假设像素电路1900是视觉传感器的像素阵列电路第一区域中的一个像素电路,像素电路2100是像素阵列电路第二区域中的一个像素电路。第一区域和第二区域是像素阵列电路中的两个不同区域,并且第一区域和第二区域输出的时间的表示精度不同。
读取电路2105可以分别用于读取像素电路1900产生的数据信号以及像素电路2100产生的数据信号,并将第一编码单元1907输出的编码后的数据信号传输给控制电路2106,将第二编码单元2107输出的编码后的数据信号传输给控制电路2106。控制电路2106可以根据读取电路传输的数据分别控制第一编码单元1907采用多大的比特对事件进行编码,控制第二编码单元2107采用多大的比特对事件进行编码,即控制电路2106可以分别控制像素电路1900以及像素电路2100输出事件的表示精度。
光强检测单元2101,阈值比较单元2102,读取控制单元2103,光强采集单元2104以及第二编码单元2107可以分别参照光强检测单元1901,阈值比较单元1902,读取控制单元1903,光强采集单元1904以及第一编码单元1907进行理解,这里不再重复赘述。
下面结合一个具体的例子,对控制电路控制像素阵列电路不同的区域采用不同的编码方式进行说明。参阅图24,为对像素阵列进行区域划分的示意图。参阅图24,将像素阵列 电路划分为6个区域,分别是A区域,B区域,C区域,D区域,E区域以及F区域。针对不同的区域可以设定不同的权重,比如可能包括目标对象的区域设置更大的权重,在背景区域设置更小的权重,示例性的,图24中,将D区域,E区域以及F区域设置更大的权重,A区域,B区域,C区域设置更小的权重,具体的,A区域的权重为0.05,B区域的权重为0.1,C区域的权重为0.05,D区域的权重为0.2,E区域的权重为0.4,F区域的权重为0.2。比如最大位宽为12比特,则将权重最大的E区域设定最大位宽12比特,按照各个区域的权重,对应的,A区域设定的最大位宽为2比特,B区域设定的最大位宽为3比特,C区域设定的最大位宽为2比特,D区域设定的最大位宽为6比特,F区域设定的最大位宽为6比特。需要说明的是,图24中将像素阵列划分为6个区域,以及每个区域设置的权重是为了举例说明,并不代表对方案的限定,实际上可以根据需求划分不同数目的区域,并针对不同的区域设定不同的最大位宽。控制电路确定每一个区域对应的最优位宽的方式与上述控制电路确定像素电路1900对应的最优位宽的方式相同,可以采用位宽递减的方式,二分搜索法以及近似值估算方法等等。示例性的,下面以位宽递减的方式,进行进一步的解释说明。
假设带宽限制为3000bps,由于将像素阵列进行了区域划分,针对每一个区域分配的带宽也有所不同,以上述例子继续说明,A区域的权重为0.05,则A区域分配带宽为3000×0.05=150bps,B区域的权重为0.1,则B区域分配带宽为3000×0.1=300bps,C区域的权重为0.05,C区域分配带宽3000×0.05=150bps,D区域的权重为0.2,则D区域分配带宽为3000×0.2=600bps,E区域的权重为0.4,则E区域分配带宽为3000×0.4=1200bps,F区域的权重为0.2,则F区域分配带宽为3000×0.2=600bps。假设1秒内,A区域产生50个事件,B区域产生80个事件,C区域产生60个事件,D区域产生90个事件,E区域产生100个事件,F区域产生80个事件,则:
A区域:对于A区域,控制电路首先根据A区域的最大位宽2比特确定事件产生的速率50×2<150,并且考虑到事件数32比特和位宽大小4比特需要传输,仍然不超过带宽限制,所以控制电路控制A区域对应的编码单元采用2比特对一个事件进行编码,比如像素电路1900是A区域中的一个像素电路,则控制电路2106控制第一编码单元1907采用2比特对一个事件进行编码,A区域一共需要传输32+4+50×2=136比特。
B区域:对于B区域,控制电路首先根据B区域的最大位宽3比特确定事件产生的速率80×3<300,并且考虑到事件数32比特和位宽大小4比特需要传输,仍然不超过带宽限制,所以控制电路控制B区域对应的编码单元采用3比特对一个事件进行编码,比如像素电路2100是B区域中的一个像素电路,则控制电路2106控制第二编码单元2107采用3比特对一个事件进行编码,B区域一共需要传输32+4+80×3=276比特。
C区域:对于C区域,控制电路首先根据C区域的最大位宽2比特确定事件产生的速率60×1<150,并且考虑到事件数32比特和位宽大小4比特需要传输,仍然不超过带宽限制,所以控制电路控制C区域对应的编码单元采用1比特对一个事件进行编码。C区域一共需要传输32+4+60×1=96比特。
D区域:带宽为3000×0.2=600bps,按6比特编码,D区域一共需要传输32+4+90×6=576 比特。
E区域:带宽为3000×0.4=1200bps,按12比特编码将超过带宽限制,则按11比特编码,E区域一共需要传输32+4+100×11=1136比特。
F区域:带宽为3000×0.2=600bps,按6比特编码,F区域一共需要传输32+4+80×6=516比特。
综上,1秒内传输的总比特数为2736比特,如果与原始数据相比,即不考虑事件丢失,每个事件按12比特编码的方案,本方案能够节省50.4%的数据量。
图25示出了本申请的可能的实施例的控制电路的框图。控制电路可以用于实现图21、图23中的控制电路1906等,如图25所示,控制电路包括至少一个处理器2301、耦合到处理器2301的至少一个存储器2302以及耦合到处理器2301的通信机制2303。存储器2302至少用于存储计算机程序以及从读取电路获取的数据信号。控制电路可以通过通信机制2303被通信耦合到如图21、图23中的的视觉传感器的读取电路2105或者视觉传感器外部的读取电路,第一编码单元1907,第二编码单元2109以对他们实现控制功能。当处理器读取存储器2302中存储的计算机程序后,执行上述图21至图24中描述的控制电路执行的动作。
需要说明的是,图25所示的控制电路还可以包括预配置的统计模型231以及策略模块232。对由读取电路2105提供的像素阵列电路在一段时间内(比如单位时间内)产生光强变化事件进行历史统计。统计模型231然后可以向策略模块232传输统计数据。统计数据可以指示光强变化事件的数目,也可以指示光强变化事件的总数据量。
在一些实施例中,处理器中可以包括多个统计模型,和与该多个统计模型对应的策略模块。比如图25所示的控制电路可以和图8所示的控制电路结合起来。比如,在一些实施例中,控制电路的处理器包括统计模型606,策略模块608,统计模型231以及策略模块232。
图26示出了根据本申请的可能的实施例的电子设备的框图。如图26所示,电子设备包括视觉传感器芯片2400、控制电路2401、以及解析电路2402。应当理解的是,电子设备用于示例性目的,其可以利用任何合适的设备来实现,包括当前已知的和未来开发的各种传感器设备。本申请的实施例还可以被体现在不同的传感器系统中。另外,还应当理解,电子设备还可以包括其他元件、模块或实体,出于清楚的目的未被示出,但不意味着本申请的实施例不具备这些元件、模块或实体。
其中,视觉传感器芯片2400和控制电路2401可以参照图21至图25所描述的视觉传感器和控制电路进行理解,这里不再重复赘述。解析电路2402可以被配置为解析由视觉传感器芯片2400中的读取电路读取的数据信号。在本申请的可能的实施例中,解析电路2402可以采用与视觉传感器芯片2400当前采用的数据格式位宽相适应的位宽解析视觉传感器传输的数据信号。为了更好的理解解析电路如何解析视觉传感器芯片传输的数据信号,下面结合两个具体的例子进行说明。
上文提到了一个例子:假设最大位宽B为12比特,带宽限制为3000bps(每一秒最大允许传输3000比特),通过32个比特编码事件数目,通过4个比特编码表示光强特征信 息的位宽,视觉传感器在第1秒产生了100个事件,第2秒产生了300个事件,第3秒产生了400个事件,第4秒产生了180个事件。则采用本申请提供的方案,第1秒采用12比特编码一个事件,第2秒采用9比特编码一个事件,第3秒采用7比特编码一个事件,第4秒采用12比特编码一个事件。下面结合这个例子继续说明解析电路如何解析视觉传感器芯片传输的数据信号。
视觉传感器芯片输出的数据可以是二进制数据流,该二进制数据流可以包括三部分,分别用于表示事件数目,位宽,以及编码后的每个事件。如图27所示,为一种二进制数据流的示意图,视觉传感器芯片输出的二进制数据流的前s比特用于表示事件数目,比如在上个例子中,s为32,则解析电路可以读取二进制数据流的前32个比特,以解析出事件数目,通过解析第1秒对应的二进制数据流的前32个比特,可以解析出第1秒的事件数目为100,再解析i个比特以获取表示光强特征信息的位宽,在上个例子中s为4,通过解析第1秒对应的二进制数据流的相应位置的4个比特,可以解析出第1秒的表示光强特征信息的位宽为12比特,即第1秒通过12比特表示1个事件,随后根据第1秒对应的二进制数据流,按照12比特依次解析出100个事件。
与第1秒的解析过程相同,通过解析第2秒对应的二进制数据流的前32个比特,可以解析出第2秒的事件数目为300,再读取4个比特解析出位宽为9个比特,随后按照9个比特依次解析出300个事件。通过解析第3秒对应的二进制数据流的前32个比特,可以解析出第3秒的事件数目为400,再读取4个比特解析出位宽为7个比特,随后按照7个比特依次解析出400个事件。解析第4秒对应的二进制数据流的前32个比特,可以解析出第4秒的事件数目为180,再读取4个比特解析出位宽为12个比特,随后按照12个比特依次解析出180个事件。
在一些可能的实施例中,如果是基于事件流的读取模式时,由于每个事件表示为<x,y,t,m>,(x,y)表示产生事件的像素位置,t表示产生事件的时间,m表示光强的特征信息。假设x通过b x个比特表示,y通过b y个比特表示,t通过b t个比特表示,m为表示光强特征信息的位宽。相应地,解析电路初始状态时,可以解析出的前b x个比特指示像素的坐标x,接下来b y个比特指示像素的坐标y,其后的b t个比特指示读取时间,最后解析s个比特表示事件数目,i个比特表示表示光强特征信息的位宽,随后按照i个比特指示的位宽解析出事件,具体的解析出事件的光强的特征信息。
在一些可能的实施例中,如果像素阵列电路不同的区域采用不同的编码方式,则针对每一个区域,分别采用与该区域对应的表示光强特征信息的位宽解析数据信号。上文图24提到了一个例子,下面结合该例子继续说明。针对区域A,解析电路读取32比特解析出事件数为50,再读取4比特解析出位宽大小为2,随后按照每个事件2比特依次解析出50个事件。对于区域B,读取32比特解析出事件数为80,再读取4比特解析出位宽大小为3,随后按每个事件3比特依次解析出80个事件。对于区域C,读取32比特解析出事件数为60,再读取4比特解析出位宽大小为1,随后按每个事件1比特依次解析出60个事件。对于区域D,读取读32比特解析出事件数为90,再读取4比特解析出位宽大小为6,随后按每个事件6比特依次解析出90个事件。对于区域E,读取读32比特解析出事件数为100, 再读取4比特解析出位宽大小为11,随后按每个事件11比特依次解析出100个事件。
在一个可能的实施方式中,解析电路2400可以采用与视觉传感器芯片2400中相同的控制策略来确定读取电路的当前事件表示方式相适应的解析模式。作为示例,如果视觉传感器芯片2400初始状态下由R个比特表示一个事件,则解析电路相应地基于与该表示方式相关联的比特位数(比如初始状态下时R个)来解析事件,如果视觉传感器根据需要传输的数据量与视觉传感器的预置最大带宽调整了事件表示方式,则解析电路2400采用与视觉传感器相同的调整策略确定通过相关联的比特位数来解析事件。
本申请实施例还提供一种用于操作视觉传感器芯片的方法。参阅图28,为根据本申请的可能的实施例的用于操作视觉传感器芯片的方法的流程图,可以包括以下步骤:
2601、通过测量光强变化量来生成与像素阵列电路中的像素对应的至少一个数据信号。
像素阵列电路通过测量光强变化量来生成与像素阵列电路中的像素对应的至少一个数据信号,该至少一个数据信号指示光强变化事件,光强变化事件表示像素阵列电路中的对应像素测量到的光强变化量超过预定阈值。
步骤2601可以参照图20对应的实施例中的步骤1801进行理解,这里不再重复赘述。
2602、根据第一比特对至少一个数据信号进行编码,以得到第一编码数据。
第一编码单元根据第一比特对至少一个数据信号进行编码,以得到第一编码数据。第一编码单元可以参照图21中的第一编码单元1907执行的步骤进行理解。
2603、从控制电路接收到第一控制信号时,根据第一控制信号指示的第二比特对至少一个数据信号进行编码,第一控制信号是控制电路根据第一编码数据确定的。
第一编码单元从控制电路接收到第一控制信号时,根据第一控制信号指示的第二比特对至少一个数据信号进行编码,第一控制信号是控制电路根据第一编码数据确定的。
第一编码单元可以参照图21中的第一编码单元1907执行的步骤进行理解。
在一些可能的实施例中,控制信号是控制电路根据第一编码数据以及视觉传感器芯片预置的带宽确定的。
在一些可能的实施例中,第一编码数据的数据量不小于带宽时,控制信号指示的第二比特小于第一比特,以使通过第二比特编码的至少一个数据信号的总数据量不大于带宽。
在一些可能的实施例中,第一编码数据的数据量不大于带宽时,控制信号指示的第二比特大于第一比特,且通过第二比特编码的至少一个数据信号的总数据量不大于带宽。
在一些可能的实施例中,所述像素阵列包括Y个区域,所述Y个区域中的至少两个区域的最大比特不同,所述最大比特表示预设的对一个所述区域生成的所述至少一个数据信号进行编码的最大比特,所述第一编码单元,具体用于根据所述第一比特对所述第一区域生成的所述至少一个数据信号进行编码,以得到第一编码数据,所述第一比特不大于所述第一区域的最大比特,所述第一区域是所述Y个区域中的任意一个区域;所述第一编码单元,具体用于从所述控制电路接收到所述第一控制信号时,根据所述第一控制信号指示的第二比特对所述第一区域生成的所述至少一个数据信号进行编码,所述第一控制信号是所述控制电路根据所述第一编码数据确定的。
在一些可能的实施例中,控制电路,还用于:确定通过第三比特编码的至少一个数据 信号的总数据量大于比特,且通过第二比特编码的至少一个数据信号的总数据量不大于带宽时,向第一编码单元发送第一控制信号,第三比特和第二比特之间相差1个比特单位。以保证在满足带宽限制的前提下,以更大的比特编码事件,并尽可能传输所有事件。
为了能够在满足带宽限制的前提下,将视觉传感器产生的事件都传输出来,上文介绍的方案通过调整事件表示的精度,在满足带宽限制的条件下,以更大的表示精度传输所有事件。但是,降低事件表示的精度,即降低表示事件的位宽使得事件可以携带的信息变少了,在一些场景中不利于对事件的处理和分析。所以降低事件表示精度的方式可能不适用所有场景,即在某些场景中,需要采用高比特的位宽表示事件,但是前文也提到了高比特位宽表示的事件,虽然可以携带更多的数据,但是数据量也较大,在视觉传感器预置最大带宽一定的情况下,可能存在事件数据无法被读出的情况,造成数据的丢失。为了解决这一问题,本申请实施例还提供一种视觉传感器,下面对此进行具体的说明。
参阅图29-a为本申请提供的另一种视觉传感器的框图。本申请中的视觉传感器可以被实现为视觉传感器芯片,本文对此不再重复说明。如图29-a所示,视觉传感器包括像素阵列电路2701和读取电路2702。读取电路2702可以读取像素阵列电路2701输出的数据信号,并将该数据信号传输至第三编码单元2703,以供第三编码单元2703对获取到的数据信号进行编码,关于第三编码单元2703如何对获取到的数据信号进行编码将在下文进行介绍。第三编码2703编码后的数据信号可以被读取到视觉传感器的外部。
在一些可能的实施例中,第三编码单元2703可以布置到视觉传感器的内部,参阅图29-b,为本申请实施例提供的另一种视觉传感器的框图,如图29-b所示,视觉传感器2800还包括第三编码单元2703,其中第三编码单元2703可以通过软件实现,也可以通过硬件实现,本申请实施例对此并不进行限定。
在一些可能的实施例中,视觉传感器还可以包括控制电路,参阅图29-c,为本申请实施例提供的另一种视觉传感器的框图,如图29-c所示,视觉传感器2900还包括控制电路2704,控制电路2704可以被配置为控制读取电路2704读取数据信号的模式。例如,读取电路905可以以第一读取模式和第二读取模式中的其中一种读取模式进行读取,第一读取模式和第二读取模式分别对应于基于帧扫描的读取模式和基于事件流的读取模式中的其中一种模式。需要说明的是,控制电路2704也可以不配置在视觉传感器的内部,此外,在一些可能的实施例中,读取电路2704也可以仅以一种信号读取模式来读取像素电路输出的数据信号,比如读取电路2704被配置为仅以基于帧扫描的读取模式来读取像素电路输出的数据信号,或者读取电路2704被配置为仅以基于事件流的读取模式来读取像素电路输出的数据信号。
上文已经提到每一个像素阵列电路都可以包括一个或多个像素阵列,并且每个像素阵列包括多个像素,每个像素可以视为一个像素电路,每一个像素电路用于生成与该像素对应的数据信号。请参阅图30,为本申请实施例提供的另一种优选的像素电路的示意图。该像素电路3000包括光强检测单元3001,阈值比较单元3002,读出控制单元3003,以及光强采集单元3004。
其中,光强采集单元3001用于将获取到的光信号转换为电信号。光强检测单元3001 可以参照图11对应的实施例中的光强检测单元901进行理解,这里不再重复赘述。
阈值比较单元3002用于判断第一电信号是否大于第一目标阈值,或者第一电信号是否小于第二目标阈值。第一电信号是光强采集单元当前输出的电信号,第一电信号大于第一目标阈值,或者第一电信号小于第二目标阈值时,阈值比较单元3002输出极性信息,该极性信息用于指示光强变换是增强或者减弱,比如极性信息可以是+1或-1,+1用于指示光强增强,-1用于指示光强减弱。阈值比较单元3002用于比较当前光强与上一次事件产生时的光强的差异是否超过预定阈值,可以参考公式1-1进行理解。第一目标阈值可以理解为第一预定阈值和第二电信号的和,第二目标阈值可以理解为第二预定阈值和第二电信号的和。第二电信号是上一次事件发生时光强检测单元3001输出的电信号。本申请实施例中的阈值比较单元可以通过硬件的方式实现,也可以通过软件的方式实现。
读出控制单元3003获取到极性信息时,控制光强采集单元3004采集第一电信号。
读出控制单元3003还用于通知读取电路读取光强采集单元3004中存储的第一电信号。以及通知读取电路3005读取阈值比较单元3002输出的极性信息。
读取电路3005可以被配置为按照预定顺序扫描像素阵列电路中的像素,以读取对应像素生成的数据信号。在一些可能的实施例中,读取电路3005可以参照读取电路220,读取电路320,读取电路720进行理解,即读取电路905被配置为能够以多于一种信号读取模式来读取像素电路输出的数据信号。例如,读取电路3005可以以第一读取模式和第二读取模式中的其中一种读取模式进行读取,第一读取模式和第二读取模式分别对应于基于帧扫描的读取模式和基于事件流的读取模式中的其中一种模式。在一些可能的实施例中,读取电路905也可以仅以一种信号读取模式来读取像素电路输出的数据信号,比如读取电路3005被配置为仅以基于帧扫描的读取模式来读取像素电路输出的数据信号,或者读取电路3005被配置为仅以基于事件流的读取模式来读取像素电路输出的数据信号。
第三编码单元3007根据从读取电路3005获取的数据信号,编码极性信息以及光强变化量与预定阈值的差分值。上文介绍了仿生视觉传感器的工作原理,以DVS为例,通过比较当前光强与上一次事件发生时的光强,当其变化量达到预定发放阈值C时,产生并输出一个事件。即通常在当前光强与上一次事件产生时的光强的差异超过预定阈值C时,DVS将产生一个事件。本申请充分考虑仿生视觉传感器的工作原理,利用预定阈值,降低事件表示的代价。下面对其原理进行说明,对于光强信息,在初始状态(即首次事件读出时)编码其绝对光强L,此后,若有新的事件产生,仅需编码光强变化量与预定阈值之间的差分值K以及极性信息。其原理在于,一个新事件产生条件是当前时刻光强相比上一次事件的光强变化量达到预定阈值,考虑可能存在的延迟和噪声影响,光强变化量与预定阈值并不完全相等,但其差分值应在0附近波动;因此,编码和传递该差分值将显著降低数据表示代价。同时,为了解码的准确性,还需传递极性信息以辅助判定当前光强相比上一次事件的变化趋势(即正负性),从而重建出当前时刻的光强。
示例性的,参阅图31,为本申请提供的一种第三编码单元的框图示意图。第三编码单元2703可以包括存储模块271,比较模块272以及编码模块273。存储模块271可以用于存储从读取电路2702获取的数据信号,该数据信号可以包括读取电路2702从阈值比较单 元3002中获取的极性信息,以及从光强采集单元3004中获取的光强信息。比较模块272用于比较光强变化量,即比较当前获取的光强信息与上一次获取的光强信息之间的差值,以下将当前获取的光强信息与上一次获取的光强信息之间的差值称为光强变换量。比较模块272还用于确定光强变换量与预定阈值的差值,其中根据极性信息指示的光强是增强还是减弱,预定阈值的取值可能不同。以下将光强变换量与预定阈值的差值称为差分值,可以通过控制表示为差分值K=|L-L′|-C。编码模块273对存储模块存储的极性信息进行编码,比如通常可以采用1-2bit对极性信息进行编码,编码模块273还用于对比较模块输出的差分值进行编码,以下将这种方式称编码方式为差分编码。在一个优选的实施方式中,对差分值进行编码的比特数可以根据预定阈值确定,比如预定阈值为30,则理论上差分值应不大于预定阈值30,因此差分值所需的最大比特数为
Figure PCTCN2020141973-appb-000024
比特。在一个可能的实施方式中,差分值可能仍然大于预定阈值,则可以对剩余差分值(差分值和预定阈值的差值)继续编码,直至剩余差分值不大于预定阈值。比如如果第一次计算的差分值(以下称为第一差分值)大于预定阈值,则可以将第一差分值编码为第二差分值和预定阈值,第二差分值是第一差分值和预定阈值之间的差值,则绝对光强信息通过第二差分值和两个预定阈值进行表示,即对第二差分值进行编码,对预定阈值进行两次编码,以获取编码后的绝对光强信息。为了更好的理解本申请实施例中的对差分值进行编码的过程,下面参阅图32,结合一个具体的例子进行说明:
假设绝对光强信息以10比特表示,即最大表示光强特征信息的位宽为10比特,预定阈值为30,按照前述分析,理论上差分值应小于等于事件发放阈值30,因此编码差分值所需的最大比特数为
Figure PCTCN2020141973-appb-000025
比特。若事件数为10,则通过光强信息表示事件的代价为10×10=100比特。采用本申请提供的编码方案,可以节省事件的表示代价,即节省需要传输的数据量,以下具体说明:假设要传输的10个事件的绝对光强分别为{80,112,150,100,65,24,81,123,170,211},则初始状态,按照最大位宽对事件进行编码,按10比特编码第1个事件的绝对光强80。
从第2个事件开始,按1比特编码极性信息,按5比特编码光强变化量和发放阈值30的差分值。对于第2个事件,其相比于第1个事件的绝对光强80的光强变化量为|112-80|=32;而光强变化量与发放阈值30的差分值为32-30=2。由于相比第1个事件,光强在增强,即112>80,因此极性信息为+1。则分别采用1比特对极性信息+1进行编码,采用5比特对差分值2进行编码。
对于第3个事件,其相比于第2个事件的绝对光强112的光强变化量为|150-112|=38,则光强变化量与发放阈值的差分值为38-30=8;极性信息仍为+1。则分别采用1比特对极性信息+1进行编码,采用5比特对差分值8进行编码。
对于第4个事件,其相比于第3个事件的绝对光强150的光强变化量为|100-150|=50,光强变化量与发放阈值的差分值为50-30=20;由于当前绝对光强相比第3个事件的绝对光强减弱,即100<150,因此极性信息为-1。则分别采用1比特对极性信息-1进行编码,采用5比特对差分值20进行编码。
对于第5个事件,其相比于第4个事件的绝对光强100的光强变化量为|100-65|=35, 光强变化量与发放阈值的差分值为35-30=5;由于当前绝对光强相比第3个事件的绝对光强减弱,即65<100,因此极性信息为-1。则分别采用1比特对极性信息-1进行编码,采用5比特对差分值5进行编码。
对于第6个事件,其相比于第5个事件的绝对光强65的光强变化量为|65-24|=41,光强变化量与发放阈值的差分值为41-30=11;由于当前绝对光强相比第5个事件的绝对光强减弱,即24<65,因此极性信息为-1。则分别采用1比特对极性信息-1进行编码,采用5比特对差分值11进行编码。
对于第7个事件,其相比于第6个事件的绝对光强24的光强变化量为|81-24|=57,光强变化量与发放阈值的差分值为57-30=27;由于当前绝对光强相比第5个事件的绝对光强增强,即81>24,因此极性信息为+1。则分别采用1比特对极性信息+1进行编码,采用5比特对差分值27进行编码。
对于第8个事件,其相比于第7个事件的绝对光强81的光强变化量为|123-81|=42,光强变化量与发放阈值的差分值为42-30=12;由于当前绝对光强相比第7个事件的绝对光强增强,即123>81,因此极性信息为+1。则分别采用1比特对极性信息+1进行编码,采用5比特对差分值12进行编码。
对于第9个事件,其相比于第8个事件的绝对光强123的光强变化量为|170-123|=47,光强变化量与发放阈值的差分值为47-30=17;由于当前绝对光强相比第3个事件的绝对光强增强,即170>123,因此极性信息为+1。则分别采用1比特对极性信息+1进行编码,采用5比特对差分值17进行编码。
对于第10个事件,其相比于第9个事件的绝对光强170的光强变化量为|211-170|=41,光强变化量与发放阈值的差分值为41-30=11;由于当前绝对光强相比第3个事件的绝对光强增强,即211>170,因此极性信息为+1。则分别采用1比特对极性信息+1进行编码,采用5比特对差分值11进行编码。
在这个例子中,初始状态第1个事件编码了10比特,此后9个事件按1比特编码光强极性,按5比特编码光强变化量与发放阈值30的差分值,则总共编码了10+(1+5)×9=64比特。而原始按照固定的10比特编码绝对光强一共需要10×10=100比特,通过本申请提供的数据编码方式,至少节省了36%的数据量。现有视觉传感器在事件传输和存储上都没有考虑高效的编码策略,通常按照固定比特位宽对像素的坐标信息(x,y),光强的特征信息被读取的时间t和光强特征信息进行编码,光强特征信息是光强信息时,光强信息往往需要大量比特位进行表示。而从DVS采样原理来看,前后事件的光强信息是具有一定的相关性的,特别是还考虑到预定阈值是确定的,这些信息都可以用于降低事件数据的冗余性,实现高效压缩。本申请提供的方案利用了上述数据相关性,通过事件差分编码降低了这一相关性,实现了数据量的降低。具体的改进包括初始状态全量编码之后,后续事件仅需编码极性信息,以及光强变化量与预定阈值之间的差分值,即可以有效降低编码数据量。其中,全量编码是指利用视觉传感器预定义的最大位宽对一个事件进行编码。此外利用上一个事件的光强信息,以及解码出的极性信息和差分值,即可无损重建出当前时刻的光强信息。下面结合图33对解码的过程进行说明。
图33示出了根据本申请的可能的实施例的电子设备的框图。如图33所示,电子设备包括视觉传感器芯片3100、解析电路3101。应当理解的是,电子设备用于示例性目的,其可以利用任何合适的设备来实现,包括当前已知的和未来开发的各种传感器设备。本申请的实施例还可以被体现在不同的传感器系统中。另外,还应当理解,电子设备还可以包括其他元件、模块或实体,出于清楚的目的未被示出,但不意味着本申请的实施例不具备这些元件、模块或实体。
其中,视觉传感器芯片3100可以参照图29-a至图32所描述的视觉传感器进行理解,这里不再重复赘述。解析电路3101可以被配置为解析由视觉传感器芯片3100中的读取电路读取的数据信号。在本申请的可能的实施例中,解析电路3101可以根据预设的解码方法解码出极性信息和差分值,以获得当前时刻的光强信息。为了更好的理解解析电路3101如何解析视觉传感器芯片传输的数据信号,下面结合上述例子进行说明。
初始状态下,解析电路3101对获取的二进制数据流进行解码,对于第1个事件,按照最大位宽去解码,以获取第1秒对应的时刻的绝对光强,比如在上个例子中,按照10比特解码出第1个事件的绝对光强80。
此后的解码过程,首先解析极性信息,比如解析电路3101读取二进制数据流中的前1比特,并对该1比特进行解码,以获取极性信息,并按照差分编码下的光强信息表示位宽解码出差分值。然后根据同像素的上一次事件的绝对光强以及预定阈值,重建出当前时刻的绝对光强。
例如,对第2个事件,先按1比特解码出光强极性,得到+1;然后按5比特解码出差分值2。那么,由于光强极性为正,代表第2个事件相比第1个事件光强增强了,因此第2个事件的绝对光强计算为80+2+30=112,其中80为解码出来的第1个事件的绝对光强,2为差分值,30为事件发放阈值。
对于第3个事件,先按1比特解码出光强极性为+1,再按5比特解码出差分值为8,则第3个事件的绝对光强重建为112+8+30=150。
对于第4个事件,先按1比特解码出光强极性为-1,再按5比特解码出差分值为20;由于光强极性为负,代表相比第3个事件光强减弱了,因此绝对光强重建为150-20-30=100。
对于第5个事件,先按1比特解码出光强极性为-1,再按5比特解码出差分值为5;由于光强极性为负,代表相比第4个事件光强减弱了,因此绝对光强重建为100-5-30=65。
对于第6个事件,先按1比特解码出光强极性为-1,再按5比特解码出差分值为11;由于光强极性为负,代表相比第5个事件光强减弱了,因此绝对光强重建为65-11-30=24。
对于第7个事件,先按1比特解码出光强极性为+1,再按5比特解码出差分值为27;由于光强极性为正,代表相比第5个事件光强增强了,因此绝对光强重建为24+27+30=81。
对于第8个事件,先按1比特解码出光强极性为+1,再按5比特解码出差分值为12;由于光强极性为正,代表相比第5个事件光强增强了,因此绝对光强重建为81+12+30=123。
对于第9个事件,先按1比特解码出光强极性为+1,再按5比特解码出差分值为17;由于光强极性为正,代表相比第5个事件光强增强了,因此绝对光强重建为123+17+30=170。
对于第10个事件,先按1比特解码出光强极性为+1,再按5比特解码出差分值为11; 由于光强极性为正,代表相比第5个事件光强增强了,因此绝对光强重建为170+11+30=211。
在一些可能的实施例中,可以每隔预设时长进行一次全量编码,以降低解码依赖并防止误码。下面还以上面的例子为例继续说明,上面的例子提到通过1比特编码极性信息,解析电路3101可以通过读取该1比特获取光强的变换趋势,由于在一实施方式中,增加了全量编码,还需要指示解析电路3101当前是采用全量编码还是差分编码,比如可以通过2比特指示解析电路3101是全量编码还是差分编码,比如解析电路3101通过2比特解码出+1和-1时,确定采用差分编码对应的解码方式进行解码,比如,+1代表光强增强了,-1代表光强减弱了,如果解析电路3101通过2比特解析出0,则确定按照全量编码对应的解码方式进行解码。下面进行举例说明,第1个事件采用10比特编码,第2个事件至第7个事件采用2比特编码极性信息,采用5比特编码差分值。由于设定了每隔预设时长要进行一次全量编码,以防止解码依赖和误码,假设对于第8个事件,与第1个事件间隔了预设时长,则针对第8个事件,不再采用差分编码方式,即不再采用2比特编码极性信息,采用5比特编码差分值,而是采用全量编码,即通过10比特表示第8个事件对应的光强信息123。第9个事件和第10个事件仍采用差分编码,其中极性信息采用2比特编码,差分值采用5比特编码。
上述编码过程的总数据量为10+(2+5)×7+(2+10)+(2+5)×2=85比特,相比原始按照固定的10比特编码绝对光强一共需要10×10=100比特,采用每隔预设时长进行一次全量编码的方案,可以至少节省了15%的数据量。
针对上述每隔预设时长进行一次全量编码的方案,解码时,解析电路3101可以根据极性信息确定应当采用哪一种解码方式,并根据差分值、极性信息、预定阈值和已解码出的上一次事件发放时的光强,重建当前时刻光强,下面结合上述例子继续说明。
对于第1个事件,按照最大位宽10比特去解码,以获取第1秒对应的时刻的绝对光强此后,所有的事件首先按2比特解码出光强极性。若光极性信息指示采用差分编码,比如若极性信息非0,则按照5比特解码出差分值,若极性信息指示采用全量编码,比如若极性信息为0,则按照10比特解码出光强信息。
具体地,第2个事件首先按2比特解码出光强极性为+1,由于光强极性非零,则按照5比特解码出差分值为2,那么绝对光强重建为80+2+30=112。
第3个事件,按2比特解码出光强极性为+1,再按5比特解码出差分值为8,则第3个事件的绝对光强重建为112+8+30=150。
对于第4个事件,先按2比特解码出光强极性为-1,再按5比特解码出差分值为20;由于光强极性为负,代表相比第3个事件光强减弱了,因此绝对光强重建为150-20-30=100。
对于第5个事件,先按2比特解码出光强极性为-1,再按5比特解码出差分值为5;由于光强极性为负,代表相比第4个事件光强减弱了,因此绝对光强重建为100-5-30=65。
对于第6个事件,先按2比特解码出光强极性为-1,再按5比特解码出差分值为11;由于光强极性为负,代表相比第5个事件光强减弱了,因此绝对光强重建为65-11-30=24。
对于第7个事件,先按2比特解码出光强极性为+1,再按5比特解码出差分值为27;由于光强极性为正,代表相比第5个事件光强增强了,因此绝对光强重建为24+27+30=81。
对于第8个事件,先按2比特解码出光强极性为0,表示此事件为全量编码,则按10比特解码出绝对光强为123。
对于第9个事件,先按2比特解码出光强极性为+1,然后按5比特解码出差分值为17,则绝对光强重建为123+17+30=170。
对于第10个事件,先按2比特解码出光强极性为+1,然后按5比特解码出差分值为11,则绝对光强重建为170+11+30=211。
至此完成10个事件的解码和光强重建。
上述实施例,均假设光强变化量与差分值的差值不小于0,在一些可能的实施方式中,如果光强变化量和差分值的小于0时,则采用全量编码,即光强变化量与差分值的差值小于0时,采用全量编码,光强变化量与差分值的差值不小于0时采用差分编码。
在一些可能的实施例中,视觉传感器可能存在一定的延迟,可能导致两次或者两次以上满足光强变换量大于预定阈值,才产生了一次事件。这会出现差分值大于等于预定阈值,光强变化量至少是预定阈值的两倍的问题。为了解决这一问题,可以通过递归索引编码方式进行解决,下面对此进行说明。
第三编码单元2703可以首先确定差分值是否超过预定阈值,假设差分值小于预定阈值,则直接按照上述提到的差分编码方法对差分值进行编码,假设差分值不小于预定阈值,并且差分值和预定阈值的差值(第一剩余差分值)为M1,若第一剩余差分值M1小于预定阈值,则对M1进行编码,并对差分值进行编码。为了更好的理解本方案,下面结合一个例子进行说明:
假设最大表示光强特征信息的位宽为10比特,要传输4个事件,且该4个事件的绝对光强分别为{80,150,100,200},预定阈值为30,第三编码单元2703具体编码过程如下:
初始状态,对于第1个事件,按10比特编码绝对光强80。
第2个事件,其绝对光强为150,相比第1个事件的光强变化量|150-80|=70,则极性信息为+1;而光强变化量与预定阈值的差分值为70-30=40,剩余差分值超过了预定阈值30,不能对剩余差分值直接编码,将40减去30为10,10小于预定阈值,则编码剩余的差分值10。从差分值40到剩余差分值10减去了1个预定阈值30,则对1个预定阈值30进行编码,并对剩余差分值10进行编码。即编码极性信息+1,预定阈值30,以及剩余差分值10。
第3个事件,其绝对光强为100,相比于第2个事件,光强变化量为|100-150|=50,极性信息为-1;光强变化量与预定阈值的差分值为50-30=20,20小于预定阈值,则编码极性信息-1,以及差分值20即可。
上述编码过程的总数据量为10+(1+5+5)+(1+5)=27比特,而按照固定的10比特进行编码需要的总数据量为3×10=30比特,本实施例方法可至少节省10%数据量。
上述提到若第一剩余差分值M1小于预定阈值,则对M1进行编码,并对差分值进行编码,此外还可能存在第一剩余差分值M1仍然大于预定阈值的情况。如果第一剩余差分值M1仍然大于预定阈值,则第三编码单元2703确定对事件采用全量编码,这是因为如果再继续计算第一剩余差分值M1和预定阈值的差值,直到剩余差分值小于预定阈值,比如第二剩余差分值M2小于预定阈值,且差分值通过减去n个预定阈值得到的M2,则对预定阈值 进行n次编码,得到n个编码后的预定阈值,并对M2进行编码,通过这样的编码方式可能会导致事件表示的代价超过全量编码的代价,所以当第一剩余差分值M1仍然大于预定阈值,则第三编码单元2703确定对事件采用全量编码。下面举个例子进行说明:假设在上述的例子冲,还有第4个事件,第4个事件的光强信息为200,相比于第3个事件,光强变化量为|200-100|=100,极性信息为+1,光强变化量与预定阈值的差分值为100-30=70,70超过了预定阈值30,剩余差分值不小于预定阈值,不能对剩余差分值进行编码,则计算70-30=20,40仍然超过了预定阈值30,则计算40-30=10,10小于预定阈值,从差分值70到剩余差分值10,减去了2个预定阈值30,则对2个预定阈值进行编码,并对剩余差分值10进行编码。即编码极性信息+1,第一个预定阈值30,第二个预定阈值30,以及剩余差分值10。则如果仍然采用差分编码方式,上述编码过程的总数据量为10+(1+5+5)+(1+5)+(1+5+5+5)=43比特,而原始事件数据按照固定的10比特编码需要4×10=30比特,所以当第一剩余差分值M1仍然大于预定阈值,则第三编码单元2703确定对事件采用全量编码,可以更加节省数据量。
下面对递归索引编码方式对应的解码方式进行说明。解析电路3101对获取的二进制数据流进行解码,对于第1个事件,按照最大位宽去解码,以获取第1秒对应的时刻的绝对光强,比如在上个例子中,按照10比特解码出第1个事件的绝对光强80。此后的解码过程,首先解析极性信息,比如解析电路3101读取二进制数据流中的前1比特,并对该1比特进行解码,以获取极性信息,并按照差分编码下的光强信息表示位宽解码出差分值。如果解码出的差分值等于预定阈值,则按照光强信息表示位宽继续解码,获得剩余差分值。下面结合上述例子进行说明:
初始状态,按10比特解码出第1个事件的绝对光强80。
对于第2个事件,首先按1比特解码出光强极性为+1,然后按5比特解码差分值为30,发现差分值与发放阈值相等,则继续按5比特解码剩余差分值10。因此,第2个事件的光强差分值实际为30+10=40,则绝对光强重建为80+40+30=150。
对于第3个事件,先按1比特解码出光强极性为-1,然后按5比特解码出差分值为20,则绝对光强重建为150-20-30=100。
至此完成了3个事件的解码和光强重建。
本申请实施例还提供一种用于操作视觉传感器芯片的方法。参阅图34,为根据本申请的可能的实施例的用于操作视觉传感器芯片的方法的流程图,可以包括以下步骤:
3201、通过测量光强变化量来生成与像素阵列电路中的像素对应的至少一个数据信号。
像素阵列电路通过测量光强变化量来生成与像素阵列电路中的多个像素对应的多个数据信号,多个数据信号指示至少一个光强变化事件,至少一个光强变化事件表示像素阵列电路中的对应像素测量到的光强变化量超过预定阈值。
3202、根据第一预设的位宽对差分值进行编码。
第三编码单元根据第一预设的位宽对差分值进行编码,差分值是光强变换量和预定阈值的差值。第三编码单元可以参照第三编码单元2703进行理解,这里不再重复赘述。
在一些可能的实施例中,像素阵列电路包括多个像素,每个像素包括阈值比较单元, 阈值比较单元,用于光强变换量超过预定阈值时,输出极性信息,极性信息用于指示光强变化量是增强或者减弱。第三编码单元,还用于根据第二预设的位宽对极性信息进行编码。
在一些可能的实施例中,每个像素包括还包括光强检测单元,读出控制单元和光强采集单元,光强检测单元,用于输出照射在其上的光信号对应的电信号,电信号用于指示光强。阈值比较单元,具体用于根据电信号确定光强变换量超过预定阈值时,输出极性信息。读出控制单元,用于响应于接收到极性信号,指示光强采集单元采集并缓存对应极性信息接收时刻的电信号。第三编码单元,还用于根据第三预设的位宽对第一电信号进行编码,第一电信号是光强采集单元采集并缓存对应极性信息第一次接收时刻的电信号,第三预设的位宽是视觉传感器预置的用于表示光强的特征信息的最大位宽。
在一些可能的实施例中,第三编码单元,还用于:每隔预设时长根据第三预设的位宽对差分值进行编码。
在一些可能的实施例中,第三编码单元,具体用于:差分值大于预定阈值时,根据第一预设的位宽对差分值进行编码。
在一些可能的实施例中,第三编码单元,还用于:差分值不大于预定阈值时,根据第一预设的位宽对剩余差分值和预定阈值进行编码,剩余差分值是差分值和预定阈值的差值。
为了更好的展示通过对差分值进行编码的方式,可以节省传输事件所需的数据量,下面结合实验数据进行说明。CeleX传感器是一种现有的视觉传感器,CeleX传感器采用异步读取模式,即采用基于事件流的读取模式,CeleX传感器传输的事件通过光强信息表示,一般来说CeleX传感器采用8-13比特表示光强信息,即最大表示光强特征信息的位宽为8-13bit。在实验中,将CeleX传感器的参数设置为空间分辨率为1280×800,时间分辨率为14us,采样模式为Fixed Event-Intensity Mode,设定最大表示光强特征信息的位宽为12比特。利用CeleX传感器在Event-Intensity模式下采集的7组事件数据进行实验。实验结果通过表1表示,想相比于直接传输原始数据,即直接传输按照12比特编码所需的数据量,传输编码后的数据,可以大幅度减小传输所需的数据量。此外,相比于现有技术中已有的编码方案,本申请提供编码方案,由于充分考虑到光强变化量与预定阈值之间的相关性,仅传输两者的差分值以及极性信息,即可重建当前时刻的光强,相比于已有的编码方式,也可大量显著节省数据量。参加表1的实验数据,对7组数据对应的压缩比求平均值为1.645,本申请提出的差分编码方式获得了平均1.654倍无损压缩比,节省了约41.1%的数据量;相比之下现有的编码方式只能获得平均1.306倍压缩比(节省约26.6%数据量)。
表1:
Figure PCTCN2020141973-appb-000026
Figure PCTCN2020141973-appb-000027
此外,需要说明的是,视觉传感器外部的读取电路可以将编码模块273编码后的数据信号读取至视觉传感器的外部,比如,视觉传感器装配于一个电子设备中,该电子设备可能包括处理器和存储器,电子设备的读取电路可以将第三编码单元3007编码后的数据信号读取至电子设备的处理器中,或者存储器中。需要说明的是,本文涉及到关于编码的描述均指对光强的特征信息进行编码,对于用于表示一个事件的其他信息行编码或者其他处理的方式,本申请并不进行限定,比如其他信息可以包括产生事件的像素的坐标信息(x,y),光强的特征信息被读取的时间t等。
以上对本申请实施例提供的视觉传感器进行了介绍,通过本申请提供的方案,视觉传感器能够自适应地在多种数据读取模式之间切换,使得读取数据速率始终保持未超过预定的读取数据速率阈值,还可以自适应地在两种事件表示方式之间切换,使得读取数据速率始终保持未超过预定的读取数据速率阈值,从而降低了视觉传感器的数据传输、解析和存储的代价,显著提高了传感器的性能。本申请提供的视觉传感器还可以采用调整事件表示的精度,在满足带宽限制的条件下,以更大的表示精度传输所有事件。本申请提供的视觉传感器还可以采用对差分值进行编码的方式,降低了视觉传感器的数据传输、解析和存储的代价的同时还能以最高的精度传输事件,显著提高了传感器的性能。
本申请提供的视觉传感器可以装配于任何一种需要利用视觉信息的设备上,比如本申请提供的视觉传感器可以装配于智能手机,电视机,平板设备,监控设备,摄像头模组,安防设备等等。
2、图像优化
在通过数据采集和数据编解码之后,即可得到可用的RGB图像、事件图像或者视频等数据,进一步地,即可使用采集到的数据进行进一步优化,以便进行后续的应用。例如,可以通过RGB摄像头采集到RGB图像,并通过前述的编解码方式对数据进行编码,在需要使用RGB图像时,即可对数据进行解码,得到可用的RGB图像。又例如,可以通过DVS采集到事件图像,通过前述提供的编码方式将事件图像保存在存储介质中,当需要使用事件图像时,即可通过前述的解码方式来读取到DVS图像,以便进行后续处理。下面对本申请提供的进行图像优化的方法的流程进行示例性说明。
在介绍本申请提供的一些方法的流程之前,下面先对一些较为通用的概念进行介绍。
为便于理解,首先对本申请提供的方法中所涉及的一些通用的概念进行介绍。
a.运动传感器
结合前述图1B的相关描述,运动传感器即可以因光照强度的变化,监测到一定范围内目标对象的运动将引起一系列的像素产生事件输出,得到一段时间内的事件流。在本申请实施方式中所提及的运动信息,即可以使用运动传感器对目标对象在预设范围内的运动情况进行监测,得到目标对象在检测范围内进行运动时的信息。
以运动传感器为DVS为例,产生事件的方式可以如图35所示,DVS对运动变化进行响应产生事件,由于静态区域不会激发事件,因此事件大多产生于存在运动物体的区域。通常,在当前光强与上一次事件产生时的光强的差异超过阈值时,DVS将产生一个事件,如图3中所示的事件N1、N2和N3,且通过事件的产生仅与光强的相对变化相关。其中,每个事件可以表示为<x,y,t,f>,(x,y)表示产生事件的像素位置,t表示产生事件的时间,f表示光强的特征信息。在部分DVS传感器(如DAVIS传感器、ATIS传感器等)中,f表示光强的变化趋势,也可以称为极性,通常用1bit表示,取值可以为ON/OFF,其中ON表示光强增强,OFF表示光强减弱。在某些DVS传感器,如CeleX传感器进行运动对象监测的场景中f表示绝对光强,通常用多个比特表示,如9bit表示0-511范围内的光强值。
可以理解为,DVS对光强变化超过阈值时才会产生事件,因此可以通过DVS检测运动的对象,而DVS对静态区域则并不敏感。
b.事件图像
事件图像可以包括由前述的运动传感器采集到的数据生成的图像,具体包括了基于目标对象在运动传感器的监视范围内进行运动时的运动轨迹信息生成的图像,或者说事件图像可以用于标识一段时间内目标对象在运动传感器的检测范围内进行运动时的信息。
例如,若在DVS的检测范围内挥手,监测到的其中一个时刻的事件如图36所示,其中,图36中的白色表示DVS监测到的事件,即DVS可以监测到预设范围内的运动对象的轮廓和位置。
具体例如,由DVS采集到的数据构成的图像可以表示为
Figure PCTCN2020141973-appb-000028
其中
Figure PCTCN2020141973-appb-000029
(x,y)表示图像中的某个位置的坐标,t表示时刻,t 1为开始拍摄曝光图像的时刻减去50毫秒(即一个时间窗口),t 2为开始拍摄曝光图像的时刻,events表示运动传感器,如DVS采集到的数据。
c.运动信息
该运动信息中可以包括包括目标对象在预设范围内进行运动时的信息。
可以通过运动传感器对目标对象在预设范围内的运动情况进行监测,得到预设范围内的目标对象的运动信息。其中,目标对象是预设范围内运动的物体,目标对象的数量可以是一个或者多个,该运动信息可以包括目标对象在预设范围内进行运动时的运动轨迹的信息。
例如,该运动信息中可以包括目标对象在预设范围内进行运动时,目标对象所在的区 域的大小、边框或者角点在预设范围内的坐标等信息。
具体地,可以通过DVS监测到的数据生成时间窗口,然后对其中的事件按照短时窗口对时间窗口进行切分,累积短时窗口中的事件,计算连通域后得到的运动轨迹。进一步地,对时间窗口中的一系列运动轨迹进行分析,通过计算光流或者运动矢量,得到运动的目标对象的运动特性,如运动方向、运动速度等信息。
示例性地,如图37所示,可以将时间窗口切分多个短时窗口,如图37中所示的k个短时窗口。切分的方式可以是按照设定的时长进行切分,也可以是按照随机的时长进行切分,或者按照运动轨迹变化情况进行切分等,具体可以根据实际应用场景进行调整。在切分得到k个短时窗口之后,分析每个短时窗口中的事件的位置,确定目标对象在每个短时窗口中的目标对象所在的区域,如短时窗口1中的运动区域为如图37中所示的运动区域1,短时窗口k中的运动区域为图37中所示的运动区域k。然后通过短时窗口1-k中运动区域的变化情况,确定目标区域的运动区域以及运动特性,如运动方向或者运动速度等。
通常,运动信息中所包括的运动特性可以包括运动速度或运动方向等。具体地,该运动速度可以是目标对象相比前一短时窗口的速度的变化趋势,包括但不限于变快、变慢等速度趋势状态量,甚至更多级别的速度趋势状态量,如快、较快、非常快、慢、较慢、非常慢等。该运动方向也可以是相比前一短时窗口的方向变化,包括但不限于向左、向右、向上、向下、不变等方向趋势状态量,甚至更多级别的方向趋势状态量,如向左上、向左下、向右上、向右下、向左、向右、向上、向下、不变等。
在本申请提供的以下实施方式中可以代入上述通用概念,以下不再赘述。
下面对图像增强或重构的一些可能的实施方式进行介绍。
其中,对图像增强和重构的目的是获得更清晰的RGB图像或者事件图像,下面分别对一些可能的实施方式进行说明。
(1)运动补偿
通常,运动传感器采集到的信息可以用于进行图像重建、目标检测、拍摄运动对象、使用运动的设备进行拍摄、拍摄去模糊、运动估计、深度估计或者进行目标检测识别等等场景,因此,如何得到更准确的运动信息,成为亟待解决的问题。
本申请提供一种图像处理方法,用于使用运动参数来对运动信息进行更新,得到更准确的运动信息。
首先,在此场景中,本申请提供的图像处理方法的具体流程可以包括:使用运动传感器对检测范围内目标对象进行运动时的运动信息进行采集,该运动信息可以来源于基于帧的运动检测或者基于事件的运动检测等,然后基于该运动信息生成事件图像,然后计算运动参数,该运动参数包括运动传感器与目标对象之间的相对运动的参数,然后根据该运动参数来对事件图像进行更新,得到更新后的事件图像。
本申请提供的图像处理方法中,对更新事件图像的过程提供了多种实现方式,下面分别对不同的实施方式及其结合实施方式进行说明。
在一种可能的实施方式中,可以基于预设的优化模型来更新事件图像,如以优化模型的值最优为目标来更新事件图像,得到更新的事件图像。在更新事件图像的过程中,可以 根据运动参数来确定优化模型的初始值,从而可以实现以运动传感器监测到的运动信息为约束初始化优化模型的值,使对事件图像进行更新时所使用的初始值可以更准确。相对于需要对事件图像进行多次全局迭代更新,本申请提供的方法基于获取到的运动参数来对优化模型进行初始化,可以明显提高针对事件图像的更新速度,提高对事件图像的更新效率,并且可以给出较好的初始化更新方向,在有限迭代次数下提升优化效果。
在一种可能的实施方式中,在对事件图像进行更新的过程中,通常可以进行多次迭代更新,从而使最终得到的事件图像更优。在每次迭代更新的过程中,可以使用上一次迭代更新时输出的运动参数,来进行当前次迭代更新,从而可以避免每次迭代更新时都重新计算运动参数,提高更新效率。
下面分别对初始化优化模型的值和迭代更新事件图像的过程分别进行说明。
过程一、使用运动参数初始化优化模型的过程
参阅图38,本申请提供的一种图像处理方法的流程示意图。
3801、获取运动信息。
可以通过运动传感器对目标对象在预设范围内的运动情况进行监测,得到预设范围内的目标对象的运动信息。其中,目标对象是预设范围内运动的物体,目标对象的数量可以是一个或者多个,该运动信息可以包括目标对象在预设范围内进行运动时的运动轨迹的信息。
例如,该运动信息中可以包括目标对象在预设范围内进行运动时,目标对象所在的区域的大小、边框或者角点在预设范围内的坐标等信息。
为便于理解,以下将目标对象在预设范围内进行运动时,目标对象在检测到的每一时刻中所在的区域称为目标对象的运动区域。该运动区域例如,若目标对象为行人,且行人正在进行全身运动,则运动区域内可以包括行人的全身,若行人仅手臂运动,则目标对象可以仅仅是行人的手臂,运动区域可以包括行人的手臂部分。
通常,该预设范围与摄像头的焦距或者视场角等相关。例如,摄像头的视场角越大,拍摄到的范围的面积也越大,摄像头的视场角越小,拍摄到的范围的面积也越小。又例如,摄像头的焦距越大,拍摄的范围也就越远,也可以理解为拍摄到的距离远的对象更清晰,摄像头的焦距越小,拍摄到的范围也就越近。
本申请实施方式中,运动传感器监测到的范围包括摄像头的拍摄范围,预设范围可以是摄像头的拍摄范围,运动传感器所监测到的范围包括该预设范围,即运动传感器所监测到的范围可以大于或者等于该预设范围。
在一种可能的实施方式中,该运动信息可以包括目标对象当前所在的区域和进入预设范围后的历史所在的区域,还可以包括目标对象的运动速度或者运动方向等。
结合前述的数据采集和数据编码,本实施例中的运动信息可以是通过前述的数据采集和编解码的方式中得到的数据,例如,可以通过DVS采集得到事件流,并通过前述提供的数据编解码的处理方式,得到可用的运动信息。
3802、根据运动信息生成至少一帧事件图像。
其中,在得到运动信息之后,可以运动传感器在检测范围内所采集到的信息生成至少 一帧事件图像。通常,运动信息中可以包括一段时长内目标对象在检测范围内运动的轨迹的信息,因此生成检测范围对应的图像,并将运动信息所包括的目标对象的轨迹映射至图像中,得到至少一帧事件图像。该至少一帧事件图像可以理解为表示目标对象在检测范围内产生运动时的运动轨迹的图像。
例如,该事件图像可以参阅前述图35-37及其相关介绍。
当本申请所提及的至少一帧事件图像为多帧事件图像时,可以是同一时间窗口的事件图像,也可以是不同事件窗口的事件图像,例如,事件图像1是[t1,t2]时段内的事件图像,事件图像2是[t2,t3]时段内的事件图像。当然,该至少一帧事件图像也可以是相同时段内不同区域的事件图像。例如,可以将DVS的监测区域划分为多个区域,基于每个区域内检测到的事件生成对应的事件图像。
还需要说明的是,根据前述的数据采集和编解码中提供的方法,可以在存储介质中直接读取到事件图像,则此时无需执行步骤3801-3802,可以直接从存储介质中读取到至少一帧事件图像,本申请此处仅仅是示例性说明,并不作为限定。
3803、获取运动参数。
其中,该运动参数表示传感器和目标对象之间的相对运动的相关参数,如目标对象在像平面的运动速度、运动方向、运动加速度、光流信息、目标对象距离运动传感器的深度、运动传感器的加速度或者运动传感器的角速度等,其中光流信息表示运动传感器与目标对象之间的相对运动的速度。
并且,计算运动参数的方式可以有多种,例如,若运动参数不仅包括运动传感器自身相关的参数,还包括目标对象的运动速度、运动方向或运动加速度等,则可以通过运动传感器采集到的信息计算得到运动参数。
又例如,若运动参数包括了运动传感器自身的相关参数,如光流信息、运动传感器的加速度、运动传感器的角速度或者深度等,则可以通过运动传感器采集到的信息或者IMU、陀螺仪或者加速度计等,得到运动传感器自身的相关参数。
还例如,若运动参数不包括运动传感器自身相关的参数,而是包括目标对象的运动速度、运动方向或运动加速度、深度等,则可以通过运动传感器采集到的信息计算得到运动参数。又例如,若运动参数包括了运动传感器自身的相关参数,如光流信息、运动传感器的加速度、运动传感器的角速度等,则可以通过运动传感器采集到的信息或者IMU、陀螺仪或者加速度计等,得到运动传感器自身的相关参数。
例如,以从IMU采集到的数据中获取运动参数为例,在IMU采集到的数据中,可以包括IMU的角速度ω或加速度α等。可以从角速度ω或加速度α等中选择一项或者多项作为运动参数。
在一种可能的实施方式中,运动参数可以由运动传感器采集得到,在一些场景中,运动传感器采集运动参数时,可能受到噪声或者偏置等影响,导致运动参数出现偏移,因此,可以使用一些纠偏参数对运动参数进行纠偏,从而提高运动参数的准确性。可以是在确定运动参数之后,对该运动参数进行纠偏,得到纠偏后的运动参数,也可以是运动传感器在采集数据时,被配置为基于纠偏参数进行纠偏,得到纠偏后的数据,从运动传感器采集到 的数据中即可直接提取到去偏置后的运动参数。因此,在本申请实施方式中,可以得到纠偏后的运动参数,从而使运动参数更准确。
例如,因IMU的数据容易受到噪声或零偏置参数的影响,其中零偏置参数受到随机游走的影响因此需要不断更新修正。因此,在提取运动参数时,可以在IMU采集到的数据的基础上,去除受噪声或零偏置参数的影响。例如,通常将角速度的真实值表示为:
Figure PCTCN2020141973-appb-000030
Figure PCTCN2020141973-appb-000031
将和加速度的真实值表示为:
Figure PCTCN2020141973-appb-000032
其中,
Figure PCTCN2020141973-appb-000033
表示变换矩阵,从i时刻到各时刻j下相机的变换矩阵:
Figure PCTCN2020141973-appb-000034
具体可以表示从空间坐标系到相机体坐标系的变换,g表示重力加速度,n为噪声,b为零偏置参数。
具体例如,可以以匀速直线运动模型来表示目标对象与运动传感器之间的相对运动,运动参数可以是一个速度向量v,需要说明的是,不同场景中可以选择不同的运动模型,也就会对应多种运动参数,例如以匀加速直线运动为例,运动参数为一个运动向量v和加速度a p。通过IMU数据计算出的变换矩阵和相平面的深度Z以及投影模型π来计算出初始的速度向量:
Figure PCTCN2020141973-appb-000035
其中,E表示单位矩阵,
Figure PCTCN2020141973-appb-000036
表示相平面的原点。Δt为一段时长。
此外,以根据DVS采集到的数据来计算运动参数为例,如图36中的白色表示DVS监测到的事件,即DVS可以监测到预设范围内的运动对象的轮廓和位置,可以根据DVS监测到的目标对象在预设范围内的运动轨迹,计算目标对象的运动速度,并提取到目标对象的运动方向。
具体地,可以通过DVS监测到的数据生成时间窗口,然后对其中的事件按照短时窗口对时间窗口进行切分,累积短时窗口中的事件,每个时间窗口内累计的事件可以理解为一帧事件图像。进一步地,还可以对时间窗口中的一系列运动轨迹进行分析,通过计算光流、运动矢量等方式,得到运动的目标对象的运动特性,如运动方向、运动速度等信息。
示例性地,如前述图37所示,可以将时间窗口切分多个短时窗口,如图37中所示的k个短时窗口,每个时间窗口可以对应一帧事件图像。切分的方式可以是按照设定的时长进行切分,也可以是按照随机的时长进行切分,或者按照运动轨迹变化情况进行切分等,具体可以根据实际应用场景进行调整。在切分得到k个短时窗口之后,分析每个短时窗口中的事件的位置,确定目标对象在每个短时窗口中的目标对象所在的区域,如短时窗口1中的运动区域为如图37中所示的运动区域1,短时窗口k中的运动区域为图37中所示的运动区域k。然后通过短时窗口1-k中运动区域的变化情况,确定目标区域的运动区域以及运动特性,如运动方向或者运动速度等。
在一种可能的实施方式中,得到运动参数之后,在初始化优化模型之前,即可使用该运动参数对事件图像进行补偿,从而得到补偿后的事件图像。例如,以目标对象的运动轨迹为匀速直线运动,运动传感器为DVS为例,时间窗口[t,t+Δt]内t k时刻DVS捕获位置为x k,目标对象的运动轨迹可以被划分为多段直线运动,以θ(即运动参数)表示事件图像中目标对象的运动速度,则事件图像中在对目标对象进行运动补偿后的位置x k′为:x′ k=x k-(t k-t ref)·θ,对事件图像的所有事件进行运动补偿之后,即可得到补偿后的事件图像。
3804、根据运动参数对预设的优化模型的值进行初始化,得到优化模型的值。
在得到运动参数之后,可以使用该运动参数对事件图像来进行补偿,得到补偿后的事件图像,然后根据补偿后的事件图像来计算优化模型的初始值,或者称为初始的最优值。
其中,优化模型可以包括多种,可以根据不同的场景选择不同的优化模型。例如,优化模型可以包括但不限于以下一种或者多种:方差(variance)、均方(mean square)、图像熵(image entropy)、梯度幅度(gradient magnitude)、拉普拉斯(Laplacian)、SoS损失函数、R2损失函数或者匀速直线运动模型等。方差也可以称为对比度,最大化对比度的算法可以包括梯度上升、牛顿法等,迭代一次计算出更新的运动参数,然后重复以上过程,直到达到最优的对比度。
需要说明的是,本申请实施例中,仅以对比度算法为优化模型进行示例性说明,通常事件图像的对比度越大,事件图像的补偿效果或者更新效果越好,而在另一些场景中,优化模型的值最优值可能是最小值,即优化模型的值越小,事件图像的更新效果越好。
3805、根据优化模型的值更新至少一帧事件图像,得到更新后的至少一帧事件图像。
在使用运动参数对优化模型进行初始化得到优化模型的值之后,基于该优化模型的值对至少一帧事件图像进行迭代更新,从而得到更新后的至少一帧事件图像。
具体地,在得到优化模型的初始值之后,在对事件图像进行迭代更新的过程中,可以根据该初始值反推运动参数,并根据反推得到的运动参数对事件图像来进行补偿,得到补偿后的事件图像,然后根据补偿后的事件图像来计算优化模型的最优值,重复上述步骤,直到满足终止迭代的条件,如迭代次数达到预设次数、迭代时长达到预设时长、相邻次迭代得到的事件图像之间的差值小于预设值、或者相邻次迭代得到的优化模型的最优值之间的差值小于预设差值等,输出最终得到的事件图像。
例如,选取对比度(或者称为方差)F作为优化模型,并以运动参数为匀速速度为例,在初始化运动参数θ后,为了得到F最大化的事件图像,需要将F作为目标函数对运动参数θ进行最更新求解θ=arg minF(θ,x)。
对运动图像进行补偿的过程可以理解为,将时间窗口[t,t+Δt]内的事件图像按照运动模型反推回到t时刻,从而实现运动补偿。以目标对象的运动轨迹为匀速直线运动为例,时间窗口[t,t+Δt]内t k时刻DVS捕获位置为x k,目标对象的运动轨迹可以被划分为多段直线运动,以θ表示事件图像中目标对象的运动速度,则事件图像中在对目标对象进行运动补偿后的位置x k′为:x′ k=x k-(t k-t ref)·θ,累积对目标对象进行运动补偿后在事件图像中的位置,即可得到一次更新后的事件图像。
然后,计算运动补偿后得到的事件图像的图像对比度
Figure PCTCN2020141973-appb-000037
其中h i,j表示该时间窗口内的事件经过运动补偿后形成的事件图像中的像素,N p表示该帧中的像素数量,μ表示该frame的均值。随后,通过最优化算法计算最优化F(x,θ)的θ值θ=arg minF(θ,x),经过多次迭代计算出最佳的运动参数θ,并据最优的运动参数对事件图像进行补偿,得到更优的事件图像。该优化算法可以采用梯度上升、牛顿法、共轭梯度法(Conjugate Gradient)或动量优化法(Momentum)等算法,具体可以根据实际应 用场景调整,本申请对此不作限定。
为便于理解,步骤3805可以理解为,在得到运动参数之后,使用该运动参数对事件图像进行补偿,并基于补偿后的事件图像计算优化模型的最优值(即初始值),然后基于该最优值反推最优的运动参数,使用反推得到的最优的运动参数来对事件图像进行再次补偿,并迭代前述步骤,得到最终更新后的事件图像。
更具体地,迭代更新至少一帧事件图像的过程还可以参阅以下实施方式二,此处不再赘述。
因此,在本申请实施方式中,在更新事件图像之前,可以使用运动参数对优化模型进行初始化,从而可以基于初始化的优化模型的值来对事件图像进行更新,而无需从最小的优化模型的值或是随机的初始值来对事件图像进行更新,因此可以减少对事件图像的迭代更新次数,提高对事件图像的迭代更新效率,快速得到最优的事件图像。
在一种可能的实施方式中,在每次计算得到最优的优化模型的值的过程中,可以更新纠偏参数,该纠偏参数可以用于得到纠偏后的运动参数,如运动传感器在采集到数据之后,使用该纠偏参数对采集到的数据进行纠偏,从而得到纠偏后的数据,以便后续可以从纠偏后的数据中提取到更准确的运动参数。或者,在从运动传感器采集到的数据中提取到运动参数之后,可以使用纠偏参数来对运动参数进行纠偏,得到更准确的运动参数。例如,运动参数可以由IMU采集得到,在每次计算得到最优的优化模型的值的过程中,可以更新IMU参数,或者称为纠偏参数,该IMU参数可以用于IMU采集数据。例如,因IMU的数据容易受到噪声n和零偏置参数b的影响,其中零偏置参数受到随机游走的影响因此需要不断更新修正。通常将角速度的真实值表示为:
Figure PCTCN2020141973-appb-000038
将和加速度的真实值表示为:
Figure PCTCN2020141973-appb-000039
b和n g即为IMU参数,用于对采集到的数据进行修正,得到更准确的运动参数。因此,在本申请实施方式中,在更新事件图像的过程中,还可以对IMU参数进行更新,从而可以使用更新后的IMU参数来得到更准确的运动参数。通常,运动参数可以是通过对IMU采集到的数据进行积分得到,误差会逐步累积,时间越长计算得到的运动参数的漂移也就越大,在较短的时间内通常无法对IMU的数据进行校准,而本申请实施方式中,在得到优化模型的最优值之后,可以使用该最优值来更新IMU参数,从而使得后续可以基于更准确的IMU参数来得到运动参数,提高运动参数的准确率。
下面以从IMU采集到的数据中得到运动参数,参阅图39,运动传感器为DVS为例对本申请提供的图像处理方法的流程进行示例性说明。
首先,IMU数据3901是IMU采集到的数据,具体可以包括IMU的角速度、加速度或者速度等,通常,IMU与DVS可以设置在同一设备中或者具有连接关系等,IMU的角速度、加速度或者速度等,也可以表示为DVS的角速度、加速度或者速度等。
运动参数3902可以是从IMU数据中得到的数据,如角速度、加速度或者速度等。通常,因IMU采集的数据容易受到噪声n和零偏置参数b的影响,其中零偏置参数受到随机游走的影响因此需要不断更新修正。通常将角速度的真实值表示为:
Figure PCTCN2020141973-appb-000040
将加速度的真实值表示为:
Figure PCTCN2020141973-appb-000041
其中,
Figure PCTCN2020141973-appb-000042
表示变换矩阵,从i时刻到各时刻j下相机的变换矩阵:
Figure PCTCN2020141973-appb-000043
具体可以表示从空间坐标系到相机体坐标系的 变换,g表示重力加速度,n为噪声,b为零偏置参数。
在对事件图像进行更新之前,可以使用运动参数3901来初始化对比度3904,同时,还可以使用运动参数来补偿事件图像3903,得到补偿后的事件图像。
在对事件图像进行补偿时,可以将时间窗口[t,t+Δt]内的事件按照运动模型反推回到t时刻,从而实现运动补偿。例如,补偿后的位置x k′为:x′ k=x k-(t k-t ref)·θ,累积对目标对象进行补偿目标对象在图像中的位置,即可得到补偿后的图像,此处将补偿后的事件图像的像素表示为h ij
需要说明的是,本申请实施例中以优化模型为对比度(或者称为方差)的算法来进行示例性说明,实际应用场景中该对比度可以替换其他指标,如方差(variance)、均方(mean square)、图像熵(image entropy)、梯度幅度(gradient magnitude)、拉普拉斯(Laplacian)等,具体可以根据实际应用场景进行调整。
在得到补偿后的事件图像之后,可以基于补偿后的事件图像来计算最大化对比度,并使用最大化对比度来更新运动参数,并继续使用更新后的运动参数来补偿事件图像,得到更新后的事件图像,并重复上述步骤,直至符合终止迭代的条件,输出最终的事件图像。
在得到补偿后的事件图像h ij之后,计算图像对比度
Figure PCTCN2020141973-appb-000044
N p表示事件图像中像素的数量,μ表示事件图像的像素均值。然后计算最大化F(x,θ)的运动参数θ,即在哪一个θ的值的基础上F可以达到最大化。从而可以基于最大化时得到的运动参数θ的基础上对事件图像进行进一步迭代补偿,从而得到更新后的图像。
在最大化对比度的过程中,还可以同时更新IMU参数,该IMU参数可以用于IMU采集数据或者对IMU采集到的数据进行修正等。
例如,将角速度的真实值表示为:
Figure PCTCN2020141973-appb-000045
将加速度的真实值表示为:
Figure PCTCN2020141973-appb-000046
则IMU参数可以包括噪声n和零偏置参数b。将由IMU数据计算运动参数的过程视为θ=G(b a,b g,a,ω),则b′ a,b′ g=arg minF(G(b a,b g),x),从而得到更新后的噪声n和零偏置参数b。
因此,在本申请实施方式中,可以基于IMU采集到的数据来得到运动参数,从而基于运动参数进行对比度初始化,进而基于初始化的对比度对事件图像进行更新,得到更新后的事件图像。相当于基于运动参数设定了对比度的初始值,减少了对事件图像进行多次迭代次数,提高得到最终的事件图像的效率。
过程二、迭代更新的过程
参阅图40,本申请提供的另一种图像处理方法的流程示意图,如下所述。
4001、获取目标任务,并根据目标任务确定迭代时长。
其中,该目标任务可以包括对至少一帧事件图像进行迭代更新的时长,或者该目标任务可以使用至少一帧事件图像来进行的任务,并包括了对至少一帧事件图像进行迭代更新的时长等。
例如,该目标任务可以直接携带对至少一帧事件图像进行迭代更新的时长,如可以由用户设定对每一帧事件图像进行迭代更新的时长为30ms。
又例如,该目标任务可以是使用至少一帧事件图像进行目标检测、图像重建或拍摄运 动对象等任务,该目标任务还可以包括对每一帧事件图像进行迭代更新的时长为50ms等,或者对该至少一帧事件图像的总迭代时长为3900ms等。
需要说明的是,本申请中的步骤4001为可选步骤,在一些场景中,也可以不设定对事件图像的迭代时长,如在对事件图像进行迭代更新的迭代次数达到预设次数,或者优化模型的输出的值的变化值不超过预设值等,具体可以根据实际应用场景进行调整,此处并不作为限定。
4002、获取运动信息。
4003、根据运动信息生成至少一帧事件图像。
其中,步骤4002-4003与前述步骤3801-3802类似,此处不再赘述。
在得到事件图像之后,即可对事件图像进行迭代更新,迭代更新的过程可以如以下步骤4004-4006所述。
还需要说明的是,本申请对步骤4001和步骤4003的执行顺序不作限定,可以先执行步骤4001,也可以先执行步骤4003,还可以同时执行步骤4001和步骤4003,具体可以根据实际应用场景调整,此处不作限定。
4004、获取上一次迭代根据优化模型得到的运动参数。
其中,该运动参数表示传感器和目标对象之间的相对运动的相关参数,如目标对象的运动速度、运动方向、运动加速度、光流信息、运动传感器的加速度、运动传感器的角速度或者深度等,该光流信息表示运动传感器与目标对象之间的相对运动的速度。
若当前次迭代为第一次迭代,则可以将运动参数设置为初始值,如设置为0或者预先设置的值等,或者根据运动传感器采集到的信息来计算运动参数等。
若当前次迭代为非第一次迭代,则可以根据上一次迭代过程中优化模型的最优值,反推运动参数的值,然后将反推得到的值作为运动参数的值。或者,将反推得到的运动参数与前述通过步骤3803的方式确定的运动参数进行加权融合,得到融合后的运动参数。
例如,在对事件图像进行的每次迭代更新的过程中,计算得到最优值F(x,θ)之后,反推求运动参数θ的值,θ=arg minF(θ,x),从而计算得到更新后的运动参数。
又例如,除了基于对事件图像的上一次迭代更新的优化模型的最优值得到的运动参数(为便于区分称为运动参数1),还可以根据运动传感器采集到的数据获取运动参数(为便于区域称为运动参数2),获取运动参数2的方式可以参阅前述步骤3803,此处不再赘述。可以采用对运动参数1和运动参数2进行加权融合的方式,来得到本申请实施例中本次迭代更新所使用的运动参数。例如,运动参数1的权重值可以设置为0.8,运动参数2可以是IMU采集到的参数,其权重值可以设置为0.2,则本次迭代更新取的运动参数为=0.2*运动参数2+0.8*运动参数1。
此外,若前述的至少一帧事件图像为多帧事件图像,且当前次迭代更新的事件图像,与上一次迭代更新的事件图像不相同,也可以将上一次迭代更新事件图像时得到的运动参数来对当前次迭代更新的事件图像进行更新。因此,在本申请实施方式中,在对不同的事件图像进行更新时,可以使用对上一帧事件图像进行迭代更新得到的运动参数来对当前的事件图像进行更新,从而可以使用更准确的运动参数来进行更新。相对于重新初始化运动 参数的值,本申请实施例提供了有效的运动参数,可以明显提高对事件图像的更新效率。
4005、根据运动参数对至少一帧事件图像进行更新,得到更新后的至少一帧事件图像。
在得到当前次迭代的运动参数之后,根据该运动参数对事件图像进行补偿,得到当前次迭代更新得到的至少一帧事件图像。
具体地,当该至少一帧事件图像为一帧事件图像时,在每次迭代过程中,可以对该一帧事件图像进行迭代更新。若该至少一帧事件图像为多帧事件图像时,在完成其中一帧事件图像进行更新之后,可以继续对下一帧事件图像进行更新,或者,每次迭代可以对不同的事件图像进行更新,从而完成对所有的事件图像的迭代更新。例如,可以首先对[t0,t1]时段的事件图像进行多次迭代更新,在完成对[t0,t1]时段的事件图像的更新之后,计算最终的运动参数,并基于该运动参数,对[t1,t2]时段的事件图像进行更新,依次类推。又例如,在第一次迭代过程中,可以对[t0,t1]时段的事件图像进行更新,计算得到运动参数之后,基于该运动参数,对[t1,t2]时段的事件图像进行更新,依次类推。
为便于理解,本申请实施例以对一帧事件图像(或者称为目标事件图像)为例进行示例性说明。
例如,在确定运动参数θ之后,对目标事件图像中每个事件的位置进行补偿,如x′ k=x k-(t k-t ref)·θ,x′ k即为对x k进行补偿后的位置,每个位置上的变换后的事件累积起来即可形成更新后的目标事件图像:
Figure PCTCN2020141973-appb-000047
其中,N e表示目标事件图像中的事件数量,b k表示目标事件图像的表示方式,取值可以是0或者1。
示例性地,如图41所示,图41中,分别通过不同的形式来表示事件图像,显然,随着迭代次数的增加,得到的事件图像也越来越清晰。
在对事件图像进行补偿之后,可以通过优化模型的值来衡量事件图像的质量,该优化模型可以包括多种可以包括但不限于以下一种或者多种:方差(variance)、均方(mean square)、图像熵(image entropy)、梯度幅度(gradient magnitude)、拉普拉斯(Laplacian)、SoS损失函数、R2损失函数等。可以使用优化算法计算优化模型的最优值,然后可以根据该最优值计算出新的运动参数。
为便于理解,步骤4005可以理解为,在对事件图像进行补偿之后,通过预先设定的评价指标来衡量事件图像的质量,如方差、均方、图像熵、梯度幅度、拉普拉斯等,如
Figure PCTCN2020141973-appb-000048
通过最优化算法计算最大化F(x,θ)的θ值θ=arg minF(θ,x),即可得到当前次迭代更新过程得到的更新后的运动参数。以F为对比度为例,最大化对比度的优化算法可以采用梯度上升、牛顿法等方法,计算出更新的运动参数,然后使用该运动参数对更新后的事件图像或者下一帧事件图像进行更新,重复以上过程,得到最终的更新后的至少一帧事件图像。
4006、判断是否结束迭代,若是,则执行步骤4007,若否,则执行步骤4004。
在对事件图像的每一次迭代更新过程中,在对事件图像进行更新之后,可以判断是否结束对事件图像的迭代更新,若结束迭代,则可以输出更新后的至少一帧图像,若未结束迭代,则可以继续对事件图像进行迭代更新,即执行步骤4004。
具体地,判断是否结束迭代的方式可以包括判断当前次迭代的结果是否满足预设条件, 若是则终止迭代,终止条件包括以下一项或者多项:对至少一帧事件图像进行迭代更新的次数达到预设次数、对至少一帧事件图像进行迭代更新的时长达到预设时长、或者对至少一帧事件图像进行更新过程中优化模型的最优值变化小于预设值等等。该预设时长可以是根据步骤4001中的目标任务确定的,也可以是预先设定的时长,如100ms或50ms等。例如,用户可以通过终端的交互界面,设置每一帧事件图像的迭代更新时长。
因此,在一些场景中,可以根据实际需求确定迭代次数,兼顾事件图像处理的效率和事件图像的质量,在满足实时处理的要求下更新事件图像,实现效率和质量的平衡。
4007、输出更新后的至少一帧事件图像。
在终止对事件图像的迭代更新之后,即可输出更新后的至少一帧事件图像。
可选地,后续可以使用更新后的至少一帧事件图像进行后续分析。如可以使用更新后的事件图像进行深度估计、光流估计、图像重建、目标检测、拍摄运动对象、使用运动的设备进行拍摄、拍摄去模糊、运动估计、深度估计或者进行目标检测识别等。
在本申请实施方式中,在每次迭代过程中,可以通过上一次迭代得到的优化模型的最优值,得到当前次迭代所使用的运动参数,并根据该运动参数对事件图像进行补偿,得到补偿后的事件图像。因此,可以提高对事件图像进行更新的效率,快速得到质量更高的事件图像。并且,可以根据具体场景调整迭代次数,可以兼顾事件图像的更新效率和质量,快速高效地得到符合需求的事件图像。
为便于理解,下面以几个具体的迭代过程为例,对本申请提供的图像处理方法的流程进行示例性说明。
示例性地,以一帧事件图像为例,参阅图42,本申请提供的另一种图像处理方法的流程示意图,如下所述。
首先,可以获取DVS采集到的数据4204,并基于DVS采集到的数据初始化事件图像4202,得到初始的事件图像。通常,事件图像的表示可以用极性(b=-1或+1)信息,如1表示某个像素点存在事件,-1表示某个像素点不存在事件,也可以只对事件进行计数(b=0或1),如1表示某个像素点存在事件,0表示某个像素点不存在事件等。
若当前次为第一次迭代,则运动参数4201可以是初始化的参数,如初始化为0或者预设值,或者,还可以根据IMU采集到的数据来初始化该运动参数,例如,可以将IMU采集到的加速度或者速度作为初始化的运动参数。此外,在后续的迭代过程中,该运动参数可以是上一次迭代得到的运动参数,也可以是基于运动传感器(如DVS、IMU、加速度计或者陀螺仪等)采集到的数据得到的运动参数,还可以是结合上一次迭代得到的运动参数和运动传感器(如DVS、IMU、加速度计或者陀螺仪等)采集到的数据得到的运动参数进行加权运算,得到当前次迭代所使用的运动参数。
在得到运动参数4201之后,使用该运动参数对事件图像4202进行补偿,得到补偿后的事件图像。例如,在确定运动参数θ之后,对事件图像中每个事件的位置进行补偿,如x′ k=x k-(t k-t ref)·θ,x′ k即为对x k进行补偿后的位置,每个位置上的变换后的事件累积起来即可形成更新后的事件图像:
Figure PCTCN2020141973-appb-000049
在使用运动参数4201对事件图像进行补偿之后,使用补偿后的事件图像来最大化对比 度,如
Figure PCTCN2020141973-appb-000050
通过最优化算法计算最大化F(x,θ)的θ值θ=arg minF(x,θ),实现对运动参数的更新。
在对事件图像的迭代次数达到预设次数,或者对事件图像的迭代时长达到预设时长,或者最大化对比度的值的变化值不超过预设变化值等,则可以终止对事件图像的迭代更新,输出最终的事件图像。
因此,在本申请实施方式中,可以使用上一次迭代得到的最大化的对比度,来反推运动参数,从而使下一次对事件图像进行更新时,可以使用该运动参数来补偿事件图像,从而可以快速得到更新后的事件图像,在保障更新效率的同时,可以得到质量更优的事件图像。
前述以对一帧事件图像进行更新为例进行了示例性说明,下面以对多帧事件图像进行更新为例进行示例性说明。
示例性地,如图43所示,以3帧事件图像(如图43中所示出的事件图像1、事件图像2和事件图像3)的迭代更新过程为例。其中,该三帧事件图像可以是基于DVS在不同时段采集到的数据生成。例如,可以累积时间段[t0,t1]内采集到的事件,得到事件图像1;累积时间段[t1,t2]内采集到的事件,得到事件图像2;累积时间段[t2,t3]内采集到的事件,得到事件图像3等。
在迭代更新1的过程中,若当前次迭代为第一次迭代,运动参数θ 1可以是基于运动传感器采集到的数据来进行初始化得到,也可以是初始化为预先设置的值等。例如,运动参数θ 1可以是从IMU采集到的数据中提取到的,如IMU可以采集到本身的加速度、角速度或者速度等,则可以直接从IMU本身的加速度、角速度或者速度等中选择一个或多个作为运动参数θ 1。又例如,可以提前设置运动参数初始化的值为0或者其他值等。
在对事件图像1的更新过程中,可以使用运动参数θ 1对事件图像1进行补偿,得到补偿后的事件图像,然后基于补偿后的事件图像,以及优化算法计算最大化对比度,并使用最大化对比度来更新运动参数θ 1
对事件图像1-事件图像3的迭代更新的具体过程与前述图42的更新过程类似,此处不再赘述。
在终止对事件图像1的迭代更新之后,还可以使用最终迭代得到的对比度来初始化运动参数θ 1对运动参数θ 2,在终止对事件图像2的迭代更新之后,还可以使用最终迭代得到的对比度来初始化运动参数θ 2对运动参数θ 3
在一种可能的实施方式中,除了可以在每一帧事件图像更新完成之后再更新下一阵事件图像,还可以是一次循环更新每一帧事件图像,从而实现对多帧事件图像的更新。
因此,在本申请实施方式中,在实现对一帧事件图像的更新之后,可以基于对该事件图像进行更新更新得到的运动参数,对更新下一帧事件图像时使用的运动参数进行初始化,从而使每次更新事件图像时,可以使用已有的运动参数来进行更新,从而实现对事件图像的高效更新。
过程三、使用运动参数初始化优化模型,并进行迭代更新
前述对初始化运动参数和对事件图像进行迭代更新的过程分别进行了说明,在一些场 景中,本申请提供的图像处理方法中初始化运动参数和对事件图像进行迭代更新的过程可以结合起来实施,下面对结合起来实施的方法进行说明。
示例性地,在一些场景中,如同一个终端设备可以包括多种运动传感器,例如,终端设备可以同时包括DVS和IMU,事件图像可以由DVS采集到的数据生成,可以使用IMU采集到的数据来初始化运动参数,然后基于该初始化的运动参数来对事件图像进行迭代更新。
下面以基于IMU获取到的数据来初始化运动参数为例进行示例性说明,在一些场景中,初始的运动参数还可以基于其他传感器采集到的数据来确定,如加速度计、陀螺仪、重力传感器、DVS等。参阅图44,本申请提供的另一种图像处理方法的流程示意图。
4401、获取IMU采集到的数据。
其中,IMU可以用于测量自身的三轴角速度以及加速度,在IMU采集到的数据中,可以包括IMU的角速度ω或加速度α等。
例如,在一种场景中,用户可以通过手机来进行拍摄,该手机中除了RGB摄像头(或者称为RGB传感器),还可以包括DVS和IMU,可以使用DVS采集到的数据,对RGB摄像头的拍摄提供其他辅助功能,如对焦或者对RGB摄像头拍摄到的RGB图像进行补偿等。在用户使用手机进行拍摄的同时,IMU可以同时检测自身的运动变化情况,如角速度或者加速度等。
4402、初始化运动参数。
其中,该运动参数可以是从IMU采集到的数据中选取得到。例如,在IMU采集到的数据中,可以包括IMU的角速度ω或加速度α等。可以从角速度ω或加速度α等中选择一项或者多项作为运动参数。
4403、获取目标任务,根据目标任务确定迭代时长。
4404、获取运动信息。
4405、根据运动信息生成至少一帧事件图像。
其中,步骤4403-4405可以参阅前述步骤4001-4003中的描述,此处不再赘述。
4406、根据运动参数对事件图像进行更新,得到更新后的事件图像。
其中,步骤4406可以参阅前述步骤4005中的描述,此处不再赘述。
4407、是否达到迭代时长,若是,则执行步骤4409,若否,则执行步骤4408。
其中,在完成当前次对事件图像的更新之后,若对事件图像的迭代时长达到预先设置的迭代时长,则可以终止对该事件图像的迭代更新,输出最终的事件图像。
此外,若需要对多帧事件图像进行迭代更新,则在每次对事件图像进行更新之后,都可以判断是否达到预先设置的迭代时长,在完成对所有的事件图像进行更新之后,即可输出更新后的至少一帧事件图像。
4408、更新运动参数。
若未完成对事件图像的迭代更新,则在每一次更新完成之后,可以将更新后的事件作为优化模型的输入,使用预先设置的优化算法,计算优化模型的最优值,并根据该最优值更新运动参数。
需要说明的是,若当前次迭代为对至少一帧事件图像的最后一次迭代更新,则可以执 行步骤4408,也可以不执行步骤4408,具体可以根据实际应用场景进行调整。
在一种可能的实施方式中,除了使用优化模型的最优值来更新运动参数,还可以结合IMU采集到的数据,得到更准确的运动参数。例如,以下将使用优化模型的最优值反推得到的运动参数称为运动参数1,对使用IMU持续获取运动参数称为运动参数2,在得到运动参数1和运动参数2之后,可以对运动参数1和运动参数2进行加权运算,得到最终的运动参数,又或者,可以从运动参数1和运动参数2中选择其中一个作为最终的运动参数等,具体可以根据实际应用场景来进行调整。
例如,本申请可以应用于运动摄影的场景,以运动参数为相机的运动速度为例,运动参数1可以通过优化模型的最优值计算得到v1=arg minF(v1,x),运动参数2可以是从IMU采集到的数据中选择的v2,则在对事件图像进行一次迭代之后,将运动参数更新为:θ=ω1*v1+ω2*v2,ω1是运动参数1的权重值,ω2是运动参数2的权重值。当然,也可以从v1和v2中选择其中一个作为新的运动参数。
具体地,更新运动参数的具体过程可以参阅前述步骤4004中的相关描述,此处不再赘述。
此外,在确定终止对事件图像的迭代更新之后,可以执行步骤4408,即更新运动参数,也可以不执行步骤4408,即不更新运动参数,具体可以根据实际应用场景进行调整。
4409、输出更新后的至少一帧事件图像。
在完成对至少一帧事件图像中的所有事件图像的迭代更新之后,即可输出最终的更新后的至少一帧事件图像。
具体地,步骤4409可以参阅前述步骤4007中的相关描述,此处不再赘述。
因此,在本申请实施方式中,可以使用运动传感器,如IMU、加速度计或者陀螺仪等采集到的数据来初始化运动参数,从而使后续可以基于该运动参数来对事件图像进行更新,相当于提供了对事件图像进行更新时更高的起点,从而可以高效地得到更新后的事件图像。在更新过程中,可以根据目标任务来确定迭代时长,从而可以根据实际应用场景,在线对事件图像进行更新,符合更多的应用场景,泛化能力强。此外,在对多帧事件图像进行更新的过程中,更新下一帧事件图像是可以复用更新前一帧事件图像时得到的运动参数,从而可以使用更准确的运动参数来对事件图像进行更新,高效地得到更清晰的事件图像。
前述对本申请提供的通过运动补偿的方式对事件图像进行优化的方法流程进行了详细说明,下面对本申请提供一种图像处理装置的结构进行介绍,该图像处理装置用于执行前述过程一、过程二或者过程三中的步骤。
首先,本申请提供一种图像处理装置,参阅图112,用于执行前述过程二或者过程三中的步骤,该图像处理装置可以包括:
获取模块11201,用于获取运动信息,所述运动信息包括目标对象在运动传感器11203的检测范围内进行运动时的运动轨迹的信息;
处理模块11202,用于根据所述运动信息生成至少一帧事件图像,所述至少一帧事件图像为表示所述目标对象在所述检测范围内产生运动时的运动轨迹的图像;
所述获取模块11201,还用于获取目标任务,并根据所述目标任务获取迭代时长;
所述处理模块11202,还用于对所述至少一帧事件图像进行迭代更新,得到更新后的至少一帧事件图像,且对所述至少一帧事件图像进行迭代更新的时长不超过所述迭代时长。
在一种可能的实施方式中,所述处理模块11202,具体用于:获取运动参数,所述运动参数表示所述运动传感器与所述目标对象之间的相对运动的参数;根据所述运动参数对所述至少一帧事件图像中的其中一帧目标事件图像(如称为目标事件图像)进行迭代更新,得到更新后的目标事件图像。
在一种可能的实施方式中,所述处理模块11202,具体用于:获取上一次迭代更新过程中预设的优化模型的值;根据所述优化模型的值计算得到所述运动参数。
在一种可能的实施方式中,所述处理模块11202,具体用于:根据所述运动参数对所述目标事件图像中所述目标对象的运动轨迹进行补偿,得到当前次迭代更新得到的目标事件图像。
在一种可能的实施方式中,所述运动参数包括以下一项或者多项:深度、光流信息、所述运动传感器进行运动的加速度或所述运动传感器进行运动的角速度,所述深度表示所述运动传感器和所述目标对象之间的距离,所述光流信息表示所述运动传感器和所述目标对象之间的相对运动的运动速度的信息。
在一种可能的实施方式中,所述处理模块11202,还用于在所述任意一次迭代更新过程中,若当前次迭代的结果满足预设条件,则终止迭代,所述终止条件包括以下至少一项:对所述至少一帧事件图像进行迭代更新的次数达到预设次数或者对所述至少一帧事件图像更新过程中优化模型的值变化小于预设值。
本申请还提供一种图像处理装置,参阅图113,该图像处理装置可以用于执行前述过程一或者过程三中的步骤,该图像处理装置包括:
处理模块11302,用于根据运动信息生成至少一帧事件图像,所述运动信息包括目标对象在运动传感器的检测范围内产生运动时的运动轨迹的信息,所述至少一帧事件图像为表示所述目标对象在所述检测范围内产生运动时的运动轨迹的图像;
获取模块11301,用于获取运动参数,所述运动参数表示所述运动传感器11303与所述目标对象之间的相对运动的参数;
所述处理模块11302,还用于根据所述运动参数对预设的优化模型的值进行初始化,得到优化模型的值;
所述处理模块11302,还用于根据所述优化模型的值更新所述至少一帧事件图像,得到更新后的所述至少一帧事件图像。
在一种可能的实施方式中,所述运动参数包括以下一项或者多项:深度、光流信息、所述运动传感器进行运动的加速度或所述运动传感器进行运动的角速度,所述深度表示所述运动传感器和所述目标对象之间的距离,所述光流信息表示所述运动传感器和所述目标对象之间的相对运动的运动速度的信息。
在一种可能的实施方式中,所述获取模块11302,具体用于:获取惯性测量单元IMU传感器采集到的数据;根据所述IMU传感器采集到的数据计算得到所述运动参数。
在一种可能的实施方式中,所述处理模块11302,还用于所述根据所述运动参数对预 设的优化模型的值进行初始化之后,根据所述优化模型的值更新所述IMU传感器的参数,所述IMU传感器的参数用于所述IMU传感器采集数据。
(2)图像重建
前述对通过运动参数来补偿优化事件图像的方式进行了介绍,为针对事件图像进行优化的方式,在另一种可能的实施方式中,还可以结合运动传感器采集到的数据,来重建RGB图像,以便于后续可以使用重建得到的RGB图像来进行进一步应用,如车牌识别、二维码识别或路牌识别等。
通常,在图像重建的过程中,可以使用神经网络来输出重建后的图像。然而,随着图像的复杂度越高,计算的复杂度也就越高。例如,当二维码的维度越高,计算复杂度也就越大,重建图像的效率也就越低。因此,本申请提供一种图像处理的方法,对运动传感器采集到的信息来进行图像重建,高效准确地得到重建图像。
首先,本申请提供的图像处理的方法的具体流程可以包括:获取运动信息,运动信息包括目标对象在运动传感器的检测范围内进行运动时的运动轨迹的信息;根据运动信息生成事件图像,事件图像为表示目标对象在检测范围内运动时的运动轨迹的图像;根据事件图像中包括的至少一个事件,确定与事件图像中每个像素点对应的颜色类型,得到第一重建图像,其中,第一像素点与至少一个第二像素点的颜色类型不相同,第一像素点是第一重建图像中至少一个中任意一个事件对应的像素点,至少一个第二像素点包括于第一重建图像中与第一像素点相邻的多个像素点中。因此,在本申请实施方式中,可以使用运功传感器采集到的信息来进行图像重建,得到重建后的图像,后续可以使用重建后的图像来进行图像识别、目标检测等。
具体地,事件图像可以是一段时间内或N个事件在事件对应位置(或沿着运动轨迹补偿修正后的位置)上累计得到的图像,通常该图像中无事件产生的位置的值为0。
在一些目标对象运动或者摄像装置存在抖动等场景中,可以使用运动传感器,如DVS采集到的信息来进行图像重建,从而可以根据重建后的图像来进行后续的图像识别或者目标检测等操作。
例如,在一些车库的车牌识别场景中,当车辆驶入车库入口时,设置在入口的车牌识别系统,即可通过RGB摄像头来拍摄车牌,随后从拍摄到的图像中识别出车牌号。通常,因车辆运动可能拍摄到的RGB图像不清晰,导致车牌识别效率低下。以车牌识别系统中设置的运动传感器为DVS为例,本申请提供的图像处理的方法,车牌识别系统可以通过DVS采集到的信息来进行图像重建,快速地重建出车牌的图像,从而提高车牌识别的效率。
又例如,在一些二维码识别的场景中,可能因用户手持终端存在抖动或者二维码不固定等情况,导致拍摄到的二维码图像不清晰,无法识别出二维码,或者在大光比的场景下,如在夜晚黑暗环境下打开摄像头扫描二维码,终端上的闪光灯将导致二维码过曝,从而导致无法识别出二维码。以终端中设置的运动传感器为DVS为例,本申请实施方式中,终端可以使用DVS采集到的信息来快速进行图像重建,得到重建后的二维码图像,从而实现二维码的高效识别。
下面对本申请提供的图像处理的方法进行详细介绍。
参阅图45,本申请提供的另一种图像处理的方法的流程示意图。
4501、获取运动信息。
可以通过运动传感器对目标对象在运动传感器的检测范围内的运动情况进行监测,得到检测范围内的目标对象的运动信息。其中,目标对象是检测范围内运动的物体,目标对象的数量可以是一个或者多个,该运动信息可以包括目标对象在检测范围内进行运动时的运动轨迹的信息。
需要说明的是,本申请实施例中所提及的运动中的物体或者对象,为与运动传感器之间存在相对运动的物体或者对象,可以理解为本申请所提及的运动是相对于运动传感器而言存在的运动。
例如,该运动信息中可以包括目标对象在检测范围内进行运动时,目标对象所在的区域的大小、边框或者角点在检测范围内的坐标等信息。
为便于理解,以下将目标对象在检测范围内进行运动时,目标对象在检测到的每一时刻中所在的区域称为目标对象的运动区域。该运动区域例如,若目标对象为行人,且行人正在进行全身运动,则运动区域内可以包括行人的全身,若行人仅手臂运动,则目标对象可以仅仅是行人的手臂,运动区域可以包括行人的手臂部分。
4502、根据运动信息生成事件图像。
其中,在得到运动信息之后,可以运动传感器在检测范围内所采集到的信息生成至少一帧事件图像。通常,运动信息中可以包括一段时长内目标对象在检测范围内运动的轨迹的信息,因此生成检测范围对应的图像,并将运动信息所包括的目标对象的轨迹映射至图像中,得到事件图像。
例如,该事件图像可以参阅前述图35-37及其相关介绍。或者,该事件图像还可以是通过前述的运动补偿的方式进行优化后得到的图像。
在一种可能的实施方式中,本申请提供的方法还可以包括:根据目标对象与运动传感器之间进行相对运动时的运动参数,对事件图像进行补偿,得到补偿后的事件图像。运动参数表示传感器和目标对象之间的相对运动的相关参数,如运动参数包括以下一项或者多项:深度、光流信息、运动传感器进行运动的加速度或运动传感器进行运动的角速度,深度表示运动传感器和目标对象之间的距离,光流信息表示运动传感器和目标对象之间的相对运动的运动速度的信息。因此,在本申请实施方式中,可以通过运动参数来对事件图像进行补偿,得到更清晰的事件图像,从而使后续进行图像重建时,可以得到更清晰的重建图像。
例如,以目标对象的运动轨迹为匀速直线运动,运动传感器为DVS为例,时间窗口[t,t+Δt]内t k时刻DVS捕获位置为x k,目标对象的运动轨迹可以被划分为多段直线运动,以θ(即运动参数)表示事件图像中目标对象的运动速度,则事件图像中在对目标对象进行运动补偿后的位置x k′为:x′ k=x k-(t k-t ref)·θ,对事件图像的所有事件进行运动补偿之后,即可得到补偿后的事件图像。
在一种可能的实施方式中,该运动参数可以是根据IMU采集到的数据中提取到的,也可以是基于运动传感器,如DVS采集到的数据计算得到等。
例如,若运动参数不仅包括运动传感器自身相关的参数,还包括目标对象的运动速度、运动方向或运动加速度等,则可以通过运动传感器采集到的信息计算得到运动参数。
又例如,若运动参数包括了运动传感器自身的相关参数,如光流信息、运动传感器的加速度、运动传感器的角速度或者深度等,则可以通过运动传感器采集到的信息或者IMU、陀螺仪或者加速度计等,得到运动传感器自身的相关参数。
例如,以从IMU采集到的数据中获取运动参数为例,在IMU采集到的数据中,可以包括IMU的角速度ω或加速度α等。可以从角速度ω或加速度α等中选择一项或者多项作为运动参数。
可选地,该事件图像还可以通过前述图38-图44对应的方法来进行优化,从而得到更清晰的事件图像,具体可以参阅前述图38-图44的相关介绍,此处不再赘述。
4503、根据事件图像中包括的至少一个事件,从预设的颜色池中确定与事件图像中每个像素点对应的颜色类型,得到第一重建图像。
其中,该事件图像可以是前述的至少一帧图像中的任意一帧图像,也可以是从该至少一帧图像中选择的其中一帧图像。例如,可以将DVS在一段时间内采集到的信息转换为多帧事件图像,可以从该多帧事件图像中任意选择一帧事件图像来进行颜色重建,得到一帧重建图像;也可以是从该多帧事件图像中选择其中一帧(如第一帧、第五帧或者最后一帧等)来进行颜色重建,得到一帧重建图像;或者,还可以对从该多帧事件图像中选择多帧事件图像或者全部事件图像来进行颜色重建,得到多帧重建图像,其中,针对每一帧事件图像进行颜色重建的过程类似。
其中,该颜色池为可选的,即可以不使用颜色池来确定像素点的颜色类型。例如,在扫描事件图像时,默认起始颜色类型为白色,当下一个像素点扫描到事件时,默认下一个像素点为黑色,即仅使用默认的颜色类型即可,无需从颜色池中选择。在本申请实施例中,为便于理解,示例性地以从颜色池中选择了颜色类型为例进行示例性说明,并不作为限定。如在实际应用场景中,可以根据实际需求确定设置颜色池或者默认像素点的颜色类型为固定的颜色类型等。
示例性地,为便于理解,本申请以针对其中一帧事件图像来进行重建得到重建图像的过程为例进行示例性说明。
其中,可以根据事件图像中所包括的事件的位置,来从预设的颜色池中确定每个事件对应的像素点对应的颜色类型和与事件相邻的像素点对应的颜色类型,从而得到第一重建图像。具体地,以其中一个具有事件的像素点为例,以下将该像素点称为第一像素点,与第一像素点相邻的至少一个像素点中,至少有一个像素点对应的颜色类型与该第一像素点的颜色类型不相同,以下将与第一像素点相邻且与第一像素点对应的颜色类型不同的像素点称为第二像素点,若事件图像中某一区域为连续的不具有事件的像素点,则该区域内的像素点对应的颜色类型都相同或者光照强度的变化较小,如小于阈值。
具体地,得到第一重建图像的具体方式可以包括:可以按照第一方向扫描事件图像中每个像素点,从预设的颜色池中确定与事件图像中每个像素点对应的颜色类型,得到第一重建图像,其中,若在第一像素点扫描到具有事件,则确定第一像素点的颜色类型为第一 颜色类型,按照第一方向排列在第一像素点之前的第二像素点不具有事件,第二像素点对应的颜色类型为第二颜色类型,第一颜色类型和第二颜色类型是颜色池中包括的两种颜色类型。
例如,颜色池中可以包括颜色类型1和颜色类型2,可以按照逐行或者逐列的方式扫描事件图像中的每个像素点,在未扫描到事件之前,为每个像素点重建颜色类型2,在扫描到某一个像素点存在事件时,即可为该像素点重建颜色类型1,若后续扫描到的一段连续的像素点不具有事件,则该段连续的像素点对应的颜色类型也为颜色类型1,在该连续的像素点之后,若再次扫描到具有事件的像素点,则可以为该像素点重建颜色类型2,并为后续扫描到的一段连续的像素点不具有事件重建颜色类型2,以此类推,从而得到重建后的重建图像。
在一种可能的实施方式中,若按照第一方向排列在第一像素点之后的连续多个第三像素点不具有事件,则该多个第三像素点对应的颜色类型与第一像素点的颜色类型相同,即该多个第三像素点对应的颜色类型为第一颜色类型。
示例性地,为便于理解,事件图像可以表示为如图46A所示,每个“□”代表像素点具有事件,如图46A中的S1-S5,“○”代表像素点不具有事件,在得到该事件图像之后,确定每个像素点对应的颜色类型。示例性地,得到的重建图像可以如图46B所示,其中,可以按照逐行的方式来扫描事件图像。在扫描第一行时,初始颜色可以设定为第二颜色类型,在扫描到具有事件(S1)时,改变颜色类型,将该像素点对应的颜色类型重建为第一颜色类型,若该像素点之后的连续多个像素点都不具有事件,则该段连续的像素点的颜色类型与第一个事件的颜色类型相同,都是第一颜色类型。在扫描第二行时,初始颜色类型也设置为第二颜色类型,当扫描到事件S2时,设置S2对应的像素点的颜色类型为第一颜色类型,S2之后的多个像素点因都不具有事件,该多个像素点的颜色类型都设置为第一颜色类型,第三行与第二行的重建方式类似,不再赘述。在扫描第四行时,初始颜色类型也设置为第二颜色类型,在扫描到第一个事件S4时,将S4所在的像素点的颜色类型设置为第一颜色类型,S4和S5之间的像素点的颜色类型也为第一颜色类型。在扫描到S5之后,改变重建的颜色类型为第二颜色类型,S5对应的像素点的颜色类型为第二颜色类型,S5之后的像素点也为第二颜色类型。在扫描第五行时,因第五行不存在事件,即第五行的像素点的颜色类型都为第二颜色类型。
在一种可能的实施方式中,若按照第一方向排列在第一像素点之后且与第一像素点相邻的第四像素点具有事件,且按照第一方向排列在第四像素点之后且与第四像素点相邻的第五像素点不具有事件,则第四像素点和第五像素点对应的颜色类型都为第一颜色类型。可以理解为,当事件图像中存在至少两个连续的像素点都具有事件时,在扫描到第二个事件时,可以不改变重建颜色类型,从而避免因目标对象的边缘过宽而导致的重建图像边缘不清晰。
示例性地,存在两个连续的像素点都具有事件的事件图像可以如图47A所示,图47A与前述图46A所示的事件图像类似,对于类似之处此处不再赘述。一些区别在于,在图47A的第一行中,具有连续两个具有事件的像素点S1和S2,扫描该事件图像后得到的重建图 像可以如图47B所示,在第一行中,以第二颜色类型作为初始颜色类型对事件图像进行扫描,在扫描到事件S1时,改变重建颜色类型为第一颜色类型,在扫描到事件S2时,因S2与S1相邻,此时可以不改变重建颜色类型,即S2对应的颜色类型也为第一颜色类型,从而避免出现边缘夹层的现象,提高重建图像的准确度。
在一种可能的实施方式中,对事件图像进行扫描的方向可以是预先设定的,也可以是根据运动传感器采集到的信息来确定的。
例如,可以预先设定按照事件图像的行或者列来进行扫描。
又例如,若使用终端对二维码进行拍摄,终端内设置有DVS和IMU,则在拍摄二维码时,DVS采集到的运动信息可以用于生成事件图像,可以使用IMU来确定终端的移动方向,然后将该移动方向设置为对事件图像进行扫描的方向。
又例如,终端内设置有DVS,在拍摄二维码时,DVS采集到的运动信息可以用于生成事件图像,其次,还可以根据DVS采集到的信息,来计算终端的运动方向,然后将该运动方向设置为对事件图像进行扫描的方向。或者,也可以根据RGB摄像头拍摄到的信息,来识别终端的移动方向,从而将该移动方向设置为对事件图像进行扫描的方向。
又例如,若使用车牌识别系统来识别车牌,需要拍摄车牌的图像。可以通过DVS采集到的信息来生成事件图像,还可以通过DVS采集到的信息来计算车辆的移动方向,从而将该移动方向设置为对事件图像进行扫描的方向。或者,还可以通过RGB摄像头拍摄到的信息,来识别终端的移动方向,并将该移动方向设置为对事件图像进行扫描的方向。
在一种可能的实施方式中,颜色池中包括的颜色种类可以是在基于事件图像进行重建之前设定的,设定的方式可以包括多种,例如,可以是预先设定默认的两种或者两种以上颜色类型(如黑色和白色),还可以是得到RGB摄像头拍摄到的RGB图像之后,生成RGB图像的颜色直方图,从该直方图中选择占比最大的两种或两种以上的颜色类型加入颜色池中,或者还可以是接收用户的输入数据,从输入数据中确定颜色类型并加入颜色池等。
在一种可能的实施方式中,在得到事件图像之后,还可以结合RGB摄像头采集到的RGB图像来进行融合,从而得到更清晰的图像,以便于后续进行识别或者分类等任务。
具体地,可以将事件图像和RGB图像分为多个区域,且事件图像中划分的多个区域和RGB图像中的多个区域的位置相同,然后衡量RGB图像中每个区域的模糊程度(如使用方差、拉普拉斯变换等来进行衡量),在确定某一个区域的模糊程度低于预设模糊程度时,基于事件图像中与该区域对应的区域来进行图像重建,重建过程可以参阅步骤4503中的重建过程,得到该区域内的重建图像,然后将该区域内的重建图像与RGB图像进行拼接,如将RGB图像中模糊程度低于预设模糊程度的区域替换为该区域内的重建图像,从而得到最终的重建图像。例如,可以对RGB图像中质量较差的部分进行补偿重建,而对于质量较好的部分则保持不变。具体例如,对于产生存在高光部分的二维码,对高光部分可以进行重建,而对不存在高光的部分则可以保持不变。
可以理解为,在进行图像重建时,可以仅重建事件图像中的某一个区域,而无需对事件图像完整地进行重建,并将该区域内的重建图像与RGB图像进行融合,得到新的重建图像,即新的第一重建图像,从而减少了需要进行图像重建的区域大小,进一步提高得到重 建图像的效率。
其中,在扫描得到第一重建图像之后,还可以对该第一重建图像进行其他操作,如下步骤4504-4506所示。可以理解为,本申请实施例中的步骤4504-4506为可选步骤,可以继续执行步骤4504-4506中的任意步骤,也可以不执行步骤4504-4506,具体可以根据实际应用场景进行调整,本申请对此不作限定。
4504、按照不同方向对事件图像进行多次扫描,得到多帧重建图像,融合多帧重建图像,得到更新后的第一重建图像。
需要说明的是,本申请实施例中的步骤4504为可选步骤,具体可以根据实际应用场景来确定是否需要进行多次扫描,本申请对此并不作限定。例如,以二维码识别的场景为例,若重建出一帧包括二维码的重建图像之后,无法识别出该二维码,则可以按照不同的方向对事件图像进行多次扫描,从而得到更新后的重建图像。
在一种可能的实施方式中,可以对同一帧事件图像按照多个不同的方向来进行扫描并重建,得到多帧重建图像,然后可以融合该多帧重建图像,输出最终的更准确的重建图像。
具体地,融合多帧重建图像的方式可以有多种方式,示例性地。可以以该多帧重建图像中的每个像素点为单位进行融合,以其中一个像素点为例,若每帧重建图像中该像素点的值都相同,则将该相同的值作为最终的重建图像中该像素点的值。若每帧重建图像中该像素点的值不相同,则可以对该像素点在每帧重建图像中的值进行加权融合,得到该像素点在最终的重建图像中的值,或者,通过投票法来确定该像素点的值,例如,若在4帧重建图像中相同位置的像素点的值分别为1,1,1,0,1的数量大于0的数量,则确定最终的重建图像中该相同位置的像素点的值为1。
4505、判断第一重建图像是否满足预设条件,若是,则执行步骤4506,若否,则执行步骤4501。
在本申请实施例提供的方法中,还可以判断第一重建图像是否符合预设要求,若该第一重建图像不符合预设要求,还可以重新获取运动信息,并根据新的运动信息来获取新的事件图像,进而得到新的重建图像。该预设要求可以包括但不限于:该重建图像的清晰程度未达到预设值,或者未识别出该重建图像中所包括的信息,或者重建图像中识别出的结果的准确率低于阈值等。
例如,在使用终端扫描二维码的过程中,终端通过DVS采集到的信息生成一帧事件图像,并根据该事件图像进行图像重建,得到一帧重建图像,若对该重建图像进行识别,而未识别出二维码,则可以重新获取DVS采集到的信息,并得到新的事件图像,进而得到新的重建图像,以此类推,直到识别出二维码。
4506、其他处理。
在得到符合预设要求的第一重建图像之后,即可对该第一重建图像进行其他处理,如识别该第一重建图像中所包括的信息,或者保存该第一重建图像等,在不同的场景中,对第一重建图像进行处理的方式也可能不相同,具体可以根据实际应用场景来进行调整。
因此,在本申请实施方式中,可以使用运动传感器采集到的信息来进行图像重建,高效快速地得到重建图像,从而提高后续对重建图像进行图像识别、图像分类等的效率。即 使在一些拍摄运动物体或者存在拍摄抖动等场景中,拍摄不到清晰的RGB图像,也可以通过对运动传感器采集到的信息来进行图像重建,可以快速准确地重建出更清晰的图像,以便于进行后续的识别或者分类等任务。
前述对本申请提供的图像处理的方法的流程进行了详细说明。为便于理解,下面结合前述的流程,以具体的应用场景为例对本申请提供的图像处理的方法进行更详细的说明。
参阅图48,本申请提供的另一种图像处理的方法的流程示意图,如下所述。
首先,获取事件图像4801。
可以是通过DVS采集到的数据得到,将DVS的数据累计成帧,具体成帧的方式可以采用按时间累计、按事件数量累计或时间面累计的方式,得到事件图像。
通常,拍摄的对象可以是具有两种或者两种以上颜色的对象,如二维码、小程序码、条形码、车牌、路牌等等,DVS可以对亮度变化的区域产生响应,以拍摄对象为双色为例,产生亮度变化的只是对象的边缘,从而可以利用DVS的特性和双色对象的特性,得到边缘更清晰的事件图像。
预处理4802,可以对事件图像进行去噪或者运动补偿等操作。去噪的目标是去除与目标对象边缘无关的噪声,去噪的方式可以包括多种,如邻域去噪、点云去噪等方式。运动补偿可以使用运动参数来对事件图像进行补偿,运动参数可以包括DVS的运动速度、角速度、加速度等,还可以包括目标对象的运动速度或加速度等参数。运动补偿可以使目标对象在事件图像中的边界更清晰,并结合时间上的事件对边缘进行补偿,从而得到更清晰更准确的事件图像。
图像重建4803,即基于预处理4802得到的事件图像进行图像重建,得到重建后的双色图像。
为便于理解,本申请实施例以重建图像为具有两种颜色的双色图像为例进行示例性说明,并不作为限定,双色图像重建4803可以参阅图49所示的重建过程。
首先,初始化两种颜色4901。
其中,以颜色池中包括两种颜色类型为例,进行初始化两种颜色4901,即初始化进行图像重建时所使用的颜色类型。该两种颜色是双色图像中的颜色。这两种颜色的得来可以通过多种方式。如:默认为黑白图像;识别双色图像的类型判断颜色,例如条形码,则默认有黑白颜色组成;从其他传感器(sensor)中得到,如调用RGB摄像头采集图像,从DVS双色图像的区域确定双色图像在RGB图像中的区域,然后统计区域中主要的两种颜色(直方图的方法等),将这两种颜色作为初始颜色池。例如,在扫描二维码的场景中,可以初始化两种颜色类型为黑色和白色,以在后续进行图像重建时,可以重建出具有白色和黑色的包括了二维码的图像。又例如,在扫描车牌的场景中,可以从RGB图像所包括的车牌的区域的直方图中选择两种颜色,若车牌为蓝底白字,则可以初始化两种颜色类型为蓝色和白色,若车牌为黄底黑字,则可以初始化两种颜色类型为黄色和黑色等,具体可以根据实际应用场景或需求进行调整,此处不作限定。
然后,扫描事件图像4902。可以按照目标对象运动的方向、DVS运动的方向、逐行或者逐列等方式对事件图像进行扫描,扫描每个像素点是否具有事件。
在扫描事件图像的过程中,可以判断扫描是否结束4903,若扫描结束,则执行步骤4907,若扫描未结束,则可以继续执行步骤4902-4906。
若扫描未结束,则可以判断当前像素点是否包括事件4904,若当前像素点包括事件,则可以改变颜色4905,即为当前像素点设置于上一像素点不相同的颜色类型,例如,若上一像素点对应的颜色为白色,则当前像素点对应的颜色为不相同的黑色。
若当前像素点不包括事件,则无需改变当前像素点对应的颜色类型,即当前像素点对应的颜色与上一像素点对应的颜色类型相同。例如,若上一个像素点对应的颜色类型为白色,这当前像素点对应得有颜色类型同样为白色。
在确定当前像素点对应的颜色类型之后,即可重建双色图像中当前像素点的颜色4906。例如,若当前像素点的颜色类型为白色,则在双色图像中设置该像素点的颜色类型为白色。
例如,在目标对象为二维码的场景中,在二维码重建区域对事件图像进行逐行扫描。在扫描每一行像素点的过程中,在没有扫描到event之前,则将扫描过的像素点的颜色重建为黑色。当扫描过程中第一次遇到event,则重建出白色。在后续的扫描中,当扫描到的像素有event事件且前面无event产生时或后续像素没有event产生时,则改变颜色,并将新的颜色放在像素位置上。如上一个像素点的颜色为白色,则将当前像素点的颜色改为黑色。
随后继续扫描事件图像,并重建双色图像中的像素点的颜色,即循环执行步骤4902-4906,直到事件图像扫描结束,即已扫描事件图像中的所有像素点,并对双色图像中所有像素点的颜色进行重建,得到双色图像。
在得到双色图像之后,还可以判断双色图像是否满足要求4907,若该双色图像满足要求,即可输出该双色图像4908。若该双色图像不满足要求,则可以选择改变扫描方向4909,然后重新扫描事件图像,即重复执行步骤4902-4907,直到得到满足要求的双色图像。
该要求可以是对双色图像的识别精度超过预设精度值,或者识别出双色图像所包括的信息,或者双色图像的模糊程度低于预设模糊程度,或者进行图像重建的次数超过预设次数等。例如,若重建的对象是二维码,则可以识别双色图像,若识别出二维码,并得到该二维码所包括的信息,则该双色图像即满足要求,可以终止图像重建的过程。
示例性地,以扫描二维码为例,基于DVS采集到的数据得到的事件图像可以如图50所示,可以逐行或者逐列对该事件图像中的每个像素点进行扫描,得到最终的双色图像,该双色图像如图51所示。
此外,在改变扫描方向,重新对事件图像进行扫描之后,可以得到新的双色图像,可以将新的双色图像和改变扫描方向之前得到的一帧或者多帧双色图像进行融合,从而得到融合后的双色图像。可以理解为,采用多次不同方向进行对事件图像进行扫描,完成了多次图像重建,然后将不同方向的重建图像进行融合。融合方式可以例如像素上投票法,获得最终的双色图像。
因此,本申请实施方式中,可以快速进行双色图像进行重建。上述实施例重复利用双色图像和DVS触发的机制,可以采用简单地扫描图像的方式实现快速重建。并且算法的复杂度低,不依赖复杂的算法就可以实现。当双色图像和DVS传感器具有相对运动时,DVS 中的双色图像产生的事件(event)可以快速得到原有的彩色的双色图像,用于快速重建和检测识别。对于快速、高动态范围、低时延要求等场景和低计算能力的设备上可以得到较高的重建精度。充分利用了双色图像的特征和DVS event触发的机制,通过扫描图像就可以快速地对双色图像进行重建,有利于快速的识别和检测。可以在高动态范围的环境和运动较快的场景下,实现提高双色图像的识别精度。简单、低计算复杂度、更高的鲁棒性重建算法,可以提高双色图像识别的速度。
此外,还可以结合RGB摄像头采集到的RGB图像来进行图像重建。具体地,在得到RGB图像之后,确定需要进行图像重建的区域,然后从事件图像中确定对应的区域,随后对事件图像中该对应的区域进行扫描,重建出双色图像,重建过程与前述4901-4909类似,此处不再赘述。在得到该区域的双色图像之后,对该双色图像与RGB图像进行融合,如将RGB图像中的该区域替换为该双色图像,或者对该双色图像的像素值与RGB图像中该区域的像素值进行加权融合等,使最终得到的融合图像比RGB图像更清晰。
并且,需要注意的是,RGB摄像头与DVS可能存在视差,即RGB摄像头与DVS的视野范围可能不相同,则在进行图像重建之前,还可以对RGB图像和事件图像进行配准,如使用同一个坐标系来对齐RGB图像和事件图像,使RGB图像和事件处于同一坐标系中。
具体例如,当RGB和DVS直接不存在视差时,可以直接对RGB图像中质量较差的区域进行重建,质量较好的区域直接使用。如RGB图像中的高光区域,双色图像在RGB图像中质量较差,难以区分。但是DVS具有较高的动态范围,可以区分边界。则高光部分可以使用本申请提供的快速扫描的重建方式来进行重建,非高光部分可以直接使用RGB的数据。衡量图像质量的方式,可以使用对比度,当对比度小于阈值,则认为是质量较差的区域。本申请实施例中,也可以采用两种RGB与DVS数据之间的差异进行区分原RGB图像质量的高低。具体地,提取RGB图像的边缘信息,然后与事件图像进行对比。对比的方式包括逐像素差异等等,也可以将事件图像分块计算对比度,两种数据对比度差异较大的地方则是图像质量较差的地方,需要使用快速重建的方式进行重建,其他区域则采用RGB中的数据。
因此,本申请实施方式中,可以结合RGB图像来进行图像重建,通过DVS采集到的信息对RGB图像中质量较差的部分来进行重建,从而快速准确地得到清晰的图像,以便于后续高效地进行图像识别或者图像分类等任务。
本申请还提供一种图像处理装置,参阅图114,该图像处理装置可以用于执行前述图45-图51对应的方法流程的步骤,该图像处理装置可以包括:
获取模块11401,用于获取运动信息,所述运动信息包括目标对象在运动传感器11403的检测范围内进行运动时的运动轨迹的信息;
处理模块11402,用于根据所述运动信息生成事件图像,所述事件图像为表示所述目标对象在所述检测范围内运动时的运动轨迹的图像;
所述处理模块11402,还用于根据所述事件图像中包括的至少一个事件,得到第一重建图像,其中,第一像素点与至少一个第二像素点的颜色类型不相同,所述第一像素点是所述第一重建图像中所述至少一个中任意一个事件对应的像素点,所述至少一个第二像素点包括于所述第一重建图像中与所述第一像素点相邻的多个像素点中。
可选地,该图像处理装置还可以执行前述图38-图44对应的方法流程的步骤。
在一种可能的实施方式中,所述处理模块11402,具体用于按照第一方向扫描所述事件图像中每个像素点,确定与所述事件图像中每个像素点对应的颜色类型,得到第一重建图像,其中,若扫描到所述第一像素点具有事件,则确定所述第一像素点的颜色类型为第一颜色类型,且若按照所述第一方向排列在所述第一像素点之前的第二像素点不具有事件,则所述第二像素点对应的颜色类型为第二颜色类型,所述第一颜色类型和所述第二颜色类型是不同的颜色类型,具有事件的像素点表示由所述运动传感器监测到存在变化的位置在所述事件图像中对应的像素点。
在一种可能的实施方式中,所述第一方向是预先设置的方向、或者所述第一方向是根据IMU采集到的数据确定的方向,或者,所述第一方向是根据色彩RGB摄像头拍摄到的图像确定的方向。
在一种可能的实施方式中,若按照所述第一方向排列在所述第一像素点之后的连续多个第三像素点不具有事件,则所述多个第三像素点对应的颜色类型为所述第一颜色类型。
在一种可能的实施方式中,若按照所述第一方向排列在所述第一像素点之后且与所述第一像素点相邻的第四像素点具有事件,且按照所述第一方向排列在所述第四像素点之后且与所述第四像素点相邻的第五像素点不具有事件,则所述第四像素点和所述第五像素点对应的颜色类型都为所述第一颜色类型。
在一种可能的实施方式中,所述处理模块11402,还用于所述按照第一方向扫描所述事件图像中每个像素点,确定与所述事件图像中每个像素点对应的颜色类型,得到第一重建图像之后,按照第二方向扫描所述事件图像,确定与所述事件图像中每个像素点对应的颜色类型,得到第二重建图像,所述第二方向与所述第一方向不同;对所述第一重建图像和所述第二重建图像进行融合,得到更新后的所述第一重建图像。
在一种可能的实施方式中,所述处理模块11402,还用于若所述第一重建图像不符合预设要求,则更新运动信息,并根据更新后的运动信息更新事件图像,并根据更新后的事件图像得到更新后的第一重建图像。
在一种可能的实施方式中,所述处理模块11402,还用于在所述根据所述事件图像中包括的至少一个事件,确定与所述事件图像中每个像素点对应的颜色类型,得到第一重建图像之前,根据所述目标对象与所述运动传感器之间进行相对运动时的运动参数,对所述事件图像进行补偿,得到补偿后的所述事件图像,所述运动参数包括以下一项或者多项:深度、光流信息、所述运动传感器进行运动的加速度或所述运动传感器进行运动的角速度,所述深度表示所述运动传感器和所述目标对象之间的距离,所述光流信息表示所述运动传感器和所述目标对象之间的相对运动的运动速度的信息。
在一种可能的实施方式中,所述重建图像中的像素点的颜色类型,是根据色彩RGB摄像头采集到的颜色确定的。
在一种可能的实施方式中,所述处理模块11402,还用于:根据RGB摄像头采集到的数据得到RGB图像;对所述RGB图像与所述第一重建图像进行融合,得到更新后的所述第一重建图像。
3、应用流程
前述对图像优化的方法进行了详细介绍,在得到的优化后的RGB图像或者事件图像之后,即可使用优化后的事件图像来进行进一步应用。或者,在前述的数据采集和数据编解码部分可以采集到RGB图像或事件图像,后续即可使用采集到的RGB图像或者事件图像进行进一步应用,下面对RGB图像或事件图像的具体应用场景进行介绍。
其中,本申请提供的应用场景对应有多种方法流程,具体可以包括运动摄影增强、DVS图像和RGB图像融合、关键帧选择、SLAM或者位姿估计等场景,下面分别进行示例性说明。
(1)运动摄影增强
拍照是常用的功能,例如,终端可以设置或者连接有色彩(red green blue,RGB)摄像头,可以用户拍摄RGB图像。在一些场景中,可能对一些运动中的对象进行拍摄,或者在移动摄像头的场景下进行拍摄,还可能在一些光照强度差异较大的环境中拍摄。
通常,在摄像头拍摄到的RGB图像中,可以通过多个通道的信息来表示,每个通道通过有限的范围来表示,如0-255范围。而在实际应用场景中,可能存在最大光照强度和最小光照强度相差较大的场景,而0-255范围可能无法表示出实际场景中所呈现的不同光照强度,从而导致最终得到的RGB图像纹理不够丰富,在可视化界面中存在模糊等情况。或者,在实际应用场景中,可能出现镜头抖动或者拍摄范围内对象高速移动等情况,导致最终拍摄得到的RGB图像模糊,在可视化界面中呈现给用户的图像不清楚,降低用户体验。
在一些场景中,为了得到包括更多信息的图像,可以通过融合不同曝光时长的图像的方式,来获取到高动态范围图像(high dynamic range image,HDR),同时捕获到场景中亮部和暗部的纹理信息,提高最终得到的图像的清晰度。例如,可以拍摄短曝光时长、和长曝光时长两种图像,然后融合短曝光时长和长曝光时长对应的图像,得到HDR,HDR中包括了更丰富的信息,从而使最终在可视化界面中呈现给用户的图像也更清晰。在拍摄场景中,也可能出现最大光照强度和最小光照强度相差较大(以下简称为大光比)、镜头抖动或者拍摄范围内的对象高速运动等场景,导致最终得到的图像模糊,降低用户体验。
本申请提供的图像处理的方法,可以应用于各种场景,如摄影场景、监控场景等,用于拍摄到更清晰的图像或者使拍摄到的图像更清晰等。例如,在一种场景中,用户可以使用终端来进行拍摄,得到一张或者多张更清晰的图像,或者,在拍摄得到多张图像之后,将多张图像合并为一张更清晰的图像等。本申请提供的一种图像处理的方法,包括了多种实施方式,例如,实施方式一,可以是在进行拍摄的过程中,拍摄到一张或者多张图像,如结合运动传感器采集到的信息来拍摄运动中的对象,实施方式二,拍摄到多张图像,然后对多张图像进行合并,得到更高清的图像。其中,在实施方式二中,拍摄多张图像的过程,可以参考方式中拍摄图像的方式,即本申请提供的实施方式一和实施方式二可以单独实施,也可以结合起来实施,具体可以根据实际应用场景进行调整,本申请仅分别对实施方式一和实施方式二单独实施的方式进行说明,并不作为限定。
实施方式一具体例如,用户使用具有拍摄功能的手机来对具有运动对象的场景进行拍照,可以选择拍摄动态对象的模式,当用户点击拍摄按钮之后,即可结合DVS采集到的信息,自动完成对运动中的对象的对焦,并拍摄一张或者多张图像,从而拍摄到运动中的对象的 更清晰的图像。
实施方式二具体例如,在一些大光比或者运动场景中,用户可以使用具有拍摄功能的手机来进行拍摄,在用户点击拍摄按钮之后,手机可以自动设置不同的曝光时长,来拍摄到多张图像,并对拍摄到的多张图像进行融合,得到最终的HDR。其中,单独拍摄多张图像的方式也可以参阅实施方式一的拍摄方式,从而高效地拍摄到清晰的图像。
下面分别对实施方式一和实施方式二进行介绍,以下实施方式一和实施方式二可以单独实施,也可以合并起来实施,具体可以根据实际应用场景来进行调整。
实施方式一、拍摄范围内存在处于运动状态的对象时的图像处理方式
随着智能手机和数码相机等的飞速发展和广泛普及,用户对于摄影的需求也越来越强烈。而现有的手机或数码相机等虽然能够覆盖绝大多数场景的拍摄,然而对于运动的抓拍并不尽如人意,具体表现在用户需要较准确地把握拍摄的时机,刚好能够抓住运动的瞬间,同时运动区域的对焦以及曝光控制等操作技巧都影响着最终的成像效果。现有方案中,通常采用色彩(red green blue,RGB)摄像头进行拍摄,RGB摄像头对于运动瞬间的捕捉通常由用户手动触发摄影,用户需要在拍摄前选定一个区域进行对焦,然后在运动发生时选择一个合适的时机按下快门(或手机的拍摄按键)记录下该运动瞬间;具体的,需要根据用户的操作触发对焦、锁焦、按下快门、曝光、输出等一系列过程,最终输出一幅图像。然而,若由用户来触发对焦、锁焦等操作,则可能导致无法确定出最优的触发时间点,导致拍摄到的图像不清晰,降低用户体验。
因此,本申请提供一种图像处理方法,在运动场景中,通过捕获目标对象的进行运动时的运动轨迹,完成对运动的目标对象的对焦,提高得到的图像的清晰度。
需要说明的是,本申请所提及的拍摄范围内存在运动的对象的场景中,是指摄像头相对于拍摄范围内的对象之间存在相互运动的情况,实际应用场景中,可以是摄像头在运动,也可能是拍摄范围内的对象在运动,还可能是摄像头与拍摄范围内的对象同时在运动,具体可以根据实际应用场景调整,而针对摄像头来说,都可以理解为拍摄范围内的对象处于运动状态。
下面对本申请提供的图像处理的方法进行详细说明。参阅图52,本申请提供的一种图像处理方法的流程示意图,如下所述。
5201、检测目标对象的运动信息。
可以通过运动传感器对目标对象在预设范围内的运动情况进行监测,得到预设范围内的目标对象的运动信息。其中,目标对象是预设范围内运动的物体,目标对象的数量可以是一个或者多个,该运动信息可以包括目标对象在预设范围内进行运动时的运动轨迹的信息。
例如,该运动信息中可以包括目标对象在预设范围内进行运动时,目标对象所在的区域的大小、边框或者角点在预设范围内的坐标等信息。
为便于理解,以下将目标对象在预设范围内进行运动时,目标对象在检测到的每一时刻中所在的区域称为目标对象的运动区域。该运动区域例如,若目标对象为行人,且行人正在进行全身运动,则运动区域内可以包括行人的全身,若行人仅手臂运动,则目标对象 可以仅仅是行人的手臂,运动区域可以包括行人的手臂部分。
通常,该预设范围与摄像头的焦距或者视场角等相关,且通常不小于运动传感器的检测范围。例如,摄像头的视场角越大,拍摄到的范围的面积也越大,摄像头的视场角越小,拍摄到的范围的面积也越小。又例如,摄像头的焦距越大,拍摄的范围也就越大,也可以理解为拍摄到的距离远的对象更清晰,摄像头的焦距越小,拍摄到的范围也就越小。
本申请实施方式中,运动传感器监测到的范围包括摄像头的拍摄范围,预设范围可以是摄像头的拍摄范围,运动传感器所监测到的范围包括该预设范围,即运动传感器所监测到的范围可以大于或者等于该预设范围。
示例性地,该运动信息可以参阅前述图35-37的相关描述,此处不再赘述。
此外,该运动信息还可以包括从第1部分所提及的数据采集或数据编解码得到的数据或者数据流等。
5202、根据运动信息确定对焦信息。
在获取到目标对象在预设范围内的运动信息之后,根据该运动信息确定对焦信息。其中,该运动信息中包括目标对象的运动轨迹,即可以根据该运动轨迹确定对预设范围内的目标对象进行对焦的对焦信息。
可选地,确定对焦信息的方式有多种,下面分别进行详细说明。
方式一、通过预测区域得到对焦信息
为便于理解,在本申请以下实施方式中,将拍摄目标对象时对应的至少一个对焦点所在的区域称为对焦区域。
其中,对焦信息可以包括对焦区域中的至少一个点的位置信息,如对焦区域的边框或者角点在预设范围内的坐标等信息。确定该对焦区域的具体方式可以包括:根据运动信息对预设时长内目标对象的运动轨迹进行预测,以得到预测区域,然后根据预测区域确定对焦区域,该对焦区域包括对目标对象进行对焦的至少一个对焦点,对焦信息包括至少一个对焦点的位置信息。该预设时长可以是预先设定的时长,如10微秒,5微秒等。
可以理解的是,在一些场景中,由于运动已经发生,若只根据目标对象当前所在的区域和运动特性来触发RGB摄像头拍摄,则可能目标对象以已经进入下一位置或状态,此时拍摄的图像存在滞后。因此,需要对未来的预设时长内目标对象区域进行预测,对不完整的运动进行筛选,尤其对于运动对象刚进入镜头视野,或运动对象较远不利于拍摄等情况进行筛选,决策出最佳的拍摄时机,触发RGB摄像头进行工作。
在一种具体的实施方式中,可以根据前述步骤5201中得到的运动信息对未来的预设时长内目标对象的运动轨迹进行预测,具体可以根据目标对象的在预设范围内进行运动时的运动轨迹,以及运动方向和运动速度中的至少一个对未来的预设时长内目标对象的运动轨迹进行预测,得到预测区域。
在一种更具体的实施方式中,可以是根据监测到的运动对象目标对象在预设范围内进行运动时的运动轨迹,以及运动方向和/或运动速度,拟合出目标对象所在的区域的中心点随时间变化的变化函数,然后根据该变化函数计算出预测中心点,该预测中心点为预测区域的中心点,并根据该预测中心点确定预测区域。
示例性地,如图53所示,可以根据监测到的目标对象的运动轨迹,拟合出变化函数F(x c,y c,t),其中(x c,y c)为目标对象所在的区域的中心点,t为时间,从而可计算出下一个时间段内运动对象所在的区域位置。中心点(x c,y c)由所有事件的坐标位置(x i,y i)求均值得到,i=1,2,…n,n为短时窗口内的事件个数,n为正整数。具体的计算方式例如
Figure PCTCN2020141973-appb-000051
该变化函数可能是线性函数、也可能是指数型函数等等,具体可以根据实际应用场景进行调整,此处并不作限定。然后根据该变化函数预测目标对象在未来的运动轨迹,从该运动轨迹中选择一个点作为预测中心点,然后根据该预测中心点确定出预测区域,该预测区域的形状可以根据实际应用场景进行调整,例如,可以是外接矩形、外接最小圆、多边形、不规则形状等。
在一种可能的实施方式中,若预测区域符合预设条件,则根据预测区域确定对焦区域;若预测区域不符合预设条件,则重新根据运动信息对预设时长内目标对象的运动轨迹进行预测,得到新的预测区域,并根据新的预测区域确定对焦区域。该预设条件可以是预设区域中包括的目标对象为完整的形态,即预设区域中包括了完整的目标对象,或者预测区域的面积大于预设值,或者目标对象与摄像头的距离大于预设的距离阈值等。
通常,该预测中心点可以由运动传感器,如DAVIS或CeleX等传感器等进行预测,也可以是由电子设备的处理器来进行预测,然后当该预设区域满足预设条件时,即可根据触发电子设备的摄像模块根据对焦区域进行对焦。
在方式一中,可以通过拟合目标对象在预设范围内的运动轨迹,来对未来的预设时长内目标对象所在的区域进行预测,从而实现对焦区域的预测,使得后续拍摄到的图片更清晰。尤其在一些目标对象高速移动的场景中,可以通过对未来的预设时长内目标对象所在的区域的预测,从而实现对焦区域的预测,以使后续可以及时捕获到目标对象在运动状态下的更清晰的图像,提高用户体验。
方式二、直接根据目标对象的当前所在的区域确定对焦信息
其中,在得到目标对象在预设范围内进行运动时的运动轨迹之后,可以将目标对象当前所在的区域作为对焦区域,对焦区域包括对目标对象进行对焦的至少一个对焦点,对焦信息包括至少一个对焦点的位置信息。例如,若通过DVS监测到目标对象的当前所在的区域,且目标对象的运动速度小于速度阈值,即表示目标对象的运动速度较慢,对焦时间充足。因此,可以直接将目标对象当前所在的区域作为对焦区域,因此可以拍摄到清晰的图像。
获取目标对象当前所在的区域的方式可以参阅前述方式一,此处不再赘述。
在本方式二中,可以将目标对象的当前所在的区域,即目标对象当前所在的区域作为对焦区域,从而可以准确地对目标对象进行对焦。尤其在一些低速运动的场景中,对焦时间充足,仅通过当前所在的区域即可对焦,可以得到更清晰的图像。并且无需再进行预测,减少了工作量。
5203、根据对焦信息在预设范围中对目标对象进行对焦,并拍摄预设范围的图像。
其中,对焦信息可以包括对焦区域中的至少一个点的位置信息,在确定对焦区域之后, 根据该对焦区域对预设范围内的目标对象进行对焦,并拍摄预设范围内的图像。
具体地,该对焦区域可以与预测区域相同,也可以大于预测区域,具体可以根据实际应用场景进行调整。例如,在确定预测区域之后,可以直接将该预测区域作为对焦区域,也可以选择比预测区域更大的范围作为对焦区域,从而可以保障拍摄到的目标对象完整。在另一种场景中,如低速运动的场景,对焦区域可以是目标对象的当前所在的区域,则可以直接在当前所在的区域内进行对焦,即可拍摄到清晰的图像,减少了预测这一步骤的工作量。
在一种可能的实施方式中,可以通过摄像头进行图像拍摄,得到预设范围内的图像。如通过前述图1B中所示的摄像头193进行拍摄。该摄像头可以包括色彩(red green blue,RGB)传感器(也可以称为RGB摄像头),即由RGB摄像头进行拍摄。相应地,具体的对焦方式可以包括:将RGB摄像头的多个对焦点中,与对焦区域的中心点的范数距离最小的至少一个点作为对焦点进行对焦,从而完成对目标对象所在的区域或者预测的区域进行对焦,进而完成对目标对象的拍摄,得到RGB摄像头拍摄到的图像,以下可以将RGB拍摄到的图像称为RGB图像。当然,在一些场景中,可以直接将预测区域的中心点作为对焦点,从而完成对焦以及拍摄,得到RGB图像。
示例性地,如图54所示,RGB摄像头可以具有多个预先设定的对焦点,当预测出目标对象的预测区域,并根据该预测区域确定对焦区域之后,选取与该对焦区域的中心点的范数距离最近的一个或者多个点作为对焦点并进行对焦,从而完成对目标对象的拍摄。距离的计算方法可以包括但不限于L1范数距离或者L2范数距离,例如,L1范数距离的计算公式可以包括:|x 1-x 2|+|y 1-y 2|,L2范数距离的计算公式可以包括:
Figure PCTCN2020141973-appb-000052
其中,(x1,y1)为预测区域的中点,(x2,y2)为RGB摄像头的预先设定的对焦点。
在另一种可能的场景中,RGB摄像头也可以不预先设定对焦点,在确定对焦区域之后,直接将对焦区域的中心点作为对焦点,或者将对焦区域内的所有像素点作为对焦点,或者,选择对焦区域中的一个或者多个像素点作为对焦点等,具体可以根据实际应用场景进行调整。
在一种可能的实施方式中,在拍摄图像之前,还可以获取曝光参数,并根据该曝光参数拍摄图像。
该曝光参数可以包括但不限于曝光值(exposure value,EV)、曝光量、曝光时长、光圈大小或者感光度(international standardization organization,ISO)等。曝光时长可以理解为将光投射到摄像头的感光材料的感光面上,快门所要打开的时长。可以通过调整曝光时长,使摄像头的拍摄时长与目标对象的运动速度匹配,从而使摄像头可以快速捕获到更清晰的图像。曝光值表示曝光的光圈和曝光时长之间的组合。曝光量表示物体表面某一面元接收的光照度在时间内的积分。IOS为根据曝光量确定的值。
在一种具体的实施方式中,获取曝光参数的方式可以包括:根据运动信息确定曝光参数。其中,以曝光参数包括曝光时长为例,该曝光时长与目标对象的运动速度呈负相关关系。例如,目标对象的运动速度越快,曝光时长越短,目标对象的运动速度越慢,曝光时 长越长,从而使摄像头可以在匹配的曝光时长下,拍摄到更清晰的图像。
在另一种具体的实施方式中,获取曝光参数的方式可以包括:根据光照强度确定曝光参数。其中,以曝光参数包括曝光时长为例,该曝光时长与光照强度的大小呈负相关关系。例如,光照强度越大,曝光时长越短,光照强度越小,曝光时长越长。
例如,RGB摄像头可以根据预测的运动特性,具体为运动速度的变化趋势,调整曝光参数。曝光参数默认设定为多个档位,分别适应不同速度的运动,如1/30秒,1/60秒,1/100秒,1/20秒,1/500秒等。当运动变快时,若曝光时间较长,则将曝光时间适当减小,调至更小一级的档位。当运动变慢时,若曝光时间较短,则适当提高曝光时间,调至更高一级的档位,以使拍摄时的曝光量与光照强度相匹配的,避免过曝或者光照不足等情况。
在一种可能的实施方式中,在通过摄像头进行拍摄之后,还可以包括:通过运动传感器监测到的目标对象在拍摄图像时的运动信息,对摄像头拍摄到的图像进行融合,得到预设范围的目标图像。
例如,如图55所示,RGB摄像头完成曝光和拍摄,经过其内部的图像信号处理后输出一幅RGB摄像头图像。DVS记录了同时段的事件数据,将该时间段内的事件进行累积,得到运动对象的轮廓和位置,与RGB摄像头图像配准后,即像素坐标对齐,突出运动对象的边缘细节,包括但不限于滤波、边缘锐化等方式。经增强后的目标图像作为最终输出,呈现给用户或存储至手机内存。此后,根据系统设置或用户设置,DVS可继续进行运动检测,触发RGB摄像头进行下一次拍摄,即对运动的物体的连续拍摄。
因此,在本申请实施方式中,可以根据检测到的目标对象在预设范围内的进行运动时的运动轨迹进行对焦,从而拍摄到更清晰的图像。并且,使对焦区域与目标对象运动时所在的区域或者预测到的运动时所在区域相同或者相交,从而拍摄到更清晰的图像,提高用户体验。并且,进一步地,可以根据目标对象在预设范围内的运动轨迹对目标对象在未来的预设时长内所在的区域进行预测,从而可以根据预测区域进行对焦,可以理解为提前确定对焦区域,从而可以使拍摄到的运动的物体更清晰。并且,可以根据与拍摄到的图像同时段的运动信息,对拍摄到的图像进行加强处理,从而进一步提高得到的目标图像的清晰度。
前述对本申请提供的图像处理方法的流程进行了介绍,为便于理解,下面基于前述介绍的方法,以具体的应用场景为例进行更详细的说明。
场景一
示例性地,拍摄高速运动物体的流程可以参阅图56。
5601、DVS进行运动监测。
其中,可以通过DVS对RGB摄像头的拍摄范围,即前述的预设范围进行监测,监测该拍摄范围内进行运动的一个或者多个对象。
需要说明的是,该一个或者多个对象可以是在拍摄范围内活动的人物、动物、车辆、无人机或者机器人等,在不同的应用场景中可能具有不同的对象,具体可以根据实际应用场景进行调整,本申请对此不作限定。
具体地,DVS可以对拍摄范围内的光照强度的变化进行响应,产生事件。一个短时窗口内可以包括一个或者多个事件。由于静态区域不会激发事件,因此事件大多产生于存在运动的区域。获取一个短时窗口内的事件进行累积,并求取其连通域,可得到一个或多个存在运动的区域。为便于理解,以下将该存在运动的区域称为运动区域。该运动区域的形态包括但不限于外接矩形、外接最小圆、多边形、不规则形状等。通常,若运动区域小于预先设定的阈值,则筛选掉该区域。可以理解为,当监测到的运动区域小于阈值时,该运动区域可能是噪声,或者监测到的运动物体不完整等,过滤掉该区域可以降低无意义的工作量。
DVS监测目标对象的具体方式可以参阅前述步骤3801中的相关描述,此处不再赘述。
示例性地,如图57所示,摄像头的拍摄范围即前述的预设范围,与摄像头的视场角α相关。通常,摄像头的视场角越大,拍摄范围也就越大,视场角越小,拍摄范围也越小。DVS监测的范围包括摄像头的拍摄范围,从而实现对该预设范围内的运动的对象的监测。DVS监测到的事件具有稀疏性;同时,DVS中每个像素独立、异步地对连续的光强变化做出响应,而并无RGB摄像头的同步曝光影响,不受曝光时间、帧率的限制,因此DVS通常具有极高的时间分辨率,例如DAVIS的时间精度可达1us,适合捕捉高速运动的对象。
需要说明的是,本申请中所提及的高速与低速是相对而言的,对于高速和低速的划分可以根据实际应用场景进行调整,例如,可以将高于10KM/h的速度称为高速,低于10KM/h的速度称为低速。
5602、进行预测得到预测区域,判断是否触发RGB摄像头拍摄,若是,则执行步骤4203,若否,则执行步骤5601。
其中,可以由DVS根据持续监测到的目标对象的运动轨迹,持续对目标对象的未来一段时长内所在的区域进行预测,并根据预测区域判断是否触发RGB摄像头进行拍摄。
确定该预测区域的具体方式可以参阅前述步骤3802中的相关描述,此处不再赘述。
当确定目标对象的预测区域之后,判断该预设区域是否满足预设条件,若满足预设条件,则触发RGB摄像头进行后续的对焦以及拍摄,若不满足预设条件,则继续对拍摄范围进行监测,直到得到满足预设条件的预测区域或者结束拍摄。
示例性地,如图58所示,当车辆在道路上高速行驶时,可以根据DVS监测到的车辆的运动方向和运动速度,对车辆的行驶轨迹进行预测,从而可以预测到车辆即将行驶至的区域,即图58中所示的5801。当预测区域满足预设条件时,即可触发RGB摄像头进行对焦,若预设区域不满足预设条件,则不触发RGB摄像头进行对焦,并继续对车辆的运动轨迹进行监测。该预设条件可以是预测区域内的车辆不完整或者预测区域的面积太小等。例如,若车辆并未完全进入镜头视野则不触发RGB摄像头拍摄。
当预测区域满足预设条件时,DVS可以将该预测区域作为对焦区域传送至RGB摄像头,触发RGB摄像头拍摄。通常,RGB摄像头和DVS之间可能存在视差,因此需要进行配准操作。如将预测区域的坐标系与RGB摄像头的像素坐标系对齐,以使预测区域经过配准后具有与RGB摄像头视野相同的坐标系。
具体地,对焦区域可以是目标对象的当前所在区域,也可以是预测区域。对焦区域可 以通过几何形状参数描述,若对焦区域采用外接矩形,则DVS可以将其左上角顶点坐标、宽、高等数传递给RGB摄像头;若对焦区域采用多边形,则DVS可以将多边形的每个顶点按顺时针(或逆时针)依次传递给RGB摄像头;若对焦区域采用外界最小圆,则DVS可以将圆心坐标、圆半径传递给RGB摄像头等,具体可以根据实际应用场景进行调整,此处仅仅是示例性说明,并不作为限定。
此外,DVS还可以将目标对象的运动特性,如运动速度和运动方向等传送给RGB摄像头。该运动速度可以是目标对象相比前一短时窗口的速度的变化值或者变化趋势。该变化趋势可以包括但不限于变快、变慢等速度趋势状态量,甚至更多级别的速度趋势状态量,如快、较快、非常快、慢、较慢、非常慢等。该运动方向也可以是相比前一短时窗口的方向或者方向变化。该方向变化可以包括但不限于向左、向右、向上、向下、不变等方向趋势状态量,甚至更多级别的方向趋势状态量,如向左上、向左下、向右上、向右下、向左、向右、向上、向下、不变等。
5603、基于预测区域进行对焦。
在确定预测区域之后,可以将该预测区域作为对焦区域,并根据该对焦区域确定至少一个对焦点,并基于该至少一个对焦点进行对焦。具体地,可以直接按照该对焦区域所包括的点进行对焦,也可以是选取与该对焦区域的中心点距离最近的对焦点进行对焦等。
通常,RGB摄像头有多个对焦点,根据DVS提供的对焦区域,选择与该对焦区域的范数距离最近的一个或者多个对焦点进行对焦,并锁焦,即保持该一个或者多个对焦点的对焦。例如,参阅前述图54,在RGB摄像头接收到DVS传送的预测区域,可以选择与对焦区域的中心点的范数距离最近的一个或者多个点作为对焦点进行对焦并锁焦。对焦方式包括但不限于相位对焦或者反差对焦等。
5604、调整曝光参数并拍摄。
在进行对焦之后,还可以根据DVS监测到的运动特性调整曝光参数。例如,目标对象的运动速度越快,曝光参数越小,目标对象的运动速度越慢,则曝光参数越大,使摄像头可以拍摄到更清晰的图像。具体地,摄像头可以将采集到的光信号转换为电信号,从而得到拍摄到的预设范围的图像。
示例性地,如图59所示,通过对车辆的行驶轨迹进行预测确定对焦区域4401,然后完成对焦锁焦,随后调整至合适的曝光时长之后,在此对焦以及调整曝光时长的时段中,车辆行驶到预测区域,完成对运动的车辆的拍摄,得到清晰的车辆的图像。
例如,在一些场景中,可以建立目标对象的运动速度和曝光时长之间的映射关系,在确定目标对象的运动速度之后,可以根据该映射关系来调整曝光时长,从而使得曝光时长与目标对象的运动速度匹配,进而拍摄到更清晰的图像。具体地,该映射关系可以是预先设置的映射表格,如当运动速度处于第一范围时,曝光时长为1/60秒,当运动速度处于第二范围时,曝光时长为1/360秒等。该映射关系还可以是线性关系、指数关系、反比例关系等,具体可以根据实际应用场景进行调整,此处不做限定。
又例如,在一些场景中,可以建立目标对象的运动速度的变化大小和曝光时长的调整方式之间的映射关系。例如,若目标对象的运动速度增大,则降低曝光时长,若目标对象 的运动速度减小,则提高曝光时长,从而使得摄像头可以拍摄到更清晰的图像。更具体地,曝光时长的调整量可以与运动速度的变化幅度相关,如运动速度的变化量越大,则调整的曝光时长的量也就越大,运动速度的变化量越小,则调整的曝光时长的量也就越小。
还例如,在一些场景中,可以结合目标对象的运动速度和运动方向,调整曝光时长。如该运动速度可以是目标对象在实际环境中的速度,可以根据该速度和运动方向,确定目标对象与摄像头的拍摄方向垂直的方向的速度,然后根据该与摄像头的拍摄方向垂直的方向的速度来调整曝光时长。如该与摄像头的拍摄方向垂直的方向的速度越大,曝光时长越长,该与摄像头的拍摄方向垂直的方向的速度越小,则曝光时长越短。
此外,关于如何调整曝光参数,还可以参阅以下步骤7304中的相关描述,此处不再赘述。
5605、增强运动细节。
在通过摄像头进行拍摄,得到拍摄到的图像之后,通过DVS同时监测到的预设范围内的运动对象的信息,可以根据DVS监测到的信息,如目标对象的轮廓或者在图像中的位置等,对摄像头拍摄到的图像的运动细节进行增强处理,得到更清晰的目标图像。
可以理解为,在通过摄像头拍摄的同时(以下将通过摄像头拍摄的时段称为拍摄时段),DVS可以持续对预设范围内的运动对象进行监测,得到拍摄时段中预设范围内的运动的对象的信息,如目标对象的轮廓、在图像中的位置等信息,并根据该信息对拍摄到的图像进行噪声滤除或者边缘锐化等处理,从而增强摄像头拍摄到的图像的纹理细节或者轮廓等,进一步得到更清晰的图像,提高用户体验。
因此,在本申请实施方式中,可以通过采集到的目标对象的运动信息,对目标对象的运动轨迹进行拟合。然后根据拟合得到的目标对象的运动轨迹得到目标对象的预测区域,该预测区域即目标对象未来一段时长内即将运动到的区域,并根据该预测区域进行对焦以及锁焦,根据目标对象的运动特性调整曝光参数,从而完成对运动的目标对象的拍摄。可以理解为,在进行对焦、锁焦以及调整曝光参数等一系列步骤之后,目标对象移动至预测区域,即对焦区域内,此时对目标对象进行拍摄,可以拍摄到更清晰的图像。因此,即使目标对象处于高速运动的状态,也可以准确地完成对目标对象的对焦,从而拍摄到更清晰的图像。
前述对本申请提供的图像处理方法的具体流程进行了详细介绍,为便于理解,下面对以具体的场景为例,对本申请提供的图像处理方法的一些应用场景进行示例性说明,下面分别对不同的应用场景进行介绍。
示例性地,为便于理解,下面对场景一的流程进行更具体的描述。参阅图60,本申请提供的图像处理方法的另一种流程示意图。
首先,由DVS进行运动检测,即检测RGB摄像头的拍摄范围内的运动的对象,以运动的目标对象为例,根据检测到的目标对象的信息生成事件数据。DVS可以根据检测范围内的光强的变化,生成检测范围内的事件数据,在当前光强与上一次事件产生时的光强的差异超过阈值时,DVS将产生一个事件,得到一个事件的数据。通常,一个事件的事件数据可以包括一个事件中产生光强变化的像素点的位置、像素点的像素值或者光强变化值等一 种或者多种信息。
DVS可以根据监测得到的事件数据,拟合目标对象的运动轨迹,并根据目标对象的运动轨迹预测目标对象即将运动至的区域,得到预测区域。
可选地,在DVS进行运动检测以及得到预测区域的过程中,RGB摄像头可以处于关闭状态,从而减少RGB摄像头的功耗。例如,在拍摄高速运动的物体,如飞机、车辆、高速运动的用户等,可以先通过DVS监测对象的运动情况,当得到的预测区域满足预设条件时,DVS才触发RGB摄像头进行拍摄,降低RGB摄像头产生的功耗。
DVS得到预测区域之后,将该预测区域传送至RGB摄像头,触发RGB摄像头启动,并指示RGB摄像头根据该预测区域进行对焦。或者,DVS可以根据该预测区域确定对焦区域,该对焦区域的范围大于预测区域的范围,然后指示RGB摄像头根据该对焦区域进行对焦。下面以指示RGB摄像头根据预测区域进行对焦为例进行示例性说明。
通常,DVS将预测区域传送至RGB摄像头之前,还可以对该预测区域进行配准,即该预测区域所在的坐标系与RGB摄像头的坐标系保持一致,使得RGB摄像头可以准确地得到预测区域在拍摄范围内的位置,从而准确地确定对焦点。
RGB摄像头可以在DVS的触发下启动,根据预测区域进行对焦。例如,RGB摄像头可以选择与预测区域的中心点的范数距离最近的一个或者多个对焦点进行对焦,并锁定对焦点,即保持对焦点。
此外,DVS还将目标对象的运动特性传送至RGB摄像头,该运动特性可以包括目标对象的运动速度或者运动方向等信息。
RGB摄像头根据接收到的运动特性调整曝光参数,包括曝光时长或者曝光值等。例如,可以设定目标对象的运动速度和对应的曝光时长的映射关系,当接收到目标对象的运动速度时,可以根据该映射关系确定与该运动速度关联的曝光时长,从而调整曝光时长。具体例如,如表2所示,
运动速度 曝光时长(s)
[0,5) 1/60
[5,10) 1/200
[10,15) 1/500
[15,20) 1/800
表2
其中,运动速度可以通过目标对象在拍摄范围内的坐标来计算,例如,可以根据拍摄范围建立坐标系,该坐标系可以是二维坐标系,也可以是三维坐标系,具体可以根据实际应用场景进行调整。然后根据目标对象在坐标系中的变化值,计算目标对象的运动速度。
在进行曝光调整之后,通过RGB摄像头的感光元件,采集拍摄范围内的图像信号,并对采集到的图像信号进行处理,例如,将采集到的模拟信号转换为电信号,从而得到拍摄的图像。
在RGB摄像头进行拍摄的同时,DVS可以持续对拍摄范围内的目标对象的运动情况进 行监测,因此可以得到拍摄时段内的事件数据。
在RGB摄像头拍摄得到拍摄范围内的图像之后,可以对该图像以及同时段内的事件数据进行融合,从而对拍摄到的图像进行运动细节增强,得到更清晰的目标图像。
示例性地,如图61所示,拍摄时段内的DVS事件中可以包括运动的车辆的轮廓,可以根据该DVS事件对RGB摄像头拍摄到的图像,即图61中所示的RGB图像进行融合,增强RGB图像的运动细节,如滤除噪声、边缘锐化等处理,从而得到增强运动细节后的目标图像。经增强后的图像可以作为最终输出,在显示界面中显示或存储至电子设备的存储介质中。
示例性地,通过RGB摄像头和DVS获取目标图像的更具体的方式可以参阅图62。其中,DVS对拍摄范围内运动的对象进行监测,采集到较长的长时间窗,然后通过切分时间窗的方式,对目标对象的运动轨迹进行拟合,并根据拟合得到的运动轨迹对目标对象未来一段时长内所在的区域进行预测,得到预测区域。当预测区域满足预设条件时,即触发RGB摄像头启动,并根据预测区域进行对焦。
其次,DVS还根据监测到的目标对象的运动轨迹,计算目标对象的运动速度或者运动方向等运行特性,并将该运行特性传送至RGB摄像头。RGB摄像头根据该运动特性调整曝光参数,以使用与该运动特性匹配的曝光参数,如曝光时长和曝光值等。
在调整曝光参数之后,进行拍摄,将感光元件采集到的信号转换为电信号,得到拍摄得到的RGB图像。
在RGB摄像头进行对焦、调整曝光参数以及输出RGB图像的同时,DVS持续对拍摄范围内运动的对象进行监测,得到拍摄时段内的事件数据,包括目标对象运动时的轮廓、在预设区域内的位置等。
然后可以由电子设备的处理器根据DVS采集到的事件数据对RGB图像进行增强处理,如滤除噪声、边缘锐化等,从而得到更清晰的目标图像。
因此,在本场景中,对于高速运动的对象,可以通过预测未来一段时长内目标对象所在的区域来提前进行对焦,从而可以拍摄到清晰的运动中的图像。并且,可以通过调整曝光参数,来对目标对象进行与运动速度匹配的曝光,从而使摄像头进一步拍摄到更清晰的图像。此外,还可以通过DVS在同时段检测到的事件,对拍摄到的图像进行运动细节的增强,得到更清晰的目标图像。
场景二
示例性地,拍摄非高速运动的流程可以参阅图63。该非高速运动的场景如安防、门禁等场景。
6301、DVS进行运动监测。
其中,本场景中,目标对象可以是低速运动的对象。
具体地,步骤6301可以参阅前述步骤5201中的相关描述,此处不再赘述。
示例性地,本场景二可以是门禁场景中,如图64所示,可以在门禁中设置RGB摄像头和DVS,此外,还可以设置ISP或者显示器等装置,此处仅仅是示例性说明,不再一一赘述。
6302、根据目标对象当前所在的区域判断是否触发RGB摄像头拍摄,若是,则执行步骤6303,若否,则执行步骤6301。
本场景中,因目标对象处于低速运动,可以根据目标对象的当前所在的区域判断是否触发RGB摄像头进行拍摄。具体地,可以判断目标对象当前所在的区域是否满足预设条件,若是,则执行步骤6303,若否,则执行步骤6301。
例如,可以判断当前所在的区域中的目标对象是否完整,当前所在的区域的面积是否大于预设值等。当当前所在的区域中的目标对象完整,或者,当前所在的区域的面积大于预设值等,则DVS可以将当前所在的区域作为对焦区域发送至RGB摄像头,以触发RGB摄像头启动,并根据该当前所在的区域进行拍摄。
示例性地,如图65所示,当存在目标对象进入门禁的监控范围内,且出现了异常运动时,如靠近门禁或者接触门禁等,可能存在对象的面积覆盖了DVS和RGB摄像头的拍摄范围,导致DVS检测到光照强度变化。例如门禁外是小区公共门禁,当人员进入门禁前方,可能遮挡楼道的灯光,造成整个视野内的光强减小。当DVS根据光照强度的变化,监测到运动对象时,如图65中所示的1801,可以监测目标对象的当前所在的区域,然后判断目标对象当前所在的区域的面积是否大于预设值,或者目标对象当前所在的区域内的目标对象是否完整等,决定是否触发RGB摄像头拍摄。当确定触发RGB摄像头拍摄时,DVS可以将目标对象当前所在的区域作为对焦区域传送至RGB摄像头,RGB摄像头可以基于目标对象当前所在的区域进行对焦,并根据目标对象的运动特性调整曝光参数,完成对目标对象的拍摄,得到目标对象的RGB图像。同时,DVS可以在拍摄时段对目标对象所在区域进行持续监测。
6303、基于目标对象当前所在的区域进行对焦。
其中,基于当前运动区域进行对焦与基于预设区域进行对焦的方式类似,此处不再赘述。步骤6303与前述步骤5203类似,此处不再赘述。
6304、调整曝光参数并拍摄。
在本场景中,可以根据光强来调整曝光参数。具体地,曝光参数可以包括曝光时长,该曝光时长与拍摄范围内的光强大小呈负相关关系。
并且,调整曝光参数所使用的光照强度值,可以是由DVS采集到的光照强度值,也可以是由RGB摄像头或者其他设备采集到的光照强度值,具体可以根据实际应用场景进行调整,此处不做限定。
例如,可以根据DVS整体的事件发生速率,估计出平均光强的变化,平均光强L与DVS事件率R成正相关关系即L∝R。可以根据这一关系调整曝光参数,当估计的平均光强减小时,则增加曝光时长,如由1/100秒提高至1/30秒,当估计的平均光强增大时,则减少曝光时长,如由1/30秒减少至1/100秒。
又例如,可以计算出平均光强的值,然后根据该平均光强的值确定曝光参数。如平均光强的值越大,则曝光时长越短,平均光强的值越小,曝光时长越长。从而使摄像头的曝光时长与平均光强的值匹配,进而可以充分拍摄到拍摄范围内的图像,得到更清晰的图像,提高用户体验。
6305、增强运动细节。
其中,步骤6305与前述步骤5205类似,此处不再赘述。
因此,在本应用场景中,可以根据DVS监测到的目标对象当前所在的区域进行对焦,可以准确地识别出运动物体所在的区域,从而进行准确的对焦。并且,也可以根据光强的大小调整曝光参数,使得RGB摄像头可以准确地适应光照强度的大小,从而拍摄到更清晰的图像。此外,本应用场景也可以通过DVS在同时段检测到的事件,对拍摄到的图像进行运动细节的增强,得到更清晰的目标图像。
并且,在此场景中,尤其在一些监控场景中,若持续采用RGB摄像头进行监控,将产生较大的功耗,如RGB摄像头持续拍摄的功耗较通常为数百毫瓦至数十瓦等,且产生的数据量大。而本申请提供的图像处理方法,可以在DVS检测到存在运动的对象时才出发RGB摄像头启动拍摄,DVS功耗通常为数十毫瓦,例如DAVIS346型号传感器的功耗为10-30毫瓦,因此可以降低功耗。且DVS仅获取到运动的对象的轮廓,可以避免对用户的所有数据,如隐私数据都监控,可以提高用户体验。且可以对异常运动进行拍摄,可以根据拍摄到的图像进行后续的报警操作,具体可以根据实际应用场景进行调整,提高安全性。可以理解为,本申请提供的图像处理方法,通过DVS以较低功耗实时监测外界的运动,只有在判别为异常运动时才触发RGB摄像头工作,具有功耗上的优势;同时,DVS输出的事件并不包含具体的纹理细节,只有运动对象的轮廓和位置,具有隐私安全的优势。
本申请还提供一种图形用户界面(graphical user interface,GUI),该GUI可以应用于电子设备,如终端、监控设备、自动驾驶车辆等设备中,该电子设备可以包括显示屏、存储器、一个或多个处理器,所述一个或多个处理器用于执行存储在所述存储器中的一个或多个计算机程序,如前述图52-65中所提及的图像处理方法的步骤,该GUI用于通过显示屏对前述图52-65中摄像头所拍摄到的画面进行显示。
下面对本申请提供的GUI进行详细介绍。
该图形用户界面包括:响应于针对目标对象进行拍摄的触发操作,以及根据对焦信息拍摄预设范围的图像,显示该预设范围的图像,该预设范围为摄像头拍摄范围,该对焦信息包括对该预设范围内的该目标对象进行对焦的参数,该对焦信息为根据该目标对象的运动信息确定,所述运动信息包括所述目标对象在预设范围内的进行运动时的运动轨迹的信息。
示例性地,如图66所示,目标对象可以高速移动的车辆,GUI具体可以包括,响应于在检测目标对象的运动信息,该运动信息中可以包括目标对象在预设范围内的运动轨迹的信息,该预设范围为摄像头拍摄范围;然后,根据运动信息确定对焦信息,对焦信息包括对预设范围内的目标对象进行对焦的参数;随后,根据对焦信息在预设范围中对目标对象进行对焦,并通过摄像头拍摄到车辆的图像之后,在显示屏中显示拍摄到的图像,该图像中可以包括高速运动中的车辆。
因此,在本申请实施方式中,可以检测摄像头的拍摄范围内,运动中的目标对象的运动轨迹,然后根据目标对象的运动轨迹确定对焦信息并完成对焦,从而可以拍摄到更清晰的图像。即使目标对象处于运动中,也可以准确地对目标对象进行对焦,拍摄到清晰的运 动状态的图像,提高用户体验。
在一种可能的实施方式中,该对焦信息包括对焦区域的信息,该图形用户界面还可以包括:响应于该运动信息对预设时长内该目标对象的运动轨迹进行预测,得到预测区域,以及根据该预测区域确定该对焦区域,在该显示屏中显示该对焦区域。
示例性地,如图67所示,当车辆处于高速运动状态时,可以根据检测到的车辆在拍摄范围内进行运动的运动轨迹,对未来预设时长内车辆的运动轨迹进行预测,得到未来一段时间内车辆即将到达的预测区域,将该区域作为对焦区域6701,并基于对焦区域6701进行对焦,如图68所示,从而拍摄到更清晰的目标对象的图像。
因此,在本申请实施方式中,可以对目标对象未来的预设时长内的运动轨迹进行预测,并根据预测区域确定对焦区域,可以准确地完成对目标对象的对焦。即使目标对象处于高速运动,本申请实施方式也可以通过预测的方式提前对目标对象进行对焦,使目标对象处于对焦区域,从而拍摄到更清晰的高速运动的目标对象。
在一种可能的实施方式中,该图形用户界面具体可以包括:若该预测区域符合预设条件,则响应于根据该预测区域确定该对焦区域,在该显示屏中显示该对焦区域;若该预测区域不符合预设条件,则响应于重新根据该运动信息对预设时长内该目标对象的运动轨迹进行预测,得到新的预测区域,以及根据该新的预测区域确定该对焦区域,在该显示屏中显示该对焦区域。
该预设条件可以是预测区域中包括完整的目标对象,或者预测区域的面积大于预设值等。
示例性地,如图69A所示,当摄像头拍摄到的目标对象不完整时,可能导致针对目标对象的预测区域的面积较小,即对焦区域6901较小,小于车辆的面积,导致后续拍摄到的车辆可能出现部分不清晰的情况。而当车辆的车身完全进行拍摄范围,如图69B所示,则此时可以得到面积符合要求的预测区域,即对焦区域6902,从而基于该对焦区域5502,拍摄到完整、清晰的车辆的图像,如图69C所示。
因此,在本申请实施方式中,只有当预测区域符合预设条件时,才根据预测区域确定对焦区域,并触发摄像头拍摄,当预测区域不符合预设条件时,则不触发摄像头进行拍摄,从而可以避免拍摄到的图像中目标对象不完整,或者可以避免无意义的拍摄。并且,在未进行拍摄时,摄像头可以处于未启动状态,仅当预测区域满足预设条件时,才触发摄像头进行拍摄,可以降低摄像头产生的功耗。
在一种可能的实施方式中,该运动信息还包括该目标对象的运动方向和运动速度中的至少一种;该图形用户界面具体可以包括:响应于根据所述目标对象在预设范围内进行运动时的运动轨迹,以及该运动方向和/或该运动速度对预设时长内该目标对象的运动轨迹进行预测,得到该预测区域,在该显示屏中显示该预测区域。
因此,本申请实施方式中,可以根据目标对象在预设范围内的运动轨迹,以及运动方向和/或运动速度等,对目标对象在未来的预设时长内的运动轨迹进行预测,从而可以对目标对象未来的运动轨迹进行准确的预测,进而可以对目标对象进行更准确的对焦,进而可以拍摄到更清晰的图像。
在一种可能的实施方式中,该图形用户界面具体可以包括:响应于根据目标对象在预设范围内的运动轨迹,以及所述运动方向和/或所述运动速度,拟合出所述目标对象所在的区域的中心点随时间变化的变化函数,以及根据所述变化函数计算出预测中心点,所述预测中心点为预测得到的所述目标对象所在的区域的中心点,并根据所述预测中心点得到所述预测区域,在显示屏中显示该预测区域。
在一种可能的实施方式中,所述预测范围的图像由RGB摄像头拍摄,该图形用户界面具体可以包括:响应于将所述RGB摄像头的多个对焦点中,与所述对焦区域的中心点的范数距离最小的至少一个点作为对焦点进行对焦,在显示屏中显示基于该至少一个点作为对焦点进行对焦后拍摄到的图像。
在一种可能的实施方式中,该对焦信息包括对焦区域的信息,该运动信息中包括该目标对象的当前所在的区域,该图形用户界面具体可以包括:响应于将该目标对象的当前所在的区域作为该对焦区域,在该显示屏中显示该对焦区域。
示例性地,如图70所示,目标对象可以是低速运动的行人,此时目标对象的运动速度较低,可以直接将目标对象的当前所在的区域作为对焦区域7001,然后对基于对焦区域5601进行对焦,即可得到清晰的图像。
因此,本申请实施方式中,目标对象在预设范围内的运动轨迹的信息中可以包括目标对象当前所在的区域和历史所在的区域,在一些低速场景中,可以将目标对象的当前所在的区域,作为对焦区域,从而完成对目标对象的对焦,进而可以拍摄到更清晰的图像。
在一种可能的实施方式中,该图形用户界面具体可以包括:响应于在所述拍摄所述预设范围的图像之前,获取曝光参数,在显示屏中显示该曝光参数;响应于根据所述曝光参数拍摄所述预设范围的图像,在显示屏中显示该根据所述曝光参数拍摄所述预设范围的图像。因此,本申请实施方式中,还可以调整曝光参数,从而通过曝光参数完成拍摄,得到清晰的图像。
具体地,曝光参数可以包括EV、曝光时长、曝光量、光圈大小或者ISO等参数,在拍摄图像时,可以在拍摄界面中显示曝光参数,以使用户可以根据显示的曝光参数获取到当前的拍摄情况,提高用户体验。
示例性地,如图71所示,曝光参数可以包括EV,在拍摄图像时,若EV=6,则可以在显示界面中显示“EV:6”,以使用户通过显示界面或者到EV的具体值,提高用户体验。
在一种可能的实施方式中,曝光参数为根据所述运动信息确定,所述曝光参数包括曝光时长,所述曝光时长与所述目标对象的运动速度呈负相关关系。
因此,在本申请实施方式中,可以通过目标对象的运动速度确定曝光时长,使曝光时长与目标对象的运动速度匹配,如运动速度越快,曝光时长越短,运动速度越慢,则曝光时长越长。可以避免过曝或者曝光不足等,从而使后续可以拍摄到更清晰的图像,提高用户体验。
在一种可能的实施方式中,曝光参数为根据光照强度确定,该光照强度可以是由摄像头检测到的光照强度,也可以是运动传感器检测到的光照强度,所述曝光参数包括曝光时长,所述预设范围内的光照强度的大小与所述曝光时长呈负相关关系。
因此,本申请实施方式中,可以根据检测到的光照强度确定曝光时长,当光照强度越大时,曝光时长越短,光照强度越小时,曝光时长越长,从而可以保障适量的曝光量,拍摄到更清晰的图像。
在一种可能的实施方式中,该图形用户界面还可以包括:响应于根据监测到的该目标对象与该图像对应的运动的信息,对该预设范围内的图像进行融合,得到该预设范围内的目标图像,在该显示屏中显示该图像。
因此,本申请实施方式中,在拍摄图像的同时,还可以对预设范围内目标对象的运动情况进行监测,获取到目标对象在图像中对应的运动的信息,如目标对象的轮廓、目标对象在预设范围内的位置等信息,并通过该信息对拍摄到的图像进行增强处理,得到更清晰的图像。
示例性地,DVS可以采集到运动的目标对象的轮廓,从而可以根据DVS采集到的目标对象的轮廓,对RGB摄像头采集到的图像进行增强处理,RGB摄像头采集到的图像可以如图72A所示,如消除目标对象的轮廓的噪声,对目标物体的轮廓进行增强等,从而得到更清晰的目标对象的图像,如图72B所示。
在一种可能的实施方式中,该运动信息为通过动态视觉传感器DVS对该预设范围内的目标对象的运动情况进行监测得到。
因此,本申请实施方式中,可以通过DVS对摄像头的拍摄范围进行运动的对象的监测,从而得到准确的运动信息,即使目标对象处于高速运动的状态,也可以通过DVS及时捕获到目标对象的运动信息。
实施方式二、HDR模式的拍摄场景下获取图像的方式
首先,在HDR模式的拍摄场景中,参阅图73,本申请提供的一种图像处理方法的流程示意图。需要说明的是,对于与前述实施方式一中相同或者相似的名词或者步骤等,以下不再赘述。
7301、获取第一事件图像和拍摄到的多张RGB图像。
其中,该第一事件图像可以是通过运动传感器采集到的图像,包括了预设范围内运动的对象的信息,该预设范围可以理解为运动传感器的检测范围,且该预设范围包括了摄像头的拍摄范围。为便于理解,本申请所提及的事件图像可以理解为基于一段时间内通过运动传感器采集到的信息生成的动态图像,表示了一段时间内运动传感器的检测范围内相对于运动传感器存在运动的对象的运动变化情况。
需要说明的是,本实施方式二中所提及的第一事件图像和第二事件图像,是指图73-图80中涉及到拍摄场景下所述使用的事件图像,与以下与SLAM对应的图95-图108或者图118-图120所提及的第一事件图像和第二事件图像,可以是相同的事件图像,也可以是不同的事件图像,具体可以根据实际应用场景进行调整。
该多张RGB图像(或者称为第一图像)可以是使用不同曝光时长所拍摄到的图像。例如,该多张图像中可以使用短曝光时长拍摄到的图像,和使用长曝光时长拍摄到的图像,通常,曝光时长越长,可以采集到弱光场景下更多的纹理信息,曝光时长越短,可以采集到强光场景下的更多纹理信息,因此,通过不同曝光时长,可以采集到纹理更丰富的图像。
例如,参阅前述图36,该第一事件图像可以是由DVS在摄像头拍摄多张RGB图像时采集得到,该第一事件图像中可以包括一段时间段内,对象在摄像头的拍摄范围内进行运动时,目标对象所在的区域的大小、边框或者角点在预设范围内的坐标等信息。
具体例如,由DVS采集到的数据构成的图像可以表示为
Figure PCTCN2020141973-appb-000053
其中
Figure PCTCN2020141973-appb-000054
(x,y)表示图像中的某个位置的坐标,t表示时刻,t 1为开始拍摄曝光图像的时刻减去50毫秒,t 2为开始拍摄曝光图像的时刻,events表示运动传感器,如DVS采集到的数据。
更具体地,该第一事件图像与前述步骤5201中所提及的运动信息类似,此处不再赘述。
可选地,本实施例所提及的事件图像可以通过前述图38-图44对应的方法流程来进行优化,从而得到更清晰的事件图像。
需要说明的是,在本申请实施方式中,为便于理解,将RGB摄像头拍摄到的图像称为RGB图像,将运动传感器采集到的信息称为事件图像。
7302、根据第一事件图像计算每张RGB图像对应的抖动程度。
在得到第一事件图像和多张RGB图像之后,使用第一事件图像来计算每张RGB图像对应的抖动程度。该抖动程度可以理解为拍摄RGB图像时摄像头的抖动程度,或者在拍摄RGB图像时,拍摄范围内的对象处于运动状态造成图像模糊时的模糊程度,也可以是两种情况同时存在等。
具体地,第一事件图像中包括了一段时长内摄像头的拍摄范围内处于运动状态的对象的位置、轮廓等信息,该一段时长覆盖了多张RGB图像的拍摄时段。因此,可以通过第一事件图像中在各个RGB图像的拍摄时段内所包括的处于运动状态的对象的信息,来计算每张RGB图像的抖动程度。
示例性地,量化拍摄RGB图像时的抖动程度的方式可以包括:
Figure PCTCN2020141973-appb-000055
Figure PCTCN2020141973-appb-000056
其中,Blur e用于衡量第e张RGB曝光图像的模糊程度,即拍摄每张图像时的抖动程度,t e0为开始拍摄曝光图像的时刻,t e为当前的RGB图像的曝光时长,H*W表示当前RGB图像的长和宽,(x,y)表示RGB图像中某个局部的位置,r e(x,y)表示第e张RGB曝光图像中局部模糊程度,events表示DVS采集到的数据,α是归一化因子,用于将r(x,y)归一化至[0,1]范围内。
需要说明的是,本申请量化抖动程度的方式仅仅是一种示例,具体可以使用其他方式来量化抖动程度,如Brenner梯度函数、方差函数或熵函数等,具体可以根据实际应用场景进行调整,本申请对此并不作限定。
7303、判断是否需要补拍RGB图像,若是,则执行步骤7304,若否,则执行步骤7306。
在计算得到拍摄每张RGB图像的抖动程度之后,基于每张RGB图像对应的抖动程度,判断是否需要补拍RGB图像,若需要补拍RGB图像,则可以继续执行步骤7304,若不需要补拍RGB图像,则可以继续执行步骤7306。
具体地,可以判断每张RGB图像的抖动程度是否超过第一预设值,若某一张图像的抖动程度超过该第一预设值,则可以补拍一张RGB图像,若所有的RGB图像的抖动程度都不超过第一预设值,则不需要补拍RGB图像。若存在多张RGB图像的抖动程度超过第一预设值,则可以补拍多张RGB图像。
在一种可能的实施方式中,除了判断每张RGB图像的抖动程度是否超过第一预设值,还可以判断重拍RGB图像的重拍次数是否超过一定次数,若超过一定次数,则可以无需再进行补拍,若重拍次数未超过一定次数,则可以继续重拍行RGB图像。例如,可以预先设定重拍次数不超过5次,当重拍次数达到5次时,即使RGB图像的抖动程度较高,也不再进行重拍RGB图像。
例如,量化拍摄RGB图像时的抖动程度的方式可以包括:
Figure PCTCN2020141973-appb-000057
Figure PCTCN2020141973-appb-000058
当Blur e≥threshold 2时,则需要补拍RGB图像,threshold 2即第一预设值。
在另一种可能的实施方式中,当某一张或者多张RGB图像(但不是所有的RGB图像)的抖动程度高于第一预设值时,可以无需补拍,使用剩余的抖动程度不高于第一预设值的RGB图像进行融合,得到最终的图像,从而提高得到图像的效率。
为便于理解,示例性地,抖动程度较低的图像可以如图74所示,抖动程度较高的图像可以如图75所示。显然,抖动程度较高的图像所包括的信息不准确,在可视化界面中显示较模糊,若使用抖动程度较高的图像来进行融合,最终得到的目标图像所包括的信息也不准确,甚至可能出现模糊,因此,此情况下需要补拍一张或者多张RGB图像。又例如,在最强光照强度与最暗光照强度比例较大的场景中,如图76所示,拍摄到的RGB图像可能出现过曝的情况,导致最强光照强度部分的图像不清晰,而通过DVS捕获到的图像的清晰度较高,因此,可以通过DVS采集到的信息,来判断是否需要补拍RGB图像,从而得到更清晰的RGB图像。
在一种可能的实施方式中,判断是否需要重拍RGB图像的方式还可以包括:将第一事件图像切分为多个区域,以及多张RGB图像中曝光值最小的RGB图像(或者称为第三图像)相应地切分为多个区域,第一事件图像中的多个区域的形状和位置与RGB图像中的多个区域的形状和位置相对应。例如,若将第一事件图像划分为了16个矩形的区域,也可以将曝光值最小的RGB图像切分为与第一事件图像中的区域的形状、大小和位置相同的16个矩形的区域。曝光值可以包括曝光时长、曝光量或者曝光级数中一种或者多种。然后计算第一事件图像中的每个区域是否包括纹理信息(或者称为第一纹理信息),以及计算曝光值最小的RGB图像中的每个区域是否包括纹理信息,然后对比第一事件图像中的每个区域和曝光值最小的RGB图像中的每个区域,若第一动态区域中的某一个区域包括了纹理信息,且曝光值最小的RGB图像中与该区域相同的区域中不包括纹理信息,则表示RGB图像中的该区域模糊程度较高,可以补拍RGB图像。而若第一事件图像中每个区域都不包括纹理信息,则无需补拍RGB图像。
例如,在最大光照强度和最小光照强度之间的比值较大的场景中,即可以理解为明暗 相差较大的场景中,将第一事件图像和曝光值最小的RGB图像都划分了相同形状、大小的区域,然后计算第一事件图像和曝光值最小的RGB图像中的每个区域是否包括纹理信息。如图77所示,可以将第一事件图像和曝光值最小的RGB图像分割为多个宏块,若第一事件图像上存在方差大于预先设定的阈值threshold 0的宏块,记为宏块集合{MB i},即宏块MB i中包括了纹理信息。对应地,在曝光值最小的RGB图像I e上找到对应宏块区域,通过计算I e上这些宏块区域的像素方差来判断第一事件图像上包含的纹理是否被曝光值最小的RGB图像捕获。若存在一个宏块MB i,它在I e上的像素方差小于预先设定的阈值threshold 1,则说明这个区域的纹理没有完全被RGB图像所捕获,则需要补拍RGB图像。
在一种可能的实施方式中,还可以提取第一事件图像中所包括的纹理特征,以及第三图像中的特征,并对第一事件图像所包括的特征与第三图像中的特征进行匹配,如比较特征之间的欧式距离,欧式距离越近,匹配度越高,欧式距离越远,匹配度越低。若匹配度较低,如低于0.8,表示RGB图像中可能未完全捕获到存在运动的对象的纹理信息,需要补拍RGB图像。从第一事件图像或者RGB图像中提取特征可以是尺度不变特征变换(scale invariant feature transform,SIFT),或者通过深度神经网络进行提取得到的特征,或者生成灰度直方图,具体可以根据实际应用场景进行调整,本申请对此并不作限定。
或者,在一种可能的实施方式中,可以计算第一事件图像中检测到的存在事件的区域的大小,若存在事件的区域的大小超过预设大小,则确定需要补拍RGB图像,若存在事件的区域的大小未超过预设大小,则可以无需补拍RGB图像,或者通过其他实施方式判断是否需要补拍RGB图像等。
此外,在一些场景中,若事件区域的位置位于第一事件图像或者RGB图像的中心区域,如覆盖了RGB图像的中心点,则需要补充拍摄RGB图像。若区域在RGB图像的周边区域,如靠近RGB图像的边界线,且事件区域的面积小于一定值,则可以无需补充拍摄RGB图像。或者,还可以基于事件区域与事件图像的中心点之间的距离来判断是否需要补充拍摄RGB图像。例如,若事件区域与事件图像的中心点之间的距离小于预设的距离,如该距离小于200个像素点,则需要补充拍摄RGB图像,该距离不小于200个像素点,则无需补充拍摄RGB图像,具体可以根据实际应用场景来进行调整。
具体例如,RGB图像对应的事件图像可以表示为:
Figure PCTCN2020141973-appb-000059
将该事件图像划分为多个相同大小且不重叠的多个宏块,用运动宏块的个数来计算运动区域的大小,当且仅当事件图像上宏块包含的非0像素个数大于预设阈值threshold 3时将这个宏块判定为运动宏块。如事件图像上一共包含16*16个宏块,threshold 3可以设置为128。当运动区域包含的运动宏块个数超过128时,即需要补拍RGB图像,当不超过128时,则不需要补拍RGB图像或者通过其他方式判断是否需要补拍RGB图像等。
在一种可能的实施方式中,运动传感器所拍摄到的范围和RGB摄像头的拍摄范围可能不相同,在此场景中,在步骤7302之前,还需要对齐第一事件图像和多张RGB图像,使第一事件图像对应的拍摄范围与RGB图像对应的拍摄范围匹配。
7304、计算曝光参数。
其中,该曝光参数可以包括曝光时长、曝光量或者曝光级数等中的一项或者多项。
示例性地,计算曝光时长的方式可以包括:使用最短曝光图像对应的DVS数据估计过曝区域的真实像素值
Figure PCTCN2020141973-appb-000060
其中C是DVS相机的门阀值,通常C=2,p(x,y,t)={-1,0,1}是t时刻像素位置(x,y)处的带符号事件,相较于前一个时刻,光强减弱时事件为-1,光强增加时事件为1,光强不变时没有事件发生,记为0。基于相机响应曲线(Camera Response Function,CRF),曝光区域的曝光值为:
Figure PCTCN2020141973-appb-000061
Figure PCTCN2020141973-appb-000062
根据曝光值估计最优曝光时长
Figure PCTCN2020141973-appb-000063
Figure PCTCN2020141973-appb-000064
其中,Vmin=0,Vmax=255。
此外,若某一张RGB图像的抖动程度高于第一预设值,在计算重拍使用的曝光参数时,可以直接使用该RGB图像对应的曝光参数。
又例如,此处计算曝光参数的方式,可以参阅前述实施方式中的调整曝光参数,如前述的步骤5604、步骤7404、图60或图62对应的实施例中所提及的调整曝光的方式等。
需要说明的是,步骤7304为可选步骤,可以重新计算曝光参数,如曝光时长、曝光量或者曝光等级等,也可以使用抖动程度大于第一预设值的RGB图像对应的曝光参数重新拍摄等。
7305、重新拍摄得到抖动程度不高于第一预设值的RGB图像。
其中,在补拍RGB图像时,可以使用运动传感器对拍摄范围内运动的对象的图像进行捕获,然后使用运动传感器捕获到的补拍RGB图像时的事件图像,来计算补拍的RGB图像对应的抖动程度。当该抖动程度高于第一预设值时,可以继续执行步骤7303,直到补拍得到的RGB图像的抖动程度不高于第一预设值,或者补拍次数达到预设次数等。
若在步骤7305之前,执行了步骤7304,即计算了曝光参数,则可以使用该曝光参数来补拍RGB图像,而若未执行步骤7304,则可以使用抖动程度大于第一预设值的RGB图像对应的曝光参数进行拍摄,得到新的RGB图像,或者称为第二图像。
此外,若在拍摄范围内存在运动的对象的场景中补拍RGB图像,补充拍摄RGB图像的具体方式还可以参阅前述实施方式一,例如,可以通过DVS采集到的数据对拍摄范围内的对象的运动轨迹进行预测,从而根据预测结果来进行对焦,拍摄到更清晰的图像,此处不再赘述。
因此,在本申请实施方式中,利用动态感知摄像头(即运动传感器)采集到的信息自适应地调整曝光策略,即利用动态感知信息对拍摄范围内的纹理的高动态范围感知特性,自适应补充拍摄曝光时长合适的图像,提升相机捕捉强光区或者暗光区纹理信息的能力。
7306、根据每张RGB图像的抖动程度计算融合权重,并根据每张图像的融合权重融合多张RGB图像得到目标图像。
在得到多张抖动程度不超过第一预设值的RGB图像之后,根据每张RGB图像的抖动程度,来计算每张RGB图像对应的融合权重,并根据每张RGB图像的融合权重来对多张RGB图像进行融合,得到高清的目标图像。
在融合多张RGB图像的过程中,还可以对其不同曝光时长的RGB图像,以使融合后得到的目标图像更清晰。通常,可以采用计算光流、基于像素点或特征点来查找多张RGB图 像之间相对应的位置,并计算偏移量,根据偏移量来完成RGB图像的对齐。
例如,对齐RGB图像的具体方式可以包括:首先根据event data计算局部光流信息,计算方法如下:假设一个局部空间Ω内的事件图像数据p(x,y,t)在同一个平面上,用
Figure PCTCN2020141973-appb-000065
来表示这个平面的参数。通过优化以下公式求解参数a,b,c,d:
Figure PCTCN2020141973-appb-000066
根据平面∑ e=ax+by+ct+d,求解出这个局部空间Ω的局部偏移量
Figure PCTCN2020141973-appb-000067
根据u和v的值来对齐图像,即I e(x,y)=I e+N(x+u,y+v),其中I e是较前拍摄的曝光图像,I e+N是在I e之后拍摄的曝光图像,N=1,2,…,p(x,y,t)是I e和I e+N之间局部空间Ω内发生的事件数据,Ω的空间分辨率为8*8。对图像上每个局部空间Ω估计局部偏移量,完成对整张RGB图像的对齐。特别地,当Ω的分辨率为H*W时,计算的是整张图像的全局偏移量。
在计算每张RGB图像的融合权重的过程中,可以为抖动程度低的RGB图像设置较高的融合权重,而为抖动程度较高的RGB图像设置较低的融合权重,从而使最终得到的目标图像所包括的信息更清晰。
为每张图像设置融合权重的方式可以有多种,如通过多张RGB图像的抖动程度的比例来设置每张RGB图像的融合权重,或者根据每张RGB图像的抖动程度的大小来设置每张RGB图像的融合权重等。
例如,为每张RGB图像设置初始的融合权重的方式可以表示为:
Figure PCTCN2020141973-appb-000068
w e(x,y)表示RGB图像的融合权重,Vmin=0,Vmax=255。
若在拍摄RGB图像时存在摄像头抖动或者拍摄范围内的对象处于运动状态等情况,则可以根据每张图像的抖动程度,调整每张图像的融合权重,例如,调整后的融合权重可以表示为:
Figure PCTCN2020141973-appb-000069
Blur e为每张RGB图像的抖动程度,BS e表示运动区域的大小。
通常,若RGB图像的抖动程度较高,即整体较模糊,且该RGB图像在事件图像中对应的时段内存在较大的运动区域,则该RGB图像的融合权值可以大幅度降低,以避免最终得到的目标图像中存在模糊的区域。而若RGB图像的抖动程度较低,即整体清晰,且该RGB图像在事件图像中对应的时段内存在较小或者不存在运动区域,则可以在初始融合权重的基础上增加该RGB图像的融合权重,以使最终得到的目标图像更清晰。
在一种可能的实施方式中,若每张RGB图像的第一抖动程度不高于第一预设值且高于第二预设值,则对每张第一图像进行去抖动处理,得到去抖动后的每张第一图像。具体地,去抖动的方式可以包括:AI去抖算法、基于光流的去抖算法、USM(Unsharp Mask)锐化算法等,具体可以根据实际应用场景进行调整,本申请对此并不作限定。因此,在本申请实施方式中,可以基于动态数据区分抖动情况,在没有抖动时直接融合,在抖动不强时自适应地对RGB图像进行去抖动,而在抖动强烈时补充拍摄RGB图像,使用了多种抖动程度的场景,泛化能力强。
示例性地,直接拍摄一帧图像可以如图78所示,而通过本申请提供的方法,结合事件图像对多张RGB图像进行融合得到的目标图像可以如图79所示,显然,由本申请提供的方法得到的图像更清晰,提升了用户体验。
因此,在本申请实施方式中,可以通过事件图像,来量化拍摄RGB图像时的抖动程度,并根据每张RGB图像的抖动程度,确定每张RGB图像的融合权重。通常,抖动程度低的RGB图像对应的融合权重也就越高,从而使最终得到的目标图像包括的信息更倾向于更清晰的RGB图像,从而得到更清晰的目标图像。并且,针对抖动程度高的RGB图像,可以补拍RBG图像,得到抖动程度更低、更清晰的RGB图像,以使后续再进行图像融合时,可以使用更清晰的图像进行融合,进而使最终得到的目标图像也更清晰。
为便于理解,下面以一个更具体的场景对本申请提供的图像处理的方法的流程进行详细说明。
本申请提供的图像处理的方法可以由手机或者相机等设置有或者连接了摄像头和运动传感器,如DVS的设备来执行,以下以手机为例进行说明。
如图80所示,在用户使用手机进行拍摄的场景中,用户可以打开HDR模式,通过HDR模式来拍摄更清晰的图像。
用户点击拍摄按钮之后,短时间内保持手机不动,此时手机可以使用不同的曝光时长来拍摄多张RGB图像。在此过程中,若某一张或多张RGB图像的抖动程度高于预设值,则可以补充拍摄RGB图像,从而增加新的RGB图像。在补拍RGB图像的过程中,可以使用抖动程度高于预设值的RGB图像对应的曝光时长,也可以使用在此基础上降低曝光等级后的曝光时长,从而得到更清晰的补充RGB图像。
若RGB图像的抖动程度不高于预设值,而大于0,则可以对RGB图像进行去抖动处理,从而得到更清晰的RGB图像,且相对于补拍RGB图像可以提高得到最终的目标图像的效率。 若所有RGB图像的抖动程度都不超过预设值,则无需补充拍摄RGB图像和去抖动处理。
然后根据每张RGB图像的抖动程度,为每张RGB图像分配融合权重。通常,抖动程度较高的RGB图像,对应的权重值也越小,抖动程度低的RGB图像,对应的权重值也就越大,从而使最终得到的目标图像所包括的信息更倾向于更清晰的RGB图像所包括的信息,使最终得到的目标图像更清晰,提高用户体验。且若该目标图像用于后续的图像识别或者特征提取等,得到的识别结果或者提取到的特征也更准确。
除此之外,以上方法(即HDR模式的拍摄场景下获取图像的方式)将DVS传感器和RGB摄像头协同生成的高质量图像的方式,还可以应用于高帧率视频应用(High frame rate video,HFR video)的场景中,利用DVS的去运动模糊和HDR特性提升HFR中每一帧的图像质量,以增强图像的质量。同时,RGB传感器以固定帧率拍摄图像序列(视频),利用两帧RGB图像之间的DVS事件辅助重构高帧率视频,可以提升视频帧率。
参阅图115,本申请提供的一种图像处理装置的一种结构示意图,该图像处理装置可以包括:
运动传感器11501,用于检测目标对象的运动信息,运动信息包括目标对象在预设范围内进行运动时的运动轨迹的信息,预设范围为摄像头拍摄范围;
计算模块11502,用于根据运动信息确定对焦信息,对焦信息包括对预设范围内的目标对象进行对焦的参数;
拍摄模块11503,用于根据对焦信息在预设范围中对目标对象进行对焦,并用于拍摄预设范围的图像。
在一种可能的实施方式中,计算模块11502可以是与运动传感器11501耦合的模块,或者设置于运动传感器11501内部的模块。
在一种可能的实施方式中,对焦信息包括对焦区域的信息;计算模块11502,具体用于:根据运动信息对预设时长内目标对象的运动轨迹进行预测,得到预测区域;根据预测区域确定对焦区域。
在一种可能的实施方式中,计算模块11502,具体用于:若预测区域符合预设条件,则将预测区域作为对焦区域,并触发拍摄模块11503进行对焦;若预测区域不符合预设条件,则重新根据运动信息对预设时长内目标对象的运动轨迹进行预测,得到新的预测区域,并根据所述新的预测区域确定所述对焦区域。
可以理解为,当计算模块11502确定预设区域符合预设条件时,即将该预设区域作为对焦区域,如将该预设区域作为对焦区域或者确定比该预设区域大的范围作为对焦区域等,并触发拍摄模块进行拍摄。在此之前,摄像模块可以处于关闭状态,例如,若摄像模块包括摄像头,在计算模块11502触发拍摄之前,如预设区域不符合预设条件,则该摄像头可以处于关闭状态,从而减少摄像头的功耗,节省资源。
在一种可能的实施方式中,运动信息还包括目标对象的运动方向和运动速度中的至少一种;
计算模块11502,具体用于根据目标对象在预设范围内进行运动时的运动轨迹,以及运动方向和/或运动速度对预设时长内目标对象的运动轨迹进行预测,得到预测区域。
在一种可能的实施方式中,计算模块11502,具体用于:根据运动区域,以及运动方向和/或运动速度,拟合出目标对象的运动区域的中心点随时间变化的变化函数;根据变化函数计算出预测中心点,预测中心点为预测得到的预设时长内目标对象的所在区域的中心点;根据预测中心点得到预测区域。
在一种可能的实施方式中,拍摄模块11503包括RGB摄像头;
拍摄模块11503,具体用于将RGB摄像头的多个对焦点中,与对焦区域的中心点的范数距离最小的至少一个点作为对焦点进行对焦。
在一种可能的实施方式中,对焦信息包括对焦区域的信息,运动区域中包括目标对象的当前所在的区域,计算模块11502,具体用于将目标对象的当前所在的区域作为对焦区域。
在一种可能的实施方式中,拍摄模块11503,还用于在拍摄模块11503拍摄预设范围的图像之前,获取曝光参数,根据曝光参数拍摄预设范围的图像。
在一种可能的实施方式中,拍摄模块11503,具体用于根据运动信息获取曝光参数,其中,曝光参数包括曝光时长,曝光时长与目标无图的运动速度呈负相关关系。
在一种可能的实施方式中,拍摄模块11503,具体用于根据光照强度获取曝光参数,其中,曝光参数包括曝光时长,预设范围内的光照强度的大小与曝光时长呈负相关关系。
在一种可能的实施方式中,图像处理装置还可以包括:
增强模块11504,用于在拍摄模块拍摄预设范围的图像之后,根据监测到的目标对象与图像对应的运动的信息,对预设范围内的图像进行融合,得到预设范围内的目标图像。
在一种可能的实施方式中,运动传感器11501可以包括动态视觉传感器DVS,DVS用于对预设范围内的目标对象的运动情况进行监测,得到运动信息。
参阅图116,本申请还提供一种图像处理装置,包括:
获取模块11601,用于获取第一事件图像和拍摄到的多张第一图像,所述第一事件图像包括在所述多张第一图像的拍摄时间段内预设范围中运动的对象的信息,具体可以是通过运动传感器11603得到,所述多张第一图像对应的曝光时长不相同,所述预设范围为摄像头的拍摄范围;
处理模块11602,用于根据所述第一事件图像计算所述多张第一图像中每张第一图像对应的第一抖动程度,所述第一抖动程度用于表示拍摄所述多张第一图像时摄像头抖动的程度;
所述处理模块11602,还用于根据所述每张第一图像对应的第一抖动程度确定所述多张第一图像中每张第一图像的融合权重,其中,所述多张第一图像对应的第一抖动程度和融合权重呈负相关关系;
所述处理模块11602,还用于根据所述每张第一图像的融合权重融合所述多张第一图像,得到目标图像。
在一种可能的实施方式中,所述处理模块11602,还用于在所述根据所述第一抖动程度确定所述多张第一图像中每张第一图像的融合权重之前,若所述第一抖动程度不高于第一预设值且高于第二预设值,则对所述每张第一图像进行去抖动处理,得到去抖动后的所 述每张第一图像。
在一种可能的实施方式中,所述获取模块11601,还用于若所述第一抖动程度高于第一预设值,则重新拍摄得到第二图像,所述第二图像的第二抖动程度不高于所述第一预设值;
所述处理模块11602,具体用于根据所述每张第一图像的第一抖动程度计算所述每张第一图像的融合权重,以及根据所述第二抖动程度计算所述第二图像的融合权重;
所述处理模块11602,具体用于根据所述每张第一图像的融合权重和所述第二图像的融合权重,融合所述多张第一图像和所述第二图像,得到所述目标图像。
在一种可能的实施方式中,所述获取模块11601,还用于所述重新拍摄得到第二图像之前,获取第二事件图像,所述第二事件图像为在获取所述第一事件图像之前得到;
根据所述第二事件图像包括的信息计算得到曝光参数,所述曝光参数用于拍摄所述第二图像。
在一种可能的实施方式中,所述获取模块11601,具体用于:将所述第一事件图像切分为多个区域,以及将第三图像切分为多个区域,所述第三图像为所述多张第一图像中曝光值最小的第一图像,且所述第一事件图像所包括的多个区域与所述第三图像包括的多个区域的位置相对应,所述曝光值包括曝光时长、曝光量或者曝光级数中的至少一种;计算所述第一事件图像中的每个区域是否包括第一纹理信息,以及所述第三图像中每个区域是否包括第二纹理信息;若所述第一事件图像中的第一区域包括所述第一纹理信息,且所述第三图像中与所述第一区域对应的区域不包括所述第二纹理信息,则根据所述曝光参数进行拍摄,得到所述第二图像,所述第一区域时所述第一动态区域中的任一区域。
(2)DVS图像和RGB图像融合
拍照技术常见于手机和相机等终端设备,是一种感光器件在一段时间(设定的曝光时间)内接收光子(自然光)并量化为数字信号(比如0-255)的过程,感光器件也可称为感光元件或图像传感器,是组成数字摄像头的重要组成部分,若根据元件的不同,可分为电荷耦合元件(charge coupled device,CCD)和金属氧化物半导体元件(complementary metal-oxide semiconductor,CMOS)两大类;若根据拍摄的光学图像类型的不同,则可分为彩色传感器和运动传感器两大类,其中,彩色传感器也可称为RGB传感器,运动传感器可以是运动检测视觉传感器(motion detection vision sensor,MDVS),也可简称为动态视觉传感器(dynamic vision sensor,DVS)。
在手机等智能终端设备的带动下,图像传感器得到了快速发展,而随着图像传感器使用种类的不断丰富,一台终端设备上配备的图像传感器的类型和传感感测功能越来越多,这使得终端设备所能处理的使用场景也越来越广泛,因此,如何构建一个感测功能丰富的图像传感器,以及在拍照过程中,针对不同使用场景如何对图像传感器获取的数据进行处理、如何输出数据、输出何种数据等均成为亟待解决的问题。
通常,图像传感器采集到的信息可以用于进行图像重建、目标检测、拍摄运动对象、使用运动的设备进行拍摄、拍摄去模糊、运动估计、深度估计或者进行目标检测识别等等 场景。目前,在手机等智能终端设备的带动下,图像传感器得到了快速发展,而随着图像传感器使用种类的不断丰富,一台终端设备上配备的图像传感器的类型和传感感测功能越来越多,这使得终端设备所能处理的使用场景也越来越广泛,因此,如何构建一个感测功能丰富的图像传感器,以及在拍照过程中,针对不同使用场景如何对图像传感器获取的数据进行处理、如何输出数据、输出何种数据等均成为亟待解决的问题。
基于此,本申请实施例结合彩色传感器和运动传感器各自的优势,构建一种新的图像传感器,并提供一种新的数据处理方法,用于实现多种应用模式下的数据采集和数据输出,使得构建的新的图像传感器支持的功能更丰富强大、使用场景更广泛。下面将从以下三个方面对本申请实施例的内容进行阐述,第一方面,如何基于已有的感光单元(即传感器像素)或已有的图像传感器构建感测功能更强大的图像传感器新结构,其中涉及到新的图像传感器的芯片架构、电路结构以及对应的工作流程;第二方面,基于新构建的图像传感器,如何实现数据采集和数据输出,其中涉及到新的数据处理算法和不同的应用模式,以及针对不同的数据融合方式开发适配的算法对相应的数据流进行处理。第三方面,是输出数据的一种应用实例,即如何高效、准确的对拍摄到的图像进行运动物体(也可称为运动前景)移除。具体地,第二方面的具体实现又可分为以下几点:1)基于新构建的图像传感器,不同应用模式下如何实现数据采集;2)不同应用模式下如何输出数据、输出何种数据等。具体地,不同输出模式下,配合新的算法,可以实现高质量图像重建,例如,可以是高帧率图像重建、高动态范围(high dynamic range,HDR)图像重建,或者实现低功耗目标检测和识别功能,并将这些语义信息和图像关联起来等,从而为用户提供更好的体验。需要注意的是,为便于理解,在以下的实施例中,均以运动传感器为DVS为例进行说明。
(1)、构建图像传感器新结构及工作流程
由于本申请实施例涉及了许多关于图像传感器的相关知识,为了更好地理解本申请实施例的方案,下面先对本申请实施例可能涉及的相关术语和概念进行介绍。应理解的是,相关的概念解释可能会因为本申请实施例的具体情况有所限制,但并不代表本申请仅能局限于该具体情况,在不同实施例的具体情况可能也会存在差异,具体此处不做限定。
由于任意成像系统的目的都是获取能够满足要求的图片,在一个成像系统中,图形处理器的任务就是为相应的成像系统提取足够高质量的图片信息,具体地,成像物镜将外界照明光照射下的(或自身发光的)景物成像在物镜的像面上,形成二维空间的光强分布(光学图像),而能够将二维光强分布的光学图像转变成一维时序电信号的传感器就称为图像传感器。在图像传感器中,每一个感光单元对应一个像素(Pixels),一个图像传感器上包含的像素数量越多,代表着它能够感测到更多的物体细节,从而图像就越清晰,也就是其提供的画面分辨率越高。市面上主流的摄像头大都是采用30万像素的图像传感器,即在图像传感器中一共有大约30万个感光单元。与之对应的成像分辨率为640×480(即等于307200个像素)。如图81所示,示意的是两个传统的彩色传感器,其中,传感器A包括5×5=25个感光单元(仅为示意),对应拍摄到的图像A就包括25个像素值,每个像素值基于对应位置上的感光单元得到,而传感器B包括10×10=100个感光单元(仅为示意),同样地,对应拍摄到的图像B就包括100个像素值,每个像素值也是基于对应位置上的感光单元得到。
这里需要注意的是,DVS与上述图81对应的彩色传感器类似,一个DVS也包括有多个感光单元,每个感光单元也对应图像上的一个像素点,与传统的彩色传感器不同的地方在于两种图像传感器中感光单元的工作原理不同,具体的,传统的彩色传感器是按帧格式输出全幅图像,而DVS借鉴人类视网膜的三层模型,每个像素独立异步工作,没有帧和曝光时间的概念,DVS只能捕捉动态变化,当拍摄的场景没有任何变化时,摄像头无输出(不考虑噪声),因此不能捕捉静态信息。
当本申请实施例所提及的至少一帧事件图像为多帧事件图像时,可以是同一时间窗口的事件图像,也可以是不同时间窗口的事件图像,例如,事件图像1是[t1,t2]时段内的事件图像,事件图像2是[t2,t3]时段内的事件图像。当然,该至少一帧事件图像也可以是相同时段内不同区域的事件图像。例如,可以将DVS的监测区域划分为多个区域,基于每个区域内检测到的事件生成对应的事件图像。此外,不同像素位置、一段时间内的事件则构成事件数据流,也可简称为事件流。
示例性地,如前述图37所示,可以将时间窗口切分多个短时窗口,如图37中所示的k个短时窗口,每个时间窗口可以对应一帧事件图像。切分的方式可以是按照设定的时长进行切分,也可以是按照随机的时长进行切分,或者按照运动轨迹变化情况进行切分等,具体可以根据实际应用场景进行调整。在切分得到k个短时窗口之后,分析每个短时窗口中的事件的位置,确定目标对象在每个短时窗口中所在的区域,如短时窗口1中的运动区域为如图37中所示的运动区域1,短时窗口k中的运动区域为图37中所示的运动区域k。然后通过短时窗口1-k中运动区域的变化情况,确定目标区域的运动区域以及运动特性,如运动方向或者运动速度等。此外,整个时间窗口(即图37中下方的实线矩形框)内不同像素位置的事件就构成事件数据流。
在用户的日常拍照活动中,时常会有运动物体(可称为运动前景)出其不意的出现在拍摄范围中,从而影响拍照效果,目前市面上有一些运动物体移除的方法,例如,Lumia手机通过拍摄一段时长的动态照片(比如2秒),并基于该动态照片进行照片拼接,在一定场景下能够实现运动物体的移除,这种方式对拍摄时机要求高,需要稳定拍摄一段时间(比如上述所述的2秒),并且移除的效果不佳,对于高速运动的物体无法识别并移除。基于此,如何高效、准确的对拍摄到的图像进行运动物体移除,成为亟待解决的问题。
本申请实施例提供了一种数据处理方法,具体来说,是提供了一种图像处理方法,用于高效、准确的对拍摄到的图像进行运动物体移除。
首先,本申请提供的图像处理方法的具体流程可以包括:首先,获取事件流和一帧第一RGB图像,该事件流包括至少一帧事件图像,该至少一帧事件图像中的每帧事件图像由目标对象在运动传感器的监视范围内进行运动时的运动轨迹信息生成,该第一RGB图像为在曝光时长内被摄像头捕捉到的每个时刻下拍摄场景的叠加;根据该事件流构建蒙版,蒙版用于确定每帧事件图像的运动区域;根据事件流、第一RGB图像和蒙版得到第二RGB图像,该第二RGB图像就为去除了目标对象(即去除了运动物体)的RGB图像。在本申请实施例中,可以只基于一张RGB图像和事件流去除运动物体,从而得到无运动物体的RGB图像,相比现有技术中需要通过多张RGB图像和事件流才能去除运动物体的方式,只需要用 户拍摄一张RGB图像,用户体验更佳。
运动物体移除在摄影、检测识别、背景建模、全景拼接等应用上都有很强的意义,例如,在手机拍照等应用场景中,当用户想要拍摄一些风景照片时,有时候在拍摄过程中,拍摄区域内会存在众多行人(如,在人员众多的风景区),那么通过运动物体移除就可得到符合用户要求的风景照;又例如,在监控场景中,可以使用背景减除的方式分离背景与前景(即运动前景),从而可以快速的达到运动物体检测的目的;还例如,在全景拼接场景中,全景拼接时涉及到运动物体的多张照片拼接,需要将运动前景移除。
下面对本申请提供的图像处理方法进行详细介绍。具体请参阅图82,图82为本申请实施例提供的图像处理方法的流程示意图,该方法可以包括如下步骤:
8201、获取事件流和一帧第一RGB图像。
首先,通过具备运动传感器(如,DVS)和RGB传感器的摄像头分别获取到事件流和一帧RGB图像(可称为第一RGB图像),其中,获取到的事件流包括至少一帧事件图像,该至少一帧事件图像中的每帧事件图像都是由目标对象(即运动物体)在运动传感器的监视范围内进行运动时的运动轨迹信息生成,而该第一RGB图像为在曝光时长内被摄像头捕捉到的每个时刻下拍摄场景的叠加。
为便于理解,下面分别对如何获取事件流和第一RGB图像进行说明。
a.获取事件流的过程
首先,通过运动传感器获取运动信息,具体地,可以通过运动传感器对目标对象在运动传感器的检测范围内的运动情况进行监测,得到检测范围内的目标对象的运动信息。其中,目标对象是检测范围内运动的物体,目标对象的数量可以是一个或者多个,该运动信息可以包括目标对象在检测范围内进行运动时的运动轨迹的信息。例如,该运动信息中可以包括目标对象在检测范围内进行运动时,目标对象的运动轮廓、所在的区域的大小或者角点在检测范围内的坐标等信息。
为便于理解,以下将目标对象在检测范围内进行运动时,目标对象在检测到的每一时刻中所在的区域称为目标对象的运动区域。该运动区域例如,若目标对象为行人,且行人正在进行全身运动,则运动区域内可以包括行人的全身,若行人仅手臂运动,则目标对象可以仅仅是行人的手臂,运动区域可以包括行人的手臂部分。
之后,根据运动信息生成事件图像,也就是说,在得到运动信息之后,根据运动传感器在检测范围内所采集到的信息生成至少一帧事件图像。通常,运动信息中可以包括一段时长内目标对象在检测范围内运动的轨迹的信息,运动信息可以被视为事件,则一段时间内获取到的运动信息构成事件流。取事件流中的一个时间窗口对应的全部运动信息按照对应坐标映射至同一图像中,得到事件图像。
示例性地,该事件图像可以参阅前述图35-37及其相关介绍,此处不再赘述。
可选地,本实施例所提及的事件图像可以通过前述图38-图44对应的方法流程来进行优化,从而得到更清晰的事件图像。
为便于理解,以下举例示意,请参阅图83,运动传感器因为其不需要曝光的特性,可以以极高的时间分辨率将运动中的闪电捕捉,例如,在一个极小的时间窗口内(可以看做 某一时刻t k),运动传感器可以捕捉到一个闪电所在位置的清晰轮廓,那么在曝光时间(假设为[t 1,t 2])内闪电的运动轨迹被不断捕捉,从而形成了如图83所示的事件流。
b.获取一帧第一RGB图像的过程
第一RGB图像则可通过彩色传感器获取,当开启了彩色传感器,那么摄像头就可通过该彩色传感器获取到一帧第一RGB图像,彩色传感器在获取图像时,其原理决定了其获取的图像是一段曝光时间内场景的叠加。假设将该第一RGB图像记为I,那么图像I就表示拍摄场景f从t 1时刻到t 2时刻之间的曝光结果,这里是假设曝光时长为[t 1,t 2],且拍摄场景f指的是摄像头拍摄范围内的真实的清晰场景的图像。如图84所示,图84示意的是图像I以及图像I在曝光时刻为t 1时对应的拍摄场景f(t 1)和曝光时刻为t 2时对应的拍摄场景f(t 2),图像I表示的拍摄场景f从t 1时刻到t 2时刻之间的曝光结果的叠加,可见多个拍摄场景曝光叠加后得到的图像I是一张模糊图像。
8202、根据事件流构建蒙版。
获取到事件流和第一RGB图像后,就可以根据事件流构建蒙版,蒙版用于确定事件流中的每帧事件图像的运动区域,也就是用于确定RGB图像中运动物体所处的位置。如图85所示,灰色区域为静态区域,也可称为背景区域,黑色区域则为运动区域。
需要说明的是,本申请将基于事件流E构建蒙版M(t)的过程记为g(x),对于x时刻的拍摄场景f(x)而言,因为其运动已被运动传感器记录在事件流E中,因此蒙版M(t)可以表示为:M(t)=g(E(t+Δt)),其中,E(t+Δt)可表示为
Figure PCTCN2020141973-appb-000070
如图86所示。g(x)作为表示构建蒙版的方法,可以采用很多种实现方式,例如,可以通过形态学的方式,使用事件图像的位置信息构建连通区;也可以是选用带有时间衰减的函数将一段时长内产生的事件图像的区域给与不同权重,据此得到蒙版;还可以是通过将空间邻域内一段时长内产生的事件图像数量超过预设阈值的区域记为0(表示运动区域),未超过预设阈值的区域记为1(表示背景区域),以此方式来构建蒙版。在本申请实施例中,对构建蒙版的具体实现方式不做限定。
为便于理解,这里对其中一种构建蒙版的具体实现方式进行说明:首先,可将运动传感器的监视范围划分为多个预设邻域(设为邻域k),然后,在每个邻域k范围内,当事件流在预设时长Δt范围内的事件图像数量超过阈值P,则确定对应的该邻域为运动区域,该运动区域可标记为0,若事件流在预设时长Δt范围内的事件图像数量没有超过阈值P,则确定对应的该邻域为背景区域,该背景区域可标记为1,具体可如下述公式(18)所示:
Figure PCTCN2020141973-appb-000071
其中,M xy(t)表示t时刻下蒙版M在(x,y)位置的取值,e ij(s)表示事件流中s时刻的事件图像e在(i,j)位置记录的事件(属于事件流)。
8203、根据事件流、第一RGB图像和蒙版得到第二RGB图像,第二RGB图像为去除目标对象的RGB图像。
根据上述步骤得到事件流、第一RGB图像和蒙版之后,就可以根据该事件流、第一RGB图像和蒙版得到第二RGB图像,第二RGB图像为去除目标对象的RGB图像,如图87所示, 图87就为图像I对应的去除了运动物体的图像I′。
下面具体介绍如何根据事件流、第一RGB图像(也可称为图像I)和蒙版得到第二RGB图像。
首先,介绍如何通过含有运动模糊的图像I和事件流E计算得到不含运动模糊的图像f(t 1),具体地,可通过如下一系列公式得到:
Figure PCTCN2020141973-appb-000072
Figure PCTCN2020141973-appb-000073
Figure PCTCN2020141973-appb-000074
logf(t)=logf(t 1)+c·E(t)      (22)
Figure PCTCN2020141973-appb-000075
Figure PCTCN2020141973-appb-000076
Figure PCTCN2020141973-appb-000077
其中,彩色传感器的拍照原理决定了其拍摄的结果为曝光时间内的所有时刻对应场景的叠加,即如果所拍摄场景在t时刻对应的标准清晰图像为f(t),则图像I是由t 1到t 2时刻的f(t)积分而来,也就是上述的公式(19)所示
Figure PCTCN2020141973-appb-000078
如图84中的图像I所示:每个闪电表示真实的某个时刻下运动物体所处的位置,因为曝光时间长,闪电移动到不同的位置被相机捕捉了多次,并最终拍出了一张模糊的照片。
而运动传感器因为其不需要曝光的特性,可以以极高的时间分辨率将运动中的闪电捕捉,具体可表示为上述公式(20)所示,运动传感器将离散的运动信息,也就是离散的事件(x,y,σ,t 0),其中x,y表示光强变化的坐标,p表示光强变化的方向,t表示发生变化的时间。用e xy(t)来表示(x,y)位置上关于时间t的连续函数,则有
Figure PCTCN2020141973-appb-000079
Figure PCTCN2020141973-appb-000080
表示的是一个在t0时刻积分为1的冲击函数,σ表示在t 0时刻是否有光强变化,即如果在对数域上光强相比参考光强变化变化大于阈值c,则σ=1,若小于阈值的相反数-c,则σ=-1。其他情况则σ=0。后续以e(t)表示(x,y)位置的e xy(t)。例如,在一个极小的时间窗内(可以看作某一时刻t k,DVS可以捕捉到一个闪电所在位置的清晰轮廓,轮廓上的 一个点可以表示为e(t k),如图83中的每个闪电的轮廓,那么在曝光时间内闪电的运动被不断的捕捉,从而形成了事件图像,具体事件图像中每个像素点的值可表示为上述公式(21)所示:
Figure PCTCN2020141973-appb-000081
又因为事件产生的原理是在对应像素位置上光强的log值变化达到c值,即下述公式(29)所示:
Figure PCTCN2020141973-appb-000082
真实清晰图像f(t 1)与t时刻的真实清晰图像f(t),可以表示为f(t 1)不断叠加光强变化,即上述公式(22)所示:logf(t)=logf(t 1)+c·E(t)。将公式(22)代入公式(19),就可得到公式(23),再将公式(21)代入公式(23),就可得到公式(24),将公式(24)进行移项等操作,就可得出由模糊图像I和事件流e得出真实清晰图像f(t 1)的公式(25)所示:
Figure PCTCN2020141973-appb-000083
因此,当通过摄像头拍摄到不同时刻的多张图像时,这里以拍摄到的两帧图像I 1和I 2为例进行说明,请参阅图88,如果已知每张图像中运动物体的位置为ROI 1、ROI 2,可分别得出背景区域为1运动区域为0的蒙版M 1、M 2。那么可以通过将不同时刻不同运动区域的图像组合的方式,得到一张无运动物体的图像,该无运动物体的图像可表示为I′,具体可如下公式(27)所示:
Figure PCTCN2020141973-appb-000084
由两张图像的情况就可推导出若拍摄的是n张图像的情况下,得到无运动物体的图像I′的表达方式,如图(28)所示:
Figure PCTCN2020141973-appb-000085
上述公式(27)和公式(28)都需要至少用户手动拍摄至少两张图像才能得到一张无运动物体的图像I′,如果在一些允许拍摄时间很短的情况下,比如,拍摄烟花在空中绽放的图像、拍摄飞机高速从窗口飞过的图像等,这些拍摄场景在可拍摄范围的存在时间非常短,用户可能只来得及拍摄到一张图像,此时可通过如下方式得到无运动物体的图像I′:首先,假设将拍摄到的图像记为I,那么图像I就表示拍摄场景f从t 1时刻到t 2时刻之间的曝光结果,这里是假设曝光时长为[t 1,t 2],且拍摄场景f指的是摄像头拍摄范围内的真实的清晰场景的图像,即f(t)表示一副无任何运动模糊的理想图像,那么去除运动前景的图像I′就可表示为如下公式(29)所示:
Figure PCTCN2020141973-appb-000086
其中,M(t)表示图像I在t时刻时的蒙版,蒙版的构建方式可如上述公式(18)所示,此处不予赘述。
而已知由模糊图像I和事件流e得出理想真实清晰图像f(t 1)的过程如上述公式(25)所示,也就是经过一系列变换可得到如下公式(30)至公式(32):
Figure PCTCN2020141973-appb-000087
Figure PCTCN2020141973-appb-000088
结合上述公式(29)、公式(32),最终可得出当只拍摄到一张图像I时,如何得到对应的无运动物体的图像I′,具体可如公式(33)所示:
Figure PCTCN2020141973-appb-000089
需要说明的是,上述所述的根据一张图像I得到一张无运动物体的图像I′的过程中,首先需要用户手动触发摄像头拍摄得到一张图像I,然而在一些应用场景中,如图89所示,当拍照过程中运动物体运动较小时,在t 1时刻和在t 2时刻,两个时刻的运动物体重叠区域过大,会导致通过上述方式无法移除运动物体或者移除效果不好。因此,在本申请的一些实施方式中,还提供了一种图像处理方法,该图像处理方法与上述图像处理方法不同的地方在于:可以通过判断运动传感器采集的运动数据是否存在运动突变,当存在运动突变时,则触发摄像头拍摄第三RGB图像(如图90所示),之后,再根据上述步骤8201至步骤8202类似的方式获取事件流和一帧第一RGB图像,并根据事件流构建蒙版(请参阅上述步骤8201-8202,具体此处不予赘述),最后再根据事件流、第一RGB图像、第三RGB图像和蒙版得到无运动前景的第二RGB图像。得到的第三RGB图像由于是通过运动突变情况下触发摄像头自动抓拍的,灵敏度高,从而可以在用户察觉到有运动物体变化之初就能得到一帧图像,该方案可与上述公式(33)提出的单张图像I中运动物体移除的方法相结合,得到如下公式(34)所示的基于摄像头自动抓拍的第三RGB图像(即图像B k)和用户手动拍摄的第一RGB图像(即图像I)移除图像中运动物体的方法:
Figure PCTCN2020141973-appb-000090
其中,图像B k表示在曝光时间内,在k时刻触发摄像头拍摄到的一张第三RGB图像,如果在曝光时间内存在3次运动突变,则对应3个k时刻,每个k时刻下均会触发摄像头拍摄到一张第三RGB图像,M k则表示在k时刻时,基于图像B k构建得到的蒙版。因此,如图91所示,基于运动突变触发摄像头抓拍到的图像B k(一张或多张)和用户在一定曝光时间内主动拍摄得到的图像I,可通过上述公式(34),得到一张无运动物体的图像I′。
为便于理解本申请实施例所述的两种方式,下面以实例对本申请实施例所述的两种移除图像中运动前景的方式进行说明:图92为基于一帧第一RGB图像(即图像I)和事件流E得到无运动物体的第二RGB图像(即图像I′)的流程示意图和图像I′的表达形式,图93为基于一帧第一RGB图像(即图像I)、运动突变触发拍摄得到的第三RGB图像(即一张或多张图像B k)和事件流E得到无运动物体的第二RGB图像(即图像I′)的流程示意图和图像I′的表达形式,从中可以看出,图92的模式是通过建立单张图像I和事件流E之间的关系,并基于对应构建的蒙版M,计算得到去除了运动物体的图像I′,具体的过程可以概括为:事件相机获取事件流E,且用户拍照,通过RGB相机获取图像I,对于事件流E中的不同时刻生成蒙版M,并基于该图像I、事件流E和蒙版M,通过上述公式(33)计算出移除了运动物体的图像I′;而图93的模式是通过运动传感器采集到的运动数据确定当存在运动突变情况时触发RGB相机抓拍图像B k,以用于后续去除图像I中的运动物体,具体的过程可以概括为:事件相机获取事件流E,通过分析事件流E,确定监视范围内是否出现运动突变(如,出现新的运动物体),并触发RGB相机抓拍图像B k,用户拍照,通过RGB相机获取图像I,对于事件流E中的不同时刻生成蒙版M,并基于该图像I、图像B k、事件流E和蒙版M,通过上述公式(34)计算出移除了运动物体的图像I′。
需要注意的是,在本申请的一些实施方式中,事件相机和RGB相机可以集成在一个相机中,也可以是两个独立的相机分别进行工作,具体此处不做限定。
此外,在本申请应用的拍照的场景中,还可以在显示界面中展示拍照时结合使用的传感器,例如,可以在显示界面中显示DVS、IMU或者红外等选择,由用户来选择是否开启这些传感器,从而得到与用户的期望符合的图像。例如,如图94A所示,当用户打开拍照界面时,可以在设置选项中选择摄像时的配置,如图94B所示,可以由用户选择是否打开DVS、IMU或者红外等,从而得到与用户的期望符合的图像或者视频。
在图81和图94所对应的实施例的基础上,为了更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关设备。具体参阅图117,图117为本申请实施例提供的图像处理装置的一种结构示意图,该图像处理装置11700包括:获取模块11701、构建模块11702、处理模块11703,其中,获取模块11701,用于获取事件流和一帧第一RGB图像,所述事件流包括至少一帧事件图像,所述至少一帧事件图像中的每帧事件图像由目标对象在运动传感器的监视范围内进行运动时的运动轨迹信息生成,所述第一RGB图像为在曝光时长内被摄像头捕捉到的每个时刻下拍摄场景的叠加;构建模块11702,用于根据所述事件流构建蒙版,所述蒙版用于确定所述每帧事件图像的运动区域;处理模块11703,用于根据所述事件流、所述第一RGB图像和所述蒙版得到第二RGB图像,所述第二RGB图像为去除所述目标对象的RGB图像。
在本申请上述实施方式中,可以只基于一张RGB图像和事件流去除运动物体,从而得到无运动物体的RGB图像,相比现有技术中需要通过多张RGB图像和事件流才能去除运动物体的方式,只需要用户拍摄一张RGB图像,用户体验更佳。
在一种可能的设计中,所述获取模块11701,还用于当所述运动传感器在第一时刻监测到所述监视范围内出现运动突变,触发所述摄像头拍摄第三RGB图像;所述处理模块 11703,还用于根据所述事件流、所述第一RGB图像、所述第三RGB图像和所述蒙版得到第二RGB图像。
在本申请上述实施方式中,可以通过判断运动传感器采集的运动数据是否存在运动突变,当存在运动突变时,则触发摄像头拍摄第三RGB图像,之后再根据上述类似的方式获取事件流和一帧第一RGB图像,并根据事件流构建蒙版,最后再根据事件流、第一RGB图像、第三RGB图像和蒙版得到无运动前景的第二RGB图像。得到的第三RGB图像由于是通过运动突变情况下触发摄像头自动抓拍的,灵敏度高,从而可以在用户察觉到有运动物体变化之初就能得到一帧图像,基于该第三RGB图像和第一RGB图像可以对运动物体实现更好的移除效果。
在一种可能的设计中,所述运动传感器在第一时刻监测到所述监视范围内出现运动突变包括:在所述监视范围内,所述运动传感器在第一时刻采集到的第一事件流的产生区域与所述运动传感器在第二时刻采集到的第二事件流的产生区域之间的重叠部分小于预设值。
在本申请上述实施方式中,具体阐述了运动突变的判定条件,具备可实现性。
在一种可能的设计中,所述构建模块11702,具体用于:将所述运动传感器的监视范围划分为多个预设邻域;在目标预设邻域内,当所述事件流在预设时长内的事件图像数量超过阈值,确定所述目标预设领域为一个运动子区域,所述目标预设邻域为所述多个预设邻域中的任意一个,各个运动子区域构成所述蒙版。
在本申请上述实施方式中,具体阐述了一种构建蒙版的方法,简单易操作。
(3)SLAM
传统APS(Advaenced Photo System)摄像头,主要基于类似背景减除的方法来定位运动目标并重点分析这部分关键信息,最简单的实现方法是帧差法。而DVS能通过感知单个像素亮度的变化,捕捉运动目标,有着与帧差法几乎一样的效果,但是具有更低的时延。DVS摄像头在单个运动目标场景下能快速定位前景运动目标所在的矩形区域/mask,比如镜头固定不动且拍摄的背景干净的监控场景下。示例性地,可以参阅图95,图95为本申请实施例提供的传统摄像头与DVS所拍摄的场景对比示意图。其中,图95中的(a)为传统APS摄像头所拍摄的场景示意图,图95中的(b)为DVS所拍摄的场景示意图。
具体地,使用DVS进行运动物体检测的流程如下文所述。
当画面中有运动物体出现或者场景存在光线变化时,DVS对应区域产生事件(events)。通过将一段时间内(比如1秒)出现events的像素位置设置为1,没有events的像素位置设置为0,得到一张如图95中的(b)所示的二值图。在二值图上找到连通的矩形框区域。然后,判断矩形框区域的大小,当矩形框区域的面积>阈值1时,认为是场景光线变化;当阈值2>矩形框区域的面积时,认为矩形框区域的面积太小,是噪声,比如风吹叶子晃动产生的运动区域;当阈值1>矩形框区域的面积>阈值2时,进一步根据运动的连续性来判断是否是移动的物体。
可选的,使用DVS传感器和RGB摄像头进行运动物体检测和识别的流程如下图所示:
当画面中有运动物体出现或者场景存在光线变化时,DVS对应区域产生事件events。通过将一段时间内(比如1秒)出现events的像素位置设置为1,没有events的像素位 置设置为0,得到一张如图95中的(b)所示的二值图。在图上找到连通的矩形框区域。将矩形框区域膨胀一圈(h*w*0.1)之后,找到RGB摄像头对应帧上的对应矩形区域,作为运动物体区域。使用现有RGB图像深度学习网络来识别运动物体区域内物体的类别。
一般来说,使用DVS进行运动物体检测,具有低时延的优势,因为DVS对高速运动物体敏感,可以快速捕捉运动事件,并进行响应分析,“时间分辨率”比APS更高。此外,DVS传感器对物体运动高度敏感,受场景光强影响不大,即在过亮或者过暗的场景下,仍能进行运动物体识别信息。
将DVS应用于SLAM技术,能够提供跟精准的定位和地图重建功能。此功能在AR场景应用下十分有用。此外,基于DVS使得用户可以通过虚实融合看到物理空间的虚拟信息。
示例性地,基于DVS来使得用户看到物理空间的虚拟信息的一些例子如下文所述。
1、实际楼宇的虚拟标牌,楼宇出入口的虚拟呈现,园区服务设施的虚拟标牌等。如火车站、食堂、咖啡厅、便利店、母婴室、健身房、充电桩、取款机、卫生间等。
2、显示智慧信息,如室内场所的温度湿度、空气质量、楼宇人数、会议室名称、会议议题等。具体地,可以参阅图96,图96为本申请实施例提供的一种应用了DVS的室内导航示意图。
3、3D步行导航,支持室内外的实时步行导航。具体地,可以参阅图97-图99,图97为本申请实施例提供的一种应用了DVS的室外导航示意图;图98a为本申请实施例提供的一种应用了DVS的车站导航示意图;图98b为本申请实施例提供的一种应用了DVS的景点导航示意图;图99为本申请实施例提供的一种应用了DVS的商场导航示意图。
具体的,在全场景空间计算中,可使用本专利发明的DVS相机和传统传感器(如摄像头等)融合架构进行位姿估计,提高快速运动、高动态环境采集、光强变化较大环境下的精度。例如,由于DVS相机对光强变化敏感,因此在夜间也能够找到图像匹配点,使得夜晚定位成为可能。
DVS的高速、高动态范围、可以检测运动引起的光强变化的特点可以解决现有SLAM快速运动、高动态环境时容易失败的问题。此外,DVS仅检测光强变化,数据冗余度低,采集功耗(20mW)和带宽(100kB/s)都很小,输入SLAM的数据量很少,可以显著降低SLAM的功耗。
全场景空间获取位姿估计信息后,可以用于环境或者场景识别理解。
可选的,为了提高强场景理解的精确度,还可以结合高精度地图进行精确定位。
最后,基于地图信息、位置估计信息以及当前的应用需求,可以在真实环境中的对应位置渲染成像出虚拟信息。
可以参阅图100,图100为本申请实施例提供的一种执行SLAM的流程示意图。如图100所示,在终端上部署有SLAM系统,该终端例如可以为机器人、无人机或无人车等终端,终端通过运行SLAM系统来获取输入数据,并基于输入数据执行一系列的SLAM流程,从而完成SLAM。其中,用于执行SLAM流程的输入数据可以包括但不限于事件图像、RGB图像、深度图像和IMU数据中的一种或多种。例如,在终端上部署有事件图像传感器(例如DVS)和RGB相机,则终端上的SLAM系统的输入数据为事件图像和RGB图像。又例如,在终端上 部署有DVS、RGB相机和深度相机,则终端上的SLAM系统的输入数据为事件图像、RGB图像和深度图像。
可选地,本实施例所提及的事件图像可以通过前述图38-图44对应的方法流程来进行优化,从而得到更清晰的事件图像,以下不再赘述。
可选的,在实际应用中,在终端上可以部署有多个用于获取不同类型输入数据的设备,例如终端上部署有DVS、RGB相机和深度相机,终端可以根据当前的场景自适应性地选择用于执行SLAM的数据。例如,在高速运动或光照突变场景下,终端可以只选择事件图像作为执行SLAM的数据。也就是说,终端可以在该场景下选择只开启事件图像传感器,而关闭RGB相机和深度相机;或者,终端中的SLAM系统可以在执行SLAM的过程中,只获取事件图像传感器所传输的数据,而不获取RGB相机和深度相机所传输的数据。
在终端的SLAM系统执行SLAM流程的过程中,终端可以基于输入数据执行位姿估计,并且判断输入数据是否为关键帧。在输入数据为关键帧的情况下,基于确定的关键帧进行建图。此外,终端还可以基于确定的关键帧持续进行闭环检测,在检测到闭环的情况下执行全局优化,以持续执行SLAM流程。
为便于理解,以下将分别介绍终端执行SLAM流程的各个步骤。
a.位姿估计
可以参阅图101,图101为本申请实施例提供的一种位姿估计方法10100的流程示意图。如图101所示,该位姿估计方法10100包括以下的步骤。
步骤10101,获取第一事件图像和目标图像,该目标图像包括RGB图像或深度图像。
本实施例中,该位姿估计方法10100可以应用于SLAM场景,执行该位姿估计方法10100的主体可以为终端(或者说前述图1B的电子设备),例如用于执行SLAM的机器人终端、无人车终端或无人机终端等终端。
本实施例中,第一事件图像是由目标对象在运动传感器的监视范围内进行运动时的运动轨迹信息生成。例如该第一事件图像可以为DVS事件图,终端可以连接有DVS或者是预置有DVS,终端通过DVS监测环境,并且获取到环境对应的DVS事件图。终端可以连接有DVS或者是预置有DVS,终端通过DVS监测环境,并且获取到环境对应的DVS事件,以得到上述的第一事件图像。该终端还可以是连接或预置有用于捕捉环境信息的红绿蓝(red green blue,RGB)相机或深度相机,终端通过该RGB相机或深度相机可以获取到该环境下的RGB图像或深度图像,例如获得上述的目标图像。其中,RGB图像又称为真彩图像,它使用R、G、B 3个分量标识一个像素的颜色,R、G、B分别代表红、绿、蓝3种不同的基础颜色,通过3基色可以合成出任意颜色。
由于DVS所输出的单个事件通常携带较少信息,且容易受到噪声的影响。因此,在实际应用中,可以基于DVS所输出的多个连续的事件来形成事件图像。
在一个可能的实施例中,终端可以获取DVS所输出的N个连续的DVS事件,并且将所述N个连续的DVS事件积分为第一事件图像,N为大于1的整数。在实际应用中,N的取值可以根据实际情况来调整,例如根据DVS的灵敏度以及SLAM的精度要求确定N的取值为4、5或10等数值,本实施例并不对N的取值做具体限定。
本实施例中,终端在获取到事件图像和RGB图像之后,可以对事件图像和RGB图像执行时序对齐操作,得到时序对齐的事件图像和RGB图像,以便于后续基于时序对齐的事件图像和RGB图像执行位姿估计。由于在事件图像和RGB图像的采集过程中,终端是不断移动的,并且事件图像和RGB图像是基于不同的装置采集得到,因此为了保证事件图像和RGB图像能够共同用于执行后续的位姿估计,需要执行时序对齐操作。在执行时序对齐操作之后,能够保证时序对齐的事件图像和RGB图像是在相同的时刻或相近的时刻采集得到的,即保证了事件图像和RGB图像所采集到的环境信息是相同的。
示例性地,在获取到第一事件图像和目标图像之后,终端可以确定所述第一事件图像的获取时间和所述目标图像的获取时间。然后,终端可以根据所述目标图像的获取时间与所述第一事件图像的获取时间之间的时间差小于第二阈值,确定第一事件图像与目标图像时序对齐。其中,第二阈值可以根据SLAM的精度以及RGB相机采集RGB图像的频率来决定,例如第二阈值可以取值为5毫秒或10毫秒,本实施例并不对第二阈值的取值做具体限定。
由于第一事件图像是由N个连续的DVS事件积分得到的,终端可以根据N个连续的DVS事件所对应的获取时间来确定第一事件图像的获取时间,即确定第一事件图像的获取时间为所述N个连续的DVS事件中获取到第一个DVS事件至最后一个DVS事件的时间段。该目标图像的获取时间则可以是指终端从RGB相机接收到目标图像的时刻。由于实际上第一事件图像对应的获取时间为一个时间段,而目标图像的获取时间为一个时刻,因此终端可以基于目标图像的获取时间是否在第一事件图像对应的获取时间的范围内,来确定所述目标图像的获取时间与所述第一事件图像的获取时间之间的时间差。示例性地,如果目标图像的获取时间在第一事件图像对应的获取时间的时间段范围内,则可以确定两者之间的时间差为0(即时间差小于第二阈值);如果目标图像的获取时间不在第一事件图像对应的获取时间的时间段范围内,则可以基于第一事件图像的第一个DVS事件的获取时间或最后一个DVS事件的获取时间来确定时间差。
例如,假设N为4,终端获取到积分成第一事件图像的4个连续的DVS事件的时刻分别为t1、t2、t3、t4,则终端可以确定第一事件图像的获取时间为t1至t4的时间段;此外,终端获取到的目标图像的时刻为t5,且时刻t5在t1-t4时间段的范围外。这样,终端可以确定时刻t5与时刻t1之间的时间差1以及时刻t5与时刻t4之间的时间差2,如果时间差1或者时间差2中的任意一个时间差小于第二阈值,则可以确定第一事件图像与目标图像时序对齐。
示例性地,可以参阅图102,图102为本申请实施例提供的一种将DVS事件积分成事件图像的示意图。如图102所示,图102中第一行中的每个点表示DVS相机所采集的每一个DVS事件。在图102中,每4个DVS事件则积分成一个事件图像,积分得到的事件图像例如为图102中的Wk、Wk+1、Wk+2、Wk+3、Wk+4、Wk+5、Wk+6。可以看到,由于每两个DVS事件之间的时间间隔不相同,由不同的4个DVS事件所积分得到的事件图像的积分时间也不相同。在图102中,竖直的虚线则表示RGB相机采集得到的RGB图像,tk、tk+1、tk+2、tk+3、tk+4分别为RGB相机采集RGB图像k、RGB图像k+1、RGB图像k+2、RGB图像k+3和RGB图像k+4的时间点。由图102可以看出,事件图像Wk的获取时间与RGB图像k的获 取时间之间的时间差小于第二阈值,可以确定事件图像Wk与RGB图像k时序对齐;事件图像Wk+1的获取时间与RGB图像k以及RGB图像k+1的获取时间之间的时间差均大于第二阈值,可以确定事件图像Wk(即第二事件图像)不存在时序对齐的RGB图像。
步骤10102,确定第一事件图像的积分时间。
在第一事件图像是由多个连续的DVS事件积分得到的情况下,第一事件图像的积分时间则可以是多个连续的DVS事件之间的时间间隔。简单来说,终端可以通过确定多个连续的DVS事件中最后一个DVS事件和第一个DVS事件之间的时间间隔,来确定第一事件图像的积分时间。
例如,假设N为4,终端获取到积分成第一事件图像的4个连续的DVS事件的时刻分别为t1、t2、t3、t4,则终端可以确定第一事件图像的积分时间为t4-t1。
步骤10103,若所述积分时间小于第一阈值,确定不通过所述目标图像来执行位姿估计。
本实施例中,在终端处于高速运动或者光照突变的场景时,由于环境信息变化较快,因此DVS可以在短时间内捕捉到大量的事件,即在短时间内输出大量的事件,从而使得由固定数目事件所得到的事件图像对应的积分时间较小。在这种情况下,由于环境信息变化较快,RGB相机往往难以捕捉到有效的环境信息,例如在场景具有高速运动物体的情况下,RGB相机所采集到的RGB图像中通常难以捕捉到该高速运动物体,即在RGB图像中该高速运动物体对应的区域为一模糊区域。
因此,在第一事件图像对应的积分时间小于第一阈值时,终端可以确定RGB图像质量较低甚至无法捕捉到环境的有效信息,从而可以确定不通过目标图像来执行位姿估计。其中,第一阈值的取值可以根据SLAM的精度要求来确定,例如第一阈值的取值可以为5毫秒或7毫秒,本实施例并不对第一阈值的取值做具体限定。也就是说,终端在计算第一事件图像对应的获取时刻下的位姿时,即便终端可以确定第一事件图像具有时序对齐的目标图像,终端也仅仅是基于第一事件图像来执行位姿估计。这样,可以有效地避免采用第一事件图像和目标图像共同执行位姿估计时,由于目标图像质量较低而导致位姿估计效果较差。
在一个可能的实施例中,终端除了可以是在确定了第一事件图像时序对齐的目标图像之后,再基于第一事件图像的积分小于第一阈值确定不通过目标图像来执行位姿估计之外,终端还可以是获得第一事件图像并且确定第一事件图像的积分时间小于第一阈值之后,则确定不通过第一事件图像对应的RGB图像来执行位姿估计。也就是说,终端可以不对第一事件图像执行时序对齐操作,而直接通过第一事件图像来执行位姿估计操作,从而节省了执行时序对齐操作的资源开销。
步骤10104,根据所述第一事件图像执行位姿估计。
终端在确定不通过目标图像来执行位姿估计后,可以根据第一事件图像来执行位姿估计,以计算得到第一事件图像的获取时刻下所对应的终端的位姿。
本实施例中,在终端基于事件图像的积分时间小于阈值来确定当前处于RGB相机难以采集有效环境信息的场景时,终端确定不通过质量较差的RGB图像来执行位姿估计,以提高位姿估计的精度。
以上详细描述了终端处于高速运动或者光照突变的场景时,终端执行位姿估计的过程;以下将描述终端在处于静态或低速运动的场景时,终端执行位姿估计的过程。
在一个可能的实施例中,在终端获取到的输入信号包括DVS事件、RGB图像和IMU数据的情况下,终端将DVS事件积分得到事件图像,并对事件图像、RGB图像和IMU数据执行时序对齐,以根据时序对齐结果执行位姿估计。
具体地,终端执行时序对齐操作的过程如下:
在终端基于N个连续的DVS事件,积分得到事件图像时,终端确定与该事件图像相邻的RGB图像和IMU数据的获取时间与该事件图像的获取时间之间的时间差是否小于第二阈值,以确定该事件图像是否存在时序对齐的RGB图像和/或IMU数据。
由于IMU采集数据的频率远大于RGB相机采集图像的频率,因此,可以认为任意时刻都存在有与RGB图像时序对齐的IMU数据。这样,在终端获取到RGB图像时,终端可以确定该RGB图像的获取时间与相邻的事件图像的获取时间之间的时间差是否小于第二阈值,以确定该RGB图像是否存在时序对齐的事件图像。
基于上述终端执行时序对齐操作的过程,终端在执行时序对齐操作后,可以得到多种可能的时序对齐的信号组合。具体地,该多种可能的时序对齐的信号组合如下所示。
1、事件图像、RGB图像和IMU数据。
在终端获取到事件图像之后,终端确定与该事件图像相邻的RGB图像的获取时间。在该RGB图像的获取时间与该事件图像的获取时间之间的时间差小于第二阈值时,终端确定事件图像和RGB图像时序对齐。由于IMU采集数据的频率远大于RGB相机采集图像的频率,因此,可以认为任意时刻都存在有与RGB图像时序对齐的IMU数据。因此,在确定事件图像和RGB图像时序对齐之后,可以获取到与该事件图像以及该RGB图像时序对齐的IMU数据。
在这种情况下,终端可以根据事件图像、RGB图像和IMU数据来执行位姿估计。
2、RGB图像和IMU数据。
在获取终端获取到RGB图像之后,终端判断是否存在与该RGB图像时序对齐的事件图像,即判断该RGB图像的获取时间与相邻的事件图像的获取时间之间的时间差是否小于第二阈值。如果该RGB图像的获取时间与相邻的事件图像的获取时间之间的时间差不小于第二阈值,则终端确定该RGB图像不存在时序对齐的事件图像,即该RGB图像只有时序对齐的IMU数据。
在这种情况下,终端可以是根据RGB图像和IMU数据来执行位姿估计。
3、事件图像和IMU数据。
在终端获取到事件图像之后,终端确定与该事件图像相邻的RGB图像的获取时间。在该事件图像与该事件图像相邻的RGB图像的获取时间之间的时间差不小于第二阈值时,终端确定事件图像没有与其时序对齐的RGB图像。在确定事件图像没有与其时序对齐的RGB图像之后,终端可以继续确定是否存在与该事件图像时序对齐的IMU数据。具体地,终端确定与该事件图像相邻的IMU数据的获取时间。如果与该事件图相邻的IMU数据的获取时间与相邻的事件图像的获取时间之间的时间差小于第三阈值,则终端确定事件图像与该IMU 数据时序对齐。
在这种情况下,终端可以是根据事件图像和IMU数据来执行位姿估计。
4、事件图像。
类似地,在终端获取到事件图像之后,终端确定与该事件图像相邻的RGB图像的获取时间。在该事件图像与该事件图像相邻的RGB图像的获取时间之间的时间差不小于第二阈值时,终端确定事件图像没有与其时序对齐的RGB图像。在确定事件图像没有与其时序对齐的RGB图像之后,终端可以继续确定是否存在与该事件图像时序对齐的IMU数据。具体地,终端确定与该事件图像相邻的IMU数据的获取时间。如果与该事件图相邻的IMU数据的获取时间与相邻的事件图像的获取时间之间的时间差不小于第三阈值,则终端确定该事件图像也不存在与其时序对齐的IMU数据。
在这种情况下,终端可以是根据事件图像来执行位姿估计。
示例性地,终端获取第二事件图像,所述第二事件图像为表示目标对象在运动传感器的检测范围内产生运动时的运动轨迹的图像。其中,第二事件图像和上述的第一事件图像对应的时间段不相同,即运动传感器检测获得第一事件图像的时间段与运动传感器检测获得第二事件图像的时间段不相同。若不存在有与所述第二事件图像时序对齐的目标图像,则确定所述第二事件图像不具有用于共同执行位姿估计的目标图像。因此,终端根据所述第二事件图像执行位姿估计,例如终端只根据第二事件图像执行位姿估计或者终端根据第二事件图像和IMU数据来执行位姿估计。
在一个可能的实施例中,在采用基于滑动窗口的视觉惯性位姿估计的情况下,位姿估计的过程实质上是代价函数的联合优化过程。基于上述的多种可能的时序对齐的信号组合,可以得到不同信号组合下的代价函数。
示例性地,对于时序对齐的信号组合为事件图像、RGB图像和IMU数据,代价函数包括三项,分别为:事件相机的加权重投影误差、RGB相机的加权重投影误差和惯性误差项。具体地,该代价函数如公式35所示。
Figure PCTCN2020141973-appb-000091
其中,J表示代价函数;i表示相机索引,i为0时表示事件相机,i为1时表示RGB相机;k表示帧索引;j表示路标索引;
Figure PCTCN2020141973-appb-000092
表示传感器i在第k帧中保留的路标索引;
Figure PCTCN2020141973-appb-000093
表示路标测量值的信息矩阵;
Figure PCTCN2020141973-appb-000094
表示第k个IMU误差的信息矩阵;e s表示惯性误差项。
可选的,在事件图像的积分时间小于第一阈值时,即终端处于高速运动或者光照突变的场景时,则不通过RGB图像来求取代价函数,以提高位姿估计精度。也就是说,代价函数中包括两项,分别为事件相机的加权重投影误差和惯性误差项。简单来说,可以在公式35的基础上进行改动,以使得i的取值范围为0,从而得到代价函数对应的公式。
对于时序对齐的信号组合为RGB图像和IMU数据,则终端只通过RGB图像和IMU数据来求取代价函数。也就是说,代价函数中包括两项,分别为RGB相机的加权重投影误差和惯性误差项。简单来说,可以在公式35的基础上进行改动,以使得i的取值范围为1,从 而得到代价函数对应的公式。
对于时序对齐的信号组合为事件图像和IMU数据,则终端只通过事件图像和IMU数据来求取代价函数。也就是说,代价函数中包括两项,分别为事件相机的加权重投影误差和惯性误差项。
对于时序对齐的信号组合为事件图像,则终端只通过事件图像来求取代价函数。也就是说,代价函数中只包括一项,为事件相机的加权重投影误差。
在位姿估计过程中,位姿的估计往往是一个递推的过程,即由上一帧位姿解算当前帧位姿。这样,位姿估计过程中的误差便会一帧一帧地传递下去,形成累积误差。因此,在执行位姿估计的过程中,终端还可以执行回环检测,以减小位姿估计的累积误差,提高位姿估计的精度。其中,回环检测,又称闭环检测,是指识别终端曾经到达的某一个场景,使得地图闭环的过程。通过回环检测,可以判断终端是否回到了先前经过的位置。如果检测到回环,则将信息传递给后端进行优化处理,以消除累积误差。
在一个可能的实施例中,终端根据所述第一事件图像和字典执行回环检测,所述字典为基于事件图像所构建的字典。
可选的,在执行回环检测之前,终端可以预先基于事件图像构建字典,以便于在执行回环检测的过程中能够基于字典执行回环检测。具体地,终端构建字典的过程包括:终端获取多个事件图像,所述多个事件图像为用于训练的事件图像,所述多个事件图像可以是终端在不同的场景下所拍摄的事件图像。终端通过特征提取算法,获取所述多个事件图像的视觉特征,视觉特征例如可以包括图像的纹理、图案或灰度统计等特征。不同场景下所拍摄的事件图像具有不同的视觉特征,因此可以通过视觉特征来表示场景中的各个要素。在获取得到多个事件图像的视觉特征之后,终端通过聚类算法对所述视觉特征进行聚类,得到聚类后的视觉特征,所述聚类后的视觉特征具有对应的描述子。通过对视觉特征进行聚类,可以将相似的视觉特征归为一类,以便于后续执行视觉特征的匹配。根据所述聚类后的视觉特征,构建所述字典。
示例性地,在终端提取得到多个事件图像中的视觉特征之后,可以得到每个视觉特征对应的描述子,例如ORB描述子或BRIEF描述子,该描述子用于表示视觉特征。然后,通过层次k均值(Hierarchical K-means)聚类算法或者K-means++聚类算法,将多个视觉特征归入k个簇(cluster)中,每一个簇通过其质心(centroid)来描述,即得到每个簇的描述子。其中,视觉特征聚类的质量通常可以用同一个簇的误差平方和(Sum of Squared Error,SSE)来表示,SSE越小表示同一个簇的数据点越接近于其质心,聚类效果也越好。这里的“接近”可以是使用距离度量方法来实现的,不同的距离度量方法也会对聚类效果造成影响。
在构建字典的过程中,可以将聚类后的所有N个描述子分散在一个k分支,d深度的k叉树的叶子节点上,从而得到有k d个叶子结点的树结构。在实际应用中,可以根据场景大小,以及需要达到的效果调整k和d的数值。这样,在检索事件图像的视觉特征时,可以通过对数时间的复杂度(d次=log kN)找到其对应的聚类中心,而需要使用复杂度较高的 暴力检索。
在得到字典之后,终端根据所述第一事件图像和字典执行回环检测,具体可以包括:终端确定所述第一事件图像的描述子,例如终端通过特征提取算法提取第一事件图像中的视觉特征,并确定提取得到的视觉特征的描述子。终端在所述字典中确定所述第一事件图像的描述子对应的视觉特征,例如终端在字典的k叉树中检索与第一事件图像的描述子匹配的视觉特征。终端基于所述视觉特征确定所述第一事件图像对应的词袋向量(BoW vector),并确定所述第一事件图像对应的词袋向量与其他事件图像的词袋向量之间的相似度,以确定所述第一事件图像所匹配的事件图像。
简单来说,终端基于事件图像所构建的字典可以认为是整个场景中所有视觉特征的集合。终端基于当前事件图像在字典中确定对应的视觉特征则相当于是:终端在字典中查找当前事件图像所包括的视觉特征。基于当前事件图像所包括的视觉特征,可以构成词袋向量,例如在该词袋向量中,当前事件图像所包括的视觉特征表示为1,当前事件图像不包括的视觉特征表示为0。最后,通过比较不同的事件图像之间的词袋向量的相似度,即可确定两个事件图像之间是否是匹配的。如果两个事件图像之间的词袋向量的相似度大于或等于预设阈值,则可以确定两个事件图像匹配;如果两个事件图像之间的词袋向量的相似度小于预设阈值,则可以确定两个事件图像不匹配。
b.关键帧
关键帧是视频或者图像集中能够代表该视频或者图像集关键信息的图像帧,通常关键帧连接的两段内容有较大变化。随着视频数据量日益增长,关键帧在视频分析、视频编码、安防监控以及机器人视觉等领域广泛应用。
关键帧选择是视频分析中的基本部分,通过关键帧选择能够提供用于视频索引、浏览、检索和检测等的适当视频摘要。关键帧的使用降低了视频数据流在内容和时间上的冗余度,既能有效反映视频内容,又显著减少了视频分析时间。
视频编码过程中,需要动态的加入编码关键帧,以保证图像质量和编码比特率符合要求。通常情况下,当图像内容发生明显变化时,就需要插入关键帧。
视频监控作为安全防范的有效手段被广泛应用于很多领域,由于全天候监控会产生大量的视频数据,但是用户感兴趣的只是其中有显著变化的那一小部分,因此,关键帧提取技术能够筛选出用户感兴趣的关键帧序列。
近年来随着机器人、无人机、无人车、AR/VR等设备日益火爆,视觉同步定位与建图(visual simultaneous localization and mapping,VSLAM)作为该领域的关键技术之一,也为大家所熟知。VSLAM是指运动物体根据传感器的信息,一边计算自身位置,一边构建环境地图的过程,能够用于实现运动物体自身的定位,以及后续的路径规划和场景理解。在VSLAM中,通常使用关键帧进行建图和定位,这样可以避免因逐帧插入导致系统实时性降低、计算代价增加以及系统内存消耗过大的问题。
在上述的视频分析、视频编码、安防监控以及机器人视觉等领域中,均可以采用DVS获取到相应的事件图像,并且在获取到的多个事件图像中选择所需的关键帧。
在相关技术中,对事件图像进行关键帧选择的方式是对所有的事件图像都进行特征提 取、位姿估计等复杂计算后,才确定事件图像是否为关键帧。由于需要对所有的事件图像都进行复杂计算,导致该方案的计算量较大。
可以参阅图103,图103为本申请实施例提供的一种关键帧选择方法10300的流程示意图。如图103所示,该关键帧选择方法10300包括以下的步骤。
步骤10301,获取事件图像。
本实施例中,该关键帧选择方法10300可以应用于视频分析、视频编解码或安防监控等场景,执行该关键帧选择方法10300的主体可以为终端或服务器,例如用于执行视频分析的服务器、执行视频编解码的终端或服务器,或者用于执行监控的终端。为便于叙述,以下将以终端为执行主体为例,对本申请实施例提供的关键帧选择方法10300进行描述。
本实施例中,终端可以连接有DVS或者是预置有DVS,终端通过DVS监测目标环境,并且获取到目标环境对应的事件图像。
步骤10302,确定所述事件图像的第一信息。
其中,第一信息可以包括事件图像中的事件和/或特征,终端可以通过检测事件图像中的事件和/或特征来确定第一信息。
在一个可能的示例中,如果该事件图像中的像素表示光强的变化趋势,则该事件图像为二值图像,终端可以确定像素值不为0的像素为该事件图像中的事件。也就是说,值不为0的像素的个数即为事件图像中的事件数量。
在另一个可能的示例中,如果该事件图像中的像素表示绝对光强,则该事件图像为灰度图像。这样,终端可以确定该事件图像中像素值超过一定阈值的像素为该事件图像中的事件,即像素值超过一定阈值的像素的个数则为该事件图像中的事件数量。或者,终端也可以是通过将当前事件图像中的像素值与上一时刻相邻的事件图像中对应的像素值相减并取绝对值,从而确定绝对值超过一定阈值的像素为事件图像中的事件。
对于事件图像中的特征,终端可以通过特征提取算法来提取事件图像中的特征。其中,该特征提取算法可以包括但不限于加速分段测试特性(Features from Accelerated Segment Test,FAST)、(Oriented FAST and Rotated BRIEF,ORB)、加速鲁棒性特征(Speeded Up Robust Features,SURF)、尺度不变性特征变换(Scale-invariant feature transform,SIFT)等算法。在提取得到事件图像中的特征之后,终端通过统计提取得到的特征,即可确定该事件图像的特征数量。
步骤10303,若基于所述第一信息确定所述事件图像满足第一条件,则确定所述事件图像为关键帧。
在一个可能的示例中,所述第一条件可以包括事件数量大于第一阈值、事件有效区域的数量大于第二阈值、特征数量大于第三阈值和特征有效区域的数量大于第四阈值中的一个或多个。也就是说,终端在基于第一信息确定事件图像满足事件数量大于第一阈值、事件有效区域大于第二阈值、特征数量大于第三阈值和特征有效区域的数量大于第四阈值中的一个或多个时,终端可以确定该事件图像为关键帧。
在第一条件包括事件有效区域的数量大于第二阈值的情况下,终端可以将该事件图像划分为多个区域,并且确定每个区域中的事件数量。在区域的事件数量大于一定阈值时, 终端可以确定该区域为有效区域。这样,终端可以通过统计有效区域的数量是否大于第二阈值,来确定该事件图像是否满足第一条件。其中,区域内的事件数量对应的阈值可以是根据区域的划分方式确定的,本实施例并不对该阈值做具体限定。
终端将事件图像划分为多个区域的方式可以有多种。在一种可能的实现方式中,终端可以是将事件图像平均地划分为多个区域,例如将事件图像均分为1030个区域,每个区域的面积均相同。在另一种可能的实现方式中,终端可以是非均匀地将事件图像划分为多个区域,例如在该事件图像的中间位置划分得到的区域的面积较小,在该事件图像边缘位置划分得到的区域的面积则较大。示例性地,可以参阅图104,图104为本申请实施例提供的一种事件图像的区域划分示意图。如图104中的(a)所示,事件图像被均匀地划分为1030个区域,每个区域的面积均相同。如图104中的(b)所示,事件图像被非均匀地划分为多个区域,并且该事件图像边缘位置的区域的面积大小为中间位置的区域的面积大小的4倍。
在第一条件包括特征有效区域的数量大于第四阈值的情况下,终端可以将该事件图像划分为多个区域,并且确定每个区域中的特征数量。在区域的特征数量大于一定阈值时,终端可以确定该区域为特征有效区域。这样,终端可以通过统计特征有效区域的数量是否大于第四阈值,来确定该事件图像是否满足第一条件。其中,区域内的特征数量对应的阈值可以是根据区域的划分方式确定的,本实施例并不对该阈值做具体限定。
此外,终端将事件图像划分为多个区域的方式与前述确定事件有效区域时的划分方式类似,具体可以参考上述的描述,此处不再赘述。
在一个可能的实施例中,终端可以是获取多个DVS产生的且时序对齐的事件图像,此时从其中任选1帧进行上述关键帧选择,如果满足上述的第一条件,则将当前的多个事件图像确定为关键帧。
在一个可能的实施例中,该事件图像还可以具有时序对齐的深度图像。例如,在配置有深度相机的情况下,可以由深度相机产生与事件图像时序对齐的深度图像。在这种情况下,如果事件图像满足第一条件,则可以将该事件图像以及与该事件图像时序对齐的深度图像均确定为关键帧。
在一个可能的实施例中,该事件图像还可以具有对应的RGB图像,该RGB图像与该事件图像时序对齐。也就是说,终端可以获取到时序对齐的事件图像和RGB图像。在这种情况下,终端可以获取RGB图像对应的特征数量和/或特征有效区域。通过确定RGB图像对应的特征数量是否大于特定阈值和/或RGB图像对应的特征有效区域是否大于特定阈值,来确定该RGB图像是否满足特定的条件。这样,终端可以通过确定RGB图像是否满足特定的条件和/或事件图像是否满足第一条件,来确定是否将该RGB图像和事件图像确定为关键帧。需要说明的是,RGB图像的特征数量对应的特定阈值和RGB图像的特征有效区域对应的特定阈值可以是指不同的阈值。
示例性地,在终端确定RGB图像对应的特征数量大于特定阈值或该RGB图像对应的特征大于特定阈值时,终端可以确定该RGB图像以及对应的事件图像为关键帧。在终端确定事件图像满足第一条件时,终端也可以确定该事件图像以及对应的RGB图像为关键帧。
本实施例中,通过确定事件图像中的事件数量、事件分布、特征数量和/或特征分布等信息,来判断当前事件图像是否为关键帧,能够实现关键帧的快速选择,算法量小,能够满足视频分析、视频编解码或安防监控等场景的关键帧快速选择。
可以参阅图105,图105为本申请实施例提供的一种关键帧选择方法10500的流程示意图。如图105所示,该关键帧选择方法10500包括以下的步骤。
步骤10501,获取事件图像。
步骤10502,确定所述事件图像的第一信息,所述第一信息包括所述事件图像中的事件和/或特征。
本实施例中,该关键帧选择方法10500可以应用于VSLAM场景,执行该关键帧选择方法10500的主体可以为终端,例如机器人终端、无人车终端或无人机终端。
其中,步骤10501和步骤10502与上述的步骤10301和步骤10302类似,具体可参考上述的步骤10301和步骤10302,此处不再赘述。
步骤10503,若基于所述第一信息确定所述事件图像满足第一条件,则确定所述事件图像的第二信息,所述第二信息包括所述事件图像中的运动特征和/或位姿特征,所述第一条件与事件数量和/或特征数量相关。
本实施例中,基于所述第一信息确定所述事件图像满足第一条件与上述步骤10303类似,具体可以参考上述的步骤10303,此处不再赘述。
其中,所述第二信息可以包括所述事件图像中的运动特征和/或位姿特征,终端可以通过检测事件图像中的事件和/或特征来确定第一信息。
在一个可能的实施例中,终端确定第二信息的方式可以是采用极线约束方法。该极线约束方法包括以下的步骤。
终端将第一个关键帧(即第一个被确定为关键帧的事件图像)的三维位姿初始化为坐标系原点。
终端确定当前事件图像的特征,并且将该事件图像的特征与上一个关键帧的特征进行匹配,得到匹配点对。其中,终端将该事件图像的特征与上一个关键帧的特征进行匹配的方式包括但不限于暴力搜索的方式,该暴力搜索的方式即为遍历该事件图像中的特征,并且逐一确定每个特征在上一个关键帧中是否有匹配的特征。
终端通过随机抽样一致性算法(Random sample consensus,RANSAC)从上述匹配点对中选取符合6自由度相对运动模型且数量尽可能多的子样本集。当符合相对运动模型的匹配点对数量大于预置阈值时,对找到的匹配点对用最小二乘法计算出当前时刻事件图像与关键帧图之间的三维空间相对运动矩阵。终端根据计算得到的三维空间相对运动矩阵,即可计算当前事件图像相对于上一个关键帧的运动变化情况,即运动特征以及位姿特征。
步骤10504,若基于所述第二信息确定所述事件图像满足第二条件,确定所述事件图像为关键帧,所述第二条件与运动变化量和/或位姿变化量相关。
其中,该第二条件可以包括:当前事件图像相对上一个关键帧的距离超过预设距离值(该预设距离值例如可以为10mm)、当前事件图像相对上一个关键帧的旋转角度超过预设角度值(该预设角度值例如可以为10°)、当前事件图像相对上一个关键帧的距离超 过预设距离值且旋转角度超过预设角度值以及当前事件图像相对上一个关键帧的距离超过预设距离值或旋转角度超过预设角度值中的一个或多个。
也就是说,终端可以基于事件图像中的运动变化量和位姿变化量中的一个或多个来确定事件图像是否满足第二条件,从而确定该事件图像是否可以作为关键帧。
本实施例中,通过设置粗筛条件,以较小的计算量对图像进行粗筛,将满足粗筛条件的图像加入关键帧序列中,然后再基于细筛条件筛选关键帧序列中的图像,从而实现关键帧的选择。由于通过较小的计算量预先筛选了部分不满足条件的图像,然后再在满足条件的图像中进行关键帧选择,不需要对所有的图像都进行较大运算量的计算,能够降低计算量。
在一个可能的实施例中,在终端获取到的输入为多路事件图像流的情况下,终端可以选择任意1路事件图像按照上述方法计算运动特征和位姿特征;终端还可以是选择任意2路或者多路事件图像,通过双目或者多目的方式计算运动特征和位姿特征。
在一个可能的实施例中,该事件图像还可以具有同步的深度图像。例如,在配置有深度相机的情况下,可以由深度相机产生与事件图像同步的深度图像。在这种情况下,如果事件图像满足第一条件和第二条件,则终端可以将该事件图像和对应的深度图像确定为关键帧。此外,在步骤10503中,在获得事件图像对应的深度图像的情况下,终端能够获取到相应的深度信息,因此终端也可以是通过(Perspective-N-Points,PnP)算法或者迭代最近点(Iterative Closest Point,ICP)算法来计算运动特征和位姿特征。
在一个可能的实施例中,该事件图像还可以具有同步的RGB图像,该RGB图像与该事件图像时序对齐。也就是说,终端可以获取到时序对齐的事件图像和RGB图像。在这种情况下,终端在基于第一信息确定事件图像满足第一条件之后,终端可以是通过判断事件图像是否满足第二条件和/或RGB图像是否满足第二条件,来确定是否将该事件图像及其对应的RGB图像确定为关键帧。例如,终端在确定RGB图像满足第二条件时,终端可以将该事件图像及其对应的RGB图像确定为关键帧;终端也可以是在确定事件图像以及RGB图像均满足第二条件时,确定该事件图像及其对应的RGB图像为关键帧。其中,终端在确定RGB图像是否满足第二条件的过程中,终端可以先基于RGB图像确定对应的运动特征和位姿特征,终端确定RGB图像对应的运动特征和位姿特征的过程与确定事件图像对应的运动特征和位姿特征的过程类似,具体可以参考上述步骤10503的描述,此处不再赘述。
在一个可能的实施例中,在该事件图像具有同步的RGB图像的情况下,在某些场景下,例如需要生成高质量的纹理图的3D重建场景,对RGB图像的清晰度和亮度一致性要求较高,因此,此时选择关键帧还可以考虑RGB图像的清晰度和亮度一致性。
具体地,终端可以是通过判断事件图像是否满足第二条件、事件图像或RGB图像的清晰度是否大于清晰度阈值和/或事件图像或RGB图像的亮度一致性指标是否大于预设指标阈值,来确定是否将事件图像及其对应的RGB图像确定为关键帧。
示例性地,终端可以是根据事件图像满足第二条件来确定事件图像及其对应的RGB图像为关键帧;终端也可以是根据事件图像或RGB图像的清晰度大于清晰度阈值来确定事件 图像及其对应的RGB图像为关键帧;终端还可以是根据事件图像或RGB图像的亮度一致性指标是否大于预设指标阈值来确定事件图像及其对应的RGB图像为关键帧。此外,终端还可以是根据事件图像满足第二条件且事件图像或RGB图像的清晰度大于清晰度阈值,或者RGB图像的清晰度大于清晰度阈值且事件图像或RGB图像的亮度一致性指标大于预设指标阈值,来确定事件图像及其对应的RGB图像为关键帧。
具体地,终端确定RGB图像的清晰度的方法可以包括但不限于Brenner梯度方法、Tenengrad梯度方法、Laplacian梯度方法和方差方法等方法。以Brenner梯度方法为例,终端可以计算相邻两个像素灰度差的平方,该函数定义如下:
D(f)=∑ yx|f(x+2,y)-f(x,y)| 2
其中,f(x,y)表示图像f对应像素点(x,y)的灰度值,D(f)为图像清晰度计算结果。
由上述函数可知,计算RGB图像清晰度的过程中,RGB图像中的所有像素均参与计算,计算量较大。
本实施例中,终端确定事件图像的清晰度的方法同样可以包括但不限于上述的Brenner梯度方法、Tenengrad梯度方法、Laplacian梯度方法和方差方法等方法。并且,终端基于事件图像来计算清晰度,可以将计算结果除以参与计算的像素数量进行归一化,将上述归一化的结果作为最终的清晰度计算结果。这样,由于在计算事件图像的清晰度的过程中,只有事件响应的像素才参与上述计算,能够尽可能地减小终端的计算量。
终端计算RGB图像的亮度一致性指标的方法包括但不限于如下方法:
1、计算当前RGB图像的平均亮度,即首先将RGB图像所有像素的亮度值求和,然后除以像素数量求得RGB图像的亮度均值。类似地,基于前述的方式计算相邻的RGB图像关键帧的平均亮度。最后,计算当前RGB图像的平均亮度和相邻关键帧的平均亮度的差值的绝对值,并将该绝对值作为RGB图像的亮度一致性指标。
2、将当前RGB图像和相邻的RGB图像关键帧逐像素求差(即计算每组对应的像素之间的亮度差),并计算差值的绝对值。然后对每组像素对应的绝对值进行求和运算,最后将得到的求和结果除以像素数量,得到归一化结果,该归一化结果即可作为亮度一致性指标。
由上述终端计算RGB图像的亮度一致性指标的方法可知,基于RGB图像来计算亮度一致性指标时,RGB图像中的所有像素均参与计算,计算量较大。本实施例中,终端可以基于事件图像来计算亮度一致性指标,从而使得只有事件响应的像素才参与上述计算,能够尽可能地减小终端的计算量。示例性地,终端计算事件图像的亮度一致性指标的方法如下:
1、如果事件图像中的像素表示光强变化极性,则终端可以先计算当前事件图像的事件数量与相邻事件图像关键帧的事件数量的差值的绝对值,然后将该绝对值除以事件图像的像素数量所得到的结果作为亮度一致性指标。
2、如果事件图像中的像素表示光强,则将当前事件图像和相邻的事件图像关键帧逐像素求差(即计算每组对应的像素之间的亮度差),并计算差值的绝对值。然后对每组像素对应的绝对值进行求和运算,最后将得到的求和结果除以像素数量,得到归一化结果,该归一化结果即可作为亮度一致性指标。
在一个可能的实施例中,除了具有对应的RGB图像,该事件图像还可以具有同步的深 度图像。例如,在配置有深度相机的情况下,可以由深度相机产生与事件图像同步的深度图像。在这种情况下,如果事件图像满足第一条件和第二条件,则终端可以将该事件图像、RGB图像和对应的深度图像确定为关键帧。此外,在获得事件图像对应的深度图像的情况下,终端能够获取到相应的深度信息,因此终端也可以是通过PnP算法或者ICP算法来计算运动特征和位姿特征。
c.动态SLAM
对于采用了SLAM技术的运动物体来说,为了实现自主移动,其需要具备感知所在环境和对自身位姿进行准确估计的功能。相关技术中,运动物体在移动过程中通过相机采集环境图像,对环境图像进行特征点提取和帧间匹配,可以得到对关键点坐标变化的观测数据。然后,建立观测信息和位姿之间的函数关系,并使用最优化方法求解该函数的极值,最终可以得到估计出的位姿信息。
目前,相关技术中用于实现位姿估计的算法均是适用于静态场景,即场景中没有动态的物体,在动态场景下该算法通常难以实现准确的位姿估计。
有鉴于此,本申请实施例提供一种位姿估计方法,通过事件图像来捕捉场景中的动态区域,并基于该动态区域进行位姿确定,从而能够准备地确定位姿信息。
可以参阅图106,图106为本申请实施例提供的一种位姿估计方法1060的流程示意图。如图106所示,该位姿估计方法1060包括以下的步骤。
步骤10601,获取事件图像和所述事件图像对应的图像,所述事件图像和所述图像所捕捉的环境信息相同。
本实施例中,该位姿估计方法1060可以应用于SLAM场景,执行该位姿估计方法1060的主体可以为终端,例如用于执行SLAM的机器人终端、无人车终端或无人机终端等终端。
本实施例中,事件图像是由目标对象在运动传感器的监视范围内进行运动时的运动轨迹信息生成。例如该事件图像可以为DVS事件图,终端可以连接有DVS或者是预置有DVS,终端通过DVS监测环境,并且获取到环境对应的DVS事件图。该终端还可以是连接或预置有用于捕捉环境信息的相机,例如深度相机或者RGB相机,终端通过该相机可以获取到相应的环境图像,例如通过深度相机获取到该环境下的深度图像,或者通过RGB相机获取到该环境下的红绿蓝(red green blue,RGB)图像。RGB图像又称为真彩图像,它使用R、G、B 3个分量标识一个像素的颜色,R、G、B分别代表红、绿、蓝3种不同的基础颜色,通过3基色可以合成出任意颜色。
在一个可能的实施例中,终端在获取到事件图像和目标图像之后,终端可以将事件图像和目标图像进行对齐,从而得到与事件图像对应的目标图像。示例性地,终端可以通过匹配时域最近邻信号的方式和标定来使得事件图像与目标图像在时域上对齐。也就是说,对齐后的事件图像和目标图像可以认为是在相同的时刻下捕捉到了相同场景下的环境信息。
步骤10602,确定所述事件图像中的第一运动区域。
可以理解的是,由于DVS仅捕捉场景中动态变化的部分,且DVS且对动态变化的物体边缘响应强烈,因此,终端可以基于事件图像的响应来确定事件图像中的运动区域,即确定发生了动态变化的区域。
在事件图像的采集过程中,DVS可以是静止或运动的。在DVS静止的情况下,DVS所采集到的事件图像中的事件则为当前场景下发生移动的物体。在DVS运动的情况下,当前场景下静止不动的物体以及发生了移动的物体均与DVS发生了相对移动,因此,DVS所采集到的事件图像中的事件则可以包括当前场景下静止不动的物体以及发生了移动的物体。也就是说,对于DVS在不同运动状态下所采集的事件图像,终端确定事件图像中的运动区域的方式可以是不一样的。
在一个可能的实施例中,在DVS在静止状态下采集到事件图像的情况下,终端可以先对事件图像进行二值化处理,即事件图像中有事件响应的像素点设置为1,事件图像中没有事件响应的像素点则设置为0,从而得到该事件图像对应的二值图像。然后,终端检测该二值图像中的轮廓,如果轮廓所包围的面积大于设定的阈值,则可以确定轮廓所包围的区域为运动区域。其中,该设定阈值例如可以为10个像素或106个像素,也就是说,如果轮廓所包围的区域中超过10个像素或106个像素,则可以确定该轮廓所包围的区域为运动区域。
应理解,终端所获取到的事件图像中可能会存在有一定的噪声,即场景中没有发生运动的区域在事件图像中也可能有对应的像素。这样,通过预先设定阈值来确定事件图像中的运动区域,可以尽可能地去除事件图像中的噪声,从而避免将事件图像中的噪声区域确定为运动区域。
在另一个可能的实施例中,在DVS在运动状态下采集到事件图像的情况下,终端可以获取当前事件图像(即当前时刻采集得到的事件图像)以及上一帧事件图像(即上一个时刻采集得到的事件图像),并计算当前事件图像和上一帧事件图像的光流。其中,光流是2D矢量场,表示每个像素在相邻帧之间相对位置的位移向量。在计算得到光流之后,终端可以遍历当前事件图像每个像素的位移向量,如果当前像素的位移方向与周围像素的不一致,或者当前像素的位移方向与周围像素一致但位移大小的差值大于预设阈值时,则将该像素标记为属于运动区域(例如将该像素标记为1,以指示其属于运动区域),否则标注为属于静止区域(例如将该像素标记为0以指示其属于静止区域),从而得到标记图像(即得到标记有1和0的二值图像)。其中,该预设阈值例如可以为5个像素或10个像素,即某一像素的位移大小与该像素周围像素的位移大小之间的差值大于5个像素或10个像素时,则可以将该像素标记为运动区域。在得到标记图像之后,终端可以检测该图像中被标记为属于运动区域的像素,从而得到由这些像素所构成的轮廓,并且终端可以确定该轮廓所包围的区域为第一运动区域,除第一运动区域之外的区域则为静止区域。
步骤10603,根据所述第一运动区域确定所述图像中对应的第二运动区域。
对于该图像而言,该图像中的每个像素均在事件图像中有对应的像素,因此,终端基于事件图像中的第一运动区域,可以确定该图像中与第一运动区域对应的第二运动区域。其中,第二运动区域与第一运动区域所对应的环境信息相同。例如,该事件图像可以为DVS在室内场景捕捉到的事件图,且该室内场景下存在有移动的行人,即该事件图像中的第一运动区域则为行人所在的区域,该事件图像对应的图像中的第二运动区域则同样为行人所在的区域。
示例性地,终端将该图像中与事件图像中的第一运动区域对应的像素保留,并且剔除其他的像素后所得到的区域则为该图像中的第二运动区域。
步骤10604,根据所述图像中的第二运动区域进行位姿估计。
本实施例中,在相机采集图像的过程中,相机可以是静止的,也可以是运动的。也就是说,终端所获取到的图像可以是相机在静止状态下的采集到的图像,也可以是相机在运动状态下所采集到的图像。对于相机在不同状态下所采集到的图像,终端基于图像确定位姿的方式也可以是不同的。
方式一、该图像为相机在静止状态下采集到的图像。
在相机处于静止状态时,相机在相同的场景下采集多个不同的图像。因此,对于该场景中静止不动的物体,相机相对于该物体的位姿是没有发生变化的,即相对于该物体,相机的位置和姿态并没有发生变化。然而,对于该场景中移动的物体,相机相对于该物体的位姿是发生了变化的,即相机的位置或姿态发生了变化。例如,在相机采集室内场景下的环境信息时,在相机处于静止状态的情况下,相对于室内静止不动的柱子,相机的位姿是没有发生变化的;相对于室内在移动的人,相机的位姿则发生了变化。
这样,由于相机相对于静止物体的位姿是没有变化的,因此,终端可以基于运动物体来确定相机的位姿。也就是说,终端可以基于获取到的图像中的第二运动区域来确定相机的位姿,而不需要基于图像中的静止区域来确定相机的位姿。
具体地,在该图像为RGB图像的情况下,终端可以提取该图像中的第二运动区域的特征点并与上一帧图像中的特征点匹配,得到多对特征点。或者,终端可以通过光流来进行匹配,以得到多对特征点。然后,对于每一对特征点,终端可以按照静态场景VSLAM的方法进行姿态估计,对于当前帧运动区域的非特征点,则通过插值计算位姿。
其中,特征点是指图像灰度值发生剧烈变化的点或者在图像边缘上曲率较大的点(即两个边缘的交点)。图像特征点在基于特征点的图像匹配算法中有着十分重要的作用。图像特征点能够反映图像本质特征,能够标识图像中目标物体。通过特征点能够完成图像的匹配。
在该图像为深度图像的情况下,则利用ICP算法匹配,然后对于每一对匹配点按照静态场景VSLAM的方法进行姿态估计,如果当前帧运动区域存在没有匹配上的像素,则通过插值计算位姿。上述位姿估计方法计算量较大,一种可选的方法是,首先对深度图像运动区域进行采样(例如等间隔采样、或者关键点检测等),对上述采样点进行姿态估计,非采样点的位姿通过采样点的位姿插值得到。
方式二、该图像为相机在运动状态下采集到的图像。
在相机处于运动状态时,对于场景中静止不动的物体以及移动的物体,相机的位姿均发生了变化,并且相机相对于静止不动的物体的位姿变化量与相机相对于移动物体的位姿变化量是不同的。例如,在相机采集室内场景下的环境信息时,在相机处于向右移动状态的情况下,相对于室内静止不动的柱子,相机的位姿发生了变化;相对于室内向左移动的人,相机的位姿也发生了变化,且相机相对于人的位姿变化量大于相机相对于柱子的位姿变化量。
这样,终端可以基于场景中的静止物体和/或运动物体来确定相机的位姿,即终端可以基于获取到的图像中的第二运动区域和/或图像中的静止区域来确定相机的位姿。以下将介绍终端基于图像中不同的区域来确定相机位姿的过程。
1、终端基于图像中的静止区域来确定相机位姿。
可以参阅图107,图107为本申请实施例提供的一种基于图像的静止区域来执行位姿估计的流程示意图。如图107所示,终端可以基于事件图像以及深度图像或RGB图像进行图像的静止区域的检测。具体地,在确定了深度图像或RGB图像中的运动区域之后,终端剔除该深度图像或RGB图像中的运动区域对应的像素后,剩下的区域则为该深度图像或RGB图像中的静止区域。然后,终端可以按照静态场景VSLAM的方法对该深度图像或RGB图像中的静止区域进行位姿估计。
2、终端基于图像中的运动区域来确定相机位姿。
可以参阅图108a,图108a为本申请实施例提供的一种基于图像的运动区域来执行位姿估计的流程示意图。如图108a所示,终端可以基于事件图像以及深度图像或RGB图像进行图像的静止区域的检测。具体地,在确定了深度图像或RGB图像中的运动区域之后,终端剔除该深度图像或RGB图像中除运动区域之外的像素,剩下的区域则为该深度图像或RGB图像中的运动区域。然后,终端可以按照静态场景VSLAM的方法对该深度图像或RGB图像中的运动区域进行位姿估计。
3、终端基于图像中的运动区域和静止区域来确定相机位姿。
可以参阅图108b,图108b为本申请实施例提供的一种基于图像的整体区域来执行位姿估计的流程示意图。如图108b所示,终端可以基于事件图像以及深度图像或RGB图像进行图像的静止区域以及动态区域的检测,分别检测得到深度图像或RGB图像中的静止区域以及动态区域。其中,终端进行图像的静止区域的检测的过程与上述图107对应的实施例的过程类似,具体可以参考上述图107对应的实施例;终端进行图像的运动区域的检测的过程与上述图108a对应的实施例的过程类似,具体可以参考上述图108a对应的实施例,在此不再赘述。然后,终端可以按照静态场景VSLAM的方法对该深度图像或RGB图像中的静止区域以及运动区域分别进行位姿估计。
此外,除了前述的应用场景之外,本申请提供的方法还可以应用于其他更详细的场景,如眼动跟踪、检测识别等场景,眼动跟踪可以包括远程眼动跟踪、AR/VR近眼眼动跟踪、注视响应交互等,检测识别可以包括运动目标定位、人脸检测识别、车载检测识别、手势识别或者安防场景下的检测识别等。例如,如在得到更清晰的事件图像之后,还可以结合事件图像进行更进一步地处理,基于更清晰的事件图像进行眼动跟踪、注视响应、安防场景下检测识别或者车载检测识别等应用场景,下面示例性地对本申请提供的方法的一些更详细的应用场景进行介绍。
场景一、眼动跟踪
首先,对于穿戴式的AR/VR眼镜,摄像头靠近眼部,且与眼部的距离的相对固定,便于捕捉眼部动作信息。由于DVS相机跟踪动态物体更快速,且能够输出运动变化信息,比传统摄像头跟有利于进行眼动跟踪。
在一种眼动跟踪场景中,可以使用DVS传感器和红外传感器来构建AR/VR眼镜,其结构可以如图109所示。其中,DVS传感器的数量可以是一个或者多个,如每个镜框设置一个DVS传感器,红外光源的数量也可以是一个或者多个,用于产生红外光源,照射在角膜上产生闪烁点,即普尔钦斑(Purkinje image),该闪烁点由进入瞳孔的光线是在角膜外表面上反射(cornealreflection,CR)而产生的。由于眼球近似球体,照射在上面的闪烁点位置基本不会随着眼球的转动而改变。利用一个或者多个闪烁点和光源位置计算获得角膜曲率中心,并作为眼动视觉的锚点位置信息坐标。根据实时跟踪眼动变化,DVS传感器产生四元组信息[X,Y,t,e],其中X,Y为位置信息;t为时间信息;e为事件变化信息。然后即可使用DVS输出的信息,通过本申请提供的方法进行运动补偿,得到更清晰的事件图像。然后可以根据DVS和用户眼部的相对位置关系,以及眼球、虹膜、瞳孔几何模型,基于事件在事件图像中的像素坐标(x,y)去反推眼球在水平面和垂直面的旋转角度,计算出人眼相对于DVS摄像机的视线角度。该事件图像可以通过本申请前述的运动补偿的方式进行优化,得到更清晰的事件图像。随后,基于DVS摄像机与屏幕的相对关系(比如屏幕上有双目摄像机,能定位人头相对于屏幕的空间位置),结合人眼相对于头的视线角度,来估计落在屏幕上的视点位置,实现眼动跟踪。
在另一种眼动跟踪场景中,还可以使用DVS与眼动仪融合,来实现更准确的眼动跟踪。例如,眼动仪以小于1000HZ的频率采集视点,DVS在1000HZ的间隙采集视点。融合眼动仪和DVS采集到的视点得到更高时间精度的眼动数据。
在另一种眼动跟踪场景中,DVS传感器还可以上用于远程眼动跟踪,例如,如图13所示,可以应用于通过手机和平板终端设备实现眼动跟踪。此类设备,由于眼部与传感器之间的距离较远,且距离是变化的,可采用与前述图109中的场景类似的方式,通过多个传感器来确定三维坐标系中的角膜中心和眼球运动中心,进而与屏幕进行交互。
在一种注视响应的场景中,如图110中所示的结构还可以用于感知眼睛注视,如果DVS感知到用户在屏幕上注视时长大于t时,则可以进行对应的眼动操作控制,如注视亮屏等,控制设备可以是手机,平板,穿戴手表等。例如,将一段时间内(比如1秒)出现events的像素位置设置为1,没有events的像素位置设置为0,得到一张如上图所示的二值mask图。
训练阶段:收集从不同角度不同距离注视屏幕时,拍摄到的二值mask图,并标注出人眼区域。收集从不同角度不同距离没有注视屏幕时,拍摄到的二值mask图,并标注出人眼区域。基于收集到的数据训练模型,模型能定位人眼区域,并能识别出“注视”和“非注视”两种状态。
测试阶段:对当前二值mask图使用模型来找出人眼区域,并识别是否处于“注视”状态。如果处于“注视”状态,进一步判断注视时长,若注视时长大于等于1秒,点亮屏幕。如果处于“非注视”状态,保证设备处于息屏状态。
此外,当注视时长大于一定时长(如3秒)时,提取眼部的特征来识别身份解,实现手机的快速解锁。而当人眼距离屏幕超过一定距离(如超过30cm),则不启动身份识别解锁功能,以保证用户使用手机的安全性。
在此场景中,相比于基于传统摄像头的眼动跟踪方案,基于DVS的眼动跟踪更快速、更低功耗。而且,在进行远程眼动跟踪或者注视交互识别时,DVS传感器不必采集人脸的全部特征和识别,因此较RGB设备更能保护用户隐私。例如,相比于使用RGB来感知用户的注视,DVS传感器只需要感知用户眼部的变化即可,功耗低。
场景二、安防场景下进行检测识别
传统APS(Advaenced Photo System)摄像头,主要基于类似背景减除的方法来定位运动目标并重点分析这部分关键信息,最简单的实现方法是帧差法。而DVS能通过感知单个像素亮度的变化,捕捉运动目标,有着与帧差法几乎一样的效果,但是具有更低的时延。DVS摄像头在单个运动目标场景下能快速定位前景运动目标所在的矩形区域/mask,比如镜头固定不动且拍摄的背景干净的监控场景下。通过本申请提供的方法,可以对DVS采集到的图像进行运动补偿,从而得到更清晰的事件图像,从而使安防场景下的检测识别更准确。
一种场景例如,使用DVS传感器进行运动物体检测的流程可以包括:当画面中有运动物体出现或者场景存在光线变化时,DVS对应区域产生事件events。将一段时间内(比如1秒)出现events的像素位置设置为1,没有events的像素位置设置为0,得到mask图,通过本申请提供的方法,对mask图像进行运动补偿,得到清晰的事件图像。在事件图像上筛选出连通的矩形框区域。然后判断矩形框的大小,当矩形框面积>阈值1,DVS检测到的运动区域过大,不进行检测识别,可以理解为DVS检测到的变化是场景光线变化;当阈值2>矩形框面积,则可以接为该矩形框表示噪声,比如风吹叶子晃动产生的运动区域;当阈值1>矩形框面积>阈值2,则可以进一步根据运动的连续性来判断是否是移动的物体,从而确定是否需要进行进一步地检测识别。
另一种场景例如,使用DVS传感器和RGB摄像头进行运动物体检测和识别的流程如可以包括:当画面中有运动物体出现或者场景存在光线变化时,DVS对应区域产生事件events,通过本申请提供的方法得到清晰的事件图像,并在事件图像中确定表示运动物体的矩形框,将矩形框膨胀一圈(h*w*0.1)之后,找到RGB摄像头对应帧上的对应矩形区域,作为运动物体区域。使用现有RGB图像深度学习网络来识别运动物体区域内物体的类别。
因此,在本场景中,因为DVS传感器对高速运动物体敏感,可以快速捕捉运动事件,并进行响应分析,“时间分辨率”比APS更高,因此使用DVS传感器进行运动物体检测,具有低时延的优势。此外,DVS传感器对物体运动高度敏感,受场景光强影响不大,即在过亮或者过暗的场景下,仍能进行运动物体识别信息。
场景三、车载检测识别
通常,在车辆行驶过程中,动态感知摄像头能捕捉视野中静止或者运动的车辆轮廓、车牌信息、车道线。这个场景下主要包括三种应用:运动物体检测、高速车牌识别、车道线检测。具体的,DVS传感器可以部署在车上进行车外物体检测,也可以部署在公共交通的摄像头上,进行安防监控。
更具体地,运动物体检测,借助动态感知芯片的运动敏感性、低时延,实现车载场景下的运动物体(车辆、行人)的实时目标检测,尤其对于快速运动场景(避免运动模糊)、高动态范围场景,辅助驾驶员进行避障判断。
高速路标、车牌识别:分为两个场景,ADAS和交通监控。前者是车载DVS,进行车外的目标识别,只需要简单纹理少量颜色(双色图像等)即可,DVS特别适合进行高速车牌、路标的识别,以及邻近车辆的相对测速等;后者是固定场景的DVS交通监控,应用场景包括高速路抓拍、违停抓拍、闯红灯抓拍等。总体上,DVS在车载ADAS价值更大一些,交通监控可能需要借助其他传感器协同完成(弥补纹理缺失的缺陷)。
车道线检测:用于自动驾驶的车道保持、并线辅助等功能,借助DVS可对车道线进行实时检测。
DVS的高动态特性在上述场景下还具有全天候可用的优势,在逆光、夜间等条件下仍可进行检测识别。
自动驾驶组网图可以如图111所示,其中,该组网内可以包括自动驾驶车辆(如图14所示的自动驾驶车辆A、自动驾驶车辆B或自动驾驶车辆C等)以及集中控制设备,还可以包括监控摄像头或者其他设备等。集中控制设备可以用于控制或者标识道路中车辆的环境数据。
在此场景下,可以进行运动物体检测、车道线检测、高速路标或车牌识别等。具体可以是结合本申请提供的方法得到的更清晰的事件图像。
运动物体检测:借助动态感知芯片的运动敏感性、低时延,实现车载场景下的运动物体(车辆、行人)的实时目标检测,尤其对于快速运动场景(避免运动模糊)、高动态范围场景,辅助驾驶员进行避障判断。
车道线检测:用于自动驾驶的车道保持、并线辅助等功能,借助DVS可对车道线进行实时检测。
高速路标、车牌识别:分为两个场景,ADAS和交通监控。前者是车载DVS,进行车外的目标识别,只需要简单纹理少量颜色(如双色图像)即可,DVS特别适合进行高速车牌、路标的识别,以及邻近车辆的相对测速等;后者是固定场景的DVS交通监控,应用场景包括高速路抓拍、违停抓拍、闯红灯抓拍等。总体上,DVS在车载ADAS价值更大一些,交通监控可能需要借助其他传感器协同完成(如弥补纹理缺失的缺陷)。
在此场景下,可以结合DVS采集到的图像更加快速准确识别运动物体。特别是针对简单文理的图像,识别更加准确,且功耗更低。不受光强影响,例如夜间行驶或者隧道内识别也比较精准。
在图95、图108a和图108b所对应的实施例的基础上,为了更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关设备。具体参阅图118,图118为本申请实施例提供的数据处理装置的一种结构示意图。如图118所示,该数据处理装置包括获取模块11801和处理模块11802。所述获取模块11801,用于获取第一事件图像和第一RGB图像,所述第一事件图像与所述第一RGB图像时序对齐,所述第一事件图像为表示目标对象在运动传感器的检测范围内产生运动时的运动轨迹的图像;所述处理模块11802,用于确定第一事件图像的积分时间;所述处理模块11802,还用于若所述积分时间小于第一阈值,则确定不通过所述第一RGB图像来执行位姿估计;所述处理模块11802,还用于根据所述第一事件图像执行位姿估计。
在一种可能的设计中,所述处理模块11802,还用于确定所述第一事件图像的获取时间和所述第一RGB图像的获取时间;根据所述第一RGB图像的获取时间与所述第一事件图像的获取时间之间的时间差小于第二阈值,确定第一事件图像与第一RGB图像时序对齐。
在一种可能的设计中,所述获取模块11801,还用于获取N个连续的DVS事件;所述处理模块11802,还用于将所述N个连续的DVS事件积分为第一事件图像;所述处理模块11802,还用于根据所述N个连续的DVS事件的获取时间确定所述第一事件图像的获取时间。
在一种可能的设计中,所述处理模块11802,还用于确定用于积分为所述第一事件图像的N个连续的DVS事件;所述处理模块11802,还用于根据所述N个连续的DVS事件中的第一个DVS事件和最后一个DVS事件的获取时间,确定所述第一事件图像的积分时间。
在一种可能的设计中,所述获取模块11801,还用于获取第二事件图像;所述处理模块11802,还用于若不存在有与所述第二事件图像时序对齐的RGB图像,则确定所述第二事件图像不具有用于共同执行位姿估计的RGB图像;所述处理模块11802,还用于根据所述第二事件图像执行位姿估计。
在一种可能的设计中,所述处理模块11802,还用于:若确定所述第二事件图像具有时序对齐的惯性测量单元IMU数据,则根据所述第二DVS图和所述第二事件图像对应的IMU数据确定位姿;若确定所述第二事件图像不具有时序对齐的惯性测量单元IMU数据,则仅根据所述第二事件图像确定位姿。
在一种可能的设计中,所述获取模块11801,还用于获取第二RGB图像;所述处理模块11802,还用于若不存在有与所述第二RGB图像时序对齐的事件图像,则确定所述第二RGB图像不具有用于共同执行位姿估计的事件图像;所述处理模块11802,还用于根据所述第二RGB图像确定位姿。
在一种可能的设计中,所述处理模块11802,还用于根据所述第一事件图像和字典执行回环检测,所述字典为基于事件图像所构建的字典。
在一种可能的设计中,所述获取模块11801,还用于获取多个事件图像,所述多个事件图像为用于训练的事件图像;所述获取模块11801,还用于获取所述多个事件图像的视觉特征;所述处理模块11802,还用于通过聚类算法对所述视觉特征进行聚类,得到聚类后的视觉特征,所述聚类后的视觉特征具有对应的描述子;所述处理模块11802,还用于根据所述聚类后的视觉特征,构建所述字典。
在一种可能的设计中,所述处理模块11802,还用于:确定所述第一事件图像的描述子;在所述字典中确定所述第一事件图像的描述子对应的视觉特征;基于所述视觉特征确定所述第一事件图像对应的词袋向量;确定所述第一事件图像对应的词袋向量与其他事件图像的词袋向量之间的相似度,以确定所述第一事件图像所匹配的事件图像。
具体参阅图119,图119为本申请实施例提供的数据处理装置的一种结构示意图。如图119所示,该数据处理装置包括获取模块11901和处理模块11902。所述获取模块11901,用于获取事件图像;所述处理模块11902,用于确定所述事件图像的第一信息,所述第一信息包括所述事件图像中的事件和/或特征;所述处理模块11902,用于若基于所述第一信息确定所述事件图像至少满足第一条件,则确定所述事件图像为关键帧,所述第一条件与 事件数量和/或特征数量相关。
在一种可能的设计中,所述第一条件包括:所述事件图像中的事件数量大于第一阈值、所述事件图像中的事件有效区域的数量大于第二阈值、所述事件图像中的特征数量大于第三阈值和所述事件图像中的特征有效区域大于第四阈值中的一个或多个。
在一种可能的设计中,所述获取模块11901,用于获取与所述事件图像时序对齐的深度图像;所述处理模块11902,还用于若基于所述第一信息确定所述事件图像至少满足第一条件,则确定所述事件图像和所述深度图像为关键帧。
在一种可能的设计中,所述获取模块11901,用于获取与所述事件图像时序对齐的RGB图像;所述获取模块11901,用于获取所述RGB图像的特征数量和/或特征有效区域;所述处理模块11902,还用于若基于所述第一信息确定所述事件图像至少满足第一条件,且所述RGB图像的特征数量大于第五阈值和/或所述RGB图像的特征有效区域的数量大于第六阈值,则确定所述事件图像和所述RGB图像为关键帧。
在一种可能的设计中,所述处理模块11902,还用于:若基于所述第一信息确定所述事件图像至少满足所述第一条件,则确定所述事件图像的第二信息,所述第二信息包括所述事件图像中的运动特征和/或位姿特征;若基于所述第二信息确定所述事件图像至少满足第二条件,确定所述事件图像为关键帧,所述第二条件与运动变化量和/或位姿变化量相关。
在一种可能的设计中,所述处理模块11902,还用于确定所述事件图像的清晰度和/或亮度一致性指标;所述处理模块11902,还用于若基于所述第二信息确定所述事件图像至少满足所述第二条件,且所述事件图像的清晰度大于清晰度阈值和/或所述事件图像的亮度一致性指标大于预设指标阈值,则确定所述事件图像为关键帧。
在一种可能的设计中,所述处理模块11902,还用于:若所述事件图像中的像素表示光强变化极性,则计算所述事件图像的事件数量与相邻的关键帧的事件数量的差值的绝对值,并将所述绝对值除以所述事件图像的像素数量,得到所述事件图像的亮度一致性指标;若所述事件图像中的像素表示光强,则将所述事件图像和相邻的关键帧逐像素求差,并计算差值的绝对值,对每组像素对应的绝对值进行求和运算,并将得到的求和结果除以像素数量,得到所述事件图像的亮度一致性指标。
在一种可能的设计中,所述获取模块11901,用于获取与所述事件图像时序对齐的RGB图像;所述处理模块11902,还用于确定所述RGB图像的清晰度和/或亮度一致性指标;所述处理模块11902,还用于若基于所述第二信息确定所述事件图像至少满足第二条件,且所述RGB图像的清晰度大于清晰度阈值和/或所述RGB图像的亮度一致性指标大于预设指标阈值,则确定所述事件图像和所述RGB图像为关键帧。
在一种可能的设计中,所述第二条件包括:所述事件图像与上一个关键帧的距离超过预设距离值、所述事件图像与上一个关键帧的旋转角度超过预设角度值以及所述事件图像与上一个关键帧的距离超过预设距离值且所述事件图像与上一个关键帧的旋转角度超过预设角度值中的一个或多个。
具体参阅图120,图120为本申请实施例提供的数据处理装置的一种结构示意图。如 图120所示,该数据处理装置包括获取模块12001和处理模块12002。所述获取模块,用于获取第一事件图像和所述第一事件图像对应的目标图像,所述第一事件图像和所述图像所捕捉的环境信息相同,所述目标图像包括深度图像或RGB图像,所述第一事件图像为表示目标对象在运动传感器的检测范围内产生运动时的运动轨迹的图像;所述处理模块,用于确定所述第一事件图像中的第一运动区域;所述处理模块,还用于根据所述第一运动区域确定所述图像中对应的第二运动区域;所述处理模块,还用于根据所述图像中的第二运动区域进行位姿估计。
在一种可能的设计中,所述获取模块,还用于若采集所述第一事件图像的动态视觉传感器DVS为静止的,则获取所述第一事件图像中有事件响应的像素点;所述处理模块,还用于根据所述有事件响应的像素点确定所述第一运动区域。
在一种可能的设计中,所述处理模块,还用于:确定由所述第一事件图像中有事件响应的像素点构成的轮廓;若所述轮廓所包围的面积大于第一阈值,则确定所述轮廓所包围的区域为第一运动区域。
在一种可能的设计中,所述获取模块,还用于若采集所述第一事件图像的DVS为运动的,则获取第二事件图像,所述第二事件图像为所述第一事件图像的前一帧事件图;所述处理模块,还用于计算所述第一事件图像中的像素相对于所述第二事件图像的位移大小以及位移方向;所述处理模块,还用于若所述第一事件图像中的像素的位移方向与周围像素的位移方向不相同,或所述第一事件图像中的像素的位移大小与周围像素的位移大小之间的差值大于第二阈值,则确定所述像素属于第一运动区域。
在一种可能的设计中,所述处理模块,还用于根据所述第一运动区域确定所述图像中对应的静止区域;所述处理模块,还用于根据所述图像中的静止区域确定位姿。
请参阅图121,本申请提供的另一种电子设备的结构示意图,如下所述。
该电子设备可以包括处理器12101、存储器12102、RGB传感器12103和运动传感器12104。该处理器12101、RGB传感器12103和运动传感器12104之间通过线路互联。其中,存储器12102中存储有程序指令和数据。RGB传感器12103用于进行拍摄,将采集到的模拟信号转换为电信号。运动传感器12104用于对拍摄范围内的运动的对象进行监测。
存储器12102中存储了前述图3-a至图108-b中的步骤对应的程序指令以及数据。
处理器12101用于执行前述图3-a至图108-b中任一实施例所示的电子设备执行的方法步骤。
RGB传感器12103用于执行前述图3-a至图108-b中任一实施例所示的电子设备执行的拍摄图像的步骤。
运动传感器12104用于执行前述图3-a至图108-b中任一实施例所示的电子设备执行的对运动的对象进行监测的步骤。
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有用于生成车辆行驶速度的程序,当其在计算机上行驶时,使得计算机执行如前述图2-18所示实施例描述的方法中的步骤。
可选地,前述的图121中所示的设备可以是芯片。
本申请实施例还提供了一种电子设备,该电子设备也可以称为数字处理芯片或者芯片,芯片包括处理单元和通信接口,处理单元通过通信接口获取程序指令,程序指令被处理单元执行,处理单元用于执行前述图3-a至图108-b中任一实施例所示的电子设备执行的方法步骤。
本申请实施例还提供一种数字处理芯片。该数字处理芯片中集成了用于实现上述处理器12101,或者处理器12101的功能的电路和一个或者多个接口。当该数字处理芯片中集成了存储器时,该数字处理芯片可以完成前述实施例中的任一个或多个实施例的方法步骤。当该数字处理芯片中未集成存储器时,可以通过通信接口与外置的存储器连接。该数字处理芯片根据外置的存储器中存储的程序代码来实现上述实施例中电子设备执行的动作。
本申请实施例中还提供一种包括计算机程序产品,当其在计算机上行驶时,使得计算机执行如前述图3-a至图108-b所示实施例描述的方法中电子设备所执行的步骤。
本申请实施例提供的电子设备可以为芯片,芯片包括:处理单元和通信单元,所述处理单元例如可以是处理器,所述通信单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行存储单元存储的计算机执行指令,以使服务器内的芯片执行上述图3-a至图108-b所示实施例描述的图像处理方法。可选地,所述存储单元为所述芯片内的存储单元,如寄存器、缓存等,所述存储单元还可以是所述无线接入设备端内的位于所述芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。
具体地,前述的处理单元或者处理器可以是中央处理器(central processing unit,CPU)、网络处理器(neural-network processing unit,NPU)、图形处理器(graphics processing unit,GPU)、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)或现场可编程逻辑门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者也可以是任何常规的处理器等。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献 的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
最后应说明的是:以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (74)

  1. 一种视觉传感器芯片,其特征在于,包括:
    像素阵列电路,用于通过测量光强变化量来生成与所述像素阵列电路中的像素对应的至少一个数据信号,所述至少一个数据信号指示光强变化事件,所述光强变化事件表示所述像素阵列电路中的对应像素测量到的光强变化量超过预定阈值;
    读取电路,所述读取电路与所述像素阵列电路耦合,用于以第一事件表示方式从所述像素阵列电路读取所述至少一个数据信号;
    所述读取电路,还用于向控制电路提供所述至少一个数据信号;
    所述读取电路,还用于从所述控制电路接收到基于所述至少一个数据信号而生成的转换信号时,转换到以第二事件表示方式从所述像素阵列电路读取所述至少一个数据信号。
  2. 根据权利要求1所述的视觉传感器芯片,其特征在于,所述第一事件表示方式为通过极性信息表示事件,所述像素阵列电路包括多个像素,每个所述像素包括阈值比较单元,
    所述阈值比较单元,用于所述光强变换量超过预定阈值时,输出极性信息,所述极性信息用于指示所述光强变化量是增强或者减弱;
    所述读取电路,具体用于读取所述阈值比较单元输出的所述极性信息。
  3. 根据权利要求1所述的视觉传感器芯片,其特征在于,所述第一事件表示方式为通过光强信息表示事件,所述像素阵列包括多个像素,每个所述像素包括阈值比较单元,读出控制单元和光强采集单元,
    所述光强检测单元,用于输出照射在其上的光信号对应的电信号,所述电信号用于指示光强;
    所述阈值比较单元,用于根据所述电信号确定所述光强变换量超过预定阈值时,输出第一信号;
    所述读出控制单元,用于响应于接收到所述第一信号,指示光强采集单元采集并缓存对应所述第一信号接收时刻的所述电信号;
    所述读取电路,具体用于读取所述光强采集单元缓存的所述电信号。
  4. 根据权利要求1至3任一项所述的视觉传感器芯片,其特征在于,所述控制电路,还用于:
    基于从所述读取电路接收的所述至少一个数据信号,确定统计数据;
    如果确定所述统计数据满足预定转换条件,向所述读取电路发送所述转换信号,所述预定转换条件基于所述视觉传感器芯片的预置带宽确定。
  5. 根据权利要求4所述的视觉传感器芯片,其特征在于,所述第一事件表示方式为通过光强信息表示事件,所述第二事件表示方式为通过极性信息表示事件时,所述预定转换条件为通过所述第一事件表示方式从所述像素阵列电路读取的总数据量大于所述预置带宽,或者所述预定转换条件为所述至少一个数据信号的数目大于所述预置带宽和所述第一比特的比值,所述第一比特是所述数据信号的数据格式的预置比特。
  6. 根据权利要求4所述的视觉传感器芯片,其特征在于,所述第一事件表示方式为通过极性信息表示事件,所述第二事件表示方式为通过光强信息表示事件时,所述预定转换 条件为若通过所述第二事件表示方式从所述像素阵列电路读取所述至少一个数据信号,读取的总数据量不大于所述预置带宽,或者所述预定转换条件为所述至少一个数据信号的数目不大于所述预置带宽和所述第一比特的比值,所述第一比特是所述数据信号的数据格式的预置比特。
  7. 一种解码电路,其特征在于,包括:
    读取电路,用于从视觉传感器芯片读取数据信号;
    解码电路,用于根据第一解码方式对所述数据信号进行解码;
    所述解码电路,还用于从控制电路接收到转换信号时,根据第二解码方式对所述数据信号进行解码。
  8. 根据权利要求7所述的解码电路,其特征在于,所述控制电路,还用于:
    基于从所述读取电路读取的所述数据信号,确定统计数据;
    如果确定所述统计数据满足预定转换条件,向所述编码电路发送所述转换信号,所述预定转换条件基于所述视觉传感器芯片的预置带宽确定。
  9. 根据权利要求8所述的解码电路,其特征在于,所述第一解码方式为根据与第一事件表示方式相对应的第一比特对所述数据信号进行解码,所述第一事件表示方式为通过光强信息表示事件,所述第二解码方式为根据与第二事件表示方式相对应的第二比特对所述数据信号进行解码,所述第二事件表示方式为通过极性信息表示事件,所述极性信息用于指示所述光强变化量是增强或者减弱,所述转换条件为根据所述第一解码方式解码的总数据量大于所述预置带宽,或者所述预定转换条件为所述数据信号的数目大于所述预置带宽和所述第一比特的比值,所述第一比特是所述数据信号的数据格式的预置比特。
  10. 根据权利要求8所述的解码电路,其特征在于,所述第一解码方式为根据与第一事件表示方式相对应的第一比特对所述数据信号进行解码,所述第一事件表示方式为通过极性信息表示事件,所述极性信息用于指示所述光强变化量是增强或者减弱,所述第二解码方式为通过与第二事件表示方式相对应的第二比特对所述数据信号进行解码,所述第二事件表示方式为通过光强信息表示事件,所述转换条件为若根据所述第二解码方式解码所述数据信号,总数据量不大于所述预置带宽,或者所述预定转换条件为所述数据信号的数目大于所述预置带宽和所述第一比特的比值,所述第一比特是所述数据信号的数据格式的预置比特。
  11. 一种操作视觉传感器芯片的方法,其特征在于,包括:
    通过所述视觉传感器芯片的像素阵列电路测量光强变化量来生成与所述像素阵列电路中的像素对应的至少一个数据信号,所述至少一个数据信号指示光强变化事件,所述光强变化事件表示所述像素阵列电路中的对应像素测量到的光强变化量超过预定阈值;
    通过所述视觉传感器芯片的读取电路以第一事件表示方式从所述像素阵列电路读取所述至少一个数据信号;
    通过所述读取电路向所述视觉传感器芯片的控制电路提供所述至少一个数据信号;
    通过所述读取电路从所述控制电路接收到基于所述至少一个数据信号而生成的转换信号时,转换到以第二事件表示方式从所述像素阵列电路读取所述至少一个数据信号。
  12. 根据权利要求11所述的方法,其特征在于,所述第一事件表示方式为通过极性信息表示事件,所述像素阵列电路包括多个像素,每个所述像素包括阈值比较单元,所述通过所述视觉传感器芯片的读取电路以第一事件表示方式从所述像素阵列电路读取所述至少一个数据信号,包括:
    所述光强变换量超过预定阈值时,通过所述阈值比较单元输出极性信息,所述极性信息用于指示所述光强变化量是增强或者减弱;
    通过所述读取电路读取所述阈值比较单元输出的所述极性信息。
  13. 根据权利要求11所述的方法,其特征在于,所述第一事件表示方式为通过光强信息表示事件,所述像素阵列包括多个像素,每个所述像素包括阈值比较单元,读出控制单元和光强采集单元,所述通过所述视觉传感器芯片的读取电路以第一事件表示方式从所述像素阵列电路读取所述至少一个数据信号,包括:
    通过所述光强采集单元输出照射在其上的光信号对应的电信号,所述电信号用于指示光强;
    所述电信号确定所述光强变换量超过预定阈值时,通过所述阈值比较单元输出第一信号;
    响应于接收到所述第一信号,通过所述读出控制单元指示光强采集单元采集并缓存对应所述第一信号接收时刻的所述电信号;
    通过所述读取电路读取所述光强采集单元缓存的所述电信号。
  14. 根据权利要求11至13任一项所述的方法,其特征在于,所述方法还包括:
    基于从所述读取电路接收的所述至少一个数据信号,确定统计数据;
    如果确定所述统计数据满足预定转换条件,向所述读取电路发送所述转换信号,所述预定转换条件基于所述视觉传感器芯片的预置带宽确定。
  15. 根据权利要求14所述的方法,其特征在于,所述第一事件表示方式为通过光强信息表示事件,所述第二事件表示方式为通过极性信息表示事件时,所述预定转换条件为通过所述第一事件表示方式从所述像素阵列电路读取的总数据量大于所述预置带宽,或者所述预定转换条件为所述至少一个数据信号的数目大于所述预置带宽和所述第一比特的比值,所述第一比特是所述数据信号的数据格式的预置比特。
  16. 根据权利要求14所述的方法,其特征在于,所述第一事件表示方式为通过极性信息表示事件,所述第二事件表示方式为通过光强信息表示事件时,所述预定转换条件为若通过所述第二事件表示方式从所述像素阵列电路读取所述至少一个数据信号,读取的总数据量不大于所述预置带宽,或者所述预定转换条件为所述至少一个数据信号的数目不大于所述预置带宽和所述第一比特的比值,所述第一比特是所述数据信号的数据格式的预置比特。
  17. 一种解码方法,其特征在于,包括:
    通过读取电路从视觉传感器芯片读取数据信号;
    通过解码电路根据第一解码方式对所述数据信号进行解码;
    从控制电路接收到转换信号时,通过所述解码电路根据第二解码方式对所述数据信号 进行解码。
  18. 根据权利要求17所述的解码方法,其特征在于,还包括:
    基于从所述读取电路读取的所述数据信号,确定统计数据;
    如果确定所述统计数据满足预定转换条件,向所述编码电路发送所述转换信号,所述预定转换条件基于所述视觉传感器芯片的预置带宽确定。
  19. 根据权利要求18所述的解码方法,其特征在于,所述第一解码方式为根据与第一事件表示方式相对应的第一比特对所述数据信号进行解码,所述第一事件表示方式为通过光强信息表示事件,所述第二解码方式为根据与第二事件表示方式相对应的第二比特对所述数据信号进行解码,所述第二事件表示方式为通过极性信息表示事件,所述极性信息用于指示所述光强变化量是增强或者减弱,所述转换条件为根据所述第一解码方式解码的总数据量大于所述预置带宽,或者所述预定转换条件为所述数据信号的数目大于所述预置带宽和所述第一比特的比值,所述第一比特是所述数据信号的数据格式的预置比特。
  20. 根据权利要求18所述的解码方法,其特征在于,所述第一解码方式为根据与第一事件表示方式相对应的第一比特对所述数据信号进行解码,所述第一事件表示方式为通过极性信息表示事件,所述极性信息用于指示所述光强变化量是增强或者减弱,所述第二解码方式为通过与第二事件表示方式相对应的第二比特对所述数据信号进行解码,所述第二事件表示方式为通过光强信息表示事件,所述转换条件为若根据所述第二解码方式解码所述数据信号,总数据量不大于所述预置带宽,或者所述预定转换条件为所述数据信号的数目大于所述预置带宽和所述第一比特的比值,所述第一比特是所述数据信号的数据格式的预置比特。
  21. 一种视觉传感器芯片,其特征在于,包括:
    像素阵列电路,用于通过测量光强变化量来生成与所述像素阵列电路中的像素对应的至少一个数据信号,所述至少一个数据信号指示光强变化事件,所述光强变化事件表示所述像素阵列电路中的对应像素测量到的光强变化量超过预定阈值;
    第一编码单元,用于根据第一比特对所述至少一个数据信号进行编码,以得到第一编码数据;
    所述第一编码单元,还用于从控制电路接收到第一控制信号时,根据所述第一控制信号指示的第二比特对所述至少一个数据信号进行编码,所述第一控制信号是所述控制电路根据所述第一编码数据确定的。
  22. 根据权利要求21所述的视觉传感器芯片,其特征在于,所述第一控制信号是所述控制电路根据所述第一编码数据以及所述视觉传感器芯片预置的带宽确定的。
  23. 根据权利要求22所述的视觉传感器芯片,其特征在于,所述第一编码数据的数据量不小于所述带宽时,所述控制信号指示的所述第二比特小于所述第一比特,以使通过所述第二比特编码的所述至少一个数据信号的总数据量不大于所述带宽。
  24. 根据权利要求22所述的视觉传感器芯片,其特征在于,所述第一编码数据的数据量小于所述带宽时,所述控制信号指示的所述第二比特大于所述第一比特,且通过所述第二比特编码的所述至少一个数据信号的总数据量不大于所述带宽。
  25. 根据权利要求21至24任一项所述的视觉传感器芯片,其特征在于,所述像素阵列包括N个区域,所述N个区域中的至少两个区域的最大比特不同,所述最大比特表示预设的对一个所述区域生成的所述至少一个数据信号进行编码的最大比特,
    所述第一编码单元,具体用于根据所述第一比特对所述第一区域生成的所述至少一个数据信号进行编码,以得到第一编码数据,所述第一比特不大于所述第一区域的最大比特,所述第一区域是所述N个区域中的任意一个区域;
    所述第一编码单元,具体用于从所述控制电路接收到所述第一控制信号时,根据所述第一控制信号指示的第二比特对所述第一区域生成的所述至少一个数据信号进行编码,所述第一控制信号是所述控制电路根据所述第一编码数据确定的。
  26. 根据权利要求21所述的视觉传感器芯片,其特征在于,所述控制电路,还用于:
    确定通过第三比特编码的所述至少一个数据信号的总数据量大于所述带宽,且通过所述第二比特编码的所述至少一个数据信号的总数据量不大于所述带宽时,向所述第一编码单元发送所述第一控制信号,所述第三比特和所述第二比特之间相差1个比特单位。
  27. 一种解码设备,其特征在于,包括:
    读取电路,用于从视觉传感器芯片读取数据信号;
    解码电路,用于根据第一比特对所述数据信号进行解码;
    所述解码电路,还用于从控制电路接收到第一控制信号时,根据所第一控制信号指示的第二比特对所述数据信号进行解码。
  28. 根据权利要求27所述的解码设备,其特征在于,所述第一控制信号是所述控制电路根据所述第一编码数据以及所述视觉传感器芯片预置的带宽确定的。
  29. 根据权利要求28所述的解码设备,其特征在于,根据所述第一比特解码的所述数据信号的总数据量不小于所述带宽时,所述第二比特小于所述第一比特。
  30. 根据权利要求28所述的解码设备,其特征在于,根据所述第一比特解码的所述数据信号的总数据量小于所述带宽时,所述第二比特大于所述第一比特,且通过所述第二比特解码所述数据信号的总数据量不大于所述带宽。
  31. 根据权利要求27至30任一项所述的解码设备,其特征在于,
    所述读取电路,具体用于从视觉传感器芯片读取第一区域对应的数据信号,所述第一区域是所述视觉传感器的像素阵列包括的N个区域中的任意一个区域,所述N个区域中的至少两个区域的最大比特不同,所述最大比特表示预设的对一个所述区域生成的所述至少一个数据信号进行编码的最大比特;
    所述解码电路,具体用于根据所述第一比特对所述第一区域对应的数据信号进行解码。
  32. 根据权利要求27所述的解码设备,其特征在于,所述控制电路,还用于:
    确定过第三比特解码的所述数据信号的总数据量大于所述带宽,且通过所述第二比特解码所述数据信号的总数据量不大于所述带宽时,向所述第一编码单元发送所述第一控制信号,所述第三比特和所述第二比特之间相差1个比特单位。
  33. 一种操作视觉传感器芯片的方法,其特征在于,包括:
    通过所述视觉传感器芯片的像素阵列电路测量光强变化量来生成与所述像素阵列电路 中的像素对应的至少一个数据信号,所述至少一个数据信号指示光强变化事件,所述光强变化事件表示所述像素阵列电路中的对应像素测量到的光强变化量超过预定阈值;
    通过所述视觉传感器芯片的第一编码单元根据第一比特对所述至少一个数据信号进行编码,以得到第一编码数据;
    通过所述第一编码单元从所述视觉传感器芯片的控制电路接收到第一控制信号时,根据所述第一控制信号指示的第二比特对所述至少一个数据信号进行编码,所述第一控制信号是所述控制电路根据所述第一编码数据确定的。
  34. 根据权利要求33所述的方法,其特征在于,所述第一控制信号是所述控制电路根据所述第一编码数据以及所述视觉传感器芯片预置的带宽确定的。
  35. 根据权利要求34所述的方法,其特征在于,所述第一编码数据的数据量不小于所述带宽时,所述控制信号指示的所述第二比特小于所述第一比特,以使通过所述第二比特编码的所述至少一个数据信号的总数据量不大于所述带宽。
  36. 根据权利要求34所述的方法,其特征在于,所述第一编码数据的数据量小于所述带宽时,所述控制信号指示的所述第二比特大于所述第一比特,且通过所述第二比特编码的所述至少一个数据信号的总数据量不大于所述带宽。
  37. 根据权利要求33至36任一项所述的方法,其特征在于,所述像素阵列包括N个区域,所述N个区域中的至少两个区域的最大比特不同,所述最大比特表示预设的对一个所述区域生成的所述至少一个数据信号进行编码的最大比特,
    所述通过所述视觉传感器芯片的第一编码单元根据第一比特对所述至少一个数据信号进行编码,包括:
    通过所述第一编码单元根据所述第一比特对所述第一区域生成的所述至少一个数据信号进行编码,以得到第一编码数据,所述第一比特不大于所述第一区域的最大比特,所述第一区域是所述N个区域中的任意一个区域;
    所述通过所述第一编码单元从所述视觉传感器芯片的控制电路接收到第一控制信号时,根据所述第一控制信号指示的第二比特对所述至少一个数据信号进行编码,包括:
    所述通过所述第一编码单元从所述控制电路接收到所述第一控制信号时,根据所述第一控制信号指示的第二比特对所述第一区域生成的所述至少一个数据信号进行编码,所述第一控制信号是所述控制电路根据所述第一编码数据确定的。
  38. 根据权利要求33所述的方法,其特征在于,还包括:
    确定通过第三比特编码的所述至少一个数据信号的总数据量大于所述带宽,且通过所述第二比特编码的所述至少一个数据信号的总数据量不大于所述带宽时,通过所述控制电路向所述第一编码单元发送所述第一控制信号,所述第三比特和所述第二比特之间相差1个比特单位。
  39. 一种解码方法,其特征在于,包括:
    通过读取电路从视觉传感器芯片读取数据信号;
    通过解码电路根据第一比特对所述数据信号进行解码;
    通过所述解码电路从控制电路接收到第一控制信号时,根据所第一控制信号指示的第 二比特对所述数据信号进行解码。
  40. 根据权利要求39所述的解码方法,其特征在于,所述第一控制信号是所述控制电路根据所述第一编码数据以及所述视觉传感器芯片预置的带宽确定的。
  41. 根据权利要求40所述的解码方法,其特征在于,根据所述第一比特解码的所述数据信号的总数据量不小于所述带宽时,所述第二比特小于所述第一比特。
  42. 根据权利要求40所述的解码方法,其特征在于,根据所述第一比特解码的所述数据信号的总数据量小于所述带宽时,所述第二比特大于所述第一比特,且通过所述第二比特解码所述数据信号的总数据量不大于所述带宽。
  43. 根据权利要求39至42任一项所述的解码方法,其特征在于,所述通过读取电路从视觉传感器芯片读取数据信号,包括:
    通过所述读取电路从视觉传感器芯片读取第一区域对应的数据信号,所述第一区域是所述视觉传感器的像素阵列包括的N个区域中的任意一个区域,所述N个区域中的至少两个区域的最大比特不同,所述最大比特表示预设的对一个所述区域生成的所述至少一个数据信号进行编码的最大比特;
    所述通过解码电路根据第一比特对所述数据信号进行解码,包括:
    通过所述解码电路根据所述第一比特对所述第一区域对应的数据信号进行解码。
  44. 根据权利要求39所述的解码方法,其特征在于,所述方法还包括:
    确定过第三比特解码的所述数据信号的总数据量大于所述带宽,且通过所述第二比特解码所述数据信号的总数据量不大于所述带宽时,向所述第一编码单元发送所述第一控制信号,所述第三比特和所述第二比特之间相差1个比特单位。
  45. 一种视觉传感器芯片,其特征在于,包括:
    像素阵列电路,用于通过测量光强变化量来生成与所述像素阵列电路中的多个像素对应的多个数据信号,所述多个数据信号指示至少一个光强变化事件,所述至少一个光强变化事件表示所述像素阵列电路中的对应像素测量到的光强变化量超过预定阈值;
    第三编码单元,用于根据第一预设的比特对第一差分值进行编码,所述第一差分值是所述光强变换量和所述预定阈值的差值。
  46. 根据权利要求45所述的视觉传感器芯片,其特征在于,所述像素阵列电路包括多个像素,每个所述像素包括阈值比较单元,
    所述阈值比较单元,用于所述光强变换量超过所述预定阈值时,输出极性信息,所述极性信息用于指示所述光强变化量是增强或者减弱;
    所述第三编码单元,还用于根据第二预设的比特对所述极性信息进行编码。
  47. 根据权利要求46所述的视觉传感器芯片,其特征在于,每个所述像素包括还包括光强检测单元,读出控制单元和光强采集单元,
    所述光强检测单元,用于输出照射在其上的光信号对应的电信号,所述电信号用于指示光强;
    所述阈值比较单元,具体用于根据所述电信号确定所述光强变换量超过预定阈值时,输出所述极性信息;
    所述读出控制单元,用于响应于接收到所述极性信号,指示所述光强采集单元采集并缓存对应所述极性信息接收时刻的所述电信号;
    所述第三编码单元,还用于根据第三预设的比特对第一电信号进行编码,所述第一电信号是所述光强采集单元采集的对应所述极性信息第一次接收时刻的所述电信号,所述第三预设的比特是所述视觉传感器预置的用于表示光强的特征信息的最大比特。
  48. 根据权利要求47所述的视觉传感器芯片,其特征在于,所述第三编码单元,还用于:
    每隔预设时长根据所述第三预设的比特对所述光强采集单元采集的所述电信号进行编码。
  49. 根据权利要求45至48任一项所述的视觉传感器芯片,其特征在于,所述第三编码单元,具体用于:
    所述第一差分值小于所述预定阈值时,根据所述第一预设的比特对所述第一差分值进行编码。
  50. 根据权利要求45至49任一项所述的视觉传感器芯片,其特征在于,所述第三编码单元,还用于:
    所述第一差分值不小于所述预定阈值时,根据所述第一预设的比特对第一剩余差分值和所述预定阈值进行编码,所述第一剩余差分值是所述差分值和所述预定阈值的差值。
  51. 根据权利要求50所述的视觉传感器芯片,其特征在于,所述第三编码单元,具体用于:
    所述第一剩余差分值不小于所述预定阈值时,根据所述第一预设的比特对第二剩余差分值进行编码,所述第二剩余差分值是所述第一剩余差分值和所述预定阈值的差值;
    根据所述第一预设的比特对所述预定阈值进行第一次编码;
    根据所述第一预设的比特对所述预定阈值进行第二次编码。
  52. 一种解码设备,其特征在于,包括:获取电路,用于从视觉传感器芯片读取数据信号;
    解码电路,用于根据第一比特对数据信号进行解码,以获取差分值,所述差分值小于预定阈值,所述差分值是所述视觉传感器测量到的光强变换量和预定阈值的差值,所述光强变化量超过所述预定阈值,所述视觉传感器产生至少一个光强变化事件。
  53. 根据权利要求52所述的解码设备,其特征在于,所述解码电路,还用于:
    根据第二比特对所述数据信号进行解码,以获取极性信息,所述极性信息用于指示所述光强变化量是增强或者减弱。
  54. 根据权利要求52或53所述的解码设备,其特征在于,所述解码电路,还用于:
    根据第三比特对第一时刻接收到的所述数据信号进行解码,以获取所述视觉传感器输出的照射在其上的光信号对应的电信号,所述第三比特是所述视觉传感器预置的用于表示光强的特征信息的最大比特。
  55. 根据权利要求54所述的解码设备,其特征在于,所述解码电路,还用于:
    每隔预设时长根据所述第三比特对第一时刻接收到的所述数据信号进行解码。
  56. 根据权利要求52至55任一项所述的解码设备,其特征在于,所述解码电路,具体用于:
    根据第一比特对数据信号进行解码,以获取差分值和至少一个所述预定阈值。
  57. 一种操作视觉传感器芯片的方法,其特征在于,包括:
    通过所述视觉传感器芯片的像素阵列电路测量光强变化量来生成与所述像素阵列电路中的多个像素对应的多个数据信号,所述多个数据信号指示至少一个光强变化事件,所述至少一个光强变化事件表示所述像素阵列电路中的对应像素测量到的光强变化量超过预定阈值;
    通过所述视觉传感器芯片的第三编码单元根据第一预设的比特对第一差分值进行编码,所述第一差分值是所述光强变换量和所述预定阈值的差值。
  58. 根据权利要求57所述的方法,其特征在于,所述像素阵列电路包括多个像素,每个所述像素包括阈值比较单元,所述方法还包括:
    所述光强变换量超过所述预定阈值时,通过所述阈值比较单元输出极性信息,所述极性信息用于指示所述光强变化量是增强或者减弱;
    通过所述第三编码单元根据第二预设的比特对所述极性信息进行编码。
  59. 根据权利要求58所述的方法,其特征在于,每个所述像素包括还包括光强检测单元,读出控制单元和光强采集单元,所述方法还包括:
    通过所述光强检测单元输出照射在其上的光信号对应的电信号,所述电信号用于指示光强;
    所述通过所述阈值比较单元输出极性信息,包括:
    根据所述电信号确定所述光强变换量超过预定阈值时,通过所述阈值比较单元输出所述极性信息;
    所述方法还包括:
    响应于接收到所述极性信号,通过所述读出控制单元指示所述光强采集单元采集并缓存对应所述极性信息接收时刻的所述电信号;
    根据第三预设的比特对第一电信号进行编码,所述第一电信号是所述光强采集单元采集的对应所述极性信息第一次接收时刻的所述电信号,所述第三预设的比特是所述视觉传感器预置的用于表示光强的特征信息的最大比特。
  60. 根据权利要求59所述的方法,其特征在于,所述方法还包括:
    每隔预设时长根据所述第三预设的比特对所述光强采集单元采集的所述电信号进行编码。
  61. 根据权利要求57至60任一项所述的方法,其特征在于,所述通过所述视觉传感器芯片的第三编码单元根据第一预设的比特对第一差分值进行编码,包括:
    所述第一差分值小于所述预定阈值时,根据所述第一预设的比特对所述第一差分值进行编码。
  62. 根据权利要求57至61任一项所述的方法,其特征在于,所述通过所述视觉传感器芯片的第三编码单元根据第一预设的比特对第一差分值进行编码,还包括:
    所述第一差分值不小于所述预定阈值时,根据所述第一预设的比特对第一剩余差分值和所述预定阈值进行编码,所述第一剩余差分值是所述差分值和所述预定阈值的差值。
  63. 根据权利要求62所述的方法,其特征在于,所述第一差分值不小于所述预定阈值时,根据所述第一预设的比特对第一剩余差分值和所述预定阈值进行编码,包括:
    所述第一剩余差分值不小于所述预定阈值时,根据所述第一预设的比特对第二剩余差分值进行编码,所述第二剩余差分值是所述第一剩余差分值和所述预定阈值的差值;
    根据所述第一预设的比特对所述预定阈值进行第一次编码;
    根据所述第一预设的比特对所述预定阈值进行第二次编码,所述第一剩余差分值包括所述第二剩余差分值和两个所述预定阈值。
  64. 一种解码方法,其特征在于,包括:
    通过获取电路从视觉传感器芯片读取数据信号;
    通过解码电路根据第一比特对数据信号进行解码,以获取差分值,所述差分值小于预定阈值,所述差分值是所述视觉传感器测量到的光强变换量和预定阈值的差值,所述光强变化量超过所述预定阈值,所述视觉传感器产生至少一个光强变化事件。
  65. 根据权利要求64所述的解码方法,其特征在于,还包括:
    根据第二比特对所述数据信号进行解码,以获取极性信息,所述极性信息用于指示所述光强变化量是增强或者减弱。
  66. 根据权利要求64或65所述的解码方法,其特征在于,还包括:
    根据第三比特对第一时刻接收到的所述数据信号进行解码,以获取所述视觉传感器输出的照射在其上的光信号对应的电信号,所述第三比特是所述视觉传感器预置的用于表示光强的特征信息的最大比特。
  67. 根据权利要求66所述的解码方法,其特征在于,还包括:
    每隔预设时长根据所述第三比特对第一时刻接收到的所述数据信号进行解码。
  68. 根据权利要求64至67任一项所述的解码方法,其特征在于,所述通过解码电路根据第一比特对数据信号进行解码,以获取差分值,包括:
    根据第一比特对数据信号进行解码,以获取差分值和至少一个所述预定阈值。
  69. 一种视觉传感器芯片,包括处理器和存储器,所述处理器与所述存储器耦合,其特征在于,
    所述存储器,用于存储程序;
    所述处理器,用于执行所述存储器中的程序,使得所述图像处理装置执行如权利要求11-16或33-38或57-63中任一项所述的方法。
  70. 一种解码设备,包括处理器和存储器,所述处理器与所述存储器耦合,其特征在于,
    所述存储器,用于存储程序;
    所述处理器,用于执行所述存储器中的程序,使得所述图像处理装置执行如权利要求17-20或39-44或64-68中任一项所述的方法。
  71. 一种计算机可读存储介质,包括程序,其特征在于,当其在计算机上运行时,使 得计算机执行如权利要求11-16或33-38或57-63中任一项所述的方法。
  72. 一种计算机可读存储介质,包括程序,其特征在于,当其在计算机上运行时,使得计算机执行如权利要求17-20或39-44或64-68中任一项所述的方法。
  73. 一种包含指令的计算机程序产品,其特征在于,当其在计算机上运行时,使得计算机执行如权利要求11-16或33-38或57-63中任一项所述的方法。
  74. 一种包含指令的计算机程序产品,其特征在于,当其在计算机上运行时,使得计算机执行如权利要求17-20或39-44或64-68中任一项所述的方法。
PCT/CN2020/141973 2020-12-31 2020-12-31 一种视觉传感器芯片、操作视觉传感器芯片的方法以及设备 WO2022141351A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080104370.3A CN116530092A (zh) 2020-12-31 2020-12-31 一种视觉传感器芯片、操作视觉传感器芯片的方法以及设备
PCT/CN2020/141973 WO2022141351A1 (zh) 2020-12-31 2020-12-31 一种视觉传感器芯片、操作视觉传感器芯片的方法以及设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/141973 WO2022141351A1 (zh) 2020-12-31 2020-12-31 一种视觉传感器芯片、操作视觉传感器芯片的方法以及设备

Publications (1)

Publication Number Publication Date
WO2022141351A1 true WO2022141351A1 (zh) 2022-07-07

Family

ID=82258823

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/141973 WO2022141351A1 (zh) 2020-12-31 2020-12-31 一种视觉传感器芯片、操作视觉传感器芯片的方法以及设备

Country Status (2)

Country Link
CN (1) CN116530092A (zh)
WO (1) WO2022141351A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116563419A (zh) * 2023-07-11 2023-08-08 上海孤波科技有限公司 晶圆图配置数据的修正方法、装置、电子设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117319450B (zh) * 2023-11-27 2024-02-09 成都秦川物联网科技股份有限公司 基于物联网的超声波计量仪表数据交互方法、装置及设备
CN117479031A (zh) * 2023-12-22 2024-01-30 珠海燧景科技有限公司 一种事件传感器的像素排列结构及去噪方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077601A (zh) * 2014-09-30 2017-08-18 高通股份有限公司 使用基于事件的视觉传感器进行低功率始终接通脸部检测、跟踪、辨识及/或分析
CN109005329A (zh) * 2018-09-19 2018-12-14 广东工业大学 一种像素单元、图像传感器以及相机
CN110536050A (zh) * 2018-05-24 2019-12-03 三星电子株式会社 动态视觉传感器、电子设备及其数据传输方法
CN110868518A (zh) * 2018-08-14 2020-03-06 三星电子株式会社 使用动态视觉传感器进行脉冲光图案捕获的系统和方法
CN110971792A (zh) * 2018-09-29 2020-04-07 华为技术有限公司 一种动态视觉传感器
WO2020112715A1 (en) * 2018-11-26 2020-06-04 Bae Systems Information And Electronic Systems Integration Inc. Bdi based pixel for synchronous frame-based & asynchronous event-driven readouts
US20200312899A1 (en) * 2019-03-28 2020-10-01 Samsung Electronics Co., Ltd. Dynamic vision sensors configured to calibrate event signals using optical black region and methods of operating the same

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077601A (zh) * 2014-09-30 2017-08-18 高通股份有限公司 使用基于事件的视觉传感器进行低功率始终接通脸部检测、跟踪、辨识及/或分析
CN110536050A (zh) * 2018-05-24 2019-12-03 三星电子株式会社 动态视觉传感器、电子设备及其数据传输方法
CN110868518A (zh) * 2018-08-14 2020-03-06 三星电子株式会社 使用动态视觉传感器进行脉冲光图案捕获的系统和方法
CN109005329A (zh) * 2018-09-19 2018-12-14 广东工业大学 一种像素单元、图像传感器以及相机
CN110971792A (zh) * 2018-09-29 2020-04-07 华为技术有限公司 一种动态视觉传感器
WO2020112715A1 (en) * 2018-11-26 2020-06-04 Bae Systems Information And Electronic Systems Integration Inc. Bdi based pixel for synchronous frame-based & asynchronous event-driven readouts
US20200312899A1 (en) * 2019-03-28 2020-10-01 Samsung Electronics Co., Ltd. Dynamic vision sensors configured to calibrate event signals using optical black region and methods of operating the same

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116563419A (zh) * 2023-07-11 2023-08-08 上海孤波科技有限公司 晶圆图配置数据的修正方法、装置、电子设备及存储介质
CN116563419B (zh) * 2023-07-11 2023-09-19 上海孤波科技有限公司 晶圆图配置数据的修正方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN116530092A (zh) 2023-08-01

Similar Documents

Publication Publication Date Title
WO2022141418A1 (zh) 一种图像处理方法以及装置
WO2022141376A1 (zh) 一种位姿估计方法及相关装置
WO2022141445A1 (zh) 一种图像处理方法以及装置
WO2022141477A1 (zh) 一种图像处理方法以及装置
WO2022141351A1 (zh) 一种视觉传感器芯片、操作视觉传感器芯片的方法以及设备
WO2022141333A1 (zh) 一种图像处理方法以及装置
CN110445978B (zh) 一种拍摄方法及设备
WO2021258321A1 (zh) 一种图像获取方法以及装置
US10609273B2 (en) Image pickup device and method of tracking subject thereof
CN116582741B (zh) 一种拍摄方法及设备
CN113810601B (zh) 终端的图像处理方法、装置和终端设备
WO2021077878A1 (zh) 图像处理方法、装置及电子设备
WO2021078001A1 (zh) 一种图像增强方法及装置
WO2021237616A1 (zh) 图像传输方法、可移动平台及计算机可读存储介质
US11810269B2 (en) Chrominance denoising
CN115526983B (zh) 一种三维重建方法及相关设备
WO2022001806A1 (zh) 图像变换方法和装置
WO2022179604A1 (zh) 一种分割图置信度确定方法及装置
WO2022089341A1 (zh) 一种图像处理方法及相关装置
US20230419505A1 (en) Automatic exposure metering for regions of interest that tracks moving subjects using artificial intelligence
CN114302063B (zh) 一种拍摄方法及设备
CN115484383A (zh) 拍摄方法及相关装置
CN116109828B (zh) 图像处理方法和电子设备
CN116055872B (zh) 图像获取方法、电子设备和计算机可读存储介质
WO2022218216A1 (zh) 图像处理方法和终端设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20967690

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202080104370.3

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20967690

Country of ref document: EP

Kind code of ref document: A1