Image processing method and device, electronic equipment and storage medium

By adjusting and using the target adjustment coefficient matrix to adjust the image quality and sending it to the FPGA chip for processing, the problem of large workload and high hardware resource consumption in color space conversion is solved, and the image output efficiency is improved.

CN120091117APending Publication Date: 2025-06-03XIAN QINGSONG PHOTOELECTRIC TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311589016.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

In the prior art, FPGA chips have a large workload and consume a lot of hardware resources when performing color space conversion, resulting in low image output efficiency.

Method used

By acquiring the original image, in response to the image quality parameter adjustment operation, adjusting the preset adjustment coefficient matrix, generating the target adjustment coefficient matrix, and converting the original image to the first color space to adjust the image quality, and finally sending the target image data to the FPGA chip for processing.

Benefits of technology

This method greatly reduces the matrix computing amount of FPGA chip in color space conversion, saves hardware resources, and improves image output efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120091117A_ABST
    Figure CN120091117A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and device, electronic equipment and a storage medium, and the method comprises the steps: adjusting a preset adjustment coefficient matrix corresponding to each image quality parameter of an original image in response to an image quality parameter adjustment operation, and generating a target adjustment coefficient matrix of the original image; the image quality parameters comprise at least one of brightness, saturation, contrast, hue and color temperature; converting the original image into a first color space to obtain first image data; based on each target adjustment coefficient matrix, performing image quality adjustment on the first image data to obtain target image data; and sending the target image data to the field programmable gate array chip, and processing the target image data through the field programmable gate array chip to generate a target image of the original image. Based on the embodiment, hardware resources of a chip are saved to a great extent in the color space conversion process, the color space conversion efficiency is improved, and the image output efficiency of the image output equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular, to an image processing method, apparatus, electronic device, and storage medium. Background Art

[0002] Existing image output devices such as televisions often have the function of color space conversion for image processing. However, during each color space conversion (CSC) process, a series of image quality adjustments are often required, including adjustments such as brightness, contrast, saturation, color temperature, and color difference. Moreover, during the color space conversion process, multiple space conversions are required, and in the case of different data types and different domains, different parameters are needed for conversion.

[0003] Therefore, during each color space conversion process, multiple matrix operations are required, which is a large workload and consumes a lot of hardware resources for a Field Programmable Gate Array (FPGA) chip, affecting the image output efficiency. Summary of the Invention

[0004] Based on the above research, the present invention provides an image processing method, apparatus, electronic device, and storage medium, which can solve the problem that the workload of the FPGA chip is large and consumes a lot of hardware resources during color space conversion in the prior art, resulting in low image output efficiency.

[0005] The embodiments of the present invention can be implemented in the following ways:

[0006] In a first aspect, an embodiment of the present invention provides an image processing method, the method including:

[0007] Obtain an original image;

[0008] In response to an image quality parameter adjustment operation, adjust the preset adjustment coefficient matrix corresponding to each image quality parameter of the original image to generate a target adjustment coefficient matrix of the original image; the image quality parameters include at least one of brightness, saturation, contrast, hue, and color temperature; and

[0009] Convert the original image to a first color space to obtain first image data;

[0010] Based on each of the target adjustment coefficient matrices, perform image quality adjustment on the first image data to obtain target image data;

[0011] Send the target image data to the field programmable gate array (FPGA) chip, and process the target image data through the FPGA chip to generate the target image of the original image.

[0012] In an alternative embodiment, the target adjustment coefficient matrix includes at least one of: a first target adjustment coefficient matrix, a second target adjustment coefficient matrix, a third target adjustment coefficient matrix, a fourth target adjustment coefficient matrix, and a fifth target adjustment coefficient matrix;

[0013] The first target adjustment coefficient matrix is a luminance coefficient matrix for luminance adjustment;

[0014] The second target adjustment coefficient matrix is a saturation coefficient matrix for saturation adjustment;

[0015] The third target adjustment coefficient matrix is a contrast coefficient matrix for contrast adjustment;

[0016] The fourth target adjustment coefficient matrix is a hue coefficient matrix for hue adjustment;

[0017] The fifth target adjustment coefficient matrix is a color temperature coefficient matrix for color temperature adjustment.

[0018] In an alternative embodiment, adjusting the first image data based on each of the target adjustment coefficient matrices to obtain target image data includes:

[0019] Adjust the luminance of the first image data according to the first target adjustment coefficient matrix to obtain second image data;

[0020] Adjust the saturation of the second image data according to the second target adjustment coefficient matrix to obtain third image data;

[0021] Adjust the contrast of the third image data according to the third target adjustment coefficient matrix to obtain fourth image data;

[0022] Adjust the hue of the fourth image data according to the fourth target adjustment coefficient matrix to obtain fifth image data;

[0023] Adjust the color temperature of the fifth image data based on the fifth target adjustment coefficient matrix to obtain target image data.

[0024] In an alternative embodiment, adjusting the color temperature of the fifth image data based on the fifth target adjustment coefficient matrix to obtain target image data includes:

[0025] Convert the fifth image data to the RGB color space to obtain sixth image data;

[0026] Adjust the color temperature of the sixth image data according to the fifth target adjustment coefficient matrix to obtain target image data.

[0027] In an alternative embodiment, the converting the original image to the first color space to obtain the first image data includes:

[0028] Obtain the image type of the original image;

[0029] Query the preset matrix database and obtain the spatial conversion matrix corresponding to the original image according to the image type;

[0030] Convert the original image to the first color space based on the spatial conversion matrix to obtain the first image data.

