Method and device for local update design

The Edge Connect model processes partially obscured and uncensored images to generate locally updated images, which solves the problem of designers wasting time and energy in local micro-updates and improves design efficiency.

CN115146349BActive Publication Date: 2024-09-20BEIJING FORESTRY UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210788695.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-06
Publication Date
2024-09-20
Estimated Expiration
2042-07-06

AI Technical Summary

Technical Problem

In urban and landscape architecture design, due to the small area and large number of local micro-updates, designers waste a lot of time and energy in the sketching and rendering process.

Method used

The Edge Connect model is used to collect partially covered and uncensored images, an atlas is established, and the Edge Connect model is used for training, a local update model is generated, and the design images to be partially updated are input and processed using the Canny algorithm. and the generator-discriminator generate predicted contours and updated images, reducing manual operations.

Benefits of technology

It simplifies the design process, reduces the waste of time and energy caused by manual partial updates, improves update efficiency, and generates high-quality partial update images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115146349B
    Figure CN115146349B
Patent Text Reader

Abstract

The present invention discloses a method for partial update design, comprising: collecting a partially blocked image and a partially unblocked image, establishing a partially blocked atlas and a partially unblocked atlas; using the partially blocked image in the partially blocked atlas as input and the partially unblocked image in the partially unblocked atlas as output, training using an EdgeConnect model to obtain a partial update model; inputting a design image to be partially updated into the partial update model to obtain a partial update image. The present invention also provides a method for partial update design. The present invention can reduce the waste of time and energy caused by manual partial update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence related technologies, and more specifically, to a method and device for local update design. Background Art

[0002] At present, the steps for local micro-updates in urban, park and green space design are: first use CAD and other professional drawing software to draw sketches, and then use PS or rendering software to get the update effect. As urban construction and landscape architecture industry enter a mature stage, affected by early planning, more and more places are facing the problem of local micro-updates. These local updated plots are small in area and large in number. After site surveys and sketches, designers will then design, render and other steps to get the update results, which will obviously cause a lot of time and energy waste.

[0003] Therefore, it is urgent to design a technical solution that can overcome the above-mentioned defects to a certain extent. Summary of the invention

[0004] An object of the present invention is to provide a method and device for local update design, which can reduce the waste of time and energy caused by manual local update.

[0005] In order to achieve these objectives and other advantages of the present invention, according to one aspect of the present invention, a method for partially updating a design is provided, comprising: collecting partially obscured images and partially unobstructed images, and establishing a partially obscured atlas and a partially unobstructed atlas; using the partially obscured images in the partially obscured atlas as input and the partially unobstructed images in the partially unobstructed atlas as output, training using an Edge Connect model to obtain a locally updated model; and inputting a design image to be locally updated into the locally updated model to obtain a locally updated image.

[0006] Furthermore, it also includes: normalizing the size of the collected partially blocked image and the partially unblocked image, and then inputting them into the Edge Connect model.

[0007] Furthermore, it also includes: graying the partially obscured image or the design image to be partially updated to obtain a grayscale image, extracting the obscured area of ​​the partially obscured image or the design image to be partially updated as an occluded image, performing edge detection on the partially obscured image or the design image to be partially updated using a Canny algorithm to obtain a contour image, and inputting the grayscale image, the occluded image and the contour image into the EdgeConnect model.

[0008] Furthermore, the Edge Connect model includes a first generator, a second generator, a first discriminator, and a second discriminator, wherein the first generator is used to generate a predicted contour image according to the grayscale image, the occlusion image, and the contour image, and the first discriminator is used to calculate a loss function of the first generator to determine whether the predicted contour image is true;

[0009] The second generator is used to generate a predicted update image based on the predicted contour image, the partially occluded image or the design image to be partially updated, and the second discriminator is used to calculate the loss function of the second generator to determine whether the predicted update image is true.

[0010] Furthermore, the method further includes: identifying key points of the partially unobstructed image, determining key areas of the partially unobstructed image according to the key points, and performing occlusion to generate the partially obstructed image.

