Multi-channel camera synchronization switching module and method based on ping-pong RAM structure

Through the multi-channel camera synchronization transfer module and method based on the ping-pong RAM structure, the problems of multi-channel camera image splicing delay and low synchronization accuracy are solved, and high-precision, low-latency image synchronization output is achieved, which is suitable for automobile assisted driving. field.

CN113596282BActive Publication Date: 2024-10-22WUHU JINLIN ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110910131.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-09
Publication Date
2024-10-22
Estimated Expiration
2041-08-09

AI Technical Summary

Technical Problem

In the field of automotive assisted driving, multi-channel camera image stitching and output delays are long and synchronization accuracy is low, which affects driving safety and comfort.

Method used

Using a multi-channel camera synchronization transfer module and method based on the ping-pong RAM structure, through high-speed cameras, synchronization pulse generators, input buffers, data controllers and output buffer FIFOs, the synchronous acquisition and splicing output of n camera images are achieved, avoiding the need for Image panoramic stitching operation.

Benefits of technology

It achieves synchronization accuracy higher than 1ns and image output delay less than 5ms, simplifying the image processing process and reducing the need for large-capacity onboard cache.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113596282B_ABST
    Figure CN113596282B_ABST
Patent Text Reader

Abstract

A multi-channel camera synchronous switching module and method based on a ping-pong RAM structure belongs to the field of automobile assisted driving, and specifically relates to an FPGA module and method for realizing the synchronous switching of multi-channel cameras with a ping-pong RAM structure to output wide-format images. The present invention is used to realize the FPGA module and algorithm for synchronously acquiring images from multiple cameras and switching them into a frame of spliced ​​images, without performing panoramic splicing of images, to achieve low-latency output, and can effectively reduce the image acquisition cost of the assisted driving controller and the processing complexity caused by asynchronous processing. The method includes the following steps: connecting n cameras with MIPI interfaces to n image input high-speed serial ports in the FPGA, after a synchronization signal is sent by a synchronization pulse generator, n RAM0s and n RAM1s alternately output row image data, and outputting a wide-format image after synchronous splicing of the composed images is realized by a data controller, and outputting the wide-format image through an output high-speed serial port through an optical fiber.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses a multi-channel camera synchronous switching module and method based on a ping-pong RAM structure, belonging to the field of automobile assisted driving, and specifically relates to a method for implementing a multi-channel camera synchronous switching output wide-format image using a ping-pong RAM structure using FPGA. Background Art

[0002] In the field of assisted driving, multi-source sensors installed on the car are used to collect environmental signals (millimeter wave radar, laser radar, single / binocular cameras, satellite navigation, etc.), and then perform dynamic and static object recognition to predict possible dangers during driving, so as to effectively increase the comfort and safety of car driving. At the same time, more and more cameras are used on the car body to avoid accidents caused by blind spots in the driving field.

[0003] The existing technology mainly focuses on panoramic stitching. For example, the patent "Vehicle-mounted 360-degree panoramic stitching method" needs to determine the parameter model, find out the coordinate mapping relationship and establish a mapping table, and finally match according to the feature points; the patent "Multi-channel camera synchronous acquisition system" is mainly used in the field of virtual reality video production, and mainly focuses on the exposure synchronization of multiple cameras; the patent "A method, device, equipment and storage medium for automobile front-view image stitching" mainly focuses on the front-view image, and the amplitude is not enough; the article "Research on key technologies for intelligent automobile video image stitching" optimizes the existing algorithm with large computational complexity and slow speed, and expands the image field of view after stitching; the article "Research on key technologies for panoramic image stitching" uses a feature matching image stitching scheme, which mainly improves the robustness and substantiality of the image stitching algorithm.

[0004] The pursuit of complex algorithms greatly increases the delay in image stitching and output of multiple cameras. How to find a synchronization switching method with high synchronization accuracy and low latency is an urgent problem to be solved. Summary of the invention

[0005] In view of the problems of long delay time and low synchronization accuracy in image stitching and output of multiple cameras, the present invention discloses a multi-channel camera synchronization switching module and a synchronization switching method based on a ping-pong RAM structure, which can be used to combine images from n cameras into one picture without performing operations such as panoramic image stitching, but only performing synchronous acquisition and synchronous stitching output of images.

[0006] The object of the present invention is achieved in that:

