House type map processing method and device, electronic equipment and storage medium

By vectorizing the floor plan, the problem of blurry display on different electronic devices was solved, achieving a clear and stable display effect.

CN116128996BActive Publication Date: 2026-01-02BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310041774.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-11
Publication Date
2026-01-02
Estimated Expiration
2043-01-11

AI Technical Summary

Technical Problem

When floor plans are displayed on different electronic devices, the compression or enlargement may cause blurring due to differences in software and hardware.

Method used

The floor plan is vectorized, including drawing the overall layout and room outlines, and saved as a vector graphic to ensure that the floor plan is displayed without distortion at different resolutions.

Benefits of technology

It achieves clear display of floor plans on different devices and resolutions, avoiding blurriness and distortion, and improving the display effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116128996B_ABST
    Figure CN116128996B_ABST
Patent Text Reader

Abstract

The application discloses a house type drawing processing method and device, electronic equipment and a storage medium, and belongs to the technical field of image processing. The house type drawing processing method comprises the following steps: preprocessing a to-be-processed house type drawing to obtain a target image, the content of the target image comprising a target object, and the target object comprising a plurality of object regions; determining a first contour of the target object; determining a second contour of the plurality of object regions; and generating a target house type drawing according to the first contour and the second contour.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of image processing, and particularly relates to a house type drawing processing method and device, electronic equipment and a storage medium. BACKGROUND

[0002] In the related art, a house type drawing is hand-drawn by a draftsman. For online house viewing scenarios, a user can display a house type drawing through an electronic device such as a mobile phone or a tablet computer. Different electronic devices have different software and hardware. In order to adapt to display screens of different electronic devices, a house type drawing is compressed or enlarged, which can cause a problem of blurred display of the house type drawing. SUMMARY

[0003] Embodiments of the application provide a house type drawing processing method and device, electronic equipment and a storage medium, which can solve the problem of blurred display of a house type drawing when the house type drawing is compressed or enlarged.

[0004] In a first aspect, embodiments of the application provide a house type drawing processing method, including:

[0005] Preprocessing a house type drawing to be processed to obtain a target image, content of the target image including a target object, the target object including a plurality of object regions;

[0006] Determining a first contour of the target object;

[0007] Determining a second contour of the plurality of object regions;

[0008] Generating a target house type drawing according to the first contour and the second contour.

[0009] In a second aspect, embodiments of the application provide a house type drawing processing device, including:

[0010] A preprocessing module configured to preprocess a house type drawing to be processed to obtain a target image, content of the target image including a target object, the target object including a plurality of object regions;

[0011] A determining module configured to determine a first contour of the target object, and further configured to determine a second contour of the plurality of object regions;

[0012] A generating module configured to generate a target house type drawing according to the first contour and the second contour.

[0013] In a third aspect, embodiments of the application provide electronic equipment including a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions being executed by the processor to implement steps of the method of the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, the readable storage medium storing a program or instructions, the program or instructions being executed by a processor to implement steps of the method in the first aspect.

[0015] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to run a program or instructions to implement steps of the method in the first aspect.

[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, the program product being stored in a storage medium, the program product being executed by at least one processor to implement the method in the first aspect.

[0017] In an embodiment of the present application, a to-be-processed house type drawing, i.e., a house type drawing drawn by a draftsman, is preprocessed to obtain a target image, the target image including a target object, i.e., a house property shown in the house type drawing, and a plurality of regions in the target object, i.e., a plurality of rooms in the house property. A first contour of the house property as a whole and a second contour of each room are drawn respectively, wherein the first contour and the second contour are both drawn in the form of a vector graph. In the finally obtained target house type drawing, the overall outer contour and the room contour inside are both vectorized line segments or curve segments, so that a vectorized house type drawing can be obtained. When the vectorized house type drawing is displayed, whether the house type drawing is compressed or enlarged, image distortion, blurring, and the like do not occur, and the display effect of the house type drawing can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 A flowchart of a house type drawing processing method according to an embodiment of the present application is shown;

[0019] Figure 2 A schematic diagram of a first contour according to an embodiment of the present application is shown;

[0020] Figure 3 A schematic diagram of a second contour according to an embodiment of the present application is shown;

[0021] Figure 4 A structural block diagram of a house type drawing processing apparatus according to an embodiment of the present application is shown;

[0022] Figure 5 A structural block diagram of an electronic device according to an embodiment of the present application is shown;

[0023] Figure 6 A hardware structure schematic diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0024] With reference to the drawings and the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly described. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art are within the scope of protection of the present application.

[0025] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of a kind and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in a "or" relationship.

[0026] The house type drawing processing method, device, electronic equipment and storage medium provided by the embodiments of the present application will be described in detail below in combination with the drawings and specific embodiments and application scenarios.