[0011] Furthermore, the key area of ​​the partially unobstructed image is determined according to the key points, and occlusion is performed. The method for generating the partially obstructed image includes: S1: dividing the partially unobstructed image into multiple rectangular areas; S2: identifying the lines and intersections in each of the rectangular areas, and selecting the intersections with the most connected lines as the key points; S3: taking the key point in the rectangular area in the upper left corner as the starting point and the key point in the rectangular area in the lower right corner as the end point, the key area extends from the starting point to the end point, and the width of the key area is a predetermined multiple of the size of the rectangular area; S4: changing the number of the rectangular areas in S1, repeating S2 to S3, and obtaining the key area; S5: performing occlusion on the key area obtained in S3 to S4 to obtain the partially obstructed image.

[0012] Furthermore, the key area does not cross in the process of extending from the starting point to the end point.

[0013] According to another aspect of the present invention, there is also provided an apparatus for partially updating a design, comprising: an acquisition module, for acquiring partially obscured images and partially unobstructed images, and establishing a partially obscured atlas and a partially unobstructed atlas; a local update model, obtained by training with an Edge Connect model using the partially obscured images in the partially obscured atlas as input and the partially unobstructed images in the partially unobstructed atlas as output; and an update module, for inputting the design image to be partially updated into the local update model, and obtaining a locally updated image.

[0014] Furthermore, the Edge Connect model includes a first generator, a second generator, a first discriminator and a second discriminator; the partially occluded image or the design image to be locally updated is grayed to obtain a grayscale image, the occluded area of ​​the partially occluded image or the design image to be locally updated is extracted as an occluded image, and the Canny algorithm is used to perform edge detection on the partially occluded image or the design image to be locally updated to obtain a contour image; the first generator is used to generate a predicted contour image based on the grayscale image, the occluded image and the contour image, and the first discriminator is used to calculate the loss function of the first generator to determine whether the predicted contour image is true; the second generator is used to generate a predicted update image based on the predicted contour image, the partially occluded image or the design image to be locally updated, and the second discriminator is used to calculate the loss function of the second generator to determine whether the predicted update image is true.

[0015] Furthermore, it also includes: the acquisition module is also used to identify the key points of the partially unobstructed image, determine the key area of ​​the partially unobstructed image according to the key points, and perform occlusion to generate the partially obstructed image. The specific method includes: S1: divide the partially unobstructed image into multiple rectangular areas; S2: identify the lines and intersections in each of the rectangular areas, and select the intersections with the most connected lines as the key points; S3: take the key point in the rectangular area in the upper left corner as the starting point, and take the key point in the rectangular area in the lower right corner as the end point, the key area extends from the starting point to the end point, the width of the key area is a predetermined multiple of the size of the rectangular area, and the key area does not cross in the process of extending from the starting point to the end point; S4: change the number of the rectangular areas in S1, repeat S2~S3, and obtain the key area; S5: perform occlusion on the key area obtained in S3~S4 to obtain the partially obstructed image.

[0016] The present invention has at least the following beneficial effects:

[0017] The present invention uses the Edge Connect model in artificial intelligence to model the correlation between partially blocked images and partially unblocked images. The user inputs the design image to be partially updated, and the computer can generate and return a high-quality partially updated image. The operation process is simple, which can reduce the waste of time and energy caused by manual partial updates and improve update efficiency.

[0018] Other advantages, objectives and features of the present invention will be embodied in part through the following description, and in part will be understood by those skilled in the art through study and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of the present invention;

[0020] Figure 2 It is a schematic diagram of the rectangular area of ​​the present invention. DETAILED DESCRIPTION

[0021] The present invention is further described in detail below in conjunction with the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.

[0022] It should be understood that the terms such as “having”, “including” and “comprising” used herein do not exclude the existence or addition of one or more other elements or combinations thereof.

[0023] like Figure 1 As shown, an embodiment of the present application provides a method for local update design, including:

[0024] Step 1: Collect partially blocked images and partially unblocked images, and establish partially blocked atlases and partially unblocked atlases; optionally, the partially unblocked images are site plans of cities, parks, and green spaces, which are obtained by crawling the Internet or public data sets; the partially blocked images can be derived from existing images, or they can be obtained by masking the partially unblocked images; optionally, the masked parts are functional areas or design elements in the site plan, such as green spaces, squares, stadiums, and waters in the site plan, and the partially blocked images and partially unblocked images generated in this way are used for training, which is more in line with the actual situation of local update design;

