RAW image processing method, system and device and storage medium

By adopting soft compression method and characterizing direct memory access technology in the processing of raw image data, the problems of high resource occupation and compatibility limitations of hardware compression method are solved, and the effects of efficient intelligent compression and data restoration are achieved.

CN120224028APending Publication Date: 2025-06-27CHINA AUTOMOTIVE ENG RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510383490.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

When processing original image data, the hardware compression method has problems such as high resource usage, performance bottlenecks, high cost and compatibility limitations in the prior art, making it difficult to support new algorithms and efficient storage.

Method used

The soft compression method is adopted to transmit data through characterization direct memory access technology, and linear transformation and RGB data filling is used to obtain RGB format solid color data and then video encoding and packaging is performed.

Benefits of technology

It realizes efficient and intelligent compression of raw image data, reduces data storage space usage, reduces hardware costs, and improves the efficiency of data processing and analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120224028A_ABST
    Figure CN120224028A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a RAW image processing method, system and device and a storage medium, a plurality of RAW cameras collect image original data, and transmit the image original data to an industrial personal computer data collection card through a GSML2 protocol; the data acquisition card deserializes the original image data to obtain RAW data in an RGGB format, and transmits the RAW data to a preset interface of the industrial personal computer; a preset RAW image processing program of the industrial personal computer obtains the RAW data in the RGGB format from the preset interface, and linear transformation and RGB data filling are carried out to obtain pure color data in the RGB format; and sending the pure color data in the RGB format into a video card of the industrial personal computer for video coding, and packaging a coded video stream into a preset format. According to the method, the defects of an existing hardware compression mode are overcome, based on a software compression mode, the camera RAW data compression and acquisition technology is adopted, key image information is reserved, meanwhile, efficient and intelligent compression of original image data is achieved, the data storage space is reduced, the hardware cost is reduced, and the data processing and analysis efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly relates to a RAW image processing method, system, device and storage medium. Background Art

[0002] In the field of intelligent driving vehicles, the acquisition and application of raw image data are becoming increasingly important. Raw image data, or RAW data for short, is widely used in the model training and system optimization of intelligent vehicles due to its advantages in terms of cost, volume, power consumption, and its ability to provide high-quality image information. It is especially important for the implementation of advanced driver assistance systems (ADAS) and fully autonomous driving functions. In practical applications, it not only improves the perception accuracy of intelligent driving vehicles but also provides more information and details for multi-sensor fusion and handling complex scenarios. At the same time, with the evolution of technology, the high-definition intelligent driving scene data stored in raw image data will become the trend of future high-quality scene data, further promoting the development of intelligent driving vehicles.

[0003] Traditional raw image data processing methods generally use integrated processing chips for compression. There are mainly the following two methods:

[0004] One method is to use a dedicated image processor (ISP / DSP) to achieve hardware-level compression through an integrated image signal processor (ISP) or digital signal processor (DSP). The disadvantages of this method are as follows: 1) Low algorithm flexibility. Usually, it is optimized for specific compression algorithms (such as Delta coding, Huffman coding) at the hardware level, and it is difficult to support new algorithms (such as AI compression or wavelet transform), resulting in the dependence of technology upgrades on chip iterations; 2) Resource occupation and performance bottlenecks. For high-resolution RAW data, the ISP may experience delays or frame drops due to insufficient bandwidth; 3) The SoC integrated with the ISP generates obvious heat under high load, affecting the battery life of the camera; 4) Compatibility limitations. ISPs from different manufacturers adopt proprietary compression schemes (such as lossless RAW, RAF), resulting in poor compatibility of third-party software (requiring a dedicated decoding library).

[0005] Another method is FPGA / ASIC acceleration, which uses a programmable logic device (FPGA) or an application-specific integrated circuit (ASIC) to implement an efficient compression algorithm. The disadvantages of this method are as follows: 1) High development costs. Due to the irreversibility of ASICs, once the chip is fabricated, the algorithm cannot be modified; 2) High power consumption. The parallel computing units of FPGAs can consume 5 - 10W of power, requiring additional heat dissipation design; 3) Difficult algorithm updates. For example, the ProRes RAW encoder using ASIC acceleration cannot support new compression standards through firmware upgrades. Summary of the Invention

[0006] The present invention aims to provide a RAW image processing method, system, device and storage medium. By adopting the camera RAW data compression acquisition technology, it can efficiently and intelligently compress the original image data while retaining key image information. This not only greatly reduces the storage space occupied by the data, lowers the hardware cost, but also improves the efficiency of data processing and analysis.

[0007] The basic solution provided by the present invention is: a RAW image processing method, the method comprising:

[0008] S100, acquiring original image data through a plurality of RAW cameras and transmitting it through a specific protocol;

[0009] S200, processing the transmitted original image data to obtain RAW data in RGGB format and transmitting it through the technology representing direct memory access;

[0010] S300, using a preset RAW image processing program to obtain the transmitted RAW data in RGGB format, performing linear transformation and RGB data filling on it to obtain solid-color data in RGB format;

[0011] S400, performing video encoding on the solid-color data in RGB format and encapsulating it into a preset format.

[0012] The present invention also provides a RAW image processing system, the system comprising:

[0013] A data acquisition module, configured to acquire original image data through a plurality of RAW cameras and transmit it through a specific protocol; process the transmitted original image data to obtain RAW data in RGGB format and transmit it through the technology representing direct memory access;

[0014] A data processing module, configured to use a preset RAW image processing program to obtain the transmitted RAW data in RGGB format, perform linear transformation and RGB data filling on it to obtain solid-color data in RGB format;

[0015] A video encoding and encapsulation module, configured to perform video encoding on the solid-color data in RGB format and encapsulate it into a preset format.

[0016] The present invention also provides a RAW image processing device, the device comprising a plurality of RAW cameras and an industrial computer; the plurality of RAW cameras are configured to acquire original image data and perform data interaction with the industrial computer through a specific protocol;

[0017] An industrial control computer is installed with a data acquisition card, RAW image processing software, and an encoding and encapsulation component. The data acquisition card is used to receive and process raw image data, obtain RAW data in the RGGB format, and transmit it to a preset interface of the industrial control computer through a technology representing direct memory access. The RAW image processing software is used to obtain RAW data in the RGGB format from the preset interface, perform linear transformation and RGB data filling to obtain solid-color data in the RGB format, and send it to the encoding and encapsulation component. The encoding and encapsulation component is used to perform video encoding on the received solid-color data in the RGB format and encapsulate it into a preset format.

[0018] The present invention also provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer is enabled to execute any one of the RAW image processing methods described above.

[0019] The working principle and advantages of the present invention are as follows:

[0020] When processing large amounts of RAW image data, conventionally, hard compression is usually preferred over soft compression, mainly because hard compression can significantly reduce the burden on system resources and improve processing speed. Hard compression performs the compression task through dedicated hardware (such as GPU, FPGA, or ASIC), which is designed for efficient processing of large amounts of data and can complete complex calculations in a very short time, greatly improving work efficiency. In addition, hard compression devices often have an optimized data processing pipeline, which can achieve a more efficient energy consumption ratio, which is particularly important for tasks that require long-term operation and large-scale data processing. In contrast, conventionally, soft compression is usually considered to rely on the CPU for calculation. For high-resolution and large-data-volume RAW images, this will consume a large amount of computing resources, resulting in an extended processing time and potentially affecting the performance of other concurrently running applications. Therefore, when hard compression has obvious advantages, soft compression is usually not selected for processing large RAW images.

[0021] Although hard compression has obvious advantages, it also has obvious defects, which limit the wide use of RAW image processing and affect the technological improvement of related industries. Therefore, this solution specifically targets the existing defects of hard compression and instead selects the soft compression method that is not conventionally used. It not only solves the CPU problem and greatly reduces the storage space occupied by data, but also, in the face of usually large RAW data, achieves efficient and intelligent soft compression processing of the original image data, can retain key image information, enables the encoded data to be well restored, and is not restricted by the proprietary restoration algorithms of hard compression product manufacturers, having significant generality. At the same time, it reduces the hardware cost, improves the efficiency of data processing and analysis, and helps the popularization and use of technology and the technological improvement of related industries.

