CN112580213A - Method and apparatus for generating display image of electric field lines, and storage medium - Google Patents

Method and apparatus for generating display image of electric field lines, and storage medium Download PDF

Info

Publication number
CN112580213A
CN112580213A CN202011548510.4A CN202011548510A CN112580213A CN 112580213 A CN112580213 A CN 112580213A CN 202011548510 A CN202011548510 A CN 202011548510A CN 112580213 A CN112580213 A CN 112580213A
Authority
CN
China
Prior art keywords
charge
electric field
values
image pixels
transparency
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
CN202011548510.4A
Other languages
Chinese (zh)
Other versions
CN112580213B (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.)
Beijing Cut Stone Hi Tech Co ltd
Original Assignee
Beijing Cut Stone Hi Tech 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 Beijing Cut Stone Hi Tech Co ltd filed Critical Beijing Cut Stone Hi Tech Co ltd
Priority to CN202011548510.4A priority Critical patent/CN112580213B/en
Publication of CN112580213A publication Critical patent/CN112580213A/en
Application granted granted Critical
Publication of CN112580213B publication Critical patent/CN112580213B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/62Semi-transparency

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Image Processing (AREA)

Abstract

A method and apparatus for generating a display image of electric field lines, and a storage medium. The method for generating the display image of the electric field lines comprises the following steps: receiving parameters of at least one charge, wherein the parameters of at least one charge comprise coordinates of at least one charge and a charge amount of at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image comprises a plurality of image pixels; calculating a value of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameter of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and setting transparency of the plurality of image pixels based on the plurality of flow function values, respectively. The method for generating the display image of the electric field lines has the potential of increasing the generation speed of the display image of the electric field lines.

Description