[0025] Step 2: Taking the partially blocked image in the partially blocked atlas as input and the partially unblocked image in the partially unblocked atlas as output, the Edge Connect model is used for training to obtain a local update model; the Edge Connect model is a two-stage image inpainting adversarial model that integrates a contour generator and an inpainting network. The contour imaginary image generated by the contour generator is first used as a priori result. Then, based on this contour imaginary image, the inpainting network is used to fill the blocked area and estimate the RGB pixel values ​​of the blocked area.

[0026] Step 3: Input the design image to be partially updated into the local update model to obtain a local update image; the design image to be partially updated includes the local area to be updated, such as various venues; obviously, the operation process is simple, which can reduce the waste of time and energy caused by manual local update and improve the update efficiency.

[0027] In another embodiment, the method further includes: normalizing the size of the collected partially obscured image and the partially unobstructed image, and then inputting them into the Edge Connect model for training.

[0028] In another embodiment, it also includes: graying the partially obscured image or the design image to be partially updated to obtain a grayscale image, extracting the obscured area of ​​the partially obscured image or the design image to be partially updated as an occluded image, performing edge detection on the partially obscured image or the design image to be partially updated using a Canny algorithm to obtain a contour image, and inputting the grayscale image, the occluded image, and the contour image into the Edge Connect model; processing the partially obscured image or the design image to be partially updated, and then inputting the processed image into the EdgeConnect model for training.

[0029] In another embodiment, the Edge Connect model includes a first generator, a second generator, a first discriminator and a second discriminator, the first generator is used to generate a predicted contour image according to the grayscale image, the occluded image and the contour image, and the first discriminator is used to calculate the loss function of the first generator to determine whether the predicted contour image is true; the second generator is used to generate a predicted update image according to the predicted contour image, the partially occluded image or the design image to be partially updated, and the second discriminator is used to calculate the loss function of the second generator to determine whether the predicted update image is Real; that is, the first generator and the second generator are G1:X1→Y1 and G2:X2→Y2, and the corresponding first discriminator and the second discriminator are D1 and D2 respectively. The generators G1 and G2 form a linear structure between samples X and Y, that is, the result Y1 generated by G1 is the starting X2 of G2; the first discriminator calculates the adversarial loss and the feature loss to obtain the loss function, and discriminates the produced predicted contour image; the second discriminator calculates the adversarial loss, the perceptual loss and the style loss to obtain the loss function, and discriminates the obtained predicted update image. When the loss functions are all lower than the predetermined value, the training of the local update model is completed.

[0030] In another embodiment, it also includes: identifying key points of the partially unobstructed image, determining key areas of the partially unobstructed image based on the key points, and performing occlusion to generate the partially obstructed image; optionally, key points can be determined according to conventional image recognition algorithms, such as identifying objects in an image and taking several points on the object as key points; by determining key points and key areas, a large number of partially obstructed images can be generated, which provide a large number of rich training samples for the Edge Connect model.

[0031] In another embodiment, a specific method for generating a partially obscured image based on a partially unobstructed image is provided. The key area of ​​the partially unobstructed image is determined based on the key points, and occlusion is performed. The method for generating the partially obscured image includes: S1: dividing the partially unobstructed image into a plurality of rectangular areas. Figure 2 9 rectangular areas are shown in the figure and are numbered from 1 to 9; S2: Identify the lines and intersections in each rectangular area, and select the intersections with the most connected lines as the key points; S3: Take the key point in the rectangular area at the upper left corner as the starting point and the key point in the rectangular area at the lower right corner as the end point, the key area extends from the starting point to the end point, and the width of the key area is a predetermined multiple of the size of the rectangular area; S4: Change the number of the rectangular areas in S1, repeat S2 to S3, and obtain the key area; S5: Perform occlusion on the key area obtained in S3 to S4 to obtain the partially occluded image;

[0032] In the above embodiment, a plurality of parallel horizontal lines and a plurality of parallel vertical lines are used to divide the partially unobstructed image into a plurality of rectangular areas, and then key points in each rectangular area are respectively identified. The key points may be the intersections with the most connecting lines. The key points are extended from the key points of the upper left rectangular area and pass through the key points of each rectangular area in turn to obtain the key areas. For example, from Figure 2 The blocks are numbered 1-2-3-6-5-4-7-8-9 in sequence; the width of the key area is a predetermined multiple of the size of the rectangle, which can be 0.2-0.5. The number of horizontal and vertical lines is changed, the size of the rectangular area is adjusted, and the key area is obtained repeatedly, so that multiple layout blocked images are obtained according to an image with no cover; this embodiment can obtain a large number of training samples with a small number of collected images, and the training samples contain key points, and the training details are rich. By adjusting the size of the rectangular area and identifying the key points, compared with masking a specific functional area or design element, most of the details in the collected image can be covered to obtain a training image with rich details. After training, the update accuracy of the local update model is improved; for example, 5,000 partially unobstructed images are collected from a web crawler and a public data set. Through the operation of this embodiment, the number of partially unobstructed images can be increased to 50,000, and the details are richer and more obvious. After training, the local update model obtained has a higher update accuracy.

