An Image Acquisition System Based on FPGA

By receiving and processing the camera's serial data on the FPGA chip and converting it into MIPICSI-2 protocol format, it solves the integration problem of the CoaXPress interface and the ARM platform, achieving efficient and reliable image data processing, and is suitable for diverse applications processing platform.

CN117835073BActive Publication Date: 2024-10-22深圳市度申科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410241050.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-04
Publication Date
2024-10-22
Estimated Expiration
2044-03-04

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively integrate the image data transmitted by the CoaXPress interface with the processing platform based on the ARM architecture, resulting in increased system complexity and cost, and is not suitable for diversified processing platforms, especially in embedded systems.

Method used

Design an image acquisition system based on FPGA. It receives the serial data of the camera through the FPGA chip, converts it into parallel data, converts it into MIPICSI-2 protocol format, and sends it to the ARM platform, using high-speed transceiver and CoaXPress protocol analysis module. , frame control module, data cache module and MIPI DPHY transmission controller to achieve accurate and reliable processing of data.

Benefits of technology

It improves the accuracy and reliability of image data processing, simplifies system design, reduces costs, and improves compatibility and flexibility with the ARM platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117835073B_ABST
    Figure CN117835073B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image acquisition technology, specifically to an image acquisition system based on FPGA, comprising: a camera, an FPGA chip and an ARM platform; the camera is used to obtain serial data; the FPGA chip is used to receive and process the serial data from the camera, convert the serial data into parallel data, extract image data from the parallel data, convert the extracted image data into a MIPI CSI-2 protocol format, and send the image data converted into the MIPI CSI-2 protocol format to the ARM platform. The present invention proposes an image acquisition system based on FPGA, which utilizes the flexibility and high performance of FPGA to receive and process serial data from the camera, convert the data into a MIPI CSI-2 protocol format, so as to be directly compatible with an ARM-based processing platform, and improves the accuracy and reliability of data processing by integrating an efficient frame control module, a data cache module and a MIPI DPHY transmission controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image acquisition technology, and in particular to an image acquisition system based on FPGA. Background Art

[0002] With the rapid development of industrial automation and advanced image processing technology, the demand for efficient and reliable image acquisition systems is growing. In many applications, especially in the fields of high-speed, high-resolution industrial visual inspection and complex image analysis, it is necessary to capture a large amount of image data from the camera and process this data quickly and accurately.

[0003] Currently, CoaXPress (CXP) is a popular high-speed data transmission standard that is widely used in cameras. It supports high data transmission rates and long-distance transmission, making it suitable for demanding industrial environments. However, there is a challenge in how to effectively integrate image data transmitted via the CoaXPress interface with an ARM architecture-based processing platform. Traditional methods usually rely on the use of the PCI Express (PCIe) interface, which not only increases the complexity and cost of the system, but also limits its application to more diverse processing platforms, especially in embedded systems.

[0004] Therefore, it is necessary to develop an FPGA-based image acquisition system to solve the above problems. Summary of the invention

[0005] The embodiment of the present application provides an FPGA-based image acquisition system, including: a camera, an FPGA chip, and an ARM platform;

[0006] The camera is used to obtain serial data;

[0007] The FPGA chip is used to receive the serial data from the camera, convert the serial data into parallel data, extract image data from the parallel data, convert the extracted image data into MIPICSI-2 protocol format, and send the image data converted into MIPICSI-2 protocol format to the ARM platform.

[0008] Preferably, the FPGA chip includes a high-speed transceiver, a CoaXpress protocol parsing module, a frame control module, a data cache module, a MIPI DPHY transmission controller and a Regs module. The high-speed transceiver receives the serial data of the camera, converts the serial data into parallel data and passes it to the CoaXPress protocol parsing module. The CoaXPress protocol parsing module receives the parallel data and extracts valid image data, and passes the valid image data to the frame control module. The frame control module performs frame control, frame information statistics and image cropping on the image data, and transmits the processed image data to the data cache module. The data cache module caches the image data, uses DDR memory for read and write operations, and transmits the cached image data to the MIPI DPHY transmission controller. The MIPI DPHY transmission controller is used to convert the image data into MIPICSI-2 protocol format.

[0009] Preferably, the Regs module is used to read and write status information of the CoaXpress protocol parsing module, the frame control module, the data cache module and the MIPI DPHY transmission controller.

[0010] Preferably, the ARM platform has an I2C / SPI controller, and the I2C / SPI controller is used to access the status information read and written by the Regs module.

[0011] Preferably, the CoaXpress protocol analysis module includes a GTH IP module, a protocol analysis channel module, an asynchronous FIFO, a packet control module and an image interface module;

