Image generation method and device and storage medium

By performing downsampling and blurring processing based on pixel points of the first image in image processing, the target image is generated, and the problem of excessive computing and memory requirements of image processing algorithms on terminal devices in the prior art is solved, thereby achieving efficient image processing and better blurring effects.

CN120020859APending Publication Date: 2025-05-20BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311541004.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2025-05-20

AI Technical Summary

Technical Problem

Due to the large amount of computing and high memory demands, existing image processing algorithms are difficult to widely use on terminal devices, especially in real-time image processing.

Method used

By acquiring the first image, M second pixel points are determined based on the N first pixel points in the first image, a second image is obtained, and a blurring process is performed. Finally, N third pixel points are determined based on the processed second pixel points, and a target image is generated.

Benefits of technology

This method saves calculation and storage space during image processing, improves processing efficiency, and due to the saving of calculation, more complex fuzzy algorithms can be used to improve the blur effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120020859A_ABST
    Figure CN120020859A_ABST
Patent Text Reader

Abstract

The invention relates to an image generation method and device and a storage medium. The image generation method comprises the steps of obtaining a first image; m second pixel points are determined based on N first pixel points in the first image, M and N are positive integers, and M is smaller than N; based on the M second pixel points, a second image is obtained, and the second image comprises the M second pixel points; performing fuzzy processing on the second image; determining N third pixel points based on second pixel points in the second image after fuzzy processing; and taking an image comprising the N third pixel points as a target image. In the image processing process, the calculation amount and the storage space are saved, and the efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Currently, image processing, especially real-time image processing, has been widely studied. Due to their large computational complexity and high memory requirements, many image processing algorithms cannot be widely applied to terminals. Summary of the Invention

[0003] To overcome the problems in the related art, the present disclosure provides an image generation method, apparatus, and storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image generation method, including: obtaining a first image; determining M second pixel points based on N first pixel points in the first image to obtain a second image, where both M and N are positive integers, and M is less than N; performing blurring processing on the second image; determining N third pixel points based on the second pixel points after blurring processing; and using the image including the N third pixel points as a target image.

[0005] In an embodiment, the determining M second pixel points based on N first pixel points in the first image includes: determining pixel values of the M second pixel points based on pixel values of the N first pixel points in the first image.

[0006] In an embodiment, the determining pixel values of the M second pixel points based on pixel values of the N first pixel points in the first image includes: determining M pixel average values based on the pixel values of the N first pixel points; and using the M pixel average values as pixel values of the M second pixel points respectively.

[0007] In an embodiment, the determining pixel values of the M second pixel points based on pixel values of the N first pixel points in the first image includes: determining a weight coefficient for each of the N first pixel points in the first image; determining M pixel weighted average values based on the weight coefficients and the pixel values of the N first pixel points in the first image; and using the M pixel weighted average values as pixel values of the M second pixel points respectively.

[0008] In an embodiment, each of the second pixel points corresponds to a fourth pixel point in the first image, and the determining a weight coefficient for each of the N first pixel points in the first image includes: determining the weight coefficients for the N first pixel points respectively based on distances between the N first pixel points and the fourth pixel point; where the greater the distance, the smaller the weight coefficient.

[0009] In one embodiment, determining M second pixel points based on N first pixel points in the first image includes: determining a first intermediate pixel point based on a plurality of first pixel points in the vertical direction in the first image; and determining the second pixel points based on a plurality of the first intermediate pixel points in the horizontal direction.

[0010] According to a second aspect of the embodiments of the present disclosure, there is provided an image generation device, including: an acquisition module configured to acquire a first image; a determination module configured to determine M second pixel points based on N first pixel points in the first image, where both M and N are positive integers and M is less than N; a processing module configured to obtain a second image based on the M second pixel points, the second image including the M second pixel points; performing blurring processing on the second image; the determination module is further configured to determine N third pixel points based on the second pixel points after the blurring processing; and the processing module is further configured to use the image including the N third pixel points as a target image.

[0011] In one embodiment, the determination module determines M second pixel points based on N first pixel points in the first image in the following manner: determining the pixel values of the M second pixel points based on the pixel values of the N first pixel points in the first image.

[0012] In one embodiment, the determination module determines the pixel values of the M second pixel points based on the pixel values of the N first pixel points in the first image in the following manner: determining M pixel average values based on the pixel values of the N first pixel points; and respectively using the M pixel average values as the pixel values of the M second pixel points.

[0013] In one embodiment, the determination module determines the pixel values of the M second pixel points based on the pixel values of the N first pixel points in the first image in the following manner: determining a weight coefficient for each of the N first pixel points in the first image; determining M pixel weighted average values based on the weight coefficients and the pixel values of the N first pixel points in the first image; and respectively using the M pixel weighted average values as the pixel values of the M second pixel points.

[0014] In one embodiment, each second pixel point corresponds to a fourth pixel point in the first image, and the determination module determines the weight coefficient for each of the N first pixel points in the first image in the following manner: respectively determining the weight coefficients of the N first pixel points based on the distances between the N first pixel points and the fourth pixel point; where the greater the distance, the smaller the weight coefficient.