[0033] In another embodiment, the key area does not cross in the process of extending from the starting point to the end point, which can reduce unnecessary extension and reduce the amount of calculation.

[0034] The embodiment of the present application also provides a device for local update design, which is set on a PC, a local server or a remote server, including:

[0035] A collection module, used for collecting partially obscured images and partially unobstructed images from the network or an existing database, and establishing a partially obscured atlas and a partially unobstructed atlas;

[0036] A local update model, which is obtained by training with an Edge Connect model using the local occluded image in the local occluded atlas as input and the local unoccluded image in the local unoccluded atlas as output, that is, the local occluded atlas and the local unoccluded atlas obtained by the acquisition module are used for training to obtain the local update model;

[0037] The updating module is used to input the design image to be partially updated into the local updating model to obtain the local updated image, wherein the design image to be partially updated includes the local area to be updated, such as various venues.

[0038] In another embodiment, the Edge Connect model includes a first generator, a second generator, a first discriminator and a second discriminator; the partially obscured image or the design image to be locally updated is grayed to obtain a grayscale image, the obscured area of ​​the partially obscured image or the design image to be locally updated is extracted as an occluded image, and the Canny algorithm is used to perform edge detection on the partially obscured image or the design image to be locally updated to obtain a contour image; the first generator is used to generate a predicted contour image based on the grayscale image, the occluded image and the contour image, and the first discriminator is used to calculate the loss function of the first generator to determine whether the predicted contour image is true; the second generator is used to generate a predicted update image based on the predicted contour image, the partially obscured image or the design image to be locally updated, and the second discriminator is used to calculate the loss function of the second generator to determine whether the predicted update image is true; when the loss functions are all lower than a predetermined value, the training of the local update model is completed.

[0039] In another embodiment, it also includes: the acquisition module is also used to identify the key points of the partially unobstructed image, determine the key area of ​​the partially unobstructed image according to the key points, and perform occlusion to generate the partially obstructed image. The specific method includes: S1: divide the partially unobstructed image into multiple rectangular areas; S2: identify the lines and intersections in each of the rectangular areas, and select the intersections with the most connected lines as the key points; S3: take the key point in the rectangular area in the upper left corner as the starting point, and take the key point in the rectangular area in the lower right corner as the end point, the key area extends from the starting point to the end point, the width of the key area is a predetermined multiple of the size of the rectangular area, and the key area does not cross in the process of extending from the starting point to the end point; S4: change the number of the rectangular areas in S1, repeat S2 to S3, and obtain the key area; S5: perform occlusion on the key area obtained by S3 to S4, The partially obscured image is obtained; specifically, a plurality of parallel horizontal lines and a plurality of parallel vertical lines are used to divide the partially unobstructed image into a plurality of rectangular areas, and then key points in each rectangular area are respectively identified, the key points may be intersections with the most connecting lines, and the key points are extended from the key points of the upper left rectangular area, and the key points of each rectangular area are passed through in sequence to obtain the key area, the width of the key area is a predetermined multiple of the size of the rectangle, and the predetermined multiple may be 0.2 to 0.5, the number of horizontal lines and vertical lines is changed, the size of the rectangular area is adjusted, and the key area is repeatedly obtained, so that a plurality of layout obscured images are obtained according to an image with no obstruction; the present embodiment can obtain a large number of training samples with a small number of acquired images, and the training samples contain key points, and the training details are rich. By adjusting the size of the rectangular area and identifying the key points, most of the details in the acquired image can be covered to obtain a training image with rich details, and the update accuracy of the local update model is improved after training.

[0040] The number of devices and processing scales described here are used to simplify the description of the present invention. The application, modification and variation of the method and apparatus of the present invention with partial updated design will be obvious to those skilled in the art.

[0041] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

Claims