[0027] In some embodiments of the present application, a house type drawing processing method is provided, Figure 1 A flowchart of a house type drawing processing method according to an embodiment of the present application is shown in FIG. 1. Figure 1 As shown in FIG. 1, the house type drawing processing method comprises:

[0028] In step 102, the house type drawing to be processed is preprocessed to obtain a target image, the content of the target image includes a target object, and the target object includes a plurality of object regions.

[0029] In step 104, a first contour of the target object is determined.

[0030] In step 106, a second contour of the plurality of object regions is determined.

[0031] In step 108, the target house type drawing is generated according to the first contour and the second contour.

[0032] In the embodiments of the present application, for online house viewing scenarios, users can display house type drawings through electronic devices such as mobile phones and tablet computers. For different electronic devices, their software and hardware are different, in order to adapt to the display screens of different electronic devices, the house type drawings will be compressed or enlarged.

[0033] In the related art, the house type drawing is manually drawn by a draftsman, and is saved in the form of a picture after being drawn, so that when the picture house type drawing is scaled, the house type drawing display will be blurred and other problems will occur.

[0034] To address the aforementioned issues, this application vectorizes the floor plan based on its overall outline and internal room outlines. The vectorized floor plan remains undistorted and unblurred regardless of whether it is scaled or not.

[0035] Specifically, the floor plan to be processed is the floor plan drawn by the draftsman. After obtaining the floor plan to be processed, the first step is to preprocess it. Specifically, the preprocessing steps can be to remove useless parts of the floor plan, such as decorative patterns and background colors, to obtain a relatively clean line floor plan, which is the target image.

[0036] The target image includes the target object, which is the property shown in the floor plan, such as a unit with an area of ​​100 square meters. 2 The target property includes multiple areas, which are the various rooms within the property, including the porch, entryway, living room, bedroom, and bathroom.

[0037] The first outline of the current property as a whole and the second outline of each room in the current property are drawn separately. Both the first and second outlines are drawn in vector form. In the final target floor plan, the overall outer outline and the internal room outlines are vectorized line segments or curve segments. Therefore, a vectorized floor plan can be obtained. When displaying the vectorized floor plan, no image distortion or blurring will occur, regardless of whether the floor plan is compressed or enlarged, thus improving the display effect of the floor plan.

[0038] In some embodiments of this application, determining the first contour of the target object includes:

[0039] Identify the outer contour of the target object and obtain multiple outer contour feature points of the target object;

[0040] The outer contour curve of the target object is obtained by fitting multiple outer contour feature points;

[0041] The outer contour curve is smoothed to obtain the first contour.

[0042] In this embodiment of the application, the first outline is the overall outline of the property shown in the current floor plan. Figure 2 A schematic diagram of a first outline according to an embodiment of this application is shown, as follows. Figure 2 As shown, when drawing the first contour, image recognition is first performed on the preprocessed floor plan, that is, the target object 202 in the target image 200. Specifically, edge detection is performed on the target object, and feature points on the edge of the target object are obtained through the edge detection algorithm, which are denoted as outer contour feature points 204.

[0043] The contour feature points 204 are fitted to obtain a curve, i.e., a contour curve 206 of the target object. It can be understood that the contour curve can be a closed curve or an open, non-closed curve, and the embodiments of the present application do not limit this.

[0044] The fitted contour curve is further smoothed to obtain a first vectorized contour.

[0045] The embodiments of the present application vectorize the overall contour of the house type diagram, i.e., the first contour, and the vectorized target house type diagram after processing will not be blurred or distorted when displayed at any resolution, thereby improving the display effect of the house type diagram.

[0046] In some embodiments of the present application, the second contour of the plurality of object regions is determined, including:

[0047] According to the shape of each object region in the plurality of object regions, a corresponding region graph is generated in each object region, and the area of the region graph is less than the area of the object region;

[0048] Each region graph in the plurality of region graphs is enlarged at a constant ratio until at least one side of each region graph intersects at least one side of at least one other region graph.

[0049] The second contour is determined according to the plurality of region graphs after the constant ratio enlargement.

[0050] In the embodiments of the present application, after the pre-processing of the house type diagram to be processed, a target image is obtained, the target image includes a target object, i.e., a house property displayed by the house type diagram, and the target object includes a plurality of object regions, each of which corresponds to a room in the house property.

[0051] Since the shapes of these rooms can be different and irregular, a region graph is first drawn in each room, Figure 3 A schematic diagram of the second contour according to the embodiments of the present application is shown in FIG. 3. Figure 3 As shown in FIG. 3, the shape of the region graph 3022 is the same as that of the corresponding object region 302, and the area of the region graph is less than that of the object region.

[0052] Meanwhile, the region graphs 3022 are enlarged at a constant ratio. During the enlargement of the region graphs 3022, adjacent region graphs approach each other, and when a region graph intersects with the side of another region graph, the enlargement of the two region graphs is stopped until each region graph contacts at least one other region graph.

