Digital photogrammetry method, electronic equipment and system
By shooting images at different shooting positions and directions, building digital three-dimensional space and calculating the size scaling ratio, the problems of complex operation, limited applicable scenarios and poor reliability in the prior art are solved, and more convenient and reliable digital photogrammetry is achieved.
Patent Information
- Application Number
- CN202010131656.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-28
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2040-02-28
AI Technical Summary
The existing digital photogrammetry methods have problems such as complex operation, limited application scenarios and poor reliability in communication base station surveys.
By obtaining images of different shooting positions and directions, a digital three-dimensional space is constructed, and the size scaling ratio is determined using objects of known sizes, and the distance and height of the target object are calculated.
It reduces the operation complexity of image acquisition, expands the applicability of the measurement scene, and improves the reliability of the measurement.
Smart Images

Figure CN113409438B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a digital photogrammetry method, electronic equipment and system. Background Art
[0002] The survey work for communication base stations, including but not limited to the measurement of indoor and outdoor equipment size, height, deployment spacing, etc., is an important prerequisite for the design of communication base station sites, equipment deployment, material delivery, risk detection, etc. Traditional survey methods are outdoor measurement and indoor hand-drawing. Traditional survey methods have problems such as large workload, poor reliability, and high risk. For this reason, operators and tower operators are more likely to use digital photogrammetry methods to complete the survey work for communication base stations.
[0003] Digital photogrammetry is the process of processing digital images or digitized images using computers, using computer vision to replace the human eye's stereoscopic measurement and recognition to automatically extract geometric and physical information.
[0004] Among them, the measurement scheme based on ground sequence images is often used. Surveyors can use mobile phones or cameras to take a large number of photos or videos containing control points, and then perform relevant data processing on these photos or videos. It should be noted that before taking photos or videos, surveyors need to follow strict distance and orientation relationships to lay out multiple targets representing control points. The target laying process is complicated and unreliable. In addition, laying out multiple targets also requires a certain amount of space, which is difficult to implement in some narrow spaces, sloping roofs and other scenarios.
[0005] It can be seen that there is an urgent need for a reliable digital photogrammetry method that is easy to operate and applicable to a wider range of measurement scenarios. Summary of the invention
[0006] The present application provides a digital photogrammetry method, electronic device, and system, which can reduce the operational complexity of image acquisition, expand the applicable scenarios of digital photogrammetry, and increase the reliability of measurement.
[0007] In order to achieve the above objectives, the embodiments of the present application provide the following technical solutions:
[0008] In a first aspect, a method provided by the present application includes: acquiring a first image and a second image, both of which include a target object and a first object of known actual size; wherein the first image and the second image are shot at different positions and in different directions; constructing a digital three-dimensional space based on the first image and the second image; determining the distance between two endpoints of the target object based on the digital three-dimensional space and a size scaling ratio between the digital three-dimensional space and the real three-dimensional space, wherein the scaling ratio is related to the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object.
[0009] The digital three-dimensional space is presented in the form of a three-dimensional point cloud. A three-dimensional point cloud refers to a collection of point data on the surface of an object in a three-dimensional space, which can reflect the surface contour of the object. The two endpoints of the target object refer to the two endpoints of the distance to be measured. It should be noted that the target object here can be one, and the distance between the two endpoints of the target object can be the height, length, width, etc. of the target object. There can also be two target objects, and the distance between the two endpoints of the target object can be the distance between the two target objects, etc.
[0010] Compared with the prior art, where surveyors need to follow strict distance and orientation relationships in advance to lay out targets of multiple control points, and take a large number of photos or videos containing targets, the operation of taking images twice at different shooting positions and in different shooting directions in the embodiment of the present application is more convenient. Moreover, in the embodiment of the present application, the actual size of the first object is used to determine the size scaling ratio of the digital three-dimensional space, which is conducive to improving the reliability of the measurement. Furthermore, since it is also possible to take images at different shooting positions and in different shooting directions in scenes such as small machine rooms and sloping roofs, the measurement method provided in the embodiment of the present application can be applied to a wider range of measurement scenarios.
[0011] In a possible implementation, the method further includes: determining the direction of the sky in the digital three-dimensional space based on the ground in the digital three-dimensional space and the photographic center of the first image, or based on the ground in the digital three-dimensional space and the photographic center of the second image; wherein the ground in the digital three-dimensional space is the plane with the densest distribution of discrete points in the digital three-dimensional space; determining the height of the target object based on the digital three-dimensional space, the scaling ratio, the ground in the digital three-dimensional space, and the direction of the sky.
[0012] Among them, the plane with the densest distribution of three-dimensional discrete points is the plane with the largest number of point data in the unit space.
[0013] The above-mentioned height measurement implementation method makes the embodiment of the present application applicable to more measurement scenarios. For example, in some scenarios where the target object is relatively high or the bottom of the target object is blocked, the height of the target object can be calculated by the top captured. In addition, in the scheme provided in the embodiment of the present application, the height of the target object can be measured by simply marking the position of the top in the first image and the second image, without marking the position of the bottom, which simplifies the operation of the measurement personnel.
[0014] In a possible implementation, before determining the distance between the two endpoints of the target object based on the digital three-dimensional space and the scaling ratio of the size thereof to the real three-dimensional space, the method further includes: acquiring the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object; calculating the size S2 of the first object in the digital three-dimensional space based on the position of the first object in the first image and the position of the first object in the second image; and calculating the scaling ratio of the size of the digital three-dimensional space to the real three-dimensional space based on the actual size S1 of the first object and the size S2 of the first object in the digital three-dimensional space.
[0015] The position of the first object in the first image may be the coordinates of the image point of the first object in the first image. Similarly, the position of the first object in the second image may be the coordinates of the image point of the first object in the second image.
[0016] Therefore, a method for calculating a scaling ratio based on the actual size S1 of a first object of known size and the size S2 of the first object in a digital three-dimensional space is provided. Since the actual size of the first object is accurate data, it is beneficial to improve the accuracy of the calculated scaling ratio and enhance the reliability of the measurement.
[0017] In one possible implementation, obtaining the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object includes: receiving the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object as input; or identifying the position of the first object in the first image, the position of the first object in the second image, and finding the actual size S1 of the first object.
[0018] Thus, a method is provided in which a measurement person can manually mark the positions of the two endpoints of the first object and input the actual size of the first object, and a method is also provided in which a server automatically identifies the positions of the two endpoints of the first object and finds the actual size of the first object, thus enriching the ways of obtaining the positions of the two endpoints of the first object and the actual size of the first object.
[0019] In a possible implementation, the first object is a benchmark for segmented design, and the first object at least includes a first black segment, a first white segment, a first color segment, a second white segment, a second color segment, a third white segment, and a second black segment arranged in sequence; wherein the color of the first color segment and the color of the second color segment are a pair of complementary colors; the actual size S1 of the first object is the length between two endpoints of the first object, one endpoint of the first object is located at the junction of the first black segment and the first white segment, and the other endpoint of the first object is located at the junction of the third white segment and the second black segment; the position of the first object in the first image is the positions of the two endpoints of the first object in the first image; the position of the first object in the second image is the positions of the two endpoints of the first object in the second image.
[0020] Thus, a specially designed benchmark is provided, which can be used as the first object, so that the server can automatically identify the two endpoints of the first object, thereby simplifying the operation of the measurement personnel.
[0021] In a possible implementation, identifying the position of the first object in the first image and the position of the first object in the second image includes: identifying the first color segment and the second color segment in the first image, and the first area with straight line features in the first image; identifying the first color segment and the second color segment in the second image, and the second area with straight line features in the second image; automatically determining the positions of the two endpoints of the first object in the first image according to the positional relationship between the first color segment and the second color segment in the first image, the first area with straight line features in the first image, and each color segment in the first object; and automatically determining the positions of the two endpoints of the first object in the first image according to the positional relationship between the first color segment and the second color segment in the second image, the second area with straight line features in the second image, and each color segment in the first object. Thus, a method for identifying the two endpoints of a benchmark is provided.
[0022] In a specific implementation, a filter may be used to determine the region with straight line features from the first image and the second image, wherein the filter may be the real part of a two-dimensional Gabor function.
[0023] In a possible implementation, the first color segment is a red segment, and the second color segment is a cyan segment; or, the first color segment is a magenta segment, and the second color segment is a green segment.
[0024] It should be noted that, when the shooting light is insufficient, blue and black are not easily distinguished in the captured image. When the shooting light is too bright, yellow and white are not easily distinguished. Therefore, the first color segment and the second color segment are not blue or yellow.
[0025] In a possible implementation, the scaling ratio of the size of the digital three-dimensional space to the size of the real three-dimensional space is calculated based on the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object, including: calculating the size S2 of the first object in the digital three-dimensional space based on the position of the first object in the first image and the position of the first object in the second image; calculating the scaling ratio of the size of the digital three-dimensional space to the size of the real three-dimensional space based on the actual size S1 of the first object and the size S2 of the first object in the digital three-dimensional space. Thus, a method for specifically calculating the scaling ratio of the size of the digital three-dimensional space to the size of the real three-dimensional space is provided.
[0026] In one possible implementation, the distance between the two endpoints of the target object is determined based on the digital three-dimensional space and the scaling ratio of the digital three-dimensional space to the real three-dimensional space, including: determining the distance between the two endpoints of the target object based on the digital three-dimensional space, the scaling ratio, the positions of the two endpoints of the target object in the first image, and the positions of the two endpoints of the target object in the second image.
[0027] In one possible implementation, the height of the target object is determined based on the digital three-dimensional space, the scaling ratio, the ground of the digital three-dimensional space, and the sky direction of the digital three-dimensional space, including: determining the height of the target object based on the digital three-dimensional space, the scaling ratio, the ground of the digital three-dimensional space, the sky direction of the digital three-dimensional space, the position of the top of the target object in the first image, and the position of the top of the target object in the second image.
[0028] In a second aspect, a measuring device is provided, comprising: an acquisition unit, used to acquire a first image and a second image, both of which include a target object and a first object of known actual size; wherein the first image and the second image are shot at different positions and in different directions; a construction unit, used to construct a digital three-dimensional space based on the first image and the second image; a determination unit, used to determine the distance between two end points of the target object based on the digital three-dimensional space and a scaling ratio between the digital three-dimensional space and the real three-dimensional space, wherein the scaling ratio is related to the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object.
[0029] In a possible implementation, the determination unit is further used to: determine the direction of the sky in the digital three-dimensional space based on the ground in the digital three-dimensional space and the photographic center of the first image, or based on the ground in the digital three-dimensional space and the photographic center of the second image; wherein the ground in the digital three-dimensional space is the plane with the densest distribution of discrete points in the digital three-dimensional space; determine the height of the target object based on the digital three-dimensional space, the scaling ratio, the ground in the digital three-dimensional space, and the direction of the sky in the digital three-dimensional space.
[0030] In a possible implementation, before the determination unit determines the distance between the two endpoints of the target object based on the digital three-dimensional space and the scaling ratio of the sizes of the digital three-dimensional space and the real three-dimensional space, the acquisition unit is further used to acquire the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object; the determination unit is further used to calculate the size S2 of the first object in the digital three-dimensional space based on the position of the first object in the first image and the position of the first object in the second image; and calculate the scaling ratio of the sizes of the digital three-dimensional space and the real three-dimensional space based on the actual size S1 of the first object and the size S2 of the first object in the digital three-dimensional space.
[0031] In one possible implementation, in the process of the acquisition unit acquiring the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object, the acquisition unit is specifically used to: receive the input position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object; or, identify the position of the first object in the first image, the position of the first object in the second image, and find the actual size S1 of the first object.
[0032] In a possible implementation, the first object is a benchmark for segmented design, and the first object at least includes a first black segment, a first white segment, a first color segment, a second white segment, a second color segment, a third white segment, and a second black segment arranged in sequence; wherein the color of the first color segment and the color of the second color segment are a pair of complementary colors; the actual size S1 of the first object is the length between two endpoints of the first object, one endpoint of the first object is located at the junction of the first black segment and the first white segment, and the other endpoint of the first object is located at the junction of the third white segment and the second black segment; the position of the first object in the first image is the positions of the two endpoints of the first object in the first image; the position of the first object in the second image is the positions of the two endpoints of the first object in the second image.
[0033] In a possible implementation, in the process of the acquisition unit identifying the position of the first object in the first image and the position of the first object in the second image, the acquisition unit is further specifically used to: identify the first color segment and the second color segment in the first image, and the first area with straight line features in the first image; identify the first color segment and the second color segment in the second image, and the second area with straight line features in the second image; automatically determine the positions of two endpoints of the first object in the first image based on the positional relationship between the first color segment and the second color segment in the first image, the first area in the first image, and each color segment in the first object; and automatically determine the positions of the two endpoints of the first object in the first image based on the positional relationship between the first color segment and the second color segment in the second image, the second area in the second image, and each color segment in the first object.
[0034] In a possible implementation, the first color segment is a red segment, and the second color segment is a cyan segment; or, the first color segment is a magenta segment, and the second color segment is a green segment.
[0035] In a possible implementation, in the process of calculating the scaling ratio of the size of the digital three-dimensional space to the real three-dimensional space according to the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object, the determination unit is specifically used to: calculate the size S2 of the first object in the digital three-dimensional space according to the position of the first object in the first image and the position of the first object in the second image; calculate the scaling ratio of the size of the digital three-dimensional space to the real three-dimensional space according to the actual size S1 of the first object and the size S2 of the first object in the digital three-dimensional space.
[0036] In one possible implementation, in the process of determining the distance between the two endpoints of the target object based on the digital three-dimensional space and the scaling ratio of the sizes of the digital three-dimensional space and the real three-dimensional space, the determination unit is specifically used to: determine the distance between the two endpoints of the target object based on the digital three-dimensional space, the scaling ratio, the positions of the two endpoints of the target object in the first image, and the positions of the two endpoints of the target object in the second image.
[0037] In one example, the positions of the two endpoints of the target object in the first image and the two endpoints of the target object in the second image manually marked by the surveyor can be received, and then the distance between the two endpoints of the target object can be calculated based on these position information, the digital three-dimensional space, and the scaling ratio.
[0038] It should be noted that the target object here can be one, and the distance between the two endpoints of the target object can be the height, length, width, etc. of the target object. There can also be two target objects, and the distance between the two endpoints of the target object can be the distance between the two target objects, etc. For example, the measurement method can be used in digital survey of telecommunication base stations to obtain information such as equipment size, cable length, installation spacing, etc. It can also be used in other engineering measurements or daily life, such as measuring the distance between buildings, etc.
[0039] In a possible implementation, in the process of a determination unit determining the height of a target object based on the digital three-dimensional space, a scaling ratio, the ground of the digital three-dimensional space, and the sky direction of the digital three-dimensional space, the determination unit is specifically used to determine the height of the target object based on the digital three-dimensional space, the scaling ratio, the ground of the digital three-dimensional space, the sky direction of the digital three-dimensional space, the position of the top of the target object in the first image, and the position of the top of the target object in the second image.
[0040] In one example, the position of the top of the target object in the first image and the position of the top of the target object in the second image manually marked by the surveyor can be received, and then the height of the target object can be calculated based on these position information, the digital three-dimensional space, and the ground and sky directions of the digital three-dimensional space. The measurement method provided in the embodiment of the present application can be applied to the digital survey scene of telecommunication base stations to obtain the height of long-distance high towers and various equipment on the towers. It can also be applied to other engineering measurements or daily life, such as measuring the height of buildings.
[0041] In the third aspect, a server is provided, comprising one or more processors, one or more memories and one or more communication interfaces, wherein the one or more memories and the one or more communication interfaces are coupled to the one or more processors, and the one or more memories are used to store computer program codes, wherein the computer program codes include computer instructions, and when the one or more processors read the computer instructions from the one or more memories, the server executes the method described in the above aspect and any possible implementation thereof.
[0042] In a fourth aspect, a chip system is provided, comprising a processor. When the processor executes an instruction, the processor executes the method described in the above aspects and any possible implementation thereof.
[0043] In a fifth aspect, a computer storage medium is provided, comprising computer instructions. When the computer instructions are executed on a server, the server executes the method described in the above aspects and any possible implementation thereof.
[0044] In a sixth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is enabled to execute the method as described in the above aspects and any possible implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic diagram of the structure of a communication system provided in an embodiment of the present application;
[0046] Figure 2A A schematic diagram of an image acquisition method provided in an embodiment of the present application;
[0047] Figure 2B A schematic diagram of another image acquisition method provided in an embodiment of the present application;
[0048] Figure 2C A schematic diagram of another image acquisition method provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0051] Figure 5A A schematic diagram of a flow chart of a digital photogrammetry method provided in an embodiment of the present application;
[0052] Figure 5B A schematic diagram of a method for calculating the distance between two endpoints of a target object provided in an embodiment of the present application;
[0053] 6A to 6H Schematic diagram of user interfaces of some electronic devices provided in embodiments of the present application;
[0054] Fig. 7A A schematic diagram of a flow chart of another digital photogrammetry method provided in an embodiment of the present application;
[0055] Figure 7B A schematic diagram of a method for calculating the height of a target object provided in an embodiment of the present application;
[0056] Figure 8 A schematic diagram of a benchmark provided in an embodiment of the present application;
[0057] Fig. 9 A schematic diagram of a hue circle provided for an embodiment of the application;
[0058] Fig.10 A schematic diagram of another benchmark provided in an embodiment of the present application;
[0059] FIG. 11A to FIG. 11D A schematic diagram of a method for identifying a benchmark provided in an embodiment of the present application;
[0060] Fig.12 A schematic diagram of the structure of a chip system provided in an embodiment of the present application;
[0061] Fig.13 A schematic diagram of the structure of a device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. The “and / or” in this article is merely a way to describe the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0063] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0064] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more. In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0065] like Figure 1 As shown, a communication system provided in an embodiment of the present application is provided. The communication system includes a first electronic device 100, a server 200, and a second electronic device 300. In some examples, the second electronic device 300 and the first electronic device 100 can be the same device. In other examples, the first electronic device 100, the server 200, and the second electronic device 300 can be the same device. In other words, all steps in the embodiment of the present application are completed by one device, such as a terminal.
[0066] The first electronic device 100 is a device with a camera, which can be used to capture an image of the target to be measured. For example, the first electronic device 100 can be a mobile phone, a tablet computer, a camera, a wearable electronic device, etc. The present application does not impose any special restrictions on the specific form of the first electronic device 100.
[0067] Specifically, the surveyor can use the first electronic device 100 to shoot the first image and the second image at different shooting positions and in different shooting directions, wherein both the first image and the second image include the target object. The above-mentioned shooting position can be understood as the position in the light (or photography center) of the camera of the first electronic device 100 when shooting the image. Shooting the first image and the second image in different shooting directions means taking the photographed object (such as the target object) as the center, selecting different photography points around the target object to shoot the first image and the second image, and the photography points of the two times are not on the same straight line with the target object. Under the condition that the shooting distance and the shooting height remain unchanged, different shooting directions can show different side images of the target object. Alternatively, shooting the first image and the second image in different shooting directions can also be understood as that the Q point on the target object forms an angle with the line connecting the photography centers of the two images, and the angle is not zero and is not 180 degrees. Among them, the Q point on the target object can be any point on the target object, for example, it can be any one of the two endpoints of the target object, it can be the vertex of the target object, etc.
[0068] It should be noted that the first image and the second image taken at different shooting positions and in different shooting directions can form a stereo image pair, so as to subsequently form a digital three-dimensional space and calculate the distance between the two endpoints of the target object and the height of the target object based on the principle of triangulation.
[0069] For example, Figure 2A As shown, the measurement personnel can carry the first electronic device 100 to capture the first image of the target 21 to be measured at a certain position. When capturing the first image, the camera of the first electronic device 100 is located at the first position P1. Then, the measurement personnel moves their own position and captures the second image at another position. When capturing the second image, the camera of the first electronic device 100 is located at the second position P2. Among them, the vertex Q1 point on the target object forms an angle α1 with the lines connecting the points P1 and P2 respectively. Among them, the angle α1 is not zero and is not 180 degrees. Figure 2A The measurement method shown can be used in outdoor measurement scenarios. For example, the measurement personnel can face the target object (such as a house, a tower, etc.), move left and right, and take two photos. The two shooting positions are several meters to tens of meters apart, and the distant target object can be measured.
[0070] For example, Figure 2BAs shown, the surveyor can lift the first electronic device 100 over the head to capture the first image of the target object 22. When the first electronic device 100 is used to capture the first image, the camera of the first electronic device 100 is located at the first position P3. Then, the surveyor places the first electronic device 100 at the waist to capture the second image of the target object. When the first electronic device 100 is used to capture the second image, the camera of the first electronic device 100 is located at the second position P4. Among them, the vertex Q2 on the target object forms an angle α2 with the lines connecting the points P1 and P2. Among them, the angle α2 is not zero and is not 180 degrees. Figure 2B The method shown is applicable to measurement in a small space, such as a small machine room, etc. The distance between two shooting points is about 0.4 to 1 meter, and the target object within 10 meters can be measured.
[0071] For example, Figure 2C As shown, the measurement personnel can stretch their arms to one side of the body to capture the first image of the target object 22. When the first electronic device 100 is used to capture the first image, the camera of the first electronic device 100 is located at the first position P5. Then, the measurement personnel stretch their arms to the other side of the body to capture the second image of the target object. When the first electronic device 100 is used to capture the second image, the camera of the first electronic device 100 is located at the second position P6. The vertex Q3 on the target object forms an angle α3 with the lines connecting the points P1 and P2. The angle α3 is not zero and is not 180 degrees. Figure 2C The method shown is applicable to scenarios where it is inconvenient for the surveyor to move, such as on a tower or roof. Then, the surveyor can spread his arms to the left and right respectively to take two photos, with the distance between the two shooting points being about 1 to 2.5 meters, and can measure target objects within 20 to 50 meters.
[0072] In some examples, the first electronic device 100 may also receive information of a first object of known size input by a measurement person, such as information of two endpoints of the first object in the first image and the second image, and the actual size of the first object, wherein both the first image and the second image include the first object.
[0073] Then, the first electronic device 100 sends the captured first image and the second image to the server 200. The server 200 constructs a digital three-dimensional space according to the first image and the second image. It should be noted that the size of each object in the digital three-dimensional space is in the same ratio as the size of each object in the real three-dimensional world, the relative position relationship between each object in the digital three-dimensional space is in the same ratio as the relative position relationship between each object in the real three-dimensional world, and the distance between each object in the digital three-dimensional space is in the same ratio as the distance between each object in the real three-dimensional world.
[0074] The server 200 can identify the information of the first object of known size in the first image and the second image, or receive the information of the first object of known size from the first electronic device 100. The server 200 can obtain the scale scaling ratio of the digital three-dimensional space and the real three-dimensional world based on the actual size of the first object and the size of the first object in the digital three-dimensional space. Thus, the server 200 can calculate the distance between the two endpoints of the target object based on the scale scaling ratio and the digital three-dimensional space. In one implementation, the server 200 can receive the two endpoint information of the target object sent by the second electronic device 300, and the server 200 can calculate the distance between the two endpoints based on the two endpoint information of the target object and the scale scaling ratio. In another implementation, the server 200 can send the digital three-dimensional space and the scale scaling ratio to the second electronic device 300. The second electronic device 200 can then calculate the distance between the two endpoints of the target object based on the two endpoint information of the target object input by the measurement personnel.
[0075] The second electronic device 300 is a device with a display screen and an input device, which can display the first image and the second image, and receive the target object information input by the measurement personnel according to the first image and the second image. For example, the second electronic device 300 can be a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a netbook, etc., and the present application does not impose any special restrictions on the specific form of the second electronic device 300. In some examples, the second electronic device 300 can be the same device as the first electronic device 100.
[0076] In other embodiments of the present application, the server 200 can also determine that the plane with the most dense distribution of three-dimensional discrete points in the digital three-dimensional space is the ground, and then determine the height of the ground and the direction of the sky. Thus, the server 200 can calculate the height of the target object according to the scale scaling ratio, the digital three-dimensional space, the ground height and the direction of the sky, that is, the distance between the top of the target object and the ground. In one implementation, the server 200 can receive the top information of the target object sent by the second electronic device 300. The server 200 can calculate the height of the target object according to the top information of the target object, the digital three-dimensional space, the ground height and the direction of the sky. In another implementation, the server 200 can send the digital three-dimensional space and related parameters (scale scaling ratio, ground height and sky direction) to the second electronic device 300. The second electronic device 200 can calculate the height of the target object according to the top information of the target object input by the surveyor and the digital three-dimensional space.
[0077] In summary, in the measurement method provided by the embodiment of the present application, the surveyor can use the first electronic device 100 to shoot the first image and the second image in different shooting directions at two different shooting positions. Then, a digital three-dimensional space is constructed based on the first image and the second image. Then, according to the actual size of the object of known size in the first image and the second image, the scale scaling ratio of the digital three-dimensional space and the real three-dimensional world is obtained. Then, the distance between the two endpoints of the target object in the first image and the second image is calculated according to the scale scaling ratio and the digital three-dimensional space. The ground in the digital three-dimensional space can also be identified, and the plane with the most dense distribution of three-dimensional discrete points is the ground, so that the height of the target object in the first image and the second image can be calculated. Compared with the prior art, the surveyor needs to set the target of multiple control points in advance according to the strict distance relationship and orientation relationship, and take a large number of photos or videos containing the target. The embodiment of the present application is convenient to operate and has high reliability in shooting images at different shooting positions and in different shooting directions. In addition, the actual size of the first object is used in the embodiment of the present application to determine the scaling ratio of the size of the digital three-dimensional space, which is also conducive to improving the reliability of the measurement. Furthermore, since images can be captured at different shooting positions and in different shooting directions in scenes such as a small machine room and a sloping roof, the measurement method provided in the embodiment of the present application can be applicable to a wider range of measurement scenes.
[0078] See also Figure 3 , Figure 3 A schematic structural diagram of the first electronic device 100 is shown.
[0079] The first electronic device 100 may include a processor 110, an internal memory 121, a universal serial bus (USB) interface 130, a camera 150, and a display screen 160. Optionally, the first electronic device 100 may also include one or more of an external memory interface 120, a charging management module 140, a power management module 141, and a battery 142.
[0080] The processor 110 may include one or more processing units, for example, the processor 110 may include one or more of an application processor (AP), a graphics processing unit (GPU), an image signal processor (ISP), a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, a general-purpose input / output (GPIO) interface, and / or a universal serial bus (USB) interface, etc. The processor 110 communicates with other devices (such as an internal memory 121, a camera 150, a display screen 160, etc.) through the one or more interfaces.
[0081] The USB interface 130 is an interface that complies with USB standard specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the first electronic device 100, and may also be used to transmit data between the first electronic device 100 and a peripheral device.
[0082] In the embodiment of the present application, the first electronic device 100 can send the captured first image and the second image to the server 200 through the USB interface 130, and send the positions of the two endpoints or the top of the target object in the first image marked by the user, and the positions of the two endpoints or the top of the target object in the second image to the server 200. In some other examples, the first electronic device 100 can also send the positions of the two endpoints of the first object of known size in the first image marked by the user, the positions of the two endpoints of the first object of known size in the second image, and the actual size of the first object to the server 200 through the one or more interfaces.
[0083] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the first electronic device 100. In other embodiments of the present application, the first electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0084] The first electronic device 100 implements a display function through a GPU, a display screen 160, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 160 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0085] The first electronic device 100 can realize a shooting function through an ISP, a camera 150 , a GPU, a display screen 160 , and an application processor.
[0086] The ISP is used to process the data fed back by the camera 150. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 150.
[0087] The camera 150 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the first electronic device 100 may include 1 or N cameras 150, where N is a positive integer greater than 1.
[0088] In the embodiment of the present application, the first electronic device 100 can be used to call the camera 150 to capture the first image and the second image containing the target object at different shooting positions and in different shooting directions. The different shooting positions are the optical centers of the camera 150.
[0089] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the first electronic device 100. The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The charging management module 140 is used to receive charging input from the charger. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 160, the camera 150, and the wireless communication module.
[0090] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the first electronic device 100. In other embodiments of the present application, the first electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0091] See also Figure 4 , Figure 4 The schematic diagram of the structure of a server 200 is shown. The server 200 includes one or more processors 210, one or more external memories 220, and one or more communication interfaces 230. Optionally, the server 200 may further include an input device 240 and an output device 250.
[0092] The processor 210, the external memory 220, the communication interface 230, the input device 240 and the output device 250 are connected via a bus. The processor 210 may include a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), a graphics processing unit (GPU), a neural-network processing unit (NPU), or an integrated circuit for controlling the execution of the program of the present application.
[0093] Generally, the processor may be provided with an internal memory, which may be used to store computer executable program codes, which include instructions. The internal memory may include a storage program area and a storage data area. Among them, the storage program area may store an operating system and an algorithm model required to be used in the embodiment of the present application, such as an algorithm model for identifying a first object, an algorithm for constructing a digital three-dimensional space according to a first image and a second image, an algorithm for solving a digital three-dimensional scale scaling ratio according to the actual size of the first object, and an algorithm for identifying a plane with the most dense distribution of three-dimensional discrete points in a digital three-dimensional space. The storage data area may store data created during the use of the server 200 (a three-dimensional discrete point cloud of a digital three-dimensional space, the actual size of the first object, parameters of a ground position of a digital three-dimensional space, parameters of a sky direction of a digital three-dimensional space, etc.). In addition, the internal memory 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, a universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the server 200 by running instructions stored in the internal memory. In one example, the processor 210 may also include multiple CPUs, and the processor 210 may be a single-CPU processor or a multi-CPU processor. The processor here may refer to one or more devices, circuits, or processing cores for processing data (such as computer program instructions).
[0094] The communication interface 230 may be used to communicate with other devices or communication networks, such as Ethernet, wireless local area networks (WLAN), etc.
[0095] The output device 250 communicates with the processor 210 and can display information in a variety of ways. For example, the output device can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector.
[0096] The input device 240 communicates with the processor 210 and can receive user input in a variety of ways. For example, the input device can be a mouse, a keyboard, a touch screen device, or a sensor device.
[0097] It should be noted that the structure of the second electronic device 300 can refer to Figure 3In the structural description of the first electronic device 100, it can be understood that the second electronic device 300 may include more or fewer components than the first electronic device 100, or combine some components, or split some components, or arrange the components differently. This embodiment of the application is not limited to this. In some examples, the second electronic device 300 can be the same device as the first electronic device 100.
[0098] In order to facilitate understanding of the technical solutions provided by the embodiments of the present application, the technical terms involved in the embodiments of the present application are first explained.
[0099] Free network adjustment: Adjustment refers to the reasonable allocation of accidental errors of observations, pre-correction of systematic errors of observations, and control of gross errors of observations by adopting certain observation principles and manual error detection methods. In general adjustment algorithms, the control network is fixed on the known data based on known starting data. When there is no necessary starting data in the network, we call it a free network, and the adjustment method without starting data is called free network adjustment.
[0100] Space resection: A method of calculating the elements of exterior orientation of an image using collinear equations using three or more control points (or connection points) that are not in a straight line.
[0101] Space intersection: A method of determining the object space coordinates (coordinates in a provisional three-dimensional coordinate system or coordinates in a ground measurement coordinate system) of a point by using the interior and exterior orientation elements of the left and right images of a stereo pair and the image coordinate measurement values of the image points with the same name.
[0102] Shooting position: The shooting position in this article can be understood as the position in the light (or the center of photography) of the camera of the first electronic device 100 when shooting an image.
[0103] Shooting direction: In this article, shooting the first image and the second image in different shooting directions means that the first image and the second image are shot at different shooting points around the target object with the subject (e.g., target object) as the center, and the two shooting points are not on the same straight line with the target object. Under the condition that the shooting distance and shooting height remain unchanged, different shooting directions can show different side images of the target object. Alternatively, shooting the first image and the second image in different shooting directions can also be understood as that the Q point on the target object forms an angle with the line connecting the photographic centers of the two images, and the angle is not zero and not 180 degrees. Among them, the Q point on the target object can be any point on the target object, for example, it can be any one of the two endpoints of the target object, it can be the vertex of the target object, etc.
[0104] The technical solutions involved in the following embodiments can be Figure 1 The technical solution provided in the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.
[0105] like Figure 5A FIG. 1 is a flowchart of a digital photogrammetry method provided in an embodiment of the present application, which is specifically as follows:
[0106] S501: Acquire a first image and a second image, wherein both the first image and the second image include a target object, wherein the first image and the second image are shot at different positions and in different directions.
[0107] In some embodiments, the surveyor may carry the first electronic device 100 and shoot the first image and the second image of the target object at different shooting positions and in different shooting directions. The meaning of the shooting position and the shooting direction can be found in the above description and will not be repeated here. Then, the first image and the second image shot are sent to the server 200 through the first electronic device 100, and the server 200 performs subsequent data processing.
[0108] The first electronic device 100 may be a portable device or a device commonly used by measurement personnel, such as a mobile phone, a tablet computer, a camera, a wearable device with a camera, or a device connected to a camera, etc. In this way, the use of dedicated measurement equipment is avoided during the measurement process, which is conducive to reducing the cost of measurement and is convenient for measurement personnel to carry.
[0109] An exemplary description is given by taking a mobile phone as the first electronic device 100 as an example.
[0110] The surveyor can open the surveying application in the mobile phone and call the camera to take pictures. During the photo-taking process, the mobile phone can display some guidance information to prompt the surveyor to take the first image and the second image in two different shooting positions and different shooting directions. For example, Fig. 6A The prompt message 601 shown, Figure 6B The prompt information 602 shown, Figure 6C The prompt information 603 and Fig.6D The prompt information 604 is shown. Then, the mobile phone can upload the first image and the second image taken to the server 200 for processing.
[0111] Furthermore, in one example, if the angles formed between the Q point on the target object and the lines connecting the photographic centers of the two images are controlled within a range greater than 5 degrees and less than 60 degrees, the measurement error can be reduced to 2% and below. In another example, it is assumed that the distance between the photographic center P1 of the first image and any point Q on the target object is D. The Q point on the target object can be any point on the target object, such as any one of the two endpoints of the target object, or the vertex of the target object. If the distance between the photographic centers P2 and P1 of the second image is controlled within a range greater than D / 20 and less than D, the measurement error can be reduced to 2% and below.
[0112] S502: Construct a digital three-dimensional space according to the first image and the second image.
[0113] In some embodiments of the present application, the server 200 may first identify the rigid body and the unchanging feature area in the first image and the second image as the valid area, or identify the non-rigid body and the changeable object in the first image and the second image as the invalid area. Subsequently, the relevant data processing process is performed on the valid area in the first image and the second image. In this way, on the one hand, since the area of the changeable object in the first image and the second image is excluded, it is beneficial to improve the accuracy of the subsequent feature point matching. On the other hand, the area of the changeable object in the first image and the second image is excluded, and only the valid area in the first image and the second image is processed subsequently, which greatly reduces the amount of data for subsequent processing and helps to improve data processing efficiency.
[0114] In some examples of this embodiment, the sky, water surface, pedestrians, vehicles, etc. in the image can be considered as changeable objects. Therefore, the server 200 can use a semantic segmentation method to perform full-factor classification on the received first image and the second image respectively, and identify the changeable objects in the first image and the second image, that is, the invalid area. Then, the server 200 can add a gray mask to the invalid area in the first image and the second image to cover the invalid area in the first image and the second image.
[0115] Among them, the semantic segmentation method includes but is not limited to using the open source deep learning training model DeepLab-v3, etc., and the embodiments of the present application are not limited to this.
[0116] Optionally, the server 200 may also perform color equalization on the images of the identified unchanged feature areas (i.e., effective areas) in the first image and the second image. In specific implementation, algorithms such as histogram stretching, histogram regularization, and Kama transformation may be used to perform color equalization on the effective areas in the first image and the second image.
[0117] The histogram stretching method is used as an example for explanation. In one example, the server 200 respectively counts the grayscale histogram for the image in the effective area of the first image. Among them, the grayscale histogram is to count the frequency of occurrence of all pixels of the image according to the size of the grayscale value. Then, the server 200 discards a part of the pixels with larger grayscale values (for example, the number of discarded pixels accounts for 0.5% of the total number of pixels in the effective area image) and / or discards a part of the pixels with smaller grayscale values (for example, the number of discarded pixels accounts for 0.5% of the total number of pixels in the effective area) according to the grayscale histogram of the image in the effective area of the first image, and obtains the truncation threshold. A linear transformation formula is constructed according to the truncation threshold, and the grayscale histogram is stretched to achieve color equalization of the image in the effective area of the first image. Using a similar method, the server 200 can perform color equalization on the image in the effective area of the second image.
[0118] It should be noted that color balancing of the effective areas in the first image and the second image is helpful in reducing the impact of environmental factors during shooting (for example, weather conditions, light conditions, etc.) and factors such as the specifications of the camera used for shooting, thereby improving the accuracy of subsequent feature point matching and dense matching.
[0119] Furthermore, the server 200 performs feature point matching, free network adjustment and dense matching on the image of the area of the feature in the first image to obtain a digital three-dimensional space.
[0120] Among them, feature point matching includes feature extraction, feature description and feature matching. Specifically, the server 200 extracts feature points from the effective area image of the first image after the above processing and the effective area image of the second image, and then describes each feature point respectively. Compare the similarity between each feature point in the effective area image of the first image and each feature point in the effective area image of the second image. Determine whether the feature points with a similarity higher than the threshold A are the same feature points (i.e., feature points with the same name), and the feature matching is completed. It can be understood that the server 200 can use any technology known in the relevant technical field to match the feature points in the first image and the second image, and the embodiment of the present application does not make specific limitations on this. For example, the server 200 can use feature description operators such as scale-invariant feature transform (SIFT) and speeded up robust features (SURF) for feature description. For another example, the server 200 can use the least squares method for feature matching.
[0121] The feature points with the same name determined in the effective area image of the first image and the effective area of the second image constitute the connection points of the two images, and the server 200 performs gross error elimination and adjustment assignment based on these connection points, that is, free network adjustment. Then, spatial rear interaction calculation is performed according to the connection points after free network adjustment to obtain the relative external orientation elements of the two images. Based on the relative external orientation elements of the two images, the nuclear line image is constructed, and dense matching is performed, that is, a pixel-by-pixel spatial front intersection calculation is performed to obtain a three-dimensional dense point cloud (point clouds) to form a digital three-dimensional space. Among them, a three-dimensional point cloud refers to a collection of point data on the surface of an object in a three-dimensional space, which can be used to reflect the surface contour of the object. The number of points obtained by this method is large and dense, that is, a dense point cloud.
[0122] It should be noted that the digital three-dimensional space obtained by performing free network adjustment and dense matching based on the first image and the second image in the embodiment of the present application is inconsistent with the position, size and direction of the real three-dimensional world. However, the size of each object in the digital three-dimensional space is in the same ratio as the actual size of each object in the real three-dimensional world; the distance between each object in the digital three-dimensional space is in the same ratio as the distance between each object in the real three-dimensional world.
[0123] In other embodiments of the present application, the server 200 may also verify whether the first image and the second image taken by the surveyor meet the shooting requirements according to the matching of the feature points when the feature points are matched. If the first image and the second image do not meet the shooting requirements, the first electronic device 100 may display relevant prompt information or play relevant voice prompts to prompt the surveyor to retake the first image and the second image, or retake the second image.
[0124] For example, if it is detected that no feature points with the same name are extracted in the effective areas of the first image and the second image, or the number of feature points with the same name extracted is less than the threshold B (for example, 10 to 100), the server 200 may prompt the measurement personnel through the first electronic device 100, "Please retake the first image and the second image, and ensure that the two shots are aimed at the same target."
[0125] For another example, if it is detected that within the effective area of the first image and the second image, the position deviation of the image points of the same name extracted in the two images is generally less than the threshold C (for example, 5 to 20 pixels), the server 200 may prompt the measurement personnel through the first electronic device 100 to "please retake the first image and the second image, and make sure to take them at different positions."
[0126] The following formula can be used to calculate the image point position deviation ΔP of the same-name feature point (denoted as point P) on the first image and the second image:
[0127]
[0128] Among them, (Px1, Py1) is the pixel coordinate of point P in the first image; (Px2, Py2) is the pixel coordinate of point P in the second image.
[0129] S503, obtaining the actual size S1 of the first object and the position information of the first object in the first image and the second image; calculating the size S2 of the first object in the digital three-dimensional space according to the position information of the first object in the first image and the second image; wherein the first object is included in both the first image and the second image.
[0130] In some embodiments of the present application, the measurement personnel may also input information of objects of known size in the first image and the second image through the first electronic device 100, such as the positions of the two endpoints of the object of known size in the first image, the positions of the two endpoints of the object of known size in the second image, and the size of the first object in real space, that is, the real size S1 of the object. In a specific example, the measurement personnel may distinguish the first object of known size from the first image and the second image, mark the two endpoints of the first object in the first image and the second image respectively, and input the size of the first object through the first electronic device 100. In another specific example, the measurement personnel may also place the first object of known size within the viewfinder range of the camera when shooting the first image and the second image. That is, when shooting the first image and the second image, the first object is also captured in both the first image and the second image. After shooting the first image and the second image, the measurement personnel may mark the two endpoints of the first object in the first image and the second image respectively, and input the real size of the first object through the first electronic device 100.
[0131] Then, the first electronic device 100 sends the positions of the two endpoints of the first object in the first image (for example, the coordinates of the image points in the first image), the positions of the two endpoints of the first object in the second image (for example, the coordinates of the image points in the second image), and the real size S1 of the first object to the server 200. The server 200 can first calculate the coordinates of the two endpoints of the first object in the digital three-dimensional space according to the positions of the two endpoints of the first object in the first image and the positions of the two endpoints in the second image, and then calculate the distance between the two coordinates, which is the size S2 of the first object in the digital three-dimensional space.
[0132] Still taking a mobile phone as the first electronic device 100 as an example for illustrative description. The mobile phone can display the first image and the second image at the same time, or display the first image and the second image in sequence, so that the measurement personnel can mark the positions of the two endpoints of the first object of known size on the two images respectively (i.e., a total of four positions). In some examples, after the measurement personnel marks the position of an endpoint in one of the images, the mobile phone can also make auxiliary lines in the other image according to the position of the endpoint in the image and the geometric relationship of the stereo image pair to help the measurement personnel mark the position of the endpoint in the other image.
[0133] For example, since the display screen of a mobile phone is relatively small, the first image and the second image may be displayed in sequence. Fig. 6E and Fig. 6F As shown in FIG. 1 , the first image and the second image displayed by the mobile phone both include A4 paper of known length, which is 29.7 cm. Then, the measurement personnel can mark the two endpoints of the long side of the A4 paper in the first image and the second image respectively. Fig. 6E As shown in the figure, the surveyor can first mark the two endpoints E1 and F1 of the long side of the A4 paper in the first image. Of course, the first image can also be enlarged and the two endpoints E1 and F1 of the long side of the A4 paper can be marked to make the marking more accurate. Then, switching to the second image, the mobile phone can draw auxiliary lines in the second image based on the two endpoints E1 and F1 marked in the first image and the geometric relationship of the stereo pair. Fig. 6F As shown, the dotted line (1) is the auxiliary line corresponding to the endpoint E1, and the measurement personnel can mark the corresponding endpoint E2 in the second image based on the auxiliary line. The dotted line (2) is the auxiliary line corresponding to the endpoint F1, and the measurement personnel can mark the corresponding endpoint F2 in the second image based on the auxiliary line. Then, the mobile phone calculates the image point coordinates of E1 and F1 in the first image, and the image point coordinates of E2 and F2 in the second image. The mobile phone can also prompt the measurement personnel to input the value of the actual size S1 of the first object, and then the mobile phone sends the image point coordinates of E1, F1, E2 and F2, and the value of the actual size S1 to the server 200 for subsequent processing.
[0134] In some other embodiments of the present application, the server 200 may also identify two endpoints of a first object of known size in the first image and the second image, and an actual size S1 between the two endpoints of the first object. In some examples, a benchmark with a fixed length and an appearance that is easily recognized by the server 200 may be designed as the first object. When taking the first image and the second image, the surveyor places the benchmark within the framing range taken by the first electronic device 100, that is, the benchmark is included in both the first image and the second image taken.
[0135] The designed benchmark can be a rod-shaped object with multiple colors spaced apart. The server 200 can determine the position of the endpoints of the benchmark by automatically locking the specific color of the rod-shaped object in the first image and the second image. The actual size S1 between the two endpoints of the benchmark is known. The design of the benchmark and the method for identifying the two endpoints of the benchmark will be described in detail below and will not be described here.
[0136] In some other embodiments of the present application, the server 200 may also first identify the two endpoints of the first object of known size in the first image and the second image. If the recognition fails, the first electronic device 100 may prompt the measurement personnel to manually input relevant information of the first object of known size, such as the positions of the two endpoints of the first object in the first image, the positions of the two endpoints of the first object in the second image, and the actual size S1 of the first object. Alternatively, when the server 200 identifies the two endpoints of the first object of known size in the first image and the second image, the first electronic device 100 may also prompt the measurement personnel to check the information of the first object at the identification location to ensure the accuracy of the recognition result.
[0137] S504 : Calculate a scale ratio between the digital three-dimensional space and the real three-dimensional world according to the actual size S1 of the first object and the size S2 of the first object in the digital three-dimensional space.
[0138] In some embodiments of the present application, the server 200 obtains a scale scaling ratio of S1 / S2 between the digital three-dimensional space and the real space based on the size S2 of the first object in the digital three-dimensional space and the actual size S1 of the first object in the real three-dimensional world.
[0139] S505: Determine the distance between two endpoints of the target object according to the digital three-dimensional space, the scale scaling ratio, the first image, and the second image.
[0140] In one example, the server 200 may receive the positions of the two endpoints of the target object sent by the second electronic device 300, including the image point coordinates of the two endpoints of the target object in the first image and the image point coordinates of the two endpoints of the target object in the second image. A spatial forward intersection is performed according to the image point coordinates of the two endpoints of the target object to calculate the coordinates of the two endpoints of the target object in the digital three-dimensional space. Figure 5B As shown, point U (x3, y3, z3) and point V (x4, y4, z4) are the coordinates of the two endpoints of the target object in the digital three-dimensional space calculated by the server 200. The distance between point U and point V in the digital three-dimensional space can be calculated according to the coordinates of point U and point V in the digital three-dimensional space, and then the actual distance between the two endpoints can be calculated according to the distance between point U and point V in the digital three-dimensional space and the scale scaling ratio.
[0141] In another example, the server 200 may also send the calculated digital three-dimensional space and scale scaling ratio to the second electronic device 300. The second electronic device 300 receives the marks of the two endpoints of the target object input by the measurement personnel, and calculates the distance between the two endpoints of the target object according to the digital three-dimensional space and the scale scaling ratio.
[0142] Still taking a mobile phone as the second electronic device 300 as an example for illustrative description. The mobile phone can display the first image and the second image simultaneously, or display the first image and the second image in sequence, so that the measurement personnel can mark the positions of the two endpoints of the target object on the two images respectively (i.e., a total of four positions). The specific marking method is the same as the method of marking the two endpoints of the first object in step S503, and will not be repeated here. For example, Figure 6G As shown in FIG. 1 , the measurement personnel mark the two end points S1 and R1 of the target object in the first image. Figure 6H As shown, the measurement personnel mark the two endpoints S2 and R2 of the target object in the second image. Then, the second electronic device 300 sends the image point coordinates of S1, R1, S2 and R2 to the server 200, so that the server 200 can perform subsequent processing and measure the length of the display. In some examples, the second electronic device 300 can be the same device as the first electronic device 100.
[0143] It should be noted that the target object here can be one, and the distance between the two endpoints of the target object can be the height, length, width, etc. of the target object. There can also be two target objects, and the distance between the two endpoints of the target object can be the distance between the two target objects, etc. For example, the measurement method can be used in digital survey of telecommunication base stations to obtain information such as equipment size, cable length, installation spacing, etc. It can also be used in other engineering measurements or daily life, such as measuring the distance between buildings, etc.
[0144] In summary, in the measurement method provided by the embodiment of the present application, the surveyor can use the first electronic device 100 to shoot the first image and the second image in different shooting directions at two different shooting positions. Then, a digital three-dimensional space is constructed based on the first image and the second image. According to the actual size of the first object of known size in the first image and the second image, the scale scaling ratio of the digital three-dimensional space and the real three-dimensional world is obtained. Then, the distance between the two endpoints of the target object in the first image and the second image can be calculated according to the digital three-dimensional space and the scale scaling ratio. Compared with the prior art, the surveyor needs to set the targets of multiple control points in advance according to the strict distance relationship and orientation relationship, and take a large number of photos or videos including the targets. The embodiment of the present application is convenient to operate and has high reliability in shooting images at different shooting positions and in different shooting directions. In addition, the actual size of the first object is used in the embodiment of the present application to determine the scaling ratio of the size of the digital three-dimensional space, which is also conducive to improving the reliability of the measurement. In addition, since it can also be achieved in scenes such as small machine rooms and sloping roofs to shoot images at different shooting positions and in different shooting directions, the measurement method provided by the embodiment of the present application can be applied to a wider range of measurement scenarios.
[0145] Considering that in some scenes of measuring the height of the target object, the first electronic device 100 may not be able to capture images including the top and bottom of the target object because the target object is high or the bottom of the target object is blocked by other objects. To this end, the embodiment of the present application also provides a digital photogrammetry method, which can identify the plane with the densest three-dimensional discrete points in the digital three-dimensional space based on the digital three-dimensional space obtained in step S502 and the scale scaling ratio obtained in S504, and confirm it as the ground. Further, according to the normal vector of the ground and the shooting position of the first and second images, the direction of the sky is determined. Then, the server 200 can calculate the distance from the top of the target object to the ground according to the top of the target object, the ground position, and the direction of the sky, that is, the height of the target object, to expand the use scenario of the measurement method provided by the embodiment of the present application. In addition, when calculating the height of the target object, it is also possible to complete the measurement of the height of the target object by simply marking the position of the top in the first image and the second image, without marking the position of the bottom.
[0146] Specifically, Fig. 7A FIG. 1 is a flow chart of another digital image measurement method provided in an embodiment of the present application. The measurement method includes the above steps S501 to S504, and steps S701 to S702, which are specifically as follows:
[0147] S701, identifying the plane with the densest distribution of discrete points in the second three-dimensional space as the ground, and further determining the direction of the sky in the digital three-dimensional space.
[0148] Generally, in the real three-dimensional world, the ground is the plane with the most and most complex rigid bodies. Therefore, the area with the richest texture in the first image and the second image can be considered as the ground. Then, in the digital three-dimensional space constructed based on the first image and the second image, the plane with the densest distribution of three-dimensional discrete points can be considered as the ground. Among them, the plane with the densest distribution of three-dimensional discrete points is the plane with the largest number of point data in the unit space. After determining the ground in the digital three-dimensional space, the normal vector of the ground is the direction of the sky or the direction of gravity. Furthermore, since the camera center of the first image or the second image is determined to be above the ground, the direction of the sky in the digital three-dimensional space can be determined.
[0149] In a specific example, the server 200 may determine the ground and sky directions in the digital three-dimensional space by using the following steps:
[0150] Step a: Determine the photographic midpoint of the first image and the photographic center of the second image in the digital three-dimensional space. Set the center of the line connecting the photographic centers of the two images to O(O x ,O y ,O z ) point and construct a virtual sphere with point O as the center.
[0151] Step b: grid the virtual sphere in the form of longitude and latitude. The longitude is recorded as Lon, and the value range is (-180°, 180°]. The latitude is recorded as Lat, and the value range is (-90°, 90°]. With 1° as the sampling interval, there are 360*180 grid points on the virtual sphere. Of course, the sampling interval can also be other degrees, and this application does not limit the number of grid points on the virtual sphere.
[0152] Step c: Starting from the center of the sphere O, draw rays toward the grid points on the sphere to form a 360*180 vector, recorded as Represents 360*180 directions.
[0153] Step d: Starting from the virtual center of the ball, follow n (e.g. 10) virtual cylinders with a height of m meters (e.g. 0.2 meters) and a radius of r meters (e.g. 50 meters) are arranged at equal intervals in the direction, denoted as Where i is the cylinder marking code, i∈{1,2,...,10}. It should be noted that the height and radius of the virtual cylinder here are designed according to the size of the real three-dimensional world, so when corresponding to the digital three-dimensional space, it is necessary to divide by the size scaling ratio S1 / S2. Of course, the height and radius of the virtual cylinder can also be designed according to the size of the digital three-dimensional space, and there is no need to divide by the size scaling ratio S1 / S2, and the embodiments of the present application are not limited to this.
[0154] Step e: Calculate the number of three-dimensional discrete points in the "bounding box" formed by the 360*180*n virtual cylinders formed in step d and step e, and record the direction corresponding to the bounding box with the largest number. and marker code i Mark . Then the direction of the sky is In the opposite direction, the distance between the ground position and the center O of the virtual sphere is m*i Mark .
[0155] It is understandable that other methods may also be used to determine the directions of the ground and the sky in the digital three-dimensional space, and the embodiments of the present application do not specifically limit this.
[0156] S702: Determine the distance from the top of the target object to the ground as the height of the target object according to the position of the ground, the direction of the sky, the digital three-dimensional space, the first image and the second image.
[0157] In one example, the server 200 may receive the position of the top of the target object sent by the second electronic device 300, including the image point coordinates of the top of the target object in the first image and the image point coordinates of the top of the target object in the second image. A spatial forward intersection is performed according to the image point coordinates of the top of the target object to calculate the coordinates of the top of the target object in the digital three-dimensional space. Figure 7B As shown, point T (x1, y1, z1) is the coordinate of the top of the target object in the digital three-dimensional space calculated by the server 200. Point G (x2, y2, z2) is a point randomly selected on the ground in the digital three-dimensional space. The line connecting point T and point G at the top of the target object can be used as the hypotenuse of the triangle (or right trapezoid), and the height H in the vertical direction can be used as the right angle side to construct a triangle (or right trapezoid). According to the principle of geometry, the length H of the right angle side is the height of the target object.
[0158] In another example, the server 200 may also send the calculated digital three-dimensional space, size scaling ratio, ground position, sky direction and other information to the second electronic device 300. The second electronic device 300 receives the mark of the top of the target object input by the surveyor and calculates the height of the target object according to the third three-dimensional space.
[0159] Still taking a mobile phone as the second electronic device 300 as an example for exemplary description. The mobile phone can display the first image and the second image at the same time, or display the first image and the second image successively, so that the measurement personnel can mark the position of the top of the target object on the two images respectively (i.e., two positions in total). The specific marking method is the same as the method of marking the two endpoints of the first object in step S503, and will not be repeated here. In some examples, the second electronic device 300 can be the same device as the first electronic device 100.
[0160] It can be seen that the measurement method provided in the embodiment of the present application can be applied to the digital survey scene of telecommunication base stations, and is used to obtain the height of long-distance high towers and various equipment on the towers, etc. It can also be applied to other engineering measurements or daily life, such as measuring the height of buildings.
[0161] The following describes in detail a method for the server 200 to identify two endpoints of a benchmark in conjunction with a benchmark.
[0162] like Figure 8 As shown in FIG. 1 , a schematic diagram of a benchmark provided in an embodiment of the present application is shown. The benchmark is a rod-shaped object designed with four color segments. The four colors include black, white, color 1, and color 2. Color 1 and color 2 are different, and neither color 1 nor color 2 is black or white. Color 1 and color 2 can be selected from a pair of complementary colors in the color wheel. Fig. 9 The diagram shows a 24-color hue ring. For example, color 1 and color 2 may be red and cyan. Color 1 and color 2 may also be magenta and green. Of course, color 1 and color 2 may also be two colors close to complementary colors. For example, color 1 may be red, and color 2 may be cyan with a bluish tint or cyan with a greenish tint. Since the two colors in complementary colors have a greater degree of distinction, it is convenient for the server 200 to accurately identify the two colors.
[0163] It should be noted that when the shooting light is insufficient, the blue and black in the image are difficult to distinguish. When the shooting light is too bright, the yellow and white are difficult to distinguish. Therefore, color 1 and color 2 are not blue or yellow.
[0164] In some examples, the order of the four color segments on the pole is: black, white, color 1, white, color 2, white and black. In this way, the intersection of the black segment and the white segment (i.e., point A and point B) can be considered as two endpoints that need to be identified by the server 200. On the pole, the distance between the two endpoints is the actual size S1 of the first object. For example, the length of each color segment between the two endpoints is equal, which is the first length S0, such as 10 cm. Then, S1=5*S0, and the total length of the pole is greater than 5*S0.
[0165] In one example, the material of the pole can be plastic or carbon, which has the characteristics of being not easily deformed and non-conductive. The diameter of the pole can be 1 to 2.5 cm. The pole is a straight pole, including but not limited to a cylinder, an elliptical cylinder, a triangular prism, a quadrangular prism, etc. In another example, the pole can also be designed to be foldable, that is, the pole can be divided into at least two sections, connected by bolts or rubber bands, for easy assembly and disassembly.
[0166] like Fig.10FIG. 1 is a schematic diagram of another benchmark provided in an embodiment of the present application. Figure 8 Compared to the benchmark shown, Fig.10 exist Figure 8 In addition to the black segments at both ends of the pole shown (here the length of the black segments at both ends of the pole is also S0), a white segment is added respectively. In this way, the intersection points of the black segments and the white segments at both ends of the pole (i.e., point C and point D) can be considered as the two endpoints that need to be identified by the server 200. On the pole, the distance between the two endpoints is the actual size S1 of the first object. For example, the length of the segments of each color between the two endpoints is equal, which is the first length S0, such as 10 cm. Then, S1=7*S0, and the total length of the pole is greater than 7*S0. The embodiment of the present application does not limit the specific form of the pole.
[0167] In some embodiments of the present application, the measurement personnel can use the first electronic device 100 to take the first image and the second image. Figure 8 The benchmark shown or Fig.10 The pole shown is placed in the viewing range of the camera, so both the first image and the second image include the pole.
[0168] Then, the server 200 can use the deep learning and morphological synthesis methods to determine the approximate position of the pole in the first image and the second image respectively, and then lock the center line of the pole according to the straight line feature and color feature of the pole. Then, according to the center line of the pole, the known segmented relationship of each color in the pole, and the gray change amount in the image, the two endpoints of the pole are accurately locked, that is, the two endpoints of the first object.
[0169] Below, with Fig.10 As an example, combined with the benchmark shown FIG. 11A to FIG. 11D , a method for the server 200 to identify two endpoints of the benchmark is described in detail, and the method specifically includes:
[0170] Step a: predict the position range of the benchmark in the first image and the second image respectively, recorded as the first range.
[0171] In a specific implementation, the two images may be switched first, that is, each image may be cut into small pieces, namely, sliced images. The size of each sliced image may be, for example, 500*500 pixels, and a certain degree of overlap may be retained between the sliced image and the sliced images around it, for example, 50% overlap. It should be noted that the slicing process is to increase the pixel ratio of the benchmark in the sliced image, which is more helpful for target detection.
[0172] Then, a deep learning method can be used to perform target detection on the slice image of the first image and the slice image of the second image, respectively, to obtain the approximate position of the benchmark in the first image and the second image. The model used for target detection includes but is not limited to Mask R-CNN and the like.
[0173] It should also be noted that before performing target detection, the server 200 may also pre-process the first image and the second image. For example, general optical cameras have imaging distortion, and firstly, it is necessary to perform distortion correction on each image using the internal parameters of the camera. In another example, if the camera of the first electronic device 100 is a fisheye lens, it is also necessary to perform a perspective transformation of the spherical to central projection on each image. Among them, the distortion correction and perspective transformation are to ensure that the shape of the benchmark in the image is a straight line and is not distorted due to projection deformation.
[0174] Optionally, the image of the benchmark in the first image and the image of the benchmark in the second image identified by the deep learning method can be further subjected to a morphological opening operation of "erode first, then dilate" to remove small-area noise points and expand and connect the range of the predicted benchmark to better constrain the position of the benchmark in the first image and the second image. The scale of morphological dilation should be larger than the scale of morphological erosion. For example, the scale of morphological dilation is 30 pixels, and the scale of morphological erosion is 10 pixels.
[0175] For example, Fig.11A As shown in FIG. 1 , an example of a first image or a second image is shown, and the image includes a benchmark. After the relevant processing in step a, the approximate position of the benchmark in the image can be obtained, such as Fig. 11B The white area shown.
[0176] Step b: Determine an area with straight line features in the image within the first range of the first image and the second image, which is a more accurate position range of the benchmark, and is recorded as the second range. The second range is smaller than the first range, and the second range is included in the first range.
[0177] In a specific implementation, a filter may be used to determine the region with straight line features from the first image and the second image. The filter may be the real part of a two-dimensional Gabor function, and the formula for constructing the filter is:
[0178]
[0179] Where (x, y) is the position in the two-dimensional filter; Gabor λ,σ,γ,θ,φ(x, y) is the value of the Gabor filter at this position; λ is the wavelength of the sine function, 10<λ<20; σ is the standard deviation of the Gaussian function, 3<σ<6; γ is the aspect ratio of the Gaussian function in the x and y directions, γ=1; φ is the initial phase of the sine wave, φ=0; θ is the direction of the Gabor kernel function. In some examples of the present application, some directions of the Gabor kernel function can be selected. For example, 9 directions are selected, such as θ of 0°, 20°, 40°, 60°, 80°, 100°, 120°, 140°, and 160°, that is, 9 Gabor filters are constructed respectively.
[0180] After constructing the filter, the constructed filter is used to process the first image and the second image to extract the straight line features in the image. For example, the size of the Gabor filter window is set to any odd number between 21 and 51. Then, the images within the first range of the first image and the second image are filtered multiple times by sliding the window to obtain the Gabor feature value of the image in the θ direction of the i-th row and j-th column, which is recorded as T Gabor-θ (i, j). The final Gabor eigenvalue is the maximum value of the absolute values of the Gabor eigenvalues in multiple directions (for example, 9 directions), as shown in the following formula:
[0181]
[0182] After the above calculation, the area where the Gabor feature value is greater than the threshold D (for example, 100) is an area with obvious straight line features and can be considered as a more accurate position range of the benchmark. Fig. 11C As shown, the white area in the image is the area with obvious straight line features determined in step b.
[0183] Furthermore, based on the approximate range of the benchmark determined in step a and the straight line area determined in step b, the overlapping area is further determined to be a more accurate position range of the benchmark.
[0184] Step c: identifying the color features of the benchmark from the images within the second range of the first image and the second image, and identifying the two end points of the benchmark in combination with the design of the benchmark.
[0185] First, superpixel segmentation is performed on the image within the second range of the first image and the second image, that is, pixels with similar colors and textures in the image form superpixels, which will effectively suppress optical lens imaging noise points and help lock the color blocks in the image. Among them, the color block refers to an area with specific color characteristics. Among them, the superpixel segmentation algorithm includes but is not limited to simple linear iterative clustering (SLIC), mean-shift algorithm, etc. The size of the superpixel is, for example, 50 to 100 pixels.
[0186] Then, the image after superpixel segmentation is converted from RGB space to HSL (Hue, Saturation, Lightness) space, and two color blocks are extracted from the images within the second range of the first image and the second image respectively through the hue threshold segmentation method, which are the color blocks corresponding to color 1 and the color blocks corresponding to color 2. For example, red blocks and cyan blocks. Among them, the threshold of hue is related to the color selected in the benchmark design. Then, the center of gravity of the two color blocks is calculated, and the connecting line of the center of gravity and its extension line are the center line of the benchmark.
[0187] On the center line of the determined benchmark, find the position where the grayscale value changes the most within a specific range on both sides of the two determined color blocks, which can be considered as the intersection of the black color block and the white color block. Among them, the maximum change in the above grayscale value is close to and slightly less than 255. Since the grayscale value of black in the image is close to and slightly higher than zero, and the grayscale value of white in the image is close to and slightly less than 255. Then, the intersection of the black color block and the white color block is the one with the largest change in grayscale value.
[0188] For example, if we use Figure 8 The benchmark shown in the figure can determine a position with the largest change in grayscale value, such as point A, on the extension line on one side of the line connecting the centers of gravity of the two color blocks. A position with the largest change in grayscale value, such as point B, can be determined on the extension line on the other side of the line connecting the centers of gravity of the two color blocks. Optionally, the two determined endpoints can be further verified based on the positional relationship of the color blocks in the benchmark. For example, the center of gravity of the color block where color 1 is located is 2*s0 away from the center of gravity of the color block where color 2 is located. If point A is 1.5*s0 away from the center of the color block where color 1 is located, or point A is 2.5*s0 away from the center of the color block where color 2 is located, then point A is considered to be accurately identified. If point B is 2.5*s0 away from the center of the color block where color 1 is located, or point B is 1.5*s0 away from the center of the color block where color 2 is located, then point B is considered to be accurately identified.
[0189] For example, if we use Fig.10The benchmark shown in the figure can determine two positions with the largest grayscale value changes, such as point A and point C, on the extension line on one side of the line connecting the centers of gravity of the two color blocks. Further, point C can be determined as one of the endpoints in the benchmark according to the distance between point C and the center of gravity of the color block being greater than the distance between point A and the center of gravity of the color block. Optionally, it can also be determined whether point C is accurately identified based on the positional relationship between point A and point C on the benchmark. For example, the center of gravity of the color block where color 1 is located is 2*s0 away from the center of gravity of the color block where color 2 is located. If point C and point A are s0 apart, it can be considered that point C is correctly identified. On the extension line on the other side of the line connecting the centers of gravity of the two color blocks, it can be determined that two positions with the largest grayscale value changes, such as point B and point D. Similarly, point D can be determined as another endpoint in the benchmark. Optionally, it can also be determined whether point D is accurately identified based on the positional relationship between point B and point D. Of course, other methods can also be used to verify the accuracy of point C or point D identified by server 200, and the embodiments of the present application are not limited to this. Of course, the distance between point A and point B may also be defined as the distance between two end points of the benchmark that the server 200 needs to identify, and this embodiment of the present application does not limit this.
[0190] Still using Fig.10 The following is an example of the benchmark shown in Figure 1. Fig.11D As shown, in the area 1001 identified in step b, a color block 1002 corresponding to color 1 and a color block 1003 corresponding to color 2 are identified. Then, on the extension line of the line connecting the center of gravity of the color block 1002 and the center of gravity of the color block 1003, four endpoints with the largest grayscale value changes are found, namely point A, point C, point B and point D. Further, according to the positional relationship of each segment, point C and point D can be determined as the two endpoints of the benchmark.
[0191] It can be seen that when the server 200 can identify the two endpoints of the benchmark as the two endpoints of the first object, there is no need for the surveyor to mark the two endpoints of the first object in the first image and the second image respectively through the first electronic device 100, which can simplify the surveyor's operation and make the measurement more automated.
[0192] The above embodiments are described by taking the construction of a digital three-dimensional space based on the first image and the second image, and then determining the scale scaling ratio, ground position and sky direction of the digital three-dimensional space and the real three-dimensional world, and finally directly calculating the distance between the two endpoints of the target object, or calculating the height of the target object according to the digital three-dimensional space, the scale scaling ratio, the ground position and the sky direction. Based on the inventive concept of the embodiment of the present application, after constructing the digital three-dimensional space based on the first image and the second image, and determining the scale scaling ratio, ground position and sky direction of the digital three-dimensional space and the real three-dimensional world, the obtained digital three-dimensional space can be scaled, translated and rotated, so that the digital three-dimensional space is adjusted to be consistent with the real three-dimensional world. Then, the distance between the two endpoints of the target object is calculated based on the adjusted digital three-dimensional space, or the height of the target object is calculated. The embodiment of the present application does not limit this.
[0193] The present application also provides a chip system, such as Fig.12 As shown, the chip system includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 and the interface circuit 1102 can be interconnected via lines. For example, the interface circuit 1102 can be used to receive signals from other devices (such as the memory of the server 200). For another example, the interface circuit 1102 can be used to send signals to other devices (such as the processor 1101). Exemplarily, the interface circuit 1102 can read the instructions stored in the memory and send the instructions to the processor 1101. When the instructions are executed by the processor 1101, the server 200 can execute the various steps performed by the server 200 in the above embodiment. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0194] It is understandable that, in order to realize the above functions, the above-mentioned terminals etc. include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present invention.
[0195] The embodiment of the present application can divide the functional modules of the above-mentioned terminal etc. according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0196] In the case of dividing each functional module into corresponding functional modules, Fig.13 Another possible structural diagram of the server involved in the above embodiment is shown. The server 200 includes an acquisition unit 1301 , a construction unit 1302 and a determination unit 1303 .
[0197] Among them, the acquisition unit 1301 is used to acquire a first image and a second image, and the first image and the second image both include a target object and a first object whose actual size is known; wherein the shooting positions of the first image and the second image are different, and the shooting directions of the first image and the second image are different.
[0198] The constructing unit 1302 is configured to construct a digital three-dimensional space according to the first image and the second image.
[0199] The determination unit 1303 is used to determine the distance between the two endpoints of the target object according to the digital three-dimensional space and the scaling ratio of the size of the digital three-dimensional space and the real three-dimensional space, wherein the scaling ratio is related to the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object.
[0200] Furthermore, the determination unit 1303 is also used to: determine the plane with the densest distribution of discrete points in the digital three-dimensional space as the ground of the digital three-dimensional space; determine the sky direction of the digital three-dimensional space according to the ground of the digital three-dimensional space and the photographic center of the first image, or according to the ground of the digital three-dimensional space and the photographic center of the second image; determine the height of the target object according to the digital three-dimensional space, the scaling ratio, the ground of the digital three-dimensional space and the sky direction of the digital three-dimensional space.
[0201] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here. In the case of an integrated unit, the above acquisition unit 1301 can be the communication interface 230 of the server 200. The above construction unit 1302 and determination unit 1303 can be integrated together and can be the processor 210 of the server 200.
[0202] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0203] Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0204] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.
[0205] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A digital photogrammetry method, characterized in that: include: Acquire a first image and a second image, wherein both the first image and the second image include a target object and a first object whose actual size is known; wherein the first image and the second image are shot at different positions and in different directions; constructing a digital three-dimensional space according to the first image and the second image, wherein the digital three-dimensional space is presented in the form of a three-dimensional point cloud, and the three-dimensional point cloud is used to reflect the surface contour of the object; The distance between the two endpoints of the target object is determined according to the scaling ratio of the sizes of the digital three-dimensional space and the real three-dimensional space, and the coordinates of the two endpoints of the target object in the digital three-dimensional space, wherein the scaling ratio is related to the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object.
2. The method according to claim 1, characterized in that The method further comprises: Determine the sky direction of the digital three-dimensional space according to the ground of the digital three-dimensional space and the photographic center of the first image, or according to the ground of the digital three-dimensional space and the photographic center of the second image; wherein the ground of the digital three-dimensional space is a plane where the discrete points in the digital three-dimensional space are most densely distributed; The height of the target object is determined according to the digital three-dimensional space, the scaling ratio, the ground of the digital three-dimensional space, and the sky direction of the digital three-dimensional space.
3. The method according to claim 1 or 2, characterized in that: Before determining the distance between two endpoints of the target object according to the digital three-dimensional space and the scaling ratio between the digital three-dimensional space and the real three-dimensional space, the method further includes: Acquire a position of the first object in the first image, a position of the first object in the second image, and an actual size S1 of the first object; Calculate a size S2 of the first object in the digital three-dimensional space according to a position of the first object in the first image and a position of the first object in the second image; The scaling ratio between the size of the digital three-dimensional space and the size of the real three-dimensional space is calculated according to the actual size S1 of the first object and the size S2 of the first object in the digital three-dimensional space.
4. The method according to claim 3, characterized in that The acquiring the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object includes: Receive input of the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object; Alternatively, the position of the first object in the first image and the position of the first object in the second image are identified, and the actual size S1 of the first object is found.
5. The method according to claim 4, characterized in that The first object is a segmented design pole, and the first object at least comprises a first black segment, a first white segment, a first color segment, a second white segment, a second color segment, a third white segment, and a second black segment arranged in sequence; wherein the color of the first color segment and the color of the second color segment are a pair of complementary colors; The actual size S1 of the first object is the length between two endpoints of the first object, one endpoint of the first object is located at the junction of the first black segment and the first white segment, and the other endpoint of the first object is located at the junction of the third white segment and the second black segment; The position of the first object in the first image is the positions of the two endpoints of the first object in the first image; the position of the first object in the second image is the positions of the two endpoints of the first object in the second image.
6. The method according to claim 5, characterized in that The identifying the position of the first object in the first image and the position of the first object in the second image includes: Identify the first color segment and the second color segment in the first image, and a first region having a straight line feature in the first image; identify the first color segment and the second color segment in the second image, and a second region having a straight line feature in the second image; The positions of two endpoints of the first object in the first image are automatically determined based on the positional relationship between the first color segment and the second color segment in the first image, the first area in the first image, and the color segments in the first object; and the positions of two endpoints of the first object in the first image are automatically determined based on the positional relationship between the first color segment and the second color segment in the second image, the second area in the second image, and the color segments in the first object.
7. The method according to claim 5 or 6, characterized in that: The first color segment is a red segment, and the second color segment is a cyan segment; Alternatively, the first color segment is a magenta segment, and the second color segment is a green segment.
8. The method according to claim 2, characterized in that: The step of determining the height of the target object according to the digital three-dimensional space, the scaling ratio, the ground of the digital three-dimensional space, and the sky direction of the digital three-dimensional space includes: The height of the target object is determined based on the digital three-dimensional space, the scaling ratio, the ground of the digital three-dimensional space, the sky direction of the digital three-dimensional space, the position of the top of the target object in the first image, and the position of the top of the target object in the second image.
9. A measuring device, characterized in that: include: an acquisition unit, configured to acquire a first image and a second image, wherein the first image and the second image both include a target object and a first object of known actual size; wherein the first image and the second image are shot at different positions and in different directions; A construction unit, configured to construct a digital three-dimensional space according to the first image and the second image, wherein the digital three-dimensional space is presented in the form of a three-dimensional point cloud, and the three-dimensional point cloud is used to reflect the surface contour of the object; a determination unit, configured to determine a distance between two endpoints of the target object according to a scaling ratio between the sizes of the digital three-dimensional space and the real three-dimensional space, and coordinates of the two endpoints of the target object in the digital three-dimensional space, wherein the scaling ratio is related to a position of the first object in the first image, a position of the first object in the second image, and an actual size S1 of the first object.
10. The measuring device according to claim 9, characterized in that The determining unit is further configured to: Determine the sky direction of the digital three-dimensional space according to the ground of the digital three-dimensional space and the photographic center of the first image, or according to the ground of the digital three-dimensional space and the photographic center of the second image; wherein the ground of the digital three-dimensional space is a plane where the discrete points in the digital three-dimensional space are most densely distributed; The height of the target object is determined according to the digital three-dimensional space, the scaling ratio, the ground of the digital three-dimensional space, and the sky direction of the digital three-dimensional space.
11. The measuring device according to claim 9 or 10, characterized in that Before the determining unit determines the distance between the two endpoints of the target object according to the digital three-dimensional space and the scaling ratio of the digital three-dimensional space to the real three-dimensional space, The acquisition unit is further used to acquire the position of the first object in the first image, the position of the first object in the second image, and an actual size S1 of the first object; The determination unit is further used to calculate the size S2 of the first object in the digital three-dimensional space according to the position of the first object in the first image and the position of the first object in the second image; and calculate the scaling ratio of the size of the digital three-dimensional space to the real three-dimensional space according to the actual size S1 of the first object and the size S2 of the first object in the digital three-dimensional space.
12. The measuring device according to claim 11, characterized in that In the process in which the acquisition unit acquires the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object, the acquisition unit is specifically configured to: Receive input of the position of the first object in the first image, the position of the first object in the second image, and the actual size S1 of the first object; Alternatively, the position of the first object in the first image and the position of the first object in the second image are identified, and the actual size S1 of the first object is found.
13. The measuring device according to claim 12, characterized in that The first object is a segmented design pole, and the first object at least comprises a first black segment, a first white segment, a first color segment, a second white segment, a second color segment, a third white segment, and a second black segment arranged in sequence; wherein the color of the first color segment and the color of the second color segment are a pair of complementary colors; The actual size S1 of the first object is the length between two endpoints of the first object, one endpoint of the first object is located at the junction of the first black segment and the first white segment, and the other endpoint of the first object is located at the junction of the third white segment and the second black segment; The position of the first object in the first image is the positions of the two endpoints of the first object in the first image; the position of the first object in the second image is the positions of the two endpoints of the first object in the second image.
14. The measuring device according to claim 13, characterized in that In the process in which the acquisition unit identifies the position of the first object in the first image and the position of the first object in the second image, the acquisition unit is further specifically configured to: Identify the first color segment and the second color segment in the first image, and a first region having a straight line feature in the first image; identify the first color segment and the second color segment in the second image, and a second region having a straight line feature in the second image; Automatically determining positions of two endpoints of the first object in the first image according to the positional relationship between the first color segment and the second color segment in the first image, the first area in the first image, and each color segment in the first object; And according to the positional relationship between the first color segment and the second color segment in the second image, the second area in the second image, and each color segment in the first object, the positions of the two endpoints of the first object in the first image are automatically determined.
15. The measuring device according to claim 13 or 14, characterized in that The first color segment is a red segment, and the second color segment is a cyan segment; Alternatively, the first color segment is a magenta segment, and the second color segment is a green segment.
16. The measuring device according to claim 10, characterized in that In the process in which the determination unit determines the height of the target object according to the digital three-dimensional space, the scaling ratio, the ground of the digital three-dimensional space, and the sky direction of the digital three-dimensional space, the determination unit is specifically used to: The height of the target object is determined based on the digital three-dimensional space, the scaling ratio, the ground of the digital three-dimensional space, the sky direction of the digital three-dimensional space, the position of the top of the target object in the first image, and the position of the top of the target object in the second image.
17. A server, characterized in that: The server comprises one or more processors, one or more memories and one or more communication interfaces, wherein the one or more memories and the one or more communication interfaces are coupled to the one or more processors, and the one or more memories are used to store computer program codes, wherein the computer program codes include computer instructions, and when the one or more processors read the computer instructions from the one or more memories, the server executes the digital photogrammetry method according to any one of claims 1 to 8.
18. A computer storage medium, characterized in that: The method comprises computer instructions, which, when executed on a server, enable the server to execute the digital photogrammetry method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method for three-dimensional measurement of panoramic real scenes
CN102052916A
Method and device for dimensional measuring system based on binocular vision
CN109341537A