Interactive room planar graph extraction method and system based on image recognition
By combining a room recognition method based on YOLO transfer learning and human-computer interaction with a graph theory ring detection algorithm, the problem of low efficiency and insufficient accuracy in the conversion of planar diagrams to 3D models in existing technologies is solved, and efficient and accurate modeling of non-rectangular structures is achieved.
Patent Information
- Application Number
- CN202511774111.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-13
AI Technical Summary
Existing technologies cannot simultaneously meet the requirements of strictly matching the image scale of room outlines in interior floor plans, processing curves and non-rectangular polygonal structures, ensuring outline closure, and efficient connection modeling, resulting in long design cycles and insufficient accuracy.
A room recognition model based on YOLO transfer learning is adopted, combined with human-computer interaction correction and graph theory loop detection algorithms. Through feature point fitting and bounding box priority setting, the room outline is accurately extracted and 3D modeled.
It achieves efficient and accurate conversion from 2D drawings to 3D models, breaking through the limitations of traditional manual drawing and existing algorithms, improving efficiency and accuracy, adapting to non-rectangular structures and ensuring contour closure.
Smart Images

Figure CN121527320A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, specifically relating to an interactive room floor plan extraction method and system based on image recognition. Background Technology
[0002] In fields such as architectural design, interior decoration, and 3D scene positioning, extracting room outlines from interior floor plans and converting them into models is a fundamental step in bringing designs to life. Traditionally, this process relies on manual drawing: designers must trace the room boundaries point by point in modeling software, referring to the floor plan. This is not only slow and inefficient, but also makes it difficult to strictly ensure that the outline matches the original proportions of the input image, leading to discrepancies between the subsequent model and the actual drawings, requiring repeated adjustments.
[0003] With the development of computer vision technology, object detection algorithms, represented by YOLO, are increasingly being used for the initial extraction of room outlines. These algorithms can quickly identify room areas in floor plans and return rectangular bounding boxes, shortening the time for obtaining the initial outline compared to manual drawing. However, the application of existing detection algorithms has significant limitations: on the one hand, the bounding boxes they output are only a rough outline of the room, not the vector graphics required for engineering, and are easily affected by noise lines in the floor plan (such as scan noise, irrelevant annotation lines, and interference lines formed by local stains), leading to bounding box offsets, missed identification of small rooms, or misinclusion of non-room areas (such as corridor corners and equipment annotation areas). These deviations need to be corrected manually one by one, increasing the workload. On the other hand, these algorithms cannot directly identify common non-rectangular structures in floor plans (such as curved walls and polygonal rooms), still requiring manual supplementary drawing, which lacks flexibility. At the same time, the recognition results of detection algorithms may have deviations (such as bounding box offsets), and there is a lack of convenient correction mechanisms, making it difficult to adapt to the accuracy requirements of actual designs.
[0004] Furthermore, neither traditional manual drawing nor existing detection algorithms can guarantee the "absolute closure" and "modeling continuity" of the room outline: the room outline needs to form a closed loop to be used for 3D modeling, but manual drawing is prone to vertex misalignment, and the bounding box generated by the detection algorithm also needs additional processing to close; moreover, the extracted outline often needs to be manually converted into a modelable format, which cannot be directly connected to the subsequent modeling process, further extending the design cycle.
[0005] In summary, existing technologies cannot simultaneously meet the requirements of "strictly matching image proportions", "handling curves and non-rectangular polygonal structures", "ensuring contour closure" and "efficiently connecting modeling". Summary of the Invention
[0006] To address the problems existing in the prior art, this invention provides an interactive room floor plan extraction method, device, system, and storage medium based on image recognition. Through geometric optimization and closed loop detection, it enables rapid and accurate room extraction and modeling of indoor floor plans.
[0007] To achieve the above objectives, the present invention provides the following solution: An interactive floor plan room extraction method based on image recognition, comprising: Based on YOLO pre-trained model, a room recognition model for indoor floor plan is constructed by transfer learning to infer and recognize the room's rectangular bounding box from the input floor plan. Based on the input image and the room rectangular bounding boxes, rooms that were missed or misdetected are corrected, so that the misaligned bounding boxes are aligned and snapped according to custom rules to obtain a neatly arranged rectangular image. In the visualization interface, select the feature points or corner points of the curved wall, fit the curved wall with a cubic spline curve, and retain the selected feature points or corner points; in the visualization interface, select the endpoints of the straight wall and / or the vertices of the polygon, and connect them in sequence to form a polygonal outline; take the line segments of the fitted curve and the edges of the polygonal outline as the edges of the graph, take the endpoints of each line segment as the nodes of the graph, and use the cycle detection algorithm in graph theory to analyze the connection relationship between the above edges and nodes to obtain the basic cycle; Based on the outline information of the rectangle and the outline information of the base ring, the wall is stretched and the floor is filled to obtain a three-dimensional room model.
[0008] As a preferred approach, a custom room dataset is constructed, a YOLO pre-trained model is loaded for transfer learning, and a YOLO model best.pt is obtained for room recognition in floor plans. The input indoor floor plan is then inferred and recognized using the model best.pt to obtain the rectangular bounding boxes of most rooms.
[0009] As a preferred method, missed / false detection rooms are corrected through human-computer interaction. Priority boundary reference boxes are set, and the boundary boxes are aligned and snapped together according to the rule that "the reference box has the highest priority, and the priority of the remaining boundary boxes decreases from left to right and from top to bottom". This results in a neatly arranged rectangular image. As a preferred method, based on the rectangle outline information and the base ring outline information, the data is converted into a .dxf format vector image through coordinate mapping and exported. The wall extrusion and floor filling are then performed using FreeCAD to obtain a three-dimensional room model.
[0010] The present invention also provides an interactive floor plan room extraction system based on image recognition, comprising: The first processing module is used to perform transfer learning based on the YOLO pre-trained model, build a room recognition model for indoor floor plans, and infer and recognize the input floor plan to obtain the room's rectangular bounding box. The second processing module is used to correct missed or misdetected rooms based on the input image and the room rectangular bounding boxes, so that the misaligned box bounding boxes are aligned and snapped according to custom rules to obtain a neatly arranged rectangular image. The third processing module is used to select feature points or corner points of the curved wall in the visualization interface, fit the curved wall with a cubic spline curve, and retain the selected feature points or corner points; select the endpoints of the straight wall and / or the vertices of the polygon in the visualization interface, and connect them in sequence to form a polygon outline; take the line segments of the fitted curve and the edges of the polygon outline as the edges of the graph, take the endpoints of each line segment as the nodes of the graph, and use the cycle detection algorithm in graph theory to analyze the connection relationship between the above edges and nodes to obtain the basic cycle; The fourth processing module is used to obtain a three-dimensional room model by stretching the walls and filling the floor based on the outline information of the rectangle and the outline information of the base ring.
[0011] As a preferred embodiment, the first processing module is used to construct a custom room dataset, load a YOLO pre-trained model for transfer learning, and obtain a YOLO model best.pt for room recognition in floor plans. The model best.pt is used to perform inference recognition on the input indoor floor plan to obtain the rectangular bounding boxes of most rooms.
[0012] Preferably, the second processing module is used to correct missed / false detection rooms through human-computer interaction, setting priority boundary reference boxes, and aligning and snapping the boundary boxes according to the rule that "the reference box has the highest priority, and the priority of other boundary boxes decreases from left to right and from top to bottom", resulting in a neatly arranged rectangular image. Preferably, the fourth processing module is used to convert the rectangular outline information and the base ring outline information into a vector graphic in .dxf format through coordinate mapping and export it, and then use FreeCAD to perform wall extrusion and floor filling to obtain a three-dimensional room model.
[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention provides an interactive floor plan room extraction method based on image recognition. Through a collaborative mechanism of "YOLO transfer learning for initial recognition + human-computer interaction and visualization correction," it ensures high efficiency in initial room contour extraction through algorithms, while accurately compensating for recognition deviations and strictly guaranteeing the proportional consistency between the room contour and the original image through bounding box priority settings and snapping alignment rules. Furthermore, it employs "feature point selection + cubic spline fitting" for curved walls and "vertex selection + sequential connection" for polygonal rooms, overcoming the limitation of traditional object detection algorithms that can only recognize rectangular rooms. It flexibly adapts to non-rectangular building structures such as curved walls and polygons; combined with graph theory loop detection algorithms to ensure the absolute closure of room outlines, and exports .dxf vector graphics through coordinate mapping, and directly completes wall extrusion and floor filling based on FreeCAD, realizing a "one-stop" process connection from 2D images to 3D models. It effectively solves the problems of low efficiency and large scale deviation of traditional manual drawing, as well as the poor adaptability of existing target detection algorithms to non-rectangular structures and insufficient outline closure and modeling connection. It greatly improves the efficiency and accuracy of converting interior floor plans into 3D models and has good engineering application value. Attached Figure Description
[0014] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a flowchart of the interactive room floor plan extraction method based on image recognition according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the result of rectangular alignment adsorption and ring detection of the input image provided in the embodiment of the present invention; Figure 3 This is a schematic diagram of a three-dimensional room layout output by the method of the present invention from an input image provided in an embodiment of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0018] Example 1 like Figure 1 As shown, this invention provides an interactive room floor plan extraction method based on image recognition, comprising: A. Construct a custom room dataset, load a YOLO pre-trained model for transfer learning, and obtain the YOLO model best.pt for room recognition in floor plans. Use the model best.pt to infer and recognize the input indoor floor plan, and obtain the rectangular bounding boxes of most rooms.
[0019] B. Use the interface to visualize the input image and interactive information (box boundaries) to correct missed or incorrectly detected rooms. Select the boundary reference box, set the movement threshold, and make the misaligned box boundaries align and snap according to custom rules to obtain a neatly arranged rectangle.
[0020] C. In the above visualization interface, select feature points (such as inflection points, control points) or corner points of the curved wall, and fit the curved wall with a cubic spline curve, while retaining the selected feature points or corner points (ensuring that the selected points are located on the fitted curve); in the above visualization interface, select the endpoints of the straight wall and / or the vertices of the polygon, and connect them in sequence to form a polygon outline; take the line segments of the fitted curve and the edges of the polygon outline as the edges of the graph, and take the endpoints of each line segment as the nodes of the graph, and use the cycle detection algorithm in graph theory to analyze the connection relationship between the above edges and nodes to obtain the basic cycle.
[0021] D. Based on the rectangular outline information obtained in step B and the base ring outline information obtained in step C, convert them into vector graphics in .dxf format through coordinate mapping and export them. Use the open-source library FreeCAD to perform wall extrusion and floor filling to obtain a three-dimensional room model.
[0022] Step A specifically involves: a1. Collect 100 interior architectural floor plans, use labelme to annotate the room outlines (rectangles and polygons) to obtain the dataset; a2. Convert the above dataset from COCO to YOLO format on the Roboflow platform, and package the dataset into training set, test set and validation set according to the proportions; a3. Load the yolov8s-seg.pt pre-trained model, customize the image enhancement strategy, perform transfer learning, and obtain the customized room recognition model best.pt; a4. Input the indoor building floor plan to be detected, and return the prediction results as room bounding boxes, where the coordinates of the boxes are in pixels of the input image.
[0023] Step B specifically involves: b1. Use a visualization interface to create a visualization interface that displays the original image, the bounding box from step a4, and the subsequent selection of points and polygon information; b2. In the visualization interface, select the outermost reference box for use as a reference for bounding box alignment and snapping; b3. In the visualization interface, select the missed rectangular rooms to add new bounding boxes, and select the incorrectly detected bounding boxes to delete them; b4. Create rules: Set priorities for all bounding boxes (including the reference box described in b2 and the new bounding box described in b3), with the reference box having the highest priority. The priorities of other bounding boxes decrease from left to right and from top to bottom. Low-priority bounding boxes are aligned and snapped to high-priority bounding boxes to obtain neatly arranged rectangular outlines.
[0024] Step C specifically involves: c1. Select the feature points (such as inflection points, control points) or corner points of the curved wall in the visualization interface; c2. Import the scipy.interpolate library and use make_interp_spline to perform cubic spline curve fitting on the selected points mentioned in c1. Use polygonal line segments for approximation to obtain the fitted curve. c3. Select the endpoints of the straight wall and / or the vertices of the polygon in the visualization interface; c4. Connect the endpoints and vertices described in c3 in sequence, mark the intersections, and obtain the line segments and / or polygonal outlines; c5. Take the line segments of the fitted curve described in c2 and the straight line segments and polygon contours described in c4 as the edges of the graph, and take the endpoints and intersections of each line segment as the nodes of the graph. Use the cycle detection algorithm in graph theory to analyze the connection relationship between the above edges and nodes, and process to obtain the basic cycle.
[0025] Step D specifically involves: d1. Organize the rectangular contour information obtained in step b4 and the base loop contour information obtained in step c5; d2. In the visualization interface, select the origin, select a side of the reference box for length calibration, and calculate the scaling ratio k between the pixel length and the world length; d3. Import the ezdxf library, create a .dxf format file, perform coordinate mapping on the contour information described in d1 to convert it into a .dxf format vector graphic, and export it; d4. Import the FreeCAD library, scale the room dimensions proportionally to scale k, stretch the walls to a specified height and fill the floor with a specified thickness based on the outline information described in d1, and export the room model in 3D format.
[0026] The alignment and adsorption described in step b4 are divided into two stages: Phase 1: Traverse each rectangle and check its positional relationship with the reference box. If the intersection-union ratio (IU) exceeds a certain threshold, it is considered an illegal rectangle outside the reference box and is deleted. If the distance between a side of a rectangle and a side of the reference box is less than a certain threshold, move the rectangle so that that side coincides with a side of the reference box. This achieves the goal of snapping the rectangle to the reference frame; Phase 2: Traverse each rectangle and its edges from the top left to the bottom right, checking their positional relationship with high-priority edges. If the projections overlap and the distance is within the threshold, they are aligned and snapped to become high-priority edges, thus achieving the goal of snapping and aligning the inner rectangles.
[0027] The ring detection algorithm described in step c5 is as follows: c5.1. Topology Construction: Let the input set of line segments be... Each line segment Composed of a point sequence, extract consecutive point pairs of line segments and construct a node-adjacent node mapping table Adj: for Any continuous pair of points in Record the bidirectional connection between p and q in Adj. ; c5.2. Loop detection based on Adj using Depth-First Search (DFS): Start DFS for node v and trace the path. ( If the traversal reaches the node If u ≠ parent node, then extract the child path. To form a closed loop ( (index of u in P), filter The rings constitute the original set of rings. ; c5.3. Ring Standardization and Deduplication: For Take the core point column (Remove duplicate endpoints) and convert to an edge set. ;by Using a unique identifier, duplicate edge sets are removed to obtain a list of unique cycle edge sets. ; c5.4. Effective ring screening: Sort by |E| in descending order, for each Calculate the union of all other ring edge sets. ( For the retained rings, (for unprocessed rings), if Then E is retained in the set of valid rings. ; c5.5. Point sequence restoration: For Traverse the edge set to restore the ordered list of points The set of valid cycle points is obtained, which is the base cycle.
[0028] This embodiment takes the extraction of rooms and 3D modeling of a ship's floor plan as an example, and applies the method to the rapid extraction and 3D modeling of rooms inside a ship.
[0029] A custom room dataset was constructed, consisting of interior floor plans of residential buildings. A YOLO pre-trained model was loaded and transferred to obtain the YOLO model best.pt for room recognition. The best.pt model was used to infer and recognize the rectangular bounding boxes of most rooms from the input residential floor plans. Specifically, 100 residential floor plans were collected, and the room outlines were annotated using LabelMe to obtain the dataset. The dataset was then converted from COCO to YOLO format on the Roboflow platform, and the dataset was packaged into training, test, and validation sets according to the specified proportions. The yolov8s-seg.pt pre-trained model was loaded, and a customized image enhancement strategy was implemented for transfer learning to obtain the customized room recognition model best.pt. The residential floor plan to be detected was input, and the prediction results were returned as room bounding boxes, where the coordinates of the boxes were in pixels of the input image.
[0030] Using a user interface to visualize the input image and interactive information, this method corrects missed or incorrectly detected rooms. Boundary reference boxes are selected, and movement thresholds are set. This allows misaligned bounding boxes to align and snap to each other according to custom rules, resulting in neatly arranged rectangles. First, a visualization interface is created to display the original image, the obtained bounding boxes, and subsequent point selection and polygon information. The outermost reference box is selected in the visualization interface for bounding box alignment and snapping. Missed rectangular rooms are selected to add new bounding boxes, and incorrectly detected bounding boxes are selected to delete them. Rules are created: all bounding boxes are prioritized, with the reference box having the highest priority. Other bounding boxes have decreasing priority from left to right and top to bottom. Lower-priority bounding boxes align and snap to higher-priority bounding boxes, resulting in neatly arranged rectangular outlines. Alignment and snapping are divided into two stages: Stage 1: Traverse each rectangle, check its positional relationship with the reference box, handle illegal rectangles, and snap the rectangles to the reference box; Stage 2: Traverse each rectangle and its edges, snapping and aligning the internal rectangles. The final rectangle alignment and snapping result is shown below. Figure 2 As shown.
[0031] In the visualization interface, select the feature points or corner points of the curved wall, fit the curved wall with a cubic spline curve, and retain the selected feature points or corner points; in the visualization interface, select the endpoints of the straight wall and / or the vertices of the polygon, and connect them in sequence to form a polygon outline; take the line segments of the fitted curve and the edges of the polygon outline as the edges of the graph, and take the endpoints of each line segment as the nodes of the graph, and use the cycle detection algorithm in graph theory to analyze the connection relationship of the above edges and nodes to obtain the basic cycle. In practice, first, select the feature points or corner points of the curved wall in the visualization interface; import the scipy.interpolate library and use make_interp_spline to fit the selected points with a cubic spline curve, approximating with polygonal line segments to obtain the fitted curve; select the endpoints and / or vertices of the straight wall in the visualization interface; connect the endpoints and vertices in sequence, mark the intersections, and obtain the straight line segments and / or polygonal contours; use the edges of the fitted curve's line segments, straight line segments, and polygonal contours as the edges of the graph, and the endpoints and intersections of each line segment as the nodes of the graph; use the cycle detection algorithm in graph theory to analyze the connectivity, and process to obtain the basic cycle. The cycle detection process includes topology construction, depth-first search-based cycle detection, cycle standardization and deduplication, effective cycle screening, and point sequence restoration. The final obtained basic cycle is as follows: Figure 2 As shown.
[0032] Based on the obtained rectangular and base ring contour information, the data is converted into a .dxf format vector image through coordinate mapping and exported. The wall extrusion and floor filling are then performed using the open-source library FreeCAD to obtain a 3D room model. First, the obtained rectangular and base ring contour information is organized. In the visualization interface, the origin is selected, and a side of the reference frame is selected for length calibration. The scaling ratio of pixel length to world length is calculated. The ezdxf library is imported, a .dxf format file is created, and the contour information is converted into a .dxf format vector image through coordinate mapping and exported. The FreeCAD library is then imported, and the room dimensions are scaled proportionally. Wall extrusion to a specified height and floor filling to a specified thickness are performed on the contour information, exporting the result as a 3D room model. The final output 3D room layout is shown below. Figure 3 As shown.
[0033] This embodiment achieves rapid extraction and 3D modeling of the interior rooms of a ship through the above steps. In the traditional mode, extracting room outlines from interior floor plans relies on manual drawing, which is slow, inefficient, and makes it difficult to ensure that the outlines are consistent with the original proportions of the input image, resulting in deviations between the subsequent model and the actual drawings. Existing object detection algorithms, such as YOLO, can quickly identify room areas and return rectangular bounding boxes, but the output bounding boxes are only a rough outline of the room, not the vector graphics required for engineering, are easily affected by noise lines, cannot directly identify non-rectangular structures, lack convenient correction mechanisms, and are difficult to balance the "absolute closure" and "modeling continuity" of the room outlines. This invention employs a collaborative mechanism of "YOLO transfer learning for initial recognition + human-computer interaction for visual correction." It leverages algorithms to ensure efficient extraction of the initial room outline, compensates for recognition deviations through bounding box priority settings and snap-in alignment rules, and guarantees consistency between the outline and the original image proportions. Corresponding processing methods are used for curved walls and polygonal rooms, overcoming the limitations of traditional object detection algorithms. Combined with graph theory ring detection algorithms, it ensures absolute outline closure. Coordinate mapping is used to export .dxf vector graphics, and FreeCAD is used to complete wall extrusion and floor filling, achieving a "one-stop" workflow from planar images to 3D models. This effectively solves the problems of traditional manual drawing and existing object detection algorithms, significantly improving the efficiency and accuracy of converting interior floor plans into 3D models, and possesses significant engineering application value.
[0034] Example 2 The present invention also provides an interactive room floor plan extraction system based on image recognition, comprising: The first processing module is used to perform transfer learning based on the YOLO pre-trained model, build a room recognition model for indoor floor plans, and infer and recognize the input floor plan to obtain the room's rectangular bounding box. The second processing module is used to correct missed or misdetected rooms based on the input image and the room rectangular bounding boxes, so that the misaligned box bounding boxes are aligned and snapped according to custom rules to obtain a neatly arranged rectangular image. The third processing module is used to select feature points or corner points of the curved wall in the visualization interface, fit the curved wall with a cubic spline curve, and retain the selected feature points or corner points; select the endpoints of the straight wall and / or the vertices of the polygon in the visualization interface, and connect them in sequence to form a polygon outline; take the line segments of the fitted curve and the edges of the polygon outline as the edges of the graph, take the endpoints of each line segment as the nodes of the graph, and use the cycle detection algorithm in graph theory to analyze the connection relationship between the above edges and nodes to obtain the basic cycle; The fourth processing module is used to obtain a three-dimensional room model by stretching the walls and filling the floor based on the outline information of the rectangle and the outline information of the base ring.
[0035] As one embodiment of the present invention, the first processing module is used to construct a custom room dataset, load a YOLO pre-trained model for transfer learning, obtain a YOLO model best.pt for room recognition in floor plans, and perform inference recognition on the input indoor floor plan using the model best.pt to obtain the rectangular bounding boxes of most rooms.
[0036] In one embodiment of the present invention, the second processing module is used to correct missed / false detection rooms through human-computer interaction, setting priority boundary reference boxes, and aligning and snapping the boundary boxes according to the rule that "the reference box has the highest priority, and the priority of the remaining boundary boxes decreases from left to right and from top to bottom" to obtain a neatly arranged rectangular image. As one embodiment of the present invention, the fourth processing module is used to convert the rectangular outline information and the base ring outline information into a vector graphic in .dxf format through coordinate mapping and export it, and then use FreeCAD to perform wall extrusion and floor filling to obtain a three-dimensional room model.
[0037] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. An image recognition based interactive floorplan room extraction method, characterized in that, The method comprises the following steps: Based on the YOLO pre-trained model, transfer learning is performed to construct a room recognition model for indoor floor plan, and inference recognition is performed on the input floor plan to obtain a room rectangular boundary box; According to the input image and the room rectangular boundary box, the missed or misdetected room is corrected, so that the misaligned box boundary frame is aligned and adsorbed according to the self-defined rule, and a rectangular graph with neat arrangement is obtained; In the visualization interface, the feature points or corner points of the curved wall are selected, and the curved wall is fitted using a cubic spline curve, and the selected feature points or corner points are retained; in the above-mentioned visualization interface, the end points of the straight line wall and / or the vertices of the polygon are selected, and the polygon contour is sequentially connected; the line segment of the fitted curve and the edge of the polygon contour are taken as the edges of the graph, and the end points of each line segment are taken as the nodes of the graph, and the connection relationship of the edges and nodes is analyzed by using the loop detection algorithm in graph theory, and a base ring is obtained by processing. According to the rectangular graph contour information and the base ring contour information, the wall is stretched and the floor is filled to obtain a three-dimensional room model.
2. The image recognition based interactive floorplan room extraction method of claim 1, wherein, A self-defined room data set is constructed, a YOLO pre-trained model is loaded for transfer learning, a YOLO model best.pt for room recognition of a floor plan is obtained, and inference recognition is performed on an input indoor floor plan by using the model best.pt to obtain a rectangular boundary box of most rooms.
3. The image recognition based interactive floorplan room extraction method of claim 2, wherein, Through human-computer interaction, the missed / misdetected room is corrected, a boundary reference frame with priority is set, and the boundary frame is aligned and adsorbed according to the rule that "the reference frame has the highest priority, and the remaining boundary frames have decreasing priority from left to right and from top to bottom", so that a rectangular graph with neat arrangement is obtained.
4. The image recognition based interactive floorplan room extraction method of claim 3, wherein, According to the rectangular graph contour information and the base ring contour information, the coordinates are mapped to a.dxf format vector graph and are exported, and the wall is stretched and the floor is filled by using FreeCAD to obtain a three-dimensional room model.
5. An image recognition based interactive floorplan room extraction system, characterized in that, The method comprises the following steps: The first processing module is configured to perform transfer learning based on a YOLO pre-trained model, construct a room recognition model for an indoor floor plan, and perform inference recognition on an input floor plan to obtain a room rectangular boundary box; The second processing module is configured to correct a missed or misdetected room according to an input image and a room rectangular boundary box, so that misaligned box boundary frames are aligned and adsorbed according to a self-defined rule, and a rectangular graph with neat arrangement is obtained; The third processing module is configured to select feature points or corner points of a curved wall in a visualization interface, fit the curved wall using a cubic spline curve, and retain the selected feature points or corner points; select end points of a straight line wall and / or vertices of a polygon in the above-mentioned visualization interface, and sequentially connect to form a polygon contour; take the line segment of the fitted curve and the edge of the polygon contour as the edges of the graph, take the end points of each line segment as the nodes of the graph, analyze the connection relationship of the edges and nodes by using a loop detection algorithm in graph theory, and obtain a base ring by processing. The fourth processing module is configured to perform wall stretching and floor filling according to rectangular graph contour information and base ring contour information to obtain a three-dimensional room model.
6. The image recognition based interactive floorplan room extraction system of claim 5, wherein, The first processing module is configured to construct a custom room dataset, load a YOLO pre-trained model for transfer learning, obtain a YOLO model best.pt for planar room recognition, and perform inference and recognition on an input indoor planar graph through the model best.pt to obtain rectangular bounding boxes box of most rooms.
7. The image recognition based interactive floorplan room extraction system of claim 6, wherein, The second processing module is configured to correct the missed / corrected rooms through human-computer interaction, set a boundary reference frame with a priority, and align and adsorb the boundary frames according to a rule that "the reference frame has the highest priority, and the remaining boundary frames have a priority decreasing from left to right and from top to bottom", so as to obtain a rectangular graph arranged in a neat manner.
8. The image recognition based interactive floorplan room extraction system of claim 7, wherein, The fourth processing module is configured to convert the rectangular graph contour information and the base ring contour information into a.dxf format vector graph through coordinate mapping and export, and obtain a three-dimensional room model through wall stretching and floor filling by using FreeCAD.