[0053] At this time, adjacent region graphs in the plurality of region graphs drawn share a side, as shown in FIG. 3. Figure 3As shown, there is a common edge 308 between the first region graph 304 and the second region graph 306.

[0054] According to the edges of the plurality of region graphs after the enlargement, the second contour of each object region, i.e., each room, can be determined.

[0055] Embodiments of the present application draw region graphs with the same shape as the rooms, and obtain rooms matching the shape, size and position of the real rooms by inflating the region graphs, so as to accurately draw the contours of the rooms, and finally generate vectorized rooms, which can avoid the problems of display distortion and blur when the house type diagram is scaled.

[0056] In some embodiments of the present application, determining the second contour according to the plurality of region graphs after the equal-scale enlargement comprises:

[0057] determining a graph contour curve of each of the plurality of region graphs;

[0058] performing smoothing processing on the graph contour curve to obtain the second contour.

[0059] In embodiments of the present application, after the plurality of region graphs are enlarged, a graph contour curve of each of the enlarged region graphs is determined, which is a curve formed by the edges of the region graph. It can be understood that the graph contour curve can be a closed curve, i.e., the outer edges of the region graph form a closed shape. The graph contour curve can also be an open curve, which is not limited in embodiments of the present application.

[0060] Performing smoothing processing on the graph contour curve of each of the region graphs, i.e., each room, can obtain the vectorized second contour.

[0061] Embodiments of the present application vectorize the contour of each room in the house type diagram, i.e., the second contour. The processed vectorized target house type diagram will not be blurred or distorted when displayed at any resolution, which can improve the display effect of the house type diagram.

[0062] In some embodiments of the present application, before determining the second contour according to the plurality of region graphs after the equal-scale enlargement, the method further comprises:

[0063] In a case where the first region graph and the second region graph in the plurality of region graphs satisfy that at least part of the first region graph and at least part of the second region graph coincide, a coincident region graph of the first region graph and the second region graph is determined;

[0064] In a case where the area of the coincident region graph is greater than an area threshold, the coincident region graph is determined as a new region graph;

[0065] In a case where the area of the overlapping region pattern is less than or equal to the area threshold, the overlapping region pattern is deleted in the first region pattern or the second region pattern.

[0066] In the embodiments of the present application, when the region patterns corresponding to the plurality of object regions are scaled up at a same scale, there may be a case where the scaled-up region patterns at least partially overlap with other region patterns. If the first region pattern and the second region pattern overlap, the overlapping part is the overlapping region pattern.

[0067] The area of the overlapping region pattern is determined. If the area of the overlapping region pattern is large, specifically greater than an area threshold, the overlapping region is classified as a room with a small area, and the overlapping region pattern is determined as a new region pattern.

[0068] If the area of the overlapping region pattern is small, specifically less than or equal to the area threshold, one of the overlapping first region pattern and the second region pattern is adjusted. For example, the overlapping region pattern is deleted in the first region pattern, the area of the overlapping region pattern is included in the second region pattern, or the overlapping region pattern is deleted in the second region pattern, and the area of the overlapping region pattern is included in the first region pattern.

[0069] The embodiments of the present application can ensure the accuracy of the house type diagram by processing the overlapping region based on the area of the overlapping region.

[0070] In some embodiments of the present application, the first contour and the second contour each include at least one contour line segment;

[0071] Generating a target house type diagram according to the first contour and the second contour includes:

[0072] Receiving a configuration input of the at least one contour line segment;

[0073] In response to the configuration input, setting a line segment attribute of the at least one contour line segment to obtain the target house type diagram, wherein the line segment attribute includes one or a combination of a wall type, a door type, and a window type.

[0074] In the embodiments of the present application, after obtaining the first contour of the entire property in the house type diagram and the second contour of each room inside the property, the first contour and the second contour each include at least one contour line segment. It can be understood that the contour line segment can be a straight line segment or a curved line segment.

[0075] The user or the draftsman can configure the line segment attribute of the line segment in the first contour and the second contour through configuration input, such as configuring the wall type of a certain contour line segment, for example, configuring the wall type of the first contour line segment as a load-bearing wall. For example, marking the door type on a certain contour line segment, for example, marking the door type on the second contour line segment as a front door. For example, marking the window type on a certain contour line segment, for example, marking the window on the third contour line segment as a bay window.

[0076] The embodiment of the present application marks the wall type, the door type and the window type in the house type drawing by configuring the line segment attribute of the line segment contour line segment, and enriches the content of the house type drawing.

[0077] In some embodiments of the present application, the house type drawing to be processed is preprocessed to obtain a target image, comprising:

[0078] The house type drawing to be processed is subjected to gray scale processing to obtain a target gray scale drawing;

[0079] The target gray scale drawing is subjected to noise reduction processing to obtain a target image.

