CN111784559A - Graph adjusting method and device - Google Patents

Graph adjusting method and device Download PDF

Info

Publication number
CN111784559A
CN111784559A CN201910265035.0A CN201910265035A CN111784559A CN 111784559 A CN111784559 A CN 111784559A CN 201910265035 A CN201910265035 A CN 201910265035A CN 111784559 A CN111784559 A CN 111784559A
Authority
CN
China
Prior art keywords
star
adjusted
vertex
distance
vertex angle
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.)
Pending
Application number
CN201910265035.0A
Other languages
Chinese (zh)
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 Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Kingsoft Mobile Technology Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Kingsoft Mobile 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 Beijing Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd, Guangzhou Kingsoft Mobile Technology Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN201910265035.0A priority Critical patent/CN111784559A/en
Publication of CN111784559A publication Critical patent/CN111784559A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map

Landscapes

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

Abstract

The embodiment of the invention provides a method and a device for adjusting a graph, which relate to the technical field of computer image processing, wherein the method comprises the following steps: the method comprises the steps of obtaining the number of vertex angles of a star to be adjusted, obtaining the width of the star to be adjusted as characterization information under the condition that the number of the vertex angles is an even number, obtaining the height of the star to be adjusted as the characterization information under the condition that the number of the vertex angles is an odd number, calculating the distance from the central point to the vertex of the positive star determined by the number of the vertex angles and the characterization information according to the number of the vertex angles and the characterization information, adjusting the star to be adjusted according to the number of the vertex angles, the characterization information and the distance, obtaining an adjusted star with the same vertex angle and the same side length, and considering that the adjusted star is the positive star. By applying the scheme provided by the embodiment of the invention to adjust the star shape, the probability that the obtained star shape is a positive star shape can be improved.

Description