Method and apparatus for generating display image of electric field lines, and storage medium
Technical Field
Embodiments of the present disclosure relate to a method and apparatus for generating a display image of electric field lines, and a storage medium.
Background
Electric field lines are some imaginary curves introduced in an electric field in order to visually describe the electric field distribution. The tangential direction of each point on the curve is consistent with the direction of the electric field intensity of the point; the electric field intensity is large at the place where the curve is dense, and the electric field intensity is small at the place where the curve is sparse.
Electric field lines are a difficulty in physics learning in middle schools because electric field lines are an artificially abstract concept, not really existing. Students can hardly understand the teaching process, and teachers usually rely on hand-drawn electric field lines or electric field line pictures to explain the electric field lines. However, hand-drawn electric field lines or pictures of electric field lines do not well show dynamic changes in the electric field, such as due to charge changes (e.g., position shifts or newly added charges).
Disclosure of Invention
At least one embodiment of the present disclosure provides a method of generating a display image of electric field lines, including: receiving parameters of at least one charge, wherein the parameters of at least one charge include coordinates of the at least one charge and a charge amount of the at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image includes a plurality of image pixels; calculating a value of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameter of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and setting transparency of the plurality of image pixels based on the plurality of flow function values, respectively.
For example, in at least one example of the generation method, values of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels are calculated respectively by a plurality of processing units included in a parallel processing array of a graphics processor.
For example, in at least one example of the generation method, a parameter of the at least one charge is received by a fragment shader; and causing the plurality of processing units to respectively invoke the fragment shader to calculate values of a flow function of an electric field formed by the at least one charge at locations corresponding to the plurality of image pixels.
For example, in at least one example of the generating method, a flow function Φ _ k (x, y) of an electric field formed by a k-th charge of the at least one charge satisfies the following relation:
Figure BDA0002857125170000021
wherein the absolute value of n _ k is equal to the number of electric field lines used to simulate and describe the electric field formed by the kth charge; (x _ k, y _ k) is the coordinates of the kth charge; (x, y) is used to represent the coordinates of any of the plurality of image pixels, k being a positive integer.
For example, in at least one example of the generation method, the amount of charge of the at least one charge comprises an amount of charge of the kth charge; the generation method further comprises the following steps: calculating the number of electric field lines simulating and describing the electric field formed by the kth charge based on the charge amount of the kth charge.
For example, in at least one example of the generation method, the at least one charge comprises a plurality of charges; and a value of a flow function of the at least one electric-charge-formed electric field at a location corresponding to each of the plurality of image pixels is equal to a sum of values of the flow function of the plurality of electric-charge-formed electric fields at a location corresponding to each of the plurality of image pixels.
For example, in at least one example of the generation method, the setting transparency of the plurality of image pixels based on the plurality of flow function values, respectively, includes: respectively executing a remainder operation on the plurality of flow function values relative to a preset constant to respectively obtain a plurality of remainders; and respectively setting transparency of the plurality of image pixels based on absolute values of the plurality of remainders.
For example, in at least one example of the generation method, the preset constant is 2 π.
For example, in at least one example of the generation method, the setting of the transparency of the plurality of image pixels based on the absolute values of the plurality of remainders, respectively, includes: respectively carrying out normalization operation on the absolute values of the plurality of remainders to respectively obtain a plurality of normalized values; performing a line sharpening operation based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively; and setting a transparency of the plurality of image pixels based on the plurality of sharpening values.
For example, in at least one example of the generation method, the transparency t _ ij of an image pixel in an ith row and jth column of the plurality of image pixels and the sharpening value r _ ij of an image pixel in the plurality of sharpening values corresponding to the ith row and jth column satisfy the following expression: t _ ij ═ round (T × r _ ij); t is an upper limit value of transparency of a plurality of image pixels of the display image, and round represents rounding operation.
For example, in at least one example of the generation method, the performing a line sharpening operation based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively, includes: performing a mapping operation on the plurality of normalized values to obtain a plurality of mapped values based on the plurality of normalized values, respectively; and respectively calculating m powers of the plurality of mapping values, and respectively taking the m powers of the plurality of mapping values as the plurality of sharpening values, wherein m is a natural number larger than 8.
For example, in at least one example of the generation method, m is an integer greater than 10 and less than 30.
For example, in at least one example of the generation method, the performing a line sharpening operation based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively, includes: and respectively calculating m powers of the plurality of normalized values, and taking the m powers of the plurality of normalized values as the plurality of sharpening values, wherein m is a natural number larger than 8.
For example, in at least one example of the generation method, the setting of the transparency of the plurality of image pixels based on the absolute values of the plurality of remainders, respectively, includes: setting a transparency of image pixels of the plurality of image pixels corresponding to a first portion of the plurality of remainders to a first transparency, wherein a value of the first portion of the plurality of remainders is less than a predetermined threshold; and setting the transparency of image pixels corresponding to a second part of the remainders in the image pixels as a second transparency, wherein the value of the second part of the remainders in the image pixels is greater than or equal to the preset threshold value, and the second transparency is greater than the first transparency.
For example, in at least one example of the generation method, the first transparency represents fully opaque and the second transparency represents fully transparent.
For example, in at least one example of the generation method, the generation method further comprises: setting color values of the plurality of image pixels to a same value.
At least one embodiment of the present disclosure also provides an apparatus for generating a display image of electric field lines, including: a memory and a processor. The memory has stored therein computer program instructions adapted to be executed by the processor, the computer program instructions, when executed by the processor, causing the processor to perform the method of: receiving parameters of at least one charge, wherein the parameters of at least one charge include coordinates of the at least one charge and a charge amount of the at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image includes a plurality of image pixels; calculating a value of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameter of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and setting transparency of the plurality of image pixels based on the plurality of flow function values, respectively.
For example, in at least one example of the generating device, the processor is a graphics processor.
At least one embodiment of the present disclosure also provides a storage medium storing computer program instructions that, when executed by a processor, cause a computer to perform a method comprising: receiving parameters of at least one charge, wherein the parameters of at least one charge include coordinates of the at least one charge and a charge amount of the at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image includes a plurality of image pixels; calculating a value of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameter of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and setting transparency of the plurality of image pixels based on the plurality of flow function values, respectively.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below, and it is apparent that the drawings in the following description relate only to some embodiments of the present disclosure and are not limiting to the present disclosure.
Fig. 1 is an exemplary flow chart of a method of generating a display image of electric field lines provided by at least one embodiment of the present disclosure;
fig. 2 is a schematic diagram of a displayed image of electric field lines obtained by employing the method described in the first example;
fig. 3 is a schematic diagram of a displayed image of electric field lines obtained by employing the method described in the second example;
fig. 4 is a schematic diagram of a displayed image of electric field lines obtained by employing a method described by a third example;
FIG. 5A illustrates a schematic diagram of one example of a correspondence of flow function values to normalized values in at least one embodiment of the present disclosure;
fig. 5B is a diagram illustrating one example of a correspondence of flow function values to mapping values in at least one embodiment of the present disclosure;
6-9 are four schematic diagrams of displayed images of electric field lines obtained by employing a fourth exemplary described method;
fig. 10 is a schematic block diagram of an apparatus for generating a display image of electric field lines provided by at least one embodiment of the present disclosure; and
fig. 11 is a schematic block diagram of a storage medium provided by at least one embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings of the embodiments of the present disclosure. It is to be understood that the described embodiments are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the disclosure without any inventive step, are within the scope of protection of the disclosure.
Unless defined otherwise, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this disclosure belongs. The use of "first," "second," and similar terms in this disclosure is not intended to indicate any order, quantity, or importance, but rather is used to distinguish one element from another. Likewise, the word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
The inventors of the present disclosure noted in their research that using electric field line simulation techniques, a display image of electric field lines (or a plot of electric field lines) may be generated using a computing device. However, the inventors of the present disclosure have also noted in their research that display images of electric field lines generated based on related electric field line simulation techniques are slow (e.g., rendering efficiency is low, generating or rendering a display image of one frame of electric field lines for more than 10 seconds) or are less accurate. Correspondingly, it is difficult to better demonstrate (e.g., demonstrate in real time) the effects of the dynamics of the electric field line variations based on these electric field line simulation techniques. This will be described in detail with reference to an example.
For example, a fixed-point iterative method can be used to generate an image of the electric field lines of the electrostatic field of the point charge, as follows.
Step S501: the display range of electric field lines of the electrostatic field of the point charge is set.
Step S502: some starting points are selected around the point charge as starting points for the electric field and for the fixed point iteration.
Step S503: the direction of the resultant field strength at the starting point is calculated using coulomb's law, and a small displacement increment (e.g., a predetermined step size that is a fixed value) is taken along the direction of the resultant field strength, and the position (coordinate) of the first iteration point is obtained.
Step S504: and calculating the direction of the combined field intensity at the first iteration point, and obtaining the position (coordinate) of the second iteration point based on the direction of the combined field intensity at the first iteration point until the obtained position of the iteration point exceeds the preset display range of the electric field lines.
The inventor of the present disclosure has noticed in research that the method of generating the display image of the electric field lines using fixed-point iteration is not only large in calculation amount and high in requirement for performance of the calculation apparatus, but also has a problem that the generation speed of the display image of the electric field lines is slow; also, the above problem is more serious as the resolution of the displayed image of the electric field lines increases.
For example, since it takes a long time (for example, more than 10 seconds) to display the display image of the electric field lines of the electric field formed by the electric charges after the position change, the students need to wait for a period of time to see the display image of the electric field lines after the position change, that is, there is a problem of image sticking; for example, in order to reduce the adverse effect of image sticking and the like on the display effect, the display range of the electric field lines may be set to be relatively small, and in this case, the generated display image of the electric field lines is generally suitable for small-screen (e.g., mobile phone screen) display, but not well suitable for classroom display.
The inventors of the present disclosure have noted in their research that the method of generating a display image of electric field lines using fixed-point iteration also has a problem of relatively low accuracy. For example, for electrostatic charges, since the electric field at the location where the electrostatic charge is located (the center of the electrostatic charge) is infinite, the starting point of the iteration cannot select the center of the electrostatic charge, but can only select some points around the electrostatic charge as the starting points of the electric field lines; this will cause errors in the starting point of the fixed-point iteration, and the position of the iteration point obtained in each step of the iterative operation has errors (compared with the accurate position) due to the starting point errors, and thus the errors in the position of the iteration point gradually increase as the iteration progresses; for another example, the method of generating a display image of electric field lines using fixed-point iteration may have problems in that the electric field lines cannot be closed and repeated drawing of lines. For example, in the case where the electric field lines of the electric field formed by the two opposite sign point charges cannot be closed to the negative charges due to the above-mentioned error, the number of electric field lines around the negative charges is insufficient, and the electric field lines need to be drawn around the negative charges, which leads to a problem of repeated drawing. For example, since the above-described problem of repeated drawing of lines does not coincide with the teaching "electric field lines start from positive charges to end from negative charges in an electrostatic field", a display image based on the electric field lines generated by the above-described method is not suitable for application in teaching. The inventors of the present disclosure have also noted in their research that the display image of the electric field lines generated based on other methods also has a problem that the accuracy of the display image of the electric field lines is low due to the respective reasons.
At least one embodiment of the present disclosure provides a method and apparatus for generating a display image of electric field lines, and a storage medium. The method for generating the display image of the electric field lines comprises the following steps: receiving parameters of at least one charge, wherein the parameters of at least one charge comprise coordinates of at least one charge and a charge amount of at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image comprises a plurality of image pixels; calculating a value of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameter of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and setting transparency of the plurality of image pixels based on the plurality of flow function values, respectively.
For example, by acquiring a plurality of flow function values respectively corresponding to a plurality of image pixels and respectively setting the transparency of the plurality of image pixels based on the plurality of flow function values respectively corresponding to the plurality of image pixels, it is possible to generate a display image of electric field lines and make the method of generating the display image of electric field lines have a potential to increase the generation speed of the display image of electric field lines. In some examples, the method of generating the display image of electric field lines may increase a speed of generating the display image of electric field lines (e.g., rendering efficiency), e.g., enabling real-time rendering. In some examples, the method for generating a display image of electric field lines can be used to generate a display image of electric field lines formed by any number of charges located at any position (e.g., the positions of the centers of a plurality of charges are not collinear, i.e., not on the same virtual straight line). In some examples, the method of generating a display image of electric field lines obtains a display image of electric field lines with high accuracy. In some examples, the method of generating the display image of electric field lines may compromise accuracy and rendering efficiency of the display image of electric field lines.
In the following, a method for generating a display image of electric field lines according to at least one embodiment of the present disclosure is described in a non-limiting manner by several examples and embodiments, and as described below, different features of these specific examples and embodiments may be combined with each other without mutual conflict, so as to obtain new examples and embodiments, which also belong to the protection scope of the present disclosure.
Fig. 1 is an exemplary flow chart of a method of generating a display image of electric field lines provided by at least one embodiment of the present disclosure. As shown in fig. 1, the method for generating a display image of electric field lines includes the following steps S110 to S130. For example, step S110, step S120, and step S130 may be sequentially performed.
Step S110: at least one parameter of charge is received. The parameters of the at least one charge include coordinates of the at least one charge and a charge amount of the at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image includes a plurality of image pixels.
Step S120: a value of a flow function of an electric field formed by the at least one electric charge at positions corresponding to the plurality of image pixels is calculated based on the parameter of the at least one electric charge, and a plurality of flow function values respectively corresponding to the plurality of image pixels are acquired.
Step S130: transparency of a plurality of image pixels is set based on the plurality of flow function values, respectively.
For example, by setting the transparency of the plurality of image pixels with the plurality of flow function values respectively corresponding to the plurality of image pixels, respectively, a display image of the electric field lines can be generated. For example, by generating a display image of electric field lines by adopting a method of setting transparency of a plurality of image pixels based on a plurality of flow function values respectively corresponding to the plurality of image pixels, it becomes possible to generate a display image of electric field lines using a graphics processor, thereby making the method of generating a display image of electric field lines have a potential to increase the generation speed of a display image of electric field lines.
For example, the method of generating a display image of electric field lines further comprises: the color values of the plurality of image pixels are set to the same value, so that the display effect of the display image of the electric field lines can be improved. For example, "setting color values of a plurality of image pixels to the same value" means that color values of respective color channels for representing colors of the image pixels are all equal. For example, in the case of representing the colors of image pixels using the RGB color space, the color values of the red channels of a plurality of image pixels may all be made equal, the color values of the green channels may all be made equal, and the color values of the blue channels may all be made equal. For example, the color values of the plurality of image pixels may all be set to (0, 0, 0), i.e., the color values of the red channel, the green channel, and the blue channel are all zero.
For example, in step S110, the at least one charge may include one charge, two charges, or at least three charges. For example, where the at least one charge includes at least three charges, the locations of the at least three charges may or may not be collinear. In some examples, the method of generating a display image of electric field lines may be used to generate a display image of electric field lines formed by any number of charges located at any position, for example, to support simulation of electric field lines formed by any number of charges located at any position.
For example, in step S110, at least one parameter of charge may be received from a graphical user interface. For example, in step S110, at least one parameter of charge may be received by a shader (e.g., a fragment shader) running on the graphics processor.
For example, step S110 may further include: the resolution of the displayed image (or the number of pixels of a row and the number of pixels of a column of the displayed image) is received (e.g., from a graphical user interface). For example, the number of pixels of a row and the number of pixels of a column of a display image may be PI _ W and PI _ H, respectively. For example, PI _ W and PI _ H may be 512 and 512, respectively. For another example, PI _ W and PI _ H may be 1920 and 1080, respectively, or other suitable values.
For example, the k-th charge of the at least one charge has a charge amount Q _ k, and k is a positive integer equal to or greater than 1 and equal to or less than the number of the at least one charge. For example, the coordinates of the kth charge (e.g., the center of the charge) of the at least one charge is (x _ k, y _ k). For example, the coordinates of the kth charge in the at least one charge may be the coordinates of the kth charge in the displayed image (e.g., the coordinates of the image pixel where the kth charge is located). For example, the coordinates of the first and second of the at least one charge may be (128, 256) and (384, 256), respectively.
For example, in step S120, values of the flow function of the electric field formed by the at least one electric charge at positions corresponding to the plurality of image pixels are respectively taken as a plurality of flow function values corresponding to the plurality of image pixels. For example, the coordinates of any one of the plurality of image pixels are (x, y). For example, x is a positive integer of 1 or more and PI _ W or less, and y is a positive integer of 1 or more and PI _ H or less. For another example, x is a non-negative positive integer of 0 to PI _ W-1, and y is a non-negative positive integer of 0 to PI _ H-1.
For example, in step S120, values of a flow function of an electric field formed by at least one charge at positions corresponding to a plurality of image pixels may be calculated (e.g., in parallel), respectively, so that not only errors due to starting point selection errors and iteration (e.g., improving accuracy of electric field lines) may be avoided; the speed of generation of a display image of the electric field lines can also be increased. For example, a plurality of flow function values respectively corresponding to a plurality of image pixels may be calculated in parallel using a plurality of processing units included in a parallel processing array, such as a graphics processor. For example, a graphics processor has more Processing units (e.g., arithmetic units) than a Central Processing Unit (CPU), and thus parallel computing a plurality of flow function values respectively corresponding to a plurality of image pixels using a plurality of Processing units included in, for example, a parallel Processing array of the graphics processor can further improve the generation speed and rendering efficiency (e.g., real-time rendering) of a display image of electric field lines. For example, a display image of tens of frames (e.g., 60 frames) of electric field lines may be generated every second.
For example, in step S120, the plurality of processing units are respectively caused to invoke shaders (e.g., fragment shaders) running on the graphics processor to calculate values of flow functions of electric fields formed by at least one charge at positions corresponding to the plurality of image pixels. For example, a method for performing an operation by respectively invoking shaders (e.g., fragment shaders) running on a graphics processor by using a plurality of processing units included in the graphics processor may be referred to in the related art, and will not be described herein again.
For example, after the generation method of the display image based on the electric field lines generates the display image of the electric field lines, the display image of the electric field lines is supplied (e.g., directly supplied) to a frame buffer (also referred to as a frame buffer or a video memory); each storage unit of the frame buffer corresponds to one pixel on the display screen. For example, the entire frame buffer corresponds to one frame of the display image displayed on the display screen. For example, a frame buffer memory provides a display image of the electric field lines to a Video Graphics Array (VGA) controller.
For example, in step S120, the flow function Φ _ k (x, y) of the electric field formed by the k-th charge of the at least one charge satisfies the following relation:
Figure BDA0002857125170000101
here, the absolute value of n _ k is equal to the number of electric field lines used to simulate and describe the electric field formed by the k-th charge.
For example, by making the flow function Φ _ k of the electric field formed by the k-th charge of the at least one charge satisfy the above-described relational expression, it is possible to make the value of the flow function of the electric field formed by the at least one charge at the position corresponding to each of the plurality of image pixels equal to the sum of the values of the flow function of the electric field formed by the plurality of charges at the position corresponding to each of the plurality of image pixels in the case where the at least one charge includes a plurality of charges; for example, the flow function Φ (x, y) of the electric field formed at the position (x, y) by the three charges is equal to the sum of the flow function Φ _1(x, y) of the electric field formed at the position (x, y) by the first charge, the flow function Φ _2(x, y) of the electric field formed at the position (x, y) by the second charge, and the flow function Φ _3(x, y) of the electric field formed at the position (x, y) by the third charge, that is, Φ (x, y) ═ Φ _1(x, y) + Φ _2(x, y) + Φ _3(x, y); in this case, the method of generating a display image of electric field lines can be used to generate a display image of electric field lines formed by an arbitrary number of charges located at arbitrary positions (for example, the positions of the centers of a plurality of charges are not collinear, that is, not on the same virtual straight line), thereby allowing students to understand the characteristics of the electric field more deeply.
For example, step S120 may further include: the number of electric field lines (i.e., the absolute value of n _ k) used to simulate and describe the electric field formed by the kth charge is calculated based on the charge amount of the kth charge. For example, the number of electric field lines of the electric field formed by the k-th charge is positively correlated with the absolute value of the charge amount of the k-th charge. For example, the specific relationship between the number of electric field lines of the electric field formed by the kth charge and the absolute value of the charge amount of the kth charge may be set according to the actual application requirement, and is not described herein again.
For example, step S120 further includes: the sign of n _ k is determined based on the type (e.g., positive, negative) of the kth charge. For example, when the kth charge is positive, n _ k is positive; when the k-th charge is negative, n _ k is negative.
For example, in step S130, the transparency of the plurality of image pixels is set based on the plurality of flow function values, respectively, including the following steps S131 and S132.
Step S131: and respectively executing a remainder operation on the plurality of flow function values relative to a preset constant so as to respectively obtain a plurality of remainders. For example, in step S131, the preset constant is 2 pi; in this case, each of the plurality of remainders takes a value equal to or greater than zero and less than 2 π.
Step S132: transparency of the plurality of image pixels is set based on absolute values of the plurality of remainders, respectively.
For example, in step S132, a specific method for respectively setting the transparency of a plurality of image pixels based on the absolute values of a plurality of remainders may be set according to practical application requirements, and is exemplarily described below with reference to four examples.
In a first example, step S132 includes: the transparency of image pixels of the plurality of image pixels corresponding to a first portion of the plurality of remainders is set to be a first transparency, and the transparency of image pixels of the plurality of image pixels corresponding to a second portion of the plurality of remainders is set to be a second transparency, wherein the value of the first portion of the plurality of remainders is less than a predetermined threshold, the value of the second portion of the plurality of remainders is greater than or equal to a predetermined threshold, and the second transparency is greater than the first transparency. For example, a first transparency may represent fully opaque and a second transparency may represent fully transparent.
For example, the predetermined threshold may be set according to actual application requirements. For example, the predetermined threshold is equal to or less than 0.8 (e.g., equal to or less than 0.4 or equal to or less than 0.2). For example, by making a transparency (e.g., fully opaque) of an image pixel of the plurality of image pixels corresponding to a remainder of the first portion of the plurality of remainders less than a transparency (e.g., fully transparent) of an image pixel of the plurality of image pixels corresponding to a remainder of the second portion of the plurality of remainders, an image pixel of the plurality of image pixels corresponding to a flow function value substantially equal to 2 × t × pi (t equal to a non-negative integer) may be found and electric field lines generated (e.g., drawn) based on the image pixels.
Fig. 2 is a schematic diagram of a displayed image of electric field lines (e.g., electric field lines used to simulate and describe an electric field formed by two point charges of the same sign) obtained by employing the method described in the first example. For example, the inventors of the present disclosure have noted in their studies that, although image pixels corresponding to flow function values substantially equal to 2 × t × pi (t is equal to a non-negative integer) among a plurality of image pixels can be directly and concisely found by the method of the first example, as shown in fig. 2, the display effect of a display image of electric field lines generated based on this method may have a problem of appearing discontinuous, particularly, a portion of the electric field lines near the center of the point charge (see the region enclosed by the dashed frame of fig. 2).
The inventors of the present disclosure have noted in their studies that it is possible to improve the display effect of the electric field lines at the positions close to the point charges in the first example by setting the transparency of the plurality of image pixels based on the normalized values of the absolute values of the plurality of remainders, which may have a problem of appearing discontinuous and improve the display effect of the display image of the electric field lines. The following is an exemplary description with reference to the second example to the fourth example.
For example, in the second example, the step S132 includes the following step S132a and step S132b _ 1. For example, step S132a and step S132b _1 may be sequentially performed.
Step S132 a: a normalization operation is performed on the absolute values of the plurality of remainders, respectively, to obtain a plurality of normalized values, respectively.
For example, in step S132a, ratios of a plurality of remainders to a preset constant (e.g., 2 pi) may be respectively used as a plurality of normalization values; for example, the plurality of normalization values are equal to or greater than 0 and less than 1.
Step S132b _ 1: rounding up the product of the plurality of normalized values and an upper limit value T (see the third example below for a detailed description) of the transparency of the plurality of image pixels of the display image is taken as the transparency of the plurality of image pixels, respectively.
Fig. 3 is a schematic diagram of a displayed image of electric field lines (e.g., electric field lines used to simulate and describe an electric field formed by two point charges of the same sign) obtained by employing the method described by the second example. The inventors of the present disclosure have noted in their studies that, although there may be a problem in that the display effect of the electric field lines at the positions close to the point charges in the first example may appear discontinuous by respectively rounding up values of products of the plurality of normalized values and the upper limit values T of the transparency of the plurality of image pixels of the display image as the transparency of the plurality of image pixels, as shown in fig. 3, the display image of the electric field lines generated based on the method described in the second example looks like a curved surface, and therefore, it may not be easy for a part of students to correspond the display image of the electric field lines generated based on the method described in the second example to the electric field lines.
In the third example and the fourth example, a line sharpening operation may be performed on the plurality of normalized values obtained based on step S132 to obtain a plurality of sharpened values based on the plurality of normalized values, respectively, and to set the transparency of the plurality of image pixels based on the plurality of sharpened values; in this case, the electric field lines in the display image of the electric field lines can be caused to appear in the form of a curved line on the basis of improving the problem that the display effect of the electric field lines at the positions close to the point charges in the first example may appear discontinuous, whereby the display effect of the display image of the electric field lines can be enhanced.
For example, in the third example, step S132 includes step S132a (see the second example for a detailed description), step S132b _2, and step S132c, and step S132a, step S132b _2, and step S132c may be performed in sequence, for example.
Step S132b _ 2: a line sharpening operation is performed based on the plurality of normalized values, with a plurality of sharpening values.
Step S132 c: transparency of the plurality of image pixels is set based on the plurality of sharpening values.
For example, step S132b includes: and respectively calculating m powers of the plurality of normalized values, and taking the m powers of the plurality of normalized values as a plurality of sharpening values, wherein m is a natural number greater than 8. For example, m is greater than 10 and less than 20 (e.g., is an integer greater than 10 and less than 20). For example, the inventors of the present disclosure have noted in their studies that by making greater than 10 and less than 20, the display effect of the display image of the electric field lines can be made better. For example, m is equal to 12, 16, 18, or other suitable values.
For example, in step S132c, the transparency t _ ij of the image pixel in the ith row and jth column among the plurality of image pixels and the sharpening value r _ ij of the image pixel corresponding to the ith row and jth column among the plurality of sharpening values satisfy the following expression: t _ ij ═ round (T × r _ ij); t is an upper limit value of the transparency of a plurality of image pixels of the display image, and round denotes a rounding operation. For example, the upper limit value of the transparency of a plurality of image pixels of the display image may be 255; in this case, the transparency of the plurality of image pixels has a value in a range of 0 to 255.
Fig. 4 is a schematic diagram of a displayed image of electric field lines (e.g., electric field lines used to simulate and describe an electric field formed by two same-sign point charges) obtained by employing the method described in the third example. As shown in fig. 4, by causing the display of the electric field lines to perform a line sharpening operation based on a plurality of normalized values and setting the transparency of a plurality of image pixels based on the plurality of sharpening values, the electric field lines in the image can be caused to appear in the form of a curve, whereby the display effect of the display image of the electric field lines can be enhanced.
The inventors of the present disclosure have noticed in their studies that, in the display images of electric field lines shown in fig. 3 and 4, the region with the highest transparency and the region with the lowest transparency are in close proximity (for example, the region in close proximity to the complete opacity is completely transparent), which brings about a certain adverse effect on the display effect of the display images of electric field lines. The inventor of the present disclosure has also noted in research that the above-mentioned problem of the close proximity of the region with the highest transparency and the region with the lowest transparency is mainly caused by performing a remainder operation on the flow function and the transparency setting manner of the image pixels. This is illustrated below in conjunction with fig. 5A.
FIG. 5A is a diagram illustrating an example of a correspondence of a flow function value φ to a normalized value (a pre-set constant of the remainder operation is 2 π) in at least one embodiment of the present disclosure; for the second example, fig. 5A may also represent a flow function value versus transparency correspondence (without regard to rounding operations). For example, as shown in FIG. 5A, the remainder operation is such that, in the case where the flow function value corresponding to an image pixel is slightly less than 2 x t x π (t equals a non-negative integer), the transparency (normalized value) of the image pixel is in the highest region (e.g., substantially equal to 255, e.g., substantially completely transparent); whereas in the case where the flow function value corresponding to an image pixel is equal to or slightly greater than 2 x t x pi (t is equal to a non-negative integer), the transparency (normalized value) of the image pixel is in the lowest region (e.g., substantially equal to 0, e.g., substantially completely opaque).
The inventors of the present disclosure have also noted in their research that the problem of close proximity of the region of highest transparency and the region of lowest transparency can be avoided by performing a mapping operation (e.g., performing a mapping operation on a normalized value), and thus the adverse effect on the display effect of the display image of electric field lines by the close proximity of the region of highest transparency and the region of lowest transparency can be suppressed. The following description is made with reference to the fourth example, fig. 5B, and fig. 6 to 9.
For example, in the fourth example, step S132 includes step S132a (see the second example for a detailed description), step S132b _3, step S132b _4, and step S132c (see the third example for a detailed description). For example, step S132a, step S132b _3, step S132b _4, and step S132c may be sequentially performed.
Step S132b _ 3: a mapping operation is performed on the plurality of normalized values to obtain a plurality of mapped values based on the plurality of normalized values, respectively.
For example, performing a mapping operation on a plurality of normalized values includes: mapping a lower limit value (e.g., 0) of the plurality of normalized values to a lower limit value (e.g., 0) of the plurality of normalized values; mapping an upper limit value (e.g., 1) of the plurality of normalized values to a lower limit value (e.g., 0) of the plurality of normalized values; and half (e.g., 0.5) of the sum of the upper limit value and the lower limit value of the plurality of normalized values is mapped to an upper limit value (e.g., 1) of the plurality of normalized values.
This is illustrated below in conjunction with fig. 5B. Fig. 5B illustrates a schematic diagram of one example of a correspondence of flow function values to mapping values in at least one embodiment of the present disclosure. It should be noted that, for clarity and ease of description, fig. 5B also shows the correspondence between the flow function value phi and the normalized value. For example, as shown in fig. 5B, 0 may be mapped to 0, 0.5 may be mapped to 1, and 1 may be mapped to 0.5.
Step S132b _ 4: and respectively calculating m powers of the plurality of mapping values, and respectively taking the m powers of the plurality of mapping values as a plurality of sharpening values, wherein m is a natural number larger than 8.
For example, m is greater than 10 and less than 20 (e.g., is an integer greater than 10 and less than 20). For example, the inventors of the present disclosure have noted in their studies that by making greater than 10 and less than 20, the display effect of the display image of the electric field lines can be made better. For example, m is equal to 12, 16, 18, or other suitable values.
For example, as shown in fig. 5B, by performing a mapping operation (for example, performing a mapping operation on a normalized value) and setting m-th powers of a plurality of mapped values as a plurality of sharpening values, respectively, it is possible to reduce an adverse effect of the proximity of the region with the highest transparency and the region with the lowest transparency on the display effect of the display image of the electric field lines, whereby the display effect of the display image of the electric field lines can be further improved. This is exemplified below in connection with fig. 6-9.
Fig. 6 is a first schematic diagram of a displayed image of electric field lines obtained by employing the method described in the fourth example (e.g., electric field lines used to simulate and describe an electric field formed by two same-sign point charges).
Fig. 7 is a second schematic diagram of a displayed image of electric field lines obtained by employing the method described in the fourth example (e.g., electric field lines used to simulate and describe an electric field formed by two opposite sign point charges). Fig. 8 is a third schematic diagram of a displayed image of electric field lines obtained by employing the method described in the fourth example (e.g., electric field lines used to simulate and describe an electric field formed by four non-collinear point charges). Fig. 9 is a fourth schematic illustration of a displayed image of electric field lines obtained by employing the method described in the fourth example (e.g., electric field lines used to simulate and describe an electric field formed by one positive charge). It should be noted that fig. 6-9 also show at least one point charge, at least one support for the point charge, and the sign of the at least one point charge for the sake of image and aesthetic appearance.
For example, as shown in fig. 6 to 9, the display images of the electric field lines obtained by the method described in the fourth example can be well simulated to generate the display images of the electric field lines formed by any number of charges located at any position (for example, the positions of the centers of a plurality of charges are not collinear, that is, not on the same virtual straight line), thereby enabling students to understand the characteristics of the electric field more deeply. Further, as described previously, in some examples, the method of generating the display image of the electric field lines may calculate in parallel a plurality of flow function values respectively corresponding to a plurality of image pixels using a plurality of processing units included in a parallel processing array of a graphics processor, thereby further increasing a generation speed and rendering efficiency (e.g., real-time rendering) of the display image of the electric field lines and making it possible to compromise an accuracy and rendering efficiency of the display image of the electric field lines.
At least one embodiment of the present disclosure also provides an apparatus for generating a display image of electric field lines. Fig. 10 is a schematic block diagram of an apparatus for generating a display image of electric field lines provided by at least one embodiment of the present disclosure.
As shown in fig. 10, the apparatus for generating a display image of electric field lines includes: a memory and a processor. The memory has stored therein computer program instructions adapted to be executed by the processor, the computer program instructions, when executed by the processor, cause the processor to perform the method of: receiving parameters of at least one charge, wherein the parameters of at least one charge comprise coordinates of at least one charge and a charge amount of at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image comprises a plurality of image pixels; calculating a value of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameter of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; transparency of a plurality of image pixels is set based on the plurality of flow function values, respectively.
For example, by acquiring a plurality of flow function values respectively corresponding to a plurality of image pixels and respectively setting the transparency of the plurality of image pixels based on the plurality of flow function values respectively corresponding to the plurality of image pixels, it is possible to generate a display image of electric field lines and make the generating device of the display image of electric field lines have a potential to increase the generation speed of the display image of electric field lines.
For example, at least one embodiment of the present disclosure further provides a related method for generating a display image of electric field lines, which may refer to the related description of the method for generating the display image of electric field lines and is not repeated herein.
For example, the processor may be a Graphics Processing Unit (GPU), in which case a plurality of flow function values respectively corresponding to a plurality of image pixels may be calculated in parallel using a plurality of processing units included in a parallel processing array, e.g., the graphics processing unit, and the generation speed of the display image of the electric field lines may be further increased (e.g., the display image of the electric field lines is generated in real time).
The means for generating a displayed image of the electric field lines further comprises a graphical user interface, for example. For example, the means for generating a displayed image of the electric field lines allows for real-time response to the operation of a user (e.g., a teacher) using a graphical user interface. For example, in response to a user dragging the charge causing a change in charge position, a displayed image of new electric field lines is generated and provided to the graphical user interface for display.
For example, a user may select a kth charge (k is a positive integer greater than or equal to 1 and less than or equal to the number of the at least one charge) of the at least one charge in the graphical user interface, change a position of the kth charge by dragging, transfer the updated position of the charge to a shader (e.g., a fragment shader) running on the graphics processor via the graphical user interface, calculate values of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the updated position of the charge, and set transparency of the plurality of image pixels based on the plurality of flow function values, respectively, whereby a display image of electric field lines of the electric field formed by the at least one charge after the position change may be obtained.
For example, the apparatus for generating a display image of electric field lines according to at least one embodiment of the present disclosure may render a display image of electric field lines of several tens of frames (e.g., 60 frames) per second, thereby allowing a teacher to rapidly drag at least one charge in a graphical user interface and rapidly generate a display image of electric field lines of an electric field formed by at least one charge with a changed position, thereby better exhibiting an effect of real-time dynamics of changes of the electric field lines by using the apparatus for generating a display image of electric field lines according to at least one embodiment of the present disclosure, so that a teacher may better explain related knowledge of the electric field lines, and a student may also more easily understand related knowledge of the electric field lines, thereby enhancing learning interest in related knowledge of the electric field lines.
It should be noted that, without considering the speed of generation of the display image of the electric field lines, a Central Processing Unit (CPU), Tensor Processor (TPU) or other form of processing unit having data processing capability and/or instruction execution capability may also be employed as the processor. For example, the processor may be implemented as a general purpose processor, and may also be a single chip microcomputer, a microprocessor, a digital signal processor, a dedicated image processing chip, a field programmable logic array, or the like.
For example, the memory may include at least one of volatile memory and non-volatile memory, e.g., the memory may include Read Only Memory (ROM), a hard disk, flash memory, etc. Accordingly, the memory may be implemented as one or more computer program products, which may include various forms of computer-readable storage media on which one or more computer program instructions may be stored. The processor may execute the program instructions to perform a method of generating a display image of any of the electric field lines provided by at least one embodiment of the present disclosure. The memory may also store various other applications and various data, such as various data used and/or generated by the applications, etc.
At least one embodiment of the present disclosure also provides a storage medium (e.g., a non-transitory storage medium). Fig. 11 is a schematic block diagram of a storage medium provided by at least one embodiment of the present disclosure.
As shown in fig. 11, the storage medium stores computer program instructions that, when executed by a processor, cause a computer to perform a method comprising: receiving parameters of at least one charge, wherein the parameters of at least one charge comprise coordinates of at least one charge and a charge amount of at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image comprises a plurality of image pixels; calculating a value of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameter of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; transparency of a plurality of image pixels is set based on the plurality of flow function values, respectively.
For example, the computer program instructions in the storage medium, when executed by the processor, may generate a display image of electric field lines and have the potential to increase the speed of generation of the display image of electric field lines. For example, the storage medium may refer to the related description of the generation method of the display image of the electric field lines, which is not described herein again.
For example, a storage medium may take many forms, including a tangible storage medium, a carrier wave medium, or a physical transmission medium. The stable storage media may include: optical or magnetic disks, and other computer or similar devices, capable of implementing the system components described in the figures. Unstable storage media may include dynamic memory, such as the main memory of a computer platform, etc. Tangible transmission media may include coaxial cables, copper cables, and fiber optics, such as the wires that form a bus within a computer system. Carrier wave transmission media may convey electrical, electromagnetic, acoustic, or light wave signals, and so on. These signals may be generated by radio frequency or infrared data communication methods. Common storage media (e.g., computer-readable media) include hard disks, floppy disks, magnetic tape, any other magnetic medium; CD-ROM, DVD-ROM, any other optical medium; punch cards, any other physical storage medium containing a pattern of holes; RAM, PROM, EPROM, FLASH-EPROM, any other memory chip or cartridge; a carrier wave transmitting data or instructions, a cable or connection transmitting a carrier wave, any other data which can be read by a computer and/or computer program instructions (e.g., program code).
Computer program instructions (e.g., program code) for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
Although the present disclosure has been described in detail hereinabove with respect to general illustrations and specific embodiments, it will be apparent to those skilled in the art that modifications or improvements may be made thereto based on the embodiments of the disclosure. Accordingly, such modifications and improvements are intended to be within the scope of this disclosure, as claimed.
The above description is intended to be exemplary of the present disclosure, and not to limit the scope of the present disclosure, which is defined by the claims appended hereto.

