CN112132918A - Particle-based spotlight effect implementation method and device - Google Patents

Particle-based spotlight effect implementation method and device Download PDF

Info

Publication number
CN112132918A
CN112132918A CN202010883421.9A CN202010883421A CN112132918A CN 112132918 A CN112132918 A CN 112132918A CN 202010883421 A CN202010883421 A CN 202010883421A CN 112132918 A CN112132918 A CN 112132918A
Authority
CN
China
Prior art keywords
particle
position information
sampling
spotlight effect
central point
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
CN202010883421.9A
Other languages
Chinese (zh)
Other versions
CN112132918B (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.)
Draft Xiamen Information Service Co ltd
Gaoding Xiamen Technology Co Ltd
Original Assignee
Gaoding Xiamen 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 Gaoding Xiamen Technology Co Ltd filed Critical Gaoding Xiamen Technology Co Ltd
Priority to CN202010883421.9A priority Critical patent/CN112132918B/en
Publication of CN112132918A publication Critical patent/CN112132918A/en
Priority to PCT/CN2021/106952 priority patent/WO2022042130A1/en
Application granted granted Critical
Publication of CN112132918B publication Critical patent/CN112132918B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The invention discloses a particle-based spotlight effect implementation method, medium, equipment and device, wherein the method comprises the following steps: acquiring image information and central point position information, wherein the image information comprises a plurality of particles and position information corresponding to each particle; calculating the light emitting direction of each particle according to the position information of the central point and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point; sampling according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, generating a mask according to the sampling result corresponding to each particle, and fusing the mask and the image information to generate a spotlight effect image; the spotlight effect can be effectively generated based on the particle system, meanwhile, the required calculation amount in the spotlight effect generation process is reduced, and the generation efficiency is improved.

Description