Graph adjusting method and device
Technical Field
The invention relates to the technical field of computer image processing, in particular to a method and a device for adjusting a graph.
Background
With the wider application of various file processing software, users often need to draw a positive star through the software. However, when the user draws a regular star through the software, the star is generally drawn by dragging a mouse, and in this case, the lengths of the edges and the vertex angles of the drawn star are generally different, that is, the drawn star is a non-regular star. Therefore, the non-regular star needs to be adjusted to obtain a regular star.
In the prior art, when a non-positive star is adjusted, a user usually manually adjusts the non-positive star by dragging a mouse, and then judges whether the star has equal side length and equal vertex angle by naked eyes.
Although the non-positive star can be adjusted by applying the above method, errors usually exist due to the fact that whether the side lengths are equal and the vertex angles are equal is judged by naked eyes, and therefore the accuracy rate that the star obtained through adjustment is a positive star is low.
Disclosure of Invention
The embodiment of the invention aims to provide a graph adjusting method and device so as to improve the accuracy of obtaining a positive star shape by adjusting the star shape. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for adjusting a graph, where the method includes:
acquiring the number of vertex angles of the star to be adjusted;
under the condition that the number of the vertex angles is an even number, acquiring the width of the star to be adjusted as characterization information;
under the condition that the number of the vertex angles is odd, acquiring the height of the star to be adjusted as characterization information;
according to the vertex angle number and the representation information, calculating the distance from the central point to the vertex of the positive star determined by the vertex angle number and the representation information;
and adjusting the star to be adjusted according to the vertex angle number, the characterization information and the distance to obtain an adjusted star with the same vertex angle and the same side length.
In an embodiment of the present invention, said calculating, according to the vertex angle number and the characterization information, a distance from a central point to a vertex of the positive star determined by the vertex angle number and the characterization information includes:
the distance r is calculated according to the following expression:
Figure BDA0002016510000000021
wherein m represents the characterization information, n represents the number of the vertex angles, and a, b, and c represent preset parameters.
In an embodiment of the present invention, the adjusting the star to be adjusted according to the vertex angle number, the characterization information, and the distance includes:
when the vertex angle number is an even number, calculating a first numerical value according to the following expression, and under the condition that the vertex angle number and the width of the star to be adjusted are kept unchanged, adjusting the height of the star to be adjusted to be the first numerical value:
Figure BDA0002016510000000022
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents the distance, m represents the characterization information, and d represents a preset parameter.
In an embodiment of the present invention, the adjusting the star to be adjusted according to the vertex angle number, the characterization information, and the distance includes:
when the number of the vertex angles is an odd number, calculating a second numerical value according to the following expression, and under the condition that the number of the vertex angles and the height of the star to be adjusted are not changed, adjusting the width of the star to be adjusted to be the second numerical value:
Figure BDA0002016510000000023
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents the distance, and e and f represent preset parameters.
In a second aspect, an embodiment of the present invention provides a graphics adjusting apparatus, where the apparatus includes:
the vertex angle number acquisition module is used for acquiring the vertex angle number of the star to be adjusted;
the width acquisition module is used for acquiring the width of the star to be adjusted as the representation information under the condition that the number of the vertex angles is an even number;
the height acquisition module is used for acquiring the height of the star to be adjusted as the representation information under the condition that the number of the vertex angles is odd;
the distance calculation module is used for calculating the distance from the central point to the vertex of the positive star determined by the vertex angle number and the representation information according to the vertex angle number and the representation information;
and the graph adjusting module is used for adjusting the star to be adjusted according to the vertex angle number, the representation information and the distance to obtain an adjusted star with the same vertex angle and the same side length.
In an embodiment of the present invention, the distance calculating module is specifically configured to:
the distance r is calculated according to the following expression:
Figure BDA0002016510000000031
wherein m represents the characterization information, n represents the number of the vertex angles, and a, b, and c represent preset parameters.
In one embodiment of the invention:
the graph adjusting module is specifically configured to, when the vertex angle number is an even number, calculate a first numerical value according to the following expression, and adjust the height of the star to be adjusted to the first numerical value while keeping the vertex angle number and the width of the star to be adjusted unchanged, to obtain an adjusted star with equal vertex angles and equal side lengths:
Figure BDA0002016510000000032
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents the distance, m represents the characterization information, and d represents a preset parameter.
In one embodiment of the invention:
the graph adjusting module is specifically configured to, when the vertex angle number is an odd number, calculate a second numerical value according to the following expression, and adjust the width of the star to be adjusted to the second numerical value while keeping the vertex angle number and the height of the star to be adjusted unchanged, to obtain an adjusted star with equal vertex angles and equal side lengths:
Figure BDA0002016510000000033
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents the distance, and e and f represent preset parameters.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a fourth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of any one of the above first aspects.
In a fifth aspect, embodiments of the present invention also provide a computer program product comprising instructions, which when run on a computer, cause the computer to perform the method steps of any of the first aspects described above.
As can be seen from the above, when the star is adjusted by applying the scheme provided by the embodiment of the present invention, the number of vertex angles of the star to be adjusted is obtained; under the condition that the number of vertex angles is an even number, acquiring the width of a star to be adjusted as characterization information; under the condition that the number of vertex angles is odd, acquiring the height of the star to be adjusted as characterization information; calculating the distance from the central point to the vertex of the positive star determined by the vertex angle number and the representation information according to the vertex angle number and the representation information; and adjusting the star to be adjusted according to the vertex angle number, the representation information and the distance to obtain an adjusted star with the same vertex angle and the same side length. Compared with the prior art, when the scheme provided by the embodiment of the invention is applied to star adjustment, the judgment by naked eyes is not needed, and the graph adjustment is carried out according to the height, the width and the vertex angle of the star, so that the influence of subjective factors of a user on an adjustment result can be reduced, and the accuracy of adjusting the star to be a positive star is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for adjusting a graph according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a diagram provided by an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a graphic adjustment apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a method and a device for adjusting a graph, which are respectively described in detail below.
First, an execution body of the graphic adjustment scheme provided by the embodiment of the present invention is explained.
The execution subject may be a software client. For example, the software client may perform file processing such as WPS, Word, PDF, or may perform graphics processing.
In addition, the execution main body may also be an electronic device running the software client. Such as desktop computers, notebook computers, tablet computers, smart phones, and the like.
The following describes a method for adjusting a pattern according to an embodiment of the present invention with reference to a specific embodiment.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for adjusting a pattern according to an embodiment of the present invention, where the method includes the following steps 101-105.
Step 101, acquiring the vertex angle number of the star to be adjusted.
Specifically, the star to be adjusted may be a positive star or a non-positive star, and the application does not limit this.
In an implementation manner of the present invention, the vertex angle number may be obtained by obtaining a vertex angle number of a star to be adjusted, which is input by a user. For example, the electronic device may generate a dialog box on the display interface, and the user inputs the number of vertices of the star to be adjusted in the dialog box, so that the electronic device obtains the number of vertices input by the user.
In another implementation manner of the invention, the vertex of the star to be adjusted can be identified, and the vertex angle number of the star to be adjusted is obtained according to the vertex number of the star to be adjusted.
And 102, acquiring the width of the star to be adjusted as the representation information under the condition that the number of the vertex angles is even.
Specifically, in an implementation manner of the present invention, the width may be obtained by obtaining a width of the star to be adjusted, which is input by a user. For example, the electronic device may generate a dialog box in the display interface in which the user enters the width of the star to be tuned, so that the electronic device obtains the width entered by the user.
In another implementation manner of the present invention, the vertex of the star to be adjusted may be identified, the coordinates of the identified vertex may be obtained, and the width of the star to be adjusted may be calculated according to the identified vertex coordinates.
In another implementation manner of the present invention, the width of the circumscribed rectangle of the star to be adjusted can be obtained, and the obtained width is used as the width of the star to be adjusted. Specifically, referring to fig. 2, the width of the five-pointed star to be adjusted can be obtained by identifying the width of the circumscribed rectangle.
And 103, acquiring the height of the star to be adjusted as the representation information under the condition that the number of the vertex angles is odd.
Specifically, the implementation manner of this step is similar to that of step 102, and the height of the star to be adjusted may be obtained by means of user input, vertex recognition, circumscribed rectangle recognition, or the like, which is not described in detail herein.
And step 104, calculating the distance from the center point to the vertex of the positive star determined by the vertex angle number and the representation information according to the vertex angle number and the representation information.
In one embodiment of the present invention, the distance r may be calculated by the following expression:
Figure BDA0002016510000000061
wherein m represents the above characterizing information, n represents the number of vertex angles, and a, b, and c represent preset parameters.
Specifically, the value of a may be 2, the value of b may be 3, and the value of c may be 2. Under the condition, if the number of the vertex angles of the star to be adjusted is 6 and the characterization information is 20 pixel points, the distance from the center point to the vertex of the regular hexagon star with the width of 20 pixel points can be calculated according to the formula:
Figure BDA0002016510000000062
the distance from the center point to the vertex of the regular hexagon star with the width of 20 pixel points is 12 pixel points obtained by calculation.
In addition to the above, the values of a, b, and c may be other values, for example, a may be 1, 1.5, 2.5, 3, etc., b may be 2.5, 3.5, 4, etc., and c may be 1, 1.5, 2.5, 3, etc. The embodiments of the present invention are described above as examples, and the schemes provided by the embodiments of the present invention are not limited.
And 105, adjusting the star to be adjusted according to the vertex angle number, the representation information and the distance to obtain an adjusted star with the same vertex angle and the same side length.
The inventor finds that the star has different characteristics when the star has different vertex angles in the experimental process. In view of this, in one embodiment of the present invention, if the number of the star points to be adjusted is even, the first value is calculated according to the following expression, and the height of the star to be adjusted is adjusted to the first value while keeping the number of the star points to be adjusted and the width unchanged:
Figure BDA0002016510000000071
wherein mod represents a remainder operator, n represents a vertex angle number, r represents the distance, m represents characterization information, and d represents a preset parameter.
Specifically, the value of d may be 4. Under the condition, if the number of the vertex angles of the star to be adjusted is 6 and the width is 20 pixel points, the height of the hexagonal star with the width of 20 pixel points can be calculated according to the formula:
Figure BDA0002016510000000072
the height of the hexagonal star with the width of 20 pixel points is 24 pixel points through calculation.
In addition to the above, the value of d may be other values, for example, the value of d may be 3, 5, 6, and so on. The embodiments of the present invention are described above as examples, and the schemes provided by the embodiments of the present invention are not limited.
In another embodiment of the present invention, when the number of the star points to be adjusted is odd, a second value is calculated according to the following expression, and the width of the star to be adjusted is adjusted to the second value while the number of the star points to be adjusted and the height of the star to be adjusted are kept unchanged:
Figure BDA0002016510000000073
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents a distance, and e and f represent preset parameters.
Specifically, the value of e may be 5, and the value of f may be 4. In this case, if the number of the vertex angles of the star to be adjusted is 5 and the height is 20 pixel points, the width of the regular five-pointed star with the height of 20 pixel points can be calculated according to the formula as follows:
Figure BDA0002016510000000081
the calculation results show that the width of the regular five-pointed star with the height of 20 pixel points is 21 pixel points.
In addition to the above, the values of e and f may be other values, for example, the value of e may be 3, 4, 6, etc., and the value of f may be 2, 3, 5, etc. The embodiments of the present invention are described above as examples, and the schemes provided by the embodiments of the present invention are not limited.
It can be seen that, when the graph is adjusted by applying the schemes provided by the embodiments of the present invention, since the first numerical value and the second numerical value obtained by calculation are results obtained by calculation according to the positive star, the star to be adjusted is adjusted according to the calculation results, and an adjusted star having the same vertex angle and the same side length is obtained, and the adjusted star can be considered as the positive star. Compared with the prior art, when the scheme provided by the embodiment of the invention is applied to star adjustment, the judgment by naked eyes is not needed, and the graph adjustment is carried out according to the height, the width and the vertex angle of the star, so that the influence of subjective factors of a user on an adjustment result can be reduced, and the accuracy of adjusting the star to be a positive star is improved.
Corresponding to the graph adjusting method, the embodiment of the invention also provides a graph adjusting device.
Fig. 3 is a schematic structural diagram of a graph adjustment apparatus according to an embodiment of the present invention, where the apparatus includes:
a vertex angle number obtaining module 301, configured to obtain the number of vertex angles of the star to be adjusted;
a width obtaining module 302, configured to obtain, as characterization information, a width of the star to be adjusted when the number of vertex angles is an even number;
the height obtaining module 303 is configured to obtain the height of the star to be adjusted as the characterization information when the number of vertex angles is odd;
the distance calculation module 304 is configured to calculate, according to the vertex angle number and the characterization information, a distance from a center point of the positive star to the vertex, which is determined by the vertex angle number and the characterization information;
and the graph adjusting module 305 is configured to adjust the star to be adjusted according to the number of vertex angles, the representation information, and the distance, so as to obtain an adjusted star with the same vertex angle and the same side length.
In an embodiment of the present invention, the distance calculating module 304 is specifically configured to calculate the distance r according to the following expression:
Figure BDA0002016510000000091
wherein m represents the representation information, n represents the number of vertex angles, and a, b and c represent preset parameters.
In an embodiment of the present invention, the graph adjusting module 305 is specifically configured to, when the vertex angle is an even number, adjust the height of the star to be adjusted to the first value according to the following expression, while keeping the vertex angle and the width of the star to be adjusted unchanged, to obtain an adjusted star with equal vertex angles and equal side lengths:
Figure BDA0002016510000000092
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents a distance, m represents characterization information, and d represents a preset parameter.
In another embodiment of the present invention, the graph adjusting module 305 is specifically configured to, when the number of vertices is an odd number, calculate a second value according to the following expression, and adjust the width of the star to be adjusted to the second value under the condition that the number of vertices and the height of the star to be adjusted are not changed, so as to obtain an adjusted star with equal vertices and equal side lengths:
Figure BDA0002016510000000093
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents a distance, and e and f represent preset parameters.
It can be seen that, when the device provided by the above embodiments of the present invention is applied to adjust a graph, since the first numerical value and the second numerical value obtained by calculation are results obtained by calculation according to a regular star, the star to be adjusted is adjusted according to the calculation results, and an adjusted star having an equal vertex angle and an equal side length is obtained, and the adjusted star can be considered as a regular star. Compared with the prior art, when the device provided by the embodiment of the invention is applied to star adjustment, the judgment by naked eyes is not needed, and the graphic adjustment is carried out according to the height, the width and the vertex angle of the star, so that the influence of subjective factors of a user on an adjustment result can be reduced, and the accuracy of adjusting the star to be a positive star is improved.
Corresponding to the graph adjusting method, the embodiment of the invention also provides electronic equipment.
In an embodiment of the present invention, as shown in fig. 4, there is provided a schematic structural diagram of an electronic device, where the electronic device includes: a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402 and the memory 403 communicate with each other via the communication bus 404,
a memory 403 for storing a computer program;
the processor 401 is configured to implement the graph adjustment method provided in the embodiment of the present invention when executing the program stored in the memory 403.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program is executed by a processor to implement the steps of any of the above-mentioned graph adjustment methods.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform any of the above-described graph adjustment methods.
It can be seen that, when the electronic device provided by the above embodiment is applied to perform graph adjustment, when a computer program stored in a computer-readable storage medium provided by the above embodiment is executed to perform graph adjustment, and when a computer runs the computer program product provided by the above embodiment on a computer to perform graph adjustment, the vertex angle number of the star to be adjusted is obtained; under the condition that the number of vertex angles is an even number, acquiring the width of a star to be adjusted as characterization information; under the condition that the number of vertex angles is odd, acquiring the height of the star to be adjusted as characterization information; calculating the distance from the central point to the vertex of the positive star determined by the vertex angle number and the representation information according to the vertex angle number and the representation information; and adjusting the star to be adjusted according to the vertex angle number, the representation information and the distance to obtain an adjusted star with the same vertex angle and the same side length, wherein the adjusted star is considered to be a positive star.
Compared with the prior art, when the scheme provided by the embodiment of the invention is applied to star adjustment, the method does not depend on naked eye judgment any more, but carries out the graph adjustment according to the height, the width and the number of the top angles of the star, so that the influence of subjective factors of a user on an adjustment result can be reduced, and the accuracy of adjusting the star to be a positive star is improved.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, apparatus embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are described with relative simplicity as they are substantially similar to method embodiments, where relevant only as described in portions of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for adjusting a pattern, comprising:
acquiring the number of vertex angles of the star to be adjusted;
under the condition that the number of the vertex angles is an even number, acquiring the width of the star to be adjusted as characterization information;
under the condition that the number of the vertex angles is odd, acquiring the height of the star to be adjusted as characterization information;
according to the vertex angle number and the representation information, calculating the distance from the central point to the vertex of the positive star determined by the vertex angle number and the representation information;
and adjusting the star to be adjusted according to the vertex angle number, the characterization information and the distance to obtain an adjusted star with the same vertex angle and the same side length.
2. The method of claim 1, wherein said calculating a center-to-vertex distance of a positive star determined by said vertex number and said characterization information from said vertex number and said characterization information comprises:
the distance r is calculated according to the following expression:
Figure FDA0002016509990000011
wherein m represents the characterization information, n represents the number of the vertex angles, and a, b, and c represent preset parameters.
3. The method according to claim 1 or 2, wherein the adjusting the star to be adjusted according to the vertex angle number, the characterization information and the distance comprises:
when the vertex angle number is an even number, calculating a first numerical value according to the following expression, and under the condition that the vertex angle number and the width of the star to be adjusted are kept unchanged, adjusting the height of the star to be adjusted to be the first numerical value:
Figure FDA0002016509990000012
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents the distance, m represents the characterization information, and d represents a preset parameter.
4. The method according to claim 1 or 2, wherein the adjusting the star to be adjusted according to the vertex angle number, the characterization information and the distance comprises:
when the number of the vertex angles is an odd number, calculating a second numerical value according to the following expression, and under the condition that the number of the vertex angles and the height of the star to be adjusted are not changed, adjusting the width of the star to be adjusted to be the second numerical value:
Figure FDA0002016509990000021
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents the distance, and e and f represent preset parameters.
5. A pattern adjustment apparatus, characterized in that the apparatus comprises:
the vertex angle number acquisition module is used for acquiring the vertex angle number of the star to be adjusted;
the width acquisition module is used for acquiring the width of the star to be adjusted as the representation information under the condition that the number of the vertex angles is an even number;
the height acquisition module is used for acquiring the height of the star to be adjusted as the representation information under the condition that the number of the vertex angles is odd;
the distance calculation module is used for calculating the distance from the central point to the vertex of the positive star determined by the vertex angle number and the representation information according to the vertex angle number and the representation information;
and the graph adjusting module is used for adjusting the star to be adjusted according to the vertex angle number, the representation information and the distance to obtain an adjusted star with the same vertex angle and the same side length.
6. The apparatus of claim 5, wherein the distance calculation module is specifically configured to:
the distance r is calculated according to the following expression:
Figure FDA0002016509990000022
wherein m represents the characterization information, n represents the number of the vertex angles, and a, b, and c represent preset parameters.
7. The apparatus of claim 5 or 6, wherein:
the graph adjusting module is specifically configured to, when the vertex angle number is an even number, calculate a first numerical value according to the following expression, and adjust the height of the star to be adjusted to the first numerical value while keeping the vertex angle number and the width of the star to be adjusted unchanged, to obtain an adjusted star with equal vertex angles and equal side lengths:
Figure FDA0002016509990000023
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents the distance, m represents the characterization information, and d represents a preset parameter.
8. The apparatus of claim 5 or 6, wherein:
the graph adjusting module is specifically configured to, when the vertex angle number is an odd number, calculate a second numerical value according to the following expression, and adjust the width of the star to be adjusted to the second numerical value while keeping the vertex angle number and the height of the star to be adjusted unchanged, to obtain an adjusted star with equal vertex angles and equal side lengths:
Figure FDA0002016509990000031
wherein mod represents a remainder operator, n represents the number of the vertex angles, r represents the distance, and e and f represent preset parameters.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN201910265035.0A 2019-04-03 2019-04-03 Graph adjusting method and device Pending CN111784559A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910265035.0A CN111784559A (en) 2019-04-03 2019-04-03 Graph adjusting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910265035.0A CN111784559A (en) 2019-04-03 2019-04-03 Graph adjusting method and device