Claims (19)

1. A method of generating a displayed image of electric field lines, comprising:
receiving parameters of at least one charge, wherein the parameters of at least one charge include coordinates of the at least one charge and a charge amount of the at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image includes a plurality of image pixels;
calculating a value of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameter of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and
transparency of the plurality of image pixels is set based on the plurality of flow function values, respectively.
2. The generation method according to claim 1, wherein a plurality of processing units included with a parallel processing array of a graphics processor respectively calculate values of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels.
3. A generation method according to claim 2, wherein the parameter of the at least one charge is received by a fragment shader; and
causing the plurality of processing units to respectively invoke the fragment shader to calculate values of a flow function of an electric field formed by the at least one charge at locations corresponding to the plurality of image pixels.
4. The generation method of claim 1, wherein a flow function Φ _ k (x, y) of an electric field formed by a kth charge of the at least one charge satisfies the following relation:
Figure FDA0002857125160000011
wherein the absolute value of n _ k is equal to the number of electric field lines used to simulate and describe the electric field formed by the kth charge; (x _ k, y _ k) is the coordinates of the kth charge; (x, y) is used to represent the coordinates of any of the plurality of image pixels, k being a positive integer.
5. The generation method of claim 4, wherein the amount of charge of the at least one charge comprises an amount of charge of the kth charge; and
the generation method further comprises the following steps: calculating the number of electric field lines simulating and describing the electric field formed by the kth charge based on the charge amount of the kth charge.
6. The generation method of claim 4, wherein the at least one charge comprises a plurality of charges; and
a value of a flow function of the at least one electric-charge-formed electric field at a location corresponding to each of the plurality of image pixels is equal to a sum of values of the flow function of the plurality of electric-charge-formed electric fields at a location corresponding to each of the plurality of image pixels.
7. The generation method according to any one of claims 1 to 6, wherein the setting of the transparency of the plurality of image pixels based on the plurality of flow function values, respectively, includes:
respectively executing a remainder operation on the plurality of flow function values relative to a preset constant to respectively obtain a plurality of remainders; and
transparency of the plurality of image pixels is respectively set based on absolute values of the plurality of remainders.
8. The generation method according to claim 7, wherein the preset constant is 2 pi.
9. The generation method according to claim 7, wherein the setting of the transparency of the plurality of image pixels based on the absolute values of the plurality of remainders, respectively, comprises:
respectively carrying out normalization operation on the absolute values of the plurality of remainders to respectively obtain a plurality of normalized values;
performing a line sharpening operation based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively; and
setting a transparency of the plurality of image pixels based on the plurality of sharpening values.
10. The generation method of claim 9, wherein the transparency t _ ij of the image pixel in row i and column j of the plurality of image pixels and the sharpening value r _ ij of the image pixel corresponding to row i and column j of the plurality of sharpening values satisfy the following expression:
t_ij=round(T×r_ij);
t is an upper limit value of transparency of a plurality of image pixels of the display image, and round represents rounding operation.
11. The generation method of claim 9, wherein the performing a line sharpening operation based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively, comprises:
performing a mapping operation on the plurality of normalized values to obtain a plurality of mapped values based on the plurality of normalized values, respectively; and
and respectively calculating m powers of the plurality of mapping values, and respectively taking the m powers of the plurality of mapping values as the plurality of sharpening values, wherein m is a natural number larger than 8.
12. The generation method of claim 11, wherein m is an integer greater than 10 and less than 30.
13. The generation method of claim 9, wherein the performing a line sharpening operation based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively, comprises:
and respectively calculating m powers of the plurality of normalized values, and taking the m powers of the plurality of normalized values as the plurality of sharpening values, wherein m is a natural number larger than 8.
14. The generation method according to claim 7, wherein the setting of the transparency of the plurality of image pixels based on the absolute values of the plurality of remainders, respectively, comprises:
setting a transparency of image pixels of the plurality of image pixels corresponding to a first portion of the plurality of remainders to a first transparency, wherein a value of the first portion of the plurality of remainders is less than a predetermined threshold; and
and setting the transparency of image pixels corresponding to the remainder of the second part in the plurality of remainders as a second transparency, wherein the value of the remainder of the second part in the plurality of remainders is greater than or equal to the predetermined threshold, and the second transparency is greater than the first transparency.
15. The generation method of claim 14, wherein the first transparency represents fully opaque and the second transparency represents fully transparent.
16. The generation method according to any one of claims 1 to 6, further comprising: setting color values of the plurality of image pixels to a same value.
17. An apparatus for generating a display image of electric field lines, comprising: a memory and a processor, wherein the processor is capable of,
wherein the memory has stored therein computer program instructions adapted to be executed by the processor, the computer program instructions, when executed by the processor, causing the processor to perform the method of:
receiving parameters of at least one charge, wherein the parameters of at least one charge include coordinates of the at least one charge and a charge amount of the at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image includes a plurality of image pixels;
calculating a value of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameter of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and
transparency of the plurality of image pixels is set based on the plurality of flow function values, respectively.
18. The generation apparatus of claim 17, wherein the processor is a graphics processor.
19. A storage medium storing computer program instructions which, when executed by a processor, cause a computer to perform a method comprising:
receiving parameters of at least one charge, wherein the parameters of at least one charge include coordinates of the at least one charge and a charge amount of the at least one charge, the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, and the display image includes a plurality of image pixels;
calculating a value of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameter of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and
transparency of the plurality of image pixels is set based on the plurality of flow function values, respectively.
CN202011548510.4A 2020-12-24 2020-12-24 Method and device for generating display image of electric field lines and storage medium Active CN112580213B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011548510.4A CN112580213B (en) 2020-12-24 2020-12-24 Method and device for generating display image of electric field lines and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011548510.4A CN112580213B (en) 2020-12-24 2020-12-24 Method and device for generating display image of electric field lines and storage medium