Particle-based spotlight effect implementation method and device
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method for implementing a particle-based spotlight effect, a computer-readable storage medium, a computer device, and an apparatus for implementing a particle-based spotlight effect.
Background
Graphically, spotlight effects are widely used as typical lighting effects.
In the related art, when a spotlight effect is realized in a particle system, a light source is often required to be added for each particle; furthermore, since the positions of the particles are randomly generated, the light source needs to be rebound when the positions of the particles change. Further, the spotlight effect generation efficiency is low, the calculation amount is large, and the calculation process is complicated.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, an object of the present invention is to provide a method for implementing a particle-based spotlight effect, which can effectively generate a spotlight effect based on a particle system, and at the same time, reduce the amount of calculation required in the process of generating the spotlight effect and improve the generation efficiency.
A second object of the invention is to propose a computer-readable storage medium.
A third object of the invention is to propose a computer device.
A fourth object of the invention is to propose a particle based spotlight effect realisation arrangement.
In order to achieve the above object, a first embodiment of the present invention provides a method for implementing a particle-based spotlight effect, including the following steps: acquiring image information and central point position information, wherein the image information comprises a plurality of particles and position information corresponding to each particle; calculating the light emitting direction of each particle according to the position information of the central point and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point; sampling is carried out according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, a mask is generated according to the sampling result corresponding to each particle, and the mask and the image information are fused to generate a spotlight effect image.
According to the method for realizing the spotlight effect based on the particles, firstly, image information and central point position information are obtained, wherein the image information comprises a plurality of particles and position information corresponding to each particle; then, calculating the light emitting direction of each particle according to the position information of the central point and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point; then, sampling is carried out according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, a mask is generated according to the sampling result corresponding to each particle, and the mask and the image information are fused to generate a spotlight effect image; therefore, the spotlight effect is effectively generated based on the particle system, meanwhile, the required calculated amount in the spotlight effect generating process is reduced, and the generating efficiency is improved.
In addition, the particle-based spotlight effect implementation method proposed according to the above-mentioned embodiment of the present invention may also have the following additional technical features:
alternatively, the light emission direction of each particle is calculated according to the following formula:
dir=centerPoint-uv
where dir represents the light-emitting direction of the particle, centerPoint represents the position information of the center point, and uv represents the position information corresponding to the particle.
Optionally, the sampling step size is determined according to the following formula:
dist=|dir|
distmin=max(|dir|,5)
Figure BDA0002654812150000021
where dist denotes the distance between the particle and the center point, the direction of light emission of the dir particle, distminDenotes the minimum distance and step denotes the sampling step size.
Alternatively, the sampling process for each particle is expressed by the following formula:
Figure BDA0002654812150000022
wherein, color represents the pixel value corresponding to the current sampling point, sum represents the accumulated sampling data, and count represents the accumulation times of the sampling data.
To achieve the above object, a second aspect of the present invention provides a computer-readable storage medium having a particle-based spotlight effect implementation program stored thereon, where the particle-based spotlight effect implementation program, when executed by a processor, implements the particle-based spotlight effect implementation method as described above.
According to the computer-readable storage medium of the embodiment of the invention, the particle-based spotlight effect implementation program is stored, so that the processor implements the particle-based spotlight effect implementation method when executing the particle-based spotlight effect implementation program, thereby effectively generating the spotlight effect based on the particle system, reducing the required calculation amount in the spotlight effect generation process and improving the generation efficiency.
To achieve the above object, a third embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the particle-based spotlight effect implementing method as described above is implemented.
According to the computer equipment provided by the embodiment of the invention, the particle-based spotlight effect implementation program is stored through the memory, so that the processor can realize the particle-based spotlight effect implementation method when executing the particle-based spotlight effect implementation program, the spotlight effect can be effectively generated by a particle-based system, meanwhile, the calculation amount required in the spotlight effect generation process is reduced, and the generation efficiency is improved.
In order to achieve the above object, an embodiment of the present invention provides a device for implementing a spotlight effect based on particles, including an obtaining module, where the obtaining module is configured to obtain image information and center point position information, where the image information includes a plurality of particles and position information corresponding to each particle; the calculation module is used for calculating the light emitting direction of each particle according to the central point position information and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point; and the sampling module is used for sampling according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, generating a mask according to the sampling result corresponding to each particle, and fusing the mask and the image information to generate a spotlight effect image.
According to the device for realizing the spotlight effect based on the particles, the acquisition module is arranged to acquire the image information and the position information of the central point, wherein the image information comprises a plurality of particles and the position information corresponding to each particle; the calculation module is used for calculating the light emitting direction of each particle according to the central point position information and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point; the sampling module is used for sampling according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, generating a mask according to the sampling result corresponding to each particle, and fusing the mask and the image information to generate a spotlight effect image; therefore, the spotlight effect is effectively generated based on the particle system, meanwhile, the required calculated amount in the spotlight effect generating process is reduced, and the generating efficiency is improved.
In addition, the particle-based spotlight effect implementation apparatus according to the above embodiment of the present invention may further have the following additional technical features:
alternatively, the light emission direction of each particle is calculated according to the following formula:
dir=centerPoint-uv
where dir represents the light-emitting direction of the particle, centerPoint represents the position information of the center point, and uv represents the position information corresponding to the particle.
Optionally, the sampling step size is determined according to the following formula:
dist=|dir|
distmin=max(|dir|,5)
Figure BDA0002654812150000031
where dist denotes the distance between the particle and the center point, the direction of light emission of the dir particle, distminDenotes the minimum distance and step denotes the sampling step size.
Alternatively, the sampling process for each particle is expressed by the following formula:
Figure BDA0002654812150000041
wherein, color represents the pixel value corresponding to the current sampling point, sum represents the accumulated sampling data, and count represents the accumulation times of the sampling data.
Drawings
FIG. 1 is a flow chart illustrating a method for implementing a particle-based spotlight effect according to an embodiment of the present invention;
fig. 2 is a block diagram illustrating a particle-based spotlight effect implementation apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
In the related art, when the spotlight effect is realized based on the particle system, the spotlight effect generation efficiency is low, the calculation amount is large, and the calculation process is complex; according to the method for realizing the spotlight effect based on the particles, firstly, image information and central point position information are obtained, wherein the image information comprises a plurality of particles and position information corresponding to each particle; then, calculating the light emitting direction of each particle according to the position information of the central point and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point; then, sampling is carried out according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, a mask is generated according to the sampling result corresponding to each particle, and the mask and the image information are fused to generate a spotlight effect image; therefore, the spotlight effect is effectively generated based on the particle system, meanwhile, the required calculated amount in the spotlight effect generating process is reduced, and the generating efficiency is improved.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Fig. 1 is a schematic flow chart of a particle-based spotlight effect implementation method according to an embodiment of the present invention, and as shown in fig. 1, the particle-based spotlight effect implementation method includes the following steps:
s101, image information and central point position information are obtained, wherein the image information comprises a plurality of particles and position information corresponding to each particle.
That is, image information including a plurality of particles and position information corresponding to each particle and position information of a light-emitting center point are acquired.
As an example, first, an input image src (the image src contains a plurality of particles) is acquired, and a light emission center point of a spotlight is set, so that the acquisition of position information corresponding to each of the plurality of particles in the image and position information of a light emission center point is completed.
S102, calculating the light emitting direction of each particle according to the central point position information and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point.
That is, the light emitting direction of each particle is calculated according to the position information of the central point and the position information corresponding to each particle, and the light emitting direction determines the irradiation direction of the light when the light effect is realized; and then, calculating the distance between each particle and the central point according to the position information of the central point and the position information corresponding to each particle, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point.
As an example, the light emission direction of each particle is calculated according to the following formula:
dir=centerPoint-uv
where dir represents the light-emitting direction of the particle, centerPoint represents the position information of the center point, and uv represents the position information corresponding to the particle.
As an example, the sampling step size is determined according to the following formula:
dist=|dir|
distmin=max(|dir|,5)
Figure BDA0002654812150000051
where dist denotes the distance between the particle and the center point, the direction of light emission of the dir particle, distminDenotes the minimum distance and step denotes the sampling step size.
That is, calculating the distance dist between the current position of the particle and the light-emitting center, and determining the density of the subsequent sampling in a distance weighting mode; wherein, in order to ensure the effect at the luminous center, a minimum distance dist is setmin
S103, sampling according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, generating a mask according to the sampling result corresponding to each particle, and fusing the mask and the image information to generate a spotlight effect image.
That is, sampling is performed along the light emitting direction of the particle from the current position of the particle according to the sampling step corresponding to each particle, then a mask is generated according to the sampling result of each particle, and the mask and the original image information are fused to generate a spotlight effect image.
As an example, the sampling process for each particle is expressed by the following formula:
Figure BDA0002654812150000061
wherein, color represents the pixel value corresponding to the current sampling point, sum represents the accumulated sampling data, and count represents the accumulation times of the sampling data.
That is, sampling is performed along the light emitting direction from the current position of the particle according to the step length, and the sampled data is accumulated to obtain sum each time the sampled data is obtained by sampling; meanwhile, the accumulated times of the sampling data are counted to obtain a count, and then the pixel value color corresponding to the sampling position in the current sampling task can be obtained according to sum and the count. Then, after traversing the whole image, a corresponding mask can be obtained, and after the mask is obtained, the mask and the original image are fused to obtain the final spotlight effect image.
In summary, according to the method for implementing the spotlight effect based on the particles of the embodiment of the present invention, first, image information and center point position information are obtained, where the image information includes a plurality of particles and position information corresponding to each particle; then, calculating the light emitting direction of each particle according to the position information of the central point and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point; then, sampling is carried out according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, a mask is generated according to the sampling result corresponding to each particle, and the mask and the image information are fused to generate a spotlight effect image; therefore, the spotlight effect is effectively generated based on the particle system, meanwhile, the required calculated amount in the spotlight effect generating process is reduced, and the generating efficiency is improved.
To implement the above embodiments, embodiments of the present invention propose a computer-readable storage medium on which a particle-based spotlight effect implementation program is stored, which, when executed by a processor, implements the particle-based spotlight effect implementation method as described above.
According to the computer-readable storage medium of the embodiment of the invention, the particle-based spotlight effect implementation program is stored, so that the processor implements the particle-based spotlight effect implementation method when executing the particle-based spotlight effect implementation program, thereby effectively generating the spotlight effect based on the particle system, reducing the required calculation amount in the spotlight effect generation process and improving the generation efficiency.
To implement the foregoing embodiments, the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the particle-based spotlight effect implementation method as described above is implemented.
According to the computer equipment provided by the embodiment of the invention, the particle-based spotlight effect implementation program is stored through the memory, so that the processor can realize the particle-based spotlight effect implementation method when executing the particle-based spotlight effect implementation program, the spotlight effect can be effectively generated by a particle-based system, meanwhile, the calculation amount required in the spotlight effect generation process is reduced, and the generation efficiency is improved.
In order to implement the above embodiments, an embodiment of the present invention provides a particle-based spotlight effect implementing apparatus, as shown in fig. 2, the particle-based spotlight effect implementing apparatus including: an acquisition module 10, a calculation module 20 and a sampling module 30.
The obtaining module 10 is configured to obtain image information and center point position information, where the image information includes a plurality of particles and position information corresponding to each particle;
the calculating module 20 is configured to calculate a light emitting direction of each particle according to the central point position information and the position information corresponding to each particle, calculate a distance between each particle and the central point, and determine a sampling step corresponding to each particle according to the distance between each particle and the central point;
the sampling module 30 is configured to sample according to a sampling step corresponding to each particle, position information corresponding to each particle, and a light emitting direction of each particle, generate a mask according to a sampling result corresponding to each particle, and fuse the mask and image information to generate a spotlight effect image.
In some embodiments, the light emission direction of each particle is calculated according to the following formula:
dir=centerPoint-uv
where dir represents the light-emitting direction of the particle, centerPoint represents the position information of the center point, and uv represents the position information corresponding to the particle.
In some embodiments, the sampling step size is determined according to the following equation:
dist=|dir|
distmin=max(|dir|,5)
Figure BDA0002654812150000071
where dist denotes the distance between the particle and the center point, the direction of light emission of the dir particle, distminDenotes the minimum distance and step denotes the sampling step size.
In some embodiments, the sampling process for each particle is expressed by the following formula:
Figure BDA0002654812150000072
wherein, color represents the pixel value corresponding to the current sampling point, sum represents the accumulated sampling data, and count represents the accumulation times of the sampling data.
It should be noted that the above description about the particle-based spotlight effect implementation method in fig. 1 is also applicable to the particle-based spotlight effect implementation apparatus, and is not repeated herein.
In summary, according to the apparatus for implementing a spotlight effect based on particles in an embodiment of the present invention, the obtaining module is configured to obtain image information and center point position information, where the image information includes a plurality of particles and position information corresponding to each particle; the calculation module is used for calculating the light emitting direction of each particle according to the central point position information and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point; the sampling module is used for sampling according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, generating a mask according to the sampling result corresponding to each particle, and fusing the mask and the image information to generate a spotlight effect image; therefore, the spotlight effect is effectively generated based on the particle system, meanwhile, the required calculated amount in the spotlight effect generating process is reduced, and the generating efficiency is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A method for realizing a spotlight effect based on particles is characterized by comprising the following steps:
acquiring image information and central point position information, wherein the image information comprises a plurality of particles and position information corresponding to each particle;
calculating the light emitting direction of each particle according to the position information of the central point and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point;
sampling is carried out according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, a mask is generated according to the sampling result corresponding to each particle, and the mask and the image information are fused to generate a spotlight effect image.
2. A particle-based spotlight effect realization method according to claim 1 characterized by that the light emitting direction of each particle is calculated according to the following formula:
dir=centerPoint-uv
where dir represents the light-emitting direction of the particle, centerPoint represents the position information of the center point, and uv represents the position information corresponding to the particle.
3. A particle-based spotlight effect realization method according to claim 1 characterized by that the sampling step size is determined according to the following formula:
dist=|dir|
distmin=max(|dir|,5)
Figure FDA0002654812140000011
where dist denotes the distance between the particle and the center point, the direction of light emission of the dir particle, distminDenotes the minimum distance and step denotes the sampling step size.
4. The particle-based spotlight effect realization method of claim 1, characterized in that the sampling process of each particle is expressed by the following formula:
Figure FDA0002654812140000012
wherein, color represents the pixel value corresponding to the current sampling point, sum represents the accumulated sampling data, and count represents the accumulation times of the sampling data.
5. A computer-readable storage medium, on which a particle-based spotlight effect implementation program is stored, which when executed by a processor implements the particle-based spotlight effect implementation method according to any one of claims 1 to 4.
6. Computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the program, implements the particle-based spotlight effect implementing method according to any of the claims 1 to 4.
7. A particle-based spotlight effect realization apparatus, comprising:
the device comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring image information and central point position information, wherein the image information comprises a plurality of particles and position information corresponding to each particle;
the calculation module is used for calculating the light emitting direction of each particle according to the central point position information and the position information corresponding to each particle, calculating the distance between each particle and the central point, and determining the sampling step length corresponding to each particle according to the distance between each particle and the central point;
and the sampling module is used for sampling according to the sampling step length corresponding to each particle, the position information corresponding to each particle and the light-emitting direction of each particle, generating a mask according to the sampling result corresponding to each particle, and fusing the mask and the image information to generate a spotlight effect image.
8. A particle-based spotlight effect realisation device according to claim 7 characterized in that the light emitting direction of each particle is calculated according to the following formula:
dir=centerPoint-uv
where dir represents the light-emitting direction of the particle, centerPoint represents the position information of the center point, and uv represents the position information corresponding to the particle.
9. A particle-based spotlight effect realization device according to claim 7 characterized in that the sampling step size is determined according to the following formula:
dist=|dir|
distmin=max(|dir|,5)
Figure FDA0002654812140000021
where dist denotes the distance between the particle and the center point, the direction of light emission of the dir particle, distminDenotes the minimum distance and step denotes the sampling step size.
10. The particle-based spotlight effect realization device according to claim 7, characterized in that the sampling process of each particle is expressed by the following formula:
Figure FDA0002654812140000022
wherein, color represents the pixel value corresponding to the current sampling point, sum represents the accumulated sampling data, and count represents the accumulation times of the sampling data.
CN202010883421.9A 2020-08-28 2020-08-28 Particle-based spotlight effect implementation method and device Active CN112132918B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010883421.9A CN112132918B (en) 2020-08-28 2020-08-28 Particle-based spotlight effect implementation method and device
PCT/CN2021/106952 WO2022042130A1 (en) 2020-08-28 2021-07-16 Spotlight effect implementation method and apparatus based on particles

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010883421.9A CN112132918B (en) 2020-08-28 2020-08-28 Particle-based spotlight effect implementation method and device

