Search

CN-117291931-B - Building space segmentation method and system based on maximum inscribed rectangle

CN117291931BCN 117291931 BCN117291931 BCN 117291931BCN-117291931-B

Abstract

The invention provides a building space segmentation method and system based on maximum inscribed rectangles, which comprise the steps of obtaining building space images to be segmented, reading the number of marked text points in the building space images to be segmented, solving the maximum inscribed rectangles of the building space images to be segmented based on the marked text points to obtain the maximum inscribed rectangles of the marked text points, carrying out different processing on the maximum inscribed rectangles of the marked text points for the building space images to be segmented of different numbers of the marked text points to obtain space segmentation results, and outputting building space segmentation images.

Inventors

  • Request for anonymity
  • Request for anonymity
  • Request for anonymity
  • Request for anonymity

Assignees

  • 上海帮图信息科技有限公司

Dates

Publication Date
20260512
Application Date
20230922

Claims (8)

  1. 1. The building space segmentation method based on the maximum inscribed rectangle is characterized by comprising the following steps of: acquiring a building space image to be segmented, and reading the number of marked text points in the building space image to be segmented; The method comprises the steps of solving a maximum inscribed rectangle of a building space image to be segmented based on a marked text point to obtain a maximum inscribed rectangle of the marked text point, searching all grid points in the building space image to be segmented, taking transverse coordinates as transverse scales and longitudinal coordinates as longitudinal scales based on any grid point, dividing the building space image to be segmented into four text areas of left upper text area, right upper text area, left lower text area and right lower text area based on the marked text point according to the transverse scales and the longitudinal scales, performing de-duplication and de-background point processing on the grid points of the left upper text area and the right lower text area to obtain a set LU formed by N processed left upper text area grid points and a set RD formed by M processed right lower text area grid points, randomly selecting any grid point in the set LU and any grid point in the set RD to be combined two by two to obtain a combined rectangle, filtering the rectangle with background characteristics to obtain a background-free combined rectangle, and selecting the background-free combined rectangle with the largest area as the maximum inscribed rectangle of the marked text point; And carrying out different processing on the maximum inscribed rectangles of the marked text points to obtain space segmentation results for the building space images to be segmented of different numbers of marked text points, and outputting the building space segmentation images.
  2. 2. The building space segmentation method based on the largest inscribed rectangle according to claim 1, wherein the steps of obtaining the building space image to be segmented, and reading the number of the marked text points in the building space image to be segmented are as follows: Building space mask images generated by converting building space images and marked text points input by a user through a program; and taking the generated building space mask image as a building space image to be segmented, and taking the number of marked text points input by a user as the number of marked text points in the building space image to be segmented.
  3. 3. The building space segmentation method based on the maximum inscribed rectangle according to claim 1, wherein for the building space images to be segmented of different numbers of marked text points, different processing is performed on the maximum inscribed rectangle of each marked text point to obtain a space segmentation result, and a building space segmentation image is output, specifically: For a building space image to be segmented which only contains a single marked text point, the building space segmentation result is the maximum inscribed rectangle of the marked text point, and a building space segmentation image is output; and for the building space image to be segmented containing two or more marked text points, carrying out different processing on the maximum inscribed rectangle of each marked text point according to different superposition conditions of the maximum inscribed rectangle of each marked text point to obtain a space segmentation result, and outputting a building space segmentation image.
  4. 4. The building space segmentation method based on the maximum inscribed rectangle according to claim 3, wherein for the building space image to be segmented containing two or more marked text points, different processing is performed on the maximum inscribed rectangle of each marked text point according to different superposition conditions of the maximum inscribed rectangle of each marked text point to obtain a space segmentation result, specifically: for the situation that the maximum inscribed rectangle of each marked text point does not contain a public area, the construction space segmentation result is the combination result of the maximum inscribed rectangle of each marked text point, and a construction space segmentation image is output; For the situation that the maximum inscribed rectangle of each marked text point contains a public area but is not overlapped, selecting a next-level inscribed rectangle which corresponds to each marked text point and does not contain other text points, combining the next-level inscribed rectangles of each marked text point to obtain a building space segmentation result, and outputting a building space segmentation image; And under the condition that the maximum inscription rectangles of all the marked text points completely coincide, acquiring a text center point through an OCR model, constructing a central line based on the text center point, dividing and updating the maximum inscription rectangles of all the marked text points according to the central line, combining the updated maximum inscription rectangles to obtain a building space segmentation result, and outputting a building space segmentation image.
  5. 5. The building space segmentation system based on the maximum inscribed rectangle is characterized by comprising a text point identification module, a maximum inscribed rectangle module and a space segmentation module; the text point identification module is used for acquiring a building space image to be segmented and reading the number of marked text points in the building space image to be segmented; The maximum inscribed rectangle module is used for solving the maximum inscribed rectangle of the building space image to be segmented based on the marked text points to obtain the maximum inscribed rectangle of the marked text points, and specifically comprises the steps of searching all grid points in the building space image to be segmented, taking a transverse coordinate as a transverse scale and a longitudinal coordinate as a longitudinal scale based on any grid point, dividing the building space image to be segmented into four text areas of left upper text areas, right upper text areas, left lower text areas and right lower text areas based on the marked text points according to the transverse scale and the longitudinal scale, carrying out duplicate removal and background point removal processing on the grid points of the left upper text areas and the right lower text areas to obtain a set LU formed by N processed left upper text area grid points and a set RD formed by M processed right lower text area grid points, randomly selecting any grid point in the set LU and any grid point in the set RD to be combined two by two, filtering the obtained combined rectangle to obtain a rectangle with background characteristics, and selecting the combined rectangle with the largest area as the maximum inscribed rectangle of the marked text points; The space segmentation module is used for carrying out different processing on the maximum inscribed rectangles of the marked text points to obtain space segmentation results for the building space images to be segmented of different numbers of marked text points, and outputting the building space segmentation images.
  6. 6. The building space segmentation system based on maximum inscribed rectangle according to claim 5, wherein the text point identification module comprises an image acquisition unit and a text point reading unit; the image acquisition unit is used for converting a building space image input by a user and a marked text point into a building space mask image through a program; the text point reading unit is used for taking the generated building space mask image as a building space image to be segmented, and taking the number of marked text points input by a user as the number of marked text points in the building space image to be segmented.
  7. 7. The building space division system based on the maximum inscribed rectangle according to claim 5, wherein the space division module comprises a single text point space division unit and a multi text point space division unit; the single text point space segmentation unit is used for outputting a building space segmentation image for a building space image to be segmented, wherein the building space image only contains a single marked text point, and the building space segmentation result is the maximum inscribed rectangle of the marked text point; the multi-text-point space segmentation unit is used for carrying out different processing on the maximum inscribed rectangle of each marked text point according to different superposition conditions of the maximum inscribed rectangle of each marked text point to obtain a space segmentation result and outputting a building space segmentation image for building space images to be segmented, wherein the building space images contain two or more marked text points.
  8. 8. The system for building space division based on maximum inscribed rectangle according to claim 7, wherein the multiple text point space division unit comprises a first case subunit, a second case subunit, and a third case subunit; The first situation subunit is configured to output a building space segmentation image when the maximum inscribed rectangle of each marked text point does not contain a public area, where the building space segmentation result is a combination result of the maximum inscribed rectangle of each marked text point; The second condition subunit is configured to select a next-level inscribed rectangle which does not contain other text points and corresponds to each marked text point, and combine the next-level inscribed rectangles of each marked text point to obtain a building space segmentation result and output a building space segmentation image for the situation that the largest inscribed rectangle of each marked text point contains a public area but does not coincide; The third condition subunit is configured to obtain a text center point through an OCR model for a situation that maximum inscribed rectangles of each marked text point completely coincide, construct a center line based on the text center point, divide and update the maximum inscribed rectangles of each marked text point according to the center line, combine the updated maximum inscribed rectangles to obtain a building space segmentation result, and output a building space segmentation image.

