Image parameter adjustment method, device, equipment and storage medium

By processing images with alpha channels, high-resolution images without alpha channels and high-resolution images with alpha channels are obtained, and fused, the problem of high computing resources and data costs in the prior art is solved, and efficient image parameter adjustment is achieved.

CN115147281BActive Publication Date: 2025-08-22东莞市步步高教育软件有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210859941.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-20
Publication Date
2025-08-22
Estimated Expiration
2042-07-20

AI Technical Summary

Technical Problem

The prior art requires a lot of computing resources and data costs and a lot of work when processing images with alpha channels.

Method used

By image processing on images with alpha channels, high-resolution images without alpha channels and high-resolution images with alpha channels were obtained, respectively, and fused to form target images, reducing dependence on drawing software and repeated design of super-resolution models.

Benefits of technology

Improve the efficiency of image parameter adjustment and save computing resources and data costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115147281B_ABST
    Figure CN115147281B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose an image parameter adjustment method, apparatus, device, and storage medium. The method comprises acquiring a first image, wherein the first image parameters corresponding to the first image include a first alpha channel parameter, a first resolution, and a first size; performing image processing on the first image to obtain a second image and a third image, wherein the second image parameters corresponding to the second image include a target resolution and a target size, and the third image parameters corresponding to the third image include a second alpha channel parameter, a second resolution, and the target size; performing image processing on the third image to extract the second alpha channel parameter; and performing fusion processing on the second alpha channel parameter and the second image to obtain the target image. The technical solution provided by the embodiments of the present application solves the problem of heavy workload, large computing resources, and data costs when adjusting image parameters, thereby improving the efficiency of image parameter adjustment.
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 image processing technology, and in particular to an image parameter adjustment method, apparatus, device, and storage medium. Background Art

[0002] With the popularization of terminal devices such as computers, tablets, and mobile phones and the continuous development of photography technology, more and more users use terminal devices to perform image processing to change image parameters, so as to convert the original image into a target image that meets people's daily work, life or study needs, such as adjusting the image resolution, size, etc.

[0003] Currently, when processing images with an alpha channel, the parameters of the image without the alpha channel are first reconstructed and then redrawn using drawing software. Alternatively, the current mainstream super-resolution model is redesigned to include an additional alpha channel and the alpha-channel images are processed as training samples. These processing methods are labor-intensive and require significant computational resources and data costs. Summary of the Invention

[0004] The embodiments of the present application provide an image parameter adjustment method, apparatus, device, and storage medium, which solve the problem of heavy workload, large amount of computing resources, and data costs when adjusting image parameters, thereby improving the efficiency of image parameter adjustment.

[0005] In a first aspect, an embodiment of the present application provides an image parameter adjustment method, comprising:

[0006] Acquire a first image, where first image parameters corresponding to the first image include a first alpha channel parameter, a first resolution, and a first size;

[0007] performing image processing on the first image to obtain a second image and a third image, wherein second image parameters corresponding to the second image include a target resolution and a target size, and third image parameters corresponding to the third image include a second alpha channel parameter, a second resolution, and the target size;

[0008] Performing image processing on the third image to extract the second alpha channel parameter;

[0009] The second alpha channel parameter and the second image are fused to obtain a target image.

[0010] Furthermore, performing image processing on the first image to obtain a second image includes:

[0011] performing alpha channel parameter removal processing on the first image to obtain a fourth image that does not include the alpha channel, wherein the fourth image has the same resolution and size as the first image;

[0012] Perform super-resolution processing on the fourth image to obtain the second image.

[0013] Furthermore, performing image processing on the first image to obtain a third image includes:

[0014] Performing image interpolation algorithm processing on the first image to obtain the third image.

[0015] Furthermore, performing super-resolution processing on the fourth image to obtain the second image includes:

[0016] determining a magnification factor according to the target size, and magnifying the fourth image according to the magnification factor to obtain a fifth image;

[0017] Determining a corresponding initial pixel point and a corresponding initial pixel value in the fifth image according to the initial pixel point and the corresponding initial pixel value in the fourth image;

[0018] Determining, based on an initial pixel point in the fifth image, pixel values ​​of pixels in a neighborhood corresponding to the initial pixel point;

[0019] Performing pixel correction processing according to the pixel value of the initial pixel point, the pixel values ​​of the pixels in the neighborhood corresponding to the initial pixel point, and the magnification factor to determine a second pixel value corresponding to the initial pixel point;

[0020] The fifth image is adjusted according to the second pixel value to obtain the second image.

[0021] Furthermore, the first image parameter also includes a first RGB parameter;

[0022] The performing an image interpolation algorithm on the first image to obtain the third image includes:

[0023] Obtaining a second RGB parameter based on multiplying the first RGB parameter by the first alpha channel parameter;

[0024] Perform image interpolation algorithm processing on the first image according to the second RGB parameters, and output a third image in RGB format after interpolation.

[0025] Furthermore, the obtaining of the second RGB parameter based on the multiplication of the first RGB parameter and the first alpha channel parameter includes:

[0026] Obtain a second R component, a second G component, and a second B component of a second RGB parameter based on multiplying the first R component, the first G component, and the first B component of the first RGB parameter by the first alpha channel parameter respectively;

[0027] The performing an image interpolation algorithm on the first image according to the second RGB parameter and outputting a third image in an interpolated RGB format includes:

[0028] In the first image, a current pixel is selected, and image data of a neighborhood of the current pixel is obtained;

[0029] interpolating the G component of each pixel in the GR row and the BG row in the neighborhood of the current pixel based on the second RGB parameters so that the size of the interpolated image is the target size, and outputting the interpolated third G component;

[0030] interpolating the B component and the R component of each pixel in the GR row in the neighborhood of the current pixel based on the third G component, interpolating the B component and the R component of each pixel in the BG row in the neighborhood of the current pixel based on the third G component, so that the size of the interpolated image is the target size, and outputting the interpolated third B component and third R component;

[0031] Based on the third G component, the third B component, and the third R component, the third image in the interpolated RGB format is output.

[0032] Furthermore, performing image processing on the third image to extract the second alpha channel parameter includes:

[0033] Perform alpha channel parameter extraction processing on the third G component, the third B component, and the third R component of the third image to obtain the second alpha channel parameter.

[0034] Furthermore, the fusing process of the second alpha channel parameter and the second image to obtain a target image includes:

[0035] fusing the second alpha channel parameters into the parameters of the second image to form target image parameters;

[0036] The corresponding target image is generated according to the target image parameters.

[0037] In a second aspect, an embodiment of the present application provides an image parameter adjustment device, comprising:

[0038] An image acquisition unit, configured to acquire a first image, wherein first image parameters corresponding to the first image include a first alpha channel parameter, a first resolution, and a first size;

[0039] a first processing unit, configured to perform image processing on the first image to obtain a second image and a third image, wherein second image parameters corresponding to the second image include a target resolution and a target size, and third image parameters corresponding to the third image include a second alpha channel parameter, a second resolution, and the target size;

[0040] a second processing unit, configured to perform image processing on the third image to extract the second alpha channel parameter;

[0041] The third processing unit is configured to perform fusion processing on the second alpha channel parameter and the second image to obtain a target image.

[0042] Furthermore, the first processing unit is further configured to perform alpha channel parameter removal processing on the first image to obtain a fourth image that does not contain an alpha channel, wherein the fourth image has the same resolution and size as the first image;

[0043] Perform super-resolution processing on the fourth image to obtain the second image.

[0044] Furthermore, the first processing unit is further configured to perform image interpolation algorithm processing on the first image to obtain the third image.

[0045] Furthermore, the first processing unit is further configured to determine a magnification factor according to the target size, and magnify the fourth image according to the magnification factor to obtain a fifth image;

[0046] Determining a corresponding initial pixel point and a corresponding initial pixel value in the fifth image according to the initial pixel point and the corresponding initial pixel value in the fourth image;

[0047] Determining, based on an initial pixel point in the fifth image, pixel values ​​of pixels in a neighborhood corresponding to the initial pixel point;

[0048] Performing pixel correction processing according to the pixel value of the initial pixel point, the pixel values ​​of the pixels in the neighborhood corresponding to the initial pixel point, and the magnification factor to determine a second pixel value corresponding to the initial pixel point;

[0049] The fifth image is adjusted according to the second pixel value to obtain the second image.

[0050] Furthermore, the first image parameter also includes a first RGB parameter;

[0051] The first processing unit is further configured to obtain a second RGB parameter based on multiplying the first RGB parameter by the first alpha channel parameter;

[0052] Perform image interpolation algorithm processing on the first image according to the second RGB parameters, and output a third image in RGB format after interpolation.

[0053] Furthermore, the first processing unit is further configured to obtain a second R component, a second G component, and a second B component of a second RGB parameter by multiplying the first alpha channel parameter by the first R component, the first G component, and the first B component of the first RGB parameter respectively;

[0054] The performing an image interpolation algorithm on the first image according to the second RGB parameter and outputting a third image in an interpolated RGB format includes:

[0055] In the first image, a current pixel is selected, and image data of a neighborhood of the current pixel is obtained;

[0056] interpolating the G component of each pixel in the GR row and the BG row in the neighborhood of the current pixel based on the second RGB parameters so that the size of the interpolated image is the target size, and outputting the interpolated third G component;

[0057] interpolating the B component and the R component of each pixel in the GR row in the neighborhood of the current pixel based on the third G component, interpolating the B component and the R component of each pixel in the BG row in the neighborhood of the current pixel based on the third G component, so that the size of the interpolated image is the target size, and outputting the interpolated third B component and third R component;

[0058] Based on the third G component, the third B component, and the third R component, the third image in the interpolated RGB format is output.

[0059] Furthermore, the second processing unit is further configured to perform alpha channel parameter extraction processing on the third G component, the third B component, and the third R component of the third image to obtain the second alpha channel parameter.

[0060] Furthermore, the third processing unit is further configured to fuse the second alpha channel parameters into the parameters of the second image to form target image parameters;

[0061] The corresponding target image is generated according to the target image parameters.

[0062] In a third aspect, an embodiment of the present application provides an image parameter adjustment device, including:

[0063] memory and one or more processors;

[0064] The memory is used to store one or more programs;

[0065] When the one or more programs are executed by the one or more processors, the one or more processors implement the image parameter adjustment method as described in the first aspect.

[0066] In a fourth aspect, an embodiment of the present application provides a storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform the image parameter adjustment method as described in the first aspect.

[0067] In an embodiment of the present application, a first image including a first alpha channel parameter, a first resolution, and a first size is processed to obtain a second image including a target resolution and a target size, and a third image including a second alpha channel parameter, a second resolution, and the target size. The third image is then processed to extract the second alpha channel parameter, and the second alpha channel parameter is fused with the second image to obtain a target image. By employing the above-described technical means, a first image including an alpha channel parameter is processed to obtain a second image including only target resolution and target size parameters without an alpha channel parameter, and a third image including both an alpha channel parameter and a target size parameter. The second image and the third image are fused to obtain a target image including the alpha channel parameter, the target resolution, and the target size. This achieves adjustment of image parameters including alpha channel parameters, improves the efficiency of image parameter adjustment including alpha channel parameters, and saves computing resources and data costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 This is a flow chart of an image parameter adjustment method provided by an embodiment of the present application;

[0069] Figure 2 is a schematic diagram of generating a second image from a first image provided by an embodiment of the present application;

[0070] Figure 3 is a schematic diagram of generating a third image from a first image provided by an embodiment of the present application;

[0071] Figure 4 is a schematic diagram of generating a target image from a second image and a third image provided by an embodiment of the present application;

[0072] Figure 5 This is a structural diagram of an image parameter adjustment device provided in an embodiment of the present application;

[0073] Figure 6It is a structural diagram of an image parameter adjustment device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solutions and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. It should also be noted that, for ease of description, only parts related to the present application, not all of the contents, are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0075] The image parameter adjustment method and apparatus provided herein are designed to adjust image parameters by processing a first image with alpha channel parameters to obtain a second image without alpha channel parameters but containing only target resolution and target size parameters, and a third image with alpha channel parameters and target size parameters. The second and third images are then fused to obtain a corresponding target image containing the alpha channel parameters, target resolution, and target size, thereby adjusting the image parameters with alpha channel parameters. This improves the efficiency of image parameter adjustment with alpha channel parameters and saves computing resources and data costs. Compared to traditional methods for adjusting image parameters with alpha channel parameters, these methods typically reconstruct parameters of images without alpha channel parameters and then redraw them using drawing software; or redesign the current mainstream super-closed model to add an additional alpha channel and process the images with alpha channel as training samples, resulting in a large workload and requiring a large amount of computing resources and data costs. Based on this, the image parameter adjustment method of the present invention is provided to address the problem of large workload and the need for large amounts of computing resources and data costs when adjusting image parameters.

[0076] Figure 1A flowchart of an image parameter adjustment method provided in an embodiment of the present application is provided. The image parameter adjustment method provided in this embodiment can be performed by an image parameter adjustment device. The image parameter adjustment device can be implemented through software and / or hardware. The image parameter adjustment device can be composed of two or more physical entities, or a single physical entity. Generally speaking, the image parameter adjustment device can be a terminal device, such as a computer device.

[0077] The following computer device is used as an example to describe the subject of the image parameter adjustment method. Figure 1 , the image parameter adjustment method specifically includes:

[0078] S101: Acquire a first image, where first image parameters corresponding to the first image include a first alpha channel parameter, a first resolution, and a first size.

[0079] When adjusting image parameters, most of the time, low-resolution images are converted into high-resolution images. However, for low-resolution images with alpha channel parameters, it is not possible to directly perform super-resolution processing on low-resolution images with alpha channel parameters to obtain high-resolution images with alpha channel parameters. When converting low-resolution images with alpha channel parameters into high-resolution images with alpha channel parameters, the alpha channel parameters of the image are first removed, and then the parameters of the image without alpha channel parameters are reconstructed, and then the drawing software is used to redraw the image; or, the current mainstream super-closed model is redesigned to add an additional alpha channel, and the images with alpha channel are processed as training samples. The above two existing methods have a large workload, resulting in low efficiency in image parameter adjustment.

[0080] Before adjusting image parameters, it is necessary to obtain the corresponding image to be processed and the corresponding image parameters. This provides the adjustment target and parameter basis for subsequent image parameter adjustment. A first image to be adjusted and the corresponding first image parameters are obtained. The first image parameters corresponding to the first image include a first alpha channel parameter, a first resolution, and a first size. The first alpha channel parameter is a transparency channel parameter, meaning that the first image to be processed has a transparency channel parameter.

[0081] S102. Perform image processing on the first image to obtain a second image and a third image, wherein second image parameters corresponding to the second image include a target resolution and a target size, and third image parameters corresponding to the third image include a second alpha channel parameter, a second resolution, and the target size.

[0082] Since it is not possible to directly perform super-resolution processing on a low-resolution image with alpha channel parameters to obtain a high-resolution image with alpha channel parameters, it is necessary to perform image processing on the first image to obtain the corresponding second and third images, which serve as intermediate images in the subsequent fusion process to obtain the high-resolution image with alpha channel parameters. The second image is an image without alpha channel parameters, and the third image is an image with alpha channel parameters.

[0083] In one embodiment, a method for obtaining a second image based on a first image is provided. The first image is processed to remove alpha channel parameters to obtain a fourth image that does not include an alpha channel. In this case, the fourth image has the same resolution and size as the first image. After obtaining the fourth image that does not include an alpha channel, a target resolution and a target size are determined in corresponding target parameters based on actual needs. The fourth image that does not include an alpha channel is super-resolution processed based on the target resolution and target size to obtain a second image. The fourth image does not include an alpha channel, and the resolution and size of the fourth image are the same as those of the first image. Based on the fact that the fourth image does not include an alpha channel, super-resolution processing can be performed directly on the fourth image to obtain a second image with corresponding image parameters having the target resolution and target size. A preset target size can be used, and super-resolution processing can be performed on the fourth image based on the preset target size to obtain a corresponding second image that meets the target size.

[0084] Exemplarily, the first alpha channel parameters corresponding to the first image parameters may be deleted, or all the first alpha channel parameters may be set to 0, thereby removing the alpha channel parameters from the first image to obtain a fourth image without an alpha channel.

[0085] For example, Figure 2 This is a schematic diagram of generating a second image 20 from a first image provided by an embodiment of the present application, referring to Figure 2A first image 10 is obtained, where the corresponding dimensions of the first image 10 are length L1 and width W1, and the corresponding parameters of the first image 10 are the first alpha channel parameter A1, the first resolution R1, and the first size (L1, W1). The alpha channel parameters are removed from the first image 10 to obtain a fourth image 11 excluding the alpha channel. In this case, the resolution and dimensions of the fourth image 11 are the same as those of the first image 10, i.e., the corresponding dimensions of the fourth image 11 are length L1 and width W1. The fourth image parameters corresponding to the fourth image 11 include the first resolution R1 and the first size (L1, W1). After obtaining the fourth image 11 excluding the alpha channel, the target resolution R2 and target size (L2, W2) of the corresponding target parameters are determined according to actual requirements. The fourth image 11 excluding the alpha channel is super-resolution processed based on the target resolution R2 and target size (L2, W2) to obtain a second image 20, where the dimensions of the second image 20 are length L2 and width W2. The fourth image 11 does not include an alpha channel, and the resolution and size of the fourth image 11 are consistent with those of the first image 10. Since the fourth image 11 does not include an alpha channel, super-resolution processing can be performed directly on the fourth image 11 to obtain a second image 20 that also does not include an alpha channel. Therefore, the corresponding parameters of the second image 20 are the target resolution R2 and the target size (L2, W2).

[0086] In one embodiment, a method for obtaining a second image from a fourth image is provided. A target size is set according to actual needs, a magnification factor is determined based on the target size, and the fourth image is magnified based on the magnification factor to obtain a fifth image. Based on the initial pixel and the corresponding initial pixel value in the fourth image, the corresponding initial pixel and the corresponding initial pixel value in the fifth image are determined. Based on the initial pixel in the fifth image, the pixel values ​​of the pixels in the neighborhood corresponding to the initial pixel are determined. Correction processing is performed based on the pixel value of the initial pixel, the pixel values ​​of the pixels in the corresponding neighborhood, and the magnification factor to determine a second pixel value corresponding to the initial pixel, where the second pixel value is the pixel value corresponding to the initial pixel after super-resolution processing. Adjustment processing is performed on the fifth image based on the second pixel to obtain a second image with a higher resolution. By super-resolution processing the low-resolution, small-sized fourth image to obtain a corresponding second image with a higher resolution and a larger size, the enlarged image is made clearer, thereby ensuring that the processed second image meets the corresponding target resolution and target size requirements.

[0087] It should be noted that the above-mentioned initial pixel point does not refer to a single pixel point, but refers to several pixels points, or all the pixels points in the fourth image and the corresponding pixels points in the fifth image.

[0088] Exemplarily, the corresponding magnification factor is determined based on the ratio of the target size to the first size, where the magnification factor is the ratio of the target size to the first size. The number of initial pixels in the fourth image multiplied by the magnification factor equals the number of initial pixels in the fifth image. For example, if the resolution of the fourth image is a×b and the magnification factor is 2, then the resolution of the fifth image is A×B, where A is twice a and B is twice b, i.e., A=2a and B=2b. Assuming that the resolution of the fourth image is 100×100 and the magnification factor is 2, the resolution of the enlarged fifth image is 200×200. The position of the corresponding initial pixel in the fifth image is determined based on the position of the initial pixel in the fourth image. Assuming that the magnification factor is 2 and the coordinates of the initial pixel in the fourth image are (x, y), the coordinates of the corresponding initial pixel in the fifth image are (2x, 2y). Since the pixel values ​​corresponding to the fourth image are the same as those of the first image, the image parameters of the corresponding first image are known, and thus the pixel values ​​of all the initial pixels in the corresponding fourth image are known, the pixel values ​​of the corresponding initial pixels in the fifth image can be obtained. In the fifth image, the corresponding pixel points and the corresponding pixel values ​​in the neighborhood are determined based on each initial pixel point, wherein the pixel points in the neighborhood are the two left and right pixel points in the row direction and the two upper and lower pixel points in the column direction of the initial pixel point. Super-resolution processing is performed based on the pixel value of the initial pixel point and the pixel value of the corresponding pixel point in the neighborhood and the magnification to obtain the corresponding correction value. The super-resolution position corresponding to each initial pixel point in the fifth image is determined based on the correction value and the magnification, and the super-resolution position is the position in the corresponding fourth image. The pixel value corresponding to the super-resolution position in the fourth image is determined to be the second pixel value. The pixel value of each initial pixel point in the fifth image is adjusted to the corresponding second pixel value to obtain the second image. It should be noted that, for each initial pixel in the fifth image, the corresponding second pixel value can be obtained through the above-mentioned implementation method. During the adjustment process, the pixel values ​​corresponding to all pixel points in the fifth image are adjusted to the corresponding second pixel values ​​to obtain a second image with higher resolution.

[0089] In one embodiment, another implementation method for obtaining a second image from a fourth image is provided. The fourth image is input into a trained image super-resolution model to obtain a second image with the same target resolution and target size. The trained image super-resolution model is trained based on low-resolution sample images, high-resolution target-resolution sample images, and intermediate-resolution sample images. The intermediate-resolution image is obtained based on the low-resolution sample images and the target-resolution sample images, and the intermediate resolution lies between the corresponding low and high resolutions. The image super-resolution model can be obtained by training models including an SRCNN image super-resolution model, an EDSR image super-resolution model, or an SRGAN image super-resolution model. In this implementation, the fourth image without alpha channel parameters is input into the trained image super-resolution model, and the output corresponds to a second image without alpha channel parameters. Compared to existing super-resolution models that add an additional alpha channel and process images with alpha channels as training samples for image super-resolution model training, the image super-resolution model of this embodiment requires relatively fewer computational resources and data costs during training, thereby also achieving the technical effect of reducing workload and improving the efficiency of image parameter adjustment.

[0090] In one embodiment, a method for obtaining a third image based on a first image is provided. The third image is obtained by performing an image interpolation algorithm on the first image. Because the first image has alpha channel parameters, the image interpolation algorithm is performed on the first image to obtain a first image also having alpha channel parameters. The image to be parameter-adjusted is converted into an RGB format first image, so that the first image parameters also include first RGB parameters. Specifically, the image interpolation algorithm includes: multiplying the first RGB parameters by the first alpha channel parameters to obtain second RGB parameters, where the second RGB parameters include the corresponding first alpha channel parameters. Specifically, multiplying the first R component, first G component, and first B component of the first RGB parameters by the first alpha channel parameters to obtain second R components, second G components, and second B components of the second RGB parameters. In the first image, a current pixel is selected and image data for the current pixel's neighborhood is obtained. Based on the second RGB parameters, the G components of each pixel in the GR and BG rows of the current pixel's neighborhood are interpolated to achieve a target size for the interpolated image, and the interpolated third G component is output. The B and R components of each pixel in the GR row adjacent to the current pixel are interpolated based on the third G component. The B and R components of each pixel in the BG row adjacent to the current pixel are interpolated based on the third G component, so that the size of the interpolated image is the target size. The interpolated third B and third R components are output. The third G, third B, and third R components all include corresponding differenced alpha channel parameters. Based on the third G, third B, and third R components, an interpolated third image in RGB format is output. The second alpha channel parameter and the second resolution of the corresponding third image parameters can be obtained based on the output third image.

[0091] For example, Figure 3 This is a schematic diagram of generating a third image from a first image provided by an embodiment of the present application, referring to Figure 3, obtaining a first image 10, where the corresponding dimensions of the first image 10 are length L1 and width W1, and the corresponding parameters of the first image 10 are the first alpha channel parameter A1, the first resolution R1, and the first size (L1, W1). The first image 10 is processed using the above-mentioned specific image interpolation algorithm to obtain a corresponding third image 30. The corresponding dimensions of the third image 30 are the same as those of the second image 20, namely, the dimensions of the third image 30 are length L2 and width W2. Compared to the first image 10, the corresponding resolution and alpha channel parameters of the third image 30 obtained by the image interpolation algorithm are also changed. Therefore, the corresponding third image 30 parameters are the second alpha channel parameter A3, the second resolution R3, and the target size (L2, W2). When the image is enlarged, the second resolution R3 obtained by the image interpolation method of this embodiment is lower than the target resolution R2.

[0092] S103: Perform image processing on the third image to extract the second alpha channel parameter.

[0093] The above process yields a second image that meets the target resolution and target size requirements, and a third image with alpha channel parameters that meets the target size. By fusing these two images, a target image with alpha channel parameters that meets the target resolution and target size requirements can be obtained. Prior to fusion, the third image with alpha channel parameters that meets the target size is processed to extract the second alpha channel parameters for subsequent fusion.

[0094] In one embodiment, an implementation method for extracting alpha channel parameters is provided. Based on the above implementation process, it can be seen that the corresponding third G component, third B component, and third R component all include corresponding differenced alpha channel parameters. Therefore, alpha channel parameter extraction processing can be performed on the third G component, third B component, and third R component of the third image to obtain corresponding second alpha channel parameters. The second alpha channel parameters differ from the first alpha channel parameters because the image has been magnified and the resolution has been changed, thereby changing the corresponding alpha channel parameters.

[0095] S104: Perform fusion processing on the second alpha channel parameter and the second image to obtain a target image.

[0096] From the above, a second image without alpha channel parameters that meets the target resolution and target size requirements can be obtained, and the second alpha channel parameters corresponding to the third image with alpha channel parameters and meeting the target size are extracted. The second alpha channel parameters can be fused into the parameters of the second image to form target image parameters, and the corresponding target image can be generated according to the target image parameters.

[0097] For example, the corresponding second alpha channel parameter can be directly added to the corresponding second image parameter to adjust the transparency of the second image according to the second alpha channel parameter to obtain a target image. Alternatively, the corresponding second alpha channel parameter can be superimposed with the alpha channel parameter in the corresponding second image parameter to obtain a target alpha channel parameter, and the transparency of the second image can be adjusted according to the target alpha channel parameter to obtain the target image. It should be noted that because the second image does not contain an alpha channel parameter, the alpha channel parameter in the corresponding second image parameter is 0, and the obtained target alpha channel parameter is the second alpha channel parameter.

[0098] For example, Figure 4 This is a schematic diagram of generating a target image from a second image and a third image provided by an embodiment of the present application, with reference to Figure 4 From the above, a second image 20 without alpha channel parameters that meets the target resolution R2 and target size (L2, W2) requirements is obtained. The second alpha channel parameters A3 corresponding to the third image 30 with alpha channel parameters and meeting the target size (L2, W2) are also extracted. The second alpha channel parameters A3 can be fused with the parameters of the second image 20 to form the parameters of the target image 40. The corresponding target image 40 is generated based on the parameters of the target image 40. The corresponding dimensions of the target image 40 are a length of L2 and a width of W2. The corresponding target image parameters of the target image 40 are the second alpha channel parameters A3, the target resolution R2, and the target size (L2, W2). Through the above method, by obtaining the corresponding low-resolution first image 10 with alpha channel parameters and adjusting the corresponding image parameters, a corresponding high-resolution, large-size target image 40 with alpha channel parameters is obtained. This achieves effective adjustment of the image parameters of the image with alpha channel parameters, improves the efficiency of parameter adjustment, and reduces the workload of the parameter adjustment process.

[0099] Through the above implementation, a low-resolution first image with alpha channel parameters can be automatically adjusted to the corresponding image parameters to obtain a corresponding high-resolution, large-scale target image with alpha channel parameters, reducing the workload of redrawing with drawing software. Furthermore, the use of open datasets and open-source super-resolution processing models reduces development and data costs.

[0100] In the above, by performing image processing on a first image including a first alpha channel parameter, a first resolution, and a first size, a second image including a target resolution and a target size, and a third image including a second alpha channel parameter, a second resolution, and the target size are obtained. The third image is then image processed to extract the second alpha channel parameter, and the second alpha channel parameter is then fused with the second image to obtain the target image. Using the above technical means, image processing can be performed on a first image with alpha channel parameters to obtain a second image without alpha channel parameters but including only target resolution and target size parameters, and a third image with alpha channel parameters and target size parameters. The second image and the third image are then fused to obtain a target image including the alpha channel parameters, target resolution, and target size. This achieves adjustment of image parameters with alpha channel parameters, improves the efficiency of image parameter adjustment with alpha channel parameters, and saves computing resources and data costs.

[0101] Based on the above embodiments, Figure 5 This is a structural diagram of an image parameter adjustment device provided in an embodiment of the present application. Figure 5 The image parameter adjustment device provided in this embodiment specifically includes: an image acquisition unit 21, a first processing unit 22, a second processing unit 23 and a third processing unit 24.

[0102] The image acquisition unit 21 is configured to acquire a first image, wherein first image parameters corresponding to the first image include a first alpha channel parameter, a first resolution, and a first size;

[0103] a first processing unit 22 configured to perform image processing on the first image to obtain a second image and a third image, wherein second image parameters corresponding to the second image include a target resolution and a target size, and third image parameters corresponding to the third image include a second alpha channel parameter, a second resolution, and the target size;

[0104] A second processing unit 23 is configured to perform image processing on the third image to extract the second alpha channel parameter;

[0105] The third processing unit 24 is configured to perform fusion processing on the second alpha channel parameter and the second image to obtain a target image.

[0106] Furthermore, the first processing unit 22 is further configured to remove alpha channel parameters from the first image to obtain a fourth image without the alpha channel, wherein the fourth image has the same resolution and size as the first image.

[0107] Perform super-resolution processing on the fourth image to obtain the second image.

[0108] Furthermore, the first processing unit 22 is further configured to perform image interpolation algorithm processing on the first image to obtain the third image.

[0109] Furthermore, the first processing unit 22 is further configured to determine a magnification factor according to the target size, and magnify the fourth image according to the magnification factor to obtain a fifth image;

[0110] Determining a corresponding initial pixel point and a corresponding initial pixel value in the fifth image according to the initial pixel point and the corresponding initial pixel value in the fourth image;

[0111] Determining, based on an initial pixel point in the fifth image, pixel values ​​of pixels in a neighborhood corresponding to the initial pixel point;

[0112] Performing pixel correction processing according to the pixel value of the initial pixel point, the pixel values ​​of the pixels in the neighborhood corresponding to the initial pixel point, and the magnification factor to determine a second pixel value corresponding to the initial pixel point;

[0113] The fifth image is adjusted according to the second pixel value to obtain the second image.

[0114] Furthermore, the first image parameter also includes a first RGB parameter;

[0115] The first processing unit 22 is further configured to obtain a second RGB parameter based on multiplying the first RGB parameter by the first alpha channel parameter;

[0116] Perform image interpolation algorithm processing on the first image according to the second RGB parameters, and output a third image in RGB format after interpolation.

[0117] Furthermore, the first processing unit 22 is further configured to obtain a second R component, a second G component, and a second B component of a second RGB parameter by multiplying the first alpha channel parameter by the first R component, the first G component, and the first B component of the first RGB parameter respectively.

[0118] The performing an image interpolation algorithm on the first image according to the second RGB parameter and outputting a third image in an interpolated RGB format includes:

[0119] In the first image, a current pixel is selected, and image data of a neighborhood of the current pixel is obtained;

[0120] interpolating the G component of each pixel in the GR row and the BG row in the neighborhood of the current pixel based on the second RGB parameters so that the size of the interpolated image is the target size, and outputting the interpolated third G component;

[0121] interpolating the B component and the R component of each pixel in the GR row in the neighborhood of the current pixel based on the third G component, interpolating the B component and the R component of each pixel in the BG row in the neighborhood of the current pixel based on the third G component, so that the size of the interpolated image is the target size, and outputting the interpolated third B component and third R component;

[0122] Based on the third G component, the third B component, and the third R component, the third image in the interpolated RGB format is output.

[0123] Furthermore, the second processing unit 23 is further configured to perform alpha channel parameter extraction processing on the third G component, the third B component, and the third R component of the third image to obtain the second alpha channel parameter.

[0124] Furthermore, the third processing unit 24 is further configured to fuse the second alpha channel parameters into the parameters of the second image to form target image parameters;

[0125] The corresponding target image is generated according to the target image parameters.

[0126] In the above, by performing image processing on a first image including a first alpha channel parameter, a first resolution, and a first size, a second image including a target resolution and a target size, and a third image including a second alpha channel parameter, a second resolution, and the target size are obtained. The third image is then image processed to extract the second alpha channel parameter, and the second alpha channel parameter is then fused with the second image to obtain the target image. Using the above technical means, image processing can be performed on a first image with alpha channel parameters to obtain a second image without alpha channel parameters but including only target resolution and target size parameters, and a third image with alpha channel parameters and target size parameters. The second image and the third image are then fused to obtain a target image including the alpha channel parameters, target resolution, and target size. This achieves adjustment of image parameters with alpha channel parameters, improves the efficiency of image parameter adjustment with alpha channel parameters, and saves computing resources and data costs.

[0127] The image parameter adjustment device provided in the embodiment of the present application can be used to execute the image parameter adjustment method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0128] The present application embodiment provides an image parameter adjustment device, referring to Figure 6 The image parameter adjustment device includes: a processor 31, a memory 32, a communication module 33, an input device 34, and an output device 35. The number of processors in the image parameter adjustment device can be one or more, and the number of memories in the image parameter adjustment device can be one or more. The processor, memory, communication module, input device, and output device of the image parameter adjustment device can be connected via a bus or other means.

[0129] The memory 32 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and modules, such as the program instructions / modules corresponding to the image parameter adjustment method described in any embodiment of the present application (for example, the image acquisition unit, the first processing unit, the second processing unit, and the third processing unit in the image parameter adjustment device). The memory may mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and an application required for at least one function; the data storage area can store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include a memory remotely located relative to the processor, and these remote memories can be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0130] The communication module 33 is used for data transmission.

[0131] The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory, that is, implements the above-mentioned image parameter adjustment method.

[0132] The input device 34 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 35 may include a display device such as a display screen.

[0133] The image parameter adjustment device provided above can be used to execute the image parameter adjustment method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0134] An embodiment of the present application also provides a storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform an image parameter adjustment method, the image parameter adjustment method comprising: acquiring a first image, wherein first image parameters corresponding to the first image include a first alpha channel parameter, a first resolution, and a first size; performing image processing on the first image to obtain a second image and a third image, wherein second image parameters corresponding to the second image include a target resolution and a target size, and third image parameters corresponding to the third image include a second alpha channel parameter, a second resolution, and the target size; performing image processing on the third image to extract the second alpha channel parameter; and performing fusion processing on the second alpha channel parameter and the second image to obtain a target image.

[0135] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROMs, floppy disks, or tape drives; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or it may be located in a different second computer system that is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that can be executed by one or more processors.

[0136] Of course, the computer executable instructions of the storage medium storing computer executable instructions provided in the embodiment of the present application are not limited to the image parameter adjustment method described above, and can also execute related operations in the image parameter adjustment method provided in any embodiment of the present application.

[0137] The image parameter adjustment device, storage medium and image parameter adjustment equipment provided in the above embodiments can execute the image parameter adjustment method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the image parameter adjustment method provided in any embodiment of the present application.