[0015] In one embodiment, the determining module determines M second pixel points based on N first pixel points in the first image in the following manner: determining a first intermediate pixel point based on a plurality of first pixel points in the vertical direction in the first image; and determining the second pixel point based on a plurality of first intermediate pixel points in the horizontal direction.

[0016] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a memory for storing instructions; and a processor for calling the instructions stored in the memory to execute the image generation method according to the first aspect and any one of the embodiments of the first aspect.

[0017] According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium storing instructions, which when executed by a processor, execute the image generation method according to the first aspect or any one of the embodiments of the first aspect.

[0018] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: By obtaining a first image, determining M second pixel points based on N first pixel points in the first image to obtain a second image composed of M second pixel points, where M is less than N. And performing blurring processing on the second image, and determining N third pixel points based on the second pixel points in the second image after the processing is completed to obtain a target image, so as to save computational amount and storage space during the image processing process and improve efficiency. Moreover, since the present disclosure can save the computational amount, a more complex blurring algorithm can be used to improve the blurring effect.

[0019] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure and, together with the specification, are used to explain the principles of the present disclosure.

[0021] Figure 1 is a flowchart of an image generation method shown according to an exemplary embodiment.

[0022] Figure 2 is a flowchart of a pixel value determination method shown according to an exemplary embodiment.

[0023] Figure 3 is a flowchart of a pixel value determination method shown according to an exemplary embodiment.

[0024] Figure 4 is a flowchart of a second image determination method shown according to an exemplary embodiment.

[0025] Figure 5Schematic diagram of transforming a first pixel point into a second pixel point shown according to an exemplary example.

[0026] Figure 6 Flowchart of an image generation method shown according to an exemplary embodiment.

[0027] Figure 7 Schematic diagram of a first image to a ninth image shown according to an exemplary embodiment.

[0028] Figure 8 Block diagram of an image generation device shown according to an exemplary embodiment.

[0029] Figure 9 Block diagram of an image generation device shown according to an exemplary embodiment. Detailed implementation

[0030] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure.

[0031] Currently, image processing, especially real-time image processing, has been widely studied. Due to their large computational complexity and high memory requirements, many image processing algorithms cannot be widely applied to terminals. Taking Gaussian blur as an example, Gaussian blur is a versatile image processing technique that can improve image quality, graphic design, artistic effects, and visual perception by reducing image details and noise. Gaussian blur is widely used in the field of image processing, mainly applied to aspects such as noise reduction, image smoothing, preprocessing for edge detection, depth-of-field effect, and privacy protection. Gaussian blur can be used to create a blurred or soft image display effect. By blurring the background, on the one hand, it can highlight the foreground elements of the application to improve readability, and on the other hand, it can hide sensitive information, enriching the aesthetics and privacy of the human-computer interaction interface of mobile devices. Therefore, it is of great significance to achieve an efficient and real-time Gaussian blur effect. Gaussian blur can perform convolution filtering operations on an image using a Gaussian distribution function as the kernel function. However, since Gaussian blur involves a large number of convolution operations, especially for large-sized images and large blur radii, this may lead to high computational complexity. On the other hand, Gaussian blur usually requires accessing and processing a large amount of pixel data, with high memory overhead and access efficiency requirements. Therefore, it is difficult to be widely applied to terminals.

[0032] In some embodiments, Gaussian blur can be decomposed into one-dimensional Gaussian blur in the horizontal and vertical directions, which improves the computational efficiency of Gaussian blur. However, although the one-dimensional Gaussian blur decomposition method improves computational efficiency, in some cases, especially in scenarios that require high-quality blur effects, more computational resources are still needed. It is difficult to achieve a better balance between computational efficiency and blur quality.

[0033] In some embodiments, the original image can be cut, the cut sub-images can be blurred, and the blurred effect images of the sub-images can be displayed in the cutting order of the original image. However, there is a problem that the blur effect at the cutting edge is not smooth.

[0034] In some embodiments, the original image can be scaled down to obtain an intermediate image, and Gaussian blur processing can be performed. The processed result image is enlarged to the size of the original image, and then the blurred animation obtained by displaying the blurred image is obtained. However, the scaling down and up operations introduce information loss and the blur effect is poor.

[0035] In some embodiments, an image area that needs to be subjected to Gaussian blur processing can be selected from the original image, the area is subjected to Gaussian blur processing, and the area after Gaussian processing is re-placed on the original image. However, limited by the application scenario, it can only be applied to scenarios where only part of the area is blurred, and since the area needs to be selected from the image and the processed area needs to be re-placed on the image, the computational amount is large.

[0036] In some embodiments, the image to be processed can be compressed according to preset compression configuration information, and the compressed image can be blurred. However, lossy compression introduces information loss and the blur effect is poor. And lossless compression requires more computational resources.

