Image data processing method and device, storage medium and electronic equipment

By constructing a relationship table between floating-point image data and fixed-point image data, the problem of reduced image data accuracy caused by fixed-point processing is solved, and efficient and accurate image data processing is achieved, which is suitable for data transmission and storage of LED display screens.

CN120596691APending Publication Date: 2025-09-05XIAN QINGSONG PHOTOELECTRIC TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510413621.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

In the prior art, converting high-precision floating-point image data into fixed-point image data results in reduced image data processing accuracy. In particular, errors occur during the RGB to XYZ color space conversion process of LED displays, affecting the accuracy of image data processing.

Method used

By constructing a relationship table between floating-point image data and fixed-point image data, and using the bit width parameters, color space conversion parameters and fixed-point processing parameters in the metadata, the target floating-point image data corresponding to the fixed-point data can be directly indexed and restored, reducing or avoiding precision loss.

Benefits of technology

It improves the accuracy and efficiency of image data processing, reduces the data transmission bandwidth requirement and storage space, and ensures high precision of image data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120596691A_ABST
    Figure CN120596691A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image data processing method and device, a storage medium and electronic equipment. The method comprises the steps that target image data and metadata of the target image data are acquired; the metadata comprises a bit width parameter, a color space conversion parameter and a fixed-point processing parameter; the target image data is fixed-point data; constructing a relation table of the first data and the second data according to the bit width parameter, the color space conversion parameter and the fixed-point processing parameter; the first data is source image data expressed according to the bit width parameter and floating point image data converted according to the color space conversion parameter; the second data is fixed-point data obtained after the first data is processed according to the fixed-point processing parameters; and obtaining target floating point image data according to the target image data and the relation table. According to the invention, the image data processing accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing, and in particular to an image data processing method, device, storage medium, and electronic device. Background Art

[0002] In the field of LED displays (Light Emitting Diode Displays), fixed-point data processing technology is often used to facilitate data transmission and storage. High-precision floating-point image data is converted into fixed-point image data of a specific precision, and the fixed-point image data is used instead of the high-precision floating-point image data for subsequent data processing. However, compared with high-precision floating-point image data, subsequent data processing using fixed-point image data has errors, which reduces the image data processing accuracy.

[0003] Taking the RGB (RGB is the abbreviation of Red, Green, Blue, a color space that obtains a variety of colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other) data of the LED display screen into XYZ (XYZ is a color space that uses mathematical methods to select three ideal primary colors to replace the actual three primary colors based on RGB, thereby converting the spectral tristimulus values ​​and chromaticity coordinates R, G, and B in the CIE (International Commission on Illumination)-RGB system into positive values) data, and using nonlinear storage as an example to illustrate the traditional fixed-point processing process:

[0004] In the P3 color gamut (DCI-P3 color gamut, a wide color gamut standard developed by the Digital Cinema Initiatives (DCI)), when RGB data is converted to XYZ data and quantized to 12 bits, taking the X data in the XYZ data as an example, the source image data uses 12-bit RGB grayscale data (ranging from 0 to 4095). The 12-bit RGB grayscale data is then converted to 12-bit high-precision floating-point image data X' (ranging from 0 to 3794). The high-precision floating-point image data X' is then fixed-pointed using rounding or other fixed-point methods to obtain fixed-point image data X (ranging from 0 to 3794). At this time, this portion of the source image data is processed using a reference scale with a minimum step of 1 / 4095, and the fixed-point image data is calculated using a reference scale with a minimum step of 1 / 3794, resulting in errors. Using the fixed-point data X with errors for image processing will reduce image data processing accuracy. Summary of the Invention

[0005] In order to overcome the problems existing in the related art, the present application provides an image data processing method, device, storage and electronic equipment to improve the image data processing accuracy.

[0006] According to a first aspect of an embodiment of the present application, there is provided an image data processing method, comprising the following steps:

[0007] Acquire target image data and metadata of the target image data; the metadata includes bit width parameters, color space conversion parameters, and fixed-point processing parameters; the target image data is fixed-point data;

[0008] Constructing a relationship table between first data and second data based on the bit width parameter, the color space conversion parameter, and the fixed-point processing parameter; the first data is floating-point image data obtained by converting the source image data represented by the bit width parameter according to the color space conversion parameter; and the second data is fixed-point data obtained by processing the first data according to the fixed-point processing parameter.

[0009] Target floating-point image data is obtained according to the target image data and the relationship table.

