CN117408872B - Color image data conversion method, device, equipment and storage medium - Google Patents

Color image data conversion method, device, equipment and storage medium Download PDF

Info

Publication number
CN117408872B
CN117408872B CN202311715260.2A CN202311715260A CN117408872B CN 117408872 B CN117408872 B CN 117408872B CN 202311715260 A CN202311715260 A CN 202311715260A CN 117408872 B CN117408872 B CN 117408872B
Authority
CN
China
Prior art keywords
image data
rgb image
raw image
color
data conversion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311715260.2A
Other languages
Chinese (zh)
Other versions
CN117408872A (en
Inventor
张海峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ailiguang Technology Co ltd
Original Assignee
Shenzhen Ailiguang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ailiguang Technology Co ltd filed Critical Shenzhen Ailiguang Technology Co ltd
Priority to CN202311715260.2A priority Critical patent/CN117408872B/en
Publication of CN117408872A publication Critical patent/CN117408872A/en
Application granted granted Critical
Publication of CN117408872B publication Critical patent/CN117408872B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)
  • Color Image Communication Systems (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

The invention relates to the technical field of data processing, and discloses a color image data conversion method, a device, equipment and a storage medium, wherein the method comprises the following steps: obtaining RGB image data by simulation software, wherein the RGB image data comprises red channel data, green channel data and blue channel data; and performing data conversion on the RGB image data to obtain RAW image data. Because the existing scene simulation software generally only provides ideal RGB image data, the existing hardware often needs RAW image data in the loop test process to realize comprehensive test of the controller to be tested. Based on the method, the RGB image obtained in the simulation software is subjected to data conversion to obtain the RAW image data, so that the technical problem that the original RAW image data cannot be provided in the prior art is solved, and the controller to be tested can be comprehensively tested based on the RAW image data.

Description

Color image data conversion method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for converting color image data.
Background
In the existing Hardware-In-Loop (HIL) test, in order to perform a comprehensive test on a controller to be tested, an image output by simulation software needs to be transmitted to the controller to be tested (i.e., domain control) to perform the Hardware-In-Loop test.
However, since domain control generally only receives RAW (RAW Image Format) data, the existing scene simulation software generally only provides ideal RGB (Red, green, blue, red, green and blue) Image data, and cannot provide original RAW Image data. Therefore, in order to meet the requirement of hardware-in-loop testing, it is necessary to develop a color image data conversion method to convert RGB image data output from scene simulation software into RAW image data.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a color image data conversion method, device, equipment and storage medium, and aims to solve the technical problem that the prior art only can provide RGB image data and can not provide RAW image data.
To achieve the above object, the present invention provides a color image data conversion method comprising the steps of:
obtaining RGB image data through simulation software, wherein the RGB image data comprises red channel data, green channel data and blue channel data;
and performing data conversion on the RGB image data to obtain RAW image data.
Optionally, the step of performing data conversion on the RGB image data to obtain RAW image data includes:
acquiring R values and/or G values and/or B values of corresponding pixel channels in the RGB image data;
and arranging the R value and/or the G value and/or the B value based on a Bayer array, and performing data conversion on the RGB image data based on an arrangement mode to obtain RAW image data.
Optionally, the step of performing data conversion on the RGB image data to obtain RAW image data further includes:
acquiring an original matrix corresponding to the RGB image data, and interpolating the original matrix by taking the matrix size of a preset matrix as the size of a target matrix to obtain an interpolation matrix;
and performing data conversion on the RGB image data based on the interpolation matrix and the size of the target matrix to obtain RAW image data.
Optionally, the step of performing data conversion on the RGB image data based on the interpolation matrix and the target matrix size to obtain RAW image data further includes:
adding the values of all pixel points in the interpolation matrix corresponding to the RGB image data to obtain pixels and values;
dividing the pixel sum value by the target matrix size to obtain RAW image data.
Optionally, the step of performing data conversion on the RGB image data to obtain RAW image data further includes:
acquiring color saturation and color ratio in a pixel channel in the RGB image data;
and performing data conversion on the RGB image data based on the color saturation and the color ratio to obtain RAW image data.
Optionally, the step of acquiring RGB image data by simulation software includes:
acquiring an original video stream output by simulation software, and judging whether the original video stream is in an RGB format or not;
if not, carrying out format conversion on the original video stream to obtain RGB image data.
Optionally, after the step of performing data conversion on the RGB image data to obtain RAW image data, the method further includes:
outputting the RAW image data to a video injection card, and transmitting the RAW image data to a controller to be tested through a low-voltage differential signal physical interface based on the video injection card;
and carrying out hardware-in-loop test on the controller to be tested based on the RAW image data.
In addition, in order to achieve the above object, the present invention also proposes a color image data conversion apparatus including:
the data acquisition module is used for acquiring RGB image data through simulation software, wherein the RGB image data comprises red channel data, green channel data and blue channel data;
and the data conversion module is used for carrying out data conversion on the RGB image data to obtain RAW image data.
In addition, in order to achieve the above object, the present invention also proposes a color image data conversion apparatus including: a memory, a processor, and a color image data conversion program stored on the memory and executable on the processor, the color image data conversion program configured to implement the steps of the color image data conversion method as described above.
In addition, in order to achieve the above object, the present invention also proposes a storage medium having stored thereon a color image data conversion program which, when executed by a processor, implements the steps of the color image data conversion method as described above.
The method comprises the steps of obtaining RGB image data through simulation software, wherein the RGB image data comprises red channel data, green channel data and blue channel data; and performing data conversion on the RGB image data to obtain RAW image data. Because the existing scene simulation software generally only provides ideal RGB image data, the existing hardware often needs RAW image data in the loop test process to realize comprehensive test of the controller to be tested. Based on the method, the RGB image obtained in the simulation software is subjected to data conversion to obtain the RAW image data, so that the technical problem that the original RAW image data cannot be provided in the prior art is solved, and the controller to be tested can be comprehensively tested based on the RAW image data.
Drawings
FIG. 1 is a schematic diagram of a color image data conversion device of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a color image data conversion method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a color image data conversion method according to a second embodiment of the present invention;
FIG. 4 is a flowchart of a third embodiment of a color image data conversion method according to the present invention;
fig. 5 is a block diagram showing the structure of a first embodiment of the color image data conversion device of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a color image data conversion device of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the color image data conversion apparatus may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the color image data conversion apparatus, and may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a color image data conversion program may be included in the memory 1005 as one storage medium.
In the color image data conversion apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the color image data conversion apparatus of the present invention may be provided in a color image data conversion apparatus which calls a color image data conversion program stored in the memory 1005 through the processor 1001 and performs the color image data conversion method provided by the embodiment of the present invention.
An embodiment of the present invention provides a color image data conversion method, referring to fig. 2, fig. 2 is a flowchart of a first embodiment of the color image data conversion method of the present invention.
In this embodiment, the color image data conversion method includes the steps of:
step S10: RGB image data including red channel data, green channel data, and blue channel data is acquired by simulation software.
It should be noted that, the execution body of the method of this embodiment may be a terminal device having functions of data acquisition, data processing and program running, such as a smart phone, a smart watch, etc., or may be an electronic device having the same or similar functions, such as the above-mentioned color image data conversion device. The present embodiment and the following embodiments will be described below by taking a color image data conversion apparatus (hereinafter referred to as a conversion apparatus) as an example.
It is understood that the above light source data may refer to information describing the characteristics and behavior of the light source. It contains the relevant parameters of brightness, color, direction, shape, etc. of the light source for simulating or presenting the lighting effect in the real world. In computer graphics and computer vision, light source data is often used for applications such as ray tracing, rendering, virtual reality, game development, and the like. By modeling and setting the light source data, different types of light sources, such as point sources, parallel light sources, spotlights, etc., can be simulated. The light source data typically includes information on several important aspects: the brightness, the intensity or the brightness of the light source determines the quantity of the radiation energy, and the higher the brightness is, the stronger the light emitted by the light source is; the color determines the wavelength composition of the emitted light, and different types of light sources have different color characteristics, such as a white light source, a warm light source (such as yellow), a cold light source (such as blue), and the like; direction and position, the direction and position of the light source can influence the irradiation mode and angle of the light, for example, a parallel light source can project the light in a fixed direction and angle, and a point light source emits the light from a specific position to the surrounding; shape and size: some light sources have specific shapes and sizes, such as spotlights, area light sources, etc., which parameters may influence the lighting effect and the formation of shadows.
The RGB image data may refer to digital data representing an image using three color channels of red (R), green (G), and blue (B). In an RGB image, each pixel consists of intensity values of three channels, representing the brightness or intensity of red, green and blue, respectively. For color images, each pixel has a corresponding three-channel value of red, green, and blue, typically represented by an 8-bit unsigned integer (0-255). These values describe the relative intensities of each color channel, and thus determine the color and brightness of the pixel. By combining the values of the three color channels red, green and blue, various colors can be generated. For example, (255, 0, 0) represents pure red, (0, 255, 0) represents pure green, (0, 0, 255) represents pure blue, and (255, 255, 255) represents white.
In a specific implementation, black level correction, dead pixel correction, RAW domain denoising, multi-frame fusion, digital gain, lens Shading, white balance correction (white balance is to adjust the color temperature of an image, so that the color of the image is more similar to the real color seen by human eyes), contrast adjustment and then Demosaic processing are performed to output RGB format data. Among them, demosaic processing is an image processing technique that can be used to convert monochrome image data captured by a color filter array (e.g., bayer array) into a complete color image. In a color image sensor, each pixel can only receive one of the three color channels red, green, and blue. This is because the color filter array uses different color filters at each pixel location. The goal of the Demosaic process is to estimate the values of the unknown color channels by interpolation algorithms and information of neighboring pixels to restore the complete color image.
Step S20: and performing data conversion on the RGB image data to obtain RAW image data.
It should be noted that, the RAW image data may refer to uncompressed or processed RAW image data obtained from a digital camera or other devices supporting the RAW image format. It records the light information received by the photosensitive element (such as an image sensor), and has high quality, high dynamic range and rich image details. Unlike common image file formats such as JPEG, the RAW format is not a specific standard format, but is a RAW image data format customized by each camera manufacturer, and the structure and storage manner of the RAW image data format are different according to the model of the camera. Each camera manufacturer may use a different RAW format and include therein RAW photosensitive element data and other relevant information such as white balance, color correction, exposure compensation, etc. set parameters.
In a specific implementation, the color matrix correction and the RGB Gamma processing can be performed on the RGB image data (Gamma correction is to adjust the brightness curve of the image so that the brightness distribution of the image more accords with the perception of human eyes); demosaicing is a process of converting raw data of a Bayer pattern into a color image. The color information of each pixel point on the sensor is recombined to form a complete color image, and then the RAW image data is output after purple fringing suppression, hue and saturation adjustment, Y Gamma processing, sharpening and color noise reduction.
In one embodiment, the hardware-in-loop test may be implemented by generating RGB image data by emulating an injection device and converting the RGB image data into RAW image data, and then inputting the RAW image data to a controller under test. More specifically, the above simulation injection device may include simulation software, inverse ISP algorithm software and video injection card, so the above hardware-in-loop test may be further refined into the following steps: firstly, acquiring RGB image data from simulation software; secondly, converting RGB image data into RAW image data through reverse ISP algorithm software; thirdly, outputting the RAW image data to a video injection card; and fourthly, transmitting the RAW image data to a controller to be tested (namely domain control) for hardware-in-loop test through an LVDS (low voltage differential signaling) physical interface by a video injection card.
In the embodiment, RGB image data is obtained through simulation software, wherein the RGB image data comprises red channel data, green channel data and blue channel data; and performing data conversion on the RGB image data to obtain RAW image data. Because the existing scene simulation software generally only provides ideal RGB image data, the existing hardware often needs RAW image data in the loop test process to realize comprehensive test of the controller to be tested. Based on the above, the method in this embodiment performs data conversion on the RGB image obtained in the simulation software to obtain RAW image data, thereby solving the technical problem that the original RAW image data cannot be provided in the prior art, and further being capable of comprehensively testing the controller to be tested based on the RAW image data.
Referring to fig. 3, fig. 3 is a flowchart illustrating a color image data conversion method according to a second embodiment of the present invention.
Based on the first embodiment, in this embodiment, in order to convert RGB image data into RAW image data with different arrangements, so as to improve the applicability of the color image data conversion method of this embodiment, the step S20 may include:
step S201: and acquiring R values and/or G values and/or B values of corresponding pixel channels in the RGB image data.
Step S202: and arranging the R value and/or the G value and/or the B value based on a Bayer array, and performing data conversion on the RGB image data based on an arrangement mode to obtain RAW image data.
The Bayer Array (Bayer Array) is a color filter Array (Color Filter Array, CFA) used in a digital image sensor, and is also called a color filter Array.
In a specific implementation, a color image may be captured by arranging three color filters of red, green, and blue on an image sensor by a bayer array. The method is based on the characteristic of human eyes on color perception, and utilizes the mixture of three main colors of red, green and blue to restore a full-color image. In bayer array, each pixel is only capable of sensing one of the three colors red, green, and blue. Approximately 50% of the pixels are assigned to the green filter, 25% to the red filter and the remaining 25% to the blue filter. This is because the human eye perceives green more sharply, so using more pixels for the green channel can increase the brightness and detail of the image. Each pixel selectively receives light of a certain color as it passes through the bayer array, depending on the filter in which it is located. Then, based on these monochrome information and interpolation algorithm, the RGB image data is subjected to data conversion, whereby RAW image data can be obtained.
Step S203: and obtaining an original matrix corresponding to the RGB image data, and interpolating the original matrix by taking the matrix size of a preset matrix as the size of a target matrix to obtain an interpolation matrix.
It should be noted that, the matrix size of the preset matrix may be 2×2, or may be 3×3 or other matrix sizes, which is not limited in this embodiment.
Step S204: and performing data conversion on the RGB image data based on the interpolation matrix and the size of the target matrix to obtain RAW image data.
In a specific implementation, the RAW image data may be obtained by adding values of each pixel point in the interpolation matrix to obtain a pixel sum value, dividing the pixel sum value by the target matrix size, and integrating the result. For example, assume that an interpolation matrix with a target matrix size of 2x2 exists, and a pixel in the matrix contains 4R values, i.e., R 00 ,R 01 ,R 10 ,R 11 The RAW image data of the pixel point can be expressed as:
step S205: and acquiring the color saturation and the color ratio in the pixel channel in the RGB image data.
Step S206: and performing data conversion on the RGB image data based on the color saturation and the color ratio to obtain RAW image data.
In a specific implementation, the above RGB image data may be divided into a matrix of 3X3 or 4X4, and R value, G value, B value of each pixel in the RGB image data is multiplied by the corresponding matrix of 3X3 or 4X4 in the RAW image data R value or G value or B value of each pixel of RGB image data is obtained. Wherein rr rg rb respectively determines the saturation of red channel, the proportion of green in red channel and the proportion of blue in red channel of each pixel in RGB image data; gr gg gb determines the proportion of red in the green channel, the saturation of green, and the proportion of blue in the green channel of each pixel in the RGB image data, respectively; br bg bb determines the proportion of red in the blue channel, the proportion of green in the blue channel, and the saturation of the blue channel, respectively, of each pixel in the RGB image data.
In the embodiment, the R value and/or the G value and/or the B value of the corresponding pixel channel in the RGB image data are obtained; arranging the R value and/or the G value and/or the B value based on a Bayer array, and performing data conversion on the RGB image data based on an arrangement mode to obtain RAW image data; acquiring an original matrix corresponding to the RGB image data, and interpolating the original matrix by taking the matrix size of a preset matrix as the size of a target matrix to obtain an interpolation matrix; performing data conversion on the RGB image data based on the interpolation matrix and the target matrix to obtain RAW image data; acquiring color saturation and color ratio in a pixel channel in the RGB image data; and performing data conversion on the RGB image data based on the color saturation and the color ratio to obtain RAW image data. According to the method, the RGB image data are subjected to data conversion in different modes to obtain the RAW image data, so that the RGB image data are converted into the RAW image data in different arrangement modes, and the applicability of the color image data conversion method is improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a third embodiment of a color image data conversion method according to the present invention.
Based on the above embodiments, in this embodiment, the step S10 may include:
step S101: and acquiring an original video stream output by simulation software, and judging whether the original video stream is in an RGB format.
Step S102: if not, carrying out format conversion on the original video stream to obtain RGB image data.
In a specific implementation, the format of the original video stream may be converted to obtain RGB image data by the following steps. First, video decoding: the original video stream is decoded to convert the video stream into a series of video frames. Second, frame extraction: each frame of image data is extracted from a sequence of video frames. Thirdly, format conversion: each frame of image data is subjected to a format conversion operation to be converted into RGB format, and in general, the original video stream may employ YUV (Y represents brightness luminence, U and V represent chromaticity), HSV (H represents Hue, S represents Saturation, and V represents brightness Value), and other color spaces, which need to be converted into RGB color space for subsequent processing and analysis. Fourth, image processing: after the RGB image data is obtained, the image may be further processed, such as cropping, scaling, filtering, etc. Thus, a series of RGB image data can be extracted from the original video stream.
Further, based on the above embodiments, in order to more fully perform the hardware-in-loop test on the to-be-tested controller, thereby improving the reliability of the test, after the step S20, the method may further include:
step S30: and outputting the RAW image data to a video injection card, and transmitting the RAW image data to a controller to be tested through a low-voltage differential signal physical interface based on the video injection card.
It should be noted that the video injection card (Video Capture Card) may be a hardware device for inputting an external video signal into a computer system. It typically has a video input interface, such as HDMI, VGA, DVI or a combined video interface, and an audio input interface. The video injection card can convert the external video signal into a digital signal which can be processed by a computer and transmit the digital signal to a computer system so as to carry out video capturing, editing, transcoding or real-time streaming media application.
It should be appreciated that the low voltage differential signaling physical interface (Low Voltage Differential Signaling, LVDS) is a common digital data transmission standard and physical layer interface, and may be widely used in the field of high-speed data transmission, such as a liquid crystal display, a camera module, an embedded system, and the like. The LVDS interface uses two signal lines whose voltages are differential from each other to transmit data, typically differential signals of positive and negative polarities.
Step S40: and carrying out hardware-in-loop test on the controller to be tested based on the RAW image data.
It should be understood that the Hardware-in-the-Loop Testing (HIL Testing) is a Testing method for verifying and debugging an embedded system, and can combine an actual Hardware device with a computer simulation environment to perform a system test by simulating a real scene.
In the HIL test, the controller or processor of the embedded system is connected to analog hardware devices, which are typically sensors, actuators, or other external devices of the system. By simulating the input and output signals of these hardware devices, comprehensive testing of the function, performance and stability of the embedded system can be performed.
It should be noted that the image signal processor (Image Signal Processor, abbreviated as ISP) may be a dedicated electronic chip or module for processing and optimizing the raw image data captured by the image sensor. The main functions of the image signal processor may include: the ISP can enhance the original image data to improve the brightness, contrast, detail and the like of the image so as to obtain better visual effect. Color correction: the ISP can correct the color of the image, and adjust parameters such as color balance, color temperature, saturation and the like so as to accurately present the true color. Denoising and noise reduction: ISP can apply denoising algorithm to reduce noise and artifact in image and improve image quality and definition. Automatic exposure and automatic focusing: the ISP can automatically adjust exposure and focusing parameters according to the ambient light conditions and the characteristics of the shot object, so that the image can be properly exposed and clearly displayed in various scenes. Color Filter Array (CFA) analysis: ISPs are capable of resolving and processing color filter array (e.g., bayer array) data to convert monochrome image data into a complete color image. Image compression and encoding: where storage or transmission of images is desired, the ISP may compress and encode the images to reduce file size or transmission bandwidth requirements.
In the embodiment, an original video stream output by simulation software is obtained, and whether the original video stream is in an RGB format or not is judged; if not, carrying out format conversion on the original video stream to obtain RGB image data; outputting the RAW image data to a video injection card, and transmitting the RAW image data to a controller to be tested through a low-voltage differential signal physical interface based on the video injection card; and carrying out hardware-in-loop test on the controller to be tested based on the RAW image data. According to the method, the format conversion is carried out on the original video stream to obtain the RGB image data, so that the negative influence of image data in other formats on the color image data conversion method is avoided, and the conversion efficiency of converting the RGB image data into the RAW image data is indirectly improved.
Furthermore, an embodiment of the present invention also proposes a storage medium having stored thereon a color image data conversion program which, when executed by a processor, implements the steps of the color image data conversion method as described above.
Referring to fig. 5, fig. 5 is a block diagram showing the structure of a first embodiment of the color image data conversion apparatus of the present invention.
As shown in fig. 5, a color image data conversion apparatus according to an embodiment of the present invention includes:
a data acquisition module 501 for acquiring RGB image data including red channel data, green channel data, and blue channel data by simulation software;
the data conversion module 502 is configured to perform data conversion on the RGB image data to obtain RAW image data.
In the embodiment, RGB image data is obtained through simulation software, wherein the RGB image data comprises red channel data, green channel data and blue channel data; and performing data conversion on the RGB image data to obtain RAW image data. Because the existing scene simulation software generally only provides ideal RGB image data, the existing hardware often needs RAW image data in the loop test process to realize comprehensive test of the controller to be tested. Based on the above, the method in this embodiment performs data conversion on the RGB image obtained in the simulation software to obtain RAW image data, thereby solving the technical problem that the original RAW image data cannot be provided in the prior art, and further being capable of comprehensively testing the controller to be tested based on the RAW image data.
Based on the above-described first embodiment of the color image data conversion device of the present invention, a second embodiment of the color image data conversion device of the present invention is proposed.
In this embodiment, the data conversion module 502 is further configured to obtain an R value and/or a G value and/or a B value of a corresponding pixel channel in the RGB image data; and arranging the R value and/or the G value and/or the B value based on a Bayer array, and performing data conversion on the RGB image data based on an arrangement mode to obtain RAW image data.
Further, the data conversion module 502 is further configured to obtain an original matrix corresponding to the RGB image data, and interpolate the original matrix with a matrix size of a preset matrix as a target matrix size to obtain an interpolated matrix; and performing data conversion on the RGB image data based on the interpolation matrix and the size of the target matrix to obtain RAW image data.
Further, the data conversion module 502 is further configured to add values of each pixel point in the interpolation matrix corresponding to the RGB image data to obtain a pixel and a value; dividing the pixel sum value by the target matrix size to obtain RAW image data.
Further, the data conversion module 502 is further configured to obtain a color saturation and a color ratio in a pixel channel in the RGB image data; and performing data conversion on the RGB image data based on the color saturation and the color ratio to obtain RAW image data.
Further, the data obtaining module 501 is further configured to obtain an original video stream output by the simulation software, and determine whether the original video stream is in an RGB format; if not, carrying out format conversion on the original video stream to obtain RGB image data.
Further, the data conversion module 502 is further configured to output the RAW image data to a video injection card, and transmit the RAW image data to a controller to be tested through a low-voltage differential signal physical interface based on the video injection card; and carrying out hardware-in-loop test on the controller to be tested based on the RAW image data.
Other embodiments or specific implementations of the color image data conversion device of the present invention may refer to the above method embodiments, and are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of embodiments, it will be clear to a person skilled in the art that the above embodiment method may be implemented by means of software plus a necessary general hardware platform, but may of course also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. read-only memory/random-access memory, magnetic disk, optical disk), comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (6)