[0037] Therefore, the present disclosure provides an image generation method, which obtains a first image, determines M second pixel points based on N first pixel points in the first image to obtain a second image composed of the M second pixel points, where M is less than N. And the second image is blurred, and N third pixel points are determined based on the second pixel points in the second image after the processing is completed to obtain a target image, so as to save computational amount and storage space and improve efficiency during the image processing. Moreover, since the present disclosure can save computational amount, more complex blur algorithms can be used to improve the blur effect.

[0038] Among them, the image generation method of the present disclosure can be applied to a terminal. A terminal can also be referred to as a terminal device, a mobile station (MS), a mobile terminal (MT), etc. It is a device that provides voice and / or data connectivity to users. For example, a terminal can be a handheld device with wireless connection capabilities, a vehicle-mounted device, etc. Currently, some examples of terminals are: mobile phones, pocket personal computers (PPCs), palm computers, personal digital assistants (PDAs), laptop computers, tablet computers, wearable devices, or vehicle-mounted devices, etc. In addition, when it is a vehicle-to-everything (V2X) communication system, the terminal device can also be a vehicle-mounted device. It should be understood that the present disclosure embodiments do not limit the specific technologies and specific device forms adopted by the terminal.

[0039] Figure 1 is a flowchart of an image generation method shown according to an exemplary embodiment, as Figure 1 shown, the image generation method includes the following steps.

[0040] In step S11, a first image is obtained.

[0041] In some embodiments, an image to be processed can be obtained. In the present disclosure, the image to be processed is referred to as the first image. Obtaining the first image can be obtaining a real-time captured image, or obtaining an image stored in the terminal or the cloud.

[0042] In step S12, M second pixel points are determined based on N first pixel points in the first image, where M and N are positive integers and M is less than N.

[0043] In some embodiments, M second pixel points can be determined based on N first pixel points in the first image, where M is less than N. For example, multiple first pixel points in the first image are fused into one second pixel point. It can also be understood as performing downsampling on the first pixel points in the first image.

[0044] In step S13, a second image is obtained based on the M second pixel points, and the second image includes the M second pixel points.

[0045] In some embodiments, the image formed by the M second pixel points can be determined as the second image. That is, the second image includes the M second pixel points.

[0046] In step S14, the second image is blurred.

[0047] In some embodiments, blurring the second image includes performing aperture blurring, Li Zhuang blurring, Gaussian blurring, etc. on the second image. The present disclosure does not list them one by one, but is not limited thereto.

[0048] It can be understood that other processes such as defocusing processing and color processing can also be performed on the second image.

[0049] In step S15, based on the second pixel points in the blurred second image, N third pixel points are determined.

[0050] In some embodiments, after the blurring process of the second image is completed, N third pixel points can be determined based on the second pixel points in the blurred second image. For example, each second pixel point in the second image can be decomposed into multiple third pixel points. It can also be understood as performing upsampling on the second pixel points in the blurred second image to obtain the third pixel points. Upsampling can be understood as the inverse process of downsampling. For example, upsampling can be implemented according to algorithms such as bicubic interpolation.

[0051] In step S16, the image including N third pixel points is used as the target image.

[0052] In some embodiments, the image including N third pixel points can be used as the target image. That is, after blurring, the target image is generated, and the determined N third pixel points are included in the target image.

[0053] The present disclosure obtains the first image, determines M second pixel points based on N first pixel points in the first image, obtains the second image composed of M second pixel points, where M is less than N. And blurs the second image, determines N third pixel points based on the second pixel points in the processed second image, and obtains the target image, so as to save the calculation amount and storage space during the image processing process and improve the efficiency. Moreover, since the present disclosure can save the calculation amount, more complex blurring algorithms can be used to improve the blurring effect.

[0054] In some embodiments, in the image generation method provided by the present disclosure, determining M second pixel points based on N first pixel points in the first image includes: determining the pixel values of M second pixel points based on the pixel values of N first pixel points in the first image.

[0055] In some embodiments, the pixel value of the second pixel point can be determined based on the pixel values of one or more first pixel points in the first image. For example, the pixel value of each second pixel point is related to the pixel values of one or more first pixel points in the first image.

[0056] The present disclosure determines the pixel values of M second pixel points based on the pixel values of N first pixel points in a first image, so that the information of the N first pixel points in the first image can be reflected, thereby avoiding information loss and improving the blurring effect.

[0057] In some embodiments, in the image generation method provided by the present disclosure, the pixel values of N third pixel points are determined based on the pixel values of the second pixel points after blurring processing.

[0058] In some embodiments, Figure 2 is a flowchart of a pixel value determination method shown according to an exemplary embodiment. As Figure 2 shown, the present disclosure provides a pixel value determination method, including the following steps.

[0059] In step S21, based on the pixel values of N first pixel points in the first image, M pixel averages are determined.

[0060] In some embodiments, multiple first pixel points can be selected from the N first pixel points to calculate the average value, and M average values are obtained. For example, the N first pixel points can be divided into M groups. The average values of the pixel values of the first pixel points in the M groups are calculated respectively. Among them, the number of first pixel points in different combinations can be the same or different. There can be some identical first pixel points between different combinations.