[0012] The GTH IP module provides a synchronous clock and transmits the converted parallel data to the protocol parsing channel module. The protocol parsing channel module is used to identify and parse the K code and the packet header in the parallel data. The K code and the packet header are used to extract image data from the parallel data. The parsed parallel data is synchronized by the synchronous clock. The valid parallel data after protocol parsing and synchronization is written into the asynchronous FIFO. The parallel data written into the asynchronous FIFO is transmitted to the packet control module.

[0013] Preferably, the packet control module is used to receive the parallel data, parse the parallel data, extract the image data, and perform CRC to verify the integrity of the parallel data. If the parallel data is found to be lost or erroneous, retransmission of the parallel data will be requested.

[0014] Preferably, the frame control module includes a detection module, and the detection module is used to discard image data that does not meet preset size requirements.

[0015] Preferably, the frame control module also includes a buffer management module, which is used to monitor the amount of cached data in the data cache module, and abandon cache of the next frame of image data when the data amount reaches 95% of the capacity limit, or abandon part of the cached image data when receiving an instruction from the detection module if there is an abnormality in the first frame of image data.

[0016] Preferably, the MIPI DPHY transmission controller includes a packet reassembly module, and the packet reassembly module is used to integrate the parallel data of multiple channels and send the parallel data of multiple channels to the ARM platform through a single MIPI DPHY transmission controller channel.

[0017] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: The present invention proposes an image acquisition system based on FPGA, which utilizes the flexibility and high performance of FPGA to receive and process serial data from a camera, and converts the serial data into the MIPI CSI-2 protocol format so as to be directly compatible with an ARM-based processing platform, and improves the accuracy and reliability of data processing by integrating an efficient frame control module, a data cache module and a MIPI DPHY transmission controller. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a schematic diagram of an image acquisition system based on FPGA according to an embodiment of the present invention;

[0019] Figure 2 is a schematic diagram of a CoaXpress protocol parsing module according to an embodiment of the present invention;

[0020] Figure 3 is a schematic diagram of an effective image data interface according to an embodiment of the present invention;

[0021] Figure 4 is a schematic diagram of a packet control module according to an embodiment of the present invention;

[0022] Figure 5 is a schematic diagram of a data cache module according to an embodiment of the present invention;

[0023] Figure 6 is a schematic diagram of a MIPI DPHY transmission controller according to an embodiment of the present invention;

[0024] Figure 7 Schematic diagram of a packet reassembly module according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, ordinary technology in the art.

[0026] All other embodiments obtained by personnel without creative work are within the scope of protection of the present disclosure. Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The words "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one", "one" or "the" do not indicate quantity restrictions, but indicate the existence of at least one. Words such as "include" or "comprise" mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0027] like Figure 1 As shown, an FPGA-based image acquisition system according to an embodiment of the present invention includes: a camera, wherein the camera is used to acquire serial data. The camera may be any type of camera that can acquire parallel data, such as a CoaXPress industrial camera.

[0028] An FPGA chip is used to receive the serial data from the camera, convert the serial data into parallel data, extract image data from the parallel data, convert the extracted image data into a MIPI CSI-2 protocol format, and send the image data converted into a MIPI CSI-2 protocol format to an ARM platform.

[0029] The FPGA chip includes a high-speed transceiver, a CoaXpress protocol parsing module, a frame control module, a data cache module, a MIPI DPHY transmission controller and a Regs module. The high-speed transceiver receives the serial data of the camera, converts the serial data into parallel data and passes it to the CoaXPress protocol parsing module. The CoaXPress protocol parsing module receives the parallel data and extracts valid image data, and passes the valid image data to the frame control module. The frame control module performs frame control, frame information statistics and image cropping on the image data, and transmits the processed image data to the data cache module. The data cache module caches the image data, uses DDR memory for read and write operations, and transmits the cached image data to the MIPI DPHY transmission controller. The MIPI DPHY transmission controller is used to convert the image data into MIPICSI-2 protocol format.

[0030] High-speed transceiver (GTH)

[0031] Receiving CoaXPress data from the camera: The high-speed transceiver first receives the CoaXPress data stream from the industrial camera. These data are transmitted in high-speed serial form. The received serial data is converted into parallel data by the high-speed transceiver to facilitate parsing and processing by the CoaXpress protocol parsing module inside the FPGA.

[0032] CoaXpress protocol analysis module

[0033] Attached Figure 2 A CoaXpress protocol analysis module, comprising a GTH IP module, a protocol analysis channel module, an asynchronous FIFO, a packet control module and an image interface module;