Publications (1)

Publication Number Publication Date
CN111784559A true CN111784559A (en) 2020-10-16

Family

ID=72754758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910265035.0A Pending CN111784559A (en) 2019-04-03 2019-04-03 Graph adjusting method and device

Country Status (1)

Country Link
CN (1) CN111784559A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001067485A (en) * 1999-08-27 2001-03-16 Digital Electronics Corp Device and method for drawing polygon, and computer- readable recording medium where for program drawing polygon is recorded
US20040263537A1 (en) * 2003-06-30 2004-12-30 Peter Faraday Flexibly resizeable vector graphics
US20070046675A1 (en) * 2005-08-31 2007-03-01 Fujitsu Limited Polygonal chart drawing processing method, device and computer-readable medium recording a program of the same
CN101410875A (en) * 2006-04-24 2009-04-15 松下电器产业株式会社 Drawing device and drawing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001067485A (en) * 1999-08-27 2001-03-16 Digital Electronics Corp Device and method for drawing polygon, and computer- readable recording medium where for program drawing polygon is recorded
US20040263537A1 (en) * 2003-06-30 2004-12-30 Peter Faraday Flexibly resizeable vector graphics
US20070046675A1 (en) * 2005-08-31 2007-03-01 Fujitsu Limited Polygonal chart drawing processing method, device and computer-readable medium recording a program of the same
CN101410875A (en) * 2006-04-24 2009-04-15 松下电器产业株式会社 Drawing device and drawing method