[0022] This solution takes into account that RAW data is usually huge in volume. If the conventional CPU moves data byte by byte (PIO mode), the CPU will be occupied for a long time and unable to execute critical tasks (such as image processing and logic control). Therefore, this solution adopts a technology representing direct memory access, which can be the existing DMA technology or other technologies that can achieve the effect of direct memory access. The essence of DMA technology is to offload the data transfer task through hardware, thus achieving: CPU resource release, improving real-time computing ability; maximizing bandwidth to meet the demand for high-speed large data volume; deterministic low latency, meeting the industrial hard real-time standard; energy efficiency optimization, adapting to harsh industrial environments.

[0023] This solution finds that the normal process of conventional soft compression is to convert the values of RGGB into a normal RGB color picture, similar to a normal picture after ISP processing and then perform encoding compression. The performance requirements are very high. If it is necessary to restore to the original image data, the compressed data needs to be decoded and then reversely restored to the RAW picture, which is simply impossible for users to restore to the original image data. Conventional soft compression involves the processing method from RGGB to RGB. Generally, it needs to go through steps such as extracting color channels, interpolating missing color values (such as bilinear interpolation, adaptive interpolation, etc.), color correction (such as white balance adjustment, color matrix transformation, etc.), and post-processing (noise reduction, sharpening, Gamma correction). After being processed by various algorithms and then encoded and compressed, there will also be losses in the U and V components during the compression process. The RGB original values generated in this way have changed and the RGGB data cannot be restored after encoding and compression.

[0024] This solution completely subverts the above existing methods. Different from the compression method after converting RGGB format data into a normal picture, it designs a way to compress RAW data, that is, fill the values after linear transformation of RGGB format data into pure color RGB format data for R, G, and B components, and then perform encoding and encapsulation, realizing the direct compression of RAW data, not restricted by the private restoration algorithms of hard compression product manufacturers, and the conversion is simple and the restoration degree of data is higher.

[0025] The conversion proposed in this solution is not a conversion in the conventional sense. Instead, a linear conversion method from RGGB to RGB is proposed. During the design of the data format conversion in this solution, it is found that due to the loss of the UV components during the (H264) encoding and compression process of conventional RGB pixel points, the restoration of RGB values is affected, and further the restoration of RGGB data is affected. Therefore, a linear conversion is proposed. For example, the R value in RGGB is filled into the three values of RGB. The RGB pixel points are filled with a single value after being linearly processed by RGGB, and the repeated values are filled to make the RGB values the same for pure colors. During encoding, it is calculated through the conversion formula from RGB to YUV: Y = 0.299R + 0.587G + 0.114B; U = -0.169R - 0.331G + 0.500B + 128; V = 0.500R - 0.419G - 0.081B + 128. Since the R, G, and B values of the RGB pixel points in this solution are the same, it is calculated that before encoding, Y = R, and U, V = 128, avoiding the error introduced by subsampling. During decoding and restoration, the Y component with the least loss during the encoding and compression process is directly taken for calculation and restoration, that is, the Y component is directly taken for calculation during restoration, that is, R = Y, which does not affect the restoration of RGB values, and further ensures the quality of the RAW data in RGGB format. Thus, this solution achieves good restoration after encoding. This restoration method only requires a linear conversion and is not restricted by the proprietary restoration algorithms of hardware compression product manufacturers. Moreover, the conversion is simple, with a higher degree of data restoration, avoiding information loss during the ISP processing process, and can more accurately restore the original image information, improving the accuracy of algorithm training and the performance of the intelligent driving system.

[0026] In the project of collecting RAW camera data during overseas vehicle road tests, if the original RAW data is stored, for a camera with a resolution of 3840 * 2160 and a frame rate of 30 frames per second, taking RAW12 as an example, each pixel occupies 1.5 bytes. The size of each RAW image is 3840 * 2160 * 1.5 / 1024 / 1024 = 11.86M. The data volume for 1 hour is 3600 * 30 * 11.86 / 1024 = 1.22TB. After being compressed into H264 and stored according to this solution, with a bitstream of 20Mbit / s for storage, the data volume for 1 hour is 3600 * 20 / 1024 / 8 = 8.79GB, saving about 141 times the storage space and greatly reducing the cost of overseas road test data storage for the host manufacturer.

