WO2022141887A1 - Home decoration plan automatic design method and apparatus, computer device, and storage medium - Google Patents

Home decoration plan automatic design method and apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2022141887A1
WO2022141887A1 PCT/CN2021/084730 CN2021084730W WO2022141887A1 WO 2022141887 A1 WO2022141887 A1 WO 2022141887A1 CN 2021084730 W CN2021084730 W CN 2021084730W WO 2022141887 A1 WO2022141887 A1 WO 2022141887A1
Authority
WO
WIPO (PCT)
Prior art keywords
plane
preview image
projection
bounding box
wall
Prior art date
Application number
PCT/CN2021/084730
Other languages
French (fr)
Chinese (zh)
Inventor
宋璐
黄治
喻培
陈静
唐睿
Original Assignee
杭州群核信息技术有限公司
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 杭州群核信息技术有限公司 filed Critical 杭州群核信息技术有限公司
Publication of WO2022141887A1 publication Critical patent/WO2022141887A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/13Architectural design, e.g. computer-aided architectural design [CAAD] related to design of buildings, bridges, landscapes, production plants or roads
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Definitions

  • the invention belongs to the cross field of home improvement design and computer-aided design, and also relates to the technical field of graphics and images, in particular to a method and device for automatic home improvement plane design, computer equipment and a storage medium.
  • Soft decoration is an emerging concept in the field of home decoration design, which further subdivides the field of home decoration.
  • the so-called soft decoration refers to the use of accessories that are easy to replace and change positions after the hard decoration is completed, such as wallpaper, fabrics, carpets, furniture, etc.
  • Ornaments, lighting, plants, etc. are the secondary furnishings and arrangements of the interior.
  • 3D form such as 3D Max, Kujiale, 3D home, and flat design home.
  • This method uses the schematic placement of the 3D model of the home improvement material in the visualization tool as the main design process.
  • the effect in the design process cannot be directly used as the delivery result, and it takes a long time to render and wait for the rendering.
  • 2D form such as Meijian, PS, PPT, etc.
  • This form uses pictures of home improvement materials to make puzzles on a flat canvas.
  • the effect presented in the design process is the final delivery effect, which is intuitive and simple, but requires strong spatial imagination and takes a long time to make perspective relationships between pictures. , size, etc.
  • the purpose of the present invention is to provide an automatic design method, device, computer equipment and storage medium for home improvement planes, and combine the advantages of 3D design and 2D design to achieve simple, efficient and extremely design effects, bringing users the ultimate operating experience.
  • an embodiment of the present invention provides an automatic design method for a home improvement plane, including the following steps:
  • the materials are automatically placed in the floor plan of the house type projection according to the material design instructions, and the automatic design result of the home decoration plane is obtained;
  • the configuration attributes of the home improvement materials include the material type and the default design position of the material.
  • an embodiment of the present invention provides an automatic design device for a home improvement plane, including:
  • the generation module generates the three-dimensional structure information of the house type and the floor plan projection of the house type according to the background picture of the flat home decoration;
  • Receiving module receiving material design instructions
  • the design module according to the configuration attributes of the home decoration materials and the three-dimensional structure information of the house type, automatically places the materials in the floor plan of the house type projection according to the material design instructions, and obtains the automatic design result of the home decoration plane;
  • the configuration attributes of the home decoration materials include the material type and the material default design. Location.
  • an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program The steps of realizing the method for automatic design of home improvement planes described in the first aspect.
  • an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is processed and executed, the method for automatically designing a home improvement plane described in the first aspect is realized. step.
  • the beneficial effects of the present invention at least include:
  • the method and device, computer equipment, and storage medium for automatic design of home decoration plane provided by the embodiments of the present invention, by generating three-dimensional structure information of the house type and the floor plan of the house type according to the background picture of the plane home decoration, and defining configuration attributes for the materials, according to the configuration attributes of the home decoration materials and The three-dimensional structure information of the house type, the material is automatically placed in the house type projection plan, and the automatic design results of the home decoration plane are obtained, which simplifies the difficulty of home decoration design, lowers the threshold for the use of design software, and uses 3D information to assist the design process, making designers work more efficiently substantial improvement.
  • Fig. 1 is the flow chart of the home improvement plane automatic design method provided by an embodiment of the present invention
  • FIG. 2 is a schematic diagram of imaging room area information provided by an embodiment of the present invention.
  • FIG. 3 is a projected plan view of a house type showing control points according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a 3D material bounding box provided by an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of the highlighted display of the adsorption surface and the default adsorption position of the ground material provided by an embodiment of the present invention
  • FIG. 6 is a schematic diagram of the highlighted display of the adsorption surface and the default adsorption position of the wall material provided by an embodiment of the present invention
  • FIG. 7 is a visual effect diagram of a material and its bounding box provided by an embodiment of the present invention showing near large and far small;
  • FIG. 8 is a schematic diagram of an automatic design device for home improvement planes provided by an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of an automatic design device for a home improvement plane provided by another embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
  • the embodiments of the present invention provide an automatic home improvement plane design method, device, computer equipment and storage medium, which can be specifically applied to the field of home improvement to automatically generate a 2.5-dimensional (2.5D) floor plan projection
  • the floor plan and the floor plan of the floor plan are automatically placed by default.
  • Embodiment 1 provides an automatic design method for a home improvement plane. As shown in FIG. 1, the embodiment provides the automatic design method of home improvement plane, which includes the following steps:
  • the background picture of flat home decoration is the benchmark for automatic design of the user's home decoration plane.
  • There are many choices for the background picture of flat home decoration which can be a complete rendering with soft decoration, an empty scene rendering without soft decoration, a real photo or a whiteboard.
  • a whiteboard is a blank background. That is to say, the automatic design method for the home improvement plane provided by the embodiment of the present invention can be designed on any background image.
  • the home improvement plane automatic design method provided by the present invention is a 3D or 2.5D design method. Therefore, the three-dimensional information of the house type is very important auxiliary information in the design process. Before designing, it is necessary to obtain the three-dimensional structure information of the house type. The three-dimensional information is used for home improvement layout design.
  • the background image of the flat home decoration is a rendering image
  • the camera parameters and light field information are obtained according to the rendering parameters, and the camera matrix is constructed;
  • the 3D model of the rendering image is obtained by calculating the rendering image and the camera matrix, that is, the 3D structure information of the house type is obtained.
  • the parameters in the rendering process are traced back through the rendering image, and the obtained original camera parameters include cameraPosition (camera position), lookat (the direction the camera is looking at), up (the direction the camera head is facing), and fov (the camera's field of view). angle), clippingNear (near plane clipping), aspect (the aspect ratio of the rendered image), and another representation of the camera parameter information includes cameraPosition, the camera coordinate system represented by U, V, W, clippingNear, aspect, these two The camera parameter information described by each representation is equivalent.
  • the camera rotation matrix R, the camera translation matrix T is obtained through cameraPosition, and the projection matrix P of the camera is obtained through fov, aspect, zNear and zFar; in this way, the camera matrix is the world coordinate system (3D coordinate system) to the plane coordinate system (2D coordinate system).
  • the transformation matrix CameraTransform P*T*R of the coordinate system), and the transformation matrix CameraTransform -1 from the plane coordinate system to the world coordinate system.
  • the camera parameters are preset, that is, the camera position is used as the origin of the world coordinate system, and the world coordinate system and the camera coordinate system are coincident, and the edge detection is performed on the real photo, and the top of the wall is perpendicular to each other.
  • the assumption is that the three-dimensional structure information of the house type is restored, and then the projected floor plan of the house type is constructed according to the three-dimensional structure information of the house type.
  • constructing a floor plan of a house type projection according to the three-dimensional structure information of the house type includes:
  • the specific process is: first, connect the corresponding corner points to generate wall lines according to the corner coordinates and wall information, and obtain the floor plan of the house; then, according to the camera position and the near-plane clipping distance of the direction the camera is looking at, obtain the direction the camera is looking at After the plane coordinates of the point, judge and determine that the point the camera is looking at is located in the room area of the floor plan according to the plane coordinates of the point the camera is looking at; finally, filter and determine the effective corners that make up the room area, based on the effective corners , wall thickness, wall height and camera parameters to generate the wall projection plane, the ground projection plane and the top projection plane to form the floor plan of the room area.
  • the apartment frame is formed according to the connection of the effective corner points, and according to the thickness of the wall, lines parallel to the apartment frame are generated inwardly and outwardly along the apartment frame as the inner wall line and the outer wall line.
  • the point in the direction the camera looks at refers to the clipping plane of the direction in which the camera looks, that is, the intersection of the near plane of the imaging viewing cone and the direction in which the camera looks. Since the room area is a closed area, the corner points between the walls in the room area and the corner points of other rooms of the apartment type are eliminated as redundant points, and the remaining corner points are the effective corner points that constitute the room area. As shown in Figure 2, the corners represented by the symbol ⁇ without dots are redundant points in the room where the camera is located, and the remaining symbols ⁇ with dots next to them are used to form walls and are valid corners.
  • the thickness information of the wall After eliminating the redundant points, use the thickness information of the wall to increase or decrease the thickness of the wall by 1/2 along the direction perpendicular to the wall to obtain the inner wall line and the outer wall line, and take the intersection of the inner wall line as the target corner point, That is, the dots in Figure 2, they are the smallest set of points that describe the polygons formed by the lines in the wall of the room where the camera is located.
  • the target corner point (the circle point in Fig. 2 ) of the final projected plan view is actually the intersection point of all the inner wall lines, but because the room is irregular, it is impossible to distinguish the inner wall line and the outer wall line, so it is necessary to Line recognition is performed to determine the intersection of lines within the wall.
  • the specific process includes:
  • the perspective projection and orthogonal projection of the indoor area can be realized by using the camera view cone.
  • the camera view cone used is the truncation of the spatial connection of the vertebral frustum to the target corner, and the intersection of the vertebral frustum and the spatial connection. is the new control point;
  • the orthographic projection is realized, the camera view cone used is the spatial connection truncation of the cube to the target corner.
  • the new control point and the original control point are connected in sequence to generate the wall projection plane, then all the upper control points of the wall are connected to form the top projection plane, and all the lower control points of the wall are connected to form the bottom surface.
  • Projection plane which forms the projected floor plan of the room area.
  • the projection plane is called the adsorption surface, which means that the home improvement material can be adsorbed to the corresponding surface according to the configuration property of the material.
  • the corner points of the plane are set as control points, and the adsorption surface is described according to the control points.
  • the adsorption surface is represented by the control points connected clockwise, and a List is used to describe the visible projection plane of the house type structure of the rendering image, and each visible projection plane is described by no less than 3 control points.
  • the control points should be adjusted accordingly to the picture, and increased as needed.
  • the first wall A from the left is truncated by a corner of the view cone, then the control points describing the first wall from the left will be changed from 4 to 5.
  • the corners are also added to the corresponding projection planes as control points to ensure that the entire picture is completely covered by all projection planes, such as the upper left, upper right, and lower right corners in Figure 3, but the projection planes can overlap in the picture, such as the one behind the bump wall.
  • the plane is shown in part B in Figure 3.
  • the background image of the flat home decoration is a whiteboard
  • One of the typical cases is to select the case where the camera is looking straight ahead, and there is only a part of a wall in the field of view. In this case, all the home improvement materials are placed on the same plane in a tiled type, which is compatible with pure 2D design. .
  • Material design instructions refer to various operation instructions for designing home improvement materials on the home projection plane, including material placement, material movement, material scaling, material rotation, material replacement, rendering, and generating proposals. In the present invention, it mainly relates to the material placement instruction.
  • the materials are automatically placed in the house type projection plan according to the material design instruction, and the result of the automatic design of the home decoration plane is obtained.
  • the configuration properties of home improvement materials are set in advance, and the configuration properties are directly used when applying, among which the configuration properties include the material type and the default design position of the material.
  • Two material types are defined according to the setting method, namely placement type and tile type.
  • placement type refers to materials that can be placed directly, such as sofas, beds, tables, etc., and is further subdivided.
  • Placement types include placement on the ground, hanging on the wall, and hanging on the top surface.
  • the type of paving refers to the materials that can be paved, such as carpets, paintings, curtains, etc., and is further subdivided.
  • the types of paving include paving on the ground and pasting on the wall.
  • two types of materials are also defined, namely three-dimensional (3D) materials and two-dimensional (2D) materials, that is, the automatic design method of home decoration plane provided by the present invention supports the mixed design of 3D materials and 2D materials on the plane at the same time
  • the material elements manipulated in the canvas are all pictures, the background is a large texture as the background layer, and each material element is a small picture, which is carried by a separate layer.
  • a description mark is set for the 3D material and the 2D material.
  • Bounding Box is the physical size of an object described by three values of x, y, and z, and the unit can be millimeters.
  • the embodiment defines that the model coordinate system of the 3D material is a Cartesian coordinate system, so that the horizontal rightward is the positive direction of the x-axis, the horizontal forward is the positive direction of the y-axis, and the vertical upward is the positive direction of the z-axis.
  • the origin of the coordinate system is located in the shape of the material. Heart.
  • the Bounding Box describing its physical size is missing, but the present invention still uses the coordinate form of the 3D material Bounding Box, and assigns its default height value according to the empirical observation of the 2D material category, that is, the z value in the Bounding Box, Let the y value be 0, and the x value is calculated according to the ratio of the aspect ratio of the 2D image and the z value of the Bounding Box. Assuming that the default height of z is 2000mm, the pixel height of the corresponding material is 400px, and the real pixel width of the material is 600px, then the z value is 3000mm according to the proportional calculation.
  • the coordinates of the four vertices of the Bounding Box are ⁇ point 1(-x/2,0,z/ 2), point 2(-x/2,0,-z/2), point 3(x/2,0,-z/2), point 4(x/2,0,z/2) ⁇ .
  • the default design position of the material includes the default adsorption position and the default adsorption surface of the material.
  • corresponding default adsorption surfaces and default adsorption positions are defined for different types of materials according to the material types, so as to realize more efficient and intelligent placement.
  • the image recognition algorithm can be used to find the material type that best matches the semantic content of the picture, and the default adsorption surface and default adsorption position of the picture can be defined according to the most matching material type.
  • the default adsorption surface is defined as the ground in the floor plan of the floor plan; for the top surface material suspended on the top surface, the default adsorption surface is defined as the top surface in the floor plan of the floor plan. ; For the wall materials hung on the wall and pasted on the wall, define the default adsorption surface as the wall in the floor plan of the floor plan.
  • the control points of the default adsorption surface corresponding to the material are connected to form a closed-loop line, and the virtual surface formed by the closed-loop line or/and the closed-loop line is highlighted.
  • the highlighted display disappears. .
  • the preview image of the material can be dragged to the floor plan of the floor plan according to the user's instruction, and the control points of the default adsorption surface corresponding to the material will be connected to form a closed-loop line, and the virtual surface formed by the closed-loop line will be displayed.
  • the adsorption surface is highlighted, as shown in Figure 5.
  • the highlight of the adsorption surface will be displayed until the material is placed.
  • the initial state after the material is placed is the selected state, and the highlight of the adsorption surface disappears.
  • the present invention also defines a method for the default adsorption position of the ground material in the default adsorption surface-ground, including: (a1) When the bottom line of the material preview image and the ground formed by the control point intersect, After placing, ensure that the lower edge of the material preview image and the front and lower edge of the material bounding box parallel to the x direction (that is, the line connecting the vertices 5 and 6 in Figure 4) overlap and the center points of the two overlap, so as to determine the default The adsorption position is shown in Figure 5.
  • (b1) When the upper and lower lines of the material preview image only intersect with the wall formed by the control points, project the lower line of the material preview image to the ground along the z-axis of the world coordinate system to obtain the lower projection line, according to The lower projection line determines two default adsorption positions: Method 1, after placing, ensure that the lower projection line of the material preview image and the front and lower edge of the material bounding box parallel to the x-direction (that is, the line connecting vertices 5 and 6 in Figure 4) Overlap and the center points of the two overlap, as shown in Figure 5; Method 2, after placing, ensure that the lower projection line of the material preview image overlaps with the front and lower line parallel to the x-direction of the material bounding box, and a certain offset is calculated. , when calculating the offset, make sure that the bounding box of the material is completely inside the ground.
  • Method 1 after placing, ensure that the lower projection line of the material preview image and the front and lower edge of the material bounding box parallel to the x-direction (that
  • the present invention also defines a method for the default adsorption position of the ground material in the default adsorption surface-ground, including: (a2) When the bottom line of the material preview image intersects with the ground formed by the control points , the material automatically forms a consistent perspective relationship with the ground. After placing, ensure that the bottom line of the material preview image and the bottom surface of the material bounding box (that is, the plane composed of vertices 5, 6, 7, and 8 in Figure 4) The center line in the x direction overlaps And the center points of the two coincide, so as to determine the default adsorption position, as shown in Figure 5.
  • Method 1 After placing, ensure that the lower projection line of the material preview image overlaps with the center line of the bottom surface of the material bounding box in the x direction and the center points of the two coincide, as shown in Figure 5; Method 2. After placing, ensure that the lower projection line of the material preview image overlaps with the center line of the bottom surface of the material bounding box in the x direction and perform a certain offset calculation. When calculating the offset, ensure that the material bounding box is completely within the ground.
  • the present invention also defines a method for the default adsorption position of the top surface material in the default adsorption surface - the top surface.
  • the default adsorption position of the top surface material is similar to the default adsorption position of the ground material, that is, the default adsorption position of the ground material
  • the ground is replaced by the top surface
  • the top surface is replaced by the bottom surface
  • the lower side line is replaced by the upper side line
  • the upper side line is replaced by the lower side line
  • the lower side projection line is replaced by the upper side projection line
  • the upper side projection line is replaced by the lower side projection line.
  • the connection of vertices 5 and 6 in Figure 4 is replaced with the connection of vertices 1 and 2 in Figure 4.
  • Other content is the same as the definition method of the default adsorption position of the ground material. Specifically:
  • Method 1 After placing, ensure that the lower projection line of the material preview image overlaps with the front and upper side lines of the material bounding box parallel to the x-direction, and the center points of the two coincide; Method 2, after placing, ensure that the lower projection line of the material preview image and the material The front upper edge of the bounding box that is parallel to the x-direction overlaps and a certain offset is calculated. When calculating the offset, ensure that the material bounding box is completely within the top surface.
  • the present invention also defines a method for the default adsorption position of the wall material in the default adsorption surface-wall surface, including: (a4) when the upper and lower lines of the material preview image are only connected to the wall formed by the control points When there is an intersection, the material is placed on the wall that intersects with the center of the material preview image, and the material automatically forms a consistent perspective relationship with the wall. According to the perspective relationship, the fitting plane of the bounding box of the material is judged and determined.
  • the fitting plane It is the left side of the bounding box (that is, the plane composed of vertices 2, 3, 7, and 6 in Figure 4), the back plane (that is, the plane composed of vertices 3, 4, 8, and 7 in Figure 4) or the right side. (that is, the plane composed of vertices 1, 4, 8, and 5 in Figure 4), the center point of the material preview after placement coincides with the center point of the fitting plane, as shown in Figure 6.
  • the material can be placed by dragging the material onto the floor plan of the house type projection with the mouse, or by clicking the button, the preview image of the material can be adsorbed on the mouse, and then clicking on the floor plan of the house type projection can place the material.
  • the mouse is positioned at the center of the preview image of the material.
  • the material selected according to the material design instruction will be automatically generated in the default adsorption position of the default adsorption surface according to its configuration properties. After the material preview is placed in the default adsorption position, it will be automatically adjusted to the physical size, and the icon size will be maintained at other times. , to implement the default design.
  • the type projection plan is a projection plane, in order to make the design result map realize the presentation effect of near big and far small in line with the real world observation results. You need to adjust the placement of the material to show the perspective effect of near, large and far. In traditional 2D design, users usually rely on their own spatial imagination to manually scale the size of each material to achieve the effect of near big and far small. This manual adjustment method has low efficiency, poor accuracy and poor effect.
  • the automatic design method of the home decoration plane of the present invention further includes: automatically adjusting the size of the 3D material to achieve the effect of near large and far small, including: a material-based bounding box and a camera parameters, after the pose (position and attitude) of the material preview image in the house type projection plane is given, the 2D coordinates of the 8 vertices of the material bounding box in the house type projection plane are obtained by calculation, so as to realize the adjustment of the 3D material.
  • the pixel size of the height of the back plane, bbox.y is the pixel size when the upper or lower plane of the bounding box is expanded to be parallel to the back plane, a*bbox.y represents the upper or lower plane of the bounding box projected on the house
  • the pixel size in the plan view; the display width of the material preview is calculated according to the aspect ratio of the material preview to ensure the consistency of the material preview and the bounding box.
  • the 2D coordinates of the 8 vertices of the bounding box in the house type projection plane can be determined, and then the adjustment of the 3D material can be realized.
  • the bounding box will achieve the visual effect of near and far according to the physical size, and the 3D material will become larger and smaller together.
  • bbox.y 0
  • bbox.x is calculated from bbox.z and the aspect ratio of the material preview, so the bounding box and the material preview are also completely matched in the floor plan of the floor plan, as shown in Figure 7 sofa.
  • the method for automatic design of home decoration plane further includes: setting an operation bar for providing quick switching placement positions for materials, the operation bar is displayed and presented according to the selection of the material, and switching placement positions includes including placing On the ground, hanging on the ceiling, hanging on the wall, sticking to the wall and laying on the ground; the user can quickly operate the material by selecting and switching the placement position to achieve custom design.
  • the method for automatically designing a home decoration plane of the present invention further comprises: automatically generating a layer and an adjustment layer for the material placed on the floor plan of the house type projection, specifically, generating the layer depth according to the depth information of the material bounding box, and adjusting the layer depth according to the depth compensation value. Depth adjustment to adjust the layer position.
  • all 3D materials are flattened to a plane with a central depth, and then all 3D materials are degraded into 2D material preview images.
  • the depth information of the center of the material bounding box can be used to add a depth compensation value Sort the layers, that is, the layer farthest from the camera is on the bottom layer, and the layer closer to the camera is on the upper layer, so that the near material can block the distant material.
  • the direction of the depth compensation value is the direction the camera is looking at, and the size is bbox.y/2, which is the depth of the back plane of the material's bounding box, so that the ornaments on the table, the pillows on the sofa, The pillows, blankets, etc. on the bed will be on the upper layer, which is consistent with the observation results.
  • For layer adjustment set the adjusted precision value, perform compensation operations on the precision value and the depth of the material to be adjusted to obtain the compensated depth value, and adjust the material position according to the compensated depth value.
  • the adjusted precision value eps may be defined as the minimum precision value recognizable by the computer, such as 1e-6. Then, when the selected material is moved up one layer, sort the depth values of all the original materials, find the depth a of the material one layer above the selected material, adjust the depth compensation value, and set the depth value of the material to be adjusted to a+eps. The same is true for moving down a layer. If you set it to the top, find the value b with the largest depth of all the materials, and set the depth value of the material to be adjusted to b+eps. The same is true for the bottom.
  • the method for automatically designing a home decoration plane provided by the embodiment further includes: rendering a result of the home decoration plane design to obtain a rendering diagram.
  • the method for automatically designing a home improvement plane provided by the embodiment further includes: generating a proposal based on a home improvement plane design result.
  • the automatic design method for home decoration plane provided by the embodiment does not limit the background image, and can take photos for renderings, whiteboards or real scenes, and has stronger application compatibility, which is convenient for users to design home decoration.
  • the effect of realistic design is not limit the background image, and can take photos for renderings, whiteboards or real scenes, and has stronger application compatibility, which is convenient for users to design home decoration. The effect of realistic design.
  • configuration attributes are defined through materials, and materials are automatically placed in the floor plan of the house type projection according to the configuration attributes of home decoration materials and the three-dimensional structure information of the house type, so as to obtain the result of automatic design of the home decoration plane, which simplifies the process of home decoration design. Difficulty, lower the threshold for the use of design software, and use 3D information to assist the design process, which greatly improves the work efficiency of designers.
  • the home improvement plane automatic design method provided by the embodiment uses 3D information to assist the design process, so that the work efficiency of designers is greatly improved, and at the same time, it is perfectly compatible with 2D and 3D materials, and solves the problem of high cost of 2D material information and 3D material acquisition.
  • the results of the automatic design of a home decoration plane can be docked and rendered to obtain a more realistic light and shadow effect, and at the same time, a proposal can be generated to provide to the user.
  • Embodiment 2 provides a home improvement plane automatic design device.
  • the home improvement plane automatic design device 800 provided by the embodiment includes:
  • Obtaining module 801 obtaining a background image of flat home decoration
  • the generating module 802 generates the three-dimensional structure information of the house type and the floor plan projection of the house type according to the background image of the flat home decoration;
  • the design module 804 according to the configuration attributes of the home improvement materials and the three-dimensional structure information of the house type, automatically places the materials in the house type projection plan according to the material design instructions, and obtains the results of the automatic design of the home decoration plane; the configuration attributes of the home decoration materials include the material type, the material default Design location.
  • the home improvement plane automatic design device 800 further includes:
  • the rendering module 901 renders the home improvement graphic design result to obtain a rendering
  • the proposal generation module 902 generates a proposal based on the home improvement graphic design result.
  • the automatic home improvement plane design device provided in Embodiment 2 performs the automatic design of the home improvement plane
  • the division of the above-mentioned functional modules should be used as an example to illustrate, and the above-mentioned functions can be allocated according to different functional modules.
  • the internal structure of the terminal or server is divided into different functional modules to complete all or part of the functions described above.
  • the automatic home improvement plane design device provided in the second embodiment belongs to the same concept as the embodiment of the home improvement plane automatic design method, and the specific implementation process is detailed in the home improvement plane automatic design method embodiment, which will not be repeated here.
  • Embodiment 3 provides a computer device, and provides a computer device, the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 10 .
  • the computer equipment includes a processor, memory, a network interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the nonvolatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program when executed by the processor, implements an image presentation method.
  • the display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen
  • the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.
  • FIG. 10 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • a computer device including a memory, a processor, and a computer program stored in the machine memory and executable on the processor, and the processor implements the method described in claim 1 when the processor executes the computer program.
  • the steps of the home improvement plane automatic design method are to realize the following steps:
  • the materials are automatically placed in the floor plan of the house type projection according to the material design instructions, and the result of the automatic design of the home decoration plane is obtained.
  • the processor executes the computer program, the following steps are further implemented: rendering the graphic design result of the home decoration to generate a rendering and outputting the rendering.
  • the most basic situation is that after obtaining the 3D model of the house type projection plan and the 3D model of the 3D material, a 3D model of the scene is formed, and the 3D scene model is rendered to obtain a rendering of the home improvement design result.
  • the material is a 2D material
  • the following three methods are used for rendering: the first method is to tolerate a certain degree of inconsistency, and the image search technology is used to search for the most similar model to render; the second method is based on The outline of the 2D material builds a flat model, and the 2D material is pasted on the surface as a texture for rendering; the three methods are to temporarily remove all the 2D material during rendering, and after obtaining the rendered scene graph of the 3D material, calculate its depth map, and use the 2D material according to The depth information is placed where the occluded part is cropped.
  • the processor when the processor executes the computer program, the following steps are further implemented: generating and outputting a design proposal based on the home improvement graphic design result.
  • the complete proposal also includes cover, back cover, catalog, style analysis, material analysis, color analysis, etc. These contents belong to the category of pure 2D design, which can be realized by using the pure white background mentioned above. That is, all materials are posted on the same wall facing the same side. Users can also upload pictures as one or more pages of the proposal, and each space is designed as a page, thus forming a complete proposal that can be shared, disseminated and reported.
  • Embodiment 4 also provides a computer-readable storage medium, such as a memory including at least one instruction, the at least one instruction can be executed by a processor in a terminal to complete the steps of the method for automatically designing a home improvement plane in Embodiment 1.
  • a computer-readable storage medium such as a memory including at least one instruction
  • the at least one instruction can be executed by a processor in a terminal to complete the steps of the method for automatically designing a home improvement plane in Embodiment 1.
  • Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Road (Synchlink) DRAM
  • SLDRAM synchronous chain Road (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Abstract

A home decoration plan automatic design method and apparatus, a computer device, and a storage medium, relating to the field of home decoration design. The home decoration plan automatic design method comprises the following steps: obtaining a planar home decoration background diagram (S101); generating three-dimensional structure information of a room type and a room type projection plan according to the planar home decoration background diagram (S102); receiving a material design instruction (S103); and according to configuration attributes of a home decoration material and the three-dimensional structure information of the room type, automatically placing the material in the room type projection plan according to the material design instruction to obtain a home decoration plan automatic design result (S104). The advantages of 3D design and 2D design are combined simultaneously, thereby realizing simple, efficient and exquisite design effects, and bringing an excellent operation experience to a user.

Description

一种家装平面自动设计方法和装置、计算机设备和存储介质A kind of home improvement plane automatic design method and device, computer equipment and storage medium 技术领域technical field
本发明属家装设计和计算机辅助设计的交叉领域,还涉及图形图像技术领域,具体涉及一种家装平面自动设计方法和装置、计算机设备和存储介质。The invention belongs to the cross field of home improvement design and computer-aided design, and also relates to the technical field of graphics and images, in particular to a method and device for automatic home improvement plane design, computer equipment and a storage medium.
背景技术Background technique
软装是一个家装设计领域中新兴的概念,把家装领域更加细分化了,所谓软装是指硬装修完毕之后,利用那些易更换、易变动位置的饰物如墙纸、布艺、地毯、家具、饰品、灯饰、植物等对室内的二度陈设与布置。换句话说,就是指除了室内装潢中固定的、不能移动的装饰物如地板、顶棚、墙面以及门窗等之外,其它可以移动的、易于更换的饰物,是对居室的二度陈设与布置。Soft decoration is an emerging concept in the field of home decoration design, which further subdivides the field of home decoration. The so-called soft decoration refers to the use of accessories that are easy to replace and change positions after the hard decoration is completed, such as wallpaper, fabrics, carpets, furniture, etc. Ornaments, lighting, plants, etc. are the secondary furnishings and arrangements of the interior. In other words, it means that in addition to the fixed and immovable decorations in the interior decoration such as floors, ceilings, walls and doors and windows, other movable and easy-to-replace decorations are the secondary furnishings and layout of the living room. .
随着人们生活水平的提高,对软装设计的个性化需求愈加明显,人们通常通过专业的软装设计师、家居卖场的门店导购,或自己简单搭配来确定自己喜欢的风格和色系,以及特定的软装单品,然后才去进行软装的购置和摆场。家装设计的现状有两种主流方式,一种是3D形式,如3D Max,酷家乐,三维家,躺平设计家等。这种方式利用家装素材的三维模型在可视化工具中的示意摆放来作为主要设计过程,设计过程中的效果无法直接作为交付结果,需要经过较长时间的渲染等待得到效果图。另一种是2D形式,如美间,PS,PPT等。这种形式利用家装素材的图片在一个平面画布中进行拼图搭配,设计过程中呈现的效果就是最终的交付效果,直观简单,但需要较强的空间想象能力并且花费较长时间对图片进行透视关系、大小等调整。With the improvement of people's living standards, the personalized demand for soft decoration design has become more and more obvious. People usually determine their favorite styles and colors through professional soft decoration designers, shopping guides in home stores, or simple matching by themselves, and Specific soft outfit items, and then go to the purchase and placement of soft outfits. There are two mainstream methods for the current situation of home decoration design, one is 3D form, such as 3D Max, Kujiale, 3D home, and flat design home. This method uses the schematic placement of the 3D model of the home improvement material in the visualization tool as the main design process. The effect in the design process cannot be directly used as the delivery result, and it takes a long time to render and wait for the rendering. The other is 2D form, such as Meijian, PS, PPT, etc. This form uses pictures of home improvement materials to make puzzles on a flat canvas. The effect presented in the design process is the final delivery effect, which is intuitive and simple, but requires strong spatial imagination and takes a long time to make perspective relationships between pictures. , size, etc.
发明内容SUMMARY OF THE INVENTION
鉴于上述,本发明的目的是提供了一种家装平面自动设计方法、装置、计算机设备和存储介质,同时结合3D设计和2D设计的优点,实现简单、高效以及精美的设计效果,带给用户极致的操作体验。In view of the above, the purpose of the present invention is to provide an automatic design method, device, computer equipment and storage medium for home improvement planes, and combine the advantages of 3D design and 2D design to achieve simple, efficient and exquisite design effects, bringing users the ultimate operating experience.
第一方面,本发明实施例提供了一种家装平面自动设计方法,包括以下步骤:In a first aspect, an embodiment of the present invention provides an automatic design method for a home improvement plane, including the following steps:
获取平面家装背景图;Get the background image of flat home decoration;
根据平面家装背景图生成户型的三维结构信息和户型投影平面图;Generate the three-dimensional structure information of the unit and the projection plan of the unit according to the background picture of the flat home decoration;
接收素材设计指令;Receive material design instructions;
根据家装素材的配置属性和户型的三维结构信息,在户型投影平面图中依据素材设计指令自动放置素材,得到家装平面自动设计结果;所述家装素材的配置属性包括 素材类型、素材默认设计位置。According to the configuration attributes of the home improvement materials and the three-dimensional structure information of the house type, the materials are automatically placed in the floor plan of the house type projection according to the material design instructions, and the automatic design result of the home decoration plane is obtained; the configuration attributes of the home improvement materials include the material type and the default design position of the material.
第二方面,本发明实施例提供了一种家装平面自动设计装置,包括:In a second aspect, an embodiment of the present invention provides an automatic design device for a home improvement plane, including:
获取模块,获取平面家装背景图;Get the module to get the background image of flat home decoration;
生成模块,根据平面家装背景图生成户型的三维结构信息和户型投影平面图;The generation module generates the three-dimensional structure information of the house type and the floor plan projection of the house type according to the background picture of the flat home decoration;
接收模块,接收素材设计指令;Receiving module, receiving material design instructions;
设计模块,根据家装素材的配置属性和户型的三维结构信息,在户型投影平面图中依据素材设计指令自动放置素材,得到家装平面自动设计结果;所述家装素材的配置属性包括素材类型、素材默认设计位置。The design module, according to the configuration attributes of the home decoration materials and the three-dimensional structure information of the house type, automatically places the materials in the floor plan of the house type projection according to the material design instructions, and obtains the automatic design result of the home decoration plane; the configuration attributes of the home decoration materials include the material type and the material default design. Location.
第三方面,本发明实施例提供了一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上执行的计算机程序,所述处理器执行所述计算机程序时实现第一方面所述的家装平面自动设计方法的步骤。In a third aspect, an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program The steps of realizing the method for automatic design of home improvement planes described in the first aspect.
第四方面,本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理执行时实现第一方面所述的家装平面自动设计方法的步骤。In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is processed and executed, the method for automatically designing a home improvement plane described in the first aspect is realized. step.
与现有技术相比,本发明具有的有益效果至少包括:Compared with the prior art, the beneficial effects of the present invention at least include:
本发明实施例提供的家装平面自动设计方法和装置、计算机设备和存储介质,通过根据平面家装背景图生成户型的三维结构信息和户型投影平面图,为素材定义配置属性,根据家装素材的配置属性和户型的三维结构信息,在户型投影平面图中自动放置素材,得到家装平面自动设计结果,简化了家装设计的难度,降低了设计软件的使用门槛,利用3D信息辅助设计过程,使得设计人员的工作效率大幅度提高。The method and device, computer equipment, and storage medium for automatic design of home decoration plane provided by the embodiments of the present invention, by generating three-dimensional structure information of the house type and the floor plan of the house type according to the background picture of the plane home decoration, and defining configuration attributes for the materials, according to the configuration attributes of the home decoration materials and The three-dimensional structure information of the house type, the material is automatically placed in the house type projection plan, and the automatic design results of the home decoration plane are obtained, which simplifies the difficulty of home decoration design, lowers the threshold for the use of design software, and uses 3D information to assist the design process, making designers work more efficiently substantial improvement.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动前提下,还可以根据这些附图获得其他附图。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative efforts.
图1是本发明一实施例提供的家装平面自动设计方法的流程图;Fig. 1 is the flow chart of the home improvement plane automatic design method provided by an embodiment of the present invention;
图2是本发明一实施例提供的成像房间区域信息示意图;2 is a schematic diagram of imaging room area information provided by an embodiment of the present invention;
图3是本发明一实施例提供的显示控制点的户型投影平面图;FIG. 3 is a projected plan view of a house type showing control points according to an embodiment of the present invention;
图4是本发明一实施例提供的3D素材包围盒的结构示意图;4 is a schematic structural diagram of a 3D material bounding box provided by an embodiment of the present invention;
图5是本发明一实施例提供的吸附面高亮显示和地面素材的默认吸附位置示意图;FIG. 5 is a schematic diagram of the highlighted display of the adsorption surface and the default adsorption position of the ground material provided by an embodiment of the present invention;
图6是本发明一实施例提供的吸附面高亮显示和墙面素材的默认吸附位置示意图;FIG. 6 is a schematic diagram of the highlighted display of the adsorption surface and the default adsorption position of the wall material provided by an embodiment of the present invention;
图7是本发明一实施例提供的素材及其包围盒呈现近大远小的视觉效果图;FIG. 7 is a visual effect diagram of a material and its bounding box provided by an embodiment of the present invention showing near large and far small;
图8是本发明一实施例提供的家装平面自动设计装置的示意图;8 is a schematic diagram of an automatic design device for home improvement planes provided by an embodiment of the present invention;
图9是本发明另一实施例提供的家装平面自动设计装置的示意图;9 is a schematic diagram of an automatic design device for a home improvement plane provided by another embodiment of the present invention;
图10是本发明一实施例提供的计算机设备的结构示意图。FIG. 10 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例对本发明进行进一步的详细说明。应当理解,此处所描述的具体实施方式仅仅用以解释本发明,并不限定本发明的保护范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, and do not limit the protection scope of the present invention.
为了提升家装设计的效率和效果,本发明实施例提供了一种家装平面自动设计方法、装置、计算机设备和存储介质,具体可以应用到家装领域,实现自动生成2.5维度(2.5D)的户型投影平面图和在户型投影平面图自动默认放置素材。下面针对每部分进行详细说明。In order to improve the efficiency and effect of home improvement design, the embodiments of the present invention provide an automatic home improvement plane design method, device, computer equipment and storage medium, which can be specifically applied to the field of home improvement to automatically generate a 2.5-dimensional (2.5D) floor plan projection The floor plan and the floor plan of the floor plan are automatically placed by default. Each section is described in detail below.
实施例1Example 1
实施例1提供了一种家装平面自动设计方法。如图1所示,实施例提供家装平面自动设计方法包括以下步骤: Embodiment 1 provides an automatic design method for a home improvement plane. As shown in FIG. 1, the embodiment provides the automatic design method of home improvement plane, which includes the following steps:
S101,获取平面家装背景图。S101, acquiring a background image of plane home decoration.
平面家装背景图是用户家装平面自动设计的基准图。平面家装背景图的选择有很多,可以是带软装的完整渲染图、不带软装的空场景渲染图、实拍照片或白板,白板即空白背景。也就是本发明实施例提供的家装平面自动设计方法可以在任意背景图上进行设计。The background picture of flat home decoration is the benchmark for automatic design of the user's home decoration plane. There are many choices for the background picture of flat home decoration, which can be a complete rendering with soft decoration, an empty scene rendering without soft decoration, a real photo or a whiteboard. A whiteboard is a blank background. That is to say, the automatic design method for the home improvement plane provided by the embodiment of the present invention can be designed on any background image.
S102,根据平面家装背景图生成户型的三维信息和户型投影平面图。S102 , generating three-dimensional information of the house type and a floor plan projection of the house type according to the background image of the flat home decoration.
本发明提供的家装平面自动设计方法是一种3D或者2.5D的设计方法,因此,户型的三维信息是设计过程非常重要的辅助信息,在进行设计之前需要先获得户型的三维结构信息,然后基于该三维信息进行家装布局设计。The home improvement plane automatic design method provided by the present invention is a 3D or 2.5D design method. Therefore, the three-dimensional information of the house type is very important auxiliary information in the design process. Before designing, it is necessary to obtain the three-dimensional structure information of the house type. The three-dimensional information is used for home improvement layout design.
当平面家装背景图为渲染图时,解析渲染图后根据渲染参数获得相机参数和光场信息,并构建相机矩阵;基于渲染图和相机矩阵计算获得渲染图的三维模型,即得到户型的三维结构信息;根据户型的三维结构信息构建户型投影平面图,其中,投影平面图包括地面投影平面(简称地面)、墙面投影平面(简称墙面)以及顶面投影平面(简称顶面)至少一种。When the background image of the flat home decoration is a rendering image, after parsing the rendering image, the camera parameters and light field information are obtained according to the rendering parameters, and the camera matrix is constructed; the 3D model of the rendering image is obtained by calculating the rendering image and the camera matrix, that is, the 3D structure information of the house type is obtained. Constructing a floor plan projection plan according to the three-dimensional structure information of the floor plan, wherein the projection plan view includes at least one of a ground projection plane (referred to as the ground), a wall projection plane (referred to as a wall) and a top projection plane (referred to as the top surface).
具体来说,通过渲染图追溯到渲染过程中的参数,获取的原始相机参数包括cameraPosition(相机位置),lookat(相机看向的方向),up(相机头顶朝向的方向),fov(相机视场角),clippingNear(近平面裁剪),aspect(渲染图的长宽比),另外一种表示形式的相机参数信息包括cameraPosition,以U、V、W表示的相机坐标系, clippingNear,aspect,这两种表示形式所描述的相机参数信息是等价的。Specifically, the parameters in the rendering process are traced back through the rendering image, and the obtained original camera parameters include cameraPosition (camera position), lookat (the direction the camera is looking at), up (the direction the camera head is facing), and fov (the camera's field of view). angle), clippingNear (near plane clipping), aspect (the aspect ratio of the rendered image), and another representation of the camera parameter information includes cameraPosition, the camera coordinate system represented by U, V, W, clippingNear, aspect, these two The camera parameter information described by each representation is equivalent.
实施例中以第一种表示形式为例来说明相机矩阵的构建过程为:令zNear=clippingNear,zFar=画面中房间最远的墙角到相机的距离+补偿常数;通过cameraPosition、lookat以及up求解出相机旋转矩阵R,通过cameraPosition求出相机平移矩阵T,通过fov、aspect、zNear以及zFar求出相机的投影矩阵P;这样相机矩阵,也就是世界坐标系(3D坐标系)到平面坐标系(2D坐标系)的变换矩阵CameraTransform=P*T*R,及平面坐标系到世界坐标系的变换矩阵CameraTransform -1In the embodiment, the first representation is taken as an example to illustrate the construction process of the camera matrix: let zNear=clippingNear, zFar=the distance from the farthest corner of the room in the picture to the camera + compensation constant; The camera rotation matrix R, the camera translation matrix T is obtained through cameraPosition, and the projection matrix P of the camera is obtained through fov, aspect, zNear and zFar; in this way, the camera matrix is the world coordinate system (3D coordinate system) to the plane coordinate system (2D coordinate system). The transformation matrix CameraTransform=P*T*R of the coordinate system), and the transformation matrix CameraTransform -1 from the plane coordinate system to the world coordinate system.
当平面家装背景图为实拍照片时,预设相机参数,即以相机位置作为世界坐标系原点,且世界坐标系和相机坐标系重合,对实拍照片做边缘检测,结合墙顶地互相垂直的假设,恢复户型三维结构信息,然后依据户型的三维结构信息构建户型投影平面图。When the background picture of the flat home decoration is a real photo, the camera parameters are preset, that is, the camera position is used as the origin of the world coordinate system, and the world coordinate system and the camera coordinate system are coincident, and the edge detection is performed on the real photo, and the top of the wall is perpendicular to each other. The assumption is that the three-dimensional structure information of the house type is restored, and then the projected floor plan of the house type is constructed according to the three-dimensional structure information of the house type.
在一种实施方式中,根据户型的三维结构信息构建户型投影平面图包括:In one embodiment, constructing a floor plan of a house type projection according to the three-dimensional structure information of the house type includes:
基于户型的三维结构信息得到表示墙体连接处的所有角点(corner)信息和所有墙体(wall)信息;其中,角点信息用坐标表示,墙体信息采用连接墙体的两个角点坐标、墙体厚度以及墙体高度描述。Based on the three-dimensional structure information of the house type, all the corner information and all the wall information representing the connection of the wall are obtained; the corner information is represented by coordinates, and the wall information adopts the two corner points connecting the wall. Coordinates, wall thickness, and wall height description.
根据角点信息和墙体信息构建户型平面图后,根据相机参数对户型平面图做投影,得到户型投影平面图。具体过程为:首先,根据角点坐标和墙体信息连接对应角点生成墙体线条,得到户型平面图;然后,根据相机位置和相机看向的方向的近平面裁剪距离,获得相机看向的方向点位的平面坐标后,根据相机看向的点位的平面坐标判断并确定相机看向的点位位于平面户型图的房间区域;最后,筛选确定组成房间区域的有效角点,基于有效角点、墙体厚度、墙体高度以及相机参数生成墙面投影平面、地面投影平面以及顶面投影平面,形成房间区域的户型投影平面图。After building the floor plan according to the corner point information and the wall information, project the floor plan according to the camera parameters to obtain the floor plan of the floor plan. The specific process is: first, connect the corresponding corner points to generate wall lines according to the corner coordinates and wall information, and obtain the floor plan of the house; then, according to the camera position and the near-plane clipping distance of the direction the camera is looking at, obtain the direction the camera is looking at After the plane coordinates of the point, judge and determine that the point the camera is looking at is located in the room area of the floor plan according to the plane coordinates of the point the camera is looking at; finally, filter and determine the effective corners that make up the room area, based on the effective corners , wall thickness, wall height and camera parameters to generate the wall projection plane, the ground projection plane and the top projection plane to form the floor plan of the room area.
在实施例中,在获得房间区域的有效角点后,依据有效角点连接形成户型骨架,依据墙体厚度,沿户型骨架向内和向外生成与户型骨架平行的线条作为墙内线和墙外线,确定墙内线的交点并以该交点作为目标角点,同时获得二维坐标(x,y),依据相机高度和楼层高度确定目标角点的z坐标,得到目标角点的三维坐标(x,y,z),依据目标角点的三维坐标确定空间连线,采用由相机参数确定的相机视椎对空间连线进行截断来生成新控制点,以处于相机视椎内的目标角点为原控制点,依据新控制点和原控制点生成墙面投影平面、地面投影平面以及顶面投影平面,形成房间区域的户型投影平面图。In the embodiment, after obtaining the effective corner points of the room area, the apartment frame is formed according to the connection of the effective corner points, and according to the thickness of the wall, lines parallel to the apartment frame are generated inwardly and outwardly along the apartment frame as the inner wall line and the outer wall line. , determine the intersection of the lines in the wall and use the intersection as the target corner, obtain the two-dimensional coordinates (x, y) at the same time, determine the z-coordinate of the target corner according to the camera height and floor height, and obtain the three-dimensional coordinates of the target corner (x, y) y, z), determine the space connection line according to the three-dimensional coordinates of the target corner point, use the camera view cone determined by the camera parameters to truncate the space connection line to generate a new control point, and take the target corner point in the camera view cone as the original. Control point, according to the new control point and the original control point to generate the wall projection plane, the ground projection plane and the top projection plane to form the floor plan of the room area.
实施例中,相机看向的方向点位是指相机看向的方向的裁剪平面,即成像视锥的近平面,和相机看向的方向的交点。由于房间区域是一个封闭区域,将房间区域内处于墙体之间的角点和户型其他房间的角点作为冗余点剔除,剩下的角点为组成房间区 域的有效角点。如图2所示,旁边没有圆点的符号×表示的角点为相机所在房间的冗余点,剩下的旁边有圆点的符号×用于组成墙体,为有效角点。剔除冗余点之后,利用墙体的厚度信息,沿着垂直于墙体的方向分别增减1/2的墙体厚度,得到墙内线和墙外线,并以墙内线的交点为目标角点,即图2中的圆点部分,它们是描述相机所在房间墙内线构成的多边形的最小点集。In the embodiment, the point in the direction the camera looks at refers to the clipping plane of the direction in which the camera looks, that is, the intersection of the near plane of the imaging viewing cone and the direction in which the camera looks. Since the room area is a closed area, the corner points between the walls in the room area and the corner points of other rooms of the apartment type are eliminated as redundant points, and the remaining corner points are the effective corner points that constitute the room area. As shown in Figure 2, the corners represented by the symbol × without dots are redundant points in the room where the camera is located, and the remaining symbols × with dots next to them are used to form walls and are valid corners. After eliminating the redundant points, use the thickness information of the wall to increase or decrease the thickness of the wall by 1/2 along the direction perpendicular to the wall to obtain the inner wall line and the outer wall line, and take the intersection of the inner wall line as the target corner point, That is, the dots in Figure 2, they are the smallest set of points that describe the polygons formed by the lines in the wall of the room where the camera is located.
实施例中,最终用于形成的投影平面图的目标角点(图2中的圆点)实际上是所有墙内线的交点,但因为房间是不规则的,无法区分墙内线和墙外线,因此需要进行线条识别来确定墙内线的交点,具体过程包括:In the embodiment, the target corner point (the circle point in Fig. 2 ) of the final projected plan view is actually the intersection point of all the inner wall lines, but because the room is irregular, it is impossible to distinguish the inner wall line and the outer wall line, so it is necessary to Line recognition is performed to determine the intersection of lines within the wall. The specific process includes:
对墙内线和墙外线进行延伸实现交点连接处的闭合生成交点,同时剔除交点处的出头线段,然后查找相机看向的方向点位的平面坐标所在的闭合区域方法获得墙内线即墙内线的交点作为目标角点。Extend the line inside the wall and the line outside the wall to realize the closure of the intersection connection to generate the intersection, and at the same time remove the outgoing line segment at the intersection, and then find the closed area where the plane coordinates of the point in the direction the camera is looking at. as the target corner.
实施例中,应用相机视锥可以实现室内区域的透视投影和正交投影,当实现透视投影时,采用的相机视锥为椎台对目标角点的空间连接截断,椎台与空间连接的交点为新控制点;当实现正交投影时,采用的相机视锥为立方体对目标角点的空间连接截断。In the embodiment, the perspective projection and orthogonal projection of the indoor area can be realized by using the camera view cone. When the perspective projection is realized, the camera view cone used is the truncation of the spatial connection of the vertebral frustum to the target corner, and the intersection of the vertebral frustum and the spatial connection. is the new control point; when the orthographic projection is realized, the camera view cone used is the spatial connection truncation of the cube to the target corner.
实施例中,依次对新控制点和原控制点进行连接,生成墙面投影平面,然后,将墙体的所有上控制点连接形成顶面投影平面,将墙体的所有下控制点连接形成底面投影平面,形成房间区域的户型投影平面图。In the embodiment, the new control point and the original control point are connected in sequence to generate the wall projection plane, then all the upper control points of the wall are connected to form the top projection plane, and all the lower control points of the wall are connected to form the bottom surface. Projection plane, which forms the projected floor plan of the room area.
本发明中将投影平面称为吸附面,表示能够根据素材的配置属性吸附家装素材到相应面上。为了更好地描述吸附面,设定平面的角点为控制点,依据控制点来描述吸附面。实施例中吸附面用顺时针连接的控制点表示,以一个List来描述渲染图的户型结构的可见投影平面,每个可见投影平面以不少于3个控制点描述。特别地,当某一投影平面被画面(也就是视锥范围)截断时,控制点要相应地调整到画面内,并视情况增加。例如,如图3所示的左数第一面墙A被视锥截掉一个角,则描述左数第一面墙的控制点将由4个会变成5个,此外最后整个画面中4个角也被作为控制点加入对应的投影平面,保证整个画面被所有投影平面完全覆盖,如图3中的左上角、右上角、右下角,但投影平面可在画面中重合,如凹凸墙背后的平面如图3中B部分。In the present invention, the projection plane is called the adsorption surface, which means that the home improvement material can be adsorbed to the corresponding surface according to the configuration property of the material. In order to better describe the adsorption surface, the corner points of the plane are set as control points, and the adsorption surface is described according to the control points. In the embodiment, the adsorption surface is represented by the control points connected clockwise, and a List is used to describe the visible projection plane of the house type structure of the rendering image, and each visible projection plane is described by no less than 3 control points. In particular, when a certain projection plane is cut off by the picture (that is, the viewing cone range), the control points should be adjusted accordingly to the picture, and increased as needed. For example, as shown in Figure 3, the first wall A from the left is truncated by a corner of the view cone, then the control points describing the first wall from the left will be changed from 4 to 5. In addition, there are 4 control points in the last whole picture. The corners are also added to the corresponding projection planes as control points to ensure that the entire picture is completely covered by all projection planes, such as the upper left, upper right, and lower right corners in Figure 3, but the projection planes can overlap in the picture, such as the one behind the bump wall. The plane is shown in part B in Figure 3.
当平面家装背景图为白板时,需要预定义一系列的渲染图作为白板的三维结构信息的输入,依据户型的三维结构信息构建户型投影平面图;但工具展示层面为空白,即RGB=(255,255,255),或用户定义的其他值。其中一种典型的情况是,选取相机正视正前方,且视野中只有一面墙的局部的情况,这种情况下所有家装素材都以铺贴类型放置在同一平面上,兼容了纯2D设计的情况。When the background image of the flat home decoration is a whiteboard, a series of rendering images need to be predefined as the input of the three-dimensional structure information of the whiteboard, and the projected floor plan of the house type is constructed according to the three-dimensional structure information of the house type; but the tool display level is blank, that is, RGB=(255, 255, 255), or other user-defined value. One of the typical cases is to select the case where the camera is looking straight ahead, and there is only a part of a wall in the field of view. In this case, all the home improvement materials are placed on the same plane in a tiled type, which is compatible with pure 2D design. .
S103,接收素材设计指令。S103, receiving a material design instruction.
素材设计指令是指将家装素材设计在户型投影平面的各种操作指令,包括素材放置、素材移动、素材缩放、素材旋转、素材替换、渲染以及生成提案等。本发明中,主要涉及素材放置指令。Material design instructions refer to various operation instructions for designing home improvement materials on the home projection plane, including material placement, material movement, material scaling, material rotation, material replacement, rendering, and generating proposals. In the present invention, it mainly relates to the material placement instruction.
S104,根据家装素材的配置属性和户型的三维结构信息,在户型投影平面图中依据素材设计指令自动放置素材,得到家装平面自动设计结果。S104 , according to the configuration attributes of the home improvement materials and the three-dimensional structure information of the house type, the materials are automatically placed in the house type projection plan according to the material design instruction, and the result of the automatic design of the home decoration plane is obtained.
家装素材的配置属性是事先设定好的,应用的时候直接使用配置属性,其中,配置属性包括素材类型和素材默认设计位置。按照设置方式定义了两种素材类型,分别为放置类型和铺贴类型。其中,放置类型是指能够直接摆放的素材,如沙发,床,桌子等,进一步细分,放置类型包括放置在地面、挂置在墙面以及吊置在顶面。铺贴类型是指能够铺贴设置的素材,如地毯、挂画、窗帘等,进一步细分,铺贴类型包括铺置在地面和贴置在墙面。The configuration properties of home improvement materials are set in advance, and the configuration properties are directly used when applying, among which the configuration properties include the material type and the default design position of the material. Two material types are defined according to the setting method, namely placement type and tile type. Among them, placement type refers to materials that can be placed directly, such as sofas, beds, tables, etc., and is further subdivided. Placement types include placement on the ground, hanging on the wall, and hanging on the top surface. The type of paving refers to the materials that can be paved, such as carpets, paintings, curtains, etc., and is further subdivided. The types of paving include paving on the ground and pasting on the wall.
对于铺贴类型的素材,可以根据素材铺贴设置的具体吸附面,应用相同的透视变换,将铺贴类型的素材预览图贴在对应的吸附面。对于放置类型的素材,将放置在地面和挂置在顶面的素材直接素材正面朝向相机站立设置,将挂置在墙面的素材则背靠墙面吸附。For materials of the tile type, you can apply the same perspective transformation according to the specific adsorption surface set by the material tile, and paste the preview image of the tile type material on the corresponding adsorption surface. For placement type materials, set the materials placed on the ground and the top surface to stand with the front of the material facing the camera, and the materials hung on the wall with their backs against the wall.
按照维度同样也定义了两种素材类型,分别为三维(3D)素材和二维(2D)素材,即本发明提供的家装平面自动设计方法同时支持在平面上3D素材和2D素材的混合设计,在画布中被操作的素材元素均为图片,背景是一个大贴图作为背景图层,每个素材元素都是一个小图片,由一个单独的图层承载。According to the dimensions, two types of materials are also defined, namely three-dimensional (3D) materials and two-dimensional (2D) materials, that is, the automatic design method of home decoration plane provided by the present invention supports the mixed design of 3D materials and 2D materials on the plane at the same time, The material elements manipulated in the canvas are all pictures, the background is a large texture as the background layer, and each material element is a small picture, which is carried by a separate layer.
为了方便在设计过程中对3D素材和2D素材的调整,为3D素材和2D素材设置描述标识。In order to facilitate the adjustment of the 3D material and the 2D material in the design process, a description mark is set for the 3D material and the 2D material.
设置3D素材的调整描述标识为包含坐标系的立体包围盒(Bounding Box)。Bounding Box是由x、y、z三个值描述的物体物理尺寸,单位可以为毫米。实施例定义3D素材的模型坐标系为笛卡尔坐标系,令水平向右为x轴正方向,水平向前为y轴正方向,垂直向上为z轴正方向,坐标系的原点位于素材的形心。那么对于每个3D素材来说,其初始状态形心坐标均为(0,0,0),Bounding Box所描述的立方体的8个顶点的坐标分别为[点1(x/2,y/2,z/2),点2(-x/2,y/2,z/2),点3(-x/2,-y/2,z/2),点4(x/2,-y/2,z/2),点5(x/2,y/2,-z/2),点6(-x/2,y/2,-z/2),点7(-x/2,-y/2,-z/2),点8(x/2,-y/2,-z/2)],如图4所示。3D模型所描述的素材完全被Bounding Box所包围。Sets the adjustment description of the 3D material as the Bounding Box containing the coordinate system. Bounding Box is the physical size of an object described by three values of x, y, and z, and the unit can be millimeters. The embodiment defines that the model coordinate system of the 3D material is a Cartesian coordinate system, so that the horizontal rightward is the positive direction of the x-axis, the horizontal forward is the positive direction of the y-axis, and the vertical upward is the positive direction of the z-axis. The origin of the coordinate system is located in the shape of the material. Heart. Then for each 3D material, its initial state centroid coordinates are (0, 0, 0), and the coordinates of the 8 vertices of the cube described by the Bounding Box are [point 1 (x/2, y/2 ,z/2),point 2(-x/2,y/2,z/2),point 3(-x/2,-y/2,z/2),point 4(x/2,-y /2, z/2), point 5 (x/2, y/2, -z/2), point 6 (-x/2, y/2, -z/2), point 7 (-x/2) ,-y/2,-z/2), point 8(x/2,-y/2,-z/2)], as shown in Figure 4. The material described by the 3D model is completely surrounded by the Bounding Box.
对于2D素材,描述其物理尺寸的Bounding Box是缺失的,但是本发明中仍然沿用3D素材Bounding Box的坐标形式,根据2D素材类别的经验观察赋予其默认高度值,即Bounding Box中的z值,令y值为0,x值根据2D图片的长高比和Bounding Box的z值等比例计算得到。假设z的默认高度值为2000mm,对应素材的像素高度为400px, 素材的真实像素宽度为600px,则依据等比例计算得到z值为3000mm。在得到x,y,z值之后,将笛卡尔坐标系的原点设置在2D素材的形心位置,则获得Bounding Box的4个顶点坐标分别为{点1(-x/2,0,z/2),点2(-x/2,0,-z/2),点3(x/2,0,-z/2),点4(x/2,0,z/2)}。For 2D material, the Bounding Box describing its physical size is missing, but the present invention still uses the coordinate form of the 3D material Bounding Box, and assigns its default height value according to the empirical observation of the 2D material category, that is, the z value in the Bounding Box, Let the y value be 0, and the x value is calculated according to the ratio of the aspect ratio of the 2D image and the z value of the Bounding Box. Assuming that the default height of z is 2000mm, the pixel height of the corresponding material is 400px, and the real pixel width of the material is 600px, then the z value is 3000mm according to the proportional calculation. After obtaining the x, y, z values, set the origin of the Cartesian coordinate system at the centroid of the 2D material, then the coordinates of the four vertices of the Bounding Box are {point 1(-x/2,0,z/ 2), point 2(-x/2,0,-z/2), point 3(x/2,0,-z/2), point 4(x/2,0,z/2)}.
至此,2D素材和3D素材有了同样完备的描述标识,不同的是3D素材的Bounding Box是一个立方体,而2D素材的Bounding Box是一个平面(特殊的,厚度为0的立方体)。So far, 2D material and 3D material have the same complete description and identification, the difference is that the Bounding Box of 3D material is a cube, while the Bounding Box of 2D material is a plane (a special cube with a thickness of 0).
素材默认设计位置包括素材的默认吸附位置和默认吸附面。实施例中,根据素材类型为不同类型素材定义对应的默认吸附面和默认吸附位置,以实现更加快捷的智能摆放。对于没有定义类型的图片,可以采用图像识别的算法寻找和图片的语义内容最匹配的素材类型,根据最匹配的素材类型定义图片的默认吸附面和默认吸附位置。The default design position of the material includes the default adsorption position and the default adsorption surface of the material. In the embodiment, corresponding default adsorption surfaces and default adsorption positions are defined for different types of materials according to the material types, so as to realize more efficient and intelligent placement. For a picture without a defined type, the image recognition algorithm can be used to find the material type that best matches the semantic content of the picture, and the default adsorption surface and default adsorption position of the picture can be defined according to the most matching material type.
对于放置在地面和铺置在地面的地面素材,定义其默认吸附面为户型投影平面图中的地面;对于吊置在顶面的顶面素材,定义其默认吸附面为户型投影平面图中的顶面;对于挂置在墙面和贴置在墙面的墙面素材,定义其默认吸附面为户型投影平面图中的墙面。For the ground materials placed on the ground and laid on the ground, the default adsorption surface is defined as the ground in the floor plan of the floor plan; for the top surface material suspended on the top surface, the default adsorption surface is defined as the top surface in the floor plan of the floor plan. ; For the wall materials hung on the wall and pasted on the wall, define the default adsorption surface as the wall in the floor plan of the floor plan.
为每类素材设置好默认吸附面后,为了增强显示素材与默认吸附面之间的对应关系,便于用户认知。素材被选择拖动过程中,素材对应的默认吸附面的控制点连接成闭环线,闭环线或/和闭环线形成的虚拟面以高亮显示,当素材放置到吸附面时,高亮显示消失。实施例中,可以依据用户指令,素材预览图被拖到户型投影平面图中,与素材对应的默认吸附面的控制点会连成闭环线,该闭环线所形成的虚拟面会显示出来,称之为吸附面高亮,如图5所示。素材在拖动过程中时,吸附面高亮会一直显示直到素材被放置,放置素材后的初始状态呈现为被选中的状态,同时吸附面高亮消失。After setting the default adsorption surface for each type of material, in order to enhance the corresponding relationship between the display material and the default adsorption surface, it is convenient for users to recognize. When the material is selected and dragged, the control points of the default adsorption surface corresponding to the material are connected to form a closed-loop line, and the virtual surface formed by the closed-loop line or/and the closed-loop line is highlighted. When the material is placed on the adsorption surface, the highlighted display disappears. . In the embodiment, the preview image of the material can be dragged to the floor plan of the floor plan according to the user's instruction, and the control points of the default adsorption surface corresponding to the material will be connected to form a closed-loop line, and the virtual surface formed by the closed-loop line will be displayed. The adsorption surface is highlighted, as shown in Figure 5. When the material is being dragged, the highlight of the adsorption surface will be displayed until the material is placed. The initial state after the material is placed is the selected state, and the highlight of the adsorption surface disappears.
针对放置在地面的地面素材,本发明还定义了地面素材在默认吸附面-地面中的默认吸附位置的方法包括:(a1)当素材预览图的下边线与控制点形成的地面有交集时,放置后保证素材预览图的下边线和素材包围盒的与x方向平行的前下边线(也就是图4中5、6顶点的连线)重叠且两者的中心点重合,以此来确定默认吸附位置,如图5所示。For the ground material placed on the ground, the present invention also defines a method for the default adsorption position of the ground material in the default adsorption surface-ground, including: (a1) When the bottom line of the material preview image and the ground formed by the control point intersect, After placing, ensure that the lower edge of the material preview image and the front and lower edge of the material bounding box parallel to the x direction (that is, the line connecting the vertices 5 and 6 in Figure 4) overlap and the center points of the two overlap, so as to determine the default The adsorption position is shown in Figure 5.
(b1)当素材预览图的上边线、下边线均只与控制点形成的墙面有交集时,将素材预览图的下边线沿着世界坐标系的z轴投射到地面得到下边投射线,根据下边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的下边投射线与素材包围盒的与x方向平行的前下边线(也就是图4中5、6顶点的连线)重叠且两者的中心点重合,如图5所示;方式二,放置后保证素材预览图的下边投射线与素材包围盒的与x方向平行的前下边线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒 完全在地面内。(b1) When the upper and lower lines of the material preview image only intersect with the wall formed by the control points, project the lower line of the material preview image to the ground along the z-axis of the world coordinate system to obtain the lower projection line, according to The lower projection line determines two default adsorption positions: Method 1, after placing, ensure that the lower projection line of the material preview image and the front and lower edge of the material bounding box parallel to the x-direction (that is, the line connecting vertices 5 and 6 in Figure 4) Overlap and the center points of the two overlap, as shown in Figure 5; Method 2, after placing, ensure that the lower projection line of the material preview image overlaps with the front and lower line parallel to the x-direction of the material bounding box, and a certain offset is calculated. , when calculating the offset, make sure that the bounding box of the material is completely inside the ground.
(c1)当素材预览图的上边线与控制点形成的顶面有交集时,将素材预览图的上边线沿着世界坐标系的z轴投射到地面得到上边投射线,根据上边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的上边投射线与素材包围盒的与x方向平行的前下边线重叠且两者的中心点重合,如图5所示;方式二,放置后保证素材预览图的上边投射线与素材包围盒的与x方向平行的前下边线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在地面内。(c1) When the upper edge of the material preview image intersects with the top surface formed by the control points, project the upper edge of the material preview image to the ground along the z-axis of the world coordinate system to obtain the upper projection line, and determine 2 according to the upper projection line Default adsorption position: Method 1, after placing, ensure that the upper projection line of the material preview image overlaps with the front and lower side lines of the material bounding box parallel to the x-direction and the center points of the two coincide, as shown in Figure 5; Method 2, place Afterwards, ensure that the upper projection line of the material preview image overlaps with the front and lower side lines of the material bounding box parallel to the x direction, and perform a certain offset calculation. When calculating the offset, ensure that the material bounding box is completely within the ground.
针对铺贴在地面的地面素材,本发明还定义了地面素材在默认吸附面-地面中的默认吸附位置的方法包括:(a2)当素材预览图的下边线与控制点形成的地面有交集时,素材自动与地面形成一致的透视关系,放置后保证素材预览图的下边线和素材包围盒的底面(也就是图4中顶点5、6、7、8组成的平面)x方向的中心线重叠且两者的中心点重合,以此来确定默认吸附位置,如图5所示。For the ground material laid on the ground, the present invention also defines a method for the default adsorption position of the ground material in the default adsorption surface-ground, including: (a2) When the bottom line of the material preview image intersects with the ground formed by the control points , the material automatically forms a consistent perspective relationship with the ground. After placing, ensure that the bottom line of the material preview image and the bottom surface of the material bounding box (that is, the plane composed of vertices 5, 6, 7, and 8 in Figure 4) The center line in the x direction overlaps And the center points of the two coincide, so as to determine the default adsorption position, as shown in Figure 5.
(b2)当素材预览图的上边线、下边线均只与控制点形成的墙面有交集时,将素材预览图的下边线沿着世界坐标系的z轴投射到地面得到下边投射线,根据下边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的下边投射线与素材包围盒的底面x方向的中心线重叠且两者的中心点重合,如图5所示;方式二,放置后保证素材预览图的下边投射线与素材包围盒的底面x方向的中心线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在地面内。(b2) When the upper and lower lines of the material preview image only intersect with the wall formed by the control points, project the lower line of the material preview image to the ground along the z-axis of the world coordinate system to obtain the lower projection line, according to The lower projection line determines two default adsorption positions: Method 1, after placing, ensure that the lower projection line of the material preview image overlaps with the center line of the bottom surface of the material bounding box in the x direction and the center points of the two coincide, as shown in Figure 5; Method 2. After placing, ensure that the lower projection line of the material preview image overlaps with the center line of the bottom surface of the material bounding box in the x direction and perform a certain offset calculation. When calculating the offset, ensure that the material bounding box is completely within the ground.
(c2)当素材预览图的上边线与控制点形成的顶面有交集时,将素材预览图的上边线沿着世界坐标系的z轴投射到地面得到上边投射线,根据上边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的上边投射线与素材包围盒的底面x方向的中心线重叠且两者的中心点重合,如图5所示;方式二,放置后保证素材预览图的上边投射线与素材包围盒的的底面x方向的中心线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在地面内。(c2) When the upper edge of the material preview image intersects with the top surface formed by the control points, project the upper edge of the material preview image to the ground along the z-axis of the world coordinate system to obtain the upper projection line, and determine 2 according to the upper projection line. Default adsorption position: Method 1, after placing, ensure that the upper projection line of the material preview image and the center line of the bottom surface of the material bounding box in the x-direction overlap and the center points of the two coincide, as shown in Figure 5; Method 2, ensure that after placing The upper projection line of the material preview image overlaps with the center line of the bottom surface of the material bounding box in the x direction, and a certain offset calculation is performed. When calculating the offset, ensure that the material bounding box is completely within the ground.
针对顶面素材,本发明同样定义了顶面素材在默认吸附面-顶面中的默认吸附位置的方法,顶面素材的默认吸附位置与地面素材的默认吸附位置类似,即将地面素材的默认吸附位置的定义方法中,地面更换为顶面,顶面换为底面,下边线更换为上边线,上边线更换为下边线,下边投射线更换为上边投射线,上边投射线更换为下边投射线,图4中5、6顶点的连线更换为图4中1、2顶点的连线,其他内容与地面素材的默认吸附位置的定义方法相同。具体为:For the top surface material, the present invention also defines a method for the default adsorption position of the top surface material in the default adsorption surface - the top surface. The default adsorption position of the top surface material is similar to the default adsorption position of the ground material, that is, the default adsorption position of the ground material In the method of defining the position, the ground is replaced by the top surface, the top surface is replaced by the bottom surface, the lower side line is replaced by the upper side line, the upper side line is replaced by the lower side line, the lower side projection line is replaced by the upper side projection line, and the upper side projection line is replaced by the lower side projection line. The connection of vertices 5 and 6 in Figure 4 is replaced with the connection of vertices 1 and 2 in Figure 4. Other content is the same as the definition method of the default adsorption position of the ground material. Specifically:
(a3)当素材预览图的上边线与顶面有交集时,放置后保证素材预览图的上边线和素材包围盒的与x方向平行的前上边线重叠且两者的中心点重合;(a3) When the upper edge of the material preview image has an intersection with the top surface, ensure that the upper edge of the material preview image and the front upper edge of the material bounding box parallel to the x-direction overlap and the center points of the two overlap after placement;
(b3)当素材预览图的下边线、上边线均只与墙面有交集时,将素材预览图的上 边线沿着世界坐标系的z轴投射到顶面得到上边投射线,根据上边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的上边投射线与素材包围盒的与x方向平行的前上边线重叠且两者的中心点重合;方式二,放置后保证素材预览图的上边投射线与素材包围盒的与x方向平行的前上边线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在顶面内;(b3) When the bottom and top lines of the material preview image only intersect with the wall, project the top line of the material preview image to the top surface along the z-axis of the world coordinate system to obtain the top projected line, which is determined according to the top projected line There are 2 default adsorption positions: Method 1, after placing, ensure that the upper projection line of the material preview image overlaps with the front upper side line of the material bounding box parallel to the x direction and the center points of the two coincide; method 2, ensure that the material preview image is placed after placement The upper projection line of the material bounding box overlaps with the front upper line parallel to the x direction of the material bounding box and performs a certain offset calculation. When calculating the offset, ensure that the material bounding box is completely within the top surface;
(c3)当素材预览图的下边线与地面有交集时,将素材预览图的下边线沿着世界坐标系的z轴投射到顶面得到下边投射线,根据下边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的下边投射线与素材包围盒的与x方向平行的前上边线重叠且两者的中心点重合;方式二,放置后保证素材预览图的下边投射线与素材包围盒的与x方向平行的前上边线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在顶面内。(c3) When the bottom line of the material preview image intersects with the ground, project the bottom line of the material preview image to the top surface along the z-axis of the world coordinate system to obtain the bottom projection line, and determine two default adsorption positions according to the bottom projection line: Method 1: After placing, ensure that the lower projection line of the material preview image overlaps with the front and upper side lines of the material bounding box parallel to the x-direction, and the center points of the two coincide; Method 2, after placing, ensure that the lower projection line of the material preview image and the material The front upper edge of the bounding box that is parallel to the x-direction overlaps and a certain offset is calculated. When calculating the offset, ensure that the material bounding box is completely within the top surface.
针对墙面素材,本发明还定义了墙面素材在默认吸附面-墙面中的默认吸附位置的方法包括:(a4)当素材预览图的上边线和下边线只与控制点形成的墙面有交集时,则素材放置在与素材预览图中心相交的墙面上,素材自动与墙面形成一致的透视关系,根据该透视关系判断并确定素材包围盒的贴合平面,所述贴合平面为包围盒的左侧面(也就是图4中顶点2、3、7、6组成的平面)、后平面(也就是图4中顶点3、4、8、7组成的平面)或右侧面(也就是图4中顶点1、4、8、5组成的平面),放置后素材预览图的中心点和贴合平面的中心点重合,如图6所示。For the wall material, the present invention also defines a method for the default adsorption position of the wall material in the default adsorption surface-wall surface, including: (a4) when the upper and lower lines of the material preview image are only connected to the wall formed by the control points When there is an intersection, the material is placed on the wall that intersects with the center of the material preview image, and the material automatically forms a consistent perspective relationship with the wall. According to the perspective relationship, the fitting plane of the bounding box of the material is judged and determined. The fitting plane It is the left side of the bounding box (that is, the plane composed of vertices 2, 3, 7, and 6 in Figure 4), the back plane (that is, the plane composed of vertices 3, 4, 8, and 7 in Figure 4) or the right side. (that is, the plane composed of vertices 1, 4, 8, and 5 in Figure 4), the center point of the material preview after placement coincides with the center point of the fitting plane, as shown in Figure 6.
(b4)当素材预览图的下边线和控制点形成的地面有交集时,则将素材预览图的下边线的中心沿着世界坐标系的z轴投射到墙面和地面的交界线上,得到投影点A,素材预览图放置在投影点A所在的墙面上,素材自动与墙面形成一致的透视关系,根据该透视关系判断并确定素材包围盒的贴合平面,素材放置后,素材包围盒的贴合平面的下边线的中心点和投影点A重合,如图6所示;(b4) When the bottom line of the material preview image and the ground formed by the control points have an intersection, the center of the bottom line of the material preview image is projected along the z-axis of the world coordinate system to the boundary line between the wall and the ground to obtain Projection point A, the preview image of the material is placed on the wall where the projection point A is located, and the material automatically forms a consistent perspective relationship with the wall. According to the perspective relationship, the fitting plane of the material bounding box is judged and determined. After the material is placed, the material is surrounded by The center point of the lower edge of the box's fitting plane coincides with the projection point A, as shown in Figure 6;
(c4)当素材预览图的上边线和控制点形成的顶面有交集时,则将素材预览图的上边线的中心沿着世界坐标系的z轴投射到墙面和顶面的交界线上,得到投影点B,素材预览图放置在投影点B点所在的墙面上,素材自动与墙面形成一致的透视关系,根据该透视关系判断并确定与墙面贴合的素材包围盒的贴合平面,素材放置后,素材包围盒的贴合平面的上边线的中心点和投影点B重合,如图6所示。(c4) When the upper edge of the material preview image and the top surface formed by the control points intersect, the center of the upper edge of the material preview image is projected along the z-axis of the world coordinate system to the boundary line between the wall and the top surface , get the projection point B, and place the material preview image on the wall where the projection point B is located. After the material is placed, the center point of the upper edge of the material bounding box and the projection point B coincide, as shown in Figure 6.
本发明中,通过鼠标拖动素材到户型投影平面图上来放置素材,或者点击按钮,素材预览图可以吸附在鼠标上,此时再点击户型投影平面图可以放置素材。另外,拖动或点击按钮初始瞬间,鼠标定位在素材预览图的中心处。设计时,依据素材设计指令被选中的素材会依据其配置属性自动生成在默认吸附面的默认吸附位置,素材预览图被放置在默认吸附位置后会自动调整成物理尺寸,其他时候均保持图标大小,以实 现默认设计。In the present invention, the material can be placed by dragging the material onto the floor plan of the house type projection with the mouse, or by clicking the button, the preview image of the material can be adsorbed on the mouse, and then clicking on the floor plan of the house type projection can place the material. In addition, at the initial moment of dragging or clicking the button, the mouse is positioned at the center of the preview image of the material. During design, the material selected according to the material design instruction will be automatically generated in the default adsorption position of the default adsorption surface according to its configuration properties. After the material preview is placed in the default adsorption position, it will be automatically adjusted to the physical size, and the icon size will be maintained at other times. , to implement the default design.
由于型投影平面图是一个投影平面,为了使得设计结果图实现符合真实世界观测结果的近大远小的呈现效果。需要调整放置素材呈现近大远小的透视效果。在传统的2D设计中,用户通常要靠自己的空间想象能力手动去缩放每个素材的大小,以达到近大远小的效果。这种手动调节方式效率低、准确性差、效果也差。Since the type projection plan is a projection plane, in order to make the design result map realize the presentation effect of near big and far small in line with the real world observation results. You need to adjust the placement of the material to show the perspective effect of near, large and far. In traditional 2D design, users usually rely on their own spatial imagination to manually scale the size of each material to achieve the effect of near big and far small. This manual adjustment method has low efficiency, poor accuracy and poor effect.
为了解决手动调节方式效率低、准确性差、效果也差的问题,本发明家装平面自动设计方法还包括:对3D素材自动调节尺寸以实现近大远小效果,包括:基于素材的包围盒和相机参数,在给定素材预览图在户型投影平面中位姿(位置和姿态)之后,通过计算得到素材包围盒的8个顶点在户型投影平面中的2D坐标,实现对3D素材的调整。In order to solve the problems of low efficiency, poor accuracy and poor effect of the manual adjustment method, the automatic design method of the home decoration plane of the present invention further includes: automatically adjusting the size of the 3D material to achieve the effect of near large and far small, including: a material-based bounding box and a camera parameters, after the pose (position and attitude) of the material preview image in the house type projection plane is given, the 2D coordinates of the 8 vertices of the material bounding box in the house type projection plane are obtained by calculation, so as to realize the adjustment of the 3D material.
在其中一个实施方式中,对3D素材自动调节尺寸过程为:计算包围盒的形心所在的平行于户型投影平面图的平面,将素材预览图贴在包围盒的形心处,则素材预览图的显示高度h=bbox.z+a*bbox.y,其中,系数a根据素材所在吸附面的法线在平行于户型投影平面图方向上的投影确定,bbox.z是包围盒投影到于户型投影平面图后,后平面高度的像素尺寸,bbox.y是将包围盒的上平面或下平面展开到与后平面平行时的像素尺寸,a*bbox.y表示包围盒的上平面或下平面在户型投影平面图中像素尺寸;素材预览图的显示宽度根据素材预览图的高宽比等比例计算得到,以此来保证素材预览图和包围盒的一致性,在确定素材预览图的显示高度和宽度之后,再根据相机参数即可以确定包围盒的8个顶点在户型投影平面中的2D坐标,进而实现对3D素材的调整。如图7中的吊灯,这样在画面中的不同位置,包围盒会根据物理尺寸实现近大远小的视觉效果,3D素材一起变大变小。In one embodiment, the process of automatically adjusting the size of the 3D material is: calculating the plane parallel to the floor plan of the floor plan where the centroid of the bounding box is located, and pasting the material preview image at the centroid of the bounding box, then the Display height h=bbox.z+a*bbox.y, in which the coefficient a is determined according to the projection of the normal of the adsorption surface where the material is located in the direction parallel to the floor plan of the floor plan, and bbox.z is the projection of the bounding box to the floor plan of the floor plan. After, the pixel size of the height of the back plane, bbox.y is the pixel size when the upper or lower plane of the bounding box is expanded to be parallel to the back plane, a*bbox.y represents the upper or lower plane of the bounding box projected on the house The pixel size in the plan view; the display width of the material preview is calculated according to the aspect ratio of the material preview to ensure the consistency of the material preview and the bounding box. After determining the display height and width of the material preview, Then, according to the camera parameters, the 2D coordinates of the 8 vertices of the bounding box in the house type projection plane can be determined, and then the adjustment of the 3D material can be realized. As shown in the chandelier in Figure 7, at different positions in the picture, the bounding box will achieve the visual effect of near and far according to the physical size, and the 3D material will become larger and smaller together.
对于2D素材,bbox.y=0,bbox.x由bbox.z和素材预览图的高宽比计算得到,所以包围盒和素材预览图在户型投影平面图中也是完全匹配的状态,如图7中的沙发。For 2D materials, bbox.y=0, bbox.x is calculated from bbox.z and the aspect ratio of the material preview, so the bounding box and the material preview are also completely matched in the floor plan of the floor plan, as shown in Figure 7 sofa.
为了实现快速自定义设计,实施例提供的家装平面自动设计方法还包括:设定有用于为素材提供快捷切换放置位置的操作栏,操作栏依据素材被选中而显示呈现,切换放置位置包括包含放在地上、吊在顶上、挂在墙上、贴在墙面和铺在地面;用户通过选中切换放置位置实现对素材的快捷操作,以实现自定义设计。In order to realize rapid custom design, the method for automatic design of home decoration plane provided by the embodiment further includes: setting an operation bar for providing quick switching placement positions for materials, the operation bar is displayed and presented according to the selection of the material, and switching placement positions includes including placing On the ground, hanging on the ceiling, hanging on the wall, sticking to the wall and laying on the ground; the user can quickly operate the material by selecting and switching the placement position to achieve custom design.
为了实现真实效果,使处于同一位置的多个素材会呈现遮挡关系。本发明的家装平面自动设计方法还包括:为放置到户型投影平面图的素材自动生成图层和调整图层,具体地,依据素材包围盒的深度信息生成图层深度,依据深度补偿值对图层深度进行调整,以调整图层位置。In order to achieve a realistic effect, multiple materials in the same position will show an occlusion relationship. The method for automatically designing a home decoration plane of the present invention further comprises: automatically generating a layer and an adjustment layer for the material placed on the floor plan of the house type projection, specifically, generating the layer depth according to the depth information of the material bounding box, and adjusting the layer depth according to the depth compensation value. Depth adjustment to adjust the layer position.
本发明中将所有3D素材都拍扁到其中心深度的一个平面上,进而将所有3D素材退化为2D素材预览图,基于此,可以利用素材包围盒形心的深度信息加上一个深度补 偿值进行图层的排序,即距离相机最远的在最下面图层,离相机越近,在越上面的图层,以实现近处素材遮挡远处素材。当移动或添加素材时,其深度实时变化,图层也随之调整,进而自动实现合理的遮挡关系。In the present invention, all 3D materials are flattened to a plane with a central depth, and then all 3D materials are degraded into 2D material preview images. Based on this, the depth information of the center of the material bounding box can be used to add a depth compensation value Sort the layers, that is, the layer farthest from the camera is on the bottom layer, and the layer closer to the camera is on the upper layer, so that the near material can block the distant material. When moving or adding material, its depth changes in real time, and the layers are adjusted accordingly to automatically achieve a reasonable occlusion relationship.
对于添加进户型投影平面图的3D素材,其深度补偿值的方向相机看向的方向,大小为bbox.y/2,即素材包围盒后平面的深度,这样桌上的摆件,沙发上的抱枕,床上的抱枕毯子等都会位于上面图层,符合观测结果。For the 3D material added to the projected floor plan of the house, the direction of the depth compensation value is the direction the camera is looking at, and the size is bbox.y/2, which is the depth of the back plane of the material's bounding box, so that the ornaments on the table, the pillows on the sofa, The pillows, blankets, etc. on the bed will be on the upper layer, which is consistent with the observation results.
对于图层的调整,和纯平面设计一样,为图层定义置顶、置底、上移一层、下移一层等操作。由图层的自动生成过程可知,图层定义是依赖于素材深度计算的。对于软装素材图层深度的有效取值范围为(-∞,1],其中房间内的视锥可见范围为[-1,1],1表示近(near)平面,-1表示远(far)平面。但由于素材可超出房间边界移动到外面去,所以深度值可小于-1。For layer adjustment, as with pure graphic design, define operations such as top, bottom, move up, move down, etc. for layers. It can be seen from the automatic generation process of the layer that the layer definition depends on the depth calculation of the material. The valid value range for the depth of the soft-covered material layer is (-∞, 1], where the visible range of the viewing cone in the room is [-1, 1], 1 means the near (near) plane, and -1 means the far (far) ) plane. However, the depth value can be less than -1 because the material can move outside the bounds of the room.
针对图层调整,设定调整的精度值,依据精度值和对需要调整素材的深度做补偿运算获得补偿后的深度值,依据补偿后的深度值调整素材位置。For layer adjustment, set the adjusted precision value, perform compensation operations on the precision value and the depth of the material to be adjusted to obtain the compensated depth value, and adjust the material position according to the compensated depth value.
实施例,可以定义调整的精度值eps为计算机可识别的最小精度值,如1e-6。那么选中素材上移一层时,将原先所有素材的深度值排序,找到在选中素材上面一层的素材的深度a,调整深度补偿值,令要调整素材的深度值为a+eps即可,下移一层同理。置顶的话是找到所有素材深度最大的一个值b,令要调整素材的深度值为b+eps即可,置底同理。In an embodiment, the adjusted precision value eps may be defined as the minimum precision value recognizable by the computer, such as 1e-6. Then, when the selected material is moved up one layer, sort the depth values of all the original materials, find the depth a of the material one layer above the selected material, adjust the depth compensation value, and set the depth value of the material to be adjusted to a+eps. The same is true for moving down a layer. If you set it to the top, find the value b with the largest depth of all the materials, and set the depth value of the material to be adjusted to b+eps. The same is true for the bottom.
实施例提供的家装平面自动设计方法还包括:对家装平面设计结果进行渲染,以获得渲染图。The method for automatically designing a home decoration plane provided by the embodiment further includes: rendering a result of the home decoration plane design to obtain a rendering diagram.
实施例提供的家装平面自动设计方法还包括:基于家装平面设计结果生成提案。The method for automatically designing a home improvement plane provided by the embodiment further includes: generating a proposal based on a home improvement plane design result.
实施例提供的家装平面自动设计方法,对背景图不限制,可以为渲染图、白板或者实景拍摄照片,应用兼容性更强,方便用户家装设计,当使用实景拍摄照片作为背景进行设计,能够达到实景设计的效果。The automatic design method for home decoration plane provided by the embodiment does not limit the background image, and can take photos for renderings, whiteboards or real scenes, and has stronger application compatibility, which is convenient for users to design home decoration. The effect of realistic design.
实施例提供的家装平面自动设计方法,通过素材定义配置属性,根据家装素材的配置属性和户型的三维结构信息,在户型投影平面图中自动放置素材,得到家装平面自动设计结果,简化了家装设计的难度,降低了设计软件的使用门槛,利用3D信息辅助设计过程,使得设计人员的工作效率大幅度提高。In the method for automatic design of home decoration plane provided by the embodiment, configuration attributes are defined through materials, and materials are automatically placed in the floor plan of the house type projection according to the configuration attributes of home decoration materials and the three-dimensional structure information of the house type, so as to obtain the result of automatic design of the home decoration plane, which simplifies the process of home decoration design. Difficulty, lower the threshold for the use of design software, and use 3D information to assist the design process, which greatly improves the work efficiency of designers.
实施例提供的家装平面自动设计方法,利用3D信息辅助设计过程,使得设计人员的工作效率大幅度提高,同时完美兼容2D和3D素材,解决了2D素材信息确实和3D素材获取成本高的问题。The home improvement plane automatic design method provided by the embodiment uses 3D information to assist the design process, so that the work efficiency of designers is greatly improved, and at the same time, it is perfectly compatible with 2D and 3D materials, and solves the problem of high cost of 2D material information and 3D material acquisition.
实施例提供的家装平面自动设计方法,对家装平面自动设计结果可对接渲染,获得更加真实的光影效果,同时还可以生成提案以提供给用户。In the method for automatic design of a home decoration plane provided by the embodiment, the results of the automatic design of a home decoration plane can be docked and rendered to obtain a more realistic light and shadow effect, and at the same time, a proposal can be generated to provide to the user.
实施例2Example 2
实施例2提供了一种家装平面自动设计装置。如图8所示,实施例提供的家装平面自动设计装置800,包括:Embodiment 2 provides a home improvement plane automatic design device. As shown in FIG. 8, the home improvement plane automatic design device 800 provided by the embodiment includes:
获取模块801,获取平面家装背景图;Obtaining module 801, obtaining a background image of flat home decoration;
生成模块802,根据平面家装背景图生成户型的三维结构信息和户型投影平面图;The generating module 802 generates the three-dimensional structure information of the house type and the floor plan projection of the house type according to the background image of the flat home decoration;
接收模块803,接收素材设计指令;A receiving module 803, receiving a material design instruction;
设计模块804,根据家装素材的配置属性和户型的三维结构信息,在户型投影平面图中依据素材设计指令自动放置素材,得到家装平面自动设计结果;所述家装素材的配置属性包括素材类型、素材默认设计位置。The design module 804, according to the configuration attributes of the home improvement materials and the three-dimensional structure information of the house type, automatically places the materials in the house type projection plan according to the material design instructions, and obtains the results of the automatic design of the home decoration plane; the configuration attributes of the home decoration materials include the material type, the material default Design location.
在其中一个实施方式中,如图9所示,家装平面自动设计装置800还包括:In one embodiment, as shown in FIG. 9 , the home improvement plane automatic design device 800 further includes:
渲染模块901,对家装平面设计结果进行渲染,以获得渲染图;The rendering module 901 renders the home improvement graphic design result to obtain a rendering;
提案生成模块902,基于家装平面设计结果生成提案。The proposal generation module 902 generates a proposal based on the home improvement graphic design result.
需要说明的是,实施例2提供的家装平面自动设计装置在进行家装平面自动设计时,应以上述各功能模块的划分进行举例说明,可以根据需要将上述功能分配由不同的功能模块完成,即在终端或服务器的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,实施例2提供的家装平面自动设计装置与家装平面自动设计方法实施例属于同一构思,其具体实现过程详见家装平面自动设计方法实施例,这里不再赘述。It should be noted that, when the automatic home improvement plane design device provided in Embodiment 2 performs the automatic design of the home improvement plane, the division of the above-mentioned functional modules should be used as an example to illustrate, and the above-mentioned functions can be allocated according to different functional modules. The internal structure of the terminal or server is divided into different functional modules to complete all or part of the functions described above. In addition, the automatic home improvement plane design device provided in the second embodiment belongs to the same concept as the embodiment of the home improvement plane automatic design method, and the specific implementation process is detailed in the home improvement plane automatic design method embodiment, which will not be repeated here.
实施例3Example 3
实施例3提供了计算机设备,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图10所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种图像展示方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。本领域技术人员可以理解,图10中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Embodiment 3 provides a computer device, and provides a computer device, the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 10 . The computer equipment includes a processor, memory, a network interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The nonvolatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program, when executed by the processor, implements an image presentation method. The display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse. Those skilled in the art can understand that the structure shown in FIG. 10 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
在其中一个实施方式中,提供了一种计算机设备,包括存储器、处理器以及存储 在机存储器中并可在处理器上执行的计算机程序,处理器执行计算机程序时实现权利实施例1所述的家装平面自动设计方法的步骤,即实现如下步骤:In one of the embodiments, a computer device is provided, including a memory, a processor, and a computer program stored in the machine memory and executable on the processor, and the processor implements the method described in claim 1 when the processor executes the computer program. The steps of the home improvement plane automatic design method are to realize the following steps:
获取平面家装背景图;Get the background image of flat home decoration;
根据平面家装背景图生成户型的三维结构信息和户型投影平面图;Generate the three-dimensional structure information of the unit and the projection plan of the unit according to the background picture of the flat home decoration;
接收素材设计指令;Receive material design instructions;
根据家装素材的配置属性和户型的三维结构信息,在户型投影平面图中依据素材设计指令自动放置素材,得到家装平面自动设计结果。According to the configuration properties of the home decoration materials and the three-dimensional structure information of the house type, the materials are automatically placed in the floor plan of the house type projection according to the material design instructions, and the result of the automatic design of the home decoration plane is obtained.
在其中一个实施方式中,处理器执行计算机程序时还实现如下步骤:对家装平面设计结果进行渲染生成渲染图并输出。In one embodiment, when the processor executes the computer program, the following steps are further implemented: rendering the graphic design result of the home decoration to generate a rendering and outputting the rendering.
由于设计过程无论是户型投影平面图还是素材全部由3D信息来辅助计算,所以非常容易转换为3D模型进行离线渲染,获得更真实的光影效果。Since the design process, whether it is the floor plan of the house type projection or the material, is all assisted by 3D information, it is very easy to convert it into a 3D model for offline rendering to obtain a more realistic light and shadow effect.
最基础的情况是,在获得户型投影平面图的三维户型模型和3D素材的三维模型后,组成场景三维模型,对三维场景模型进行渲染,得到家装设计结果的渲染图。The most basic situation is that after obtaining the 3D model of the house type projection plan and the 3D model of the 3D material, a 3D model of the scene is formed, and the 3D scene model is rendered to obtain a rendering of the home improvement design result.
当素材为2D素材时,因为不具有三维模型,所以渲染时采用以下三种方式:方式一是可以容忍一定程度的不一致,采用图搜技术用图片搜索最相似的模型来渲染;方式二是根据2D素材的轮廓构建一个平板模型,2D素材作为纹理贴在表面来渲染;方式三种是渲染时先暂时移出所有2D素材,得到3D素材的渲染场景图后,计算其深度图,将2D素材根据深度信息放置其中被遮挡部分裁剪。When the material is a 2D material, because there is no 3D model, the following three methods are used for rendering: the first method is to tolerate a certain degree of inconsistency, and the image search technology is used to search for the most similar model to render; the second method is based on The outline of the 2D material builds a flat model, and the 2D material is pasted on the surface as a texture for rendering; the three methods are to temporarily remove all the 2D material during rendering, and after obtaining the rendered scene graph of the 3D material, calculate its depth map, and use the 2D material according to The depth information is placed where the occluded part is cropped.
在其中一个实施方式中,处理器执行计算机程序时还实现如下步骤:基于家装平面设计结果生成设计提案并输出。In one of the embodiments, when the processor executes the computer program, the following steps are further implemented: generating and outputting a design proposal based on the home improvement graphic design result.
当用户完成每个空间的设计后,还需要生成一个完整的提案来构成整个设计方案。除了空间设计外,完整的提案还包括封面、封底、目录、风格解析、材质解析、色彩解析等部分,而这些内容属于纯2D设计的范畴,可以采用上文提到的纯白色背景来实现,即所有素材贴在同一面正视的墙上。也可以由用户自主上传图片作为提案的其中一页或多页,每个空间的设计都作为一页,由此构成一个完整的可分享可传播可汇报的提案。When the user completes the design of each space, it is also necessary to generate a complete proposal to constitute the entire design scheme. In addition to space design, the complete proposal also includes cover, back cover, catalog, style analysis, material analysis, color analysis, etc. These contents belong to the category of pure 2D design, which can be realized by using the pure white background mentioned above. That is, all materials are posted on the same wall facing the same side. Users can also upload pictures as one or more pages of the proposal, and each space is designed as a page, thus forming a complete proposal that can be shared, disseminated and reported.
实施例4Example 4
实施例4还提供了一种计算机可读存储介质,例如包括至少一条指令的存储器,上述至少一条指令可由终端中的处理器执行以完成实施例1中家装平面自动设计方法的步骤。 Embodiment 4 also provides a computer-readable storage medium, such as a memory including at least one instruction, the at least one instruction can be executed by a processor in a terminal to complete the steps of the method for automatically designing a home improvement plane in Embodiment 1.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流 程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage In the medium, when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other medium used in the various embodiments provided in this application may include non-volatile and/or volatile memory. Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上所述的具体实施方式对本发明的技术方案和有益效果进行了详细说明,应理解的是以上所述仅为本发明的最优选实施例,并不用于限制本发明,凡在本发明的原则范围内所做的任何修改、补充和等同替换等,均应包含在本发明的保护范围之内。The above-mentioned specific embodiments describe in detail the technical solutions and beneficial effects of the present invention. It should be understood that the above-mentioned embodiments are only the most preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, additions and equivalent substitutions made within the scope shall be included within the protection scope of the present invention.