1. Method of partial update design, It is characterized in that include: Collect partially blocked images and partially unblocked images, and establish partially blocked atlases and partially unblocked atlases; Taking the partially blocked image in the partially blocked atlas as input and the partially unblocked image in the partially unblocked atlas as output, training is performed using the Edge Connect model to obtain a local update model; Inputting the design image to be partially updated into the local update model to obtain a local update image; Graying the partially blocked image or the design image to be partially updated to obtain a grayscale image, extracting the blocked area of ​​the partially blocked image or the design image to be partially updated as an occlusion image, performing edge detection on the partially blocked image or the design image to be partially updated using a Canny algorithm to obtain a contour image, and inputting the grayscale image, the occlusion image, and the contour image into the Edge Connect model; Identifying key points of the partially unobstructed image, determining key areas of the partially unobstructed image according to the key points, and performing occlusion to generate the partially obstructed image; The method of determining the key area of ​​the partially unobstructed image according to the key points and performing occlusion to generate the partially obstructed image includes: S1: Divide the partially unobstructed image into a plurality of rectangular areas; S2: Identify the lines and intersections in each rectangular area, and select the intersections with the most connected lines as the key points; S3: taking the key point in the rectangular area at the upper left corner as the starting point and the key point in the rectangular area at the lower right corner as the end point, the key area extends from the starting point to the end point, and the width of the key area is a predetermined multiple of the size of the rectangular area; S4: changing the number of the rectangular areas in S1, repeating S2 to S3, and obtaining the key area; S5: performing masking on the key area obtained in S3-S4 to obtain the partially masked image.

2. The method for local update design as claimed in claim 1, It is characterized in that Also includes: The collected partially obscured image and the partially unobscured image are resized and then input into the Edge Connect model.

3. The method for local update design as claimed in claim 1, It is characterized in that The Edge Connect model includes a first generator, a second generator, a first discriminator, and a second discriminator, wherein the first generator is used to generate a predicted contour image according to the grayscale image, the occlusion image, and the contour image, and the first discriminator is used to calculate a loss function of the first generator to determine whether the predicted contour image is true; The second generator is used to generate a predicted update image based on the predicted contour image, the partially occluded image or the design image to be partially updated, and the second discriminator is used to calculate the loss function of the second generator to determine whether the predicted update image is true.

4. The method for local update design as claimed in claim 1, It is characterized in that The key area does not cross during the process of extending from the starting point to the end point.

5. Partially updated design of the device, It is characterized in that include: An acquisition module, which acquires partially blocked images and partially unblocked images, and establishes a partially blocked atlas and a partially unblocked atlas; A local update model, which is obtained by training with an Edge Connect model using the local occluded image in the local occluded atlas as input and the local unoccluded image in the local unoccluded atlas as output; An updating module, used for inputting the design image to be partially updated into the local updating model to obtain a locally updated image; The Edge Connect model includes a first generator, a second generator, a first discriminator and a second discriminator; the partially blocked image or the design image to be partially updated is grayed to obtain a gray image, the blocked area of ​​the partially blocked image or the design image to be partially updated is extracted as an occluded image, and the Canny algorithm is used to perform edge detection on the partially blocked image or the design image to be partially updated to obtain a contour image; the first generator is used to generate a predicted contour image according to the gray image, the occluded image and the contour image, and the first discriminator is used to calculate the loss function of the first generator to determine whether the predicted contour image is true; The second generator is used to generate a predicted update image according to the predicted contour image, the partially blocked image or the design image to be partially updated, and the second discriminator is used to calculate the loss function of the second generator to determine whether the predicted update image is true; The acquisition module is also used to identify key points of the partially unobstructed image, determine key areas of the partially unobstructed image according to the key points, and perform occlusion to generate the partially obstructed image. The specific method includes: S100: Divide the partially unobstructed image into a plurality of rectangular areas; S200: Identify the lines and intersections in each rectangular area, and select the intersections with the most connected lines as the key points; S300: Taking the key point in the upper left corner of the rectangular area as the starting point and the key point in the lower right corner of the rectangular area as the end point, the key area extends from the starting point to the end point, the width of the key area is a predetermined multiple of the size of the rectangular area, and the key area does not cross in the process of extending from the starting point to the end point; S400: changing the number of the rectangular areas in S100, repeating S200 to S300, and obtaining the key area; S500: performing masking on the key area obtained in S300 to S400 to obtain the partially masked image.