[0027] In summary, this solution proposes a system architecture for an efficient camera RAW data acquisition and processing system, which can effectively process the video data collected by a high-resolution RAW camera. Taking the high-resolution RAW camera as the input node, through an accurate data protocol and an efficient DMA transmission mechanism, the real-time and accuracy of data acquisition are ensured. At the same time, through the format conversion of the system program and the efficient encoding of the graphics card, the fast processing and encapsulation of high-quality RAW image data are realized, providing a reliable technical guarantee for the compressed storage and transmission of RAW data. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 FIG. is a schematic flowchart of a RAW image processing method provided by an embodiment of the present invention Figure 1 ;

[0029] Figure 2 FIG. is a schematic flowchart of a RAW image processing method provided by an embodiment of the present invention Figure 2 ;

[0030] Figure 3 FIG. is a schematic flowchart of a RAW image processing method provided by an embodiment of the present invention Figure 3 ;

[0031] Figure 4 FIG. is a schematic diagram of the RGGB-RGB conversion process provided by an embodiment of the present invention;

[0032] Figure 5 FIG. is a schematic diagram of the RGGB-ARGB conversion program provided by an embodiment of the present invention;

[0033] Figure 6 FIG. is a diagram of the RAW example data before encoding provided by an embodiment of the present invention;

[0034] Figure 7 FIG. is a diagram of the RAW example data after decoding and restoration provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] The following is a more detailed description through specific embodiments:

[0036] The embodiment is basically as shown in the attached Figure 1 FIG.: A RAW image processing method, the method includes:

[0037] S100, collecting original image data through a plurality of RAW cameras and transmitting it through a specific protocol;

[0038] S200, processing the transmitted original image data to obtain RAW data in RGGB format and transmitting it through a technology representing direct memory access;

[0039] S300, obtain the transmitted RAW data in RGGB format using a preset RAW image processing program, and perform linear transformation and RGB data filling on it to obtain pure-color data in RGB format;

[0040] S400, perform video encoding on the pure-color data in RGB format and encapsulate it into a preset format.

[0041] Specifically, in S100, a RAW camera with a resolution of 3840×2160 is used as the video data input source. In this embodiment, 4 camera products of model SG8-OX08BC-GSML2 can be selected, with a FOV of 60°, and the positions can be placed in the front, left front, right front, and rear directions of the vehicle.

[0042] The original image data collected by the RAW camera is transmitted to the video capture card through the GSML2 protocol. In order to meet the system's requirements for high bandwidth, low latency, high synchronization, multiple types, and long-distance camera data access, it is decided to use a PCIE video capture card with an interface form of GSML2 to meet the requirements of this solution and the system.

[0043] In S200, the video capture card, as the front-end data acquisition device, is responsible for deserializing the original image data output by the RAW camera. Through DMA (Direct Memory Access) technology, the data is efficiently transmitted to the PCIE interface of the industrial computer, enabling the RAW data to be transferred from the video capture card to the acquisition host (industrial computer) for processing in real time, greatly reducing the burden on the CPU and maximizing the utilization of CPU resources. By using DMA technology, the following can be achieved: release of CPU resources, improvement of real-time computing capabilities; maximization of bandwidth to meet the requirements of high-speed large data volumes; deterministic low latency to meet industrial hard real-time standards; energy efficiency optimization to adapt to harsh industrial environments.

[0044] In S300, a RAWList list is created to store the RAW data to be processed. Since the amount of original RAW image data is large, real-time sequential processing has high requirements for the host performance and high costs. A thread pool is used to process the original image data in groups concurrently, which can not only utilize the multi-core performance of the CPU but also ensure real-time processing and avoid memory overflow. In the image processing thread, traverse the RAWList list and take out the RAW data in RGGB format for processing.

[0045] In this embodiment, the thread pool size is set to 4, and threads are created to process in groups of 30 RAW images, which can not only ensure the real-time nature of data processing but also avoid waste of system resources caused by excessive thread creation. The processed image data of each group is put into the RGBList list for subsequent encoding processing.

[0046] RAW data in the RGGB format has a value range of (0 to 4095). Linear transformation involves calculating the values of R, G, G, and B in RGGB in combination with a conversion factor and converting them to the RGB value range of (0 to 255). The following formula is specifically used for linear transformation:

[0047] y = factor * x

[0048] Among them, y is the value of R, G, and B after linear transformation, factor is the conversion factor, and x is the actual value of RGGB, that is, the actual measured values of the Red, Green, Green, and Blue color channels corresponding to each pixel in the original image data captured by the image sensor.

[0049] Specifically, as Figure 4 shown, Figure 4 (a) represents a sensor with a color filter array, with a color filter array (CFA) covering its surface. The most commonly used is the RGGB arrangement (Red, Green, Green, Blue). Figure 4 (b) represents the RGGB layout of the sensor. Each pixel only records the luminance value of one color channel. For example: in the RGGB arrangement, a 2×2 pixel block will record: R, G, G, B four values. Figure 4 (c) represents the output required for each pixel RGB, that is, writing the values of each pixel block of RGGB into R, G, and B of a single pixel point respectively.

[0050] Fill in according to the corresponding pixel points of RGGB, that is, multiply the values of R, G, G, and B in RGGB by the conversion factor and then assign them to the corresponding single pixel points in RGB respectively, so as to ensure that all the values of RGGB are retained in the RGB pixel points. The RGB pixel points are filled with single values after linear processing of RGGB, filling repeated values. Here, for the RGB pixel points, the values of R, G, and B are the same, making the RGB values the same pure color, that is, the generated RGB is a pure color value without any change.

[0051] When performing H264 encoding and compression, the RGB values need to be converted to YUV before encoding (Y = 0.299R + 0.587G + 0.114B; U = -0.169R - 0.331G + 0.500B + 128; V = 0.500R - 0.419G - 0.081B + 128). Since the RGB here are pure color values, at this time, the calculated Y = R, and U, V = 128. Since there will be losses in the UV components during H264 encoding, when decoding and restoring this solution, only the Y component is taken. The loss of the UV components has no impact on restoring the data of this solution. This way of directly taking the Y component as the RGB value ensures the integrity of the data. That is, before encoding, U, V = 128. When decoding and restoring, directly take the Y component with the least loss during the encoding and compression process, that is, R = Y for calculation and restoration.

[0052] In S400, H264 video encoding is adopted, and the preset format is the MP4 format.

[0053] When using an NVIDIA graphics card for H264 video encoding, it is necessary to process the transparency part of the pure color data in the RGB format, output pure color data in the ARGB format, and then send the pure color data in the ARGB format to the NVIDIA graphics card for video encoding. The specific processing of the transparency part is to fill the Alpha channel, that is, interpolate and encode RGB, and interpolate the A component. Interpolation is to convert to nvidia codec sdk the original data format supported by the encoding interface. Just set the A component directly to 255, which does not affect the subsequent encoding process. Finally, perform H264 / H265 encoding and compression on ARGB, encapsulate MP4, and realize the encoding and compression storage of RAW data. The specific implementation program for RAW data (RGGB format) to ARGB is as Figure 5 shown, and it can also be referred to as follows:

[0054] Void VideoProvider::RAWToRGB(unsigned char*srcData,std::vector<uint8_t>&flattened_rgb)

[0055] { / / Scale the RAW12 RGGB bit values to 8-bit RGB values

[0056] const double max_val_source = (1 << 12) - 1;

[0057] const double max_val_target = (1 << 8) - 1;

[0058] const double factor = max_val_target / max_val_source;

[0059] uint8_t* image_ptr = &flattened_rgb.front();

[0060] uint8_t a_value = 255

[0061] for (int i = 0; i < img_height; ++i)

[0062] { int rowOffset = i * img_width;

[0063] for (int j = 0; j < img_width; ++j)

[0064] { int index = (rowOffset + j) * 2;

[0065] int rgb_index = (rowOffset + j) * 4;

[0066] auto value = (srcData[index + 1] << 8 | srcData[index]);

[0067] uint8_t scaled_value = static_cast<uint8_t>(value * factor);

[0068] / / Fill ARGB data

[0069] uint8_t* ptr = image_ptr + rgb_index;

[0070] *ptr = scaled_value; / / Blue channel

[0071] *(ptr + 1) = scaled_value; / / Green channel

[0072] *(ptr + 2) = scaled_value; / / Red channel

[0073] *(ptr + 3) = a_value; / / Alpha channel}}}

