A building tilt angle detection method and system based on a mobile phone depth-of-field camera
Patent Information
- Application Number
- CN202211615456.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2042-12-15
AI Technical Summary
M、N、P和Q即为所设观测标志,可见,检测较为繁琐,业主个人无法进行,因此,需要提供一种基于手机景深摄像头的楼体倾斜角度检测方法及系统,旨在解决上述问题
Smart Images

Figure CN115979218B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent detection technology, specifically to a method and system for detecting the tilt angle of a building based on a mobile phone depth camera. Background Technology
[0002] During building inspection, the building's tilt is measured. Determining the tilt angle requires a specialized assessment agency and a theodolite. The theodolite must be set up at a fixed station, at a distance at least 1.5 times the building's height. The observation point M on the upper part of the X-wall is aimed at, and the lower observation point N is determined using the left- and right-side centering method. Similarly, the upper observation point P and lower observation point Q are determined on the Y-wall, perpendicular to the X-wall. M, N, P, and Q are the established observation markers. As can be seen, the measurement is quite cumbersome and cannot be performed by the homeowner alone. Therefore, a method and system for detecting building tilt angles based on a mobile phone depth camera is needed to solve the aforementioned problems. Summary of the Invention
[0003] In view of the shortcomings of the existing technology, the purpose of this invention is to provide a method and system for detecting the tilt angle of a building based on a mobile phone depth camera, so as to solve the problems existing in the above-mentioned background technology.
[0004] This invention is implemented as follows: a method for detecting the tilt angle of a building based on a mobile phone depth camera, the method comprising the following steps:
[0005] Acquire images of the building to be measured;
[0006] To perform auxiliary correction on the image of the building to be tested, auxiliary lines are added at the blurred boundaries of the building.
[0007] Coordinate calculations are performed, and the coordinates of each point on the building boundary in space are calculated by 3D scanning with a depth camera.
[0008] Dimension calculations are performed, and the length between two points is obtained from their coordinates in space.
[0009] Perform angle calculations and determine the building's measured angle based on the calculated length;
[0010] The building tilt angle is displayed by subtracting 90° from the building tilt angle as the absolute value of the calculation result.
[0011] As a further aspect of the present invention: the step of determining the building's angle to be measured based on the calculated length specifically includes:
[0012] The measured angle of the building's front elevation is determined based on the calculated length.
[0013] The angle to be measured on the side elevation of the building is determined based on the calculated length.
[0014] As a further aspect of the present invention: the step of auxiliaryly correcting the image of the building to be tested by adding auxiliary lines at the blurred boundaries of the building specifically includes:
[0015] To ensure that the plane of the building in the image of the building under test is parallel to the plane of the mobile phone, plane correction is performed.
[0016] The bottom boundary of the part of the building that is in contact with the ground is determined as the fuzzy boundary. Auxiliary lines are added at the fuzzy boundary to help identify the boundary. The auxiliary lines are determined by the two intersection points of the left and right boundaries of the building and the ground.
[0017] As a further aspect of the present invention: the building tilt angle includes the tilt angle of the front facade and the tilt angle of the side facade.
[0018] As a further aspect of the present invention: the calculated lengths include a, b, c, d, and e, where b and d are the two adjacent sides of the angle to be measured on the front facade of the building, b and e are the two adjacent sides of the angle to be measured on the side facade of the building, a is the hypotenuse corresponding to the angle to be measured on the front facade of the building, c is the hypotenuse corresponding to the angle to be measured on the side facade of the building, α is the angle to be measured on the front facade of the building, and β is the angle to be measured on the side facade of the building. The calculation formula is as follows:
[0019] b 2 +d 2 -a 2 =2bd cosα
[0020]
[0021]
[0022] α′=|α-90°|
[0023] b 2 +e 2 -c 2 =2be cos β
[0024]
[0025]
[0026] β′=|β-90°|
[0027] Where α′ is the tilt angle of the building's front facade and β′ is the tilt angle of the building's side facade.
[0028] Another object of the present invention is to provide a building tilt angle detection system based on a mobile phone depth camera, the system comprising:
[0029] The building image acquisition module is used to acquire images of the building to be measured.
[0030] The image-assisted correction module is used to assist in the correction of the building image under test by adding auxiliary lines at the blurred boundaries of the building.
[0031] The point coordinate calculation module is used to perform coordinate calculations, which use a depth-of-field camera to 3D scan and calculate the spatial coordinates of each point on the building boundary.
[0032] The length and dimension calculation module is used to perform dimension calculations, obtaining the length between two points from their coordinates in space.
[0033] The angle calculation module is used to calculate the angle and determine the building's angle to be measured based on the calculated length.
[0034] The tilt angle determination module is used to display the tilt angle of the building. The absolute value of the tilt angle minus 90° is taken as the calculation result, which is the tilt angle of the building.
[0035] Compared with the prior art, the beneficial effects of the present invention are:
[0036] This invention uses a smartphone to capture images of the building under test, automatically corrects the images by adding auxiliary lines at blurred building boundaries to facilitate the phone's identification of points on the boundaries; calculates coordinates using a depth-sensing camera's 3D scanning to determine the spatial coordinates of points on the building boundaries; calculates dimensions by determining the length between two points using their coordinates; calculates angles by determining the building's angle to be measured based on the calculated lengths; and finally, automatically displays the building's tilt angle. The testing is convenient, requiring no assessment agency, and can be performed by the homeowner themselves. Attached Figure Description
[0037] Figure 1 This is a flowchart of a method for detecting the tilt angle of a building based on a mobile phone depth camera.
[0038] Figure 2 This is a schematic diagram of the building length dimension in a building tilt angle detection method based on a mobile phone depth camera.
[0039] Figure 3 This is a schematic diagram of a building tilt angle detection system based on a mobile phone depth camera. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0041] The specific implementation of the present invention will be described in detail below with reference to specific embodiments.
[0042] like Figure 1 As shown in the figure, this embodiment of the invention provides a method for detecting the tilt angle of a building based on a mobile phone depth camera. The method includes the following steps:
[0043] S100: Collect images of the building to be measured; simply take a picture of the building with your mobile phone.
[0044] S200 provides auxiliary correction to the building image under test by adding auxiliary lines at the blurred boundaries of the building, making it easier for the mobile phone to identify the points on the boundary.
[0045] S300 performs coordinate calculations, using a depth-of-field camera to 3D scan and calculate the coordinates of each point on the building boundary in space.
[0046] S400, perform dimension calculations, and obtain the length between two points from their coordinates in space;
[0047] S500, perform angle calculation, and determine the building's measured angle based on the calculated length;
[0048] S600 displays the building tilt angle. The absolute value of the building tilt angle minus 90° is used as the calculation result, which is the building tilt angle.
[0049] In this embodiment of the invention, the step of assisting in the correction of the building image under test by adding auxiliary lines at the blurred boundary of the building specifically includes: making the plane of the building in the image under test parallel to the plane of the mobile phone, and performing plane correction; determining the bottom boundary of the part of the building in contact with the ground as the blurred boundary, and adding auxiliary lines at the blurred boundary to assist in boundary identification. The auxiliary lines are determined by the two intersection points of the left and right boundaries of the building and the ground. Furthermore, when calculating coordinates, the distance from each point in the image of the building under test to the camera and the coordinates of that point in the 2D image can be obtained through a depth camera, thus obtaining the three-dimensional spatial coordinates of each point on the boundary. The specific scheme is as follows:
[0050] This scheme involves four coordinate systems: pixel coordinates, image coordinates, camera coordinates, and world coordinates. The three-dimensional spatial coordinates are the coordinates of a point on an object in the world coordinate system. Assume the coordinates of an object point in the world coordinate system are (X, Y, Z), and its coordinates in the camera coordinate system are (X, Y, Z). C Y C Z C The object point has coordinates (x, y) in the image coordinate system and (u, v) in the pixel coordinate system. The distance between the object point and the camera is d, and the pixel coordinates are (u, v).
[0051] The formula for converting between pixel coordinates and image coordinates is:
[0052]
[0053] Where dx and dy are the actual physical sizes of the pixels, and u0 and v0 are the coordinates of the center pixel of the image.
[0054] The transformation formula between the image coordinate system and the camera coordinate system is:
[0055]
[0056] Where f is the camera focal length.
[0057] Transformation between camera coordinate system and world coordinate system:
[0058]
[0059] Where R is a 3x3 orthogonal rotation matrix, and T is a 3D translation vector. To obtain the 3D coordinates, we need to obtain Z... c Or a value of Z, from which the distance d from the object point to the camera can be obtained using a depth-sensing camera, i.e.: X 2 +Y 2 +Z 2 =d 2 Then the corresponding spatial coordinates (X, Y, Z) can be obtained.
[0060] In this embodiment of the invention, the step of determining the building's angle to be measured based on the calculated length specifically includes: determining the angle to be measured on the front facade of the building based on the calculated length; and determining the angle to be measured on the side facade of the building based on the calculated length. The building's tilt angle includes the tilt angle of the front facade and the tilt angle of the side facade.
[0061] like Figure 2 As shown, the calculated lengths include a, b, c, d, and e, where b and d are the two adjacent sides of the angle to be measured on the front facade of the building, b and e are the two adjacent sides of the angle to be measured on the side facade of the building, a is the hypotenuse corresponding to the angle to be measured on the front facade of the building, c is the hypotenuse corresponding to the angle to be measured on the side facade of the building, α is the angle to be measured on the front facade of the building, and β is the angle to be measured on the side facade of the building. The calculation formula is as follows:
[0062] b 2 +d 2 -a 2 =2bd cosα
[0063]
[0064]
[0065] α′=|α-90°|
[0066] b 2 +e 2 -c 2 =2be cos β
[0067]
[0068]
[0069] β′=|β-90°|
[0070] Where α′ is the tilt angle of the building's front facade and β′ is the tilt angle of the building's side facade, the tilt angle of the building can be directly obtained from the image of the building to be tested, thus completing the building tilt angle detection work, which is efficient and convenient.
[0071] like Figure 3 As shown in the figure, this embodiment of the invention also provides a building tilt angle detection system based on a mobile phone depth camera, the system comprising:
[0072] Building image acquisition module 100, used to acquire images of the building to be measured;
[0073] The image-assisted correction module 200 is used to assist in the correction of the building image under test by adding auxiliary lines at the blurred boundaries of the building.
[0074] The point coordinate calculation module 300 is used to perform coordinate calculations, which calculate the spatial coordinates of each point on the building boundary using a 3D scanning depth camera.
[0075] The length and dimension calculation module 400 is used to perform dimension calculations, obtaining the length between two points from their coordinates in space.
[0076] The 500 module for calculating the angle to be measured is used to calculate the angle and determine the angle to be measured of the building based on the calculated length.
[0077] The tilt angle determination module 600 is used to display the tilt angle of the building. The absolute value of the tilt angle minus 90° is taken as the calculation result, which is the tilt angle of the building.
[0078] The above description only details the preferred embodiments of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0079] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0080] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0081] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the disclosure in the specification and embodiments. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
Claims
1. A method for detecting the tilt angle of a building based on a mobile phone depth camera, characterized in that... The method includes the following steps: Acquire images of the building to be measured; To correct the image of the building under test, auxiliary lines are added to the blurred boundaries of the building. Coordinate calculations are performed, using a depth-sensing camera to calculate the spatial coordinates of each point on the building boundary; Dimensional calculations are performed, and the length between two points is obtained from their coordinates in space. Perform angle calculations and determine the building's measured angle based on the calculated length. The building's tilt angle is displayed by subtracting 90° from the building's tilt angle. The calculated result is the building's tilt angle. The calculated lengths include a, b, c, d, and e. b and d are the two adjacent sides of the angle to be measured on the building's front facade, b and e are the two adjacent sides of the angle to be measured on the building's side facade, a is the hypotenuse corresponding to the angle to be measured on the building's front facade, c is the hypotenuse corresponding to the angle to be measured on the building's side facade, α is the angle to be measured on the building's front facade, and β is the angle to be measured on the building's side facade. The calculation formula is as follows: b 2 +d 2 -a 2 =2bdcosα; cosα=(b 2 +d 2 -a 2 ) / (2bd); α=cos -1 ((b 2 +d 2 -a 2 ) / (2bd)); α’=|α-90°|; b 2 +e 2 -c 2 =2becosβ; cos β=(b 2 +e 2 -c 2 ) / (2be); β=cos -1 ((b 2 +e 2 -c 2 ) / (2be)); β’=|β-90°|; Where α' is the tilt angle of the building's front facade and β' is the tilt angle of the building's side facade. The step of assisting in the correction of the building image under test by adding auxiliary lines at the blurred boundaries of the building specifically includes: To ensure that the plane of the building in the image is parallel to the plane of the mobile phone, plane correction is performed. The bottom boundary of the part of the building that is in contact with the ground is determined as the fuzzy boundary. Auxiliary lines are added at the fuzzy boundary to help identify the boundary. The auxiliary lines are determined by the two intersection points of the left and right boundaries of the building and the ground. The step of determining the building's angle to be measured based on the calculated length specifically includes: The measured angle of the building's front elevation is determined based on the calculated length. The angle to be measured on the side elevation of the building is determined based on the calculated length. The building tilt angle includes the tilt angle of the building's front facade and the tilt angle of the building's side facade.
Citation Information
Patent Citations
Building skew detection method and device
CN106153004A
Target inclination angle detection method and device based on depth map
CN111025330A