[0010] The present application obtains target image data and metadata of the target image data; constructs a relationship table between first data and second data based on the bit width parameters, color space conversion parameters, and fixed-point processing parameters in the metadata; the first data is the floating-point image data obtained by converting the source image data represented by the bit width parameters through the color space conversion parameters; the second data is the fixed-point data obtained by processing the first data according to the fixed-point processing parameters; and then, based on the relationship table, restores the corresponding target floating-point image data based on the target image data. The embodiments of the present application use fixed-point target image data in data transmission and storage to improve data transmission efficiency, reduce transmission bandwidth requirements, and reduce data storage space; when performing image data processing, the target floating-point image data is restored based on the relationship table, and subsequent image data processing is performed using the target floating-point image data with almost no precision loss, which can improve the accuracy of image data processing.

[0011] In one embodiment, the step of constructing a relationship table between the first data and the second data according to the bit width parameter, the color space conversion parameter, and the fixed-point processing parameter includes:

[0012] Obtaining a plurality of source image data according to the bit width parameter;

[0013] Performing color space conversion on the plurality of source image data respectively according to the color space conversion parameters to obtain a plurality of first data;

[0014] performing fixed-point processing on the plurality of first data according to the fixed-point processing parameters to obtain a plurality of second data;

[0015] A relationship table between the first data and the second data is constructed according to the plurality of first data and the plurality of second data.

[0016] The embodiment of the present application constructs a relationship table between floating-point image data and fixed-point image data based on bit width parameters, color space conversion parameters, and fixed-point processing parameters, and directly restores the target floating-point image data corresponding to the fixed-point target image data according to the relationship table index. Compared with the solution of calculating the target floating-point image data one by one according to the bit width parameters, color space conversion parameters, and fixed-point processing parameters after each target image data is received, the present application can improve the image data processing efficiency, and also facilitates the traceability and verification of the target floating-point image data based on the relationship table.

[0017] In one embodiment, the step of obtaining target floating-point image data according to the target image data and the relationship table includes:

[0018] When a floating-point image data corresponding to the target image data is indexed in the relationship table, the floating-point image data is used as the target floating-point image data.

[0019] In the embodiment of the present application, for each target image data received, an index is performed in a relationship table, and a floating-point image data corresponding to the target image data is directly used as the target floating-point image data. There is no need to perform data conversion operations on each target image data separately. This can avoid conversion errors and low conversion efficiency caused by equipment problems or other problems each time the data conversion operation is performed, thereby improving the efficiency and accuracy of image data processing.

[0020] In one embodiment, the step of obtaining target floating-point image data according to the target image data and the relationship table includes:

[0021] When a plurality of floating-point image data corresponding to the target image data is indexed in the relationship table, the target floating-point image data is obtained according to the plurality of floating-point image data.

[0022] The embodiment of the present application takes into account that multiple floating-point image data can provide more information. Therefore, when the target image data is indexed to multiple floating-point image data in the relationship table, the target floating-point image data is obtained based on the multiple floating-point image data to improve the accuracy of the data.

[0023] In one embodiment, the step of obtaining the target floating-point image data according to the plurality of floating-point image data includes:

[0024] An average value of the plurality of floating-point image data is used as the target floating-point image data.

[0025] The embodiment of the present application uses the average of multiple floating-point image data as the target floating-point image data, which can avoid the error caused by the target floating-point image data being biased towards a certain value, and is as close to the accurate floating-point image data as possible, thereby minimizing the error.

[0026] In one embodiment, the step of obtaining target floating-point image data according to the target image data and the relationship table includes:

[0027] When the floating-point image data corresponding to the target image data is not indexed in the relationship table, obtaining, from the relationship table, two first fixed-point data adjacent to the target image data and two first floating-point image data corresponding to the two first target fixed-point data;

[0028] The target floating-point image data is obtained according to the two first fixed-point data and the two first floating-point image data.

[0029] In an embodiment of the present application, when floating-point image data corresponding to target image data is not indexed in a relationship table, the target floating-point image data is estimated using two first fixed-point data adjacent to the target image data and the first floating-point image data corresponding to the first target fixed-point data, thereby estimating the target floating-point image data based on data that is numerically close to the target image data, thereby improving the accuracy of the target floating-point image data estimation.

[0030] In one embodiment, the step of obtaining the target floating-point image data according to the two first fixed-point data and the two first floating-point image data includes:

[0031] Performing linear fitting based on the two first fixed-point data and the two first floating-point image data to obtain a linear relationship between the floating-point image data and the fixed-point data;

[0032] The target floating-point image data is obtained according to the target image data and the linear relationship.

[0033] The present application performs linear fitting based on two first fixed-point data and two first floating-point image data, and can establish an accurate linear model between two known first fixed-point data points and corresponding first floating-point image data points. The linear model describes how the floating-point image data between the two known first fixed-point data points changes with the fixed-point data. The target image data between the two known first fixed-point data points is then substituted into the linear model to approximate the target floating-point image data, thereby improving the accuracy of the target floating-point image data estimation.

[0034] According to a second aspect of an embodiment of the present application, there is provided an image data processing apparatus, including:

[0035] A data acquisition module, configured to acquire target image data and metadata of the target image data; the metadata including bit width parameters, color space conversion parameters, and fixed-point processing parameters; the target image data is fixed-point data;

[0036] a relationship construction module, configured to construct a relationship table between first data and second data based on the bit width parameter, the color space conversion parameter, and the fixed-point processing parameter; the first data being source image data represented by the bit width parameter and floating-point image data converted according to the color space conversion parameter; and the second data being fixed-point data obtained by processing the first data according to the fixed-point processing parameter;

[0037] The floating-point image data acquisition module is used to obtain target floating-point image data according to the target image data and the relationship table.

[0038] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a processor and a memory; the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the image data processing method as described above.

[0039] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the image data processing method as described above is implemented.

[0040] The present application obtains target image data and metadata of the target image data; constructs a relationship table between first data and second data according to the bit width parameters, color space conversion parameters and fixed-point processing parameters in the metadata; the first data is the floating-point image data obtained by converting the source image data represented by the bit width parameters through the color space conversion parameters; the second data is the fixed-point data obtained by processing the first data according to the fixed-point processing parameters; and then, based on the relationship table, restores the corresponding target floating-point image data based on the target image data. The embodiment of the present application uses fixed-point target image data in data transmission and storage to improve data transmission efficiency, reduce transmission bandwidth requirements, and reduce data storage space; when performing image data processing, constructs a relationship table between the first data and the second data according to the bit width parameters, color space conversion parameters and fixed-point processing parameters in the metadata, and then restores the target floating-point image data according to the relationship table. Subsequent image data processing is performed using the target floating-point image data with almost no precision loss, which can improve the accuracy of image data processing.

[0041] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.

[0042] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0044] Figure 1 A comparison diagram of high-precision floating-point image data and fixed-point image data shown in one embodiment of the present application;

[0045] Figure 2 This is a flowchart of an image data processing method according to one embodiment of the present application;

[0046] Figure 3 This is a flowchart of a method for constructing a relationship table according to one embodiment of the present application;

[0047] Figure 4 This is a flowchart of a method for obtaining target floating-point image data according to one embodiment of the present application;

[0048] Figure 5 This is a flow chart of a method for obtaining target floating-point image data by linear fitting according to one embodiment of the present application;

[0049] Figure 6 This is a schematic block diagram of an image data processing device according to one embodiment of the present application;

[0050] Figure 7 This is a schematic structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0051] To make the objectives, technical solutions, and advantages of this application more clear, the embodiments of this application will be further described in detail below with reference to the accompanying drawings. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements.

[0052] It should be understood that the embodiments described in the following examples do not represent all embodiments consistent with this application. Rather, they are merely examples of devices and methods consistent with certain aspects of this application, as detailed in the appended claims. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of this application without inventive effort are intended to fall within the scope of protection of this application.

[0053] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a" and "the" used in this application are also intended to include plural forms, unless the context clearly indicates otherwise. In addition, in the description of this application, unless otherwise stated, "a plurality" refers to two or more. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone; the character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0054] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, this information should not be limited to these terms. Moreover, these terms are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood to indicate or imply relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to the specific circumstances. Depending on the context, the words "if" / "if" used in this application can be interpreted as "at the time of" or "when" or "in response to determining".

[0055] In the field of LED displays (Light Emitting Diode Displays), fixed-point data processing technology is often used to facilitate data transmission and storage. High-precision floating-point image data is converted into fixed-point image data of a specific precision, and the fixed-point image data is used instead of the high-precision floating-point image data for subsequent data processing. However, compared with high-precision floating-point image data, subsequent data processing using fixed-point image data has errors, which reduces the image data processing accuracy.

[0056] Take the RGB (RGB is the abbreviation of Red, Green, Blue, a color space that obtains a variety of colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB is a device-dependent color space. The RGB values ​​of different monitors and printers may correspond to completely different actual colors) data of the LED display screen and convert them into XYZ (XYZ is a color space that uses mathematical methods to select three ideal primary colors to replace the actual three primary colors based on RGB, thereby converting the spectral tristimulus values ​​and chromaticity coordinates R, G, and B in the CIE (International Commission on Illumination)-RGB system into positive values. XYZ is a device-independent color space based on the visual characteristics of the human eye to ensure color consistency across different devices) data, and use nonlinear storage as an example to illustrate the traditional fixed-point processing process:

[0057] In the P3 color gamut (DCI-P3 color gamut, a wide color gamut standard developed by the Digital Cinema Initiatives (DCI)), when RGB data is converted to XYZ data and quantized to 12 bits, taking the X data in the XYZ data as an example, the source image data uses 12-bit RGB grayscale data (ranging from 0-4095). This 12-bit RGB grayscale data is converted into 12-bit high-precision floating-point image data X' (ranging from 0-3794). The high-precision floating-point image data X' is then fixed-pointed using rounding or other fixed-point methods to obtain fixed-point image data X (ranging from 0-3794). At this time, this portion of the source image data is processed using a reference scale with a minimum step of 1 / 4095, and the fixed-point image data is calculated using a reference scale with a minimum step of 1 / 3794, resulting in errors. Using the fixed-point data X with errors for image processing will reduce image data processing accuracy.