[0061] In step S22, the M pixel averages are respectively used as the pixel values of the M second pixel points.

[0062] In some embodiments, the M groups of first pixel points can be respectively used as the M second pixel points, and the average pixel values of the M groups of first pixel points are respectively used as the pixel values of the M second pixel points.

[0063] The present disclosure determines M pixel averages based on the pixel values of N first pixel points, and uses the M pixel averages as the pixel values of the M second pixel points, thereby realizing that the information of multiple first pixel points is included in the second pixel points and avoiding the problem of low blurring effect caused by information loss.

[0064] In some embodiments, Figure 3 is a flowchart of a pixel value determination method shown according to an exemplary embodiment. As Figure 3 shown, the present disclosure provides a pixel value determination method, including the following steps.

[0065] In step S31, the weight coefficient of each first pixel point among the N first pixel points in the first image is determined.

[0066] In some embodiments, the weight coefficient of each of the N first pixel points can be determined. For example, when determining a second pixel point based on a plurality of first pixel points, the proportion of each of the plurality of first pixel points can be different, that is, the weight coefficients are different. The weight coefficient of each first pixel point can be determined.

[0067] In step S32, based on the weight coefficients and the pixel values of the N first pixel points in the first image, M pixel weighted averages are determined.

[0068] In some embodiments, a plurality of first pixel points can be selected from the N first pixel points to calculate the weighted average to obtain M weighted averages. For example, the N first pixel points can be divided into M groups, the pixel value of each first pixel point in each group is multiplied by the weight coefficient corresponding to the first pixel point, and the results are added to obtain the pixel weighted average of the first pixel points in the group. Among them, if there are the same first pixel points in different combinations, the weight coefficients corresponding to the first pixel point in different combinations can be the same or different.

[0069] In step S33, the M pixel weighted averages are respectively used as the pixel values of the M second pixel points.

[0070] In some embodiments, the M pixel weighted averages can be respectively used as the pixel values of the M second pixel points. For example, the N first pixel points can be divided into M groups, each group of first pixel points is used as a second pixel point, and the corresponding pixel weighted average of each group is used as the pixel value of the corresponding second pixel point.

[0071] The present disclosure makes the pixel value of the determined second pixel point more reasonable and has a better effect by determining the weight coefficient of each first pixel point and obtaining M pixel weighted averages.

[0072] In some embodiments, in the pixel value determination method provided by the present disclosure, the N first pixel points are divided into M groups, and the pixel weighted averages of the first pixel points in each group are respectively obtained to obtain M pixel weighted averages. For the weight coefficient of each first pixel point, it can be determined based on its position in the combination. Therefore, the present disclosure provides a method for determining a weight coefficient, including: each second pixel point corresponds to a fourth pixel point in the first image. Based on the distances between the N first pixel points and the fourth pixel point, the weight coefficients of the N first pixel points are respectively determined.

[0073] In some embodiments, M fourth pixel points in the first image corresponding to the M second pixel points may be determined. For example, the fourth pixel point may be the middle pixel point of each group of the divided first pixel points. That is, each combination corresponds to one fourth pixel point. For each first pixel point in the combination, the farther the distance from the fourth pixel point, the lower the weight coefficient. Conversely, the closer the distance from the fourth pixel point, the higher the weight coefficient.

[0074] The present disclosure determines the weight coefficient based on the distance, such that the weight coefficient of the first pixel points closer to the center is larger, making the determined pixel value more reasonable and the blurring effect better.

[0075] In some embodiments, Figure 4 is a flowchart of a second image determination method shown according to an exemplary embodiment. As Figure 4 shown, the second image determination method provided by the present disclosure includes the following steps.

[0076] In step S41, a first intermediate pixel point is determined based on a plurality of first pixel points in the vertical direction in the first image.

[0077] In some embodiments, a first intermediate pixel point may be determined based on a plurality of first pixel points in the vertical direction in the first image. For example, the plurality of first pixel points in each vertical direction are fused into a first intermediate pixel point.

[0078] In some embodiments, a fourth pixel point in the vertical direction corresponding to the first intermediate pixel point may be determined in the vertical direction. For example, according to the square root K of the ratio of N to M, the fourth pixel point in the vertical direction corresponding to the first intermediate pixel point may be determined. For example, for the first intermediate pixel point (X0, Y0), the fourth pixel point in the vertical direction may be (X0, KY0). The first intermediate pixel point may be determined based on the fourth pixel point in the vertical direction and a plurality of adjacent pixel points of the fourth pixel point in the vertical direction.

[0079] In some embodiments, the pixel value of the first intermediate pixel point may be determined with reference to the following formula 1.

[0080]