[0080] In the embodiment of the present application, the house type drawing to be processed is a house type drawing drawn by a draftsman. After obtaining the house type drawing to be processed, the house type drawing to be processed is first preprocessed. Specifically, the house type drawing to be processed is first subjected to gray scale processing, so as to remove useless information such as background color in the house type drawing, and obtain a target gray scale drawing.

[0081] In some embodiments, the target gray scale drawing can also be subjected to binaryzation processing, so as to further remove useless information such as watermarks and decorative patterns.

[0082] After obtaining the target gray scale drawing, the target gray scale drawing is further subjected to noise reduction processing to remove noise information in the image, and obtain a target image after noise reduction.

[0083] The embodiment of the present application removes useless information and noise information in the house type drawing to be processed through preprocessing, so as to improve the purity of the drawing degree after vector processing, and improve the display effect of the house type drawing.

[0084] In some embodiments of the present application, the house type drawing is subjected to vectorization processing, specifically comprising the following steps:

[0085] 1. First, obtain the house type drawing, and preprocess it (convert it into a gray scale drawing, and remove noise points) to obtain a standard house type drawing (an outer contour and a uniform size), then perform fitting and smoothing processing on the overall outer contour of the standard house type drawing, and finally perform fitting and smoothing processing on the room contour, and finally generate a vectorized house type drawing;

[0086] 2. When integrating the overall outer contour, first obtain the outline shape of the apartment, then expand it proportionally according to the outline of the internal rooms, stop when it touches the outline of another room, and finally optimize it by deleting smaller spaces. Finally, smooth and collinearize the outer contour.

[0087] 3. When optimizing and integrating room outlines, first obtain the room outlines, then smooth and cross the closed room outlines. If two rooms have a large overlapping area, the overlapping area can be assigned to the smaller room. If two rooms have a small overlapping area, the outline of one of the rooms will be offset.

[0088] 4. Finally, define the specific walls in the vector diagram, and determine which locations are doors, windows, and the type of wall.

[0089] The floor plan processing method provided in this application can be executed by a floor plan processing device. This application uses the floor plan processing device executing the floor plan processing method as an example to illustrate the floor plan processing device provided in this application.

[0090] In some embodiments of this application, a floor plan processing device is provided. Figure 4 A structural block diagram of a floor plan processing apparatus according to an embodiment of this application is shown, such as... Figure 4 As shown, the floor plan processing device 400 includes:

[0091] Preprocessing module 402 is used to preprocess the floor plan to be processed to obtain a target image. The content of the target image includes a target object, and the target object includes multiple object regions.

[0092] The determination module 404 is used to determine the first contour of the target object; it is also used to determine the second contour of multiple object regions.

[0093] The generation module 406 is used to generate a target floor plan based on the first contour and the second contour.

[0094] In this application embodiment, for scenarios such as online house viewing, users may use electronic devices such as mobile phones and tablets to display floor plans. Different electronic devices have different hardware and software; therefore, the floor plans may be compressed or enlarged to adapt to the displays of different electronic devices.

[0095] In related technologies, floor plans are drawn manually by draftsmen and saved as images after completion. Therefore, scaling the floor plan image can lead to problems such as blurry display.

[0096] To address the aforementioned issues, this application vectorizes the floor plan based on its overall outline and internal room outlines. The vectorized floor plan remains undistorted and unblurred regardless of whether it is scaled or not.

[0097] Specifically, the floor plan to be processed is the floor plan drawn by the draftsman. After obtaining the floor plan to be processed, the first step is to preprocess it. Specifically, the preprocessing steps can be to remove useless parts of the floor plan, such as decorative patterns and background colors, to obtain a relatively clean line floor plan, which is the target image.

[0098] The target image includes the target object, which is the property shown in the floor plan, such as a unit with an area of ​​100 square meters. 2 The target property includes multiple areas, which are the various rooms within the property, including the porch, entryway, living room, bedroom, and bathroom.

[0099] The first outline of the current property as a whole and the second outline of each room in the current property are drawn separately. Both the first and second outlines are drawn in vector form. In the final target floor plan, the overall outer outline and the internal room outlines are vectorized line segments or curve segments. Therefore, a vectorized floor plan can be obtained. When displaying the vectorized floor plan, no image distortion or blurring will occur, regardless of whether the floor plan is compressed or enlarged, thus improving the display effect of the floor plan.

[0100] In some embodiments of this application, the floor plan processing apparatus further includes:

[0101] The recognition module is used to recognize the outer contour of the target object and obtain multiple outer contour feature points of the target object.

[0102] The image processing module is used to fit the outer contour curve of the target object based on multiple outer contour feature points; and to smooth the outer contour curve to obtain the first contour.