[0058] During the implementation of the above process, the applicant discovered that the aforementioned fixed-point conversion problem can be considered an error correction problem. Since there is actually no precision loss in the process of obtaining the high-precision floating-point image data X' after the source image data is converted into a color space, the error correction problem between the source image data and the fixed-point image data X can be equivalent to the error correction problem between the high-precision floating-point image data X' and the fixed-point image data X.

[0059] See also Figure 1 Taking the rounded fixed-point conversion method as an example, the high-precision floating-point image data X' is shown on the lower border scale, and the fixed-point image data X is shown on the upper border scale. The same length, the final value difference between the two is caused by the different scales. After the image data is fixed-point converted, the accuracy is lost. Figure 1As shown, during image data processing, the fixed-point image data "2" can be obtained after the source image data has been converted into a color space and fixed-pointed. However, the high-precision floating-point image data corresponding to the fixed-point image data "2" is unknown. At this time, when image data processing is performed using the fixed-point image data "2", errors are bound to occur, which reduces the image data processing accuracy and affects the image display effect.

[0060] This application constructs a relationship table between floating-point image data and fixed-point image data based on bit width parameters, color space conversion parameters, and fixed-point processing parameters, and then directly indexes the relationship table to restore the target floating-point image data corresponding to the fixed-point target image data, and then performs subsequent image data processing with the target floating-point image data with almost no precision loss, thereby improving the accuracy of subsequent image data processing.

[0061] The image data processing methods provided in the embodiments of the present application can be executed by an image data processing device. The image data processing device can be implemented through software and / or hardware. The image data processing device can be composed of two or more physical entities or a single physical entity. The hardware referred to by the image data processing device is essentially a computer device. For example, the image data processing device can be a computer, a mobile phone, an interactive tablet, or other smart device.

[0062] The following will be combined with the Figures 2 to 5 , the image data processing method provided in the embodiment of the present application is introduced in detail.

[0063] See also Figure 2 The image data processing method provided in the embodiment of the present application includes the following steps:

[0064] Step S101: acquiring target image data and metadata of the target image data; the metadata includes bit width parameters, color space conversion parameters and fixed-point processing parameters; the target image data is fixed-point data.

[0065] The target image data is the fixed-point data received by the image data processing device, which can be stored in integer form. For example, when converting RGB data to XYZ data, the target image data is the data transmitted to the image data processing device after color conversion and fixed-point processing. In other words, the source image processing device performs color conversion and fixed-point processing on the RGB data before transmitting it to the image data processing device.

[0066] Metadata is information used to describe the attributes of target image data.

[0067] The bit width parameter is used to describe the number of bits for storing each color channel of the source image data. Taking the conversion of RGB data to XYZ data as an example, the bit width parameter describes how many bits of binary are used to represent the value of each color channel of the source image data (RGB data). For example, if the bit width parameter is 8 bits, the value of each color channel of the source image data (RGB data) is represented by 8 bits of binary, that is, the value range of the source image data (RGB data) is 0 to 255 (2 8 -1), the bit width parameter is 12 bits, and the value of each color channel of the source image data (RGB data) is represented by 12 bits of binary. That is, the value range of the source image data (RGB data) is 0 to 4095 (2 12 -1).

[0068] Among them, the color space conversion parameters are used to describe the parameters required to convert from one color space to another color space, such as converting from RGB color space to XYZ color space. Specifically, the color space conversion parameters may include a color space conversion matrix and a compression coefficient, etc. The source image data is converted from one color space to another color space through the color space conversion matrix, and then the converted color space data is compressed according to the compression coefficient to obtain floating-point image data. The color space conversion parameters may also include a color gamut coefficient, a white balance coefficient, and a compression coefficient, etc. The image data processing device obtains a color space conversion matrix through the color gamut coefficient and the white balance coefficient, and then processes it according to the color space conversion matrix and the compression coefficient to obtain floating-point image data.

[0069] The fixed-point processing parameters are used to describe the parameters required to convert floating-point image data into fixed-point data. Optionally, the fixed-point processing parameters may include an identifier for the fixed-point method, such as a rounded fixed-point identifier using the symbol "round." Optionally, the fixed-point processing parameters may also include indicators used for fixed-point processing, such as a scaling factor and an offset.

[0070] Step S102: Construct a relationship table between the first data and the second data based on the bit width parameters, the color space conversion parameters, and the fixed-point processing parameters; the first data is the source image data represented by the bit width parameters, and is the floating-point image data converted according to the color space conversion parameters; the second data is the fixed-point data obtained after the first data is processed according to the fixed-point processing parameters.