[0081] In formula 1, I downsample (y) represents the pixel value of the first intermediate pixel point with the ordinate y. For example, when y is equal to Y0, formula 1 is used to calculate the pixel values of all first intermediate pixel points with the ordinate Y0. That is, the pixel values of the first intermediate pixel points with the coordinates (X0, Y0), (X1, Y0), (X2, Y0), etc. are calculated. K*y represents the ordinate of the fourth pixel point in the vertical direction corresponding to the first intermediate pixel point with the ordinate y. Q represents the number of adjacent pixel points taken by the fourth pixel point in the vertical direction in the vertical direction. i is used to indicate or is the nth pixel adjacent to the fourth pixel in the vertical direction. For example, when i is equal to 0, and both represent the fourth pixel in the vertical direction. When i is equal to 1, represents the first adjacent pixel above the fourth pixel in the vertical direction, represents the first adjacent pixel below the fourth pixel in the vertical direction. The present disclosure will not list them one by one. represents rounding up, that is, when K*y is a decimal or a fraction, it can be rounded up to an integer. For example, when K*y is 1.2, rounding up means taking 2. represents rounding down. For example, when K*y is 1.2, rounding down means taking 1. w i represents the weight coefficient of the fourth pixel in the vertical direction and multiple adjacent pixels of the fourth pixel in the vertical direction. represents the pixel weighted average of the fourth pixel in the vertical direction and Q adjacent pixels above the fourth pixel in the vertical direction. represents the pixel weighted average of the fourth pixel in the vertical direction and Q adjacent pixels below the fourth pixel in the vertical direction.

[0082] In step S42, a second pixel is determined based on multiple first intermediate pixels in the horizontal direction.

[0083] In some embodiments, a second pixel determined based on multiple first intermediate pixels in the horizontal direction may be used. For example, multiple first intermediate pixels in the horizontal direction are fused into a second pixel.

[0084] In some embodiments, a fourth pixel in the horizontal direction corresponding to the second pixel may be determined in the horizontal direction. For example, according to the square root K of the ratio of N to M, the fourth pixel in the horizontal direction corresponding to the second pixel may be determined. For example, for the second pixel (X0, Y0), the fourth pixel in the horizontal direction may be (KX0, Y0). The second pixel may be determined based on the fourth pixel in the horizontal direction and multiple adjacent first intermediate pixels of the fourth pixel in the horizontal direction.

[0085] In some embodiments, formula 2 may be referred to.

[0086]

[0087] The symbols in formula 2 may refer to the symbols in formula 1. In formula 2, I downsample (x) represents the pixel value of the second pixel with the abscissa x. i is used to indicate or is the nth pixel adjacent to the fourth pixel in the horizontal direction. For example, when i is equal to 0, and both represent the fourth pixel in the horizontal direction. When i is equal to 1, represents the first first intermediate pixel adjacent to the right of the fourth pixel in the horizontal direction. represents the first first intermediate pixel adjacent to the left of the fourth pixel in the horizontal direction. represents the pixel weighted average of the fourth pixel in the horizontal direction and Q adjacent pixels to the right of the fourth pixel in the horizontal direction. represents the pixel weighted average of the fourth pixel in the horizontal direction and Q adjacent pixels to the left of the fourth pixel in the horizontal direction.

[0088] In some embodiments, Figure 5 is a schematic diagram showing the transformation of the first pixel into the second pixel according to an exemplary example. As Figure 5As shown, N is 16, M is 4, and K is 2. The fourth pixel point in the vertical direction corresponding to the first intermediate pixel point can be determined. For the first intermediate pixel point with a vertical coordinate of 1, the vertical coordinate of its corresponding fourth pixel point in the vertical direction is 1 * K, that is, 2. * represents the multiplication sign. That is, for the first intermediate pixel point with a vertical coordinate of 1, its corresponding fourth pixel point in the vertical direction is the first pixel point with a vertical coordinate of 2. For the first intermediate pixel point with a vertical coordinate of 2, its corresponding fourth pixel point in the vertical direction is the first pixel point with a vertical coordinate of 4. Multiple adjacent pixel points can be taken above and below the first pixel point with a vertical coordinate of 2 and fused into the first intermediate pixel point with a vertical coordinate of 1. For example, for the first intermediate pixel point (1, 1), its corresponding first pixel point in the vertical direction is (1, 2). The first pixel point (1, 2), the adjacent first pixel point (1, 1) above the first pixel point (1, 2), and the adjacent first pixel point (1, 3) below the first pixel point (1, 2) can be fused. That is, the pixel values of the first pixel points (1, 1), (1, 2), and (1, 3) are averaged or weighted averaged to be used as the pixel value of the first intermediate pixel point (1, 1). Of course, multiple adjacent pixel points can be taken above the first intermediate pixel point (1, 1). This disclosure is only an example and does not limit the number of adjacent pixel points. It can be understood as downsampling in the vertical direction. From the first intermediate pixel point to the second pixel point, the fourth pixel point in the horizontal direction corresponding to the second pixel point can be determined. For the second pixel point with a horizontal coordinate of 1, the horizontal coordinate of its corresponding fourth pixel point in the horizontal direction is 1 * K, that is, 2. That is, for the second pixel point with a horizontal coordinate of 1, its corresponding fourth pixel point in the horizontal direction is the first intermediate pixel point with a horizontal coordinate of 2. For the second pixel point with a horizontal coordinate of 2, its corresponding fourth pixel point in the horizontal direction is the first intermediate pixel point with a horizontal coordinate of 4. Multiple adjacent pixel points can be taken to the left and right of the first pixel point with a horizontal coordinate of 2 and fused into the first intermediate pixel point with a horizontal coordinate of 1. For example, for the second pixel point (1, 1), its corresponding fourth pixel point in the horizontal direction is the first intermediate pixel point (2, 1). The first intermediate pixel point (2, 1), the first adjacent pixel point (1, 1) to the left of the first intermediate pixel point, and the first adjacent pixel point (3, 1) to the right of the first intermediate pixel point (2, 1) can be fused. That is, the pixel values of the first intermediate pixel points (1, 1), (2, 1), and (3, 1) are averaged or weighted averaged to be used as the pixel value of the second pixel point (1, 1). This disclosure will not list all examples one by one.