Publications (2)

Publication Number Publication Date
CN112580213A true CN112580213A (en) 2021-03-30
CN112580213B CN112580213B (en) 2024-07-05

Family

ID=75139565

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011548510.4A Active CN112580213B (en) 2020-12-24 2020-12-24 Method and device for generating display image of electric field lines and storage medium

Country Status (1)

Country Link
CN (1) CN112580213B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113380394A (en) * 2021-06-18 2021-09-10 上海睿刀医疗科技有限公司 Method and device for determining ablation boundary of electrode needle, electronic equipment and storage medium
CN116484211A (en) * 2023-06-21 2023-07-25 中国电力科学研究院有限公司 Method and device for dividing electric field line interface

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050276616A1 (en) * 2004-05-31 2005-12-15 Canon Kabushiki Kaisha Analysis method, program for performing the method, and information processing apparatus
CN202049655U (en) * 2011-01-05 2011-11-23 湖州师范学院 Micro-electric field line experimental device
CN102663723A (en) * 2012-02-24 2012-09-12 武汉大学 Image segmentation method based on color sample and electric field model
CN103984876A (en) * 2014-06-11 2014-08-13 国家电网公司 Calculation method for synthetic electric field of ultrahigh voltage direct-current transmission line crossing complex terrain
CN110796903A (en) * 2019-08-09 2020-02-14 中国民用航空总局第二研究所 Sign avoiding method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050276616A1 (en) * 2004-05-31 2005-12-15 Canon Kabushiki Kaisha Analysis method, program for performing the method, and information processing apparatus
CN202049655U (en) * 2011-01-05 2011-11-23 湖州师范学院 Micro-electric field line experimental device
CN102663723A (en) * 2012-02-24 2012-09-12 武汉大学 Image segmentation method based on color sample and electric field model
CN103984876A (en) * 2014-06-11 2014-08-13 国家电网公司 Calculation method for synthetic electric field of ultrahigh voltage direct-current transmission line crossing complex terrain
CN110796903A (en) * 2019-08-09 2020-02-14 中国民用航空总局第二研究所 Sign avoiding method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
徐维祯;林国华;李鹏飞;: "利用Canvas描绘多个点电荷的电场线和等势面", 物理通报, no. 12, 5 December 2016 (2016-12-05), pages 46 - 48 *
栾玲;刘杰;冯立军;: "基于MATLAB的点电荷系电场分布的用户图形界面设计", 物理与工程, pages 72 - 78 *
汤朝红;熊伦;: "利用Matlab模拟点电荷对的电场线分布", 广西物理, pages 45 - 47 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113380394A (en) * 2021-06-18 2021-09-10 上海睿刀医疗科技有限公司 Method and device for determining ablation boundary of electrode needle, electronic equipment and storage medium
CN116484211A (en) * 2023-06-21 2023-07-25 中国电力科学研究院有限公司 Method and device for dividing electric field line interface
CN116484211B (en) * 2023-06-21 2023-08-18 中国电力科学研究院有限公司 Method and device for dividing electric field line interface