[0103] In this embodiment of the application, the first outline is the overall outline of the property shown in the current floor plan. Figure 2 A schematic diagram of a first outline according to an embodiment of this application is shown, as follows. Figure 2 As shown, when drawing the first contour, image recognition is first performed on the preprocessed floor plan, that is, the target object 202 in the target image 200. Specifically, edge detection is performed on the target object, and feature points on the edge of the target object are obtained through the edge detection algorithm, which are denoted as outer contour feature points 204.

[0104] The contour feature points 204 are fitted, and a curve obtained by fitting is a contour curve 206 of the target object. It can be understood that the contour curve can be a closed curve or an open curve, and the embodiments of the present application do not limit this.

[0105] The fitted contour curve is further smoothed, and a first vectorized contour is obtained.

[0106] The embodiments of the present application vectorize the overall contour of the house type drawing, that is, the first contour. The vectorized target house type drawing processed will not be blurred and distorted when displayed at any resolution, and the display effect of the house type drawing can be improved.

[0107] In some embodiments of the present application, the generation module is further configured to generate a corresponding region graph in each object region according to the shape of each object region in the plurality of object regions, and the area of the region graph is less than the area of the object region.

[0108] The image processing module is further configured to proportionally enlarge each region graph in the plurality of region graphs until at least one side of each region graph intersects at least one side of at least one other region graph.

[0109] The determination module is further configured to determine a second contour according to the plurality of region graphs after proportional enlargement.

[0110] In the embodiments of the present application, after the house type drawing to be processed is preprocessed, a target image is obtained, the target image includes a target object, that is, a house property displayed by the house type drawing, and the target object includes a plurality of object regions, each of which corresponds to a room in the house property.

[0111] Since the shapes of the rooms can be different and irregular, a region graph is first drawn in each room, Figure 3 FIG. 2 shows a schematic diagram of a second contour according to an embodiment of the present application, as Figure 3 As shown in FIG. 2, the shape of the region graph 3022 is the same as that of the corresponding object region 302, and the area of the region graph is less than that of the object region.

[0112] Meanwhile, the region graphs 3022 are proportionally enlarged, and in the process of enlarging the region graphs 3022, adjacent region graphs approach each other. When a region graph intersects with a side of another region graph, the enlargement of the two region graphs is stopped, and each region graph is in contact with at least one other region graph.

[0113] At this time, adjacent region graphs in the plurality of region graphs drawn share a side, as Figure 3As shown, there is a common edge 308 between the first region graph 304 and the second region graph 306.

[0114] According to the edges of the enlarged region graphs, the second contour of each object region, i.e., each room, can be determined.

[0115] Embodiments of the present application draw region graphs with the same shape as the rooms, and obtain rooms matching the shape, size and position of the real rooms by inflating the region graphs, so as to accurately draw the contours of the rooms and finally generate vectorized rooms, which can avoid display distortion and blurring when the house type diagram is scaled.

[0116] In some embodiments of the present application, the determining module is further configured to determine a graph contour curve of each region graph in the plurality of region graphs.

[0117] The image processing module is further configured to perform smoothing processing on the graph contour curve to obtain the second contour.

[0118] In embodiments of the present application, after the plurality of region graphs are enlarged, a graph contour curve of each enlarged region graph is determined, which is a curve formed by the edges of the region graph. It can be understood that the graph contour curve can be a closed curve, i.e., the outer edges of the region graph form a closed shape. The graph contour curve can also be an open curve, which is not limited in embodiments of the present application.

[0119] The graph contour curve of each region graph, i.e., each room, is smoothed, and a vectorized second contour can be obtained.

[0120] Embodiments of the present application vectorize the contour of each room in the house type diagram, i.e., the second contour. The processed vectorized target house type diagram will not be blurred or distorted when displayed at any resolution, which can improve the display effect of the house type diagram.

[0121] In some embodiments of the present application, the determining module is further configured to, when the first region graph and the second region graph in the plurality of region graphs satisfy a condition that at least part of the first region graph and at least part of the second region graph coincide, determine a coinciding region graph of the first region graph and the second region graph; and when the area of the coinciding region graph is greater than an area threshold, determine the coinciding region graph as a new region graph.

[0122] The house type diagram processing apparatus further includes:

[0123] The deleting module is configured to, when the area of the coinciding region graph is less than or equal to the area threshold, delete the coinciding region graph in the first region graph or the second region graph.

[0124] In the embodiments of the present application, when the region graphs corresponding to the plurality of object regions are scaled up at a constant ratio, there can be a case where the scaled-up region graph at least partially overlaps with other region graphs. If the first region graph and the second region graph overlap, the overlapping part is the overlapping region graph.

[0125] The area of the overlapping region graph is determined. If the area of the overlapping region graph is large, specifically greater than an area threshold, the overlapping region is classified as a room with a small area, and the overlapping region graph is determined as a new region graph.