[0071] Floating-point image data is a numerical data type used to represent real numbers. It can accurately represent very large or very small values ​​and is a high-precision value.

[0072] It is understood that the floating-point image data obtained by converting the source image data using the color space conversion parameters, as the first data, is a high-precision numerical value, and this process does not result in loss of precision. The fixed-point data obtained by processing the floating-point image data according to the fixed-point processing parameters, as the second data, is an approximate operation and results in loss of precision. In this embodiment of the present application, by recording a one-to-one correspondence between the first data and the second data, a relationship table between the first data and the second data can be obtained. Based on this relationship table, the second data can be restored based on the first data, thereby restoring the floating-point image data without loss of precision.

[0073] Step S103: Obtain target floating-point image data according to the target image data and the relationship table.

[0074] The target floating-point image data can be obtained by indexing the target image data into the relationship table. Furthermore, after obtaining the target floating-point image data, embodiments of the present application can also restore the image source data without loss of precision for display based on color space conversion parameters and bit width parameters. Alternatively, after obtaining the target floating-point image data, embodiments of the present application can perform data verification based on the target floating-point image data, etc., which is not limited by this application.

[0075] The present application obtains target image data and metadata of the target image data; constructs a relationship table between first data and second data according to the bit width parameters, color space conversion parameters and fixed-point processing parameters in the metadata; the first data is the floating-point image data obtained by converting the source image data represented by the bit width parameters through the color space conversion parameters; the second data is the fixed-point data obtained by processing the first data according to the fixed-point processing parameters; and then, based on the relationship table, restores the corresponding target floating-point image data based on the target image data. The embodiment of the present application uses fixed-point target image data in data transmission and storage to improve data transmission efficiency, reduce transmission bandwidth requirements, and reduce data storage space; when performing image data processing, constructs a relationship table between the first data and the second data according to the bit width parameters, color space conversion parameters and fixed-point processing parameters in the metadata, and then restores the target floating-point image data according to the relationship table. Subsequent image data processing is performed using the target floating-point image data with almost no precision loss, which can improve the accuracy of image data processing.

[0076] See also Figure 3 In one embodiment, the step of constructing a relationship table between the first data and the second data according to the bit width parameter, the color space conversion parameter, and the fixed-point processing parameter in step S102 includes:

[0077] Step S1021: Obtain a plurality of source image data according to the bit width parameter.

[0078] It can be understood that the source image data range can be obtained based on the bit width parameter, and by listing the source image data within the range, a number of source image data can be obtained. Taking the bit width parameter as 12 as an example, it can be known that the source image data range is 0-4095, and the values ​​0, 1, 2...4095 can be listed in sequence to obtain 4095 source image data.

[0079] Step S1022: performing color space conversion on a plurality of source image data according to the color space conversion parameters to obtain a plurality of first data.

[0080] It should be understood that the source image data typically includes multiple color channels, and the color space conversion parameters corresponding to different color channels may be the same or different. For example, when converting from an RGB color space to an XYZ color space, the color space conversion parameters corresponding to the X data, Y data, and Z data in the XYZ color space are generally different. In the embodiment of the present application, different color space conversion parameters are set for different color channels, that is, the first data obtained will be data obtained by converting different color channels according to their respective color space conversion parameters.

[0081] Step S1023: performing fixed-point processing on the plurality of first data according to the fixed-point processing parameters to obtain a plurality of second data.

[0082] The fixed-point processing method is determined according to the fixed-point processing parameters, which can be rounding, truncation or other fixed-point methods, and this application is not limited.

[0083] Step S1024: constructing a relationship table between the first data and the second data according to the plurality of first data and the plurality of second data.

[0084] The following uses the example of converting RGB data into XYZ data and quantizing it to 12 bits in the P3 color space to obtain X data in the XYZ data to illustrate how to construct a relationship table between the first data and the second data. Please refer to the following table (1):

[0085]

[0086]

[0087] Table 1

[0088] In Table (1), column A represents RGB grayscale data (4095 levels of RGB grayscale data) with a 12-bit bit width parameter, i.e., the source image data, which is obtained by enumerating within the data range represented by the 12-bit bit width parameter; column B represents the maximum value of the 12-bit RGB grayscale data; column C represents the maximum value of the floating-point image data X' after the 12-bit RGB grayscale data is converted to a color space; column D represents the floating-point image data X' after the color space conversion of each level of RGB grayscale data, calculated as the corresponding grayscale / maximum value of the RGB grayscale data * maximum value of the floating-point image data X', i.e., column D value = column A value / column B value * column C value; column E represents the fixed-point data X obtained by rounding column D to the nearest integer. In actual use, to reduce data storage, the relationship table includes column D and column E data that corresponds one-to-one to the data in column D, i.e., a relationship table is obtained between the first data and the second data.