Description

Building space segmentation method and system based on maximum inscribed rectangle Technical Field The invention relates to the technical field of image processing, in particular to a building space segmentation method and system based on a maximum inscribed rectangle. Background In CAD images of building spaces, different textual identifications are typically employed in different types of spaces at different locations. The abstract building space segmentation may be embodied as an image processing problem that solves for the largest inscribed rectangle in space. However, for a building space containing a plurality of text labels, the space division needs to meet the condition that the space division is not coincident and meet the artificial division basis of a standardized building. In the prior art, most of methods for solving the largest inscribed rectangle are to find spatial contour points, randomly select two contour points for pairing and sequentially traverse, and select the rectangle with the largest area from the traversed rectangle, namely the solved largest inscribed rectangle. The solving method is low in calculation speed, and is difficult to meet the requirement of space division according to texts in residential buildings. Disclosure of Invention The invention provides a building space segmentation method and system based on a maximum inscribed rectangle, which can be used for visualizing the abstract space division problem and solving the problems of segmenting building spaces under various conditions of identifying text points and conforming to building professional specifications. In order to solve the technical problems, the invention provides a building space segmentation method based on a maximum inscribed rectangle, which comprises the following steps: acquiring a building space image to be segmented, and reading the number of marked text points in the building space image to be segmented; solving the maximum inscribed rectangle of the building space image to be segmented based on the marked text points to obtain the maximum inscribed rectangle of the marked text points; And carrying out different processing on the maximum inscribed rectangles of the marked text points to obtain space segmentation results for the building space images to be segmented of different numbers of marked text points, and outputting the building space segmentation images. The embodiment of the invention carries out multi-space division based on the maximum inscribed rectangle, and the abstract space division problem is embodied as an actual image processing problem. And reading the marked text points of the building space image, solving the maximum inscribed rectangle of the space where each text point is located based on the marked text points, and carrying out corresponding processing according to the conditions of different marked text points, thereby obtaining a space segmentation result and realizing accurate and standard-compliant division of the building space which only contains one marked text point and a plurality of marked text points. Further, the acquiring the building space image to be segmented, and reading the number of the marked text points in the building space image to be segmented specifically includes: Building space mask images generated by converting building space images and marked text points input by a user through a program; and taking the generated building space mask image as a building space image to be segmented, and taking the number of marked text points input by a user as the number of marked text points in the building space image to be segmented. Further, solving the maximum inscription rectangle of the building space image to be segmented based on the marked text points to obtain the maximum inscription rectangle of the marked text points, wherein the method specifically comprises the following steps: Searching all grid points in the building space image to be segmented, taking a transverse coordinate as a transverse scale and a longitudinal coordinate as a longitudinal scale based on any grid point; Dividing the text into four text areas of upper left, upper right, lower left and lower right according to a transverse ruler and a longitudinal ruler based on marked text points; Performing de-duplication and background point removal processing on grid points of the upper left text region and the lower right text region to obtain a set LU formed by N processed upper left text region grid points and a set RD formed by M processed lower right text region grid points; randomly selecting any grid point in the set LU and any grid point in the set RD to be combined pairwise to obtain a combined rectangle; filtering the rectangle with background characteristics from the obtained combined rectangle to obtain a combined rectangle without background; And selecting the background-free combined rectangle with the largest area as the largest inscribed rectangle of the marked text point.