[0074] The above RAW data processing process is as follows Figure 3As shown, after the original image data is deserialized, it is stored in the specified memory address of the data acquisition card. The data processing program of the industrial control computer (the preset RAW image processing program) copies the RAW data in the data acquisition card to the specified memory address of the industrial control computer through the technology representing direct memory access, and adds it to the RAWList list; determines whether the length of the RAWList list is equal to the preset length. In this embodiment, the preset length is 30; if it is equal to the preset length, the RAW data is passed into the RAWList list and the thread pool is started; traverses the RAWList to obtain the RAW data in RGGB format; determines the calculation conversion factor factor = 255 / 4095; performs RGGB linearization processing, multiplies the actual values of RGGB by the conversion factor factor respectively to obtain RGGB values with a value range of 0-255; assigns the RGGB values with a value range of 0-255 to the RGB of a single pixel point respectively, so that the values of RGB are the same as pure colors; R -> RGB, G -> RGB, G -> RGB, B -> RGB, that is, sets the values after linear transformation to RGB respectively:; RGB -> ARGB, that is, the RGB conversion to ARGB is completed; ARGB -> H264, that is, the ARGB completes the H264 video encoding; H264 -> MP4, that is, the video encoding ends and the MP4 format encapsulation is completed, and it ends.

[0075] This solution also provides a RAW image processing system, and the system includes:

[0076] A data acquisition module, which is used to collect original image data through several RAW cameras and transmit it through a specific protocol; processes the transmitted original image data to obtain RAW data in RGGB format and transmits it through the technology representing direct memory access;

[0077] A data processing module, which is used to obtain the transmitted RAW data in RGGB format by using a preset RAW image processing program and perform linear transformation and RGB data filling on it to obtain pure color data in RGB format;

[0078] A video encoding and encapsulation module, which is used to perform video encoding on the pure color data in RGB format and encapsulate it into a preset format.

[0079] This embodiment also provides a RAW image processing device, as Figure 2 shown, the device includes several RAW cameras and an industrial control computer; several RAW cameras are used to collect original image data and perform data interaction with the industrial control computer through a specific protocol;

[0080] An industrial control computer is installed with a data acquisition card, RAW image processing software, and an encoding and encapsulation component; the data acquisition card is used to receive and process raw image data, obtain RAW data in the RGGB format, and transmit it to a preset interface of the industrial control computer through a technology representing direct memory access; the RAW image processing software is used to obtain RAW data in the RGGB format from the preset interface, perform linear transformation and RGB data filling to obtain solid-color data in the RGB format, and send it to the encoding and encapsulation component; the encoding and encapsulation component is used to perform video encoding on the received solid-color data in the RGB format and encapsulate it into a preset format.

[0081] This embodiment also provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor of the computer, the computer is made to execute the above-mentioned RAW image processing method.

[0082] It can be understood that the above system, device, and storage medium can all fully execute the above-mentioned RAW image processing method and achieve the same effect, and the specific process will not be elaborated.

[0083] In the actual application process of the above method, system, device, and storage medium, a comparison is made between the RAW image data before encoding and the RAW image data after encoding. As Figure 6 shown is the RAW example data diagram before encoding. As Figure 7 shown is the RAW example data diagram after decoding and restoration. Through the result comparison, it can be seen that the RAW data before compression is basically the same as that after decompression, fully proving the feasibility of this compression method.

[0084] A RAW image processing method, system, device, and storage medium provided in this embodiment propose a system architecture for an efficient camera RAW data acquisition and processing system, which can effectively process the video data collected by a high-resolution RAW camera. Taking the high-resolution RAW camera as the input node, through an accurate data protocol and an efficient DMA transmission mechanism, the real-time and accuracy of data acquisition are ensured. At the same time, through the format conversion of the system program and the efficient encoding of the graphics card, the rapid processing and encapsulation of high-quality RAW image data are realized, providing a reliable technical guarantee for the compressed storage and transmission of RAW data.

