Search

CN-122023745-A - Method and system for generating body block based on hand-drawn sketch

CN122023745ACN 122023745 ACN122023745 ACN 122023745ACN-122023745-A

Abstract

The embodiment of the invention provides a block generation method and system based on a hand-drawn sketch, and belongs to the technical field of image processing and three-dimensional modeling. The method comprises the steps of obtaining a hand-drawn sketch image, extracting a closed contour candidate set, generating a polygon candidate set, identifying a measurement anchor point set in the hand-drawn sketch image, constructing a spatial scale field according to the measurement anchor point set, mapping the polygon candidate set into a metric bottom surface polygon set, extracting a height implication feature set corresponding to the metric bottom surface polygon set, determining an absolute height value according to the height implication feature set and the measurement anchor point set, generating a bulk parameter set, constructing a spatial constraint map, executing position adjustment calculation, generating a three-dimensional bulk set and outputting a three-dimensional model file. The scheme of the invention realizes the numerical extraction and unified mapping of scale information and height implication information in the hand-drawn sketch, and generates a three-dimensional block model with consistent geometric relationship under the space constraint condition.

Inventors

  • Tao Haifan
  • ZHOU FAN

Assignees

  • 成都工业职业技术学院

Dates

Publication Date
20260512
Application Date
20260408