1. A color image data conversion method, characterized in that the method comprises the steps of:
obtaining RGB image data through simulation software, wherein the RGB image data comprises red channel data, green channel data and blue channel data;
performing data conversion on the RGB image data to obtain RAW image data;
the step of performing data conversion on the RGB image data to obtain RAW image data includes:
acquiring R values and/or G values and/or B values of corresponding pixel channels in the RGB image data;
arranging the R value and/or the G value and/or the B value based on a Bayer array, and performing data conversion on the RGB image data based on an arrangement mode to obtain RAW image data;
the step of performing data conversion on the RGB image data to obtain RAW image data further includes:
acquiring an original matrix corresponding to the RGB image data, and interpolating the original matrix by taking the matrix size of a preset matrix as the size of a target matrix to obtain an interpolation matrix;
performing data conversion on the RGB image data based on the interpolation matrix and the target matrix to obtain RAW image data;
the step of performing data conversion on the RGB image data based on the interpolation matrix and the target matrix size to obtain RAW image data further includes:
adding the values of all pixel points in the interpolation matrix corresponding to the RGB image data to obtain pixels and values;
dividing the pixel sum value by the target matrix size to obtain RAW image data;
the step of performing data conversion on the RGB image data to obtain RAW image data further includes:
acquiring color saturation and color ratio in a pixel channel in the RGB image data;
performing data conversion on the RGB image data based on the color saturation and the color ratio to obtain RAW image data;
the step of performing data conversion on the RGB image data based on the color saturation and the color ratio to obtain RAW image data includes:
performing data conversion on the RGB image data based on the saturation of the red channel, the proportion of green in the red channel and the proportion of blue in the red channel to obtain an R value of a pixel in the RAW image data;
performing data conversion on the RGB image data based on the saturation of the green channel, the proportion of red in the green channel and the proportion of blue in the green channel to obtain a G value of a pixel in the RAW image data;
performing data conversion on the RGB image data based on the saturation of the blue channel, the proportion of red in the blue channel and the proportion of green in the blue channel to obtain a B value of a pixel in the RAW image data;
and determining the RAW image data according to the R value of the pixel in the RAW image data, the G value of the pixel in the RAW image data and the B value of the pixel in the RAW image data.
2. The color image data conversion method according to claim 1, wherein the step of acquiring RGB image data by simulation software comprises:
acquiring an original video stream output by simulation software, and judging whether the original video stream is in an RGB format or not;
if not, carrying out format conversion on the original video stream to obtain RGB image data.
3. The color image data conversion method according to any one of claims 1 to 2, characterized in that after the step of performing data conversion on the RGB image data to obtain RAW image data, further comprising:
outputting the RAW image data to a video injection card, and transmitting the RAW image data to a controller to be tested through a low-voltage differential signal physical interface based on the video injection card;
and carrying out hardware-in-loop test on the controller to be tested based on the RAW image data.
4. A color image data conversion device, characterized in that the color image data conversion device comprises:
the data acquisition module is used for acquiring RGB image data through simulation software, wherein the RGB image data comprises red channel data, green channel data and blue channel data;
the data conversion module is used for carrying out data conversion on the RGB image data to obtain RAW image data;
the step of performing data conversion on the RGB image data to obtain RAW image data includes:
acquiring R values and/or G values and/or B values of corresponding pixel channels in the RGB image data;
arranging the R value and/or the G value and/or the B value based on a Bayer array, and performing data conversion on the RGB image data based on an arrangement mode to obtain RAW image data;
the step of performing data conversion on the RGB image data to obtain RAW image data further includes:
acquiring an original matrix corresponding to the RGB image data, and interpolating the original matrix by taking the matrix size of a preset matrix as the size of a target matrix to obtain an interpolation matrix;
performing data conversion on the RGB image data based on the interpolation matrix and the target matrix to obtain RAW image data;
the step of performing data conversion on the RGB image data based on the interpolation matrix and the target matrix size to obtain RAW image data further includes:
adding the values of all pixel points in the interpolation matrix corresponding to the RGB image data to obtain pixels and values;
dividing the pixel sum value by the target matrix size to obtain RAW image data;
the step of performing data conversion on the RGB image data to obtain RAW image data further includes:
acquiring color saturation and color ratio in a pixel channel in the RGB image data;
performing data conversion on the RGB image data based on the color saturation and the color ratio to obtain RAW image data;
the step of performing data conversion on the RGB image data based on the color saturation and the color ratio to obtain RAW image data includes:
performing data conversion on the RGB image data based on the saturation of the red channel, the proportion of green in the red channel and the proportion of blue in the red channel to obtain an R value of a pixel in the RAW image data;
performing data conversion on the RGB image data based on the saturation of the green channel, the proportion of red in the green channel and the proportion of blue in the green channel to obtain a G value of a pixel in the RAW image data;
performing data conversion on the RGB image data based on the saturation of the blue channel, the proportion of red in the blue channel and the proportion of green in the blue channel to obtain a B value of a pixel in the RAW image data;
and determining the RAW image data according to the R value of the pixel in the RAW image data, the G value of the pixel in the RAW image data and the B value of the pixel in the RAW image data.
5. A color image data conversion apparatus, characterized by comprising: a memory, a processor, and a color image data conversion program stored on the memory and executable on the processor, the color image data conversion program configured to implement the steps of the color image data conversion method of any one of claims 1 to 3.
6. A storage medium having stored thereon a color image data conversion program which, when executed by a processor, implements the steps of the color image data conversion method according to any one of claims 1 to 3.
CN202311715260.2A 2023-12-14 2023-12-14 Color image data conversion method, device, equipment and storage medium Active CN117408872B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311715260.2A CN117408872B (en) 2023-12-14 2023-12-14 Color image data conversion method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311715260.2A CN117408872B (en) 2023-12-14 2023-12-14 Color image data conversion method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117408872A CN117408872A (en) 2024-01-16
CN117408872B true CN117408872B (en) 2024-04-05

Family

ID=89500306

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311715260.2A Active CN117408872B (en) 2023-12-14 2023-12-14 Color image data conversion method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117408872B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022141515A1 (en) * 2020-12-31 2022-07-07 深圳市大疆创新科技有限公司 Video encoding method and device and video decoding method and device
CN116546335A (en) * 2023-05-08 2023-08-04 北京经纬恒润科技股份有限公司 Simulation image acquisition method, simulation image acquisition device, electronic equipment and computer readable storage medium
CN116915971A (en) * 2023-06-16 2023-10-20 嬴彻星创智能科技(上海)有限公司 Quality evaluation method, device, equipment and medium for hardware-in-loop video data
CN116912127A (en) * 2023-07-26 2023-10-20 清华大学 RAW domain fog data simulation method based on inverse ISP

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022141515A1 (en) * 2020-12-31 2022-07-07 深圳市大疆创新科技有限公司 Video encoding method and device and video decoding method and device
CN116546335A (en) * 2023-05-08 2023-08-04 北京经纬恒润科技股份有限公司 Simulation image acquisition method, simulation image acquisition device, electronic equipment and computer readable storage medium
CN116915971A (en) * 2023-06-16 2023-10-20 嬴彻星创智能科技(上海)有限公司 Quality evaluation method, device, equipment and medium for hardware-in-loop video data
CN116912127A (en) * 2023-07-26 2023-10-20 清华大学 RAW domain fog data simulation method based on inverse ISP

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Reduction of Colour Artifacts using Inverse Demosaicking;Jim S. Jimmy Li et al.;2010 International Conference on Digital Image Computing: Techniques and Applications;20110117;摘要,第106页左栏第三段至第108页左栏第一段 *
丁晟 等.基于FPGA的自动驾驶HIL视频注入***设计.电子器件.2023,第46卷(第4期),第1075-1082页. *
基于FPGA的自动驾驶HIL视频注入***设计;丁晟 等;电子器件;20230820;第46卷(第4期);第1075-1082页 *
基于模型定义设计的深度网络相机图像处理器研究;张宇航;中国优秀硕士学位论文全文数据库 信息科技术辑;20220415(2022年第04期);第7-12页 *

