WO2017101454A1 - Information processing method and device - Google Patents

Information processing method and device Download PDF

Info

Publication number
WO2017101454A1
WO2017101454A1 PCT/CN2016/092174 CN2016092174W WO2017101454A1 WO 2017101454 A1 WO2017101454 A1 WO 2017101454A1 CN 2016092174 W CN2016092174 W CN 2016092174W WO 2017101454 A1 WO2017101454 A1 WO 2017101454A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
line
vector line
closed area
deleted
Prior art date
Application number
PCT/CN2016/092174
Other languages
French (fr)
Chinese (zh)
Inventor
陈双龙
Original Assignee
广州视睿电子科技有限公司
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 广州视睿电子科技有限公司 filed Critical 广州视睿电子科技有限公司
Publication of WO2017101454A1 publication Critical patent/WO2017101454A1/en

Links

Images

Classifications

    • 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
    • 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

Definitions

  • the present invention relates to the field of image processing technologies, and in particular, to an information processing method, apparatus, and electronic device.
  • the inventors have found that the prior art determines the vector lines that need to be deleted through complicated mathematical calculations and image processing methods, requires a high computer configuration, and occupies more computer resources.
  • the present invention provides the following technical solutions:
  • An information processing method includes:
  • the vector line deletion range is outside the target closed area or outside the target closed area;
  • the two end points of the target vector line are all within the target closed area, or both outside the target closed area, determine whether the target vector line is a line to be deleted by the vector line deletion range;
  • the target line is equally divided into a plurality of segments, if the first equal point of the adjacent two equal points is located in the target closed area And a second halving point of the two adjacent bisector points is located outside the target closed area, and determining that one of the adjacent two bisector points is the target vector line and the target is closed Intersection of the area;
  • a partial line on the target vector line that needs to be deleted is determined based on a relationship between two end points of the target vector line and the target closed area, an intersection of the target vector line and the target closed area, and the vector line deletion range.
  • both end points of the target vector line are in the target closed area, or both outside the target closed area, determine whether the target vector line is Lines that need to be removed, including:
  • the vector line deletion range is within the target closed area, determine that the target vector line is a line that needs to be deleted
  • both end points of the target vector line are outside the target closed area, and the vector line deletion range is outside the target closed area, it is determined that the target vector line is a line that needs to be deleted.
  • the relationship between the two end points of the target vector line and the target closed area, the intersection of the target vector line and the target closed area, and the vector line deletion range determine the target vector line
  • the target The part of the line on the vector line that needs to be deleted is: the line between the first end point and the intersection point on the line of the target vector;
  • the target The part of the line on the vector line that needs to be deleted is: the line between the second end point and the intersection point on the line of the target vector.
  • determining one of the adjacent two equal points is an intersection of the target vector line and the target closed area, including:
  • Determining a point in the adjacent closed area of the adjacent two equal points is an intersection of the target vector line and the target closed area.
  • the above method preferably, further includes:
  • An information processing apparatus comprising:
  • a first determining module configured to determine a target closed area, a vector line deletion range, and at least one target vector line; the vector line deletion range is outside the target closed area or outside the target closed area;
  • a judging module configured to determine, for each piece of the target vector line, a relationship between two end points of the target vector line and the target closed area
  • a second determining module configured to determine, if the two end points of the target vector line are in the target closed area, or outside the target closed area, determine whether the target vector line is needed by using the vector line deletion range Deleted line;
  • a third determining module configured to: if only one end point of the two end points of the target vector line is located in the target area, divide the target line into a plurality of segments equally, if the first equal point of the adjacent two equal points Located in the target closed area, a second one of the adjacent two equal points is located outside the target closed area, and one of the adjacent two equal points is determined as the target The intersection of the vector line and the closed area of the target;
  • a fourth determining module configured to determine a relationship between two end points of the target vector line and the target closed area, an intersection of the target vector line and the target closed area, and the vector line deletion range determines that the target vector line needs Part of the line that was deleted.
  • the second determining module comprises
  • a first determining unit configured to determine that the target vector line is a line to be deleted if both end points of the target vector line are in the target closed area, and the vector line deletion range is in the target closed area ;
  • a second determining unit configured to determine that the target vector line is a line to be deleted if both end points of the target vector line are outside the target closed area, and the vector line deletion range is outside the target closed area .
  • the fourth determining module comprises:
  • a third determining unit configured to: if a first end point of the two end points of the target vector line is located in the target closed area, the second end point is located outside the target closed area, and the deletion range of the vector line is a target In the enclosed area, the part of the line of the target vector that needs to be deleted is: a line between the first end point and the intersection point on the line of the target vector;
  • a fourth determining unit configured to: if the first end point of the two end points of the target vector line is located in the target closed area, the second end point is located outside the target closed area, and the vector line is deleted The portion of the target vector line that needs to be deleted is the line between the second endpoint and the intersection on the target vector line, except that the range is the target closed area.
  • the third determining module is configured to determine that one of the adjacent two bisectors is an intersection of the target vector line and the target closed area, and the determining the adjacent two The point in the target closed area among the equal dividing points is the intersection of the target vector line and the target closed area.
  • the above device preferably, further comprises:
  • a deleting module configured to delete all the determined lines that need to be deleted after each line in the at least one target vector line determines the part that needs to be deleted.
  • an information processing method and apparatus determine a target closed area, a vector line deletion range, and at least one target vector line. For each target vector line, according to the two end points and targets of the target vector line The relationship between the closed area and the target closed area is determined.
  • the target vector line is a line to be deleted, and if there is an intersection, the line from the target vector Determining a point among the plurality of aliquots is an intersection of the target vector line and the target closed area, so that based on the intersection, the relationship between the two end points of the target vector line and the target closed area, and the vector line deletion range determine the target
  • the part of the line on the vector line that needs to be deleted is simple to calculate and has a small amount of computation, so that the vector line that needs to be deleted is determined with a lower computer configuration.
  • FIG. 1 is a flowchart of an implementation of an information processing method according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of an information processing apparatus according to an embodiment of the present disclosure
  • FIG. 3 is a schematic structural diagram of a second determining module according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of a fourth determining module according to an embodiment of the present application.
  • FIG. 5 is another schematic structural diagram of an information processing apparatus according to an embodiment of the present disclosure.
  • FIG. 1 is a flowchart of an implementation of an information processing method according to an embodiment of the present disclosure, which may include:
  • Step S11 determining a target closed area, a vector line deletion range, and at least one target vector line; the vector line deletion range is outside the target closed area or outside the target closed area;
  • the user may need to delete some lines in a closed area, or may need to delete some lines outside the closed area.
  • the target closed area, the vector line deletion range, and the at least one target vector line may be selected by the user.
  • the display vector line deletion range option list is triggered by the user's preset operation, and the user selects the vector line deletion range from the list.
  • all the vector lines may have no intersection with the target closed area.
  • all the vector lines may be located in the target closed area, or all the vector lines may be located outside the target closed area, or One part of the vector line is located in the closed area of the target, and the other part of the vector line is outside the closed area of the target.
  • all vector lines may also intersect with the target closed area; or, in the selected at least one target vector line, some vector lines and the target closed area have intersections, and some vector lines There is no intersection with the target closed area.
  • Step S12 determining, for each piece of the target vector line, a relationship between two end points of the target vector line and the target closed area;
  • the part of the target vector line that needs to be deleted is determined line by line.
  • Step S13 If both end points of the target vector line are in the target closed area, or both are outside the target closed area, determine whether the target vector line is a line to be deleted by the vector line deletion range;
  • Step S14 If only one end point of the two end points of the target vector line is located in the target area, divide the target line into a plurality of segments equally, if the first equal point of the adjacent two equal points is located in the target In the closed area, a second of the two adjacent points is located outside the target closed area, and one of the adjacent two equal points is determined to be the target vector line and the target The intersection of closed areas;
  • each target vector line For each target vector line, if only one end point of the two end points of the target vector line is located in the target area, it indicates that the target vector line has an intersection with the target closed curve. Then, according to the vector line deletion range, only a part of the target vector line can be deleted, and the intersection of the target vector line and the target closed area needs to be obtained.
  • the target vector line is equally divided into several equal parts (for example, 20 equal parts, of course, the embodiment of the present invention is not limited to the target vector line.
  • the average is divided into 20 equal parts, the more the division, the higher the precision.
  • a point is determined from several equal points on the target vector line as the intersection of the vector line and the target closed area.
  • the first of the two endpoints of the target vector line is within the target enclosed area and the second endpoint is outside the target closed area.
  • traversing each of the bisector points on the target vector line sequentially, if the i-th bisector on the target vector line is in the target closed area, and the i+1th The aliquot is outside the target closed area, then the i-th aliquot can be determined, or the i+1 quintile is the intersection of the target vector line and the target closed area.
  • the i-th bisector on the target vector line is outside the target closed area, and the i+1th The aliquot is in the target closed area, then the i-th aliquot can be determined, or the i+1 quintile is the intersection of the target vector line and the target closed area.
  • a point in the target two closed points that is located in the target closed area may be determined as an intersection of the target vector line and the target closed area.
  • the halving point is also determined to be within the target closed area when the halving point is on the edge of the target closed area, the point in the target closed area among the two adjacent halved points is determined The intersection of the target vector line and the target closed area makes the operation result more accurate.
  • Step S15 determining a relationship between two end points of the target vector line and the target closed area, an intersection of the target vector line and the target closed area, and a vector line deletion range to determine a part of the line on the target vector line to be deleted.
  • the vector line deletion range determination For each target vector line, after determining the intersection of the target vector line and the target closed area, according to the intersection, the relationship between the two end points of the target vector line and the target closed area, and the vector line deletion range determination The part of the target vector line that needs to be deleted.
  • the intersection of the target vector line and the target closed area is determined by calculating the positional relationship between the finite equal point and the target closed area, which is simple and computationally inefficient.
  • the information processing method provided by the embodiment of the present invention determines a target closed area, a vector line deletion range, and at least one target vector line. For each target vector line, the target is determined according to the relationship between the two end points of the target vector line and the target closed area. Whether there is an intersection point between the vector line and the target closed area.
  • the target vector line deletion range determines whether the target vector line is a line to be deleted, and if there is an intersection point, a number from the target vector line Determining a point in the point is the intersection of the target vector line and the target closed area, so that based on the intersection, the relationship between the two end points of the target vector line and the target closed area, and the vector line deletion range determine that the target vector line needs
  • the deleted part of the line because the positional relationship between the point and the closed area is the basic function of the vector drawing software, therefore, the information processing method provided by the embodiment of the invention is simple in calculation and less in computation, thereby realizing the determination by the lower computer configuration.
  • Vector lines that need to be removed are simple in calculation and less in computation, thereby realizing the determination by the lower computer configuration.
  • the vector line deletion range is used to determine whether the target vector line is a line to be deleted.
  • the specific implementation manner may include:
  • both end points of the target vector line are within the target closed area, and the vector line deletion range is within the target closed area, determine that the target vector line is a line that needs to be deleted;
  • both end points of the target vector line are outside the target closed area, and the vector line deletion range is outside the target closed area, it is determined that the target vector line is a line that needs to be deleted.
  • both end points of the target vector line are in the target closed area, and the vector line deletion range is outside the target closed area, it can be determined that the target vector line is a line that cannot be deleted, that is, a line that needs to be retained.
  • both end points of the target vector line are outside the target closed area, and the vector line deletion range is within the target closed area, it can be determined that the target vector line is a line that cannot be deleted, that is, a line that needs to be retained.
  • the relationship between the two endpoints of the target vector line and the target closed region, the intersection of the target vector line and the target closed region, and the vector line deletion range determine one of the partial lines of the target vector line that need to be deleted.
  • the implementation can be:
  • the target The part of the line on the underlying vector that needs to be deleted is: the line between the first endpoint and the intersection on the line of the target vector;
  • the line between the first endpoint and the intersection on the target vector line is the line that needs to be deleted.
  • the target vector line needs to be deleted.
  • the part of the line is: the line between the second endpoint and the intersection on the target vector line.
  • the line between the second end point and the intersection point on the target vector line is the line that needs to be deleted.
  • the target vector line may be equally divided into several segments by a binary method.
  • the target vector line can be equally divided into even segments by the dichotomy.
  • the target vector line is not evenly divided into even-numbered segments, and the target vector line is evenly divided into odd-numbered segments. Therefore, in the embodiment of the present invention, the target vector lines are equally divided into several segments. It is not limited to the dichotomy, and there may be other methods of division, which are not specifically limited herein.
  • the information processing method provided by the embodiment of the present invention may further include:
  • each of the at least one target vector line determines the portion to be deleted, all the determined lines that need to be deleted are deleted.
  • any one of the at least one target vector line (for the convenience of description, the first target vector line), if the part of the first target vector line that needs to be deleted is deleted, The remaining part of the first target vector line is taken as the target vector line, and the relationship between the two end points of the target vector line and the target closed area is determined. If only one of the two end points is in the target area, it means that if there are still some lines In the vector line deletion range, the remaining part of the first target vector line can be used as the target vector line, and divided equally into several segments again, if the first equal point of the adjacent two equal points is located in the target closed area.
  • the second bisector of the two adjacent bisectors is located outside the target closed area, and one of the adjacent two bisectors is determined to be the intersection of the target vector line and the target closed area;
  • the relationship between the two endpoints of the target vector line and the target closed region, the intersection of the target vector line and the target closed region, and the vector line deletion range determine the partial lines on the target vector line that need to be deleted.
  • the intersection of the target vector line and the target closed area is more accurately determined by dividing the target vector line multiple times. Improve the accuracy of information processing.
  • the embodiment of the present invention further provides an information processing device.
  • a schematic structural diagram of the information processing device provided by the embodiment of the present invention is as shown in FIG. 2, and may include:
  • the first determining module 21 is configured to determine a target closed area, a vector line deletion range, and at least one target vector line; wherein the vector line deletion range is within the target closed area or outside the target closed area;
  • the first determining module 21 may select a target closed area, a vector line deletion range, and at least one target vector line according to a user.
  • the first determining module 21 may trigger the display vector line deletion range option list by the user's preset operation after the user selects the target closed area and the at least one target vector line, and the user selects the vector line deletion range from the list.
  • all the vector lines may have no intersection with the target closed area.
  • all the vector lines may be located in the target closed area, or all the vector lines may be located outside the target closed area, or One part of the vector line is located in the closed area of the target, and the other part of the vector line is outside the closed area of the target.
  • all vector lines may also intersect with the target closed area; or, in the selected at least one target vector line, some vector lines and the target closed area have intersections, and some vector lines There is no intersection with the target closed area.
  • the determining module 22 is configured to determine, for each piece of the target vector line, a relationship between two end points of the target vector line and the target closed area;
  • the part of the target vector line that needs to be deleted is determined line by line.
  • the second determining module 23 is configured to determine, if the two end points of the target vector line are in the target closed area, or outside the target closed area, determine whether the target vector line is a line to be deleted by using a vector line deletion range;
  • the third determining module 24 is configured to divide the target line into a plurality of segments even if only one end point of the two end points of the target vector line is located in the target area, if the first equal dividing point of the two adjacent equal dividing points Located in the closed area of the target, the second bisector of the two adjacent bisectors is located outside the target closed area, and one of the adjacent two bisectors is determined to be the target vector line and the target closed area.
  • each target vector line For each target vector line, if only one end point of the two end points of the target vector line is located in the target area, it indicates that the target vector line has an intersection with the target closed curve. Then, according to the vector line deletion range, only a part of the target vector line can be deleted, and the intersection of the target vector line and the target closed area needs to be obtained.
  • the target vector line is equally divided into several equal parts (for example, 20 equal parts, of course, the embodiment of the present invention is not limited to the target vector line.
  • the average is divided into 20 equal parts, the more the division, the higher the precision.
  • a point is determined from several equal points on the target vector line as the intersection of the vector line and the target closed area.
  • one of the adjacent two equal points may be determined as the The intersection of the target vector line and the closed area of the target.
  • the first of the two endpoints of the target vector line is within the target enclosed area and the second endpoint is outside the target closed area.
  • traversing each of the bisector points on the target vector line sequentially, if the i-th bisector on the target vector line is in the target closed area, and the i+1th The aliquot is outside the target closed area, then the i-th aliquot can be determined, or the i+1 quintile is the intersection of the target vector line and the target closed area.
  • the i-th bisector on the target vector line is outside the target closed area, and the i+1th The aliquot is in the target closed area, then the i-th aliquot can be determined, or the i+1 quintile is the intersection of the target vector line and the target closed area.
  • the fourth determining module 25 is configured to determine, according to the relationship between the two end points of the target vector line and the target closed area, the intersection of the target vector line and the target closed area, and the vector line deletion range, the target vector line needs to be deleted. Part of the line.
  • the vector line deletion range determination For each target vector line, after determining the intersection of the target vector line and the target closed area, according to the intersection, the relationship between the two end points of the target vector line and the target closed area, and the vector line deletion range determination The part of the target vector line that needs to be deleted.
  • the intersection of the target vector line and the target closed area is determined by calculating the positional relationship between the finite equal point and the target closed area, which is simple and computationally inefficient.
  • the information processing apparatus determines a target closed area, a vector line deletion range, and at least one target vector line. For each target vector line, the target is determined according to the relationship between the two end points of the target vector line and the target closed area. Whether there is an intersection point between the vector line and the target closed area.
  • the target vector line deletion range determines whether the target vector line is a line to be deleted, and if there is an intersection point, from several equal points on the target vector line Determining a point as an intersection of the target vector line and the target closed area, so that based on the intersection, the relationship between the two end points of the target vector line and the target closed area, and the vector line deletion range determine that the target vector line needs to be deleted
  • the partial line because the positional relationship between the point and the closed area is the basic function of the vector drawing software, therefore, the information processing method provided by the embodiment of the present invention is simple in calculation and small in amount of calculation, thereby realizing that the deletion needs to be performed with a lower computer configuration.
  • Vector lines because the positional relationship between the point and the closed area is the basic function of the vector drawing software, therefore, the information processing method provided by the embodiment of the present invention is simple in calculation and small in amount of calculation, thereby realizing that the deletion needs to be performed with a lower computer configuration.
  • a schematic structural diagram of the second determining module 23 is as shown in FIG. 3, and may include:
  • the first determining unit 31 is configured to determine that the target vector line is a line that needs to be deleted if both end points of the target vector line are within the target closed area and the vector line deletion range is within the target closed area;
  • the first determining unit 31 is further configured to: if both end points of the target vector line are in the target closed area, and the vector line deletion range is outside the target closed area, it may be determined that the target vector line is a line that cannot be deleted, That is, the lines that need to be preserved.
  • the second determining unit 32 is configured to determine that the target vector line is a line that needs to be deleted if both end points of the target vector line are outside the target closed area and the vector line deletion range is the target closed area.
  • the second determining unit 32 is further configured to: if both end points of the target vector line are outside the target closed area, and the vector line deletion range is within the target closed area, it may be determined that the target vector line is a line that cannot be deleted. That is, the lines that need to be preserved.
  • a schematic structural diagram of the fourth determining module 25 is as shown in FIG. 4, and may include:
  • the third determining unit 41 is configured to: if the first end point of the two end points of the target vector line is located in the target closed area, the second end point is outside the target closed area, and the deletion range of the vector line is within the target closed area, then the The part of the line on the target vector that needs to be deleted is: the line between the first end point and the intersection point on the line of the target vector;
  • the line between the first endpoint and the intersection on the target vector line is the line that needs to be deleted.
  • the fourth determining unit 42 is configured to: if the first end point of the two end points of the target vector line is located in the target closed area, the second end point is outside the target closed area, and the deletion range of the vector line is outside the target closed area, then the The part of the line on the target vector that needs to be deleted is: the line between the second end point on the line of the target vector and the intersection.
  • the line between the second end point and the intersection point on the target vector line is the line that needs to be deleted.
  • the third determining module 24 may divide the target vector line into a plurality of segments by a dichotomy.
  • the target vector line can be equally divided into even segments by the dichotomy.
  • the target vector line is not evenly divided into even-numbered segments, and the target vector line is evenly divided into odd-numbered segments. Therefore, in the embodiment of the present invention, the target vector lines are equally divided into several segments. It is not limited to the dichotomy, and the target vector lines can be equally divided into several segments by other division methods, which are not specifically limited herein.
  • FIG. 5 another schematic structural diagram of the information processing apparatus provided by the embodiment of the present invention is as shown in FIG. 5, and may further include:
  • the deleting module 51 is configured to delete all the determined lines that need to be deleted after each line in the at least one target vector line is determined to be deleted.
  • the triggering determination module 22 determines the relationship between the two endpoints of the target vector line and the target closed region, if only one of the two endpoints is within the target region, If a part of the line is within the vector line deletion range, the third determining module 24 divides the remaining part of the first target vector line into a plurality of segments, if the first halving point of the adjacent two equal points is at the target In the closed area, the second of the two adjacent points is located outside the target closed area, and one of the adjacent two equal points is determined to be the intersection of the target vector line and the target closed area. ;
  • the relationship between the two endpoints of the target vector line and the target closed region, the intersection of the target vector line and the target closed region, and the vector line deletion range determine the partial lines on the target vector line that need to be deleted.
  • the intersection of the target vector line and the target closed area is more accurately determined by dividing the target vector line multiple times, thereby improving the precision of information processing.
  • the disclosed system if present
  • apparatus if present
  • method may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

An information processing method and device, comprising: determining a target closed area, a vector line deletion range and at least one target vector line (S11); with respect to each target vector line, determining the relationship between the two end points thereof and the target closed area (S12); determining whether an intersection point is present between the target vector line and the target closed area, if no such intersection point is present, determining whether the target vector line is a to-be-deleted line according to the vector line deletion range (S13), and if such an intersection point is present, designating a point from among several equal diversion points on the target vector line as the intersection point between the target vector line and the target closed area; and determining the to-be-deleted lines on the target vector line on the basis of the determined intersection point, the relationship between the two end points of the target vector line and the target closed area, as well as the vector line deletion range (S15). The method involves simple calculation, requires less computation and allows for computers with lower configurations to determine to-be-deleted vector lines.

Description

信息处理方法及装置Information processing method and device 技术领域Technical field
本发明涉及图像处理技术领域,更具体地说,涉及一种信息处理方法、装置及电子设备。The present invention relates to the field of image processing technologies, and in particular, to an information processing method, apparatus, and electronic device.
背景技术Background technique
在矢量绘图过程中,由于种种原因,可能要删除封闭区域(规则或不规则的封闭区域)内或封闭区域外的部分或全部线条。During vector drawing, for various reasons, it may be necessary to delete some or all of the lines in or outside the enclosed area (regular or irregular closed areas).
发明人在实现本发明的过程中发现,现有技术中通过复杂的数学计算和图像处理方法确定需要删除的矢量线条,需要较高的计算机配置,占用计算机资源较多。In the process of implementing the present invention, the inventors have found that the prior art determines the vector lines that need to be deleted through complicated mathematical calculations and image processing methods, requires a high computer configuration, and occupies more computer resources.
发明内容Summary of the invention
本发明的目的是提供一种信息处理方法及装置,以通过较低的计算机配置确定需要删除的矢量线条。It is an object of the present invention to provide an information processing method and apparatus for determining a vector line to be deleted by a lower computer configuration.
为实现上述目的,本发明提供了如下技术方案:To achieve the above object, the present invention provides the following technical solutions:
一种信息处理方法,包括:An information processing method includes:
确定目标封闭区域、矢量线条删除范围和至少一条目标矢量线条;所述矢量线条删除范围为所述目标封闭区域内或所述目标封闭区域外;Determining a target closed area, a vector line deletion range, and at least one target vector line; the vector line deletion range is outside the target closed area or outside the target closed area;
对于每一条目标矢量线条,判断该目标矢量线条的两个端点与所述目标封闭区域的关系;For each target vector line, determining a relationship between two end points of the target vector line and the target closed area;
若该目标矢量线条的两个端点均在所述目标封闭区域内,或均在所述目标封闭区域外,通过所述矢量线条删除范围确定该目标矢量线条是否为需要删除的线条;If the two end points of the target vector line are all within the target closed area, or both outside the target closed area, determine whether the target vector line is a line to be deleted by the vector line deletion range;
若该目标矢量线条的两个端点只有一个端点位于目标区域内,将该目标线条平均划分为若干段,若相邻的两个等分点中的第一等分点位于所述目标封闭区域内,所述相邻的两个等分点中的第二等分点位于所述目标封闭区域外,确定所述相邻两个等分点中的一个点为该目标矢量线条与所述目标封闭区域的交点; If only one end point of the two end points of the target vector line is located in the target area, the target line is equally divided into a plurality of segments, if the first equal point of the adjacent two equal points is located in the target closed area And a second halving point of the two adjacent bisector points is located outside the target closed area, and determining that one of the adjacent two bisector points is the target vector line and the target is closed Intersection of the area;
基于该目标矢量线条的两个端点与所述目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及所述矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条。A partial line on the target vector line that needs to be deleted is determined based on a relationship between two end points of the target vector line and the target closed area, an intersection of the target vector line and the target closed area, and the vector line deletion range.
上述方法,优选的,所述若该目标矢量线条的两个端点均在所述目标封闭区域内,或均在所述目标封闭区域外,通过所述矢量线条删除范围确定该目标矢量线条是否为需要删除的线条,包括:In the above method, preferably, if both end points of the target vector line are in the target closed area, or both outside the target closed area, determine whether the target vector line is Lines that need to be removed, including:
若该目标矢量线条的两个端点均在所述目标封闭区域内,且所述矢量线条删除范围为所述目标封闭区域内,确定该目标矢量线条为需要删除的线条;If the two end points of the target vector line are all within the target closed area, and the vector line deletion range is within the target closed area, determine that the target vector line is a line that needs to be deleted;
或者,or,
若该目标矢量线条的两个端点均在所述目标封闭区域外,且所述矢量线条删除范围为所述目标封闭区域外,确定该目标矢量线条为需要删除的线条。If both end points of the target vector line are outside the target closed area, and the vector line deletion range is outside the target closed area, it is determined that the target vector line is a line that needs to be deleted.
上述方法,优选的,所述基于该目标矢量线条的两个端点与所述目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及所述矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条,包括:In the above method, preferably, the relationship between the two end points of the target vector line and the target closed area, the intersection of the target vector line and the target closed area, and the vector line deletion range determine the target vector line Some lines that need to be removed, including:
若该目标矢量线条的两个端点中的第一端点位于所述目标封闭区域内,第二端点位于所述目标封闭区域外,所述矢量线条的删除范围为目标封闭区域内,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上所述第一端点与所述交点之间的线条;If the first endpoint of the two endpoints of the target vector line is located in the target closed region, the second endpoint is located outside the target closed region, and the deleted range of the vector line is within the target closed region, then the target The part of the line on the vector line that needs to be deleted is: the line between the first end point and the intersection point on the line of the target vector;
若该目标矢量线条的两个端点中的第一端点位于所述目标封闭区域内,第二端点位于所述目标封闭区域外,所述矢量线条的删除范围为目标封闭区域外,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上所述第二端点与所述交点之间的线条。If the first endpoint of the two endpoints of the target vector line is located in the target closed region, the second endpoint is located outside the target closed region, and the deleted range of the vector line is outside the target closed region, then the target The part of the line on the vector line that needs to be deleted is: the line between the second end point and the intersection point on the line of the target vector.
上述方法,优选的,所述确定所述相邻两个等分点中的一个点为该目标矢量线条与所述目标封闭区域的交点,包括:In the above method, preferably, determining one of the adjacent two equal points is an intersection of the target vector line and the target closed area, including:
确定所述相邻两个等分点中的位于所述目标封闭区域内的点为该目标矢量线条与所述目标封闭区域的交点。Determining a point in the adjacent closed area of the adjacent two equal points is an intersection of the target vector line and the target closed area.
上述方法,优选的,还包括:The above method, preferably, further includes:
当所述至少一条目标矢量线条中各线条均确定完需要被删除部分后,删除所确定的所有需要被删除线条。After each line in the at least one target vector line determines the portion that needs to be deleted, all the determined lines that need to be deleted are deleted.
一种信息处理装置,包括: An information processing apparatus comprising:
第一确定模块,用于确定目标封闭区域、矢量线条删除范围和至少一条目标矢量线条;所述矢量线条删除范围为所述目标封闭区域内或所述目标封闭区域外;a first determining module, configured to determine a target closed area, a vector line deletion range, and at least one target vector line; the vector line deletion range is outside the target closed area or outside the target closed area;
判断模块,用于对于每一条目标矢量线条,判断该目标矢量线条的两个端点与所述目标封闭区域的关系;a judging module, configured to determine, for each piece of the target vector line, a relationship between two end points of the target vector line and the target closed area;
第二确定模块,用于若该目标矢量线条的两个端点均在所述目标封闭区域内,或均在所述目标封闭区域外,通过所述矢量线条删除范围确定该目标矢量线条是否为需要删除的线条;a second determining module, configured to determine, if the two end points of the target vector line are in the target closed area, or outside the target closed area, determine whether the target vector line is needed by using the vector line deletion range Deleted line;
第三确定模块,用于若该目标矢量线条的两个端点只有一个端点位于目标区域内,将该目标线条平均划分为若干段,若相邻的两个等分点中的第一等分点位于所述目标封闭区域内,所述相邻的两个等分点中的第二等分点位于所述目标封闭区域外,确定所述相邻两个等分点中的一个点为该目标矢量线条与所述目标封闭区域的交点;a third determining module, configured to: if only one end point of the two end points of the target vector line is located in the target area, divide the target line into a plurality of segments equally, if the first equal point of the adjacent two equal points Located in the target closed area, a second one of the adjacent two equal points is located outside the target closed area, and one of the adjacent two equal points is determined as the target The intersection of the vector line and the closed area of the target;
第四确定模块,用于基于该目标矢量线条的两个端点与所述目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及所述矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条。a fourth determining module, configured to determine a relationship between two end points of the target vector line and the target closed area, an intersection of the target vector line and the target closed area, and the vector line deletion range determines that the target vector line needs Part of the line that was deleted.
上述装置,优选的,第二确定模块包括,The above device, preferably, the second determining module comprises
第一确定单元,用于若该目标矢量线条的两个端点均在所述目标封闭区域内,且所述矢量线条删除范围为所述目标封闭区域内,确定该目标矢量线条为需要删除的线条;a first determining unit, configured to determine that the target vector line is a line to be deleted if both end points of the target vector line are in the target closed area, and the vector line deletion range is in the target closed area ;
第二确定单元,用于若该目标矢量线条的两个端点均在所述目标封闭区域外,且所述矢量线条删除范围为所述目标封闭区域外,确定该目标矢量线条为需要删除的线条。a second determining unit, configured to determine that the target vector line is a line to be deleted if both end points of the target vector line are outside the target closed area, and the vector line deletion range is outside the target closed area .
上述装置,优选的,所述第四确定模块包括:Preferably, the fourth determining module comprises:
第三确定单元,用于若该目标矢量线条的两个端点中的第一端点位于所述目标封闭区域内,第二端点位于所述目标封闭区域外,所述矢量线条的删除范围为目标封闭区域内,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上所述第一端点与所述交点之间的线条;a third determining unit, configured to: if a first end point of the two end points of the target vector line is located in the target closed area, the second end point is located outside the target closed area, and the deletion range of the vector line is a target In the enclosed area, the part of the line of the target vector that needs to be deleted is: a line between the first end point and the intersection point on the line of the target vector;
第四确定单元,用于若该目标矢量线条的两个端点中的第一端点位于所述目标封闭区域内,第二端点位于所述目标封闭区域外,所述矢量线条的删 除范围为目标封闭区域外,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上所述第二端点与所述交点之间的线条。a fourth determining unit, configured to: if the first end point of the two end points of the target vector line is located in the target closed area, the second end point is located outside the target closed area, and the vector line is deleted The portion of the target vector line that needs to be deleted is the line between the second endpoint and the intersection on the target vector line, except that the range is the target closed area.
上述装置,优选的,用于确定所述相邻两个等分点中的一个点为该目标矢量线条与所述目标封闭区域的交点的第三确定模块具体用于,确定所述相邻两个等分点中的位于所述目标封闭区域内的点为该目标矢量线条与所述目标封闭区域的交点。Preferably, the third determining module is configured to determine that one of the adjacent two bisectors is an intersection of the target vector line and the target closed area, and the determining the adjacent two The point in the target closed area among the equal dividing points is the intersection of the target vector line and the target closed area.
上述装置,优选的,还包括:The above device, preferably, further comprises:
删除模块,用于当所述至少一条目标矢量线条中各线条均确定完需要被删除部分后,删除所确定的所有需要被删除线条。And a deleting module, configured to delete all the determined lines that need to be deleted after each line in the at least one target vector line determines the part that needs to be deleted.
通过以上方案可知,本申请提供的一种信息处理方法及装置,确定目标封闭区域、矢量线条删除范围以及至少一条目标矢量线条,对于每一条目标矢量线条,根据目标矢量线条的两个端点与目标封闭区域的关系,确定目标矢量线条与目标封闭区域是否存在交点,若不存在交点,根据矢量线条删除范围直接确定该目标矢量线条是否为需要删除的线条,若存在交点,则从该目标矢量线条上的若干等分点中确定一个点为该目标矢量线条与目标封闭区域的交点,从而基于该交点,该目标矢量线条的两个端点与目标封闭区域的关系、以及矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条,计算简单,运算量少,从而实现以较低的计算机配置确定需要删除的矢量线条。According to the above solution, an information processing method and apparatus provided by the present application determine a target closed area, a vector line deletion range, and at least one target vector line. For each target vector line, according to the two end points and targets of the target vector line The relationship between the closed area and the target closed area is determined. If there is no intersection, if the intersection of the vector line is deleted, it is directly determined whether the target vector line is a line to be deleted, and if there is an intersection, the line from the target vector Determining a point among the plurality of aliquots is an intersection of the target vector line and the target closed area, so that based on the intersection, the relationship between the two end points of the target vector line and the target closed area, and the vector line deletion range determine the target The part of the line on the vector line that needs to be deleted is simple to calculate and has a small amount of computation, so that the vector line that needs to be deleted is determined with a lower computer configuration.
附图说明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 embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图1为本申请实施例提供的信息处理方法的一种实现流程图;FIG. 1 is a flowchart of an implementation of an information processing method according to an embodiment of the present application;
图2为本申请实施例提供的信息处理装置的一种结构示意图;FIG. 2 is a schematic structural diagram of an information processing apparatus according to an embodiment of the present disclosure;
图3为本申请实施例提供的第二确定模块的一种结构示意图;FIG. 3 is a schematic structural diagram of a second determining module according to an embodiment of the present disclosure;
图4为本申请实施例提供的第四确定模块的一种结构示意图;4 is a schematic structural diagram of a fourth determining module according to an embodiment of the present application;
图5为本申请实施例提供的信息处理装置的另一种结构示意图。 FIG. 5 is another schematic structural diagram of an information processing apparatus according to an embodiment of the present disclosure.
说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等(如果存在)是用于区别类似的部分,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示的以外的顺序实施。The terms "first", "second", "third", "fourth", etc. (if present) in the specification and claims and the above figures are used to distinguish similar parts and are not necessarily used to describe particular Order or order. It is to be understood that the data so used may be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than that illustrated herein.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有付出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without departing from the inventive scope are the scope of the present invention.
请参阅图1,图1为本申请实施例提供的信息处理方法的一种实现流程图,可以包括:Referring to FIG. 1 , FIG. 1 is a flowchart of an implementation of an information processing method according to an embodiment of the present disclosure, which may include:
步骤S11:确定目标封闭区域、矢量线条删除范围和至少一条目标矢量线条;所述矢量线条删除范围为所述目标封闭区域内或所述目标封闭区域外;Step S11: determining a target closed area, a vector line deletion range, and at least one target vector line; the vector line deletion range is outside the target closed area or outside the target closed area;
用户在对矢量图进行修改过程中,可能需要删除某个封闭区域内的某些线条,也可能需要删除该封闭区域外的某些线条。本发明实施例中,可以由用户选择目标封闭区域、矢量线条删除范围,以及至少一条目标矢量线条。其中,可以在用户选定目标封闭区域以及至少一条目标矢量线条后,通过用户的预设操作触发显示矢量线条删除范围选项列表,由用户从列表中选择矢量线条删除范围。During the modification of the vector image, the user may need to delete some lines in a closed area, or may need to delete some lines outside the closed area. In the embodiment of the present invention, the target closed area, the vector line deletion range, and the at least one target vector line may be selected by the user. Wherein, after the user selects the target closed area and at least one target vector line, the display vector line deletion range option list is triggered by the user's preset operation, and the user selects the vector line deletion range from the list.
其中所选择的至少一条目标矢量线条中,可能全部矢量线条均与目标封闭区域没有交点,例如,可能全部矢量线条均位于目标封闭区域内,也可能全部矢量线条均位于目标封闭区域外,或者,一部分矢量线条位于目标封闭区域内,另一部分矢量线条位于目标封闭区域外。当然,所选择的至少一条目标矢量线条中,也可能全部矢量线条均与目标封闭区域有交点;或者,所选择的至少一条目标矢量线条中,部分矢量线条与目标封闭区域存在交点,部分矢量线条与目标封闭区域不存在交点。In the selected at least one target vector line, all the vector lines may have no intersection with the target closed area. For example, all the vector lines may be located in the target closed area, or all the vector lines may be located outside the target closed area, or One part of the vector line is located in the closed area of the target, and the other part of the vector line is outside the closed area of the target. Of course, in at least one target vector line selected, all vector lines may also intersect with the target closed area; or, in the selected at least one target vector line, some vector lines and the target closed area have intersections, and some vector lines There is no intersection with the target closed area.
步骤S12:对于每一条目标矢量线条,判断该目标矢量线条的两个端点与所述目标封闭区域的关系; Step S12: determining, for each piece of the target vector line, a relationship between two end points of the target vector line and the target closed area;
本发明实施例中,在确定目标矢量线条后,对所确定的至少一条目标矢量线条,逐线条确定该目标矢量线条需要被删除的部分。In the embodiment of the present invention, after determining the target vector line, for the determined at least one target vector line, the part of the target vector line that needs to be deleted is determined line by line.
步骤S13:若该目标矢量线条的两个端点均在目标封闭区域内,或均在目标封闭区域外,通过矢量线条删除范围确定该目标矢量线条是否为需要删除的线条;Step S13: If both end points of the target vector line are in the target closed area, or both are outside the target closed area, determine whether the target vector line is a line to be deleted by the vector line deletion range;
对于每一条目标矢量线条,若该目标矢量线条的两个端点均在所述目标封闭区域内,或均在所述目标封闭区域外,说明该目标矢量线条与目标封闭区域没有交点。For each target vector line, if both end points of the target vector line are within the target closed area, or both are outside the target closed area, it indicates that the target vector line has no intersection with the target closed area.
此时,可以直接通过矢量线条删除范围确定该目标矢量线条是否是需要删除的线条。也就是说,通过目标矢量线条的两个端点就可以确定目标矢量线条是否是需要被删除的线条。而判断点是否在封闭区域内是通常是矢量绘图软件自带的基本功能,因此,实现简单。At this point, you can directly determine whether the target vector line is the line you want to delete by the vector line deletion range. That is to say, it is possible to determine whether the target vector line is a line to be deleted by the two end points of the target vector line. Judging whether the point is in the closed area is usually the basic function of the vector drawing software, so the implementation is simple.
步骤S14:若该目标矢量线条的两个端点只有一个端点位于目标区域内,将该目标线条平均划分为若干段,若相邻的两个等分点中的第一等分点位于所述目标封闭区域内,该相邻的两个等分点中的第二等分点位于所述目标封闭区域外,确定该相邻两个等分点中的一个点为该目标矢量线条与所述目标封闭区域的交点;Step S14: If only one end point of the two end points of the target vector line is located in the target area, divide the target line into a plurality of segments equally, if the first equal point of the adjacent two equal points is located in the target In the closed area, a second of the two adjacent points is located outside the target closed area, and one of the adjacent two equal points is determined to be the target vector line and the target The intersection of closed areas;
对于每一条目标矢量线条,若该目标矢量线条的两个端点只有一个端点位于目标区域内,说明目标矢量线条与目标封闭曲线存在交点。那么,根据矢量线条删除范围,只能删除该目标矢量线条的一部分,此时需要获取该目标矢量线条与目标封闭区域的交点。For each target vector line, if only one end point of the two end points of the target vector line is located in the target area, it indicates that the target vector line has an intersection with the target closed curve. Then, according to the vector line deletion range, only a part of the target vector line can be deleted, and the intersection of the target vector line and the target closed area needs to be obtained.
本发明实施例中,为了快速获取目标矢量线条与目标封闭区域的交点,将该目标矢量线条平均划分为若干等分(如20等分,当然,本发明实施例中并不限于将目标矢量线条平均划分为20等分,划分越多,精度越高),从该目标矢量线条上的若干等分点中确定一个点为该矢量线条与目标封闭区域的交点。In the embodiment of the present invention, in order to quickly obtain the intersection of the target vector line and the target closed area, the target vector line is equally divided into several equal parts (for example, 20 equal parts, of course, the embodiment of the present invention is not limited to the target vector line. The average is divided into 20 equal parts, the more the division, the higher the precision. A point is determined from several equal points on the target vector line as the intersection of the vector line and the target closed area.
可选的,可以从目标矢量线条的其中一个端点开始,对目标矢量线条上的各个等分点依次进行遍历,若目标矢量线条上相邻的两个等分点中,一个等分点在目标封闭区域内(包括该等分点在该目标封闭区域的边缘上),另 一个等分点在目标封闭区域外,则可以将该相邻的两个等分点中的其中一个点确定为该目标矢量线条与该目标封闭区域的交点。Optionally, starting from one of the endpoints of the target vector line, traversing each of the equal points on the target vector line, if one of the two adjacent points on the target vector line, one of the equal points is at the target Within the enclosed area (including the points on the edge of the closed area of the target), An aliquot is outside the target closed area, and one of the two adjacent halving points may be determined as the intersection of the target vector line and the target closed area.
例如,假设该目标矢量线条的两个端点中的第一端点位于目标封闭区域内,第二端点位于目标封闭区域外。可以从目标矢量线条的第一端点开始,对目标矢量线条上的各个等分点依次进行遍历,若目标矢量线条上的第i个等分点在目标封闭区域内,而第i+1个等分点在目标封闭区域外,则可以确定第i个等分点,或者,第i+1个等分点为目标矢量线条与目标封闭区域的交点。也可以从目标矢量线条的第二端点开始,对目标矢量线条上的各个等分点依次进行遍历,若目标矢量线条上的第i个等分点在目标封闭区域外,而第i+1个等分点在目标封闭区域内,则可以确定第i个等分点,或者,第i+1个等分点为目标矢量线条与目标封闭区域的交点。For example, assume that the first of the two endpoints of the target vector line is within the target enclosed area and the second endpoint is outside the target closed area. Starting from the first end point of the target vector line, traversing each of the bisector points on the target vector line sequentially, if the i-th bisector on the target vector line is in the target closed area, and the i+1th The aliquot is outside the target closed area, then the i-th aliquot can be determined, or the i+1 quintile is the intersection of the target vector line and the target closed area. It is also possible to traverse the unequal points on the target vector line from the second end point of the target vector line, if the i-th bisector on the target vector line is outside the target closed area, and the i+1th The aliquot is in the target closed area, then the i-th aliquot can be determined, or the i+1 quintile is the intersection of the target vector line and the target closed area.
优选的,可以将上述相邻的两个等分点中的位于目标封闭区域内的点确定为该目标矢量线条与所述目标封闭区域的交点。Preferably, a point in the target two closed points that is located in the target closed area may be determined as an intersection of the target vector line and the target closed area.
由于等分点在该目标封闭区域的边缘上时也会将该等分点确定为在目标封闭区域内,因此,将上述相邻的两个等分点中的位于目标封闭区域内的点确定为该目标矢量线条与所述目标封闭区域的交点,使得操作结果更加精确。Since the halving point is also determined to be within the target closed area when the halving point is on the edge of the target closed area, the point in the target closed area among the two adjacent halved points is determined The intersection of the target vector line and the target closed area makes the operation result more accurate.
步骤S15:基于该目标矢量线条的两个端点与目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条。Step S15: determining a relationship between two end points of the target vector line and the target closed area, an intersection of the target vector line and the target closed area, and a vector line deletion range to determine a part of the line on the target vector line to be deleted.
对于每一条目标矢量线条,在确定该目标矢量线条与目标封闭区域的交点后,就可以依据该交点,该目标矢量线条的两个端点与所述目标封闭区域的关系,以及矢量线条删除范围确定该目标矢量线条上需要被删除的部分。For each target vector line, after determining the intersection of the target vector line and the target closed area, according to the intersection, the relationship between the two end points of the target vector line and the target closed area, and the vector line deletion range determination The part of the target vector line that needs to be deleted.
对于与目标封闭区域存在交点的目标矢量线条,通过计算有限个等分点与目标封闭区域的位置关系确定目标矢量线条与目标封闭区域的交点,实现简单,计算量少。For the target vector line with the intersection of the target closed area, the intersection of the target vector line and the target closed area is determined by calculating the positional relationship between the finite equal point and the target closed area, which is simple and computationally inefficient.
本发明实施例提供的信息处理方法,确定目标封闭区域、矢量线条删除范围以及至少一条目标矢量线条,对于每一条目标矢量线条,根据目标矢量线条的两个端点与目标封闭区域的关系,确定目标矢量线条与目标封闭区域是否存在交点,若不存在交点,根据矢量线条删除范围直接确定该目标矢量线条是否为需要删除的线条,若存在交点,则从该目标矢量线条上的若干等 分点中确定一个点为该目标矢量线条与目标封闭区域的交点,从而基于该交点,该目标矢量线条的两个端点与目标封闭区域的关系、以及矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条,由于点与封闭区域的位置关系是矢量绘图软件的基本功能,因此,本发明实施例提供的信息处理方法,计算简单,运算量少,从而实现以较低的计算机配置确定需要删除的矢量线条。The information processing method provided by the embodiment of the present invention determines a target closed area, a vector line deletion range, and at least one target vector line. For each target vector line, the target is determined according to the relationship between the two end points of the target vector line and the target closed area. Whether there is an intersection point between the vector line and the target closed area. If there is no intersection point, it is directly determined according to the vector line deletion range whether the target vector line is a line to be deleted, and if there is an intersection point, a number from the target vector line Determining a point in the point is the intersection of the target vector line and the target closed area, so that based on the intersection, the relationship between the two end points of the target vector line and the target closed area, and the vector line deletion range determine that the target vector line needs The deleted part of the line, because the positional relationship between the point and the closed area is the basic function of the vector drawing software, therefore, the information processing method provided by the embodiment of the invention is simple in calculation and less in computation, thereby realizing the determination by the lower computer configuration. Vector lines that need to be removed.
可选的,若该目标矢量线条的两个端点均在目标封闭区域内,或均目标封闭区域外,通过矢量线条删除范围确定该目标矢量线条是否为需要删除的线条,具体实现方式可以包括:Optionally, if the two end points of the target vector line are in the target closed area, or the target closed area, the vector line deletion range is used to determine whether the target vector line is a line to be deleted. The specific implementation manner may include:
若该目标矢量线条的两个端点均在目标封闭区域内,且矢量线条删除范围为目标封闭区域内,确定该目标矢量线条为需要删除的线条;If both end points of the target vector line are within the target closed area, and the vector line deletion range is within the target closed area, determine that the target vector line is a line that needs to be deleted;
或者,or,
若该目标矢量线条的两个端点均在目标封闭区域外,且矢量线条删除范围为目标封闭区域外,确定该目标矢量线条为需要删除的线条。If both end points of the target vector line are outside the target closed area, and the vector line deletion range is outside the target closed area, it is determined that the target vector line is a line that needs to be deleted.
若该目标矢量线条的两个端点均在目标封闭区域内,而矢量线条删除范围为目标封闭区域外,则可以确定该目标矢量线条是不能删除的线条,即需要保留的线条。If both end points of the target vector line are in the target closed area, and the vector line deletion range is outside the target closed area, it can be determined that the target vector line is a line that cannot be deleted, that is, a line that needs to be retained.
或者,or,
若该目标矢量线条的两个端点均在目标封闭区域外,而矢量线条删除范围为目标封闭区域内,则可以确定该目标矢量线条是不能删除的线条,即需要保留的线条。If both end points of the target vector line are outside the target closed area, and the vector line deletion range is within the target closed area, it can be determined that the target vector line is a line that cannot be deleted, that is, a line that needs to be retained.
可选的,基于该目标矢量线条的两个端点与目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条的一种实现方式可以为:Optionally, the relationship between the two endpoints of the target vector line and the target closed region, the intersection of the target vector line and the target closed region, and the vector line deletion range determine one of the partial lines of the target vector line that need to be deleted. The implementation can be:
若该目标矢量线条的两个端点中的第一端点位于目标封闭区域内,第二端点位于目标封闭区域外,矢量线条的删除范围为目标封闭区域内,则该目 标矢量线条上需要被删除的部分线条为:该目标矢量线条上第一端点与交点之间的线条;If the first end point of the two end points of the target vector line is located in the target closed area, the second end point is outside the target closed area, and the deletion range of the vector line is within the target closed area, then the target The part of the line on the underlying vector that needs to be deleted is: the line between the first endpoint and the intersection on the line of the target vector;
如果矢量线条的删除范围为目标封闭区域内,则目标矢量线条上第一端点与交点之间的线条即为需要被删除的线条。If the deletion range of the vector line is within the target closed area, the line between the first endpoint and the intersection on the target vector line is the line that needs to be deleted.
若该目标矢量线条的两个端点中的第一端点位于目标封闭区域内,第二端点位于目标封闭区域外,矢量线条的删除范围为目标封闭区域外,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上第二端点与交点之间的线条。If the first end point of the two end points of the target vector line is located in the target closed area, the second end point is outside the target closed area, and the deletion range of the vector line is outside the target closed area, the target vector line needs to be deleted. The part of the line is: the line between the second endpoint and the intersection on the target vector line.
如果矢量线条的删除范围为目标封闭区域外,则目标矢量线条上第二端点与交点之间的线条即为需要被删除的线条。If the deletion range of the vector line is outside the target closed area, the line between the second end point and the intersection point on the target vector line is the line that needs to be deleted.
可选的,本发明实施例中,可以通过二分法将目标矢量线条平均划分为若干段。通过二分法可以将目标矢量线条平均划分为偶数段。当然,本发明实施例中,并不限于将目标矢量线条平均划分为偶数段,还可以将目标矢量线条平均划分为奇数段,因此,本发明实施例中,对目标矢量线条平均划分为若干段并不局限于二分法,还可以有其它划分方法,这里不做具体限定。Optionally, in the embodiment of the present invention, the target vector line may be equally divided into several segments by a binary method. The target vector line can be equally divided into even segments by the dichotomy. Of course, in the embodiment of the present invention, the target vector line is not evenly divided into even-numbered segments, and the target vector line is evenly divided into odd-numbered segments. Therefore, in the embodiment of the present invention, the target vector lines are equally divided into several segments. It is not limited to the dichotomy, and there may be other methods of division, which are not specifically limited herein.
可选的,本发明实施例提供的信息处理方法进一步可以包括:Optionally, the information processing method provided by the embodiment of the present invention may further include:
当上述至少一条目标矢量线条中各线条均确定完需要被删除部分后,删除所确定的所有需要被删除线条。After each of the at least one target vector line determines the portion to be deleted, all the determined lines that need to be deleted are deleted.
进一步的,对于上述至少一条目标矢量线条中的任意一条目标矢量线条(为叙述方便,记为第一目标矢量线条),若将第一目标矢量线条上所确定的需要被删除部分删除后,可以将第一目标矢量线条的剩余部分作为目标矢量线条,并判断该目标矢量线条的两个端点与目标封闭区域的关系,若两个端点中只有一个端点在目标区域内,说明若还有部分线条在矢量线条删除范围内,则可以将第一目标矢量线条的剩余部分作为目标矢量线条,再次平均划分为若干段,若相邻的两个等分点中的第一等分点位于目标封闭区域内,该相邻的两个等分点中的第二等分点位于目标封闭区域外,确定该相邻两个等分点中的一个点为该目标矢量线条与目标封闭区域的交点; Further, for any one of the at least one target vector line (for the convenience of description, the first target vector line), if the part of the first target vector line that needs to be deleted is deleted, The remaining part of the first target vector line is taken as the target vector line, and the relationship between the two end points of the target vector line and the target closed area is determined. If only one of the two end points is in the target area, it means that if there are still some lines In the vector line deletion range, the remaining part of the first target vector line can be used as the target vector line, and divided equally into several segments again, if the first equal point of the adjacent two equal points is located in the target closed area. The second bisector of the two adjacent bisectors is located outside the target closed area, and one of the adjacent two bisectors is determined to be the intersection of the target vector line and the target closed area;
基于该目标矢量线条的两个端点与目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条。The relationship between the two endpoints of the target vector line and the target closed region, the intersection of the target vector line and the target closed region, and the vector line deletion range determine the partial lines on the target vector line that need to be deleted.
也就是说,本发明实施例中,通过多次对目标矢量线条划分的方式更精确地确定目标矢量线条与目标封闭区域的交点。提高了信息处理的精度。That is to say, in the embodiment of the present invention, the intersection of the target vector line and the target closed area is more accurately determined by dividing the target vector line multiple times. Improve the accuracy of information processing.
与方法实施例相对应,本发明实施例还提供一种信息处理装置,本发明实施例提供的信息处理装置的一种结构示意图如图2所示,可以包括:Corresponding to the method embodiment, the embodiment of the present invention further provides an information processing device. A schematic structural diagram of the information processing device provided by the embodiment of the present invention is as shown in FIG. 2, and may include:
第一确定模块21,判断模块22,第二确定模块23,第三确定模块24和第四确定模块25;其中,a first determining module 21, a determining module 22, a second determining module 23, a third determining module 24, and a fourth determining module 25; wherein
第一确定模块21用于确定目标封闭区域、矢量线条删除范围和至少一条目标矢量线条;其中矢量线条删除范围为目标封闭区域内或目标封闭区域外;The first determining module 21 is configured to determine a target closed area, a vector line deletion range, and at least one target vector line; wherein the vector line deletion range is within the target closed area or outside the target closed area;
用户在对矢量图进行修改过程中,可能需要删除某个封闭区域内的某些线条,也可能需要删除该封闭区域外的某些线条。本发明实施例中,第一确定模块21可以根据用户选择目标封闭区域、矢量线条删除范围,以及至少一条目标矢量线条。其中,第一确定模块21可以在用户选定目标封闭区域以及至少一条目标矢量线条后,通过用户的预设操作触发显示矢量线条删除范围选项列表,由用户从列表中选择矢量线条删除范围。During the modification of the vector image, the user may need to delete some lines in a closed area, or may need to delete some lines outside the closed area. In the embodiment of the present invention, the first determining module 21 may select a target closed area, a vector line deletion range, and at least one target vector line according to a user. The first determining module 21 may trigger the display vector line deletion range option list by the user's preset operation after the user selects the target closed area and the at least one target vector line, and the user selects the vector line deletion range from the list.
其中所选择的至少一条目标矢量线条中,可能全部矢量线条均与目标封闭区域没有交点,例如,可能全部矢量线条均位于目标封闭区域内,也可能全部矢量线条均位于目标封闭区域外,或者,一部分矢量线条位于目标封闭区域内,另一部分矢量线条位于目标封闭区域外。当然,所选择的至少一条目标矢量线条中,也可能全部矢量线条均与目标封闭区域有交点;或者,所选择的至少一条目标矢量线条中,部分矢量线条与目标封闭区域存在交点,部分矢量线条与目标封闭区域不存在交点。In the selected at least one target vector line, all the vector lines may have no intersection with the target closed area. For example, all the vector lines may be located in the target closed area, or all the vector lines may be located outside the target closed area, or One part of the vector line is located in the closed area of the target, and the other part of the vector line is outside the closed area of the target. Of course, in at least one target vector line selected, all vector lines may also intersect with the target closed area; or, in the selected at least one target vector line, some vector lines and the target closed area have intersections, and some vector lines There is no intersection with the target closed area.
判断模块22用于对于每一条目标矢量线条,判断该目标矢量线条的两个端点与目标封闭区域的关系;The determining module 22 is configured to determine, for each piece of the target vector line, a relationship between two end points of the target vector line and the target closed area;
本发明实施例中,在确定目标矢量线条后,对所确定的至少一条目标矢量线条,逐线条确定该目标矢量线条需要被删除的部分。 In the embodiment of the present invention, after determining the target vector line, for the determined at least one target vector line, the part of the target vector line that needs to be deleted is determined line by line.
第二确定模块23用于若该目标矢量线条的两个端点均在目标封闭区域内,或均在目标封闭区域外,通过矢量线条删除范围确定该目标矢量线条是否为需要删除的线条;The second determining module 23 is configured to determine, if the two end points of the target vector line are in the target closed area, or outside the target closed area, determine whether the target vector line is a line to be deleted by using a vector line deletion range;
对于每一条目标矢量线条,若该目标矢量线条的两个端点均在所述目标封闭区域内,或均在所述目标封闭区域外,说明该目标矢量线条与目标封闭区域没有交点。For each target vector line, if both end points of the target vector line are within the target closed area, or both are outside the target closed area, it indicates that the target vector line has no intersection with the target closed area.
此时,可以直接通过矢量线条删除范围确定该目标矢量线条是否是需要删除的线条。也就是说,通过目标矢量线条的两个端点就可以确定目标矢量线条是否是需要被删除的线条。而判断点是否在封闭区域内是通常是矢量绘图软件自带的基本功能,因此,实现简单。At this point, you can directly determine whether the target vector line is the line you want to delete by the vector line deletion range. That is to say, it is possible to determine whether the target vector line is a line to be deleted by the two end points of the target vector line. Judging whether the point is in the closed area is usually the basic function of the vector drawing software, so the implementation is simple.
第三确定模块24用于若该目标矢量线条的两个端点只有一个端点位于目标区域内,将该目标线条平均划分为若干段,若相邻的两个等分点中的第一等分点位于目标封闭区域内,相邻的两个等分点中的第二等分点位于目标封闭区域外,确定该相邻两个等分点中的一个点为该目标矢量线条与目标封闭区域的交点;The third determining module 24 is configured to divide the target line into a plurality of segments even if only one end point of the two end points of the target vector line is located in the target area, if the first equal dividing point of the two adjacent equal dividing points Located in the closed area of the target, the second bisector of the two adjacent bisectors is located outside the target closed area, and one of the adjacent two bisectors is determined to be the target vector line and the target closed area. Intersection point
对于每一条目标矢量线条,若该目标矢量线条的两个端点只有一个端点位于目标区域内,说明目标矢量线条与目标封闭曲线存在交点。那么,根据矢量线条删除范围,只能删除该目标矢量线条的一部分,此时需要获取该目标矢量线条与目标封闭区域的交点。For each target vector line, if only one end point of the two end points of the target vector line is located in the target area, it indicates that the target vector line has an intersection with the target closed curve. Then, according to the vector line deletion range, only a part of the target vector line can be deleted, and the intersection of the target vector line and the target closed area needs to be obtained.
本发明实施例中,为了快速获取目标矢量线条与目标封闭区域的交点,将该目标矢量线条平均划分为若干等分(如20等分,当然,本发明实施例中并不限于将目标矢量线条平均划分为20等分,划分越多,精度越高),从该目标矢量线条上的若干等分点中确定一个点为该矢量线条与目标封闭区域的交点。In the embodiment of the present invention, in order to quickly obtain the intersection of the target vector line and the target closed area, the target vector line is equally divided into several equal parts (for example, 20 equal parts, of course, the embodiment of the present invention is not limited to the target vector line. The average is divided into 20 equal parts, the more the division, the higher the precision. A point is determined from several equal points on the target vector line as the intersection of the vector line and the target closed area.
可选的,可以从目标矢量线条的其中一个端点开始,对目标矢量线条上的各个等分点依次进行遍历,若目标矢量线条上相邻的两个等分点中,一个等分点在目标封闭区域内(包括该等分点在该目标封闭区域的边缘上),另一个等分点在目标封闭区域外,则可以将该相邻的两个等分点中的其中一个点确定为该目标矢量线条与该目标封闭区域的交点。 Optionally, starting from one of the endpoints of the target vector line, traversing each of the equal points on the target vector line, if one of the two adjacent points on the target vector line, one of the equal points is at the target Within the enclosed area (including the points on the edge of the target closed area), and another halving point outside the target closed area, one of the adjacent two equal points may be determined as the The intersection of the target vector line and the closed area of the target.
例如,假设该目标矢量线条的两个端点中的第一端点位于目标封闭区域内,第二端点位于目标封闭区域外。可以从目标矢量线条的第一端点开始,对目标矢量线条上的各个等分点依次进行遍历,若目标矢量线条上的第i个等分点在目标封闭区域内,而第i+1个等分点在目标封闭区域外,则可以确定第i个等分点,或者,第i+1个等分点为目标矢量线条与目标封闭区域的交点。也可以从目标矢量线条的第二端点开始,对目标矢量线条上的各个等分点依次进行遍历,若目标矢量线条上的第i个等分点在目标封闭区域外,而第i+1个等分点在目标封闭区域内,则可以确定第i个等分点,或者,第i+1个等分点为目标矢量线条与目标封闭区域的交点。For example, assume that the first of the two endpoints of the target vector line is within the target enclosed area and the second endpoint is outside the target closed area. Starting from the first end point of the target vector line, traversing each of the bisector points on the target vector line sequentially, if the i-th bisector on the target vector line is in the target closed area, and the i+1th The aliquot is outside the target closed area, then the i-th aliquot can be determined, or the i+1 quintile is the intersection of the target vector line and the target closed area. It is also possible to traverse the unequal points on the target vector line from the second end point of the target vector line, if the i-th bisector on the target vector line is outside the target closed area, and the i+1th The aliquot is in the target closed area, then the i-th aliquot can be determined, or the i+1 quintile is the intersection of the target vector line and the target closed area.
第四确定模块25用于基于该目标矢量线条的两个端点与所述目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条。The fourth determining module 25 is configured to determine, according to the relationship between the two end points of the target vector line and the target closed area, the intersection of the target vector line and the target closed area, and the vector line deletion range, the target vector line needs to be deleted. Part of the line.
对于每一条目标矢量线条,在确定该目标矢量线条与目标封闭区域的交点后,就可以依据该交点,该目标矢量线条的两个端点与所述目标封闭区域的关系,以及矢量线条删除范围确定该目标矢量线条上需要被删除的部分。For each target vector line, after determining the intersection of the target vector line and the target closed area, according to the intersection, the relationship between the two end points of the target vector line and the target closed area, and the vector line deletion range determination The part of the target vector line that needs to be deleted.
对于与目标封闭区域存在交点的目标矢量线条,通过计算有限个等分点与目标封闭区域的位置关系确定目标矢量线条与目标封闭区域的交点,实现简单,计算量少。For the target vector line with the intersection of the target closed area, the intersection of the target vector line and the target closed area is determined by calculating the positional relationship between the finite equal point and the target closed area, which is simple and computationally inefficient.
本发明实施例提供的信息处理装置,确定目标封闭区域、矢量线条删除范围以及至少一条目标矢量线条,对于每一条目标矢量线条,根据目标矢量线条的两个端点与目标封闭区域的关系,确定目标矢量线条与目标封闭区域是否存在交点,若不存在交点,根据矢量线条删除范围直接确定该目标矢量线条是否为需要删除的线条,若存在交点,则从该目标矢量线条上的若干等分点中确定一个点为该目标矢量线条与目标封闭区域的交点,从而基于该交点,该目标矢量线条的两个端点与目标封闭区域的关系、以及矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条,由于点与封闭区域的位置关系是矢量绘图软件的基本功能,因此,本发明实施例提供的信息处理方法,计算简单,运算量少,从而实现以较低的计算机配置确定需要删除的矢量线条。 The information processing apparatus provided by the embodiment of the present invention determines a target closed area, a vector line deletion range, and at least one target vector line. For each target vector line, the target is determined according to the relationship between the two end points of the target vector line and the target closed area. Whether there is an intersection point between the vector line and the target closed area. If there is no intersection point, it is directly determined according to the vector line deletion range whether the target vector line is a line to be deleted, and if there is an intersection point, from several equal points on the target vector line Determining a point as an intersection of the target vector line and the target closed area, so that based on the intersection, the relationship between the two end points of the target vector line and the target closed area, and the vector line deletion range determine that the target vector line needs to be deleted The partial line, because the positional relationship between the point and the closed area is the basic function of the vector drawing software, therefore, the information processing method provided by the embodiment of the present invention is simple in calculation and small in amount of calculation, thereby realizing that the deletion needs to be performed with a lower computer configuration. Vector lines.
可选的,第二确定模块23的一种结构示意图如图3所示,可以包括:Optionally, a schematic structural diagram of the second determining module 23 is as shown in FIG. 3, and may include:
第一确定单元31和第二确定单元32;其中,a first determining unit 31 and a second determining unit 32; wherein
第一确定单元31用于若该目标矢量线条的两个端点均在目标封闭区域内,且矢量线条删除范围为目标封闭区域内,确定该目标矢量线条为需要删除的线条;The first determining unit 31 is configured to determine that the target vector line is a line that needs to be deleted if both end points of the target vector line are within the target closed area and the vector line deletion range is within the target closed area;
第一确定单元31还可以用于,若该目标矢量线条的两个端点均在目标封闭区域内,而矢量线条删除范围为目标封闭区域外,则可以确定该目标矢量线条是不能删除的线条,即需要保留的线条。The first determining unit 31 is further configured to: if both end points of the target vector line are in the target closed area, and the vector line deletion range is outside the target closed area, it may be determined that the target vector line is a line that cannot be deleted, That is, the lines that need to be preserved.
第二确定单元32用于若该目标矢量线条的两个端点均在目标封闭区域外,且矢量线条删除范围为目标封闭区域外,确定该目标矢量线条为需要删除的线条。The second determining unit 32 is configured to determine that the target vector line is a line that needs to be deleted if both end points of the target vector line are outside the target closed area and the vector line deletion range is the target closed area.
第二确定单元32还可以用于,若该目标矢量线条的两个端点均在目标封闭区域外,而矢量线条删除范围为目标封闭区域内,则可以确定该目标矢量线条是不能删除的线条,即需要保留的线条。The second determining unit 32 is further configured to: if both end points of the target vector line are outside the target closed area, and the vector line deletion range is within the target closed area, it may be determined that the target vector line is a line that cannot be deleted. That is, the lines that need to be preserved.
可选的,第四确定模块25的一种结构示意图如图4所示,可以包括:Optionally, a schematic structural diagram of the fourth determining module 25 is as shown in FIG. 4, and may include:
第三确定单元41和第四确定单元42;其中,a third determining unit 41 and a fourth determining unit 42; wherein
第三确定单元41用于若该目标矢量线条的两个端点中的第一端点位于目标封闭区域内,第二端点位于目标封闭区域外,矢量线条的删除范围为目标封闭区域内,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上第一端点与所述交点之间的线条;The third determining unit 41 is configured to: if the first end point of the two end points of the target vector line is located in the target closed area, the second end point is outside the target closed area, and the deletion range of the vector line is within the target closed area, then the The part of the line on the target vector that needs to be deleted is: the line between the first end point and the intersection point on the line of the target vector;
如果矢量线条的删除范围为目标封闭区域内,则目标矢量线条上第一端点与交点之间的线条即为需要被删除的线条。If the deletion range of the vector line is within the target closed area, the line between the first endpoint and the intersection on the target vector line is the line that needs to be deleted.
第四确定单元42用于若该目标矢量线条的两个端点中的第一端点位于目标封闭区域内,第二端点位于目标封闭区域外,矢量线条的删除范围为目标封闭区域外,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上第二端点与所述交点之间的线条。The fourth determining unit 42 is configured to: if the first end point of the two end points of the target vector line is located in the target closed area, the second end point is outside the target closed area, and the deletion range of the vector line is outside the target closed area, then the The part of the line on the target vector that needs to be deleted is: the line between the second end point on the line of the target vector and the intersection.
如果矢量线条的删除范围为目标封闭区域外,则目标矢量线条上第二端点与交点之间的线条即为需要被删除的线条。 If the deletion range of the vector line is outside the target closed area, the line between the second end point and the intersection point on the target vector line is the line that needs to be deleted.
可选的,本发明实施例中,第三确定模块24可以通过二分法将目标矢量线条平均划分为若干段。通过二分法可以将目标矢量线条平均划分为偶数段。当然,本发明实施例中,并不限于将目标矢量线条平均划分为偶数段,还可以将目标矢量线条平均划分为奇数段,因此,本发明实施例中,对目标矢量线条平均划分为若干段并不局限于二分法,还可以通过其它划分方法将目标矢量线条平均划分为若干段,这里不做具体限定。Optionally, in the embodiment of the present invention, the third determining module 24 may divide the target vector line into a plurality of segments by a dichotomy. The target vector line can be equally divided into even segments by the dichotomy. Of course, in the embodiment of the present invention, the target vector line is not evenly divided into even-numbered segments, and the target vector line is evenly divided into odd-numbered segments. Therefore, in the embodiment of the present invention, the target vector lines are equally divided into several segments. It is not limited to the dichotomy, and the target vector lines can be equally divided into several segments by other division methods, which are not specifically limited herein.
可选的,在图2所示实施例的基础上,本发明实施例提供的信息处理装置的另一种结构示意图如图5所示,还可以包括:Optionally, on the basis of the embodiment shown in FIG. 2, another schematic structural diagram of the information processing apparatus provided by the embodiment of the present invention is as shown in FIG. 5, and may further include:
删除模块51,用于当上述至少一条目标矢量线条中各线条均确定完需要被删除部分后,删除所确定的所有需要被删除线条。The deleting module 51 is configured to delete all the determined lines that need to be deleted after each line in the at least one target vector line is determined to be deleted.
可选的,对于上述至少一条目标矢量线条中的任意一条目标矢量线条(为叙述方便,记为第一目标矢量线条),若将第一目标矢量线条上所确定的需要被删除部分删除后,可以将第一目标矢量线条的剩余部分作为目标矢量线条,并触发判断模块22判断该目标矢量线条的两个端点与目标封闭区域的关系,若两个端点中只有一个端点在目标区域内,说明还有部分线条在矢量线条删除范围内,则第三确定模块24再次将第一目标矢量线条剩余部分平均划分为若干段,若相邻的两个等分点中的第一等分点位于目标封闭区域内,该相邻的两个等分点中的第二等分点位于目标封闭区域外,确定该相邻两个等分点中的一个点为该目标矢量线条与目标封闭区域的交点;Optionally, for any one of the at least one target vector line (for the convenience of description, the first target vector line), if the part of the first target vector line that needs to be deleted is deleted, The remaining portion of the first target vector line may be used as the target vector line, and the triggering determination module 22 determines the relationship between the two endpoints of the target vector line and the target closed region, if only one of the two endpoints is within the target region, If a part of the line is within the vector line deletion range, the third determining module 24 divides the remaining part of the first target vector line into a plurality of segments, if the first halving point of the adjacent two equal points is at the target In the closed area, the second of the two adjacent points is located outside the target closed area, and one of the adjacent two equal points is determined to be the intersection of the target vector line and the target closed area. ;
基于该目标矢量线条的两个端点与目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条。The relationship between the two endpoints of the target vector line and the target closed region, the intersection of the target vector line and the target closed region, and the vector line deletion range determine the partial lines on the target vector line that need to be deleted.
也就是说,本发明实施例中,通过多次对目标矢量线条划分的方式更精确地确定目标矢量线条与目标封闭区域的交点,提高了信息处理的精度。That is to say, in the embodiment of the present invention, the intersection of the target vector line and the target closed area is more accurately determined by dividing the target vector line multiple times, thereby improving the precision of information processing.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特 定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the technical solution. Apply application and design constraints. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的***(若存在)、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system (if any), device and unit can refer to the corresponding process in the foregoing method embodiment, and no longer Narration.
在本申请所提供的几个实施例中,应该理解到,所揭露的***(若存在)、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided herein, it should be understood that the disclosed system (if present), apparatus, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。 The functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including The instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。 The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments are obvious to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but the scope of the invention is to be accorded

Claims (10)

  1. 一种信息处理方法,其特征在于,包括:An information processing method, comprising:
    确定目标封闭区域、矢量线条删除范围和至少一条目标矢量线条;所述矢量线条删除范围为所述目标封闭区域内或所述目标封闭区域外;Determining a target closed area, a vector line deletion range, and at least one target vector line; the vector line deletion range is outside the target closed area or outside the target closed area;
    对于每一条目标矢量线条,判断该目标矢量线条的两个端点与所述目标封闭区域的关系;For each target vector line, determining a relationship between two end points of the target vector line and the target closed area;
    若该目标矢量线条的两个端点均在所述目标封闭区域内,或均在所述目标封闭区域外,通过所述矢量线条删除范围确定该目标矢量线条是否为需要删除的线条;If the two end points of the target vector line are all within the target closed area, or both outside the target closed area, determine whether the target vector line is a line to be deleted by the vector line deletion range;
    若该目标矢量线条的两个端点只有一个端点位于目标区域内,将该目标线条平均划分为若干段,若相邻的两个等分点中的第一等分点位于所述目标封闭区域内,所述相邻的两个等分点中的第二等分点位于所述目标封闭区域外,确定所述相邻两个等分点中的一个点为该目标矢量线条与所述目标封闭区域的交点;If only one end point of the two end points of the target vector line is located in the target area, the target line is equally divided into a plurality of segments, if the first equal point of the adjacent two equal points is located in the target closed area And a second halving point of the two adjacent bisector points is located outside the target closed area, and determining that one of the adjacent two bisector points is the target vector line and the target is closed Intersection of the area;
    基于该目标矢量线条的两个端点与所述目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及所述矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条。A partial line on the target vector line that needs to be deleted is determined based on a relationship between two end points of the target vector line and the target closed area, an intersection of the target vector line and the target closed area, and the vector line deletion range.
  2. 根据权利要求1所述的方法,其特征在于,所述若该目标矢量线条的两个端点均在所述目标封闭区域内,或均在所述目标封闭区域外,通过所述矢量线条删除范围确定该目标矢量线条是否为需要删除的线条,包括:The method according to claim 1, wherein if both end points of the target vector line are within the target closed area, or both outside the target closed area, the range is deleted by the vector line Determine if the target vector line is a line that needs to be deleted, including:
    若该目标矢量线条的两个端点均在所述目标封闭区域内,且所述矢量线条删除范围为所述目标封闭区域内,确定该目标矢量线条为需要删除的线条;If the two end points of the target vector line are all within the target closed area, and the vector line deletion range is within the target closed area, determine that the target vector line is a line that needs to be deleted;
    或者,or,
    若该目标矢量线条的两个端点均在所述目标封闭区域外,且所述矢量线条删除范围为所述目标封闭区域外,确定该目标矢量线条为需要删除的线条。If both end points of the target vector line are outside the target closed area, and the vector line deletion range is outside the target closed area, it is determined that the target vector line is a line that needs to be deleted.
  3. 根据权利要求1所述的方法,其特征在于,所述基于该目标矢量线条的两个端点与所述目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及所述矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条,包括: The method according to claim 1, wherein said relationship between two end points of the target vector line and the target closed area, an intersection of the target vector line and the target closed area, and the vector line deletion The range determines the portion of the line on the target vector that needs to be removed, including:
    若该目标矢量线条的两个端点中的第一端点位于所述目标封闭区域内,第二端点位于所述目标封闭区域外,所述矢量线条的删除范围为目标封闭区域内,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上所述第一端点与所述交点之间的线条;If the first endpoint of the two endpoints of the target vector line is located in the target closed region, the second endpoint is located outside the target closed region, and the deleted range of the vector line is within the target closed region, then the target The part of the line on the vector line that needs to be deleted is: the line between the first end point and the intersection point on the line of the target vector;
    若该目标矢量线条的两个端点中的第一端点位于所述目标封闭区域内,第二端点位于所述目标封闭区域外,所述矢量线条的删除范围为目标封闭区域外,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上所述第二端点与所述交点之间的线条。If the first endpoint of the two endpoints of the target vector line is located in the target closed region, the second endpoint is located outside the target closed region, and the deleted range of the vector line is outside the target closed region, then the target The part of the line on the vector line that needs to be deleted is: the line between the second end point and the intersection point on the line of the target vector.
  4. 根据权利要求1-3任意一项所述的方法,其特征在于,所述确定所述相邻两个等分点中的一个点为该目标矢量线条与所述目标封闭区域的交点,包括:The method according to any one of claims 1-3, wherein the determining one of the adjacent two bisectors is an intersection of the target vector line and the target closed area, comprising:
    确定所述相邻两个等分点中的位于所述目标封闭区域内的点为该目标矢量线条与所述目标封闭区域的交点。Determining a point in the adjacent closed area of the adjacent two equal points is an intersection of the target vector line and the target closed area.
  5. 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    当所述至少一条目标矢量线条中各线条均确定完需要被删除部分后,删除所确定的所有需要被删除线条。After each line in the at least one target vector line determines the portion that needs to be deleted, all the determined lines that need to be deleted are deleted.
  6. 一种信息处理装置,其特征在于,包括:An information processing apparatus, comprising:
    第一确定模块,用于确定目标封闭区域、矢量线条删除范围和至少一条目标矢量线条;所述矢量线条删除范围为所述目标封闭区域内或所述目标封闭区域外;a first determining module, configured to determine a target closed area, a vector line deletion range, and at least one target vector line; the vector line deletion range is outside the target closed area or outside the target closed area;
    判断模块,用于对于每一条目标矢量线条,判断该目标矢量线条的两个端点与所述目标封闭区域的关系;a judging module, configured to determine, for each piece of the target vector line, a relationship between two end points of the target vector line and the target closed area;
    第二确定模块,用于若该目标矢量线条的两个端点均在所述目标封闭区域内,或均在所述目标封闭区域外,通过所述矢量线条删除范围确定该目标矢量线条是否为需要删除的线条;a second determining module, configured to determine, if the two end points of the target vector line are in the target closed area, or outside the target closed area, determine whether the target vector line is needed by using the vector line deletion range Deleted line;
    第三确定模块,用于若该目标矢量线条的两个端点只有一个端点位于目标区域内,将该目标线条平均划分为若干段,若相邻的两个等分点中的第一等分点位于所述目标封闭区域内,所述相邻的两个等分点中的第二等分点位于所述目标封闭区域外,确定所述相邻两个等分点中的一个点为该目标矢量线条与所述目标封闭区域的交点; a third determining module, configured to: if only one end point of the two end points of the target vector line is located in the target area, divide the target line into a plurality of segments equally, if the first equal point of the adjacent two equal points Located in the target closed area, a second one of the adjacent two equal points is located outside the target closed area, and one of the adjacent two equal points is determined as the target The intersection of the vector line and the closed area of the target;
    第四确定模块,用于基于该目标矢量线条的两个端点与所述目标封闭区域的关系、该目标矢量线条与目标封闭区域的交点,以及所述矢量线条删除范围确定该目标矢量线条上需要被删除的部分线条。a fourth determining module, configured to determine a relationship between two end points of the target vector line and the target closed area, an intersection of the target vector line and the target closed area, and the vector line deletion range determines that the target vector line needs Part of the line that was deleted.
  7. 根据权利要求6所述的装置,其特征在于,第二确定模块包括,The apparatus of claim 6 wherein the second determining module comprises
    第一确定单元,用于若该目标矢量线条的两个端点均在所述目标封闭区域内,且所述矢量线条删除范围为所述目标封闭区域内,确定该目标矢量线条为需要删除的线条;a first determining unit, configured to determine that the target vector line is a line to be deleted if both end points of the target vector line are in the target closed area, and the vector line deletion range is in the target closed area ;
    第二确定单元,用于若该目标矢量线条的两个端点均在所述目标封闭区域外,且所述矢量线条删除范围为所述目标封闭区域外,确定该目标矢量线条为需要删除的线条。a second determining unit, configured to determine that the target vector line is a line to be deleted if both end points of the target vector line are outside the target closed area, and the vector line deletion range is outside the target closed area .
  8. 根据权利要求6所述的装置,其特征在于,所述第四确定模块包括:The apparatus according to claim 6, wherein the fourth determining module comprises:
    第三确定单元,用于若该目标矢量线条的两个端点中的第一端点位于所述目标封闭区域内,第二端点位于所述目标封闭区域外,所述矢量线条的删除范围为目标封闭区域内,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上所述第一端点与所述交点之间的线条;a third determining unit, configured to: if a first end point of the two end points of the target vector line is located in the target closed area, the second end point is located outside the target closed area, and the deletion range of the vector line is a target In the enclosed area, the part of the line of the target vector that needs to be deleted is: a line between the first end point and the intersection point on the line of the target vector;
    第四确定单元,用于若该目标矢量线条的两个端点中的第一端点位于所述目标封闭区域内,第二端点位于所述目标封闭区域外,所述矢量线条的删除范围为目标封闭区域外,则该目标矢量线条上需要被删除的部分线条为:该目标矢量线条上所述第二端点与所述交点之间的线条。a fourth determining unit, configured to: if a first end point of the two end points of the target vector line is located in the target closed area, the second end point is located outside the target closed area, and the deletion range of the vector line is a target Outside the closed area, the part of the line on the target vector line that needs to be deleted is: the line between the second end point and the intersection point on the target vector line.
  9. 根据权利要求6-8任意一项所述的装置,其特征在于,用于确定所述相邻两个等分点中的一个点为该目标矢量线条与所述目标封闭区域的交点的第三确定模块具体用于,确定所述相邻两个等分点中的位于所述目标封闭区域内的点为该目标矢量线条与所述目标封闭区域的交点。The apparatus according to any one of claims 6-8, wherein a third point of the adjacent two equally spaced points is determined as a third point of intersection of the target vector line and the target closed area The determining module is specifically configured to determine that a point in the adjacent closed area of the adjacent two equal points is an intersection of the target vector line and the target closed area.
  10. 根据权利要求6所述的装置,其特征在于,还包括:The device according to claim 6, further comprising:
    删除模块,用于当所述至少一条目标矢量线条中各线条均确定完需要被删除部分后,删除所确定的所有需要被删除线条。 And a deleting module, configured to delete all the determined lines that need to be deleted after each line in the at least one target vector line determines the part that needs to be deleted.
PCT/CN2016/092174 2015-12-18 2016-07-28 Information processing method and device WO2017101454A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510968316.4 2015-12-18
CN201510968316.4A CN105574907B (en) 2015-12-18 2015-12-18 Information processing method and device

Publications (1)

Publication Number Publication Date
WO2017101454A1 true WO2017101454A1 (en) 2017-06-22

Family

ID=55884994

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/092174 WO2017101454A1 (en) 2015-12-18 2016-07-28 Information processing method and device

Country Status (2)

Country Link
CN (1) CN105574907B (en)
WO (1) WO2017101454A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105574907B (en) * 2015-12-18 2019-02-01 广州视睿电子科技有限公司 Information processing method and device
CN110458920B (en) * 2018-05-08 2021-09-21 杭州海康威视数字技术股份有限公司 Handwriting erasing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002063586A (en) * 2000-08-23 2002-02-28 Casio Comput Co Ltd Device for editing object
CN104123737A (en) * 2014-07-15 2014-10-29 沈颖 Testing method for judging inclusivity of points on inner portion, outer portion or boundary of polygonal area
CN104537701A (en) * 2015-01-22 2015-04-22 江苏中威科技软件***有限公司 Operation method of vector lines
CN105574907A (en) * 2015-12-18 2016-05-11 广州视睿电子科技有限公司 Information processing method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2646256A1 (en) * 1989-04-24 1990-10-26 Digital Equipment Int METHOD FOR REALIZING DRAWINGS USING A COMPUTER
JP2005234610A (en) * 2001-05-07 2005-09-02 T Five:Kk Freehand-input pattern editing system
CN101477694B (en) * 2008-12-02 2011-07-27 广东威创视讯科技股份有限公司 Handwriting erasing method and apparatus
CN101609560B (en) * 2009-07-16 2011-09-14 广东威创视讯科技股份有限公司 Method for erasing handwriting
CN102566862B (en) * 2010-12-21 2014-08-27 汉王科技股份有限公司 Method and device for erasing geometric figures in interactive electronic whiteboard
CN103578553B (en) * 2013-10-14 2016-03-30 江苏敏行信息技术有限公司 A kind of vector line style fast erase method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002063586A (en) * 2000-08-23 2002-02-28 Casio Comput Co Ltd Device for editing object
CN104123737A (en) * 2014-07-15 2014-10-29 沈颖 Testing method for judging inclusivity of points on inner portion, outer portion or boundary of polygonal area
CN104537701A (en) * 2015-01-22 2015-04-22 江苏中威科技软件***有限公司 Operation method of vector lines
CN105574907A (en) * 2015-12-18 2016-05-11 广州视睿电子科技有限公司 Information processing method and device

Also Published As

Publication number Publication date
CN105574907A (en) 2016-05-11
CN105574907B (en) 2019-02-01

Similar Documents

Publication Publication Date Title
CN109416728A (en) Object detection method, device and computer system
US9990762B2 (en) Image processing apparatus and method
JP2018514028A5 (en)
US11551439B2 (en) Some automated and semi-automated tools for linear feature extraction in two and three dimensions
US10600190B2 (en) Object detection and tracking method and system for a video
US20150234935A1 (en) Database calculation using parallel-computation in a directed acyclic graph
WO2018072336A1 (en) Line segment erasing method and device
WO2019085709A1 (en) Pooling method and system applied to convolutional neural network
WO2017173929A1 (en) Unsupervised feature selection method and device
US20180152698A1 (en) Method and apparatus for determining interpupillary distance (ipd)
US20170323149A1 (en) Rotation invariant object detection
US11017593B2 (en) Automated registration of three-dimensional vectors to three-dimensional linear features in remotely-sensed data
WO2017166856A1 (en) Method, device and equipment for file encryption
US20190005618A1 (en) Automated seamline construction for high-quality high-resolution orthomosaics
WO2017101454A1 (en) Information processing method and device
US10097808B2 (en) Image matching apparatus and method thereof
US9785724B2 (en) Secondary queue for index process
US20210166053A1 (en) Merging object detections using graphs
CN107924574B (en) Smart flip operations for grouped objects
WO2013097565A1 (en) Method and apparatus for processing three-dimensional model data
US11068739B1 (en) Method and system for comparison of object contours
US20180089581A1 (en) Apparatus and method for dataset model fitting using a classifying engine
US9710963B2 (en) Primitive fitting apparatus and method using point cloud
JP2020525963A (en) Method and apparatus for comparing media characteristics
US20130293543A1 (en) Image processing apparatus and method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16874515

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16874515

Country of ref document: EP

Kind code of ref document: A1