Object position detection method, furniture position detection method and device
By calculating the angle of the vertex difference vector of the convex polygon projection of furniture on the ground, the fast and accurate detection of furniture position is achieved, solving the problem of inefficient furniture position detection in smart home decoration layout, and improving design efficiency and accuracy.
Patent Information
- Application Number
- CN202010357676.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-29
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2040-04-29
AI Technical Summary
The existing technology is difficult to realize automatic detection of furniture positions in smart home decoration layouts, resulting in inefficient layout design.
By obtaining the projection of the convex polygon of the furniture on the ground, determining the vertex coordinates of the projection, calculating the angle of the vertex difference vector, determining the relative position of the furniture and determining whether it overlaps.
It realizes rapid and accurate detection of furniture locations, and improves the design efficiency and accuracy of smart home decoration layout.
Smart Images

Figure CN113570661B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart home, and in particular, to an object position detection method, a furniture position detection method, a computing device, and a readable storage medium. Background Art
[0002] With the development of Internet technology and the continuous improvement of people's living standards, people pay more and more attention to the layout and decoration of houses, and the smart home decoration industry has emerged as the times require.
[0003] In the design of smart home decoration, it is usually necessary to obtain the floor plan of the user's house and the current layout of the house, such as the placement positions of furniture such as sofas, coffee tables, cabinets, and lamps. Then, according to the user's needs, the placement positions of the furniture in the house are adjusted according to a certain algorithm to generate a design drawing, so as to realize the layout of smart home decoration.
[0004] Furniture position detection is the basis for realizing the layout of smart home decoration. Therefore, a method capable of automatically detecting the position of furniture needs to be provided. Summary of the Invention
[0005] For this reason, the present invention provides an object position detection method, a furniture position detection method, and a device, in an attempt to solve or at least alleviate the problems existing above.
[0006] According to a first aspect of the present invention, there is provided an object position detection method suitable for detecting the relative position between a first object and a second object. The method includes: obtaining a first projection of the first object on a preset plane and a second projection of the second object on the preset plane, where both the first projection and the second projection are in the shape of a convex polygon; based on a preset coordinate system, respectively determining the vertex coordinates of the first projection and the second projection; generating a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; and determining the relative position between the first object and the second object according to the angles of the plurality of vertex difference vectors.
[0007] According to a second aspect of the present invention, there is provided a furniture position detection method suitable for detecting the relative position between a first furniture and a second furniture. The method includes: obtaining a first projection of the first furniture on the ground and a second projection of the second furniture on the ground, where both the first projection and the second projection are in the shape of a convex polygon; based on a preset coordinate system, respectively determining the vertex coordinates of the first projection and the second projection; generating a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; and determining the relative position between the first furniture and the second furniture according to the angles of the plurality of vertex difference vectors.
[0008] According to a third aspect of the present invention, there is provided a method for detecting home objects, including: for a plurality of furniture in a home space, respectively determining the relative positions of each pair of furniture by using the above-mentioned furniture position detection method; and drawing a position map of the above-mentioned plurality of furniture according to the relative positions.
[0009] According to a fourth aspect of the present invention, there is provided a method for generating a home design drawing, including: for a plurality of furniture in a home space, respectively determining the relative positions of each pair of furniture by using the above-mentioned furniture position detection method; determining an initial layout of the plurality of furniture in the home space according to the relative positions; using a preset layout algorithm to adjust the position of at least one of the plurality of furniture; and determining the relative positions of each pair of furniture after adjustment, and generating a design drawing of the home space according to the relative positions.
[0010] According to a fifth aspect of the present invention, there is provided an intelligent home decoration system, including an image acquisition device, a user terminal, a design terminal and a server. Among them, the image acquisition device is installed above the ground with the lens facing downwards, and is suitable for acquiring a layout drawing of a home space, and the layout drawing includes a plurality of furniture; the user terminal is suitable for obtaining the layout drawing and sending a design request to the server based on the layout drawing; the server is suitable for responding to the design request, using a preset layout algorithm to adjust the position of at least one of the plurality of furniture, and generating an initial design drawing; the design terminal is suitable for adjusting the initial design drawing to generate a design drawing, and sending the design drawing to the server, so that the server can feedback the design drawing to the user terminal.
[0011] According to a sixth aspect of the present invention, there is provided a method for detecting a road traffic state, which is suitable for detecting whether two traffic objects collide to identify a road traffic accident. The traffic objects include vehicles and pedestrians. The method includes: obtaining a first projection of a first traffic object on the ground and a second projection of a second traffic object on the ground, and both the first projection and the second projection are in the shape of a convex polygon; respectively determining the vertex coordinates of the first projection and the second projection based on a preset coordinate system; generating a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; and determining whether the first traffic object and the second traffic object collide according to the angles of the plurality of vertex difference vectors, so as to identify a road traffic accident.
[0012] According to the seventh aspect of the present invention, there is provided a method for detecting game objects, which is suitable for detecting whether two objects in a game screen collide. The method includes: obtaining a first contour of a first object in the game screen and a second contour of a second object in the game screen, where both the first contour and the second contour are in the shape of a convex polygon; determining the vertex coordinates of the first contour and the second contour respectively based on a preset coordinate system; generating a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first contour and the vertex coordinates of the second contour; and determining whether the first object and the second object collide according to the angles of the plurality of vertex difference vectors.
[0013] According to the eighth aspect of the present invention, there is provided an object position detection device, including: an object projection obtaining module, which is suitable for obtaining a first projection of a first object on a preset plane and a second projection of a second object on the preset plane, where both the first projection and the second projection are in the shape of a convex polygon; a vertex coordinate determining module, which is suitable for determining the vertex coordinates of the first projection and the second projection respectively based on a preset coordinate system; an object position calculating module, which is suitable for generating a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; and determining the relative position of the first object and the second object according to the angles of the plurality of vertex difference vectors.
[0014] According to the ninth aspect of the present invention, there is provided a furniture position detection device, including: a furniture projection obtaining module, which is suitable for obtaining a first projection of a first furniture on the ground and a second projection of a second furniture on the ground, where both the first projection and the second projection are in the shape of a convex polygon; a vertex coordinate determining module, which is suitable for determining the vertex coordinates of the first projection and the second projection respectively based on a preset coordinate system; a furniture position calculating module, which is suitable for generating a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; and determining the relative position of the first furniture and the second furniture according to the angles of the plurality of vertex difference vectors.
[0015] According to the tenth aspect of the present invention, there is provided a computing device, including: at least one processor; and a memory storing program instructions, when the program instructions are read and executed by the processor, the computing device is caused to execute at least one of the above object position detection method, furniture position detection method, method for detecting home objects, method for generating a home design drawing, method for detecting road traffic conditions, and method for detecting game objects.
[0016] According to the eleventh aspect of the present invention, there is provided a readable storage medium storing program instructions, which, when read and executed by a computing device, cause the computing device to execute at least one of the above object position detection method, furniture position detection method, home object detection method, home design drawing generation method, road traffic state detection method, and game object detection method.
[0017] The object position detection method of the present invention is suitable for detecting the relative positions of two objects. First, projections of the two objects in the shape of convex polygons on a preset plane are obtained. Subsequently, based on a preset coordinate system, the vertex coordinates of the two projections are respectively determined, and a plurality of vertex difference vectors are calculated. Finally, the relative positions of the two objects are determined according to the angles of the vertex difference vectors, and it is judged whether the positions of the two objects overlap.
[0018] The object position detection method of the present invention is applicable to various objects whose projections are convex polygons, and is not limited to regular figures such as equilateral triangles and rectangles, and has good universality and strong operability.
[0019] In addition, the object position detection method of the present invention determines the relative positions of the two objects by calculating the angles of the vertex difference vectors, has a fast calculation speed and high efficiency, saves computing resources, and can realize the rapid detection of the object positions.
[0020] The object position detection method of the present invention can be applied to the field of intelligent home decoration. That is, the present invention also provides a furniture position detection method.
[0021] The furniture position detection method of the present invention can determine the relative positions of any two pieces of furniture whose projections are convex polygons, and judge whether the positions of the two pieces of furniture overlap, thereby providing a data basis for the intelligent home decoration layout.
[0022] In addition, the furniture position detection method of the present invention has a fast calculation speed and high efficiency, can quickly identify the relative positions of the two pieces of furniture, and thus is beneficial to realizing a fast and efficient intelligent home decoration layout.
[0023] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other objects, features and advantages of the present invention more obvious and understandable, the following specific embodiments of the present invention are specifically given. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] To achieve the above and related purposes, certain illustrative aspects are described herein in connection with the following description and drawings, which indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalent aspects are intended to fall within the scope of the claimed subject matter. The above and other purposes, features, and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the drawings. Throughout the present disclosure, the same reference numerals generally refer to the same components or elements.
[0025] Figure 1 A schematic diagram of an intelligent home decoration system 100 according to an embodiment of the present invention is shown;
[0026] Figure 2 A flowchart of an object position detection method 200 according to an embodiment of the present invention is shown;
[0027] Figure 2A Schematic diagrams of a convex polygon and a non-convex polygon according to an embodiment of the present invention are shown;
[0028] Figure 3 Schematic diagrams of a preset coordinate system according to a first embodiment of the present invention, and vertex coordinates of a first projection and a second projection are shown;
[0029] Figure 4 Shows Figure 3 Schematic diagrams of the corresponding vertex difference vector and the minimum circumferential enclosure;
[0030] Figure 5 Schematic diagrams of a preset coordinate system according to a second embodiment of the present invention, and vertex coordinates of a first projection and a second projection are shown;
[0031] Figure 6 Shows Figure 5 Schematic diagrams of the corresponding vertex difference vector and the minimum circumferential enclosure;
[0032] Figure 7 Schematic diagrams of a preset coordinate system according to a third embodiment of the present invention, and vertex coordinates of a first projection and a second projection are shown;
[0033] Figure 8 Shows Figure 7 Schematic diagrams of the corresponding vertex difference vector and the minimum circumferential enclosure;
[0034] Figure 9 A flowchart of a furniture position detection method 300 according to an embodiment of the present invention is shown;
[0035] Figure 10 A schematic diagram of a computing device 400 according to an embodiment of the present invention is shown;
[0036] Figure 11 FIG. 500 is a schematic diagram showing an object position detection device according to an embodiment of the present invention;
[0037] Figure 12 FIG. 600 is a schematic diagram showing a furniture position detection device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.
[0039] The present invention provides an object position detection method, which can be applied to the field of smart home to realize the layout of smart home decoration.
[0040] Figure 1 FIG. 100 is a schematic diagram showing a smart home decoration system according to an embodiment of the present invention. As Figure 1 shown, the system 100 includes a server 120, a design terminal 130, and a user terminal 140.
[0041] In an embodiment of the present invention, a user refers to a person with a need for house decoration design, which may be, for example, the owner, lessee, manager, etc. of the house. The user terminal 140 is a terminal device used by the user, including but not limited to a desktop computer, a notebook computer, and other personally configured computers, as well as a mobile phone, a tablet computer, a smart wearable device, and other portable mobile terminals.
[0042] The user can submit a house decoration design request by accessing a specific web page or application (App) on the user terminal 140. The server 120 is the server corresponding to the specific web page or application, and is used to provide methods and data calls to the web page or application to implement corresponding functions.
[0043] In some embodiments, when the user terminal 140 submits a house design request, the server 120 responds to the request and prompts the user to upload a house floor plan and a layout plan of the current house. The user can obtain the floor plan from the house developer or the property certificate, and collect the layout plan of the current house through an image acquisition device such as the user terminal 140, a camera fixed on the house (usually fixed at a corner of the roof), or an aerial photography device (such as a drone, etc.). The image acquisition device is installed above the ground and the lens faces downward.
[0044] For example, as Figure 1As shown, an image acquisition device such as a user terminal 140 or a camera fixed at a corner of the roof, an aerial photography device, etc. can be used to collect the layout plan of the house 110, and the layout plan includes the placement positions of items such as a bed 111, a table 112, a sofa 113, a potted plant 114, a chandelier 115, etc. inside the house.
[0045] After the user terminal 140 obtains the house type plan and the house layout plan, it uploads the two to the server 120 to submit a design request. In response to the design request, the server 120 identifies the placement positions of furniture, household appliances and other items in the house (i.e., the home space) based on the house type plan and the current house layout plan, uses a preset layout algorithm to carry out decoration design, adjusts the placement positions of the items, and generates a design drawing.
[0046] The process of generating the design drawing can be entirely executed in the server 120, or can be assisted by the design terminal 130 to execute the server 120. The design terminal 130 is a terminal device used by home improvement designers, including but not limited to personal configured computers such as desktop computers, laptop computers, and portable mobile terminals such as mobile phones, tablet computers, and smart wearable devices. In some embodiments, the server 120 automatically performs decoration design using a preset layout algorithm, adjusts the position of at least one of multiple pieces of furniture in the current home space, and generates an initial design drawing. The design terminal 130 obtains the initial design drawing generated by the server 120 and supervises and adjusts it. The process of supervision and adjustment can be repeated multiple times. After adjustment, the design terminal 130 generates a design drawing and returns the design drawing to the server 120. The server 120 further sends the final draft of the design drawing to the user terminal 140, thus completing the home improvement layout design.
[0047] In Figure 1 In the intelligent home improvement scenario shown, identifying the placement positions of furniture and other items in the house is the basis for realizing the intelligent home improvement layout. For example, in the process of intelligent home improvement layout, it is necessary to identify the placement positions of each piece of furniture from the current house layout plan. Then, in the process of decorating the house, it is necessary to continuously adjust the positions of each existing piece of furniture, determine the placement positions of new furniture, and identify and correct the positions of each piece of furniture after adjustment. In order to automatically and quickly identify the positions of furniture in the house, the present invention provides an object position detection method, which is suitable for detecting the relative positions between two objects and judging whether the positions of the two objects overlap.
[0048] It should be noted that although the object position detection method of the present invention is proposed based on the application scenario of intelligent home improvement layout, the object position detection method of the present invention can be applied to any application scenario that needs to detect the relative positions of two objects, and is not limited to the smart home scenario.
[0049] For example, the object position detection method of the present invention can also be applied to the application scenarios of smart cities to detect whether there is an overlap in the positions between transportation vehicles or between a transportation vehicle and a person, that is, whether a collision occurs, so as to identify road traffic accidents.
[0050] Alternatively, the object position detection method of the present invention can also be applied to the field of game development. In games such as tower defense, shooting, action, adventure, etc., there are often scenarios where a tool object (such as a bullet, a flying knife, etc.) hits a target object (such as a monster, an airplane, a tank, etc.). The object position detection method of the present invention can be used to detect whether there is an overlap in the positions of the tool object and the target object in the game screen, that is, whether the two collide.
[0051] In addition to the smart home scenario, two scenarios where the object position detection method of the present invention can be applied are listed above. Those skilled in the art can understand that the application scenarios of the object position detection method of the present invention and the specific categories of objects are not limited to those listed above. Any application scenario that requires detecting the relative positions of two objects can adopt the object position detection method of the present invention.
[0052] Figure 2 The flowchart of an object detection method 200 according to an embodiment of the present invention is shown. Method 200 is executed in a computing device, and the computing device can be, for example, a server, a personal computer, a mobile phone, a tablet computer, a smart wearable device, an Internet of Things device, etc., but is not limited thereto. In Figure 1 the smart home scenario shown, the computing device can be, for example, the server 120 or the design terminal 130.
[0053] Method 200 is adapted to detect the relative positions of a first object and a second object and determine whether there is an overlap in the positions of the two objects. As Figure 2 shown, method 200 starts from step S210.
[0054] In step S210, a first projection of the first object on a preset plane and a second projection of the second object on the preset plane are obtained. Among them, both the first projection and the second projection are in the shape of a convex polygon.
[0055] The first object and the second object can be any objects, and the present invention does not limit the types of the first object and the second object. For example, in Figure 1 the smart home layout scenario shown, the first object and the second object can be furniture; in the smart city application scenario, the first object and the second object can be transportation vehicles or people; and so on.
[0056] The first projection of the first object on the preset plane and the second projection of the second object on the preset plane can be obtained by collecting images of the first object and the second object above the preset plane. The local areas corresponding to the first object and the second object in the collected images are the corresponding first projection and second projection respectively.
[0057] The preset plane can be, for example, the ground, a wall surface or other reference planes, and the present invention does not limit the type of the preset plane. Generally, the preset plane is the ground. Correspondingly, the first projection of the first object on the preset plane and the second projection of the second object on the preset plane can be obtained by installing an image acquisition device above the ground (the lens of the image acquisition device faces downward) to collect images of the first object and the second object. The local areas corresponding to the first object and the second object in the collected images are the corresponding first projection and second projection respectively.
[0058] In the embodiments of the present invention, both the first projection and the second projection are in the shape of a convex polygon. That is, the object position detection method of the present invention is suitable for detecting the relative positions of two objects whose projections are convex polygons. A convex polygon refers to a polygon in which when any one of all the sides of the polygon is extended infinitely in both directions to form a straight line, all the other sides are on the same side of this straight line. The interior angles of a convex polygon should not all be reflexive angles, and the line segment between any two vertices is located inside or on the polygon.
[0059] For example, Figure 2A shows the projections of a bed, a dining table, and a sofa on the ground in an intelligent home decoration layout scenario. As Figure 2A shown, all these three projections are polygons. The projection of the bed on the ground is a rectangle, which includes four vertices A1 to D1. Among these four vertices, the connection line between any two vertices is located inside or on the rectangle. Therefore, this rectangle is a convex polygon. The projection of the dining table on the ground is a hexagon, which includes six vertices A2 to F2. Among these six vertices, the connection line between any two vertices is located inside or on the hexagon. Therefore, this hexagon is a convex polygon. In Figure 2A , the sofa has a sense of design, and its projection on the ground presents an irregular decagon including 10 vertices. Among these ten vertices, the connection line between any two vertices is not all located inside or on the decagon. For example, the connection line between vertices A3 and C3 and the connection line between vertices E3 and H3 are located outside the decagon. Therefore, this decagon is not a convex polygon.
[0060] The object position detection method of the present invention is suitable for detecting the relative positions of two objects whose projections are convex polygons, and is not suitable for detecting the relative positions of two objects whose projections are both non-convex polygons or one is a convex polygon and the other is a non-convex polygon. This is because the object position detection method of the present invention determines the relative positions of two objects by analyzing the angles of the vertex difference vectors of the two projections. For two convex polygons, there is a corresponding relationship between the angle of the vertex difference vector and the relative positions of the two objects. For the case where the two projections are both non-convex polygons, or one is a convex polygon and the other is a non-convex polygon, since non-convex polygons are involved, the angle range of the vertex difference vector can be 0 to 360 degrees, and there is no clear corresponding relationship between the angle of the vertex difference vector and the relative positions of the two objects. Therefore, the object position detection method of the present invention cannot be applied in this case.
[0061] Still taking Figure 2A as an example, among the three objects of the bed, dining table, and sofa shown in Figure 2A , the object position detection method of the present invention is suitable for detecting the relative positions of the bed and the dining table, and is not suitable for detecting the relative positions of the bed and the sofa, or the dining table and the sofa.
[0062] After obtaining the first projection and the second projection in step S210, step S220 is executed.
[0063] In step S220, based on the preset coordinate system, the vertex coordinates of the first projection and the second projection are determined respectively.
[0064] The preset coordinate system is usually a plane rectangular coordinate system, and the position of its origin and the positive directions of the coordinate axes can be set by those skilled in the art, and the present invention does not limit this. In one embodiment, for the image collected in step S210 that includes the first projection and the second projection, the lower left corner of the image can be used as the origin, the horizontal rightward direction can be used as the positive direction of the x-axis, and the vertical upward direction can be used as the positive direction of the y-axis to establish a preset coordinate system. The established coordinate system is as shown in Figures 3 - 8 .
[0065] Based on the preset coordinate system, the vertex coordinates of the first projection and the second projection are determined. For example, for the image collected in step S210 that includes the first projection and the second projection, a coordinate system as shown in Figures 3 - 8 is established, where the vertex coordinates of the first projection and the second projection can be the pixel distances of the vertex to the x-axis and the y-axis.
[0066] After determining the vertex coordinates of the first projection and the second projection in step S220, step S230 is executed.
[0067] In step S230, a plurality of vertex difference vectors are generated based on the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection.
[0068] According to one embodiment, each vertex coordinate of the first projection is respectively subtracted from each vertex coordinate of the second projection to generate a plurality of vertex difference vectors. The number of generated vertex difference vectors is the product of the number of vertices of the first projection and the number of vertices of the second projection.
[0069] For example, in Figure 3 the embodiment shown, the first projection is rectangle A1A2A3A4, and the second projection is rectangle B1B2B3B4. Each vertex coordinate of the first projection is respectively subtracted from each vertex coordinate of the first projection to generate 16 vertex difference vectors, that is: the coordinates of vertex A1 of the first projection are respectively subtracted from the coordinates of vertices B1, B2, B3, B4 of the second projection to generate vertex difference vectors B1A1, B2A1, B3A1, and B4A1; the coordinates of vertex A2 of the first projection are respectively subtracted from the coordinates of vertices B1, B2, B3, B4 of the second projection to generate vertex difference vectors B1A2, B2A2, B3A2, and B4A2; the coordinates of vertex A3 of the first projection are respectively subtracted from the coordinates of vertices B1, B2, B3, B4 of the second projection to generate vertex difference vectors B1A3, B2A3, B3A3, and B4A3; the coordinates of vertex A4 of the first projection are respectively subtracted from the coordinates of vertices B1, B2, B3, B4 of the second projection to generate vertex difference vectors B1A4, B2A4, B3A4, and B4A4, a total of 16 vertex difference vectors are generated.
[0070] Similarly, in Figure 5 and Figure 7 the embodiment shown, the first projection is triangle A1A2A3, and the second projection is rectangle B1B2B3B4. Each vertex coordinate of the first projection is respectively subtracted from each vertex coordinate of the first projection to generate 12 vertex difference vectors, that is B1A1, B2A1, B3A1, B4A1, B1A2, B2A2, B3A2, B4A2, B1A3, B2A3, B3A3, B4A3.
[0071] After generating a plurality of vertex difference vectors in step S230, step S240 is executed.
[0072] In step S240, the relative position of the first object and the second object is determined according to the angles of the plurality of vertex difference vectors.
[0073] According to an embodiment, step S240 includes: if the angle of the minimum circumferential enclosure formed by multiple vertex difference vectors is greater than or equal to 180 degrees, there is a position overlap between the first object and the second object; if the angle of the minimum circumferential enclosure formed by multiple vertex difference vectors is less than 180 degrees, there is no position overlap between the first object and the second object.
[0074] Further, the angle of the minimum circumferential enclosure formed by multiple vertex difference vectors being greater than or equal to 180 degrees includes two cases: if the angle of the minimum circumferential enclosure formed by multiple vertex difference vectors is greater than 180 degrees, part or all of the regions of the first object and the second object overlap; if the angle of the minimum circumferential enclosure formed by multiple vertex difference vectors is equal to 180 degrees, one side of the first object and the second object overlaps.
[0075] In an embodiment of the present invention, the circumferential enclosure of multiple vertex difference vectors refers to an arc that can contain these multiple vertex difference vectors. Multiple vertex difference vectors can form multiple circumferential enclosures, and the circumferential enclosure with the smallest angle (i.e., the arc with the smallest central angle) is the minimum circumferential enclosure.
[0076] For example, Figure 3 in the shown embodiment, the first projection A1A2A3A4 of the first object and the second projection B1B2B3B4 of the second object are shown. Based on these two projections, 16 vertex difference vectors such as B1A1, B2A1, B3A1, etc. are generated, as Figure 4 shown.
[0077] Figure 4 The 16 vertex difference vectors shown can form multiple circumferential enclosures. For example, taking a point O1 on the ray where vector B3A1 is located as the starting point and a point O2 on the ray where vector B4A4 is located as the ending point, an arc O1O2 is formed. All 16 vertex difference vectors are included inside the arc O1O2. The arc O1O2 is a circumferential enclosure formed by these 16 vertex difference vectors, and the angle of this circumferential enclosure is O1OO2. Taking a point O3 on the ray where vector B2A1 is located as the starting point and a point O4 on the ray where vector B3A1 is located as the ending point, an arc O3O4 is formed. All 16 vertex difference vectors are included inside the arc O3O4. The arc O3O4 is another circumferential enclosure formed by these 16 vertex difference vectors, and the angle of this circumferential enclosure is O3OO4.
[0078] Those skilled in the art can understand that in addition to the circumferential enclosures O1O2 and O3O4, Figure 4 the 16 vertex difference vectors in Figure 4 can also form other circumferential enclosures. Due to space limitations,
[0079] Among the enclosing circles formed by these 16 vertex difference vectors, the enclosing circle with the smallest angle is the enclosing circle O1O2, that is, the smallest enclosing circle is O1O2.
[0080] As Figure 4 shown, since the angle of the smallest enclosing circle O1O2 is less than 180 degrees, the positions of the corresponding first object and second object do not overlap.
[0081] In Figure 5 the illustrated embodiment, the first projection A1A2A3 of the first object and the second projection B1B2B3B4 of the second object are shown. Based on these two projections, 12 vertex difference vectors such as B1A1, B2A1, B3A1, etc. are generated, as Figure 6 shown.
[0082] Figure 6 The 12 vertex difference vectors shown can form multiple enclosing circles, among which the enclosing circle with the smallest angle is the enclosing circle O1O2, that is, the smallest enclosing circle is O1O2. As Figure 6 shown, since the angle of the smallest enclosing circle O1O2 is greater than 180 degrees, part or all of the regions of the corresponding first object and second object overlap, and the overlapping region is as Figure 5 shown by the shaded part in.
[0083] In Figure 7 the illustrated embodiment, the first projection A1A2A3 of the first object and the second projection B1B2B3B4 of the second object are shown. Based on these two projections, 12 vertex difference vectors such as B1A1, B2A1, B3A1, etc. are generated, as Figure 8 shown.
[0084] Figure 8 The 12 vertex difference vectors shown can form multiple enclosing circles, among which the enclosing circle with the smallest angle is the enclosing circle O1O2, that is, the smallest enclosing circle is O1O2. As Figure 8 shown, since the angle of the smallest enclosing circle O1O2 is equal to 180 degrees, one side of the corresponding first object and second object overlaps. As Figure 7 shown, the side A1A2 of the first object overlaps with the side B3B4 of the second object.
[0085] Figures 3 - 8 Illustrates the correlation between the angle of the smallest enclosing circle and the relative positions of the two objects. In a computing device, directly calculating the angle of the smallest enclosing circle and determining its size relationship with 180 will involve angle operations such as cos and sin as well as division operations, resulting in slow calculation speed and low efficiency. To avoid angle operations such as cos and sin as well as division operations, according to one embodiment, the relative size of the angle of the smallest enclosing circle and 180 degrees can be determined according to the following steps S242 to S246:
[0086] In step S242, one is selected from multiple vertex difference vectors as the initial vector.
[0087] The initial vector can be any one of the multiple vertex difference vectors. For example, there are 16 vertex difference vectors in total, which are (x0, y0), (x1, y1), …, (x15, y15), and (x0, y0) can be used as the initial vector.
[0088] Subsequently, in step S244, the leftmost vector and the rightmost vector are determined from the other vertex difference vectors, where the leftmost vector is the vertex difference vector located on the left side of the initial vector and having the largest included angle with the initial vector, and the rightmost vector is the vertex difference vector located on the right side of the initial vector and having the largest included angle with the initial vector.
[0089] According to one embodiment, the leftmost vector and the rightmost vector can be determined according to the following steps:
[0090] First, the initial values of the leftmost vector and the rightmost vector are both set to the initial vector. Subsequently, the other vertex difference vectors are traversed. For each vector, the following steps are performed to update the leftmost vector and the rightmost vector: If the current vector is located on the left side of the initial vector and on the left side of the leftmost vector, the leftmost vector is updated to the current vector; if the current vector is located on the right side of the initial vector and on the right side of the rightmost vector, the rightmost vector is updated to the current vector.
[0091] For example, there are 16 vertex difference vectors (x0, y0), (x1, y1), …, (x15, y15), where (x0, y0) is the initial vector. The initial values of the leftmost vector pointLeft and the rightmost vector pointRight are both set to the initial vector, that is, pointLeft = pointRight = (x0, y0).
[0092] Subsequently, the other vertex difference vectors are traversed, that is, the vectors (x1, y1) to (x15, y15) are traversed. A variable currPoint is set to store the current vector, that is, the value of currPoint changes with the traversal process, and its value is the currently traversed vertex difference vector.
[0093] In each traversal:
[0094] Judge whether the current vector currPoint is located on the left side of the initial vector (x0, y0). If it is located on the left side of the initial vector, further judge whether it is located on the left side of the leftmost vector pointLeft. If so, the leftmost vector is updated to the current vector, that is, pointLeft = currPoint;
[0095] If the current vector currPoint is not to the left of the initial vector (x0, y0), then determine whether the current vector currPoint is to the right of the initial vector (x0, y0). If it is to the right of the initial vector, then further determine whether it is to the right of the rightmost vector pointRight. If so, update the rightmost vector to the current vector, i.e., let pointRight = currPoint.
[0096] Specifically, the relative positions of two vectors can be determined by the following method, i.e., determining whether the first vector is to the left of, to the right of, or collinear with the second vector: calculate the difference between the product of the abscissa of the first vector and the ordinate of the second vector and the product of the ordinate of the first vector and the abscissa of the second vector; if the difference is greater than 0, then the second vector is to the left of the first vector; if the difference is less than 0, then the second vector is to the right of the first vector; if the difference is equal to 0, then the second vector is collinear with the first vector.
[0097] For example, the first vector is the initial vector (x0, y0), and the second vector is the current vector currPoint = (x, y). If x0*y - y0*x > 0, then the current vector currPoint is to the left of the initial vector (x0, y0); if x0*y - y0*x < 0, then the current vector currPoint is to the right of the initial vector (x0, y0); if x0*y - y0*x = 0, then the current vector currPoint is collinear with the initial vector (x0, y0).
[0098] After traversing all other vertex difference vectors, the final leftmost vector and rightmost vector will be obtained.
[0099] In the above traversal process, each traversal requires 2 left / right judgments, and each judgment requires 2 multiplications and 1 addition (in the operation process of the computing device, subtraction can be equivalent to addition), that is, each traversal requires 4 multiplications and 2 additions. When there are 15 other vertex difference vectors, traversing these vectors requires a total of 15 * 4 = 60 multiplication operations and 15 * 2 = 30 addition operations.
[0100] According to another embodiment, the leftmost vector and the rightmost vector can be determined according to the following steps: determine a left vector set and a right vector set from the other vertex difference vectors, where the left vector set includes the vertex difference vectors to the left of the initial vector, and the right vector set includes the vertex difference vectors to the right of the initial vector; determine the leftmost vector from the left vector set; and determine the rightmost vector from the right vector set. Further, in this embodiment, the step of determining the leftmost vector from the left vector set and the step of determining the rightmost vector from the right vector set are executed in parallel, thereby accelerating the calculation speed.
[0101] After determining the leftmost vector and the rightmost vector, step S246 is executed.
[0102] In step S246, it is judged whether the leftmost vector is on the left side of the rightmost vector. If the leftmost vector is on the left side of the rightmost vector, the angle of the minimum circumferential enclosure is less than 180 degrees; if the leftmost vector is on the right side of the rightmost vector, the angle of the minimum circumferential enclosure is greater than 180 degrees; if the leftmost vector and the rightmost vector are collinear, the angle of the minimum circumferential enclosure is 180 degrees.
[0103] According to an embodiment, the relative position of the leftmost vector and the rightmost vector can be judged according to the method described above, that is, it is judged whether the leftmost vector is on the left side, right side or collinear with the rightmost vector. That is, calculate the difference between the product of the abscissa of the rightmost vector and the ordinate of the leftmost vector and the product of the ordinate of the rightmost vector and the abscissa of the leftmost vector; if the difference is greater than 0, the leftmost vector is on the left side of the rightmost vector; if the difference is less than 0, the leftmost vector is on the right side of the rightmost vector; if the difference is equal to 0, the leftmost vector and the rightmost vector are collinear. Using this method to judge whether the leftmost vector is on the left side of the rightmost vector requires 2 multiplication operations and 1 addition operation.
[0104] Therefore, taking the first projection of the first object and the second projection of the second object as rectangles as an example, in the process of using the object position detection method 200 to determine the relative position of the first object and the second object, step S230 generates 16 vertex difference vectors by subtracting vertex coordinates, and a total of 16 addition operations need to be performed. In step S240, to determine the relative position of the two objects, 60 + 2 = 62 multiplication operations and 30 + 1 = 31 addition operations need to be performed. Therefore, the entire method 200 needs to perform 62 multiplication operations and 16 + 31 = 47 addition operations in total, without performing division operations and angle operations such as sin and cos, with fast calculation speed, high efficiency, saving calculation resources, and being able to achieve fast detection of object positions.
[0105] In addition, the object position detection method 200 of the present invention is applicable to various objects with convex polygon projections, and is not limited to regular figures such as equilateral triangles and rectangles, with good universality and strong operability.
[0106] The object position detection method 200 of the present invention can be applied to the field of intelligent home decoration. Correspondingly, the present invention also provides a furniture position detection method 300. The method 300 is executed in a computing device, and the computing device can be, for example, the aforementioned server 120 or the design terminal 130.
[0107] The method 300 is suitable for detecting the relative position of the first furniture and the second furniture and judging whether the positions of the two pieces of furniture overlap. As Figure 9 shown, the method 300 starts from step S310.
[0108] In step S310, obtain the first projection of the first piece of furniture on the ground and the second projection of the second piece of furniture on the ground. Both the first projection and the second projection are convex polygons.
[0109] The first piece of furniture and the second piece of furniture can be any type of furniture, such as a bed, a coffee table, a table and chairs, etc. The present invention does not limit the specific types of the first piece of furniture and the second piece of furniture.
[0110] The first projection and the second projection can be obtained, for example, by setting up an image acquisition device above the ground (the lens of the image acquisition device faces downward) and collecting the images of the first piece of furniture and the second piece of furniture by the image acquisition device. The local areas corresponding to the first piece of furniture and the second piece of furniture in the collected images are the corresponding first projection and second projection.
[0111] For the specific implementation method of step S310, reference can be made to the aforementioned step S210, which will not be elaborated here.
[0112] Subsequently, in step S320, based on a preset coordinate system, determine the vertex coordinates of the first projection and the second projection respectively.
[0113] The preset coordinate system is usually a plane rectangular coordinate system, and the position of its origin and the positive directions of the coordinate axes can be set by those skilled in the art themselves. The present invention does not limit this. In one embodiment, for the image collected in step S110 that includes the first projection and the second projection, the lower left corner of the image can be used as the origin, the horizontal rightward direction can be used as the positive direction of the x-axis, and the vertical upward direction can be used as the positive direction of the y-axis to establish a preset coordinate system.
[0114] For the specific implementation method of step S320, reference can be made to the aforementioned step S220, which will not be elaborated here.
[0115] Subsequently, in step S330, generate a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection.
[0116] According to one embodiment, subtract each vertex coordinate of the first projection from each vertex coordinate of the second projection to generate a plurality of vertex difference vectors. The number of the generated vertex difference vectors is the product of the number of vertices of the first projection and the number of vertices of the second projection.
[0117] For the specific implementation method of step S330, reference can be made to the aforementioned step S230, which will not be elaborated here.
[0118] In step S340, determine the relative position of the first piece of furniture and the second piece of furniture according to the angles of the plurality of vertex difference vectors.
[0119] According to one embodiment, step S340 includes: if the angle of the minimum circumferential enclosure formed by multiple vertex difference vectors is greater than or equal to 180 degrees, there is a position overlap between the first piece of furniture and the second piece of furniture; if the angle of the minimum circumferential enclosure formed by multiple vertex difference vectors is less than 180 degrees, the positions of the first piece of furniture and the second piece of furniture do not overlap.
[0120] Further, the angle of the minimum circumferential enclosure formed by multiple vertex difference vectors being greater than or equal to 180 degrees includes two cases: if the angle of the minimum circumferential enclosure formed by multiple vertex difference vectors is greater than 180 degrees, part or all of the areas of the first piece of furniture and the second piece of furniture overlap; if the angle of the minimum circumferential enclosure formed by multiple vertex difference vectors is equal to 180 degrees, one side of the first piece of furniture and the second piece of furniture overlaps.
[0121] According to one embodiment, the relative size of the angle of the minimum circumferential enclosure and 180 degrees can be determined according to the following steps:
[0122] First, select one from multiple vertex difference vectors as the initial vector. Subsequently, determine the leftmost vector and the rightmost vector from the other vertex difference vectors, where the leftmost vector is the vertex difference vector located on the left side of the initial vector and having the largest included angle with the initial vector, and the rightmost vector is the vertex difference vector located on the right side of the initial vector and having the largest included angle with the initial vector. If the leftmost vector is located on the left side of the rightmost vector, the angle of the minimum circumferential enclosure is less than 180 degrees; if the leftmost vector is located on the right side of the rightmost vector, the angle of the minimum circumferential enclosure is greater than 180 degrees; if the leftmost vector and the rightmost vector are collinear, the angle of the minimum circumferential enclosure is 180 degrees.
[0123] For the specific implementation method of step S340, reference can be made to the foregoing step S240, which will not be elaborated here.
[0124] Based on the furniture position detection method 300, the present invention also provides a detection method 3100 for home objects. Method 3100 starts from step S3110.
[0125] In step S3110, for multiple pieces of furniture in the home space, the relative positions of each pair of furniture are respectively determined by using the foregoing furniture position detection method 300.
[0126] In the embodiments of the present invention, the home space refers to the space that needs to be decorated and designed, such as the user's house (dwelling), office in an office building, etc.
[0127] Subsequently, in step S3120, a position map of the above-mentioned multiple pieces of furniture is drawn according to the determined relative positions.
[0128] The present invention also provides a method 3200 for generating a home design drawing. Method 3200 starts from step S3210.
[0129] In step S3210, for multiple pieces of furniture in the home space, the relative positions of each pair of furniture are determined respectively by using the furniture position detection method 300.
[0130] Subsequently, in step S3220, the initial layout of the above-mentioned multiple pieces of furniture in the home space is determined according to the determined relative positions.
[0131] Subsequently, in step S3230, a preset layout algorithm is used to adjust the position of at least one of the multiple pieces of furniture. The layout algorithm can be any algorithm for automatically adjusting the position of furniture, and the present invention does not specifically limit the layout algorithm.
[0132] Subsequently, in step S3240, the relative positions of each pair of furniture after adjustment are determined by using the furniture position detection method 300, and a design drawing of the home space is generated according to the relative positions.
[0133] The generated design drawing includes, but is not limited to, the placement positions of each piece of furniture. For example, in addition to the placement positions of the furniture, the design drawing also includes information such as the electrical, plumbing, and network wiring of the home space. Based on this design drawing, the decorator can rearrange the furniture and construct the home space.
[0134] The present invention also provides a detection method 3300 for road traffic conditions, which is suitable for detecting whether two traffic objects collide to identify road traffic accidents, wherein the traffic objects include vehicles and pedestrians. The method 3300 starts from step S3310.
[0135] In step S3310, the first projection of the first traffic object on the ground and the second projection of the second traffic object on the ground are obtained, and both the first projection and the second projection are in the shape of a convex polygon.
[0136] The first projection and the second projection can be obtained, for example, by cameras installed beside the road.
[0137] Subsequently, in step S3320, based on a preset coordinate system, the vertex coordinates of the first projection and the second projection are determined respectively.
[0138] The specific implementation method of step S3320 can refer to the foregoing step S220, and will not be elaborated here.
[0139] Subsequently, in step S3330, a plurality of vertex difference vectors are generated according to the vertex coordinates, wherein the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection.
[0140] The specific implementation method of step S3330 can refer to the foregoing step S230, and will not be elaborated here.
[0141] Subsequently, in step S3340, based on the angles of multiple vertex difference vectors, it is determined whether the first traffic object collides with the second traffic object, thereby identifying a road traffic accident.
[0142] For the specific implementation method of step S3340, reference can be made to the foregoing step S240, which will not be elaborated here. Referring to the foregoing step S240, when it is determined that there is a position overlap between the first traffic object and the second traffic object, a collision occurs between them, that is, a road traffic accident occurs.
[0143] The present invention also provides a detection method 3400 for game objects, which is suitable for detecting whether two objects in a game screen collide. For example, game objects include tool objects (such as bullets, flying knives, etc.) and target objects (such as monsters, airplanes, tanks, etc.), and method 3400 is suitable for detecting whether the positions of the tool object and the target object in the game screen overlap, that is, whether they collide. Method 3400 starts from step S3410.
[0144] In step S3410, a first contour of the first object in the game screen and a second contour of the second object in the game screen are obtained, where both the first contour and the second contour are in the shape of a convex polygon.
[0145] The game screen is a plane, and the objects in the game are usually irregularly shaped graphics, such as bullets, flying objects, monsters, airplanes, etc. In some embodiments, the first contour and the second contour may be circumscribed polygons of the first object and the second object, such as a circumscribed rectangle.
[0146] Subsequently, in step S3420, based on a preset coordinate system, the vertex coordinates of the first contour and the second contour are respectively determined.
[0147] According to one embodiment, the preset coordinate system is a plane rectangular coordinate system with the lower left corner of the game screen as the origin, the horizontal rightward direction as the positive x-axis direction, and the vertical upward direction as the positive y-axis direction.
[0148] Subsequently, in step S3430, multiple vertex difference vectors are generated according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first contour and the vertex coordinates of the second contour.
[0149] For the specific implementation method of step S3430, reference can be made to the foregoing step S230, which will not be elaborated here
[0150] Subsequently, in step S3440, based on the angles of multiple vertex difference vectors, it is determined whether the first object collides with the second object.
[0151] For the specific implementation method of step S3440, reference can be made to the foregoing step S240, which will not be elaborated here. Referring to the foregoing step S240, when it is determined that there is an overlap in the positions of the first object and the second object, a collision occurs between them.
[0152] The object position detection method 200, the furniture position detection method 300, the home object detection method 3100, the home design drawing generation method 3200, the road traffic state detection method 3300, and the game object detection method 3400 of the present invention are all executed in a computing device.
[0153] Figure 10 FIG. shows a schematic diagram of a computing device 400 according to an embodiment of the present invention. As Figure 10 shown, the computing device 400 includes a processor 410 and a memory 420 storing program instructions. The memory 420 includes an object position detection device 500 and / or a furniture position detection device 600, such that the computing device 400 executes the object position detection method 200 and / or the furniture position detection method 300 of the present invention.
[0154] The object position detection device 500 includes program instructions for executing the object position detection method 200 of the present invention. When the memory 420 includes the object position detection device 500, the computing device 400 can execute the object position detection method 200 of the present invention.
[0155] The furniture position detection device 600 includes program instructions for executing the furniture position detection method 300 of the present invention. When the memory 420 includes the furniture position detection device 600, the computing device 400 can execute the furniture position detection method 300 of the present invention.
[0156] When the memory 420 includes the object position detection device 500 and the furniture position detection device 600, the computing device 400 can not only execute the object position detection method 200 of the present invention, but also execute the furniture position detection method 300 of the present invention.
[0157] In some embodiments, the memory 420 includes at least one of program instructions for executing the object position detection method 200, program instructions for executing the furniture position detection method 300, program instructions for executing the home object detection method 3100, program instructions for executing the home design drawing generation method 3200, program instructions for executing the road traffic state detection method 3300, and program instructions for executing the game object detection method 3400. When these program instructions are executed by the processor 410, the computing device 400 is caused to execute at least one of the object position detection method 200, the furniture position detection method 300, the home object detection method 3100, the home design drawing generation method 3200, the road traffic state detection method 3300, and the game object detection method 3400.
[0158] Figure 11 FIG. shows a schematic diagram of an object position detection device 500 according to an embodiment of the present invention. As Figure 11 shown, the device 500 includes an object projection acquisition module 510, a vertex coordinate determination module 520, and an object position calculation module 530.
[0159] The object projection acquisition module 510 is adapted to acquire a first projection of a first object on a preset plane and a second projection of a second object on the preset plane, wherein both the first projection and the second projection are in the shape of a convex polygon.
[0160] For the functions and specific processing logics of the object projection acquisition module 510, reference may be made to the relevant descriptions in the foregoing step S210, and details are not described herein again.
[0161] The vertex coordinate determination module 520 is adapted to determine the vertex coordinates of the first projection and the second projection respectively based on a preset coordinate system.
[0162] For the functions and specific processing logics of the vertex coordinate determination module 520, reference may be made to the relevant descriptions in the foregoing step S220, and details are not described herein again.
[0163] The object position calculation module 530 is adapted to generate a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; and determine the relative position of the first object and the second object according to the angles of the plurality of vertex difference vectors.
[0164] For the functions and specific processing logics of the object position calculation module 530, reference may be made to the relevant descriptions in the foregoing step S230 and step S240, and details are not described herein again.
[0165] Figure 12 FIG. shows a schematic diagram of a furniture position detection device 600 according to an embodiment of the present invention. As Figure 12As shown, the device 600 includes a furniture projection acquisition module 610, a vertex coordinate determination module 620, and a furniture position calculation module 630.
[0166] The furniture projection acquisition module 610 is adapted to acquire a first projection of a first piece of furniture on the ground and a second projection of a second piece of furniture on the ground, and both the first projection and the second projection are in the shape of a convex polygon.
[0167] For the functions and specific processing logics of the furniture projection acquisition module 610, reference can be made to the relevant descriptions in the foregoing step S310, which will not be elaborated here.
[0168] The vertex coordinate determination module 620 is adapted to respectively determine the vertex coordinates of the first projection and the second projection based on a preset coordinate system.
[0169] For the functions and specific processing logics of the vertex coordinate determination module 620, reference can be made to the relevant descriptions in the foregoing step S320, which will not be elaborated here.
[0170] The furniture position calculation module 630 is adapted to generate a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; and to determine the relative position of the first piece of furniture and the second piece of furniture according to the angles of the plurality of vertex difference vectors.
[0171] For the functions and specific processing logics of the furniture position calculation module 630, reference can be made to the relevant descriptions in the foregoing step S330 and step S340, which will not be elaborated here.
[0172] The various technologies described here can be implemented in combination with hardware or software, or a combination of them. Thus, the method and device of the present invention, or certain aspects or parts of the method and device of the present invention, may take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, where when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0173] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memories and / or storage elements), at least one input device, and at least one output device. Among them, the memory is configured to store the program code; the processor is configured to execute at least one of the object position detection method, the furniture position detection method, the home object detection method, the home design drawing generation method, the road traffic state detection method, and the game object detection method of the present invention according to the instructions in the program code stored in the memory.
[0174] By way of example, and not limitation, a readable medium includes a readable storage medium and a communication medium. A readable storage medium stores information such as computer readable instructions, data structures, program modules or other data. A communication medium generally embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and includes any information delivery medium. Combinations of any of the above are also included within the scope of the readable medium.
[0175] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. A variety of general purpose systems may also be used with examples of the present invention. The structure required to construct such systems will be apparent from the above description. Additionally, the present invention is not directed to any particular programming language. It should be appreciated that the present invention as described herein may be implemented using a variety of programming languages, and the description of a particular language above is for the purpose of disclosing preferred embodiments of the present invention.
[0176] In the specification provided herein, numerous specific details are set forth. However, it can be understood that embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0177] Similarly, it should be understood that, for the purpose of streamlining this disclosure and aiding in the understanding of one or more of the various inventive aspects, in the foregoing description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, the inventive aspects lie in less than all of the features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of the present invention.
[0178] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices as described in the embodiments, or alternatively may be located in one or more devices different from those of the examples. The modules in the foregoing examples may be combined into one module or further divided into multiple sub-modules.
[0179] Those skilled in the art can understand that the modules in the devices in the embodiments can be adaptively changed and set in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be adopted to combine all the features disclosed in this specification (including the accompanying claims, abstract and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise clearly stated, each feature disclosed in this specification (including the accompanying claims, abstract and drawings) can be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0180] In addition, those skilled in the art can understand that although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of features of different embodiments means that it is within the scope of the present invention and forms different embodiments. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
[0181] In addition, some of the embodiments herein are described as combinations of methods or method elements that can be implemented by a processor of a computer system or by other devices performing the functions. Therefore, a processor having the necessary instructions for implementing the method or method element forms a device for implementing the method or method element. In addition, the elements described herein in the device embodiments are examples of the following devices: the device is used to implement the functions performed by the elements for the purpose of implementing the invention.
[0182] As used herein, unless otherwise specified, the use of ordinal numbers "first", "second", "third", etc. to describe ordinary objects only indicates different instances of similar objects, and does not intend to imply that the objects so described must have a given order in terms of time, space, sorting, or in any other way.
[0183] Although the present invention has been described in terms of a limited number of embodiments, those skilled in the art will appreciate, in light of the above description, that other embodiments can be contemplated within the scope of the invention as thus described. Additionally, it should be noted that the language used in this specification has been principally selected for readability and instructional purposes rather than to limit or define the subject matter of the invention. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. For the scope of the present invention, the disclosure herein is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.
Claims
1. An object position detection method, suitable for detecting the relative position between a first object and a second object, the method comprising: Obtaining a first projection of the first object on a preset plane and a second projection of the second object on the preset plane, wherein both the first projection and the second projection are in the shape of a convex polygon; Based on a preset coordinate system, respectively determining the vertex coordinates of the first projection and the second projection; Generating a plurality of vertex difference vectors according to the vertex coordinates, wherein the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; Determining the relative position between the first object and the second object according to the angles of the plurality of vertex difference vectors; Wherein, among the plurality of circumferences formed by the plurality of vertex difference vectors, the circumference with the smallest central angle is the minimum circumference, and the circumference formed by the plurality of vertex difference vectors is an arc containing the plurality of vertex difference vectors; The step of determining the relative position between the first object and the second object according to the angles of the plurality of vertex difference vectors includes: if the angle of the minimum circumference formed by the plurality of vertex difference vectors is greater than or equal to 180 degrees, then there is a position overlap between the first object and the second object; if the angle of the minimum circumference formed by the plurality of vertex difference vectors is less than 180 degrees, then the positions of the first object and the second object do not overlap.
2. The method according to claim 1, wherein The first object and the second object include furniture, and the preset plane includes the ground.
3. The method according to claim 1 or 2, wherein The step of generating a plurality of vertex difference vectors according to the vertex coordinates includes: Subtracting each vertex coordinate of the first projection from each vertex coordinate of the second projection respectively to generate a plurality of vertex difference vectors.
4. The method according to claim 1 or 2, wherein, If the angle of the minimum circumference formed by the plurality of vertex difference vectors is greater than 180 degrees, then part or all of the regions of the first object and the second object overlap; If the angle of the minimum circumference formed by the plurality of vertex difference vectors is equal to 180 degrees, then one side of the first object and the second object overlaps.
5. The method according to claim 4, wherein Determine the relative size of the angle of the minimum circumference and 180 degrees according to the following steps: Select one of the plurality of vertex difference vectors as the initial vector; Determine the leftmost vector and the rightmost vector from the other vertex difference vectors, wherein the leftmost vector is the vertex difference vector located on the left side of the initial vector and having the largest included angle with the initial vector, and the rightmost vector is the vertex difference vector located on the right side of the initial vector and having the largest included angle with the initial vector; If the leftmost vector is located on the left side of the rightmost vector, then the angle of the minimum circumference is less than 180 degrees; if the leftmost vector is located on the right side of the rightmost vector, then the angle of the minimum circumference is greater than 180 degrees; if the leftmost vector and the rightmost vector are collinear, then the angle of the minimum circumference is 180 degrees.
6. The method according to claim 5, wherein, The leftmost vector and the rightmost vector are determined according to the following steps: Set the initial values of both the leftmost vector and the rightmost vector to the initial vector; Traverse the other vertex difference vectors, and for each vector, perform the following steps to update the leftmost vector and the rightmost vector: If the current vector is to the left of the initial vector and to the left of the leftmost vector, the leftmost vector is updated to the current vector; If the current vector is to the right of the initial vector and to the right of the rightmost vector, the rightmost vector is updated to the current vector.
7. The method according to claim 5, wherein The leftmost vector and the rightmost vector are determined according to the following steps: Determine a left vector set and a right vector set from other vertex difference vectors, wherein the left vector set includes vertex difference vectors located on the left side of the initial vector, and the right vector set includes vertex difference vectors located on the right side of the initial vector; Determining a leftmost vector from the set of left vectors; and A rightmost vector is determined from the set of right vectors.
8. The method according to claim 7, wherein, The step of determining a leftmost vector from the left vector set is performed in parallel with the step of determining a rightmost vector from the right vector set.
9. The method according to any one of claims 5-8, wherein, Use the following method to determine the relative position of two vectors: Calculate the difference between the product of the abscissa of the first vector and the ordinate of the second vector and the product of the ordinate of the first vector and the abscissa of the second vector; If the difference is greater than 0, the second vector is located on the left side of the first vector; If the difference is less than 0, the second vector is located to the right of the first vector; If the difference is equal to 0, the second vector is collinear with the first vector.
10. A furniture position detection method, suitable for detecting the relative position of a first piece of furniture and a second piece of furniture, the method comprising: Obtain a first projection of a first piece of furniture on the ground, and a second projection of a second piece of furniture on the ground, wherein both the first projection and the second projection are convex polygonal shapes; Based on a preset coordinate system, respectively determine vertex coordinates of the first projection and the second projection; Generate a plurality of vertex difference vectors according to the vertex coordinates, wherein the vertex difference vectors are differences between the vertex coordinates of the first projection and the vertex coordinates of the second projection; Determining the relative position of the first furniture and the second furniture according to the angles of the plurality of vertex difference vectors; Among the multiple encircling circles formed by the multiple vertex difference vectors, the encircling circle with the smallest central angle is the minimum encircling circle, and the encircling circle formed by the multiple vertex difference vectors is an arc containing the multiple vertex difference vectors; The step of determining the relative position of the first furniture and the second furniture based on the angles of the multiple vertex difference vectors includes: if the angle of the minimum encirclement formed by the multiple vertex difference vectors is greater than or equal to 180 degrees, then the first furniture and the second furniture overlap in position; if the angle of the minimum encirclement formed by the multiple vertex difference vectors is less than 180 degrees, then the first furniture and the second furniture do not overlap in position.
11. The method of claim 10, wherein: If the angle of the minimum encirclement formed by the plurality of vertex difference vectors is greater than 180 degrees, then the first furniture and the second furniture partially or completely overlap; If the angle of the minimum circumferential enclosure formed by the multiple vertex difference vectors is equal to 180 degrees, one side of the first piece of furniture overlaps with that of the second piece of furniture.
12. The method according to claim 10 or 11, wherein Determine the relative magnitude of the angle of the minimum circumferential enclosure with respect to 180 degrees according to the following steps: Select one of the multiple vertex difference vectors as the initial vector; Determine the leftmost vector and the rightmost vector from the other vertex difference vectors, where the leftmost vector is the vertex difference vector located to the left of the initial vector and having the largest included angle with the initial vector, and the rightmost vector is the vertex difference vector located to the right of the initial vector and having the largest included angle with the initial vector; If the leftmost vector is located to the left of the rightmost vector, the angle of the minimum circumferential enclosure is less than 180 degrees; if the leftmost vector is located to the right of the rightmost vector, the angle of the minimum circumferential enclosure is greater than 180 degrees; if the leftmost vector and the rightmost vector are collinear, the angle of the minimum circumferential enclosure is 180 degrees.
13. A method for detecting a home furnishing object, comprising: For multiple pieces of furniture in a home furnishing space, respectively determine the relative positions of each pair of furniture by using the furniture position detection method according to any one of claims 10-12; Draw a position map of the multiple pieces of furniture according to the relative positions.
14. A method for generating a home furnishing design drawing, comprising: For multiple pieces of furniture in a home furnishing space, respectively determine the relative positions of each pair of furniture by using the furniture position detection method according to any one of claims 10-12; Determine the initial layout of the multiple pieces of furniture in the home furnishing space according to the relative positions; Use a preset layout algorithm to adjust the position of at least one of the multiple pieces of furniture; And Determine the relative positions of each pair of furniture after adjustment, and generate a design drawing of the home furnishing space according to the relative positions.
15. An intelligent home decoration system, comprising an image acquisition device, a user terminal, a design terminal and a server, wherein, The image acquisition device is installed above the ground with the lens facing downwards, and is adapted to acquire a layout drawing of a home furnishing space, and the layout drawing includes multiple pieces of furniture; The user terminal is adapted to obtain the layout drawing and send a design request to the server based on the layout drawing; The server is adapted to respond to the design request, respectively determine the relative positions of each pair of furniture in the layout drawing by using the furniture position detection method according to any one of claims 10-12, and use a preset layout algorithm to adjust the position of at least one of the multiple pieces of furniture based on the determined relative positions to generate an initial design drawing; The design terminal is adapted to adjust the initial design drawing to generate a design drawing, and send the design drawing to the server so that the server can feedback the design drawing to the user terminal.
16. A method for detecting a road traffic state, adapted to detect whether two traffic objects collide to identify a road traffic accident, the traffic objects including vehicles and pedestrians, the method comprising: Obtain a first projection of a first traffic object on the ground and a second projection of a second traffic object on the ground, both the first projection and the second projection being in the shape of a convex polygon; Based on a preset coordinate system, respectively determine the vertex coordinates of the first projection and the second projection; Generate a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; Determine whether the first traffic object and the second traffic object collide according to the angles of the plurality of vertex difference vectors, so as to identify a road traffic accident; Wherein, among the plurality of enclosing circles formed by the plurality of vertex difference vectors, the enclosing circle with the smallest central angle is the minimum enclosing circle, and the enclosing circle formed by the plurality of vertex difference vectors is an arc containing the plurality of vertex difference vectors; The step of determining whether the first traffic object and the second traffic object collide according to the angles of the plurality of vertex difference vectors includes: if the angle of the minimum enclosing circle formed by the plurality of vertex difference vectors is greater than or equal to 180 degrees, then the first traffic object and the second traffic object collide; if the angle of the minimum enclosing circle formed by the plurality of vertex difference vectors is less than 180 degrees, then the first traffic object and the second traffic object do not collide.
17. A method for detecting game objects, suitable for detecting whether two objects in a game screen collide, the method comprising: Obtain a first contour of a first object in a game screen and a second contour of a second object in the game screen, wherein both the first contour and the second contour are in the shape of a convex polygon; Based on a preset coordinate system, respectively determine the vertex coordinates of the first contour and the second contour; Generate a plurality of vertex difference vectors according to the vertex coordinates, where the vertex difference vector is the difference between the vertex coordinates of the first contour and the vertex coordinates of the second contour; Determine whether the first object and the second object collide according to the angles of the plurality of vertex difference vectors; Wherein, among the plurality of enclosing circles formed by the plurality of vertex difference vectors, the enclosing circle with the smallest central angle is the minimum enclosing circle, and the enclosing circle formed by the plurality of vertex difference vectors is an arc containing the plurality of vertex difference vectors; The step of determining whether the first object and the second object collide according to the angles of the plurality of vertex difference vectors includes: if the angle of the minimum enclosing circle formed by the plurality of vertex difference vectors is greater than or equal to 180 degrees, then the first object and the second object collide; if the angle of the minimum enclosing circle formed by the plurality of vertex difference vectors is less than 180 degrees, then the first object and the second object do not collide.
18. An object position detection device, comprising: An object projection acquisition module, suitable for acquiring a first projection of a first object on a preset plane and a second projection of a second object on the preset plane, wherein both the first projection and the second projection are in the shape of a convex polygon; A vertex coordinate determination module, suitable for respectively determining the vertex coordinates of the first projection and the second projection based on a preset coordinate system; An object position calculation module, adapted to generate a plurality of vertex difference vectors according to the vertex coordinates, wherein the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; and Determine the relative position of the first object and the second object according to the angles of the plurality of vertex difference vectors; Wherein, among the plurality of circumferences formed by the plurality of vertex difference vectors, the circumference with the smallest central angle is the minimum circumference, and the circumference formed by the plurality of vertex difference vectors is an arc containing the plurality of vertex difference vectors; The step of the object position calculation module determining the relative position of the first object and the second object according to the angles of the plurality of vertex difference vectors includes: if the angle of the minimum circumference formed by the plurality of vertex difference vectors is greater than or equal to 180 degrees, there is a position overlap between the first object and the second object; if the angle of the minimum circumference formed by the plurality of vertex difference vectors is less than 180 degrees, the positions of the first object and the second object do not overlap.
19. A furniture position detection device, comprising: A furniture projection acquisition module, adapted to acquire a first projection of a first furniture on the ground and a second projection of a second furniture on the ground, wherein both the first projection and the second projection are in the shape of a convex polygon; A vertex coordinate determination module, adapted to respectively determine the vertex coordinates of the first projection and the second projection based on a preset coordinate system; A furniture position calculation module, adapted to generate a plurality of vertex difference vectors according to the vertex coordinates, wherein the vertex difference vector is the difference between the vertex coordinates of the first projection and the vertex coordinates of the second projection; and Determine the relative position of the first furniture and the second furniture according to the angles of the plurality of vertex difference vectors; Wherein, among the plurality of circumferences formed by the plurality of vertex difference vectors, the circumference with the smallest central angle is the minimum circumference, and the circumference formed by the plurality of vertex difference vectors is an arc containing the plurality of vertex difference vectors; The step of the furniture position calculation module determining the relative position of the first furniture and the second furniture according to the angles of the plurality of vertex difference vectors includes: if the angle of the minimum circumference formed by the plurality of vertex difference vectors is greater than or equal to 180 degrees, there is a position overlap between the first furniture and the second furniture; if the angle of the minimum circumference formed by the plurality of vertex difference vectors is less than 180 degrees, the positions of the first furniture and the second furniture do not overlap.
20. A computing device, comprising: At least one processor and a memory storing program instructions; When the program instructions are read and executed by the processor, the computing device is caused to execute at least one of the object position detection method according to any one of claims 1-9, the furniture position detection method according to any one of claims 10-12, the home object detection method according to claim 13, the home design drawing generation method according to claim 14, the road traffic state detection method according to claim 16, and the game object detection method according to claim 17.
21. A readable storage medium storing program instructions, which, when read and executed by a computing device, cause the computing device to execute at least one of the object position detection method according to any one of claims 1-9, the furniture position detection method according to any one of claims 10-12, the home object detection method according to claim 13, the home design drawing generation method according to claim 14, the road traffic state detection method according to claim 16, and the game object detection method according to claim 17.
Citation Information
Patent Citations
Semanteme division method of constructing images from pixels by jointing embeddedness
CN107392254A
Coordinate mapping method and device for projected image in projection equipment and projection equipment
CN108200416A