Publications (2)

Publication Number Publication Date
CN112132918A true CN112132918A (en) 2020-12-25
CN112132918B CN112132918B (en) 2022-08-05

Family

ID=73847504

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010883421.9A Active CN112132918B (en) 2020-08-28 2020-08-28 Particle-based spotlight effect implementation method and device

Country Status (2)

Country Link
CN (1) CN112132918B (en)
WO (1) WO2022042130A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022042130A1 (en) * 2020-08-28 2022-03-03 稿定(厦门)科技有限公司 Spotlight effect implementation method and apparatus based on particles
WO2022166656A1 (en) * 2021-02-07 2022-08-11 北京字节跳动网络技术有限公司 Method and apparatus for generating lighting image, device, and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008243602A (en) * 2007-03-27 2008-10-09 Matsushita Electric Works Ltd Irradiation size variable spotlight
CN101923719A (en) * 2009-06-12 2010-12-22 新奥特(北京)视频技术有限公司 Particle filter and light stream vector-based video target tracking method
EP2913855A1 (en) * 2012-10-25 2015-09-02 Toray Industries, Inc. Fluorescent-material-containing resin sheet and light-emitting device
US20180033195A1 (en) * 2015-02-27 2018-02-01 Sony Corporation Information processing apparatus, information processing method, and program
CN110033503A (en) * 2019-04-18 2019-07-19 腾讯科技(深圳)有限公司 Cartoon display method, device, computer equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014119427A (en) * 2012-12-19 2014-06-30 Fujitsu Semiconductor Ltd Spot search device and spot search method
CN105045476A (en) * 2015-06-12 2015-11-11 广东小天才科技有限公司 Method and apparatus for obtaining spotlight graph
CN109471631A (en) * 2018-11-21 2019-03-15 北京京东尚科信息技术有限公司 The generation method and device of masking-out material
CN110675479B (en) * 2019-10-14 2023-05-16 北京代码乾坤科技有限公司 Dynamic illumination processing method and device, storage medium and electronic device
CN111223106B (en) * 2019-10-28 2022-08-09 稿定(厦门)科技有限公司 Full-automatic portrait mask matting method and system
CN112132918B (en) * 2020-08-28 2022-08-05 稿定(厦门)科技有限公司 Particle-based spotlight effect implementation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008243602A (en) * 2007-03-27 2008-10-09 Matsushita Electric Works Ltd Irradiation size variable spotlight
CN101923719A (en) * 2009-06-12 2010-12-22 新奥特(北京)视频技术有限公司 Particle filter and light stream vector-based video target tracking method
EP2913855A1 (en) * 2012-10-25 2015-09-02 Toray Industries, Inc. Fluorescent-material-containing resin sheet and light-emitting device
US20180033195A1 (en) * 2015-02-27 2018-02-01 Sony Corporation Information processing apparatus, information processing method, and program
CN110033503A (en) * 2019-04-18 2019-07-19 腾讯科技(深圳)有限公司 Cartoon display method, device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
楚绅科技: "模拟聚光灯效果", 《PHOTOSHOP CS4数码照片处理从入门到精通》 *
黄心渊 等: "粒子系统与镜头特效", 《3D STUDIO MAX R2.5学习捷径(动画、材质和粒子系统篇)》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022042130A1 (en) * 2020-08-28 2022-03-03 稿定(厦门)科技有限公司 Spotlight effect implementation method and apparatus based on particles
WO2022166656A1 (en) * 2021-02-07 2022-08-11 北京字节跳动网络技术有限公司 Method and apparatus for generating lighting image, device, and medium

