CN108399605A - Image processing method, terminal device and computer readable storage medium - Google Patents

Image processing method, terminal device and computer readable storage medium Download PDF

Info

Publication number
CN108399605A
CN108399605A CN201810020059.5A CN201810020059A CN108399605A CN 108399605 A CN108399605 A CN 108399605A CN 201810020059 A CN201810020059 A CN 201810020059A CN 108399605 A CN108399605 A CN 108399605A
Authority
CN
China
Prior art keywords
processing
rendering
picture
pixel points
processing method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810020059.5A
Other languages
Chinese (zh)
Other versions
CN108399605B (en
Inventor
苏晓强
庄伟胤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN201810020059.5A priority Critical patent/CN108399605B/en
Publication of CN108399605A publication Critical patent/CN108399605A/en
Application granted granted Critical
Publication of CN108399605B publication Critical patent/CN108399605B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The present embodiments relate to picture Processing Technique field, a kind of image processing method, terminal device and computer readable storage medium are disclosed.In the present invention, image processing method includes:It obtains in pending picture and waits for fuzzy region;It treats fuzzy region and carries out Gaussian Blur processing, and pixel is stored in pre-assigned memory space by treated;During treating fuzzy region progress Gaussian Blur processing, whether monitoring current state meets the beginning condition for rendering processing;When meeting the condition for rendering processing beginning, pixel is read from memory space, and carry out rendering processing;Wherein, in rendering processing procedure, the remainder for continuing to treat fuzzy region carries out Gaussian Blur and handles to being fully completed.Image processing method, terminal device and the computer readable storage medium that embodiment of the present invention provides are effectively shortened from picture blur processing to the time for rendering displaying.

Description

Picture processing method, terminal device and computer readable storage medium
Technical Field
The embodiment of the invention relates to the technical field of picture processing, in particular to a picture processing method, terminal equipment and a computer readable storage medium.
Background
Along with the popularization and application of intelligent terminal equipment, people have higher and higher requirements on the intelligent degree of the intelligent terminal equipment, and the application and the realization of an image processing technology in the aspect of improving the intelligent degree of the terminal equipment are more and more. In the field of image processing technology, gaussian blur is a process of performing convolution filtering on an image by taking gaussian distribution as a kernel function, and is a common basic operation in a plurality of image processing methods and visual special effects.
Taking a terminal device of an Android operating system as an example, 16ms is a screen refreshing frequency required by the Android device, if the time for processing and rendering pictures exceeds 16ms, an interface is experienced, and most of the gaussian blur processing time is longer than 16ms at present, so that in order to solve the problem, the following two methods are mainly used at present:
1. starting from the Gaussian blur algorithm, the algorithm is improved to reduce the Gaussian blur processing time;
2. starting from the user experience point, for example, a waiting prompt is given to the user before the picture Gaussian blur processing is completed.
However, the inventors found that at least the following problems exist in the prior art: whether the improvement of the Gaussian blur algorithm or the user experience is in hand, the method is based on one-time rendering display after the Gaussian processing of the whole picture is finished, so that a very abrupt experience is provided for the user, and the picture is loaded and displayed to an interface instantly. Although, in order to solve such a problem that the image is obtrusive, an original image is superimposed on the image after the gaussian blur, and then the transparency of the original image is changed to achieve the effect of the dynamic blur, the premise of the scheme is that the image after the gaussian blur needs to be processed first and then the effect can be achieved based on two images, so that the total time from the image processing to the rendering and displaying is prolonged, which is equivalent to prolonging the time to improve the experience.
Disclosure of Invention
An object of an embodiment of the present invention is to provide a picture processing method, a terminal device, and a computer-readable storage medium, which effectively shorten the time from a picture blur process to a rendering display, achieve the purpose of reducing the waiting time of a user, provide the user with an experience that a picture is slowly expanded from top to bottom, and solve the problem of a picture being displayed suddenly.
In order to solve the above technical problem, an embodiment of the present invention provides an image processing method, where the image processing method includes: acquiring a to-be-blurred area in a to-be-processed picture; performing Gaussian blur processing on the area to be blurred, and storing the processed pixel points into a pre-allocated storage space; monitoring whether the current state meets the starting condition of rendering processing or not in the process of carrying out Gaussian blur processing on the region to be blurred; reading pixel points from the storage space and performing rendering processing when the condition of starting rendering processing is met; and in the process of rendering, continuously carrying out Gaussian blur processing on the rest part of the to-be-blurred region until the whole process is finished.
The embodiment of the invention provides terminal equipment, which comprises at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform the picture processing method according to any of the embodiments of the present invention.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program, and the computer program can realize the picture processing method related in any embodiment of the invention when being executed by a processor.
Compared with the prior art, the embodiment of the invention provides the picture processing method capable of effectively shortening the time from picture blurring processing to rendering display, and by advancing the starting time of rendering processing, the Gaussian blurring processing and the rendering processing can be executed in parallel, so that the time from picture blurring processing to rendering display is effectively shortened, the total time is shortened, and the purpose of reducing the waiting time of a user is achieved.
In addition, the pixel point after will handling is deposited in the memory space of pre-allocation, specifically includes: and storing the processed pixel points into a pre-allocated storage space in a row unit. This embodiment provides a specific way to store the processed pixel points in the pre-allocated storage space.
In addition, the rendering processing includes displaying each row of pixel points in sequence according to preset interval time in row units. In the process of rendering, each row of pixel points are sequentially displayed according to preset interval time in row units, so that the user can experience that the picture is slowly unfolded from top to bottom, and the problem of abrupt picture display is solved.
In addition, the rendering time interval is set using the following formula:
T≥(1-P)×H×(W×t);
wherein, T is the time required for rendering all the pixel points in the to-be-blurred region, H is the total number of rows of the pixel points included in the to-be-blurred region, Δ T is the rendering time interval, P is the percentage of the gaussian blurring processing progress, W is the total number of columns of the pixel points included in the to-be-blurred region, and T is the time required for processing one pixel point by gaussian blurring.
In addition, the percentage P is calculated using the following formula:
wherein, x is the number of rows of pixel points corresponding to the time point when rendering processing starts, P is the percentage of the progress of gaussian fuzzy processing, and H is the total number of rows of pixel points included in the region to be fuzzy.
In addition, the value range of P is between 40% and 80%. The method provides a specific value range of the percentage P of the Gaussian blur processing progress, in the value range, the smaller the value of P is, the better the performance of the terminal device is represented, the more efficient the Gaussian blur processing is, and the earlier the corresponding rendering processing starts, so that the time from the image blur processing to the rendering display is effectively shortened.
In addition, the value of P ranges from 50% to 60%. The method provides a value range with a better percentage P of the Gaussian blur processing progress, and the value of P is set to be 50-60%, so that the image processing method can better meet the current commonly used terminal equipment.
In addition, monitoring whether the current state meets the starting condition of the rendering processing specifically includes: acquiring current system time; and when the acquired system time is equal to a preset time point when the rendering processing is started, determining that the current state meets the condition of starting the rendering processing. The invention provides a specific implementation mode for judging whether the current state meets the starting condition of rendering processing, which comprises the steps of obtaining the current system time, comparing the obtained system time with the preset time point of the starting of rendering processing, and performing rendering processing by using a row unit according to the preset rendering time interval of each row of pixel points from the first row of pixel points stored in a storage space when the obtained system time is equal to the preset time point of the starting of rendering processing. The method is simple and convenient to realize, and reasonable rendering processing starting time can be set according to actual needs, so that the time from picture fuzzy processing to rendering display can be effectively shortened, and the aim of reducing the waiting time of a user is fulfilled.
In addition, monitoring whether the current state meets the starting condition of the rendering processing specifically includes: acquiring the line number of pixel points stored in a storage space; and when the line number of the acquired pixel point is equal to the preset line number of the starting rendering processing, determining that the current state meets the starting rendering processing condition. The method provides another specific implementation mode for judging whether the current state meets the starting condition of the rendering processing, the line number of the pixel points stored in the storage space is obtained, the obtained line number of the pixel points is compared with the preset line number of the starting rendering processing, and when the obtained line number of the pixel points is equal to the preset line number of the starting rendering processing, the rendering processing is carried out according to the preset rendering time interval of each line of the pixel points by a behavior unit from the first line of the pixel points stored in the storage space. The method solves the problem that the actual processing time and the preset time have errors due to different performances of the terminal equipment, ensures the starting time of rendering processing, enables the time from the fuzzy processing of the picture to the rendering display to be more controllable, and further ensures the picture processing effect.
In addition, acquiring the region to be blurred specifically includes: acquiring a picture to be processed; determining the area of a fuzzy object in a picture to be processed according to a preset fuzzy object; and determining the area of the fuzzy object in the picture to be processed as the area to be fuzzy. The method provides a specific determination method of the to-be-blurred region, so that the subsequent processing process of the picture is more targeted, and the actual use requirements of the user are better met.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
FIG. 1 is a flow chart of a picture processing method according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of the derivation of the formula for setting the time interval according to the first embodiment of the present invention;
FIG. 3 is a schematic diagram of the derivation of the formula for setting the time interval according to the first embodiment of the present invention;
FIG. 4 is a schematic diagram of the derivation of the formula for setting the time interval according to the first embodiment of the present invention;
FIG. 5 is a flowchart of a picture processing method according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal device according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the present invention relates to a picture processing method, which is mainly applied to a terminal device capable of displaying pictures, such as a mobile phone, a tablet computer, and the like, and an operating system of the terminal device may be an Android operating system (an operating system developed by google corporation), an ios operating system (a mobile operating system of apple corporation), and the like, which is not described herein again in detail. For the sake of understanding, the following description will be made specifically, and the specific flow is shown in fig. 1.
In step 101, a to-be-blurred region in a to-be-processed picture is acquired.
Specifically, in this embodiment, the obtaining of the to-be-blurred region in the to-be-processed picture may specifically be obtained by:
s1, acquiring a to-be-processed picture, that is, a picture that needs to be processed, where the picture may be pre-stored in the terminal device, or may be a picture that has just been shot by a user using a camera of the terminal device, and this is not limited here.
And S2, determining the area of the fuzzy object in the picture to be processed according to the preset fuzzy object.
It should be noted that, in this embodiment, the preset fuzzy object may be pre-stored in the terminal device, for example, a certain fuzzy mode corresponds to a specific fuzzy object, or may be set by the user according to personal preferences before the fuzzy is performed, and is not limited herein.
And S3, determining the area of the fuzzy object in the picture to be processed as the area to be fuzzy.
It should be noted that the to-be-blurred region in this embodiment may be a local region in the to-be-processed picture, or may be an entire region of the to-be-processed picture (i.e., the entire to-be-processed picture).
In step 102, gaussian blur processing is performed on the region to be blurred.
In step 103, the processed pixel points are stored in the pre-allocated storage space.
Specifically, in practical application, when the gaussian blurring processing is performed on the to-be-blurred region in the to-be-blurred image, specifically, the pixel points in the to-be-blurred region are processed one by one, and then each processed pixel point is sequentially stored into a pre-allocated storage space according to the sequence and is stored in a row unit.
It should be noted that, when the processed pixel points are stored in the pre-allocated storage space in row units, the pixel points may be stored in a single row or in multiple rows. Preferably, the storage can be performed in a single line, so that the processing speed can be increased.
For example, if the to-be-blurred region is a picture region with a resolution of 5 × 5 (i.e., each row and each column has 5 pixels, as shown in table 1), then the processing is performed sequentially from (0, 0) to (0, 4) during the gaussian blur processing, and after the processing of the row of pixels is completed, the processing is performed sequentially from (1, 0) to (1, 4), and according to this manner, until the processing of (4, 4) is completed, that is, all pixels are processed completely.
In addition, in the process of gaussian processing, the pixel points obtained by gaussian blurring processing are stored in a pre-allocated storage space in a row unit, that is, the format of the pixel points stored in the storage space should be the same as the distribution of the pixel points in the to-be-blurred region before gaussian processing, that is, the same as the storage sequence in table 1.
(0,0) (0,1) (0,2) (0,3) (0,4)
(1,0) (1,1) (1,2) (1,3) (1,4)
(2,0) (2,1) (2,2) (2,3) (2,4)
(3,0) (3,1) (3,2) (3,3) (3,4)
(4,0) (4,1) (4,2) (4,3) (4,4)
TABLE 1
It should be noted that the above is only an example, and does not limit the technical solution of the present invention, and in practical applications, the pixel point of the to-be-blurred region is far greater than 5 × 5, but the implementation manner is the same, and is not described herein again.
In step 104, the current system time is obtained.
In step 105, it is determined whether the acquired system time is equal to a preset point in time at which the rendering process is started. If the acquired system time is equal to the preset rendering processing starting time point, determining that the current state meets the rendering processing starting condition, entering step 106, and performing rendering processing according to the preset rendering time interval of each row of pixel points in a row unit; otherwise, returning to step 104, re-acquiring the current system time until the acquired system time is equal to the preset time point when the rendering processing starts, and entering step 106 or ending the picture processing operation.
In step 106, the pixel points are read and rendered.
Specifically, when the condition for starting the rendering process is satisfied, the pixel points are read from the storage space, and then the pixel points in each row are sequentially displayed in a row unit according to the preset interval time. The rendering process mainly includes displaying pixel points and performing other processes to realize the display of the pixel points.
As described above, the to-be-blurred region in the present embodiment may be a local region in the to-be-processed picture, or may be an entire region of the to-be-processed picture (i.e., the entire to-be-processed picture). When the to-be-blurred region is the whole to-be-processed picture, the blurring processing, storing and rendering methods of the pixel points can be processed according to the steps S102 to S106; when the to-be-blurred region is a local region in the to-be-processed picture, there are some differences in the specific processing method, which specifically includes that, in step S103, not only the processed pixel points are stored in the pre-allocated storage space, but also the pixel points that do not need to be blurred are stored in the pre-allocated storage space, and the pixel points (including the processed and non-processed pixel points) are stored according to the order of pixel arrangement in the original picture when being stored. In this way, in step 106, the pixel points are read, and when the rendering process is performed, the read pixel points include the processed pixel points and the pixel points that do not need to be processed, and the basic sequence of reading and rendering is also performed based on the sequence of pixel arrangement in the original picture, so as to display the processed complete image.
In addition, the time interval taken when performing the rendering process in the present embodiment may be set by the following formula:
equation 1:
equation 2: t is not less than (1-P). times.Hx (W.times.t);
equation 3:
specifically, T is time required for rendering all pixels in the to-be-blurred region, H is total number of rows of pixels included in the to-be-blurred region, Δ T is rendering time interval, P is percentage of gaussian blurring processing progress, W is total number of columns of pixels included in the to-be-blurred region, T is time required for gaussian blurring processing of one pixel, and x is number of rows of pixels corresponding to time point when rendering processing starts.
To facilitate understanding of the inversion and use of the above equations, the following detailed description is made in conjunction with fig. 2 to 4:
assuming that there is a picture with a resolution of 100 × 100 pixels, as shown in fig. 2, each row and each column of the picture have 100 pixel points, the gaussian blur processing actually performs a convolution operation on each pixel point in the picture, and assuming that the convolution calculation time of each pixel point is t, the time required for the gaussian blur processing of the whole picture can be calculated as:
W×H×t=100×100×t=10000t;(1)
each line has 100 pixel points, so the time required for performing gaussian blurring processing on each line of pixel points can be calculated:
W×t=100t;(2)
according to the picture processing scheme provided in the present embodiment, it is assumed that the gaussian blur processing has completed x rows and is now a set point in time at which rendering starts, as shown in fig. 3.
From this time node, the gaussian blur process and the rendering process will be executed concurrently. And because the rendering processing speed is high, the time for rendering a row of pixel points can be ignored, and at this time, the rendering interval time between each row of pixel points is assumed to be delta t.
Because the rendering process should lag behind the gaussian blur process, it is ensured that enough pixel data can be rendered during the rendering process. Assuming that the current gaussian blur processing reaches the y line from the time node at which the rendering processing starts, as shown in fig. 4, the time required from the time node at which the rendering processing starts to the current gaussian blur processing can be calculated as:
(y-x)×W×t=(y-x)×100t;(3)
neglecting the rendering processing time of each row of pixel points, the time required from the time node when the rendering processing starts to the rendering process at this time can be calculated as:
Δt×y;(4)
as is apparent from the above description, the result obtained by equation (3) is less than or equal to the result obtained by equation (4), and thus it can be obtained:
(y-x)×W×t≤Δt×y;(5)
in formula 5, y represents the number of lines of the current gaussian blur processing, x is the number of rows of pixels corresponding to the time point at which the rendering processing starts, Δ t represents the rendering time interval between pixels in each row, t represents the convolution calculation time of each pixel, and W represents the number of pixels in each row. Wherein, the value range of x is 0< x < y, and the value range of y is x < y and is less than or equal to H.
When y is equal to H, it indicates that the gaussian blurring operation is finished, the whole picture is finished with the gaussian blurring, and the relation between x and Δ t can be obtained by substituting the relation into equation (5) for conversion:
in equation (6), x represents the number of lines that the current gaussian blur process completes, and if both sides are divided by H, the following relationship can be obtained:
by the above-mentioned deduction, it is understood that the above-mentioned formula (7) is the formula 3 in the present embodiment, and the formulas 1 and 2 in the present embodiment can be deduced by substitution, and when P is 0.5, it indicates that the gaussian blurring processing operation has been performed halfway.
According to the formula (2), W × t represents the gaussian blur calculation time of each row of pixels, and obviously Δ t is certainly smaller than W × t, because the purpose of the embodiment is to advance the rendering time, so that the rendering operation and the gaussian blur processing operation can be executed in parallel, and a good visual experience is provided for a user.
In addition, it should be noted that in the rendering process, the time for rendering each line may be ignored, and therefore, it is necessary to implement delaying of the rendering processing operation by setting Δ t, so as to ensure that the rendering processing operation can be executed in parallel with the gaussian blur processing operation.
Assuming that 1s is required for gaussian blurring processing of a picture with 100 × 100 pixels in this example, if the gaussian blurring processing is selected to be a time node at which rendering starts when half of the processing is performed, that is, P is 0.5, Δ t is 5ms, that is, the rendering interval of each row of pixels is 5 ms. Similarly, if the gaussian blur processing is selected to proceed to 1/4, i.e., P is 0.25, Δ t is 7.5ms, i.e., the rendering interval of each row of pixels is 7.5 ms.
It should be noted that the above is only an example, and the technical scheme of the present invention is not limited, in practical application, the setting of Δ t may be set according to a screen refresh frequency of a terminal device, and taking an operating system as a terminal device of an Android system as an example, since 16ms is the screen refresh frequency of the Android device, Δ t is not too small, otherwise, human eyes cannot distinguish the sequence of rendering processing of each row of pixel points, and then the experience of slowly expanding a picture from top to bottom is not good enough.
In addition, it is worth mentioning that, because the performance of the terminal device is in a certain relationship with the percentage P of the gaussian blur processing progress, specifically, if the value of P is smaller, the performance of the terminal device is better, and the gaussian blur processing is more efficient, it is found through tests that when the value range of P is between 40% and 80%, the gaussian blur processing effect is higher, and therefore, in order to ensure the picture processing effect in practical application, the value range of P is preferably between 40% and 80%.
In addition, according to the current mainstream terminal equipment, tests show that when the value range of P is between 50% and 60%, the image processing speed is higher, the processing effect is better, and the current popular terminal equipment can be better met.
It should be noted that the above is only an example, and does not limit the technical solution of the present invention, and in practical applications, a person skilled in the art may set the range according to needs, and is not limited to the range recited in the claims, for example, the range is determined according to the effect after testing on a specific terminal device.
Taking Android equipment as an example, after each line of pixel points after rendering processing is obtained, each line of pixel points is usually stored as a Bitmap file (i.e., Bitmap data) for storage, and then when rendering is needed, the Bitmap file is displayed on an interface of the terminal equipment according to the sequence, so that the user can be provided with experience that pictures are slowly expanded from top to bottom, and the problem of abrupt display of the pictures is solved.
In addition, it is worth mentioning that, in the process of displaying the bitmap file on the interface of the terminal device according to the sequence, a decoding operation is specifically further included, that is, the bitmap file needs to be decoded, and then the data obtained by decoding is delivered to a GPU (Graphics Processing Unit) of the terminal device for display.
Regarding the specific implementation of the decoding operation, those skilled in the art may set different decoding implementation manners for terminal devices of different operating systems according to actual needs, and details are not described here.
The above is only a specific implementation manner of the picture processing method on the Android device, and when picture processing operations are performed on numerous devices of other types, a person skilled in the art can perform conventional processing according to needs, and the specific implementation manner is not limited herein, and the above manner does not limit the scope of the present invention.
It should be noted that, in the picture processing method provided in this embodiment, in the process of performing rendering processing according to the preset rendering time interval of each row of pixel points in a row unit, the gaussian blur processing operation is continuously performed, that is, in the process of performing rendering processing according to the preset rendering time interval of each row of pixel points in a row unit, the gaussian blur processing is still performed on an area to be blurred in the area to be blurred, and the operation continues until all the areas to be blurred are subjected to the gaussian blur processing and the rendering processing.
Compared with the prior art, the picture processing method provided by the embodiment can execute the Gaussian blur processing and the rendering processing in parallel by advancing the starting time of the rendering processing, and effectively shortens the time from the picture blur processing to the rendering display, thereby shortening the total time and achieving the purpose of reducing the waiting time of a user. In addition, the bitmap file obtained after rendering processing is displayed on the interface of the terminal device according to the sequence, so that the user can experience that the picture is slowly unfolded from top to bottom, and the problem of abrupt display of the picture is solved.
In addition, it should be noted that the picture processing method provided by the present embodiment may be an independent application function for users to process pictures, or may be embedded in some application program to implement preset picture processing requirements, such as automatic blurring of background pictures, etc., whichever implementation manner is within the protection scope of the present invention, and adding insignificant modifications to algorithms or processes or introducing insignificant designs is within the protection scope of the present invention, but the core design without changing the algorithms and processes thereof is within the protection scope of the present invention.
A second embodiment of the present invention relates to a picture processing method. This embodiment is substantially the same as the first embodiment, and mainly differs therefrom in that: in the first embodiment, it is monitored whether the current state satisfies the start condition of the rendering process, specifically, by determining whether the current system time is equal to a preset time point at which the rendering process starts. In this embodiment, whether the current state meets the condition for starting the rendering process is monitored, specifically, whether the line number of the pixel points stored in the storage space is equal to the preset line number for starting the rendering process is determined, and a specific flow is shown in fig. 5.
Specifically, the present embodiment includes steps 501 to 506, where steps 501 to 503 and 506 are substantially the same as steps 101 to 103 and 106 in the first embodiment, and are not repeated here, and the following differences are mainly introduced:
in step 504, the number of rows of the pixel points stored in the storage space is obtained.
In step 505, it is determined whether the number of lines of the obtained pixel point is equal to a preset number of lines at which the rendering process starts. If the number of lines of the acquired pixel points is equal to the number of lines of the preset rendering process, determining that the current state meets the condition of the rendering process, entering step 506, and performing rendering process according to the rendering time interval of the pixel points of each line in a row unit; otherwise, returning to step 504, re-obtaining the number of lines of the pixel points stored in the storage space until the number of lines of the pixel points obtained equals to the number of lines at the beginning of the preset rendering processing, and entering step 506 or ending the image processing operation.
Compared with the prior art, the picture processing method provided in the embodiment includes the steps that the number of rows of the pixel points stored in the storage space is obtained, the obtained number of rows of the pixel points is compared with the preset number of rows at the beginning of rendering processing, when the obtained number of rows of the pixel points is equal to the preset number of rows at the beginning of rendering processing, from the first row of pixel points stored in the storage space, rendering processing is carried out according to the preset rendering time interval of each row of pixel points in a behavior unit, the problem that errors exist between actual processing time and preset time due to different performances of terminal equipment is solved, the starting time of rendering processing is guaranteed, the time from picture fuzzy processing to rendering display is controllable, and the picture processing effect is further guaranteed.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A third embodiment of the present invention relates to a terminal device. The terminal device comprises a memory and a processor, wherein a preset program is stored in the memory, and the processor reads the program stored in the memory and executes the picture processing method related to any embodiment of the invention according to the program.
Specifically, the specific structure of the terminal device is shown in fig. 6.
The terminal device includes: one or more processors 601 and a memory 602, one processor 601 being illustrated in fig. 6. The processor 601 and the memory 602 may be connected by a bus or other means, and fig. 6 illustrates an example of a connection by a bus. The memory 602, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, for example, whether the current state satisfies the starting condition of the rendering process, the preset rendering time interval of each row of pixel points, and the like in any method embodiment of the present invention is stored in the memory 602. The processor 601 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 602, that is, implements the picture processing method described in any of the method embodiments above.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store a list of options, etc. Further, the memory 602 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 602 may optionally include memory located remotely from the processor 601, which may be connected to an external device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory 602 and, when executed by the one or more processors 601, perform the picture processing method referred to in any of the method embodiments above.
The product can execute the method provided by the embodiment of the application, has corresponding functional modules and beneficial effects of the execution method, does not describe the technical details in the embodiment in detail, and can refer to the picture processing method related to any method implementation of the invention.
A fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program, when executed by a processor, implements the picture processing method provided by any of the embodiments of the present invention.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the above embodiments may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (12)

1. A picture processing method, characterized in that the picture processing method comprises:
acquiring a to-be-blurred area in a to-be-processed picture;
performing Gaussian blur processing on the area to be blurred, and storing the processed pixel points into a pre-allocated storage space;
monitoring whether the current state meets the starting condition of rendering processing or not in the process of carrying out Gaussian blur processing on the region to be blurred;
when the condition of starting the rendering processing is met, reading the pixel points from the storage space, and performing the rendering processing; and in the process of rendering, continuously carrying out the Gaussian blur processing on the rest part of the region to be blurred until the completion of the Gaussian blur processing is completed.
2. The method according to claim 1, wherein the storing the processed pixel points into a pre-allocated storage space specifically comprises:
and storing the processed pixel points into a pre-allocated storage space in a row unit.
3. The picture processing method according to claim 2, wherein the rendering process includes displaying the pixels in each row in a row unit in sequence at preset intervals.
4. The picture processing method according to claim 3, wherein the time interval is set using the following formula:
T≥(1-P)×H×(W×t);
wherein, T is the time required for rendering all the pixels in the to-be-blurred region, H is the total number of rows of pixels included in the to-be-blurred region, Δ T is the rendering time interval, P is the percentage of the progress of gaussian blurring, W is the total number of columns of pixels included in the to-be-blurred region, and T is the time required for processing one pixel by gaussian blurring.
5. The method according to claim 4, wherein the percentage P is calculated by using the following formula:
wherein, x is the number of rows of pixel points corresponding to the time point when rendering processing starts, P is the percentage of the progress of gaussian fuzzy processing, and H is the total number of rows of pixel points included in the region to be fuzzy.
6. The picture processing method according to claim 5, wherein the value of P ranges from 40% to 80%.
7. The picture processing method according to claim 6, wherein the value range of P is between 50% and 60%.
8. The method according to any one of claims 1 to 7, wherein the monitoring whether the current state satisfies a starting condition of the rendering process specifically includes:
acquiring current system time;
and when the acquired system time is equal to a preset time point when the rendering processing is started, determining that the current state meets the condition of starting the rendering processing.
9. The method according to any one of claims 1 to 7, wherein the monitoring whether the current state satisfies a starting condition of the rendering process specifically includes:
acquiring the line number of the pixel points stored in the storage space;
and when the acquired line number of the pixel point is equal to a preset line number for starting rendering processing, determining that the current state meets the condition for starting rendering processing.
10. The image processing method according to any one of claims 1 to 7, wherein the acquiring the region to be blurred specifically includes:
acquiring the picture to be processed;
determining the area of the fuzzy object in the picture to be processed according to a preset fuzzy object;
determining the area of the fuzzy object in the picture to be processed as the area to be fuzzy.
11. A terminal device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the picture processing method of any one of claims 1 to 10.
12. A computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the picture processing method according to any one of claims 1 to 10.
CN201810020059.5A 2018-01-09 2018-01-09 Picture processing method, terminal device and computer readable storage medium Expired - Fee Related CN108399605B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810020059.5A CN108399605B (en) 2018-01-09 2018-01-09 Picture processing method, terminal device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810020059.5A CN108399605B (en) 2018-01-09 2018-01-09 Picture processing method, terminal device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108399605A true CN108399605A (en) 2018-08-14
CN108399605B CN108399605B (en) 2021-07-06

Family

ID=63093775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810020059.5A Expired - Fee Related CN108399605B (en) 2018-01-09 2018-01-09 Picture processing method, terminal device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108399605B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110766617A (en) * 2019-09-12 2020-02-07 江苏理工学院 Rendering acceleration method with dynamic blurring and sampling quantity reduction function
CN110807114A (en) * 2019-11-07 2020-02-18 北京无限光场科技有限公司 Method, device, terminal and storage medium for picture display
CN111125113A (en) * 2019-12-25 2020-05-08 中科三清科技有限公司 Method and device for storing air pollutant data
WO2023103682A1 (en) * 2021-12-10 2023-06-15 北京字跳网络技术有限公司 Image processing method and apparatus, device, and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188554A (en) * 2011-12-29 2013-07-03 盛趣信息技术(上海)有限公司 Image coding method and image coding system
CN104200459A (en) * 2014-08-04 2014-12-10 联想(北京)有限公司 Information processing method and electronic device
CN104217402A (en) * 2014-08-20 2014-12-17 北京奇艺世纪科技有限公司 Real-time Gaussian Blur method and device of video on mobile equipment
US8982120B1 (en) * 2013-12-18 2015-03-17 Google Inc. Blurring while loading map data
US20160309131A1 (en) * 2013-12-24 2016-10-20 Olympus Corporation Image processing device, imaging device, information storage medium, and image processing method
CN107092684A (en) * 2017-04-21 2017-08-25 腾讯科技(深圳)有限公司 Image processing method and device, storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188554A (en) * 2011-12-29 2013-07-03 盛趣信息技术(上海)有限公司 Image coding method and image coding system
US8982120B1 (en) * 2013-12-18 2015-03-17 Google Inc. Blurring while loading map data
US20160309131A1 (en) * 2013-12-24 2016-10-20 Olympus Corporation Image processing device, imaging device, information storage medium, and image processing method
CN104200459A (en) * 2014-08-04 2014-12-10 联想(北京)有限公司 Information processing method and electronic device
CN104217402A (en) * 2014-08-20 2014-12-17 北京奇艺世纪科技有限公司 Real-time Gaussian Blur method and device of video on mobile equipment
CN107092684A (en) * 2017-04-21 2017-08-25 腾讯科技(深圳)有限公司 Image processing method and device, storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110766617A (en) * 2019-09-12 2020-02-07 江苏理工学院 Rendering acceleration method with dynamic blurring and sampling quantity reduction function
CN110807114A (en) * 2019-11-07 2020-02-18 北京无限光场科技有限公司 Method, device, terminal and storage medium for picture display
CN110807114B (en) * 2019-11-07 2024-01-30 北京有竹居网络技术有限公司 Method, device, terminal and storage medium for picture display
CN111125113A (en) * 2019-12-25 2020-05-08 中科三清科技有限公司 Method and device for storing air pollutant data
CN111125113B (en) * 2019-12-25 2020-09-15 中科三清科技有限公司 Method and device for storing air pollutant data
WO2023103682A1 (en) * 2021-12-10 2023-06-15 北京字跳网络技术有限公司 Image processing method and apparatus, device, and medium

Also Published As

Publication number Publication date
CN108399605B (en) 2021-07-06

Similar Documents

Publication Publication Date Title
CN108399605B (en) Picture processing method, terminal device and computer readable storage medium
KR102010712B1 (en) Distortion Correction Method and Terminal
CN109788138A (en) Screen control method, device, terminal and storage medium
TWI777098B (en) Method, apparatus and electronic device for image processing and storage medium thereof
WO2018176876A1 (en) Image display method, mobile terminal, and computer storage medium
CN108564546B (en) Model training method and device and photographing terminal
CN105677259A (en) Method for storing file in mobile terminal and mobile terminal
WO2015161809A1 (en) Picture splitting method and apparatus, and picture loading method and apparatus
CN107657587A (en) Image processing method, apparatus and system
CN112115811A (en) Image processing method and device based on privacy protection and electronic equipment
CN113791857B (en) Application window background fuzzy processing method and device in Linux system
CN109727211A (en) A kind of image de-noising method, calculates equipment and medium at device
CN110087096A (en) Method for processing video frequency, device and computer readable storage medium
CN111028180B (en) Image processing method, video processing method and corresponding devices
CN106683129B (en) Relative reduction texture decomposition method and device based on bilateral kernel regression
US20170310872A1 (en) Image dynamic range adjustment method, terminal, and storage medium
CN107590240B (en) Method and device for adjusting size of characters for page rendering
CN111045576B (en) Display control method, display control device, terminal equipment and electronic equipment
US20160117794A1 (en) Modifying gradation in an image frame including applying a weighting to a previously processed portion of the image frame
US9704506B2 (en) Harmonic feature processing for reducing noise
CN104978712B (en) Image processing method and device
CN114299014A (en) Image processing architecture, method, electronic device and storage medium
CN109978801B (en) Image processing method and image processing device
CN110298903B (en) Curve editing method and device, computing equipment and storage medium
CN109640170B (en) Speed processing method of self-shooting video, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210706

Termination date: 20220109