Claims (16)

  1. 一种家装平面自动设计方法,其特征在于,包括以下步骤:An automatic design method for home improvement plane, characterized in that it comprises the following steps:
    获取平面家装背景图;Get the background image of flat home decoration;
    根据平面家装背景图生成户型的三维结构信息和户型投影平面图;Generate the three-dimensional structure information of the unit and the projection plan of the unit according to the background picture of the flat home decoration;
    接收素材设计指令;Receive material design instructions;
    根据家装素材的配置属性和户型的三维结构信息,在户型投影平面图中依据素材设计指令自动放置素材,得到家装平面自动设计结果;所述家装素材的配置属性包括素材类型、素材默认设计位置。According to the configuration attributes of the home improvement materials and the three-dimensional structure information of the house type, the materials are automatically placed in the floor plan of the house type projection according to the material design instructions, and the automatic design result of the home decoration plane is obtained; the configuration attributes of the home improvement materials include the material type and the default design position of the material.
  2. 如权利要求1所述的家装平面自动设计方法,其特征在于,所述根据平面家装背景图生成户型的三维结构信息和户型投影平面图包括:The method for automatically designing a home decoration plane according to claim 1, wherein the generating the three-dimensional structure information of the house type and the floor plan projection of the house type according to the background picture of the plane home decoration comprises:
    当平面家装背景图为渲染图时,解析渲染图后根据渲染参数获得相机参数和光场信息,并构建相机矩阵;基于渲染图和相机矩阵计算获得渲染图的三维模型,即得到户型的三维结构信息;根据户型的三维结构信息构建户型投影平面图;When the background image of the flat home decoration is a rendered image, after parsing the rendered image, the camera parameters and light field information are obtained according to the rendering parameters, and the camera matrix is constructed; the 3D model of the rendered image is obtained by calculating the rendering image and the camera matrix, that is, the 3D structure information of the house type is obtained. ;Construct the floor plan of the house type according to the three-dimensional structure information of the house type;
    当平面家装背景图为实拍照片时,预设相机参数,即以相机位置作为世界坐标系原点,且世界坐标系和相机坐标系重合,对实拍照片做边缘检测,结合墙顶地互相垂直的假设,恢复户型三维结构信息,然后依据户型的三维结构信息构建户型投影平面图;When the background picture of the flat home decoration is a real photo, the camera parameters are preset, that is, the camera position is used as the origin of the world coordinate system, and the world coordinate system and the camera coordinate system are coincident, and the edge detection is performed on the real photo, and the top of the wall is perpendicular to each other. , restore the 3D structure information of the house type, and then construct the floor plan projection plan of the house type according to the 3D structure information of the house type;
    当平面家装背景图为白板时,预定义一系列的渲染图作为白板的三维结构信息的输入,依据户型的三维结构信息构建户型投影平面图。When the background image of the flat home decoration is a whiteboard, a series of pre-defined rendering images are used as the input of the three-dimensional structure information of the whiteboard, and the projected floor plan of the house type is constructed according to the three-dimensional structure information of the house type.
  3. 如权利要求2所述的家装平面自动设计方法,其特征在于,所述根据户型的三维结构信息构建户型投影平面图包括:The method for automatically designing a home improvement plane according to claim 2, wherein the constructing the floor plan projection of the house type according to the three-dimensional structure information of the house type comprises:
    基于户型的三维结构信息得到表示墙体连接处的所有角点信息和所有墙体信息;Based on the 3D structure information of the house type, all the corner point information and all the wall information representing the wall connection are obtained;
    根据角点信息和墙体信息构建户型平面图后,根据相机参数对户型平面图做投影,得到户型投影平面图。After building the floor plan according to the corner point information and the wall information, project the floor plan according to the camera parameters to obtain the floor plan of the floor plan.
  4. 如权利要求3所述的家装平面自动设计方法,其特征在于,所述根据角点信息和墙体信息构建户型平面图后,根据相机参数对户型平面图做投影,得到户型投影平面图包括:The automatic design method for home improvement plane according to claim 3, characterized in that, after constructing the floor plan according to the corner point information and the wall body information, projecting the floor plan according to the camera parameters, and obtaining the floor plan projection of the floor plan comprises:
    首先,根据角点坐标和墙体信息连接对应角点生成墙体线条,得到户型平面图;然后,根据相机位置和相机看向的方向的近平面裁剪距离,获得相机看向的方向点位的平面坐标后,根据相机看向的方向点位的平面坐标判断并确定相机看向的方向点位位于平面户型图的房间区域,并剔除房间区域内不相关的角点和墙体,剩下的角点和墙作为成像房间区域信息;最后,筛选确定组成房间区域的有效角点,基于有效角点、 墙体厚度、墙体高度以及相机参数生成墙面投影平面、地面投影平面以及顶面投影平面,形成房间区域的户型投影平面图。First, connect the corresponding corner points to generate wall lines according to the corner coordinates and wall information, and obtain the floor plan of the house; then, according to the camera position and the near-plane clipping distance of the direction the camera is looking at, the plane of the point in the direction that the camera is looking at is obtained. After the coordinates, according to the plane coordinates of the point in the direction the camera is looking at, determine and determine that the point in the direction the camera is looking is located in the room area of the floor plan, and remove the irrelevant corners and walls in the room area, and the remaining corners Points and walls are used as the information of the imaging room area; finally, the effective corner points that constitute the room area are screened and determined, and the wall projection plane, ground projection plane and top projection plane are generated based on the effective corner points, wall thickness, wall height and camera parameters , which forms the projected floor plan of the room area.
  5. 如权利要求1所述的家装平面自动设计方法,其特征在于,在获得房间区域的有效角点后,依据有效角点连接形成户型骨架,依据墙体厚度,沿户型骨架向内和向外生成与户型骨架平行的线条作为墙内线和墙外线,确定墙内线的交点并以该交点作为目标角点,同时获得二维坐标(x,y),依据相机高度和楼层高度确定目标角点的z坐标,得到目标角点的三维坐标(x,y,z),依据目标角点的三维坐标确定空间连线,采用由相机参数确定的相机视椎对空间连线进行截断来生成新控制点,以处于相机视椎内的目标角点为原控制点,依据新控制点和原控制点生成墙面投影平面、地面投影平面以及顶面投影平面,形成房间区域的户型投影平面图。The automatic design method for home improvement plane according to claim 1, characterized in that, after obtaining the effective corner points of the room area, a house-shaped skeleton is formed according to the connection of the effective corner points, and according to the thickness of the wall, the house-shaped skeleton is generated inward and outward along the house-shaped skeleton. The lines parallel to the skeleton of the house are used as the inner and outer lines of the wall, determine the intersection of the inner lines of the wall and use the intersection as the target corner, obtain the two-dimensional coordinates (x, y) at the same time, and determine the z of the target corner according to the camera height and floor height. Coordinates, get the three-dimensional coordinates (x, y, z) of the target corner, determine the space connection according to the three-dimensional coordinates of the target corner, and use the camera view cone determined by the camera parameters to truncate the space connection to generate a new control point. Taking the target corner in the camera's viewing cone as the original control point, the wall projection plane, the ground projection plane and the top projection plane are generated according to the new control point and the original control point, and the floor plan of the room area is formed.
  6. 如权利要求1所述的家装平面自动设计方法,其特征在于,所述素材默认设计位置包括素材的默认吸附面和默认吸附位置;The automatic design method for home improvement plane according to claim 1, wherein the default design position of the material includes a default adsorption surface and a default adsorption position of the material;
    根据素材类型为不同类型素材定义对应的默认吸附面和默认吸附位置,其中,对于放置在地面和铺置在地面的地面素材,定义其默认吸附面为户型投影平面图中的地面;对于吊置在顶面的顶面素材,定义其默认吸附面为户型投影平面图中的顶面;对于挂置在墙面和贴置在墙面的墙面素材,定义其默认吸附面为户型投影平面图中的墙面;Define the corresponding default adsorption surface and default adsorption position for different types of materials according to the material type. For the ground materials placed on the ground and laid on the ground, the default adsorption surface is defined as the ground in the floor plan of the floor plan; For the top surface material of the top surface, define its default adsorption surface as the top surface in the floor plan of the floor plan; for the wall material hung on the wall and attached to the wall, define its default adsorption surface as the wall in the floor plan of the floor plan. noodle;
    对于没有定义类型的图片,采用图像识别的算法寻找和图片的语义内容最匹配的素材类型,根据最匹配的素材类型定义图片的默认吸附面和默认吸附位置。For pictures without a defined type, the image recognition algorithm is used to find the material type that best matches the semantic content of the picture, and the default adsorption surface and default adsorption position of the picture are defined according to the most matching material type.
  7. 如权利要求6所述的家装平面自动设计方法,其特征在于,设定平面的角点为控制点,依据控制点来描述吸附面,素材被选择拖动过程中,素材对应的默认吸附面的控制点连接成闭环线,闭环线或/和闭环线形成的虚拟面以高亮显示,当素材放置到吸附面时,高亮显示消失。The automatic design method for a home decoration plane according to claim 6, wherein the corner points of the plane are set as control points, and the adsorption surface is described according to the control points. During the process of selecting and dragging the material, the default adsorption surface corresponding to the material The control points are connected to form a closed-loop line, and the virtual surface formed by the closed-loop line or/and the closed-loop line is highlighted. When the material is placed on the adsorption surface, the highlight disappears.
  8. 如权利要求6所述的家装平面自动设计方法,其特征在于,针对放置在地面的地面素材,确定地面素材在地面中的默认吸附位置的方法包括:The automatic design method for a home improvement plane according to claim 6, wherein, for the ground material placed on the ground, the method for determining the default adsorption position of the ground material on the ground comprises:
    (a1)当素材预览图的下边线与地面有交集时,放置后保证素材预览图的下边线和素材包围盒的与x方向平行的前下边线重叠且两者的中心点重合;(a1) When the lower edge of the material preview image intersects with the ground, ensure that the lower edge of the material preview image and the front lower edge of the material bounding box parallel to the x-direction overlap and the center points of the two overlap after placement;
    (b1)当素材预览图的上边线、下边线均只与墙面有交集时,将素材预览图的下边线沿着世界坐标系的z轴投射到地面得到下边投射线,根据下边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的下边投射线与素材包围盒的与x方向平行的前下边线重叠且两者的中心点重合;方式二,放置后保证素材预览图的下边投射线与素材包围盒的与x方向平行的前下边线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在地面内;(b1) When both the top and bottom lines of the material preview image only intersect with the wall, project the bottom line of the material preview image to the ground along the z-axis of the world coordinate system to obtain the bottom projected line, which is determined according to the bottom projected line There are 2 default adsorption positions: Method 1, after placing, ensure that the lower projection line of the material preview image overlaps with the front and lower side lines of the material bounding box parallel to the x-direction, and the center points of the two coincide; method 2, ensure that the material preview image is placed after placement The lower projection line of the material bounding box overlaps with the front and lower edge of the material bounding box parallel to the x direction, and a certain offset calculation is performed. When calculating the offset, ensure that the material bounding box is completely within the ground;
    (c1)当素材预览图的上边线与顶面有交集时,将素材预览图的上边线沿着世界坐标系的z轴投射到地面得到上边投射线,根据上边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的上边投射线与素材包围盒的与x方向平行的前下边线重叠且两者的中心点重合;方式二,放置后保证素材预览图的上边投射线与素材包围盒的与x方向平行的前下边线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在地面内;(c1) When the upper edge of the material preview image intersects with the top surface, project the upper edge of the material preview image to the ground along the z-axis of the world coordinate system to obtain the upper projection line, and determine two default adsorption positions according to the upper projection line : Method 1, after placing, ensure that the upper projection line of the material preview image overlaps with the front and lower side lines of the material bounding box parallel to the x-direction, and the center points of the two coincide; Method 2, after placing, ensure that the upper projection line of the material preview image and The front and bottom edges of the material bounding box parallel to the x-direction overlap and a certain offset calculation is performed. When calculating the offset, ensure that the material bounding box is completely within the ground;
    针对铺贴在地面的地面素材,确定地面素材在地面中的默认吸附位置的方法包括:For the ground material laid on the ground, the method for determining the default adsorption position of the ground material on the ground includes:
    (a2)当素材预览图的下边线与控制点形成的地面有交集时,素材自动与地面形成一致的透视关系,放置后保证素材预览图的下边线和素材包围盒的底面x方向的中心线重叠且两者的中心点重合,以此来确定默认吸附位置;(a2) When the bottom line of the material preview image intersects with the ground formed by the control points, the material will automatically form a consistent perspective relationship with the ground. After placement, ensure that the bottom line of the material preview image and the center line of the bottom surface of the material bounding box in the x direction Overlap and the center points of the two coincide to determine the default adsorption position;
    (b2)当素材预览图的上边线、下边线均只与控制点形成的墙面有交集时,将素材预览图的下边线沿着世界坐标系的z轴投射到地面得到下边投射线,根据下边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的下边投射线与素材包围盒的底面x方向的中心线重叠且两者的中心点重合;方式二,放置后保证素材预览图的下边投射线与素材包围盒的底面x方向的中心线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在地面内;(b2) When the upper and lower lines of the material preview image only intersect with the wall formed by the control points, project the lower line of the material preview image to the ground along the z-axis of the world coordinate system to obtain the lower projection line, according to The lower projection line determines two default adsorption positions: Method 1, after placing, ensure that the lower projection line of the material preview image overlaps with the center line in the x-direction of the bottom surface of the material bounding box and the center points of the two coincide; Method 2, ensure that the material is placed after placement The lower projection line of the preview image overlaps with the center line of the bottom surface of the material bounding box in the x direction, and a certain offset calculation is performed. When calculating the offset, ensure that the material bounding box is completely within the ground;
    (c2)当素材预览图的上边线与控制点形成的顶面有交集时,将素材预览图的上边线沿着世界坐标系的z轴投射到地面得到上边投射线,根据上边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的上边投射线与素材包围盒的底面x方向的中心线重叠且两者的中心点重合;方式二,放置后保证素材预览图的上边投射线与素材包围盒的的底面x方向的中心线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在地面内;(c2) When the upper edge of the material preview image intersects with the top surface formed by the control points, project the upper edge of the material preview image to the ground along the z-axis of the world coordinate system to obtain the upper projection line, and determine 2 according to the upper projection line. Default adsorption positions: Method 1: After placing, ensure that the upper projection line of the material preview image overlaps with the center line of the bottom surface of the material bounding box in the x direction, and the center points of the two coincide; Method 2, after placing, ensure that the upper side projection of the material preview image The line overlaps with the center line of the bottom surface of the material bounding box in the x direction, and a certain offset calculation is performed. When calculating the offset, ensure that the material bounding box is completely within the ground;
    针对顶面素材,确定顶面素材在顶面中的默认吸附位置的方法包括:For the top surface material, the methods for determining the default snap position of the top surface material in the top surface include:
    (a2)当素材预览图的上边线与顶面有交集时,放置后保证素材预览图的上边线和素材包围盒的与x方向平行的前上边线重叠且两者的中心点重合;(a2) When the upper edge of the material preview image intersects with the top surface, ensure that the upper edge of the material preview image and the front upper edge of the material bounding box parallel to the x-direction overlap and the center points of the two overlap after placement;
    (b2)当素材预览图的下边线、上边线均只与墙面有交集时,将素材预览图的上边线沿着世界坐标系的z轴投射到顶面得到上边投射线,根据上边投射线确定2种默认吸附位置:方式一,放置后保证素材预览图的上边投射线与素材包围盒的与x方向平行的前上边线重叠且两者的中心点重合;方式二,放置后保证素材预览图的上边投射线与素材包围盒的与x方向平行的前上边线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在顶面内;(b2) When the lower and upper lines of the material preview image only intersect with the wall, project the upper line of the material preview image along the z-axis of the world coordinate system to the top surface to obtain the upper projection line, which is determined according to the upper projection line There are 2 default adsorption positions: Method 1, after placing, ensure that the upper projection line of the material preview image overlaps with the front upper side line of the material bounding box parallel to the x direction and the center points of the two coincide; method 2, ensure that the material preview image is placed after placement The upper projection line of the material bounding box overlaps with the front upper line parallel to the x direction of the material bounding box and performs a certain offset calculation. When calculating the offset, ensure that the material bounding box is completely within the top surface;
    (c2)当素材预览图的下边线与地面有交集时,将素材预览图的下边线沿着世界坐标系的z轴投射到顶面得到下边投射线,根据下边投射线确定2种默认吸附位置: 方式一,放置后保证素材预览图的下边投射线与素材包围盒的与x方向平行的前上边线重叠且两者的中心点重合;方式二,放置后保证素材预览图的下边投射线与素材包围盒的与x方向平行的前上边线重叠且进行一定的偏移量计算,偏移量计算时要保证素材包围盒完全在顶面内;(c2) When the bottom line of the material preview image intersects with the ground, project the bottom line of the material preview image to the top surface along the z-axis of the world coordinate system to obtain the bottom projection line, and determine two default adsorption positions according to the bottom projection line: Method 1: After placing, ensure that the lower projection line of the material preview image overlaps with the front and upper side lines of the material bounding box parallel to the x-direction, and the center points of the two coincide; Method 2, after placing, ensure that the lower projection line of the material preview image and the material The front and upper edges of the bounding box parallel to the x-direction overlap and a certain offset calculation is performed. When calculating the offset, ensure that the material bounding box is completely within the top surface;
    针对墙面素材,确定顶面素材在墙面中的默认吸附位置的方法包括:For the wall material, the methods for determining the default adsorption position of the top material on the wall include:
    (a3)当素材预览图的上边线和下边线只与墙面有交集时,素材放置在与素材预览图中心相交的墙面上,素材自动与墙面形成一致的透视关系,根据透视关系判断并确定素材包围盒的贴合平面,放置后素材预览图的中心点和贴合平面的中心点重合,贴合平面为包围盒的左侧面、后平面或右侧面;(a3) When the upper and lower lines of the material preview image only intersect with the wall, the material is placed on the wall that intersects with the center of the material preview image, and the material automatically forms a consistent perspective relationship with the wall. Judging based on the perspective relationship And determine the fitting plane of the material bounding box, the center point of the material preview image after placement coincides with the center point of the fitting plane, and the fitting plane is the left side, back plane or right side of the bounding box;
    (b3)当素材预览图的下边线和地面有交集时,将素材预览图的下边线的中心沿着世界坐标系的z轴投射到墙面和地面的交界线上,得到投影点,素材预览图放置在投影点所在的墙面上,素材自动与墙面形成一致的透视关系,根据该透视关系判断并确定素材包围盒的贴合平面,素材放置后,素材包围盒的贴合平面的下边线的中心点和投影点重合;(b3) When the bottom line of the material preview image intersects with the ground, project the center of the bottom line of the material preview image along the z-axis of the world coordinate system to the boundary line between the wall and the ground to obtain the projection point, the material preview The image is placed on the wall where the projection point is located, and the material automatically forms a consistent perspective relationship with the wall. According to the perspective relationship, the fitting plane of the material bounding box is judged and determined. After the material is placed, the material bounding box fits below the plane. The center point of the edge and the projection point coincide;
    (c3)当素材预览图的上边线和顶面有交集时,将素材预览图的上边线的中心沿着世界坐标系的z轴投射到墙面和顶面的交界线上,得到投影点,素材预览图放置在投影点点所在的墙面上,素材自动与墙面形成一致的透视关系,根据该透视关系判断并确定素材包围盒的贴合平面,素材放置后,素材包围盒的贴合平面的上边线的中心点和投影点重合。(c3) When the upper edge of the material preview image and the top surface intersect, the center of the upper edge of the material preview image is projected along the z-axis of the world coordinate system to the boundary line between the wall and the top surface to obtain the projection point, The material preview image is placed on the wall where the projection point is located, and the material automatically forms a consistent perspective relationship with the wall. According to the perspective relationship, the fitting plane of the material bounding box is judged and determined. After the material is placed, the fitting plane of the material bounding box The center point of the upper edge of the line coincides with the projection point.
  9. 如权利要求1项所述的家装平面自动设计方法,其特征在于,对3D素材自动调节尺寸以实现近大远小效果,包括:基于素材的包围盒和相机参数,在给定素材预览图在户型投影平面中位姿之后,通过计算得到素材包围盒的8个顶点在户型投影平面中的2D坐标,实现对3D素材的调整。The automatic design method for home improvement plane according to claim 1, wherein the automatic adjustment of the size of the 3D material to achieve the effect of near big and far small, including: based on the material's bounding box and camera parameters, in a given material preview image in After the pose in the house type projection plane, the 2D coordinates of the 8 vertices of the material bounding box in the house type projection plane are obtained by calculation, so as to realize the adjustment of the 3D material.
  10. 如权利要求9项所述的家装平面自动设计方法,其特征在于,对3D素材自动调节尺寸过程为:The automatic design method for home improvement plane according to claim 9, wherein the process of automatically adjusting the size of the 3D material is:
    计算包围盒的形心所在的平行于户型投影平面图的平面,将素材预览图贴在包围盒的形心处,则素材预览图的显示高度h=bbox.z+a*bbox.y,其中,系数a根据素材所在吸附面的法线在平行于户型投影平面图方向上的投影确定,bbox.z是包围盒投影到于户型投影平面图后,后平面高度的像素尺寸,bbox.y是将包围盒的上平面或下平面展开到与后平面平行时的像素尺寸,a*bbox.y表示包围盒的上平面或下平面在户型投影平面图中像素尺寸;Calculate the plane parallel to the floor plan where the centroid of the bounding box is located, and paste the material preview image at the centroid of the bounding box, then the display height of the material preview image is h=bbox.z+a*bbox.y, where, The coefficient a is determined according to the projection of the normal of the adsorption surface where the material is located in the direction parallel to the floor plan of the floor plan. bbox.z is the pixel size of the height of the back plane after the bounding box is projected on the floor plan of the floor plan. The pixel size when the upper or lower plane of the bounding box is expanded to be parallel to the rear plane, a*bbox.y represents the pixel size of the upper or lower plane of the bounding box in the floor plan of the house type projection;
    素材预览图的显示宽度根据素材预览图的高宽比等比例计算得到;The display width of the material preview image is calculated according to the aspect ratio of the material preview image;
    在确定素材预览图的显示高度和宽度之后,再根据相机参数确定包围盒的8个顶 点在户型投影平面中的2D坐标,进而实现对3D素材的调整。After determining the display height and width of the material preview image, the 2D coordinates of the 8 vertices of the bounding box in the floor plan projection plane are determined according to the camera parameters, thereby realizing the adjustment of the 3D material.
  11. 如权利要求1项所述的家装平面自动设计方法,其特征在于,还包括:设定有用于为素材提供快捷切换放置位置的操作栏,操作栏依据素材被选中而显示呈现,切换放置位置包括包含放在地上、吊在顶上、挂在墙上、贴在墙面和铺在地面;用户通过选中切换放置位置实现对素材的快捷操作,以实现自定义设计。The automatic design method for home improvement plane according to claim 1, further comprising: setting an operation bar for providing quick switching placement positions for materials, the operation bar is displayed and presented according to the selection of the materials, and the switching placement includes: Including placing on the ground, hanging on the ceiling, hanging on the wall, sticking to the wall and laying on the ground; the user can quickly operate the material by selecting and switching the placement position to achieve custom design.
  12. 如权利要求1项所述的家装平面自动设计方法,其特征在于,还包括:为放置到户型投影平面图的素材自动生成图层和调整图层,具体依据素材包围盒的深度信息生成图层深度,依据深度补偿值对图层深度进行调整,以调整图层位置。The automatic design method for home improvement plane according to claim 1, further comprising: automatically generating a layer and an adjustment layer for the material placed on the floor plan of the house type projection, specifically generating a layer depth according to the depth information of the material bounding box , adjust the layer depth according to the depth compensation value to adjust the layer position.
  13. 如权利要求1~12任一项所述的家装平面自动设计方法,其特征在于,还包括:对家装平面设计结果进行渲染生成渲染图并输出;The automatic design method for a home improvement plane according to any one of claims 1 to 12, further comprising: rendering the home improvement plane design result to generate a rendering and outputting;
    基于家装平面设计结果生成设计提案并输出。Generate and output design proposals based on home improvement graphic design results.
  14. 一种家装平面自动设计装置,其特征在于,包括:A home improvement plane automatic design device is characterized in that, comprising:
    获取模块,获取平面家装背景图;Get the module to get the background image of flat home decoration;
    生成模块,根据平面家装背景图生成户型的三维结构信息和户型投影平面图;The generation module generates the three-dimensional structure information of the house type and the floor plan projection of the house type according to the background picture of the flat home decoration;
    接收模块,接收素材设计指令;Receiving module, receiving material design instructions;
    设计模块,根据家装素材的配置属性和户型的三维结构信息,在户型投影平面图中依据素材设计指令自动放置素材,得到家装平面自动设计结果;所述家装素材的配置属性包括素材类型、素材默认设计位置。The design module, according to the configuration attributes of the home decoration materials and the three-dimensional structure information of the house type, automatically places the materials in the floor plan of the house type projection according to the material design instructions, and obtains the automatic design result of the home decoration plane; the configuration attributes of the home decoration materials include the material type and the material default design. Location.
  15. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上执行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1~13任一项所述的家装平面自动设计方法的步骤。A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, claims 1 to 13 are implemented Any one of the steps of the automatic design method for home improvement plane.
  16. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理执行时实现权利要求1~13任一项所述的家装平面自动设计方法的步骤。A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is processed and executed, it realizes the steps of the automatic home improvement plane design method according to any one of claims 1 to 13.