[0085] The above are only embodiments of the present invention. Common knowledge such as specific structures and characteristics known in the art is not described in detail herein. Those of ordinary skill in the art know all the common general technical knowledge in the technical field to which the invention pertains before the filing date or the priority date, can know all the prior art in this field, and have the ability to apply conventional experimental means before this date. Those of ordinary skill in the art can, under the inspiration given in this application, complete and implement this solution in combination with their own abilities. Some typical well-known structures or well-known methods should not become obstacles for those of ordinary skill in the art to implement this application. It should be noted that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can still be made, and these should also be regarded as the protection scope of the present invention, and these will not affect the implementation effect of the present invention and the practicality of the patent.

Claims

1. A RAW image processing method, characterized in that: The method comprises: S100, collects raw image data through several RAW cameras and transmits it through a specific protocol; S200, processing the transmitted raw image data to obtain RGGB format RAW data, and transmitting the data through a technology representing direct memory access; S300, using a preset RAW image processing program to obtain the transmitted RGGB format RAW data, and performing linear transformation and RGB data filling on the data to obtain RGB format pure color data; S400 performs video encoding on the pure color data in RGB format and encapsulates it into a preset format.

2. A RAW image processing method according to claim 1, characterized in that: In S100, the specific protocol is the GSML2 protocol; in S200, the RGGB format RAW data is transmitted to the PCIE interface.

3. A RAW image processing method according to claim 1, characterized in that: In S300, a RAWList list is created to store the RGGB format RAW data to be processed; a thread pool is used to group and concurrently process the RGGB format RAW data.

4. A RAW image processing method according to claim 1, characterized in that: In S300, the linear transformation and RGB data filling are as follows: the values ​​of R, G, G, and B in RGGB are calculated in combination with the conversion factor, and then assigned to the corresponding single pixel points in RGB, so that RGB is a pure color value.

5. A RAW image processing method according to claim 4, characterized in that: The following linear transformation is performed: y=factor*x Among them, y is the value of R, G, and B after linear transformation, factor is the conversion factor, and x is the actual value of RGGB.

6. A RAW image processing method according to claim 4, characterized in that: During encoding compression, the RGB value is converted to YUV and then encoded. At this time, Y=R is calculated, and U and V are both 128; during decoding and restoration, the Y component with the least loss in the encoding and compression process, that is, R=Y, is directly taken for calculation and restoration.

7. A RAW image processing method according to claim 1, characterized in that: S400 also includes processing the transparency part of the RGB format pure color data, outputting the ARGB format pure color data, and then sending the ARGB format pure color data to the graphics card for video encoding.

8. A RAW image processing system, characterized in that: The system comprises: A data acquisition module is used to acquire raw image data through several RAW cameras and transmit it through a specific protocol; the transmitted raw image data is processed to obtain RGGB format RAW data, and the data is transmitted through a technology representing direct memory access; The data processing module is used to obtain the transmitted RGGB format RAW data by using a preset RAW image processing program, and perform linear transformation and RGB data filling on the data to obtain RGB format pure color data; The video encoding and packaging module is used to perform video encoding on RGB format pure color data and package it into a preset format.

9. A RAW image processing device, characterized in that: The device includes several RAW cameras and an industrial computer; the several RAW cameras are used to collect raw image data and exchange data with the industrial computer through a specific protocol; The industrial computer is installed with a data acquisition card, RAW image processing software and encoding packaging components; the data acquisition card is used to receive and process the original image data, obtain the RAW data in RGGB format, and transmit it to the preset interface of the industrial computer through the technology representing direct memory access; RAW image processing software, used to obtain RGGB format RAW data from a preset interface, perform linear transformation and RGB data filling, obtain RGB format pure color data, and send it to the encoding packaging component; The encoding and packaging component is used to perform video encoding on the received RGB format pure color data and encapsulate it into a preset format.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor of a computer, the computer is enabled to execute a RAW image processing method according to any one of claims 1 to 7.