[0089] The embodiment of the present application constructs a relationship table between floating-point image data and fixed-point image data based on bit width parameters, color space conversion parameters, and fixed-point processing parameters, and directly restores the target floating-point image data corresponding to the fixed-point target image data according to the relationship table index. Compared with the solution of calculating the target floating-point image data one by one according to the bit width parameters, color space conversion parameters, and fixed-point processing parameters after each target image data is received, the present application can improve the image data processing efficiency, and also facilitates the traceability and verification of the target floating-point image data based on the relationship table.

[0090] See also Figure 4 In one embodiment, the step of obtaining target floating-point image data according to the target image data and the relationship table in step S103 includes:

[0091] Step S1031: when a floating-point image data corresponding to the target image data is indexed in the relationship table, the floating-point image data is used as the target floating-point image data.

[0092] Specifically, please continue to refer to Table (1). If the target image data is "2", that is, the data in column E is "2", then you can find in the data in column D of Table (1) that the floating-point image data corresponding to the target image data "2" is "1.852972259", then you can use "1.852972259" as the target floating-point image data.

[0093] In the embodiment of the present application, for each target image data received, an index is performed in a relationship table, and a floating-point image data corresponding to the target image data is directly used as the target floating-point image data. There is no need to perform data conversion operations on each target image data separately. This can avoid conversion errors and low conversion efficiency caused by equipment problems or other problems each time the data conversion operation is performed, thereby improving the efficiency and accuracy of image data processing.

[0094] Please continue reading Figure 4 In one embodiment, the step of obtaining target floating-point image data according to the target image data and the relationship table in step S103 includes:

[0095] Step S1032: when a plurality of floating-point image data corresponding to the target image data is indexed in the relationship table, the target floating-point image data is obtained according to the plurality of floating-point image data.

[0096] It is understandable that, considering that the same fixed-point value may correspond to multiple floating-point image data, in order to improve data accuracy, the target floating-point image data is obtained based on the multiple floating-point image data. In one embodiment, the average of the multiple floating-point image data is used as the target floating-point image data; in another embodiment, the target floating-point image data is obtained by multiplying the multiple floating-point image data by a preset weight value and then averaging the result.

[0097] Specifically, please continue to refer to Table (1). If the target image data is "6", that is, the data in column E is "6", then you can find in the data in column D of Table 1 that the target image data "6" corresponds to two floating-point image data, namely "5.558916777" and "6.485402906", so you can get the target floating-point image data based on the two floating-point image data "5.558916777" and "6.485402906".

[0098] The embodiment of the present application takes into account that multiple floating-point image data can provide more information. Therefore, when the target image data is indexed to multiple floating-point image data in the relationship table, the target floating-point image data is obtained based on the multiple floating-point image data to improve the accuracy of the data.

[0099] In one embodiment, the step of obtaining target floating-point image data according to the plurality of floating-point image data in step S1032 includes:

[0100] Step S10321: taking the average of the plurality of floating-point image data as the target floating-point image data.

[0101] Specifically, please continue to refer to Table (1). The fixed-point data "6" in column E corresponds to two floating-point image data "5.558916777" and "6.485402906". The average of the two floating-point image data "5.558916777" and "6.485402906", that is, (5.558916777+6.485402906) / 2=6.0221598415, is used as the target floating-point image data.

[0102] The embodiment of the present application uses the average of multiple floating-point image data as the target floating-point image data, which can avoid the error caused by the target floating-point image data being biased towards a certain value, and is as close to the accurate floating-point image data as possible, thereby minimizing the error.

[0103] Please continue reading Figure 4 In one embodiment, the step of obtaining target floating-point image data according to the target image data and the relationship table in step S103 includes:

[0104] Step S1033: when the floating-point image data corresponding to the target image data is not indexed in the relationship table, obtaining two first fixed-point data adjacent to the target image data and two first floating-point image data corresponding to the two first target fixed-point data in the relationship table;

[0105] Step S1034: Obtain target floating-point image data according to the two first fixed-point data and the two first floating-point image data.

[0106] When the maximum value of the floating-point image data is greater than the maximum value of the source image data, there may be floating-point image data in the relationship table that is not indexed to the target image data. For example, when 12-bit RGB data (source image data in the range of 0-4095) is converted to a target in the range of 0-4132, there may be target image data that is not indexed to the corresponding floating-point image data in the relationship table. Therefore, in the relationship table, two first fixed-point data adjacent to the target image data and the first floating-point image data corresponding to the first target fixed-point data are obtained, and the target floating-point image data is approximated based on the two first fixed-point data and the two first floating-point image data.

