The field relates to image distortion processing.
Electronics use in vehicles is increasing daily. In addition to the conventional engine controller, transmission controller, infotainment unit, body controller and the like, the advent of numerous safety and autonomous systems are greatly increasing the processing done inside a vehicle. For example, adaptive cruise control may entail intercommunication between a radar system, an engine controller and a transmission controller. More advanced features, such as collision avoidance and autonomous operation, may require significant image processing.
Forward facing cameras provide images from the front of the vehicle for lane departure warnings, traffic sign recognition, collision alert and object detection. Such cameras commonly use wide angle or fisheye lenses to increase the captured scene. However, wide angle or fisheye lenses conventionally induce distortion in the captured images. To correct the distortion, backward remapping or backmapping processing, from the output image to the input image, must be used. Because of the distortion, a one-to-one line remapping is not possible and multiple input lines are processed to develop one output line.
Conventionally, the input image data is stored in DRAM (dynamic random access memory) and distortion processing occurs on a frame-by-frame basis, as each input frame has completed other processing. The wait for a frame to be finished processing delays the image processing pipeline. The multiple input lines needed for a single output line hinders stream operations from the DRAM, requiring numerus new page operations, thus increasing used DRAM bandwidth and creating further delays in the image processing pipeline.
A lens distortion correction function operates by backmapping output images to the uncorrected, distorted input images. As a vision image processor completes processing on the image data lines needed for the lens distortion correction function to operate on a group of output, undistorted image lines, the lens distortion correction function begins processing the image data, rather than waiting for a full frame to be ready. This improves image processing pipeline delays by overlapping the operations. The vision image processor provides output image data to a circular buffer in SRAM (static random access memory), rather than providing it to DRAM. The lens distortion correction function operates from the image data in the circular buffer. By operating from the SRAM circular buffer, access to the DRAM for the highly fragmented backmapping image data read operations is removed, improving available DRAM bandwidth. By using a circular buffer, less space is needed in the SRAM. The improved memory operations further improve the image processing pipeline delays.
For a detailed description of various examples, reference will now be made to the accompanying drawings in which:
Referring now to
Referring now to
A graphics acceleration module 524 is connected to the high-speed interconnect 508. A display subsystem 526 is connected to the high-speed interconnect 508 and includes conversion logic 528 and output logic 530 to allow operation with and connection to various video monitors. A system services block 532, which includes items such as DMA controllers, memory management units, general-purpose I/O's, mailboxes and the like, is provided for normal SoC 500 operation. A serial connectivity module 534 is connected to the high-speed interconnect 508 and includes modules as normal in an SoC. A vehicle connectivity module 536 provides interconnects for external communication interfaces, such as PCIe block 538, USB block 540 and an Ethernet switch 542. A capture/MIPI module 544 includes a four-lane CSI-2 compliant transmit block 546 and a four-lane CSI-2 receive module and hub.
An MCU island 560 is provided as a secondary subsystem and handles operation of the integrated SoC 500 when the other components are powered down to save energy. An MCU ARM processor 562, such as one or more ARM R5F cores, operates as a master and is coupled to the high-speed interconnect 508 through an isolation interface 561. An MCU general purpose I/O (GPIO) block 564 operates as a slave. MCU RAM 566 is provided to act as local memory for the MCU ARM processor 562. A CAN bus block 568, an additional external communication interface, is connected to allow operation with a conventional CAN bus environment in the vehicle 100. An Ethernet MAC (media access control) block 570 is provided for further connectivity in the vehicle 100. External memory, generally non-volatile memory (NVM) is connected to the MCU ARM processor 562 via an external memory interface 569 to store instructions loaded into the various other memories for execution by the various appropriate processors. The MCU ARM processor 562 operates as a safety processor, monitoring operations of the SoC 500 to ensure proper operation of the SoC 500.
It is understood that this is one example of an SoC provided for explanation and many other SoC examples are possible, with varying numbers of processors, DSPs, accelerators and the like.
Referring now to
A DMA controller 410 is provided to assist in data transfer as required. A shared level 2 (SL2) RAM 412, an SRAM, is connected to the VISS 402 and each of the functions 404-408 and the DMA controller 410 to operate as local memory for the functions. A hardware thread scheduler (HTS) 414 provides scheduling and coordination of pipeline operations between the various functions. For more details on the HTS, please refer to U.S. Patent Application Publication No. 2018/0189105, hereby incorporated by reference. A VISS scheduler 416 is illustrated as receiving an output or producer from the VISS 402 and providing an input or consumer to the VISS 402. The producer is provided when the VISS 402 completes a particular operation, while the consumer is provided when the VISS 402 is to begin processing, as at the start of a frame. An LDC scheduler 418 is connected to the LDC function 404. The LDC function 404 has a consumer and a producer to the LDC scheduler 418. This consumer allows the processing of the LDC function 404 to be started or proceed to the next operation, while the producer allows the LDC function 404 to indicate completion of a particular operation or of the entire frame to start the next function in the image processing pipeline. A DMA1 scheduler 420 is connected to the DMA controller 410 and includes both the producer and a consumer so that the DMA controller 410 operation is initiated by a related function in the image processing pipeline to transfer data between the SL2 RAM 412 and the DDR 515 or MSMC 510 and starts operations of a related function based on commencement or completion of the data transfers to or from the DDR 515 or MSMC 510. To aid in this description of the pipeline operations, cameras 102 and 104 to provide video image data are connected to the capture/MIPI module 544, which is connected to the high-speed interconnect 508.
The vision processing accelerator 520 operates on blocks, which are multiple lines and multiple columns of data, generally image pixel data. For example, block 618 represents the squares of the second line and left four columns in the object grid 600. Block 619 is formed by the remaining squares in the second line. Block 618 and block 619 form a row of blocks for the second line. Referring to the barrel distortion grid 602, the corresponding block to block 618 is block 620, which includes the squares of the top two lines and left four columns of the barrel distortion grid 602. Block 621 corresponds to block 619 and is formed by the remaining squares in the top two lines. Blocks 620 and 621 are the row of blocks for the top two lines.
In the center of the object grid 600, a single line of squares forms block 622, which maps to block 624, a single line of squares in the underlying reference grid in the barrel distortion grid 602. Thus, as can be seen, the number of reference grid squares or data blocks in the distorted image varies with the location of the desired blocks in the distortion free or output image.
In a specific example, the image being processed is an HD image, with 1920 columns and 1080 lines. The vision processing accelerator 520 has a block size of 64 columns and 54 lines, resulting in a grid of 30 blocks by 20 blocks. In the example, lines 94-253, a total of 166 lines, map to the first row of blocks. Then lines 108-277, a total of 170 lines, map to the second row of blocks. Lines 132-307, a total of 175 lines, map to the third row of blocks. Lines 542-617, a total of 75 lines, map to the eleventh row of blocks. Lines 838-992, a total of 153 lines, map to the twentieth row of blocks. As can be seen, the number of lines varies with the location of the row of blocks.
The examples of
Referring to
The VISS 402 provides a producer or end of line processing signal as each line is completed. From these producers, the VISS scheduler 416 keeps track of the line number that the VISS 402 has just finished processing. When the appropriate number of lines have been processed by the VISS 402 and deposited in the circular buffer 650, the VISS scheduler 416 operates as an input image data block ready mapping element that determines that the lines needed for a block remapping operation are present in the SL2 RAM 412 and ready for operation by the LDC function 404. The VISS scheduler 416 provides an indication to the LDC scheduler 418, which also receives a signal indicating that there is available output buffer space in the SL2 RAM 412. The LDC scheduler 418 provides a notification to the LDC function 404 when both the chunk of data ready and output buffer availability signals are present, and thereafter for the rest of the row blocks when the output buffer availability signal is received and the LDC function 404 has completed the previous block.
A mesh remapping table 654 that contains values for remapping output image data locations in the output image data blocks to respective input image data locations in the input image data lines to properly obtain the needed image data has been placed in the SRAM 512 in the MSMC 510 by the processor 506. In another example the mesh remapping table 654 is located in the SL2 RAM 412. The LDC function 404 includes buffer pointers 653 to keep track of the beginning and end of the circular buffer 650 and the next read location. The LDC function 404 obtains or retrieves the appropriate image data for the desired output block, the multiple input lines needed for the particular output block being developed by the LDC function 404 based on the values in the mesh remapping table 654, as shown by path 4, and processes the retrieved input image data to provide the processed output image data. The completed undistorted image data is provided from the LDC function 404 to the SL2 RAM 412, as shown by path 5. The undistorted image data located in the SL2 RAM 412 can then be operated on by other functions in the image processing pipeline, such as the NF function 406 and the MSC function 408. The LDC function 404 provides a block completion signal to the LDC scheduler 418, which provides the notification to an appropriate scheduler for the NF function 406 or MSC function 408 at the end of each row of blocks or the end of the frame, as desired, as the LDC scheduler 418 is counting the completed blocks and then the rows of blocks to determine end of a row and end of the frame. The NF function 406 or the MSC function 408 then process the undistorted image data as defined by the image processing pipeline. These operations and later operations of the image processing pipeline are not shown for clarity.
The VISS 402 continues to process lines of the received image and provide the completed lines to the circular buffer 650. As the lines that are needed for the next block to be operated on by the LDC function 404 are deposited into the circular buffer 650, the VISS scheduler 416 provides a notification so that the LDC function 404 then operates on its next output block, as the necessary data is present in the circular buffer 650. The VISS 402 sequentially adds line image data to the circular buffer 650 while the LDC function 404 consumes it in blocks, with the LDC function 404 operating on a row of blocks as the needed lines are placed in the circular buffer 650 by the VISS 402. The circular buffer 650 is sized to hold at least the largest number of lines needed for an output row of buffers and the number of lines produced while the LDC function 404 processes a row of blocks.
By having the LDC function 404 operate out of the circular buffer 650 or 652, the LDC function 404 does not have to access the DDR 515 to obtain the necessary back remapping information. This reduces the bandwidth demand on the DDR 515, allowing additional functions to utilize the DDR 515. Because the VISS scheduler 416 keeps track of the lines in the circular buffer 650 to use in the block operations, so that the LDC function 404 operates on the image data as soon as the necessary data has been developed by the VISS 402, the image processing pipeline delays are reduced as the LDC function 404 is no longer waiting for an entire frame to be completed but is overlapping operations with the VISS 402.
From this description it can be seen that the SL2 RAM 412, the SRAM 512 holding the mesh remapping table 654, the LDC function 404 and the VISS scheduler 416 operate as an image data remapping engine.
Sometime later, when the VISS 402 finishes operations on the lines referenced by the first row of output blocks being developed by the LDC function 404 as determined by the VISS scheduler 416 and signaled to the LDC scheduler 418, the image data that has been processed by the VISS 402 has been moved to the circular buffer 650, 652 and a working buffer in the SL2 RAM 412 is available to receive the output of the LDC function 404, the LDC scheduler 418 provides, at time 806, an hts_tstart signal for block (0,0) to the LDC function 404. The LDC function 404 obtains the lookup table or mesh data values for the output block being developed from the mesh remapping table 654. When the mesh data is retrieved at time 808, the obtained mesh data values are utilized to develop the coordinates of the corner of the block to be developed and shortly thereafter the bounding box is developed for the input image data from the VISS 402. At time 810, the image data inside the image bounding box, the portions of the desired lines as output by the VISS 402 that map to the output block (0,0) of the LDC function 404 being developed, are retrieved. The image data retrieval is completed at time 812.
After the image data retrieval completes at time 812, the cycle repeats and the affine calculations for the corners of the next output block, block (0,1), are developed by the LDC function 404, followed by the bounding box computations for the mesh. At time 814, a block (0,1) hts_tstart signal is received by the LDC function 404, indicating that the working buffer is ready to receive the output of the LDC function 404 for the next block. Upon receiving the hts_tstart signal, the LDC function 404 retrieves the necessary mesh data for block (0,1). At this time, the main block processing, the primary image distortion operations, is commenced by the LDC function 404 for block (0,0), and undistorted image data is written to the working buffer in the SL2 RAM 412.
After the mesh data for the next block (0,1) is retrieved, the mesh corner coordinates are developed and the image bounding box is computed. Then at time 816 the necessary image data for the next block (0,1) is retrieved from the circular buffer 650 or 652. At time 818, the processing of the image data of block (0,0) is completed by the LDC function 404. The LDC function 404 completes writing the image output data to the SL2 RAM 412 at time 820. The output write operation starts at time 815 and ends at time 820. At time 820, a block (0,0) hts_tdone signal is provided by the LDC function 404 to the LDC scheduler 418, to allow the image data to be transferred to the DDR 515 if desired as described above.
When the image data of the last block, block (Last,Last), is finished being written to the working buffer, at time 860, an hts_tdone signal is provided. As the LDC scheduler 418 has been keeping track of rows and blocks, the LDC scheduler 418 knows that this is the hts_tdone signal for the last block of the frame. The LDC scheduler 418 provides a signal to the DMA1 scheduler 420 as normal to have the last block of image data transferred to the DDR 515. The LDC scheduler 418 provides a signal to the next scheduler in the image processing pipeline, so that the next function can proceed on performing operations on the lines of the row of blocks that has just been completed by the LDC function 404. If the next function is operating on a full frame of data and not on lines as provided incrementally by the LDC function 404, this signal is then the start signal for that function. The LDC scheduler 418 further provides an interrupt to the processor 506 to inform the processor 506 that the frame has been completed by the LDC function 404 and the vision processing accelerator 520 needs to be reprogrammed for the next frame to be processed. This interrupt is illustrated as the hts_init signal at time 862. Operations then proceed as described for
The reprogramming of the hardware thread scheduler 414 and the various functions, such as the LDC function 404, is done in this example because the vision processing accelerator 520 only operates on a single thread so that when a particular thread, a single frame from a given camera for example, has been completed, the vision processing accelerator 520 must be reprogrammed for the next frame for the next camera. It is understood that the reprogramming of the hardware thread scheduler 414 and other blocks could be omitted between frames if the vision processing accelerator 520 and its particular functions is capable of multithreaded operation by containing the appropriate contexts for the particular threads to be operated. Then the transition from one frame of one camera to a frame of another camera is done by indicating a context switch rather than reprogramming the hardware thread scheduler 414 and LDC function 404 and so on.
By beginning LDC function 404 operation as soon as the needed lines are available, VISS 402 and LDC function 404 operations can be overlapped, reduced overall image processing pipeline delay. By using a circular buffer to hold data from the VISS 402 to be processed by the LDC function 404, rather than sending the data to DDR 515, DDR 515 bandwidth use is decreased, as the scattered read operations needed for the back remapping distortion correction operation need not be handled by the DDR 515. This both decreases the delay in the image processing pipeline and increases the available bandwidth of the DDR 515.
While the VISS scheduler 416 has been described as including the mapping of lines to LDC function 404 blocks, in one example this mapping can be done in a spare scheduler. In this example, the VISS scheduler 416 provides an indication to the spare scheduler upon the completion of each line by the VISS 402. The spare scheduler then provides the block ready signal to the LDC scheduler 418.
While the above description has utilized correction of barrel or pincushion geometric distortion as examples, the back remapping and described operations are also suitable for chromatic aberration correction, changing the virtual camera viewpoint, constructing any desirable panorama output view, or any combinations of the above.
The above description is intended to be illustrative, and not restrictive. For example, the above-described examples may be used in combination with each other. Many other examples will be apparent upon reviewing the above description. The scope should, therefore, be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled. In the appended claims, the terms “including” and “in which” are used as the plain-English equivalents of the respective terms “comprising” and “wherein.”
This application claims priority to U.S. Provisional Application No. 62/956,988, filed Jan. 3, 2020, which is hereby incorporated by reference.
Number | Name | Date | Kind |
---|---|---|---|
10152767 | Hanson | Dec 2018 | B1 |
20160189350 | Glotzbach | Jun 2016 | A1 |
20170011493 | Eldar | Jan 2017 | A1 |
20170195564 | Appia | Jul 2017 | A1 |
20180189102 | Sanghvi | Jul 2018 | A1 |
20180189105 | Sanghvi et al. | Jul 2018 | A1 |
20180315170 | Mills | Nov 2018 | A1 |
20190347763 | Goel | Nov 2019 | A1 |
Entry |
---|
Hegde, Kartik et al. “HTS: A Hardware Task Scheduler for Heterogenous Systems.” Jun. 29, 2019. arXiv:1907.00271v1 [cs.OS] 11 pages. |
Moffitt, Michael D. et al. “Scalable Scheduling for Hardware-Accelerated Functional Verification.” Proceedings of the Twenty-First International Conference on Automated Planning and Scheduling, 2011, pp. 162-169. |
Clemente, Juan Antonio et al. “A Mapping-Scheduling Algorithm for Hardware Acceleration on Reconfigurable Platforms.” ACM Transactions on Reconfigurable Technology Systems, vol. V, No. N, Article A, Accepted 2013. DOI: http://dx.doi.org/10.1145.0000000.0000000. 28 pages. |
Hanhirova, Jussi. “Performance Analysis of Hardware Accelerated Scheduling.” Thesis submitted for examination or degree of Master of Science in Technology, Aalto University School of Science, Dec. 11, 2014, 78 pages. |
Usui, Hiroyuki et al. “DASH: Deadline-Aware High-Performance Memory Scheduler for Heterogeneous Systems with Hardware Accelerators.” https://github.com/CMU-SAFARI/HWASim. |
Usui, Hiroyuki et al. “SQUASH: Simple QoS-Aware High Performance Memory Scheduler for Heterogeneous Systems with Hardware Accelerators.” SAFARI Technical Report No. 2015-0003 (Mar. 18, 2015), pp. 1-20. |
Mody, Mihir et al. “Flexible and Efficient Perspective Transform Engine” 2017 IEEE International Conference on Consumer Electronics-Asia (ICCE-Asia). pp. 111-114. |
Hongshi, Wang et al. “The Distortion Correction of Large View Wide-angle Lens for Image Mosaic Based on OpenCV.” 2011 International Conference on Mechatronic Science, Electrical Engineering and Computer, Aug. 19-22, 2011, Jilin, China, pp. 1074-1077. |
Number | Date | Country | |
---|---|---|---|
20210209722 A1 | Jul 2021 | US |
Number | Date | Country | |
---|---|---|---|
62956988 | Jan 2020 | US |