Similar Documents

Publication Publication Date Title
CN109753641B (en) Method and device for changing object position, electronic equipment and storage medium
CN110708568B (en) Video content mutation detection method and device
CN112001406A (en) Text region detection method and device
WO2019241775A1 (en) Systems and methods for optimized computer vision using deep neural networks and lipschitz analysis
CN113190781A (en) Page layout method, device, equipment and storage medium
CN111222368A (en) Method and device for identifying document paragraph and electronic equipment
CN111523531A (en) Word processing method and device, electronic equipment and computer readable storage medium
CN112508005A (en) Method, apparatus, device and storage medium for processing image
CN111240622B (en) Drawing method and device
CN111784559A (en) Graph adjusting method and device
CN111951349A (en) Method and device for adjusting graph vertex type and electronic equipment
US20160247283A1 (en) System and method for directionality based row detection
CN109165648B (en) Image processing method, image processing device and mobile terminal
CN111402366A (en) Character rendering method and device, electronic equipment and storage medium
CN111768464B (en) Graph adjustment method and device
CN112990163A (en) Fingerprint calibration method, electronic device and storage medium
CN111767700B (en) Graph adjustment method and device
CN109657205B (en) Text line height adjusting method and device and electronic equipment
CN115984309A (en) Method and device for training image segmentation model and image segmentation
CN114035706A (en) Touch screen finger characteristic analysis method, device, equipment and storage medium
CN112233202B (en) Regular polygon drawing method and device, electronic equipment and readable storage medium
CN107945016B (en) Variable value dimension increasing method and device and computer readable storage medium
CN112784551A (en) Method, device and equipment for realizing cell and picture adaptation
CN111696169A (en) Method and device for generating equilateral polygon and electronic equipment
US10354424B1 (en) Method and apparatus of data display

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