CN111754526B - House type graph dividing method, household type graph classifying method, household type graph dividing device, household type graph dividing equipment and storage medium - Google Patents

House type graph dividing method, household type graph classifying method, household type graph dividing device, household type graph dividing equipment and storage medium Download PDF

Info

Publication number
CN111754526B
CN111754526B CN202010582320.8A CN202010582320A CN111754526B CN 111754526 B CN111754526 B CN 111754526B CN 202010582320 A CN202010582320 A CN 202010582320A CN 111754526 B CN111754526 B CN 111754526B
Authority
CN
China
Prior art keywords
area
image
segmented
width
segmentation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010582320.8A
Other languages
Chinese (zh)
Other versions
CN111754526A (en
Inventor
刘勉励
曾翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Bozhilin Robot Co Ltd
Original Assignee
Guangdong Bozhilin Robot Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Bozhilin Robot Co Ltd filed Critical Guangdong Bozhilin Robot Co Ltd
Priority to CN202010582320.8A priority Critical patent/CN111754526B/en
Publication of CN111754526A publication Critical patent/CN111754526A/en
Application granted granted Critical
Publication of CN111754526B publication Critical patent/CN111754526B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20036Morphological image processing

Abstract

The embodiment of the invention discloses a household pattern segmentation method, a classification method, a segmentation device, equipment and a storage medium. The household pattern segmentation method comprises the following steps: obtaining a to-be-segmented house type diagram, wherein the to-be-segmented house type diagram comprises a door opening area; binarizing the house type graph to be segmented based on a passing area in the house type graph to be segmented to obtain a binarized image; performing open operation on the binarized image to obtain a door opening area of the binarized image, and determining an area dividing line in the binarized image based on the door opening area; and carrying out image segmentation on the to-be-segmented house type graph based on the region segmentation line to obtain at least one target segmentation region of the to-be-segmented house type graph. According to the scheme provided by the embodiment of the invention, the technical effect of automatically dividing the house type graph is realized.

Description

House type graph dividing method, household type graph classifying method, household type graph dividing device, household type graph dividing equipment and storage medium
Technical Field
The embodiment of the invention relates to an image segmentation technology, in particular to a household pattern segmentation method, a classification method, a segmentation device, equipment and a storage medium.
Background
When a building construction robot works on a construction site, autonomous positioning navigation is needed, one of the key problems is the generation of a navigation map, and most robots conduct guiding and positioning according to the navigation map. But the grid map which is most widely used at present does not have semantic information, and different rooms have different process requirements, such as ceramic tile sticking of kitchen and bathroom walls, paint spraying of bedroom walls, such as kitchen and bathroom ground tiles, bedroom ground floor laying and the like. Therefore, the room segmentation and classification of the segmentation result of the grid map are of great significance to guiding the operation of the robot.
At present, a robot mainly adopts laser real-time positioning and mapping, namely, a sensor (such as a laser radar) is used for acquiring a local environment map near the position of the robot. The laser radar mainly adopts the expression mode of a grid map, the grid map does not contain semantic information, a positioning instruction is required to be given by a person when the robot works, after the robot reaches a designated position, the target area is repositioned by other sensors (such as a vision module of an industrial camera and the like), and then the working instruction is executed. The working areas of the construction robots of different processes are different, and the working area where different processes are located cannot be distinguished by simply using the grid map, so that manual specification is required. In recent years, the visual real-time positioning and mapping technology has been developed in the research field and contains semantic information, but the method has the advantages of large operand, low reliability, no texture in the construction environment and difficult realization of application.
Disclosure of Invention
The embodiment of the invention provides a house type map segmentation method, a classification method, a segmentation device, equipment and a storage medium, so as to realize the effect of automatically segmenting a navigation map.
In a first aspect, an embodiment of the present invention provides a method for segmenting a family pattern, where the method includes:
obtaining a to-be-segmented house type diagram, wherein the to-be-segmented house type diagram comprises a door opening area;
binarizing the house type graph to be segmented based on a passing area in the house type graph to be segmented to obtain a binarized image;
performing open operation on the binarized image to obtain a door opening area of the binarized image, and determining an area dividing line in the binarized image based on the door opening area;
and carrying out image segmentation on the to-be-segmented house type graph based on the region segmentation line to obtain at least one target segmentation region of the to-be-segmented house type graph.
In a second aspect, an embodiment of the present invention further provides a method for classifying a family pattern, where the method includes:
inputting a target segmentation area into a trained image classification model, and classifying the target segmentation area based on the image classification model;
the image classification model is obtained by adding labels to at least one historical target segmentation region, extracting features of the labeled at least one historical target segmentation region, determining region contour information, constructing a training sample set based on the region contour information and the labels, and training based on the training sample set;
The target segmentation area and the at least one historical target segmentation area are both obtained based on the segmentation method of claims 1-6.
In a third aspect, an embodiment of the present invention further provides a device for dividing a house type graph, where the device includes:
the system comprises a to-be-segmented house type graph acquisition module, a door opening area acquisition module and a door opening area acquisition module, wherein the to-be-segmented house type graph acquisition module is used for acquiring a to-be-segmented house type graph;
the binarization image acquisition module is used for binarizing the house type graph to be segmented based on a passing area in the house type graph to be segmented to obtain a binarization image;
the area dividing line determining module is used for performing opening operation on the binary image to obtain a door opening area of the binary image, and determining an area dividing line in the binary image based on the door opening area;
and the target segmentation area determining module is used for carrying out image segmentation on the household pattern to be segmented based on the area segmentation line to obtain at least one target segmentation area of the household pattern to be segmented.
In a fourth aspect, an embodiment of the present invention further provides an apparatus, including:
one or more processors;
a storage means for storing one or more programs;
And when the one or more programs are executed by the one or more processors, the one or more processors implement the method for segmenting the house type graph according to any one of the embodiments of the present invention and/or the method for classifying the house type graph according to the embodiments of the present invention.
In a fifth aspect, embodiments of the present invention further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the method for segmenting a floor plan according to any one of the embodiments of the present invention and/or the method for classifying a floor plan according to the embodiments of the present invention.
According to the technical scheme, the through area in the to-be-segmented house type graph is obtained to carry out binarization on the to-be-segmented house type graph to obtain a binarized image, the opening operation is carried out on the binarized image to obtain the door opening area of the binarized image, the area dividing line in the binarized image is determined based on the door opening area, the image segmentation is carried out on the to-be-segmented house type graph based on the area dividing line to obtain at least one target segmentation area of the to-be-segmented house type graph, automatic segmentation of the to-be-segmented house type graph is achieved, operation is simple, and great time cost and labor cost are saved.
Drawings
FIG. 1 is a flow chart of a house type graph dividing method in a first embodiment of the invention;
fig. 2 is a schematic view of a house type to be segmented in a first embodiment of the present invention;
FIG. 3 is a diagram of a binarized image according to a first embodiment of the present invention;
FIG. 4 is an image of the erosion obtained after the erosion of the binarized image in accordance with the first embodiment of the present invention;
FIG. 5 is an expanded image obtained by expanding a corrosion image according to the first embodiment of the present invention;
FIG. 6 is a schematic view of a door opening area in accordance with a first embodiment of the present invention;
fig. 7 is a dividing line of a binarized image in the first embodiment of the present invention;
FIG. 8 is a flowchart of a house type graph dividing method in a second embodiment of the present invention;
FIG. 9 is a schematic diagram of a method for determining a division line of a region in a second embodiment of the present invention;
fig. 10 is a flowchart of a house type graph dividing method in the third embodiment of the present invention;
FIG. 11 is a corrosion image when the difference between the width of the door opening area and the width of the corridor area is not within the preset width range in the third embodiment of the present invention;
FIG. 12 is a graph showing erosion when the difference between the width of the door opening area and the width of the corridor area is within a preset width range in the third embodiment of the present invention;
fig. 13 is a schematic diagram of a segmentation result of a to-be-segmented house type graph in a third embodiment of the present invention;
Fig. 14 is a flowchart of a house type graph dividing method in the fourth embodiment of the present invention;
fig. 15 is a schematic diagram of a pixel width corresponding to a length or a width of a target division area in a fourth embodiment of the present invention being smaller than a preset width threshold;
fig. 16 is a flowchart of a house type graph dividing method in a fifth embodiment of the present invention;
FIG. 17 is a schematic diagram showing the result of the center-diffusion maximum inscribed rectangle in the fifth embodiment of the present invention;
FIG. 18 is a schematic view of a region excluding the inscribed maximum rectangular region in the fifth embodiment of the present invention;
FIG. 19 is a corrosion image of an area other than the inscribed maximum rectangular area in embodiment five of the present invention;
fig. 20 is a schematic diagram of a final segmentation result of a to-be-segmented family pattern diagram in a fifth embodiment of the present invention;
fig. 21 is a schematic view of a region division of a target division region in a fifth embodiment of the present invention;
fig. 22 is a flowchart of a house type diagram classification method in the sixth embodiment of the present invention;
fig. 23 is a schematic structural diagram of a house type graph dividing device in a seventh embodiment of the present invention;
fig. 24 is a schematic structural view of an apparatus according to an eighth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a house type graph splitting method provided in an embodiment of the present invention, where the embodiment is applicable to a situation of automatically splitting an acquired house type graph of a building, the method may be performed by a house type graph splitting device, the house type graph splitting device may be implemented by software and/or hardware, and the house type graph splitting device may be configured on a computing device, and specifically includes the following steps:
s110, acquiring a to-be-segmented house type graph, wherein the to-be-segmented house type graph comprises a door opening area.
The house pattern to be segmented may be an acquired house pattern to be segmented, for example, may be a navigation map of any building, where the house pattern to be segmented may be acquired through a laser real-time positioning and mapping technique or a visual laser real-time positioning and mapping technique, that is, through a sensor (such as a laser radar or a visual laser radar), referring to the house pattern to be segmented illustrated in fig. 2, and fig. 2 is an acquired house pattern to be segmented of any building. The door opening area is included in the figure, where the door opening area may be an area of the door between rooms, such as B in fig. 2 being the door opening area. And dividing the target division area of the to-be-divided house type graph by utilizing a division algorithm or a division model through the obtained to-be-divided house type graph.
S120, binarizing the to-be-segmented house type graph based on the passing area in the to-be-segmented house type graph to obtain a binarized image.
The traffic region may be, for example, each target divided region and a region where each target divided region communicates. The binarization processing is performed on the house type diagram to be segmented in fig. 2, so that a binarized image of the house type diagram to be segmented can be obtained, and referring to a binarized image schematic diagram shown in fig. 3, a white foreground in fig. 3 is a traffic area, and a black background area. The binarization processing of the to-be-segmented house type graph in fig. 2 may specifically be that the to-be-segmented house type graph in fig. 2 is subjected to the grey level processing, then the image after the grey level processing is converted into a binary image (fig. 3) with only two colors of black and white, when the binarization processing is performed, a threshold value is selected first, the threshold value is a point selected as a dividing line of the processed image, and if the grey level of an image pixel is smaller than the threshold value, the black 0 is set; if the difference is larger than the threshold, the white value is set to be 1, and an Otsu threshold algorithm (otus) can be adopted here, namely an automatic threshold selection method with the largest inter-class variance is used for selecting the image, and binarization processing is carried out on the image. And then, carrying out subsequent operation based on the binarized image to obtain a region dividing line for dividing the target dividing region in the house type graph to be divided.
S130, performing open operation on the binarized image to obtain a door opening area of the binarized image, and determining an area dividing line in the binarized image based on the door opening area.
The open operation is to perform morphological processing on the binarized image, that is, the binarized image is first corroded to obtain a corroded image, then the corroded image is subjected to expansion processing to obtain an expanded image, referring to a corroded image obtained by corroding the binarized image shown in fig. 4, it can be seen from the a graph in fig. 4 that after multiple corrosions, the C area in the a graph in fig. 4 is narrowed as compared with the C area in fig. 3, and is close to a straight line, and after one more corrosions, the b graph in fig. 4 is obtained, the C area in the b graph in fig. 4 is already closed, the original foreground area is a communication area, and after corrosions into the b graph, the b communicating areas are changed. The corrosion image in fig. 4 is expanded once to form an expanded image obtained after the corrosion image in fig. 5 is expanded, the diagram a in fig. 4 is subtracted from fig. 5 to obtain a schematic view of a door opening area in fig. 6, and as can be seen from fig. 6, the door opening area is similar to a rectangle which is elongated in the transverse direction, and a dividing line of the binary image in fig. 7 can be obtained according to the length and the width of the rectangle and the thickness of a wall body of the rectangular area, wherein the line a in fig. 7 is a region dividing line of the binary image, and the region dividing line divides one communication region into two communication regions, namely, a target dividing region a is divided, so that at least one target dividing region in the house type image is divided based on the dividing method.
And S140, performing image segmentation on the household pattern to be segmented based on the region segmentation line to obtain at least one target segmentation region of the household pattern to be segmented.
The target division area may be an area desired or specified to be divided from the house type drawing to be divided, and the target division area may be one, two, or more than two areas, for example. The method can be used for carrying out image segmentation on the house type map based on the region segmentation line to obtain at least one target segmentation region of the house type map, achieves the effect of automatically segmenting the navigation map, is simple to operate, and saves great time cost and labor cost.
According to the technical scheme, the through area in the to-be-segmented house type graph is obtained to carry out binarization on the to-be-segmented house type graph to obtain a binarized image, the opening operation is carried out on the binarized image to obtain the door opening area of the binarized image, the area dividing line in the binarized image is determined based on the door opening area, the image segmentation is carried out on the to-be-segmented house type graph based on the area dividing line to obtain at least one target segmentation area of the to-be-segmented house type graph, automatic segmentation of the to-be-segmented house type graph is achieved, operation is simple, and great time cost and labor cost are saved.
Implement two
Fig. 8 is a flowchart of a house type graph segmentation method according to a second embodiment of the present invention, where the embodiments of the present invention may be combined with each of the alternatives in the foregoing embodiments. In an embodiment of the present invention, the determining, based on the door opening area, an area dividing line in the binarized image includes: obtaining a rectangular image of the door opening area based on the corrosion image obtained by performing open operation on the binarized image; determining a region dividing line in the binarized image based on a first pixel width of the rectangular image, a first pixel height of the rectangular image, a pixel number of each corrosion and a first preset pixel width of a wall thickness of the door opening region.
As shown in fig. 8, the method in the embodiment of the present invention specifically includes the following steps:
s210, acquiring a to-be-segmented house type diagram, wherein the to-be-segmented house type diagram comprises a door opening area.
S220, binarizing the to-be-segmented house type graph based on the passing area in the to-be-segmented house type graph to obtain a binarized image.
S230, performing open operation on the binary image to obtain a door opening area of the binary image, obtaining a rectangular image of the door opening area based on a corrosion image obtained by performing open operation on the binary image, and determining an area dividing line in the binary image based on a first pixel width of the rectangular image, a first pixel height of the rectangular image, the number of each corrosion pixels and a first preset pixel width of a wall thickness of the door opening area.
The rectangular image of the door opening area may be, for example, a laterally elongated rectangle as shown in fig. 6.
The first pixel width of the rectangular image may be the pixel width of the door opening region, which may be directly taken from fig. 6. The first pixel height of the rectangular image may be the pixel height of the door opening area, which may be directly obtained from fig. 6.
The number of each etching pixel may be the number of each etching pixel when etching fig. 3, where the number of each etching pixel may be set according to the user requirement, and is not limited herein, and in practical application, in order to ensure that the connected area and the door hole area are not simultaneously etched to disappear, the number of each etching pixel should not be too large, so that the number of each etching pixel is increased within a reasonable range, the iteration number may be reduced, and the operation may be accelerated, and in this embodiment, the number of each etching pixel may be set to 1.
The first preset pixel width may be a wall thickness of a door opening area set in advance, where the first preset pixel width is a pixel value of a lowest thickness of the wall thickness of the door opening area conforming to the national standard, that is, the first preset pixel width is a pixel value of a lowest thickness of the wall thickness of the door opening not lower than the national standard. The first preset pixel width can be determined according to the lowest wall thickness of the door opening area in the national standard and the scale of the wall thickness of the door opening area and the graphic pixels, and the specific determination method can be as follows: assuming that the thickness of the wall body in the door opening area is Dmax, the thickness of the wall body with the thickest wall is Dmin, according to the scale k, the pixel width of the thickest wall is tmax=dmax/k, and the pixel width of the thinnest wall is tmin=dmin/k, namely, the first preset pixel width is Tmin. Since the thickness of the thinnest wall body is not less than 10cm in real life, the thickness of the thickest wall body is not more than 30cm, the maximum scale can be set to 100 mm/pixel theoretically (the thinnest wall can be displayed as a pixel width in the figure), but the setting error of the scale is larger, the scale is not generally adopted, the scale is recommended to be ensured to be not more than 50 mm/pixel in practical application, and the scale can be set to 20 mm/pixel in the embodiment of the invention.
Therefore, based on the first pixel width of the rectangular image, the first pixel height of the rectangular image, the number of corroded pixels each time and the first preset pixel width of the wall thickness of the door opening area, the area dividing line in the binarized image can be accurately determined, so that the house type image to be divided can be accurately divided.
Optionally, the determining the area dividing line in the binarized image based on the first pixel width of the rectangular image, the first pixel height of the rectangular image, the number of pixels corroded each time, and the first preset pixel width of the wall thickness of the door opening area may specifically be: determining a position of a region dividing line in the binarized image based on a first pixel width of the rectangular image and a first pixel height of the rectangular image; and determining the length of a region dividing line in the binarized image based on the first pixel width of the rectangular image, the pixel number of each corrosion and the first preset pixel width of the wall thickness.
For example, referring to the schematic diagram of the determining method of the area dividing line shown in fig. 9, for convenience of display and calculation, the gray values of the a-chart in fig. 3 and fig. 4 may be changed and superimposed to form fig. 9, as shown by the a-chart in fig. 9, where a is the pixel width of the wall body of the door opening area, and b is the rectangular pixel width, i.e. the first pixel width, in fig. 6, so that b-a is the eroded pixel width X, where x=the number of times of erosion per number of eroded pixels. As shown in b of fig. 9, c is the pixel height of the rectangle in fig. 6, i.e. the first pixel height, d is the pixel width of the door opening, d-c is the eroded pixel width X, and the center point of the rectangle is the center point of the door opening. The location of the region dividing line is thus determined within the rectangular extent of the rectangular image, i.e. within the first pixel width and the first pixel height.
From the above relationship, b-a=d-c=x. Setting the number of pixels per erosion as E, since the small rectangle disappears in the process of a-b in fig. 4, the shorter side c < = 2*E of the small rectangle can be known, based on the formula:
Figure BDA0002552804930000101
from the above conditions, it is obtained that Tmax > b-d > = Tmin-2×e, b-Tmax < d < = 2×e+b-Tmin
Since the region dividing line is to divide the target divided region, the length of the region dividing line should be larger than d, and as a result of b-Tmax < d < = 2×e+b-Tmin, it is known that the length of the region dividing line is a straight line slightly larger than 2×e+b-Tmin, and the function of dividing the target divided region is achieved, and the two target divided regions are divided.
When one region is divided into two regions, the two regions are continuously corroded, and the two regions are only smaller and smaller by the cyclic corrosion function, the number of connected regions is changed from 1 to 0, and at this time, the region is not subdivided, so that the region can be regarded as one target divided region (room).
In this way, the target division area can be accurately divided according to the determined position and length of the area dividing line.
S240, image segmentation is carried out on the house type graph to be segmented based on the region segmentation line, and at least one target segmentation region of the house type graph to be segmented is obtained.
According to the technical scheme, the rectangular image of the door opening area is obtained by performing open operation on the binary image, and the area dividing line in the binary image can be accurately determined based on the first pixel width of the rectangular image, the first pixel height of the rectangular image, the number of each corroded pixel and the first preset pixel width of the wall thickness of the door opening area, so that the house type image to be divided can be accurately divided.
Example III
Fig. 10 is a flowchart of a house type graph segmentation method according to a third embodiment of the present invention, where the embodiments of the present invention may be combined with each of the alternatives in the foregoing embodiments. In the embodiment of the present invention, after the image segmentation is performed on the to-be-segmented house type graph based on the region segmentation line to obtain at least one target segmentation region of the to-be-segmented house type graph, the method further includes: the method comprises the steps that a corridor area is included in a house pattern to be segmented, when the difference value between the width of a door opening area and the width of the corridor area is in a preset width range, an etching image obtained by performing open operation on the basis of the binarized image is obtained, an L-shaped image of the house pattern to be segmented is obtained, and when the absolute value of the difference value between the width of a first pixel of a rectangle in the L-shaped image and the width of the etching pixel is larger than the first preset pixel width and smaller than the second preset pixel width of the thickness of a wall body, the rectangle in the L-shaped image is determined to be the door opening area; wherein the pixel width is determined based on the number of pixels per etching and the number of times of etching.
As shown in fig. 10, the method in the embodiment of the present invention specifically includes the following steps:
s310, acquiring a to-be-segmented house type diagram, wherein the to-be-segmented house type diagram comprises a door opening area.
S320, binarizing the to-be-segmented house type graph based on the passing area in the to-be-segmented house type graph to obtain a binarized image.
S330, performing open operation on the binary image to obtain a door opening area of the binary image, obtaining a rectangular image of the door opening area based on the corrosion image obtained by performing open operation on the binary image, and determining an area dividing line in the binary image based on a first pixel width of the rectangular image, a first pixel height of the rectangular image, the number of each corrosion pixels and a first preset pixel width of a wall thickness of the door opening area.
And S340, carrying out image segmentation on the household pattern to be segmented based on the region segmentation line to obtain at least one target segmentation region of the household pattern to be segmented.
S350, when the difference value between the width of the door opening area and the width of the corridor area is in a preset width range, an etching image obtained by performing open operation on the binary image is obtained, an L-shaped image of the door opening area to be segmented is obtained, and when the absolute value of the difference value between the width of a first pixel of a rectangle in the L-shaped image and the width of the etching pixel is larger than the first preset pixel width and smaller than the second preset pixel width of the wall thickness, the rectangle in the L-shaped image is determined to be the door opening area; wherein the pixel width is determined based on the number of pixels per etching and the number of times of etching.
By way of example, the preset width range may be a range of a difference between the width of the preset door opening region and the width of the corridor region, for example, the preset width range may be 0-1cm, i.e., the difference between the width of the door opening region and the width of the corridor region is within 0-1 cm.
The pixel width of the etching is determined based on the pixel number of each etching and the number of etching times, specifically, may be determined based on the following formula: etched pixel width = number of times etched by 2 per number of etched pixels.
The second preset pixel width may be a pixel value of a wall thickness of the door opening area set in advance, where the second preset pixel width is a pixel value of a highest thickness of the wall thickness of the door opening area conforming to the national standard, that is, the second preset pixel width is a pixel value of a highest thickness of the wall thickness of the door opening not higher than the national standard. For example, the second preset pixel width may be Tmax in the second embodiment, or may be any value smaller than Tmax, and the determination method thereof is identical to the determination method of Tmin, which will not be described in detail herein.
Referring to the erosion image when the difference between the width of the door opening area and the width of the corridor area is not within the preset width range shown in fig. 11, normally, if the width of the door opening area adjacent to the corridor area is smaller than the width of the corridor area, the door opening area is eroded first, leaving a rectangle of the corridor area as shown in fig. 11.
Referring to the corrosion image of fig. 12, taking the house pattern to be segmented as an example of a building, when the difference between the width of the door opening area and the width of the corridor area is within the preset width range, there is a corridor area in the house pattern to be segmented, and when the target segmentation area in the house pattern to be segmented is segmented, the width of the door opening area is very close to the width of the corridor area, that is, when the width of the door opening is close to the width of the corridor, at this time, when the house pattern to be segmented is corroded, the corrosion result may be L-shaped as shown in fig. 12, and at this time, the L-shaped area may be corroded transversely and vertically to obtain two rectangles in the longitudinal direction and the transverse direction. With the above-mentioned embodiment two, b-a=d-c=x, so b-x=a, it is explained that the difference between the width of the rectangle etched in the door opening area and the etched pixel width is equal to the pixel thickness of the wall body in the door opening area, and based on the thickness of the wall body in the national standard, it is possible to determine whether this area is the door opening according to whether the absolute value of the difference between b-X is equal to or less than the second preset pixel width (for example, tmax) and equal to or more than the first preset pixel width (for example, tmin), that is, the absolute value of the difference between the pixel width and the etched pixel width of the two rectangles in the L-shape in fig. 12 is determined, and if the absolute value of the difference between the pixel width and the etched pixel width of the rectangle in the lateral direction is equal to or less than the second preset pixel width and equal to or more than the first preset pixel width, the lateral rectangle is the thickness of the wall body in the door opening area that meets the national standard, and the lateral rectangle is determined to be the door opening area.
When the rectangle is a door opening region, the target division region may be further divided by using the region dividing line in the second embodiment, and if the rectangle is not a door opening region, the target division region cannot be further divided, that is, the division of the target division region is completed.
When the absolute value of the difference value between the width of the door opening area and the width of the corridor area is larger than the first preset pixel width and smaller than the second preset pixel width of the wall thickness, determining the rectangle in the L-shaped image as the door opening area; thus, whether the rectangular area is the door opening area or not can be accurately determined, so that whether the target segmentation area is segmented or not can be accurately determined.
It can be understood that, after determining that the target division area is not subdivided, the above-mentioned division method is used to divide each target division area, so as to obtain a division result schematic diagram of the to-be-divided house type diagram as shown in fig. 13, and as can be seen from fig. 13, each target division area in the to-be-divided house type diagram can be divided.
According to the technical scheme, when the difference value between the width of the door opening area and the width of the corridor area is in the preset width range, an L-shaped image of the house type image to be segmented is obtained based on a corrosion image obtained by performing open operation on the binarized image, and when the absolute value of the difference value between the width of a first pixel of a rectangle in the L-shaped image and the width of the corrosion pixel is larger than the first preset pixel width and smaller than the second preset pixel width of the wall thickness, the rectangle in the L-shaped image is determined to be the door opening area; thus, whether the rectangular area is the door opening area or not can be accurately determined, so that whether the target segmentation area is segmented or not can be accurately determined.
Example IV
Fig. 14 is a flowchart of a house type graph segmentation method according to a fourth embodiment of the present invention, where the embodiments of the present invention may be combined with each of the alternatives in the foregoing embodiments. In an embodiment of the present invention, optionally, the history navigation map includes a corridor area, when a difference between a width of the door opening area and a width of the corridor area is within a preset width range, based on an erosion image obtained by performing an open operation on the binarized image, an "L" image of the to-be-segmented house type map is obtained, and when an absolute value of a difference between a first pixel width and an erosion pixel width of a rectangle in the "L" image is greater than the first preset pixel width and less than a second preset pixel width of a wall thickness, the method further includes, after determining that the rectangle in the "L" image is the door opening area: determining the pixel width corresponding to the length or the width of the target segmentation area; and if the pixel width corresponding to the length or the width of the target segmentation area is smaller than a preset width threshold value, determining that the segmentation of the target segmentation area in the binarized image is completed.
As shown in fig. 14, the method in the embodiment of the present invention specifically includes the following steps:
s410, acquiring a to-be-segmented house type diagram, wherein the to-be-segmented house type diagram comprises a door opening area.
S420, binarizing the to-be-segmented house type graph based on the passing area in the to-be-segmented house type graph to obtain a binarized image.
S430, performing open operation on the binary image to obtain a door opening area of the binary image, obtaining a rectangular image of the door opening area based on the corrosion image obtained by the open operation on the binary image, and determining an area dividing line in the binary image based on a first pixel width of the rectangular image, a first pixel height of the rectangular image, the number of each corrosion pixels and a first preset pixel width of a wall thickness of the door opening area.
S440, performing image segmentation on the to-be-segmented house type graph based on the region segmentation line to obtain at least one target segmentation region of the to-be-segmented house type graph.
S450, when the difference value between the width of the door opening area and the width of the corridor area is in a preset width range, an etching image obtained by performing open operation on the binary image is obtained, an L-shaped image of the door opening area to be segmented is obtained, and when the absolute value of the difference value between the width of a first pixel of a rectangle in the L-shaped image and the width of the etching pixel is larger than the first preset pixel width and smaller than the second preset pixel width of the wall thickness, the rectangle in the L-shaped image is determined to be the door opening area; wherein the pixel width is determined based on the number of pixels per etching and the number of times of etching.
S460, determining the pixel width corresponding to the length or the width of the target segmentation area; and if the pixel width corresponding to the length or the width of the target segmentation area is smaller than a preset width threshold value, determining that the segmentation of the target segmentation area in the binarized image is completed.
The preset width threshold may be, for example, a pixel width corresponding to a length of a preset target divided region or a width threshold of a pixel width corresponding to a width of the target divided region. After the target division area is divided, the pixel width corresponding to the length of the target division area or the pixel width corresponding to the width of the target division area can be extracted, and if the pixel width corresponding to the length of the target division area or the pixel width corresponding to the width of the target division area is smaller than a preset width threshold, the division of the target division area in the binary image is determined to be completed.
It will be understood that the target division areas are areas such as bedrooms, living rooms, and toilets that are required by the user, where the lengths and widths of the areas have certain thresholds, for example, the lengths of the areas such as the bedrooms, the living rooms, and the toilets are all greater than 3 meters, the preset threshold of the pixel width corresponding to the lengths is 150, the preset threshold of the pixel width corresponding to the lengths is 100, and if the lengths of the divided target division areas are less than 150, or the pixel width corresponding to the widths is less than 100, the target division areas cannot be subdivided, where the target division areas whose lengths or the pixel widths corresponding to the widths of the target division areas are less than the preset width threshold can be regarded as irregular defects in the historical navigation map, such as obstacles.
It will be understood that, referring to the schematic diagram of fig. 15, where the length or width of the target division area corresponds to a pixel width smaller than the preset width threshold, as shown in fig. 15 a, there is a defect such as B in the target division area, when the target division area is continuously divided, the target division area is first eroded to obtain two rectangles in fig. B, where the pixel width corresponding to the length or width of the two rectangles may be compared with the preset width threshold, and if the pixel width is smaller than the preset width threshold, the target division area in fig. a may not be subdivided into the areas in fig. B.
Therefore, whether the target segmentation area in the binary image is segmented is determined by judging whether the pixel width corresponding to the length or the width of the target segmentation area is smaller than a preset width threshold value, and whether the target segmentation area can be continuously subdivided can be accurately quantized or not can be known.
According to the technical scheme provided by the embodiment of the invention, whether the target segmentation area in the binarized image is segmented is determined by judging whether the pixel width corresponding to the length or the width of the target segmentation area is smaller than the preset width threshold value, so that whether the target segmentation area can be continuously subdivided can be accurately quantized.
Example five
Fig. 16 is a flowchart of a house type graph splitting method according to a fifth embodiment of the present invention, and the embodiments of the present invention may be combined with each of the alternatives in the foregoing embodiments. In the embodiment of the present invention, optionally, a pixel width corresponding to the length or the width of the determined target segmentation area; if the pixel width corresponding to the length or width of the target segmentation area is smaller than a preset width threshold, after determining that segmentation of the target segmentation area in the binarized image is completed, the method further includes: and performing region segmentation on the at least one target segmentation region based on a center diffusion method.
As shown in fig. 16, the method in the embodiment of the present invention specifically includes the following steps:
s510, acquiring a to-be-segmented house type graph, wherein the to-be-segmented house type graph comprises a door opening area.
S520, binarizing the to-be-segmented house type graph based on the passing area in the to-be-segmented house type graph to obtain a binarized image.
S530, performing open operation on the binary image to obtain a door opening area of the binary image, obtaining a rectangular image of the door opening area based on the corrosion image obtained by performing open operation on the binary image, and determining an area dividing line in the binary image based on a first pixel width of the rectangular image, a first pixel height of the rectangular image, the number of each corrosion pixels and a first preset pixel width of a wall thickness of the door opening area.
S540, performing image segmentation on the to-be-segmented house type graph based on the region segmentation line to obtain at least one target segmentation region of the to-be-segmented house type graph.
S550, when the difference value between the width of the door opening area and the width of the corridor area is in a preset width range, an etching image obtained by performing open operation on the binary image is obtained, an L-shaped image of the door opening area to be segmented is obtained, and when the absolute value of the difference value between the width of a first pixel of a rectangle in the L-shaped image and the width of the etching pixel is larger than the first preset pixel width and smaller than the second preset pixel width of the wall thickness, the rectangle in the L-shaped image is determined to be the door opening area; wherein the pixel width is determined based on the number of pixels per etching and the number of times of etching.
S560, determining the pixel width corresponding to the length or the width of the target segmentation area; and if the pixel width corresponding to the length or the width of the target segmentation area is smaller than a preset width threshold value, determining that the segmentation of the target segmentation area in the binarized image is completed.
S570, performing region segmentation on the at least one target segmentation region based on a center diffusion method.
For example, when the target division area is divided, there may be a case where the target division area is not completely well divided, for example, an area a in fig. 13 is a living room and a balcony area, where a is a living room area, and b is a balcony area, which is not well divided, because the width of the balcony is smaller than the width of the balcony door, and the balcony area has been completely corroded before the balcony door has not been completely corroded. For another example, where the width of the door opening area adjacent to the corridor area is greater than the width of the corridor area, the corridor area may have eroded completely before the door opening area has eroded completely, thus joining the two target segment areas together. Therefore, in order to divide the target division area which is not completely divided well, it is necessary to divide the target division area which is not completely divided twice, taking the living room and balcony in fig. 13 as an example, and in order to divide the living room and balcony, a center diffusion method is used to divide the living room and balcony.
The specific center diffusion method may be that the pixel coordinates of a center point of the contour of the area a in fig. 13 are determined as (x, y), where the center point may be that when a non-redispersible target divided area is circularly eroded, the number of connected areas is changed from 1 to 0, and before the last erosion (before the target divided area is completely disappeared), a small area of the target divided area is obtained, and any point in the area may be selected as a center point of the target divided area. Since a small area of the target division area is obtained before the last etching, the area is small, any point is selected in the area, and the point-to-point difference is not large.
Based on the selected center point, the center point is respectively diffused to the periphery, namely the horizontal pixel coordinate of the left boundary line of the center point is X L1 X-1, the abscissa of the right boundary line is X R1 =x+1, the vertical pixel coordinate of the upper boundary line is Y U1 Y-1, the vertical pixel coordinate of the lower boundary line is Y D1 The four boundary lines form a small positive rectangle, the pixel values on the outline corresponding to the pixel coordinates on the four boundary lines of the positive rectangle are judged, if the pixel coordinates on one boundary line appear white (the boundary contour line of the target divided area is white), the boundary is indicated to have already spread to the contour boundary of the target divided area, the boundary line stops spreading, otherwise, the spreading is continuedEach iteration shifts the left boundary by one pixel to the left, the right boundary by one pixel to the right, the upper boundary by one pixel to the upper boundary and the lower boundary by one pixel to the lower boundary, and the calculation is cycled until each boundary is diffused to the contour boundary line of the target division area, at this time, the calculation of the maximum inscribed rectangle is completed, and referring to the result schematic diagram of the central diffusion maximum inscribed rectangle shown in fig. 17, fig. 17 is an area a in fig. 13, and as can be seen from fig. 17, a is the maximum inscribed rectangle obtained by using the central diffusion method, and the maximum inscribed rectangle divides the living room and the balcony.
Referring to the schematic view of the area except the inscribed maximum rectangular area shown in fig. 18, the area a in fig. 13 is subtracted from fig. 17 to obtain the area of fig. 18, and the area a in fig. 19 is eroded to obtain the eroded image of the area except the inscribed maximum rectangular area, and as can be seen from fig. 19, after dividing the area a in fig. 13, other areas c are left in the balcony area except the living room area, and these areas c can be judged whether these areas c are a room or a target division area intended by the user by judging whether the pixel width corresponding to the length or width of the target division area is smaller than the preset width threshold.
The balcony area is also divided by the center diffusion method, so that a final division result schematic diagram of the house type diagram to be divided shown in fig. 20 can be formed, and as can be seen from fig. 20, each target division area is divided.
Therefore, the incompletely segmented target segmentation areas can be subjected to regional segmentation by using a central diffusion method, so that all the target segmentation areas of the whole historical navigation map are perfectly and accurately segmented.
When the center point is used for dividing the target divided region by using the center diffusion method, the difference between the selected center points is not very large, so that the different regions of the target divided region can be accurately divided without great influence on the region division of the target divided region. Although the selection of the center point has no great influence on the region segmentation of the target segmentation region, the selection of the center point can influence the calculation result of the maximum inscribed rectangle, thereby influencing different region segmentation conditions in the target segmentation region. Referring to fig. 21, a diagram a in fig. 21 shows a calculation result of a maximum inscribed rectangle formed when the center point is selected and the maximum inscribed rectangle is biased to the upper side of the target divided region, wherein, for example, 1 is a living room region and 2 is a balcony region. The b-chart in fig. 21 shows the calculation result of the maximum inscribed rectangle formed when the center point is selected and the center point is deviated to the lower side of the target divided area, wherein, for example, 3 is a living room area and 4 is a balcony area.
The two results in fig. 21 are generated due to the difference in the positions of the selected center points, and the two different areas of the living room and the balcony are divided, but the dividing of the living room and the balcony area is not affected, the target dividing area (living room area and balcony area) in fig. 21 can be divided no matter how the center points are selected, and only the proportion of the divided balcony area and living room area in the whole target dividing area is different.
According to the technical scheme provided by the embodiment of the invention, the target segmentation areas which are not completely segmented can be subjected to regional segmentation by utilizing the central diffusion method, so that all the target segmentation areas of the whole household pattern to be segmented are completely and accurately segmented.
Example six
Fig. 22 is a flowchart of a house type graph classifying method according to a sixth embodiment of the present invention, and the embodiment of the present invention may be combined with each of the alternatives in the foregoing embodiment. In the embodiment of the invention, after the target segmentation areas in the to-be-segmented house type graph are equally segmented based on the central diffusion method, the segmented target segmentation areas can be classified by using the method of the embodiment of the invention.
As shown in fig. 22, the method in the embodiment of the present invention specifically includes the following steps:
S610, inputting the target segmentation area into a trained image classification model, and classifying the target segmentation area based on the image classification model.
The target division area here is illustratively obtained based on the division methods of the first to fifth embodiments described above. The image classification model can be a model for classifying the target segmentation image input into the model, for example, the model can be a support vector machine model, the support vector machine can realize automatic classification of the target segmentation area after receiving the input target segmentation area, and the trained support vector machine considers experience risks and structural risks in the training process and minimizes the risks, so that the trained image classification model has good stability and low error rate after the image classification model is trained by using the historical target segmentation area. Geometrically, the stability of the support vector machine is realized in that the support vector machine requires the maximum margin when constructing the hyperplane decision boundary, so that a sufficient space is reserved between interval boundaries to accommodate the test sample, and the test sample can be accommodated to the maximum extent; and secondly, the support vector machine uses a hinge loss function as proxy loss, the support vector machine has sparsity due to the value characteristic of the hinge loss function, namely, the decision boundary is only determined by the support vector, and the rest sample points are not participated, so that the experience risk is minimized. In the use process, the robustness and sparsity of the support vector machine ensure reliable solving results and greatly reduce the calculated amount and memory overhead of the kernel matrix.
The image classification model is obtained by adding labels to at least one historical target segmentation region, extracting features of the labeled at least one historical target segmentation region, determining region contour information, constructing a training sample set based on the region contour information and the labels, and training based on the training sample set.
The history target divided area here may be a history target divided area obtained by the above-described dividing methods of the first to fifth embodiments based on the history-divided house type map. When the history object divided regions obtained by the dividing methods of the first to fifth embodiments are two or more, different history object divided regions may correspond to the same or different labels, respectively. Taking a building house type diagram as an example, for example, as shown in fig. 2, fig. 2 may be a history house type diagram to be segmented, a in fig. 2 is a history target segmentation area, and the history house type diagram to be segmented is a map of any building, where the history target segmentation area may be each room, for example, the segmented history target segmentation area may be marked as a room in a unified manner, or the segmented history target segmentation area may be subdivided into a kitchen, a bedroom, a bathroom, a balcony, and the like. When training the image classification model by utilizing the historical target segmentation area, the historical house type graph is segmented by utilizing the segmentation method to obtain at least one historical target segmentation area, the label corresponding to the at least one historical target segmentation area is marked, and then the marked at least one historical target segmentation area is used for training the image classification model so as to classify the target segmentation area of the house type graph to be segmented by utilizing the trained image classification model. For example, there are 3 historical target segmentation areas in a certain historical house type graph, which are respectively: the method comprises the steps of marking each historical target dividing region, training an image dividing model by using at least one marked historical target dividing region, and enabling the image classifying model to complete classification of the historical target dividing region through learning the marked at least one historical target dividing region, wherein the historical target dividing region A is a master bedroom, the historical target dividing region B is a living room, and the historical target dividing region C is a toilet.
The region profile information may be profile information of at least one historical target segmented region obtained by extracting features of at least one historical target segmented region, and specifically may be, for example, a length, a width, an area, a ratio of length to width, a ratio of length to area, a ratio of profile area to total area of a corresponding historical user pattern, a distance from a center of a profile to a center of a corresponding historical user pattern, a number of corner points of the profile, and the like of the profile of the historical target segmented region. The corresponding label can be established between the area profile information and the historical target segmentation area, for example, the label can be a label with the ratio of length to width in a preset range, for example, the label can be a bedroom with the ratio of length to width in a range of 1-1.5, a living room with the ratio of the profile area to the total area of the corresponding historical user pattern in a range of 0.2-0.3, and the like, so that the corresponding relation of the label is established, and the label corresponding to any historical target segmentation area can be known clearly and conveniently according to the extracted area profile information.
The training sample set is constructed by utilizing the extracted regional contour information of at least one historical target segmentation region, and the original image classification model is trained based on the training sample set, so that the trained image classification model can be obtained, and the trained image classification model is conveniently used for completing classification of the target segmentation region, the operation is simple, and the great time cost and the labor cost are saved.
It may be appreciated that, when the original image classification model is trained, the historical target segmentation area is input, the original image classification model is trained, the user expects to output the label of the input historical target segmentation area, after the historical target segmentation area is input into the image classification model, the output result converges with the output result expected by the user, if the output result converges within a certain threshold, for example, 80%, i.e., the output result accords with 80% of the output result expected by the user, the image classification model is trained, and if the output result converges not within a certain threshold, the original image classification model is trained continuously until the user requirement is met.
According to the technical scheme, the target segmentation areas are input into the trained image classification model, and classified based on the image classification model, so that automatic classification of the target segmentation areas is completed, the operation is simple, and great time cost and labor cost are saved.
Example seven
Fig. 23 is a schematic structural diagram of a house type graph splitting device according to a seventh embodiment of the present invention, as shown in fig. 23, the device includes: the to-be-segmented house type graph acquisition module 31 and the binarized image acquisition module 32, the region segmentation line determination module 33 and the target segmentation region determination model 34.
The to-be-segmented house type diagram obtaining module 31 is configured to obtain a to-be-segmented house type diagram, where the to-be-segmented house type diagram includes a door opening area;
the binarization image acquisition module 32 is configured to binarize the to-be-segmented house type graph based on a passing area in the to-be-segmented house type graph, so as to obtain a binarization image;
the region dividing line determining module 33 is configured to perform an opening operation on the binarized image to obtain a door opening region of the binarized image, and determine a region dividing line in the binarized image based on the door opening region;
the target segmentation area determining module 34 is configured to perform image segmentation on the to-be-segmented house type graph based on the area segmentation line, so as to obtain at least one target segmentation area of the to-be-segmented house type graph.
On the basis of the technical solution of the above embodiment, the area dividing line determining module 33 includes:
the rectangular image acquisition unit is used for acquiring a rectangular image of the door opening area based on the corrosion image obtained by performing open operation on the binarized image;
and the area dividing line determining unit is used for determining an area dividing line in the binarized image based on the first pixel width of the rectangular image, the first pixel height of the rectangular image, the number of corroded pixels each time and the first preset pixel width of the wall thickness of the door opening area.
On the basis of the technical solution of the above embodiment, the area dividing line determining unit includes:
a region dividing line position determining subunit configured to determine a position of a region dividing line in the binarized image based on a first pixel width of the rectangular image and a first pixel height of the rectangular image;
and the area dividing line length determining subunit is used for determining the length of the area dividing line in the binarized image based on the first pixel width of the rectangular image, the pixel number of each corrosion and the first preset pixel width of the wall thickness.
Optionally, the to-be-segmented house type graph includes a corridor area.
On the basis of the technical solution of the foregoing embodiment, the apparatus further includes:
the door opening area determining module is used for obtaining an L-shaped image of the house type image to be segmented based on a corrosion image obtained by performing open operation on the binarized image when the difference value between the width of the door opening area and the width of the corridor area is in a preset width range, and determining that the rectangle in the L-shaped image is the door opening area when the absolute value of the difference value between the width of a first pixel of the rectangle in the L-shaped image and the width of the corrosion pixel is larger than the first preset pixel width and smaller than the second preset pixel width of the wall thickness; wherein the pixel width is determined based on the number of pixels per etching and the number of times of etching.
On the basis of the technical solution of the foregoing embodiment, the apparatus further includes:
the target segmentation region segmentation completion determination module is used for determining the pixel width corresponding to the length or the width of the target segmentation region; and if the pixel width corresponding to the length or the width of the target segmentation area is smaller than a preset width threshold value, determining that the segmentation of the target segmentation area in the binarized image is completed.
On the basis of the technical solution of the foregoing embodiment, the apparatus further includes:
and the region segmentation module is used for carrying out region segmentation on the at least one target segmentation region based on a center diffusion method.
The household pattern segmentation device provided by the embodiment of the invention can execute the household pattern segmentation method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example eight
Fig. 24 is a schematic structural diagram of an apparatus according to an eighth embodiment of the present invention, and as shown in fig. 24, the apparatus includes a processor 70, a memory 71, an input device 72, and an output device 73; the number of processors 70 in the device may be one or more, one processor 70 being taken as an example in fig. 24; the processor 70, memory 71, input means 72 and output means 73 in the device may be connected by a bus or other means, in fig. 24 by way of example.
The memory 71 is a computer-readable storage medium, and may be used to store a software program, a computer-executable program, and modules, such as program instructions/modules corresponding to the family pattern segmentation method in the embodiment of the present invention (for example, the family pattern to be segmented acquisition module 31 and the binarized image acquisition module 32, the region segmentation line determination module 33, and the target segmentation region determination model 34). The processor 70 executes various functional applications of the device and data processing, i.e., implements the above-described house pattern segmentation method and/or house pattern classification method, by running software programs, instructions, and modules stored in the memory 71.
The memory 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 71 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 71 may further include memory remotely located relative to processor 70, which may be connected to the device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 72 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the apparatus. The output means 73 may comprise a display device such as a display screen.
Example nine
A ninth embodiment of the present invention also provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a house pattern segmentation method and/or a house pattern classification method.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the above-described method operations, and may also perform the related operations in the house type graph segmentation method and/or the house type graph classification method provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the apparatus for dividing a house type graph, each unit and module included are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (10)

1. The house type graph segmentation method is characterized by comprising the following steps of:
obtaining a to-be-segmented house type diagram, wherein the to-be-segmented house type diagram comprises a door opening area;
Binarizing the house type graph to be segmented based on a passing area in the house type graph to be segmented to obtain a binarized image;
performing open operation on the binarized image to obtain a door opening area of the binarized image, and determining an area dividing line in the binarized image based on the door opening area;
and carrying out image segmentation on the to-be-segmented house type graph based on the region segmentation line to obtain at least one target segmentation region of the to-be-segmented house type graph.
2. The method of claim 1, wherein the determining a region split line in the binarized image based on the door opening region comprises:
obtaining a rectangular image of the door opening area based on the corrosion image obtained by performing open operation on the binarized image;
and determining a region dividing line in the binarized image based on the first pixel width of the rectangular image, the first pixel height of the rectangular image, the pixel number of each corrosion and the first preset pixel width of the wall thickness.
3. The method of claim 2, wherein the determining the region split line in the binarized image based on the first pixel width of the rectangular image, the first pixel height of the rectangular image, the number of pixels per erosion, and the first preset pixel width of the wall thickness of the door opening region comprises:
Determining a position of a region dividing line in the binarized image based on a first pixel width of the rectangular image and a first pixel height of the rectangular image;
and determining the length of a region dividing line in the binarized image based on the first pixel width of the rectangular image, the pixel number of each corrosion and the first preset pixel width of the wall thickness.
4. A method according to claim 3, wherein the pattern of rooms to be segmented includes corridor areas, the method further comprising:
when the difference value between the width of the door opening area and the width of the corridor area is in a preset width range, an L-shaped image of the house type image to be segmented is obtained based on a corrosion image obtained by performing open operation on the binarized image, and when the absolute value of the difference value between the width of a first pixel of a rectangle in the L-shaped image and the width of a corrosion pixel is larger than the first preset pixel width and smaller than the second preset pixel width of the wall thickness, the rectangle in the L-shaped image is determined to be the door opening area;
wherein the pixel width is determined based on the number of pixels per etching and the number of times of etching.
5. The method as recited in claim 1, further comprising:
determining the pixel width corresponding to the length or the width of the target segmentation area;
and if the pixel width corresponding to the length or the width of the target segmentation area is smaller than a preset width threshold value, determining that the segmentation of the target segmentation area in the binarized image is completed.
6. The method as recited in claim 1, further comprising:
and performing region segmentation on the at least one target segmentation region based on a center diffusion method.
7. The household pattern classification method is characterized by comprising the following steps of:
inputting a target segmentation area into a trained image classification model, and classifying the target segmentation area based on the image classification model;
the image classification model is obtained by adding labels to at least one historical target segmentation region, extracting features of the labeled at least one historical target segmentation region, determining region contour information, constructing a training sample set based on the region contour information and the labels, and training based on the training sample set;
the target segmentation area and the at least one historical target segmentation area are both obtained based on the segmentation method of claims 1-6.
8. The house type graph dividing device is characterized in that the house type graph comprises a door opening area; the device comprises:
the system comprises a to-be-segmented house type diagram acquisition module, a door opening area acquisition module and a door opening area acquisition module, wherein the to-be-segmented house type diagram acquisition module is used for acquiring a to-be-segmented house type diagram;
the binarization image acquisition module is used for binarizing the house type graph to be segmented based on a passing area in the house type graph to be segmented to obtain a binarization image;
the area dividing line determining module is used for performing opening operation on the binary image to obtain a door opening area of the binary image, and determining an area dividing line in the binary image based on the door opening area;
and the target segmentation area determining module is used for carrying out image segmentation on the household pattern to be segmented based on the area segmentation line to obtain at least one target segmentation area of the household pattern to be segmented.
9. An apparatus, the apparatus comprising:
one or more processors;
a storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the house pattern segmentation method of any one of claims 1-6 and/or the house pattern classification method of claim 7.
10. A storage medium containing computer-executable instructions, which when executed by a computer processor are for performing the house pattern segmentation method of any one of claims 1-6 and/or the house pattern classification method of claim 7.
CN202010582320.8A 2020-06-23 2020-06-23 House type graph dividing method, household type graph classifying method, household type graph dividing device, household type graph dividing equipment and storage medium Active CN111754526B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010582320.8A CN111754526B (en) 2020-06-23 2020-06-23 House type graph dividing method, household type graph classifying method, household type graph dividing device, household type graph dividing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010582320.8A CN111754526B (en) 2020-06-23 2020-06-23 House type graph dividing method, household type graph classifying method, household type graph dividing device, household type graph dividing equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111754526A CN111754526A (en) 2020-10-09
CN111754526B true CN111754526B (en) 2023-06-30

Family

ID=72676937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010582320.8A Active CN111754526B (en) 2020-06-23 2020-06-23 House type graph dividing method, household type graph classifying method, household type graph dividing device, household type graph dividing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111754526B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632648B (en) * 2020-12-04 2022-03-18 贝壳找房(北京)科技有限公司 Automatic lamp placing method and device based on space understanding
CN113534795A (en) * 2021-06-30 2021-10-22 深圳市银星智能科技股份有限公司 Equipment searching method and self-moving equipment
CN116433701B (en) * 2023-06-15 2023-10-10 武汉中观自动化科技有限公司 Workpiece hole profile extraction method, device, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08235364A (en) * 1995-02-28 1996-09-13 N T T Data Tsushin Kk Method and device for transforming vector graphic
US6608929B1 (en) * 1999-05-28 2003-08-19 Olympus Optical Co., Ltd. Image segmentation apparatus, method thereof, and recording medium storing processing program
CN103971098A (en) * 2014-05-19 2014-08-06 北京明兰网络科技有限公司 Method for recognizing wall in house type image and method for automatically correcting length ratio of house type image
CN107330979A (en) * 2017-06-30 2017-11-07 电子科技大学中山学院 Vector diagram generation method and device for building house type and terminal
CN108717726A (en) * 2018-05-11 2018-10-30 北京家印互动科技有限公司 Three-dimensional house type model generating method and device
CN110197153A (en) * 2019-05-30 2019-09-03 南京维狸家智能科技有限公司 Wall automatic identifying method in a kind of floor plan
CN110378913A (en) * 2019-07-18 2019-10-25 深圳先进技术研究院 Image partition method, device, equipment and storage medium
CN110826121A (en) * 2019-10-10 2020-02-21 江苏艾佳家居用品有限公司 Method and system for automatically positioning house type corridor and entrance

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08235364A (en) * 1995-02-28 1996-09-13 N T T Data Tsushin Kk Method and device for transforming vector graphic
US6608929B1 (en) * 1999-05-28 2003-08-19 Olympus Optical Co., Ltd. Image segmentation apparatus, method thereof, and recording medium storing processing program
CN103971098A (en) * 2014-05-19 2014-08-06 北京明兰网络科技有限公司 Method for recognizing wall in house type image and method for automatically correcting length ratio of house type image
CN107330979A (en) * 2017-06-30 2017-11-07 电子科技大学中山学院 Vector diagram generation method and device for building house type and terminal
CN108717726A (en) * 2018-05-11 2018-10-30 北京家印互动科技有限公司 Three-dimensional house type model generating method and device
CN110197153A (en) * 2019-05-30 2019-09-03 南京维狸家智能科技有限公司 Wall automatic identifying method in a kind of floor plan
CN110378913A (en) * 2019-07-18 2019-10-25 深圳先进技术研究院 Image partition method, device, equipment and storage medium
CN110826121A (en) * 2019-10-10 2020-02-21 江苏艾佳家居用品有限公司 Method and system for automatically positioning house type corridor and entrance

Also Published As

Publication number Publication date
CN111754526A (en) 2020-10-09

Similar Documents

Publication Publication Date Title
CN111754526B (en) House type graph dividing method, household type graph classifying method, household type graph dividing device, household type graph dividing equipment and storage medium
TWI784973B (en) Information processing device, information processing method, and information processing program
CN112419297A (en) Bolt looseness detection method, device, equipment and storage medium
CN111611643A (en) Family type vectorization data obtaining method and device, electronic equipment and storage medium
CN109753918B (en) Wall body identification method and system in house type graph
CN109685019B (en) Component identification method, electronic equipment and storage medium
CN110334390B (en) Method and device for identifying outer wall in computer-aided design (CAD), storage medium and processor
CN113538671A (en) Map generation method, map generation device, storage medium and processor
CN107992036A (en) Transport Vehicle paths planning method, device and storage medium in a kind of intelligent parking garage
CN112001406A (en) Text region detection method and device
CN113962000A (en) Method for dynamically arranging smoke detectors in CAD (computer-aided design) drawing
Wang et al. Fast vanishing point detection method based on road border region estimation
CN113673413A (en) Method and device for examining architectural drawings, computer readable medium and electronic equipment
CN106611425B (en) A kind of panchromatic remote sensing image segmentation method
CN116363319B (en) Modeling method, modeling device, equipment and medium for building roof
CN114882192B (en) Building facade segmentation method and device, electronic equipment and storage medium
CN115712942A (en) Ultra-large building drawing sanitary appliance identification method based on deep learning
CN115392407A (en) Method, device, equipment and medium for warning danger source based on unsupervised learning
CN115359468A (en) Target website identification method, device, equipment and medium
CN113971709A (en) Automatic drawing method for wall-mounted component of CAD electrical construction plan
Kang et al. Line feature extraction from RGB laser point cloud
CN112734795A (en) Method and equipment for judging motion trend and direction of object
Ross-Gillespie et al. Implementation of the algorithm recommended by the panel for the 2016 international stock assessment workshop for assessing whether or not to continue with the penguin island closure experiment
CN116152277B (en) Map segmentation method and device, electronic equipment and medium
Rana Isovist Analyst-An Arcview extension for planning visual surveillance

Legal Events

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