Claims (10)

  1. 1. A method for generating a block based on a sketch of a hand drawing, the method comprising: acquiring a hand-drawn sketch image, extracting a closed contour candidate set, and generating a polygon candidate set based on the closed contour candidate set; Identifying a measurement anchor point set in the hand-drawn sketch image, constructing a spatial scale field according to the measurement anchor point set, and mapping the polygon candidate set into a metric bottom surface polygon set; extracting a height implication feature set corresponding to the metric bottom surface polygon set, determining an absolute height value according to the height implication feature set and the measurement anchor point set, and generating a bulk block parameter set; And constructing a space constraint map based on the metric bottom surface polygon set and the volume parameter set, executing position adjustment calculation, generating a three-dimensional volume set and outputting a three-dimensional model file.
  2. 2. The sketch-based volumetric block generation method according to claim 1, wherein acquiring a sketch image of a sketch of the sketch and extracting a closed contour candidate set, generating a polygon candidate set based on the closed contour candidate set, comprises: Performing self-adaptive binarization processing on the hand-drawn sketch image to generate a line mask image; performing skeleton refinement processing on the line mask image to generate a skeleton image with single pixel width, and extracting an endpoint set and an intersection point set in the skeleton image; Performing vectorization processing on the skeleton image based on the endpoint set and the intersection point set to generate a broken line set, and performing line segment merging and simplification processing on the broken line set to obtain a contour line segment set; And executing closed detection and fracture completion calculation based on the relation between the end point distance and the included angle of the adjacent line segments in the contour line segment set, generating a closed contour candidate set, and converting the closed contour candidate set into a polygon candidate set.
  3. 3. The sketch-based block generation method according to claim 2, wherein performing line segment merging and simplification processing on the polyline set to obtain a contour line segment set includes: calculating the end point distance and the direction included angle between adjacent fold lines in the fold line set, and screening fold line pairs with the end point distance smaller than a preset distance threshold and the direction included angle smaller than a preset angle threshold; executing endpoint connection and direction consistency adjustment on the fold line pairs to generate a combined fold line set; Performing vertex redundancy detection on each fold line in the combined fold line set, deleting continuous collinear vertices, reserving end points and turning points, and generating a simplified fold line set; and reorganizing the simplified broken line set according to a space communication relationship to obtain the contour line segment set.
  4. 4. The sketch-based volumetric block generation method of claim 1, wherein identifying a set of metric anchor points in the sketch image comprises: performing direction filtering and morphological connected domain analysis on the hand-drawn sketch image, extracting a line segment pair set meeting parallel line characteristics, and generating a first anchor point candidate set according to pixel spacing between adjacent parallel lines in the line segment pair set; Detecting a step-shaped line segment group with a regular repeated structure in the hand-drawn sketch image, and generating a second anchor point candidate set based on pixel spacing between adjacent step-shaped line segments; Performing symbol template matching and contour shape comparison on the hand-drawn sketch image, identifying facility symbol areas meeting a preset geometric proportion relation, and generating a third anchor point candidate set based on pixel sizes of the facility symbol areas; And carrying out space consistency check and scale consistency screening on the first anchor point candidate set, the second anchor point candidate set and the third anchor point candidate set, reserving anchor point data meeting the real space mapping relation, and generating the measurement anchor point set.
  5. 5. The sketch-based volumetric block generation method of claim 4, wherein constructing a spatial scale field from the set of metric anchors and mapping the set of polygon candidates to a set of metric bottom surface polygons comprises: extracting corresponding pixel spacing values and real spacing values from each measurement anchor point in the measurement anchor point set, and calculating a scale sample value based on the pixel spacing values and the real spacing values to generate a scale sample set; Dividing the hand-drawn sketch image into a plurality of scale grids according to the spatial distribution of the scale sample set in the hand-drawn sketch image, and performing statistical fusion processing on scale sample values falling into the scale grids in each scale grid to generate a grid scale value set; Performing spatial interpolation calculation based on the grid scale value set to generate a spatial scale field covering the hand-drawn sketch image; And reading the scale value of the corresponding position of the space scale field for each vertex pixel coordinate in the polygon candidate set, and executing coordinate transformation calculation for each vertex pixel coordinate based on the scale value to generate the metric bottom surface polygon set.
  6. 6. The sketch-based block generation method according to claim 1, wherein extracting a set of height-implied features corresponding to the metric bottom surface polygon set includes: Determining corresponding pixel areas of each metric bottom polygon in the hand-drawn sketch image, and extracting a boundary line pixel set and an internal filling pixel set in the corresponding pixel areas; calculating a line width characteristic value based on the boundary line pixel set, and calculating a shadow density characteristic value based on the internal filling pixel set; parallel line detection is executed in the corresponding pixel area, the number of repeated lines is counted, and a superimposed line characteristic value is calculated; And combining the line width characteristic value, the shadow density characteristic value and the overlapping line characteristic value according to the metric bottom surface polygon corresponding relation to generate a height implication characteristic set.
  7. 7. The sketch-based volumetric block generation method according to claim 6, wherein determining an absolute height value from the set of height-implied features and the set of metric anchors to generate a set of volumetric block parameters comprises: Performing normalization processing on each height-implied feature vector in the height-implied feature set, and calculating a relative height grade value based on a preset weight to generate a relative height grade set; screening a height reference anchor point with real height attribute from the measurement anchor point set, and reading a real height value corresponding to the height reference anchor point to generate a height reference set; determining corresponding height unit values based on the space adjacent relation between each metric bottom polygon and the height reference set, and calculating an absolute height value set according to the relative height grade set and the height unit values; And combining the absolute height value set and the metric bottom surface polygon set according to a one-to-one correspondence relationship to generate a bulk parameter set.
  8. 8. The sketch-based tile generation method of claim 7, wherein constructing a spatial constraint map based on the metric bottom surface polygon set and the tile parameter set and performing a position adjustment calculation, generating a three-dimensional tile set and outputting a three-dimensional model file, comprises: determining an adjacent relation side set and an intersecting relation side set based on the boundary distance relation and the intersecting relation between any two metric bottom surface polygons in the metric bottom surface polygon set, and constructing a space constraint graph by taking each metric bottom surface polygon as a node; Setting position adjustment variables for the metric bottom surface polygon set based on the space constraint graph, and calculating each position adjustment variable and generating a deviation correcting bottom surface polygon set by taking the intersection area corresponding to the intersection relation side set and the boundary distance condition corresponding to the adjacent relation side set as position adjustment targets; performing stretching generation based on absolute height values in the deviation rectifying bottom surface polygon set and the bulk parameter set to generate a three-dimensional bulk set; and packaging the three-dimensional block set into a three-dimensional model file containing geometric data and block identification data, and outputting the three-dimensional model file.
  9. 9. The sketch-based volume generating method according to claim 8, wherein performing stretching generation based on absolute height values in the rectified bottom surface polygon set and the volume parameter set to generate a three-dimensional volume set includes: performing surface patch construction on each correction bottom surface polygon in the correction bottom surface polygon set to obtain a bottom surface patch set; The absolute height value in the bulk parameter set is associated with the bottom surface patch set according to a one-to-one correspondence, and a stretching parameter set is generated; And performing stretching generation on the bottom surface dough sheet set along a preset vertical direction based on the stretching parameter set, and performing sealing treatment on the stretching side wall and the top surface to obtain a three-dimensional body block set.
  10. 10. A sketch-based volumetric block generation system, the system comprising: an initialization unit, which is used for acquiring a hand-drawn sketch image and extracting a closed contour candidate set, and generating a polygon candidate set based on the closed contour candidate set; the mapping unit is used for identifying a measurement anchor point set in the hand-drawn sketch image, constructing a space scale field according to the measurement anchor point set, and mapping the polygon candidate set into a metric bottom surface polygon set; The feature extraction unit is used for extracting a height-implied feature set corresponding to the metric bottom surface polygon set, determining an absolute height value according to the height-implied feature set and the measurement anchor point set, and generating a bulk parameter set; and the file output unit is used for constructing a space constraint map based on the metric bottom surface polygon set and the bulk block parameter set, executing position adjustment calculation, generating a three-dimensional bulk block set and outputting a three-dimensional model file.

Description

Method and system for generating body block based on hand-drawn sketch Technical Field The invention relates to the technical field of image processing and three-dimensional modeling, in particular to a block generation method and system based on a hand-drawn sketch. Background In the conceptual design stage, designers often express spatial profiles, volume relationships, and high-low variation intentions by hand-drawing sketches. The hand-drawn sketch has the advantages of visual expression and convenient modification, but the proportional relationship is often judged by experience of a plotter, local amplification or compression phenomena possibly exist in different areas, line thickness and shadow filling are also often expressed schematically, and quantitative information which can be directly used for calculation is lacking. The existing three-dimensional modeling flow generally needs to redraw a contour in modeling software and manually set size and height parameters, a sketch is only used as a reference base map, the modeling process depends on manual operation, the efficiency is low, and understanding deviation is easy to generate. The partial image processing method can extract boundary lines in the sketch, but generally adopts a single proportion to carry out integral scaling treatment, can not reflect the scale difference of different areas in the sketch, and does not carry out numerical analysis on expression information such as line width, overlapping line or filling density, so that the height parameters of the generated body block still need to be manually determined. In a complex sketch scene, the automatically generated bottom surface contours are easy to overlap or misplace, and three-dimensional blocks with consistent spatial relationships are difficult to directly form. Therefore, there is a need for a processing method that can extract scalable information and highly implicit information from a sketch and complete position correction and volume generation in a unified coordinate system to improve the degree of automation and data consistency of sketch to three-dimensional model conversion. Disclosure of Invention The embodiment of the invention aims to provide a volume block generation method and system based on a hand-drawn sketch, which at least solve the problems that scale information in the hand-drawn sketch cannot be unified, high expression cannot be quantized and volume block space relations are difficult to automatically correct. In order to achieve the above object, a first aspect of the present invention provides a block generation method based on a hand sketch, the method comprising obtaining a hand sketch image and extracting a closed contour candidate set, generating a polygon candidate set based on the closed contour candidate set, identifying a metric anchor point set in the hand sketch image, constructing a spatial scale field according to the metric anchor point set, mapping the polygon candidate set to a metric bottom surface polygon set, extracting a height-implied feature set corresponding to the metric bottom surface polygon set, determining an absolute height value according to the height-implied feature set and the metric anchor point set, generating a block parameter set, constructing a spatial constraint map based on the metric bottom surface polygon set and the block parameter set, performing position adjustment calculation, generating a three-dimensional block set, and outputting a three-dimensional model file. The method comprises the steps of obtaining a hand sketch image, extracting a closed contour candidate set, generating a polygon candidate set based on the closed contour candidate set, performing adaptive binarization processing on the hand sketch image to generate a line mask image, performing skeleton refinement processing on the line mask image to generate a skeleton image with single pixel width, extracting an endpoint set and an intersection point set in the skeleton image, performing vectorization processing on the skeleton image based on the endpoint set and the intersection point set to generate a broken line set, performing line segment merging and simplification processing on the broken line set to obtain a contour line segment set, performing closed detection and fracture completion calculation based on the relationship between the endpoint distance and an included angle of adjacent line segments in the contour line segment set, generating the closed contour candidate set, and converting the closed contour candidate set into the polygon candidate set. The method comprises the steps of selecting a folding line set, carrying out line segment merging and simplification processing on the folding line set to obtain a contour line segment set, calculating an end point distance and direction included angle between adjacent folding lines in the folding line set, screening folding line pairs with the end point distance smaller than a preset distance