[0126] If the area of the overlapping region graph is small, specifically less than or equal to the area threshold, one of the overlapping first region graph and the second region graph is adjusted, such as deleting the overlapping region graph in the first region graph, classifying the area of the overlapping region graph into the second region graph, or deleting the overlapping region graph in the second region graph, and classifying the area of the overlapping region graph into the first region graph.

[0127] The embodiments of the present application can ensure the accuracy of the house type graph by processing the overlapping region based on the area of the overlapping region.

[0128] In some embodiments of the present application, the first contour and the second contour each include at least one contour line segment;

[0129] The house type graph processing apparatus further includes:

[0130] The receiving module is configured to receive a configuration input of the at least one contour line segment;

[0131] The setting module is configured to set a line segment attribute of the at least one contour line segment in response to the configuration input, to obtain a target house type graph, wherein the line segment attribute includes one or a combination of a wall type, a door type, and a window type.

[0132] In the embodiments of the present application, after obtaining the first contour of the entire property in the house type graph and the second contour of each room inside the property, the first contour and the second contour each include at least one contour line segment. It can be understood that the contour line segment can be a straight line segment or a curved line segment.

[0133] The user or the draftsman can configure the line segment attribute of the contour line segment in the first contour and the second contour through the configuration input, such as configuring the wall type of a certain contour line segment, for example, configuring the wall type of the first contour line segment as a load-bearing wall. For example, marking the door type on a certain contour line segment, for example, marking the door type on the second contour line segment as a front door. For example, marking the window type on a certain contour line segment, for example, marking the window on the third contour line segment as a bay window.

[0134] The embodiment of the present application marks the wall type, the door type and the window type in the house type drawing by configuring the line segment attribute of the line segment contour line segment, and enriches the content of the house type drawing.

[0135] In some embodiments of the present application, the preprocessing module is specifically configured to perform grayscale processing on the house type drawing to be processed to obtain a target grayscale drawing, and perform noise reduction processing on the target grayscale drawing to obtain a target image.

[0136] In the embodiment of the present application, the house type drawing to be processed is a house type drawing drawn by a draftsman. After obtaining the house type drawing to be processed, the house type drawing to be processed is first preprocessed. Specifically, the house type drawing to be processed is first subjected to grayscale processing, so as to remove useless information such as the background color in the house type drawing, and obtain a target grayscale drawing.

[0137] In some embodiments, the target grayscale drawing can also be subjected to binarization processing, so as to further remove useless information such as watermarks and decorative patterns.

[0138] After obtaining the target grayscale drawing, the target grayscale drawing is further subjected to noise reduction processing to remove noise information in the image, and obtain a target image after noise reduction.

[0139] The embodiment of the present application removes useless information and noise information in the house type drawing to be processed by preprocessing, so as to improve the purity of the drawing degree after vector processing, and improve the display effect of the house type drawing.

[0140] The house type drawing processing apparatus in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than the terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), and the like. The electronic device can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, and the like, and the embodiment of the present application is not limited in this regard.

[0141] The house type drawing processing apparatus in the embodiments of the present applicationapplicationbe an apparatus having an operating system. The operating systemapplicationbe an Android operating system, an iOS operating system, or another possible operating system, and the embodiments of the present application do not make specific limitations.

[0142] The house type drawing processing apparatus provided in the embodiments of the present applicationapplicationimplement the various processes implemented by the method embodiments, and thus the details are not described herein again.

[0143] Optionally, the embodiments of the present application further provide an electronic device, Figure 5 A structural block diagram of an electronic device according to the embodiments of the present application is shown in FIG. 5. Figure 5 As shown in FIG. 5, the electronic device 500 includes a processor 502, a memory 504, and a program or instruction stored in the memory 504 and executable on the processor 502. The program or instructionapplicationbe executed by the processor 502 to implement the various processes of the above method embodiments and achieve the same technical effects. Thus, the details are not described herein again.

[0144] It should be noted that the electronic device in the embodiments of the present applicationapplicationinclude the mobile electronic device and the non-mobile electronic device described above.

[0145] Figure 6 A hardware structural diagram of an electronic device according to the embodiments of the present application is shown in FIG. 6.

[0146] The electronic device 600 includes, but is not limited to, a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610, etc.

[0147] Those skilled in the art can understand that the electronic device 600applicationfurther include a power supply (such as a battery) for supplying power to various components. The power supplyapplicationbe logically connected to the processor 610 through a power management system, so as to realize the functions of power management, such as charging, discharging, and power consumption management, through the power management system. Figure 6 The electronic device structure shown in FIG. 6 does not constitute a limitation on the electronic device, and the electronic deviceapplicationinclude more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components, and thus the details are not described herein again.

[0148] The processor 610applicationbe configured to pre-process a to-be-processed house type drawing to obtain a target image, the content of the target image including a target object, the target object including a plurality of object regions; determine a first contour of the target object; and determine a second contour of the plurality of object regions; and generate a target house type drawing according to the first contour and the second contour.