[0138] The above are only preferred embodiments of the present application and the technical principles employed. The present application is not limited to the specific embodiments described herein, and any obvious changes, readjustments, and substitutions that are apparent to those skilled in the art will not depart from the scope of protection of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present application. The scope of the present application is determined by the scope of the claims.

Claims

1. A method for adjusting image parameters, characterized in that: include: Acquire a first image, where first image parameters corresponding to the first image include a first alpha channel parameter, a first resolution, and a first size; performing alpha channel parameter removal processing on the first image to obtain a fourth image that does not include the alpha channel, wherein the fourth image has the same resolution and size as the first image; performing super-resolution processing on the fourth image to obtain a second image, wherein second image parameters corresponding to the second image include a target resolution and a target size, the target resolution is greater than the first resolution, and the target size is greater than the first size; performing an image interpolation algorithm on the first image to obtain a third image, wherein third image parameters corresponding to the third image include a second alpha channel parameter, a second resolution, and the target size, the second resolution is smaller than the target resolution, and the second alpha channel parameter has a different parameter value from the first alpha channel parameter; Performing image processing on the third image to extract the second alpha channel parameter; The second alpha channel parameter and the second image are fused to obtain a target image.

2. The method according to claim 1, characterized in that The performing super-resolution processing on the fourth image to obtain the second image includes: determining a magnification factor according to the target size, and magnifying the fourth image according to the magnification factor to obtain a fifth image; Determining a corresponding initial pixel point and a corresponding initial pixel value in the fifth image according to the initial pixel point and the corresponding initial pixel value in the fourth image; Determining, based on an initial pixel point in the fifth image, pixel values ​​of pixels in a neighborhood corresponding to the initial pixel point; Performing pixel correction processing according to the pixel value of the initial pixel point, the pixel values ​​of the pixels in the neighborhood corresponding to the initial pixel point, and the magnification factor to determine a second pixel value corresponding to the initial pixel point; The fifth image is adjusted according to the second pixel value to obtain the second image.

3. The method according to claim 1, characterized in that The first image parameter also includes a first RGB parameter; The performing an image interpolation algorithm on the first image to obtain the third image includes: Obtaining a second RGB parameter based on multiplying the first RGB parameter by the first alpha channel parameter; Perform image interpolation algorithm processing on the first image according to the second RGB parameters, and output a third image in RGB format after interpolation.

4. The method according to claim 3, characterized in that The obtaining of the second RGB parameter based on multiplying the first RGB parameter and the first alpha channel parameter includes: Obtain a second R component, a second G component, and a second B component of a second RGB parameter based on multiplying the first R component, the first G component, and the first B component of the first RGB parameter by the first alpha channel parameter respectively; The performing an image interpolation algorithm on the first image according to the second RGB parameter and outputting a third image in an interpolated RGB format includes: In the first image, a current pixel is selected, and image data of a neighborhood of the current pixel is obtained; interpolating the G component of each pixel in the GR row and the BG row in the neighborhood of the current pixel based on the second RGB parameters so that the size of the interpolated image is the target size, and outputting the interpolated third G component; interpolating the B component and the R component of each pixel in the GR row in the neighborhood of the current pixel based on the third G component, interpolating the B component and the R component of each pixel in the BG row in the neighborhood of the current pixel based on the third G component, so that the size of the interpolated image is the target size, and outputting the interpolated third B component and third R component; Based on the third G component, the third B component, and the third R component, the third image in the interpolated RGB format is output.

5. The method according to claim 4, characterized in that The performing image processing on the third image to extract the second alpha channel parameter includes: Perform alpha channel parameter extraction processing on the third G component, the third B component, and the third R component of the third image to obtain the second alpha channel parameter.

6. The method according to claim 5, characterized in that The fusing the second alpha channel parameter and the second image to obtain a target image includes: fusing the second alpha channel parameters into the parameters of the second image to form target image parameters; The corresponding target image is generated according to the target image parameters.

7. An image parameter adjustment device, characterized in that: include: An image acquisition unit, configured to acquire a first image, wherein first image parameters corresponding to the first image include a first alpha channel parameter, a first resolution, and a first size; a first processing unit, configured to perform alpha channel parameter removal processing on the first image to obtain a fourth image without the alpha channel, wherein the fourth image has the same resolution and size as the first image; performing super-resolution processing on the fourth image to obtain a second image, wherein second image parameters corresponding to the second image include a target resolution and a target size, the target resolution is greater than the first resolution, and the target size is greater than the first size; The first processing unit is further configured to perform an image interpolation algorithm on the first image to obtain a third image, wherein third image parameters corresponding to the third image include a second alpha channel parameter, a second resolution, and the target size, the second resolution is smaller than the target resolution, and the second alpha channel parameter and the first alpha channel parameter have different parameter values; a second processing unit, configured to perform image processing on the third image to extract the second alpha channel parameter; The third processing unit is configured to perform fusion processing on the second alpha channel parameter and the second image to obtain a target image.

8. An image parameter adjustment device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A storage medium storing computer executable instructions, characterized in that: When the computer executable instructions are executed by a processor, they are used to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Text image super-resolution method

    CN110415176A

  • Enhanced image and video super-resolution processing

    US20110037894A1