[0031] In an alternative embodiment, the preset adjustment coefficient matrix includes at least one of: a first preset adjustment coefficient matrix for brightness adjustment, a second preset adjustment coefficient matrix for saturation adjustment, a third preset adjustment coefficient matrix for contrast adjustment, a fourth preset adjustment coefficient matrix for hue adjustment, and a fifth preset adjustment coefficient matrix for color temperature adjustment;

[0032] The generating the target adjustment coefficient matrix of the original image by adjusting the preset adjustment coefficient matrix corresponding to each image quality parameter of the original image in response to the image quality parameter adjustment operation includes:

[0033] In response to the image quality parameter adjustment operation, obtain the adjustment values of each of the image quality parameters of the original image; the adjustment values include: brightness adjustment value, saturation adjustment value, contrast adjustment value, hue adjustment value, and color temperature adjustment value;

[0034] Adjust the preset brightness matrix elements in the first preset adjustment coefficient matrix according to the brightness adjustment value to obtain a first target adjustment coefficient matrix; and

[0035] Adjust the preset saturation matrix elements in the second preset adjustment coefficient according to the saturation adjustment value to obtain a second target adjustment coefficient matrix; and

[0036] Adjust the preset contrast matrix elements in the third preset adjustment coefficient according to the contrast adjustment value to obtain a third target adjustment coefficient matrix; and

[0037] Adjust the preset hue matrix elements in the fourth preset adjustment coefficient according to the hue adjustment value to obtain a fourth target adjustment coefficient matrix; and

[0038] Adjust the preset color temperature matrix elements in the fifth preset adjustment coefficient according to the color temperature adjustment value to obtain a fifth target adjustment coefficient matrix.

[0039] In an alternative embodiment, the method further includes:

[0040] Invoking the field programmable gate array chip, and sending a preset offset matrix to the field programmable gate array chip, and processing the target image and the preset offset matrix through the field programmable gate array chip to generate a target image of the original image.

[0041] In a second aspect, an embodiment of the present application further provides an image processing apparatus, where the image processing apparatus includes:

[0042] An acquisition unit, configured to acquire an original image;

[0043] A parameter adjustment unit, configured to, in response to an image quality parameter adjustment operation, adjust a preset adjustment coefficient matrix corresponding to each image quality parameter of the original image to generate a target adjustment coefficient matrix of the original image; the image quality parameters include: brightness, saturation, contrast, hue, color temperature; and

[0044] A space conversion unit, configured to convert the original image to a first color space to obtain first image data;

[0045] An image quality adjustment unit, configured to perform image quality adjustment on the first image data based on each of the target adjustment coefficient matrices to obtain target image data;

[0046] A sending unit, configured to send the target image data to a field programmable gate array chip, and process the target image data through the field programmable gate array F chip to generate a target image of the original image.

[0047] In a third aspect, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, the image processing method described in any one of the foregoing embodiments is implemented.

[0048] In a fourth aspect, an embodiment of the present application further provides a readable storage medium, where the readable storage medium includes a computer program, and when the computer program runs, it controls an electronic device where the readable storage medium is located to execute the image processing method described in any one of the foregoing embodiments.

[0049] The image processing method, apparatus, electronic device, and storage medium provided by the embodiments of the present application adjust the preset adjustment coefficient matrix corresponding to each image quality parameter of the original image in response to an image quality parameter adjustment operation, generate target image data of the original image, and send the target image data to the FPGA chip for image processing. Based on the target image data, the FPGA chip can generate the target image of the original image. In the embodiments of the present application, when performing image quality adjustment during the color space conversion process, only the elements of the preset adjustment coefficient matrix need to be simply modified to obtain the target adjustment coefficient matrix. Based on the target adjustment coefficient matrix, at most 8 matrix multiplications are required to obtain the target data matrix after image quality adjustment. As a result, when the FPGA chip performs image processing, it does not need to perform image quality adjustment processing, and only needs to perform a simple addition operation on the target image data and the preset offset matrix to generate the target image, which greatly saves the hardware resources of the FPGA, improves the color space conversion efficiency, and further improves the image output efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The following will clearly show the technical solutions and other beneficial effects of the present application by describing the specific embodiments of the present application in detail with reference to the accompanying drawings.

[0051] Figure 1 is a system schematic diagram of the image processing system provided by the embodiments of the present application;

[0052] Figure 2 is a flowchart of the image processing method provided by the embodiments of the present application;

[0053] Figure 3 is a flowchart of step S202 provided by the embodiments of the present application;

[0054] Figure 4 is a flowchart of step S203 provided by the embodiments of the present application;

[0055] Figure 5 is a flowchart of step S204 provided by the embodiments of the present application;

[0056] Figure 6 is a structural schematic diagram of the image processing apparatus provided by the embodiments of the present application;

[0057] Figure 7 is a structural schematic diagram of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0058] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0059] In the description of the present application, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of the described features. In the description of the present application, "a plurality" means two or more, unless otherwise specifically defined.

[0060] The following disclosure provides many different embodiments or examples for implementing different structures of the present application. To simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, they are only examples and are not intended to limit the present application. In addition, the present application may repeat reference numerals and / or reference letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed. In addition, the present application provides examples of various specific processes and materials, but those of ordinary skill in the art can be aware of the application of other processes and / or the use of other materials.

[0061] First, the noun terms involved in one or more embodiments of this specification are explained.

[0062] YUV: It is a pixel format in which the luminance parameter and the chrominance parameter are separated. Among them, Y represents the brightness, that is, the grayscale value; while U and V represent the chrominance, and their function is to describe the color and saturation of the image and are used to specify the color of the pixel. When encoding a photo or video, YUV allows reducing the bandwidth of the chrominance considering the human perception ability.