[0107] Optionally, linear fitting is performed based on the two first fixed-point data and the two first floating-point image data to obtain target floating-point image data corresponding to the target image data. Optionally, linear interpolation, polynomial interpolation, spline interpolation, or other interpolation methods are performed based on the two first fixed-point data and the two first floating-point image data to obtain target floating-point image data corresponding to the target image data.

[0108] When the floating-point image data corresponding to the target image data cannot be indexed in the relationship table in the embodiment of the present application, the target floating-point image data is estimated by two first fixed-point data adjacent to the target image data and the first floating-point image data corresponding to the first target fixed-point data, so as to estimate the target floating-point image data based on the data numerically close to the target image data, improving the accuracy of the estimation of the target floating-point image data.

[0109] Please refer to Figure 5 , in one embodiment, the step S1034 of obtaining the target floating-point image data according to two first fixed-point data and two first floating-point image data includes:

[0110] Step S10341: Perform linear fitting according to two first fixed-point data and two first floating-point image data to obtain the linear relationship between the floating-point image data and the fixed-point data.

[0111] Step S10342: Obtain the target floating-point image data according to the target image data and the linear relationship.

[0112] Specifically, assume that the target image data is P. The two first fixed-point data adjacent to the target image data found in the relationship table are P1 and P2 respectively, where P1 < P < P2. The two first floating-point image data corresponding to the two first fixed-point data P1 and P2 obtained from the relationship table are H1 and H2 respectively. Assume that there is a linear relationship between the floating-point image data H and the fixed-point data P, which can be represented by the following linear equation: H = a*P + b, where a is the slope and b is the intercept. Use two data points (P1, H1) and (P2, H2) to calculate the slope a and the intercept b: a = (H2 - H1) / (P2 - P1); b = H1 - a*P1; Substitute the target image data P into the linear equation H = a*P + b to obtain the target floating-point image data H.

[0113] The present application performs linear fitting according to two first fixed-point data and two first floating-point image data, and can establish an accurate linear model between two known first fixed-point data points and the corresponding first floating-point image data points. This linear model describes how the floating-point image data changes with the fixed-point data between two known first fixed-point data points, and then substitutes the target image data between the two known first fixed-point data points into this linear model to approximate and obtain the target floating-point image data, improving the accuracy of the estimation of the target floating-point image data.

[0114] Please refer to Figure 6 , which is a schematic structural diagram of the image data processing device provided by the embodiment of the present application. The device 200 includes:

[0115] The data acquisition module 201 is used to acquire target image data and metadata of the target image data; the metadata includes bit width parameters, color space conversion parameters and fixed-point processing parameters; the target image data is fixed-point data;

[0116] The relationship building module 202 is configured to build a relationship table between first data and second data based on the bit width parameter, the color space conversion parameter, and the fixed-point processing parameter; the first data is the floating-point image data obtained by converting the source image data represented by the bit width parameter according to the color space conversion parameter; and the second data is the fixed-point data obtained by processing the first data according to the fixed-point processing parameter.

[0117] The floating-point image data acquisition module 203 is configured to obtain target floating-point image data according to the target image data and the relationship table.

[0118] It should be noted that the image data processing device provided in the embodiment of the present application, when executing the image data processing method, only uses the division of the above-mentioned functional modules as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the image data processing device provided in the embodiment of the present application and the image data processing method provided in the embodiment of the present application are based on the same concept. The implementation process is detailed in the method embodiment and will not be repeated here.

[0119] The image data processing device of the present application can be applied to a computer device. The device embodiment can be implemented by software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the file processing in which it is located reading the corresponding computer program instructions in the memory and running them. From a hardware perspective, the computer device in which it is located may include a processor and a memory, and the processor and the memory are connected via a data bus or other well-known methods.

[0120] See also Figure 7 , is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 7 As shown, the electronic device 300 can be specifically a computer, a mobile phone, a tablet computer, an interactive tablet, etc. The electronic device 300 can include: at least one processor 310, at least one memory 320, at least one display 330, at least one network interface 340, a user interface 350 and at least one communication bus 360.

[0121] The communication bus 360 is used to implement the connection and communication between these components.

[0122] The user interface 350 may include a display screen and a camera; the user interface 350 may also include a standard wired interface and a wireless interface.

[0123] The network interface 340 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0124] The processor 310 may include one or more processing cores. The processor 310 utilizes various interfaces and circuits to connect various components within the electronic device 300. It executes instructions, programs, code sets, or instruction sets stored in the memory 320, as well as accesses data stored in the memory 320, to perform various functions of the electronic device 300 and process data. Optionally, the processor 310 may be implemented using at least one hardware form factor of a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 310 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content displayed by the display layer; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 310 and may be implemented as a separate chip.

[0125] Among them, the memory 320 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 320 includes a non-transitory computer-readable storage medium. The memory 320 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 320 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 320 may also be optionally at least one storage device located away from the aforementioned processor 310. As Figure 7As shown, the memory 320 as a computer storage medium may include an operating system, a network communication module, and a user.