[0089] This disclosure determines the second pixel point step by step by determining the first intermediate pixel point based on multiple first pixel points in the vertical direction in the first image and determining the second pixel point based on multiple first intermediate pixel points in the horizontal direction, reducing the calculation amount and improving the efficiency.

[0090] In some embodiments, Figure 6is a flowchart of an image generation method shown according to an exemplary embodiment. As Figure 6 shown, the present disclosure provides an image generation method, including the following steps.

[0091] In step S51, perform downsampling in the vertical direction on the pixel points of the first image to obtain a fourth image.

[0092] In some embodiments, perform downsampling in the vertical direction on the pixel points of the first image, that is, determine the fourth pixel point in the vertical direction, and determine the first intermediate pixel point based on the fourth pixel point in the vertical direction. The specific implementation can refer to the embodiment of step S41, and the present disclosure will not elaborate. The first intermediate pixel points constitute the fourth image.

[0093] In step S52, perform downsampling in the horizontal direction on the pixel points of the fourth image to obtain a fifth image.

[0094] In some embodiments, downsampling in the horizontal direction can be performed on the first intermediate pixel points of the first image. For example, determine the fourth pixel point in the horizontal direction, and determine the second pixel point based on the fourth pixel point in the horizontal direction. The specific implementation can still refer to the embodiment in step S42, and the fifth image is composed of the second pixel points. Among them, the fifth image can be the second image.

[0095] In step S53, perform vertical blurring on the fifth image to obtain a sixth image.

[0096] In some embodiments, vertical blurring can be performed on the fifth image. For example, perform Gaussian blurring in the vertical direction on the fifth image. Exemplarily, reference can be made to formula 3 below.

[0097]

[0098] In formula 3, I blurred (y) represents the pixel value of the second pixel point with the ordinate y after vertical blurring, and g i represents the weight coefficient of Gaussian blurring. represents the weighted average of the pixel values of the second pixel points with the ordinates y, y + 1, y + 2 ··· y + P). represents the weighted average of the pixel values of the pixel points with the ordinates y - 1, y - 2 ··· y - P).

[0099] In step S54, perform horizontal blurring on the sixth image. Obtain a seventh image.

[0100] In some embodiments, the sixth image can be blurred in the horizontal direction. For example, perform Gaussian blur on the sixth image in the vertical direction. Exemplarily, reference can be made to Equation 4 below.

[0101]

[0102] In Equation 4, I blurred (x) represents the pixel value of the second pixel point with abscissa x after blurring in the horizontal direction, and g i represents the weight coefficient of Gaussian blur. represents the weighted average of the pixel values of the second pixel points with abscissas x, x + 1, x + 2 ··· x + P after blurring. represents the weighted average of the pixel values of the pixel points with ordinates x - 1, x - 2 ··· x - P.

[0103] In step S55, perform horizontal upsampling on the seventh image to obtain the eighth image.

[0104] In some embodiments, pixel points can be inserted in the horizontal direction of the seventh image based on an interpolation algorithm to obtain the eighth image.

[0105] In step S56, perform vertical upsampling on the eighth image to obtain the ninth image.

[0106] In some embodiments, pixel points can be inserted in the vertical direction of the eighth image based on an interpolation algorithm to obtain the ninth image. The ninth image can be understood as the first image after blurring.

[0107] In some embodiments, Figure 7 is a schematic diagram of the first image to the ninth image shown according to an exemplary embodiment. As Figure 7 shown, the first image is the image to be processed. The fourth image is the image after vertical downsampling. The fifth image is the image after horizontal downsampling. The sixth image is the image after vertical blurring. The seventh image is the image after horizontal blurring. The eighth image is the image after horizontal upsampling. The ninth image is the image after vertical upsampling.

[0108] The present disclosure obtains a blurred image corresponding to the first image by subjecting the first image to vertical downsampling, horizontal downsampling, vertical blurring, horizontal blurring, horizontal upsampling, and vertical upsampling, improving efficiency and achieving a better blurring effect.

[0109] Based on the same concept, the present disclosure provides an image generation device.

