CN113920250B - House type code matching method and device - Google Patents

House type code matching method and device Download PDF

Info

Publication number
CN113920250B
CN113920250B CN202111229250.9A CN202111229250A CN113920250B CN 113920250 B CN113920250 B CN 113920250B CN 202111229250 A CN202111229250 A CN 202111229250A CN 113920250 B CN113920250 B CN 113920250B
Authority
CN
China
Prior art keywords
vertex
house type
rectangle
loss weight
rectangular
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111229250.9A
Other languages
Chinese (zh)
Other versions
CN113920250A (en
Inventor
刘玉丹
王士玮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong 3vjia Information Technology Co Ltd
Original Assignee
Guangdong 3vjia Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong 3vjia Information Technology Co Ltd filed Critical Guangdong 3vjia Information Technology Co Ltd
Priority to CN202111229250.9A priority Critical patent/CN113920250B/en
Publication of CN113920250A publication Critical patent/CN113920250A/en
Priority to PCT/CN2022/074860 priority patent/WO2023065570A1/en
Application granted granted Critical
Publication of CN113920250B publication Critical patent/CN113920250B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/04Architectural design, interior design
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Geometry (AREA)
  • Computer Graphics (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the application provides a house type code matching method and device, and relates to the technical field of home decoration design. The method comprises the steps of receiving house type geometric data of a house type to be processed, which are input by a user; rectangular decomposition is carried out on the house type geometric data so as to decompose polygons corresponding to the house type geometric data into a plurality of rectangles; taking the center of the main rectangle with the largest area as an origin to acquire the position information of each rectangle, the door and the window; coding according to the position information to obtain a spatial code; the space codes are matched with the existing space codes in the database to obtain the most similar house type, and the house type single space is coded and geometrically matched, so that the similar space can be rapidly screened out, and the problem of poor matching effect of the existing method is solved.

Description

House type code matching method and device
Technical Field
The application relates to the technical field of home decoration design, in particular to a house type code matching method and device.
Background
The home decoration design software generally needs to carry out different scheme designs for different house types. When users have a need to see similar or identical house type related design schemes, designers also want to be able to quickly push to users with excellent schemes of similar house types in the database, thereby improving communication efficiency and promoting billing.
In the prior art, when the same and similar space of the house type is searched from the database, the search cannot be directly performed by using the traditional relational database search method, but the same and similar method is searched, for the house type, the area and the length and width of the main space are focused, the common similarity measurement method is only considered on the vertex position, the area and the length and width are not directly considered, and the overall matching effect is poor.
Disclosure of Invention
The embodiment of the application aims to provide a house type coding matching method, a house type coding matching device, electronic equipment and a storage medium, which are used for coding and geometrically matching house types, so that similar spaces can be screened out rapidly, and the problem of poor matching effect of the existing method is solved.
The embodiment of the application provides a house type code matching method, which comprises the following steps:
receiving the house type geometric data of the house type to be processed, which are input by a user;
rectangular decomposition is carried out on the house type geometric data so as to decompose polygons corresponding to the house type geometric data into a plurality of rectangles;
taking the center of the main rectangle with the largest area as an origin to acquire the position information of each rectangle, the door and the window;
coding according to the position information to obtain a spatial code;
and matching the space codes with the existing space codes in the database to obtain the most similar house type.
In the implementation process, a single space is split into a plurality of rectangles, and the rectangles are encoded according to the length and width plus door and window information and stored in a database; then the same coded house types are rapidly screened by utilizing a database retrieval technology; geometric matching is carried out on the screened house types, so that quick and accurate retrieval of house type single space can be carried out on databases with more than ten millions of levels, and the problem of poor matching effect of the traditional method is solved.
Further, the rectangular decomposition of the house type geometric data is performed to decompose the polygon corresponding to the house type geometric data into a plurality of rectangles, including:
judging whether the vertex number of the polygon is less than or equal to 4;
if not, calculating the loss weight of each vertex to obtain a target vertex with the minimum loss weight;
rectangular clipping is carried out at the target vertex so as to obtain a sub-rectangle;
and storing the sub-rectangle, and updating the polygon to judge the vertex number again.
In the implementation process, the polygon in the single space is split into a main rectangle and a plurality of sub-rectangles by circularly calculating the loss weight.
Further, the calculating the loss weight of each vertex to obtain the target vertex with the minimum loss weight includes:
the area of the rectangle to be cut formed by the current vertex is processed;
judging whether the rectangle to be cut is outside the polygon;
if yes, multiplying the area and taking the multiplied area as the loss weight of the current vertex;
if not, the area is used as the loss weight of the current vertex.
In the implementation process, the rectangular area is used as the loss weight, and when the rectangle to be cut is outside the polygon, the rectangle can be prevented from being cut in a multiplication mode, so that the accuracy of rectangular decomposition is improved.
Further, the calculating the loss weight of each vertex to obtain the target vertex with the minimum loss weight includes:
the calculation formula of the loss weight is as follows:
||P i -P i-1 ||*α+||P i+1 -P i ||*β;
wherein P is i Representing the current vertex, P i-1 And P i+1 Respectively representing two vertexes adjacent to the current vertex of the rectangle to be cut, wherein alpha and beta are preset constants;
judging whether the rectangle to be cut is outside the polygon;
if yes, taking the multiplication value of the calculated value as the loss weight of the current vertex;
if not, taking the calculated value as the loss weight of the current vertex.
In the implementation process, another calculation mode of the loss weight is provided, internal and external judgment is carried out on the rectangle to be cut of each vertex, if the rectangle to be cut is external, multiplication is carried out on the basis of the original loss weight, and therefore the rectangle to be cut is prevented from being cut.
Further, the performing rectangle clipping at the target vertex to obtain a sub rectangle includes:
the position of a fourth vertex corresponding to the target vertex is obtained, and the position is expressed as follows by vectors:
Figure GDA0004100609190000031
wherein P is i-1 And P i+1 Respectively represent and the target vertex P i Two adjacent vertices;
acquisition of the P i-1 ,P i ,P i+1 ,
Figure GDA0004100609190000032
The sub-rectangles are formed and P is deleted in the cyclic sequence of polygons i-1 、P i And P i+1 Three vertexes, and inserted with vertex +.>
Figure GDA0004100609190000033
To update the polygon.
In the implementation process, the sub-rectangle to be cut is determined by calculating the position of the fourth vertex, and the cutting and the updating of the polygon sequence are realized by deleting three existing vertices in the polygon sequence and inserting the fourth vertex.
Further, the encoding according to the position information to obtain spatial encoding includes:
compressing and rounding the length and the width of each rectangle to obtain a corresponding length and width compression value;
generating rectangular codes according to the coding sequence of letters, long compression values, underlines and wide compression values;
compressing and rounding the position coordinates of the door and the window to obtain corresponding coordinate compression values;
generating door and window codes according to coding sequences of letters, abscissa compression values, underlines and ordinate compression values;
and ordering the rectangular codes and the door and window codes according to a preset ordering to generate space codes.
In the implementation process, the main rectangle is taken as the center, all rectangles and doors and windows are encoded, the encoding sequence of the single space can be obtained, and the quick retrieval can be realized by searching the encoding sequence with the same encoding.
Further, the matching the spatial codes with the existing spatial codes in the database to obtain the most similar house types includes:
searching the database to obtain single spaces with the same codes;
calculating the geometrical similarity between the single space and the house type to be processed;
and taking the single space with the minimum geometrical similarity as the most similar house type of the house type to be processed.
In the implementation process, for the single space with the same codes, which is searched, the most similar house type can be determined through the geometric similarity.
Further, the calculating the geometrical similarity between the single space and the to-be-processed house type includes:
sequencing a plurality of rectangles obtained by decomposing the single space and the rectangle of the house to be processed according to the area from large to small to obtain a rectangular sequence;
calculating the geometric similarity of two rectangular sequences:
Figure GDA0004100609190000041
wherein A is i And B i Representing the ith rectangle in the rectangular sequence of single spaces, B i An ith rectangle in the rectangular sequence representing the house type to be processed; m represents the maximum value of the number of rectangles in a single space and the number of rectangles in a to-be-processed house, and the rectangular sequence with the number smaller than M is filled with empty rectangles, wherein the length and width and the coordinate value of each empty rectangle are 0; i A i .xy-B i Xy represents the Euclidean distance of the coordinates; w (w) 0 ,w 1 Respectively representing the size comparison weight and the position comparison weight; width represents the length of the rectangle; height represents the width of the rectangle.
In the implementation process, a calculation method of the geometric similarity is provided, and the method can be used for rapidly and accurately determining the most similar house type.
The embodiment of the application also provides a house type code matching device, which comprises:
the data receiving module is used for receiving the house type geometric data of the house type to be processed, which are input by a user;
the rectangular decomposition module is used for performing rectangular decomposition on the house type geometric data so as to decompose polygons corresponding to the house type geometric data into a plurality of rectangles;
the position information acquisition module is used for acquiring the position information of each rectangle, the door and the window by taking the center of the main rectangle with the largest area as an origin;
the coding module is used for coding according to the position information so as to obtain a space code;
and the matching module is used for matching the space codes with the existing space codes in the database so as to obtain the most similar house type.
In the implementation process, a single space is split into a plurality of rectangles, and the rectangles are encoded according to the length and width plus door and window information and stored in a database; then the same coded house types are rapidly screened by utilizing a database retrieval technology; geometric matching is carried out on the screened house types, so that the house types can be quickly and accurately searched for the databases with more than ten millions of levels, and the problem of poor matching effect of the traditional method is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a house type code matching method provided in an embodiment of the present application;
FIG. 2 is a coding flow chart provided in an embodiment of the present application;
FIG. 3 is a rectangular exploded flow chart provided by an embodiment of the present application;
FIGS. 4 (a), 4 (b) and 4 (c) are each a vertex P provided in embodiments of the present application i Before cutting, rectangular shape to be cut is formed and after cuttingA schematic diagram;
FIG. 5 is a clipping flow chart provided in an embodiment of the present application;
fig. 6 (a) is a schematic diagram of a polygon corresponding to a to-be-processed unit according to an embodiment of the present application;
fig. 6 (b) is a schematic diagram of a sub-rectangle obtained by first rectangle decomposition according to an embodiment of the present application;
FIG. 6 (c) is a schematic diagram of a multiple rectangular exploded view provided in an embodiment of the present application;
fig. 6 (d) is a schematic diagram of a main rectangle obtained after rectangular decomposition according to an embodiment of the present application;
FIG. 7 is a flowchart of generating a single spatial code according to an embodiment of the present application;
FIG. 8 is a code matching flow chart provided in an embodiment of the present application;
fig. 9 is a block diagram of a house type code matching device according to an embodiment of the present application;
fig. 10 is a block diagram of another house type code matching device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a flowchart of a house type code matching method according to an embodiment of the present application. The method is characterized in that the polygons corresponding to the single space are decomposed into a plurality of rectangles, the rectangles and door and window information are encoded, and the most similar house type in the database can be quickly searched through encoding matching, so that the searching efficiency is improved. The whole house type comprises a plurality of single spaces, namely the processing objects are a plurality of multi-deformation, and the processing method is the same as that of the single space (a polygon), and is not repeated here. For single space coding, the method specifically comprises the following steps:
step S100: receiving the house type geometric data of the house type to be processed, which are input by a user;
as shown in fig. 2, in order to implement the coding flow chart, the house type geometric data input by the user includes wall information and door and window information. The wall information is a two-dimensional array of points that forms a closed planar polygon. The gate and window information is another two discrete sets of vertex sequences, each vertex indicating a gate or window at that location.
Therefore, the house type geometry data needs to be preprocessed before rectangular decomposition. In particular, wall polygon data needs to be simplified and denoised.
On the premise of considering only home decoration scenes, the sides of the polygon are composed of horizontal and vertical line segments. I.e. two adjacent edges have only two relationships, vertical or collinear. The purpose of simplification is therefore to ensure that each edge and its two adjacent edges remain in a perpendicular relationship, i.e. the included angle at each vertex is 90 degrees.
Illustratively, for a sequence P of n vertices on a polygon 0 ,P 1 ...,P n-1 The specific simplified process is as follows:
firstly, traversing each vertex in a vertex sequence in turn, and judging whether an included angle where the vertex is located is 90 degrees or not;
if yes, recording the vertex;
if not, namely, a point with an included angle which is not 90 degrees exists, deleting the vertex in the vertex sequence, and updating the vertex sequence; and ending the traversal until no vertex with an included angle which is not 90 degrees exists.
The calculation formula for judging whether the included angle at the vertex is 90 degrees is as follows:
Figure GDA0004100609190000071
/>
and, if |cos (angle) | < ε, the angle can be considered to be 90 degrees.
P i-1 、P i And P i+1 Respectively are provided withRepresenting three adjacent vertices.
By the cosine formula, P is calculated i The cosine value cos (angle) of the included angle is then determined to be zero, and the absolute value of the cosine value cos (angle) is determined to be less than a small value epsilon (typically 0.000001) in consideration of the floating point error.
The polygonal sequence is obtained by simplifying and denoising the house type geometric data, and rectangular decomposition can be carried out on the polygonal sequence.
Step S200: rectangular decomposition is carried out on the house type geometric data so as to decompose polygons corresponding to the house type geometric data into a plurality of rectangles;
as shown in fig. 3, a rectangular exploded flowchart is provided, and the steps may specifically include:
step S210: judging whether the vertex number of the polygon is less than or equal to 4;
step S220: if not, calculating the loss weight of each vertex to obtain a target vertex with the minimum loss weight;
step S230: rectangular clipping is carried out at the target vertex so as to obtain a sub-rectangle;
step S240: and storing the sub-rectangle, and updating the polygon to judge the vertex number again.
For the clipping vertex selection method, the loss weight of each vertex if clipped is calculated, so that the vertex with the minimum loss weight is selected for clipping. There are various methods for calculating the loss weight, and as one embodiment, the area of the rectangle to be clipped, i.e., ||p, may be calculated i -P i-1 ||*||P i+1 -P i To avoid that the cut rectangle is outside the original polygon, the inside and outside of each vertex are judged, if the rectangle is outside the polygon, the rectangle is multiplied by the original loss weight, and the rectangle existing outside the polygon (not part of the polygon) is avoided to be cut by the method of increasing the loss weight.
In another embodiment, P may be i -P i-1 ||*α+||P i+1 -P i β as loss weightWherein α=1.0, β=0.25 is taken, and it is determined whether the rectangle to be clipped is outside the polygon; if yes, taking the multiplication value of the calculated value as the loss weight of the current vertex; if not, taking the calculated value as the loss weight of the current vertex. The multiplication is not limited here.
For clipping, as shown in FIGS. 4 (a), 4 (b) and 4 (c), is the vertex P i Before cutting, rectangle to be cut is formed and schematic diagram after cutting. As shown in fig. 5, a clipping flow chart is shown as follows:
step S231: acquiring a fourth vertex corresponding to the target vertex
Figure GDA0004100609190000081
Is defined by the position of:
Figure GDA0004100609190000082
wherein P is i-1 And P i+1 Respectively represent and the target vertex P i Two adjacent vertices;
step S232: acquisition of the P i-1 ,P i ,P i+1 ,
Figure GDA0004100609190000091
The sub-rectangles are formed and P is deleted in the cyclic sequence of polygons i-1 、P i And P i+1 Three vertices, and at P i-2 And P i+2 Between which vertex is inserted->
Figure GDA0004100609190000092
To update the polygon.
The vertex here is
Figure GDA0004100609190000093
Is located within the polygon.
Through the clipping method, each time, one vertex (the loss weight is the smallest) is selected from the polygon sequence, the angle where the vertex is located is clipped, the polygon sequence is updated, and the process is repeated until only 4 vertices are left in the polygon sequence, as shown in fig. 6 (a), a polygon schematic diagram corresponding to the house type to be processed is shown in fig. 6 (b), and a sub-rectangle schematic diagram obtained by first rectangle decomposition is shown in fig. 6 (b); FIG. 6 (c) is a schematic diagram showing a plurality of rectangular decomposition; fig. 6 (d) is a schematic diagram of a main rectangle obtained by rectangular decomposition.
Step S300: taking the center of the main rectangle with the largest area as an origin to acquire the position information of each rectangle, the door and the window;
after a series of rectangles is obtained, the rectangle with the largest area (typically the last rectangle) is taken as the main rectangle of the space. The center C of the main rectangle is calculated, and the center is taken as the origin of coordinates, so that the new positions of each sub rectangle, each vertex of the original polygon and the door and window can be calculated. The calculation method is to subtract the center coordinates of the main rectangle from the original vertex coordinates to obtain new coordinates.
Step S400: coding according to the position information to obtain a spatial code;
as shown in fig. 7, a flowchart is generated for single space coding, and a specific coding process is as follows:
step S401: compressing and rounding the length and the width of each rectangle to obtain a corresponding length and width compression value;
step S402: generating rectangular codes according to the coding sequence of letters, long compression values, underlines and wide compression values;
step S403: compressing and rounding the position coordinates of the door and the window to obtain corresponding coordinate compression values;
step S404: generating door and window codes according to coding sequences of letters, abscissa compression values, underlines and ordinate compression values;
step S405: and ordering the rectangular codes and the door and window codes according to a preset ordering to generate space codes.
Illustratively, given parameter L 0 、L 1 The section length and the section length of the position, which respectively indicate the size, correspond to the control of the precision of the encoding (the longer the section length, the lower the precision). L (L) 0 Generally 500 meters, equivalent to 0.5 meter(household data is typically in millimeters; l (L) 1 1000 is taken, corresponding to 1 meter.
The length and width W, H of the main rectangle is compressed and rounded (where the length is denoted by W and the width is denoted by H), and the obtained length and width compression value can be expressed as:
Figure GDA0004100609190000101
wherein round represents rounding.
The length-width coding of the main rectangle can be expressed as:
Figure GDA0004100609190000102
for example, a rectangle with a length of 5500mm and a width of 3000mm, after compression
Figure GDA0004100609190000103
11->
Figure GDA0004100609190000104
6, then the rectangle is encoded as "m11_6".
Compressing and rounding the position coordinates x and y of the door and the window to obtain corresponding coordinate compression values:
Figure GDA0004100609190000105
the encoding of a single gate can be expressed as:
Figure GDA0004100609190000106
a single window is similar, replacing the code "D" with "W".
For example, one door is (-380 mm,4250 mm), then after compression
Figure GDA0004100609190000107
Is-4->
Figure GDA0004100609190000108
4. The code of this gate is "D-4_4".
If there are multiple doors and windows and sub-rectangles, the ordering can be performed according to the order from top right to bottom left, or according to the size of the coordinate values, and the ordering rule is not limited in any way.
Illustratively, a main rectangle of one room is 5500mm long and 3000mm wide, with two doors (-3000 mm,1500 mm), (3000 mm,2500 mm), and one window (2750 mm, -1500 mm). Its code is "m11_6d3_2w3_2d3_2".
Step S500: and matching the space codes with the existing space codes in the database to obtain the most similar house type.
As shown in fig. 8, a code matching flow chart is shown, and the specific process is as follows:
step S501: searching the database to obtain single spaces with the same codes;
the codes of a plurality of house types of space are stored in the database, and codes identical to the house types to be processed can be quickly found by searching the existing space codes in the database. If the same code is not found, it is stated that there is necessarily no exactly the same single space in the database.
Step S502: calculating the geometrical similarity between the single space and the house type to be processed;
sequencing a plurality of rectangles obtained by decomposing single space rectangles according to the area from large to small to obtain a rectangular sequence [ A ] 0 ,A 1 ,...,A n-1 ]Sequencing a plurality of rectangles obtained by decomposing the house type rectangles to be processed according to the area from large to small to obtain a rectangular sequence [ B ] 0 ,B 1 ,...,B m-1 ]。
M takes the maximum of M and n of a rectangular sequence. If the length of a certain sequence is less than M, filling empty rectangles after the sequence to make the sequence length be M. The so-called empty rectangle is { width=0, height=0, x=0, y=0 }.
Calculating the geometric similarity of two rectangular sequences:
Figure GDA0004100609190000111
wherein A is i And B i Representing the ith rectangle in the rectangular sequence of single spaces, B i An ith rectangle in the rectangular sequence representing the house type to be processed; i A i .xy-B i Xy represents the Euclidean distance of the coordinates; w (w) 0 ,w 1 Respectively representing the size comparison weight and the position comparison weight; width represents the length of the rectangle; height represents the width of the rectangle.
In house type matching, the size comparison is more important, so w is generally set 0 =1,w 1 The weight parameters may be adjusted as needed, and are not limited herein.
Step S503: and taking the single space with the minimum geometrical similarity as the most similar house type of the house type to be processed.
As long as w 0 ,w 1 All are larger than zero, and the geometric similarity ensures that if a certain single space is identical to the house type to be processed, the measurement value of the single space and the house type to be processed is 0; meanwhile, if the metric value is 0, the space is identical to the type of the household to be processed.
The coding method takes account of wall data (namely polygons) of house types, also door and window position information data, obtains a main rectangle through rectangular decomposition, meets the requirement that the area and the main space length and width are important points for the house types, codes the house types into short character strings through coding process, can search the character strings by utilizing the quick searching capability of a database, achieves the searching effect of tens of millions of house types in second, finds the nearest house type through the calculation process of geometric similarity, and has better matching effect.
In conclusion, a single space is split into a plurality of rectangles, the rectangles are encoded according to the length and the width plus door and window information, and the rectangles are stored in a database; then the same coded house types are rapidly screened by utilizing a database retrieval technology; and performing geometric matching on the screened house types. Therefore, the method can quickly and accurately search the house type bill space of the databases with more than ten millions of levels.
The embodiment of the application also provides a house type space code matching device, as shown in fig. 9, which is a structural block diagram of the house type space code matching device, and the device comprises but is not limited to:
the data receiving module 100 is configured to receive the house type geometric data of the house type to be processed, which is input by the user;
the rectangular decomposition module 200 is configured to perform rectangular decomposition on the house type geometric data, so as to decompose a polygon corresponding to the house type geometric data into a plurality of rectangles;
a position information obtaining module 300, configured to obtain position information of each rectangle, door and window with the center of the main rectangle with the largest area as an origin;
an encoding module 400, configured to encode according to the location information to obtain a spatial encoding;
and the matching module 500 is configured to match the spatial code with an existing spatial code in the database to obtain a most similar household type.
As shown in fig. 10, there is a block diagram of another house type code matching device, wherein a rectangular decomposition module 200 includes:
the judgment module 210: judging whether the vertex number of the polygon is less than or equal to 4;
the loss weight calculation module 220: if not, calculating the loss weight of each vertex to obtain a target vertex with the minimum loss weight;
clipping module 230: rectangular clipping is carried out at the target vertex so as to obtain a sub-rectangle;
update module 240: and storing the sub-rectangle, and updating the polygon to judge the vertex number again.
The cropping module 230 includes:
vertex acquisition module 231: acquiring a fourth vertex corresponding to the target vertex
Figure GDA0004100609190000131
Is defined by the position of:
Figure GDA0004100609190000132
wherein P is i-1 And P i+1 Respectively represent and the target vertex P i Two adjacent vertices;
deletion module 232: acquisition of the P i-1 ,P i ,P i+1 ,
Figure GDA0004100609190000133
The sub-rectangles are formed and P is deleted in the cyclic sequence of polygons i-1 、P i And P i+1 Three vertices, and at P i-2 And P i+2 Between which vertex is inserted->
Figure GDA0004100609190000134
To update the polygon.
The encoding module 400 includes:
the first compression module 401: compressing and rounding the length and the width of each rectangle to obtain a corresponding length and width compression value;
rectangular encoding module 402: generating rectangular codes according to the coding sequence of letters, long compression values, underlines and wide compression values;
the second compression module 403: compressing and rounding the position coordinates of the door and the window to obtain corresponding coordinate compression values;
door and window encoding module 404: generating door and window codes according to coding sequences of letters, abscissa compression values, underlines and ordinate compression values;
the sorting module 405: and ordering the rectangular codes and the door and window codes according to a preset ordering to generate space codes.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the memory is used for storing a computer program, and the processor runs the computer program to enable the electronic equipment to execute the house type code matching method.
The embodiment of the application also provides a readable storage medium, wherein the readable storage medium stores computer program instructions, and the computer program instructions execute the house type code matching method when being read and run by a processor.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application, and various modifications and variations may be suggested to one skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (9)

1. A house type code matching method, characterized in that the method comprises:
receiving the house type geometric data of the house type to be processed, which are input by a user;
rectangular decomposition is carried out on the house type geometric data so as to decompose polygons corresponding to the house type geometric data into a plurality of rectangles;
taking the center of the main rectangle with the largest area as an origin to acquire the position information of each rectangle, the door and the window;
coding according to the position information to obtain a spatial code;
matching the space code with the existing space code in the database to obtain the most similar house type;
the rectangular decomposition is performed on the house type geometric data to decompose the polygon corresponding to the house type geometric data into a plurality of rectangles, and the rectangular decomposition comprises the following steps:
judging whether the vertex number of the polygon is less than or equal to 4;
if not, calculating the loss weight of each vertex to obtain a target vertex with the minimum loss weight, wherein the loss weight of each vertex can be calculated through the area of a rectangle to be cut formed by the vertices, or through a loss weight calculation formula formed by two adjacent vertexes of the vertex on the rectangle to be cut;
rectangular clipping is carried out at the target vertex so as to obtain a sub-rectangle;
and storing the sub-rectangle, and updating the polygon to judge the vertex number again.
2. The house type code matching method according to claim 1, wherein before the step of performing rectangular decomposition on the house type geometric data to decompose a polygon corresponding to the house type geometric data into a plurality of rectangles, the method further comprises preprocessing the house type geometric data:
traversing each vertex of the polygon vertex sequence of the house type geometric data in sequence, and judging whether the included angle of the vertex is 90 degrees or not;
if yes, recording the vertex;
if not, deleting the vertex from the vertex sequence, updating the vertex sequence until no vertex with an included angle of not 90 degrees exists, and ending the traversal;
the calculation formula for judging whether the included angle at the vertex is 90 degrees is as follows:
Figure QLYQS_1
wherein P is i-1 、P i And P i+1 Respectively represent three adjacent vertexes, if |cos (angle) |<And epsilon, wherein the included angle is 90 degrees, and epsilon is a preset constant.
3. The house type code matching method according to claim 1, wherein said calculating the loss weight of each vertex to obtain a target vertex with a minimum loss weight comprises:
the area of the rectangle to be cut formed by the current vertex is processed;
judging whether the rectangle to be cut is outside the polygon;
if yes, multiplying the area and taking the multiplied area as the loss weight of the current vertex;
if not, the area is used as the loss weight of the current vertex.
4. The house type code matching method according to claim 1, wherein said calculating the loss weight of each vertex to obtain a target vertex with a minimum loss weight comprises:
the calculation formula of the loss weight is as follows:
||P i -P i-1 ||*α+||P i+1 -P i ||*β;
wherein P is i Representation ofCurrent vertex, P i-1 And P i+1 Respectively representing two vertexes adjacent to the current vertex of the rectangle to be cut, wherein alpha and beta are preset constants;
judging whether the rectangle to be cut is outside the polygon;
if yes, taking the multiplication value of the calculated value as the loss weight of the current vertex;
if not, taking the calculated value as the loss weight of the current vertex.
5. The house type code matching method according to claim 1, wherein said performing rectangle clipping at the target vertex to obtain a sub-rectangle comprises:
the position of a fourth vertex corresponding to the target vertex is obtained, and the position is expressed as follows by vectors:
Figure QLYQS_2
wherein P is i-1 And P i+1 Respectively represent and the target vertex P i Two adjacent vertices;
acquisition of the data from
Figure QLYQS_3
The sub-rectangles are formed and P is deleted in the cyclic sequence of polygons i-1 、P i And P i+1 Three vertexes, and inserted with vertex +.>
Figure QLYQS_4
To update the polygon.
6. The house type code matching method according to claim 1, wherein said coding according to the position information to obtain a spatial code comprises:
compressing and rounding the length and the width of each rectangle to obtain a corresponding length and width compression value;
generating rectangular codes according to the coding sequence of letters, long compression values, underlines and wide compression values;
compressing and rounding the position coordinates of the door and the window to obtain corresponding coordinate compression values;
generating door and window codes according to coding sequences of letters, abscissa compression values, underlines and ordinate compression values;
and ordering the rectangular codes and the door and window codes according to a preset ordering to generate space codes.
7. The method for matching household patterns according to claim 1, wherein the matching with the existing spatial codes in the database by using the spatial codes to obtain the most similar household patterns comprises:
searching the database to obtain single spaces with the same codes;
calculating the geometrical similarity between the single space and the house type to be processed;
and taking the single space with the minimum geometrical similarity as the most similar house type of the house type to be processed.
8. The method for matching house types according to claim 7, wherein the calculating the geometrical similarity between the single space and the house types to be processed comprises:
sequencing a plurality of rectangles obtained by decomposing the single space and the rectangle of the house to be processed according to the area from large to small to obtain a rectangular sequence;
calculating the geometric similarity of two rectangular sequences:
Figure QLYQS_5
wherein A is i Representing the ith rectangle in the rectangular sequence of single spaces, B i An ith rectangle in the rectangular sequence representing the house type to be processed; m represents the maximum value of the number of rectangles in a single space and the number of rectangles in the type of the room to be processed, and the rectangular sequence with the number less than M is filled with empty rectangles, whereinThe length and width of the empty rectangle and the coordinate value are 0; i A i .xy-B i Xy represents the Euclidean distance of the coordinates; w (w) 0 ,w 1 Respectively representing the size comparison weight and the position comparison weight; width represents the length of the rectangle; height represents the width of the rectangle.
9. A house type code matching device, characterized in that the device comprises:
the data receiving module is used for receiving the house type geometric data of the house type to be processed, which are input by a user;
the rectangular decomposition module is used for performing rectangular decomposition on the house type geometric data so as to decompose polygons corresponding to the house type geometric data into a plurality of rectangles;
the position information acquisition module is used for acquiring the position information of each rectangle, the door and the window by taking the center of the main rectangle with the largest area as an origin;
the coding module is used for coding according to the position information so as to obtain a space code;
the matching module is used for matching the space codes with the existing space codes in the database to obtain the most similar house type;
wherein, the rectangle decomposition module includes:
the judging module is used for judging whether the vertex number of the polygon is smaller than or equal to 4;
the loss weight calculation module is used for calculating the loss weight of each vertex if the loss weight is larger than 4 so as to obtain a target vertex with the minimum loss weight, wherein the loss weight of each vertex can be calculated through the area of a rectangle to be cut formed by the vertex or through a loss weight calculation formula formed by two adjacent vertexes of the vertex on the rectangle to be cut;
the clipping module is used for clipping the rectangle at the target vertex to obtain a sub rectangle;
and the updating module is used for storing the sub-rectangles and updating the polygons so as to re-judge the vertex numbers.
CN202111229250.9A 2021-10-21 2021-10-21 House type code matching method and device Active CN113920250B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111229250.9A CN113920250B (en) 2021-10-21 2021-10-21 House type code matching method and device
PCT/CN2022/074860 WO2023065570A1 (en) 2021-10-21 2022-01-29 House type coding and matching method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111229250.9A CN113920250B (en) 2021-10-21 2021-10-21 House type code matching method and device

Publications (2)

Publication Number Publication Date
CN113920250A CN113920250A (en) 2022-01-11
CN113920250B true CN113920250B (en) 2023-05-23

Family

ID=79242291

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111229250.9A Active CN113920250B (en) 2021-10-21 2021-10-21 House type code matching method and device

Country Status (2)

Country Link
CN (1) CN113920250B (en)
WO (1) WO2023065570A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113920250B (en) * 2021-10-21 2023-05-23 广东三维家信息科技有限公司 House type code matching method and device
CN117252869B (en) * 2023-11-15 2024-03-12 江西少科智能建造科技有限公司 CAD drawing wall path information extraction method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110223302A (en) * 2019-05-08 2019-09-10 华中科技大学 A kind of naval vessel multi-target detection method extracted based on rotary area
CN111062973A (en) * 2019-12-31 2020-04-24 西安电子科技大学 Vehicle tracking method based on target feature sensitivity and deep learning

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7925982B2 (en) * 2006-09-01 2011-04-12 Cheryl Parker System and method of overlaying and integrating data with geographic mapping applications
US20190212977A1 (en) * 2018-01-08 2019-07-11 Facebook, Inc. Candidate geographic coordinate ranking
CN110096964B (en) * 2019-04-08 2021-05-04 厦门美图之家科技有限公司 Method for generating image recognition model
CN109992693A (en) * 2019-04-17 2019-07-09 广东三维家信息科技有限公司 House type matching process and device
CN111400519B (en) * 2019-12-05 2022-08-12 江苏艾佳家居用品有限公司 Efficient customized massive similar house type searching method
CN111461190B (en) * 2020-03-24 2023-03-28 华南理工大学 Deep convolutional neural network-based non-equilibrium ship classification method
CN111598972B (en) * 2020-04-03 2021-06-29 深圳大学 House type graph generation method and device, computer equipment and storage medium
CN113920250B (en) * 2021-10-21 2023-05-23 广东三维家信息科技有限公司 House type code matching method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110223302A (en) * 2019-05-08 2019-09-10 华中科技大学 A kind of naval vessel multi-target detection method extracted based on rotary area
CN111062973A (en) * 2019-12-31 2020-04-24 西安电子科技大学 Vehicle tracking method based on target feature sensitivity and deep learning

Also Published As

Publication number Publication date
WO2023065570A1 (en) 2023-04-27
CN113920250A (en) 2022-01-11

Similar Documents

Publication Publication Date Title
CN113920250B (en) House type code matching method and device
US8457400B2 (en) Patch-based texture histogram coding for fast image similarity search
Zaslavski Algorithms for solving common fixed point problems
KR101183391B1 (en) Image comparison by metric embeddings
CN100388279C (en) Method and device for measuring visual similarity
EP2887262B1 (en) Point Cloud Simplification
Galvanin et al. Extraction of building roof contours from LiDAR data using a Markov-random-field-based approach
CN114245896A (en) Vector query method and device, electronic equipment and storage medium
CN109241442B (en) Project recommendation method based on predictive value filling, readable storage medium and terminal
CN107844602B (en) Prediction method based on spatio-temporal attribute association rule
Farr et al. An efficient interpolation technique for jump proposals in reversible-jump Markov chain Monte Carlo calculations
Cunial et al. A framework for space-efficient variable-order Markov models
Vaddadi et al. Read mapping on genome variation graphs
CN115443657A (en) Nearest neighbor searching method, encoder, decoder and storage medium
Böhm et al. Ric: Parameter-free noise-robust clustering
CN1185060A (en) Method and apparatus for compression of electronic ink
Pantaleoni Importance sampling of many lights with reinforcement lightcuts learning
Djordjevic et al. Detecting regular visit patterns
Reznik et al. Analysis of random point images with the use of symbolic computation codes and generalized Catalan numbers
Ohtake et al. Multi-scale and adaptive CS-RBFS for shape reconstruction from clouds of points
CN113407786A (en) Euclidean distance-based measurement spatial index construction method and device and related equipment
Templ et al. Robust imputation of missing values in compositional data using the R-package robCompositions
Dax et al. Trajectory similarity using compression
CN114730474A (en) Point cloud processing method, encoder, decoder, and storage medium
CN112948620B (en) Image indexing method and device, electronic equipment and storage medium thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant