CN108564539B - Method and device for displaying image - Google Patents

Method and device for displaying image Download PDF

Info

Publication number
CN108564539B
CN108564539B CN201810008379.9A CN201810008379A CN108564539B CN 108564539 B CN108564539 B CN 108564539B CN 201810008379 A CN201810008379 A CN 201810008379A CN 108564539 B CN108564539 B CN 108564539B
Authority
CN
China
Prior art keywords
filtering
image
radius
target
filtering radius
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.)
Expired - Fee Related
Application number
CN201810008379.9A
Other languages
Chinese (zh)
Other versions
CN108564539A (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 CN201810008379.9A priority Critical patent/CN108564539B/en
Publication of CN108564539A publication Critical patent/CN108564539A/en
Application granted granted Critical
Publication of CN108564539B publication Critical patent/CN108564539B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T5/70

Abstract

The invention discloses a method and a device for displaying an image, and belongs to the technical field of image processing. The method comprises the following steps: receiving a Gaussian blur processing instruction for a target image, and acquiring a target filtering radius; determining at least one intermediate filtering radius according to the target filtering radius and the number of image processing threads; performing, by a plurality of image processing threads, gaussian blur processing based on the at least one intermediate filtering radius and the target filtering radius, respectively, and based on the target image at the same time; and sequentially displaying the target images after the Gaussian blur processing corresponding to the plurality of image processing threads according to the sequence of the filtering radius from small to large. By adopting the invention, the effect of displaying the image can be improved.

Description

Method and device for displaying image
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and an apparatus for displaying an image.
Background
With the rapid development of computer technology, image processing technology has also been widely used. Gaussian blurring is a common image processing technique, and mainly performs blurring on an image based on a gaussian curve, which can be used to reduce image noise.
After a user selects an image needing Gaussian blur processing, the terminal can reassign the pixel value of each pixel point in the image through a Gaussian filter function. Specifically, the terminal may set a filtering radius, and then, for each pixel point, select a peripheral pixel point within the filtering radius with the pixel point as a central pixel point, and then, according to the pixel values of the peripheral pixel points and corresponding preset weights, calculate the pixel value of the central pixel point after the gaussian blur processing by combining the pixel value of the central pixel point and the preset weights, thereby obtaining an image after the gaussian blur processing.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
due to the limitation of hardware performance, the terminal may consume a long processing time for performing the gaussian blur processing, so that after the processing is started, the terminal will continuously display the original image and display the image after the gaussian blur processing after a long period of time, and thus the effect of displaying the image is poor.
Disclosure of Invention
In order to solve the problems of the prior art, embodiments of the present invention provide a method and apparatus for displaying an image. The technical scheme is as follows:
in a first aspect, a method of displaying an image is provided, the method comprising:
receiving a Gaussian blur processing instruction for a target image, and acquiring a target filtering radius;
selecting at least one intermediate filtering radius according to the target filtering radius and the number of image processing threads;
performing, by a plurality of image processing threads, gaussian blur processing based on the at least one intermediate filtering radius and the target filtering radius, respectively, and based on the target image at the same time;
and sequentially displaying the target images after the Gaussian blur processing corresponding to the plurality of image processing threads according to the sequence of the filtering radius from small to large.
Optionally, the selecting at least one intermediate filtering radius according to the target filtering radius and the number of image processing threads includes:
and selecting at least one intermediate filtering radius from positive integers smaller than the target filtering radius, wherein the number of the intermediate filtering radii is smaller than the number of the image processing threads, and the at least one intermediate filtering radius and the target filtering radius form an arithmetic progression.
Optionally, the method further includes:
obtaining the Gaussian blur processing time corresponding to the minimum filtering radius in the at least one intermediate filtering radius;
determining the mathematical relation of the Gaussian blur processing time corresponding to different filtering radii according to the multiplication times and the addition times contained in the Gaussian blur processing corresponding to different filtering radii;
and calculating the display duration of the target image after the Gaussian blur processing corresponding to different filtering radii according to the Gaussian blur processing time corresponding to the minimum filtering radius and the mathematical relationship.
Optionally, the displaying, according to the order from small to large of the filtering radius, the target images after the gaussian blur processing corresponding to the plurality of image processing threads in sequence includes:
setting gradual animation for the Gaussian-blurred target images corresponding to different filtering radii according to the display duration of the Gaussian-blurred target images corresponding to different filtering radii;
and sequentially displaying the target images after the Gaussian blur processing corresponding to the image processing threads in the form of the gradual-change animation according to the sequence of the filtering radiuses from small to large.
Optionally, the method further includes:
receiving a fuzziness adjusting instruction for a target image, and acquiring a current filtering radius and a final filtering radius;
selecting at least one transition filtering radius according to the current filtering radius, the final filtering radius and the number of the image processing threads;
performing, by a plurality of image processing threads, gaussian blur processing based on the target image while respectively based on the at least one transition filtering radius and the final filtering radius;
and sequentially displaying the target images after the Gaussian blur processing corresponding to the plurality of image processing threads according to the sequence of the filtering radius from small to large.
In a second aspect, there is provided an apparatus for displaying an image, the apparatus comprising:
the receiving module is used for receiving a Gaussian blur processing instruction for a target image and acquiring a target filtering radius;
the selection module is used for selecting at least one intermediate filtering radius according to the target filtering radius and the number of the image processing threads;
the processing module is used for performing Gaussian blur processing on the basis of the at least one intermediate filtering radius and the target image through a plurality of image processing threads;
and the display module is used for sequentially displaying the target images after the Gaussian blur processing corresponding to the image processing threads according to the sequence of the filtering radius from small to large.
Optionally, the selecting module is specifically configured to:
and selecting at least one intermediate filtering radius from positive integers smaller than the target filtering radius, wherein the number of the intermediate filtering radii is smaller than the number of the image processing threads, and the at least one intermediate filtering radius and the target filtering radius form an arithmetic progression.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring the Gaussian blur processing time corresponding to the minimum filtering radius in the at least one intermediate filtering radius;
the determining module is used for determining the mathematical relation of the Gaussian blur processing time corresponding to different filtering radiuses according to the multiplication times and the addition times contained in the Gaussian blur processing corresponding to different filtering radiuses;
and the calculation module is used for calculating the display duration of the target image after the Gaussian blur processing corresponding to different filtering radii according to the Gaussian blur processing time corresponding to the minimum filtering radius and the mathematical relationship.
Optionally, the display module is specifically configured to:
setting gradual animation for the Gaussian-blurred target images corresponding to different filtering radii according to the display duration of the Gaussian-blurred target images corresponding to different filtering radii;
and sequentially displaying the target images after the Gaussian blur processing corresponding to the image processing threads in the form of the gradual-change animation according to the sequence of the filtering radiuses from small to large.
Optionally, the receiving module is further configured to receive a blur degree adjustment instruction for the target image, and obtain a current filtering radius and a final filtering radius;
the selection module is further configured to select at least one transition filtering radius according to the current filtering radius, the final filtering radius and the number of image processing threads;
the processing module is further configured to perform, through a plurality of image processing threads, gaussian blur processing based on the target image and the at least one transition filtering radius and the final filtering radius, respectively;
and the display module is further used for sequentially displaying the target images after the Gaussian blur processing corresponding to the plurality of image processing threads according to the sequence of the filtering radius from small to large.
In a third aspect, there is provided a terminal comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by the processor to implement the method of displaying an image according to the first aspect.
In a fourth aspect, there is provided a computer readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by a processor to implement the method of displaying an image according to the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, a Gaussian blur processing instruction for a target image is received, a target filtering radius is obtained, at least one intermediate filtering radius is determined according to the target filtering radius and the number of image processing threads, Gaussian blur processing is carried out on the target image through a plurality of image processing threads based on the at least one intermediate filtering radius and the target filtering radius respectively, and the target image after the Gaussian blur processing corresponding to the image processing threads is displayed in sequence according to the sequence of the filtering radii from small to large. Therefore, after the image is subjected to Gaussian blur processing, the terminal can smoothly display the image subjected to Gaussian blur processing according to the progressive sequence of the image blurriness, so that the image effect viewed by a user is changed from clear to gradually blurred instead of hard jump between the original image and the final image, the time length for the terminal to continuously display the original image is shortened, and the image display effect is optimized.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a method for displaying an image according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a process for displaying images according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a display duration calculation according to an embodiment of the present invention;
FIG. 4 is a flowchart of a method for adjusting image blur according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an apparatus for displaying images according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of an apparatus for displaying images according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides a method for displaying an image, and an execution main body of the method can be a terminal. The terminal can be any terminal with an image processing function, such as a mobile phone, a computer, and the like, and an image processing application program can be installed on the terminal, and the image processing application program can be used for performing gaussian blur processing on the image. The terminal can be provided with a processor, a memory, a display component and an input component, wherein the processor can be used for processing the process of displaying the image, the memory can be used for storing data required in the following processing process and generated data, the display component can be used for displaying the image, displaying an application interface and the like, can be a screen, and the input component can be used for inputting instructions to the terminal by a user, and can be a keyboard or control keys and the like. In this embodiment, a terminal is taken as an example of a computer to perform detailed description of the scheme, and other situations are similar to the above, and the detailed description is omitted here.
The process flow shown in fig. 1 will be described in detail below with reference to specific embodiments, and the contents may be as follows:
step 101, receiving a gaussian blur processing instruction for a target image, and acquiring a target filtering radius.
In implementation, a user can install an image processing application program for editing and modifying an image on the terminal, and the image processing application program can support a Gaussian blur processing function. When a user wants to perform gaussian blur processing on an image (e.g., a target image), the user may open the image processing application, load the target image, and then select a menu item of gaussian blur in a function menu of image processing. Thereafter, the user can set the image blur degree of the gaussian blur processing and click the start button. At this time, the terminal may receive a gaussian blur processing instruction for the target image input by the user, and start to perform gaussian blur processing on the target image. Specifically, the terminal may first determine a target filtering radius corresponding to the image blur degree set by the user. It will be appreciated that gaussian blur processing for different filter radii will produce different degrees of image blur. Of course, the target filter radius may also be directly input to the terminal by the user.
Step 102, selecting at least one intermediate filtering radius according to the target filtering radius and the number of image processing threads.
In implementation, after acquiring the target filtering radius, the terminal may determine the number of currently available image processing threads. The number of the image processing threads can be determined by the total processing threads and the current load condition of the terminal, and can also be set by a system user. Then, the terminal may select at least one intermediate filtering radius smaller than the target filtering radius, and ensure that the number of the intermediate filtering radii is smaller than the number of the image processing threads.
Optionally, when the plurality of filtering radii are linear, the change of the blur degree of the image when the image is displayed will be smoother, and accordingly, the processing in step 102 may be as follows: and selecting at least one intermediate filtering radius from the positive integers smaller than the target filtering radius, wherein the number of the intermediate filtering radii is smaller than the number of the image processing threads, and the at least one intermediate filtering radius and the target filtering radius form an arithmetic progression.
In implementation, after the terminal obtains the target filtering radius, at least one intermediate filtering radius may be selected from all positive integers smaller than the target filtering radius, so that the at least one intermediate filtering radius and the target filtering radius form an arithmetic progression. Meanwhile, the terminal can also determine the number of the currently available image processing threads, and when the intermediate filtering radius is selected, the number of the intermediate filtering radii is ensured to be smaller than the number of the image processing threads. For example, if the target filtering radius is 12 and the number of available image processing threads is 4, the selected intermediate filtering radii may be: 3. 6, 9, or may be: 4. 8, or may also be: 6. further, in order to improve the image display effect, a case where the usage rate of all the graphics processing threads is the highest is selected by default, and of course, the number of the image processing threads to be specifically used may be determined according to the setting.
And 103, performing Gaussian blur processing on the basis of at least one intermediate filtering radius and a target filtering radius and the target image through a plurality of image processing threads.
In an implementation, after determining the at least one intermediate filtering radius, the terminal may respectively deliver the gaussian blur processing corresponding to the at least one intermediate filtering radius and the target filtering radius to the plurality of image processing threads to complete, that is, the plurality of image processing threads may start the gaussian blur processing with different filtering radii for the target image at the same time. For example, if there are 3 intermediate filter radii, it is possible to start gaussian blur processing corresponding to the 3 intermediate filter radii and one target filter radius of the target image at the same time by 4 image processing threads.
And step 104, sequentially displaying the target images after the Gaussian blur processing corresponding to the image processing threads according to the sequence of the filtering radius from small to large.
In implementation, after the terminal starts to perform the gaussian blurring processing on the target image through a plurality of image processing threads at the same time, the required time duration of the gaussian blurring processing is different due to different sizes of the filtering radii, wherein the smaller the filtering radius is, the shorter the required time duration is. Therefore, the Gaussian blur processing with small filtering radius is completed first, and the plurality of image processing threads complete the Gaussian blur processing on the target image in sequence according to the sequence from small filtering radius to large filtering radius. Further, the terminal may sequentially display the target images after the gaussian blur processing corresponding to the plurality of image processing threads in the above order. Fig. 2 is a schematic diagram illustrating the image displaying process from step 101 to step 104.
Optionally, the display duration of the target image processed by each image processing thread may be determined based on the gaussian blur processing time corresponding to different filter halves, and the corresponding processing may be as follows: obtaining Gaussian blur processing time corresponding to the minimum filtering radius in at least one intermediate filtering radius; determining the mathematical relation of the Gaussian blur processing time corresponding to different filtering radii according to the multiplication times and the addition times contained in the Gaussian blur processing corresponding to different filtering radii; and calculating the display duration of the target image after the Gaussian blur processing corresponding to different filtering radii according to the Gaussian blur processing time corresponding to the minimum filtering radius and the mathematical relationship.
In implementation, the terminal starts the gaussian blur processing on the target image through the plurality of image processing threads, may start timing at the same time, may stop timing when it is detected that the first image processing thread completes the gaussian blur processing, and at this time, the terminal may obtain the gaussian blur processing time corresponding to the minimum filter radius of the at least one intermediate filter radius. And then, the terminal can determine the mathematical relation of the Gaussian blur processing time corresponding to different filtering radii according to the multiplication times and the addition times contained in the Gaussian blur processing corresponding to different filtering radii.
Specifically, assuming that the filtering radius is R, for a pixel point in the target image, it is necessary to determine the pixel point and the surrounding (2R +1)2-the pixel values of 1 pixel are weighted-averaged, i.e. (2R +1)2A sub-multiplication operation and(2R+1)2-1 addition operation. Can be provided with T1Time for terminal to perform one multiplication, T2The time for performing an addition operation for the terminal, then, the calculation time for one pixel point may be
Figure BDA0001539422800000073
If the number of pixel points of the image is N, the time for carrying out Gaussian blur processing on the whole image is about t ≈ 2R +1)2]×(T1+T2) And (4) multiplied by N. Further, different filter radii Rm、RnCorresponding Gaussian blur processing time tm、tnThe mathematical relationship of (1) is as follows:
Figure BDA0001539422800000071
further, it is possible to prevent the occurrence of,
Figure BDA0001539422800000072
thus, the Gaussian blur processing time t corresponding to the minimum filter radius is obtained1Thereafter, can be based on t1And calculating with the mathematical relationship to obtain the Gaussian blur processing time corresponding to different filtering radiuses: t is t2、t3、t4…. The time for displaying one image is the time for subtracting the time for processing the Gaussian blur of the previous image from the time for processing the Gaussian blur of the next image, so that the next image can be continuously displayed after the previous image is displayed, therefore, different filtering radiuses Rn-1The display duration of the corresponding target image after the gaussian blur processing may be tn-tn-1. It is understood that the target image after the gaussian blur processing corresponding to the target filtering radius is the last target image, and thus the terminal defaults to continuously display the target image. The calculation process of the display time length described above can refer to fig. 3.
Alternatively, the target image may be displayed in a gradual animation form based on the display time, and accordingly, the processing of step 103 may be as follows: setting gradual animation for the Gaussian-blurred target images corresponding to different filtering radii according to the display duration of the Gaussian-blurred target images corresponding to different filtering radii; and sequentially displaying the target images after the Gaussian blur processing corresponding to the image processing threads in a gradual animation mode according to the sequence of the filtering radius from small to large.
In implementation, after the terminal displays the target image after the gaussian blur processing corresponding to the minimum filtering radius, the terminal may calculate the display duration of the target image after the gaussian blur processing corresponding to different filtering radii. Therefore, the terminal can set the gradual animation for the target image after the Gaussian blur processing corresponding to different filtering radii according to the display duration of the target image after the Gaussian blur processing corresponding to different filtering radii. Furthermore, the terminal displays the target images after the Gaussian blur processing corresponding to the image processing threads in a gradual animation mode according to the sequence from small to large of the filtering radius. The effect of the above-mentioned gradual-change animation can be that the previous image is added with a fade-out animation, the current image is added with a fade-in animation, the two animation effects are performed simultaneously, and the execution time of the gradual-change animation is the display duration of the current image.
For example, take the current image as the second image, and the display duration is t3-t2Adding time length t to the first image when the second image begins to be displayed3-t2While adding a time period t based on the second image3-t2Fade-in animation of (2). Of course, the gradual animation of any other effect can be selected, and the animation duration of the gradual animation can be freely set. It should be noted that, for the target image after the gaussian blur processing corresponding to the target filtering radius, the display duration is set to be infinite, so the animation duration of the corresponding gradual animation may be set to be equal to the animation duration of the previous target image.
It is understood that, in the whole process of displaying the target image, the user can perform the display pause operation at any time, so that the terminal will continuously display the target image currently being displayed and stop the gaussian blur processing for the target image in all the image processing threads.
Optionally, this embodiment further provides a processing flow for adjusting the image blur degree after the image is displayed, and specific contents may be as shown in fig. 4:
step 401, receiving a blur degree adjustment instruction for a target image, and acquiring a current filtering radius and a final filtering radius.
In implementation, when the terminal displays the target image after the gaussian blur processing, if the user resets the image blur degree of the gaussian blur processing, the terminal may obtain a current filtering radius corresponding to the image blur degree of the target image at the time and a final filtering radius corresponding to the newly set image blur degree. It is to be understood that, in connection with the processing of steps 101 to 104, the current filtering radius may be any one of at least one intermediate filtering radius or a target filtering radius. Of course, the final filter radius may be directly input to the value terminal by the user.
Step 402, selecting at least one transition filtering radius according to the current filtering radius, the final filtering radius and the number of image processing threads.
In implementation, after acquiring the current filtering radius and the final filtering radius, the terminal may determine the number of currently available image processing threads. The number of image processing threads can be determined by the total processing thread of the terminal and the current load condition, and can also be specifically set by the user. Then, the terminal can select at least one transition filtering radius between the current filtering radius and the final filtering radius, and ensure that the number of the transition filtering radii is smaller than the number of the image processing threads. It will be understood that, based on the above consideration that the at least one intermediate filter radius and the target filter radius form an arithmetic progression, here the at least one transition filter radius, the current filter radius and the final filter radius may also form an arithmetic progression.
And step 403, performing Gaussian blur processing on the basis of at least one transition filtering radius and at least one final filtering radius and on the basis of the target image through a plurality of image processing threads.
In implementation, after determining at least one transition filtering radius, the terminal may respectively deliver the gaussian blur processing corresponding to the at least one transition filtering radius and the final filtering radius to a plurality of image processing threads to complete, that is, the plurality of image processing threads may simultaneously start the gaussian blur processing with different filtering radii for the target image. In one case, in combination with the processing in steps 101 to 104, the user may adjust the image blur degree of the target image after displaying the target image after the gaussian blur processing corresponding to the target filter radius on the terminal. In another case, the user may adjust the image blur degree of the target image when the terminal displays the target image after the gaussian blur processing corresponding to any intermediate filter radius, that is, when at least one image processing thread does not complete the gaussian blur processing of the target image, at this time, the at least one image processing thread stops the incomplete gaussian blur processing and starts the gaussian blur processing corresponding to a new filter radius.
And step 404, sequentially displaying the target images after the Gaussian blur processing corresponding to the plurality of image processing threads according to the sequence of the filtering radius from small to large.
The specific processing in this step may refer to step 104, and is not described here again.
It should be noted that the method for displaying the image may also be implemented by being embedded in other applications, for example, in a virtual display of a system background picture, or in a scene required by other applications, in this application scene, the implementation program of the image display method is embedded in the applications, where specific parameter selections are set by a developer and a designer in advance.
In the embodiment of the invention, a Gaussian blur processing instruction for a target image is received, a target filtering radius is obtained, at least one intermediate filtering radius is determined according to the target filtering radius and the number of image processing threads, Gaussian blur processing is carried out on the target image through a plurality of image processing threads based on the at least one intermediate filtering radius and the target filtering radius respectively, and each target image after the Gaussian blur processing corresponding to the plurality of image processing threads is displayed in sequence according to the sequence of the filtering radii from small to large. Therefore, after the image is subjected to Gaussian blur processing, the terminal can smoothly display the image subjected to Gaussian blur processing according to the progressive sequence of the image blurriness, so that the image effect viewed by a user is changed from clear to gradually blurred instead of hard jump between the original image and the final image, the time length for the terminal to continuously display the original image is shortened, and the image display effect is optimized.
Based on the same technical concept, the embodiment of the invention also provides a device for displaying images, as shown in fig. 5, the device comprises
A receiving module 501, configured to receive a gaussian blur processing instruction for a target image, and obtain a target filtering radius;
a selecting module 502, configured to select at least one intermediate filtering radius according to the target filtering radius and the number of image processing threads;
a processing module 503, configured to perform, by using multiple image processing threads, gaussian blur processing based on the at least one intermediate filtering radius and the target filtering radius, respectively, and simultaneously based on the target image;
a display module 504, configured to sequentially display the target images after the gaussian blur processing corresponding to the multiple image processing threads according to a sequence from a small filtering radius to a large filtering radius.
Optionally, the selecting module 502 is specifically configured to:
and selecting at least one intermediate filtering radius from positive integers smaller than the target filtering radius, wherein the number of the intermediate filtering radii is smaller than the number of the image processing threads, and the at least one intermediate filtering radius and the target filtering radius form an arithmetic progression.
Optionally, as shown in fig. 6, the apparatus further includes:
an obtaining module 505, configured to obtain a gaussian blur processing time corresponding to a minimum filter radius of the at least one intermediate filter radius;
a determining module 506, configured to determine a mathematical relationship between gaussian blur processing times corresponding to different filter radii according to the number of multiplication operations and the number of addition operations included in the gaussian blur processing corresponding to different filter radii;
and the calculating module 507 is configured to calculate, according to the gaussian blur processing time corresponding to the minimum filtering radius and the mathematical relationship, a display duration of the target image after the gaussian blur processing corresponding to different filtering radii.
Optionally, the display module 504 is specifically configured to:
setting gradual animation for the Gaussian-blurred target images corresponding to different filtering radii according to the display duration of the Gaussian-blurred target images corresponding to different filtering radii;
and sequentially displaying the target images after the Gaussian blur processing corresponding to the image processing threads in the form of the gradual-change animation according to the sequence of the filtering radiuses from small to large.
Optionally, the receiving module 501 is further configured to receive a blur degree adjusting instruction for a target image, and obtain a current filtering radius and a final filtering radius;
the selecting module 502 is further configured to select at least one transition filtering radius according to the current filtering radius, the final filtering radius, and the number of image processing threads;
the processing module 503 is further configured to perform, by a plurality of image processing threads, gaussian blur processing based on the target image and the at least one transition filtering radius and the final filtering radius, respectively;
the display module 504 is further configured to sequentially display the target images after the gaussian blur processing corresponding to the plurality of image processing threads according to a sequence from a small filtering radius to a large filtering radius.
In the embodiment of the invention, a Gaussian blur processing instruction for a target image is received, a target filtering radius is obtained, at least one intermediate filtering radius is determined according to the target filtering radius and the number of image processing threads, Gaussian blur processing is carried out on the target image through a plurality of image processing threads based on the at least one intermediate filtering radius and the target filtering radius respectively, and each target image after the Gaussian blur processing corresponding to the plurality of image processing threads is displayed in sequence according to the sequence of the filtering radii from small to large. Therefore, after the image is subjected to Gaussian blur processing, the terminal can smoothly display the image subjected to Gaussian blur processing according to the progressive sequence of the image blurriness, so that the image effect viewed by a user is changed from clear to gradually blurred instead of hard jump between the original image and the final image, the time length for the terminal to continuously display the original image is shortened, and the image display effect is optimized.
It should be noted that: in the device for displaying an image according to the above embodiment, when displaying an image, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus for displaying an image and the method for displaying an image provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 7 is a schematic diagram illustrating a structure of a terminal according to an exemplary embodiment. The terminal may be used to implement the method of displaying an image provided in the above embodiments.
The terminal 700 may include RF (Radio Frequency) circuitry 110, memory 120 including one or more computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, audio circuitry 160, a WiFi (wireless fidelity) module 170, a processor 180 including one or more processing cores, and a power supply 190. Those skilled in the art will appreciate that the terminal structure shown in fig. 6 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then sends the received downlink information to the one or more processors 180 for processing; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 110 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 110 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), and the like.
The memory 120 may be used to store software programs and modules, and the processor 180 executes various functional applications and data processing by operating the software programs and modules stored in the memory 120. The memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal 700, and the like. Further, the memory 120 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 volatile solid state storage device. Accordingly, the memory 120 may further include a memory controller to provide the processor 180 and the input unit 130 with access to the memory 120.
The input unit 130 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 130 may include a touch-sensitive surface 131 as well as other input devices 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 131 (e.g., operations by a user on or near the touch-sensitive surface 131 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 180, and can receive and execute commands sent by the processor 180. Additionally, the touch-sensitive surface 131 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 131, the input unit 130 may also include other input devices 132. In particular, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 140 may be used to display information input by or provided to a user and various graphical user interfaces of the terminal 700, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 140 may include a Display panel 141, and optionally, the Display panel 141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when a touch operation is detected on or near the touch-sensitive surface 131, the touch operation is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in FIG. 6, touch-sensitive surface 131 and display panel 141 are shown as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 131 may be integrated with display panel 141 to implement input and output functions.
The terminal 700 can also include at least one sensor 150, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or a backlight when the terminal 700 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal 700, detailed descriptions thereof are omitted.
Audio circuitry 160, speaker 161, and microphone 162 may provide an audio interface between a user and terminal 700. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 160, and then outputs the audio data to the processor 180 for processing, and then to the RF circuit 110 to be transmitted to, for example, another terminal, or outputs the audio data to the memory 120 for further processing. The audio circuit 160 may also include an earbud jack to provide communication of a peripheral headset with the terminal 700.
WiFi belongs to a short-distance wireless transmission technology, and the terminal 700 can help a user send and receive e-mails, browse web pages, access streaming media, and the like through the WiFi module 170, and provides wireless broadband internet access for the user. Although fig. 6 shows the WiFi module 170, it is understood that it does not belong to the essential constitution of the terminal 700 and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 180 is a control center of the terminal 700, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal 700 and processes data by operating or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby performing overall monitoring of the mobile phone. Optionally, processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
The terminal 700 also includes a power supply 190 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 180 via a power management system to manage charging, discharging, and power consumption management functions via the power management system. The power supply 190 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal 700 may further include a camera, a bluetooth module, etc., which will not be described herein. Specifically, in this embodiment, the display unit of the terminal 700 is a touch screen display, and the terminal 700 further includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for performing the processing of the display image.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (12)

1. A method of displaying an image, the method comprising:
receiving a Gaussian blur processing instruction for a target image, and acquiring a target filtering radius;
selecting at least one intermediate filtering radius according to the target filtering radius and the number of image processing threads, wherein the intermediate filtering radius is smaller than the target filtering radius, and the number of the intermediate filtering radii is smaller than the number of the image processing threads;
performing, by a plurality of image processing threads, gaussian blur processing based on the at least one intermediate filtering radius and the target filtering radius, respectively, and based on the target image at the same time;
and sequentially displaying the target images after the Gaussian blur processing corresponding to the plurality of image processing threads according to the sequence of the filtering radius from small to large.
2. The method of claim 1, wherein selecting at least one intermediate filter radius based on the target filter radius and a number of image processing threads comprises:
and selecting at least one intermediate filtering radius from positive integers smaller than the target filtering radius, wherein the number of the intermediate filtering radii is smaller than the number of the image processing threads, and the at least one intermediate filtering radius and the target filtering radius form an arithmetic progression.
3. The method of claim 1, further comprising:
obtaining the Gaussian blur processing time corresponding to the minimum filtering radius in the at least one intermediate filtering radius;
determining the mathematical relation of the Gaussian blur processing time corresponding to different filtering radii according to the multiplication times and the addition times contained in the Gaussian blur processing corresponding to different filtering radii;
and calculating the display duration of the target image after the Gaussian blur processing corresponding to different filtering radii according to the Gaussian blur processing time corresponding to the minimum filtering radius and the mathematical relationship.
4. The method according to claim 3, wherein the sequentially displaying the target images after the gaussian blur processing corresponding to the plurality of image processing threads according to the order of the filtering radius from small to large comprises:
setting gradual animation for the Gaussian-blurred target images corresponding to different filtering radii according to the display duration of the Gaussian-blurred target images corresponding to different filtering radii;
and sequentially displaying the target images after the Gaussian blur processing corresponding to the image processing threads in the form of the gradual-change animation according to the sequence of the filtering radiuses from small to large.
5. The method according to any one of claims 1-4, further comprising:
receiving a fuzziness adjusting instruction for a target image, and acquiring a current filtering radius and a final filtering radius;
selecting at least one transition filtering radius according to the current filtering radius, the final filtering radius and the number of the image processing threads;
performing, by a plurality of image processing threads, gaussian blur processing based on the target image while respectively based on the at least one transition filtering radius and the final filtering radius;
and sequentially displaying the target images after the Gaussian blur processing corresponding to the plurality of image processing threads according to the sequence of the filtering radius from small to large.
6. An apparatus for displaying an image, the apparatus comprising:
the receiving module is used for receiving a Gaussian blur processing instruction for a target image and acquiring a target filtering radius;
a selection module, configured to select at least one intermediate filtering radius according to the target filtering radius and the number of image processing threads, where the intermediate filtering radius is smaller than the target filtering radius, and the number of the intermediate filtering radii is smaller than the number of the image processing threads;
the processing module is used for performing Gaussian blur processing on the basis of the at least one intermediate filtering radius and the target image through a plurality of image processing threads;
and the display module is used for sequentially displaying the target images after the Gaussian blur processing corresponding to the image processing threads according to the sequence of the filtering radius from small to large.
7. The apparatus according to claim 6, wherein the selection module is specifically configured to:
and selecting at least one intermediate filtering radius from positive integers smaller than the target filtering radius, wherein the number of the intermediate filtering radii is smaller than the number of the image processing threads, and the at least one intermediate filtering radius and the target filtering radius form an arithmetic progression.
8. The apparatus of claim 6, further comprising:
the acquisition module is used for acquiring the Gaussian blur processing time corresponding to the minimum filtering radius in the at least one intermediate filtering radius;
the determining module is used for determining the mathematical relation of the Gaussian blur processing time corresponding to different filtering radiuses according to the multiplication times and the addition times contained in the Gaussian blur processing corresponding to different filtering radiuses;
and the calculation module is used for calculating the display duration of the target image after the Gaussian blur processing corresponding to different filtering radii according to the Gaussian blur processing time corresponding to the minimum filtering radius and the mathematical relationship.
9. The apparatus of claim 8, wherein the display module is specifically configured to:
setting gradual animation for the Gaussian-blurred target images corresponding to different filtering radii according to the display duration of the Gaussian-blurred target images corresponding to different filtering radii;
and sequentially displaying the target images after the Gaussian blur processing corresponding to the image processing threads in the form of the gradual-change animation according to the sequence of the filtering radiuses from small to large.
10. The apparatus according to any one of claims 6 to 9, wherein the receiving module is further configured to receive an ambiguity adjustment instruction for a target image, and obtain a current filtering radius and a final filtering radius;
the selection module is further configured to select at least one transition filtering radius according to the current filtering radius, the final filtering radius and the number of image processing threads;
the processing module is further configured to perform, through a plurality of image processing threads, gaussian blur processing based on the target image and the at least one transition filtering radius and the final filtering radius, respectively;
and the display module is further used for sequentially displaying the target images after the Gaussian blur processing corresponding to the plurality of image processing threads according to the sequence of the filtering radius from small to large.
11. A terminal, characterized in that it comprises a processor and a memory in which at least one instruction, at least one program, set of codes or set of instructions is stored, which is loaded and executed by the processor to implement a method of displaying an image according to any one of claims 1 to 5.
12. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement a method of displaying an image according to any one of claims 1 to 5.
CN201810008379.9A 2018-01-04 2018-01-04 Method and device for displaying image Expired - Fee Related CN108564539B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810008379.9A CN108564539B (en) 2018-01-04 2018-01-04 Method and device for displaying image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810008379.9A CN108564539B (en) 2018-01-04 2018-01-04 Method and device for displaying image

Publications (2)

Publication Number Publication Date
CN108564539A CN108564539A (en) 2018-09-21
CN108564539B true CN108564539B (en) 2021-04-16

Family

ID=63529721

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810008379.9A Expired - Fee Related CN108564539B (en) 2018-01-04 2018-01-04 Method and device for displaying image

Country Status (1)

Country Link
CN (1) CN108564539B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045576B (en) * 2018-10-11 2023-06-02 阿里巴巴集团控股有限公司 Display control method, display control device, terminal equipment and electronic equipment
CN110335223B (en) * 2019-06-21 2022-08-05 北京奇艺世纪科技有限公司 Image blurring effect implementation method and device, electronic equipment and storage medium
CN111553850B (en) * 2020-03-30 2023-10-24 深圳一清创新科技有限公司 Three-dimensional information acquisition method and device based on binocular stereoscopic vision

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9094660B2 (en) * 2010-11-11 2015-07-28 Georgia Tech Research Corporation Hierarchical hole-filling for depth-based view synthesis in FTV and 3D video
CN103593822B (en) * 2012-08-17 2018-05-22 腾讯科技(深圳)有限公司 The method and apparatus that frosted special effect processing is carried out to data image
CN104794685B (en) * 2014-01-17 2019-04-26 腾讯科技(深圳)有限公司 A kind of method and device for realizing image denoising
CN104537697A (en) * 2014-12-17 2015-04-22 久邦计算机技术(广州)有限公司 Implementation method for progressively blurred animation
CN106339983A (en) * 2016-08-17 2017-01-18 乐视控股(北京)有限公司 Blurring animation realization method through Gaussian blurring and blurring animation realization device thereof

Also Published As

Publication number Publication date
CN108564539A (en) 2018-09-21

Similar Documents

Publication Publication Date Title
US10725646B2 (en) Method and apparatus for switching screen interface and terminal
CN109062467B (en) Split screen application switching method and device, storage medium and electronic equipment
EP3647926A1 (en) Mobile terminal and split screen control method thereof, and computer readable storage medium
CN108470571B (en) Audio detection method and device and storage medium
CN104778055B (en) Method and device for displaying progress bar
CN107219951B (en) Touch screen control method and device, storage medium and terminal equipment
WO2020007114A1 (en) Method and apparatus for switching split-screen application, storage medium, and electronic device
CN110908582A (en) Control method, touch control pen and electronic assembly
CN108564539B (en) Method and device for displaying image
CN110221765B (en) Video file playing method and device, storage medium and terminal
CN106302101B (en) Message reminding method, terminal and server
CN107193551B (en) Method and device for generating image frame
CN109660445B (en) Message processing method, device and storage medium
US20210124480A1 (en) Split view exiting method, split view exiting device, and electronic device
CN107622234B (en) Method and device for displaying budding face gift
WO2015135457A1 (en) Method, apparatus, and system for sending and playing multimedia information
CN105513098B (en) Image processing method and device
CN105159655B (en) Behavior event playing method and device
CN110865743A (en) Task management method and terminal equipment
CN110996003B (en) Photographing positioning method and device and mobile terminal
CN108845755A (en) split screen processing method, device, storage medium and electronic equipment
CN113296664A (en) Screen resolution adjusting method and device, terminal equipment and storage medium
CN108111553B (en) Method and device for providing service
CN106657278B (en) Data transmission method and device and computer equipment
CN112367425A (en) Volume adjusting method and device and terminal

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: 20210416

Termination date: 20220104