[0034] The GTH IP module provides a synchronous clock and transmits the converted parallel data to the protocol analysis channel module. The protocol analysis channel module is used to identify and analyze the K code and the packet header in the parallel data. The K code and the packet header are used to extract image data from the parallel data. The parsed parallel data is synchronized by the synchronous clock. The output parallel data is synchronized by a 312.5MHz clock. There is no need to use such a high frequency for subsequent data processing. The valid image data after protocol parsing and synchronization is written into the asynchronous FIFO. What is finally written into the asynchronous FIFO is the valid image data (the internal valid image data interface is as shown in the attached Figure 3 ) The parallel data written into the asynchronous FIFO is transmitted to the packet control module.

[0035] GTH IP module: Receives high-speed serial image data from the CoaXPress interface and provides a synchronous clock to ensure timing accuracy during data conversion.

[0036] Asynchronous FIFO: Buffering function, storing converted parallel data, playing a buffering role to cope with the mismatch of data processing rate, ensuring smooth and orderly data flow, and preventing data loss or congestion during high-speed data transmission.

[0037] Packet control module: The packet control module is used to receive the parallel data, parse the parallel data, and parse the K code and the packet header from the parallel data. The K code and the packet header are used to extract the image data from the parallel data and perform CRC to verify the integrity of the parallel data to ensure that the extracted image data is complete and correct. If it is found that the parallel data is lost or erroneous, the parallel data will be requested to be retransmitted.

[0038] Packets with CRC anomalies will be discarded, and the camera's packet ID will be checked to see if it is continuous. If it is not continuous, a retransmission command will be issued to the camera via the CoaXPress low-speed signal, as shown in the attached figure. Figure 4 As shown in the figure, Packet3 and Packet4 have been received, and after the packet inspection, they are judged as OK and output to the back-end module. Packet5 is judged incorrect, so a retransmission command is issued to the camera. After the camera receives the Packet5 retransmission command, it will jump back to the position of Packet5 from Ram and send Packet5->Packet6->Packet7 to fill in the packet5 and ensure the packet ID is continuous.

[0039] Image interface module: receives processed image data from the asynchronous FIFO, converts the image data into a format suitable for the post-buffer module, and coordinates the data flow of the entire system to ensure that the image data is accurately passed to the next processing stage.

[0040] Frame Control Module