Also Published As

Publication number Publication date
WO2022042130A1 (en) 2022-03-03
CN112132918B (en) 2022-08-05

Similar Documents

Publication Publication Date Title
CN112132918B (en) Particle-based spotlight effect implementation method and device
US9053540B2 (en) Stereo matching by census transform and support weight cost aggregation
JP6188400B2 (en) Image processing apparatus, program, and image processing method
Peng et al. Lidar point cloud guided monocular 3d object detection
CN106372255B (en) A kind of recognition methods of street view image and device
CN108810597B (en) Video special effect processing method and device
JP2017084364A (en) Parking space detection device, electronic instrument, and method
CN112669429A (en) Image distortion rendering method and device
CN109558901B (en) Semantic segmentation training method and device, electronic equipment and storage medium
WO2013116865A1 (en) Systems, methods, and media for updating a classifier
RU2735148C1 (en) Training gan (generative adversarial networks) to create pixel-by-pixel annotation
CN110401796A (en) A kind of jitter compensation method and device of image collecting device
CN115690765B (en) License plate recognition method, device, electronic equipment, readable medium and program product
CN111507388A (en) Weather image classification method and equipment
US11971267B2 (en) User journey carbon footprint reduction
CN104024833A (en) Image processing device, image pickup apparatus, microscope apparatus, image processing method, and image processing program
CN116758547B (en) Paper medium carbonization method, system and storage medium
WO2024011888A1 (en) License plate recognition method and apparatus, and computer-readable storage medium
CN107113377A (en) Image processing apparatus, image processing method, image processing program and storage medium
CN111462278A (en) Depth-based material sorting rendering method, medium, equipment and device
US9367937B2 (en) Apparatus and method for effective graph clustering of probabilistic graphs
CN110874824A (en) Image restoration method and device
CN111741332B (en) Particle swarm rotating video production method and medium
CN111524446B (en) Data processing method and device, electronic equipment and readable storage medium
CN112132742A (en) Particle-based adaptive halo image generation method and device

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
TR01 Transfer of patent right

Effective date of registration: 20220930

Address after: 361001 unit R, 2nd floor, No. 33-102, Punan 1st Road, Siming District, Xiamen City, Fujian Province

Patentee after: GAODING (XIAMEN) TECHNOLOGY Co.,Ltd.

Patentee after: Draft (Xiamen) Information Service Co.,Ltd.

Address before: G15-2, 3rd floor, No.10, Punan 1st Road, Dongpu Road, Siming District, Xiamen City, Fujian Province

Patentee before: GAODING (XIAMEN) TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right