[0126] exist Figure 7 In the electronic device 300 shown, the user interface 350 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 310 can be used to call the operating application stored in the memory 320, such as: image data processing program; and perform related operations of any image data processing method in the above embodiments, with corresponding functions and beneficial effects.

[0127] The present application also provides a computer-readable storage medium storing a computer program, which contains instructions suitable for being loaded by a processor and executing the steps of the image data processing method described above. The specific execution process can be found in the detailed description of the embodiment and is not further described here. The device containing the storage medium can be a personal computer, laptop computer, smartphone, tablet computer, or other electronic device.

[0128] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the components described as separate parts may or may not be physically separated, and the parts shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present application scheme. Those of ordinary skill in the art can understand and implement it without paying any creative work.

[0129] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable image data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable image data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable image data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions selected in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 function selected in a box or multiple boxes.

[0131] These computer program instructions can also be loaded onto a computer or other programmable image data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 steps for the function selected in a box or multiple boxes.

[0132] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0133] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0134] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0135] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0136] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A method for processing image data, characterized in that: The steps include: Acquire target image data and metadata of the target image data; the metadata includes bit width parameters, color space conversion parameters, and fixed-point processing parameters; the target image data is fixed-point data; Constructing a relationship table between first data and second data based on the bit width parameter, the color space conversion parameter, and the fixed-point processing parameter; the first data is floating-point image data obtained by converting source image data represented by the bit width parameter according to the color space conversion parameter; and the second data is fixed-point data obtained by processing the first data according to the fixed-point processing parameter. Target floating-point image data is obtained according to the target image data and the relationship table.

2. The image data processing method according to claim 1, wherein: The step of constructing a relationship table between the first data and the second data according to the bit width parameter, the color space conversion parameter, and the fixed-point processing parameter includes: Obtaining a plurality of source image data according to the bit width parameter; Performing color space conversion on the plurality of source image data respectively according to the color space conversion parameters to obtain a plurality of first data; performing fixed-point processing on the plurality of first data according to the fixed-point processing parameters to obtain a plurality of second data; A relationship table between the first data and the second data is constructed according to the plurality of first data and the plurality of second data.

3. The image data processing method according to any one of claims 1 or 2, characterized in that: The step of obtaining target floating-point image data according to the target image data and the relationship table includes: When a floating-point image data corresponding to the target image data is indexed in the relationship table, the floating-point image data is used as the target floating-point image data.

4. The image data processing method according to any one of claims 1 or 2, characterized in that: The step of obtaining target floating-point image data according to the target image data and the relationship table includes: When a plurality of floating-point image data corresponding to the target image data is indexed in the relationship table, the target floating-point image data is obtained according to the plurality of floating-point image data.

5. The image data processing method according to claim 4, wherein: The step of obtaining the target floating-point image data according to the plurality of floating-point image data comprises: An average value of the plurality of floating-point image data is used as the target floating-point image data.

6. The image data processing method according to any one of claims 1 or 2, characterized in that: The step of obtaining target floating-point image data according to the target image data and the relationship table includes: When the floating-point image data corresponding to the target image data is not indexed in the relationship table, obtaining, from the relationship table, two first fixed-point data adjacent to the target image data and two first floating-point image data corresponding to the two first target fixed-point data; The target floating-point image data is obtained according to the two first fixed-point data and the two first floating-point image data.

7. The image data processing method according to claim 6, wherein: The step of obtaining the target floating-point image data according to the two first fixed-point data and the two first floating-point image data comprises: Performing linear fitting based on the two first fixed-point data and the two first floating-point image data to obtain a linear relationship between the floating-point image data and the fixed-point data; The target floating-point image data is obtained according to the target image data and the linear relationship.

8. An image data processing device, characterized in that: include: A data acquisition module, configured to acquire target image data and metadata of the target image data; the metadata including bit width parameters, color space conversion parameters, and fixed-point processing parameters; the target image data is fixed-point data; a relationship construction module, configured to construct a relationship table between first data and second data based on the bit width parameter, the color space conversion parameter, and the fixed-point processing parameter; the first data being source image data represented by the bit width parameter and floating-point image data converted according to the color space conversion parameter; and the second data being fixed-point data obtained by processing the first data according to the fixed-point processing parameter; The floating-point image data acquisition module is used to obtain target floating-point image data according to the target image data and the relationship table.

9. An electronic device comprising a processor and a memory; characterized in that: The memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the image data processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image data processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Processing device and method

    CN111651486A

  • Data processing method and device, electronic equipment and storage medium

    CN113805844A

  • High precision two step branch hybrid CORDIC computing system, method and apparatus

    CN118502713A

  • Image processing method and device

    JP2005338915A

  • Method and apparatus for converting floating-point pixel values to byte pixel values by table lookup

    US5528741A