WO2021170051A1 - 一种数字摄影测量方法、电子设备及系统 - Google Patents

一种数字摄影测量方法、电子设备及系统 Download PDF

Info

Publication number
WO2021170051A1
WO2021170051A1 PCT/CN2021/077962 CN2021077962W WO2021170051A1 WO 2021170051 A1 WO2021170051 A1 WO 2021170051A1 CN 2021077962 W CN2021077962 W CN 2021077962W WO 2021170051 A1 WO2021170051 A1 WO 2021170051A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
digital
dimensional space
segment
color
Prior art date
Application number
PCT/CN2021/077962
Other languages
English (en)
French (fr)
Inventor
康一飞
方伟
梁明
黄山
尹若捷
谭凯
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021170051A1 publication Critical patent/WO2021170051A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4084Scaling of whole images or parts thereof, e.g. expanding or contracting in the transform domain, e.g. fast Fourier transform [FFT] domain scaling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Definitions

  • This application relates to the field of electronic technology, and in particular to a digital photogrammetry method, electronic equipment and system.
  • the survey work for communication base stations including but not limited to the measurement of indoor and outdoor equipment size, height, and deployment distance, is an important prerequisite for communication base station site design, equipment deployment, material delivery, and risk detection.
  • the traditional survey methods are outdoor scale measurement and indoor hand-painting.
  • Traditional survey methods have problems such as heavy workload, poor reliability, and high risk. For this reason, operators and tower companies have adopted more digital photogrammetry methods to complete surveys for communication base stations.
  • Digital photogrammetry is the use of computers to process digital images or digital images.
  • Computer vision is used to replace the stereo measurement and recognition of the human eye to complete the automatic extraction of geometric and physical information.
  • 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 azimuth relationships to lay out multiple targets representing control points. The target placement process is complicated and unreliable. In addition, laying multiple targets also needs to occupy a certain amount of space, which is difficult to implement in some small spaces, sloping roofs and other scenes.
  • the digital photogrammetry method, electronic equipment, and system provided in the present application can reduce the complexity of image acquisition operations, expand the applicable scenarios of digital photogrammetry, and increase the reliability of measurement.
  • a method provided by the present application includes: acquiring a first image and a second image, both of the first image and the second image include a target object and a first object with a known actual size; wherein, the first image The shooting position of the second image is different, and the shooting directions of the first image and the second image are different; according to the first image and the second image, a digital three-dimensional space is constructed; according to the digital three-dimensional space, and the digital three-dimensional space and the real three-dimensional The size scaling ratio of the space determines the distance between the two end points of the target object, where 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 .
  • Three-dimensional point cloud refers to a collection of point data on the surface of an object in three-dimensional space, which can reflect the contour of the surface 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 there may be one target object here, and the distance between the two end points of the target object may be the height, length, width, etc. of the target object. There may also be two target objects, and the distance between the two end points of the target object may be the distance between the two target objects, etc.
  • the embodiments of this application are in different shooting positions , It is more convenient to take images twice in different shooting directions.
  • the actual size of the first object is used to determine the size scaling ratio of the digital three-dimensional space, which is beneficial to improve the reliability of the measurement.
  • the measurement method provided in the embodiments of the present application can be applied to a wider range of measurement scenarios.
  • the method further includes: determining the sky direction of the digital three-dimensional space according to the ground of the digital three-dimensional space and the photography center of the first image, or according to the ground of the digital three-dimensional space and the photography center of the second image; Among them, the ground of the digital three-dimensional space is the plane with the densest distribution of discrete points in the digital three-dimensional space; the height of the target object is determined according to the digital three-dimensional space, the zoom ratio, and the ground and sky directions of the digital three-dimensional space.
  • 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.
  • the foregoing height measurement implementation method makes the embodiments of the present application applicable to more measurement scenarios. For example, in some scenes where the target object may be tall, or the bottom end of the target object may be blocked, the height of the target object can be calculated from the top of the shot. In addition, in the solution provided by the embodiment of the present application, the height measurement of the target object can be completed by only marking the top position in the first image and the second image, without marking the bottom position, which simplifies the operation of the measuring personnel. .
  • the method before determining the distance between the two end points of the target object according to the digital three-dimensional space and the scaling ratio between the size of the digital three-dimensional space and the real three-dimensional space, the method further includes: acquiring the first image in the first image. The position of the object, the position of the first object in the second image, and the actual size S1 of the first object; 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 first object in the digital three-dimensional space The size S2 of an object; according to the actual size S1 of the first object and the size S2 of the first object in the digital three-dimensional space, the scaling ratio of the size of the digital three-dimensional space and the real three-dimensional space is calculated.
  • the position of the first object in the first image may be the image point coordinates of the first object in the first image.
  • the position of the first object in the second image may be the image point coordinates of the first object in the second image.
  • a method for calculating the zoom ratio based on the actual size S1 of the first object with a known size and the size S2 of the first object in the 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 zoom ratio and improve the reliability of the measurement.
  • 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: receiving the input 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, and the position of the first object in the second image, and find the first The actual size of the object S1.
  • a method for manually marking the positions of the two end points of the first object by the surveyor and inputting the actual size of the first object is provided, and a method is also provided for the server to automatically recognize the positions of the two end points of the first object, and A method to find the actual size of the first object. Enriched the way to obtain the two end positions of the first object and the actual size of the first object.
  • the first object is a benchmark designed in segments, and the first object includes at least a first black segment, a first white segment, a first color segment, and a second white segment arranged in sequence.
  • the actual size S1 of the first object is the first
  • the length between the two end points of an object, one end of the first object is located at the junction of the first black segment and the first white segment, and the other end of the first object is located at the third white segment and the second black segment
  • the position of the first object in the first image is the position of the two end points of the first object in the first image; the position of the first object in the second image is the position of the two end points of the first object in the second image Location.
  • a specially designed benchmark is provided, which can be used as the first object, so that the server can automatically recognize the two endpoints of the first object and simplify the operation of the surveying personnel.
  • recognizing the position of the first object in the first image and the position of the first object in the second image includes: recognizing the first color segment and the second color segment in the first image, And a first region with linear features in the first image; identifying the first color segment and the second color segment in the second image, and the second region with linear features in the second image; according to the first image in the first image A color segment and a second color segment, the first area with linear characteristics in the first image, and the positional relationship of each color segment in the first object, automatically determine the two end points of the first object in the first image The position; and according to the first color segment and the second color segment in the second image, the second area with linear characteristics in the second image, and the position relationship of each color segment in the first object, the first object is automatically determined The position of the two end points of the first object in an image.
  • a method of identifying the two end points of the benchmark is provided.
  • a filter may be used to determine a region with linear characteristics from the first image and the second image.
  • the filter may specifically be the real part of the two-dimensional Gabor function.
  • 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. .
  • the size of the digital three-dimensional space and the real three-dimensional space is calculated 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 zoom ratio includes: calculating 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; according to the actual size S1 of the first object and the digital three-dimensional
  • the size S2 of the first object in the space is calculated to obtain the scaling ratio between the size of the digital three-dimensional space and the real three-dimensional space.
  • the distance between the two end points of the target object is determined according to the digital three-dimensional space and the scaling ratio between the digital three-dimensional space and the real three-dimensional space, including: according to the digital three-dimensional space, the scaling ratio, The positions of the two end points of the target object in the first image and the positions of the two end points of the target object in the second image determine the distance between the two end points of the target object.
  • the height of the target object is determined according to the digital three-dimensional space, zoom ratio, the ground of the digital three-dimensional space, and the sky direction of the digital three-dimensional space, including: according to the digital three-dimensional space, zoom ratio, and 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, determine the height of the target object.
  • a measurement device including: an acquisition unit for acquiring a first image and a second image, both of the first image and the second image include a target object and a first object with a known actual size; 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; the construction unit is used for digital three-dimensional space based on the first image and the second image; the determination unit is used for The digital three-dimensional space and the zoom ratio of the size of the digital three-dimensional space and the real three-dimensional space determine the distance between the two end points of the target object, where the zoom ratio is related to the position of the first object in the first image and the second image The position of an object is related to the actual size S1 of the first object.
  • the determining unit is also used to determine the sky in the digital three-dimensional space based on the ground in the digital three-dimensional space and the photography center of the first image, or based on the ground in the digital three-dimensional space and the photography center of the second image.
  • the ground of the digital three-dimensional space is the plane with the most densely distributed discrete points in the digital three-dimensional space; the height of the target object is determined according to the digital three-dimensional space, zoom ratio, the ground of the digital three-dimensional space, and the sky direction of the digital three-dimensional space.
  • the acquiring unit is also used for 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 determining unit is also used to determine the position of the first object in the first image , The position of the first object in the second image, calculate the size S2 of the first object in the digital three-dimensional space; according to the actual size S1 of the first object and the digital three-dimensional space The size S2 of the first object is calculated to obtain the scaling ratio of the size of the digital three-dimensional space and the real three-dimensional space.
  • the acquiring unit in the process in which the acquiring 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 acquiring unit is specifically used for : Receive the 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; or, identify the position of the first object in the first image, and the second image Find the position of the first object in the middle, and find the actual size S1 of the first object.
  • the first object is a benchmark designed in segments, and the first object includes at least a first black segment, a first white segment, a first color segment, and a second white segment arranged in sequence.
  • the actual size S1 of the first object is the first
  • the length between the two end points of an object, one end of the first object is located at the junction of the first black segment and the first white segment, and the other end of the first object is located at the third white segment and the second black segment
  • the position of the first object in the first image is the position of the two end points of the first object in the first image; the position of the first object in the second image is the position of the two end points of the first object in the second image Location.
  • the acquiring unit is further specifically configured to: The first color segment and the second color segment, and the first area with linear characteristics in the first image; the first color segment and the second color segment in the second image are identified, and the second image A second area with linear features; according to the first color segment and the second color segment in the first image, the first area in the first image, and the positional relationship of each color segment in the first object , Automatically determine the positions of the two end points of the first object in the first image; and according to the first color segmentation and the second color segmentation in the second image, the second area in the second image, and The position relationship of each color segment in the first object automatically determines the positions of the two end points of the first object in the first image.
  • 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. .
  • the determining unit calculates the digital three-dimensional space and 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 determining unit is specifically configured 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; According to the actual size S1 of the first object and the size S2 of the first object in the digital three-dimensional space, the scaling ratio between the size of the digital three-dimensional space and the real three-dimensional space is calculated.
  • the determining unit in the process of determining the distance between the two end points of the target object according to the digital three-dimensional space and the scaling ratio of the digital three-dimensional space and the real three-dimensional space, the determining unit specifically uses Yu: Determine the distance between the two end points of the target object according to the digital three-dimensional space, the zoom ratio, the positions of the two end points of the target object in the first image, and the positions of the two end points of the target object in the second image.
  • the positions of the two end points of the target object in the first image and the positions of the two end points of the target object in the second image manually marked by the surveyor can be received, and then based on the position information and the digital three-dimensional space, and The zoom ratio calculates the distance between the two end points of the target object.
  • the distance between the two end points of the target object may be the height, length, width, etc. of the target object.
  • the distance between the two end points of the target object may be the distance between the two target objects, etc.
  • the measurement method can be used in the digital survey of telecommunication base stations to obtain information such as equipment size, cable length, and installation spacing. It can also be used in other engineering surveys or daily life, such as measuring the distance between buildings.
  • the determining unit is specifically used to: The space, the zoom 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, determine the height of the target object.
  • 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 based on the position information, the digital three-dimensional space, and the ground of the digital three-dimensional space. And the sky direction to calculate the height of the target object.
  • the measurement method provided in the embodiments of the present application can be applied to a digital survey scenario of a telecommunication base station, and is used to obtain the height of a long-distance high tower and various types of equipment on the tower. It can also be applied to other engineering surveys or daily life, such as measuring the height of buildings.
  • a server including one or more processors, one or more memories, and one or more communication interfaces.
  • the one or more memories, the one or more communication interfaces and the one Or multiple processors are coupled, the one or more memories are used to store computer program code, the computer program code includes computer instructions, when the one or more processors read from the one or more memories
  • the computer instructions enable the server to execute the method described in the above aspect and any one of its possible implementation manners.
  • a chip system including a processor.
  • the processor executes an instruction, the processor executes the method described in the foregoing aspects and any one of the possible implementation manners.
  • a computer storage medium which includes computer instructions, which when the computer instructions run on a server, cause the server to execute the method described in the above aspects and any one of the possible implementation manners.
  • a computer program product which when the computer program product runs on a computer, causes the computer to execute the method described in the foregoing aspects and any one of the possible implementation manners.
  • FIG. 1 is a schematic structural diagram of a communication system provided by an embodiment of this application.
  • FIG. 2A is a schematic diagram of an image acquisition method provided by an embodiment of this application.
  • 2B is a schematic diagram of another image acquisition method provided by an embodiment of the application.
  • 2C is a schematic diagram of another image acquisition method provided by an embodiment of the application.
  • FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
  • FIG. 4 is a schematic structural diagram of a server provided by an embodiment of the application.
  • 5A is a schematic flowchart of a digital photogrammetry method provided by an embodiment of this application.
  • 5B is a schematic diagram of a method for calculating the distance between two end points of a target object provided by an embodiment of the application;
  • 6A to 6H are schematic diagrams of user interfaces of some electronic devices provided by embodiments of this application.
  • FIG. 7A is a schematic flowchart of another digital photogrammetry method provided by an embodiment of this application.
  • FIG. 7B is a schematic diagram of a method for calculating the height of a target object according to an embodiment of the application.
  • FIG. 8 is a schematic diagram of a benchmark provided by an embodiment of the application.
  • FIG. 9 is a schematic diagram of a hue circle provided by an application embodiment.
  • FIG. 10 is a schematic diagram of another benchmark provided by an embodiment of this application.
  • FIGS. 11A to 11D are schematic diagrams of a method for identifying a benchmark provided by an embodiment of this application.
  • FIG. 12 is a schematic structural diagram of a chip system provided by an embodiment of the application.
  • FIG. 13 is a schematic structural diagram of a device provided by an embodiment of this application.
  • A/B means or, for example, A/B can mean A or B; "and/or” in this document is only an association describing the associated object Relationship means that there can be three kinds of relationships.
  • a and/or B can mean that: A alone exists, A and B exist at the same time, and B exists alone.
  • first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined with “first” and “second” may explicitly or implicitly include one or more of these features.
  • plural means two or more.
  • words such as “exemplary” or “for example” are used as examples, illustrations, or illustrations. Any embodiment or design solution described as “exemplary” or “for example” in the embodiments of the present application should not be construed as being more preferable or advantageous than other embodiments or design solutions.
  • words such as “exemplary” or “for example” are used to present related concepts in a specific manner.
  • the communication system includes a first electronic device 100, a server 200, and a second electronic device 300.
  • the second electronic device 300 and the first electronic device 100 may be the same device.
  • the first electronic device 100, the server 200, and the second electronic device 300 may be the same device. That is to say, all the steps in the embodiments of the present application are completed by one device, such as a terminal.
  • the first electronic device 100 is a device with a camera, which can be used to capture an image of a target to be measured.
  • the first electronic device 100 may be a mobile phone, a tablet computer, a camera, a wearable electronic device, etc., and the specific form of the first electronic device 100 is not particularly limited in this application.
  • the surveyor may use the first electronic device 100 to shoot the first image and the second image in different shooting directions at different shooting positions, where both the first image and the second image include the target object.
  • the above-mentioned shooting position may be understood as the position in the light (or the center of photography) of the camera of the first electronic device 100 when an image is taken.
  • Shooting the first image and the second image in different shooting directions refers to taking the subject (for example, the target object) as the center, and selecting different shooting points around the target object to shoot the first image and the second image twice.
  • the shooting point and the target object are not on the same straight line. Under the condition of the same shooting distance and shooting height, different shooting directions can show different side images of the target object.
  • 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 of the shooting center of the two images, and the angle is not zero and Not 180 degrees.
  • 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 end points of the target object, it can be the vertex of the target object, and so on.
  • first image and the second image taken at different shooting positions and in different shooting directions can form a stereo pair, so as to subsequently form a digital three-dimensional space, and calculate the distance between the two end points of the target object based on the principle of triangulation. The distance and the height of the target object.
  • the surveyor may carry the first electronic device 100 to take a first image of the target 21 to be measured at a certain position.
  • the camera of the first electronic device 100 is located at the first position P1.
  • the surveyor moves his position and takes a second image in another position.
  • the camera of the first electronic device 100 is located at the second position P2.
  • the vertex Q1 on the target object and the line connecting the points P1 and P2 respectively form an angle ⁇ 1.
  • the included angle ⁇ 1 is not zero and not 180 degrees.
  • the measurement method shown in Figure 2A can be used in an outdoor measurement scenario.
  • the surveyor can face a target object (such as a house, an iron tower, etc.), move left and right, and take two pictures.
  • the two shooting positions are several meters to tens of meters apart, and the distant target object can be measured.
  • the surveyor can lift the first electronic device 100 over his head to take a first image of the target object 22.
  • the camera of the first electronic device 100 is located at the first position P3.
  • the surveyor places the first electronic device 100 around his waist to take a second image of the target object.
  • the camera of the first electronic device 100 is located at the second position P4.
  • the vertex Q2 on the target object and the line connecting the points P1 and P2 respectively form an angle ⁇ 2.
  • the included angle ⁇ 2 is not zero and not 180 degrees.
  • the method shown in FIG. 2B can be applied to measurement in a small space, such as a small computer room. The distance between the two shooting points is about 0.4 to 1 meter, and the target object within 10 meters can be measured.
  • the surveyor can extend his arm to one side of the body to take a first image of the target object 22.
  • the camera of the first electronic device 100 is located at the first position P5.
  • the surveyor stretches his arm to the other side of the body to take a second image of the target object.
  • the camera of the first electronic device 100 is located at the second position P6.
  • the vertex Q3 on the target object and the line connecting the points P1 and P2 respectively form an angle ⁇ 3.
  • the included angle ⁇ 3 is not zero and not 180 degrees.
  • 2C can be applied to a scene where it is inconvenient for the measurement personnel to move, such as on a tower or a roof. Then, the surveyor can extend his arms to the left and right to take two pictures. The distance between the two shooting points is about 1 to 2.5 meters, and the target objects within 20 to 50 meters can be measured.
  • the first electronic device 100 can also be used to receive information about a first object of a known size input by a surveyor, such as information on the two endpoints of the first object in the first image and the second image, and the actual information of the first object. size. Wherein, both the first image and the second image include the first object.
  • the server 200 constructs a digital three-dimensional space according to the first image and the second image. It should be noted that the ratio of the size of each object in the digital three-dimensional space to the size of each object in the real three-dimensional world is the same, and the relative position relationship between each object in the digital three-dimensional space is the same as the relative position of each object in the real three-dimensional world. The relationship is the same, and the ratio of the distance between each object in the digital three-dimensional space is the same as the distance between each object in the real three-dimensional world.
  • the server 200 may recognize the information of the first object of a known size in the first image and the second image, or receive the information of the first object of a known size from the first electronic device 100.
  • the server 200 may obtain the scale scaling ratio between the digital three-dimensional space and the real three-dimensional world according to the actual size of the first object and the size of the first object in the digital three-dimensional space.
  • the server 200 can calculate the distance between the two end points of the target object according to the scale scaling ratio and the digital three-dimensional space.
  • the server 200 may receive the two endpoint information of the target object sent by the second electronic device 300, and the server 200 may calculate the distance between the two endpoints according to the two endpoint information of the target object and the scale scaling ratio. .
  • the server 200 may send the digital three-dimensional space and the scale scaling ratio to the second electronic device 300.
  • the second electronic device 200 may then calculate the distance between the two end points of the target object according to the information of the two end points of the target object input by the surveyor.
  • 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 information of the target object input by the surveyor according to the first image and the second image.
  • the second electronic device 300 may be a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a netbook, etc.
  • the specific form of the second electronic device 300 is not described in this application. Special restrictions.
  • the second electronic device 300 may be the same device as the first electronic device 100.
  • the server 200 may also determine that the plane with the most densely distributed 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.
  • the server 200 can calculate the height of the target object, that is, the distance between the top of the target object and the ground according to the scale scaling ratio, the digital three-dimensional space, the ground height, and the sky direction.
  • the server 200 may receive the tip information of the target object sent by the second electronic device 300.
  • the server 200 may calculate the height of the target object according to the top information, digital three-dimensional space, ground height, and sky direction of the target object.
  • the server 200 may 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.
  • the surveyor can use the first electronic device 100 to shoot the first image and the second image in two different shooting positions in different shooting directions. 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 end points 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. It can also identify the ground in the digital three-dimensional space.
  • the plane with the most densely distributed 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.
  • the embodiments of the present application are in different shooting positions , Shooting images in different shooting directions is convenient and highly reliable.
  • the actual size of the first object is used 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.
  • the measurement method provided in the embodiments of the present application can be applied to a wider range of measurement scenarios.
  • FIG. 3 shows a schematic structural diagram of the first electronic device 100.
  • the first electronic device 100 may include a processor 110, an internal memory 121, a universal serial bus (USB) interface 130, a camera 150, a display screen 160, and so on.
  • the first electronic device 100 may further include one or more of an external memory interface 120, a charging management module 140, a power management module 141, and a battery 142.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a graphics processing unit (GPU), and an image signal processor (image signal processor). , ISP), digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) one or more of them.
  • the different processing units may be independent devices or integrated in one or more processors.
  • 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 (for example, the internal memory 121, the camera 150, the display screen 160, etc.) through the one or more interfaces.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 130 can be used to connect a charger to charge the first electronic device 100, and can also be used to transfer data between the first electronic device 100 and peripheral devices.
  • 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 will receive the two endpoints of the target object in the first image marked by the user.
  • the position or the position of the tip, and the position of the two end points or the position of the tip of the target object in the second image are sent to the server 200.
  • the first electronic device 100 may also receive the positions of the two end points of the first object with a known size in the first image marked by the user through the one or more interfaces, and the second image with the known size The positions of the two end points of the first object and the actual size of the first object are sent to the server 200.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic illustration, and does not constitute a structural limitation of the first electronic device 100.
  • the first electronic device 100 may also adopt different interface connection modes or a combination of multiple interface connection modes in the foregoing embodiments.
  • the first electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the first electronic device 100 may implement a shooting function through an ISP, a camera 193, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the first electronic device 100 may include 1 or N cameras 193, and N is a positive integer greater than 1.
  • the first electronic device 100 may be used to call the camera 193 to shoot the first image and the second image containing the target object in different shooting positions and in different shooting directions.
  • the different shooting position is the optical center of the camera 193.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the first electronic device 100.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the internal memory 121 may include a storage program area and a storage data 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 194, the camera 193, and the wireless communication module 160.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the first electronic device 100.
  • the first electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • FIG. 4 shows a schematic structural diagram of a server 200.
  • the server 200 includes one or more processors 210, one or more external memories 220, and one or more communication interfaces 230.
  • the server 200 may further include an input device 240 and an output device 250.
  • the processor 210, the external memory 220, the communication interface 230, the input device 240, and the output device 250 are connected by a bus.
  • the processor 210 may include a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, an Application-Specific Integrated Circuit (ASIC), a graphics processing unit (GPU), and a neural network processor. (neural-network processing unit, NPU), or an integrated circuit used to control the execution of the program of this application.
  • CPU Central Processing Unit
  • ASIC Application-Specific Integrated Circuit
  • GPU graphics processing unit
  • NPU neural network processing unit
  • an internal memory may be provided in the processor, which may be used to store computer executable program code, and the executable program code includes instructions.
  • the internal memory can include a program storage area and a data storage area.
  • the storage program area can store the operating system and the algorithm model needed to be used in the embodiments of this application, such as the algorithm model for identifying the first object, the algorithm for constructing a digital three-dimensional space based on the first image and the second image, and the algorithm based on the first object.
  • the storage data area can store the data created during the use of the server 200 (the three-dimensional discrete point cloud in the digital three-dimensional space, the actual size of the first object, the parameters of the ground position in the digital three-dimensional space, the parameters of the sky direction in the digital three-dimensional space, etc.) Wait.
  • the internal memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the processor 210 executes various functional applications and data processing of the server 200 by running instructions stored in the internal memory.
  • 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 (for example, computer program instructions).
  • the communication interface 230 may be used to communicate with other devices or communication networks, such as Ethernet, wireless local area networks (WLAN), and so on.
  • devices or communication networks such as Ethernet, wireless local area networks (WLAN), and so on.
  • the output device 250 communicates with the processor 210 and can display information in a variety of ways.
  • the output device may be a liquid crystal display (Liquid Crystal Display, LCD), a light emitting diode (Light Emitting Diode, LED) display device, a cathode ray tube (Cathode Ray Tube, CRT) display device, or a projector, etc. .
  • the input device 240 communicates with the processor 210, and can receive user input in a variety of ways.
  • the input device can be a mouse, a keyboard, a touch screen device, or a sensor device.
  • the structure of the second electronic device 300 can be described with reference to the structure of the first electronic device 100 in FIG. Parts, or combine some parts, or split some parts, or arrange different parts. The embodiment of the application does not limit this. In some examples, the second electronic device 300 may be the same device as the first electronic device 100.
  • Free network adjustment refers to the reasonable allocation of accidental errors of observations, pre-correction of systematic errors of observations, and the use of certain observation principles and manual methods to control the gross errors of observations. .
  • the control network is fixed on the known data based on the known starting data. When there is no necessary starting data in the network, we call it a free network, and the adjustment method when there is no starting data, that is, free network adjustment.
  • Space intersection Determine the object space coordinates of the point from the internal and external orientation elements of the left and right images of the stereo image pair, and the image coordinates of the image point with the same name (in a tentative three-dimensional coordinate system). Coordinates or ground measurement coordinate system coordinates) method.
  • the shooting position in this document can be understood as the position in the light (or the center of photography) of the camera of the first electronic device 100 when an image is taken.
  • shooting the first image and the second image in different shooting directions refers to taking the subject (such as the target object) as the center and choosing different shooting points around the target object to shoot the first image and the second image , And the two shooting points are not on the same straight line with the target object.
  • different shooting directions can show different side images of the target object.
  • 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 of the shooting center of the two images, and the angle is not zero and Not 180 degrees.
  • 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 end points of the target object, it can be the vertex of the target object, and so on.
  • FIG. 5A a flowchart of a digital photogrammetry method provided by an embodiment of this application is specifically as follows:
  • the surveyor may carry the first electronic device 100 and shoot the first image and the second image of the target object in different shooting directions at different shooting positions.
  • the meaning of the shooting position and the shooting direction can be referred to the above description, which will not be repeated here.
  • the first image and the second image captured are sent to the server 200 through the first electronic device 100, and the server 200 performs subsequent data processing.
  • the first electronic device 100 may be a portable device or a device commonly used by surveyors, such as a mobile phone, a tablet computer, a camera, a wearable device with a camera, or a device connected with a camera, etc. In this way, special measuring equipment is avoided during the measurement process, which is beneficial to reduce the cost of measurement and is convenient for measurement personnel to carry.
  • the surveyor can open the survey application in the mobile phone and call the camera to take pictures.
  • 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 in different shooting directions.
  • the prompt information 601 shown in FIG. 6A the prompt information 602 shown in FIG. 6B
  • the prompt information 603 shown in FIG. 6C the prompt information 604 shown in FIG. 6D.
  • the mobile phone can upload the captured first image and second image to the server 200 for processing.
  • the measurement error can be reduced to 2% and less than 2%.
  • the distance between the photography 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, for example, it can be any one of the two end points of the target object, it can be the vertex of the target object, and so on. If the distance between the photography centers P2 and P1 where the second image is taken is controlled within a range greater than D/20 and less than D, the measurement error can be reduced to 2% and below 2%.
  • the server 200 may first identify rigid bodies and unchanging feature areas in the first image and the second image as effective areas, or identify non-rigid and changeable areas in the first image and the second image.
  • the object is an invalid area.
  • relevant data processing procedures are performed for the effective areas in the first image and the second image.
  • the area of the changeable object in the first image and the second image is excluded, and only the effective areas in the first image and the second image are processed subsequently, which greatly reduces the amount of data for subsequent processing, which is beneficial Improve data processing efficiency.
  • the server 200 may adopt a semantic segmentation method to perform full-element 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 region. Then, the server 200 may add a gray mask to the invalid areas in the first image and the second image to mask the invalid areas in the first image and the second image.
  • the semantic segmentation method includes but is not limited to using the open source deep learning training model DeepLab-v3, etc., which is not limited in the embodiment of the present application.
  • the server 200 may also perform color equalization on the images of the unchanging feature regions (that is, the effective regions) that have been identified in the first image and the second image.
  • algorithms such as histogram stretching, histogram regularization, Kama transformation, etc., can be used for the effective areas in the first image and the second image to achieve color equalization.
  • the server 200 calculates the grayscale histogram for the image of the effective area in the first image, respectively.
  • the gray histogram is to count all the pixels of the image according to the size of the gray value, and count the frequency of their appearance.
  • the server 200 discards a part of pixels with larger gray values according to the grayscale histogram of the image in the effective area in the first image (for example, the number of discarded pixels accounts for 0.5% of the total number of pixels in the effective area image), and/ Or, discard a part of pixels with a small gray value (for example, the number of discarded pixels accounts for 0.5% of the total number of pixels in the effective area) to obtain a cutoff threshold.
  • a linear transformation formula is constructed according to the truncation threshold, and the gray-scale histogram is stretched to realize the color equalization of the image in the effective area in the first image.
  • the server 200 can perform color equalization on the effective area image in the second image.
  • the color equalization of the effective area in the first image and the second image is beneficial to reduce the environmental factors (for example, weather conditions, light conditions, etc.) during shooting and the camera specifications used for shooting. Influence, improve the accuracy of subsequent feature point matching and dense matching.
  • the server 200 performs feature point matching, free network adjustment and dense matching for the image of the area of the feature in the first image to obtain a digital three-dimensional space.
  • feature point matching includes feature extraction, feature description and feature matching.
  • the server 200 extracts feature points from the effective area image of the first image and the effective area image of the second image after the above-mentioned processing, and then describes each feature point separately. Compare the degree of 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. The feature points whose similarity degree is higher than the threshold A are judged whether they are the same feature point (that is, the feature point with the same name), that is, the feature matching is completed.
  • the server 200 can use any technology known in the related technical field to match the feature points in the first image and the second image, which is not specifically limited in the embodiment of the present application.
  • the server 200 may use feature description operators such as scale-invariant feature transform (SIFT) and accelerated robust features (SURF) for feature description.
  • SIFT scale-invariant feature transform
  • SURF accelerated robust features
  • the server 200 may use the least square method to perform feature matching.
  • the effective area image of the first image and the feature points with the same name in the effective area of the second image constitute the connection points of the two images.
  • the server 200 performs gross error elimination and adjustment based on these connection points, that is, free network adjustment. Then perform the spatial rear interactive calculation according to the connection points after the free network adjustment, and obtain the relative outer orientation elements of the two images. Based on the relative external orientation elements of the two images, an epipolar image is constructed and dense matching is performed, that is, a pixel-by-pixel spatial front intersection calculation is performed to obtain three-dimensional dense point clouds, which constitute a digital three-dimensional space.
  • the 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 contour of the surface of the object.
  • the number of points obtained by this method is relatively large and dense, which is a dense point cloud.
  • the position, size, and direction of the digital three-dimensional space obtained by performing processing such as free network adjustment and dense matching based on the first image and the second image in the embodiment of the present application are inconsistent with the real three-dimensional world.
  • the size of each object in the digital three-dimensional space is in proportion to the actual size of each object in the real three-dimensional world; the distance between each object in the digital three-dimensional space is proportional to the distance between each object in the real three-dimensional world The ratio is the same.
  • 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 can display related prompt information or play related voice prompts to prompt the surveyor to take the first image and the second image again, or to take the first image again. Two images.
  • the server 200 may pass the first image
  • An electronic device 100 prompts the surveyor, "Please take the first image and the second image again, and make sure that the two shots are aimed at the same target.”
  • the server 200 can be used to prompt the surveyor “please take the first image and the second image again, and make sure to take pictures at different positions”.
  • the following formula can be used to calculate the image point position deviation ⁇ P of the feature point with the same name (denoted as P point) on the first image and the second image:
  • (Px 1 , Py 1 ) are the pixel coordinates of the P point in the first image; (Px 2 , Py 2 ) are the pixel coordinates of the P point in the second image.
  • the surveyor can also use the first electronic device 100 to input information about objects of known sizes in the first image and the second image, for example, two objects including objects of known sizes in the first image.
  • the surveyor can distinguish a first object of a known size from the first image and the second image, mark the two end points of the first object in the first image and the second image, and pass The first electronic device 100 inputs the size of the first object.
  • the surveyor may also place a first object of a known size within the viewing range of the camera when shooting the first image and shooting the second image. That is, when the first image and the second image are taken, the first object is also taken in both the first image and the second image. After taking the first image and the second image, the surveyor can mark the two end points 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.
  • the first electronic device 100 compares the positions of the two end points of the first object in the first image (for example, the image point coordinates in the first image), and the positions of the two end points of the first object in the second image (for example, in the The image point coordinates in the second image) and the real size S1 of the first object are sent to the server 200.
  • the server 200 may first calculate the coordinates of the two end points of the first object in the digital three-dimensional space according to the positions of the two end points of the first object in the first image and the positions of the two end points in the second image, and then Calculate the distance between these two coordinates, which is the size S2 of the first object in the digital three-dimensional space.
  • 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 surveyor can mark the positions of the two end points of the first object of known size on the two images respectively (ie A total of four positions).
  • the mobile phone can also make an auxiliary line in the other image according to the position of the end point in the image and the geometric relationship of the stereo pair. To help the surveyor mark the location of the endpoint in another image.
  • both the first image and the second image displayed by the mobile phone include A4 paper of a known length, and the length of the A4 paper is 29.7 cm.
  • the surveyor can mark the two end points of the long side of the A4 paper in the first image and the second image respectively.
  • the surveyor can first mark the two end points E1 and F1 of the long side of the A4 paper in the first image.
  • the two end points E1 and F1 of the long side of the A4 paper can be marked to make the marking more accurate.
  • the mobile phone can make auxiliary lines in the second image with the two end points E1 and F1 marked in the first image and the geometric relationship of the stereo image pair.
  • the dotted line (1) is the auxiliary line corresponding to the end point E1, and the surveyor can mark the corresponding end point E2 in the second image according to the auxiliary line.
  • the dashed line (2) is the auxiliary line corresponding to the end point F1, and the surveyor can mark the corresponding end point F2 in the second image according to the auxiliary line.
  • the mobile phone calculates the pixel coordinates of E1 and F1 in the first image, and the pixel coordinates of E2 and F2 in the second image.
  • the mobile phone can also prompt the surveyor 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.
  • the server 200 may also identify two end points of a first object of known size in the first image and the second image, and the actual size S1 between the two end points of the first object.
  • a benchmark with a fixed length and an appearance that can be easily recognized by the server 200 may be designed as the first object.
  • the surveyor places the benchmark in the viewing range of the first electronic device 100, that is, the first image and the second image both include the benchmark.
  • the designed benchmark may be a plurality of rod-shaped objects distributed in intervals of colors.
  • the server 200 can determine the position of the end point of the benchmark by automatically locking the specific color in the rod-shaped object in the first image and the second image. And the actual size S1 between the two endpoints of the benchmark is known.
  • the design of the benchmark and the method of identifying the two endpoints of the benchmark will be described in detail below, and will not be explained here.
  • the server 200 may also first identify the two endpoints of the first object with a known size in the first image and the second image. If the recognition fails, the first electronic device 100 can be used to prompt the surveyor to manually input the relevant information of the first object of known size, such as the positions of the two end points of the first object in the first image, and the first object in the second image. The position of the two end points, and the actual size of the first object S1, etc.
  • the server 200 recognizes the two end points of the first object with a known size in the first image and the second image
  • the first electronic device 100 may also be used to prompt the surveyor to check the information of the first object at the recognition Etc. to ensure the accuracy of the recognition results.
  • the server 200 obtains the scale scaling ratio between the digital three-dimensional space and the real space according to 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. S1/S2.
  • S505. Determine the distance between the two end points of the target object according to the digital three-dimensional space and the scale scaling ratio, the first image and the second image.
  • the server 200 may receive the positions of the two end points of the target object sent by the second electronic device 300, including the image point coordinates of the two end points of the target object in the first image and the two end points of the target object in the second image.
  • the coordinates of the image point in. Perform spatial front intersection according to the image point coordinates of the two end points of the target object, and calculate the coordinates of the two end points of the target object in the digital three-dimensional space.
  • the U point (x3, y3, z3) and the V point (x4, y4, z4) are the coordinates of the two end points of the target object calculated by the server 200 in the digital three-dimensional space.
  • the distance between the U point and the V point in the digital three-dimensional space can be calculated according to the coordinates of the U point and the V point in the digital three-dimensional space, and then the distance between the U point and the V point in the digital three-dimensional space and the scale scaling ratio are calculated. The actual distance between the endpoints.
  • 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 end points of the target object input by the measuring person, and calculates the distance between the two end points of the target object according to the digital three-dimensional space and the scale scaling ratio.
  • 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 surveyor can mark the positions of the two end points of the target object on the two images respectively (that is, a total of four positions) .
  • the specific marking method is the same as the method for marking the two end points of the first object in step S503, and will not be repeated here.
  • the surveyor marks the two endpoints S1 and R1 of the target object in the first image.
  • the surveyor marks the two end points S2 and R2 of the target object in the second image.
  • 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 to measure the length of the display.
  • the second electronic device 300 may be the same device as the first electronic device 100.
  • the distance between the two end points of the target object may be the height, length, width, etc. of the target object.
  • the distance between the two end points of the target object may be the distance between the two target objects, etc.
  • the measurement method can be used in the digital survey of telecommunication base stations to obtain information such as equipment size, cable length, and installation spacing. It can also be used in other engineering surveys or daily life, such as measuring the distance between buildings.
  • the surveyor can use the first electronic device 100 to shoot the first image and the second image in two different shooting positions in different shooting directions. 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 first object with a 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 end points 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.
  • the embodiments of this application are in different shooting positions. , Shooting images in different shooting directions is convenient and highly reliable.
  • the actual size of the first object is used 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.
  • the measurement method provided in the embodiments of the present application can be applied to a wider range of measurement scenarios.
  • 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. Confirmed as the ground. Further, according to the normal vector of the ground and the shooting positions of the first and second images, the direction of the sky is determined.
  • the server 200 can calculate the distance between the top of the target object and the ground, that is, the height of the target object, according to the top of the target object, the ground position, and the sky direction, so as to expand the usage scenarios of the measurement method provided in the embodiments of the present application.
  • the server 200 can calculate the height of the target object, it is also possible to complete the measurement of the height of the target object only by marking the top position in the first image and the second image, without marking the bottom position.
  • FIG. 7A it is a schematic flowchart of another digital image measurement method provided by an embodiment of this application.
  • the measurement method includes the above steps S501 to S504, and steps S701 to S702, which are specifically as follows:
  • the ground is the most complicated and most distributed plane. Therefore, the regions 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 sky direction or the gravity direction. Further, since the imaging center of the first image or the second image is determined to be located above the ground, the sky direction in the digital three-dimensional space can be determined.
  • the server 200 may use the following steps to determine the ground and sky directions in the digital three-dimensional space, as follows:
  • Step a Determine the photographing midpoint of the first image and the photographing center of the second image in the digital three-dimensional space.
  • the center of the line connecting the photographic centers of the two images is set to O (O x , O y , O z ) point, and the O point is taken as the center of the sphere to construct a virtual sphere.
  • Step b gridding the virtual sphere in the manner of latitude and longitude.
  • the longitude is denoted as Lon, and the value range is (-180°,180°].
  • the latitude is denoted as Lat, and the value range is (-90°,90°).
  • as the sampling interval, there are a total of 360 on the virtual sphere *180 grid points.
  • the sampling interval can also be other degrees. This application does not limit the number of grid points on the virtual sphere.
  • Step c Taking the center of the sphere O as the starting point, draw a ray to the grid points on the sphere to form 360*180 vectors, denoted as Represents 360*180 directions.
  • Step d Starting from the position of the virtual center of the sphere, move along Arrange n (for example, 10) virtual cylinders with a height of m meters (for example, 0.2 meters) and a radius of r meters (for example, 50 meters) at equal intervals in the direction, denoted as Where i is the cylindrical marking code, i ⁇ 1,2,...,10 ⁇ .
  • n the cylindrical marking code, i ⁇ 1,2,...,10 ⁇ .
  • the height and radius of the virtual cylinder are designed according to the size of the real three-dimensional world. Therefore, corresponding to the digital three-dimensional space, it needs to be divided by the size scaling ratio S1/S2.
  • 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, which is not limited in the embodiment of the present application.
  • Step e Calculate the number of three-dimensional discrete points in the "bounding box" formed by 360*180*n virtual cylinders formed in steps d and e, respectively, and record the direction corresponding to the largest number of bounding boxes And the mark code i Mark . Then the sky direction is In the opposite direction of, the distance between the ground position and the center O of the virtual sphere is m*i Mark .
  • S702 According to the position of the ground, the direction of the sky, the digital three-dimensional space, the first image and the second image, determine the distance from the top of the target object to the ground as the height of the target object.
  • the server 200 may receive the position of the top of the target object sent by the second electronic device 300, including the coordinates of the top of the target object in the first image and the coordinates of the top of the target in the second image. Perform spatial forward intersection according to the image point coordinates of the top of the target object, and calculate the coordinates of the top of the target object in the digital three-dimensional space.
  • T point (x1, y1, z1) is the coordinates of the top of the target object calculated by the server 200 in the digital three-dimensional space.
  • G point (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-angled trapezoid), and the height H in the vertical direction can be used as the right-angled side to construct a triangle (or right-angled trapezoid). Understand the triangle based on the geometric primitives, and the length H of the right-angle side is the height of the target object.
  • 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 measuring person, and calculates the height of the target object according to the third three-dimensional space.
  • 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 surveyor can mark the position of the top of the target object on the two images (that is, a total of two positions).
  • the specific marking method is the same as the method for marking the two end points of the first object in step S503, and will not be repeated here.
  • the second electronic device 300 may be the same device as the first electronic device 100.
  • the measurement method provided in the embodiment of the present application can be applied to a digital survey scenario of a telecommunication base station, and is used to obtain the height of a long-distance high tower and various equipment on the tower. It can also be applied to other engineering surveys or daily life, such as measuring the height of buildings.
  • FIG. 8 it is a schematic diagram of a benchmark given in an embodiment of this application.
  • the benchmark is a rod-shaped object with a four-color segmented design.
  • the four colors include black, white, color 1 and color 2.
  • color 1 and color 2 are different, and both color 1 and color 2 are not black or white.
  • Color 1 and color 2 can select a pair of complementary colors from the hue circle.
  • Figure 9 shows a schematic diagram of a 24-color hue circle.
  • color 1 and color 2 may be red and cyan.
  • Color 1 and color 2 can also be magenta and green.
  • color 1 and color 2 can also be close to two complementary colors. Taking color 1 as red as an example, color 2 can also be cyan to blue or cyan to green. Since the two colors in the complementary colors are more distinguishable, it is convenient for the server 200 to accurately recognize the two colors.
  • the order of the four-color segments on the benchmark is: black, white, color 1, white, color 2, white, and black.
  • the boundary points between the black segment and the white segment that is, point A and point B
  • the distance between these two endpoints is the actual size S1 of the first object.
  • the segment length of each color between the two endpoints is equal, and is the first length S0, for example, 10 cm.
  • S1 5*S0
  • the total length of the benchmark is greater than 5*S0.
  • the material of the benchmark post can be plastic or carbon, which has the characteristics of not being easily deformed and non-conductive.
  • the diameter of the benchmark can be 1 to 2.5 cm.
  • the benchmarks are straight rods, including but not limited to cylindrical, elliptical, triangular, and quadrangular prisms.
  • the benchmark can also be designed to be foldable, that is, the benchmark can be divided into at least two sections and connected by bolts or rubber bands, which is convenient for assembly and disassembly.
  • FIG. 10 it is a schematic diagram of another benchmark provided by an embodiment of this application.
  • a white segment is added to the black segments at both ends of the benchmark shown in FIG. 8 (here, the length of the black segments at both ends of the benchmark is also S0).
  • the junction points of the black segment and the white segment at both ends of the benchmark that is, point C and point D
  • the distance between these two endpoints is the actual size S1 of the first object.
  • the segment length of each color between the two endpoints is equal, and is the first length S0, for example, 10 cm.
  • S1 7*S0
  • the total length of the benchmark is greater than 7*S0.
  • the embodiment of this application does not limit the specific form of the benchmark.
  • the surveyor can place the benchmark as shown in FIG. 8 or the benchmark as shown in FIG. 10 in the viewfinder of the camera when using the first electronic device 100 to take the first image and the second image. Scope. Then, both the first image and the second image include the benchmark.
  • the server 200 can use deep learning and morphological synthesis methods to determine the approximate position of the benchmark in the two images for the first image and the second image, and then lock the center of the benchmark according to the linear characteristics and color characteristics of the benchmark. String. Then, according to the center line of the benchmark, the known segmentation relationship of each color in the benchmark, and the amount of gray change in the image, the two endpoints in the benchmark are precisely locked, that is, the two endpoints of the first object.
  • the method for the server 200 to identify the two endpoints of the benchmark is described in detail.
  • the method specifically includes:
  • Step a Predict the position range of the benchmark in the first image and the second image respectively, and mark it as the first range.
  • the two images can be switched first, that is, each image is cut into small pieces, that is, sliced images.
  • the size of each slice image may be, for example, 500*500 pixels, and a certain degree of overlap may be reserved between the slice image and the surrounding slice images, such as 50% overlap. It should be noted that the slicing process is to increase the proportion of pixels of the benchmark in the sliced image, which is more helpful for target detection.
  • a deep learning method can be used to perform target detection for the slice image of the first image and the slice image of the second image, respectively, to obtain the approximate positions of the benchmarks in the first image and the second image.
  • the models used for target detection include but are not limited to Mask R-CNN.
  • the server 200 may also preprocess the first image and the second image.
  • a general optical camera has imaging distortion.
  • the camera of the first electronic device 100 is a fish-eye lens
  • a spherical-to-center projection perspective transformation needs to be performed on each image.
  • 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.
  • the image of the benchmark in the first image and the image of the benchmark in the second image that are identified based on the deep learning method can be further adopted the morphological opening operation of "corrosion first, then expansion" to remove small areas 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 expansion should be greater than the scale of morphological corrosion.
  • the scale of morphological expansion is 30 pixels, and the scale of morphological erosion is 10 pixels.
  • FIG. 11A it is an example of the first image or the second image, and the image includes a benchmark.
  • the approximate position of the benchmark in the image can be obtained, as shown in the white area in FIG. 11B.
  • Step b Determine a region with linear characteristics from the images in the first range in the first image and the second image, which is the more accurate position range of the benchmark, and it 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.
  • a filter may be used to determine a region with linear characteristics from the first image and the second image.
  • the filter can be the real part of the two-dimensional Gabor function, and the formula for constructing the filter is:
  • some Gabor kernel function directions can be selected. For example, select 9 directions, for example, ⁇ is 0°, 20°, 40°, 60°, 80°, 100°, 120°, 140°, 160°, that is, 9 Gabor filters are constructed respectively.
  • the constructed filter is used to process the first image and the second image to extract linear features in the image. For example, set the size of the Gabor filter window to any odd number between 21 and 51. Then, the images in the first range of the first image and the second image are filtered multiple times through a sliding window to obtain the Gabor feature value of the image in the i-th row and the j-th column in the ⁇ direction, denoted as T Gabor- ⁇ (i,j).
  • the final Gabor eigenvalue is the maximum value of the absolute value of the Gabor eigenvalue in multiple directions (for example, 9 directions), as shown in the following formula:
  • the area where the Gabor feature value is greater than the threshold D is an area with obvious linear features, which can be considered as a more accurate position range of the benchmark.
  • the white area in the image is an area with obvious linear features determined in step b.
  • the overlapped area is a more accurate position range of the benchmark.
  • Step c Identify the color features of the benchmark from the images in the second range in the first image and the second image, and combine the design of the benchmark to identify the two endpoints of the benchmark.
  • superpixel segmentation algorithms include but are not limited to simple linear iterative clustering (SLIC), mean-shift algorithm (Mean-shift), and so on.
  • SLIC simple linear iterative clustering
  • Mean-shift mean-shift algorithm
  • the size of the super pixel is, for example, 50 to 100 pixels.
  • the image after the super pixel segmentation is converted from RGB space to HSL ((Hue), saturation (Saturation), brightness (Lightness)) space, and through the hue threshold segmentation method, from the first image and the second image, respectively
  • Two color blocks are extracted from the image in the second range, namely the color block corresponding to color 1 and the color block corresponding to color 2.
  • the threshold of the hue is selected in the benchmark design The color is related.
  • the gray value change mentioned above is close to and slightly less than 255 at the maximum. Since the gray value of black in the image is close to and slightly higher than zero, the gray value of white in the image is close to and slightly less than 255. Then, the boundary point between the black color block and the white color block is the maximum change in gray value.
  • the benchmark as shown in FIG. 8 on the extension line on one side of the line connecting the centers of gravity of two color patches, a position where the gray value changes the most, such as point A, can be determined.
  • a position where the gray value changes the most such as point B
  • the two determined endpoints can be further verified according to the positional relationship of each color block in the benchmark. For example, the center of gravity of the color block where color 1 is located is 2*s0 from the center of gravity of the color block where color 2 is located.
  • point A is 1.5*s0 from the center of the color block where color 1 is located, or if point A is 2.5*s0 from the center of the color block where color 2 is located, then the recognition of point A is considered accurate. If point B is 2.5*s0 from the center of the color block where color 1 is located, or point B is 1.5*s0 from the center of the color block where color 2 is located, then point B is considered accurate.
  • two positions where the gray value changes the most such as point A and point C
  • point C is an end point in the benchmark based on the distance between point C and the center of gravity of the color patch is greater than the distance between point A and the center of gravity of the color patch.
  • it can further determine whether the recognition of point C is accurate according to 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 from the center of gravity of the color block where color 2 is located.
  • the distance between point C and point A is s0, it can be considered that the recognition of point C is correct.
  • the two positions where the gray value changes the most can be determined, such as point B and point D.
  • point D is the other end point in the benchmark.
  • other methods can also be used to verify the accuracy of the C point or D point identified by the server 200, which is not limited in the embodiment of the present application.
  • the distance between point A and point B can also be defined as the distance between the two end points of the benchmark that the server 200 needs to recognize, which is not limited in the embodiment of the present application.
  • the color patch 1002 corresponding to color 1 and the color patch 1003 corresponding to color 2 are identified. Then, on the extension line of the line connecting the center of gravity of the color patch 1002 and the center of gravity of the color patch 1003, the four endpoints where the gray value changes the most are found, namely point A, point C, point B, and point D. Further, according to the positional relationship of each segment, it can be determined that point C and point D are the two end points of the benchmark.
  • the server 200 can identify the two end points of the benchmark as the two end points of the first object, there is no need for the surveyor to mark the two end points of the first object in the first image and the second image through the first electronic device 100.
  • the endpoint can simplify the operation of the measurement personnel and make the measurement more automated.
  • the above embodiments construct a digital three-dimensional space based on the first image and the second image, and then determine the scale scaling ratio, ground position and sky direction of the digital three-dimensional space and the real three-dimensional world, and finally according to the digital three-dimensional space, scale scaling, ground
  • the position and sky direction directly calculate the distance between the two endpoints of the target object, or calculate the height of the target object as an example.
  • the obtained digital three-dimensional space is scaled, translated, rotated, etc., so that the digital three-dimensional space is adjusted to be consistent with the real three-dimensional world. Then, the distance between the two end points of the target object is calculated according to the adjusted digital three-dimensional space, or the height of the target object is calculated.
  • the embodiment of the application does not limit this.
  • the chip system includes at least one processor 1101 and at least one interface circuit 1102.
  • the processor 1101 and the interface circuit 1102 may be interconnected by wires.
  • the interface circuit 1102 may be used to receive signals from other devices (such as the memory of the server 200).
  • the interface circuit 1102 may be used to send signals to other devices (such as the processor 1101).
  • the interface circuit 1102 may read an instruction stored in the memory, and send the instruction to the processor 1101.
  • the server 200 can be made to execute each step executed by the server 200 in the above-mentioned embodiment.
  • the chip system may also include other discrete devices, which are not specifically limited in the embodiment of the present application.
  • the above-mentioned terminal and the like include hardware structures and/or software modules corresponding to each function.
  • the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the embodiments of the present invention.
  • the embodiment of the present application may divide the above-mentioned terminal and the like into functional modules according to the above-mentioned method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in the embodiment of the present invention is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 13 shows another possible structural schematic diagram of the server involved in the foregoing embodiment.
  • the server 200 includes an acquiring unit 1301, a constructing unit 1302, and a determining unit 1303.
  • the acquiring unit 1301 is configured to acquire a first image and a second image, both of the first image and the second image include a target object and a first object with a known actual size; wherein, the first image The shooting position of the second image is different from that of the second image, and the shooting directions of the first image and the second image are different.
  • the constructing unit 1302 is used for digital three-dimensional space based on the first image and the second image.
  • the determining unit 1303 is configured to determine the distance between the two end points 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 equal 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 are related.
  • the determining unit 1303 is further configured to: determine that the plane with the most densely distributed discrete points in the digital three-dimensional space is the ground of the digital three-dimensional space; according to the ground of the digital three-dimensional space and the first image The camera center of the digital three-dimensional space, or determine the sky direction of the digital three-dimensional space according to the ground of the digital three-dimensional space and the camera center of the second image; according to the digital three-dimensional space, the zoom ratio, and the digital three-dimensional space The ground and the sky direction of the digital three-dimensional space determine the height of the target object.
  • the above-mentioned obtaining unit 1301 may be the communication interface 230 of the server 200.
  • the foregoing construction unit 1302 and determination unit 1303 may be integrated together, and may be the processor 210 of the server 200.
  • the functional units in the various embodiments of the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • 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.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage
  • the medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Geometry (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Analysis (AREA)

Abstract

一种数字摄影测量方法、电子设备及系统,涉及电子技术领域,可以降低采集图像时的操作复杂度,扩展数字摄影测量的适用场景,增加测量的可靠性,该方法包括:在不同拍摄位置,以不同的拍摄方向拍摄第一图像和第二图像,第一图像和第二图像中都包括目标物体和实际尺寸已知的第一物体;根据第一图像和第二图像,构建数字三维空间;根据数字三维空间,以及数字三维空间与真实的三维空间的尺寸的缩放比例确定目标物体的两个端点之间的距离,其中,缩放比例与第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸有关。

Description

一种数字摄影测量方法、电子设备及系统
本申请要求于2020年2月28日提交国家知识产权局、申请号为202010131656.2、申请名称为“一种数字摄影测量方法、电子设备及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子技术领域,尤其涉及一种数字摄影测量方法、电子设备及系统。
背景技术
针对通讯基站的勘测工作,包括不限于室内外设备尺寸、高度、部署间距的测量等,是通讯基站站点设计、设备部署、物料发送、风险检测等工作的重要前提。传统的勘测手段为室外尺量、室内手绘。传统的勘测手段存在工作量大,可靠性差,且危险性高等问题。为此,运营商和塔商等更多地采用数字摄影测量方法,完成针对通讯基站的勘测工作。
数字摄影测量是利用计算机对数字影像或数字化影像进行处理,用计算机视觉代替人眼的立体量测与识别,完成几何与物理信息的自动提取。
其中,基于地面序列图像的测量方案常被使用。测量人员可使用手机或相机等,拍摄大量包含控制点的照片或者视频,然后对这些照片或视频进行相关的数据处理。需要注意的是,测量人员在拍摄照片或视频之前,需要遵循严格的距离关系和方位关系布设多个代表控制点的标靶。布设标靶过程复杂且不可靠。另外,布设多个标靶还需要占据一定的空间,在一些狭小的空间、倾斜屋顶等场景中难以实施。
可见,亟需一种操作便利,适用更广测量场景的且可靠的数字摄影测量方法。
发明内容
本申请提供的一种数字摄影测量方法、电子设备及系统,可以降低图像采集的操作复杂度,扩展数字摄影测量的适用场景,增加测量的可靠性。
为了实现上述目的,本申请实施例提供了以下技术方案:
第一方面、本申请提供的一种方法,包括:获取第一图像和第二图像,第一图像和第二图像中都包括目标物体和实际尺寸已知的第一物体;其中,第一图像与第二图像的拍摄位置不同,且,第一图像与第二图像的拍摄方向不同;根据第一图像和第二图像,构建数字三维空间;根据数字三维空间,以及数字三维空间与真实的三维空间的尺寸缩放比例确定目标物体两个端点之间的距离,其中,缩放比例与第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸S1有关。
其中,数字三维空间以三维点云的形式呈现。三维点云,是指三维空间中物体表面的点数据的集合,可反映物体表面轮廓。目标物体的两个端点,是指待测量距离的两个端点。需要说明的是,这里的目标物体可以为一个,目标物体的两个端点之间的距离可以是目标物体的高度、长度、宽度等。目标物体也可以为两个,则目标物体的两个端点之间的距离可以为两个目标物体之间的间距等。
相较于现有技术中,测量人员需要预先遵循严格的距离关系和方位关系布设多个控制点的标靶,并拍摄大量包含标靶的照片或者视频而言,本申请实施例在不同拍摄位置、以不同拍摄方向两次拍摄图像的操作更便利。并且,本申请实施例中使用第一物体的实际尺寸确定数字三维空间的尺寸缩放比例,有利于提升测量的可靠性。再有,由于在狭小机房、倾斜屋顶等场景中也能够实现在不同拍摄位置,以不同拍摄方向拍摄图像,因而本申请实施例提供的测量方法可以适用于更广的测量场景。
一种可能的实现方式中,该方法还包括:根据数字三维空间的地面和第一图像的摄影中心,或者根据数字三维空间的地面和第二图像的摄影中心,确定数字三维空间的天空方向;其中,数字三维空间的地面为数字三维空间中离散点分布最密集的平面;根据数字三维空间、缩放比例、数字三维空间的地面和天空方向,确定目标物体的高度。
其中,三维离散点分布最密集的平面为单位空间内点数据的数量值最大的平面。
上述高度测量实现方法,使本申请实施例可适用于更多的测量场景。例如,在一些可能由于目标物体较高、或者目标物体的底端被遮挡的场景中,可以通过拍摄到的顶端计算出目标物体的高度。另外,在本申请实施例提供的方案中,可以只需在第一图像和第二图像中标记顶端的位置即可完成对目标物体高度的测量,而无需标记底端的位置,简化测量人员的操作。
一种可能的实现方式中,在根据数字三维空间及其与真实的三维空间的尺寸的缩放比例,确定目标物体两个端点之间的距离之前,该方法还包括:获取第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸S1;根据第一图像中第一物体的位置、第二图像中第一物体的位置,计算数字三维空间中第一物体的尺寸S2;根据第一物体的实际尺寸S1和数字三维空间中第一物体的尺寸S2,计算得到数字三维空间与真实的三维空间的尺寸的缩放比例。
其中,第一图像中第一物体的位置,可以为第一图像中第一物体的像点坐标。类似的,第二图像中第一物体的位置,可以为第二图像中第一物体的像点坐标。
由此,提供一种根据已知尺寸的第一物体的实际尺寸S1,以及计算数字三维空间中第一物体的尺寸S2,计算缩放比例的方法。由于第一物体的实际尺寸为准确的数据,有利于提高计算的缩放比例的准确性,提升测量的可靠性。
一种可能的实现方式中,获取第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸S1,包括:接收输入的第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸S1;或者,识别第一图像中第一物体的位置,以及第二图像中第一物体的位置,以及查找第一物体的实际尺寸S1。
由此,提供了一种可由测量人员手动标记第一物体两个端点的位置,以及输入第一物体的实际尺寸的方法,也提供了一种服务器自动识别第一物体两个端点的位置,以及查找第一物体的实际尺寸的方法。丰富了获取第一物体两个端点位置和第一物体实际尺寸的方式。
一种可能的实现方式中,第一物体为分段设计的标杆,第一物体至少包括顺序排列的第一黑色分段、第一白色分段、第一彩色分段、第二白色分段、第二彩色分段、第三白色分段、第二黑色分段;其中,第一彩色分段的颜色和第二彩色分段的颜色为 一对互补色;第一物体的实际尺寸S1为第一物体的两个端点之间的长度,第一物体一个端点位于第一黑色分段和第一白色分段的交界处,第一物体另一个端点位于第三白色分段和第二黑色分段的交界处;第一图像中第一物体的位置为第一图像中第一物体的两个端点的位置;第二图像中第一物体的位置为第二图像中第一物体的两个端点的位置。
由此,提供了一种特定设计的标杆,可作为第一物体,便于服务器自动识别出该第一物体中两个端点,简化测量人员的操作。
一种可能的实现方式中,识别第一图像中第一物体的位置,以及第二图像中第一物体的位置,包括:识别出第一图像中第一彩色分段和第二彩色分段,以及第一图像中具有直线特征的第一区域;识别出第二图像中第一彩色分段和第二彩色分段,以及第二图像中具有直线特征的第二区域;根据第一图像中第一彩色分段和第二彩色分段,第一图像中具有直线特征的第一区域,以及第一物体中各个颜色分段的位置关系,自动确定出第一图像中第一物体的两个端点的位置;以及根据第二图像中第一彩色分段和第二彩色分段,第二图像中具有直线特征的第二区域,以及第一物体中各个颜色分段的位置关系,自动确定出第一图像中第一物体的两个端点的位置。由此,提供了一种识别标杆的两个端点的方法。
在一个具体的实现方式中,可以采用滤波器从第一图像和第二图像中确定具有直线特征的区域。其中,滤波器具体可以为二维Gabor函数的实部。
一种可能的实现方式中,第一彩色分段为红色分段,第二彩色分段为青色分段;或者,第一彩色分段为品色分段,第二彩色分段为绿色分段。
需要注意的是,考虑到拍摄光线不足时,拍摄的图像中蓝色与黑色不易区分。拍摄光线过亮时,黄色与白色不易区分。因此,第一彩色分段和第二彩色分段均不为蓝色或黄色。
一种可能的实现方式中,根据第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸S1,计算得到数字三维空间与真实的三维空间的尺寸的缩放比例,包括:根据第一图像中第一物体的位置、第二图像中第一物体的位置,计算数字三维空间中第一物体的尺寸S2;根据第一物体的实际尺寸S1和数字三维空间中第一物体的尺寸S2,计算得到数字三维空间与真实的三维空间的尺寸的缩放比例。由此,提供了一种具体计算所述数字三维空间与真实的三维空间的尺寸的缩放比例的方法。
一种可能的实现方式中,根据数字三维空间,以及数字三维空间与真实的三维空间的尺寸的缩放比例,确定目标物体的两个端点之间的距离,包括:根据数字三维空间、缩放比例、第一图像中目标物体的两个端点的位置,以及第二图像中目标物体的两个端点的位置,确定目标物体的两个端点之间的距离。
一种可能的实现方式中,根据数字三维空间、缩放比例、数字三维空间的地面和数字三维空间的天空方向,确定目标物体的高度,包括:根据数字三维空间、缩放比例、数字三维空间的地面、数字三维空间的天空方向、第一图像中目标物体的顶端的位置,以及第二图像中目标物体的顶端的位置,确定目标物体的高度。
第二方面、提供一种测量装置,包括:获取单元,用于获取第一图像和第二图像, 第一图像和第二图像中都包括目标物体和实际尺寸已知的第一物体;其中,第一图像与第二图像的拍摄位置不同,且,第一图像与第二图像的拍摄方向不同;构建单元,用于根据第一图像和第二图像,数字三维空间;确定单元,用于根据数字三维空间,以及数字三维空间与真实的三维空间的尺寸的缩放比例确定目标物体的两个端点之间的距离,其中,缩放比例与第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸S1有关。
一种可能的实现方式中,确定单元,还用于:根据数字三维空间的地面和第一图像的摄影中心,或者根据数字三维空间的地面和第二图像的摄影中心,确定数字三维空间的天空方向;其中,数字三维空间的地面为数字三维空间中离散点分布最密集的平面;根据数字三维空间、缩放比例、数字三维空间的地面和数字三维空间的天空方向,确定目标物体的高度。
一种可能的实现方式中,在确定单元根据数字三维空间、以及数字三维空间与真实的三维空间的尺寸的缩放比例,确定目标物体的两个端点之间的距离之前,获取单元,还用于获取第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸S1;确定单元,还用于根据所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,计算所述数字三维空间中所述第一物体的尺寸S2;根据所述第一物体的实际尺寸S1和所述数字三维空间中所述第一物体的尺寸S2,计算得到所述数字三维空间与真实的三维空间的尺寸的所述缩放比例。
一种可能的实现方式中,在获取单元获取第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸S1的过程中,获取单元,具体用于:接收输入的第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸S1;或者,识别第一图像中第一物体的位置,以及第二图像中第一物体的位置,以及查找第一物体的实际尺寸S1。
一种可能的实现方式中,第一物体为分段设计的标杆,第一物体至少包括顺序排列的第一黑色分段、第一白色分段、第一彩色分段、第二白色分段、第二彩色分段、第三白色分段、第二黑色分段;其中,第一彩色分段的颜色和第二彩色分段的颜色为一对互补色;第一物体的实际尺寸S1为第一物体的两个端点之间的长度,第一物体一个端点位于第一黑色分段和第一白色分段的交界处,第一物体另一个端点位于第三白色分段和第二黑色分段的交界处;第一图像中第一物体的位置为第一图像中第一物体的两个端点的位置;第二图像中第一物体的位置为第二图像中第一物体的两个端点的位置。
一种可能的实现方式中,在获取单元识别第一图像中第一物体的位置,以及第二图像中第一物体的位置的过程中,获取单元,还具体用于:识别出第一图像中第一彩色分段和第二彩色分段,以及第一图像中具有直线特征的第一区域;识别出第二图像中第一彩色分段和第二彩色分段,以及所述第二图像中具有直线特征的第二区域;根据第一图像中第一彩色分段和第二彩色分段,所述第一图像中的所述第一区域,以及第一物体中各个颜色分段的位置关系,自动确定出第一图像中第一物体的两个端点的位置;以及根据第二图像中第一彩色分段和第二彩色分段,所述第二图像中的所述第二区域,以及第一物体中各个颜色分段的位置关系,自动确定出第一图像中第一物体 的两个端点的位置。
一种可能的实现方式中,第一彩色分段为红色分段,第二彩色分段为青色分段;或者,第一彩色分段为品色分段,第二彩色分段为绿色分段。
一种可能的实现方式中,在确定单元根据第一图像中第一物体的位置、第二图像中第一物体的位置,以及第一物体的实际尺寸S1,计算得到数字三维空间与真实的三维空间的尺寸的缩放比例的过程中,确定单元,具体用于:根据第一图像中第一物体的位置、第二图像中第一物体的位置,计算数字三维空间中第一物体的尺寸S2;根据第一物体的实际尺寸S1和数字三维空间中第一物体的尺寸S2,计算得到数字三维空间与真实的三维空间的尺寸的缩放比例。
一种可能的实现方式中,在确定单元根据数字三维空间,以及数字三维空间与真实的三维空间的尺寸的缩放比例,确定目标物体的两个端点之间的距离的过程中,确定单元具体用于:根据数字三维空间、缩放比例、第一图像中目标物体的两个端点的位置,以及第二图像中目标物体的两个端点的位置,确定目标物体的两个端点之间的距离。
在一示例中,可以接收测量人员手动标记的第一图像中目标物体的两个端点的位置,以及第二图像中目标物体的两个端点的位置,再根据这些位置信息和数字三维空间,以及缩放比例计算出目标物体的两个端点之间的距离。
需要说明的是,这里的目标物体可以为一个,目标物体的两个端点之间的距离可以是目标物体的高度、长度、宽度等。目标物体也可以为两个,则目标物体的两个端点之间的距离可以为两个目标物体之间的间距等。例如,该测量方法可用于电信基站数字化勘测中,用于获取设备尺寸、电缆长度、安装间距等信息。也可以用于其他工程测量或日常生活中,如测量楼宇间距等。
一种可能的实现方式中,在确定单元根据数字三维空间、缩放比例、数字三维空间的地面和数字三维空间的天空方向,确定目标物体的高度的过程中,确定单元具体用于:根据数字三维空间、缩放比例、数字三维空间的地面、数字三维空间的天空方向、第一图像中目标物体的顶端的位置,以及第二图像中目标物体的顶端的位置,确定目标物体的高度。
在一示例中,可以接收测量人员手动标记的第一图像中目标物体的顶端的位置,以及第二图像中目标物体的顶端的位置,再根据这些位置信息、数字三维空间、数字三维空间的地面和天空方向计算出目标物体高度。本申请实施例提供的测量方法,可适用于电信基站数字化勘测场景中,用于获取远距离高塔及塔上各类设备的高度等。也可以适用于其他工程测量或日常生活中,如测量楼宇高度。
第三方面、提供一种服务器,包括一个或多个处理器、一个或多个存储器以及一个或多个通信接口,所述一个或多个存储器、所述一个或多个通信接口与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述一个或多个处理器从所述一个或多个存储器中读取所述计算机指令,以使得所述服务器执行如上述方面及其中任一种可能的实现方式中所述的方法。
第四方面、提供一种芯片系统,包括处理器,当处理器执行指令时,处理器执行 如上述方面中及其中任一种可能的实现方式中所述的方法。
第五方面、提供一种计算机存储介质,包括计算机指令,当计算机指令在服务器上运行时,使得服务器执行如上述方面及其中任一种可能的实现方式中所述的方法。
第六方面、提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述方面中及其中任一种可能的实现方式中所述的方法。
附图说明
图1为本申请实施例提供的一种通信系统的结构示意图;
图2A为本申请实施例提供的一种图像采集方法的示意图;
图2B为本申请实施例提供的另一种图像采集方法的示意图;
图2C为本申请实施例提供的又一种图像采集方法的示意图;
图3为本申请实施例提供的一种电子设备的结构示意图;
图4为本申请实施例提供的一种服务器的结构示意图;
图5A为本申请实施例提供的一种数字摄影测量方法的流程示意图;
图5B为本申请实施例提供的一种计算目标物体两个端点之间距离的方法示意图;
图6A至图6H为本申请实施例提供的一些电子设备的用户界面示意图;
图7A为本申请实施例提供的另一种数字摄影测量方法的流程示意图;
图7B为本申请实施例提供的一种计算目标物体高度的方法示意图;
图8为本申请实施例提供的一种标杆的示意图;
图9为申请实施例提供的一种色相环的示意图;
图10为本申请实施例提供的另一种标杆的示意图;
图11A至图11D为本申请实施例提供的一种识别标杆的方法示意图;
图12为本申请实施例提供的一种芯片系统的结构示意图;
图13为本申请实施例提供的一种装置的结构示意图。
具体实施方式
在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。
在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
如图1所示,为本申请实施例提供的一种通信系统。该通信系统包括第一电子设备100、服务器200,以及第二电子设备300。在一些示例中,第二电子设备300与第一电子设备100可以为同一设备。在另一些示例中,第一电子设备100、服务器200 和第二电子设备300可以为同一设备。也就是说,本申请实施例中所有的步骤均由一个设备完成,例如终端。
其中,第一电子设备100为具有摄像头的设备,可用于拍摄待测目标的图像。例如,第一电子设备100可为手机、平板电脑、相机、可穿戴电子设备等,本申请对第一电子设备100的具体形式不做特殊限制。
具体的,测量人员可以使用第一电子设备100在不同的拍摄位置,以不同的拍摄方向拍摄第一图像和第二图像,其中,第一图像和第二图像均包括目标物体。上述拍摄位置,可理解为拍摄图像时,第一电子设备100的摄像头的光中(或摄影中心)所在的位置。以不同的拍摄方向拍摄第一图像和第二图像,是指以被摄对象(例如目标物体)为中心,围绕目标物体四周选择不同的摄影点拍摄第一图像和第二图像,且两次的摄影点与目标物体不在同一直线上。在拍摄距离和拍摄高度不变的条件下,不同的拍摄方向可展现目标物体不同的侧面形象。或者,以不同的拍摄方向拍摄第一图像和第二图像,也可理解为,目标物体上的Q点分别与拍摄两幅图像的摄影中心的连线形成夹角,该夹角不为零且不为180度。其中,目标物体上的Q点可以为目标物体上的任一点,例如可以目标物体的两个端点中的任一个,可以为目标物体的顶点等。
需要说明的是,在不同拍摄位置、以不同拍摄方向拍摄的第一图像和第二图像可以构成立体像对,以便后续构成数字三维空间,以及基于三角测量原理计算目标对象的两个端点之间的距离和目标对象的高度。
例如,如图2A所示,测量人员可以携带第一电子设备100在某一位置处拍摄待测目标21的第一图像。在拍摄第一图像时,第一电子设备100的摄像头位于第一位置P1。而后,测量人员移动自身的位置,在另一个位置拍摄第二图像。在拍摄第二图像时,第一电子设备100的摄像头位于第二位置P2。其中,目标物体上的顶点Q1点分别与P1点和P2点的连线形成夹角α1。其中,夹角α1不为零且不为180度。图2A所示的测量方法可以使用在室外测量的场景中。比如,测量人员可以面对目标物体(例如房屋、铁塔等),左右移步,实现两次拍照,两个拍摄位置相距数米到数十米不等,可测量远处目标物体。
又例如,如图2B所示,测量人员可以将第一电子设备100举过头顶拍摄目标物体22的第一图像。在使用第一电子设备100拍摄第一图像时,第一电子设备100的摄像头位于第一位置P3。而后,测量人员将第一电子设备100放置腰间拍摄目标物体的第二图像。在使用第一电子设备100拍摄第二图像时,第一电子设备100的摄像头位于第二位置P4。其中,目标物体上的顶点Q2点分别与P1点和P2点的连线形成夹角α2。其中,夹角α2不为零且不为180度。图2B所示的方法可适用于在狭小空间中进行测量,比如狭小的机房等,两个拍摄点距离约0.4~1米,可测量10米以内的目标物体。
又例如,如图2C所示,测量人员可以向身体一侧伸展手臂,拍摄目标物体22的第一图像。在使用第一电子设备100拍摄第一图像时,第一电子设备100的摄像头位于第一位置P5。而后,测量人员向身体另一侧伸展手臂,拍摄目标物体的第二图像。在使用第一电子设备100拍摄第二图像时,第一电子设备100的摄像头位于第二位置P6。其中,目标物体上的顶点Q3点分别与P1点和P2点的连线形成夹角α3。其中, 夹角α3不为零且不为180度。图2C所示的方法可适用于测量人员不便移动位置的场景,比如位于铁塔或屋顶上。那么,测量人员可以分别向左、向右展开手臂,实现两次拍照,两个拍摄点距离约1~2.5米,可测量20~50米以内的目标物体。
一些示例中,还可通过第一电子设备100接收测量人员输入已知尺寸的第一物体的信息,例如第一图像和第二图像中第一物体的两个端点信息,以及第一物体的实际尺寸。其中,第一图像和第二图像均包括该第一物体。
而后,第一电子设备100将拍摄到的第一图像和第二图像发送至服务器200。服务器200根据第一图像和第二图像构建数字三维空间。需要说明的是,数字三维空间中各个物体的尺寸与真实三维世界中各个物体的尺寸的比例相同,数字三维空间中各个物体之间的相对位置关系与真实三维世界中各个物体之间的相对位置关系相同,数字三维空间中各个物体之间的距离与真实三维世界中各个物体之间的距离的比例相同。
服务器200可以识别第一图像和第二图像中的已知尺寸的第一物体的信息,或者从第一电子设备100处接收已知尺寸的第一物体的信息。服务器200可以根据第一物体的实际尺寸和数字三维空间中第一物体的尺寸,求得数字三维空间与真实三维世界的尺度缩放比例。由此,服务器200可以根据尺度缩放比例和数字三维空间计算目标物体两个端点之间的距离。在一种实现方式中,服务器200可以接收第二电子设备300发送的目标物体的两个端点信息,服务器200可以根据目标物体的两个端点信息,以及尺度缩放比例计算两个端点之间的距离。在另一种实现方式中,服务器200可以将数字三维空间和尺度缩放比例发送给第二电子设备300。第二电子设备200可以再根据测量人员输入的目标物体的两个端点信息计算得到目标物体的两个端点之间的距离。
其中,第二电子设备300为具有显示屏和输入装置的设备,可以显示第一图像和第二图像,并接收测量人员根据第一图像和第二图像输入目标物体信息。例如,第二电子设备300可以为手机、平板电脑、个人计算机(personal computer,PC)、个人数字助理(personal digital assistant,PDA)、上网本等,本申请对第二电子设备300的具体形式不做特殊限制。在一些示例中,第二电子设备300可以于第一电子设备100为同一设备。
在本申请的另一些实施例中,服务器200还可以确定出数字三维空间中三维离散点分布最密集的平面为地面,进而确定地面的高度以及天空方向。由此,服务器200可以根据尺度缩放比、数字三维空间、地面高度以及天空方向计算目标物体的高度,即目标物体顶端距离地面的距离。在一种实现方式中,服务器200可以接收第二电子设备300发送的目标物体的顶端信息。服务器200可以根据目标物体的顶端信息、数字三维空间、地面高度以及天空方向计算目标物体的高度。在另一种实现方式中,服务器200可以将数字三维空间以及相关参数(尺度缩放比、地面高度以及天空方向)发送给第二电子设备300。第二电子设备200可以根据测量人员输入的目标物体顶端信息,以及数字三维空间计算得到目标物体的高度。
综上可见,本申请实施例提供的测量方法中,测量人员可以使用第一电子设备100在两个不同的拍摄位置,以不同的拍摄方向拍摄第一图像和第二图像。而后基于第一图像和第二图像构建数字三维空间。再根据第一图像和第二图像中已知尺寸的物体的实际尺寸,求得数字三维空间与真实三维世界的尺度缩放比例。然后根据尺度缩放比 例和数字三维空间计算第一图像和第二图像中目标物体两个端点之间的距离。还可以识别数字三维空间中的地面,三维离散点分布最密集的平面为地面,由此可以计算第一图像和第二图像中目标物体的高度。相较于现有技术中,测量人员需要预先遵循严格的距离关系和方位关系设置多个控制点的标靶,并拍摄大量包含标靶的照片或者视频而言,本申请实施例在不同拍摄位置、以不同的拍摄方向拍摄图像操作便利,可靠性高。并且本申请实施例中使用第一物体的实际尺寸确定数字三维空间的尺寸的缩放比例,也有利于提升测量的可靠性。再有,又由于在狭小机房、倾斜屋顶等场景中也能够实现在不同拍摄位置,以不同拍摄方向拍摄图像,因而本申请实施例提供的测量方法可以适用于更广的测量场景。
请参见图3,图3示出了第一电子设备100的结构示意图。
第一电子设备100可以包括处理器110,内部存储器121,通用串行总线(universal serial bus,USB)接口130,摄像头150,和显示屏160等。可选的,第一电子设备100还可以包括外部存储器接口120,充电管理模块140,电源管理模块141,和电池142中的一项或多项。
其中,处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)中的一项或多项。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,通用输入输出(general-purpose input/output,GPIO)接口,和/或通用串行总线(universal serial bus,USB)接口等。处理器110通过该一个或多个接口与其他器件(例如内部存储器121、摄像头150、显示屏160等)进行通信连接。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为第一电子设备100充电,也可以用于第一电子设备100与外围设备之间传输数据。
在本申请实施例中,第一电子设备100可以通过该USB接口130,将拍摄的第一图像和第二图像发送给服务器200,将接收到用户标记的第一图像中目标物体的两个端点的位置或者顶端的位置,以及第二图像中目标物体的两个端点的位置或者顶端的位置等发送给服务器200。另一些示例中,第一电子设备100还可以通过该一个或多个接口将接收到用户标记的第一图像中已知尺寸的第一物体的两个端点的位置,第二图像中已知尺寸的第一物体的两个端点的位置,以及第一物体的实际尺寸等信息发送给服务器200。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对第一电子设备100的结构限定。在本申请另一些实施例中,第一电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
第一电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计 算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
第一电子设备100可以通过ISP,摄像头193,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,第一电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
在本申请实施例中,可使用第一电子设备100调用摄像头193,在不同的拍摄位置,以不同的拍摄方向拍摄包含目标物体的第一图像和第二图像。其中,不同的拍摄位置为摄像头193的光学中心。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展第一电子设备100的存储能力。内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。充电管理模块140用于从充电器接收充电输入。电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。
可以理解的是,本发明实施例示意的结构并不构成对第一电子设备100的具体限定。在本申请另一些实施例中,第一电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
请参见图4,图4示出一种服务器200的结构示意图,服务器200包括一个或多个处理器210、一个或多个外部存储器220、以及一个或多个通信接口230。可选的,服务器200还可以包括输入设备240和输出设备250。
处理器210、外部存储器220、通信接口230、输入设备240和输出设备250通过总线相连接。处理器210可以包括通用中央处理器(Central Processing Unit,CPU)、微处理器、特定应用集成电路(Application-Specific Integrated Circuit,ASIC),图形处理器(graphics processing unit,GPU)、神经网络处理器(neural-network processing unit,NPU),或者用于控制本申请方案程序执行的集成电路等。
一般,处理器中可设置有内部存储器,可以用于存储计算机可执行程序代码,所 述可执行程序代码包括指令。内部存储器可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统以及本申请实施例需要使用的算法模型等,例如识别第一物体的算法模型、根据第一图像和第二图像构建数字三维空间的算法、根据第一物体的实际尺寸求解数字三维尺度缩放比例的算法,识别数字三维空间中三维离散点分布最密集的平面的算法等。存储数据区可存储服务器200使用过程中所创建的数据(数字三维空间的三维离散点云、第一物体的实际尺寸、数字三维空间的地面位置的参数、数字三维空间的天空方向的参数等)等。此外,内部存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器210通过运行存储在内部存储器的指令,执行服务器200的各种功能应用以及数据处理。在一个示例中,处理器210也可以包括多个CPU,并且处理器210可以是一个单核(single-CPU)处理器或多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路或用于处理数据(例如计算机程序指令)的处理核。
通信接口230,可用于与其他设备或通信网络通信,如以太网,无线局域网(wireless local area networks,WLAN)等。
输出设备250和处理器210通信,可以以多种方式来显示信息。例如,输出设备可以是液晶显示器(Liquid Crystal Display,LCD),发光二级管(Light Emitting Diode,LED)显示设备,阴极射线管(Cathode Ray Tube,CRT)显示设备,或投影仪(projector)等。
输入设备240和处理器210通信,可以以多种方式接收用户的输入。例如,输入设备可以是鼠标、键盘、触摸屏设备或传感设备等。
需要说明的是,第二电子设备300的结构可以参考图3中第一电子设备100的结构描述,可以理解的是,第二电子设备300可以包括比第一电子设备100更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。本申请实施例对此不做限定。在一些示例中,第二电子设备300可以与第一电子设备100为同一设备。
为了便于理解本申请实施例提供的技术方案,先对本申请实施例涉及到技术术语进行说明。
自由网平差:平差指的是对观测值的偶然误差进行合理配赋,对观测值的系统误差进行预改正,对观测值的粗差采用一定的观测原则和人工挑错的办法予以控制。一般平差算法中,都是以已知的起算数据为基础,将控制网固定在已知数据上。当网中没有必要的起算数据时,我们称其为自由网,没有起算数据时的平差方法,即自由网平差。
空间后方交会(space resection):利用像片上三个以上不在一条直线上的控制点(或连接点),按共线方程计算该像片外方位元素(elements of exterior orientation)的方法。
空间前方交会(space intersection):由立体像对左右两影像的内、外方位元素,和同名像点的影像坐标测量值,来确定该点的物方空间坐标(某一暂定三维坐标系里的坐标或地面测量坐标系坐标)的方法。
拍摄位置:本文中的拍摄位置,可理解为拍摄图像时,第一电子设备100的摄像头的光中(或摄影中心)所在的位置。
拍摄方向:本文中以不同的拍摄方向拍摄第一图像和第二图像,是指以被摄对象(例如目标物体)为中心,围绕目标物体四周选择不同的摄影点拍摄第一图像和第二图像,且两次的摄影点与目标物体不在同一直线上。在拍摄距离和拍摄高度不变的条件下,不同的拍摄方向可展现目标物体不同的侧面形象。或者,以不同的拍摄方向拍摄第一图像和第二图像,也可理解为,目标物体上的Q点分别与拍摄两幅图像的摄影中心的连线形成夹角,该夹角不为零且不为180度。其中,目标物体上的Q点可以为目标物体上的任一点,例如可以目标物体的两个端点中的任一个,可以为目标物体的顶点等。
以下实施例中所涉及的技术方案均可以在如图1所示的通信系统中实现,下面结合附图对本申请实施例提供的技术方案进行详细说明。
如图5A所示,为本申请实施例提供的一种数字摄影测量方法的流程图,具体如下:
S501、获取第一图像和第二图像,第一图像和第二图像中都包括目标物体,其中,第一图像与第二图像的拍摄位置不同。且,所述第一图像与所述第二图像的拍摄方向不同。
在一些实施例中,测量人员可以携带第一电子设备100,在不同的拍摄位置,以不同的拍摄方向拍摄目标物体的第一图像和第二图像。其中,拍摄位置和拍摄方向的含义可参见上文的描述,这里不再赘述。而后,通过第一电子设备100将拍摄的第一图像和第二图像发送给服务器200,由服务器200进行后续的数据处理。
其中,第一电子设备100可以为便于携带的设备或者为测量人员常用的设备,例如手机、平板电脑、相机、具有摄像头的可穿戴设备、或者为连接有摄像头的设备等。这样,测量过程中避免使用专用的测量设备,有利于减低测量的成本,且便于测量人员携带。
以手机作为第一电子设备100为例进行示例性说明。
测量人员可以打开手机中测量应用,调用相机进行拍照。在拍照的过程中,手机可以显示一些引导信息,以提示测量人员能两个不同的拍摄位置,以不同的拍摄方向拍摄第一图像和第二图像。例如,如图6A所示的提示信息601,图6B所示的提示信息602、图6C所示的提示信息603以及图6D所示的提示信息604。而后,手机可以将拍摄的第一图像和第二图像,上传到服务器200进行处理。
进一步的,在一个示例中,若将目标物体上的Q点分别与拍摄两幅图像的摄影中心的连线形成夹角控制在大于5度且小于60度的范围内,可将测量误差降低到2%以及2%以下。在另一个示例中,假设拍摄第一图像的摄影中心P1距离目标物体上任一点Q点的距离为D。其中,目标物体上的Q点可以为目标物体上的任一点,例如可以目标物体的两个端点中的任一个,可以为目标物体的顶点等。若将拍摄第二图像的摄影中心P2与P1之间的距离控制在大于D/20且小于D的范围内,则可将测量误差降低到2%以及2%以下。
S502、根据所述第一图像和所述第二图像,构建数字三维空间。
本申请的一些实施例中,服务器200可以先识别出第一图像和第二图像中刚体、 不变地物区域作为有效区域,或者识别出第一图像和第二图像中非刚体、可变化的物体为无效区域。后续针对第一图像和第二图像中的有效区域执行相关数据处理过程。这样,一方面,由于排除掉第一图像和第二图像中可变化物体的区域,有利于提升后续特征点匹配的准确性。另一方面,排除掉第一图像和第二图像中可变化物体的区域,后续仅对第一图像中和第二图像中的有效区域进行处理,大量的减少了后续处理的数据量,有利于提升数据处理效率。
在该实施例的一些示例中,图像中的天空、水面、行人、车辆等都可认为是可变化的物体。因此,服务器200可以采用语义分割方法,对接收到的第一图像和第二图像分别执行全要素分类,识别出第一图像和第二图像中的可变化的物体,即无效区域。然后,服务器200可以为第一图像和第二图像中的无效区域添加灰色蒙版,以遮蔽第一图像和第二图像中的无效区域。
其中,语义分割方法包括但不限于使用开源深度学习训练模型DeepLab-v3等,本申请实施例对此不做限定。
可选的,服务器200还可以针对第一图像和第二图像中已识别出的不变地物区域(即有效区域)的图像进行色彩均衡化。在具体实现时,可以采用针对第一图像和第二图像中的有效区域执行直方图拉伸、直方图规则化、Kama变换等算法等,以实现色彩均衡化。
以直方图拉伸的方法为例,进行说明。在一个示例中,服务器200分别针对第一图像中有效区域的图像统计灰度直方图。其中,灰度直方图是将图像的所有像素,按照灰度值的大小,统计其出现的频率。然后,服务器200根据第一图像中有效区域的图像的灰度直方图,舍弃灰度值较大的一部分像素(例如舍弃像素的个数占有效区域图像总像素个数的0.5%),和/或,舍弃灰度值较小的一部分像素(例如舍弃像素的个数占有效区域总像素个数的0.5%),得到截断阈值。根据截断阈值构建线性变换公式,进行灰度直方图的拉伸,实现第一图像中有效区域的图像的色彩均衡化。采用类似的方法,服务器200可对第二图像中有效区域图像进行色彩均衡化。
需要说明的是,对第一图像和第二图像中的有效区域进行色彩均衡化,有利于降低拍摄时的环境因素(例如,天气情况、光线情况等)以及拍摄所使用的摄像头规格等因素的影响,提升后续特征点匹配和密集匹配的准确性。
进一步的,服务器200针对第一图像中的地物的区域的图像执行特征点匹配、自由网平差和密集匹配,得到数字三维空间。
其中,特征点匹配包括特征提取、特征描述和特征匹配。具体地,服务器200针对经过上述处理后的第一图像的有效区域图像,以及第二图像的有效区域图像中提取出特征点,然后分别描述各个特征点。比较第一图像的有效区域图像中的各个特征点,与第二图像的有效区域图像中的各个特征点的相似程度。将相似程度高于阈值A的特征点判断是否为同一特征点(即同名特征点),即完成特征匹配。可以理解的是,服务器200可以采用相关技术领域已知的任意技术对第一图像和第二图像中的特征点进行匹配,本申请实施例对此不做具体限定。例如,服务器200可采用尺度不变特征变换(scale-invariant feature transform,SIFT)、加速稳健特征(speeded up robust features,SURF)等特征描述算子进行特征描述。又例如,服务器200可采用最小二乘法进行特 征匹配。
第一图像的有效区域图像和第二图像的有效区域中确定为同名的特征点构成两幅图像的连接点,服务器200基于这些连接点执行粗差剔除和平差配赋,即自由网平差。然后根据自由网平差后的连接点执行空间后方交互计算,得到两幅图像的相对外方位元素。再基于两幅图的相对外方位元素,构建核线影像,执行密集匹配,即执行逐像素的空间前方交会计算,得到三维密集点云(point clouds),构成数字三维空间。其中,三维点云是指三维空间中物体表面的点数据的集合,可用于反映物体表面轮廓。由本方法得到的点数量较大且较密集,即为密集点云。
需要说明的是,本申请实施例基于第一图像和第二图像执行自由网平差和密集匹配等处理得到的数字三维空间与真实的三维世界的位置、尺寸和方向均不一致。但,数字三维空间中各个物体的尺寸,与真实的三维世界中各个物体的实际尺寸的比例相同;数字三维空间中各个物体之间的距离,与真实的三维世界中各个物体之间的距离的比例相同。
在本申请的另一些实施例中,服务器200还可以在特征点匹配时,根据特征点匹配的情况对测量人员拍摄的第一图像和第二图像是否满足拍摄要求进行验证。若第一图像和第二图像不满足拍摄要求时,可以通过第一电子设备100显示相关的提示信息或播放相关语音提示,以提示测量人员重新拍摄第一图像和第二图像,或者重新拍摄第二图像。
例如,若检测到第一图像和第二图像的有效区域内,没有提取到同名特征点,或者提取的同名特征点的数量小于阈值B(例如,10至100个),则服务器200可通过第一电子设备100提示测量人员,“请重新拍摄第一图像和第二图像,确保两次拍摄对准同一目标”。
又例如,若检测到第一图像和第二图像的有效区域内,提取到的同名特征点在两幅图像上的像点位置偏差普遍小于阈值C(例如5至20个像素),则服务器200可通过第一电子设备100提示测量人员“请重新拍摄第一图像和第二图像,确保在不同位置拍摄”。
其中,可采用如下公式计算同名特征点(记为P点)在第一图像和第二图像上的像点位置偏差ΔP:
Figure PCTCN2021077962-appb-000001
其中,(Px 1,Py 1)为P点在第一图像中的像素坐标;(Px 2,Py 2)为P点在第二图像中的像素坐标。
S503、获取第一物体的实际尺寸S1,以及第一物体在第一图像和第二图像中的位置信息;根据第一物体在第一图像和第二图像中的位置信息,计算第一物体在数字三维空间中的尺寸S2;其中,所述第一图像和所述第二图像中均包括所述第一物体。
本申请的一些实施例中,测量人员还可以通过第一电子设备100,输入第一图像和第二图像中已知尺寸的物体的信息,例如包括第一图像中已知尺寸的物体的两个端点的位置,第二图像中已知尺寸的物体的两个端点的位置,以及第一物体在真实空间中的尺寸,即该物体的真实尺寸S1。在一个具体示例中,测量人员可以从第一图像和第二图像中分辨已知尺寸的第一物体,并分别在第一图像和第二图像中标记出第一物 体的两个端点,并通过第一电子设备100输入第一物体的尺寸。在另一个具体示例中,测量人员也可以在拍摄第一图像以及拍摄第二图像时,将已知尺寸的第一物体放置到摄像头的取景范围内。也就是说,在拍摄第一图像和第二图像时,第一图像和第二图像中均也拍摄到第一物体。在拍摄第一图像和第二图像后,测量人员可以分别在第一图像和第二图像中标记出第一物体的两个端点,并通过第一电子设备100输入第一物体的真实尺寸。
然后,第一电子设备100将第一图像中第一物体的两个端点的位置(例如在第一图像中的像点坐标),第二图像中第一物体的两个端点的位置(例如在第二图像中的像点坐标),以及第一物体的真实尺寸S1,发送给服务器200。服务器200可以根据第一物体在第一图像中的两个端点的位置,以及在第二图像中的两个端点的位置,先计算出第一物体两个端点在数字三维空间中的坐标,然后计算这两个坐标之间的距离,即为第一物体在数字三维空间中尺寸S2。
仍然以手机作为第一电子设备100为例进行示例性说明。手机可以同时显示第一图像和第二图像,或者先后显示第一图像和第二图像,以便于测量人员分别在两张图像上标记出已知尺寸的第一物体的两个端点的位置(即共四个位置)。在一些示例中,当测量人员在其中一个图像中标记出一个端点的位置后,手机也可以根据该端点在该图像中的位置,以及立体像对的几何关系在另一图像中做出辅助线,以帮助测量人员在另一图像中标记出该端点的位置。
例如,由于手机的显示屏较小,可以先后显示第一图像和第二图像。如图6E和图6F所示,手机显示的第一图像和第二图像中均包括已知长度的A4纸,A4纸的长度为29.7cm。那么,测量人员可以在第一图像和第二图像中分别标记A4纸长边的两个端点。如图6E所示,测量人员可以先在第一图像中标记A4纸长边的两个端点E1和F1。当然,也可以将第一图像放大后,标记A4纸长边的两个端点E1和F1,使得标记更加准确。然后,切换到第二图像中,手机可以第一图像中已标记的E1和F1两个端点,以及立体像对的几何关系在第二图像中做出辅助线。如图6F所示,虚线(1)为端点E1对应的辅助线,测量人员可以根据该辅助线标记第二图像中对应的端点E2。虚线(2)为端点F1对应的辅助线,测量人员可以根据该辅助线标记第二图像中对应的端点F2。而后,手机计算出E1和F1在第一图像中的像点坐标,以及E2和F2在第二图像中的像点坐标。手机还可以提示测量人员输入第一物体的实际尺寸S1的数值,而后,手机将E1、F1、E2和F2的像点坐标,以及实际尺寸S1的数值发送给服务器200,进行后续处理。
本申请的另一些实施例中,服务器200也可以识别第一图像和第二图像中已知尺寸的第一物体的两个端点,以及该第一物体两个端点之间的实际尺寸S1。在一些示例中,可以设计一种长度固定、外观容易被服务器200识别的标杆作为第一物体。测量人员在拍摄第一图像和第二图像时,将标杆放置到第一电子设备100拍摄的取景范围内,即拍摄的第一图像和第二图像中均包括该标杆。
其中,设计的标杆可以为多个颜色间隔分布的杆状物体。服务器200可以通过自动锁定第一图像和第二图像中杆状物体中的特定颜色,来确定标杆的端点的位置。且标杆两个端点之间的实际尺寸S1为已知。其中,标杆的设计以及识别标杆两个端点的 方法将在下文详细说明,这里先不做说明。
本申请的又一些实施例中,服务器200也可以先识别第一图像和第二图像中已知尺寸的第一物体的两个端点。若识别失败,可以通过第一电子设备100提示测量人员,手工输入已知尺寸的第一物体的相关信息,例如第一图像中第一物体的两个端点的位置、第二图像中第一物体的两个端点的位置,以及第一物体的实际尺寸S1等。或者,在服务器200识别处第一图像和第二图像中已知尺寸的第一物体的两个端点,也可以通过第一电子设备100提示测量人员,对识别处的第一物体的信息进行核对等,以确保识别结果的准确性。
S504、根据所述第一物体的实际尺寸S1,以及所述第一物体在数字三维空间中的尺寸S2,求得数字三维空间与真实三维世界的尺度缩放比例。
在本申请的一些实施例中,服务器200根据第一物体在数字三维空间中的尺寸S2和第一物体在真实的三维世界中的实际尺寸S1,得到数字三维空间与真实空间的尺度缩放比例为S1/S2。
S505、根据所述数字三维空间、尺度缩放比例,所述第一图像和所述第二图像,确定所述目标物体的两个端点之间的距离。
在一个示例中,服务器200可以接收第二电子设备300发送的目标物体的两个端点的位置,包括目标物体两个端点在第一图像中的像点坐标以及目标物体两个端点在第二图像中的像点坐标。根据目标物体的两个端点的像点坐标执行空间前方交会,计算该目标物体的两个端点在数字三维空间中的坐标。如图5B所示,U点(x3、y3、z3)和V点(x4、y4、z4)为服务器200计算得到的目标物体的两个端点在数字三维空间的坐标。可以根据U点和V点的在数字三维空间的坐标计算出U点和V点在数字三维空间的距离,然后根据U点和V点在数字三维空间的距离和尺度缩放比例,计算这两个端点之间的实际距离。
在另一个示例中,服务器200还可以将计算得到数字三维空间和尺度缩放比例发送给第二电子设备300。由第二电子设备300接收测量人员输入的目标物体的两个端点的标记,并根据数字三维空间和尺度缩放比例计算目标物体的两个端点之间的距离。
仍然以手机作为第二电子设备300为例进行示例性说明。手机可以同时显示第一图像和第二图像,或者先后显示第一图像和第二图像,以便于测量人员分别在两张图像上标记出目标物体的两个端点的位置(即共四个位置)。具体的标记方法和步骤S503中标记第一物体的两个端点的方法相同,这里不再赘述。例如,如图6G所示,测量人员在第一图像中标记出目标物体的两个端点S1和R1。如图6H所示,测量人员在第二图像中标记出目标物体的两个端点S2和R2。而后,第二电子设备300将S1、R1、S2和R2的像点坐标,发送给服务器200,便于服务器200进行后续处理,测得显示器的长度。在一些示例中,第二电子设备300可以与第一电子设备100为同一设备。
需要说明的是,这里的目标物体可以为一个,目标物体的两个端点之间的距离可以是目标物体的高度、长度、宽度等。目标物体也可以为两个,则目标物体的两个端点之间的距离可以为两个目标物体之间的间距等。例如,该测量方法可用于电信基站数字化勘测中,用于获取设备尺寸、电缆长度、安装间距等信息。也可以用于其他工程测量或日常生活中,如测量楼宇间距等。
综上可见,本申请实施例提供的测量方法中,测量人员可以使用第一电子设备100在两个不同的拍摄位置,以不同的拍摄方向拍摄第一图像和第二图像。而后基于第一图像和第二图像构建数字三维空间。再根据第一图像和第二图像中已知尺寸的第一物体的实际尺寸,得到数字三维空间与真实的三维世界的尺度缩放比例。然后根据数字三维空间和尺度缩放比例可以计算第一图像和第二图像中目标物体两个端点之间的距离。相较于现有技术中,测量人员需要预先遵循严格的距离关系和方位关系设置多个控制点的标靶,并拍摄大量包括标靶的照片或者视频而言,本申请实施例在不同拍摄位置、以不同的拍摄方向拍摄图像操作便利,可靠性高。并且本申请实施例中使用第一物体的实际尺寸确定数字三维空间的尺寸的缩放比例,也有利于提升测量的可靠性。再有,又由于在狭小机房、倾斜屋顶等场景中也能够实现在不同拍摄位置,以不同拍摄方向拍摄图像,因而本申请实施例提供的测量方法可以适用于更广的测量场景。
考虑到在一些测量目标物体高度的场景中,可能由于目标物体较高、或者目标物体的底端被其他物体遮挡,第一电子设备100无法拍摄到包括目标物体顶端和底端的图像。为此,本申请实施例还提供了一种数字摄影测量方法,可以基于步骤S502中得到的数字三维空间和S504中得到的尺度缩放比例,识别中数字三维空间中三维离散点最密集的平面,确认为地面。进一步,根据地面的法向量和第一、二图像的拍摄位置,确定天空的方向。那么,服务器200可以根据目标物体的顶端,和地面位置、天空方向,计算出目标物体顶端距离地面的距离,即为目标物体的高度,以扩展本申请实施例提供的测量方法的使用场景。另外,计算目标物体的高度时,也可以只需在第一图像和第二图像中标记顶端的位置即可完成对目标物体高度的测量,而无需标记底端的位置。
具体的,如图7A所示,为本申请实施例提供的另一种数字影像测量方法的流程示意图。该测量方法包括上述步骤S501至步骤S504,以及步骤S701至步骤S702,具体如下:
S701、识别第二三维空间中离散点分布最密集的平面为地面,并进一步确定数字三维空间中的天空方向。
一般,在真实的三维世界中,地面是分布刚体最多、最复杂的平面。因此,第一图像和第二图像中纹理最丰富的区域可认为是地面。那么,基于第一图像和第二图像构建的数字三维空间中,三维离散点分布最密集的平面可认为是地面。其中,三维离散点分布最密集的平面为单位空间内点数据的数量值最大的平面。在确定数字三维空间中的地面后,地面的法向量为天空方向或重力方向。进一步的,又由于第一图像或第二图像摄像中心确定位于地面上方,因此,可以确定数字三维空间中的天空方向。
在一个具体的示例中,服务器200可以采用如下步骤确定数字三维空间中的地面和天空方向,如下:
步骤a、确定出数字三维空间中第一图像的摄影中点,以及第二图像的摄影中心。两张图像的摄影中心连线的中心设为O(O x,O y,O z)点,并以O点为球心,构建一个虚拟的球体。
步骤b、以经纬度的方式,对虚拟球体进行网格化。其中经度记为Lon,取值范围是(-180°,180°]。纬度记为Lat,取值范围是(-90°,90°]。以1°为采样间隔, 则虚拟球体上共有360*180个格网点。当然,采样间隔也可以为其他度数,本申请对虚拟球体上的格网点的数量不做限定。
步骤c、以球心O为起点,向球面上的格网点引射线,形成360*180个向量,记为
Figure PCTCN2021077962-appb-000002
代表360*180个方向。
步骤d、以虚拟球心位置为起点,沿着
Figure PCTCN2021077962-appb-000003
方向等间距排列n个(例如10个)高为m米(例如0.2米)、半径为r米(例如50米)的虚拟圆柱体,记为
Figure PCTCN2021077962-appb-000004
其中i为圆柱标记码,i∈{1,2,...,10}。需要注意的是,这里虚拟圆柱体的高、半径均是根据真实的三维世界的尺寸设计的,因此对应到数字三维空间中,需要除以尺寸缩放比例S1/S2。当然,也可以根据数字三维空间的尺寸设计虚拟圆柱体的高和半径,则无需除以尺寸缩放比例S1/S2,本申请实施例对此不做限定。
步骤e、分别计算基于步骤d和步骤e形成的360*180*n个虚拟圆柱体形成的“包围盒”内三维离散点的数量,并记录数量最大的包围盒对应的方向
Figure PCTCN2021077962-appb-000005
和标记码i Mark。那么天空方向即为
Figure PCTCN2021077962-appb-000006
的反方向,地面位置距离虚拟球体球心O的距离是m*i Mark
可以理解的是,也可以采用其他的方法确定出数字三维空间中的地面以及天空方向,本申请实施例对此不作具体限定。
S702、根据地面的位置、天空的方向、数字三维空间,第一图像和第二图像,确定目标物体顶端到地面的距离为目标物体的高度。
在一个示例中,服务器200可以接收第二电子设备300发送的目标物体顶端的位置,包括目标物体顶端在第一图像中的像点坐标以及目标物体顶端在第二图像中的像点坐标。根据目标物体的顶端的像点坐标执行空间前方交会,计算该目标物体顶端在数字三维空间中的坐标。如图7B所示,T点(x1、y1、z1)为服务器200计算得到的目标物体的顶端在数字三维空间的坐标。G点(x2、y2、z2)为在数字三维空间的地面上任选取的一点。可以将目标物体顶端T点与G点的连线,作为三角形(或直角梯形)斜边,将垂直方向上的高度H作为直角边,构建三角形(或直角梯形)。根据几何原理解三角形,求得直角边的长度H即为目标物体的高度。
在另一个示例中,服务器200还可以将计算得到数字三维空间、尺寸缩放比例、地面位置、天空方向等信息发送给第二电子设备300。由第二电子设备300接收测量人员输入的目标物体的顶端的标记,并根据第三三维空间计算目标物体的高度。
仍然以手机作为第二电子设备300为例进行示例性说明。手机可以同时显示第一图像和第二图像,或者先后显示第一图像和第二图像,以便于测量人员分别在两张图像上标记出目标物体顶端的位置(即共两个位置)。具体的标记方法和步骤S503中标记第一物体的两个端点的方法相同,这里不再赘述。在一些示例中,第二电子设备300可以与第一电子设备100为同一设备。
可见,本申请实施例提供的测量方法,可适用于电信基站数字化勘测场景中,用于获取远距离高塔及塔上各类设备的高度等。也可以适用于其他工程测量或日常生活中,如测量楼宇高度。
下面结合一种标杆,对服务器200识别标杆的两个端点的方法进行详细说明。
如图8所示,为本申请实施例给出的一种标杆的示意图。标杆为采用四色分段设计的杆状物体。其中四色包括黑色、白色、彩色1和彩色2。其中,彩色1和彩色2不同,且彩色1和彩色2均不为黑色或白色。彩色1和彩色2可以从色相环中选取一对互补色。如图9所示为一种24色的色相环的示意图。例如,彩色1和彩色2可以为红色(red)和青色(cyan)。彩色1和彩色2也可以为品色(magenta)和绿色(green)。当然,彩色1和彩色2也可以接近互补色的两个颜色。以彩色1为红色为例,彩色2也可以是青偏蓝或青偏绿。由于互补色中的两个颜色的区分度较大,便于服务器200准确识别出这两种颜色。
需要注意的是,考虑到拍摄光线不足时,拍摄的图像中蓝色与黑色不易区分。拍摄光线过亮时,黄色与白色不易区分。因此,彩色1和彩色2均不为蓝色(blue)或黄色(yellow)。
在一些示例中,标杆上四色分段的排列顺序为:黑色、白色、彩色1、白色、彩色2、白色和黑色。这样,黑色分段和白色分段的交界点(即A点和B点)可以认为是需要服务器200识别出的两个端点。在标杆上,这两个端点之间的距离为第一物体的实际尺寸S1。例如,在这两个端点之间的各个颜色的分段长度相等,为第一长度S0,例如10厘米。那么,S1=5*S0,标杆总长度大于5*S0。
在一示例中,标杆的材质可以为塑料或碳素,具有不易变形,不导电的特性。标杆的直径可以为1至2.5cm。标杆为直杆,包括但不限于圆柱、椭圆柱、三棱柱、四棱柱等。在另一示例中,标杆还可以设计为可折叠式,即标杆可被分为至少两截,由螺栓或皮筋相连,方便组装和拆卸。
如图10所示,为本申请实施例提供的又一种标杆的示意图。与图8所示的标杆相比,图10在图8所示的标杆两端的黑色分段外(这里标杆两端的黑色分段的长度也为S0)分别增加了一段白色分段。这样,标杆两端黑色分段和白色分段的交界点(即C点和D点)可以认为是需要服务器200识别出的两个端点。在标杆上,这两个端点之间的距离为第一物体的实际尺寸S1。例如,在这两个端点之间的各个颜色的分段长度相等,为第一长度S0,例如10厘米。那么,S1=7*S0,标杆总长度大于7*S0。本申请实施例对标杆的具体形式不作限定。
在本申请的一些实施例中,测量人员可以在使用第一电子设备100拍摄第一图像和第二图像时,将如图8所示的标杆或者如图10所示的标杆放置到摄像头的取景范围。那么,第一图像和第二图像中都包括该标杆。
而后,服务器200可以分别针对第一图像和第二图像,采用深度学习和形态学综合的方法确定出两幅图像中的标杆的大致位置,然后根据标杆的直线特征和颜色特征,锁定标杆的中心线。然后,根据标杆的中心线、已知的标杆中各个颜色的分段关系,以及图像中灰色变化量精确锁定标杆中的两个端点,即为第一物体的两个端点。
以下,以图10所示的标杆为例,结合图11A至图11D,详细介绍服务器200识别标杆的两个端点的方法,该方法具体包括:
步骤a、分别预测第一图像和第二图像中标杆的位置范围,记为第一范围。
在一个具体的实现方式中,可以先将两幅图像进行切换处理,即将每幅图像分别切成小块,即切片图像。其中,每个切片图像的尺寸例如可以为500*500像素,切片 图像与其周围的切片图像之间可以保留一定的重叠度,例如50%的重叠度。需要说明的是,切片处理是为了增加标杆在切片图像中的像素占比,更有助于目标检测。
而后,可以采用深度学习的方法,针对第一图像的切片图像,以及第二图像的切片图像,分别执行目标检测,以得到第一图像和第二图像中标杆的大致位置。其中,目标检测所用模型包括但不限于Mask R-CNN等。
还需要说明的是,在执行目标检测之前,服务器200也可以先对第一图像和第二图像进行预处理。例如,一般的光学相机均存在成像畸变,首先需要利用相机内参数对每副图像实施畸变校正。在另一个示例中,若第一电子设备100的摄像头为鱼眼镜头,则还需对每幅图像执行球面至中心投影的透视变换。其中,畸变校正和透视变换是为了保证标杆在图像中的形态为直线,不因投影变形而扭曲。
可选的,可以在基于深度学习的方法识别出的第一图像中标杆的图像,以及第二图像中标杆的图像,进一步采用“先腐蚀、后膨胀”的形态学开操作,以去除小面积噪声点,且使预测的标杆的范围扩张、联通,以更好地约束第一图像和第二图像中标杆的位置。其中,形态学膨胀的尺度应大于形态学腐蚀的尺度。例如,形态学膨胀的尺度为30个像素,形态学腐蚀的尺度为10个像素。
例如,如图11A所示,为第一图像或第二图像的一个示例,该图像中包括标杆。采用步骤a的相关处理后,可以得到标杆在该图像中的大致位置,如图11B所示的白色区域。
步骤b、从第一图像和第二图像中第一范围内的图像中确定具有直线特征的区域,为标杆更精度的位置范围,记为第二范围。其中,第二范围小于第一范围,且第二范围包含在第一范围内。
在一个具体的实现方式中,可以采用滤波器从第一图像和第二图像中确定具有直线特征的区域。其中,滤波器具体可以为二维Gabor函数的实部,其中构建滤波器的公式为:
Figure PCTCN2021077962-appb-000007
其中,(x,y)为二维滤波器中的位置;Gabor λ,σ,γ,θ,φ(x,y)为该位置下Gabor滤波器的取值;λ为正弦函数的波长,10<λ<20;σ为高斯函数标准差,3<σ<6;γ为高斯函数在x,y两个方向上的纵横比,γ=1;φ为正弦波的初始相位,φ=0;θ为Gabor核函数的方向。在本申请的一些示例中,可以选择一些Gabor核函数的方向。例如选择9个方向,例如θ为0°、20°、40°、60°、80°、100°、120°、140°、160°,即分别构建了9个Gabor滤波器。
在构建了滤波器后,使用构建的滤波器对第一图像和第二图像进行处理,以提取图像中的直线特征。例如,设定Gabor滤波器窗口的大小为21~51之间的任意奇数。然后,通过滑动窗口的方式对第一图像和第二图像中第一范围内的图像进行多次滤波,得到第i行、第j列图像在θ方向上的Gabor特征值,记为T Gabor-θ(i,j)。最终的Gabor特征值,为多个方向(例如9个方向)上Gabor特征值分别取绝对值之后的最大值,如下公式:
Figure PCTCN2021077962-appb-000008
上述计算后,Gabor特征值大于阈值D(例如,100)的区域,为直线特征明显的区域,可认为是标杆更精确的位置范围。例如,如图11C所示,图像中白色区域为经过步骤b确定的直线特征明显的区域。
进一步的,根据步骤a中确定的标杆的大致范围,以及步骤b中确定的直线区域,进一步确定重合的区域为标杆更精确的位置范围。
步骤c、从第一图像和第二图像中第二范围内的图像中识别标杆的颜色特征,并结合标杆的设计,识别出标杆的两个端点。
首先,针对第一图像和第二图像中第二范围内的图像进行超像素分割处理,即图像中颜色和纹理近似的像素组成超像素,这将有效抑制光学镜头成像噪声点,有利于锁定图像中的色块。其中,色块是指具有特定颜色特征的区域。其中,超像素分割算法包括但不限于简单线性迭代聚类(simple linear iterative clustering,SLIC)、均值漂移算法(Mean-shift)等。超像素的大小例如为50~100个像素。
然后,将超像素分割后图像由RGB空间转换至HSL(色调((Hue)、饱和度(Saturation)、亮度(Lightness))空间,通过色调阈值分割方法,分别从第一图像和第二图像中第二范围内的图像中提取两种色块,分别为彩色1对应的色块,以及彩色2对应的色块。例如红色色块和蓝绿色块。其中,色调的阈值与标杆设计中选定的颜色有关。接着,计算两个色块的重心,重心的连线及其延长线即标杆的中心线。
在确定的标杆的中心线上,寻找已确定的两个色块两侧特定范围内灰度值变化最大的位置,即可认为是黑色色块与白色色块的交界点。其中,上述灰度值变化最大为接近且略小于255。由于图像中黑色的灰度值为接近且略高于零,图像中白色的灰度值为接近且略小于255。那么,黑色色块与白色色块的交界点即为灰度值变化最大。
例如,若采用如图8所示的标杆,则在两个彩色色块的重心连线的一侧延长线上,可以确定一个灰度值变化最大的位置,例如A点。在两个彩色色块的重心连线的另一侧延长线上,可以确定一个灰度值变化最大的位置,例如B点。可选的,还可以进一步根据标杆中各个色块的位置关系,进一步对确定出的两个端点进行验证。例如,彩色1所在色块的重心距离彩色2所在色块的重心为2*s0。若A点距离彩色1所在的色块的中心为1.5*s0,或者A点距离彩色2所在的色块的中心为2.5*s0,则认为A点识别准确。若B点距离彩色1所在的色块的中心为2.5*s0,或者B点距离彩色2所在的色块的中心为1.5*s0,则认为B点识别准确。
再例如,若采用如图10所示的标杆,在两个彩色色块的重心连线的一侧延长线上,可以确定两个灰度值变化最大的位置,例如A点和C点。进一步,可以根据C点距离彩色色块重心的距离大于A点距离彩色色块重心的距离,确定出C点为标杆中的一个端点。可选的,还可以根据标杆上A点与C点的位置关系,进一步确定C点识别是否准确。例如,彩色1所在色块的重心距离彩色2所在色块的重心为2*s0。若C点和A点相距s0,则可以认为C点识别正确。在两个彩色色块的重心连线的另一侧延长线上,可以确定两个灰度值变化最大的位置,例如B点和D点。类似的,可以确定出D点为标杆中的另一个端点。可选的,还可根据B点与D点的位置关系,进一步确定D点识 别是否准确。当然,也可以采用其他方法来验证服务器200识别出的C点或D点的准确性,本申请实施例对此不作限定。当然,也可以定义A点和B点之间的距离为服务器200需要识别的标杆的两个端点之间的距离,本申请实施例对此也不作限定。
仍然以采用图10所示的标杆为例进行说明。如图11D所示,在将步骤b中识别的区域1001中,识别彩色1对应的色块1002,以及彩色2对应的色块1003。然后,在色块1002的重心和色块1003的重心的连线的延长线上,查找到灰度值变化最大的四个端点,分别为A点、C点、B点和D点。进一步的,根据各个分段的位置关系,可以确定出C点和D点为标杆的两个端点。
由此可见,当服务器200可以识别标杆的两个端点作为第一物体的两个端点,则无需测量人员通过第一电子设备100在第一图像和第二图像中分别标记第一物体的两个端点,可以简化测量人员的操作,使得测量更加自动化。
以上实施例以根据第一图像和第二图像构建数字三维空间,然后确定数字三维空间与真实的三维世界的尺度缩放比例、地面位置以及天空方向等,最后根据数字三维空间、尺度缩放比例、地面位置以及天空方向等直接计算目标物体的两个端点之间的距离,或者计算目标物体的高度为例进行说明的。基于本申请实施例的发明构思,也可以在根据第一图像和第二图像构建数字三维空间,以及确定数字三维空间与真实的三维世界的尺度缩放比例、地面位置以及天空方向等信息后,对得到的数字三维空间进行缩放、平移和旋转等,以使得数字三维空间调整到与真实的三维世界一致。然后,根据调整后的数字三维空间计算目标物体的两个端点之间的距离,或者计算目标物体的高度。本申请实施例对此不做限定。
本申请实施例还提供一种芯片系统,如图12所示,该芯片系统包括至少一个处理器1101和至少一个接口电路1102。处理器1101和接口电路1102可通过线路互联。例如,接口电路1102可用于从其它装置(例如服务器200的存储器)接收信号。又例如,接口电路1102可用于向其它装置(例如处理器1101)发送信号。示例性的,接口电路1102可读取存储器中存储的指令,并将该指令发送给处理器1101。当所述指令被处理器1101执行时,可使得服务器200执行上述实施例中的服务器200所执行的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。
可以理解的是,上述终端等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明实施例的范围。
本申请实施例可以根据上述方法示例对上述终端等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
在采用对应各个功能划分各个功能模块的情况下,图13示出了上述实施例中所涉及的服务器的另一种可能的结构示意图。该服务器200包括获取单元1301、构建单元1302和确定单元1303。
其中,获取单元1301,用于获取第一图像和第二图像,所述第一图像和所述第二图像中都包括目标物体和实际尺寸已知的第一物体;其中,所述第一图像与第二图像的拍摄位置不同,且,所述第一图像与所述第二图像的拍摄方向不同。
构建单元1302,用于根据所述第一图像和所述第二图像,数字三维空间。
确定单元1303,用于根据所述数字三维空间,以及所述数字三维空间与真实的三维空间的尺寸的缩放比例确定所述目标物体的两个端点之间的距离,其中,所述缩放比例与所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,以及所述第一物体的实际尺寸S1有关。
进一步的,所述确定单元1303,还用于:确定所述数字三维空间中离散点分布最密集的平面为所述数字三维空间的地面;根据所述数字三维空间的地面和所述第一图像的摄影中心,或者根据所述数字三维空间的地面和所述第二图像的摄影中心,确定所述数字三维空间的天空方向;根据所述数字三维空间、所述缩放比例、所述数字三维空间的地面和所述数字三维空间的天空方向,确定所述目标物体的高度。
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。在采用集成的单元的情况下,上述获取单元1301可以是服务器200的通信接口230。上述构建单元1302和确定单元1303可集成在一起,可以是服务器200的处理器210。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (20)

  1. 一种数字摄影测量方法,其特征在于,包括:
    获取第一图像和第二图像,所述第一图像和所述第二图像中都包括目标物体和实际尺寸已知的第一物体;其中,所述第一图像与第二图像的拍摄位置不同,且,所述第一图像与所述第二图像的拍摄方向不同;
    根据所述第一图像和所述第二图像,构建数字三维空间;
    根据所述数字三维空间,以及所述数字三维空间与真实的三维空间的尺寸的缩放比例确定所述目标物体的两个端点之间的距离,其中,所述缩放比例与所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,以及所述第一物体的实际尺寸S1有关。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    根据所述数字三维空间的地面和所述第一图像的摄影中心,或者根据所述数字三维空间的地面和所述第二图像的摄影中心,确定所述数字三维空间的天空方向;其中,所述数字三维空间的地面为所述数字三维空间中离散点分布最密集的平面;
    根据所述数字三维空间、所述缩放比例、所述数字三维空间的地面和所述数字三维空间的天空方向,确定所述目标物体的高度。
  3. 根据权利要求1或2所述的方法,其特征在于,在所述根据所述数字三维空间、以及所述数字三维空间与真实的三维空间的尺寸的缩放比例,确定所述目标物体的两个端点之间的距离之前,所述方法还包括:
    获取所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,以及所述第一物体的实际尺寸S1;
    根据所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,计算所述数字三维空间中所述第一物体的尺寸S2;
    根据所述第一物体的实际尺寸S1和所述数字三维空间中所述第一物体的尺寸S2,计算得到所述数字三维空间与真实的三维空间的尺寸的所述缩放比例。
  4. 根据权利要求3所述的方法,其特征在于,所述获取所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,以及所述第一物体的实际尺寸S1,包括:
    接收输入的所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,以及所述第一物体的实际尺寸S1;
    或者,识别所述第一图像中所述第一物体的位置,以及所述第二图像中所述第一物体的位置,以及查找所述第一物体的实际尺寸S1。
  5. 根据权利要求4所述的方法,其特征在于,所述第一物体为分段设计的标杆,所述第一物体至少包括顺序排列的第一黑色分段、第一白色分段、第一彩色分段、第二白色分段、第二彩色分段、第三白色分段、第二黑色分段;其中,所述第一彩色分段的颜色和所述第二彩色分段的颜色为一对互补色;
    所述第一物体的实际尺寸S1为所述第一物体的两个端点之间的长度,所述第一物体一个端点位于所述第一黑色分段和所述第一白色分段的交界处,所述第一物体另一个端点位于所述第三白色分段和所述第二黑色分段的交界处;
    所述第一图像中所述第一物体的位置为所述第一图像中所述第一物体的两个端点的位置;所述第二图像中所述第一物体的位置为所述第二图像中所述第一物体的两个端点的位置。
  6. 根据权利要求5所述的方法,其特征在于,所述识别所述第一图像中所述第一物体的位置,以及所述第二图像中所述第一物体的位置,包括:
    识别出所述第一图像中所述第一彩色分段和所述第二彩色分段,以及所述第一图像中具有直线特征的第一区域;识别出所述第二图像中所述第一彩色分段和所述第二彩色分段,以及所述第二图像中具有直线特征的第二区域;
    根据所述第一图像中所述第一彩色分段和所述第二彩色分段,所述第一图像中的所述第一区域,以及所述第一物体中各个颜色分段的位置关系,自动确定出所述第一图像中所述第一物体的两个端点的位置;以及根据所述第二图像中所述第一彩色分段和所述第二彩色分段,所述第二图像中的所述第二区域,以及所述第一物体中各个颜色分段的位置关系,自动确定出所述第一图像中所述第一物体的两个端点的位置。
  7. 根据权利要求5或6任一项所述的方法,其特征在于,所述第一彩色分段为红色分段,所述第二彩色分段为青色分段;
    或者,所述第一彩色分段为品色分段,所述第二彩色分段为绿色分段。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,根据所述数字三维空间,以及所述数字三维空间与真实的三维空间的尺寸的缩放比例,确定所述目标物体的两个端点之间的距离,包括:
    根据所述数字三维空间、所述缩放比例、所述第一图像中所述目标物体的两个端点的位置,以及所述第二图像中所述目标物体的两个端点的位置,确定所述目标物体的两个端点之间的距离。
  9. 根据权利要求2-8任一项所述的方法,其特征在于,所述根据所述数字三维空间、所述缩放比例、所述数字三维空间的地面和所述数字三维空间的天空方向,确定所述目标物体的高度,包括:
    根据所述数字三维空间、所述缩放比例、所述数字三维空间的地面、所述数字三维空间的天空方向、所述第一图像中所述目标物体的顶端的位置,以及所述第二图像中所述目标物体的顶端的位置,确定所述目标物体的高度。
  10. 一种测量装置,其特征在于,包括:
    获取单元,用于获取第一图像和第二图像,所述第一图像和所述第二图像中都包括目标物体和实际尺寸已知的第一物体;其中,所述第一图像与第二图像的拍摄位置不同,且,所述第一图像与所述第二图像的拍摄方向不同;
    构建单元,用于根据所述第一图像和所述第二图像,数字三维空间;
    确定单元,用于根据所述数字三维空间,以及所述数字三维空间与真实的三维空间的尺寸的缩放比例确定所述目标物体的两个端点之间的距离,其中,所述缩放比例与所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,以及所述第一物体的实际尺寸S1有关。
  11. 根据权利要求10所述的测量装置,其特征在于,所述确定单元,还用于:
    根据所述数字三维空间的地面和所述第一图像的摄影中心,或者根据所述数字三 维空间的地面和所述第二图像的摄影中心,确定所述数字三维空间的天空方向;其中,所述数字三维空间的地面为所述数字三维空间中离散点分布最密集的平面;
    根据所述数字三维空间、所述缩放比例、所述数字三维空间的地面和所述数字三维空间的天空方向,确定所述目标物体的高度。
  12. 根据权利要求10或11所述的测量装置,其特征在于,
    在所述确定单元根据所述数字三维空间、以及所述数字三维空间与真实的三维空间的尺寸的缩放比例,确定所述目标物体的两个端点之间的距离之前,
    所述获取单元,还用于获取所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,以及所述第一物体的实际尺寸S1;
    所述确定单元,还用于根据所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,计算所述数字三维空间中所述第一物体的尺寸S2;根据所述第一物体的实际尺寸S1和所述数字三维空间中所述第一物体的尺寸S2,计算得到所述数字三维空间与真实的三维空间的尺寸的所述缩放比例。
  13. 根据权利要求12所述的测量装置,其特征在于,在所述获取单元获取所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,以及所述第一物体的实际尺寸S1的过程中,所述获取单元,具体用于:
    接收输入的所述第一图像中所述第一物体的位置、所述第二图像中所述第一物体的位置,以及所述第一物体的实际尺寸S1;
    或者,识别所述第一图像中所述第一物体的位置,以及所述第二图像中所述第一物体的位置,以及查找所述第一物体的实际尺寸S1。
  14. 根据权利要求13所述的测量装置,其特征在于,所述第一物体为分段设计的标杆,所述第一物体至少包括顺序排列的第一黑色分段、第一白色分段、第一彩色分段、第二白色分段、第二彩色分段、第三白色分段、第二黑色分段;其中,所述第一彩色分段的颜色和所述第二彩色分段的颜色为一对互补色;
    所述第一物体的实际尺寸S1为所述第一物体的两个端点之间的长度,所述第一物体一个端点位于所述第一黑色分段和所述第一白色分段的交界处,所述第一物体另一个端点位于所述第三白色分段和所述第二黑色分段的交界处;
    所述第一图像中所述第一物体的位置为所述第一图像中所述第一物体的两个端点的位置;所述第二图像中所述第一物体的位置为所述第二图像中所述第一物体的两个端点的位置。
  15. 根据权利要求14所述的测量装置,其特征在于,在所述获取单元识别所述第一图像中所述第一物体的位置,以及所述第二图像中所述第一物体的位置的过程中,所述获取单元,还具体用于:
    识别出所述第一图像中所述第一彩色分段和所述第二彩色分段,以及所述第一图像中具有直线特征的第一区域;识别出所述第二图像中所述第一彩色分段和所述第二彩色分段,以及所述第二图像中具有直线特征的第二区域;
    根据所述第一图像中所述第一彩色分段和所述第二彩色分段,所述第一图像中的所述第一区域,以及所述第一物体中各个颜色分段的位置关系,自动确定出所述第一图像中所述第一物体的两个端点的位置;以及根据所述第二图像中所述第一彩色分段 和所述第二彩色分段,所述第二图像中的所述第二区域,以及所述第一物体中各个颜色分段的位置关系,自动确定出所述第一图像中所述第一物体的两个端点的位置。
  16. 根据权利要求14或15任一项所述的测量装置,其特征在于,所述第一彩色分段为红色分段,所述第二彩色分段为青色分段;
    或者,所述第一彩色分段为品色分段,所述第二彩色分段为绿色分段。
  17. 根据权利要求10-16任一项所述的测量装置,其特征在于,在所述确定单元根据所述数字三维空间,以及所述数字三维空间与真实的三维空间的尺寸的缩放比例,确定所述目标物体的两个端点之间的距离的过程中,所述确定单元具体用于:
    根据所述数字三维空间、所述缩放比例、所述第一图像中所述目标物体的两个端点的位置,以及所述第二图像中所述目标物体的两个端点的位置,确定所述目标物体的两个端点之间的距离。
  18. 根据权利要求11-17任一项所述的测量装置,其特征在于,在所述确定单元根据所述数字三维空间、所述缩放比例、所述数字三维空间的地面和所述数字三维空间的天空方向,确定所述目标物体的高度的过程中,所述确定单元具体用于:
    根据所述数字三维空间、所述缩放比例、所述数字三维空间的地面、所述数字三维空间的天空方向、所述第一图像中所述目标物体的顶端的位置,以及所述第二图像中所述目标物体的顶端的位置,确定所述目标物体的高度。
  19. 一种服务器,其特征在于,包括一个或多个处理器、一个或多个存储器以及一个或多个通信接口,所述一个或多个存储器、所述一个或多个通信接口与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述一个或多个处理器从所述一个或多个存储器中读取所述计算机指令,以使得所述服务器执行如权利要求1-9任一项所述的数字摄影测量方法。
  20. 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在服务器上运行时,使得所述服务器执行如权利要求1-9任一项所述的数字摄影测量方法。
PCT/CN2021/077962 2020-02-28 2021-02-25 一种数字摄影测量方法、电子设备及系统 WO2021170051A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010131656.2A CN113409438A (zh) 2020-02-28 2020-02-28 一种数字摄影测量方法、电子设备及系统
CN202010131656.2 2020-02-28

Publications (1)

Publication Number Publication Date
WO2021170051A1 true WO2021170051A1 (zh) 2021-09-02

Family

ID=77489864

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/077962 WO2021170051A1 (zh) 2020-02-28 2021-02-25 一种数字摄影测量方法、电子设备及系统

Country Status (2)

Country Link
CN (1) CN113409438A (zh)
WO (1) WO2021170051A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116912333A (zh) * 2023-09-12 2023-10-20 安徽炬视科技有限公司 一种基于作业围栏标定杆的相机姿态自标定方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115839667B (zh) * 2023-02-21 2023-05-12 青岛通产智能科技股份有限公司 一种高度测量方法、装置、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105043271A (zh) * 2015-08-06 2015-11-11 宁波市北仑海伯精密机械制造有限公司 长度测量方法及装置
CN106152946A (zh) * 2015-03-31 2016-11-23 酷派软件技术(深圳)有限公司 一种测量物体长度的方法和终端
CN109118581A (zh) * 2018-08-22 2019-01-01 Oppo广东移动通信有限公司 图像处理方法和装置、电子设备、计算机可读存储介质
CN109341537A (zh) * 2018-09-27 2019-02-15 北京伟景智能科技有限公司 基于双目视觉的尺寸测量方法和装置
US20190182474A1 (en) * 2017-12-08 2019-06-13 Interface Technology (Chengdu) Co., Ltd 3d camera device, 3d imaging method, and human face recognition method
CN110570471A (zh) * 2019-10-17 2019-12-13 南京鑫和汇通电子科技有限公司 一种基于深度图像的立方物体体积测量方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106152946A (zh) * 2015-03-31 2016-11-23 酷派软件技术(深圳)有限公司 一种测量物体长度的方法和终端
CN105043271A (zh) * 2015-08-06 2015-11-11 宁波市北仑海伯精密机械制造有限公司 长度测量方法及装置
US20190182474A1 (en) * 2017-12-08 2019-06-13 Interface Technology (Chengdu) Co., Ltd 3d camera device, 3d imaging method, and human face recognition method
CN109118581A (zh) * 2018-08-22 2019-01-01 Oppo广东移动通信有限公司 图像处理方法和装置、电子设备、计算机可读存储介质
CN109341537A (zh) * 2018-09-27 2019-02-15 北京伟景智能科技有限公司 基于双目视觉的尺寸测量方法和装置
CN110570471A (zh) * 2019-10-17 2019-12-13 南京鑫和汇通电子科技有限公司 一种基于深度图像的立方物体体积测量方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116912333A (zh) * 2023-09-12 2023-10-20 安徽炬视科技有限公司 一种基于作业围栏标定杆的相机姿态自标定方法
CN116912333B (zh) * 2023-09-12 2023-12-26 安徽炬视科技有限公司 一种基于作业围栏标定杆的相机姿态自标定方法

Also Published As

Publication number Publication date
CN113409438A (zh) 2021-09-17

Similar Documents

Publication Publication Date Title
WO2021077720A1 (zh) 获取对象三维模型的方法、装置、电子设备及系统
WO2021115071A1 (zh) 单目内窥镜图像的三维重建方法、装置及终端设备
US11816829B1 (en) Collaborative disparity decomposition
WO2021017314A1 (zh) 信息处理方法、定位方法及装置、电子设备和存储介质
Micusik et al. Descriptor free visual indoor localization with line segments
CN108629829B (zh) 一种球幕相机与深度相机结合的三维建模方法和系统
Pintore et al. Omnidirectional image capture on mobile devices for fast automatic generation of 2.5 D indoor maps
WO2021170051A1 (zh) 一种数字摄影测量方法、电子设备及系统
KR20120021666A (ko) 파노라마 영상 생성 방법
WO2021136386A1 (zh) 数据处理方法、终端和服务器
CN106462943A (zh) 将全景成像与航拍成像对齐
WO2023280038A1 (zh) 一种三维实景模型的构建方法及相关装置
CN107843251A (zh) 移动机器人的位姿估计方法
CN112946679B (zh) 一种基于人工智能的无人机测绘果冻效应检测方法及系统
WO2023017663A1 (en) Systems and methods for image processing based on optimal transport and epipolar geometry
KR102389762B1 (ko) 디지털 트윈 연동 증강현실 카메라를 통한 공간 형성 및 인식 시스템 및 그 방법
WO2021129142A1 (zh) 基于建筑物的室外定位方法、装置及移动设备
CN114969221A (zh) 一种更新地图的方法及相关设备
CN115880643A (zh) 一种基于目标检测算法的社交距离监测方法和装置
CN115131504A (zh) 一种宽视场大场景下的多人三维重建方法
Tyukin et al. The development and research of the indoor navigation system for a mobile robot with the possibility of obstacle detection
CN103903301B (zh) 一种基于彩色图像识别的城市地景建模方法
KR101028171B1 (ko) 3차원 원근투영법에 기초하여 카메라에 투영된 사각형 문서에 대한 가로대 세로 비를 결정하는 방법
CN110516647A (zh) 基于图像识别的移动目标定位方法及系统
CN117170501B (zh) 基于点线融合特征的视觉跟踪方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21761177

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21761177

Country of ref document: EP

Kind code of ref document: A1