PCT/CN2021/084730 2020-12-31 2021-03-31 Home decoration plan automatic design method and apparatus, computer device, and storage medium WO2022141887A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011624809.3 2020-12-31
CN202011624809.3A CN112668085A (en) 2020-12-31 2020-12-31 Home decoration plane automatic design method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022141887A1 true WO2022141887A1 (en) 2022-07-07

Family

ID=75412293

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/084730 WO2022141887A1 (en) 2020-12-31 2021-03-31 Home decoration plan automatic design method and apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN112668085A (en)
WO (1) WO2022141887A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115439576A (en) * 2022-08-19 2022-12-06 北京城市网邻信息技术有限公司 Method, device, equipment and medium for generating house type graph of terminal equipment
CN115758546A (en) * 2022-12-05 2023-03-07 上海定卓网络科技有限公司 House type custom design method, custom platform and readable storage medium
CN116152444A (en) * 2023-04-04 2023-05-23 山东捷瑞信息技术产业研究院有限公司 Automatic adsorption method, device and medium for three-dimensional scene model based on digital twin
CN116594531A (en) * 2023-05-19 2023-08-15 如你所视(北京)科技有限公司 Object display method, device, electronic equipment and storage medium
CN117274424A (en) * 2023-08-23 2023-12-22 瑞庭网络技术(上海)有限公司 House source information processing method and device, electronic equipment and storage medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434927B (en) * 2021-05-21 2023-06-13 杭州群核信息技术有限公司 House type expansion member-based home decoration design method and system
CN113553651B (en) * 2021-07-28 2024-02-20 杭州群核信息技术有限公司 Split fan generating method, device and storage medium
CN113664947A (en) * 2021-08-23 2021-11-19 安徽嘉禾整木家居有限公司 System and method for customizing hue collocation for home construction equipment
CN114529566B (en) * 2021-12-30 2022-11-22 北京城市网邻信息技术有限公司 Image processing method, device, equipment and storage medium
CN116680793B (en) * 2023-08-03 2023-10-20 贝壳找房(北京)科技有限公司 Wall data processing method, component creation method, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130073420A1 (en) * 2011-09-20 2013-03-21 Doodle Enterprises LLC System and Method for Interior Design
CN106327247A (en) * 2016-08-18 2017-01-11 卢志旭 Self-service home decoration designing and demonstrating system
CN109583038A (en) * 2018-11-07 2019-04-05 北京自由灵动科技有限公司 A kind of indoor design method and device
CN111127655A (en) * 2019-12-18 2020-05-08 北京城市网邻信息技术有限公司 House layout drawing construction method and device, and storage medium
CN111859511A (en) * 2020-07-28 2020-10-30 苏州金螳螂三维软件有限公司 Method and device for generating vertical face construction drawing by building model

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111985022B (en) * 2020-06-23 2022-07-19 北京城市网邻信息技术有限公司 Processing method and device for on-line decoration, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130073420A1 (en) * 2011-09-20 2013-03-21 Doodle Enterprises LLC System and Method for Interior Design
CN106327247A (en) * 2016-08-18 2017-01-11 卢志旭 Self-service home decoration designing and demonstrating system
CN109583038A (en) * 2018-11-07 2019-04-05 北京自由灵动科技有限公司 A kind of indoor design method and device
CN111127655A (en) * 2019-12-18 2020-05-08 北京城市网邻信息技术有限公司 House layout drawing construction method and device, and storage medium
CN111859511A (en) * 2020-07-28 2020-10-30 苏州金螳螂三维软件有限公司 Method and device for generating vertical face construction drawing by building model

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115439576A (en) * 2022-08-19 2022-12-06 北京城市网邻信息技术有限公司 Method, device, equipment and medium for generating house type graph of terminal equipment
CN115758546A (en) * 2022-12-05 2023-03-07 上海定卓网络科技有限公司 House type custom design method, custom platform and readable storage medium
CN115758546B (en) * 2022-12-05 2023-06-09 上海定卓网络科技有限公司 Household custom design method, custom platform and readable storage medium
CN116152444A (en) * 2023-04-04 2023-05-23 山东捷瑞信息技术产业研究院有限公司 Automatic adsorption method, device and medium for three-dimensional scene model based on digital twin
CN116594531A (en) * 2023-05-19 2023-08-15 如你所视(北京)科技有限公司 Object display method, device, electronic equipment and storage medium
CN117274424A (en) * 2023-08-23 2023-12-22 瑞庭网络技术(上海)有限公司 House source information processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112668085A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
WO2022141887A1 (en) Home decoration plan automatic design method and apparatus, computer device, and storage medium
WO2022141888A1 (en) Home decoration material moving method and apparatus, and computer device and storage medium
US7346408B2 (en) Two-dimensional graphics for incorporating on three-dimensional objects
EP2889844B1 (en) Diminished reality
US20140125654A1 (en) Modeling and Editing Image Panoramas
US9613424B2 (en) Method of constructing 3D clothing model based on a single image
CN113761614B (en) Plane home decoration design auxiliary method
JP2005502111A (en) Simultaneous use of 2D and 3D modeling data
US20080018665A1 (en) System and method for visualizing drawing style layer combinations
CN109934933B (en) Simulation method based on virtual reality and image simulation system based on virtual reality
US11681751B2 (en) Object feature visualization apparatus and methods
CN106527719A (en) House for sale investigation system based on AR (Augmented Reality) technology and real-time three-dimensional modeling
US9165409B2 (en) System and method for creating a database for generating product visualizations
WO2022141886A1 (en) Home decoration material adjustment method and apparatus, and computer device and storage medium
Criminisi et al. Bringing pictorial space to life: computer techniques for the analysis of paintings
CN116681854A (en) Virtual city generation method and device based on target detection and building reconstruction
WO2017061954A1 (en) Method and system for an online space planning tool
JP3720587B2 (en) Image synthesizer
TW201412094A (en) Device for generating a depth map
WO2020173222A1 (en) Object virtualization processing method and device, electronic device and storage medium
JP2003157290A (en) Processing method and processing system for image simulation, image simulation processing program, and recording medium
CN109808406A (en) The online method for mounting of painting and calligraphy pieces, system and storage medium
Mohan et al. Refined interiors using augmented reality
Li Design and realization of scenes of 3D virtual digital library
Saura-Herreros et al. Spherical panorama compositing through depth estimation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21912657

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21912657

Country of ref document: EP

Kind code of ref document: A1