CN113920250A - Household code matching method and device - Google Patents

Household code matching method and device Download PDF

Info

Publication number
CN113920250A
CN113920250A CN202111229250.9A CN202111229250A CN113920250A CN 113920250 A CN113920250 A CN 113920250A CN 202111229250 A CN202111229250 A CN 202111229250A CN 113920250 A CN113920250 A CN 113920250A
Authority
CN
China
Prior art keywords
rectangle
house type
vertex
rectangles
codes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111229250.9A
Other languages
Chinese (zh)
Other versions
CN113920250B (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 user type geometric data of a user type to be processed, which are input by a user; performing rectangle decomposition on the house type geometric data to decompose a polygon 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 obtain 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 spatial codes with the existing spatial codes in the database to obtain the most similar house type, and coding and geometrically matching the single house type space, so that the similar space can be quickly screened out, and the problem of poor matching effect of the existing method is solved.

Description

Household 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 different scheme designs for different house types. When a user has a need to see related design schemes of similar or identical house types, the designer also wants to be able to quickly push the excellent schemes of similar house types to the user in the database, thereby improving communication efficiency and promoting ordering.
In the prior art, when searching for the same and similar household space from a database, the traditional relational database searching method cannot be directly used for searching, but the same and similar method is searched, the area and the main space length and width are the key points of concern for the household, and a general similarity measurement method only considers the vertex position and does not directly consider the area and the length and width, so that the overall matching effect is poor.
Disclosure of Invention
An object of the embodiments of the present application is to provide a house type code matching method, apparatus, electronic device and storage medium, which perform coding and geometric matching on house types, so as to quickly screen out similar spaces, thereby solving the problem of poor matching effect of the existing method.
The embodiment of the application provides a house type code matching method, which comprises the following steps:
receiving the geometric data of the house type to be processed, which is input by a user;
performing rectangle decomposition on the house type geometric data to decompose a polygon 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 obtain 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 spatial codes with the existing spatial codes in the database to obtain the most similar house types.
In the implementation process, a single space is divided into a plurality of rectangles, the rectangles are added with door and window information according to the length and the width, coding is carried out, and the coded rectangles are stored in a database; rapidly screening house types with the same codes by utilizing a database retrieval technology; and performing geometric matching on the screened house types, so that the database of more than ten million levels can be quickly and accurately searched for the house type single space, and the problem of poor matching effect of the existing method is solved.
Further, the performing rectangle decomposition on the house type geometric data to decompose a polygon corresponding to the house type geometric data into a plurality of rectangles includes:
judging whether the number of the vertexes 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;
performing rectangle clipping at the target vertex to obtain a sub-rectangle;
and storing the sub-rectangles, and updating the polygons to judge the number of the top points again.
In the implementation process, the polygon in the single space is divided into the main rectangle and the plurality of sub-rectangles in a mode of 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 a rectangle to be cut formed by the current vertex is determined;
judging whether the rectangle to be clipped is outside the polygon;
if so, multiplying the area by value and taking the area as the loss weight of the current vertex;
and if not, taking the area as the loss weight of the current vertex.
In the implementation process, the area of the rectangle is used as the loss weight, and when the rectangle to be clipped is outside the polygon, the rectangle can be prevented from being clipped in a multiplication mode, so that the accuracy of rectangle 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:
||Pi-Pi-1||*α+||Pi+1-Pi||*β;
wherein, PiRepresenting said current vertex, Pi-1And Pi+1Respectively representing two vertexes of the rectangle to be clipped, which are adjacent to the current vertex, wherein alpha and beta are preset constants;
judging whether the rectangle to be clipped is outside the polygon;
if so, taking the multiplication value of the calculated value as the loss weight of the current vertex;
and if not, taking the calculated value as the loss weight of the current vertex.
In the implementation process, another calculation method of the loss weight is given, the inside and outside judgment is performed on the rectangle to be clipped of each vertex, and if the inside and outside judgment is performed, the inside and outside judgment is multiplied on the basis of the original loss weight so as to avoid clipping the rectangle to be clipped.
Further, the performing rectangle clipping at the target vertex to obtain a sub-rectangle includes:
and acquiring the position of a fourth vertex corresponding to the target vertex, and expressing the position as follows by using a vector:
Figure BDA0003315394170000031
wherein, Pi-1And Pi+1Respectively represent the target vertex PiTwo adjacent vertices;
get by Pi-1,Pi,Pi+1,
Figure BDA0003315394170000032
Sub-rectangles formed and P deleted in the cyclic sequence of polygonsi-1、PiAnd Pi+1Three vertexes and inserting the vertexes correspondingly
Figure BDA0003315394170000033
To update the polygon.
In the implementation process, the position of the fourth vertex is calculated to determine the sub-rectangle to be clipped, and clipping and updating of the polygon sequence are implemented by deleting three existing vertices in the polygon sequence and inserting the fourth vertex.
Further, the encoding according to the position information to obtain a spatial encoding includes:
compressing and rounding the length and width of each rectangle to obtain a corresponding length and width compression value;
generating a rectangular code according to the coding sequence of the letters, the long compression values, the underlines and the wide compression values;
compressing and rounding the position coordinates of the door and the window to obtain a corresponding coordinate compression value;
generating door and window codes according to the coding sequence of letters, horizontal coordinate compression values, underlines and vertical coordinate compression values;
and sequencing the rectangular codes and the door and window codes according to a preset sequence to generate the space codes.
In the implementation process, the main rectangle is used as the center, each rectangle and each door and window are coded, the coding sequence of the single space can be obtained, and quick retrieval can be realized by searching the coding sequence with the same code.
Further, the matching with the existing spatial codes in the database by using the spatial codes to obtain the most similar house types comprises:
searching the database to obtain a single space with the same code;
calculating the geometric similarity between the single space and the house type to be processed;
and taking the single space with the minimum geometric similarity as the most similar house type of the house types to be processed.
In the implementation process, for the searched single space with the same codes, the most similar house type can be determined through the geometric similarity.
Further, the calculating the geometric similarity between the single space and the house type to be processed includes:
sorting a plurality of rectangles obtained by decomposing the single space and the house type rectangle to be processed respectively according to the area from large to small to obtain a rectangle sequence;
the geometric similarity of two rectangular sequences is calculated:
Figure BDA0003315394170000041
wherein A isiAnd BiThe ith rectangle in the sequence of rectangles representing the single space, BiThe ith rectangle in the rectangle sequence representing the house type to be processed; m represents the maximum value of the number of rectangles of the single space and the number of rectangles of the house type to be processed, and the rectangle sequences with the number smaller than M are filled with empty rectangles, and the length, the width and the coordinate values of the empty rectangles are both 0; | | Ai.xy-BiXy | | | represents the euclidean distance of the coordinates; w is a0,w1The size comparison weight and the position comparison weight are respectively expressed.
In the implementation process, a calculation method of the geometric similarity is provided, and the method can be used for quickly and accurately determining the most similar house type.
The embodiment of the present application further provides a device for matching house type codes, where the device includes:
the data receiving module is used for receiving the geometric data of the house type to be processed, which is input by a user;
the rectangle decomposition module is used for performing rectangle 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;
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 to obtain a spatial code;
and the matching module is used for matching the space codes with the existing space codes in the database to obtain the most similar house types.
In the implementation process, a single space is divided into a plurality of rectangles, the rectangles are added with door and window information according to the length and the width, coding is carried out, and the coded rectangles are stored in a database; rapidly screening house types with the same codes 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 databases of more than ten million levels, and the problem that the matching effect of the existing method is poor is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used 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 therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a flowchart of a subscriber pattern matching method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of encoding provided by an embodiment of the present application;
FIG. 3 is a flow chart of rectangular decomposition provided by an embodiment of the present application;
FIGS. 4(a), 4(b) and 4(c) are respectively the vertices P provided in the embodiments of the present applicationiBefore cutting, a rectangle to be cut is formed and a schematic diagram after cutting;
FIG. 5 is a flow chart of cropping provided by an embodiment of the present application;
fig. 6(a) is a schematic view of a polygon corresponding to a to-be-processed house type according to an embodiment of the present application;
fig. 6(b) is a schematic diagram of sub-rectangles obtained by the first rectangle decomposition according to the embodiment of the present application;
FIG. 6(c) is a schematic diagram of an embodiment of the present application after multiple rectangular decompositions;
FIG. 6(d) is a schematic diagram of a main rectangle obtained by decomposition of a rectangle provided in the 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 flowchart of code matching provided in an embodiment of the present application;
fig. 9 is a block diagram illustrating a configuration of a house type code matching apparatus according to an embodiment of the present application;
fig. 10 is a block diagram of another subscriber pattern matching apparatus 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 numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a flowchart illustrating a subscriber pattern matching method according to an embodiment of the present disclosure. The method can rapidly search the most similar house types in the database by decomposing the polygon corresponding to the single space into a plurality of rectangles, coding the rectangles and door and window information and matching the codes, thereby improving the searching efficiency. The whole house type includes a plurality of single spaces, i.e. 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 described herein again. For single space coding, the method specifically comprises the following steps:
step S100: receiving the geometric data of the house type to be processed, which is input by a user;
as shown in fig. 2, the encoding flow chart shows that the house type geometric data input by the user includes wall information and door and window information. The wall information is a two-dimensional point array which forms a closed plane polygon. The door and window information is then another two sets of discrete sequences of vertices, each vertex indicating that there is a door or window at that location.
Therefore, the house type geometry data needs to be preprocessed before the rectangular decomposition is performed. In particular, simplification and denoising of wall volume polygon data are required.
On the premise of only considering the home decoration scene, the sides of the polygon are all composed of horizontal and vertical line segments. Namely, two adjacent edges have only two relations of being vertical or collinear. The purpose of simplification is therefore to ensure that each edge remains in perpendicular relation to its two adjacent edges, i.e. the angle at each vertex is 90 degrees.
Illustratively, for the sequence of n vertices P on a polygon0,P1...,Pn-1The specific simplification process is as follows:
firstly, sequentially traversing each vertex in a vertex sequence, and judging whether an included angle of the vertex is 90 degrees or not;
if yes, recording the vertex;
if not, namely a point with an included angle not being 90 degrees exists, deleting the vertex in the vertex sequence, and updating the vertex sequence; and ending the traversal until no vertex with the included angle not being 90 degrees exists.
The calculation formula for judging whether the included angle at the vertex is 90 degrees is as follows:
Figure BDA0003315394170000071
if | cos (angle) | < ε, the angle can be regarded as 90 degrees.
Pi-1、PiAnd Pi+1Respectively representing three adjacent vertices.
Calculating P by the cosine formulaiThe cosine value cos (angle) of the included angle is determined, and then whether the cosine value is equal to zero is determined, wherein the zero is determined that the absolute value is smaller than a smaller value epsilon (generally 0.000001) in consideration of the floating point error.
The polygon sequence is obtained by simplifying and denoising the house type geometric data, and the rectangle decomposition can be carried out on the polygon sequence.
Step S200: performing rectangle decomposition on the house type geometric data to decompose a polygon corresponding to the house type geometric data into a plurality of rectangles;
as shown in fig. 3, which is a rectangular decomposition flowchart, the steps may specifically include:
step S210: judging whether the number of the vertexes 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: performing rectangle clipping at the target vertex to obtain a sub-rectangle;
step S240: and storing the sub-rectangles, and updating the polygons to judge the number of the top points again.
The method for selecting the clipping vertex mainly calculates the loss weight of each vertex if clipping, so as to select the vertex with the minimum loss weight 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 calculatedi-Pi-1||*||Pi+1-PiAnd if the rectangle is outside the polygon, the number of the rectangles is multiplied on the basis of the original loss weight, and the loss weight is increased, so that the rectangles outside the polygon (not belonging to a part of the polygon) are prevented from being clipped.
Alternatively, P can be expressed in Pi-Pi-1||*α+||Pi+1-PiTaking | β as a loss weight, wherein α is 1.0, β is 0.25, and determining whether the rectangle to be clipped is outside the polygon; if so, taking the multiplication value of the calculated value as the loss weight of the current vertex; and if not, taking the calculated value as the loss weight of the current vertex. The multiplication factor is not limited here.
For the clipping process, as shown in FIGS. 4(a), 4(b), and 4(c), the vertex P isiBefore cutting, the rectangle to be cut is formed and a schematic diagram after cutting. As shown in fig. 5, a clipping flowchart is shown as follows:
step S231: obtaining a fourth vertex corresponding to the target vertex
Figure BDA0003315394170000083
The position of (2):
Figure BDA0003315394170000081
wherein, Pi-1And Pi+1Respectively represent the target vertex PiTwo adjacent vertices;
step S232: get by Pi-1,Pi,Pi+1,
Figure BDA0003315394170000082
Sub-rectangles formed and P deleted in the cyclic sequence of polygonsi-1、PiAnd Pi+1Three vertices and at Pi-2And Pi+2Between corresponding to insert the vertex
Figure BDA0003315394170000092
To update the polygon.
It should be noted that the vertex here
Figure BDA0003315394170000091
Within the polygon.
By the clipping method, each time a vertex is selected from the polygon sequence (with the smallest loss weight), the corner where the vertex is located is clipped, the polygon sequence is updated, and the process is repeated until only 4 vertices remain in the polygon sequence, as shown in fig. 6(a), the polygon sequence is a polygon schematic diagram corresponding to the house type to be processed, and as shown in fig. 6(b), the sub-rectangle schematic diagram is obtained by first rectangular decomposition; FIG. 6(c) is a schematic diagram after multiple rectangular decomposition; FIG. 6(d) is a schematic diagram of a main rectangle obtained by decomposition of a rectangle.
Step S300: taking the center of the main rectangle with the largest area as an origin to obtain 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 used as the main rectangle of the space. The center C of the main rectangle is calculated, and the new positions of each sub-rectangle, each vertex of the original polygon and the door and the window can be calculated by taking the center as the origin of coordinates. The calculation method is that the original vertex coordinates subtract the central coordinates of the main rectangle 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 the single space encoding, and the specific encoding process is as follows:
step S401: compressing and rounding the length and width of each rectangle to obtain a corresponding length and width compression value;
step S402: generating a rectangular code according to the coding sequence of the letters, the long compression values, the underlines and the wide compression values;
step S403: compressing and rounding the position coordinates of the door and the window to obtain a corresponding coordinate compression value;
step S404: generating door and window codes according to the coding sequence of letters, horizontal coordinate compression values, underlines and vertical coordinate compression values;
step S405: and sequencing the rectangular codes and the door and window codes according to a preset sequence to generate the space codes.
Exemplarily, a parameter L is given0、L1The length of each of the sections indicating the size and the length of each of the sections indicating the position correspond to the accuracy control of the encoding (the accuracy decreases as the length of each of the sections is longer). L is0Typically 500, corresponding to 0.5 meters (typical dimensions of house data are in millimeters); l is1Then 1000 is taken, corresponding to 1 meter.
By rounding the width and length W, H of the main rectangle (where the width and length are denoted by H), the resulting width and length compression value can be expressed as:
Figure BDA0003315394170000101
wherein round means rounding.
The length and width encoding of the master rectangle can be expressed as:
Figure BDA0003315394170000102
for example, a rectangle 5500mm in length and 3000mm in width, then after compression
Figure BDA0003315394170000103
In the range of 11, the number of the main chain,
Figure BDA0003315394170000104
is 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 a corresponding coordinate compression value:
Figure BDA0003315394170000105
the coding of a single gate can be expressed as:
Figure BDA0003315394170000106
the single window is similar, and the code "D" is replaced by "W".
For example, a door position of (-3800mm,4250mm), then compressed
Figure BDA0003315394170000107
The content of the compound is-4,
Figure BDA0003315394170000108
is 4. Then the code for the gate is "D-4 _ 4".
If a plurality of doors and windows and sub-rectangles exist, the sequencing can be carried out according to the sequence from top right to bottom left, or according to the size of the coordinate value, and the sequencing rule is not limited at all.
Illustratively, a main rectangle of a room is 5500mm long and 3000mm wide, with two doors (-3000mm,1500mm), (3000mm,2500mm), and a window (2750mm, -1500 mm). Then its encoding is "M11 _6D3_2W3_ -2D3_ 2".
Step S500: and matching the spatial codes with the existing spatial codes in the database to obtain the most similar house types.
As shown in fig. 8, a flow chart of code matching is specifically described as follows:
step S501: searching the database to obtain a single space with the same code;
the database stores the codes of a plurality of house type spaces, and the codes which are the same as the house type to be processed can be quickly found by searching the existing space codes in the database. If the same code cannot be found, it means that there is not a completely same single space in the database.
Step S502: calculating the geometric similarity between the single space and the house type to be processed;
sorting a plurality of rectangles obtained by decomposing the single-space rectangle according to the area from large to small to obtain a rectangle sequence [ A0,A1,...,An-1]Sorting a plurality of rectangles obtained by decomposing the house type rectangle to be processed from large to small according to the area to obtain a rectangle sequence [ B0,B1,...,Bm-1]。
M takes the maximum of M and n of the rectangular sequence. If the length of a certain sequence is smaller than M, filling an empty rectangle after the sequence to make the length of the sequence be M. The empty rectangle is { width is 0, height is 0, x is 0, and y is 0 }.
The geometric similarity of two rectangular sequences is calculated:
Figure BDA0003315394170000111
wherein A isiAnd BiThe ith rectangle in the sequence of rectangles representing the single space, BiThe ith rectangle in the rectangle sequence representing the house type to be processed; | | Ai.xy-BiXy | | | represents the euclidean distance of the coordinates; w is a0,w1The size comparison weight and the position comparison weight are respectively expressed.
In house-type matching, the size ratio is more important, and therefore, w is generally set0=1,w1The weight parameter may be adjusted as needed, and is not limited herein.
Step S503: and taking the single space with the minimum geometric similarity as the most similar house type of the house types to be processed.
As long as w0,w1The geometric similarity ensures that the measurement value of a certain single space and the measurement value of the to-be-processed house type are 0 if the two space and the house type are completely the same; meanwhile, it is ensured that if the metric value is 0, the space is completely the same as the house type to be processed.
The coding method considers wall data (namely polygons) of house types and door and window position information data, obtains a main rectangle through rectangle decomposition, meets the requirement that the area and the main space length are key points of concern for the house types, codes the house types into short character strings through a coding process, can search the character strings by utilizing the quick search capability of a database, achieves the search effect of tens of millions of house types per second, finds the closest house type through the calculation process of geometric similarity, and has better matching effect.
In conclusion, a single space is divided into a plurality of rectangles, the rectangles are encoded according to the length and the width and door and window information, and the encoded rectangles are stored in a database; rapidly screening house types with the same codes 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 single space of the database with more than ten million levels.
An embodiment of the present application further provides a device for matching house type codes, as shown in fig. 9, which is a block diagram of a device for matching house type spatial codes, and the device includes but is not limited to:
a data receiving module 100, configured to receive user geometry data of a to-be-processed user type input by a user;
a rectangle decomposition module 200, configured to perform rectangle 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 a center of the main rectangle having the largest area as an origin;
an encoding module 400, configured to perform encoding according to the position information to obtain a spatial code;
and the matching module 500 is used for matching the spatial codes with the existing spatial codes in the database to obtain the most similar house types.
As shown in fig. 10, it is a block diagram of another subscriber pattern code matching apparatus, wherein the rectangular decomposition module 200 includes:
the judging module 210: judging whether the number of the vertexes of the polygon is less than or equal to 4;
loss weight calculation module 220: if not, calculating the loss weight of each vertex to obtain a target vertex with the minimum loss weight;
the cropping module 230: performing rectangle clipping at the target vertex to obtain a sub-rectangle;
the update module 240: and storing the sub-rectangles, and updating the polygons to judge the number of the top points again.
The cropping module 230 includes:
the vertex fetch module 231: obtaining a fourth vertex corresponding to the target vertex
Figure BDA0003315394170000121
The position of (2):
Figure BDA0003315394170000131
wherein, Pi-1And Pi+1Respectively represent the target vertex PiTwo adjacent vertices;
the deletion module 232: get by Pi-1,Pi,Pi+1,
Figure BDA0003315394170000132
Sub-rectangles formed and P deleted in the cyclic sequence of polygonsi-1、PiAnd Pi+1Three vertices and at Pi-2And Pi+2Between corresponding to insert the vertex
Figure BDA0003315394170000133
To update the polygon.
The encoding module 400 includes:
the first compression module 401: compressing and rounding the length and width of each rectangle to obtain a corresponding length and width compression value;
the rectangular encoding module 402: generating a rectangular code according to the coding sequence of the letters, the long compression values, the underlines and the wide compression values;
the second compression module 403: compressing and rounding the position coordinates of the door and the window to obtain a corresponding coordinate compression value;
door window coding module 404: generating door and window codes according to the coding sequence of letters, horizontal coordinate compression values, underlines and vertical coordinate compression values;
the sorting module 405: and sequencing the rectangular codes and the door and window codes according to a preset sequence to generate the space codes.
An embodiment of the present application further provides an electronic device, where the electronic device includes a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to make the electronic device execute the user pattern code matching method in the foregoing description.
The embodiment of the present application further provides a readable storage medium, where computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the user type code matching method is executed.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart 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, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent 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 or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the 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 conceive of the changes or substitutions within the technical scope of the present application, and shall 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, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A house type code matching method, the method comprising:
receiving the geometric data of the house type to be processed, which is input by a user;
performing rectangle decomposition on the house type geometric data to decompose a polygon 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 obtain 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 spatial codes with the existing spatial codes in the database to obtain the most similar house types.
2. The house type code matching method according to claim 1, wherein before the step of performing a rectangular decomposition on the house type geometry data to decompose a polygon corresponding to the house type geometry data into a plurality of rectangles, the method further comprises preprocessing the house type geometry data:
sequentially traversing each vertex of the polygon vertex sequence of the house type geometric data, 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 different from 90 degrees exists, and ending traversal;
the calculation formula for judging whether the included angle at the vertex is 90 degrees is as follows:
Figure FDA0003315394160000011
wherein, Pi-1、PiAnd Pi+1Respectively representing three adjacent vertexes, if | cos (angle) | < epsilon, 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 performing a rectangular decomposition on the house type geometry data to decompose a polygon corresponding to the house type geometry data into a plurality of rectangles comprises:
judging whether the number of the vertexes 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;
performing rectangle clipping at the target vertex to obtain a sub-rectangle;
and storing the sub-rectangles, and updating the polygons to judge the number of the top points again.
4. The pattern matching method according to claim 3, wherein said calculating the loss weight of each vertex to obtain the target vertex with the minimum loss weight comprises:
the area of a rectangle to be cut formed by the current vertex is determined;
judging whether the rectangle to be clipped is outside the polygon;
if so, multiplying the area by value and taking the area as the loss weight of the current vertex;
and if not, taking the area as the loss weight of the current vertex.
5. The pattern matching method according to claim 3, wherein said calculating the loss weight of each vertex to obtain the target vertex with the minimum loss weight comprises:
the calculation formula of the loss weight is as follows:
||Pi-Pi-1||*α+||Pi+1-Pi||*β;
wherein, PiRepresenting said current vertex, Pi-1And Pi+1Respectively representing two vertexes of the rectangle to be clipped, which are adjacent to the current vertex, wherein alpha and beta are preset constants;
judging whether the rectangle to be clipped is outside the polygon;
if so, taking the multiplication value of the calculated value as the loss weight of the current vertex;
and if not, taking the calculated value as the loss weight of the current vertex.
6. The house type code matching method of claim 3, wherein the rectangular clipping at the target vertex to obtain a sub-rectangle comprises:
and acquiring the position of a fourth vertex corresponding to the target vertex, and expressing the position as follows by using a vector:
Figure FDA0003315394160000021
wherein, Pi-1And Pi+1Respectively represent the target vertex PiTwo adjacent vertices;
get by Pi-1,Pi,Pi+1,
Figure FDA0003315394160000031
Sub-rectangles formed and P deleted in the cyclic sequence of polygonsi-1、PiAnd Pi+1Three vertexes and inserting the vertexes correspondingly
Figure FDA0003315394160000032
To update the polygon.
7. The house type code matching method according to claim 1, wherein said encoding according to the position information to obtain a spatial code comprises:
compressing and rounding the length and width of each rectangle to obtain a corresponding length and width compression value;
generating a rectangular code according to the coding sequence of the letters, the long compression values, the underlines and the wide compression values;
compressing and rounding the position coordinates of the door and the window to obtain a corresponding coordinate compression value;
generating door and window codes according to the coding sequence of letters, horizontal coordinate compression values, underlines and vertical coordinate compression values;
and sequencing the rectangular codes and the door and window codes according to a preset sequence to generate the space codes.
8. The house type code matching method of claim 1, wherein the matching with the existing spatial codes in the database by using the spatial codes to obtain the most similar house type comprises:
searching the database to obtain a single space with the same code;
calculating the geometric similarity between the single space and the house type to be processed;
and taking the single space with the minimum geometric similarity as the most similar house type of the house types to be processed.
9. The house type code matching method according to claim 8, wherein said calculating the geometric similarity between the single space and the house type to be processed comprises:
sorting a plurality of rectangles obtained by decomposing the single space and the house type rectangle to be processed respectively according to the area from large to small to obtain a rectangle sequence;
the geometric similarity of two rectangular sequences is calculated:
Figure FDA0003315394160000033
wherein A isiAnd BiThe ith rectangle in the sequence of rectangles representing the single space, BiThe ith rectangle in the rectangle sequence representing the house type to be processed; m represents the maximum value of the number of rectangles of the single space and the number of rectangles of the house type to be processed, and the rectangle sequences with the number smaller than M are filled with empty rectangles, and the length, the width and the coordinate values of the empty rectangles are both 0; | | Ai.xy-BiXy | | | represents the euclidean distance of the coordinates; w is a0,w1The size comparison weight and the position comparison weight are respectively expressed.
10. A house type code matching apparatus, comprising:
the data receiving module is used for receiving the geometric data of the house type to be processed, which is input by a user;
the rectangle decomposition module is used for performing rectangle 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;
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 to obtain a spatial code;
and the matching module is used for matching the space codes with the existing space codes in the database to obtain the most similar house types.
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 true CN113920250A (en) 2022-01-11
CN113920250B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023065570A1 (en) * 2021-10-21 2023-04-27 广东三维家信息科技有限公司 House type coding and matching method and apparatus

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117252869B (en) * 2023-11-15 2024-03-12 江西少科智能建造科技有限公司 CAD drawing wall path information extraction method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080059889A1 (en) * 2006-09-01 2008-03-06 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
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
CN111400519A (en) * 2019-12-05 2020-07-10 江苏艾佳家居用品有限公司 Efficient customized massive similar house type searching method
CN111461190A (en) * 2020-03-24 2020-07-28 华南理工大学 Deep convolutional neural network-based non-equilibrium ship classification method
CN111598972A (en) * 2020-04-03 2020-08-28 深圳大学 House type graph generation method and device, computer equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN113920250B (en) * 2021-10-21 2023-05-23 广东三维家信息科技有限公司 House type code matching method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080059889A1 (en) * 2006-09-01 2008-03-06 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
CN110223302A (en) * 2019-05-08 2019-09-10 华中科技大学 A kind of naval vessel multi-target detection method extracted based on rotary area
CN111400519A (en) * 2019-12-05 2020-07-10 江苏艾佳家居用品有限公司 Efficient customized massive similar house type searching method
CN111062973A (en) * 2019-12-31 2020-04-24 西安电子科技大学 Vehicle tracking method based on target feature sensitivity and deep learning
CN111461190A (en) * 2020-03-24 2020-07-28 华南理工大学 Deep convolutional neural network-based non-equilibrium ship classification method
CN111598972A (en) * 2020-04-03 2020-08-28 深圳大学 House type graph generation method and device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023065570A1 (en) * 2021-10-21 2023-04-27 广东三维家信息科技有限公司 House type coding and matching method and apparatus

Also Published As

Publication number Publication date
WO2023065570A1 (en) 2023-04-27
CN113920250B (en) 2023-05-23

Similar Documents

Publication Publication Date Title
CN113920250B (en) House type code matching method and device
US9171158B2 (en) Dynamic anomaly, association and clustering detection
US9245382B2 (en) User-guided surface reconstruction
CN114631118A (en) Tailoring search spaces for nearest neighbor determination in point cloud compression
CN100388279C (en) Method and device for measuring visual similarity
EP2887262B1 (en) Point Cloud Simplification
CN109241442B (en) Project recommendation method based on predictive value filling, readable storage medium and terminal
CN108694411B (en) Method for identifying similar images
Cunial et al. A framework for space-efficient variable-order Markov models
CN115443657A (en) Nearest neighbor searching method, encoder, decoder and storage medium
Mäkinen et al. Algorithms for transposition invariant string matching
Pantaleoni Importance sampling of many lights with reinforcement lightcuts learning
Djordjevic et al. Detecting regular visit patterns
Li et al. Computing Longest Increasing Subsequence Over Sequential Data Streams
Grandin Data structures and algorithms for high-dimensional structured adaptive mesh refinement
Venkat et al. A Succinct, Dynamic Data Structure for Proximity Queries on Point Sets.
CN114730474A (en) Point cloud processing method, encoder, decoder, and storage medium
Kim et al. Probabilistic cost model for nearest neighbor search in image retrieval
Jang et al. Progressive vector compression for high-accuracy vector map data
Hermes et al. Boundary-constrained agglomerative segmentation
Reinbold et al. Parameterized splitting of summed volume tables
Tahaei et al. Geometric algorithm for dominant point extraction from shape contour
CN117312471B (en) Sea-land attribute judging method and device for massive position points
Jiang Set operations between linear octrees
CN108897746B (en) Image retrieval method

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