Also Published As

Publication number Publication date
CN117408872A (en) 2024-01-16

Similar Documents

Publication Publication Date Title
CN110447051B (en) Perceptually preserving contrast and chroma of a reference scene
JP5045421B2 (en) Imaging apparatus, color noise reduction method, and color noise reduction program
KR101927968B1 (en) METHOD AND DEVICE FOR DISPLAYING IMAGE BASED ON METADATA, AND RECORDING MEDIUM THEREFOR
US9177396B2 (en) Image processing apparatus and image processing method
CN111161188B (en) Method for reducing image color noise, computer device and readable storage medium
KR20070090224A (en) Method of electronic color image saturation processing
CN112087648A (en) Image processing method, image processing device, electronic equipment and storage medium
Fairchild et al. Image appearance modeling
CN114693580A (en) Image processing method and related device
CN112686810A (en) Image processing method and device
CN116485979A (en) Mapping relation calculation method, color calibration method and electronic equipment
KR101361645B1 (en) Method and apparatus for compensating image distortion
CN112200747B (en) Image processing method and device and computer readable storage medium
Kwon et al. CAM-based HDR image reproduction using CA–TC decoupled JCh decomposition
US20170180694A1 (en) Method of encoding raw color coordinates provided by a camera representing colors of a scene having two different illuminations
CN117408872B (en) Color image data conversion method, device, equipment and storage medium
JP5202190B2 (en) Image processing method and image processing apparatus
CN112911366A (en) Saturation adjusting method and device and display equipment
CN112532872B (en) Method and device for adjusting camera parameters, storage medium and electronic equipment
US8390699B2 (en) Opponent color detail enhancement for saturated colors
CN113012051A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN112907653B (en) Image processing method, image pickup device and storage medium
US20240114251A1 (en) Server device and program
Pouli et al. Color management in HDR imaging
CN111476848B (en) Video stream simulation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant