Data processing method and apparatus
By dynamically adjusting the compression parameters based on the brightness distribution information of the image data, the problem of information loss caused by fixing the compression parameters under different lighting conditions is solved, and high-quality image data compression and transmission are achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- YINWANG INTELLIGENT TECHNOLOGIES CO LTD
- Filing Date
- 2024-10-30
- Publication Date
- 2026-05-07
AI Technical Summary
In existing technologies, image data is compressed using fixed compression parameters under different lighting conditions, resulting in significant information loss and affecting the image output quality of the image signal processor.
The compression parameters are dynamically adjusted based on the brightness distribution information of the image data. High bit depth image data is compressed to low bit depth through piecewise linear compression, preserving the original details of the image data and reducing the amount of data.
It reduces information loss caused by compression, improves the output quality of the image signal processor, and reduces data transmission bandwidth consumption.
Smart Images

Figure CN2024128388_07052026_PF_FP_ABST
Abstract
Description
A data processing method and apparatus Technical Field
[0001] This application relates to the field of intelligent vehicle technology, and in particular to a data processing method and apparatus. Background Technology
[0002] Image sensors convert optical signals acquired from the surrounding environment by optical modules into digital signals to generate raw image data. To accommodate different image signal processors (ISPs) and reduce the bandwidth consumed when transmitting image data to the ISP, image data is typically compressed before transmission. For example, piecewise linear (PWL) compression is used to compress high-bit-depth image data to low-bit-depth, such as compressing 24-bit image data to 12-bit.
[0003] In different lighting environments, the distribution of dark and bright components in image data varies. Currently, image data is compressed using fixed compression parameters set by the factory default, which results in significant information loss and is detrimental to the image output quality of the ISP.
[0004] Summary of the Invention
[0005] This application discloses a data processing method and apparatus that enables compression parameters to conform to the brightness distribution of image data, reduces information loss caused by compression, and helps improve the output quality of ISP.
[0006] In a first aspect, this application provides a data processing method, comprising: firstly, acquiring first image data, wherein the bit depth of the first image data is a first bit depth; then, determining compression parameters based on the first image data, and compressing the first image data according to the compression parameters to obtain second image data. The compression parameters are related to the brightness distribution information of the first image data, which indicates the distribution of pixel brightness values in the first image data across multiple brightness intervals, these multiple brightness intervals belonging to the data range of the first bit depth. The second image data has a second bit depth, and the first bit depth is greater than the second bit depth.
[0007] Here, the first image data includes the brightness value of each pixel in a plurality of pixels. In this scheme, the bit depth of the first image data refers to the number of binary bits required to store the brightness value of each pixel in the first image data, and the unit is bits. For example, a bit depth of 24 bits means that the brightness value of each pixel in the first image data needs to be stored using 24 bits.
[0008] Optionally, the first image data is the first raw data output by the image sensor after converting the captured light signal into a digital signal, or the first image data is the second raw data obtained by signal processing of the first raw data.
[0009] In the above method, the compression parameters of the image data are determined based on the brightness distribution of the image data. This means that the compression parameters used to compress the image data can be dynamically adjusted according to the brightness distribution of the image data. Using these compression parameters to compress the image data from a high bit depth to a low bit depth preserves as much of the original detail of the image data as possible, minimizing information loss due to compression and improving the image output quality of the ISP. Furthermore, this compression not only reduces the amount of image data but also helps reduce bandwidth consumption during image data transmission.
[0010] In one possible implementation of the first aspect, the method further includes: sending data compression information, the data compression information including second image data and the aforementioned compression parameters, the compression parameters being used to decompress the second image data.
[0011] Optionally, the transmission of the aforementioned compression parameters occurs before the transmission of the second image data. In some schemes, the second image data and the compression parameters may also be transmitted separately and independently.
[0012] Implementing this method supports the transmission of image data compression results and the compression parameters used. The transmission of compression parameters precedes the transmission of the second image data, allowing the receiving end of the data compression information to receive the compression parameters first. This is beneficial for improving the processing speed of the receiving end in decompressing the second image data using the compression parameters.
[0013] In one possible implementation of the first aspect, the brightness distribution information of the first image data also includes the number of pixels for each brightness value in the first image data.
[0014] In this way, we can know the number of pixels in the first image data that fall into each of the above brightness intervals, and thus know the total number of pixels in the first image data that fall into each of the above brightness intervals. This information helps to accurately divide the range of the mapping interval corresponding to the brightness interval above the first depth within the data range of the second depth. The compression parameters obtained in this way are more consistent with the brightness distribution of the first image data.
[0015] In one possible implementation of the first aspect, the brightness distribution information of the first image data includes the number of brightness values in the first image data that fall into each brightness interval.
[0016] By implementing this method, the brightness distribution information of the first image data can be used to determine how many different brightness values fall into each brightness interval. This helps to accurately divide the range of the mapping interval corresponding to the brightness interval in the first depth within the data range of the second depth. As a result, the compression parameters obtained are more consistent with the brightness distribution of the first image data.
[0017] In one possible implementation of the first aspect, the brightness distribution information of the first image data further includes at least one of the following:
[0018] The probability of a pixel appearing for each brightness value in the first image data;
[0019] The first probability corresponding to each brightness range; and,
[0020] The second probability corresponding to each brightness range;
[0021] Wherein, the probability of a pixel with a first brightness value appearing in the first image data is the ratio of the total number of pixels with the first brightness value in the first image data to the total number of pixels in the first image data; the first probability corresponding to the first brightness interval among the above plurality of brightness intervals is the ratio of the number of brightness values falling into the first brightness interval in the first image data to the total number of brightness values in the first image data; the second probability corresponding to the first brightness interval is the ratio of the total number of brightness values falling into the first brightness interval in the first image data to the total number of pixels in the first image data.
[0022] Here, the second probability corresponding to the first brightness range is also the sum of the probabilities of each brightness value in the first image data falling into the first brightness range.
[0023] By implementing this method, the first probability and / or the second probability corresponding to each brightness interval in the first bit depth can be obtained indirectly or directly through the brightness distribution information of the first image data. The interval length of the brightness interval mapped by each brightness interval in the first bit depth in the second bit depth can also be determined through the first probability and / or the second probability. Thus, the compression parameters obtained are more consistent with the brightness distribution of the first image data.
[0024] In one possible implementation of the first aspect, the aforementioned plurality of brightness intervals includes a first brightness interval and a second brightness interval. In the first image data, when the number of brightness values falling into the first brightness interval is greater than the number of brightness values falling into the second brightness interval, the first brightness interval is mapped to a third brightness interval, and the second brightness interval is mapped to a fourth brightness interval. Both the third and fourth brightness intervals belong to a data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval. Taking the third brightness interval as an example, the interval length of the third brightness interval is the difference between the upper limit and the lower limit of the third brightness interval.
[0025] In this implementation, the more luminance values in the first image data fall within the luminance range of the first bit depth, the longer the range length of the luminance range mapped to the luminance range of the second bit depth. Compression parameters are obtained based on the number of luminance values in the first image data falling within the luminance range of the first bit depth. When these compression parameters are used to compress the first image data, they ensure that the luminance value of each pixel in the first image data has a sufficient range to be mapped within the data range of the second bit depth. This allows for the preservation of as many differences between different luminance values in the first image data as possible, thus preserving as much detail information as possible and reducing information loss caused by compression.
[0026] In one possible implementation of the first aspect, the aforementioned plurality of brightness intervals include a first brightness interval and a second brightness interval. In the first image data, when the total number of pixels whose brightness values fall into the first brightness interval is greater than the total number of pixels whose brightness values fall into the second brightness interval, the first brightness interval is mapped to a third brightness interval, and the second brightness interval is mapped to a fourth brightness interval. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
[0027] In this implementation, the more pixels in the first image data whose brightness values fall within the first bit depth brightness range, the longer the range length of the brightness range mapped to the second bit depth brightness range. When the brightness values of pixels in the first image data are floating-point numbers, compression parameters are obtained based on the number of pixels whose brightness values fall within the first bit depth brightness range. When these compression parameters are used to compress the first image data, they ensure that the brightness value of each pixel in the first image data has a sufficient range to be mapped within the second bit depth data range. This allows for the preservation of as many differences between different brightness values in the first image data as possible, thus retaining as much detail information as possible and reducing information loss due to compression.
[0028] In one possible implementation of the first aspect, the aforementioned plurality of brightness intervals include a first brightness interval and a second brightness interval. When the first result corresponding to the first brightness interval is greater than the second result corresponding to the second brightness interval, the first brightness interval is mapped to a third brightness interval, and the second brightness interval is mapped to a fourth brightness interval. Both the third and fourth brightness intervals belong to a data range of a second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval. The first result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the first brightness interval and the number of brightness values in the first image data that fall within the first brightness interval. The second result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the second brightness interval and the number of brightness values in the first image data that fall within the second brightness interval.
[0029] By implementing this method, considering both the number of brightness values falling into the brightness range in the first image data and the total number of pixels falling into that brightness range, the range of the mapping interval corresponding to the brightness range in the first depth can be more accurately divided within the second depth data range. The resulting compression parameters are more consistent with the brightness distribution of the first image data. When compressing image data based on these compression parameters, the compression result can retain as much of the original details of the image data as possible, reducing information loss caused by compression and improving the output quality of the subsequent ISP.
[0030] In one possible implementation of the first aspect, the compression parameters include coordinate information of k segment nodes of a piecewise linear PWL curve, the k segment nodes being associated with the multiple brightness ranges, k being a positive integer, the k segment nodes including a first segment node, the coordinate information of the first segment node including first coordinate axis information and second coordinate axis information, the first coordinate axis information indicating a first brightness value of the first segment node in a data range of the first bit depth, and the second coordinate axis information indicating that the first brightness value is mapped to a second brightness value in a data range of the second bit depth.
[0031] By implementing this method, the obtained compression parameters only need to contain the coordinate information of multiple segment nodes. In this way, not only is the amount of data in the compression parameters reduced, but the PWL curve can also be obtained based on the compression parameters. Linear mapping based on the PWL curve can achieve image data compression.
[0032] In a possible implementation of the first aspect, the above-mentioned multiple brightness intervals include k + 1 brightness intervals, where k is a positive integer. Determining the compression parameter according to the first image data includes: determining k first brightness values according to the brightness distribution information of the first image data, and the k first brightness values divide the data range of the first bit depth into k + 1 brightness intervals; determining the second brightness value mapped to the data range of the second bit depth for each first brightness value according to the first probability corresponding to each brightness interval and / or the second probability corresponding to each brightness interval; where the first probability corresponding to the m-th brightness interval is the ratio of the number of brightness values falling into the m-th brightness interval in the first image data to the total number of brightness values in the first image data, and the second probability corresponding to the m-th brightness interval is the ratio of the total number of pixels of the brightness values falling into the m-th brightness interval in the first image data to the total number of pixels in the first image data, and m is a positive integer not greater than k + 1.
[0033] Exemplarily, the above k first brightness values correspond to k second brightness values, where the j-th first brightness value corresponds to the j-th second brightness value, and j is a positive integer less than or equal to k. The calculation method of the j-th second brightness value can be:
[0034] When j = 1, obtain the first second brightness value corresponding to the first first brightness value according to the target probability corresponding to the first brightness interval in the above k + 1 brightness intervals and the second bit depth;
[0035] When 1 < j ≤ k, obtain the j-th second brightness value according to the (j - 1)-th second brightness value, the target probability corresponding to the j-th brightness interval and the second bit depth;
[0036] Where the target probability corresponding to the j-th brightness interval is the first probability corresponding to the j-th brightness interval, or the second probability corresponding to the j-th brightness interval, or the result of the weighted sum of the first probability corresponding to the j-th brightness interval and the second probability corresponding to the j-th brightness interval.
[0037] Implementing this implementation method, calculating the k second brightness values corresponding to the above k first brightness values in combination with the first probability corresponding to each brightness interval on the first bit depth and / or the second probability corresponding to each brightness interval realizes a reasonable and accurate division of the interval range of the mapping interval corresponding to the brightness interval on the first bit depth within the data range of the second bit depth. The compression parameter obtained in this way conforms to the brightness distribution of the first image data, and when this compression parameter is used to compress the first image data, it also enables the brightness value of each pixel in the first image data to have sufficient interval range for mapping within the data range of the second bit depth. Thus, the difference between different brightness values in the first image data can be retained as much as possible, realizing the retention of as much detail information of the first image data as possible and reducing the information loss caused by compression.
[0038] In one possible implementation of the first aspect, compressing the first image data according to compression parameters to obtain the second image data includes: obtaining a PWL curve according to the compression parameters; obtaining the second image data according to the brightness value of each pixel in the first image data and the PWL curve, wherein the second image data includes a target brightness value in a second bit depth data range mapped from the brightness value of each pixel in the first image data.
[0039] By implementing this method, the PWL curve is obtained through compression parameters. Based on the PWL curve, the first image data with a high bit depth is compressed into the second image data with a low bit depth. This reduces the amount of image data while preserving as much of the original brightness detail as possible, and also helps to reduce the bandwidth consumption caused by transmitting image data.
[0040] Secondly, this application provides a data processing method, which includes: first, receiving second image data, the second image data being related to compression parameters and first image data, the compression parameters being related to the brightness distribution information of the first image data; then, decompressing the second image data according to the compression parameters to obtain third image data. The brightness distribution information of the first image data is used to indicate the distribution of pixel brightness values in the first image data across multiple brightness intervals, these multiple brightness intervals belonging to a first bit depth data range, where the first bit depth is the bit depth of the first image data, the bit depth of the second image data is the second bit depth, and the bit depth of the third image data is the first bit depth, with the first bit depth being greater than the second bit depth.
[0041] For example, the method is applied to computing devices that require decompression of second image data, such as image signal processors (ISPs) or other sensors or chips with similar functions.
[0042] In the above method, the compressed image data not only reduces the amount of transmitted image data but also lowers bandwidth consumption due to data transmission. Furthermore, the compression parameters are related to the brightness distribution information of the image data before compression. Using these parameters to compress the second image data preserves as much of the original detail as possible from the first image data, reducing information loss caused by compression. Thus, when decompressing the second image data using these parameters, as much of the original detail as possible can be recovered. Compared to decompressing image data using factory default compression parameters, the quality of the decompressed image data is higher.
[0043] In one possible implementation of the second aspect, the method further includes receiving compression parameters before receiving the second image data.
[0044] By implementing this method, compression parameters are obtained before acquiring the second image data, which allows for direct decompression of the second image data while it is being acquired, thus improving the decompression processing speed of the second image data.
[0045] For the beneficial effects of the technical features in the second aspect below, please refer to the description of the beneficial effects of the corresponding features in the first aspect, which will not be repeated here.
[0046] In one possible implementation of the second aspect, the brightness distribution information of the first image data also includes the number of pixels for each brightness value in the first image data.
[0047] In one possible implementation of the second aspect, the brightness distribution information of the first image data includes the number of brightness values in the first image data that fall into each brightness interval.
[0048] In one possible implementation of the second aspect, the brightness distribution information of the first image data further includes at least one of the following:
[0049] The probability of a pixel appearing for each brightness value in the first image data;
[0050] The first probability corresponding to each brightness range; and,
[0051] The second probability corresponding to each brightness range;
[0052] Wherein, the probability of a pixel with a first brightness value appearing in the first image data is the ratio of the total number of pixels with the first brightness value in the first image data to the total number of pixels in the first image data; the first probability corresponding to the first brightness interval among multiple brightness intervals is the ratio of the number of brightness values falling into the first brightness interval in the first image data to the total number of brightness values in the first image data; the second probability corresponding to the first brightness interval is the ratio of the total number of brightness values falling into the first brightness interval in the first image data to the total number of pixels in the first image data.
[0053] In one possible implementation of the second aspect, the aforementioned plurality of brightness intervals include a first brightness interval and a second brightness interval. In the first image data, when the number of brightness values falling into the first brightness interval is greater than the number of brightness values falling into the second brightness interval, the first brightness interval is mapped to a third brightness interval, and the second brightness interval is mapped to a fourth brightness interval. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
[0054] In one possible implementation of the second aspect, the aforementioned multiple brightness intervals include a first brightness interval and a second brightness interval. In the first image data, when the total number of pixels whose brightness values fall into the first brightness interval is greater than the total number of pixels whose brightness values fall into the second brightness interval, the first brightness interval is mapped to the third brightness interval, and the second brightness interval is mapped to the fourth brightness interval. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
[0055] In one possible implementation of the second aspect, the aforementioned plurality of brightness intervals include a first brightness interval and a second brightness interval. When the first result corresponding to the first brightness interval is greater than the second result corresponding to the second brightness interval, the first brightness interval is mapped to a third brightness interval, and the second brightness interval is mapped to a fourth brightness interval. Both the third and fourth brightness intervals belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval. The first result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the first brightness interval and the number of brightness values in the first image data that fall within the first brightness interval. The second result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the second brightness interval and the number of brightness values in the first image data that fall within the second brightness interval.
[0056] In one possible implementation of the second aspect, the compression parameters include the coordinate information of k segment nodes of a piecewise linear PWL curve, where the k segment nodes are associated with multiple brightness ranges, k being a positive integer, and the k segment nodes include a first segment node. The coordinate information of the first segment node includes first coordinate axis information and second coordinate axis information. The first coordinate axis information indicates a first brightness value of the first segment node in a data range with a first bit depth, and the second coordinate axis information indicates that the first brightness value is mapped to a second brightness value in a data range with a second bit depth.
[0057] In one possible implementation of the second aspect, the plurality of brightness intervals includes k+1 brightness intervals. The second coordinate axis information of each segment node in the k segment nodes is associated with the first probability and / or the second probability corresponding to each brightness interval in the k+1 brightness intervals. The first probability corresponding to the m-th brightness interval is the ratio of the number of brightness values falling into the m-th brightness interval in the first image data to the total number of brightness values in the first image data. The second probability corresponding to the m-th brightness interval is the ratio of the total number of pixels falling into the m-th brightness interval in the first image data to the total number of pixels in the first image data. m is a positive integer not greater than k+1.
[0058] By implementing this method, the second coordinate axis information of each segment node in the compression parameters is related to the range of the brightness interval mapped from the first depth to the second depth. The determination of this second coordinate axis information is related to the first probability and / or the second probability corresponding to the brightness interval in the first depth. This means that the obtained compression parameters conform to the brightness distribution of the image data, so that when the compression parameters are used to compress the image data, as much of the original detail information of the image data can be preserved as much as possible, thus improving the quality of the compressed image data.
[0059] In one possible implementation of the second aspect, decompressing the second image data according to compression parameters to obtain the third image data includes: obtaining a PWL curve according to the compression parameters; obtaining the third image data according to the brightness value of each pixel in the second image data and the PWL curve, wherein the third image data includes the brightness value of each pixel in the second image data mapped to the target brightness value in the first depth data range.
[0060] By implementing this method, the PWL curve is obtained through compression parameters. Based on the PWL curve, the low bit depth second image data can be decompressed into high bit depth third image data. Since the second image data obtained after compression retains as much of the original details of the image data as possible, when using the compression parameters to decompress the second image data, the original details of the image data can also be restored as much as possible, thus improving the output quality of the decompressed image data.
[0061] Thirdly, this application provides an apparatus for data processing, the apparatus comprising: an acquisition unit for acquiring first image data, wherein the bit depth of the first image data is a first bit depth; a processing unit for determining compression parameters based on the first image data, wherein the compression parameters are related to the brightness distribution information of the first image data, wherein the brightness distribution information of the first image data is used to indicate the distribution of the brightness values of pixels in the first image data across multiple brightness intervals, wherein these multiple brightness intervals belong to the data range of the first bit depth; and the processing unit further comprising compressing the first image data according to the compression parameters to obtain second image data, wherein the bit depth of the second image data is a second bit depth, and the first bit depth is greater than the second bit depth.
[0062] Optionally, the first image data is the first raw data output by the image sensor after converting the captured light signal into a digital signal, or the first image data is the second raw data obtained by signal processing of the first raw data.
[0063] In one possible implementation of the third aspect, the apparatus further includes a transmitting unit configured to: transmit data compression information, the data compression information including second image data and the aforementioned compression parameters, the compression parameters being used to decompress the second image data.
[0064] Optionally, the transmission of the aforementioned compression parameters occurs before the transmission of the second image data.
[0065] In one possible implementation of the third aspect, the brightness distribution information of the first image data also includes the number of pixels for each brightness value in the first image data.
[0066] In one possible implementation of the third aspect, the brightness distribution information of the first image data includes the number of brightness values in the first image data that fall into each brightness interval.
[0067] In one possible implementation of the third aspect, the brightness distribution information of the first image data further includes at least one of the following:
[0068] The probability of a pixel appearing for each brightness value in the first image data;
[0069] The first probability corresponding to each brightness range; and,
[0070] The second probability corresponding to each brightness range;
[0071] Wherein, the probability of a pixel with a first brightness value appearing in the first image data is the ratio of the total number of pixels with the first brightness value in the first image data to the total number of pixels in the first image data; the first probability corresponding to the first brightness interval among the above plurality of brightness intervals is the ratio of the number of brightness values falling into the first brightness interval in the first image data to the total number of brightness values in the first image data; the second probability corresponding to the first brightness interval is the ratio of the total number of brightness values falling into the first brightness interval in the first image data to the total number of pixels in the first image data.
[0072] In one possible implementation of the third aspect, the aforementioned plurality of brightness intervals include a first brightness interval and a second brightness interval. In the first image data, when the number of brightness values falling into the first brightness interval is greater than the number of brightness values falling into the second brightness interval, the first brightness interval is mapped to the third brightness interval, and the second brightness interval is mapped to the fourth brightness interval. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
[0073] In one possible implementation of the third aspect, the aforementioned multiple brightness intervals include a first brightness interval and a second brightness interval. In the first image data, when the total number of pixels whose brightness values fall into the first brightness interval is greater than the total number of pixels whose brightness values fall into the second brightness interval, the first brightness interval is mapped to the third brightness interval, and the second brightness interval is mapped to the fourth brightness interval. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
[0074] In one possible implementation of the third aspect, the aforementioned multiple brightness intervals include a first brightness interval and a second brightness interval. When the first result corresponding to the first brightness interval is greater than the second result corresponding to the second brightness interval, the first brightness interval is mapped to a third brightness interval, and the second brightness interval is mapped to a fourth brightness interval. Both the third and fourth brightness intervals belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval. The first result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the first brightness interval and the number of brightness values in the first image data that fall within the first brightness interval. The second result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the second brightness interval and the number of brightness values in the first image data that fall within the second brightness interval.
[0075] In one possible implementation of the third aspect, the compression parameters include the coordinate information of k segment nodes of the piecewise linear PWL curve, the k segment nodes are associated with the multiple brightness ranges mentioned above, k is a positive integer, the k segment nodes include a first segment node, the coordinate information of the first segment node includes first coordinate axis information and second coordinate axis information, the first coordinate axis information indicates a first brightness value of the first segment node in a data range of the first bit depth, and the second coordinate axis information indicates that the first brightness value is mapped to a second brightness value in a data range of the second bit depth.
[0076] In one possible implementation of the third aspect, the aforementioned plurality of brightness intervals include k+1 brightness intervals, where k is a positive integer. The processing unit is specifically used for: determining k first brightness values based on the brightness distribution information of the first image data, wherein the k first brightness values divide the data range of the first bit depth into k+1 brightness intervals; determining a second brightness value in the data range of the second bit depth for each first brightness value based on a first probability corresponding to each brightness interval and / or a second probability corresponding to each brightness interval; wherein the first probability corresponding to the m-th brightness interval is the ratio of the number of brightness values in the first image data falling into the m-th brightness interval to the total number of brightness values in the first image data, and the second probability corresponding to the m-th brightness interval is the ratio of the total number of pixels in the first image data falling into the m-th brightness interval to the total number of pixels in the first image data, where m is a positive integer not greater than k+1.
[0077] In one possible implementation of the third aspect, the processing unit is specifically configured to: obtain a PWL curve based on compression parameters; and obtain second image data based on the luminance value of each pixel in the first image data and the PWL curve, wherein the second image data includes a target luminance value in a second bit-depth data range mapped from the luminance value of each pixel to the target luminance value.
[0078] Fourthly, this application provides an apparatus for data processing, comprising: an acquisition unit for receiving second image data, the second image data being related to compression parameters and first image data, the compression parameters being related to brightness distribution information of the first image data, the brightness distribution information of the first image data being used to indicate the distribution of brightness values of pixels in the first image data across multiple brightness intervals, these multiple brightness intervals belonging to a first bit depth data range, the first bit depth being the bit depth of the first image data, the bit depth of the second image data being the second bit depth, and the first bit depth being greater than the second bit depth; and a processing unit for decompressing the second image data according to the compression parameters to obtain third image data, the bit depth of the third image data being the first bit depth.
[0079] In one possible implementation of the fourth aspect, the acquisition unit is also used to: receive compression parameters.
[0080] In one possible implementation of the fourth aspect, the brightness distribution information of the first image data also includes the number of pixels for each brightness value in the first image data.
[0081] In one possible implementation of the fourth aspect, the brightness distribution information of the first image data includes the number of brightness values in the first image data that fall into each brightness interval.
[0082] In one possible implementation of the fourth aspect, the brightness distribution information of the first image data further includes at least one of the following:
[0083] The probability of a pixel appearing for each brightness value in the first image data;
[0084] The first probability corresponding to each brightness range; and,
[0085] The second probability corresponding to each brightness range;
[0086] Wherein, the probability of a pixel with a first brightness value appearing in the first image data is the ratio of the total number of pixels with the first brightness value in the first image data to the total number of pixels in the first image data; the first probability corresponding to the first brightness interval among multiple brightness intervals is the ratio of the number of brightness values falling into the first brightness interval in the first image data to the total number of brightness values in the first image data; the second probability corresponding to the first brightness interval is the ratio of the total number of brightness values falling into the first brightness interval in the first image data to the total number of pixels in the first image data.
[0087] In one possible implementation of the fourth aspect, the aforementioned plurality of brightness intervals include a first brightness interval and a second brightness interval. In the first image data, when the number of brightness values falling into the first brightness interval is greater than the number of brightness values falling into the second brightness interval, the first brightness interval is mapped to a third brightness interval, and the second brightness interval is mapped to a fourth brightness interval. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
[0088] In one possible implementation of the fourth aspect, the aforementioned multiple brightness intervals include a first brightness interval and a second brightness interval. In the first image data, when the total number of pixels whose brightness values fall into the first brightness interval is greater than the total number of pixels whose brightness values fall into the second brightness interval, the first brightness interval is mapped to the third brightness interval, and the second brightness interval is mapped to the fourth brightness interval. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
[0089] In one possible implementation of the fourth aspect, the aforementioned multiple brightness intervals include a first brightness interval and a second brightness interval. When the first result corresponding to the first brightness interval is greater than the second result corresponding to the second brightness interval, the first brightness interval is mapped to a third brightness interval, and the second brightness interval is mapped to a fourth brightness interval. Both the third and fourth brightness intervals belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval. The first result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the first brightness interval and the number of brightness values in the first image data that fall within the first brightness interval. The second result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the second brightness interval and the number of brightness values in the first image data that fall within the second brightness interval.
[0090] In one possible implementation of the fourth aspect, the compression parameters include the coordinate information of k segment nodes of a piecewise linear PWL curve, where the k segment nodes are associated with multiple brightness ranges, k being a positive integer, and the k segment nodes include a first segment node. The coordinate information of the first segment node includes first coordinate axis information and second coordinate axis information. The first coordinate axis information indicates a first brightness value of the first segment node in a data range with a first bit depth, and the second coordinate axis information indicates that the first brightness value is mapped to a second brightness value in a data range with a second bit depth.
[0091] In one possible implementation of the fourth aspect, the multiple brightness intervals include k+1 brightness intervals. The second coordinate axis information of each segment node in the k segment nodes is associated with the first probability and / or the second probability corresponding to each brightness interval in the k+1 brightness intervals. The first probability corresponding to the m-th brightness interval is the ratio of the number of brightness values falling into the m-th brightness interval in the first image data to the total number of brightness values in the first image data. The second probability corresponding to the m-th brightness interval is the ratio of the total number of pixels falling into the m-th brightness interval in the first image data to the total number of pixels in the first image data. m is a positive integer not greater than k+1.
[0092] In one possible implementation of the fourth aspect, the processing unit is specifically configured to: obtain a PWL curve based on compression parameters; and obtain third image data based on the brightness value of each pixel in the second image data and the PWL curve, wherein the third image data includes the brightness value of each pixel mapped to a target brightness value in the first depth data range.
[0093] Fifthly, this application provides a chip including a processor and a memory, wherein the memory is used to store program instructions; the processor invokes the program instructions in the memory to cause the chip to execute the method in the first aspect or any possible implementation of the first aspect, or to execute the method in the second aspect or any possible implementation of the second aspect.
[0094] Sixthly, this application provides an image acquisition device, which includes the means of the third aspect or any possible implementation of the third aspect, or includes the means of the fifth aspect for implementing the first aspect or any possible implementation of the first aspect.
[0095] For example, the image acquisition device is a camera, a webcam, etc.
[0096] In a seventh aspect, this application provides a data processing system, which includes a first device and a second device, wherein the first device is used to implement the method in the first aspect or any possible implementation of the first aspect, and the second device is used to implement the method in the second aspect or any possible implementation of the second aspect.
[0097] For example, the first device is the device in the third aspect or any possible implementation of the third aspect, and the second device is the device in the fourth aspect or any possible implementation of the fourth aspect.
[0098] Eighthly, this application provides a vehicle that includes at least one of the devices in any possible implementation of the third aspect and any possible implementation of the fourth aspect, or includes the chip described in the fifth aspect, or the image acquisition device described in the sixth aspect, or the data processing system described in the seventh aspect.
[0099] Ninthly, this application provides a computer-readable storage medium including computer instructions that, when executed by a processor, implement the method in the first aspect or any possible implementation of the first aspect, or implement the method in the second aspect or any possible implementation of the second aspect.
[0100] In a tenth aspect, this application provides a computer program product that, when executed by a processor, implements the method described in the first aspect or any possible implementation thereof, or implements the method described in the second aspect or any possible implementation thereof.
[0101] For example, the computer program product may be a software installation package. Attached Figure Description
[0102] Figure 1 is a schematic diagram of a PWL curve provided in an embodiment of this application;
[0103] Figure 2A is a schematic diagram of the architecture of a data processing system provided in an embodiment of this application;
[0104] Figure 2B is a schematic diagram of the frame of an image acquisition device provided in an embodiment of this application;
[0105] Figure 3 is a flowchart of a data processing method provided in an embodiment of this application;
[0106] Figure 4 is a schematic diagram of the brightness distribution information of image data provided in an embodiment of this application;
[0107] Figure 5A is a partial schematic diagram of the brightness distribution information of image data provided in an embodiment of this application;
[0108] Figure 5B is a schematic diagram of brightness distribution information of image data provided in another embodiment of this application;
[0109] Figure 6 is a schematic diagram of a PWL curve obtained based on compression parameters according to an embodiment of this application;
[0110] Figure 7 is a flowchart of another data processing method provided in an embodiment of this application;
[0111] Figure 8 is a schematic diagram of a data processing flow provided in an embodiment of this application;
[0112] Figure 9 is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0113] Figure 10 is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation
[0114] The prefixes such as "first" and "second" used in this application are solely for distinguishing different descriptive objects and do not impose any limitations on the position, order, priority, quantity, or content of the described objects. For example, if the described object is a "field," the ordinal numbers preceding "field" in "first field" and "second field" do not restrict the position or order of the "fields," nor do "first" and "second" restrict whether the "fields" they modify are in the same message, nor do they restrict the order of "first field" and "second field." Similarly, if the described object is a "level," the ordinal numbers preceding "level" in "first level" and "second level" do not restrict the priority between "levels." Furthermore, the number of described objects is not limited by the prefixes and can be one or more; for example, in "first device," the number of "devices" can be one or more. Furthermore, the objects modified by different prefixes can be the same or different. For example, if the object being described is "device," then "first device" and "second device" can be the same device, devices of the same type, or devices of different types. Similarly, if the object being described is "information," then "first information" and "second information" can be information with the same content or information with different content. In summary, the use of prefixes to distinguish the objects being described in the embodiments of this application does not constitute a limitation on the objects being described. The description of the objects being described is based on the claims or the context of the embodiments, and should not constitute an unnecessary limitation due to the use of such prefixes.
[0115] It should be noted that the descriptions used in the embodiments of this application, such as "at least one (or at least one) of a1, a2, ... and an", include the case where any one of a1, a2, ... and an exists alone, as well as the case where any combination of a1, a2, ... and an exists alone. Each case can exist independently. For example, the description "at least one of a, b and c" includes the cases of a alone, b alone, c alone, a combination of a and b, a combination of a and c, a combination of b and c, or a combination of a, b, and c.
[0116] To facilitate understanding, the relevant terms that may be involved in the embodiments of this application will be introduced below.
[0117] (1) Bit depth of image data
[0118] The bit depth of image data refers to the number of binary bits required to store each pixel in the image data. In this scheme, the brightness value of each pixel is recorded in bits. The bit depth of image data can also be called the image data bit depth.
[0119] The greater the bit depth of image data, the richer the detail in the image data. It can be understood that, all other things being equal (such as the resolution of the image data), the greater the bit depth of the image data, the larger the data volume of the image data, and the more bandwidth is required to transmit the image data.
[0120] (2) Piecewise linear compression
[0121] Piecewise linear (PWL) compression is a compression technique for image data that reduces data size by mapping pixel values of an image to a series of linear segments. For example, PWL compression can compress a high-bit-depth image into a low-bit-depth image, thus reducing the size of the image data while preserving image quality as much as possible, and also reducing the bandwidth required to transmit image data from the image sensor to the ISP. In PWL compression, the pixel values of the image data are processed through a series of linear mappings, thereby reducing data redundancy.
[0122] The terms mentioned above may be used in the embodiments described below.
[0123] Referring to Figure 1, Figure 1 is a schematic diagram of a PWL curve provided in an embodiment of this application. The bit depth of the image data before compression is denoted as the first bit depth, and the bit depth of the image data after compression is denoted as the second bit depth. In Figure 1, the horizontal axis represents the data range of the first bit depth, and the vertical axis represents the data range of the second bit depth. Assuming the first bit depth is 14 bits, the upper limit of the data range of the first bit depth is (2... 14 -1); If the second bit depth is 10 bits, then the upper limit of the data range of the second bit depth is (2 10 -1).
[0124] As shown in Figure 1, without compression, the brightness value distribution in the image data follows a linear distribution characteristic of the OE (Optical Image Envelope) segment. Assuming the first bit depth is 14 bits and the second bit depth is 10 bits, the solid line in Figure 1 represents the PWL (Positive Width) curve used for image data compression. The PWL curve consists of multiple linear segments: OA, AB, BC, and CD. Compared to before compression, linear segments AB, BC, and CD replace the AE segment in the OE segment. The PWL curve can compress the image data from the first bit depth to the second bit depth, where the first bit depth is greater than the second bit depth.
[0125] In PWL compression, compression parameters refer to the coordinate information of each segment node on the PWL curve. For example, segment nodes can be points A, B, C, etc., as shown in Figure 1. The compression parameters currently used are fixed parameters set by factory default, meaning the coordinate information of the segment nodes is known and fixed. In bright light environments, the amount of bright parts in the image data is greater than the amount of dark parts. If the compression parameters corresponding to Figure 1 are used to compress this image data, most of the brightness values of the pixels in the image data will be compressed into a smaller range, resulting in a loss of detail in the bright parts of the image data.
[0126] To address the aforementioned issues, this application provides a data processing system. This system determines compression parameters for the image data based on its brightness distribution and uses these parameters to compress the image data from a high bit depth to a low bit depth. While achieving compression, it preserves as much detail as possible in both dark and bright areas of the image data, minimizing information loss and improving the image quality output by the ISP. Furthermore, the system supports transmitting the compression parameters to the ISP, enabling the ISP to decompress the received compressed image data, further enhancing the ISP's image quality.
[0127] The composition of the data processing system is described below. Referring to Figure 2A, which is a schematic diagram of the architecture of a data processing system provided in an embodiment of this application, the data processing system includes an image acquisition device and an image signal processor (ISP). The image acquisition device and the ISP communicate via wired or wireless means.
[0128] Here, the image acquisition device can be a camera, webcam, or other device that can take photos or record videos.
[0129] For example, the image acquisition device includes an optical module, an image sensor, and a data compression device.
[0130] An optical module consists of a lens and optical elements, and is used to focus light from the external environment onto an image sensor.
[0131] For example, an image sensor may be a complementary metal oxide semiconductor (CMOS) sensor, a charge coupled device (CCD) sensor, etc.
[0132] An image sensor consists of multiple photosensitive pixels. Each photosensitive pixel can receive and capture light from a specific area. The photosensitive element in each pixel converts the received light into an analog signal (such as a current signal or a voltage signal). The image sensor also integrates a photoelectric conversion circuit and an analog-to-digital (AD) conversion circuit. The photoelectric conversion circuit amplifies, adjusts, and corrects the analog signal generated by the photosensitive pixels (e.g., linearizes light intensity), and reads the signal. The AD conversion circuit receives the processed analog signal from the photoelectric conversion circuit and converts it into a digital signal. The output of the AD conversion circuit is the raw image data in digital form. In some designs, the photoelectric conversion circuit and the AD conversion circuit may not be integrated into the image sensor but are placed independently of it.
[0133] The compression processing device can be a chip, integrated circuit, or other device with computing capabilities. For example, the compression processing device can perform brightness statistics on image data, and has the functions of calculating compression parameters and compressing image data.
[0134] For example, the compression processing device can acquire image data output by an image sensor, determine compression parameters based on the brightness distribution information of the image data, compress the image data according to the compression parameters, and transmit the compressed image data and the compression parameters to the ISP, so that the ISP can decompress the compressed image data according to the compression parameters. The digital image / video data output by the ISP can be used for applications running in an edge computing environment, such as object detection as data for training models, and real-time data that constitutes end-user consumption information inferred from the model.
[0135] In some solutions, the compression processing device can also be divided into a brightness statistics module, a parameter calculation module, and a compression execution module. The brightness statistics module is used to obtain the brightness distribution information of the image data, the parameter calculation module is used to determine the compression parameters based on the brightness distribution information of the image data, and the compression execution module is used to compress the image data according to the compression parameters.
[0136] In Figure 2A, the image acquisition device and the ISP are set up separately. In some solutions, the ISP can also be integrated into the image acquisition device.
[0137] In some embodiments, the image acquisition device may also include a signal processing unit. Referring to Figure 2B, which is a schematic diagram of the framework of an image acquisition device according to an embodiment of this application, the signal processing unit performs at least one of the following processing operations on the raw image data in digital form output by the image sensor: noise reduction, brightness gain, white balance gain, and bad pixel correction, and outputs the processed result to a compression processing unit. It is understood that the processing operations performed by the signal processing unit in image acquisition devices from different manufacturers may differ.
[0138] In one implementation, the data processing system shown in Figure 2A or the image acquisition device shown in Figure 2B is deployed on a terminal. The terminal can be a vehicle, robot, drone, ship, or other intelligent terminal equipped with a visual image processing system or image acquisition device. For example, a vehicle can be a means of transportation (such as commercial vehicles, passenger cars, motorcycles, flying cars, trains, etc.), an industrial vehicle (such as forklifts, trailers, tractors, etc.), an engineering vehicle (such as excavators, bulldozers, cranes, etc.), or agricultural equipment (such as lawnmowers, harvesters, etc.). Similarly, a robot can be an automated guided vehicle (AGV), a walking conversational robot, a service robot, a dancing robot, or other similar robots.
[0139] Here, the vehicle can be an autonomous vehicle equipped with an autonomous driving system, which, depending on its autonomous driving capabilities, can independently perform all or part of the driving operations. In some possible embodiments, the vehicle can also be a non-autonomous vehicle, meaning that all driving operations must be performed by a natural driver. Here, the vehicle can be a new energy vehicle, such as an electric vehicle (EV), a hybrid electric vehicle (HEV), a range-extended electric vehicle (REEV), a plug-in hybrid electric vehicle (PHEV), a fuel cell vehicle, or other new energy vehicles.
[0140] The data processing system shown in Figure 2A can be applied to a variety of application scenarios, such as the following: mobile internet (MI), industrial control, self-driving, transportation safety, internet of things (IoT), smart city, or smart home.
[0141] The data processing system shown in Figure 2A can be applied to various network types, such as one or more of the following: SparkLink, Long Term Evolution (LTE) networks, 5th generation mobile communication technology (5G), wireless local area networks (e.g., Wi-Fi), Bluetooth (BT), Zigbee, or vehicular short-range wireless communication networks, etc.
[0142] Here, Figure 2A is merely an exemplary architecture diagram, but it does not limit the number of network elements included in the system shown in Figure 2A. Although not shown in Figure 2A, Figure 2A may include other functional entities besides those shown in Figure 2A. Furthermore, the method provided in this application embodiment can be applied to the data processing system shown in Figure 2A. Of course, the method provided in this application embodiment can also be applied to other data processing systems, such as the data processing system composed of the image acquisition device and the ISP shown in Figure 2B.
[0143] Referring to Figure 3, which is a flowchart of a data processing method provided in an embodiment of this application, this method can be applied to a compression processing device. For example, the compression processing device may be the compression processing device in the image acquisition device shown in Figure 2A or Figure 2B. The method includes, but is not limited to, the following steps S301-S303.
[0144] S301: Acquire the first image data, where the bit depth of the first image data is the first bit depth.
[0145] The first image data includes the brightness value of each pixel in a plurality of pixels. The brightness value of each pixel in the first image data belongs to the data range of the first depth, and the brightness value of the pixel in the first image data is a positive number, which may be an integer or a decimal.
[0146] Here, the pixel brightness value indicates the brightness or luminance of the pixel, and is a measure describing the brightness of the pixel. For example, when the first image data is a grayscale image or single-channel image data, the pixel brightness value is equivalent to the pixel value.
[0147] For example, in the fields of vehicle and monitoring, the first bit depth is typically 16 bits to 24 bits. Taking a first bit depth of 24 bits as an example, the data range of the first bit depth is [0, 2]. 24 -1], the brightness value i of the pixel in the first image data satisfies i∈[0,2], 24 -1]. Here, please refer to the relevant description of the bit depth of the image data mentioned above for the bit depth of the first image data, and it will not be repeated here.
[0148] Here, the first image data comes from the image sensor of the image acquisition device. This first image data is the raw image data without ISP processing. The data format of the first image data is RAW data format. RAW data format is generally expressed using a Bayer arrangement, but it can also be expressed using a 4-cell structure, also known as Quad-Bayer. For example, the main Bayer arrangements include RGGB, BGGR, GRBG, GBRG, etc.
[0149] In one implementation, acquiring the first image data includes receiving the first image data output by an image sensor. In this case, the first image data is the first raw data output by the image sensor after converting the captured light signal into a digital signal. This acquisition method can be applied to the compression processing device in the image acquisition device shown in Figure 2A above.
[0150] In another implementation, acquiring the first image data includes receiving the first image data output by the signal processing device in the image acquisition device. In this case, the first image data is the second raw data obtained after signal processing of the first raw data; the first raw data is the image data output by the image sensor after converting the captured light signal into a digital signal. This acquisition method can be applied to the compression processing device in the image acquisition device shown in Figure 2B above, and compared to using the image data output by the image sensor as the first image data, it can improve the quality of the first image data.
[0151] S302: Determine compression parameters based on the first image data, which are associated with the brightness distribution information of the first image data.
[0152] The brightness distribution information of the first image data is used to indicate the distribution of the brightness values of pixels in the first image data across multiple brightness ranges, which belong to the data range of the first depth.
[0153] For example, the brightness distribution information of the first image data can be represented in the form of a histogram, table or other form.
[0154] Referring to Figure 4, Figure 4 is a schematic diagram of the brightness distribution information of image data provided in an embodiment of this application. In Figure 4, the first bit depth of the first image data is x bits, and the brightness value of the pixel in the first image data belongs to the data range of the first bit depth [0, 2]. xbits -1]. Figure 4 shows the distribution of pixel brightness values in the first image data across k+1 brightness intervals, where k is a positive integer. These k+1 brightness intervals include the first brightness interval [0, x1], the second brightness interval (x1, x2], the third brightness interval (x2, x3], ..., the kth brightness interval (x...1). k-1x k ], the (k+1)th brightness interval (x k ,2 xbits -1]. As shown in Figure 4, the total number of pixels in the first image data that fall into the first brightness interval [0, x1] is S1, the total number of pixels in the first image data that fall into the second brightness interval (x1, x2] is S2, the total number of pixels in the first image data that fall into the third brightness interval (x2, x3] is S3, and the total number of pixels in the first image data that fall into the (k+1)th brightness interval (x1, x2] is S3. k ,2 xbits The total number of pixels with a brightness value of -1 is S k+1 In other words, the first image data falls into the m-th brightness range (x... m-1 x m The total number of pixels with brightness values is S. m , where m is a positive integer less than or equal to (k+1).
[0155] It can be understood that the sum of the total number of pixels corresponding to the brightness values of each of the k+1 brightness intervals is equal to the total number of pixels in the first image data. In other words, the mathematical relationship between the total number of pixels corresponding to the brightness values of each brightness interval and the total number of pixels in the first image data satisfies the following formula (1).
[0156] Where h×w represents the total number of pixels in the first image data, and also represents the resolution of the first image data. h represents the height of the first image data, and w represents the width of the first image data. That is, the total number of pixels in the first image data is the product of the width w and the height h of the first image data, and both h and w are positive integers. S m This represents the total number of pixels (i.e., the sum of the number of pixels) in the first image data that fall into the m-th brightness interval, where m is a positive integer ≤ k+1.
[0157] Here, Figure 4 is only an example of representing the brightness distribution information of the first image data in the form of a histogram. It is only for the purpose of clearly presenting the brightness gradation information of the first image data and should not limit the number of brightness intervals of the brightness value distribution of pixels in the first image data or the total number of pixels corresponding to the brightness value of each brightness interval.
[0158] In one implementation, the brightness distribution information of the first image data includes the number of pixels for each brightness value in the first image data, specifically including the number of pixels for each brightness value in the first image data that fall within each of the aforementioned brightness intervals.
[0159] Taking the first brightness interval in Figure 4 as an example, the distribution of pixel brightness values in the first image data within the first brightness interval is shown in Figure 5A. Figure 5A is a partial schematic diagram of the brightness distribution information of image data provided in an embodiment of this application. As can be seen from Figure 5A, the number of pixels in the first image data that fall within each brightness value of the first brightness interval is, for example, the number of pixels with brightness value i in the first image data is n. i That is, the first image data contains n i The brightness value of each pixel is i. Referring to Figures 4 and 5A, for the first brightness interval, the total number of pixels S1 corresponding to the brightness value of the first brightness interval is the sum of the number of pixels of each brightness value among the T1 brightness values that fall into the first brightness interval in the first image data.
[0160] Figure 5A is only an example of the distribution of brightness values in the first brightness interval and should not be construed as limiting the distribution of brightness values in the brightness interval.
[0161] In another implementation, the brightness distribution information of the first image data includes the number of brightness values in the first image data that fall into each brightness interval. For example, if the number of brightness values in the first image data that fall into the first brightness interval is t, it means that there are t different brightness values in the first image data that fall into the first brightness interval, where t is a positive integer.
[0162] For example, the brightness distribution information of the first image data can also be represented as shown in Figure 5B. Figure 5B is a schematic diagram of the brightness distribution information of image data provided in another embodiment of this application. In Figure 5B, there are k+1 brightness intervals within the first depth data range. Please refer to the description of the corresponding content in Figure 4 above for these k+1 brightness intervals. As can be seen from Figure 5B, the number of brightness values falling into the first brightness interval [0, x1] in the first image data is T1, the number of brightness values falling into the second brightness interval (x1, x2) in the first image data is T2, the number of brightness values falling into the third brightness interval (x2, x3) in the first image data is T3, and the number of brightness values falling into the k+1 brightness interval (x1, x2) in the first image data is T3. k ,2 xbits The number of brightness values of -1] is T k+1 In other words, the first image data falls into the m-th brightness range (x... m-1 x m The number of brightness values is T. m , where m is a positive integer less than or equal to (k+1).
[0163] In some schemes, the brightness distribution information of the first image data may also include at least one of the following:
[0164] The probability of a pixel appearing for each brightness value in the first image data;
[0165] The first probability corresponding to each brightness range; and
[0166] The second probability corresponding to each brightness range.
[0167] Thus, when the brightness distribution information of the first image data is represented by a histogram similar to that shown in Figure 4, it means that there may be multiple histograms, one of which has its vertical axis used to represent a probability, which can be the aforementioned pixel occurrence probability, the first probability, or the second probability.
[0168] The m-th brightness interval is any one of the above brightness intervals. The explanations of the first probability and the second probability are as follows:
[0169] (1) The first probability corresponding to the m-th brightness interval is the ratio of the number of brightness values in the first image data that fall into the m-th brightness interval to the total number of brightness values in the first image data;
[0170] (2) The second probability corresponding to the m-th brightness interval is the ratio of the total number of pixels in the first image data that fall into the m-th brightness interval to the total number of pixels in the first image data, or the second probability corresponding to the m-th brightness interval is also the sum of the probabilities of each brightness value in the first image data falling into the m-th brightness interval.
[0171] For example, the probability of a pixel appearing for each brightness value in the first image data is calculated according to the following formula (2).
[0172] Where P(i) represents the probability of a pixel with brightness value i appearing in the first image data, and n i h×w represents the number of pixels with a brightness value of i in the first image data. The result of h×w represents the total number of pixels in the first image data. Please refer to the description of the corresponding parameters in the aforementioned formula (1) for h and w. They will not be repeated here.
[0173] In some schemes, when the brightness distribution information of the first image data is represented in tabular form, the brightness distribution information of the first image data can be represented as shown in Table 1 below. The mapping table shown in Table 1 records the correspondence between the brightness interval number, the brightness interval, and the total number of pixels with brightness values. Taking the correspondence "1-[0, x1]-S1" as an example, the correspondence "1-[0, x1]-S1" means that the total number of pixels with brightness values corresponding to the first brightness interval [0, x1] is S1. Other correspondences in Table 1 will not be described here.
[0174] Table 1 Brightness distribution information of the first image data
[0175] Table 1 is merely an example of representing the brightness distribution information of the first image data in tabular form, and should not be construed as limiting the representation or content of the brightness distribution information of the first image data. In practical applications, the textual content and storage method of the corresponding relationships recorded in Table 1 can also be in other forms. For example, Table 1 may also record at least one of the following information: the number of brightness values falling into each brightness interval in the first image data, the number of pixels for that brightness value, the probability of each brightness value appearing as a pixel, the first probability corresponding to each brightness interval, and the second probability corresponding to each brightness interval.
[0176] Here, there is no overlap between any two of the aforementioned brightness ranges.
[0177] As an example, the aforementioned multiple brightness intervals can be fixed intervals preset by the user or set by factory default. That is, the data range of the first depth is pre-divided into a fixed number of brightness intervals. For example, the data range of the first depth can be evenly divided into multiple brightness intervals, each with an equal interval length. Here, the number of brightness intervals can be preset or calculated by an algorithm (such as a clustering algorithm).
[0178] In some schemes, the aforementioned multiple brightness intervals can also be dynamically divided by the compression processing device based on the distribution of brightness values in the first image data. In this case, the interval lengths of different brightness intervals may be equal or unequal. For example, the dynamic division method used can be a clustering algorithm (e.g., the number of brightness intervals can be determined by combining the elbow rule), an adaptive thresholding method, a quantile method, etc.
[0179] In this scheme, the compression parameters are used to map the brightness values in the first image data from a data range with a first bit depth to a data range with a second bit depth. The first bit depth is the bit depth of the first image data before compression, and the second bit depth is the bit depth of the first image data after compression. Here, the second bit depth is adapted to the input specifications of the subsequent ISP.
[0180] As an example, the compression parameters include the coordinate information of k segment nodes of the PWL curve, which are associated with the aforementioned multiple brightness ranges, where k is a positive integer. The first segment node is any of these k segment nodes. The coordinate information of the first segment node includes first coordinate axis information and second coordinate axis information. The first coordinate axis information indicates a first brightness value of the first segment node in the first bit depth data range, and the second coordinate axis information indicates that the first brightness value is mapped to a second brightness value in the second bit depth data range.
[0181] In a set of k segmented nodes, two adjacent segmented nodes form a linear segment. Thus, the PWL curve consists of multiple linear segments.
[0182] In one implementation, compression parameters are determined based on first image data, including: obtaining k first brightness values according to the brightness distribution information of the first image data, and the k first brightness values divide the data range of the first bit depth into the above-mentioned multiple brightness intervals; determining the second brightness values in the data range of the second bit depth to which each first brightness value is mapped according to the first probability corresponding to each brightness interval and / or the second probability corresponding to each brightness interval. Here, for the first probability corresponding to each brightness interval and the second probability corresponding to each brightness interval, please refer to the relevant descriptions of the first probability corresponding to the m-th brightness interval and the second probability corresponding to the m-th brightness interval described above, and will not be elaborated here.
[0183] Exemplarily, the k first brightness values divide the data range of the first bit depth into k + 1 brightness intervals. Referring to Figure 4, {x1, x2, x3, …, x k} in Figure 4 are the above-mentioned k first brightness values, and the k first brightness values belong to the data range [0, 2 xbits -1] of the first bit depth. The k + 1 brightness intervals corresponding to the k first brightness values are the above-mentioned first brightness interval [0, x1], second brightness interval (x1, x2], third brightness interval (x2, x3], …, k-th brightness interval (x k-1 , x k , the (k + 1)-th brightness interval (x k , 2 xbits -1]. In this way, the process of determining the compression parameters is the process of solving the second brightness values corresponding to each of the k first brightness values.
[0184] The following describes the determination process of the second brightness value by classification. Please refer to the following Method 1 - Method 3.
[0185] Method 1: Determine the above-mentioned second brightness value according to the first probability corresponding to each brightness interval
[0186] In one implementation, the k first brightness values correspond to k second brightness values. Among them, the j-th first brightness value corresponds to the j-th second brightness value, where j is a positive integer less than or equal to k. The calculation method of the j-th second brightness value can be:
[0187] When j = 1, obtain the first second brightness value corresponding to the first first brightness value according to the first probability corresponding to the first brightness interval in the above-mentioned k + 1 brightness intervals and the second bit depth;
[0188] When 1 < j ≤ k, obtain the j-th second brightness value according to the (j - 1)-th second brightness value, the first probability corresponding to the j-th brightness interval, and the second bit depth.
[0189] In this way, the k second brightness values corresponding to the above-mentioned k first brightness values can be obtained.
[0190] For example, the relationship between the j-th second brightness value and the first probability and second bit depth corresponding to the above brightness interval satisfies the mathematical relationship shown in the following formula (3).
[0191] Where ybits represents the second bit depth, y j Let y1 represent the j-th second brightness value among the k second brightness values mentioned above, and Q1(j) represent the first probability corresponding to the j-th brightness interval. Referring to Figure 4, when j = 1, y1 is the second brightness value corresponding to the first brightness value x1 (i.e., the first second brightness value), and the calculation of y1 is related to the first probability corresponding to the first brightness interval [0, x1]. When j = 2, y2 is the second brightness value corresponding to the first brightness value x2 (i.e., the second second brightness value), and the calculation of y2 is related to y1 and the first probability corresponding to the second brightness interval (x1, x2]. When j = 3, y3 is the second brightness value corresponding to the first brightness value x3 (i.e., the third second brightness value), and the calculation of y3 is related to y2 and the first probability corresponding to the third brightness interval (x2, x3), and so on, to obtain the first brightness value x1. k The corresponding second brightness value y k Here, formula (3) is only used as an example. In some schemes, formula (3) can also be modified under the same meaning.
[0192] For example, the formula for calculating the first probability Q1(m) corresponding to each brightness interval is expressed as shown in the following formula (4).
[0193] Where i represents the brightness value, and m is an integer belonging to the range [1, k+1]. m This represents the number of brightness values in the first image data that fall into the m-th brightness interval, i.e., the number of brightness values in the first image data that are T. m There are 3 distinct brightness values falling into the m-th brightness interval. T represents the total number of brightness values in the first image data, that is, there are T distinct brightness values in the first image data. It can be understood that when n = 1, the first brightness interval is [0, x1]; when m ∈ [1, k], the m-th brightness interval is (x... m x m+1 When m = k + 1, the m-th brightness interval is (x k ,2 xbits -1]. Here, formula (4) is only an example. In some schemes, formula (4) can also be transformed with the same meaning.
[0194] Implementation Method 1 determines the second brightness value. For any two brightness intervals among the above plurality of brightness intervals, such as the first brightness interval and the second brightness interval, the first brightness interval and the second brightness interval satisfy the following condition:
[0195] In the first image data, when the number of brightness values falling into the first brightness interval is greater than the number of brightness values falling into the second brightness interval, the first brightness interval is mapped to the third brightness interval, and the second brightness interval is mapped to the fourth brightness interval; wherein, both the third brightness interval and the fourth brightness interval belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
[0196] Referring to Figure 6, which is a schematic diagram of a PWL curve obtained based on compression parameters according to an embodiment of this application. In Figure 6, assuming k = 2, the compression parameters include the coordinate information of two segment nodes (i.e., points E and F), where the coordinate information of segment node E is (x1, y1) and the coordinate information of segment node F is (x2, y2). y1 and y2 are the second brightness values to be solved. Therefore, the compression parameters can be expressed as {(x1, y1), (x2, y2)}, where y1 and y2 satisfy the mathematical relationship shown in the following formula (5).
[0197] For the descriptions of parameters T1, T2, T, ybits, i, etc. in formula (5), please refer to the descriptions of the corresponding parameters above, and they will not be repeated here.
[0198] In Figure 6, assuming the first brightness interval is (x1, x2] and the second brightness interval is [0, x1], then the first brightness interval (x1, x2] maps to the third brightness interval (y1, y2], and the second brightness interval [0, x1] maps to the fourth brightness interval (0, y1). If the number of brightness values falling into the first brightness interval (x1, x2] in the first image data is greater than the number of brightness values falling into the second brightness interval [0, x1], then the length of the third brightness interval (y1, y2] is greater than the length of the fourth brightness interval (0, y1), i.e., y2 - y1 > y1.
[0199] Here, Figure 6 is merely an example of a PWL curve and should not be construed as limiting the number of segment nodes or their coordinate information. In some schemes, the compression parameters shown in Figure 6 may include, in addition to segment nodes E and F, a start node O (0, 0) and an end node G (2, 0). xbits -1,2 ybits -1), here the starting node O and the ending node G do not need to be solved, and can be directly obtained based on the first and second depths mentioned above.
[0200] Through the above embodiments, the more the number of luminance values in the first image data that fall within the luminance range of the first bit depth, the longer the length of the luminance range mapped to the luminance range of the second bit depth. Based on the number of luminance values in the first image data that fall within the luminance range of the first bit depth, the above-mentioned second luminance value is determined. The compression parameter obtained in this way can ensure that when the first image data is compressed, the luminance value of each pixel in the first image data has a sufficient range within the data range of the second bit depth for mapping, and can retain as many differences between different luminance values in the first image data as possible, realizing the retention of as much detail information as possible in the first image data, reducing the information loss caused by compression, and being beneficial to improving the image quality of the subsequent ISP.
[0201] Method 2: Determine the above-mentioned second luminance value according to the second probability corresponding to each luminance range
[0202] In one implementation, the above k first luminance values correspond to k second luminance values. Among them, the j-th first luminance value corresponds to the j-th second luminance value, where j is a positive integer less than or equal to k. The calculation method of the j-th second luminance value can be:
[0203] When j = 1, according to the second probability and the second bit depth corresponding to the first luminance range among the above k + 1 luminance ranges, obtain the first second luminance value corresponding to the first first luminance value;
[0204] When 1 < j ≤ k, according to the (j - 1)-th second luminance value, the second probability corresponding to the j-th luminance range and the second bit depth, obtain the j-th second luminance value.
[0205] In this way, the k second luminance values corresponding to the above k first luminance values can be obtained.
[0206] Exemplarily, the relationship between the j-th second luminance value and the second probability and the second bit depth corresponding to the above luminance range satisfies the mathematical relationship shown in the following formula (6).
[0207] Among them, ybits represents the second bit depth, y j represents the j-th second luminance value among the above k second luminance values, and Q2(j) represents the second probability corresponding to the j-th luminance range. Here, formula (6) is only an example. In some solutions, formula (6) can also be deformed under the same meaning representation.
[0208] Exemplarily, the calculation formula of the second probability Q2(m) corresponding to each luminance range is shown as the following formula (7).
[0209] Among them, i represents the luminance value, n iLet represent the number of pixels with brightness value i in the first image data, m be the index of the brightness interval in the first data range, and h×w represent the total number of pixels in the first image data. When m=1, the total number of pixels in the first image data that fall within the first brightness interval [0, x1] is . When m∈[1,k], the first image data falls into the m-th brightness interval (x m x m+1 The total number of pixels with brightness values is When m = k + 1, the first image data falls into the (k + 1)th brightness interval (x). k ,2 xbits The total number of pixels with a brightness value of -1 is
[0210] Here, formula (7) is only an example. In some schemes, formula (7) can also be transformed with the same meaning. For example, Q2(m) can also be transformed into the following formula (8).
[0211] Wherein, P(i) represents the probability of a pixel with brightness value i appearing in the first image data. The calculation of P(i) is described in the aforementioned formula (2), and will not be repeated here.
[0212] In some schemes, where the brightness values of pixels in the first image data have no decimals, the superscript and subscript of the summation sign in the above formulas (7) and (8) do not need to be rounded using the round() function.
[0213] For example, the scenario in which method 2 is applied can be: when the brightness values of pixels in the first image data are floating-point numbers, when counting which brightness interval a pixel's brightness value falls into, the floating-point brightness value is processed first before determining the brightness interval it falls into. Thus, taking the brightness interval (x1, x2) as an example, there may be a group of pixels in the first image data whose brightness values are near (e.g., greater than) the brightness value x2. After processing these floating-point brightness values, these brightness values are considered as brightness value x2. Therefore, when counting the number of brightness values in the first image data that fall into the brightness interval (x1, x2), the number of brightness values falling into this interval includes the number of pixels in that group. Therefore, determining the second brightness value based on the number of pixels whose brightness values fall into the brightness interval ensures that the multiple brightness values obtained after mapping from multiple different brightness values near x2 in the first image data remain as different as possible. This achieves the goal of preserving the differences between the original brightness values in the first image data as much as possible after compression based on compression parameters, reducing information loss caused by compression.
[0214] Implementation Method 2 determines the second brightness value. For any two brightness intervals among the above plurality of brightness intervals, such as the first brightness interval and the second brightness interval, the first brightness interval and the second brightness interval satisfy the following condition:
[0215] In the first image data, when the total number of pixels whose brightness values fall into the first brightness interval is greater than the total number of pixels whose brightness values fall into the second brightness interval, the first brightness interval is mapped to the third brightness interval, and the second brightness interval is mapped to the fourth brightness interval; wherein, both the third brightness interval and the fourth brightness interval belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
[0216] Referring to Figure 6, assuming k = 2, the compression parameters include the coordinate information of two segment nodes (i.e., points E and F). The coordinate information of segment node E is (x1, y1), and the coordinate information of segment node F is (x2, y2). Therefore, the compression parameters can be expressed as {(x1, y1), (x2, y2)}, where y1 and y2 satisfy the mathematical relationship shown in the following formula (9).
[0217] For the descriptions of parameters such as ybits, i, and P(i) in formula (9), please refer to the descriptions of the corresponding parameters mentioned above, and they will not be repeated here.
[0218] In Figure 6, assuming the first brightness interval is (x1, x2] and the second brightness interval is [0, x1], then the first brightness interval (x1, x2] is mapped to the third brightness interval (y1, y2], and the second brightness interval [0, x1] is mapped to the fourth brightness interval (0, y1). If the total number of pixels in the first image data whose brightness values fall within the first brightness interval (x1, x2] is greater than the total number of pixels whose brightness values fall within the second brightness interval [0, x1], then the length of the third brightness interval (y1, y2] is greater than the length of the fourth brightness interval (0, y1), i.e., y2 - y1 > y1.
[0219] Through the above implementation method, the more pixels in the first image data that fall within the brightness range of the first bit depth, the longer the range length of the brightness range mapped to the brightness range of the second bit depth will be. The compression parameters obtained in this way can ensure that the image data retains as much detail information as possible after compression, reduce the information loss caused by compression, and help improve the output quality of subsequent ISP.
[0220] Method 3: Determine the second brightness value based on the first probability and the second probability corresponding to each brightness range.
[0221] In this case, the above k first luminance values correspond to k second luminance values, where the j-th first luminance value corresponds to the j-th second luminance value, j is a positive integer less than or equal to k, and the calculation method of the j-th second luminance value can be:
[0222] When j = 1, obtain the first second luminance value corresponding to the first first luminance value according to the first probability corresponding to the first luminance interval, the second probability corresponding to the first luminance interval, and the second bit depth;
[0223] When 1 < j ≤ k, obtain the j-th second luminance value according to the (j - 1)-th second luminance value, the first probability corresponding to the j-th luminance interval, the second probability corresponding to the j-th luminance interval, and the second bit depth.
[0224] In this way, the k second luminance values corresponding to the above k first luminance values can be obtained.
[0225] Exemplarily, the relationship between the j-th second luminance value and the first probability, second probability, and second bit depth corresponding to the above luminance interval satisfies the mathematical relationship shown in the following formula (10).
[0226] Among them, both w1 and w2 are constants, w1 is the weight coefficient corresponding to Q1(j), w2 is the weight coefficient corresponding to Q2(j), and the sum of w1 and w2 is equal to 1. Here, Q1(j) represents the first probability corresponding to the j-th luminance interval, and Q2(j) represents the second probability corresponding to the j-th luminance interval. For the calculation of Q1(j), please refer to the description of the foregoing formula (4), for the calculation of Q2(j), please refer to the description of the foregoing formula (7) or formula (8), and for the descriptions of other parameters in formula (10), please refer to the descriptions of the corresponding parameters in the foregoing formula. For the sake of brevity of the specification, it will not be elaborated here. Here, formula (10) is only an example, and in some solutions, formula (10) can also be deformed under the same meaning representation.
[0227] Embodiment 3 determines the second luminance value. For any two luminance intervals among the above multiple luminance intervals, for example, the first luminance interval and the second luminance interval, the first luminance interval and the second luminance interval satisfy the following conditions:
[0228] When the first result corresponding to the first brightness interval is greater than the second result corresponding to the second brightness interval, the interval length of the third brightness interval obtained after mapping the first brightness interval is greater than the interval length of the fourth brightness interval obtained after mapping the second brightness interval. Here, both the third and fourth brightness intervals belong to the data range of the second bit depth. The first result is obtained based on the total number of pixels in the first image data whose brightness values fall into the first brightness interval, the number of brightness values in the first image data that fall into the first brightness interval, and the aforementioned weight coefficients w1 and w2. The second result is obtained based on the total number of pixels in the first image data whose brightness values fall into the second brightness interval, the number of brightness values in the first image data that fall into the second brightness interval, and the aforementioned weight coefficients w1 and w2.
[0229] Thus, by combining the number of brightness values falling within the brightness range in the first image data with the total number of pixels falling within that brightness range, the second brightness value can be determined more accurately. This allows for a more precise division of the mapping range corresponding to the brightness range in the first depth within the second bit depth data range. The resulting compression parameters better match the brightness distribution of the first image data. Subsequently, based on these compression parameters, it can be ensured that as much detail information as possible is retained after the image data is compressed, reducing information loss caused by compression and improving the image output quality of the subsequent ISP.
[0230] S303: Compress the first image data according to the compression parameters to obtain the second image data, wherein the bit depth of the second image data is the second bit depth, and the first bit depth is greater than the second bit depth.
[0231] In one implementation, compressing first image data according to compression parameters to obtain second image data includes: obtaining a PWL curve according to the compression parameters; and obtaining the second image data based on the luminance value of each pixel in the first image data and the PWL curve. The second image data includes a target luminance value mapped from the luminance value of each pixel in the first image data, and the target luminance value mapped from the luminance value of each pixel belongs to a data range with a second bit depth. It can be understood that the number of pixels in the first image data does not change before and after compression; that is, the total number of pixels in the first image data is equal to the total number of pixels in the second image data.
[0232] For example, the PWL curve includes multiple linear segments, and the first pixel is any pixel in the first image data. Then, based on the luminance value of the first pixel in the first image data and the PWL curve, a target luminance value mapped from the luminance value of the first pixel is obtained. This target luminance value belongs to the data range of the second bit depth. Specifically, it is determined that the luminance value of the first pixel in the first image data corresponds to the first linear segment among the multiple linear segments; based on the luminance value of the first pixel and the first linear segment, the target luminance value mapped from the luminance value of the first pixel is obtained.
[0233] As shown in Figure 6, the PWL curve determined based on the compression parameters includes three linear segments: OE, EF, and FG. Based on OE, the luminance interval [0, x1] at the first depth corresponds to the luminance interval [0, y1] at the second depth. Based on EF, the luminance interval (x1, x2) at the first depth corresponds to the luminance interval (y1, y2) at the second depth. Based on EF and FG, the luminance interval (x2, y2) at the first depth... xbits -1] and the brightness range (y2, 2) at the second depth. ybits -1] corresponds to, where xbits represents the first bit depth and ybits represents the second bit depth.
[0234] In Figure 6, taking the brightness value of the first pixel in the first image data as brightness value one as an example, assuming that brightness value one belongs to the brightness interval [0, x1] within the first bit depth data range, it means that brightness value one corresponds to the linear segment OE. Brightness value one is used as the independent variable input into the linear equation corresponding to the linear segment OE, and the brightness value output by this linear equation is brightness value two. Brightness value two belongs to the brightness interval [0, y1] within the second bit depth data range. Brightness value two is the target brightness value mapped from brightness value one. Therefore, it can be understood that the brightness value of the first pixel in the second image data is brightness value two. Thus, based on this implementation method, the target brightness value mapped from the brightness value of each pixel in the first image data can be known, i.e., the second image data is obtained, and the compression of the first image data is achieved.
[0235] In some implementations, after obtaining the second image data, the compression processing device can also send the second image data and compression parameters, for example, send the second image data and compression parameters to the ISP. This implementation is described in the following embodiment of Figure 7, and will not be repeated here.
[0236] In the embodiment shown in Figure 3, the compression parameters of the image data are determined based on the brightness distribution of the image data. This means that the compression parameters used to compress the image data can be dynamically adjusted according to the brightness distribution of the image data. Using these compression parameters to compress the image data from a high bit depth to a low bit depth not only reduces the amount of image data but also preserves as much detail in both dark and bright areas of the image data as possible while achieving compression. This minimizes information loss caused by compression and improves the output quality of the ISP.
[0237] Referring to Figure 7, which is a flowchart of another data processing method provided in an embodiment of this application, this method can be applied to a data processing system, which includes, for example, a compression processing device and an ISP. Exemplarily, the compression processing device may be the compression processing device in the image acquisition device shown in Figure 2A or Figure 2B, and the ISP is the ISP in Figure 2A. This method includes, but is not limited to, the following steps S701-S702.
[0238] S701: The compression processing device sends data compression information to the ISP, which includes second image data and compression parameters. Accordingly, the ISP receives the image compression information.
[0239] Here, the second image data and compression parameters can be obtained by the compression processing device by executing the method shown in the embodiment of Figure 3 above. For the specific acquisition process, please refer to the description of the embodiment of Figure 3 above, which will not be repeated here.
[0240] In one implementation, the compression parameters are carried in the meta information of the second image data. Here, the meta information of the second image data refers to additional information unrelated to the content of the second image data itself, such as at least one of the following: the attributes of the second image data, the generation conditions, and the vehicle information.
[0241] In one implementation, when the second image data and compression parameters are transmitted within a single message (i.e., data compression information), the compression parameters and the second image data can be concatenated, with the compression parameters located in the header space of the concatenated message. Alternatively, when the compression parameters are carried within the metadata of the second image data, this metadata and the second image data compression parameters can be concatenated, with the metadata located in the header space of the concatenated message. Thus, when the ISP receives the compression parameters and the second image data, it can first obtain the compression parameters and use them to decompress the second image data, which helps improve the data processing speed. In some schemes, the order of the compression parameters and the second image data within the data compression information is not restricted.
[0242] In another implementation, the second image data and compression parameters can be transmitted separately and independently via different messages. For example, the transmission of compression parameters occurs before the transmission of the second image data. That is, the compression processing device first sends the compression parameters to the ISP, and only after the compression parameters have been transmitted does the compression processing device send the second image data to the ISP. This also improves the ISP's efficiency in decompressing the second image data.
[0243] S702: The ISP uses compression parameters to decompress the second image data and obtain the third image data.
[0244] In this embodiment, the bit depth of the third image data is the same as that of the first image data. The bit depth of the second image data is the same as that of the first image data. As shown in the example in Figure 3, the first bit depth is greater than the second bit depth.
[0245] For example, the third image data may be the same as the first image data, or it may be different from the first image data.
[0246] In one implementation, the ISP decompresses the second image data using compression parameters to obtain the third image data, including: obtaining a PWL curve based on the compression parameters; and obtaining the third image data based on the luminance value of each pixel in the second image data and the PWL curve. The third image data includes the target luminance value mapped from the luminance value of each pixel in the second image data to the first deep data range. Here, the target luminance value mapped from the luminance value of a pixel in the second image data to the first deep data range can also be referred to as the decompressed target luminance value of that pixel.
[0247] For example, the PWL curve includes multiple linear segments, and the first pixel is any pixel in the second image data. Then, based on the luminance value of the first pixel in the second image data and the PWL curve, the target luminance value after decompression of the first pixel's luminance value is obtained. This target luminance value belongs to the first depth data range. Specifically, it is determined that the luminance value of the first pixel in the second image data corresponds to the first linear segment among the multiple linear segments; based on the luminance value of the first pixel and the first linear segment, the target luminance value after decompression of the first pixel's luminance value is obtained.
[0248] As shown in Figure 6, the PWL curve determined based on the compression parameters includes three linear segments: OE, EF, and FG. Taking the brightness value of the first pixel in the second image data as brightness value two as an example, assuming that brightness value two belongs to the brightness interval (y1, y2) within the second bit depth data range, it means that brightness value one corresponds to linear segment EF. Brightness value two is input as the dependent variable into the linear equation corresponding to linear segment EF, and the brightness value output by this linear equation is brightness value three. Brightness value three belongs to the brightness interval (x1, x2) within the first bit depth data range. Brightness value three is the target brightness value after decompression of brightness value two. Therefore, the brightness value of the first pixel in the third image data is brightness value three. Thus, based on this implementation method, the target brightness value after decompression of the brightness value of each pixel in the second image data can be known, i.e., the third image data is obtained, and the decompression of the second image data is achieved.
[0249] In the embodiment shown in Figure 7, the data processing system supports transmitting the compressed image data and the compression parameters used to the ISP. This not only reduces the amount of image data transmitted between the image acquisition device (where the compression processing device is located) and the ISP, but also reduces bandwidth consumption caused by data transmission between the image acquisition device and the ISP. Furthermore, the compression parameters are related to the brightness distribution information of the image data before compression, ensuring that the original details of the image data are preserved as much as possible during the process of compressing the image data from a high bit depth to a low bit depth, reducing information loss caused by compression. Thus, when the ISP decompresses the image data using the compression parameters, it can also recover as much of the original detail of the image data as possible, improving the image output quality of the ISP.
[0250] To more clearly illustrate the data processing flow within the image acquisition device and the ISP, a schematic diagram of the data processing flow is provided as an example. Referring to Figure 8, within the image acquisition device, the first image data is first acquired. Brightness statistical processing is then performed on the first image data to obtain its brightness distribution information. Next, compression parameters are calculated based on the brightness distribution information to obtain the compression parameters. These compression parameters are then used to compress the first image data to obtain the second image data. As an example, within the image acquisition device, the aforementioned metadata (which carries the compression parameters) can also be embedded in the second image data. Finally, the second image data with embedded metadata is output, for example, sent to the ISP. Within the ISP, the second image data is first received. The compression parameters are obtained from the metadata embedded in the second image data. The compression parameters are then used to decompress the second image data to obtain the third image data. In some solutions, within the ISP, at least one of the following processes can be sequentially performed on the third image data: noise reduction, de-mosaicing, and automatic white balance (AWB) to further improve the image quality of the third image data.
[0251] It is understood that Figure 8 is merely an example and should not be construed as limiting the data processing within the image acquisition device and the ISP. In some solutions, such as within the image acquisition device, the metadata may not be embedded in the second image data; instead, the aforementioned compression parameters and the second image data may be sent separately to the ISP.
[0252] Referring to Figure 9, which is a schematic diagram of a data processing device according to an embodiment of this application, the data processing device 30 includes an acquisition unit 310 and a processing unit 312. This data processing device 30 can be implemented in hardware, software, or a combination of both.
[0253] In one implementation, the data processing device 30 may be included within the aforementioned compression processing device. In this case, the acquisition unit 310 is used to acquire first image data, the bit depth of which is the first bit depth; the processing unit 312 is used to determine compression parameters based on the first image data, the compression parameters being related to the brightness distribution information of the first image data, the brightness distribution information of the first image data being used to indicate the distribution of pixel brightness values in the first image data across multiple brightness intervals, these multiple brightness intervals belonging to the data range of the first bit depth; and to compress the first image data according to the compression parameters to obtain second image data. The bit depth of the second image data is the second bit depth, and the first bit depth is greater than the second bit depth.
[0254] In this case, the data processing device 30 can be used to implement the method described in the embodiment of FIG3. In the embodiment of FIG3, the acquisition unit 310 can be used to execute S301, and the processing unit 312 can be used to execute S302 and S303. In some embodiments, the data processing device 30 further includes a sending unit 314, which is used to send the aforementioned data compression information. Then the data processing device 30 can also be used to implement the compression processing device-side method described in the embodiment of FIG7, and the sending unit 314 can be used to execute S701.
[0255] In another implementation, the data processing device 30 can be the device described above for decompressing image data, such as an ISP. In this case, the acquisition unit 310 is used to receive second image data, which is related to compression parameters and first image data. The compression parameters are related to the brightness distribution information of the first image data. The brightness distribution information of the first image data is used to indicate the distribution of the brightness values of pixels in the first image data across multiple brightness ranges. These multiple brightness ranges belong to the data range of the first bit depth, where the first bit depth is the bit depth of the first image data, and the bit depth of the second image data is the second bit depth, where the first bit depth is greater than the second bit depth. The processing unit 312 is used to decompress the second image data according to the compression parameters to obtain third image data, where the bit depth of the third image data is the first bit depth.
[0256] In this case, the data processing device 30 can be used to implement the ISP-side method described in the embodiment of FIG7. In the embodiment of FIG7, the acquisition unit 310 and the processing unit 312 can be used to execute S702.
[0257] It should be understood that the division of the units in the data processing device 30 described above is only a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, the units in the device can be implemented by a processor calling software; for example, the device includes a processor connected to a memory containing instructions. The processor calls the instructions stored in the memory to implement any of the above methods or to implement the functions of each unit in the device. The processor can be, for example, a general-purpose processor, such as a central processing unit (CPU) or a microprocessor, and the memory can be internal or external to the device. Alternatively, the units in the device can be implemented as hardware circuits. The functionality of some or all units can be achieved through the design of these hardware circuits, which can be understood as one or more processors. For example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC). The functionality of some or all of the above units is achieved through the design of the logical relationships between the components within the circuit. In another implementation, the hardware circuit can be implemented using a programmable logic device (PLD). Taking a field-programmable gate array (FPGA) as an example, it can include a large number of logic gates. The connection relationships between the logic gates are configured through a configuration file, thereby achieving the functionality of some or all of the above units. All units of the above device can be implemented entirely through processor-invoked software, entirely through hardware circuits, or partially through processor-invoked software with the remaining parts implemented through hardware circuits.
[0258] In this application embodiment, a processor is a circuit with signal processing capabilities. In one implementation, the processor can be a circuit with instruction reading and execution capabilities, such as a central processing unit (CPU), a microprocessor, a graphics processing unit (GPU) (which can be understood as a type of microprocessor), or a digital signal processor (DSP). In another implementation, the processor can implement certain functions through the logical relationships of hardware circuits. These logical relationships of hardware circuits are fixed or reconfigurable. For example, the processor is a hardware circuit implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document and configuring the hardware circuit can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. Furthermore, it can also be a hardware circuit designed for artificial intelligence, which can be understood as a type of ASIC, such as a neural network processing unit (NPU), a tensor processing unit (TPU), a deep learning processing unit (DPU), etc.
[0259] As can be seen, each unit in the above device can be one or more processors (or processing circuits) configured to implement the above methods, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0260] Furthermore, the units in the above devices can be integrated in whole or in part, or they can be implemented independently. In one implementation, these units are integrated together as a system-on-a-chip (SOC). The SOC may include at least one processor for implementing any of the above methods or implementing the functions of the units in the device. The at least one processor may be of different types, such as CPU and FPGA, CPU and artificial intelligence processor, CPU and GPU, etc.
[0261] Referring to Figure 10, which is a schematic diagram of the structure of a computing device according to an embodiment of this application, the computing device 40 includes a processor 401, a communication interface 402, a memory 403, and a bus 404. The processor 401, the memory 403, and the communication interface 402 communicate with each other via the bus 404. It should be understood that this application does not limit the number of processors and memories in the computing device 40.
[0262] In one implementation, the computing device 40 can be the aforementioned image acquisition device or a component within the image acquisition device. The component can be, for example, a chip, an integrated circuit, or the aforementioned compression processing device. The image acquisition device can be a camera, webcam, or other device capable of taking photos or recording videos.
[0263] In another implementation, the computing device 40 can be a device with computing capabilities, such as the aforementioned ISP or other sensors or chips that need to decompress the compressed image data.
[0264] Bus 404 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only one line is used in Figure 10, but this does not imply that there is only one bus or one type of bus. Bus 404 can include pathways for transmitting information between various components of computing device 40 (e.g., memory 403, processor 401, communication interface 402).
[0265] The processor 401 can be referred to the relevant description of the processor in the above embodiments, and will not be repeated here.
[0266] Memory 403 provides storage space, which can store data such as the operating system and computer programs. Memory 403 can be one or a combination of several of the following: random access memory (RAM), erasable programmable read-only memory (EPROM), read-only memory (ROM), or compact disc read memory (CD-ROM). Memory 403 can exist alone or be integrated into processor 401.
[0267] The communication interface 402 can be used to provide information input or output to the processor 401. Alternatively, the communication interface 402 can be used to receive and / or send data to externally transmitted data, and can be a wired link interface including an Ethernet cable, or a wireless link interface (such as Wi-Fi, Bluetooth, general wireless transmission, etc.). Alternatively, the communication interface 402 may also include a transmitter (such as an RF transmitter, antenna, etc.) or a receiver coupled to the interface.
[0268] The processor 401 in the computing device 40 is used to read the computer program stored in the memory 403 to execute the aforementioned method, such as the method described in FIG3 or FIG7.
[0269] In one possible design, computing device 40 may be one or more modules in an execution body that performs the method shown in FIG3 or the compression processing apparatus-side method shown in FIG7. The processor 401 may be used to read one or more computer programs stored in memory for performing the following operations:
[0270] The first image data is acquired by the acquisition unit 310, and the bit depth of the first image data is the first bit depth.
[0271] The compression parameters are determined based on the first image data, and the compression parameters are used to compress the first image data to obtain the second image data;
[0272] The compression parameters are related to the brightness distribution information of the first image data. The brightness distribution information of the first image data is used to indicate the distribution of the brightness values of pixels in the first image data in multiple brightness ranges. These multiple brightness ranges belong to the data range of the first bit depth. The bit depth of the second image data is the second bit depth, and the first bit depth is greater than the second bit depth.
[0273] In another possible design, computing device 40 may be one or more modules in an execution body that performs the ISP-side method shown in FIG7, wherein processor 401 may be used to read one or more computer programs stored in memory for performing the following operations:
[0274] The acquisition unit 310 receives second image data, which is related to compression parameters and first image data. The compression parameters are related to the brightness distribution information of the first image data.
[0275] The second image data is decompressed according to the compression parameters to obtain the third image data;
[0276] The brightness distribution information of the first image data is used to indicate the distribution of the brightness values of pixels in the first image data in multiple brightness ranges. These multiple brightness ranges belong to the data range of the first bit depth. The first bit depth is the bit depth of the first image data, the bit depth of the second image data is the second bit depth, the bit depth of the third image data is the first bit depth, and the first bit depth is greater than the second bit depth.
[0277] In the embodiments described above, each embodiment has its own emphasis. For parts not described in detail in a particular embodiment, please refer to the relevant descriptions in other embodiments. Furthermore, in the embodiments of this application, unless otherwise specified or logically conflicting, the terminology and / or descriptions between the embodiments are consistent and can be mutually referenced. Technical features from different embodiments can be combined to form new embodiments based on their inherent logical relationships.
[0278] It should be noted that those skilled in the art will recognize that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0279] The technical solution of this application, in essence, or the part that makes the contribution, or all or part of the technical solution, can be embodied in the form of a software product. The computer program product is stored in a storage medium and includes several instructions to cause a device (which may be a personal computer, server, network device, robot, microcontroller, chip, robot, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
Claims
1. A data processing method, characterized in that, The method includes: Acquire first image data, wherein the bit depth of the first image data is the first bit depth; Based on the first image data, compression parameters are determined. The compression parameters are related to the brightness distribution information of the first image data. The brightness distribution information is used to indicate the distribution of the brightness values of pixels in the first image data in multiple brightness intervals. The multiple brightness intervals belong to the data range of the first bit depth. The first image data is compressed according to the compression parameters to obtain the second image data, wherein the bit depth of the second image data is the second bit depth, and the first bit depth is greater than the second bit depth.
2. The method according to claim 1, characterized in that, The method further includes: Send data compression information, which includes the second image data and the compression parameters, the compression parameters being used to decompress the second image data.
3. The method according to claim 1 or 2, characterized in that, The brightness distribution information also includes the number of pixels for each brightness value in the first image data.
4. The method according to any one of claims 1-3, characterized in that, The brightness distribution information includes the number of brightness values in the first image data that fall into each brightness range.
5. The method according to any one of claims 1-4, characterized in that, The brightness distribution information also includes at least one of the following: The probability of a pixel appearing for each brightness value in the first image data; The first probability corresponding to each brightness range; and, The second probability corresponding to each brightness range; Wherein, the probability of a pixel with a first brightness value appearing in the first image data is the ratio of the total number of pixels with the first brightness value in the first image data to the total number of pixels in the first image data; the first probability corresponding to the first brightness interval among the plurality of brightness intervals is the ratio of the number of brightness values falling into the first brightness interval in the first image data to the total number of brightness values in the first image data; the second probability corresponding to the first brightness interval is the ratio of the total number of brightness values falling into the first brightness interval in the first image data to the total number of pixels in the first image data.
6. The method according to any one of claims 1-5, characterized in that, The plurality of brightness ranges includes a first brightness range and a second brightness range. In the first image data, when the number of brightness values falling into the first brightness range is greater than the number of brightness values falling into the second brightness range, the first brightness range is mapped to the third brightness range, and the second brightness range is mapped to the fourth brightness range. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
7. The method according to any one of claims 1-5, characterized in that, The plurality of brightness ranges includes a first brightness range and a second brightness range. In the first image data, when the total number of pixels whose brightness values fall into the first brightness range is greater than the total number of pixels whose brightness values fall into the second brightness range, the first brightness range is mapped to the third brightness range, and the second brightness range is mapped to the fourth brightness range. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
8. The method according to any one of claims 1-5, wherein the plurality of brightness intervals includes a first brightness interval and a second brightness interval. When the first result corresponding to the first brightness interval is greater than the second result corresponding to the second brightness interval, the first brightness interval is mapped to the third brightness interval, and the second brightness interval is mapped to the fourth brightness interval. The third brightness range and the fourth brightness range All intervals belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval; The first result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the first brightness range and the number of brightness values in the first image data that fall within the first brightness range. The second result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the second brightness range and the number of brightness values in the first image data that fall within the second brightness range.
9. The method according to any one of claims 1-8, characterized in that, The compression parameters include the coordinate information of k segment nodes of a piecewise linear PWL curve. The k segment nodes are associated with the multiple brightness ranges, where k is a positive integer. The k segment nodes include a first segment node. The coordinate information of the first segment node includes first coordinate axis information and second coordinate axis information. The first coordinate axis information indicates a first brightness value of the first segment node in the first bit depth data range, and the second coordinate axis information indicates that the first brightness value is mapped to a second brightness value in the second bit depth data range.
10. The method according to claim 9, characterized in that, The plurality of brightness intervals includes k+1 brightness intervals, and the step of determining the compression parameters based on the first image data includes: Based on the brightness distribution information of the first image data, k first brightness values are determined, and the k first brightness values divide the data range of the first bit depth into the k+1 brightness intervals; Based on the first probability corresponding to each brightness interval and / or the second probability corresponding to each brightness interval, determine the second brightness value in the data range of the second bit depth that each first brightness value is mapped to; Wherein, the first probability corresponding to the m-th brightness interval is the ratio of the number of brightness values in the first image data falling into the m-th brightness interval to the total number of brightness values in the first image data, and the second probability corresponding to the m-th brightness interval is the ratio of the total number of pixels in the first image data falling into the m-th brightness interval to the total number of pixels in the first image data, where m is a positive integer not greater than k+1.
11. The method according to claim 9 or 10, characterized in that, The step of compressing the first image data according to the compression parameters to obtain the second image data includes: The PWL curve is obtained based on the compression parameters; The second image data is obtained based on the brightness value of each pixel in the first image data and the PWL curve. The second image data includes the brightness value of each pixel mapped to the target brightness value in the second bit depth data range.
12. The method according to any one of claims 2-11, characterized in that, The transmission of the compression parameters occurs before the transmission of the second image data.
13. The method according to any one of claims 1-12, characterized in that, The first image data is the first raw data output by the image sensor after the captured light signal is converted into a digital signal, or the first image data is the second raw data obtained by signal processing of the first raw data.
14. A data processing method, characterized in that, The method includes: Receive second image data, which is related to compression parameters and first image data. The compression parameters are related to the brightness distribution information of the first image data. The brightness distribution information is used to indicate the distribution of the brightness values of pixels in the first image data in multiple brightness intervals. The multiple brightness intervals belong to the data range of the first bit depth. The first bit depth is the bit depth of the first image data, and the bit depth of the second image data is the second bit depth. The first bit depth is greater than the second bit depth. The second image data is decompressed according to the compression parameters to obtain the third image data, wherein the bit depth of the third image data is the first bit depth.
15. The method according to claim 14, characterized in that, Before receiving the second image data, the method further includes: Receive the compression parameters.
16. The method according to claim 14 or 15, characterized in that, The brightness distribution information also includes the number of pixels for each brightness value in the first image data.
17. The method according to any one of claims 14-16, characterized in that, The brightness distribution information includes the number of brightness values in the first image data that fall into each brightness range.
18. The method according to any one of claims 14-17, characterized in that, The brightness distribution information also includes at least one of the following: The probability of a pixel appearing for each brightness value in the first image data; The first probability corresponding to each brightness range; and, The second probability corresponding to each brightness range; Wherein, the probability of a pixel with a first brightness value appearing in the first image data is the ratio of the total number of pixels with the first brightness value in the first image data to the total number of pixels in the first image data; the first probability corresponding to the first brightness interval among the plurality of brightness intervals is the ratio of the number of brightness values falling into the first brightness interval in the first image data to the total number of brightness values in the first image data; the second probability corresponding to the first brightness interval is the ratio of the total number of brightness values falling into the first brightness interval in the first image data to the total number of pixels in the first image data.
19. The method according to any one of claims 14-18, characterized in that, The plurality of brightness ranges includes a first brightness range and a second brightness range. In the first image data, when the number of brightness values falling into the first brightness range is greater than the number of brightness values falling into the second brightness range, the first brightness range is mapped to the third brightness range, and the second brightness range is mapped to the fourth brightness range. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
20. The method according to any one of claims 14-18, characterized in that, The plurality of brightness ranges includes a first brightness range and a second brightness range. In the first image data, when the total number of pixels whose brightness values fall into the first brightness range is greater than the total number of pixels whose brightness values fall into the second brightness range, the first brightness range is mapped to the third brightness range, and the second brightness range is mapped to the fourth brightness range. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval.
21. The method according to any one of claims 14-18, characterized in that, The plurality of brightness ranges includes a first brightness range and a second brightness range. When the first result corresponding to the first brightness interval is greater than the second result corresponding to the second brightness interval, the first brightness interval is mapped to the third brightness interval, and the second brightness interval is mapped to the fourth brightness interval. The third brightness interval and the fourth brightness interval both belong to the data range of the second bit depth, and the interval length of the third brightness interval is greater than the interval length of the fourth brightness interval. The first result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the first brightness range and the number of brightness values in the first image data that fall within the first brightness range. The second result is obtained by weighting the total number of pixels in the first image data whose brightness values fall within the second brightness range and the number of brightness values in the first image data that fall within the second brightness range.
22. The method according to any one of claims 14-21, characterized in that, The compression parameters include the coordinate information of k segment nodes of a piecewise linear PWL curve. These k segment nodes are associated with the multiple brightness ranges, where k is a positive integer. Each k segment node includes a first segment node. The coordinate information of the first segment node includes first coordinate axis information and second coordinate axis information. The first coordinate axis information indicates a first brightness value of the first segment node within the first bit depth data range, and the second coordinate axis information indicates that the first brightness value is mapped to a second brightness value within the second bit depth data range. Degree value.
23. The method according to claim 22, characterized in that, The plurality of brightness ranges includes k+1 brightness ranges. The second coordinate axis information of each of the k segment nodes is associated with the first probability and / or the second probability corresponding to each of the k+1 brightness intervals. Wherein, the first probability corresponding to the m-th brightness interval is the ratio of the number of brightness values in the first image data falling into the m-th brightness interval to the total number of brightness values in the first image data, and the second probability corresponding to the m-th brightness interval is the ratio of the total number of pixels in the first image data falling into the m-th brightness interval to the total number of pixels in the first image data, where m is a positive integer not greater than k+1.
24. The method according to claim 22 or 23, characterized in that, The step of decompressing the second image data according to the compression parameters to obtain the third image data includes: The PWL curve is obtained based on the compression parameters; The third image data is obtained based on the brightness value of each pixel in the second image data and the PWL curve. The third image data includes the brightness value of each pixel mapped to the target brightness value in the first bit depth data range.
25. An apparatus for data processing, characterized in that, The device includes: The acquisition unit is used to acquire first image data, wherein the bit depth of the first image data is the first bit depth; The processing unit is configured to determine compression parameters based on the first image data. The compression parameters are related to the brightness distribution information of the first image data. The brightness distribution information is used to indicate the distribution of the brightness values of pixels in the first image data across multiple brightness intervals, where the multiple brightness intervals belong to the data range of the first bit depth. The processing unit is further configured to compress the first image data according to the compression parameters to obtain second image data, wherein the bit depth of the second image data is a second bit depth, and the first bit depth is greater than the second bit depth.
26. An apparatus for data processing, characterized in that, The device includes: An acquisition unit is used to receive second image data, which is related to compression parameters and first image data. The compression parameters are related to the brightness distribution information of the first image data. The brightness distribution information is used to indicate the distribution of the brightness values of pixels in the first image data in multiple brightness intervals. The multiple brightness intervals belong to the data range of the first bit depth. The first bit depth is the bit depth of the first image data, and the bit depth of the second image data is the second bit depth. The first bit depth is greater than the second bit depth. The processing unit is configured to decompress the second image data according to the compression parameters to obtain third image data, wherein the bit depth of the third image data is the first bit depth.
27. A chip, characterized in that, The chip includes a memory and a processor, the memory storing computer program instructions, and the processor executing the computer program instructions to cause the device to perform the method as claimed in any one of claims 1-13, or to perform the method as claimed in any one of claims 14-24.
28. A camera, characterized in that, The camera includes the device as described in claim 25, or includes the chip as described in claim 27 for performing the method as described in any one of claims 1-13.
29. A data processing system, characterized in that, The data processing system includes a camera and an image signal processor (ISP), wherein the camera is used to implement the method as described in any one of claims 1-13, and the ISP is used to implement the method as described in any one of claims 14-24.
30. A vehicle, characterized in that, The vehicle includes the device as described in at least one of claims 25 and 26, or includes the chip as described in claim 27, or includes the camera as described in claim 28, or includes the data processing system as described in claim 29.
31. A computer-readable storage medium containing program instructions, characterized in that, When the program instructions are executed by the processor, they implement the method as described in any one of claims 1-13, or the method as described in any one of claims 14-24.
32. A computer program product comprising instructions which, when executed by a computing device, cause the computing device to perform the method as claimed in any one of claims 1-13, or to perform the method as claimed in any one of claims 14-24.
Citation Information
Patent Citations
High dynamic range video self-adaptive preprocessing method
CN110933416A
Bit-depth efficient image processing
CN110999301A
Image processing method and device and storage medium
CN116110328A
Image processing method and device, electronic equipment and storage medium
CN116167950A
Image adjustment method and device, equipment and storage medium
CN117876230A