[0110] It can be understood that, in order to implement the above functions, the image generation device provided by the embodiments of the present disclosure includes the corresponding hardware structures and / or software modules for executing various functions. Combining the units and algorithm steps of the various examples disclosed in the embodiments of the present disclosure, the embodiments of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the manner of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the technical solutions of the embodiments of the present disclosure.

[0111] It should be noted that those skilled in the art can understand that the various implementation manners / embodiments involved in the embodiments of the present disclosure above can be used in cooperation with the foregoing embodiments or can be used independently. Whether used independently or in cooperation with the foregoing embodiments, their implementation principles are similar. In the embodiments of the present disclosure, some embodiments are described in the implementation manner of being used together. Of course, those skilled in the art can understand that such illustrative examples are not limitations on the embodiments of the present disclosure.

[0112] Figure 8 is a block diagram of an image generation device 100 shown according to an exemplary embodiment. As Figure 8 shown, the device 100 includes: an acquisition module 101, a determination module 102, and a processing module 103.

[0113] Among them, the acquisition module 101 is used to acquire a first image. The determination module 102 is used to determine M second pixel points based on N first pixel points in the first image, where M and N are positive integers and M is less than N. The processing module 103 is used to obtain a second image based on the M second pixel points, and the second image includes the M second pixel points. Blur the second image. The determination module 102 is further used to determine N third pixel points based on the blurred second pixel points. The processing module 103 is further used to use the image including the N third pixel points as the target image.

[0114] In one implementation manner, the determination module 102 determines M second pixel points based on N first pixel points in the first image in the following manner: determining the pixel values of the M second pixel points based on the pixel values of the N first pixel points in the first image.

[0115] In one implementation manner, the determination module 102 determines the pixel values of the M second pixel points based on the pixel values of the N first pixel points in the first image in the following manner: determining M pixel averages based on the pixel values of the N first pixel points. Using the M pixel averages as the pixel values of the M second pixel points respectively.

[0116] In one embodiment, the determining module 102 determines the pixel values of M second pixel points based on the pixel values of N first pixel points in the first image in the following manner: Determine the weight coefficient of each of the N first pixel points in the first image. Based on the weight coefficients and the pixel values of the N first pixel points in the first image, determine M pixel weighted averages. Use the M pixel weighted averages as the pixel values of the M second pixel points respectively.

[0117] In one embodiment, each second pixel point corresponds to a fourth pixel point in the first image. The determining module 102 determines the weight coefficient of each of the N first pixel points in the first image in the following manner: Based on the distances between the N first pixel points and the fourth pixel point, determine the weight coefficients of the N first pixel points respectively. Among them, the greater the distance, the smaller the weight coefficient.

[0118] In one embodiment, the determining module 102 determines M second pixel points based on N first pixel points in the first image in the following manner: Determine a first intermediate pixel point based on a plurality of first pixel points in the vertical direction of the first image. Determine the second pixel point based on a plurality of the first intermediate pixel points in the horizontal direction.

[0119] Figure 9 It is a block diagram of an image generation device 200 shown according to an exemplary embodiment.

[0120] As Figure 9 shown, the device 200 may include one or more of the following components: a processing component 202, a memory 204, a power component 206, a multimedia component 208, an audio component 210, an input / output (I / O) interface 212, a sensor component 214, and a communication component 216.

[0121] The processing component 202 generally controls the overall operation of the device 200, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 202 may include one or more modules to facilitate the interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate the interaction between the multimedia component 208 and the processing component 202.

[0122] The memory 204 is configured to store various types of data to support the operation of the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phone book data, messages, pictures, videos, and the like. The memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0123] The power component 206 provides power to the various components of the device 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 200.

[0124] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operations. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0125] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC) that is configured to receive external audio signals when the device 200 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 204 or transmitted via the communication component 216. In some embodiments, the audio component 210 further includes a speaker for outputting audio signals.

[0126] The I / O interface 212 provides an interface between the processing component 202 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power button, and a lock button.

[0127] The sensor assembly 214 includes one or more sensors for providing an assessment of the status of the device 200 in various aspects. For example, the sensor assembly 214 can detect the on / off state of the device 200, the relative positioning of components, such as components for the display and keypad of the device 200. The sensor assembly 214 can also detect a change in the position of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200, and the temperature change of the device 200. The sensor assembly 214 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 214 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0128] The communication component 216 is configured to facilitate communication between the device 200 and other devices in a wired or wireless manner. The device 200 can access a wireless network based on communication standards, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0129] In an exemplary embodiment, the device 200 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described methods.

[0130] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions that can be executed by a processor 220 of the device 200 to complete the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0131] The present disclosure obtains a first image, determines M second pixel points based on N first pixel points in the first image, and obtains a second image composed of the M second pixel points, where M is less than N. Then, the second image is blurred, and N third pixel points are determined based on the second pixel points in the second image after the processing is completed, so as to obtain a target image, thereby saving computational amount and storage space during the image processing and improving efficiency. Moreover, since the present disclosure can save the computational amount, a more complex blurring algorithm can be used to improve the blurring effect.