[0063] YCbCr: It is a pixel format that is an international standard variant of YUV, and can also be understood as a scaled and offset version of YUV. Among them, the Cb parameter represents the degree of offset of the current color of the pixel from blue, the Cr parameter represents the degree of offset of the current color of the pixel from red, and Y represents the brightness.

[0064] Red-green-blue color space (i.e., RGB color space): Also known as the three-primary color model, based on three primary colors, namely red (R), green (G), and blue (B), through the changes of the R, G, and B color channels and their superposition with each other, rich and extensive colors are generated.

[0065] Color Range: refers to the color gamut, which is divided into two categories: Full Range and Limited Range. The R, G, and B value ranges of the Full Range are all 0 to 255, while the R, G, and B value ranges of the Limited Range are all 16 to 235. For each Color Range, there are different conversion standards. The common conversion standards are BT601, BT709, and BT2020. BT601 is the standard for standard definition, BT709 is the standard for high definition, and BT2020 is the standard for ultra-high definition.

[0066] Brightness: refers to the brightness of the light shining on the scene or image. When the brightness of the image increases, it will appear dazzling or glaring. When the brightness is smaller, the image will appear dim.

[0067] Contrast: refers to the difference between different colors. The greater the contrast, the greater the difference between different colors. If the contrast is too large, the image will appear dazzling. The smaller the contrast, the smaller the contrast between different colors.

[0068] Saturation: refers to the concentration or vividness of the image color. The higher the saturation, the richer the color; the lower the saturation, the older and duller the color will appear. When the saturation is 0, the image is a grayscale image.

[0069] Hue: It refers to the color, indicating the wavelength of the color and determining the color.

[0070] Color temperature: It is a scale that represents the color of a light source, and its unit is K (Kelvin).

[0071] The embodiments of the present application provide an image processing method, device, electronic device and storage medium, which are described below respectively.

[0072] The image processing method in the embodiment of the present application can be performed by an image processing device, which can be implemented in software and / or hardware. The image processing device can be configured in an electronic device. Specifically, the electronic device can be a server or a terminal. Among them, the server can be an independent server, or a server network or server cluster composed of servers, which includes but is not limited to a computer, a network host, a single network server, multiple network servers or a cloud server composed of multiple servers. Among them, the cloud server is composed of a large number of computers or network servers based on cloud computing. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a game console, or a personal computer (PC) and other devices.

[0073] The image processing method provided by the embodiments of this application can be applied to an image processing system. As Figure 1 shown, the image processing system may include: an electronic device 100 and an FPGA chip 200. Among them, the above-mentioned image processing device is integrated in the electronic device 100, and a computer storage medium corresponding to image processing runs in the electronic device 100 to execute the steps of the image processing method.

[0074] In the embodiments of this application, the electronic device 100 is mainly used for: acquiring an original image; in response to an image quality parameter adjustment operation, adjusting a preset adjustment coefficient matrix corresponding to each image quality parameter of the original image to generate a target adjustment coefficient matrix of the original image; converting the original image to a first color space to obtain a first image matrix; performing image quality adjustment on the first image data based on each target adjustment coefficient matrix to obtain target image data; and sending the target image data to the FPGA chip. The FPGA chip is mainly used for: processing the target image data from the electronic device 100 to generate a target image of the original image.

[0075] It should be noted that Figure 1 the schematic diagram of the system structure of the image processing system shown is only an example. The image processing system described in the embodiments of this application is used to more clearly illustrate the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions of the embodiments of this application.

[0076] As Figure 2 shown, Figure 2 is the schematic flowchart of the image processing method provided by the embodiments of this application. The image processing method at least includes the following steps:

[0077] S201, acquire an original image.

[0078] In the embodiments of this application, the above-mentioned original image may be an RGB image.

[0079] The image processing method provided by the embodiments of this application is applied to an electronic device, and the type of the electronic device is not specifically limited.

[0080] The electronic device receives an image processing request, which is used to instruct the electronic device to perform image processing. Among them, the triggering condition of the image processing request is not specifically limited, that is, the image processing request can be actively triggered by the user. For example, the user clicks the "Image Processing" button on the display interface of the electronic device to actively trigger the generation of an image processing request; in addition, the image processing request can also be automatically triggered by the electronic device. For example, the triggering condition of the image processing request preset in the electronic device is: detecting a new original image in the preset device automatically triggers the image processing request. The electronic device monitors in real time whether a new original image appears in the preset device. After detecting a new original image in the preset device, the electronic device acquires the original image.

[0081] In response to the image processing request, the electronic device acquires the original image. Among them, the acquisition method of the original image is not limited, that is, the original image can be actively uploaded to the electronic device by the user. For example, the user clicks the "Image Upload" button on the display interface of the electronic device to trigger and display the original image upload interface, and the user selects the corresponding original picture for upload; in addition, the original image can also be actively acquired by the electronic device. For example, the triggering condition for the electronic device to acquire the original image preset in the electronic device is: detecting a new original image in the preset device automatically triggers the electronic device to acquire the original image. The electronic device monitors in real time whether a new original image appears in the preset device. After detecting a new original image in the preset device, the electronic device acquires the original image.

[0082] It can be understood that the above preset device can be the electronic device itself or other electronic devices connected to the electronic device.

[0083] S202, in response to the image quality parameter adjustment operation, adjust the preset adjustment coefficient matrix corresponding to each image quality parameter of the original image to generate the target adjustment coefficient matrix of the original image.

[0084] Among them, the image quality parameters include at least one of brightness, saturation, contrast, hue, and color temperature.