[0149] The embodiments of the present application draw a first contour of the current house property and a second contour of each room in the current house property, wherein the first contour and the second contour are drawn in the form of a vector diagram, and the obtained target house type diagram has a vectorized line segment or curve segment as the overall contour and the room contour, so that a vectorized house type diagram can be obtained, and when the vectorized house type diagram is displayed, no image distortion or blurring occurs whether the house type diagram is compressed or enlarged, and the display effect of the house type diagram can be improved.

[0150] Optionally, the processor 610 is further configured to identify an outer contour of the target object to obtain a plurality of outer contour feature points of the target object, fit an outer contour curve of the target object according to the plurality of outer contour feature points, and perform smoothing processing on the outer contour curve to obtain the first contour.

[0151] The embodiments of the present application perform vectorization processing on the overall contour of the house type diagram, i.e., the first contour, and the processed vectorized target house type diagram will not be blurred or distorted when displayed at any resolution, and the display effect of the house type diagram can be improved.

[0152] Optionally, the processor 610 is further configured to generate a corresponding region graph in each object region according to the shape of each object region in the plurality of object regions, the area of the region graph is smaller than the area of the object region, perform equal-scale enlargement on each region graph in the plurality of region graphs until at least one side of each region graph intersects with at least one side of at least one other region graph, and determine the second contour according to the plurality of region graphs after equal-scale enlargement.

[0153] The embodiments of the present application draw a region graph with the same shape as the room, and obtain a room matching the shape, size and position of the real room by inflating the region graph, so as to accurately draw the contour of the room and finally generate a vectorized room, and the problem of display distortion and blurring when the house type diagram is scaled can be avoided.

[0154] Optionally, the processor 610 is further configured to determine a graph contour curve of each region graph in the plurality of region graphs, and perform smoothing processing on the graph contour curve to obtain the second contour.

[0155] The embodiments of the present application perform vectorization processing on the contour of each room in the house type diagram, i.e., the second contour, and the processed vectorized target house type diagram will not be blurred or distorted when displayed at any resolution, and the display effect of the house type diagram can be improved.

[0156] Optionally, the processor 610 is further configured to, in the first region graph and the second region graph of the plurality of region graphs, determine a coincident region graph of the first region graph and the second region graph when at least part of the first region graph and at least part of the second region graph coincide; determine the coincident region graph as a new region graph when an area of the coincident region graph is greater than an area threshold; and delete the coincident region graph from the first region graph or the second region graph when the area of the coincident region graph is less than or equal to the area threshold.

[0157] The embodiments of the present application can ensure the accuracy of the house type graph by processing the coincident region based on the area of the coincident region.

[0158] Optionally, the first contour and the second contour each include at least one contour line segment.

[0159] The processor 610 is further configured to receive a configuration input of the at least one contour line segment; and set a line segment attribute of the at least one contour line segment to obtain a target house type graph in response to the configuration input, wherein the line segment attribute includes one or a combination of a wall type, a door type, and a window type.

[0160] The embodiments of the present application can mark the wall type, the door type, and the window type in the house type graph by configuring the line segment attribute of the contour line segment, and enrich the content of the house type graph.

[0161] Optionally, the processor 610 is further configured to perform gray scale processing on the house type graph to be processed to obtain a target gray scale graph; and perform noise reduction processing on the target gray scale graph to obtain a target image.

[0162] The embodiments of the present application can improve the purity of the drawing degree after vector processing and improve the display effect of the house type graph by preprocessing the house type graph to be processed to remove the useless information and the noise information.

[0163] It should be understood that in the embodiments of the present application, the input unit 604 can include a graphics processor (GPU) 6041 and a microphone 6042. The graphics processor 6041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 606 can include a display panel 6061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also referred to as a touch screen. The touch panel 6071 can include two parts of a touch detection device and a touch controller. The other input devices 6072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, on-off keys, and the like), a trackball, a mouse, a joystick, and the like, which will not be described here.

[0164] The memory 609 can be used to store software programs and various data. The memory 609 can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, and the like), and the like. In addition, the memory 609 can include a volatile memory or a non-volatile memory, or the memory 609 can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 609 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.

[0165] The processor 610 can include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and an application program, and the modem processor mainly processes a wireless communication signal, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 610.

[0166] The embodiment of the present application further provides a readable storage medium, and the readable storage medium stores a program or an instruction. The program or the instruction is executed by a processor to realize various processes of the above-mentioned method embodiment, and the same technical effects can be achieved. To avoid repetition, details are not described herein.

[0167] The processor is a processor in the electronic device in the above-mentioned embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.

[0168] The embodiment of the present application further provides a chip, and the chip includes a processor and a communication interface. The communication interface is coupled with the processor. The processor is configured to execute a program or an instruction to realize various processes of the above-mentioned method embodiment, and the same technical effects can be achieved. To avoid repetition, details are not described herein.

[0169] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system-level chip, a system chip, a chip system, or a system-on-chip chip, and the like.

[0170] The embodiment of the present application provides a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to realize various processes of the above-mentioned method embodiment, and the same technical effects can be achieved. To avoid repetition, details are not described herein.

[0171] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations 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 can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element. Furthermore, it is to be understood that the method and apparatus of the present application can be carried out by more than one process, method, article, or apparatus either simultaneously, concurrently, or with intervening action that are carried out at the same time, either in a simultaneous fashion or in a fashion that is interleaved in time. For example, the described methods can be performed in a different order from that described, and / or various steps can be combined or omitted, and / or additional steps can be added, without departing from the scope of the described methods. Also, features described with respect to certain examples can be combined in other examples.

[0172] From the above description of the embodiments, it is apparent that the above-mentioned method can be realized by means of software plus necessary universal hardware platforms, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of computer software products, which are stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and include a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, or network equipment, etc.) execute the method of each embodiment of the present application.

[0173] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-described specific embodiments, and the above-described specific embodiments are merely illustrative, rather than limiting, and those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.

Claims

1. A method for processing floor plans, characterized in that, include: The floor plan to be processed is preprocessed to obtain a target image. The content of the target image includes a target object, and the target object includes multiple object regions. Determine the first outline of the target object; Determine the second contour of the plurality of object regions; Generate the target floor plan based on the first contour and the second contour. The step of determining the second contour of the plurality of object regions includes: Based on the shape of each object region among the plurality of object regions, a corresponding region graphic is generated in each object region, wherein the area of ​​the region graphic is smaller than the area of ​​the object region; Each of the plurality of region graphics is expanded until each region graphic touches at least one other region graphic. The second contour is determined based on the multiple region graphics after being touched.

2. The floor plan processing method according to claim 1, characterized in that, Determining the first contour of the target object includes: Identify the outer contour of the target object to obtain multiple outer contour feature points of the target object; The outer contour curve of the target object is obtained by fitting the multiple outer contour feature points; The outer contour curve is smoothed to obtain the first contour.

3. The floor plan processing method according to claim 1, characterized in that, The step of expanding each of the plurality of region graphics until each region graphic touches at least one other region graphic includes: Each of the plurality of region graphics is enlarged proportionally until at least one edge of each region graphic intersects with at least one edge of at least one other region graphic. Determining the second contour based on the multiple region graphics after being touched includes: The second contour is determined based on the proportionally enlarged images of the multiple regions.

4. The floor plan processing method according to claim 3, characterized in that, Determining the second contour based on the proportionally enlarged images of the multiple regions includes: Determine the graphic outline curve of each of the multiple region graphics; The graphic contour curve is smoothed to obtain the second contour.

5. The floor plan processing method according to claim 3, characterized in that, Before determining the second contour based on the proportionally enlarged plurality of region graphics, the method further includes: In the plurality of region graphics, if at least a portion of the first region graphic and at least a portion of the second region graphic overlap, an overlapping region graphic of the first region graphic and the second region graphic is determined. If the area of ​​the overlapping region is greater than the area threshold, the overlapping region is identified as a new region. If the area of ​​the overlapping region is less than or equal to the area threshold, the overlapping region is deleted from either the first region or the second region.

6. The floor plan processing method according to any one of claims 1 to 5, characterized in that, Both the first contour and the second contour include at least one contour line segment; The step of generating the target floor plan based on the first contour and the second contour includes: Receive configuration input for the at least one contour segment; In response to the configuration input, the line segment attributes of the at least one outline line segment are set to obtain the target floor plan, wherein the line segment attributes include one or a combination of wall type, door type and window type.

7. The floor plan processing method according to any one of claims 1 to 5, characterized in that, The process of preprocessing the floor plan to be processed to obtain the target image includes: The floor plan to be processed is subjected to grayscale processing to obtain the target grayscale image; The target grayscale image is subjected to noise reduction processing to obtain the target image.

8. A floor plan processing device, characterized in that, include: The preprocessing module is used to preprocess the floor plan to be processed to obtain a target image. The content of the target image includes a target object, and the target object includes multiple object regions. The determining module is used to determine a first contour of the target object; and is also used to determine a second contour of the plurality of object regions; The generation module is used to generate a target floor plan based on the first contour and the second contour, and is also used to generate a corresponding area graphic in each of the multiple object areas based on the shape of each object area, wherein the area of ​​the area graphic is smaller than the area of ​​the object area; The image processing module is used to dilate each of the plurality of region graphics until each region graphic touches at least one other region graphic. The determining module is further configured to determine the second contour based on the multiple region graphics after the touch.

9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the floor plan processing method as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the floor plan processing method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • House type vector graph generation method and apparatus for building and terminal

    CN107330979A