[0007] A multi-channel camera synchronization adapter module based on a ping-pong RAM structure includes n high-speed cameras, n high-speed serial ports connected to the high-speed cameras, a synchronization pulse generator for generating synchronization pulses, 2n input buffers RAM#x_1 and RAM#x_2 for input buffers, where x=1, 2, ..., n, a data controller for image splicing, an output buffer FIFO, an output high-speed serial port and a command register;

[0008] The high-speed serial port includes a high-speed serial-to-parallel conversion port MIPI CSI2-RX and a control unit, and the control unit can read the image codec chip;

[0009] The command register includes a channel enable register enable_reg, an image frame rate configuration register period_reg and an image control register cmd_reg;

[0010] The channel enable register is 32 bits and is used to select which channels among the 16 channels to enable, and each of the lower 16 bits represents a channel;

[0011] The image frame rate configuration register is 32 bits and is used to configure the output pulse frequency of the synchronization pulse generator;

[0012] The image control register is 32 bits and is used to configure whether to start acquisition. When the highest bit is 1, it indicates that acquisition is enabled, and when the highest bit is 0, it indicates that acquisition is stopped. The remaining low 31 bits indicate the number of image frames allowed for continuous acquisition.

[0013] The method for synchronously switching multiple cameras based on a ping-pong RAM structure includes the following steps:

[0014] Step a: connect n real-time cameras to n high-speed serial ports through the MIPI CSI2-RX interface, where n≤16, and the synchronization pulse generator generates synchronization pulses; write channel enable parameters to the channel enable register enable_reg, write image frame rate parameters to the image frame rate configuration register period_reg, write the start control command to the image control register cmd_reg, and start image acquisition;

[0015] Step b: When the control unit is in idle state, the rising edge of the synchronization pulse is monitored, and after the rising edge is detected, the frame header acquisition state step c, i.e., the data acquisition state, is entered;

[0016] Step c: The built-in counter starts working and determines whether a frame header appears. If the frame header data agreed upon in the protocol appears, the system jumps to the data receiving state, i.e., step d. If no frame header is detected, the system repeats this step to continue to determine whether a frame header appears. If the count is greater than a predetermined threshold and no frame header is detected, the system jumps to the idle state, i.e., step b. The data collection of this frame fails.

[0017] Step d: In the data receiving state, the string is continuously read according to the protocol, and the conversion result is stored in RAMx, wherein when x is 0, it is stored in RAM0, and when x is 1, it is stored in RAM1. x is 1-bit data, and is autonomously controlled by the control unit. After collecting a line of images, the data in n RAMx and the "line end pulse" are output, wherein n ≤ 16, and x is inverted, and the RAM is exchanged to realize the alternating ping-pong storage of RAM0 and RAM1, and execute step f; the built-in counter counts again, and when the counter reaches a frame of image specified by the protocol, the "image end" signal is output, and the control unit jumps to the idle state, i.e., step b; if there is no data input before the counter reaches the data specified by the protocol, it jumps to the data supplement state, i.e., step e;

[0018] Step e: Data supplementation state, supplement 0x00 to the predetermined data amount, output "image end" signal, and return to step b;

[0019] Step f: When the data controller is in an idle state, monitor the rising edge of the synchronization pulse, and when no rising edge is detected, maintain this state; when a rising edge is detected and the output is enabled, jump to the data preparation state, step g;

[0020] Step g: If a valid row end pulse is detected, that is, all enabled channels output row end pulses, a row of data is ready, and the process jumps to the data reading state step h; if a valid row end pulse is not detected after waiting for a timeout in this state, it means that the data is abnormal. If data reading has already started, the process jumps to the data supplement state step k, otherwise it directly jumps to the idle state step f; this state is the waiting period in the middle of row data reading, and after a row of data is read, the process returns to this state and waits for the next row of data to be ready;

[0021] Step h: This step is the data reading state. It detects the RAMx signal and determines which RAM data is valid. It reads all the data of the RAM of the first enabled channel and writes them into the FIFO. After the reading is completed, it jumps to the channel judgment state step i.

[0022] Step i: Determine whether all enabled channels have been read. If not, update the register state to the next enabled channel and jump back to the data reading state step h; if the reading is completed, jump to the image end judgment state step j;

[0023] Step j: Image end judgment state, judge whether the current reading time has timed out. If the timer has timed out but the image end pulse is still not detected, jump to the data supplement state step k; if the timer has not timed out, jump back to the idle state step f, wait for the next row data to be ready, and output the state judgment result to the high-speed serial port, and execute step l;

[0024] Step k: Data supplement state, according to the data counter that has been read currently, add 0x00 to the complete image frame, and after the supplement is completed, jump to the idle state step f to wait for the next frame of image; this step is to prevent redundant judgment of incomplete data caused by data errors between different channels;

[0025] Step 1: The output high-speed serial port receives the data from the FIFO and the image end status result in step j, and outputs the data through the optical fiber.

[0026] Beneficial effects:

[0027] First, the present invention discloses a multi-channel camera synchronous switching module based on a ping-pong RAM structure. The module includes a high-speed camera, a high-speed serial port connected to the high-speed camera, a synchronous pulse generator, an input buffer, a data controller, an output buffer FIFO, an output high-speed serial port and a command register. The module can realize a multi-channel camera synchronous switching method.

[0028] Second, the present invention discloses a multi-channel camera synchronous switching method based on a ping-pong RAM structure, which can combine images from n cameras into one picture without performing operations such as panoramic image stitching, but only performs synchronous acquisition and synchronous image stitching output. The synchronization accuracy is better than 1ns, which is convenient for subsequent image processing.

[0029] Third, when performing image stitching, the multi-channel camera synchronous switching method based on the Ping-Pong RAM structure outputs one row of data and stitches one row of data. The image output delay is small, which only occupies the acquisition time of one row of image. The delay time is better than 5ms, and the cache only occupies one row of data, so a large-capacity onboard cache is not required. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a structural schematic diagram of a multi-channel camera synchronization switching module based on a ping-pong RAM structure of the present invention.

[0031] Figure 2 It is a schematic diagram of the high-speed serial port structure.

[0032] Figure 3 This is a schematic diagram of the input and output signals of the control unit.

[0033] Figure 4 This is a schematic diagram of the command register.

[0034] Figure 5 It is the logic state transition diagram of the high-speed serial port x control unit.

[0035] Figure 6 It is the data controller logic state transition diagram. DETAILED DESCRIPTION

[0036] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings. Specific implementation method 1

[0038] The following is a specific implementation of the multi-channel camera synchronization adapter module based on the Ping-Pong RAM structure of the present invention.

[0039] The structure diagram of the multi-channel camera synchronization adapter module based on the Ping-Pong RAM structure in this embodiment is as follows: Figure 1 The multi-channel camera synchronization adapter module based on the Ping-Pong RAM structure includes n high-speed cameras, n high-speed serial ports connected to the high-speed cameras, a synchronization pulse generator for generating synchronization pulses, 2n input buffers RAM#x_1 and RAM#x_2 for input buffers, where x=1, 2, ..., n, a data controller for image splicing, an output buffer FIFO, an output high-speed serial port and a command register;

[0040] The high-speed serial port includes a high-speed serial-to-parallel conversion port MIPI CSI2-RX and a control unit, and the control unit can read the image codec chip;

[0041] The command register includes a channel enable register enable_reg, an image frame rate configuration register period_reg and an image control register cmd_reg;

[0042] The channel enable register is 32 bits and is used to select which channels among the 16 channels to enable, and each of the lower 16 bits represents a channel;

[0043] The image frame rate configuration register is 32 bits and is used to configure the output pulse frequency of the synchronization pulse generator;

[0044] The image control register is 32 bits and is used to configure whether to start acquisition. When the highest bit is 1, it indicates that acquisition is enabled, and when the highest bit is 0, it indicates that acquisition is stopped. The remaining low 31 bits indicate the number of image frames allowed to be acquired continuously. For example, when all are 1, it means continuous acquisition of 2 to the 31st power frame images. At 40fps, it means that continuous acquisition is required for nearly 2 years. Specific implementation method 2

[0046] The following is a specific implementation of the multi-channel camera synchronous switching method based on the Ping-Pong RAM structure of the present invention.

[0047] The multi-channel camera synchronous switching method in this embodiment is implemented on the basis of a multi-channel camera synchronous switching module based on a ping-pong RAM structure in the first embodiment, and the specific steps are as follows:

[0048] Step a: connect n real-time cameras to n high-speed serial ports through the MIPI CSI2-RX interface, where n≤16, and the synchronization pulse generator generates synchronization pulses; write channel enable parameters to the channel enable register enable_reg, write image frame rate parameters to the image frame rate configuration register period_reg, write the start control command to the image control register cmd_reg, and start image acquisition;

[0049] Step b: When the control unit is in idle state, the rising edge of the synchronization pulse is monitored, and after the rising edge is detected, the frame header acquisition state step c, i.e., the data acquisition state, is entered;

[0050] Step c: The built-in counter starts working and determines whether a frame header appears. If the frame header data agreed upon in the protocol appears, the system jumps to the data receiving state, i.e., step d. If no frame header is detected, the system repeats this step to continue to determine whether a frame header appears. If the count is greater than a predetermined threshold and no frame header is detected, the system jumps to the idle state, i.e., step b. The data collection of this frame fails.

[0051] Step d: In the data receiving state, the string is continuously read according to the protocol, and the conversion result is stored in RAMx, wherein when x is 0, it is stored in RAM0, and when x is 1, it is stored in RAM1. x is 1-bit data, and is autonomously controlled by the control unit. After collecting a line of images, the data in n RAMx and the "line end pulse" are output, wherein n ≤ 16, and x is inverted, and the RAM is exchanged to realize the alternating ping-pong storage of RAM0 and RAM1, and execute step f; the built-in counter counts again, and when the counter reaches a frame of image specified by the protocol, the "image end" signal is output, and the control unit jumps to the idle state, i.e., step b; if there is no data input before the counter reaches the data specified by the protocol, it jumps to the data supplement state, i.e., step e;

[0052] Step e: Data supplementation state, supplement 0x00 to the predetermined data amount, output "image end" signal, and return to step b;

[0053] Step f: When the data controller is in an idle state, monitor the rising edge of the synchronization pulse, and when no rising edge is detected, maintain this state; when a rising edge is detected and the output is enabled, jump to the data preparation state, step g;

[0054] Step g: If a valid row end pulse is detected, that is, all enabled channels output row end pulses, a row of data is ready, and the process jumps to the data reading state step h; if a valid row end pulse is not detected after waiting for a timeout in this state, it means that the data is abnormal. If data reading has already started, the process jumps to the data supplement state step k, otherwise it directly jumps to the idle state step f; this state is the waiting period in the middle of row data reading, and after a row of data is read, the process returns to this state and waits for the next row of data to be ready;

[0055] Step h: This step is the data reading state. It detects the RAMx signal and determines which RAM data is valid. It reads all the data of the RAM of the first enabled channel and writes them into the FIFO. After the reading is completed, it jumps to the channel judgment state step i.

[0056] Step i: Determine whether all enabled channels have been read. If not, update the register state to the next enabled channel and jump back to the data reading state step h; if the reading is completed, jump to the image end judgment state step j;

[0057] Step j: Image end judgment state, judge whether the current reading time has timed out. If the timer has timed out but the image end pulse is still not detected, jump to the data supplement state step k; if the timer has not timed out, jump back to the idle state step f, wait for the next row data to be ready, and output the state judgment result to the high-speed serial port, and execute step l;

[0058] Step k: Data supplement state, according to the data counter that has been read currently, add 0x00 to the complete image frame, and after the supplement is completed, jump to the idle state step f to wait for the next frame of image; this step is to prevent redundant judgment of incomplete data caused by data errors between different channels;

[0059] Step 1: The output high-speed serial port receives the data from the FIFO and the image end status result in step j, and outputs the data through the optical fiber.

[0060] It should be noted that the above implementation modes are only exemplary descriptions of this patent and do not limit its protection scope. Those skilled in the art may also make partial changes thereto, and as long as they do not exceed the spirit of this patent, they are within the protection scope of this patent.

Claims

