Method, system and equipment for quickly mapping designed building to target image
By directly calculating the coordinate transformation relationship between the design drawings and the on-site image, and using perspective transformation method to quickly map buildings, the problems of computational complexity and real-time application difficulty in traditional technology are solved, and efficient and accurate mapping effect is achieved.
Patent Information
- Application Number
- CN202411701167.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-02-25
AI Technical Summary
Traditional building mapping technology has slow processing speed, high computational complexity, difficult data integration, and difficult real-time application. It also needs to recalculate the projection when the angle of the shooting image changes, affecting the efficiency of fast mapping.
By directly calculating the coordinate conversion relationship between the design drawings and the on-site acquired images, the perspective transformation method is used for mapping, which significantly reduces the calculation amount, improves processing speed and conversion efficiency, and sets up a dynamic update module to update the perspective transformation matrix in real time.
It realizes the rapid and accurate mapping of building design drawings onto the target image, reducing the computational complexity and data integration difficulty, supporting real-time applications, and ensuring the accuracy and efficiency of mapping.
Smart Images

Figure CN119516118A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image mapping, and in particular to a method, system and device for quickly mapping a designed building to a target image. Background Art
[0002] In the process of engineering design and construction, accurately mapping the designed building to the image taken on site can ensure the precise match between the design scheme and the on-site environment, help to find deficiencies and problems in the design, and make timely modifications and optimizations, thereby improving the precision and accuracy of the design; it can provide intuitive guidance for construction, so that construction personnel can see the corresponding relationship between the design scheme and the on-site environment and better understand the construction requirements and steps; it can help construction personnel better understand the design scheme and reduce communication barriers, etc. Therefore, it is necessary to map the designed building to the image taken.
[0003] Traditional building mapping technology usually relies on two-dimensional drawings of buildings or computer-generated three-dimensional models, and projects them onto photos or images, but it often has problems such as slow processing speed, high computational complexity, difficulty in data integration, and difficulty in real-time application. Moreover, when the angle of the image is changed, the model needs to be reused for projection calculation, which is not conducive to the rapid implementation of mapping in practice.
[0004] Therefore, there is an urgent need to develop a method for quickly mapping designed buildings to target images to solve the above problems. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a method, system and equipment for quickly mapping a designed building to a target image, which directly calculates the coordinate transformation relationship between the design drawings and the images collected on site. Mapping through the coordinate transformation relationship can significantly reduce the amount of calculation and improve the processing speed and conversion efficiency.
[0006] In a first aspect, the present invention provides a method for quickly mapping a designed building to a target image, comprising the following steps: S1, obtaining a first target image shot on site of a building; S2. Preset a first coordinate system in the first target image; select a number of points in the first target image as first feature points, and obtain coordinates of the first feature points in the first coordinate system; S3, obtaining a design drawing of the building, presetting a second coordinate system in the design drawing, and obtaining real coordinates corresponding to each first feature point in the second coordinate system; S4. Calculate a first coordinate transformation relationship between the first coordinate system and the second coordinate system according to the coordinates of the first feature point and the real coordinates; S5. Convert the coordinates of any point in the design drawing into coordinates in the first target image according to the first coordinate conversion relationship, and draw them on the first target image.
[0007] Further, the S5 further includes: Acquire a second target image taken at the building site, use the Lucas-Kanade algorithm to track the second feature points in the second target image that correspond to the first feature points, and determine whether each first feature point has a corresponding second feature point; If it does not exist, the second target image is used as the first target image and the process goes to S2; If so, a third coordinate system is preset in the second target image, the coordinates of the second feature point in the third coordinate system are obtained, and a second coordinate conversion relationship between the third coordinate system and the second coordinate system is calculated according to the coordinates of the second feature point and the real coordinates; The coordinates of any point in the design drawing are converted into coordinates in the second target image according to the second coordinate conversion relationship, and are drawn on the second target image.
[0008] Further, obtaining the coordinates of the first feature point in the first coordinate system includes obtaining the first pixel coordinates corresponding to the first feature point in the image of the building taken by the drone or the photo of the building taken on site, and using the first pixel coordinates as the coordinates of the first feature point; Obtaining the coordinates of the second feature point in the third coordinate system includes obtaining the second pixel coordinates corresponding to the second feature point in the image of the building taken by a drone or the photo of the building taken on site, and using the second pixel coordinates as the coordinates of the second feature point.
[0009] Further, the first coordinate transformation relationship is the first perspective transformation matrix multiplied by the real coordinate to obtain the first feature point coordinates; the second coordinate transformation relationship is the second perspective transformation matrix multiplied by the real coordinate to obtain the second feature point coordinates; The first coordinate transformation relationship or the second coordinate transformation relationship is expressed by the following formula: , in, is the element in the i-th row and j-th column of the first perspective transformation matrix or the second perspective transformation matrix, 1≤i≤3, 1≤j≤3, is the real coordinate, is the first feature point coordinate or the second feature point coordinate.
[0010] Furthermore, the number of the first feature points is greater than or equal to 4.
[0011] In a first aspect, the present invention provides a system for quickly mapping a designed building to a target image, comprising: Data acquisition module: obtain a first target image taken on site of a building; preset a first coordinate system in the first target image; select a number of points in the first target image as first feature points, and obtain the coordinates of the first feature points in the first coordinate system; obtain a design drawing of the building, preset a second coordinate system in the design drawing, and obtain the real coordinates corresponding to each first feature point in the second coordinate system; Conversion module: connected to the data acquisition module, used for calculating the first coordinate conversion relationship between the first coordinate system and the second coordinate system according to the coordinates of the first feature point and the real coordinates; Output module: connected to the conversion module, used to convert the coordinates of any point in the design drawing into the coordinates in the first target image according to the first coordinate conversion relationship, and draw it on the first target image. In a third aspect, the present invention provides an electronic device, comprising: a processor and a memory; the processor is used to execute the steps of the method described in the first aspect by calling a program or instruction stored in the memory.
[0012] The embodiments of the present invention have the following technical effects: The present application obtains the coordinates corresponding to several feature points in the design drawings of the building and the images collected on site, and uses the perspective transformation method to directly calculate the coordinate transformation relationship between the two images. By mapping through the coordinate transformation relationship, the amount of calculation can be significantly reduced, and the processing speed and conversion efficiency can be improved; The present application sets up a dynamic update module, which records the coordinate changes of feature points through a tracking algorithm after reacquiring the captured image, and updates the perspective transformation matrix in real time, thereby ensuring that the projection of the real coordinates of the building on the image captured on site remains accurate; by updating the position of the feature points in each frame of the image, the purpose of dynamically adjusting the projection effect is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0014] Figure 1 It is a flow chart of a method for quickly mapping a designed building to a target image provided by an embodiment of the present invention; Figure 2 is a schematic diagram of a design drawing provided in Example 2 of the present invention; Figure 3It is a schematic diagram of a first target image corresponding to a design drawing provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0015] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0016] Example 1 Figure 1 FIG. 1 is a flow chart of a method for quickly mapping a designed building to a target image provided by an embodiment of the present invention. Figure 1 , including: S1. Acquire a first target image captured on site of a building.
[0017] An image, namely a first target image, can be taken on site using a drone and used as a target image for designing building mapping.
[0018] S2. Preset a first coordinate system in the first target image; select a number of points in the first target image as first feature points, and obtain coordinates of the first feature points in the first coordinate system.
[0019] The first feature point can be a significant feature point, such as an existing building corner, a road intersection, etc., which can be selected according to the actual situation, and this application does not impose too many restrictions. Obtaining the coordinates of the first feature point in the first coordinate system includes obtaining the first pixel coordinates corresponding to the first feature point in the image of the building taken by a drone or the photo of the building taken on site, and using the first pixel coordinates as the coordinates of the first feature point. S3. Obtain the design drawings of the building, preset a second coordinate system in the design drawings, and obtain the real coordinates corresponding to each first feature point in the second coordinate system.
[0020] There is a preset coordinate system in the design drawing of the building, which is set as the second coordinate system, and the real coordinates corresponding to the first feature point of the building in the second coordinate system are obtained.
[0021] It should be noted that the design drawings can also be orthophotos acquired by satellites, because designers often design directly in orthophotos.
[0022] S4. Calculate a first coordinate conversion relationship between the first coordinate system and the second coordinate system according to the first feature point coordinates and the real coordinates.
[0023] The fast mapping algorithm is used for calculation: the first coordinate transformation relationship is the first perspective transformation matrix multiplied by the real coordinate to obtain the first feature point coordinate.
[0024] The correspondence between the two images is established through the perspective transformation matrix. It should be noted that the number of feature points here must be greater than or equal to 4, and is preferably set to 4 to minimize the amount of calculation.
[0025] S5. Convert the coordinates of any point in the design drawing into coordinates in the first target image according to the first coordinate conversion relationship, and draw them on the first target image.
[0026] The coordinates of the same point in different coordinate systems can be converted to each other, so that when the point in the design drawing is converted to the first target image, it can be judged whether the constructed building has any deviations based on whether the point can overlap at the same position, which helps construction personnel better understand the design drawings.
[0027] In addition, this application includes: Acquire a second target image taken at the building site, use the Lucas-Kanade algorithm to track the second feature points in the second target image that correspond to the first feature points, and determine whether each first feature point has a corresponding second feature point; If it does not exist, the second target image is used as the first target image and the process goes to S2; If so, a third coordinate system is preset in the second target image, the coordinates of the second feature point in the third coordinate system are obtained, and a second coordinate conversion relationship between the third coordinate system and the second coordinate system is calculated according to the coordinates of the second feature point and the real coordinates; The coordinates of any point in the design drawing are converted into coordinates in the second target image according to the second coordinate conversion relationship, and are drawn on the second target image.
[0028] Obtaining the coordinates of the second feature point in the third coordinate system includes obtaining the second pixel coordinates corresponding to the second feature point in the image of the building taken by a drone or the photo of the building taken on site, and using the second pixel coordinates as the coordinates of the second feature point.
[0029] After acquiring the new photo, the shooting angle and position are adjusted to a certain extent. The feature points corresponding to the positions of the first feature points in the second target image, i.e., the second feature points, are tracked to record the coordinate changes of the feature points in real time. It should be noted that the second target image should contain all the feature points. If the number of feature points is missing, the feature points need to be re-determined for calculation. If all the feature points are included, the first perspective transformation matrix can be updated to the second perspective transformation matrix.
[0030] Specifically, the second coordinate transformation relationship is the second perspective matrix multiplied by the real coordinate to obtain the second feature point coordinate; The first coordinate transformation relationship or the second coordinate transformation relationship is expressed by the following formula: , in, is the element in the i-th row and j-th column of the first perspective transformation matrix or the second perspective transformation matrix, 1≤i≤3, 1≤j≤3, is the real coordinate, is the first feature point coordinate or the second feature point coordinate.
[0031] Based on the above technical solution, the present application obtains the coordinates corresponding to a number of feature points in the design drawing of the building and the first target image collected on site, respectively, and uses the perspective transformation method to directly calculate the coordinate transformation relationship between the two images. By performing coordinate mapping through the coordinate transformation relationship, the amount of calculation can be significantly reduced, and the processing speed and conversion efficiency can be improved. The present application sets up a dynamic update module, which records the coordinate changes of feature points through a tracking algorithm after reacquiring the captured image, and updates the perspective transformation matrix in real time, thereby ensuring that the projection of the real coordinates of the building on the image captured on site remains accurate; by updating the position of the feature points in each frame of the image, the purpose of dynamically adjusting the projection effect is achieved.
[0032] Example 2 Based on the content of Example 1, the present application provides a specific embodiment: S1: Get the first target image taken on site of the building, see Figure 3 ; S2. Preset a first coordinate system in the first target image; select a number of points in the first target image as first feature points, and obtain coordinates of the first feature points in the first coordinate system; Mark the corresponding positions of the four first feature points on the first target image, namely A1', A2', A3' and A4', and read the coordinates: A1'(365.9483,142.7681), A2'(656.0302,147.8852), A3'(623.2863,293.3273), A4'(458.17,288.6107).
[0033] S3, obtaining the design drawing of the building, presetting a second coordinate system in the design drawing, and obtaining the real coordinates corresponding to each first feature point in the second coordinate system, see Figure 2 ; Get the real coordinates corresponding to the first four feature points: A1(6527568.353,4761127.798); A2(6527606.67,4761146.041); A3(6527576.807,4761229.727); A4(6527541.545,4761213.349).
[0034] S4. Calculate a first coordinate transformation relationship between the first coordinate system and the second coordinate system according to the coordinates of the first feature point and the real coordinates; The first coordinate transformation relationship between two images is calculated using the fast mapping algorithm: , Where (x, y) is the real coordinate, (x', y') is the coordinate of the first feature point.
[0035] S5. Convert the coordinates of any point in the design drawing into coordinates in the first target image according to the first coordinate conversion relationship, and draw them on the first target image.
[0036] Get the real coordinate data of the designed building in the design drawing. These coordinates can be key points or other feature points of the building outline. Take the building outline point as an example to get its coordinates: P1(6527542.804,4761199.296); P2(6527569.931,4761143.388); P3(6527607.486,4761160.756); P4(6527582.548,4761216.236).
[0037] The design building coordinates P1, P2, P3, and P4 are converted into the first coordinates through the first coordinate transformation relationship in S4 to obtain the corresponding coordinates in the first target image, which are P1'(435.5464, 273.8259), P2'(423.6368, 176.0114), P3'(687.0449, 180.7022), and P4'(630.4491, 278.0248), respectively. They are drawn in the first target image. Figure 3 .
[0038] Example 3 Based on the content of Example 1, the present application provides a system for quickly mapping a designed building to a target image, including: Data acquisition module: obtain a first target image taken on site of a building; preset a first coordinate system in the first target image; select a number of points in the first target image as first feature points, and obtain the coordinates of the first feature points in the first coordinate system; obtain a design drawing of the building, preset a second coordinate system in the design drawing, and obtain the real coordinates corresponding to each first feature point in the second coordinate system; Conversion module: connected to the data acquisition module, used for calculating the first coordinate conversion relationship between the first coordinate system and the second coordinate system according to the coordinates of the first feature point and the real coordinates; Output module: connected to the conversion module, used to convert the coordinates of any point in the design drawing into the coordinates in the first target image according to the first coordinate conversion relationship, and draw it on the first target image.
[0039] For other details, please refer to Example 1 and will not be described in detail here.
[0040] Example 4 Based on the contents of the aforementioned embodiments, the present application provides an electronic device, comprising: a processor and a memory; the processor is used to execute the steps of the method described in Embodiment 1 by calling a program or instruction stored in the memory.
[0041] It should be noted that the terms used in the present invention are only for describing specific embodiments, rather than limiting the scope of the present application. As shown in the present specification, unless the context clearly indicates an exception, the words "one", "a", "a kind of" and / or "the" do not specifically refer to the singular, but may also include the plural. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method or device. In the absence of more restrictions, the elements defined by the sentence "include one..." do not exclude the presence of other identical elements in the process, method or device including the elements.
[0042] It should also be noted that the orientations or positional relationships indicated by the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc. are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", etc. should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.
Claims
1. A method for quickly mapping a designed building to a target image, characterized in that: The steps include: S1, obtaining a first target image shot on site of a building; S2. Preset a first coordinate system in the first target image; select a number of points in the first target image as first feature points, and obtain coordinates of the first feature points in the first coordinate system; S3, obtaining a design drawing of the building, presetting a second coordinate system in the design drawing, and obtaining the real coordinates corresponding to each first feature point in the second coordinate system; S4. Calculate a first coordinate transformation relationship between the first coordinate system and the second coordinate system according to the coordinates of the first feature point and the real coordinates; S5. Convert the coordinates of any point in the design drawing into coordinates in the first target image according to the first coordinate conversion relationship, and draw them on the first target image.
2. A method for quickly mapping a designed building to a target image according to claim 1, characterized in that: The S5 further includes: Acquire a second target image taken at the building site, use the Lucas-Kanade algorithm to track the second feature points in the second target image that correspond to the first feature points, and determine whether each first feature point has a corresponding second feature point; If it does not exist, the second target image is used as the first target image and the process goes to S2; If so, a third coordinate system is preset in the second target image, the coordinates of the second feature point in the third coordinate system are obtained, and a second coordinate conversion relationship between the third coordinate system and the second coordinate system is calculated according to the coordinates of the second feature point and the real coordinates; The coordinates of any point in the design drawing are converted into coordinates in the second target image according to the second coordinate conversion relationship, and are drawn on the second target image.
3. A method for quickly mapping a designed building to a target image according to claim 2, characterized in that: Acquiring the coordinates of the first feature point in the first coordinate system includes acquiring the first pixel coordinates corresponding to the first feature point in the image of the building taken by the drone or the photo of the building taken on site, and using the first pixel coordinates as the coordinates of the first feature point; Obtaining the coordinates of the second feature point in the third coordinate system includes obtaining the second pixel coordinates corresponding to the second feature point in the image of the building taken by a drone or the photo of the building taken on site, and using the second pixel coordinates as the coordinates of the second feature point.
4. The method for quickly mapping a designed building to a target image according to claim 2, characterized in that: The first coordinate transformation relationship is the first perspective transformation matrix multiplied by the real coordinates to obtain the first feature point coordinates; the second coordinate transformation relationship is the second perspective transformation matrix multiplied by the real coordinates to obtain the second feature point coordinates; The first coordinate transformation relationship or the second coordinate transformation relationship is expressed by the following formula: , in, is the element in the i-th row and j-th column of the first perspective transformation matrix or the second perspective transformation matrix, 1≤i≤3, 1≤j≤3, is the real coordinate, is the first feature point coordinate or the second feature point coordinate.
5. The method for quickly mapping a designed building to a target image according to claim 1, characterized in that: The number of the first feature points is greater than or equal to 4.
6. A system for quickly mapping a designed building to a target image, used to implement the steps of the method for quickly mapping a designed building to a target image as claimed in any one of claims 1 to 5, characterized in that: Includes the following modules: Data acquisition module: obtain a first target image taken on site of a building; preset a first coordinate system in the first target image; select a number of points in the first target image as first feature points, and obtain the coordinates of the first feature points in the first coordinate system; obtain a design drawing of the building, preset a second coordinate system in the design drawing, and obtain the real coordinates corresponding to each first feature point in the second coordinate system; Conversion module: connected to the data acquisition module, used for calculating the first coordinate conversion relationship between the first coordinate system and the second coordinate system according to the coordinates of the first feature point and the real coordinates; Output module: connected to the conversion module, used to convert the coordinates of any point in the design drawing into the coordinates in the first target image according to the first coordinate conversion relationship, and draw it on the first target image.
7. An electronic device, characterized in that: The electronic device comprises: Processor and memory; The processor is configured to execute the steps of the method according to any one of claims 1 to 5 by calling the program or instruction stored in the memory.