A facade reconstruction method, device, computer equipment, storage medium and product
By calculating the number of pixels and translation transformation factors of edge lines in the facade image, the position of the template object is directly determined for facade reconstruction, which solves the problem of difficult and low efficiency in the existing technology, and realizes a more efficient facade reconstruction process.
Patent Information
- Application Number
- CN202210118872.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-08
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2042-02-08
AI Technical Summary
In the development of the game, the prior art requires the acquisition of multiple pictures of different perspectives in the process of reconstruction of facades of objects such as buildings, and the location of three-dimensional lines and template objects needs to be determined through 3D technology, which makes reconstruction difficult and inefficient.
The candidate lines are determined by calculating the number of pixels corresponding to edge lines in the elevation image, and the translation transformation factor is calculated based on the positional relationship between the candidate lines, and the template object position is determined for elevation reconstruction.
The efficiency of facade reconstruction is improved, the dependence on 3D technology and template matching algorithms is avoided, and the reconstruction process is simplified.
Smart Images

Figure CN114463497B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a facade reconstruction method, apparatus, computer equipment, storage medium and product, wherein the storage medium is a computer-readable storage medium and the product is a computer program product. Background Art
[0002] In the process of game development, it is necessary to establish some objects according to the game scene, such as buildings, etc., or when a more comprehensive understanding of the object is needed, the object (for example, building) can be modeled to obtain the corresponding model. Taking the reconstruction of the building as an example, since the building is composed of multiple faces, the reconstruction of the building can be achieved by reconstructing the facade of the building. It is usually necessary to obtain pictures of the building under multiple perspectives, extract 2D edges for each photo, and then use 3D multi-perspective technology to reconstruct three-dimensional lines, and extract plane models from them. The obtained pictures are segmented according to the plane model and the three-dimensional lines to obtain different planes. For each plane, repeated template objects are manually selected, and the position of the template object on each plane is determined by the template matching algorithm. The template object is added at the corresponding position to obtain the reconstructed facade, that is, the reconstruction of the building is achieved. However, this method requires obtaining multiple pictures under different perspectives, and needs to obtain the plane model through 3D technology, etc., and the reconstruction of the facade is difficult and inefficient. Summary of the invention
[0003] The embodiments of the present application provide a facade reconstruction method, apparatus, computer equipment, storage medium and product. The solution can determine candidate lines by the number of pixels corresponding to the edge lines, and the translation transformation factor calculated according to the positional relationship between the candidate lines can determine the position of the template object to reconstruct the facade. There is no need to use 3D technology to determine the three-dimensional lines contained in the image, nor is there a need to use a template matching algorithm to determine the position of the template object, thereby improving the efficiency of facade reconstruction.
[0004] An embodiment of the present application provides a facade reconstruction method, comprising:
[0005] Acquire a facade edge image corresponding to a facade image containing a surface to be reconstructed, and acquire a template object in the surface to be reconstructed, wherein the facade edge image contains edge lines located in different directions;
[0006] Calculate the number of pixels occupied by edge lines whose positions match in each direction in the edge image;
[0007] If the number of pixels meets a preset condition, generating candidate lines corresponding to the facade image at the matching position;
[0008] Calculate the translation transformation factor corresponding to each direction according to the positional relationship between the candidate lines corresponding to each direction;
[0009] The template objects are arranged based on the translation transformation factor to model the surface to be reconstructed.
[0010] Accordingly, an embodiment of the present application further provides a facade reconstruction device, comprising:
[0011] An acquisition unit, configured to acquire a facade edge image corresponding to a facade image containing a surface to be reconstructed, and to acquire a template object in the surface to be reconstructed, wherein the facade edge image contains edge lines located in different directions;
[0012] A first calculation unit is used to calculate the number of pixels occupied by edge lines with matching positions in each direction in the edge image;
[0013] A generating unit, configured to generate candidate lines corresponding to the facade image at matching positions if the number of pixels meets a preset condition;
[0014] A second calculation unit, configured to calculate a translation transformation factor corresponding to each direction according to a positional relationship between the candidate lines corresponding to each direction;
[0015] A modeling unit is used to arrange the template objects based on the translation transformation factor to model the surface to be reconstructed.
[0016] In one embodiment, the candidate lines include a plurality of lines, and the second calculation unit includes:
[0017] A determination subunit, configured to determine a plurality of candidate line groups from the candidate lines, wherein the candidate line groups include two candidate lines in the same direction;
[0018] A distance calculation subunit, used for calculating the straight-line distance between two candidate straight lines in the candidate line group;
[0019] A factor determination subunit is used to determine the translation transformation factor according to the straight-line distance.
[0020] In one embodiment, the factor determination subunit comprises:
[0021] A search module, for searching, for each group of candidate lines, a target line that meets the condition from the candidate lines based on the straight-line distance, wherein the straight-line distance between two candidate lines in the candidate line group is greater than the size of the template object in the corresponding direction;
[0022] The data determination module is used to determine the candidate line group with the largest number of target lines among the multiple candidate line groups as the target line group, and determine the straight line distance corresponding to the target line group as the translation transformation factor.
[0023] In one embodiment, the number of pixels includes a plurality, and the generating unit includes:
[0024] A threshold calculation subunit, used to calculate a pixel threshold corresponding to each direction according to the number of pixels with the largest value among the multiple numbers of pixels in each direction;
[0025] The line generation subunit is used to generate, for each direction, a candidate line corresponding to the facade image at the matching position if the number of pixels corresponding to the direction is greater than the pixel threshold.
[0026] In one embodiment, the modeling unit includes:
[0027] A position determination subunit, used to determine the position of the template object according to the translation transformation factor corresponding to each direction;
[0028] An arranging subunit is used to arrange the template objects based on the positions to model the surface to be reconstructed.
[0029] In one embodiment, the facade reconstruction device further includes:
[0030] An area determination unit, configured to determine an area to be filled according to the translation transformation factor, the size and the position of the template object;
[0031] A pixel value acquisition unit, used to acquire an average pixel value of an image area corresponding to the area to be filled in the facade image;
[0032] A filling unit is used to fill the to-be-filled area based on the average pixel value.
[0033] In one embodiment, the acquisition unit includes:
[0034] An image acquisition subunit, used for acquiring a facade image including a facade to be reconstructed;
[0035] An edge extraction subunit, used for performing edge extraction on the facade image to obtain an initial facade edge image;
[0036] The denoising subunit is used to perform edge denoising processing on the initial facade edge image to obtain the facade edge image.
[0037] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any one of the facade reconstruction methods provided in the embodiments of the present application.
[0038] Accordingly, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute any one of the facade reconstruction methods provided in the embodiments of the present application.
[0039] Correspondingly, an embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, it is any one of the facade reconstruction methods provided in the embodiments of the present application.
[0040] The embodiment of the present application obtains a facade edge image corresponding to a facade image containing a surface to be reconstructed, and obtains a template object in the surface to be reconstructed, wherein the facade edge image includes edge lines located in different directions; the number of pixels occupied by edge lines with matching positions in each direction in the edge image is calculated; if the number of pixels meets a preset condition, candidate lines corresponding to the facade image are generated at the matching positions; according to the positional relationship between the candidate lines corresponding to each direction, a translation transformation factor corresponding to each direction is calculated; and the template objects are arranged based on the translation transformation factors to model the surface to be reconstructed.
[0041] This scheme can determine the candidate lines corresponding to the facade image by calculating the number of pixels corresponding to the position-matched edge lines, and the translation transformation factor can be calculated according to the positional relationship between the candidate lines. Further, based on the translation transformation factor, the position of the template object in the reconstructed facade can be determined to reconstruct the facade to be reconstructed. This scheme does not need to use 3D technology to determine the three-dimensional lines contained in the image, nor does it need to use a template matching algorithm to determine the position of the template object, thereby improving the efficiency of facade reconstruction. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 is a scene diagram of the facade reconstruction method provided in the embodiment of the present application;
[0044] Figure 2 is a flow chart of a facade reconstruction method provided in an embodiment of the present application;
[0045] Figure 3 is a schematic diagram of edge lines provided in an embodiment of the present application;
[0046] Figure 4 is a schematic diagram of candidate lines provided in an embodiment of the present application;
[0047] Figure 5 It is a schematic diagram of the location of the template object provided in the embodiment of the present application;
[0048] Figure 6 is a schematic diagram of the area to be filled provided in an embodiment of the present application;
[0049] Figure 7 is a schematic diagram of a facade image and a facade to be reconstructed provided in an embodiment of the present application;
[0050] Figure 8 is another flow chart of the facade reconstruction method provided by an embodiment of the present application;
[0051] Fig. 9 is a schematic diagram of a facade reconstruction device provided in an embodiment of the present application;
[0052] Fig.10 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0054] The embodiment of the present application provides a facade reconstruction method, device, computer equipment and computer readable storage medium. The facade reconstruction device can be integrated in a computer equipment, which can be a server or a terminal.
[0055] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.
[0056] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.
[0057] For example, Figure 1 As shown, a computer device performs edge extraction on a facade image containing a surface to be reconstructed to obtain a facade edge image corresponding to the facade image and containing edge lines located in different directions, and obtains a template object in the surface to be reconstructed; calculates the number of pixels occupied by edge lines that match positions in each direction in the edge image; if the number of pixels meets a preset condition, generates candidate lines corresponding to the facade image at the matching position; calculates the translation transformation factor corresponding to each direction based on the positional relationship between the candidate lines corresponding to each direction; arranges the template objects based on the translation transformation factor to model the surface to be reconstructed and obtains the reconstructed facade.
[0058] This scheme can determine the candidate lines corresponding to the facade image by calculating the number of pixels corresponding to the position-matched edge lines, and the translation transformation factor can be calculated according to the positional relationship between the candidate lines. Further, based on the translation transformation factor, the position of the template object in the reconstructed facade can be determined to reconstruct the facade to be reconstructed. This scheme does not need to use 3D technology to determine the three-dimensional lines contained in the image, nor does it need to use a template matching algorithm to determine the position of the template object, thereby improving the efficiency of facade reconstruction.
[0059] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0060] This embodiment will be described from the perspective of a facade reconstruction device. The facade reconstruction device may be integrated into a computer device, which may be a server or a terminal.
[0061] The embodiment of the present application provides a facade reconstruction method, such as Figure 2 As shown, the specific process of the facade reconstruction method can be as follows:
[0062] 101. Acquire a facade edge image corresponding to a facade image containing a surface to be reconstructed, and acquire a template object in the surface to be reconstructed, wherein the facade edge image contains edge lines located in different directions.
[0063] The surface to be reconstructed may be the surface of an object that needs to be reconstructed, and the surface of the object may include the front, side and back of the object, for example, the exterior walls of a building - the front exterior wall, the side exterior wall and the back exterior wall.
[0064] The facade image may be an image obtained for the face to be reconstructed contained in the object, the facade edge image may be an image containing the edge of the face to be reconstructed, and the edge line is a line corresponding to the edge of the intermediate facade.
[0065] Among them, the template object can be the repeated content on the surface to be reconstructed, and the facade image can be cropped to obtain the template object. For example, if the surface to be reconstructed is the facade of a building, and there are many windows arranged on the facade of the building, then the windows are repeated objects in the reconstructed surface, and the image area corresponding to one of the windows in the facade image is used as the template object.
[0066] For example, the facade image may be obtained from a database, or the facade image input by the user on the user page displayed on the client may be obtained. The client may include a client having functions such as displaying a virtual scene (e.g., a game scene) or a virtual character, and the facade image is edge extracted by an edge detection algorithm to obtain a facade edge image. The edge detection algorithm includes Roberts algorithm, Prewitt algorithm, obel algorithm, Canny algorithm, Laplacian algorithm, etc.
[0067] Among them, the Canny algorithm first performs image denoising on the inner image, then calculates the image gradient of the inner image after denoising, and then performs non-maximum suppression. Usually, the places where grayscale changes are concentrated are relatively concentrated. The gradient direction in the local range with the largest grayscale change is retained, and the others are not retained. In this way, a large part of the points can be eliminated. The edge with multiple pixel widths is turned into an edge with a single pixel width. Finally, double threshold screening is performed. After non-maximum suppression, there are still many possible edge points. Double thresholds are further set, namely low threshold (low) and high threshold (high). If the grayscale change is greater than the high threshold, it is set as a strong edge pixel, and if it is lower than the low threshold, the edge point is eliminated. The setting between the high threshold and the low threshold is a weak edge. Further judgment, if there is a strong edge pixel in its neighborhood, keep the pixel, if not, eliminate the pixel, so far, the facade edge image can be obtained.
[0068] And obtain the template object from the facade image through the template matching algorithm. For example, a matching template of the template object can be preset, and based on the matching template, the facade image is traversed to find the area similar to the matching template in the facade image as the template object.
[0069] Optionally, after the facade image is acquired, it can be displayed through the client and in response to the user selecting the surface to be reconstructed contained in the facade image displayed by the client, for example, the user can select multiple position coordinates (for example, four) from the facade image displayed by the client through a mouse or keyboard, and in response to the user's selection operation, the object contained in the image area obtained according to the multiple position coordinates is determined as the surface to be reconstructed in the facade image.
[0070] After the user selects the surface to be reconstructed, the template object in the surface to be reconstructed can also be determined in response to the user's selection operation on the template object in the facade image. For example, the user can manually select the template object from the facade image by performing a selection operation with the mouse, and the object contained in the image area selected by the user is determined as the template object.
[0071] In one embodiment, if the template object is determined by an area obtained by the intersection of multiple straight lines, the embodiment of the present application determines the position of the template object by determining the above-mentioned straight lines. Therefore, after edge extraction of the facade image, the edges of the non-straight parts and the edge lines with too large angles with the above-mentioned straight lines can be filtered to reduce the noise in the obtained facade edge image and improve the modeling effect. That is, the step of "obtaining a facade edge image corresponding to the facade image containing the facade to be reconstructed" can specifically include:
[0072] Acquire a facade image containing the facade to be reconstructed;
[0073] Perform edge extraction on the facade image to obtain an initial facade edge image;
[0074] The initial facade edge image is subjected to edge denoising processing to obtain a facade edge image.
[0075] For example, the edge extraction may be performed on the facade image to obtain an initial facade edge image, and the initial facade edge image may be subjected to edge denoising processing according to the required edge line type, and edge lines of a different type from the required edge line may be filtered out. For example, if the template object is located in an area obtained by two horizontal lines and two vertical lines, the horizontal edge lines and vertical edge lines in the initial edge image are retained. Optionally, in order to avoid erroneous filtering of the required edge lines due to the fact that pixel points on a complete straight line are extracted during the edge extraction process and the edge line corresponding to the straight line has an angle offset from the straight line, a certain error may be set. For example, edge lines having a certain angle (for example, ±10°) with the candidate straight line to be determined are retained at the same time.
[0076] 102. Calculate the number of pixels occupied by edge lines with matching positions in each direction in the edge image.
[0077] The direction may be set according to the characteristics of the surface to be reconstructed. For example, the horizontal direction and the numerical direction may be set, or other directions may be set.
[0078] The number of pixels may be the amount of pixels occupied by the edge line, for example, 5 pixels or 10 pixels.
[0079] The matching position may be an orientation, that is, a specific direction of a specific position, for example, Figure 3As shown, there can be multiple lines in the same direction in a two-dimensional plane, among which edge line 1 and edge line 2 in the same row are edge lines with matching positions, and some line segments of edge line 3 with a preset angle to the horizontal direction are also located in the same row, then edge line 3 is also an edge line with matching positions.
[0080] The row where edge line 1 and edge line 2 are located is the matching position; however, edge line 1 and edge line 4 are not in the same row in the horizontal direction, so edge line 1 and edge line 4 are not edge lines with matching positions.
[0081] For example, specifically, for each direction, edge lines with matching positions are determined, and the number of pixels occupied by edge lines with matching positions is calculated. For example, Figure 3 As shown, edge line 1, edge line 2 and edge line 3 match each other in the horizontal direction, edge line 1 includes 25 pixels, edge line 2 includes 30 pixels, and edge line 3 includes 10 pixels, so the number of pixels is 65 pixels.
[0082] 103. If the number of pixels meets the preset condition, a candidate line corresponding to the vertical image is generated at the matching position.
[0083] The preset condition may include a pixel threshold, and the pixel threshold may be preset, or the pixel threshold may be determined according to the number of pixels calculated in step 102 .
[0084] For example, if the number of pixels is greater than a preset pixel threshold, a candidate line corresponding to the inner image is generated at the matching position.
[0085] Optionally, an average value is calculated based on the multiple pixel quantities obtained in step 102, and the average value is used as the pixel threshold. Optionally, the mode or median of the multiple pixel quantities is used as the pixel threshold. Optionally.
[0086] Optionally, the number of pixels with the largest value is determined from the multiple numbers of pixels obtained in step 102, and the maximum number of pixels is generally used as the pixel threshold. That is, in one embodiment, the step of "if the number of pixels meets the preset condition, generating candidate lines corresponding to the vertical image at the matching position" may specifically include:
[0087] According to the number of pixels with the largest value among the multiple numbers of pixels in each direction, the pixel threshold corresponding to each direction is calculated;
[0088] For each direction, if the number of pixels corresponding to the direction is greater than the pixel threshold, a candidate line corresponding to the vertical image is generated at the matching position.
[0089] For example, there may be multiple sets of edge lines with matching positions in each direction, and the corresponding number of pixels may be calculated for each set of edge lines with matching positions. For example, in the horizontal direction, edge line 1 and edge line 2 match in position, edge line 3, edge line 4 and edge line 5 match in position, and edge line 6 and edge line 7 match in position, and the corresponding 3 pixel numbers in the horizontal direction may be calculated. The number of pixels with the largest value among the multiple pixel numbers is divided by 2 to obtain the pixel threshold corresponding to each direction.
[0090] The number of multiple pixels in each direction is compared with the pixel threshold corresponding to the direction. If the number of pixels is greater than the pixel threshold, a candidate line corresponding to the inner image is generated at the corresponding matching position.
[0091] Optionally, a candidate line may be generated according to the matching position, for example, x=4 is generated, and the candidate line is represented by x=4.
[0092] 104. According to the positional relationship between the candidate lines corresponding to each direction, a translation transformation factor corresponding to each direction is calculated.
[0093] The translation transformation factor may be a factor based on which objects are arranged, and the translation transformation factor may be in a numerical form or in a matrix form.
[0094] For example, the distance between the candidate lines corresponding to each direction may be obtained, and the translation transformation factor may be determined according to the distance. Specifically, the candidate lines include multiple ones, and the step “according to the positional relationship between the candidate lines corresponding to each direction” may include:
[0095] Determine multiple candidate line groups from the candidate lines, where the candidate line groups include two candidate lines in the same direction;
[0096] Calculate the straight-line distance between two candidate straight lines in the candidate line group;
[0097] Determines the translation transformation factor based on the straight-line distance.
[0098] For example, specifically, for each direction, two candidate lines are randomly selected from the candidate lines corresponding to the direction to form a candidate line group, and the distance between the two candidate lines included in each candidate line group, that is, the straight-line distance, is calculated. The average distance of multiple straight-line distances is calculated based on the straight-line distances corresponding to the multiple candidate line groups, and the average distance is used as the translation transformation factor.
[0099] Optionally, for each group of candidate line groups in each direction, the straight-line distance is determined. Since the translation transformation factor is determined in order to determine the position of the template object, the straight-line distance corresponding to the candidate line group in the horizontal direction needs to be greater than the width of the template object, and the straight-line distance corresponding to the candidate line group in the vertical direction needs to be greater than the height of the template object. Other candidate lines that meet the distance are searched in the direction, and the distance of the candidate line group that meets the search for the last candidate line is used as the translation transformation factor, that is, the step of "determining the translation transformation factor according to the straight-line distance" can specifically include:
[0100] For each group of candidate lines, searching for a target line that meets the conditions from the candidate lines based on the straight-line distance, where the straight-line distance between two candidate lines in the candidate line group is greater than the size of the template object in the corresponding direction;
[0101] Based on the number of target lines, a target line group is determined from a plurality of candidate line groups, and a straight line distance corresponding to the target line group is determined as a translation transformation factor.
[0102] The size may include data such as the width, height or area of the template object.
[0103] For example, it can be as follows Figure 4 As shown, the straight-line distance between candidate line 1 and candidate line 2 is d. Find whether there are other candidate lines at a distance d from candidate line 2. If so, the candidate line is a qualified target line. Continue to find whether there is a candidate line at a distance d from the qualified target line (that is, the distance from candidate line 2 is 2d), and so on. If not, end the search.
[0104] For each candidate line group, the number of target lines that meet the conditions is counted to obtain the number of target lines.
[0105] The candidate line group corresponding to the target line number with the largest value among the multiple target line numbers is determined as the target line group, and the straight-line distance between two candidate lines included in the target line group is used to determine the translation transformation factor. For example, the straight-line distance can be directly used as the translation transformation factor, or a matrix can be obtained based on the straight-line distance. Use this matrix as the translation transformation factor.
[0106] 105. Arrange the template objects based on the translation transformation factor to model the surface to be reconstructed.
[0107] For example, when the translation transformation factor is in numerical form, the template objects can be arranged in each direction with the corresponding translation transformation factor as the arrangement spacing. When the translation transformation factor is in matrix form, the border shape of the template object can be multiplied by the translation transformation factor, and the template object can be moved to other positions to arrange the template objects.
[0108] Optionally, the position of the template object can be determined according to the translation transformation factor. For example, the translation transformation factor in the horizontal direction is a, and the translation transformation factor in the vertical direction is b. Then the positions (0,0), (a,0), (2a,0), (0,b), (0,2b), (a,b), and (a,2b) can all be used as the positions of the template objects. The template objects can be arranged based on the positions, that is, the step of “arranging the template objects based on the translation transformation factor” can specifically include:
[0109] Determine the position of the template object according to the translation transformation factor corresponding to each direction;
[0110] Arrange template objects based on position to model the surface to be rebuilt.
[0111] For example, the position of the template object can be determined according to the direction and the corresponding translation transformation factor. Different directions are used as the moving directions of the template object, and the corresponding translation transformation factor is used as the moving unit. The position of the template object can be obtained. For example, the translation transformation factor in the A direction is a, the translation transformation factor in the B direction is b, and the position (ma, nb) is the position of the template object, where m and n are integers, such as Figure 5 As shown in Scene 1 and Scene 2, the position (ma, nb) can represent the position in a plane coordinate system established with the A direction and the B direction as coordinate axes.
[0112] The upper left corners of the template objects are placed at positions determined according to the plane transformation factors, and the template objects are arranged to model the reconstructed interior.
[0113] After the position of the template object is determined, the area where the template object is located can be determined, and the positions of other areas can also be determined, and they can be filled separately to obtain a reconstructed facade, that is, before the step of "arranging the template objects based on the position", the following can be specifically included:
[0114] Determine the area to be filled according to the translation transformation factor, the size and the position of the template object;
[0115] Obtaining the average pixel value of the image area corresponding to the area to be filled in the facade image;
[0116] The area to be filled is filled based on the average pixel value. For example, the object area where the template object is located in the reconstructed surface and the area to be filled can be determined according to the translation transformation factor, the size of the template object and the position of the template object. Figure 6 The object area and the area to be filled are shown.
[0117] The pixel value of each pixel in the image area corresponding to the area to be filled in the facade image is obtained, and the average pixel value is calculated according to the pixel value of each pixel. The object area is filled with the texture of the template object, for example, the texture of the template object is used as the texture of the object area in the reconstructed facade, and the color of the area to be filled is set to the average pixel value to complete the reconstruction of the facade.
[0118] Optionally, the surface to be reconstructed can be reconstructed based on the translation conversion factor, the texture of the template object and the average pixel value through modeling software such as Blender or FormZ. For example, when reconstructing the facade of a building, if the surface to be reconstructed is a wall with many windows, an initial building can be first established through the modeling software. The facade of the initial building is a blank facade, that is, a blank wall. According to the translation conversion factor and the size of the template object, the object area of the template object, namely the window area, and other areas, namely the wall area, are determined on the facade of the initial building. The window area is filled with the texture of the template object (the pixel value of the pixel point of the template object is used as the color of the window area), and the color of the wall area is set to the color indicated by the average pixel value.
[0119] As can be seen from the above, the embodiment of the present application obtains a facade edge image corresponding to a facade image containing a surface to be reconstructed, and obtains a template object in the surface to be reconstructed, wherein the facade edge image contains edge lines located in different directions; the number of pixels occupied by edge lines with matching positions in each direction in the edge image is calculated; if the number of pixels meets a preset condition, candidate lines corresponding to the facade image are generated at the matching position; based on the positional relationship between the candidate lines corresponding to each direction, the translation transformation factor corresponding to each direction is calculated; and the template objects are arranged based on the translation transformation factor to model the surface to be reconstructed.
[0120] This scheme can determine the candidate lines corresponding to the facade image by calculating the number of pixels corresponding to the position-matched edge lines, and the translation transformation factor can be calculated according to the positional relationship between the candidate lines. Further, based on the translation transformation factor, the position of the template object in the reconstructed facade can be determined to reconstruct the facade to be reconstructed. This scheme does not need to use 3D technology to determine the three-dimensional lines contained in the image, nor does it need to use a template matching algorithm to determine the position of the template object, thereby improving the efficiency of facade reconstruction.
[0121] Based on the above embodiments, further detailed description will be given below with examples.
[0122] This embodiment will be from the perspective of the facade reconstruction device, such as Figure 7 The facade image and the facade to be reconstructed are used as examples for description. The facade reconstruction device can be integrated into a computer device, which can be a server or a terminal.
[0123] The embodiment of the present application provides a facade reconstruction method, such as Figure 7 As shown, the specific process of the facade reconstruction method can be as follows:
[0124] 201. The terminal obtains a facade image including a facade to be reconstructed and a template object.
[0125] For example, the terminal may specifically obtain the facade image and the template object from a database, or receive the facade image and the template object through the Internet.
[0126] Optionally, the terminal obtains a facade image input by the user on the client and displays the facade image on the client. The terminal responds to the user's selection operation on the surface to be reconstructed and the template object in the facade image, determines the image area selected by the user, and uses the objects contained in the image area selected by the user as the surface to be reconstructed and the template object corresponding to the facade image. For example, the user can first select the surface to be reconstructed and then select the template object.
[0127] 202. The terminal performs edge extraction and edge noise reduction processing on the facade image to obtain a facade edge image.
[0128] Due to the edge extraction of the facade image, many edge lines can be extracted, for example, the edge lines of objects reflected on the glass, and the shape of the window on the facade to be reconstructed is usually a rectangle composed of horizontal lines and vertical lines. Therefore, after the edge extraction of the facade image, the terminal can filter the edge lines, remove noise, and retain the edge lines in the horizontal direction, the edge lines in the vertical direction, the edge lines with a preset angle of degrees (for example, ±10°) with the horizontal direction, and the edge lines with a preset angle of degrees (for example, ±10°) with the vertical direction to obtain the facade edge image.
[0129] Among them, edge detection algorithms include Roberts algorithm, Prewitt algorithm, Obel algorithm, Canny algorithm, and Laplacian algorithm.
[0130] 203. The terminal calculates the number of pixels occupied by edge lines that match the position in the horizontal direction in the edge image.
[0131] For example, the terminal may specifically determine the edge lines that match the positions in the horizontal direction, and the edge lines in the same row are the edge lines that match the positions. If some line segments of the edge lines that have a preset angle with the horizontal direction are also in the same row, then the edge lines are also the edge lines that match the positions.
[0132] Calculate the sum of the pixels occupied by all edge lines on each row to get the number of pixels corresponding to each row.
[0133] 204. If the number of pixels meets a preset condition, the terminal generates a candidate line corresponding to the vertical image at the matching position.
[0134] For example, there may be multiple sets of edge lines with matching positions in the horizontal direction, and the terminal may calculate the corresponding number of pixels for each set of edge lines with matching positions. For example, in the horizontal direction, edge line 1 and edge line 2 match in position, edge line 3, edge line 4 and edge line 5 match in position, and edge line 6 and edge line 7 match in position, and the corresponding 3 pixel numbers in the horizontal direction may be calculated. The number of pixels with the largest value among the multiple pixel numbers is divided by 2 to obtain the pixel threshold corresponding to each direction.
[0135] The terminal compares the number of multiple pixels in the horizontal direction with the pixel threshold corresponding to the horizontal direction. If the number of pixels is greater than the pixel threshold, a candidate line corresponding to the vertical image is generated at the corresponding matching position.
[0136] 205. The terminal determines a plurality of candidate line groups from the candidate lines, and calculates a straight-line distance between two candidate straight lines in the candidate line groups.
[0137] For example, the terminal may select any two candidate lines from the candidate lines corresponding to the horizontal direction to form a candidate line group, and calculate the distance between the two candidate lines included in each candidate line group, that is, the straight-line distance.
[0138] 206. The terminal determines a target line group from the multiple candidate line groups, and determines a straight line distance corresponding to the target line group as a translation transformation factor in the horizontal direction.
[0139] For example, it can be as follows Figure 4 As shown, the straight-line distance between candidate line 1 and candidate line 2 is d. Find whether there are other candidate lines at a distance d from candidate line 2. If so, the candidate line is a qualified target line. Continue to find whether there is a candidate line at a distance d from the qualified target line (that is, the distance from candidate line 2 is 2d), and so on. If not, end the search.
[0140] The terminal counts the number of target lines that meet the conditions for each candidate line group to obtain the number of target lines.
[0141] The candidate line group corresponding to the target line number with the largest value among the multiple target line numbers is determined as the target line group, and the straight-line distance between two candidate lines included in the target line group is used to determine the translation transformation factor. For example, the straight-line distance can be directly used as the translation transformation factor, or a matrix can be obtained based on the straight-line distance. Use this matrix as the translation transformation factor.
[0142] 207. The terminal determines a translation transformation factor in the vertical direction.
[0143] For example, the terminal can specifically determine the edge lines that match the positions in the vertical direction, and the edge lines in the same column are the edge lines that match the positions. If some line segments of the edge lines that have a preset angle with the vertical direction are also in the same column, then the edge lines are also the edge lines that match the positions.
[0144] Calculate the sum of the pixels occupied by all edge lines on each column to obtain the number of pixels corresponding to each column. Among the number of pixels corresponding to each column, half of the number of pixels with the largest value is used as the pixel threshold corresponding to the vertical direction. The terminal compares the number of pixels in the vertical direction with the pixel threshold corresponding to the direction. If the number of pixels is greater than the pixel threshold, the candidate lines corresponding to the vertical direction of the vertical image are generated at the corresponding matching position.
[0145] The terminal selects two candidate lines from the candidate lines corresponding to the vertical direction to form a candidate line group, and calculates the distance between the two candidate lines in each candidate line group, that is, the straight-line distance. Referring to the method in step 206, the translation factor in the vertical direction is determined according to the straight-line distance.
[0146] 208. The terminal determines the object area where the template object is located and other areas according to the translation transformation factor corresponding to each direction.
[0147] For example, after the terminal obtains the translation transformation factors in the horizontal and vertical directions, the terminal can use the blender software to reconstruct the surface to be reconstructed based on the translation transformation factors and the object template. Specifically, the blender software can be used to determine the position of the template object according to the horizontal direction and the translation transformation factors corresponding to the horizontal direction, and the vertical direction and the translation transformation factors corresponding to the vertical direction. Different directions are used as the moving directions of the template object, and the corresponding translation transformation factors are used as the moving units. The position of the template object can be obtained. For example, the horizontal translation transformation factor is a, the vertical translation transformation factor is b, and the position (ma, nb) is the position of the template object, where m and n are integers, and the position (ma, nb) can represent the position in the plane coordinate system established with the horizontal and vertical directions as coordinate axes.
[0148] For example, the terminal may specifically determine the location of the template object, determine the object area where the template object is located according to the size of the template object, and determine the area outside the object area as the area to be filled.
[0149] 209. The terminal fills the object area and other areas respectively to complete the modeling of the surface to be reconstructed.
[0150] For example, the terminal may specifically obtain a pixel value of each pixel in the facade image, and calculate an average pixel value of the facade image according to the pixel value of each pixel.
[0151] The terminal uses the texture of the template object as the texture of the object area through the blender software, for example, the pixel values of the pixels in the template object are used to fill the object area, and the average pixel value is used to fill the area to be filled, thus completing the modeling of the surface to be reconstructed.
[0152] Optionally, the terminal may display the facade obtained by modeling the facade to be reconstructed at a display position specified by the client user.
[0153] As can be seen from the above, the terminal of the embodiment of the present application obtains a facade image and a template object containing a surface to be reconstructed; performs edge extraction and edge denoising on the facade image to obtain a facade edge image; calculates the number of pixels occupied by edge lines that match the position in the horizontal direction in the edge image; if the number of pixels meets the preset conditions, the terminal generates candidate lines corresponding to the facade image at the matching position; determines multiple groups of candidate line groups from the candidate lines, and calculates the straight-line distance between two candidate straight lines in the candidate line group; determines a target line group from the multiple groups of candidate line groups, and determines the straight-line distance corresponding to the target line group as a translation transformation factor in the horizontal direction; determines the translation transformation factor in the vertical direction; determines the object area where the template object is located, as well as other areas according to the corresponding translation transformation factors in each direction; fills the object area and other areas respectively to complete the modeling of the surface to be reconstructed.
[0154] This scheme can determine the candidate lines corresponding to the facade image by calculating the number of pixels corresponding to the position-matched edge lines, and the translation transformation factor can be calculated according to the positional relationship between the candidate lines. Further, based on the translation transformation factor, the position of the template object in the reconstructed facade can be determined to reconstruct the facade to be reconstructed. This scheme does not need to use 3D technology to determine the three-dimensional lines contained in the image, nor does it need to use a template matching algorithm to determine the position of the template object, thereby improving the efficiency of facade reconstruction.
[0155] In order to facilitate better implementation of the facade reconstruction method provided in the embodiment of the present application, a facade reconstruction device is also provided in one embodiment. The meanings of the terms are the same as those in the above-mentioned facade reconstruction method, and the specific implementation details can refer to the description in the method embodiment.
[0156] The facade reconstruction device can be integrated into a computer device, such as Figure 8 As shown, the facade reconstruction device may include: an acquisition unit 301, a first calculation unit 302, a generation unit 303, a second calculation unit 304 and a modeling unit 305, as follows:
[0157] (1) An acquisition unit 301 is used to acquire a facade edge image corresponding to a facade image containing a surface to be reconstructed, and to acquire a template object in the surface to be reconstructed. The facade edge image contains edge lines located in different directions.
[0158] In one embodiment, the acquisition unit 301 includes an image acquisition subunit, an edge extraction subunit and a noise reduction subunit, specifically:
[0159] Image acquisition subunit: used for acquiring a facade image including a facade to be reconstructed;
[0160] Edge extraction subunit: used to extract the edge of the facade image to obtain the initial facade edge image;
[0161] Denoising subunit: used for performing edge denoising processing on the initial facade edge image to obtain a facade edge image.
[0162] (2) A first calculation unit 302 is used to calculate the number of pixels occupied by edge lines with matching positions in each direction in the edge image.
[0163] (3) Generating unit 303: used to generate candidate lines corresponding to the vertical image at the matching position if the number of pixels meets a preset condition.
[0164] In one embodiment, the number of pixels includes a plurality, and the generation unit 303 includes a threshold calculation subunit and a line generation subunit, specifically:
[0165] Threshold calculation subunit: used for calculating the pixel threshold corresponding to each direction according to the number of pixels with the largest value among the multiple numbers of pixels in each direction;
[0166] Line generation subunit: for each direction, if the number of pixels corresponding to the direction is greater than the pixel threshold, a candidate line corresponding to the vertical image is generated at the matching position.
[0167] (4) A second calculation unit 304: configured to calculate a translation transformation factor corresponding to each direction according to the positional relationship between the candidate lines corresponding to each direction.
[0168] In one embodiment, the candidate lines include multiple lines, and the second calculation unit 304 includes a determination subunit, a distance calculation subunit and a factor determination subunit, specifically:
[0169] Determining subunit: used for determining multiple candidate line groups from the candidate lines, where the candidate line groups include two candidate lines in the same direction;
[0170] Distance calculation subunit: used to calculate the straight line distance between two candidate straight lines in the candidate line group;
[0171] Factor determination subunit: used to determine the translation transformation factor based on the straight-line distance.
[0172] In one embodiment, the factor determination subunit includes a search module and a data determination module, specifically:
[0173] A search module: for searching, for each group of candidate lines, a target line that meets the conditions from the candidate lines based on the straight-line distance, wherein the straight-line distance between two candidate lines in the candidate line group is greater than the size of the template object in the corresponding direction;
[0174] The data determination module is used to determine the candidate line group with the largest number of target lines among the multiple candidate line groups as the target line group, and determine the straight line distance corresponding to the target line group as the translation transformation factor.
[0175] (5) Modeling unit 305: used to arrange template objects based on the translation transformation factor to model the surface to be reconstructed.
[0176] In one embodiment, the modeling unit 305 includes a position determination subunit and an arrangement subunit, specifically:
[0177] Position determination subunit: used to determine the position of the template object according to the translation transformation factor corresponding to each direction;
[0178] Arrangement subunit: used to arrange template objects based on position to model the surface to be rebuilt.
[0179] In one embodiment, the facade reconstruction device further includes a pixel value acquisition unit, a region determination unit and a filling unit, specifically:
[0180] An area determination unit: used to determine the area to be filled according to the translation transformation factor, the size and the position of the template object;
[0181] A pixel value acquisition unit: used to acquire an average pixel value of an image area corresponding to the area to be filled in the facade image;
[0182] Fill unit: used to fill the area to be filled based on the average pixel value.
[0183] As can be seen from the above, the facade reconstruction device of the embodiment of the present application obtains a facade edge image corresponding to the facade image containing the facade to be reconstructed, and obtains a template object in the facade to be reconstructed through the acquisition unit 301, the facade edge image includes edge lines located in different directions; the first calculation unit 302 calculates the number of pixels occupied by the edge lines with matching positions in each direction in the edge image; if the number of pixels meets the preset conditions, the generation unit 303 generates candidate lines corresponding to the facade image at the matching position; the second calculation unit 304 calculates the translation transformation factor corresponding to each direction according to the positional relationship between the candidate lines corresponding to each direction; finally, the modeling unit 305 arranges the template objects based on the translation transformation factor to model the facade to be reconstructed.
[0184] This scheme can determine the candidate lines corresponding to the facade image by calculating the number of pixels corresponding to the position-matched edge lines, and the translation transformation factor can be calculated according to the positional relationship between the candidate lines. Further, based on the translation transformation factor, the position of the template object in the reconstructed facade can be determined to reconstruct the facade to be reconstructed. This scheme does not need to use 3D technology to determine the three-dimensional lines contained in the image, nor does it need to use a template matching algorithm to determine the position of the template object, thereby improving the efficiency of facade reconstruction.
[0185] The present application also provides a computer device, which may be a terminal or a server. Fig. 9 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0186] The computer device may include components such as a processor 1001 with one or more processing cores, a memory 1002 with one or more computer-readable storage media, a power supply 1003, and an input unit 1004. Those skilled in the art will appreciate that Fig.10 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0187] The processor 1001 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 1002 and calling data stored in the memory 1002, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, computer program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1001.
[0188] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.
[0189] The computer device also includes a power supply 1003 for supplying power to various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 1003 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0190] The computer device may further include an input unit 1004, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0191] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically, in this embodiment, the processor 1001 in the computer device will load the executable files corresponding to the processes of one or more computer programs into the memory 1002 according to the following instructions, and the processor 1001 will run the computer programs stored in the memory 1002, thereby realizing various functions, as follows:
[0192] Acquire a facade edge image corresponding to the facade image containing the surface to be reconstructed, and acquire a template object in the surface to be reconstructed, wherein the facade edge image contains edge lines located in different directions;
[0193] Calculate the number of pixels occupied by edge lines that match the position in each direction in the edge image;
[0194] If the number of pixels meets the preset conditions, a candidate line corresponding to the vertical image is generated at the matching position;
[0195] According to the positional relationship between the candidate lines corresponding to each direction, the translation transformation factor corresponding to each direction is calculated;
[0196] The template objects are arranged based on the translation transformation factor to model the surface to be reconstructed.
[0197] The specific implementation of the above operations can be found in the previous embodiments and will not be described in detail here.
[0198] As can be seen from the above, the computer device of the embodiment of the present application can obtain a facade edge image corresponding to a facade image containing a surface to be reconstructed, and obtain a template object in the surface to be reconstructed, wherein the facade edge image contains edge lines located in different directions; calculate the number of pixels occupied by edge lines with matching positions in each direction in the edge image; if the number of pixels meets a preset condition, generate candidate lines corresponding to the facade image at the matching position; calculate the translation transformation factor corresponding to each direction according to the positional relationship between the candidate lines corresponding to each direction; and arrange the template objects based on the translation transformation factor to model the surface to be reconstructed.
[0199] This scheme can determine the candidate lines corresponding to the facade image by calculating the number of pixels corresponding to the position-matched edge lines, and the translation transformation factor can be calculated according to the positional relationship between the candidate lines. Further, based on the translation transformation factor, the position of the template object in the reconstructed facade can be determined to reconstruct the facade to be reconstructed. This scheme does not need to use 3D technology to determine the three-dimensional lines contained in the image, nor does it need to use a template matching algorithm to determine the position of the template object, thereby improving the efficiency of facade reconstruction.
[0200] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations in the above-mentioned embodiments.
[0201] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0202] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program can be loaded by a processor to execute any facade reconstruction method provided in the embodiment of the present application.
[0203] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0204] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0205] Since the computer program stored in the computer-readable storage medium can execute any one of the facade reconstruction methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the facade reconstruction methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0206] The above is a detailed introduction to a facade reconstruction method, device, computer equipment, computer-readable storage medium and computer program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A facade reconstruction method, characterized in that: include: Acquire a facade edge image corresponding to a facade image containing a surface to be reconstructed, and acquire a template object in the surface to be reconstructed, wherein the facade edge image contains edge lines located in different directions; Calculate the number of pixels occupied by edge lines whose positions match in each direction in the edge image; If the number of pixels meets a preset condition, generating candidate lines corresponding to the facade image at the matching position; Calculate the translation transformation factor corresponding to each direction according to the positional relationship between the candidate lines corresponding to each direction; The template objects are arranged based on the translation transformation factor to model the surface to be reconstructed.
2. The method according to claim 1, characterized in that The candidate lines include a plurality of lines, and the translation transformation factor corresponding to each direction is calculated according to the positional relationship between the candidate lines corresponding to each direction, including: Determine a plurality of candidate line groups from the candidate lines, wherein the candidate line groups include two candidate lines in the same direction; Calculating the straight-line distance between two candidate straight lines in the candidate line group; The translation transformation factor is determined according to the straight-line distance.
3. The method according to claim 2, characterized in that The determining the translation transformation factor according to the straight-line distance comprises: For each group of candidate lines, searching for a target line that meets the condition from the candidate lines based on the straight-line distance, wherein the straight-line distance between two candidate straight lines in the candidate line group is greater than the size of the template object in the corresponding direction; The candidate line group with the largest number of target lines among the multiple candidate line groups is determined as the target line group, and the straight line distance corresponding to the target line group is determined as the translation transformation factor.
4. The method according to claim 1, characterized in that: The number of pixels includes a plurality of pixels, and if the number of pixels meets a preset condition, generating candidate lines corresponding to the facade image at the matching position includes: According to the number of pixels with the largest value among the multiple numbers of pixels in each direction, the pixel threshold corresponding to each direction is calculated; For each direction, if the number of pixels corresponding to the direction is greater than the pixel threshold, a candidate line corresponding to the facade image is generated at the matching position.
5. The method according to claim 1, characterized in that The arranging the template objects based on the translation transformation factor includes: Determine the position of the template object according to the translation transformation factor corresponding to each direction; The template objects are arranged based on the positions to model the surface to be reconstructed.
6. The method according to claim 5, characterized in that Before arranging the template objects based on the positions, the method includes: Determine the area to be filled according to the translation transformation factor, the size and the position of the template object; Obtaining an average pixel value of an image area corresponding to the area to be filled in the facade image; The area to be filled is filled based on the average pixel value.
7. The method according to any one of claims 1 to 6, characterized in that: The step of obtaining a facade edge image corresponding to a facade image containing a facade to be reconstructed includes: Acquire a facade image containing the facade to be reconstructed; Performing edge extraction on the facade image to obtain an initial facade edge image; The initial facade edge image is subjected to edge denoising processing to obtain the facade edge image.
8. A facade reconstruction device, characterized in that: include: An acquisition unit, configured to acquire a facade edge image corresponding to a facade image containing a surface to be reconstructed, and to acquire a template object in the surface to be reconstructed, wherein the facade edge image contains edge lines located in different directions; A first calculation unit is used to calculate the number of pixels occupied by edge lines with matching positions in each direction in the edge image; A generating unit, configured to generate candidate lines corresponding to the facade image at matching positions if the number of pixels meets a preset condition; A second calculation unit, configured to calculate a translation transformation factor corresponding to each direction according to a positional relationship between the candidate lines corresponding to each direction; A modeling unit is used to arrange the template objects based on the translation transformation factor to model the surface to be reconstructed.
9. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the facade reconstruction method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the facade reconstruction method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the facade reconstruction method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Computer system and method for generating a 3D geometric model
US20100214291A1
Roof Generation And Texturing Of 3D Models
US20140125667A1