[0132] It can be understood that "a plurality of" in the present disclosure means two or more, and other quantifiers are similar. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. The singular forms of "a", "an", and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.

[0133] Furthermore, it can be understood that the terms "first", "second", etc. are used to describe various information, but this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not represent a specific order or importance. In fact, the expressions such as "first" and "second" can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.

[0134] Furthermore, it can be understood that although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood that these operations are required to be performed in the specific order shown or in a serial order, or that all the operations shown are required to be performed to obtain the desired result. In a specific environment, multitasking and parallel processing may be beneficial.

[0135] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily think of other embodiments of the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure.

[0136] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

Claims

1. An image generation method, characterized in that: include: acquiring a first image; Determine M second pixel points based on N first pixel points in the first image, where both M and N are positive integers, and M is less than N; Based on the M second pixel points, a second image is obtained, where the second image includes the M second pixel points; performing blur processing on the second image; Determine N third pixel points based on the second pixel point in the blurred second image; The image including the N third pixels is used as the target image.

2. The method according to claim 1, characterized in that The determining M second pixel points based on N first pixel points in the first image includes: The pixel values ​​of the M second pixels are determined based on the pixel values ​​of the N first pixels in the first image.

3. The method according to claim 2, characterized in that The determining pixel values ​​of M second pixel points based on the pixel values ​​of N first pixel points in the first image includes: Determine M pixel averages based on the pixel values ​​of the N first pixels; The M pixel averages are respectively used as pixel values ​​of the M second pixel points.

4. The method according to claim 2, characterized in that: The determining pixel values ​​of M second pixel points based on the pixel values ​​of N first pixel points in the first image includes: Determine a weight coefficient of each first pixel point among N first pixel points in the first image; Determine a weighted average value of M pixels based on the weight coefficient and the pixel values ​​of N first pixels in the first image; The weighted average values ​​of the M pixels are respectively used as the pixel values ​​of the M second pixel points.

5. The method according to claim 4, characterized in that Each of the second pixel points corresponds to a fourth pixel point in the first image, and determining a weight coefficient of each of the N first pixel points in the first image includes: Based on the distances between the N first pixel points and the fourth pixel point, respectively determine the weight coefficients of the N first pixel points; Among them, the larger the distance is, the smaller the weight coefficient is.

6. The method according to claim 1, characterized in that The determining M second pixel points based on N first pixel points in the first image includes: Determine a first intermediate pixel point based on a plurality of first pixel points in a vertical direction in the first image; The second pixel point is determined based on a plurality of first intermediate pixel points in a horizontal direction.

7. An image generating device, characterized in that: include: An acquisition module, used for acquiring a first image; a determination module, configured to determine M second pixel points based on N first pixel points in the first image, wherein both M and N are positive integers, and M is less than N; A processing module, configured to obtain a second image based on the M second pixel points, wherein the second image includes the M second pixel points; and perform blur processing on the second image; The determination module is further used to determine N third pixel points based on the second pixel point in the second image after blur processing; The processing module is further configured to use the image including the N third pixels as the target image.

8. The device according to claim 7, characterized in that The determination module determines M second pixel points based on N first pixel points in the first image in the following manner: The pixel values ​​of the M second pixels are determined based on the pixel values ​​of the N first pixels in the first image.

9. The device according to claim 8, characterized in that The determination module determines the pixel values ​​of the M second pixels based on the pixel values ​​of the N first pixels in the first image in the following manner: Determine M pixel averages based on the pixel values ​​of the N first pixels; The M pixel averages are respectively used as pixel values ​​of the M second pixel points.

10. The device according to claim 8, characterized in that The determination module determines the pixel values ​​of the M second pixels based on the pixel values ​​of the N first pixels in the first image in the following manner: Determine a weight coefficient of each first pixel point among N first pixel points in the first image; Determine a weighted average value of M pixels based on the weight coefficient and the pixel values ​​of N first pixels in the first image; The weighted average values ​​of the M pixels are respectively used as the pixel values ​​of the M second pixel points.

11. The device according to claim 10, characterized in that Each of the second pixel points corresponds to a fourth pixel point in the first image, and the determination module determines the weight coefficient of each of the N first pixel points in the first image in the following manner: Based on the distances between the N first pixel points and the fourth pixel point, respectively determine the weight coefficients of the N first pixel points; Among them, the larger the distance is, the smaller the weight coefficient is.

12. The device according to claim 7, characterized in that The determination module determines M second pixel points based on N first pixel points in the first image in the following manner: Determine a first intermediate pixel point based on a plurality of first pixel points in a vertical direction in the first image; The second pixel point is determined based on a plurality of first intermediate pixel points in a horizontal direction.

13. An electronic device, characterized in that: include: A memory for storing instructions; as well as A processor, configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.

14. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions are executed by the processor, the method according to any one of claims 1 to 6 is executed.

Citation Information

Cited By

  • Image fuzzy processing method and device, electronic equipment, chip and medium

    CN120725859A

  • Image blurring processing method and device, electronic equipment, chip and medium

    CN120725859B