Also Published As

Publication number Publication date
CN112580213B (en) 2024-07-05

Similar Documents

Publication Publication Date Title
EP3923248A1 (en) Image processing method and apparatus, electronic device and computer-readable storage medium
EP4120199A1 (en) Image rendering method and apparatus, and electronic device and storage medium
KR102612808B1 (en) lighting estimation
US9275493B2 (en) Rendering vector maps in a geographic information system
KR20080090671A (en) Apparatus and method for mapping textures to object model
US10922852B2 (en) Oil painting stroke simulation using neural network
CN105303506B (en) A kind of data parallel processing method and system based on HTML5
WO2023160513A1 (en) Rendering method and apparatus for 3d material, and device and storage medium
US10325403B2 (en) Image based rendering techniques for virtual reality
CN111047509A (en) Image special effect processing method and device and terminal
CN112580213B (en) Method and device for generating display image of electric field lines and storage medium
CN112995534B (en) Video generation method, device, equipment and readable storage medium
CN111915712B (en) Illumination rendering method and device, computer readable medium and electronic equipment
CN112700528A (en) Virtual object shadow rendering method for head-mounted augmented reality equipment
CN110930492B (en) Model rendering method, device, computer readable medium and electronic equipment
JP2023039426A (en) Computer implementation method, information processing system, computer program (spatio-temporal relation based mr content arrangement)
CN114219884A (en) Particle special effect rendering method, device and equipment and storage medium
CN112581620B (en) Image processing method, device, electronic equipment and storage medium
CN117058384B (en) Method and system for semantic segmentation of three-dimensional point cloud
EP4287134A1 (en) Method and system for generating polygon meshes approximating surfaces using root-finding and iteration for mesh vertex positions
CN110069195B (en) Image dragging deformation method and device
CN115526976A (en) Virtual scene rendering method and device, storage medium and electronic equipment
CN113126944B (en) Depth map display method, display device, electronic device, and storage medium
CN114998504A (en) Two-dimensional image illumination rendering method, device and system and electronic device
US20230394767A1 (en) Method and system for generating polygon meshes approximating surfaces using root-finding and iteration for mesh vertex positions

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