[0041] The frame control module includes a detection module, which is used to discard image data that does not meet the preset size requirement. The frame control module also includes a buffer management module, which is used to monitor the data cache module (such as Figure 5 The amount of cached data in the image data buffer (as shown in the figure) is determined, and when the amount of data reaches 95% of the upper capacity limit, the cached next frame of image data is abandoned; or when an instruction from the detection module is received, if the first frame of image data is abnormal, part of the cached image data is abandoned.

[0042] When the image data flows from the CoaXPress protocol parsing module to the frame control module, the detection module first checks the size and integrity of each frame of image data. If a frame of image data does not meet the preset requirements, the detection module will instruct the system to discard the frame, thereby ensuring the quality of the image data passed to the subsequent processing module, and monitor the amount of data in the data cache module in real time through the buffer management module to ensure the efficient use of the cache and system stability. When the data volume reaches 95% of the capacity limit or encounters abnormal data, the buffer management module will make corresponding processing, such as giving up caching the next frame of data or discarding the cached abnormal data.

[0043] MIPI DPHY Transmit Controller

[0044] The MIPI DPHY transmission controller includes a packet reassembly module, which is used to integrate parallel data of multiple channels and send the parallel data of multiple channels to the ARM platform through a single MIPI DPHY transmission controller channel.

[0045] MIPI DPHY transmission controller as attached Figure 6 As shown, PixeltoByte, LowLevelProtocol, and LaneManagementLayer are implemented by FPGA logic, the D-PHY module uses the hard core of the FPGA, and the 4 TX modules can support DPHY TX of up to 4 physical channels.

[0046] PixeltoByte is pixel to byte conversion. CSI-2 supports a variety of pixel formats. After the image data passes through this module, it will output 8-bit byte stream data in a certain order to the back-end low-level protocol layer.

[0047] LowLevelProtocol low-level protocol layer, adds headers and tails to the newly produced data to form a data stream that meets the protocol requirements;

[0048] LaneManagement is the channel management layer. It manages the read and write of the generated data stream according to a certain order requirement and outputs the data stream. The Lane data volume supports 1 / 2 / 4. When multiple lanes are transmitted, the byte stream is fairly distributed.

[0049] The packet reassembly module first receives parallel image data from multiple processing modules inside the FPGA, performs appropriate format adjustment and timing synchronization on the data from different channels to ensure the accuracy of data integration, and converts the integrated data to the MIPI CSI-2 protocol format, including adding necessary header and trailer information, and sends the converted data to the ARM platform through a single channel of the MIPI DHY transmission controller, which significantly improves the efficiency of data transmission, especially when processing multi-channel image data, reduces the need for multiple physical transmission channels, simplifies system design, reduces costs, ensures that the output image data fully complies with the MIPI CSI-2 standard adopted by the ARM platform, and improves the compatibility and flexibility of the system.

[0050] The MIPICSI-2 layer supports up to 4 VC channels to be packaged and output to a single DPHY hardware channel, as shown in the attached figure. Figure 7 , 4 packet assembly modules respectively package the front-end data into MIPI CSI-2 protocol packets, the data of channel 0 is packaged into VC0, the data of channel 1 is packaged into VC1, the data of channel 2 is packaged into VC2, and the data of channel 3 is packaged into VC3. Finally, it is sent out by a MIPI DPHY transmission controller through the packet reassembly module, satisfying the application of a MIPI DPHY transmission controller receiving channel to receive 4-way camera data.

[0051] Interaction between ARM platform and FPGA:

[0052] The Regs module is used to read and write status information of the CoaXpress protocol parsing module, the frame control module, the data cache module and the MIPI DPHY transmission controller. The ARM platform has an I2C / SPI controller, and the I2C / SPI controller is used to access the status information read and written by the Regs module.

[0053] The Regs module is used to store and manage the configuration parameters and status information of each module in the FPGA chip, including the CoaXpress protocol parsing module, frame control module, data cache module and MIPI DPHY transmission controller. It has the function of real-time monitoring of the status of each part of the system, including error detection and performance monitoring, allowing external devices (such as ARM platform) to read or modify these status information through standard communication protocols (I2C / SPI). The I2C / SPI controller on the ARM platform allows users to remotely configure and control each module in the FPGA through a software interface. Users can adjust image acquisition parameters such as frame rate, resolution, and data cache size as needed, and can monitor the operating status of the system, including detecting possible errors.

[0054] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0055] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0056] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0057] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0058] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0059] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. An image acquisition system based on FPGA, characterized in that: include: Camera, FPGA chip and ARM platform; The camera is used to obtain serial data; The FPGA chip is used to receive the serial data from the camera, convert the serial data into parallel data, extract image data from the parallel data, convert the extracted image data into a MIPI CSI-2 protocol format, and send the image data converted into a MIPI CSI-2 protocol format to the ARM platform; The FPGA chip includes a high-speed transceiver, a CoaXpress protocol parsing module, a frame control module, a data cache module, a MIPI DPHY transmission controller and a Regs module. The high-speed transceiver receives the serial data of the camera, and converts the serial data into parallel data and transmits it to the CoaXPress protocol parsing module. The CoaXPress protocol parsing module receives the parallel data and extracts valid image data, and transmits the valid image data to the frame control module. The frame control module performs frame control, frame information statistics and image cropping on the image data, and transmits the processed image data to the data cache module. The data cache module caches the image data, uses DDR memory for read and write operations, and transmits the cached image data to the MIPI DPHY transmission controller. The MIPI DPHY transmission controller is used to convert the image data into MIPICSI-2 protocol format; The CoaXpress protocol analysis module includes the GTH IP module, the protocol analysis channel module, the asynchronous FIFO, the packet control module and the image interface module; The GTH IP module provides a synchronous clock and transmits the converted parallel data to a protocol parsing channel module, the protocol parsing channel module is used to identify and parse the K code and the packet header in the parallel data, the K code and the packet header are used to extract image data from the parallel data, the parsed parallel data is synchronized by the synchronous clock, the valid parallel data after protocol parsing and synchronization is written into the asynchronous FIFO, and the parallel data written into the asynchronous FIFO is transmitted to the packet control module; The packet control module is used to receive the parallel data, parse the parallel data, extract the image data, and perform CRC to verify the integrity of the parallel data. If the parallel data is found to be lost or erroneous, it will request to retransmit the parallel data.

2. The FPGA-based image acquisition system according to claim 1, characterized in that: The Regs module is used to read and write status information of the CoaXpress protocol parsing module, the frame control module, the data cache module and the MIPIDPHY transmission controller.

3. The FPGA-based image acquisition system according to claim 2, characterized in that: The ARM platform has an I2C / SPI controller, and the I2C / SPI controller is used to access the status information read and written by the Regs module.

4. The FPGA-based image acquisition system according to claim 1, characterized in that: The frame control module includes a detection module, and the detection module is used to discard image data that does not meet the preset size requirement.

5. The FPGA-based image acquisition system according to claim 4, characterized in that: The frame control module also includes a buffer management module, which is used to monitor the amount of cached data in the data cache module, and abandon cache of the next frame of image data when the data amount reaches 95% of the capacity limit, or discard cached abnormal data upon receiving instructions from the detection module.

6. The FPGA-based image acquisition system according to claim 1, characterized in that: The MIPI DPHY transmission controller includes a packet reassembly module, which is used to integrate parallel data of multiple channels and send the parallel data of multiple channels to the ARM platform through a single MIPI DPHY transmission controller channel.