1. A multi-channel camera synchronization adapter module based on a ping-pong RAM structure, characterized in that: It includes n high-speed cameras, n high-speed serial ports connected to the high-speed cameras, a synchronous pulse generator for generating synchronous pulses, 2n input buffers RAM#x_1 and RAM#x_2 for input buffers, where x=1, 2, ..., n, a data controller for image stitching, an output buffer FIFO, an output high-speed serial port and a command register; The high-speed serial port includes a high-speed serial-to-parallel conversion port MIPI CSI2-RX and a control unit, and the control unit can read the image codec chip; The command register includes a channel enable register enable_reg, an image frame rate configuration register period_reg and an image control register cmd_reg; The channel enable register is 32 bits and is used to select which channels among the 16 channels to enable, and each of the lower 16 bits represents a channel; The image frame rate configuration register is 32 bits and is used to configure the output pulse frequency of the synchronization pulse generator; The image control register is 32 bits and is used to configure whether to start acquisition. When the highest bit is 1, it indicates that acquisition is enabled, and when the highest bit is 0, it indicates that acquisition is stopped. The remaining low 31 bits indicate the number of image frames allowed to be continuously acquired. The multi-channel camera synchronous switching method based on the ping-pong RAM structure implemented on the multi-channel camera synchronous switching module based on the ping-pong RAM structure comprises the following steps: Step a: connect n real-time cameras to n high-speed serial ports through the MIPI CSI2-RX interface, where n≤16, and the synchronization pulse generator generates synchronization pulses; write channel enable parameters to the channel enable register enable_reg, write image frame rate parameters to the image frame rate configuration register period_reg, write the start control command to the image control register cmd_reg, and start image acquisition; Step b: When the control unit is in idle state, the rising edge of the synchronization pulse is monitored, and after the rising edge is detected, the frame header acquisition state step c, i.e., the data acquisition state, is entered; Step c: The built-in counter starts working and determines whether a frame header appears. If the frame header data agreed upon in the protocol appears, the system jumps to the data receiving state, i.e., step d. If no frame header is detected, the system repeats this step to continue to determine whether a frame header appears. If the count is greater than a predetermined threshold and no frame header is detected, the system jumps to the idle state, i.e., step b. The data collection of this frame fails. Step d: In the data receiving state, the string is continuously read according to the protocol, and the conversion result is stored in RAMx, wherein when x is 0, it is stored in RAM0, and when x is 1, it is stored in RAM1. x is 1-bit data, and is autonomously controlled by the control unit. After collecting a line of images, the data in n RAMx and the "line end pulse" are output, wherein n ≤ 16, and x is inverted, and the RAM is exchanged to realize the alternating ping-pong storage of RAM0 and RAM1, and execute step f; the built-in counter counts again, and when the counter reaches a frame of image specified by the protocol, the "image end" signal is output, and the control unit jumps to the idle state, i.e., step b; if there is no data input before the counter reaches the data specified by the protocol, it jumps to the data supplement state, i.e., step e; Step e: Data supplementation state, supplement 0x00 to the predetermined data amount, output "image end" signal, and return to step b; Step f: When the data controller is in an idle state, monitor the rising edge of the synchronization pulse, and when no rising edge is detected, maintain this state; when a rising edge is detected and the output is enabled, jump to the data preparation state, step g; Step g: If a valid row end pulse is detected, that is, all enabled channels output row end pulses, a row of data is ready, and the process jumps to the data reading state step h; if a valid row end pulse is not detected after waiting for a timeout in this state, it means that the data is abnormal. If data reading has already started, the process jumps to the data supplement state step k, otherwise it directly jumps to the idle state step f; this state is the waiting period in the middle of row data reading, and after a row of data is read, the process returns to this state and waits for the next row of data to be ready; Step h: This step is the data reading state. It detects the RAMx signal and determines which RAM data is valid. It reads all the data of the RAM of the first enabled channel and writes them into the FIFO. After the reading is completed, it jumps to the channel judgment state step i. Step i: Determine whether all enabled channels have been read. If not, update the register state to the next enabled channel and jump back to the data reading state step h; if the reading is completed, jump to the image end judgment state step j; Step j: Image end judgment state, judge whether the current reading time has timed out. If the timer has timed out but the image end pulse is still not detected, jump to the data supplement state step k; if the timer has not timed out, jump back to the idle state step f, wait for the next row data to be ready, and output the state judgment result to the high-speed serial port, and execute step l; Step k: Data supplement state, according to the data counter that has been read currently, add 0x00 to the complete image frame, and after the supplement is completed, jump to the idle state step f to wait for the next frame of image; this step is to prevent redundant judgment of incomplete data caused by data errors between different channels; Step 1: The output high-speed serial port receives the data from the FIFO and the image end status result in step j, and outputs the data through the optical fiber.