[0085] Correspondingly, the preset adjustment parameter matrix includes at least one of a first preset adjustment coefficient matrix for brightness adjustment, a second preset adjustment coefficient matrix for saturation adjustment, a third preset adjustment coefficient matrix for contrast adjustment, a fourth preset adjustment coefficient matrix for hue adjustment, and a fifth preset adjustment coefficient matrix for color temperature adjustment.

[0086] Among them, the first preset adjustment coefficient matrix M1 is as follows:

[0087]

[0088] Among them, M1 is a 3×3 diagonal matrix, and the matrix elements outside the diagonal in M1 are all 0. In response to the picture quality parameter adjustment operation, the electronic device adjusts the matrix element in the first row and first column of M1 (i.e., the preset brightness matrix element), and then the target adjustment coefficient matrix of the first preset adjustment coefficient matrix (i.e., the first target adjustment coefficient matrix) can be obtained.

[0089] The second preset adjustment coefficient matrix M2 is shown as follows:

[0090]

[0091] Among them, M2 is also a 3×3 diagonal matrix, and the matrix elements except the diagonal in M2 are all set to 0. In response to the picture quality parameter adjustment operation, the electronic device adjusts the matrix element in the second row and second column of M2 (i.e., the preset saturation matrix element) and the matrix element in the third row and third column of M2 (i.e., the preset saturation matrix element), and then the target adjustment coefficient matrix of the second preset adjustment coefficient matrix (i.e., the second target adjustment coefficient matrix) can be obtained.

[0092] The third preset adjustment coefficient matrix M3 is shown as follows:

[0093]

[0094] Among them, M3 is also a 3×3 diagonal matrix, and the matrix elements outside the diagonal in M3 are all 0. In response to the picture quality parameter adjustment operation, the electronic device adjusts the matrix element on the diagonal of M3 (i.e., the preset contrast matrix element), and then the target adjustment coefficient matrix of the third preset adjustment coefficient matrix (i.e., the third target adjustment coefficient matrix) can be obtained.

[0095] The fourth preset adjustment coefficient matrix M4 is shown as follows:

[0096]

[0097] Among them, M4 is also a 3×3 matrix. In response to the picture quality parameter adjustment operation, the electronic device adjusts the matrix elements except those in the first row and first column of M4 (i.e., the preset hue matrix elements), and then the target adjustment coefficient matrix of the fourth preset adjustment coefficient matrix (i.e., the fourth target adjustment coefficient matrix) can be obtained.

[0098] The fifth preset adjustment coefficient matrix M5 is shown as follows:

[0099]

[0100] Among them, M5 is also a 3×3 diagonal matrix, and the matrix elements outside the diagonal in M5 are all 0. In response to the picture quality parameter adjustment operation, the electronic device adjusts the matrix elements on the diagonal in M5 (i.e., the preset color temperature matrix elements), and then the target adjustment coefficient matrix of the fifth preset adjustment coefficient matrix (i.e., the fifth target adjustment coefficient matrix) can be obtained.

[0101] It can be understood that corresponding initial values can be preset for the adjustable matrix elements in each of the above preset adjustment coefficient matrices.

[0102] Such as Figure 3 As shown, the above step S202 can be implemented at least through the following steps:

[0103] S301, in response to the picture quality parameter adjustment operation, obtain the adjustment values of each picture quality parameter of the original image.

[0104] Among them, the above adjustment values include: brightness adjustment value, saturation adjustment value, contrast adjustment value, hue adjustment value, color temperature adjustment value.

[0105] For example, after the electronic device obtains the original image, its display interface displays a "picture quality parameter adjustment" panel, and the user inputs or selects the adjustment values of each picture quality parameter in the "picture quality parameter adjustment" panel.

[0106] For another example, each preset adjustment coefficient matrix is displayed in the above "picture quality parameter adjustment" panel. For each displayed preset adjustment coefficient matrix, the user can click to modify the matrix elements to input or select the corresponding adjustment values.

[0107] S302, adjust the preset brightness matrix elements in the first preset adjustment coefficient matrix according to the brightness adjustment value to obtain the first target adjustment coefficient matrix.

[0108] The first target adjustment coefficient matrix M1′ is as follows:

[0109]

[0110] Among them, Bright′ is Bright adjusted according to the brightness adjustment value.

[0111] S303, adjust the preset saturation matrix elements in the second preset adjustment coefficient according to the saturation adjustment value to obtain the second target adjustment coefficient matrix.

[0112] The second target adjustment coefficient matrix M2′ is as follows:

[0113]

[0114] Among them, Saturation′ is Saturation adjusted according to the saturation adjustment value.

[0115] S304. Adjust the preset contrast matrix elements in the third preset adjustment coefficient according to the contrast adjustment value to obtain a third target adjustment coefficient matrix.

[0116] The third target adjustment coefficient matrix M3′ is shown as follows:

[0117]

[0118] Among them, Contrast′ is the Contrast adjusted according to the saturation adjustment value.

[0119] S305. Adjust the preset hue matrix elements in the fourth preset adjustment coefficient according to the hue adjustment value to obtain a fourth target adjustment coefficient matrix.

[0120] The fourth target adjustment coefficient matrix M4′ is shown as follows:

[0121]

[0122] Among them, hue′ is the hue adjusted according to the hue adjustment value.

[0123] S306. Adjust the preset color temperature matrix elements in the fifth preset adjustment coefficient according to the color temperature adjustment value to obtain a fifth target adjustment coefficient matrix.

[0124] The fifth target adjustment coefficient matrix M5′ is shown as follows:

[0125]

[0126] Among them, CAIN_R′ is the GAIN_R adjusted according to the color temperature adjustment value.

[0127] It can be understood that the above steps S302 - S306 can be executed simultaneously or sequentially, and no specific limitation is imposed on the execution order of S302 - S306 above.

[0128] In the embodiments of the present application, a preset adjustment coefficient matrix for each picture quality parameter is set in advance. Based on the user's operation (i.e., the picture quality parameter adjustment operation), the electronic device can automatically adjust each preset adjustment coefficient matrix according to the picture quality parameter adjustment operation, so as to obtain the corresponding target adjustment coefficient matrix, improving the user experience.

[0129] S203. Convert the original image to the first color space to obtain first image data.

[0130] The electronic device converts the original image from the red - green - blue color space to the first color space to obtain first image data.

[0131] Among them, the first color space is the YUV color space; the first image data is used to represent the Y value, U value, and V value of each pixel of the original image in the first color space.

[0132] In some optional embodiments, as Figure 4 shown, the above step S203 can be implemented at least through the following steps:

[0133] S401, obtain the image type of the original image.

[0134] Among them, the image type is represented by Color Range and conversion standard. As can be seen above, Color Range includes: Full Range, Limited Range. The conversion standard includes at least: BT601, BT709, BT2020.

[0135] Therefore, the above image types can at least include: Full Range - BT601, Full Range - BT709, Full Range - BT2020, Limited Range - BT601, Limited Range - BT709, Limited Range - BT2020.

[0136] S402, query the preset matrix database, and obtain the spatial conversion matrix corresponding to the original image according to the image type.

[0137] A corresponding matrix database (i.e., the preset matrix database) is preset, and the preset matrix database stores the spatial conversion matrix (hereinafter referred to as the first spatial conversion matrix for convenience of description) corresponding to each image type for converting from the red - green - blue color space to the first color space.

[0138] In the embodiments of the present application, after the electronic device obtains the image type of the original image, it queries in the preset matrix database according to the image type, so as to determine the spatial conversion matrix corresponding to the original image.

[0139] Among them, if the image type is Full Range - BT601, its first spatial conversion matrix M6[1] is as follows:

[0140]

[0141] If the image type is Full Range - BT709, its first spatial conversion matrix M6[2] is as follows:

[0142]

[0143] If the image type is Full Range - BT2020, its first spatial transformation matrix M6[3] is as follows:

[0144]

[0145] If the image type is Limited Range - BT601, its first spatial transformation matrix M6[4] is as follows:

[0146]

[0147] If the image type is Limited Range - B709, its first spatial transformation matrix M6[5] is as follows:

[0148]

[0149] If the image type is Limited Range - BT2020, its first spatial transformation matrix M6[6] is as follows:

[0150]

[0151] S403. Based on the spatial transformation matrix, convert the original image to the first color space to obtain the first image data.

[0152] The electronic device converts the original image to the first color space according to the spatial transformation matrix corresponding to the original image to obtain the first image data.

[0153] It can be understood that step S202 can be executed first and then step S203, or step S203 can be executed first and then step S202, or step S202 and step S203 can be executed synchronously. There is no specific limitation in the embodiments of this application.

[0154] S204. Based on each target adjustment coefficient matrix, perform image quality adjustment on the first image data to obtain the target image data.

[0155] After obtaining the target adjustment coefficient matrix, the electronic device performs image quality adjustment on the first image data to obtain the target image data after image quality adjustment.

[0156] In some alternative embodiments, the target adjustment coefficient matrix includes at least one of: a first target adjustment coefficient matrix, a second target adjustment coefficient matrix, a third target adjustment coefficient matrix, a fourth target adjustment coefficient matrix, and a fifth target adjustment coefficient matrix; the first target adjustment coefficient matrix is a luminance coefficient matrix for luminance adjustment; the second target adjustment coefficient matrix is a saturation coefficient matrix for saturation adjustment; the third target adjustment coefficient matrix is a contrast coefficient matrix for contrast adjustment; the fourth target adjustment coefficient matrix is a hue coefficient matrix for hue adjustment; and the fifth target adjustment coefficient matrix is a color temperature coefficient matrix for color temperature adjustment.

[0157] In some alternative embodiments, as Figure 5 shown, step S204 can be implemented by at least the following steps:

[0158] S501, perform luminance adjustment on the first image data according to the first target adjustment coefficient matrix to obtain second image data.

[0159] Specifically, multiply the first target adjustment coefficient matrix by the YUV matrix of each pixel, that is, perform luminance adjustment on the pixel to obtain second image data, as shown in the following formula:

[0160]

[0161] S502, perform saturation adjustment on the second image data according to the second target adjustment coefficient matrix to obtain third image data.

[0162] Specifically, multiply the third target adjustment coefficient matrix by the YUV matrix of each pixel, that is, perform saturation adjustment on the pixel to obtain third image data, as shown in the following formula:

[0163]

[0164] S503, perform contrast adjustment on the third image data according to the third target adjustment coefficient matrix to obtain fourth image data.

[0165] Specifically, multiply the third target adjustment coefficient matrix by the YUV matrix of each pixel, that is, perform contrast adjustment on the pixel to obtain fourth image data, as shown in the following formula:

[0166]

[0167] S504, perform hue adjustment on the fourth image data according to the fourth target adjustment coefficient matrix to obtain fifth image data.

[0168] Specifically, multiplying the fourth target adjustment coefficient matrix by the YUV matrix of each pixel realizes the hue adjustment of the pixel to obtain the fifth image data, as shown in the following formula:

[0169]

[0170]

[0171] S505. Based on the fifth target adjustment coefficient matrix, perform color temperature adjustment on the fifth image data to obtain the target image data.

[0172] Furthermore, in step S505, the fifth image data can be first converted to the RGB color space to obtain the sixth image data; according to the fifth target adjustment coefficient matrix, perform color temperature adjustment on the sixth image data to obtain the target image data.

[0173] Among them, multiplying the fifth target adjustment coefficient matrix by the YUV matrix of each pixel realizes the color temperature adjustment of the pixel to obtain the target image data, as shown in the following formula:

[0174]

[0175] In the embodiment of the present application, the space conversion matrix for converting from the first color space to the RGB color space is still determined according to the image type of the original image (for the convenience of description, hereinafter referred to as the second space conversion matrix).

[0176] If the image type is Full Range - BT601, its second space conversion matrix M7[1] is as follows:

[0177]

[0178] If the image type is Full Range - BT709, its space conversion matrix M7[2] is as follows:

[0179]

[0180] If the image type is Full Range - BT2020, its space conversion matrix M7[3] is as follows:

[0181]

[0182] If the image type is Limited Range - BT601, its space conversion matrix M7[4] is as follows:

[0183]

[0184] If the image type is Limited Range - B709, its spatial transformation matrix M7[5] is as follows:

[0185]

[0186] If the image type is Limited Range - BT2020, its spatial transformation matrix M7[6] is as follows:

[0187]

[0188] In some alternative embodiments, each target adjustment coefficient matrix can be used to adjust the first image data respectively to obtain multiple processed first image data, and target image data can be generated based on all the processed first image data.

[0189] S205, send the target image data to the FPGA chip, and process the target image data through this FPGA chip to generate the target image of the original image.

[0190] In some alternative embodiments, call the FPGA chip, and send the target image data and a preset offset matrix to the FPGA chip. By processing the target image data and the preset offset matrix through the FPGA chip to generate the target image of the original image, the accuracy of generating the target image can be improved by processing the target image data and the preset offset matrix through the FPGA chip to generate the target image.

[0191] Specifically, process the target image data and the preset offset matrix according to the following formula:

[0192] OUT = M × In + M × OFFSET_IN + OFFSET_OUT.

[0193] OUT = M × In + OFFSET;

[0194] Among them, OUT represents the processing result, M represents the target adjustment coefficient matrix, M × In represents the target image data, and OFFSET is used to represent the preset offset matrix corresponding to the target adjustment coefficient matrix.

[0195] The image processing method provided by the embodiment of the present application adjusts the preset adjustment coefficient matrix corresponding to each image quality parameter of the original image in response to an image quality parameter adjustment operation, generates target image data of the original image, and sends the target image data to the FPGA chip for image processing. The FPGA chip can generate the target image of the original image based on the target image data. In this embodiment, when performing image quality adjustment during the CSC color space conversion, only by simply modifying the elements of the preset adjustment coefficient matrix, the target adjustment coefficient matrix can be obtained. Based on the target adjustment coefficient matrix, at most 8 matrix multiplications are required to obtain the target data matrix after image quality adjustment. Thus, when the FPGA chip performs image processing, it does not need to perform image quality adjustment processing, and only needs to perform a simple addition operation on the target image data and the preset offset matrix to generate the target image, which greatly saves the hardware resources of the FPGA, improves the efficiency of color space conversion, and improves the image output efficiency of the image output device.

[0196] As Figure 6 shown, Figure 6 FIG. is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application. The image processing apparatus includes:

[0197] An acquisition unit 610, configured to acquire an original image;

[0198] A parameter adjustment unit 620, configured to adjust the preset adjustment coefficient matrix corresponding to each image quality parameter of the original image in response to an image quality parameter adjustment operation, and generate a target adjustment coefficient matrix of the original image; the image quality parameters include: brightness, saturation, contrast, hue, and color temperature.

[0199] A space conversion unit 630, configured to convert the original image to a first color space to obtain first image data;

[0200] An image quality adjustment unit 640, configured to perform image quality adjustment on the first image data based on each target adjustment coefficient matrix to obtain target image data;

[0201] A sending unit 650, configured to send the target image data to a field programmable gate array chip, and process the target image data through the field programmable gate array chip to generate a target image of the original image.

[0202] In some optional embodiments, the target adjustment coefficient matrix includes at least one of a first target adjustment coefficient matrix, a second target adjustment coefficient matrix, a third target adjustment coefficient matrix, a fourth target adjustment coefficient matrix, and a fifth target adjustment coefficient matrix;

[0203] The first target adjustment coefficient matrix is a brightness coefficient matrix for brightness adjustment;

[0204] The second target adjustment coefficient matrix is the saturation coefficient matrix for saturation adjustment;

[0205] The third target adjustment coefficient matrix is the contrast coefficient matrix for contrast adjustment;

[0206] The fourth target adjustment coefficient matrix is the hue coefficient matrix for hue adjustment;

[0207] The fifth target adjustment coefficient matrix is the color temperature coefficient matrix for color temperature adjustment.

[0208] In some alternative embodiments, the image quality adjustment unit 640 is specifically configured to:

[0209] Adjust the brightness of the first image data according to the first target adjustment coefficient matrix to obtain second image data;

[0210] Adjust the saturation of the second image data according to the second target adjustment coefficient matrix to obtain third image data;

[0211] Adjust the contrast of the third image data according to the third target adjustment coefficient matrix to obtain fourth image data;

[0212] Adjust the hue of the fourth image data according to the fourth target adjustment coefficient matrix to obtain fifth image data;

[0213] Adjust the color temperature of the fifth image data based on the fifth target adjustment coefficient matrix to obtain target image data.

[0214] In some alternative embodiments, the image quality adjustment unit 640 is further specifically configured to:

[0215] Convert the fifth image data to the RGB color space to obtain sixth image data;

[0216] Adjust the color temperature of the sixth image data according to the fifth target adjustment coefficient matrix to obtain target image data.

[0217] In some alternative embodiments, converting the original image to the first color space to obtain the first image data includes:

[0218] Obtain the image type of the original image;

[0219] Query the preset matrix database, and obtain the space conversion matrix corresponding to the original image according to the image type;

[0220] Convert the original image to the first color space based on the space conversion matrix to obtain the first image data.

[0221] In some alternative embodiments, the preset adjustment coefficient matrix includes at least one of: a first preset adjustment coefficient matrix for brightness adjustment, a second preset adjustment coefficient matrix for saturation adjustment, a third preset adjustment coefficient matrix for contrast adjustment, a fourth preset adjustment coefficient matrix for hue adjustment, and a fifth preset adjustment coefficient matrix for color temperature adjustment;

[0222] The parameter adjustment unit 620 is specifically configured to:

[0223] In response to the image quality parameter adjustment operation, obtain the adjustment values of each image quality parameter of the original image; the adjustment values include: brightness adjustment value, saturation adjustment value, contrast adjustment value, hue adjustment value, and color temperature adjustment value;

[0224] Adjust the preset brightness matrix elements in the first preset adjustment coefficient matrix according to the brightness adjustment value to obtain a first target adjustment coefficient matrix;

[0225] Adjust the preset saturation matrix elements in the second preset adjustment coefficient according to the saturation adjustment value to obtain a second target adjustment coefficient matrix;

[0226] Adjust the preset contrast matrix elements in the third preset adjustment coefficient according to the contrast adjustment value to obtain a third target adjustment coefficient matrix;

[0227] Adjust the preset hue matrix elements in the fourth preset adjustment coefficient according to the hue adjustment value to obtain a fourth target adjustment coefficient matrix;

[0228] Adjust the preset color temperature matrix elements in the fifth preset adjustment coefficient according to the color temperature adjustment value to obtain a fifth target adjustment coefficient matrix.

[0229] In some alternative embodiments, the image processing device further includes:

[0230] A calling unit (not shown in the figure), configured to call a field programmable gate array chip, and send the preset offset matrix to the field programmable gate array chip, and process the target image and the preset offset matrix through the field programmable gate array chip to generate the target image of the original image.

[0231] An embodiment of the present invention further provides an electronic device, as Figure 7 shown, Figure 7 is a schematic structural diagram of an embodiment of the electronic device provided in the embodiments of the present application. The electronic device includes:

[0232] One or more processors;

[0233] A memory; and

[0234] One or more applications, wherein the one or more applications are stored in the memory and are configured to execute the steps in the image processing method described in any one of the above embodiments of the conference data processing device by the processor.

[0235] Specifically: The electronic device may include components such as a processor 701 with one or more processing cores, a memory 702 of one or more computer storage media, a power supply 703, and an input unit 704. Those skilled in the art can understand that Figure 7 The structure of the electronic device shown in does not constitute a limitation on the electronic device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0236] Wherein:

[0237] The processor 701 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 702, and by calling data stored in the memory 702, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor. Among them, the application processor mainly processes performance adjustment systems, user interfaces, and application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 701 either.

[0238] The memory 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area. Among them, the program storage area can store a performance adjustment system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the electronic device. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.

[0239] The electronic device further includes a power supply 703 for powering each component. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, so as to manage functions such as charging, discharging, and power consumption management through the power management system. The power supply 703 can also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.

[0240] The electronic device may further include an input unit 704, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0241] Although not shown, the electronic device may further include a display unit, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 701 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 will run the application programs for conference data processing stored in the memory 702; thereby realizing various functions as follows:

[0242] Obtain the original image;

[0243] In response to the image quality parameter adjustment operation, adjust the preset adjustment coefficient matrix corresponding to each image quality parameter of the original image to generate the target adjustment coefficient matrix of the original image; the image quality parameters include at least one of brightness, saturation, contrast, hue, and color temperature; and

[0244] Convert the original image to the first color space to obtain the first image data;

[0245] Based on each of the target adjustment coefficient matrices, perform image quality adjustment on the first image data to obtain the target image data;

[0246] Send the target image data to the field programmable gate array chip, and process the target image data through the field programmable gate array chip to generate the target image of the original image.

[0247] Therefore, an embodiment of the present invention provides a computer storage medium, which may include: read only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), a magnetic disk or an optical disc, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any one of the image processing methods provided by the embodiments of the present invention. For example, when the computer program is loaded by the processor, the following steps may be executed:

[0248] Obtain the original image;

[0249] In response to the image quality parameter adjustment operation, adjust the preset adjustment coefficient matrix corresponding to each image quality parameter of the original image to generate the target adjustment coefficient matrix of the original image; the image quality parameters include at least one of brightness, saturation, contrast, hue, and color temperature; and

[0250] Convert the original image to the first color space to obtain the first image data;

[0251] Based on each of the target adjustment coefficient matrices, perform image quality adjustment on the first image data to obtain the target image data;

[0252] Send the target image data to the field programmable gate array chip, and process the target image data through the field programmable gate array chip to generate the target image of the original image.

[0253] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the detailed descriptions of other embodiments above, and details will not be repeated here.

[0254] In specific implementation, the above units or structures can be implemented as independent entities, or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation of the above units or structures, reference can be made to the method embodiments above, and details will not be repeated here.

[0255] For the specific implementation of each of the above operations, reference can be made to the above embodiments, and details will not be repeated here.

[0256] The above has introduced in detail a conference data processing solution provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principles and implementation manners of the present invention. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. An image processing method, characterized in that, the method includes: obtaining an original image; responding to a picture quality parameter adjustment operation, adjusting a preset adjustment coefficient matrix corresponding to each picture quality parameter of the original image to generate a target adjustment coefficient matrix of the original image; the picture quality parameters include at least one of brightness, saturation, contrast, hue, and color temperature; and converting the original image to the YUV color space to obtain first image data; performing picture quality adjustment on the first image data based on each of the target adjustment coefficient matrices to obtain target image data; sending the target image data to a field programmable gate array chip, and processing the target image data through the field programmable gate array chip to generate a target image of the original image.

2. The image processing method according to claim 1, characterized in that, the target adjustment coefficient matrix includes at least one of a first target adjustment coefficient matrix, a second target adjustment coefficient matrix, a third target adjustment coefficient matrix, a fourth target adjustment coefficient matrix, and a fifth target adjustment coefficient matrix; the first target adjustment coefficient matrix is a brightness coefficient matrix for brightness adjustment; the second target adjustment coefficient matrix is a saturation coefficient matrix for saturation adjustment; the third target adjustment coefficient matrix is a contrast coefficient matrix for contrast adjustment; the fourth target adjustment coefficient matrix is a hue coefficient matrix for hue adjustment; the fifth target adjustment coefficient matrix is a color temperature coefficient matrix for color temperature adjustment.

3. The image processing method according to claim 2, characterized in that, the performing adjustment on the first image data based on each of the target adjustment coefficient matrices to obtain target image data includes: performing brightness adjustment on the first image data according to the first target adjustment coefficient matrix to obtain second image data; performing saturation adjustment on the second image data according to the second target adjustment coefficient matrix to obtain third image data; performing contrast adjustment on the third image data according to the third target adjustment coefficient matrix to obtain fourth image data; performing hue adjustment on the fourth image data according to the fourth target adjustment coefficient matrix to obtain fifth image data; performing color temperature adjustment on the fifth image data based on the fifth target adjustment coefficient matrix to obtain target image data.

4. The image processing method according to claim 3, characterized in that, the performing color temperature adjustment on the fifth image data based on the fifth target adjustment coefficient matrix to obtain target image data includes: converting the fifth image data to the red, green, and blue color space to obtain sixth image data; performing color temperature adjustment on the sixth image data according to the fifth target adjustment coefficient matrix to obtain target image data.

5. The image processing method according to claim 1, characterized in that, the converting the original image to the first color space to obtain first image data includes: obtaining the image type of the original image; querying a preset matrix database and obtaining a space conversion matrix corresponding to the original image according to the image type; Convert the original image to a first color space based on the spatial transformation matrix to obtain first image data.

6. The image processing method according to claim 1, wherein, the preset adjustment coefficient matrix includes at least one of: a first preset adjustment coefficient matrix for brightness adjustment, a second preset adjustment coefficient matrix for saturation adjustment, a third preset adjustment coefficient matrix for contrast adjustment, a fourth preset adjustment coefficient matrix for hue adjustment, and a fifth preset adjustment coefficient matrix for color temperature adjustment; responding to the image quality parameter adjustment operation, adjusting the preset adjustment coefficient matrix corresponding to each image quality parameter of the original image to generate a target adjustment coefficient matrix of the original image, including: responding to the image quality parameter adjustment operation, obtaining the adjustment values of each image quality parameter of the original image; the adjustment values include: brightness adjustment value, saturation adjustment value, contrast adjustment value, hue adjustment value, color temperature adjustment value; adjusting the preset brightness matrix elements in the first preset adjustment coefficient matrix according to the brightness adjustment value to obtain a first target adjustment coefficient matrix; and adjusting the preset saturation matrix elements in the second preset adjustment coefficient according to the saturation adjustment value to obtain a second target adjustment coefficient matrix; and adjusting the preset contrast matrix elements in the third preset adjustment coefficient according to the contrast adjustment value to obtain a third target adjustment coefficient matrix; and adjusting the preset hue matrix elements in the fourth preset adjustment coefficient according to the hue adjustment value to obtain a fourth target adjustment coefficient matrix; and adjusting the preset color temperature matrix elements in the fifth preset adjustment coefficient according to the color temperature adjustment value to obtain a fifth target adjustment coefficient matrix.

7. The image processing method according to claim 1, wherein, the method further includes: invoking the field programmable gate array chip, and sending a preset offset matrix to the field programmable gate array chip, and processing the target image and the preset offset matrix through the field programmable gate array chip to generate a target image of the original image.

8. An image processing apparatus, wherein, the image processing apparatus includes: an acquisition unit for acquiring an original image; a parameter adjustment unit for responding to an image quality parameter adjustment operation and adjusting the preset adjustment coefficient matrix corresponding to each image quality parameter of the original image to generate a target adjustment coefficient matrix of the original image; the image quality parameters include: brightness, saturation, contrast, hue, color temperature; and a spatial conversion unit for converting the original image to a first color space to obtain first image data; an image quality adjustment unit for performing image quality adjustment on the first image data based on each target adjustment coefficient matrix to obtain target image data; a sending unit for sending the target image data to the field programmable gate array chip, and processing the target image data through the field programmable gate array chip to generate a target image of the original image.

9. An electronic device, wherein, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the image processing method according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that the readable storage medium includes a computer program, and when the computer program runs, it controls the electronic device where the readable storage medium is located to execute the image processing method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Method for realizing color gamut conversion and image display based on field programmable gate array

    CN121393391A