WO2021129142A1 - Building based outdoor positioning method, device and mobile equipment - Google Patents

Building based outdoor positioning method, device and mobile equipment Download PDF

Info

Publication number
WO2021129142A1
WO2021129142A1 PCT/CN2020/125210 CN2020125210W WO2021129142A1 WO 2021129142 A1 WO2021129142 A1 WO 2021129142A1 CN 2020125210 W CN2020125210 W CN 2020125210W WO 2021129142 A1 WO2021129142 A1 WO 2021129142A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature vector
contour
building
line
positioning
Prior art date
Application number
PCT/CN2020/125210
Other languages
French (fr)
Chinese (zh)
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 WO2021129142A1 publication Critical patent/WO2021129142A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/75Determining position or orientation of objects or cameras using feature-based methods involving models
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W64/00Locating users or terminals or network equipment for network management purposes, e.g. mobility management

Definitions

  • This application belongs to the field of Artificial Intelligence (AI), which is specifically related to the field of outdoor positioning, and particularly relates to building-based outdoor positioning methods, devices, mobile devices, and computer-readable storage medium information.
  • AI Artificial Intelligence
  • Multipath Effect causes large positioning errors in mobile devices such as mobile phones.
  • Related research Shows that the error is between 60 meters and 300 meters.
  • mobile phone positioning in the city center is a frequently used operation, and large positioning errors will seriously affect the user experience and cause inconvenience to users.
  • the embodiments of the present application provide building-based outdoor positioning methods, devices, mobile equipment, and computer-readable storage medium information, which can improve the accuracy of outdoor positioning of mobile equipment.
  • an embodiment of the present application provides a building-based outdoor positioning method, including:
  • the first image is an image obtained by a user using a mobile device to photograph any surrounding buildings;
  • the first image is an image obtained by a user taking pictures of any surrounding buildings through a mobile device.
  • the first contour is composed of at least two first structure lines.
  • the corresponding feature vector is obtained by extracting the structural lines in the building image, and matching it with the second feature vector, so as to determine the current location of the user according to the matched second feature vector, so that the user can be in a certain area or The densely-built area of the city can accurately locate the user's current location.
  • determining the current location of the user according to a matching result of the first feature vector and the second feature vector includes:
  • the amount of data of the second feature vector to be matched can be reduced, and the amount of The efficiency of feature vector matching is improved, and the positioning efficiency is correspondingly improved.
  • the second feature vector corresponding to the candidate set is searched for a second feature vector matching the first feature vector, and according to the found
  • the second feature vector determining the current location of the user includes:
  • a second feature vector that matches the first feature vector is searched for .
  • the method further includes:
  • the invalid second eigenvectors within the range of the second direction angle ⁇ are filtered out.
  • the preset fusion condition is that in the at least two first structure lines, the distance between two adjacent end points is less than a first value, and the distance between two adjacent first structure lines The vertical distance is smaller than the second value, and the slope difference is smaller than the third value.
  • the extracting the first contour of the first building based on the first image includes:
  • a straight line detection algorithm is used to extract a first structural line of the first building from the first image, and the first structural line composes a first outline of the first building.
  • the performing fusion processing on at least two first structure lines satisfying a preset fusion condition in the first contour to obtain a second contour composed of second structure lines includes:
  • At least two first structure lines that meet the preset fusion condition are fused and connected to form a second structure line.
  • the method before the acquiring the first feature vector corresponding to the second contour based on the second structure line, the method further includes:
  • Normalization processing is performed on the second structure line, so that the line width of the second structure line after the normalization processing is a fixed number of pixels.
  • the acquiring a first feature vector corresponding to the second contour based on the second structure line includes: acquiring a first response image made based on a second structure line in a different direction;
  • HOG descriptor to characterize the response image can reduce the influence of illumination and obstructions, improve the accuracy of the feature vector, thereby reduce the accumulation rate of positioning errors, and improve the accuracy of positioning.
  • an embodiment of the present application provides a method for constructing a feature vector database, including:
  • a feature vector database is constructed.
  • each set of second images includes at least two images, and different three-dimensional models are rendered to obtain different sets of second images.
  • the performing fusion processing on at least two third structure lines meeting a preset fusion condition in the third contour to obtain a fourth contour composed of fourth structure lines includes:
  • At least two third structure lines that meet the preset fusion condition are fused and connected to form a fourth structure line.
  • the method before the acquiring a second feature vector corresponding to the fourth contour based on the fourth structure line, the method further includes:
  • Normalization processing is performed on the fourth structure line, so that the line width of the fourth structure line after the normalization processing is a fixed number of pixels.
  • the acquiring a second feature vector corresponding to the fourth contour based on the fourth structure line includes:
  • the preset fusion condition is that in the at least two third structure lines, the distance between two adjacent end points is less than a first value, and the distance between two adjacent third structure lines The vertical distance is smaller than the second value, and the slope difference is smaller than the third value.
  • the constructing a feature vector database based on the second feature vector and position information corresponding to each of the second images includes:
  • a feature vector database is constructed based on the mapping relationship corresponding to the set of second images.
  • an embodiment of the present application provides a building-based outdoor positioning device, including:
  • the first image acquisition unit is configured to acquire a first image containing a first building, where the first building is any building near the user's current location;
  • a first contour extraction unit configured to extract a first contour of the first building based on the first image, where the first contour is composed of at least two first structure lines;
  • the first fusion unit is configured to perform fusion processing on at least two first structure lines meeting preset fusion conditions in the first contour, to obtain a second contour composed of at least two second structure lines;
  • a first feature vector obtaining unit configured to obtain a first feature vector corresponding to the second contour based on the second structure line
  • the positioning unit is configured to determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
  • an apparatus for constructing a feature vector database including:
  • the 3D model acquisition unit is used to acquire the 3D model of the target building
  • the second image acquisition unit is configured to render the three-dimensional model to obtain a set of second images including the second building;
  • a third contour extraction unit configured to extract a third contour of a building from each of the second images, where the third contour is composed of a third structure line;
  • the second fusion unit is configured to perform fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
  • a second feature vector obtaining unit configured to obtain a second feature vector corresponding to the fourth contour based on the fourth structure line
  • the feature vector database construction unit is configured to construct a feature vector database based on the second feature vector and position information corresponding to each of the second images.
  • an embodiment of the present application provides a mobile device, including:
  • the first image acquisition unit is configured to acquire a first image containing a first building, where the first building is any building near the user's current location;
  • a first contour extraction unit configured to extract a first contour of the first building based on the first image, where the first contour is composed of at least two first structure lines;
  • the first fusion unit is configured to perform fusion processing on at least two first structure lines meeting preset fusion conditions in the first contour, to obtain a second contour composed of at least two second structure lines;
  • a first feature vector obtaining unit configured to obtain a first feature vector corresponding to the second contour based on the second structure line
  • the positioning unit is configured to determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
  • an embodiment of the present application provides a cloud server, including:
  • the 3D model acquisition unit is used to acquire the 3D model of the target building
  • the second image acquisition unit is configured to render the three-dimensional model to obtain a set of second images including the second building;
  • a third contour extraction unit configured to extract a third contour of a building from each of the second images, where the third contour is composed of a third structure line;
  • the second fusion unit is configured to perform fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
  • a second feature vector obtaining unit configured to obtain a second feature vector corresponding to the fourth contour based on the fourth structure line
  • the feature vector database construction unit is configured to construct a feature vector database based on the second feature vector and position information corresponding to each of the second images.
  • the feature vector database construction unit is specifically configured to:
  • a feature vector database is constructed based on the mapping relationship corresponding to the set of second images.
  • an embodiment of the present application provides a computer-readable storage medium, including:
  • the first image acquisition unit is configured to acquire a first image containing a first building, where the first building is any building near the user's current location;
  • a first contour extraction unit configured to extract a first contour of the first building based on the first image, where the first contour is composed of at least two first structure lines;
  • the first fusion unit is configured to perform fusion processing on at least two first structure lines meeting preset fusion conditions in the first contour to obtain a second contour composed of at least two second structure lines, and the preset
  • the fusion condition is that the distance between two adjacent end points of the at least two first structure lines is less than a first value, and the vertical distance between two adjacent first structure lines is less than a second value, and The slope difference is less than the third value;
  • a first feature vector obtaining unit configured to obtain a first feature vector corresponding to the second contour based on the second structure line
  • the positioning unit is configured to determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
  • the 3D model acquisition unit is used to acquire the 3D model of the target building
  • the second image acquisition unit is configured to render the three-dimensional model to obtain a set of second images including the second building;
  • a third contour extraction unit configured to extract a third contour of a building from each of the second images, where the third contour is composed of a third structural line;
  • the second fusion unit is configured to perform fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
  • a second feature vector obtaining unit configured to obtain a second feature vector corresponding to the fourth contour based on the fourth structure line
  • the feature vector database construction unit is configured to construct a feature vector database based on the second feature vector and position information corresponding to each of the second images.
  • embodiments of the present application provide a computer program product, which when the computer program product runs on a mobile device, causes the mobile device to execute the building-based outdoor positioning method described in any one of the above-mentioned first aspects.
  • the cloud server is caused to execute the method for constructing a feature vector database according to any one of the second aspects.
  • the embodiment of the present application has the beneficial effect that by acquiring an image containing a building, and extracting the structural line corresponding to the building from the image containing the building, the After the structural line is fused, the feature vector corresponding to the outline of the building is extracted from the outline of the building obtained after the fusion process, and the user's location is determined according to the second feature vector that matches the feature vector to improve This improves the positioning accuracy of users in densely-built areas.
  • FIG. 1 is a schematic diagram of a structural line with obvious discontinuity problems provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of two structural lines satisfying preset fusion conditions according to an embodiment of the present application
  • FIG. 3 is a response image obtained by responding to structural lines in different directions in a contour provided by an embodiment of the present application
  • Embodiment 4 is a specific implementation flowchart of a building-based outdoor positioning method provided by Embodiment 1 of the present application;
  • FIG. 5 is a schematic diagram of a feature vector database provided by Embodiment 1 of the present application.
  • FIG. 6 is a specific implementation flowchart of a method for finding a second feature vector matching the first feature vector according to Embodiment 1 of the present application;
  • FIG. 7 is a schematic diagram of searching for a second eigenvector matching the first eigenvector within the range of the second direction angle ⁇ according to the first embodiment of the present application;
  • FIG. 8 is an implementation flowchart of a method for constructing a feature vector database provided by Embodiment 2 of the present application.
  • FIG. 9 is a schematic diagram of performing equidistant rendering on a three-dimensional model to obtain a set of second images according to Embodiment 2 of the present application;
  • FIG. 10 is a schematic diagram of a positioning interaction provided by Embodiment 3 of the present application.
  • FIG. 11 is a schematic diagram of a three-dimensional model of a building provided in Embodiment 3 of the present application.
  • FIGS. 12(a) to 12(d) are schematic diagrams of a set of rendered images obtained by equidistantly rendering the three-dimensional model in FIG. 11 from different positions and directions according to Embodiment 3 of the present application;
  • Figures 13(a) and 13(b) are schematic diagrams of the positioning results of a group of buildings from different angles, different distances, and different illumination provided in the third embodiment of the present application;
  • FIG. 14 is a schematic diagram of the average errors obtained by using different positioning methods under different lighting conditions for four groups provided in the third embodiment of the present application
  • FIG. 15 is a schematic structural diagram of a building-based outdoor positioning device provided by Embodiment 4 of the present application.
  • FIG. 16 is a schematic structural diagram of an apparatus for constructing a feature vector database provided by Embodiment 5 of the present application.
  • FIG. 17 is a schematic structural diagram of a mobile device according to Embodiment 6 of the present application.
  • FIG. 18 is a schematic structural diagram of a cloud server provided in Embodiment 7 of the present application.
  • the term “if” can be construed as “when” or “once” or “in response to determination” or “in response to detecting “.
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • the building-based outdoor positioning method provided in the embodiments of the present application can be applied to mobile devices.
  • the mobile device can be any device with image collection, sensor data collection and other functions, including but not limited to smart phones, smart home appliances, tablets, in-vehicle devices, wearable devices, and augmented reality (AR)/virtual reality devices (virtual reality, VR), etc.
  • AR augmented reality
  • VR virtual reality
  • the building-based outdoor positioning method provided in this application can be specifically stored in the mobile device in the form of an application or software, and the mobile device can implement the building-based outdoor positioning method provided in this application by executing the application or software.
  • the line segments in the building can reflect its structure, and can be detected by line detection algorithms such as Hough line detection algorithm, LSD (a Line Segment Detector) line detection algorithm, FLD (Fast Line Detector) line detection algorithm, etc.
  • line detection algorithms such as Hough line detection algorithm, LSD (a Line Segment Detector) line detection algorithm, FLD (Fast Line Detector) line detection algorithm, etc.
  • LSD Line Segment Detector
  • FLD Fast Line Detector line detection algorithm
  • the extracted line segment constitutes the outline of the building, that is, the outline of the building consists of at least It consists of two structural lines.
  • the detected and extracted line segments have obvious discontinuities as shown in Figure 1 (the selected part of the dashed frame).
  • the discontinuous line segment does not reflect its structure. Therefore, it is necessary to merge the structural lines that are confirmed to have obvious discontinuities in the outline of the building to obtain the repaired ones without obvious discontinuities. Contours, such as the fusion and connection of two structural lines that have obvious discontinuities.
  • At least two structural lines that meet preset fusion conditions are fused and connected into one structural line to repair structural lines that have obvious discontinuities.
  • the preset fusion condition referred to here is that of the at least two structural lines , The distance between two adjacent end points is less than the first value, the vertical distance between two adjacent structure lines is less than the second value, and the slope difference is less than the third value.
  • the two adjacent structure lines are merged and connected to form a structure line. That is to say, the embodiment of the present application merges and connects at least two structural lines that are close in distance, close in endpoints, and close in slope into one structural line.
  • the vertical distance referred to here refers to the end point of any one of the two adjacent structural lines with obvious discontinuities as the vertical point, which is the vertical line that intersects with the extension of the other structural line. And take the distance of the vertical line with the largest distance value as the vertical distance.
  • l i and l j 2 close to the endpoint, from two similar structures such as the existence of lines in the outline of the building structure in two adjacent lines, wherein, l i and l j adjacent two
  • the distance between the two endpoints is d 1 , d 1 is less than the first value
  • the vertical distance between l i and l j is d 2
  • d 2 is less than the second value
  • the slopes of the two are equal, that is, l i and l j
  • the slope difference of is zero, that is, l i and l j meet the preset fusion conditions.
  • l i and l j can be merged and connected to form a structural line.
  • the two adjacent structure lines when there are multiple continuous structure lines with obvious discontinuity in the outline, if two adjacent structure lines meet the preset fusion condition, the two adjacent structure lines can be merged into A structure line, and then determine whether the fused structure line and the adjacent structure line meet the preset fusion condition, if it meets, then merge again; otherwise, the two adjacent first structure lines are deemed to have no obvious discontinuity
  • the structural line of the problem does not need to be fused.
  • the specific fusion operation refers to connecting the start point of the first structure line with the end point of the second structure line to form a new structure line, and delete the original two after fusing into a new structure line.
  • Article structure line when there are multiple continuous structure lines with obvious discontinuity in the outline, if two adjacent structure lines meet the preset fusion condition, the two adjacent structure lines can be merged into A structure line, and then determine whether the fused structure line and the adjacent structure line meet the preset fusion condition, if it meets, then merge again; otherwise, the two adjacent first structure lines are deemed
  • the slope of the structural line in the outline of the building can basically be calculated.
  • the slope referred to here refers to the amount of a straight line with respect to the horizontal axis such as the degree of inclination of the ground. If the slope of a certain structure line cannot be calculated, the corresponding preset fusion condition is that the distance between the two adjacent end points of the at least two structure lines is less than the first value, and the two adjacent structures The vertical distance between the lines is less than the second value.
  • the extracted structure lines of the building appear as line segments in different directions in the contour image. In the images taken from different angles, the distribution of these line segments in different directions is different. Therefore, the line segments need to be extracted.
  • To obtain the response image in the corresponding direction use the preset feature descriptor to describe the response image to obtain the corresponding feature vector.
  • a Gabor filter is used to respond to structural lines in different directions in the contour, so as to obtain response images corresponding to different directions. For example, using Gabor filters in four directions (0°, 45°, 90°, 135°) to extract the directional characteristics of the structure line, four response images as shown in Figure 3 are obtained, and different directions correspond to different response images .
  • the first row of images is the direction used, and the second row of images is the corresponding response image.
  • the pixels in the corresponding direction have the highest brightness, as shown in Figure 3, which is highlighted in white. Part of the characteristic line.
  • the embodiment of this application uses the Histogram of Oriented Gradients (HOG) descriptor for the four response images shown in FIG. 3 Feature description, get the corresponding feature vector.
  • the feature vector represents the distribution feature of line segments with the same direction feature in an image.
  • the neural network model can also be used to respond to structural lines in different directions in the contour, so as to obtain response images corresponding to different directions.
  • the neural network model referred to here includes but is not limited to convolutional neural network.
  • FIG. 4 shows an implementation process of a building-based outdoor positioning method provided by an embodiment of the present application. The details are as follows:
  • step S401 a first image containing a first building is acquired.
  • the first building is any building near the user's current location (within a predetermined range from the user's current location).
  • the first image is an image obtained by taking pictures of any surrounding buildings by the camera of the mobile device used by the user at the current location.
  • the camera of the mobile device is used to capture the surrounding environment to obtain one or several images, and the one or several images contain At least one building taken from any angle.
  • the shooting of the first image needs to be aimed at the center of the building.
  • the shooting direction In addition to the direction angle of the shooting, there is no restriction on the shooting direction, and it is not required to capture the features of the specific building such as the skyline and the appearance due to the shooting angle. Intersecting lines such as the three numerical edge lines of a building, etc.
  • the buildings can be common tetrahedral structures (as shown in Figure 12) or unusual irregular structures (as shown in Figure 13).
  • step S402 a first contour of the first building is extracted based on the first image.
  • the first contour is composed of at least two first structure lines, and the first structure lines are line segments with the same or different directions.
  • step S402 specifically includes:
  • a straight line detection algorithm is used to extract a first structural line of the first building from the first image, and the first structural line composes a first outline of the first building.
  • the straight line detection algorithm includes, but is not limited to, the Hough straight line detection algorithm, the LSD straight line detection algorithm, and the FLD straight line detection algorithm.
  • step S403 fusion processing is performed on at least two first structure lines satisfying a preset fusion condition among the first contours to obtain a second contour composed of second structure lines.
  • the preset fusion condition is that the distance between two adjacent end points of the at least two first structure lines is less than a first value, and the two adjacent first structure lines The vertical distance between them is smaller than the second value, and the slope difference is smaller than the third value.
  • the purpose of repairing the first contour is achieved, and the second structure line composed of the second structure lines is obtained.
  • the contour is the contour of the building after repairing the obvious discontinuity problem.
  • the second structure line includes but is not limited to the structure line obtained after the fusion process, that is, the second structure line includes the first structure line. Since in the first contour, not all the first structure lines meet the preset fusion condition, that is, there are some structure lines that do not need to be fused. Therefore, the second contour is the structure line after the fusion processing and the first structure line. An outline is composed of structural lines that do not need to be fused. For ease of description, the embodiment of the present application collectively refers to all the structure lines in the second contour as the second structure line.
  • step S403 specifically includes:
  • At least two first structure lines that meet the preset fusion condition are fused and connected to form a second structure line.
  • the second structure line is the structure line obtained after the fusion process.
  • the final structure line obtained by the fusion process is set to the second structure
  • the first structural line that does not need to be fused and connected in the first contour is also set as the second structural line, and all the second structural lines constitute the second contour of the building.
  • step S404 a first feature vector corresponding to the second contour is obtained based on the second structure line.
  • the Gabor filter is used to respond to the structure lines in different directions in the second contour to obtain response images corresponding to different directions, for example, using four directions (0°, 45°, 90°, 135°). °) Gabor filter extracts the directional features of the second structure line.
  • the convolutional neural network model is used to respond to structural lines in different directions in the second contour, so as to obtain response images corresponding to different directions.
  • the different directions are not limited to the four directions of 0°, 45°, 90°, and 135°, but can also be directions from other angles, that is, the number of response images corresponding to different directions is not determined. Specific restrictions.
  • the method before step S404, the method further includes:
  • Normalization processing is performed on the second structure line, so that the line width of the second structure line after the normalization processing is a fixed number of pixels.
  • the width of the structure line obtained by the straight line detection algorithm is different, and the first feature vector obtained directly based on the structure line of different width may cause unnecessary errors and fail to pass the
  • the first feature vector accurately describes the structure line of the building. Therefore, before the first feature vector corresponding to the second contour is obtained, the line pixels of the second structure line are normalized to make the normalized
  • the line width of the second structure line is a fixed number of pixels.
  • step S404 specifically includes:
  • Step S4041 Acquire first response images based on second structure lines in different directions.
  • the Gabor operator or the convolutional neural network model it is possible to respond to the structural lines in different directions in the contour, so as to obtain the response image corresponding to the direction.
  • Step S4042 Use the HOG descriptor to perform feature description on the first response graph, and obtain the first feature vector corresponding to the second contour.
  • the number of first feature vectors is the same as the number of response images, how many response images in different directions exist, and how many first feature vectors are corresponding, that is, the final first feature vector is multiple The result of splicing the first feature vector corresponding to the response image.
  • step S405 the current location of the user is determined according to the matching result of the first feature vector and the second feature vector.
  • the second feature vector is data stored in a feature vector database. Please refer to FIG. 5, which shows related data of a feature vector database.
  • the second feature vector and the location information corresponding to the second feature vector are stored in the feature vector database, and the location information is composed of latitude and longitude information.
  • the second feature vector that matches the feature vector can be found from the feature vector database, so that the location information of the mobile device can be determined, that is, according to the matched second feature vector Get the positioning result of the mobile device.
  • the feature vector database can be stored on the mobile device side, or on the cloud server side. Since the creation or update of the feature vector database requires a large amount of positioning data support and a large number of operations, the feature vector database is generally created on the cloud server side, or the feature vector database is updated. The cloud server synchronously sends the created or updated feature vector database to the mobile device side for storage, so that the mobile device side can call the second feature vector in the feature vector database to determine the positioning result of the mobile device.
  • the embodiment of the present application provides specific implementation steps of a method for finding a second feature vector that matches the first feature vector as shown in FIG. 6, which are detailed as follows:
  • step S601 the positioning information of the user is acquired through a positioning sensor.
  • the GPS positioning information obtained is the user's positioning through the positioning sensor of the mobile device, such as a GPS positioning sensor. information.
  • GPS signals will cause multipath effects after multiple reflections from buildings, which will lead to large positioning errors in GPS positioning information obtained by mobile devices, and the positioning errors are generally Between 60 meters and 100 meters, this will bring great changes to the user's travel. Therefore, the acquired GPS positioning information can only be used as rough position information, which needs to be corrected to obtain more accurate positioning results.
  • step S602 a candidate set of buildings within a predetermined range from the center is determined with the positioning information as the center.
  • the GPS positioning information after obtaining the GPS positioning information, taking the GPS positioning information as the center, obtain buildings within a predetermined range from the center as a candidate set of buildings in the area where the mobile device is located.
  • take GPS positioning information as the center to acquire buildings within a predetermined shape such as a square.
  • step S603 a second feature vector corresponding to the candidate set is obtained from the feature vector database.
  • the second feature vector of the area in the feature vector database is determined accordingly, thereby reducing the amount of search for the second feature vector and greatly improving The efficiency of finding the second feature vector that matches the first feature vector, thereby correspondingly improving the positioning efficiency.
  • step S604 search for a second feature vector matching the first feature vector from the second feature vector corresponding to the candidate set, and determine the current location of the user according to the found second feature vector .
  • the first feature vector is matched with any second feature vector of each building in the candidate set, such as the first second feature vector, so as to determine the building corresponding to the first image. That is, the building photographed by the mobile device is determined, and the positioning result of the mobile device is further determined according to the building.
  • FIG. 7 is a schematic diagram of searching for a second eigenvector matching the first eigenvector within the range of the second direction angle ⁇ according to an embodiment of the application, in order to further reduce the search for the second eigenvector
  • step S604 will be described in detail with reference to Fig. 7, which is specifically as follows:
  • Step S6041 Obtain the first direction angle ⁇ .
  • the user obtains the first direction angle ⁇ through the built-in sensor of the mobile device, such as a posture sensor or a gyroscope, while capturing the first building to obtain the first image including the first building.
  • the built-in sensor of the mobile device such as a posture sensor or a gyroscope
  • Step S6042 using the first direction angle ⁇ as a reference, search for a second eigenvector within the range of the second direction angle ⁇ .
  • the second direction angle ⁇ is the sum/difference of the first direction angle ⁇ and the preset angle ⁇ .
  • Step S6043 from the found second eigenvectors within the range of the second direction angle ⁇ , search for a second eigenvector matching the first eigenvector, and use a linear interpolation method to determine the user’s current position.
  • the building model shown in Figure 6 is the center of GPS positioning information
  • the quadrilateral is a candidate set of buildings in the area where the mobile device is located
  • the five-pointed star is the second eigenvector corresponding to the position
  • the five-pointed star is the second eigenvector within the range of the second direction angle ⁇ .
  • the method further includes:
  • the invalid second eigenvectors within the range of the second direction angle ⁇ are filtered out.
  • the invalid second feature vector is specifically an area that cannot be reached by people or vehicles, such as roads that are prohibited from pedestrians or vehicles, such as lakes, pools, etc., which can be filtered through the map data of the mobile device.
  • the map data can be obtained through the built-in map of the mobile device.
  • step S405 the method further includes:
  • the first feature vector corresponding to the building is extracted, and the user's location is determined according to the second feature vector matching the first feature vector.
  • the first feature vector and the second feature vector are used to determine the location of the user.
  • the feature vector realizes the accurate positioning of the user's current location in a certain area or city with dense buildings, and improves the positioning accuracy of the user in a certain area or city with dense buildings.
  • FIG. 8 shows an implementation process of a method for constructing a feature vector database provided by an embodiment of the present application. The details are as follows:
  • step S801 a three-dimensional model of the target building is acquired.
  • the three-dimensional model can quickly render a large number of images, so as to obtain enough second feature vectors to construct a feature vector database.
  • the three-dimensional model in Google Earth is selected in the embodiments of this application, which is mainly based on the following considerations:
  • the areas with large positioning errors of mobile devices are limited to high-rise buildings in a city, such as the urban CBD.
  • the three-dimensional model in Google Earth basically covers the three-dimensional model of the buildings in the city center of major cities in the world.
  • Google Earth's 3D model is associated with Sketchup, the world's largest free 3D model library, and the number of 3D models is increasing and updating quickly.
  • the three-dimensional model based on Google Earth can ensure the accuracy of the second feature vector obtained, thereby creating a feature vector database with more complete and accurate data.
  • step S802 the three-dimensional model is rendered to obtain a set of second images containing second buildings.
  • each set of second images including the second building is correspondingly obtained, and each set of second images includes at least two images.
  • the second building referred to here is an image of a different direction of the target building.
  • the three-dimensional model is rendered at equal intervals from different angles and positions according to the preset rendering path and image sampling interval, and the camera's information is recorded while rendering.
  • the position and attitude angle is the third angle ⁇ , and a set of rendered images containing accurate position information is obtained.
  • FIG. 9 is a schematic diagram of rendering a three-dimensional model to obtain a set of second images according to an embodiment of the application.
  • the shape of the building in the photo is different.
  • the image obtained from the three positions A, B, and C in Figure 9 can use the building
  • the structure line describes the shape.
  • the method of rendering the three-dimensional model in computer graphics is used to obtain images rendered at different positions and different angles at equal distances, and build based on these rendered images.
  • the rendering path is actually the path of the camera movement
  • the black dots indicate the position of the camera (expressed as latitude and longitude) when the 3D model is rendered
  • the interval of the dots is the interval at which the camera collects images.
  • the point interval can be customized and is related to the required positioning accuracy. The smaller the point interval, the higher the positioning accuracy.
  • step S803 the third contour of the building is extracted from each of the second images.
  • the third contour is composed of a third structural line, and the structural line of the building is extracted from each second image through a straight line detection algorithm, and the extracted structural line forms the contour of the building, that is, the first Three contours.
  • the line detection algorithm includes, but is not limited to, the Hough line detection algorithm, the LSD line detection algorithm, and the FLD line detection algorithm.
  • step S804 fusion processing is performed on at least two third structure lines satisfying preset fusion conditions among the third contours to obtain a fourth contour composed of fourth structure lines.
  • the preset fusion condition is that among the at least two third structure lines, the distance between the two adjacent end points is less than the first value, and the two adjacent third structure lines The vertical distance between them is smaller than the second value, and the slope difference is smaller than the third value.
  • the purpose of repairing the third contour is achieved, and the fourth contour composed of the fourth structural lines is obtained. That is, the outline of the building after the obvious discontinuity problem is repaired.
  • the fourth structure line includes but is not limited to the structure line obtained after the fusion process, that is, the fourth structure line includes the third structure line. Since in the third contour, not all the third structure lines meet the preset fusion condition, that is, there are some structure lines that do not need to be fused. Therefore, the fourth contour is the structure line after fusion processing and the first The three contours are composed of structural lines that do not need to be fused. For ease of description, the embodiment of the present application collectively refers to all the structure lines in the fourth contour as the fourth structure line.
  • step S804 specifically includes:
  • At least two third structure lines that meet the preset fusion condition are fused and connected to form a fourth structure line.
  • the third structure line is the structure line obtained after the fusion process. Before this, no matter how many times the fourth structure line has been fused, the final structure line obtained by the fusion process is set to the fourth structure After the fusion processing is completed, the third structural line that does not need to be fused and connected in the third contour is also set as the fourth structural line, and all the fourth structural lines constitute the fourth contour of the building.
  • step S805 a second feature vector corresponding to the fourth contour is acquired based on the fourth structure line.
  • the Gabor filter or the convolutional neural network model is also used to respond to the structural lines in different directions in the fourth contour to obtain response images corresponding to different directions.
  • step S805 the method further includes:
  • Normalization processing is performed on the fourth structure line, so that the line width of the fourth structure line after the normalization processing is a fixed number of pixels.
  • step S805 specifically includes:
  • Step S8051 Acquire a second response image based on the fourth structure line in a different direction.
  • Step S8052 Use the HOG descriptor to perform feature description on the second response graph, and obtain a second feature vector corresponding to the fourth contour.
  • step S806 a feature vector database is constructed based on the second feature vector and location information corresponding to each of the second images.
  • different second images correspond to different second feature vectors
  • a set of second feature vectors corresponding to a set of second images is used as the second feature vector, which is related to the position information of the set of second images.
  • the combination of data such as the third direction angle ⁇ forms a feature vector database, so that the corresponding position information can be found according to the second feature vector.
  • each second image is set as the second feature vector
  • the position information and the third angle ⁇ corresponding to each second image are acquired at the same time, and each second image is created
  • the mapping relationship between the corresponding second feature vector, the position information and the third direction angle ⁇ , and the feature vector database shown in FIG. 5 is constructed based on the mapping relationship corresponding to each second image.
  • the primary key of the feature vector database is the second feature vector, and the matching location information can be found through the second feature vector.
  • step S806 includes:
  • Step S8061 Obtain the position information and the third direction angle ⁇ corresponding to each of the second images.
  • the position information of the camera that collects each second image and the attitude angle of the camera, that is, the third direction angle ⁇ are recorded at the same time, so as to obtain the second feature vector corresponding to the second image. Then establish a mapping relationship with the position information and the third angle ⁇ .
  • Step S8062 Establish a mapping relationship between each second image and its corresponding second feature vector, position information, and third-direction angle ⁇ , to obtain a mapping relationship corresponding to the set of second images.
  • the positioning accuracy of the user's current position is further improved.
  • Step S8063 Construct a feature vector database based on the mapping relationship corresponding to the set of second images.
  • step S806 is specifically:
  • a feature vector database is constructed.
  • the second feature vector is constructed based on the mapping relationship corresponding to the several sets of second images.
  • the third contour is composed of third structure lines; the fusion processing is performed on at least two third structure lines that meet the preset fusion conditions in the third contour, to obtain the fourth structure line composed of the fourth structure lines.
  • Contour based on the fourth structure line, obtain the second feature vector corresponding to the fourth contour; based on the second feature vector and position information corresponding to each of the second images, construct a feature vector database, by comparing the three-dimensional model A large number of rendered images and feature vectors and location information corresponding to the rendered images are obtained by rendering, which improves the construction efficiency and accuracy of the feature vector database.
  • the tested area of Zhujiang New City is 2,497,400m 2 , including 12 buildings, and the test time is a time period when the light changes drastically: 16:00-18:00, and the mobile equipment used is the current market Smart phone, the smart phone can automatically obtain GPS positioning information when shooting, and the real location is manually marked according to the map.
  • the cloud server obtains the three-dimensional model of the Guangdong Museum as shown in Figure 11 from Goolge Earth;
  • the cloud server sets the rendering path and the interval of image collection, and renders the 3D model in Fig. 11 equidistantly from different positions and directions, and obtains a set as shown in Fig. 12(a) to Fig. 12(d) Render the image.
  • Fig. 12(a) equidistantly from different positions and directions
  • Fig. 12(d) Render the image.
  • the cloud server uses the method in the second embodiment to extract and repair the structural lines of the building in the rendered image
  • the cloud server uses the method in the second embodiment to obtain the feature vector corresponding to each rendered image, that is, the second feature vector, and establish the mapping relationship between the position information of each rendered image, the second feature vector, and the attitude angle, that is, the direction angle, and The mapping relationship is stored in the feature vector database, and the feature vector database as shown in FIG. 5 is constructed.
  • the smart phone uses the method in the first embodiment to extract and repair the structural lines of the building in the captured image;
  • the smart phone uses the method in the first embodiment to extract the feature vector corresponding to the captured image
  • the smart phone searches the feature vector database stored in the smart phone for a second feature vector that matches the feature vector based on the extracted feature vector, the smart phone’s GPS positioning information, the reading of the attitude sensor, and the map data. And through linear interpolation method to determine the user's current location.
  • the smart phone sends the extracted feature vector, the smart phone’s GPS positioning information, the reading of the attitude sensor and the map data to the cloud service,
  • the cloud server searches the feature vector database for a second feature vector that matches the feature vector in the smart phone, and determines the current location of the user through linear interpolation and returns the current location of the user to smart phone.
  • the location information obtained by the GPS positioning sensor of the mobile device is corrected by combining the relevant data of the cloud server and the mobile device, so as to return accurate location information for the user.
  • the positioning accuracy provided by the embodiments of the present application is higher than the positioning accuracy of other existing positioning methods.
  • Figure 13 (a) and Figure 13 (b) show the positioning results of a group of buildings from different angles, different distances and different illumination, where the first The row image represents the captured image, that is, the first image, and the second row image is the structure line extracted and repaired according to the first image corresponding to the first row after the obvious discontinuity problem, that is, the contour image composed of the second structure line.
  • the three rows of images correspond to the structure lines extracted and repaired by the second image that matches the first image, that is, the contour image composed of the fourth structure line, and the last row is the positioning result provided by the embodiment of the application.
  • "+" represents the positioning result provided by the embodiment of the present application
  • " ⁇ " represents the actual location of the user.
  • FIG. 14 shows a schematic diagram of the average positioning errors obtained by using different positioning methods in four groups under different lighting conditions.
  • Figure 14 contains four sets of cumulative positioning errors obtained by using different positioning methods under different lighting conditions.
  • the first positioning error in each group is the average positioning error of all test cases.
  • the second positioning error is the average error of the positioning error of the test case under sufficient light such as daytime
  • the third positioning error is the average error of the positioning error of the test case under insufficient light such as the night.
  • the first set of average positioning errors is the average value of the positioning errors calculated based on the positioning information obtained by the GPS sensor of the mobile device and its real position; the second set of positioning errors is the positioning result and the real position provided by this embodiment of the application.
  • the average value of the calculated positioning error It can be seen from FIG. 14 that the average positioning error of the embodiment of the present application is far lower than the average positioning error of the other three groups, and the average positioning error under different lighting conditions is also much lower than the average positioning error of the remaining three groups. It can also be seen that the positioning result of this embodiment is not affected by the lighting conditions.
  • the first existing positioning method is specifically as follows:
  • This method proposes a positioning method based on point features.
  • the photo taken by the user is located at a corner of the building.
  • the photo contains three vertical edge lines of the building. Since the user always has an oblique angle when taking pictures, the three edge lines in the photo can intersect at one point. The location of the intersection of different photos is different.
  • This feature is called the TICEP feature.
  • several potential photo shooting points can be found on the 2-dimensional map where the building is located.
  • the potential shooting point is determined by the self-defined TICEP feature, and the deviation function (deviation function) constructed based on this is used to find the matching feature to obtain the accurate position.
  • the second existing positioning method is specifically as follows:
  • This method combines SLAM and positioning, and proposes a point-based positioning method.
  • the user takes a picture and obtains the angle and position information measured by the built-in sensor of the mobile phone, and uses this information to retrieve a 2.5-dimensional map (position information + height) to obtain the user's rough position in the 2.5-dimensional map. Then correct this rough position and use the following formula to estimate the precise position C of the camera:
  • l 1 and l 2 are the two vertical straight lines in the image
  • x 1 and x 2 are the two points where the building and the ground intersect.
  • the area located in the existing positioning method 1 is limited to the area around the corners of the building, and the image of the building taken must include three vertical line segments of the building; in the existing positioning method 2, 2.5 A three-dimensional map assists positioning, and the captured image of the building must include the intersection of the building and the ground.
  • FIG. 15 shows a structural block diagram of the building-based outdoor positioning device provided by an embodiment of the present application. The relevant part of the embodiment.
  • the device includes:
  • the first image acquisition unit 151 is configured to acquire a first image containing a first building, where the first building is any building near the user's current location;
  • the first contour extraction unit 152 is configured to extract a first contour of the first building based on the first image, where the first contour is composed of at least two first structural lines;
  • the first fusion unit 153 is configured to perform fusion processing on at least two first structure lines meeting preset fusion conditions in the first outline, to obtain a second outline composed of at least two second structure lines;
  • the first feature vector obtaining unit 154 is configured to obtain a first feature vector corresponding to the second contour based on the second structure line;
  • the positioning unit 155 is configured to determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
  • the positioning unit 155 includes:
  • the location information acquisition subunit is used to acquire the location information of the user through a location sensor
  • a candidate set determining subunit used to determine a candidate set of buildings within a predetermined range from the center with the positioning information as the center;
  • a second feature vector obtaining subunit configured to obtain a second feature vector corresponding to the candidate set from a feature vector database
  • the positioning subunit is used to search for a second feature vector matching the first feature vector from the second feature vector corresponding to the candidate set, and determine the current user’s current feature vector based on the found second feature vector position.
  • the positioning subunit is specifically configured to:
  • the positioning subunit is specifically further used for:
  • the invalid second eigenvectors within the range of the second direction angle ⁇ are filtered out.
  • the preset fusion condition is that in the at least two first structure lines, the distance between two adjacent end points is less than a first value, and the vertical distance between two adjacent first structure lines is The distance is smaller than the second value, and the slope difference is smaller than the third value.
  • the first contour extraction unit 152 is specifically configured to:
  • a straight line detection algorithm is used to extract a first structural line of the first building from the first image, and the first structural line composes a first outline of the first building.
  • the first fusion unit 153 is specifically configured to:
  • At least two first structure lines that meet the preset fusion condition are fused and connected to form a second structure line.
  • the device further includes:
  • the second structure line normalization processing unit is configured to perform a normalization process on the second structure line, so that the line width of the second structure line after the normalization process is a fixed number of pixels.
  • the first feature vector acquiring unit 154 is specifically configured to:
  • the first structural line corresponding to the building is fused. Then, from the contour of the building obtained after the fusion process, the first feature vector corresponding to the building is extracted, and the user's location is determined according to the second feature vector matching the first feature vector, and the first feature vector is used to determine the location of the user.
  • the vector and the second feature vector realize accurate positioning of the user's current location in the densely-built area, and improve the positioning accuracy of the user in the densely-built area.
  • FIG. 16 shows a structural block diagram of the device for constructing a feature vector database provided by an embodiment of the present application. The relevant part.
  • the device includes:
  • the three-dimensional model obtaining unit 161 is configured to obtain a three-dimensional model of the target building
  • the second image obtaining unit 162 is configured to render the three-dimensional model to obtain a set of second images including the second building;
  • the third contour extraction unit 163 is configured to extract a third contour of the building from each of the second images, where the third contour is composed of third structural lines;
  • the second fusion unit 162 is configured to perform fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
  • the second feature vector obtaining unit 165 is configured to obtain a second feature vector corresponding to the fourth contour based on the fourth structure line;
  • the feature vector database construction unit 166 is configured to construct a feature vector database based on the second feature vector and position information corresponding to each of the second images.
  • the second fusion unit 162 is specifically configured to:
  • At least two third structure lines that meet the preset fusion condition are fused and connected to form a fourth structure line.
  • the device further includes:
  • the fourth structure line normalization processing unit is configured to perform normalization processing on the fourth structure line, so that the line width of the fourth structure line after the normalization processing is a fixed number of pixels.
  • the second feature vector obtaining unit 165 is specifically configured to:
  • the preset fusion condition is that in the at least two third structure lines, the distance between two adjacent end points is less than a first value, and the distance between two adjacent third structure lines The vertical distance is smaller than the second value, and the slope difference is smaller than the third value.
  • the feature vector database construction unit 166 is specifically configured to:
  • a feature vector database is constructed based on the mapping relationship corresponding to the set of second images.
  • the third contour is composed of third structure lines; the fusion processing is performed on at least two third structure lines that meet the preset fusion conditions in the third contour, to obtain the fourth structure line composed of the fourth structure lines.
  • Contour based on the fourth structure line, obtain the second feature vector corresponding to the fourth contour; based on the second feature vector and position information corresponding to each of the second images, construct a feature vector database, by comparing the three-dimensional model A large number of rendered images and feature vectors and location information corresponding to the rendered images are obtained by rendering, which improves the construction efficiency and accuracy of the feature vector database.
  • FIG. 17 is a schematic structural diagram of a mobile device provided by an embodiment of this application.
  • the mobile device 17 of this embodiment includes: at least one processor 170 (only one is shown in FIG. 17), a processor, a memory 171, and a processor that is stored in the memory 171 and can be processed in the at least one processor.
  • a computer program 172 running on the processor 170 when the processor 170 executes the computer program 172, the steps in any of the foregoing building-based outdoor positioning method embodiments are implemented.
  • the processor 170 executes the computer program 172, the functions of the units in the foregoing device embodiments, for example, the functions of the units 151 to 155 shown in FIG. 15 are realized.
  • the mobile device 17 may be a computing device such as a mobile phone, a desktop computer, a notebook, and a palmtop computer.
  • the mobile device 17 may include, but is not limited to, a processor 170 and a memory 171.
  • FIG. 17 is only an example of the mobile device 17 and does not constitute a limitation on the mobile device 17. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
  • the so-called processor 170 may be a central processing unit (Central Processing Unit, CPU), and the processor 170 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), and application specific integrated circuits (Application Specific Integrated Circuits). , ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 171 may be an internal storage unit of the mobile device 17 in some embodiments, such as a hard disk or a memory of the electronic mobile sub-device 17. In other embodiments, the memory 171 may also be an external storage device of the mobile device 17, such as a plug-in hard disk equipped on the mobile device 17, a smart media card (SMC), and a secure digital (Secure Digital, SD) card, Flash Card, etc. Further, the memory 171 may also include both an internal storage unit of the mobile device 17 and an external storage device. The memory 171 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program.
  • a boot loader BootLoader
  • the memory 171 can also be used to temporarily store data that has been output or will be output.
  • the embodiment of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program. When the processor is executed, the steps in the foregoing method embodiments can be realized.
  • FIG. 18 is a schematic structural diagram of a cloud server provided by an embodiment of the application.
  • the cloud server 18 of this embodiment includes: at least one processor 180 (only one is shown in FIG. 18), a processor, a memory 181, and a memory 181 stored in the memory 181 and available in the at least one processor.
  • a computer program 182 running on the processor 180 when the processor 180 executes the computer program 182, the steps in any of the above-mentioned embodiments of the building-based outdoor positioning method are implemented.
  • the processor 180 executes the computer program 182
  • the functions of the units in the foregoing device embodiments for example, the functions of the units 161 to 166 shown in FIG. 16 are realized.
  • the cloud server 18 may be a computing device such as a mobile phone, a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the cloud server 18 may include, but is not limited to, a processor 180 and a memory 181.
  • FIG. 18 is only an example of the cloud server 18, and does not constitute a limitation on the cloud server 18. It may include more or less components than shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
  • the so-called processor 180 may be a central processing unit (Central Processing Unit, CPU), and the processor 180 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), and application specific integrated circuits (Application Specific Integrated Circuits). , ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 181 may be an internal storage unit of the cloud server 18 in some embodiments, such as a hard disk or memory of the cloud server 18. In other embodiments, the memory 181 may also be an external storage device of the cloud server 18, such as a plug-in hard disk equipped on the cloud server 18, a smart media card (SMC), and a secure digital (Secure Digital, SD) card, Flash Card, etc. Further, the storage 181 may also include both an internal storage unit of the cloud server 18 and an external storage device.
  • the memory 181 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program.
  • the memory 181 can also be used to temporarily store data that has been output or will be output.
  • the embodiment of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program. When the processor is executed, the steps in the foregoing method embodiments can be realized.
  • the embodiments of the present application provide a computer program product.
  • the steps in the foregoing method embodiments can be realized when the mobile device is executed.
  • 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 computer program can be stored in a computer-readable storage medium.
  • the computer program can be stored in a computer-readable storage medium.
  • the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/mobile device, recording medium, computer memory, read-only memory (ROM, Read-ONly MeMory), random access memory (RAM, RaNdoM Access MeMory), electric carrier signal, telecommunications signal and software distribution medium.
  • ROM read-only memory
  • RAM random access memory
  • RaNdoM Access MeMory electric carrier signal
  • telecommunications signal and software distribution medium for example, U disk, mobile hard disk, floppy disk or CD-ROM, etc.
  • computer-readable media cannot be electrical carrier signals and telecommunication signals.
  • the disclosed apparatus/network equipment and method may be implemented in other ways.
  • the device/network device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units.
  • components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The present application belongs to the field of artificial intelligence, and realizes auxiliary outdoor positioning using a computer vision method. The application proposes the method for positioning the mobile equipment based on the visual characteristics of the building contour line regarding the problem that the mobile equipment has positioning errors in a building dense area. Specifically, a building structure line extracting and repairing method is firstly proposed; then a descriptor for representing the characteristics of the building structural line is proposed to solve the problem that the traditional descriptor is not robust to illumination and shielding; and then, by taking the descriptor as a visual fingerprint, a fingerprint map construction algorithm based on a rendering three-dimensional model is proposed, the problem that the construction of a fingerprint map is time-consuming and labor-consuming is solved; finally a multiple sensors cooperative positioning method is proposed to improve the positioning efficiency. When a user uses the method, the user only needs to photograph any building, and the mobile equipment extracts the structural line of the building and calculates the visual characteristics of the structural line, and solves the accurate position of the user by matching with a fingerprint map and combining with multiple sensors.

Description

基于建筑物的室外定位方法、装置及移动设备Building-based outdoor positioning method, device and mobile equipment
本申请要求于2019年12月24日提交国家知识产权局、申请号为201911348363.3、申请名称为“基于建筑物的室外定位方法、装置及移动设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office on December 24, 2019, the application number is 201911348363.3, and the application name is "Building-based outdoor positioning methods, devices and mobile equipment". The entire content of the application is approved The reference is incorporated in this application.
技术领域Technical field
本申请属于人工智能(Artificial Intelligence,AI)领域,具体和室外定位领域相关,尤其涉及基于建筑物的室外定位方法、装置、移动设备及计算机可读存储介质信息。This application belongs to the field of Artificial Intelligence (AI), which is specifically related to the field of outdoor positioning, and particularly relates to building-based outdoor positioning methods, devices, mobile devices, and computer-readable storage medium information.
背景技术Background technique
在一个城市的建筑物密集区域,如城市的CBD中,GPS信号经过建筑物的多次反弹会造成多径效应(Multipath Effect),该效应导致手机等移动设备存在很大的定位误差,相关研究表明该误差在60米到300米之间。对于手机用户来说,在市中心用手机定位是一个频繁使用的操作,而较大的定位误差则会严重影响使用体验,为用户出行造成不便。In a densely built area of a city, such as the CBD of a city, multiple bounces of GPS signals through buildings will cause a multipath effect (Multipath Effect), which causes large positioning errors in mobile devices such as mobile phones. Related research Shows that the error is between 60 meters and 300 meters. For mobile phone users, mobile phone positioning in the city center is a frequently used operation, and large positioning errors will seriously affect the user experience and cause inconvenience to users.
发明内容Summary of the invention
本申请实施例提供了基于建筑物的室外定位方法、装置、移动设备及计算机可读存储介质信息,可以提高移动设备室外定位的精准度。The embodiments of the present application provide building-based outdoor positioning methods, devices, mobile equipment, and computer-readable storage medium information, which can improve the accuracy of outdoor positioning of mobile equipment.
第一方面,本申请实施例提供了一种基于建筑物的室外定位方法,包括:In the first aspect, an embodiment of the present application provides a building-based outdoor positioning method, including:
获取包含第一建筑物的第一图像;所述第一图像为用户通过移动设备对其周围的任意建筑物进行拍摄得到的图像;Acquiring a first image containing a first building; the first image is an image obtained by a user using a mobile device to photograph any surrounding buildings;
基于所述第一图像提取所述第一建筑物的第一轮廓,所述第一轮廓由至少两条第一结构线组成;Extracting a first contour of the first building based on the first image, where the first contour is composed of at least two first structural lines;
对所述第一轮廓中满足预设融合条件的至少两条第一结构线进行融合处理,获得由至少两条第二结构线组成的第二轮廓;Performing fusion processing on at least two first structure lines meeting a preset fusion condition in the first contour, to obtain a second contour composed of at least two second structure lines;
基于所述第二结构线,获取所述第二轮廓对应的第一特征向量;Obtaining a first feature vector corresponding to the second contour based on the second structure line;
根据所述第一特征向量与第二特征向量的匹配结果,确定所述用户的当前位置。Determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
示例性的,所述第一图像为用户通过移动设备对其周围的任意建筑物进行拍摄得到的图像。Exemplarily, the first image is an image obtained by a user taking pictures of any surrounding buildings through a mobile device.
所述第一轮廓由至少两条第一结构线组成。The first contour is composed of at least two first structure lines.
应理解,通过提取建筑物图像中的结构线得到相应的特征向量,将其与第二特征向量进行匹配,从而根据所匹配的第二特征向量确定用户的当前位置,使得能够在某一地区或城市的建筑物密集区域对用户的当前位置进行精确定位。It should be understood that the corresponding feature vector is obtained by extracting the structural lines in the building image, and matching it with the second feature vector, so as to determine the current location of the user according to the matched second feature vector, so that the user can be in a certain area or The densely-built area of the city can accurately locate the user's current location.
在第一方面的第一种可能的实现方式中,根据所述第一特征向量与第二特征向量的匹配结果,确定所述用户的当前位置包括:In a first possible implementation manner of the first aspect, determining the current location of the user according to a matching result of the first feature vector and the second feature vector includes:
通过定位传感器获取所述用户的定位信息;Acquiring the positioning information of the user through a positioning sensor;
以所述定位信息为中心,确定距离所述中心预定范围内的建筑物的候选集;Using the positioning information as a center to determine a candidate set of buildings within a predetermined range from the center;
从特征向量数据库中获取与所述候选集对应的第二特征向量;Acquiring a second feature vector corresponding to the candidate set from a feature vector database;
从与所述候选集对应的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,并根据查找到的第二特征向量确定所述用户的当前位置。From the second feature vector corresponding to the candidate set, search for a second feature vector matching the first feature vector, and determine the current location of the user according to the found second feature vector.
应理解,通过缩小所要匹配的建筑物的范围,即根据用户的定位信息比如GPS定位信息确定用户所在区域内的建筑物的候选集,可以减少所要匹配的第二特征向量的数据量,大大提高了特征向量匹配的效率,相应地提高了定位效率。It should be understood that by narrowing the range of buildings to be matched, that is, determining the candidate set of buildings in the area where the user is located according to the user's positioning information such as GPS positioning information, the amount of data of the second feature vector to be matched can be reduced, and the amount of The efficiency of feature vector matching is improved, and the positioning efficiency is correspondingly improved.
在第一方面的第二种可能的实现方式中,所述从与所述候选集对应的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,并根据查找到的第二特征向量确定所述用户的当前位置包括:In a second possible implementation manner of the first aspect, the second feature vector corresponding to the candidate set is searched for a second feature vector matching the first feature vector, and according to the found The second feature vector determining the current location of the user includes:
获取第一方向角α;Obtain the first direction angle α;
以所述第一方向角α为基准,查找在第二方向角α±β范围内的第二特征向量;Using the first direction angle α as a reference, search for a second eigenvector within a range of the second direction angle α±β;
从查找到的所述第二方向角α±β范围内的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,利用线性插值方法确定所述用户的当前位置。From the found second eigenvectors within the range of the second direction angle α±β, search for a second eigenvector that matches the first eigenvector, and determine the current location of the user by using a linear interpolation method.
应理解,通过第一方向角α进一步缩小所要匹配的第二特征向量的数据量,对特征向量的匹配效率进行了再次提升,相应的,定位效率也提高了。It should be understood that by further reducing the data amount of the second feature vector to be matched by the first direction angle α, the matching efficiency of the feature vector is again improved, and accordingly, the positioning efficiency is also improved.
在第一方面的第三种可能的实现方式中,在所述从查找到的所述第二方向角范围内的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,利用线性插值方法确定所述用户的当前位置之前,还包括:In a third possible implementation manner of the first aspect, in the second feature vector within the range of the second direction angle found from the search, a second feature vector that matches the first feature vector is searched for , Before determining the current position of the user by using a linear interpolation method, the method further includes:
滤除所述第二方向角α±β范围内的无效第二特征向量。The invalid second eigenvectors within the range of the second direction angle α±β are filtered out.
应理解,通过滤除无效第二特征向量,可以进一步提高定位信息的精确度。It should be understood that by filtering out the invalid second feature vector, the accuracy of the positioning information can be further improved.
示例性的,所述预设融合条件为所述至少两条第一结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条第一结构线之间的垂直距离小于第二数值,且斜率差小于第三数值。Exemplarily, the preset fusion condition is that in the at least two first structure lines, the distance between two adjacent end points is less than a first value, and the distance between two adjacent first structure lines The vertical distance is smaller than the second value, and the slope difference is smaller than the third value.
示例性的,所述基于所述第一图像提取所述第一建筑物的第一轮廓包括:Exemplarily, the extracting the first contour of the first building based on the first image includes:
通过直线检测算法,从所述第一图像中提取所述第一建筑物的第一结构线,所述第一结构线组成所述第一建筑物的第一轮廓。A straight line detection algorithm is used to extract a first structural line of the first building from the first image, and the first structural line composes a first outline of the first building.
示例性的,所述对所述第一轮廓中满足预设融合条件的至少两条第一结构线进行融合处理,获得由第二结构线组成的第二轮廓包括:Exemplarily, the performing fusion processing on at least two first structure lines satisfying a preset fusion condition in the first contour to obtain a second contour composed of second structure lines includes:
将满足预设融合条件的至少两条第一结构线融合连接成一条第二结构线。At least two first structure lines that meet the preset fusion condition are fused and connected to form a second structure line.
应理解,将明显存在间断问题的结构线进行融合处理,使得其能够准确的反映建筑物的结构,相应地提高特征向量的提取准确率,进一步降低定位误差的累积率,从而达到获得精确的定位信息的目的。It should be understood that the fusion processing of structural lines with obvious discontinuities enables them to accurately reflect the structure of the building, correspondingly improve the accuracy of feature vector extraction, and further reduce the accumulation rate of positioning errors, so as to achieve accurate positioning The purpose of the information.
在第一方面的第四种可能的实现方式中,在所述基于所述第二结构线,获取所述第二轮廓对应的第一特征向量之前,还包括:In a fourth possible implementation manner of the first aspect, before the acquiring the first feature vector corresponding to the second contour based on the second structure line, the method further includes:
对所述第二结构线进行归一化处理,以使得归一化处理后的所述第二结构线的线条宽度为固定像素个数。Normalization processing is performed on the second structure line, so that the line width of the second structure line after the normalization processing is a fixed number of pixels.
应理解,通过将第二结构线的线条宽度为固定像素个数,可以进一步降低定位误差的累积率。It should be understood that by setting the line width of the second structure line to a fixed number of pixels, the accumulation rate of positioning errors can be further reduced.
示例性的,所述基于所述第二结构线,获取所述第二轮廓对应的第一特征向量包括:获取基于不同方向的第二结构线所做出的第一响应图像;Exemplarily, the acquiring a first feature vector corresponding to the second contour based on the second structure line includes: acquiring a first response image made based on a second structure line in a different direction;
使用方向梯度直方图HOG描述子对所述第一响应图进行特征描述,获得所述第二轮廓对应的第一特征向量。Use the HOG descriptor of the directional gradient histogram to perform feature description on the first response graph, and obtain the first feature vector corresponding to the second contour.
应理解,使用HOG描述子对响应图像进行特征描述,可以减少光照以及遮挡物的影响,提高特征向量的准确率,从而降低定位误差的累积率,提高定位的精确度。It should be understood that the use of the HOG descriptor to characterize the response image can reduce the influence of illumination and obstructions, improve the accuracy of the feature vector, thereby reduce the accumulation rate of positioning errors, and improve the accuracy of positioning.
第二方面,本申请实施例提供了一种特征向量数据库的构建方法,包括:In the second aspect, an embodiment of the present application provides a method for constructing a feature vector database, including:
获取目标建筑物的三维模型;Obtain a three-dimensional model of the target building;
对所述三维模型进行渲染,获得一组包含第二建筑物的第二图像;Rendering the three-dimensional model to obtain a set of second images containing the second building;
从每个所述第二图像中提取建筑物的第三轮廓,所述第三轮廓由第三结构线组成;Extracting a third contour of the building from each of the second images, where the third contour is composed of a third structural line;
对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓;Performing fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
基于所述第四结构线,获取所述第四轮廓对应的第二特征向量;Obtaining a second feature vector corresponding to the fourth contour based on the fourth structure line;
基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库。Based on the second feature vector and position information corresponding to each of the second images, a feature vector database is constructed.
应理解,每一组第二图像中包含至少两张图像,不同的三维模型渲染得到不同组数的第二图像。每一个三维模型渲染所得第二图像越多,对应的第二特征向量越多,使得所匹配的特征向量能够确定精确的位置信息,为用户提供精确的定位信息。It should be understood that each set of second images includes at least two images, and different three-dimensional models are rendered to obtain different sets of second images. The more second images rendered by each three-dimensional model, the more corresponding second feature vectors, so that the matched feature vectors can determine accurate position information and provide users with accurate positioning information.
示例性的,所述对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓包括:Exemplarily, the performing fusion processing on at least two third structure lines meeting a preset fusion condition in the third contour to obtain a fourth contour composed of fourth structure lines includes:
将满足预设融合条件的至少两条第三结构线融合连接成一条第四结构线。At least two third structure lines that meet the preset fusion condition are fused and connected to form a fourth structure line.
在第二方面的第一种可能的实现方式中,在所述基于所述第四结构线,获取所述第四轮廓对应的第二特征向量之前,还包括:In a first possible implementation manner of the second aspect, before the acquiring a second feature vector corresponding to the fourth contour based on the fourth structure line, the method further includes:
对所述第四结构线进行归一化处理,以使得归一化处理后的所述第四结构线的线条宽度为固定像素个数。Normalization processing is performed on the fourth structure line, so that the line width of the fourth structure line after the normalization processing is a fixed number of pixels.
示例性的,所述基于所述第四结构线,获取所述第四轮廓对应的第二特征向量包括:Exemplarily, the acquiring a second feature vector corresponding to the fourth contour based on the fourth structure line includes:
获取基于不同方向的第四结构线所做出的第二响应图像。Acquire a second response image based on the fourth structure line in a different direction.
使用HOG描述子对所述第二响应图进行特征描述,获得所述第四轮廓对应的第二特征向量。Use the HOG descriptor to perform feature description on the second response graph to obtain the second feature vector corresponding to the fourth contour.
示例性的,所述预设融合条件为所述至少两条第三结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条第三结构线之间的垂直距离小于第二数值,且斜率差小于第三数值。Exemplarily, the preset fusion condition is that in the at least two third structure lines, the distance between two adjacent end points is less than a first value, and the distance between two adjacent third structure lines The vertical distance is smaller than the second value, and the slope difference is smaller than the third value.
示例性的,所述基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库包括:Exemplarily, the constructing a feature vector database based on the second feature vector and position information corresponding to each of the second images includes:
获取每一个所述第二图像对应的位置信息和第三方向角γ;Acquiring the position information and the third angle γ corresponding to each of the second images;
建立每一个所述第二图像及其对应的第二特征向量、位置信息和第三方向角γ的映射关系,得到所述一组第二图像对应的映射关系;Establishing a mapping relationship between each second image and its corresponding second feature vector, position information, and third-direction angle γ, to obtain a mapping relationship corresponding to the set of second images;
基于所述一组第二图像对应的映射关系构建特征向量数据库。A feature vector database is constructed based on the mapping relationship corresponding to the set of second images.
第三方面,本申请实施例提供了一种基于建筑物的室外定位装置,包括:In the third aspect, an embodiment of the present application provides a building-based outdoor positioning device, including:
第一图像获取单元,用于获取包含第一建筑物的第一图像,所述第一建筑物为用户当前所在位置附近的任意建筑物;The first image acquisition unit is configured to acquire a first image containing a first building, where the first building is any building near the user's current location;
第一轮廓提取单元,用于基于所述第一图像提取所述第一建筑物的第一轮廓,所述第一轮廓由至少两条第一结构线组成;A first contour extraction unit, configured to extract a first contour of the first building based on the first image, where the first contour is composed of at least two first structure lines;
第一融合单元,用于对所述第一轮廓中满足预设融合条件的至少两条第一结构线进行融合处理,获得由至少两条第二结构线组成的第二轮廓;The first fusion unit is configured to perform fusion processing on at least two first structure lines meeting preset fusion conditions in the first contour, to obtain a second contour composed of at least two second structure lines;
第一特征向量获取单元,用于基于所述第二结构线,获取所述第二轮廓对应的第一特征向量;A first feature vector obtaining unit, configured to obtain a first feature vector corresponding to the second contour based on the second structure line;
定位单元,用于根据所述第一特征向量与第二特征向量的匹配结果,确定所述用户的当前位置。The positioning unit is configured to determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
第四方面,本申请实施例提供了一种特征向量数据库的构建装置,包括:In a fourth aspect, an embodiment of the present application provides an apparatus for constructing a feature vector database, including:
三维模型获取单元,用于获取目标建筑物的三维模型;The 3D model acquisition unit is used to acquire the 3D model of the target building;
第二图像获取单元,用于对所述三维模型进行渲染,获得一组包含第二建筑物的第二图像;The second image acquisition unit is configured to render the three-dimensional model to obtain a set of second images including the second building;
第三轮廓提取单元,用于从每个所述第二图像中提取建筑物的第三轮廓,所述第三轮廓由第三结构线组成;A third contour extraction unit, configured to extract a third contour of a building from each of the second images, where the third contour is composed of a third structure line;
第二融合单元,用于对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓;The second fusion unit is configured to perform fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
第二特征向量获取单元,用于基于所述第四结构线,获取所述第四轮廓对应的第二特征向量;A second feature vector obtaining unit, configured to obtain a second feature vector corresponding to the fourth contour based on the fourth structure line;
特征向量数据库构建单元,用于基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库。The feature vector database construction unit is configured to construct a feature vector database based on the second feature vector and position information corresponding to each of the second images.
第五方面,本申请实施例提供了一种移动设备,包括:In the fifth aspect, an embodiment of the present application provides a mobile device, including:
第一图像获取单元,用于获取包含第一建筑物的第一图像,所述第一建筑物为用户当前所在位置附近的任意建筑物;The first image acquisition unit is configured to acquire a first image containing a first building, where the first building is any building near the user's current location;
第一轮廓提取单元,用于基于所述第一图像提取所述第一建筑物的第一轮廓,所述第一轮廓由至少两条第一结构线组成;A first contour extraction unit, configured to extract a first contour of the first building based on the first image, where the first contour is composed of at least two first structure lines;
第一融合单元,用于对所述第一轮廓中满足预设融合条件的至少两条第一结构线进行融合处理,获得由至少两条第二结构线组成的第二轮廓;The first fusion unit is configured to perform fusion processing on at least two first structure lines meeting preset fusion conditions in the first contour, to obtain a second contour composed of at least two second structure lines;
第一特征向量获取单元,用于基于所述第二结构线,获取所述第二轮廓对应的第一特征向量;A first feature vector obtaining unit, configured to obtain a first feature vector corresponding to the second contour based on the second structure line;
定位单元,用于根据所述第一特征向量与第二特征向量的匹配结果,确定所述用户的当前位置。The positioning unit is configured to determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
第六方面,本申请实施例提供了一种云服务器,包括:In a sixth aspect, an embodiment of the present application provides a cloud server, including:
三维模型获取单元,用于获取目标建筑物的三维模型;The 3D model acquisition unit is used to acquire the 3D model of the target building;
第二图像获取单元,用于对所述三维模型进行渲染,获得一组包含第二建筑物的第二图像;The second image acquisition unit is configured to render the three-dimensional model to obtain a set of second images including the second building;
第三轮廓提取单元,用于从每个所述第二图像中提取建筑物的第三轮廓,所述第三轮廓由第三结构线组成;A third contour extraction unit, configured to extract a third contour of a building from each of the second images, where the third contour is composed of a third structure line;
第二融合单元,用于对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓;The second fusion unit is configured to perform fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
第二特征向量获取单元,用于基于所述第四结构线,获取所述第四轮廓对应的第二特征向量;A second feature vector obtaining unit, configured to obtain a second feature vector corresponding to the fourth contour based on the fourth structure line;
特征向量数据库构建单元,用于基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库。The feature vector database construction unit is configured to construct a feature vector database based on the second feature vector and position information corresponding to each of the second images.
示例性的,所述特征向量数据库构建单元具体用于:Exemplarily, the feature vector database construction unit is specifically configured to:
获取每一个所述第二图像对应的位置信息和第三方向角γ,建立每一个所述第二图像及其对应的第二特征向量、位置信息和第三方向角γ的映射关系,得到所述一组第二图像对应的映射关系;Obtain the position information and the third angle γ corresponding to each of the second images, and establish the mapping relationship between each second image and its corresponding second feature vector, the position information and the third angle γ, and obtain the Describe the mapping relationship corresponding to a set of second images;
基于所述一组第二图像对应的映射关系构建特征向量数据库。A feature vector database is constructed based on the mapping relationship corresponding to the set of second images.
第七方面,本申请实施例提供了一种计算机可读存储介质,包括:In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, including:
第一图像获取单元,用于获取包含第一建筑物的第一图像,所述第一建筑物为用户当前所在位置附近的任意建筑物;The first image acquisition unit is configured to acquire a first image containing a first building, where the first building is any building near the user's current location;
第一轮廓提取单元,用于基于所述第一图像提取所述第一建筑物的第一轮廓,所述第一轮廓由至少两条第一结构线组成;A first contour extraction unit, configured to extract a first contour of the first building based on the first image, where the first contour is composed of at least two first structure lines;
第一融合单元,用于对所述第一轮廓中满足预设融合条件的至少两条第一结构线进行融合处理,获得由至少两条第二结构线组成的第二轮廓,所述预设融合条件为所述至少两条第一结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条第一结构线之间的垂直距离小于第二数值,且斜率差小于第三数值;The first fusion unit is configured to perform fusion processing on at least two first structure lines meeting preset fusion conditions in the first contour to obtain a second contour composed of at least two second structure lines, and the preset The fusion condition is that the distance between two adjacent end points of the at least two first structure lines is less than a first value, and the vertical distance between two adjacent first structure lines is less than a second value, and The slope difference is less than the third value;
第一特征向量获取单元,用于基于所述第二结构线,获取所述第二轮廓对应的第一特征向量;A first feature vector obtaining unit, configured to obtain a first feature vector corresponding to the second contour based on the second structure line;
定位单元,用于根据所述第一特征向量与第二特征向量的匹配结果,确定所述用户的当前位置。The positioning unit is configured to determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
以及:as well as:
三维模型获取单元,用于获取目标建筑物的三维模型;The 3D model acquisition unit is used to acquire the 3D model of the target building;
第二图像获取单元,用于对所述三维模型进行渲染,获得一组包含第二建筑物的第二图像;The second image acquisition unit is configured to render the three-dimensional model to obtain a set of second images including the second building;
第三轮廓提取单元,用于从每个所述第二图像中提取建筑物的第三轮廓,所述第三轮廓由第三结构线组成;A third contour extraction unit, configured to extract a third contour of a building from each of the second images, where the third contour is composed of a third structural line;
第二融合单元,用于对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓;The second fusion unit is configured to perform fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
第二特征向量获取单元,用于基于所述第四结构线,获取所述第四轮廓对应的第二特征向量;A second feature vector obtaining unit, configured to obtain a second feature vector corresponding to the fourth contour based on the fourth structure line;
特征向量数据库构建单元,用于基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库。The feature vector database construction unit is configured to construct a feature vector database based on the second feature vector and position information corresponding to each of the second images.
第八方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动设备上运行时,使得移动设备执行上述第一方面中任一项所述的基于建筑物的室外定位方法。当计算机程序产品在云服务器上运行时,使得云服务器执行上述第二方面中 任一项所述的特征向量数据库的构建方法。In an eighth aspect, embodiments of the present application provide a computer program product, which when the computer program product runs on a mobile device, causes the mobile device to execute the building-based outdoor positioning method described in any one of the above-mentioned first aspects. When the computer program product runs on the cloud server, the cloud server is caused to execute the method for constructing a feature vector database according to any one of the second aspects.
可以理解的是,上述第三方面至第八方面的有益效果可以参见上述第一方面和第二方面中的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the third aspect to the eighth aspect described above, reference may be made to the related description in the first aspect and the second aspect described above, and details are not described herein again.
本申请实施例与现有技术相比存在的有益效果是:通过获取包含建筑物的图像,并从该包含建筑物的图像中提取该建筑物对应的结构线,在对满足预设融合条件的结构线进行融合处理后,从进行融合处理后的得到的建筑物的轮廓中,提取该建筑物的轮廓对应的特征向量,根据与该特征向量相匹配的第二特征向量确定用户的位置,提高了用户在建筑物密集区域的定位精度。Compared with the prior art, the embodiment of the present application has the beneficial effect that by acquiring an image containing a building, and extracting the structural line corresponding to the building from the image containing the building, the After the structural line is fused, the feature vector corresponding to the outline of the building is extracted from the outline of the building obtained after the fusion process, and the user's location is determined according to the second feature vector that matches the feature vector to improve This improves the positioning accuracy of users in densely-built areas.
附图说明Description of the drawings
图1是本申请实施例提供的一种存在明显的间断问题的结构线的示意图;FIG. 1 is a schematic diagram of a structural line with obvious discontinuity problems provided by an embodiment of the present application;
图2是本申请实施例提供的一种满足预设融合条件的两条结构线的示意图;FIG. 2 is a schematic diagram of two structural lines satisfying preset fusion conditions according to an embodiment of the present application;
图3是本申请实施例提供的一种对轮廓中不同方向的结构线做出响应得到的响应图像;FIG. 3 is a response image obtained by responding to structural lines in different directions in a contour provided by an embodiment of the present application;
图4是本申请实施例一提供的一种基于建筑物的室外定位方法的具体实现流程图;4 is a specific implementation flowchart of a building-based outdoor positioning method provided by Embodiment 1 of the present application;
图5是本申请实施例一提供的一种特征向量数据库的示意图;FIG. 5 is a schematic diagram of a feature vector database provided by Embodiment 1 of the present application;
图6是本申请实施例一提供的一种查找与第一特征向量相匹配的第二特征向量的方法的具体实现流程图;FIG. 6 is a specific implementation flowchart of a method for finding a second feature vector matching the first feature vector according to Embodiment 1 of the present application;
图7是本申请实施例一提供的一种在第二方向角α±β范围内查找与第一特征向量匹配的第二特征向量的示意图;FIG. 7 is a schematic diagram of searching for a second eigenvector matching the first eigenvector within the range of the second direction angle α±β according to the first embodiment of the present application;
图8是本申请实施例二提供的一种特征向量数据库的构建方法的实现流程图;FIG. 8 is an implementation flowchart of a method for constructing a feature vector database provided by Embodiment 2 of the present application;
图9是本申请实施例二提供的一种对三维模型进行等距离渲染,获得一组第二图像的示意图;9 is a schematic diagram of performing equidistant rendering on a three-dimensional model to obtain a set of second images according to Embodiment 2 of the present application;
图10是本申请实施例三提供的一种定位交互示意图;FIG. 10 is a schematic diagram of a positioning interaction provided by Embodiment 3 of the present application;
图11是本申请实施例三提供的一种建筑物的三维模型的示意图;FIG. 11 is a schematic diagram of a three-dimensional model of a building provided in Embodiment 3 of the present application;
图12(a)至图12(d)是本申请实施例三提供的一组从不同位置和方向对图11中的三维模型进行等距离渲染得到的渲染图像的示意图;FIGS. 12(a) to 12(d) are schematic diagrams of a set of rendered images obtained by equidistantly rendering the three-dimensional model in FIG. 11 from different positions and directions according to Embodiment 3 of the present application;
图13(a)和图13(b)是本申请实施例三提供的一组建筑物从不同角度、不同距离和不同光照下的定位结果的示意图;Figures 13(a) and 13(b) are schematic diagrams of the positioning results of a group of buildings from different angles, different distances, and different illumination provided in the third embodiment of the present application;
图14是本申请实施例三提供的四组在不同光照条件下使用不同的定位方法的所得到平均误差的示意图FIG. 14 is a schematic diagram of the average errors obtained by using different positioning methods under different lighting conditions for four groups provided in the third embodiment of the present application
图15是本申请实施例四提供的一种基于建筑物的室外定位装置的结构示意图;15 is a schematic structural diagram of a building-based outdoor positioning device provided by Embodiment 4 of the present application;
图16是本申请实施例五提供的一种特征向量数据库的构建装置的结构示意图;FIG. 16 is a schematic structural diagram of an apparatus for constructing a feature vector database provided by Embodiment 5 of the present application;
图17是本申请实施例六提供的一种移动设备的结构示意图;FIG. 17 is a schematic structural diagram of a mobile device according to Embodiment 6 of the present application;
图18是本申请实施例七提供的一种云服务器的结构示意图。FIG. 18 is a schematic structural diagram of a cloud server provided in Embodiment 7 of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are proposed for a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obstructing the description of this application.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the existence of the described features, wholes, steps, operations, elements and/or components, but does not exclude one or more other The existence or addition of features, wholes, steps, operations, elements, components, and/or collections thereof.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the specification and appended claims of this application refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the description of this application and the appended claims, the term "if" can be construed as "when" or "once" or "in response to determination" or "in response to detecting ". Similarly, the phrase "if determined" or "if detected [described condition or event]" can be interpreted as meaning "once determined" or "in response to determination" or "once detected [described condition or event]" depending on the context ]" or "in response to detection of [condition or event described]".
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。The reference to "one embodiment" or "some embodiments" described in the specification of this application means that one or more embodiments of this application include a specific feature, structure, or characteristic described in combination with the embodiment. Therefore, the sentences "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless it is specifically emphasized otherwise. The terms "including", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
本申请实施例提供的基于建筑物的室外定位方法可以应用于移动设备。该移动设备可以是任意具有图像采集、传感器数据采集等功能的设备,包括但不限于智能手机、智能家电、平板电脑、车载设备、可穿戴设备以及增强现实(Augmented Reality,AR)/虚拟现实设备(virtual reality,VR)等。本申请提供的基于建筑物的室外定位方法具体可以以应用程序或软件的形式存储于移动设备,移动设备通过执行该应用程序或软件,实现本申请提供的基于建筑物的室外定位方法。The building-based outdoor positioning method provided in the embodiments of the present application can be applied to mobile devices. The mobile device can be any device with image collection, sensor data collection and other functions, including but not limited to smart phones, smart home appliances, tablets, in-vehicle devices, wearable devices, and augmented reality (AR)/virtual reality devices (virtual reality, VR), etc. The building-based outdoor positioning method provided in this application can be specifically stored in the mobile device in the form of an application or software, and the mobile device can implement the building-based outdoor positioning method provided in this application by executing the application or software.
在本申请实施中,建筑物中的线段可以反映其结构,可以通过直线检测算法比如霍夫直线检测算法、LSD(a Line Segment Detector)直线检测算法、FLD(Fast Line Detector)直线检测算法等,从包含建筑物的图像中检测该建筑物中的线段,根据检测结果提取出来线段即称为建筑物的结构线,所提取出来的线段构成了建筑物的轮廓,也即建筑物的轮廓由至少两条结构线组成。In the implementation of this application, the line segments in the building can reflect its structure, and can be detected by line detection algorithms such as Hough line detection algorithm, LSD (a Line Segment Detector) line detection algorithm, FLD (Fast Line Detector) line detection algorithm, etc. Detect the line segment in the building from the image containing the building, and extract the line segment based on the detection result, which is called the structural line of the building. The extracted line segment constitutes the outline of the building, that is, the outline of the building consists of at least It consists of two structural lines.
然而,由于图像中轻微的梯度变化,导致被检测出并被提取的线段存在如图1所示的明显的间断问题(虚框选中部分)。对于建筑物来说,间断的线段并不能反映其结构,因此需要对建筑物的轮廓中被确认为存在明显的间断问题的结构线进行融合处理,以得到修复后的没有存在明显的间断问题的轮廓,比如将明显存在间断问题的两条结构线融合连接在一起。However, due to the slight gradient changes in the image, the detected and extracted line segments have obvious discontinuities as shown in Figure 1 (the selected part of the dashed frame). For the building, the discontinuous line segment does not reflect its structure. Therefore, it is necessary to merge the structural lines that are confirmed to have obvious discontinuities in the outline of the building to obtain the repaired ones without obvious discontinuities. Contours, such as the fusion and connection of two structural lines that have obvious discontinuities.
本申请实施例通过将满足预设融合条件的至少两条结构线融合连接成一条结构线以修复明显存在间断问题的结构线,这里所指的预设融合条件为所述至少两条结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条结构线之间的垂直距离小于第二数值,且斜率差小于第三数值。比如,在明显存在间断问题的两条结构线之 间,如果满足相邻的两个端点之间的距离小于第一数值比如5mm,相邻的两条结构线之间的垂直距离小于第二数值比如1mm或5个像素,相邻的两条结构线的斜率的差的绝对值小于第三数值中的至少一个,则将该相邻的两条结构线融合连接在一起形成一条结构线。也即本申请实施例将同时满足距离相近、端点相近,斜率相近的至少两条结构线融合连接成一条结构线。In this embodiment of the application, at least two structural lines that meet preset fusion conditions are fused and connected into one structural line to repair structural lines that have obvious discontinuities. The preset fusion condition referred to here is that of the at least two structural lines , The distance between two adjacent end points is less than the first value, the vertical distance between two adjacent structure lines is less than the second value, and the slope difference is less than the third value. For example, between two structural lines with obvious discontinuities, if the distance between two adjacent end points is less than the first value, such as 5mm, the vertical distance between two adjacent structure lines is less than the second value For example, for 1 mm or 5 pixels, if the absolute value of the difference between the slopes of two adjacent structure lines is less than at least one of the third values, the two adjacent structure lines are merged and connected to form a structure line. That is to say, the embodiment of the present application merges and connects at least two structural lines that are close in distance, close in endpoints, and close in slope into one structural line.
需要说明的是,这里所指的垂直距离为以存在明显间断问题的相邻两条结构线中的任意一条结构线的端点为垂点,作与另外一条结构线的延长线相交的垂线,并以其中距离值最大的一条垂线的距离作为垂直距离。如图2所示,l i和l j为端点相近、距离相近的两条结构线比如在建筑物的轮廓中存在的相邻的两条结构线,其中,l i和l j相邻的两个端点之间的距离为d 1,d 1小于第一数值,l i和l j之间的垂直距离为d 2,d 2小于第二数值,两者的斜率相等,即l i和l j的斜率差为零,也即l i和l j满足预设融合条件,这时,可以将l i和l j融合连接成一条结构线。 It should be noted that the vertical distance referred to here refers to the end point of any one of the two adjacent structural lines with obvious discontinuities as the vertical point, which is the vertical line that intersects with the extension of the other structural line. And take the distance of the vertical line with the largest distance value as the vertical distance. As shown, l i and l j 2 close to the endpoint, from two similar structures such as the existence of lines in the outline of the building structure in two adjacent lines, wherein, l i and l j adjacent two The distance between the two endpoints is d 1 , d 1 is less than the first value, the vertical distance between l i and l j is d 2 , d 2 is less than the second value, and the slopes of the two are equal, that is, l i and l j The slope difference of is zero, that is, l i and l j meet the preset fusion conditions. At this time, l i and l j can be merged and connected to form a structural line.
在本申请实施例中,当轮廓中存在多条连续且明显存在间断问题的结构线时,如果相邻的两条结构线满足预设融合条件,则可以将相邻的两条结构线融合成一条结构线,再确定融合后的结构线与相邻的结构线是否满足预设融合条件,如果满足,则再次融合;否则,该相邻的两条第一结构线被视为不存在明显间断问题的结构线,不需要进行融合处理。作为示例而非限定,具体的融合操作是指把第一条结构线的起点与第二条结构线的终点相连接,形成一条新的结构线,融合成新的结构线后删除原有的两条结构线。In the embodiment of the present application, when there are multiple continuous structure lines with obvious discontinuity in the outline, if two adjacent structure lines meet the preset fusion condition, the two adjacent structure lines can be merged into A structure line, and then determine whether the fused structure line and the adjacent structure line meet the preset fusion condition, if it meets, then merge again; otherwise, the two adjacent first structure lines are deemed to have no obvious discontinuity The structural line of the problem does not need to be fused. As an example and not a limitation, the specific fusion operation refers to connecting the start point of the first structure line with the end point of the second structure line to form a new structure line, and delete the original two after fusing into a new structure line. Article structure line.
需要说明的是,由于拍摄角度的问题,建筑物的轮廓中的结构线基本都能计算得到其斜率,这里所指的斜率是表示一条直线关于横坐标轴比如地面倾斜程度的量。如果无法计算得到某一结构线的斜率,则相应的预设融合条件为所述至少两条结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条结构线之间的垂直距离小于第二数值。It should be noted that, due to the shooting angle, the slope of the structural line in the outline of the building can basically be calculated. The slope referred to here refers to the amount of a straight line with respect to the horizontal axis such as the degree of inclination of the ground. If the slope of a certain structure line cannot be calculated, the corresponding preset fusion condition is that the distance between the two adjacent end points of the at least two structure lines is less than the first value, and the two adjacent structures The vertical distance between the lines is less than the second value.
还需要说明的是,提取到的建筑物的结构线在轮廓图像中表现为不同方向的线段,从不同的角度拍摄的图像中,这些线段在不同方向上的分布是不同,因此,需要提取线段的方向特征,得到对应方向的响应图像,使用预设的特征描述子对该响应图像进行描述得到对应的特征向量。It should also be noted that the extracted structure lines of the building appear as line segments in different directions in the contour image. In the images taken from different angles, the distribution of these line segments in different directions is different. Therefore, the line segments need to be extracted. To obtain the response image in the corresponding direction, use the preset feature descriptor to describe the response image to obtain the corresponding feature vector.
本申请实施例通过Gabor滤波器对轮廓中不同方向的结构线做出响应,从而得到不同方向对应的响应图像。比如,使用四个方向(0°、45°、90°、135°)的Gabor滤波器提取结构线的方向特征,得到如图3所示的四张响应图像,不同的方向对应不同的响应图像。In the embodiment of the present application, a Gabor filter is used to respond to structural lines in different directions in the contour, so as to obtain response images corresponding to different directions. For example, using Gabor filters in four directions (0°, 45°, 90°, 135°) to extract the directional characteristics of the structure line, four response images as shown in Figure 3 are obtained, and different directions correspond to different response images .
如图3所示,第一行图像为所使用的方向,第二行图像为对应的响应图像,在该响应图像中,对应方向的像素的亮度最大,如图中3中显示的高亮白色部分的特征线。As shown in Figure 3, the first row of images is the direction used, and the second row of images is the corresponding response image. In this response image, the pixels in the corresponding direction have the highest brightness, as shown in Figure 3, which is highlighted in white. Part of the characteristic line.
由于响应图像是特定方向上的直线,其方向性可以用分布特征描述,本申请实施例使用方向梯度直方图(Histogram of oriented gradients,HOG)描述子对如图3所示的四张响应图像进行特征描述,得到对应的特征向量。该特征向量表示具有相同方向特征的线段在一个图像中的分布特征。Since the response image is a straight line in a specific direction, its directionality can be described by the distribution feature. The embodiment of this application uses the Histogram of Oriented Gradients (HOG) descriptor for the four response images shown in FIG. 3 Feature description, get the corresponding feature vector. The feature vector represents the distribution feature of line segments with the same direction feature in an image.
在本申请实施例中,还可以通过神经网络模型对轮廓中不同方向的结构线做出响 应,从而得到不同方向对应的响应图像。这里所指的神经网络模型包括但不限于卷积神经网络。In the embodiments of the present application, the neural network model can also be used to respond to structural lines in different directions in the contour, so as to obtain response images corresponding to different directions. The neural network model referred to here includes but is not limited to convolutional neural network.
下面结合具体的实施例对本申请进行详细的说明。The application will be described in detail below in conjunction with specific embodiments.
实施例一Example one
请参考图4,图4示出了本申请实施例提供的一种基于建筑物的室外定位方法的实现流程,详述如下:Please refer to FIG. 4, which shows an implementation process of a building-based outdoor positioning method provided by an embodiment of the present application. The details are as follows:
在步骤S401中,获取包含第一建筑物的第一图像。In step S401, a first image containing a first building is acquired.
在本申请实施例中,第一建筑物为用户当前所在位置附近(距离用户当前所在位置预定范围内)的任意建筑物。第一图像为用户在当前所在位置通过其使用的移动设备的摄像头对周围的任意建筑物进行拍摄得到的图像。在本申请的一个具体实施例中,当用户在的CBD中使用移动设备定位时,通过移动设备的摄像头对周围环境进行拍摄得到一张或若干张图像,这一张或若干张图像中包含有至少一个从任意角度拍摄的建筑物。In the embodiment of the present application, the first building is any building near the user's current location (within a predetermined range from the user's current location). The first image is an image obtained by taking pictures of any surrounding buildings by the camera of the mobile device used by the user at the current location. In a specific embodiment of the present application, when the user uses a mobile device to locate in the CBD of the user, the camera of the mobile device is used to capture the surrounding environment to obtain one or several images, and the one or several images contain At least one building taken from any angle.
需要说明的是,对第一图像的拍摄需对准建筑物的中心,除此外对拍摄的方向角不做限制,也不要求拍摄到特定建筑物的特征比如天际线、因拍摄角度而出现的相交线比如建筑物的三条数值边缘线等。It should be noted that the shooting of the first image needs to be aimed at the center of the building. In addition to the direction angle of the shooting, there is no restriction on the shooting direction, and it is not required to capture the features of the specific building such as the skyline and the appearance due to the shooting angle. Intersecting lines such as the three numerical edge lines of a building, etc.
还需要说明的是,对第一图像拍摄的建筑物没有任何限制,建筑可以是常见的四面体结构(如图12),也可以是不常见的不规则的结构(如图13)。It should also be noted that there are no restrictions on the buildings captured in the first image. The buildings can be common tetrahedral structures (as shown in Figure 12) or unusual irregular structures (as shown in Figure 13).
在步骤S402中,基于所述第一图像提取所述第一建筑物的第一轮廓。In step S402, a first contour of the first building is extracted based on the first image.
在本申请实施例中,第一轮廓由至少两条第一结构线组成,所述第一结构线为具有相同或不同方向的线段。In the embodiment of the present application, the first contour is composed of at least two first structure lines, and the first structure lines are line segments with the same or different directions.
作为示例而非限定,步骤S402具体包括:As an example and not a limitation, step S402 specifically includes:
通过直线检测算法,从所述第一图像中提取所述第一建筑物的第一结构线,所述第一结构线组成所述第一建筑物的第一轮廓。A straight line detection algorithm is used to extract a first structural line of the first building from the first image, and the first structural line composes a first outline of the first building.
在本申请实施例中,直线检测算法包括但不限于霍夫直线检测算法、LSD直线检测算法、FLD直线检测算法。In the embodiment of the present application, the straight line detection algorithm includes, but is not limited to, the Hough straight line detection algorithm, the LSD straight line detection algorithm, and the FLD straight line detection algorithm.
在步骤S403中,对所述第一轮廓中满足预设融合条件的至少两条第一结构线进行融合处理,获得由第二结构线组成的第二轮廓。In step S403, fusion processing is performed on at least two first structure lines satisfying a preset fusion condition among the first contours to obtain a second contour composed of second structure lines.
在本申请实施例中,所述预设融合条件为所述至少两条第一结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条第一结构线之间的垂直距离小于第二数值,且斜率差小于第三数值。In the embodiment of the present application, the preset fusion condition is that the distance between two adjacent end points of the at least two first structure lines is less than a first value, and the two adjacent first structure lines The vertical distance between them is smaller than the second value, and the slope difference is smaller than the third value.
通过将第一轮廓中满足预设融合条件的至少两条第一结构线即明显存在间断问题的结构线进行融合处理,从而达到修复第一轮廓的目的,获得由第二结构线组成的第二轮廓即修复明显存在间断问题后的建筑物的轮廓。By fusing the at least two first structure lines in the first contour that meet the preset fusion conditions, that is, the structure lines that have obvious discontinuities, the purpose of repairing the first contour is achieved, and the second structure line composed of the second structure lines is obtained. The contour is the contour of the building after repairing the obvious discontinuity problem.
需要说明的是,第二结构线包括但不限于融合处理后得到结构线,也即第二结构线中包括有第一结构线。由于在第一轮廓中,并不是所有的第一结构线都满足预设融合条件,也即存在部分不需要进行融合处理的结构线,因此,第二轮廓为由融合处理后的结构线以及第一轮廓中不需要进行融合处理的结构线组成。为便于说明,本申请实施例将第二轮廓中的所有结构线统称为第二结构线。It should be noted that the second structure line includes but is not limited to the structure line obtained after the fusion process, that is, the second structure line includes the first structure line. Since in the first contour, not all the first structure lines meet the preset fusion condition, that is, there are some structure lines that do not need to be fused. Therefore, the second contour is the structure line after the fusion processing and the first structure line. An outline is composed of structural lines that do not need to be fused. For ease of description, the embodiment of the present application collectively refers to all the structure lines in the second contour as the second structure line.
作为示例而非限定,步骤S403具体包括:As an example and not a limitation, step S403 specifically includes:
将满足预设融合条件的至少两条第一结构线融合连接成一条第二结构线。At least two first structure lines that meet the preset fusion condition are fused and connected to form a second structure line.
在本申请实施例中,第二结构线为融合处理后得到的结构线,在此之前,不管第二结构线进行了几次融合处理,最终融合处理得到的结构线均设定为第二结构线,在融合处理完成后,同时将第一轮廓中不需要融合连接的第一结构线也设定为第二结构线,所有的第二结构线构成了建筑的第二轮廓。In the embodiment of the present application, the second structure line is the structure line obtained after the fusion process. Before this, no matter how many times the second structure line has been fused, the final structure line obtained by the fusion process is set to the second structure After the fusion process is completed, the first structural line that does not need to be fused and connected in the first contour is also set as the second structural line, and all the second structural lines constitute the second contour of the building.
在步骤S404中,基于所述第二结构线,获取所述第二轮廓对应的第一特征向量。In step S404, a first feature vector corresponding to the second contour is obtained based on the second structure line.
在本申请实施例中,通过Gabor滤波器对第二轮廓中不同方向的结构线做出响应,得到不同方向对应的响应图像,比如,使用四个方向(0°、45°、90°、135°)的Gabor滤波器提取第二结构线的方向特征。或者,通过卷积神经网络模型对第二轮廓中不同方向的结构线做出响应,从而得到不同方向对应的响应图像。In the embodiment of the present application, the Gabor filter is used to respond to the structure lines in different directions in the second contour to obtain response images corresponding to different directions, for example, using four directions (0°, 45°, 90°, 135°). °) Gabor filter extracts the directional features of the second structure line. Alternatively, the convolutional neural network model is used to respond to structural lines in different directions in the second contour, so as to obtain response images corresponding to different directions.
需要说明的是,这里的不同方向不仅仅限于0°、45°、90°、135°这四个方向,还可以是其他角度的方向,也即不同方向对应的响应图像的个数并不做具体限制。It should be noted that the different directions here are not limited to the four directions of 0°, 45°, 90°, and 135°, but can also be directions from other angles, that is, the number of response images corresponding to different directions is not determined. Specific restrictions.
在本申请的一个具体实施例中,在步骤S404之前,还包括:In a specific embodiment of the present application, before step S404, the method further includes:
对所述第二结构线进行归一化处理,以使得归一化处理后的所述第二结构线的线条宽度为固定像素个数。Normalization processing is performed on the second structure line, so that the line width of the second structure line after the normalization processing is a fixed number of pixels.
在本申请实施例中,通过直线检测算法得到的结构线的宽带不一,直接基于宽度不一的结构线获取到的第一特征向量,有可能会造成不必要的误差,也就无法通过该第一特征向量精确地描述该建筑物的结构线,因此在获取第二轮廓对应的第一特征向量之前,对第二结构线的线条像素进行归一化处理,以使得归一化处理后的第二结构线的线条宽度为固定像素个数。In the embodiment of the present application, the width of the structure line obtained by the straight line detection algorithm is different, and the first feature vector obtained directly based on the structure line of different width may cause unnecessary errors and fail to pass the The first feature vector accurately describes the structure line of the building. Therefore, before the first feature vector corresponding to the second contour is obtained, the line pixels of the second structure line are normalized to make the normalized The line width of the second structure line is a fixed number of pixels.
在本申请的另一个具体实施例中,步骤S404具体包括:In another specific embodiment of the present application, step S404 specifically includes:
步骤S4041,获取基于不同方向的第二结构线所做出的第一响应图像。Step S4041: Acquire first response images based on second structure lines in different directions.
在本申请实施例中,通过Gabor算子或者卷积神经网络模型,可以对轮廓中不同方向的结构线做出响应,从而得到该方向对应的响应图像。In the embodiment of the present application, through the Gabor operator or the convolutional neural network model, it is possible to respond to the structural lines in different directions in the contour, so as to obtain the response image corresponding to the direction.
步骤S4042,使用HOG描述子对所述第一响应图进行特征描述,获得所述第二轮廓对应的第一特征向量。Step S4042: Use the HOG descriptor to perform feature description on the first response graph, and obtain the first feature vector corresponding to the second contour.
在本申请实施例中,第一特征向量的个数与响应图像的个数相同,存在多少个不同方向的响应图像,对应有多少个第一特征向量,即最终的第一特征向量为多个响应图对应的第一特征向量拼接的结果。In the embodiment of the present application, the number of first feature vectors is the same as the number of response images, how many response images in different directions exist, and how many first feature vectors are corresponding, that is, the final first feature vector is multiple The result of splicing the first feature vector corresponding to the response image.
在步骤S405中,根据所述第一特征向量与第二特征向量的匹配结果,确定所述用户的当前位置。In step S405, the current location of the user is determined according to the matching result of the first feature vector and the second feature vector.
在本申请实施例中,第二特征向量为存储在特征向量数据库中的数据,请参考图5,图5示出了一种特征向量数据库的相关数据。In the embodiment of the present application, the second feature vector is data stored in a feature vector database. Please refer to FIG. 5, which shows related data of a feature vector database.
从图5中可以看出,特征向量数据库中存储有第二特征向量以及该第二特征向量对应的位置信息,该位置信息由经纬度信息组成。在获得第二轮廓对应的第一特征向量后,从特征向量数据库中可以查找到与该特征向量相匹配的第二特征向量,从而可以确定移动设备的位置信息也即根据匹配的第二特征向量获取移动设备的定位结果。It can be seen from FIG. 5 that the second feature vector and the location information corresponding to the second feature vector are stored in the feature vector database, and the location information is composed of latitude and longitude information. After obtaining the first feature vector corresponding to the second contour, the second feature vector that matches the feature vector can be found from the feature vector database, so that the location information of the mobile device can be determined, that is, according to the matched second feature vector Get the positioning result of the mobile device.
需要说明的是,特征向量数据库可以存储于移动设备这一侧,还可以存储于云服 务器一侧。由于特征向量数据库的创建或更新需要大量的定位数据支持以及大量的运算,因此一般是在云服务器这一侧创建特征向量数据库,或者对特征向量数据库进行更新。云服务器将所创建或更新的特征向量数据库同步发送至移动设备这一侧进行保存,以方便移动设备这一侧调用特征向量数据库中的第二特征向量确定移动设备的定位结果。It should be noted that the feature vector database can be stored on the mobile device side, or on the cloud server side. Since the creation or update of the feature vector database requires a large amount of positioning data support and a large number of operations, the feature vector database is generally created on the cloud server side, or the feature vector database is updated. The cloud server synchronously sends the created or updated feature vector database to the mobile device side for storage, so that the mobile device side can call the second feature vector in the feature vector database to determine the positioning result of the mobile device.
还需要说明的是,由于特征向量数据库中存在大量的第二特征向量,如果使用全局搜索的方法查找与第一特征向量匹配的第二特征向量,将会导致效率低下,为了提高查找与第一特征向量相匹配的第二特征向量的效率,本申请实施例提供了如图6所示的一种查找与第一特征向量相匹配的第二特征向量的方法的具体实现步骤,详述如下:It should also be noted that since there are a large number of second feature vectors in the feature vector database, if the global search method is used to find the second feature vector that matches the first feature vector, it will lead to inefficiency. In order to improve the search and the first feature vector For the efficiency of the second feature vector that matches the feature vector, the embodiment of the present application provides specific implementation steps of a method for finding a second feature vector that matches the first feature vector as shown in FIG. 6, which are detailed as follows:
在步骤S601中,通过定位传感器获取所述用户的定位信息。In step S601, the positioning information of the user is acquired through a positioning sensor.
在本申请实施例中,用户在使用移动设备拍摄第一建筑物获得包含第一建筑物的第一图像时,同时通过移动设备的定位传感器比如GPS定位传感器,获取的GPS定位信息即用户的定位信息。In the embodiment of the present application, when the user uses the mobile device to shoot the first building to obtain the first image including the first building, at the same time, the GPS positioning information obtained is the user's positioning through the positioning sensor of the mobile device, such as a GPS positioning sensor. information.
需要说明的是,在建筑物密集区域,GPS信号经过建筑物的多次反射后会造成多径效应,从而导致移动设备获取到的GPS定位信息存在很大的定位误差,并且该定位误差一般在60米到100米之间,这将为用户的出行带来极大的不变,因此所获取的GPS定位信息仅能作为粗略的位置信息,需要对其进行修正得到更为准确的定位结果。It should be noted that in densely-built areas, GPS signals will cause multipath effects after multiple reflections from buildings, which will lead to large positioning errors in GPS positioning information obtained by mobile devices, and the positioning errors are generally Between 60 meters and 100 meters, this will bring great changes to the user's travel. Therefore, the acquired GPS positioning information can only be used as rough position information, which needs to be corrected to obtain more accurate positioning results.
在步骤S602中,以所述定位信息为中心,确定距离所述中心预定范围内的建筑物的候选集。In step S602, a candidate set of buildings within a predetermined range from the center is determined with the positioning information as the center.
在本申请实施例中,在获取到GPS定位信息后,以GPS定位信息为中心,获取距离所述中心预定范围内的建筑物作为移动设备所在区域内的建筑物的候选集。In the embodiment of the present application, after obtaining the GPS positioning information, taking the GPS positioning information as the center, obtain buildings within a predetermined range from the center as a candidate set of buildings in the area where the mobile device is located.
比如,以GPS定位信息为圆心,将预定半径范围内的建筑物作为移动设备所在区域内的建筑物的候选集。又比如,以GPS定位信息为中心,获取预定形状比如正方形范围内的建筑物。For example, taking GPS positioning information as the center of the circle, and taking buildings within a predetermined radius as a candidate set of buildings in the area where the mobile device is located. For another example, take GPS positioning information as the center to acquire buildings within a predetermined shape such as a square.
在步骤S603中,从特征向量数据库中获取与所述候选集对应的第二特征向量。In step S603, a second feature vector corresponding to the candidate set is obtained from the feature vector database.
在本申请实施例中,通过确定移动设备所在区域内的建筑物的候选集,相应地确定了特征向量数据库中的区域第二特征向量,从而减少了第二特征向量的搜索量,大大提高了查找与第一特征向量匹配的第二特征向量的效率,从而相应地提高了定位效率。In the embodiment of the present application, by determining the candidate set of buildings in the area where the mobile device is located, the second feature vector of the area in the feature vector database is determined accordingly, thereby reducing the amount of search for the second feature vector and greatly improving The efficiency of finding the second feature vector that matches the first feature vector, thereby correspondingly improving the positioning efficiency.
在步骤S604中,从与所述候选集对应的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,并根据查找到的第二特征向量确定所述用户的当前位置。In step S604, search for a second feature vector matching the first feature vector from the second feature vector corresponding to the candidate set, and determine the current location of the user according to the found second feature vector .
在本申请实施例中,将第一特征向量与候选集中每个建筑物的任意一个第二特征向量比如第一个第二特征向量进行匹配,从而确定所述第一图像对应的建筑物,也即确定移动设备所拍摄的建筑物,再根据该建筑物进一步确定移动设备的定位结果。In the embodiment of the present application, the first feature vector is matched with any second feature vector of each building in the candidate set, such as the first second feature vector, so as to determine the building corresponding to the first image. That is, the building photographed by the mobile device is determined, and the positioning result of the mobile device is further determined according to the building.
请参考图7,图7为本申请实施例提供的一种在第二方向角α±β范围内查找与第一特征向量匹配的第二特征向量的示意图,为了进一步减少第二特征向量的搜索量,精确地获取移动设备的定位结果,结合图7,对步骤S604进行详细的描述,具体如下:Please refer to FIG. 7, which is a schematic diagram of searching for a second eigenvector matching the first eigenvector within the range of the second direction angle α±β according to an embodiment of the application, in order to further reduce the search for the second eigenvector To accurately obtain the positioning result of the mobile device, step S604 will be described in detail with reference to Fig. 7, which is specifically as follows:
步骤S6041,获取第一方向角α。Step S6041: Obtain the first direction angle α.
在本申请实施例中,用户在拍摄第一建筑物获得包含第一建筑物的第一图像时,同时通过所述移动设备的内置传感器比如姿态传感器或陀螺仪获取第一方向角α。In the embodiment of the present application, the user obtains the first direction angle α through the built-in sensor of the mobile device, such as a posture sensor or a gyroscope, while capturing the first building to obtain the first image including the first building.
步骤S6042,以所述第一方向角α为基准,查找在第二方向角α±β范围内的第二特征向量。Step S6042, using the first direction angle α as a reference, search for a second eigenvector within the range of the second direction angle α±β.
在本申请实施例中,第二方向角α±β为第一方向角α和预设角度β的和/差。通过将候选集范围内对应的第二特征向量进一步减少为在第二方向角α±β范围内的第二特征向量,减少第二特征向量的搜索量,从而提高了查找与第一特征向量匹配的第二特征向量的效率,提高了定位的效率。In the embodiment of the present application, the second direction angle α±β is the sum/difference of the first direction angle α and the preset angle β. By further reducing the corresponding second feature vector in the range of the candidate set to the second feature vector in the range of the second direction angle α±β, the search amount of the second feature vector is reduced, thereby improving the search to match the first feature vector The efficiency of the second feature vector improves the efficiency of positioning.
步骤S6043,从查找到的所述第二方向角α±β范围内的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,利用线性插值方法确定所述用户的当前位置。Step S6043, from the found second eigenvectors within the range of the second direction angle α±β, search for a second eigenvector matching the first eigenvector, and use a linear interpolation method to determine the user’s current position.
在本申请实施例中,从图6中可以看出,图6所示的建筑物模型为GPS定位信息的中心,四边形为移动设备所在区域内的建筑物的候选集,在四边形上的黑点和五角星为该位置对应的第二特征向量,其中五角星为在第二方向角α±β范围内的第二特征向量,显然,从在第二方向角α±β范围内的第二特征向量内查找与第一特征向量相匹配的第二特征向量,搜索量大大减少了。In the embodiment of this application, it can be seen from Figure 6 that the building model shown in Figure 6 is the center of GPS positioning information, and the quadrilateral is a candidate set of buildings in the area where the mobile device is located, and the black dots on the quadrilateral The five-pointed star is the second eigenvector corresponding to the position, and the five-pointed star is the second eigenvector within the range of the second direction angle α±β. Obviously, from the second feature vector within the range of the second direction angle α±β Finding the second feature vector that matches the first feature vector within the vector, the search volume is greatly reduced.
为了进一步获取更为精确的第二特征向量,从而获得移动设备的精确定位,在步骤S6043之前,还包括:In order to further obtain a more accurate second feature vector, thereby obtaining accurate positioning of the mobile device, before step S6043, the method further includes:
滤除所述第二方向角α±β范围内的无效第二特征向量。The invalid second eigenvectors within the range of the second direction angle α±β are filtered out.
在本申请实施例中,无效第二特征向量具体为人或车辆不能到达的区域比如禁止行人通行或禁止车辆通行的道路、又比如湖泊、水池等,通过移动设备的地图数据,可以滤除所述第二方向角α±β范围内的无效第二特征向量,该地图数据的获取可以通过移动设备的内置地图来获取。In the embodiment of the present application, the invalid second feature vector is specifically an area that cannot be reached by people or vehicles, such as roads that are prohibited from pedestrians or vehicles, such as lakes, pools, etc., which can be filtered through the map data of the mobile device. For the invalid second feature vector within the range of the second direction angle α±β, the map data can be obtained through the built-in map of the mobile device.
在本申请实施例中,通过综合GPS定位信息、第一方向角α以及移动设备的内置地图等,实现了对移动设备的高效且精准的定位,提高了用户在建筑物密集区域的定位精度,具有较高的实用性和易用性。In the embodiment of the present application, by integrating GPS positioning information, the first direction angle α, and the built-in map of the mobile device, efficient and accurate positioning of the mobile device is realized, and the positioning accuracy of the user in densely-built areas is improved. It has high practicability and ease of use.
在本申请的一个具体实施例中,在步骤S405之后,还包括:In a specific embodiment of the present application, after step S405, the method further includes:
将确定的所述用户的当前位置推送给用户。Push the determined current location of the user to the user.
在本申请实施例中,通过获取包含建筑物的图像,并从该包含建筑物的图像中提取该建筑物对应的结构线,在对满足预设融合条件的结构线进行融合处理后,从进行融合处理后的得到的建筑物的轮廓中,提取该建筑物对应的第一特征向量,根据与该第一特征向量相匹配的第二特征向量确定用户的位置,通过第一特征向量与第二特征向量,实现在某一地区或城市的建筑物密集区域中对用户当前位置的精确定位,提高了用户在某一地区或城市的建筑物密集区域的定位精度。In the embodiment of the present application, by acquiring an image containing a building, and extracting the structural line corresponding to the building from the image containing the building, after performing the fusion processing on the structural line that meets the preset fusion condition, proceed from From the contour of the building obtained after the fusion process, the first feature vector corresponding to the building is extracted, and the user's location is determined according to the second feature vector matching the first feature vector. The first feature vector and the second feature vector are used to determine the location of the user. The feature vector realizes the accurate positioning of the user's current location in a certain area or city with dense buildings, and improves the positioning accuracy of the user in a certain area or city with dense buildings.
实施例二Example two
请参考图8,图8示出了本申请实施例提供的一种特征向量数据库的构建方法的实现流程,详述如下:Please refer to FIG. 8. FIG. 8 shows an implementation process of a method for constructing a feature vector database provided by an embodiment of the present application. The details are as follows:
在步骤S801中,获取目标建筑物的三维模型。In step S801, a three-dimensional model of the target building is acquired.
在本申请实施例中,三维模型可以快速渲染大量图像,从而获得足够的第二特征向量构建特征向量数据库。In the embodiment of the present application, the three-dimensional model can quickly render a large number of images, so as to obtain enough second feature vectors to construct a feature vector database.
对于三维模型,本申请实施例中选用谷歌地球(Google Earth,GE)中的三维模型,主要基于下述考虑:For the three-dimensional model, the three-dimensional model in Google Earth (GE) is selected in the embodiments of this application, which is mainly based on the following considerations:
Google Earth的三维模型完全开源;Google Earth’s 3D model is completely open source;
2)移动设备定位误差大的区域仅限于一个城市的高层建筑密集区域比如城市CBD中,而Google Earth中的三维模型基本涵盖了世界主要城市的市中心的建筑的三维模型2) The areas with large positioning errors of mobile devices are limited to high-rise buildings in a city, such as the urban CBD. The three-dimensional model in Google Earth basically covers the three-dimensional model of the buildings in the city center of major cities in the world.
3)Google Earth的三维模型与全世界最大的免费三维模型库Sketchup相关联,三维模型的数量增加和更新的速度很快。3) Google Earth's 3D model is associated with Sketchup, the world's largest free 3D model library, and the number of 3D models is increasing and updating quickly.
因此,基于Google Earth的三维模型,可以保证所获得第二特征向量的准确性,从而创建数据更为完善和准确的特征向量数据库。Therefore, the three-dimensional model based on Google Earth can ensure the accuracy of the second feature vector obtained, thereby creating a feature vector database with more complete and accurate data.
在步骤S802中,对所述三维模型进行渲染,获得一组包含第二建筑物的第二图像。In step S802, the three-dimensional model is rendered to obtain a set of second images containing second buildings.
在本申请实施例中,通过对不同的三维模型进行渲染,相应地获得不同的一组包含第二建筑物第二图像,每一组第二图像中至少包含两张图像。In the embodiment of the present application, by rendering different three-dimensional models, a different set of second images including the second building is correspondingly obtained, and each set of second images includes at least two images.
需要说明的是,不同的三维模型对应不同的建筑物,相应获得的第二图像中包含的第二建筑物也不同。这里所指的第二建筑物为目标建筑物的不同方向的图像。It should be noted that different three-dimensional models correspond to different buildings, and the second buildings included in the second image obtained correspondingly are also different. The second building referred to here is an image of a different direction of the target building.
在本申请的一个具体实施例中,在获得三维模型后,按照预设定的渲染路径和图像采样间隔,从不同角度和位置对所述三维模型进行等间隔渲染,在渲染的同时记录相机的位置和姿态角即第三方向角γ,获得一组包含精确的位置信息的渲染图像。In a specific embodiment of the present application, after the three-dimensional model is obtained, the three-dimensional model is rendered at equal intervals from different angles and positions according to the preset rendering path and image sampling interval, and the camera's information is recorded while rendering. The position and attitude angle is the third angle γ, and a set of rendered images containing accurate position information is obtained.
请参考图9,图9为本申请实施例提供的一种对三维模型进行渲染,获得一组第二图像的示意图。Please refer to FIG. 9, which is a schematic diagram of rendering a three-dimensional model to obtain a set of second images according to an embodiment of the application.
如图9所示,使用移动设备从不同角度、不同位置拍摄时,照片中的建筑物的形态是不同的,如从图9中A、B、C三个位置获取的图像,可以借助建筑物的结构线描述该形态。然而,人工去采集不同角度、不同位置的图像并不现实,因此借助于计算机图形学中对三维模型进行渲染的方法获得不同位置、不同角度等距离渲染的图像,并基于这些渲染得到的图像构建特征向量数据库。As shown in Figure 9, when using a mobile device to shoot from different angles and different positions, the shape of the building in the photo is different. For example, the image obtained from the three positions A, B, and C in Figure 9 can use the building The structure line describes the shape. However, it is not realistic to manually collect images from different angles and different positions. Therefore, the method of rendering the three-dimensional model in computer graphics is used to obtain images rendered at different positions and different angles at equal distances, and build based on these rendered images. Feature vector database.
如图9所示,渲染路径实际为相机移动的路径,黑色的点表示渲染三维模型时相机的位置(表示成经纬度),点的间隔为相机采集图像的间隔。点的间隔可以自定义,与需要的定位精度相关,点的间隔越小,定位的精度越高。在渲染过程完成后,所得到的每一张渲染图像都包含有精确的位置信息。As shown in FIG. 9, the rendering path is actually the path of the camera movement, the black dots indicate the position of the camera (expressed as latitude and longitude) when the 3D model is rendered, and the interval of the dots is the interval at which the camera collects images. The point interval can be customized and is related to the required positioning accuracy. The smaller the point interval, the higher the positioning accuracy. After the rendering process is completed, each resulting rendered image contains accurate position information.
在步骤S803中,从每个所述第二图像中提取建筑物的第三轮廓。In step S803, the third contour of the building is extracted from each of the second images.
在本申请实施例中,所述第三轮廓由第三结构线组成,通过直线检测算法,从每个第二图像中提取建筑物的结构线,所提取的结构线形成建筑物的轮廓即第三轮廓。该直线检测算法包括但不限于霍夫直线检测算法、LSD直线检测算法、FLD直线检测算法。In the embodiment of the present application, the third contour is composed of a third structural line, and the structural line of the building is extracted from each second image through a straight line detection algorithm, and the extracted structural line forms the contour of the building, that is, the first Three contours. The line detection algorithm includes, but is not limited to, the Hough line detection algorithm, the LSD line detection algorithm, and the FLD line detection algorithm.
在步骤S804中,对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓。In step S804, fusion processing is performed on at least two third structure lines satisfying preset fusion conditions among the third contours to obtain a fourth contour composed of fourth structure lines.
在本申请实施例中,所述预设融合条件为所述至少两条第三结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条第三结构线之间的垂直距离小于第二数值,且斜率差小于第三数值。In the embodiment of the present application, the preset fusion condition is that among the at least two third structure lines, the distance between the two adjacent end points is less than the first value, and the two adjacent third structure lines The vertical distance between them is smaller than the second value, and the slope difference is smaller than the third value.
通过将第三轮廓中满足预设融合条件的至少两条第三结构即明显存在间断问题的结构线进行融合处理,从而达到修复第三轮廓的目的,获得由第四结构线组成的第四轮廓即修复明显存在间断问题后的建筑物的轮廓。By fusing at least two third structures in the third contour that meet the preset fusion conditions, that is, structural lines that have obvious discontinuities, the purpose of repairing the third contour is achieved, and the fourth contour composed of the fourth structural lines is obtained. That is, the outline of the building after the obvious discontinuity problem is repaired.
需要说明的是,第四结构线包括但不限于融合处理后得到结构线,也即第四结构线中包括有第三结构线。由于在第三轮廓中,并不是所有的第三结构线都满足预设融合条件,也即存在部分不需要进行融合处理的结构线,因此,第四轮廓为由融合处理后的结构线以及第三轮廓中不需要进行融合处理的结构线组成。为便于说明,本申请实施例将第四轮廓中的所有结构线统称为第四结构线。It should be noted that the fourth structure line includes but is not limited to the structure line obtained after the fusion process, that is, the fourth structure line includes the third structure line. Since in the third contour, not all the third structure lines meet the preset fusion condition, that is, there are some structure lines that do not need to be fused. Therefore, the fourth contour is the structure line after fusion processing and the first The three contours are composed of structural lines that do not need to be fused. For ease of description, the embodiment of the present application collectively refers to all the structure lines in the fourth contour as the fourth structure line.
作为示例而非限定,步骤S804具体包括:As an example and not a limitation, step S804 specifically includes:
将满足预设融合条件的至少两条第三结构线融合连接成一条第四结构线。At least two third structure lines that meet the preset fusion condition are fused and connected to form a fourth structure line.
在本申请实施例中,第三结构线为融合处理后得到的结构线,在此之前,不管第四结构线进行了几次融合处理,最终融合处理得到的结构线均设定为第四结构线,在融合处理完成后,同时将第三轮廓中不需要融合连接的第三结构线也设定为第四结构线,所有的第四结构线构成了建筑的第四轮廓。In the embodiment of the present application, the third structure line is the structure line obtained after the fusion process. Before this, no matter how many times the fourth structure line has been fused, the final structure line obtained by the fusion process is set to the fourth structure After the fusion processing is completed, the third structural line that does not need to be fused and connected in the third contour is also set as the fourth structural line, and all the fourth structural lines constitute the fourth contour of the building.
在步骤S805中,基于所述第四结构线,获取所述第四轮廓对应的第二特征向量。In step S805, a second feature vector corresponding to the fourth contour is acquired based on the fourth structure line.
在本申请实施例中,同样通过Gabor滤波器或者卷积神经网络模型对第四轮廓中不同方向的结构线做出响应,得到不同方向对应的响应图像。In the embodiment of the present application, the Gabor filter or the convolutional neural network model is also used to respond to the structural lines in different directions in the fourth contour to obtain response images corresponding to different directions.
在本申请的一个具体实施例中,在步骤S805之前,还包括:In a specific embodiment of the present application, before step S805, the method further includes:
对所述第四结构线进行归一化处理,以使得归一化处理后的所述第四结构线的线条宽度为固定像素个数。Normalization processing is performed on the fourth structure line, so that the line width of the fourth structure line after the normalization processing is a fixed number of pixels.
在本申请的另一个具体实施例中,步骤S805具体包括:In another specific embodiment of the present application, step S805 specifically includes:
步骤S8051,获取基于不同方向的第四结构线所做出的第二响应图像。Step S8051: Acquire a second response image based on the fourth structure line in a different direction.
步骤S8052,使用HOG描述子对所述第二响应图进行特征描述,获得所述第四轮廓对应的第二特征向量。Step S8052: Use the HOG descriptor to perform feature description on the second response graph, and obtain a second feature vector corresponding to the fourth contour.
在步骤S806中,基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库。In step S806, a feature vector database is constructed based on the second feature vector and location information corresponding to each of the second images.
在本申请实施例中,不同的第二图像对应有不同的第二特征向量,以一组第二图像对应的一组第二特征向量为第二特征向量,与该组第二图像的位置信息以及第三方向角γ等数据组合构成特征向量数据库,从而使得根据第二特征向量可以查找到相应的位置信息。In the embodiment of the present application, different second images correspond to different second feature vectors, and a set of second feature vectors corresponding to a set of second images is used as the second feature vector, which is related to the position information of the set of second images. The combination of data such as the third direction angle γ forms a feature vector database, so that the corresponding position information can be found according to the second feature vector.
需要说明的是,在每张第二图像对应的第二特征向量设定为第二特征向量后,同时获取每张第二图像对应的位置信息和第三方向角γ,建立每张第二图像及其对应的第二特征向量、位置信息和第三方向角γ的映射关系,并基于每张第二图像对应的映射关系构建如图5所示的特征向量数据库。It should be noted that after the second feature vector corresponding to each second image is set as the second feature vector, the position information and the third angle γ corresponding to each second image are acquired at the same time, and each second image is created The mapping relationship between the corresponding second feature vector, the position information and the third direction angle γ, and the feature vector database shown in FIG. 5 is constructed based on the mapping relationship corresponding to each second image.
还需要说明的是,特征向量数据库的主键为第二特征向量,通过第二特征向量可以查找到相匹配的位置信息。It should also be noted that the primary key of the feature vector database is the second feature vector, and the matching location information can be found through the second feature vector.
具体地,步骤S806包括:Specifically, step S806 includes:
步骤S8061,获取每一个所述第二图像对应的位置信息和第三方向角γ。在本申请实施例中,在渲染过程中,同时记录采集每一个第二图像的相机的位置信息以及相 机的姿态角即第三方向角γ,以便于在获得第二图像对应的第二特征向量后与该位置信息和第三方向角γ建立映射关系。Step S8061: Obtain the position information and the third direction angle γ corresponding to each of the second images. In the embodiment of the present application, during the rendering process, the position information of the camera that collects each second image and the attitude angle of the camera, that is, the third direction angle γ, are recorded at the same time, so as to obtain the second feature vector corresponding to the second image. Then establish a mapping relationship with the position information and the third angle γ.
步骤S8062,建立每一个所述第二图像及其对应的第二特征向量、位置信息和第三方向角γ的映射关系,得到所述一组第二图像对应的映射关系。Step S8062: Establish a mapping relationship between each second image and its corresponding second feature vector, position information, and third-direction angle γ, to obtain a mapping relationship corresponding to the set of second images.
在本申请实施例中,通过增加对第三方向角γ与第一方向角的匹配程度,进一步提高对用户当前位置的定位精度。In the embodiment of the present application, by increasing the degree of matching between the third direction angle γ and the first direction angle, the positioning accuracy of the user's current position is further improved.
步骤S8063,基于所述一组第二图像对应的映射关系构建特征向量数据库。Step S8063: Construct a feature vector database based on the mapping relationship corresponding to the set of second images.
在本申请实施例中,基于一组第二图像对应的映射关系所构建的特征向量数据库中包含有第二特征向量、与该第二特征向量相对应的位置信息和相关关联的方向角信息,也即步骤S806具体为:In the embodiment of the present application, the feature vector database constructed based on the mapping relationship corresponding to a set of second images contains the second feature vector, the position information corresponding to the second feature vector, and the associated direction angle information, That is, step S806 is specifically:
基于每一个所述第二图像对应的第二特征向量、位置信息和方向角信息,构建特征向量数据库。Based on the second feature vector, position information, and direction angle information corresponding to each of the second images, a feature vector database is constructed.
在本申请实施例中,通过若干数量的三维模型对应获得若干组第二图像,基于该若干组第二图像对应的映射关系构建第二特征向量,通过不断获取新的三维模型,可以对特征向量数据库中的第二特征向量进一步完善,从而保证特征向量数据库的数据完善程度。In the embodiment of the present application, several sets of second images are correspondingly obtained through a number of three-dimensional models, and the second feature vector is constructed based on the mapping relationship corresponding to the several sets of second images. By continuously acquiring new three-dimensional models, the feature vector can be The second feature vector in the database is further improved, so as to ensure the data perfection of the feature vector database.
在本申请实施例中,通过获取目标建筑物的三维模型,对所述三维模型进行渲染,获得一组包含第二建筑物的第二图像,从每个所述第二图像中提取建筑物的第三轮廓,所述第三轮廓由第三结构线组成;对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓;基于所述第四结构线,获取所述第四轮廓对应的第二特征向量;基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库,通过对三维模型的渲染获得大量的渲染图像以及该渲染图像对应的特征向量和位置信息,提高了特征向量数据库的构建效率以及准确率。In the embodiment of the present application, by obtaining a three-dimensional model of the target building, rendering the three-dimensional model, obtaining a set of second images containing the second building, and extracting the building’s image from each of the second images The third contour, the third contour is composed of third structure lines; the fusion processing is performed on at least two third structure lines that meet the preset fusion conditions in the third contour, to obtain the fourth structure line composed of the fourth structure lines. Contour; based on the fourth structure line, obtain the second feature vector corresponding to the fourth contour; based on the second feature vector and position information corresponding to each of the second images, construct a feature vector database, by comparing the three-dimensional model A large number of rendered images and feature vectors and location information corresponding to the rendered images are obtained by rendering, which improves the construction efficiency and accuracy of the feature vector database.
实施例三Example three
对应于上文实施例所述的基于建筑物的室外定位方法和特征向量数据库的构建方法,结合图10所示的定位交互示意图,以广州珠江新城中的定位效果为例进行相关说明。Corresponding to the building-based outdoor positioning method and feature vector database construction method described in the above embodiments, combined with the positioning interaction schematic diagram shown in FIG. 10, the positioning effect in Guangzhou Zhujiang New City is taken as an example for related description.
在本申请实施例中,测试的珠江新城的区域为2,497,400m 2,含12个建筑物,测试时间为光线变化剧烈的时间段:16:00-18:00,使用的移动设备为市场现行的智能手机,该智能手机在拍摄时可以自动获取GPS定位信息,真实位置则是根据地图手动标出。 In the example of this application, the tested area of Zhujiang New City is 2,497,400m 2 , including 12 buildings, and the test time is a time period when the light changes drastically: 16:00-18:00, and the mobile equipment used is the current market Smart phone, the smart phone can automatically obtain GPS positioning information when shooting, and the real location is manually marked according to the map.
以珠江新城中的广东省博物馆的精确定位为例,按照如下步骤进行:Take the precise positioning of the Guangdong Museum in Zhujiang New Town as an example, follow the steps below:
a)云服务器从Goolge Earth中获取如图11所示的广东省博物馆的三维模型;a) The cloud server obtains the three-dimensional model of the Guangdong Museum as shown in Figure 11 from Goolge Earth;
b)云服务器设定好渲染路径和图像采集的间隔,从不同位置和方向对图11中的三维模型进行等距离渲染,得到如图12(a)至图12(d)所示的一组渲染图像,在渲染过程中,同时记录采集图像的相机的位置和方向角;b) The cloud server sets the rendering path and the interval of image collection, and renders the 3D model in Fig. 11 equidistantly from different positions and directions, and obtains a set as shown in Fig. 12(a) to Fig. 12(d) Render the image. During the rendering process, record the position and direction angle of the camera that collected the image at the same time;
c)云服务器使用实施例二中的方法提取渲染图像中建筑物的结构线并修复;c) The cloud server uses the method in the second embodiment to extract and repair the structural lines of the building in the rendered image;
d)云服务器使用实施例二中的方法获取每张渲染图像对应的特征向量即第二特征 向量,建立每张渲染图像的位置信息、第二特征向量和姿态角即方向角的映射关系,并将该映射关系存储至特征向量数据库中,构建如图5所示的特征向量数据库。d) The cloud server uses the method in the second embodiment to obtain the feature vector corresponding to each rendered image, that is, the second feature vector, and establish the mapping relationship between the position information of each rendered image, the second feature vector, and the attitude angle, that is, the direction angle, and The mapping relationship is stored in the feature vector database, and the feature vector database as shown in FIG. 5 is constructed.
e)用户通过智能手机的摄像头对广东博物馆进行拍摄;e) The user takes photos of the Guangdong Museum through the camera of the smartphone;
f)智能手机使用实施例一中的方法提取并修复所拍摄的图像中的建筑物的结构线;f) The smart phone uses the method in the first embodiment to extract and repair the structural lines of the building in the captured image;
g)智能手机使用实施例一中的方法提取所拍摄的图像对应的特征向量;g) The smart phone uses the method in the first embodiment to extract the feature vector corresponding to the captured image;
h)智能手机根据所提取的特征向量、智能手机的GPS定位信息、姿态传感器的读数以及地图数据,从存储在智能手机中的特征向量数据库中查找与该特征向量相匹配的第二特征向量,并通过线性插值的方法确定用户的当前位置。h) The smart phone searches the feature vector database stored in the smart phone for a second feature vector that matches the feature vector based on the extracted feature vector, the smart phone’s GPS positioning information, the reading of the attitude sensor, and the map data. And through linear interpolation method to determine the user's current location.
或者:or:
i)智能手机将所提取的特征向量、智能手机的GPS定位信息、姿态传感器的读数以及地图数据发送给云服务,i) The smart phone sends the extracted feature vector, the smart phone’s GPS positioning information, the reading of the attitude sensor and the map data to the cloud service,
j)云服务器根据智能手机发送的信息,从特征向量数据库查找与智能手机中的特征向量相匹配的第二特征向量,并通过线性插值的方法确定用户的当前位置并将用户的当前位置返回给智能手机。j) According to the information sent by the smart phone, the cloud server searches the feature vector database for a second feature vector that matches the feature vector in the smart phone, and determines the current location of the user through linear interpolation and returns the current location of the user to smart phone.
可见,在某一地区或城市的建筑物密集区域,针对移动设备的GPS定位传感器获得的定位信息,结合云服务器和移动设备的相关数据修正该位置,从而为用户返回精确的位置信息。It can be seen that in a certain area or a densely built area of a city, the location information obtained by the GPS positioning sensor of the mobile device is corrected by combining the relevant data of the cloud server and the mobile device, so as to return accurate location information for the user.
本申请实施例提供的定位精确高于现有其他定位方法的定位精度。The positioning accuracy provided by the embodiments of the present application is higher than the positioning accuracy of other existing positioning methods.
如图13(a)和图13(b)所示,图13(a)和图13(b)示出了一组建筑物从不同角度、不同距离和不同光照下的定位结果,其中第一行图像代表拍摄得到的图像即第一图像,第二行图像是根据第一行对应的第一图像提取并修复的明显存在间断问题后的结构线,即第二结构线组成的轮廓图像,第三行图像则是对应的与第一图像匹配的第二图像提取并修复的明显存在间断问题后的结构线,即第四结构线组成的轮廓图像,最后一行是本申请实施例提供的定位结果和用户的实际位置的比较,其中“+”代表本申请实施例提供的定位结果,“○”表示用户的实际位置。As shown in Figure 13 (a) and Figure 13 (b), Figure 13 (a) and Figure 13 (b) show the positioning results of a group of buildings from different angles, different distances and different illumination, where the first The row image represents the captured image, that is, the first image, and the second row image is the structure line extracted and repaired according to the first image corresponding to the first row after the obvious discontinuity problem, that is, the contour image composed of the second structure line. The three rows of images correspond to the structure lines extracted and repaired by the second image that matches the first image, that is, the contour image composed of the fourth structure line, and the last row is the positioning result provided by the embodiment of the application. Compared with the actual location of the user, "+" represents the positioning result provided by the embodiment of the present application, and "○" represents the actual location of the user.
从图13中可以看出,本申请实施例提供的定位结果与用户的实际位置非常接近,可见,本申请实施例具有非常高的定位精度。It can be seen from FIG. 13 that the positioning result provided by the embodiment of the present application is very close to the actual position of the user. It can be seen that the embodiment of the present application has very high positioning accuracy.
如图14所示,图14示出了四组在不同光照条件下使用不同的定位方法的所得到平均定位误差的示意图。As shown in FIG. 14, FIG. 14 shows a schematic diagram of the average positioning errors obtained by using different positioning methods in four groups under different lighting conditions.
从图14中可以看出,图14中包含四个使用不同定位方法在不同光照条件下得到的四组定位累积误差,其中每组中的第一个定位误差为所有测试例定位误差的平均误差,第二个定位误差为在光线充足比如白天下测试例定位误差的平均误差,第三个定位误差为在光线不充足比如夜晚下测试例定位误差的平均误差。It can be seen from Figure 14 that Figure 14 contains four sets of cumulative positioning errors obtained by using different positioning methods under different lighting conditions. The first positioning error in each group is the average positioning error of all test cases. , The second positioning error is the average error of the positioning error of the test case under sufficient light such as daytime, and the third positioning error is the average error of the positioning error of the test case under insufficient light such as the night.
在图14中,第一组平均定位误差为基于移动设备的GPS传感器获得定位信息与其真实位置计算得到的定位误差的平均值;第二组定位误差为本申请实施例提供的定位结果与真实位置计算得到的定位误差的平均值;第三组为现有定位方法一提供的定位结果与真实位置计算得到的定位误差的平均值;第四组为现有定位方法二提供的定位结果与真实位置计算得到的定位误差的平均值。从图14中可以看出,本申请实施例的平均定位误差远远低于其余三组的平均定位误差,并且不同光照条件下的平均定位 误差也远远低于其余三组平均定位误差。还可以看出本实施例的定位结果不受光照条件的影响。In FIG. 14, the first set of average positioning errors is the average value of the positioning errors calculated based on the positioning information obtained by the GPS sensor of the mobile device and its real position; the second set of positioning errors is the positioning result and the real position provided by this embodiment of the application. The average value of the calculated positioning error; the third group is the average value of the positioning error provided by the existing positioning method 1 and the real position; the fourth group is the positioning result and the real position provided by the existing positioning method 2 The average value of the calculated positioning error. It can be seen from FIG. 14 that the average positioning error of the embodiment of the present application is far lower than the average positioning error of the other three groups, and the average positioning error under different lighting conditions is also much lower than the average positioning error of the remaining three groups. It can also be seen that the positioning result of this embodiment is not affected by the lighting conditions.
其中,现有定位方法一具体如下:Among them, the first existing positioning method is specifically as follows:
该方法提出了一种基于点特征的定位方法。首先假设用户拍摄的照片位于建筑物的一个角,该照片中包含建筑物的三条竖直边缘线,由于用户拍照时总有一个倾斜角度,因此在照片中的三条边缘线可以相交于一点。不同照片的交点位置是不同的,这一特征被称为TICEP特征,根据交点的分布可以找到建筑所在的2维地图上潜在的几个照片拍摄点。最后通过自定义的TICEP特征确定潜在的拍摄点,并基于此所构建的偏差函数(deviation function)查找相匹配的特征以得到准确的位置。This method proposes a positioning method based on point features. First, suppose that the photo taken by the user is located at a corner of the building. The photo contains three vertical edge lines of the building. Since the user always has an oblique angle when taking pictures, the three edge lines in the photo can intersect at one point. The location of the intersection of different photos is different. This feature is called the TICEP feature. According to the distribution of the intersection, several potential photo shooting points can be found on the 2-dimensional map where the building is located. Finally, the potential shooting point is determined by the self-defined TICEP feature, and the deviation function (deviation function) constructed based on this is used to find the matching feature to obtain the accurate position.
现有定位方法二具体如下:The second existing positioning method is specifically as follows:
该方法把SLAM和定位相结合,提出了一种基于点的定位方法。首先用户拍摄一张照片同时得到手机内置传感器测量出的角度和位置信息,使用这些信息去检索一个2.5维地图(位置信息+高度),得到用户在该2.5维地图中的粗略位置。接着修正这个粗略位置,使用以下公式估计相机的精确位置C:This method combines SLAM and positioning, and proposes a point-based positioning method. First, the user takes a picture and obtains the angle and position information measured by the built-in sensor of the mobile phone, and uses this information to retrieve a 2.5-dimensional map (position information + height) to obtain the user's rough position in the 2.5-dimensional map. Then correct this rough position and use the following formula to estimate the precise position C of the camera:
Figure PCTCN2020125210-appb-000001
Figure PCTCN2020125210-appb-000001
其中,l 1,l 2是图像中两条竖直的直线,x 1,x 2是建筑物与地面相交的两个点。 Among them, l 1 and l 2 are the two vertical straight lines in the image, and x 1 and x 2 are the two points where the building and the ground intersect.
可见,现有定位方法一中定位的区域仅限于建筑物角落的周围区域,而且所拍摄的建筑物的图像必须要包含有建筑物的三条竖直线段;现有定位方法二中则需要有2.5维的地图辅助定位,并且所拍摄的建筑物的图像必须要包含有建筑物与地面的交点,而本申请实施例中对所拍摄的建筑物图像并无任何限制,使得用户在任意位置均可通过本申请实施例获得精准的定位信息。It can be seen that the area located in the existing positioning method 1 is limited to the area around the corners of the building, and the image of the building taken must include three vertical line segments of the building; in the existing positioning method 2, 2.5 A three-dimensional map assists positioning, and the captured image of the building must include the intersection of the building and the ground. In the embodiment of this application, there is no restriction on the captured image of the building, so that the user can be at any location. Accurate positioning information is obtained through the embodiments of this application.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
实施例四Example four
对应于上文实施例所述的基于建筑物的室外定位方法,图15示出了本申请实施例提供的基于建筑物的室外定位装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the building-based outdoor positioning method described in the above embodiment, FIG. 15 shows a structural block diagram of the building-based outdoor positioning device provided by an embodiment of the present application. The relevant part of the embodiment.
参照图15,该装置包括:Referring to Figure 15, the device includes:
第一图像获取单元151,用于获取包含第一建筑物的第一图像,所述第一建筑物为用户当前所在位置附近的任意建筑物;The first image acquisition unit 151 is configured to acquire a first image containing a first building, where the first building is any building near the user's current location;
第一轮廓提取单元152,用于基于所述第一图像提取所述第一建筑物的第一轮廓,所述第一轮廓由至少两条第一结构线组成;The first contour extraction unit 152 is configured to extract a first contour of the first building based on the first image, where the first contour is composed of at least two first structural lines;
第一融合单元153,用于对所述第一轮廓中满足预设融合条件的至少两条第一结构线进行融合处理,获得由至少两条第二结构线组成的第二轮廓;The first fusion unit 153 is configured to perform fusion processing on at least two first structure lines meeting preset fusion conditions in the first outline, to obtain a second outline composed of at least two second structure lines;
第一特征向量获取单元154,用于基于所述第二结构线,获取所述第二轮廓对应的第一特征向量;The first feature vector obtaining unit 154 is configured to obtain a first feature vector corresponding to the second contour based on the second structure line;
定位单元155,用于根据所述第一特征向量与第二特征向量的匹配结果,确定所 述用户的当前位置。The positioning unit 155 is configured to determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
在一种可能的实现方式中,所述定位单元155包括:In a possible implementation manner, the positioning unit 155 includes:
定位信息获取子单元,用于通过定位传感器获取所述用户的定位信息;The location information acquisition subunit is used to acquire the location information of the user through a location sensor;
候选集确定子单元,用于以所述定位信息为中心,确定距离所述中心预定范围内的建筑物的候选集;A candidate set determining subunit, used to determine a candidate set of buildings within a predetermined range from the center with the positioning information as the center;
第二特征向量获取子单元,用于从特征向量数据库中获取与所述候选集对应的第二特征向量;A second feature vector obtaining subunit, configured to obtain a second feature vector corresponding to the candidate set from a feature vector database;
定位子单元,用于从与所述候选集对应的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,并根据查找到的第二特征向量确定所述用户的当前位置。The positioning subunit is used to search for a second feature vector matching the first feature vector from the second feature vector corresponding to the candidate set, and determine the current user’s current feature vector based on the found second feature vector position.
在一种可能的实现方式中,所述定位子单元具体用于:In a possible implementation manner, the positioning subunit is specifically configured to:
获取第一方向角α;Obtain the first direction angle α;
以所述第一方向角α为基准,查找在第二方向角α±β范围内的第二特征向量;Using the first direction angle α as a reference, search for a second eigenvector within a range of the second direction angle α±β;
从查找到的所述第二方向角α±β范围内的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,利用线性插值方法确定所述用户的当前位置。From the found second eigenvectors within the range of the second direction angle α±β, search for a second eigenvector that matches the first eigenvector, and determine the current location of the user by using a linear interpolation method.
在另一种可能的实现方式中,所述定位子单元具体还用于:In another possible implementation manner, the positioning subunit is specifically further used for:
滤除所述第二方向角α±β范围内的无效第二特征向量。The invalid second eigenvectors within the range of the second direction angle α±β are filtered out.
具体地,所述预设融合条件为所述至少两条第一结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条第一结构线之间的垂直距离小于第二数值,且斜率差小于第三数值。Specifically, the preset fusion condition is that in the at least two first structure lines, the distance between two adjacent end points is less than a first value, and the vertical distance between two adjacent first structure lines is The distance is smaller than the second value, and the slope difference is smaller than the third value.
作为示例而非限定,第一轮廓提取单元152具体用于:As an example and not a limitation, the first contour extraction unit 152 is specifically configured to:
通过直线检测算法,从所述第一图像中提取所述第一建筑物的第一结构线,所述第一结构线组成所述第一建筑物的第一轮廓。A straight line detection algorithm is used to extract a first structural line of the first building from the first image, and the first structural line composes a first outline of the first building.
作为示例而非限定,第一融合单元153具体用于:As an example and not a limitation, the first fusion unit 153 is specifically configured to:
将满足预设融合条件的至少两条第一结构线融合连接成一条第二结构线。At least two first structure lines that meet the preset fusion condition are fused and connected to form a second structure line.
在一种可能的实现方式中,该装置还包括:In a possible implementation manner, the device further includes:
第二结构线归一化处理单元,用于对所述第二结构线进行归一化处理,以使得归一化处理后的所述第二结构线的线条宽度为固定像素个数。The second structure line normalization processing unit is configured to perform a normalization process on the second structure line, so that the line width of the second structure line after the normalization process is a fixed number of pixels.
作为示例而非限定,所述第一特征向量获取单元154具体用于:As an example and not a limitation, the first feature vector acquiring unit 154 is specifically configured to:
获取基于不同方向的第二结构线所做出的第一响应图像;Acquiring first response images based on second structure lines in different directions;
使用方向梯度直方图HOG描述子对所述第一响应图进行特征描述,获得所述第二轮廓对应的第一特征向量。Use the HOG descriptor of the directional gradient histogram to perform feature description on the first response graph, and obtain the first feature vector corresponding to the second contour.
在本申请实施例中,通过获取包含建筑物的图像,并从该包含建筑物的图像中提取该建筑物对应的第一结构线,在对满足预设融合条件的第一结构线进行融合处理后,从进行融合处理后的得到的建筑物的轮廓中,提取该建筑物对应的第一特征向量,根据与该第一特征向量相匹配的第二特征向量确定用户的位置,通过第一特征向量与第二特征向量,实现在建筑物密集区域中对用户当前位置的精确定位,提高了用户在建筑物密集区域的定位精度。In this embodiment of the application, by acquiring an image containing a building, and extracting the first structural line corresponding to the building from the image containing the building, the first structural line that meets the preset fusion condition is fused. Then, from the contour of the building obtained after the fusion process, the first feature vector corresponding to the building is extracted, and the user's location is determined according to the second feature vector matching the first feature vector, and the first feature vector is used to determine the location of the user. The vector and the second feature vector realize accurate positioning of the user's current location in the densely-built area, and improve the positioning accuracy of the user in the densely-built area.
实施例五Example five
对应于上文实施例所述的特征向量数据库的构建方法,图16示出了本申请实施例 提供的特征向量数据库的构建装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the method for constructing a feature vector database described in the above embodiment, FIG. 16 shows a structural block diagram of the device for constructing a feature vector database provided by an embodiment of the present application. The relevant part.
参照图16,该装置包括:Referring to Figure 16, the device includes:
三维模型获取单元161,用于获取目标建筑物的三维模型;The three-dimensional model obtaining unit 161 is configured to obtain a three-dimensional model of the target building;
第二图像获取单元162,用于对所述三维模型进行渲染,获得一组包含第二建筑物的第二图像;The second image obtaining unit 162 is configured to render the three-dimensional model to obtain a set of second images including the second building;
第三轮廓提取单元163,用于从每个所述第二图像中提取建筑物的第三轮廓,所述第三轮廓由第三结构线组成;The third contour extraction unit 163 is configured to extract a third contour of the building from each of the second images, where the third contour is composed of third structural lines;
第二融合单元162,用于对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓;The second fusion unit 162 is configured to perform fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
第二特征向量获取单元165,用于基于所述第四结构线,获取所述第四轮廓对应的第二特征向量;The second feature vector obtaining unit 165 is configured to obtain a second feature vector corresponding to the fourth contour based on the fourth structure line;
特征向量数据库构建单元166,用于基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库。The feature vector database construction unit 166 is configured to construct a feature vector database based on the second feature vector and position information corresponding to each of the second images.
所述第二融合单元162具体用于:The second fusion unit 162 is specifically configured to:
将满足预设融合条件的至少两条第三结构线融合连接成一条第四结构线。At least two third structure lines that meet the preset fusion condition are fused and connected to form a fourth structure line.
在一个可能的实现方式中,该装置还包括:In a possible implementation manner, the device further includes:
第四结构线归一化处理单元,用于对所述第四结构线进行归一化处理,以使得归一化处理后的所述第四结构线的线条宽度为固定像素个数。The fourth structure line normalization processing unit is configured to perform normalization processing on the fourth structure line, so that the line width of the fourth structure line after the normalization processing is a fixed number of pixels.
所述第二特征向量获取单元165具体用于:The second feature vector obtaining unit 165 is specifically configured to:
获取基于不同方向的第四结构线所做出的第二响应图像。Acquire a second response image based on the fourth structure line in a different direction.
使用HOG描述子对所述第二响应图进行特征描述,获得所述第四轮廓对应的第二特征向量。Use the HOG descriptor to perform feature description on the second response graph to obtain the second feature vector corresponding to the fourth contour.
示例性的,所述预设融合条件为所述至少两条第三结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条第三结构线之间的垂直距离小于第二数值,且斜率差小于第三数值。Exemplarily, the preset fusion condition is that in the at least two third structure lines, the distance between two adjacent end points is less than a first value, and the distance between two adjacent third structure lines The vertical distance is smaller than the second value, and the slope difference is smaller than the third value.
示例性的,所述特征向量数据库构建单元166具体用于:Exemplarily, the feature vector database construction unit 166 is specifically configured to:
获取每一个所述第二图像对应的位置信息和第三方向角γ;Acquiring the position information and the third angle γ corresponding to each of the second images;
建立每一个所述第二图像及其对应的第二特征向量、位置信息和第三方向角γ的映射关系,得到所述一组第二图像对应的映射关系;Establishing a mapping relationship between each second image and its corresponding second feature vector, position information, and third-direction angle γ, to obtain a mapping relationship corresponding to the set of second images;
基于所述一组第二图像对应的映射关系构建特征向量数据库。A feature vector database is constructed based on the mapping relationship corresponding to the set of second images.
在本申请实施例中,通过获取目标建筑物的三维模型,对所述三维模型进行渲染,获得一组包含第二建筑物的第二图像,从每个所述第二图像中提取建筑物的第三轮廓,所述第三轮廓由第三结构线组成;对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓;基于所述第四结构线,获取所述第四轮廓对应的第二特征向量;基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库,通过对三维模型的渲染获得大量的渲染图像以及该渲染图像对应的特征向量和位置信息,提高了特征向量数据库的构建效率以及准确率。In the embodiment of the present application, by obtaining a three-dimensional model of the target building, rendering the three-dimensional model, obtaining a set of second images containing the second building, and extracting the building’s image from each of the second images The third contour, the third contour is composed of third structure lines; the fusion processing is performed on at least two third structure lines that meet the preset fusion conditions in the third contour, to obtain the fourth structure line composed of the fourth structure lines. Contour; based on the fourth structure line, obtain the second feature vector corresponding to the fourth contour; based on the second feature vector and position information corresponding to each of the second images, construct a feature vector database, by comparing the three-dimensional model A large number of rendered images and feature vectors and location information corresponding to the rendered images are obtained by rendering, which improves the construction efficiency and accuracy of the feature vector database.
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction and execution process between the above-mentioned devices/units are based on the same concept as the method embodiment of this application, and its specific functions and technical effects can be found in the method embodiment section. I won't repeat it here.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as required. Module completion, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist alone physically, or two or more units can be integrated into one unit. The above-mentioned integrated units can be hardware-based Formal realization can also be realized in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, which will not be repeated here.
实施例六Example Six
图17为本申请实施例提供的移动设备的结构示意图。如图17所示,该实施例的移动设备17包括:至少一个处理器170(图17中仅示出一个)处理器、存储器171以及存储在所述存储器171中并可在所述至少一个处理器170上运行的计算机程序172,所述处理器170执行所述计算机程序172时实现上述任意各个基于建筑物的室外定位方法实施例中的步骤。或者,所述处理器170执行所述计算机程序172时实现上述各装置实施例中各单元的功能,例如图15所示单元151至155的功能。FIG. 17 is a schematic structural diagram of a mobile device provided by an embodiment of this application. As shown in FIG. 17, the mobile device 17 of this embodiment includes: at least one processor 170 (only one is shown in FIG. 17), a processor, a memory 171, and a processor that is stored in the memory 171 and can be processed in the at least one processor. A computer program 172 running on the processor 170, when the processor 170 executes the computer program 172, the steps in any of the foregoing building-based outdoor positioning method embodiments are implemented. Alternatively, when the processor 170 executes the computer program 172, the functions of the units in the foregoing device embodiments, for example, the functions of the units 151 to 155 shown in FIG. 15 are realized.
所述移动设备17可以是手机、桌上型计算机、笔记本及掌上电脑等计算设备。该移动设备17可包括,但不仅限于,处理器170、存储器171。本领域技术人员可以理解,图17仅仅是移动设备17的举例,并不构成对移动设备17的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The mobile device 17 may be a computing device such as a mobile phone, a desktop computer, a notebook, and a palmtop computer. The mobile device 17 may include, but is not limited to, a processor 170 and a memory 171. Those skilled in the art can understand that FIG. 17 is only an example of the mobile device 17 and does not constitute a limitation on the mobile device 17. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
所称处理器170可以是中央处理单元(Central Processing Unit,CPU),该处理器170还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 170 may be a central processing unit (Central Processing Unit, CPU), and the processor 170 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), and application specific integrated circuits (Application Specific Integrated Circuits). , ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
所述存储器171在一些实施例中可以是所述移动设备17的内部存储单元,例如电移动子设备17的硬盘或内存。所述存储器171在另一些实施例中也可以是所述移动设备17的外部存储设备,例如所述移动设备17上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器171还可以既包括所述移动设备17的内部存储单元也包括外部存储设备。所述存储器171用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器171还可以用于暂时地存储已经输出或者将要输出的数据本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行 时实现可实现上述各个方法实施例中的步骤。The memory 171 may be an internal storage unit of the mobile device 17 in some embodiments, such as a hard disk or a memory of the electronic mobile sub-device 17. In other embodiments, the memory 171 may also be an external storage device of the mobile device 17, such as a plug-in hard disk equipped on the mobile device 17, a smart media card (SMC), and a secure digital (Secure Digital, SD) card, Flash Card, etc. Further, the memory 171 may also include both an internal storage unit of the mobile device 17 and an external storage device. The memory 171 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 171 can also be used to temporarily store data that has been output or will be output. The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the processor is executed, the steps in the foregoing method embodiments can be realized.
实施例七Example Seven
图18为本申请实施例提供的云服务器的结构示意图。如18图18所示,该实施例的云服务器18包括:至少一个处理器180(图18中仅示出一个)处理器、存储器181以及存储在所述存储器181中并可在所述至少一个处理器180上运行的计算机程序182,所述处理器180执行所述计算机程序182时实现上述任意各个基于建筑物的室外定位方法实施例中的步骤。或者,所述处理器180执行所述计算机程序182时实现上述各装置实施例中各单元的功能,例如图16所示单元161至166的功能。FIG. 18 is a schematic structural diagram of a cloud server provided by an embodiment of the application. As shown in FIG. 18 and FIG. 18, the cloud server 18 of this embodiment includes: at least one processor 180 (only one is shown in FIG. 18), a processor, a memory 181, and a memory 181 stored in the memory 181 and available in the at least one processor. A computer program 182 running on the processor 180, when the processor 180 executes the computer program 182, the steps in any of the above-mentioned embodiments of the building-based outdoor positioning method are implemented. Alternatively, when the processor 180 executes the computer program 182, the functions of the units in the foregoing device embodiments, for example, the functions of the units 161 to 166 shown in FIG. 16 are realized.
所述云服务器18可以是手机、桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该云服务器18可包括,但不仅限于,处理器180、存储器181。本领域技术人员可以理解,图18仅仅是云服务器18的举例,并不构成对云服务器18的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The cloud server 18 may be a computing device such as a mobile phone, a desktop computer, a notebook, a palmtop computer, and a cloud server. The cloud server 18 may include, but is not limited to, a processor 180 and a memory 181. Those skilled in the art can understand that FIG. 18 is only an example of the cloud server 18, and does not constitute a limitation on the cloud server 18. It may include more or less components than shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
所称处理器180可以是中央处理单元(Central Processing Unit,CPU),该处理器180还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 180 may be a central processing unit (Central Processing Unit, CPU), and the processor 180 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), and application specific integrated circuits (Application Specific Integrated Circuits). , ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
所述存储器181在一些实施例中可以是所述云服务器18的内部存储单元,例如云服务器18的硬盘或内存。所述存储器181在另一些实施例中也可以是所述云服务器18的外部存储设备,例如所述云服务器18上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器181还可以既包括所述云服务器18的内部存储单元也包括外部存储设备。所述存储器181用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器181还可以用于暂时地存储已经输出或者将要输出的数据本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。The memory 181 may be an internal storage unit of the cloud server 18 in some embodiments, such as a hard disk or memory of the cloud server 18. In other embodiments, the memory 181 may also be an external storage device of the cloud server 18, such as a plug-in hard disk equipped on the cloud server 18, a smart media card (SMC), and a secure digital (Secure Digital, SD) card, Flash Card, etc. Further, the storage 181 may also include both an internal storage unit of the cloud server 18 and an external storage device. The memory 181 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 181 can also be used to temporarily store data that has been output or will be output. The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the processor is executed, the steps in the foregoing method embodiments can be realized.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动设备上运行时,使得移动设备执行时实现可实现上述各个方法实施例中的步骤。The embodiments of the present application provide a computer program product. When the computer program product runs on a mobile device, the steps in the foregoing method embodiments can be realized when the mobile device is executed.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/移动设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-ONlyMeMory)、 随机存取存储器(RAM,RaNdoM Access MeMory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the implementation of all or part of the processes in the above-mentioned embodiment methods in the present application can be accomplished by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. The computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms. The computer-readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/mobile device, recording medium, computer memory, read-only memory (ROM, Read-ONly MeMory), random access memory ( RAM, RaNdoM Access MeMory), electric carrier signal, telecommunications signal and software distribution medium. For example, U disk, mobile hard disk, floppy disk or CD-ROM, etc. In some jurisdictions, according to legislation and patent practices, computer-readable media cannot be electrical carrier signals and telecommunication signals.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own focus. For parts that are not described in detail or recorded in an embodiment, reference may be made to related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software 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 beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus/network equipment and method may be implemented in other ways. For example, the device/network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units. Or components can be combined or integrated into another system, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that it can still implement the foregoing The technical solutions recorded in the examples are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种基于建筑物的室外定位方法,其特征在于,包括:A building-based outdoor positioning method, which is characterized in that it includes:
    获取包含第一建筑物的第一图像,所述第一图像为用户通过移动设备对其周围的任意建筑物进行拍摄得到的图像;Acquiring a first image containing a first building, where the first image is an image obtained by a user using a mobile device to photograph any surrounding buildings;
    基于所述第一图像提取所述第一建筑物的第一轮廓,所述第一轮廓由至少两条第一结构线组成;Extracting a first contour of the first building based on the first image, where the first contour is composed of at least two first structural lines;
    对所述第一轮廓中满足预设融合条件的至少两条第一结构线进行融合处理,获得由至少两条第二结构线组成的第二轮廓;Performing fusion processing on at least two first structure lines meeting a preset fusion condition in the first contour, to obtain a second contour composed of at least two second structure lines;
    基于所述第二结构线,获取所述第二轮廓对应的第一特征向量;Obtaining a first feature vector corresponding to the second contour based on the second structure line;
    根据所述第一特征向量与第二特征向量的匹配结果,确定所述用户的当前位置。Determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
  2. 如权利要求1所述的方法,其特征在于,根据所述第一特征向量与第二特征向量的匹配结果,确定所述用户的当前位置包括:The method of claim 1, wherein determining the current location of the user according to a matching result of the first feature vector and the second feature vector comprises:
    通过定位传感器获取所述用户的定位信息;Acquiring the positioning information of the user through a positioning sensor;
    以所述定位信息为中心,确定距离所述中心预定范围内的建筑物的候选集;Using the positioning information as a center to determine a candidate set of buildings within a predetermined range from the center;
    从特征向量数据库中获取与所述候选集对应的第二特征向量;Acquiring a second feature vector corresponding to the candidate set from a feature vector database;
    从与所述候选集对应的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,并根据查找到的第二特征向量确定所述用户的当前位置。From the second feature vector corresponding to the candidate set, search for a second feature vector matching the first feature vector, and determine the current location of the user according to the found second feature vector.
  3. 如权利要求2所述的方法,其特征在于,所述从与所述候选集对应的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,并根据查找到的第二特征向量确定所述用户的当前位置包括:The method according to claim 2, wherein the second feature vector corresponding to the candidate set is searched for a second feature vector matching the first feature vector, and the second feature vector is searched according to the found first feature vector. The two feature vectors determining the current location of the user include:
    获取第一方向角α;Obtain the first direction angle α;
    以所述第一方向角α为基准,查找在第二方向角α±β范围内的第二特征向量,β为预设角度;Using the first direction angle α as a reference, search for a second eigenvector within a range of the second direction angle α±β, where β is the preset angle;
    从查找到的所述第二方向角范围内的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,利用线性插值方法确定所述用户的当前位置。From the found second eigenvectors in the range of the second direction angle, search for a second eigenvector matching the first eigenvector, and determine the current position of the user by using a linear interpolation method.
  4. 如权利要求3所述的方法,其特征在于,在所述从查找到的所述第二方向角范围内的第二特征向量中,查找与所述第一特征向量匹配的第二特征向量,利用线性插值方法确定所述用户的当前位置之前,还包括:The method according to claim 3, wherein, in the second eigenvectors within the range of the second direction angle found from the search, searching for a second eigenvector that matches the first eigenvector, Before using the linear interpolation method to determine the current location of the user, the method further includes:
    滤除所述第二方向角α±β范围内的无效第二特征向量。The invalid second eigenvectors within the range of the second direction angle α±β are filtered out.
  5. 如权利要求1至4任一所述的方法,其特征在于,所述预设融合条件为所述至少两条第一结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条第一结构线之间的垂直距离小于第二数值,且斜率差小于第三数值。The method according to any one of claims 1 to 4, wherein the preset fusion condition is that the distance between two adjacent end points of the at least two first structure lines is less than a first value , The vertical distance between two adjacent first structure lines is smaller than the second value, and the slope difference is smaller than the third value.
  6. 如权利要求1所述的方法,其特征在于,所述基于所述第一图像提取所述第一建筑物的第一轮廓包括:The method according to claim 1, wherein said extracting a first contour of said first building based on said first image comprises:
    通过直线检测算法,从所述第一图像中提取所述第一建筑物的第一结构线,所述第一结构线组成所述第一建筑物的第一轮廓。A straight line detection algorithm is used to extract a first structural line of the first building from the first image, and the first structural line composes a first outline of the first building.
  7. 如权利要求1所述的方法,其特征在于,所述对所述第一轮廓中满足预设融合条件的至少两条第一结构线进行融合处理,获得由第二结构线组成的第二轮廓包括:The method according to claim 1, wherein the fusion processing is performed on at least two first structure lines satisfying preset fusion conditions in the first contour to obtain a second contour composed of second structure lines include:
    将满足预设融合条件的至少两条第一结构线融合连接成一条第二结构线。At least two first structure lines that meet the preset fusion condition are fused and connected to form a second structure line.
  8. 如权利要求1所述的方法,其特征在于,在所述基于所述第二结构线,获取所述第二轮廓对应的第一特征向量之前,还包括:The method according to claim 1, characterized in that, before said obtaining the first feature vector corresponding to the second contour based on the second structure line, the method further comprises:
    对所述第二结构线进行归一化处理,以使得归一化处理后的所述第二结构线的线条宽度为固定像素个数。Normalization processing is performed on the second structure line, so that the line width of the second structure line after the normalization processing is a fixed number of pixels.
  9. 如权利要求1所述的方法,其特征在于,所述基于所述第二结构线,获取所述第二轮廓对应的第一特征向量包括:获取基于不同方向的第二结构线所做出的第一响应图像;The method according to claim 1, wherein the obtaining a first feature vector corresponding to the second contour based on the second structure line comprises: obtaining a second structure line based on a different direction. First response image;
    使用方向梯度直方图HOG描述子对所述第一响应图进行特征描述,获得所述第二轮廓对应的第一特征向量。Use the HOG descriptor of the directional gradient histogram to perform feature description on the first response graph, and obtain the first feature vector corresponding to the second contour.
  10. 一种特征向量数据库的构建方法,其特征在于,包括:A method for constructing a feature vector database, which is characterized in that it includes:
    获取目标建筑物的三维模型;Obtain a three-dimensional model of the target building;
    对所述三维模型进行渲染,获得一组包含第二建筑物的第二图像;Rendering the three-dimensional model to obtain a set of second images containing the second building;
    从每一个所述第二图像中提取建筑物的第三轮廓,所述第三轮廓由第三结构线组成;Extracting a third contour of the building from each of the second images, where the third contour is composed of a third structural line;
    对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓;Performing fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
    基于所述第四结构线,获取所述第四轮廓对应的第二特征向量;Obtaining a second feature vector corresponding to the fourth contour based on the fourth structure line;
    基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库。Based on the second feature vector and position information corresponding to each of the second images, a feature vector database is constructed.
  11. 如权利要求10所述的方法,其特征在于,所述对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓包括:The method according to claim 10, wherein the fusion processing is performed on at least two third structure lines satisfying preset fusion conditions among the third contours to obtain a fourth contour composed of fourth structure lines include:
    将满足预设融合条件的至少两条第三结构线融合连接成一条第四结构线。At least two third structure lines that meet the preset fusion condition are fused and connected to form a fourth structure line.
  12. 如权利要求10所述的方法,其特征在于,在所述基于所述第四结构线,获取所述第四轮廓对应的第二特征向量之前,还包括:The method according to claim 10, wherein before said acquiring a second feature vector corresponding to said fourth contour based on said fourth structure line, the method further comprises:
    对所述第四结构线进行归一化处理,以使得归一化处理后的所述第四结构线的线条宽度为固定像素个数。Normalization processing is performed on the fourth structure line, so that the line width of the fourth structure line after the normalization processing is a fixed number of pixels.
  13. 如权利要求10所述的方法,其特征在于,所述基于所述第四结构线,获取所述第四轮廓对应的第二特征向量包括:The method according to claim 10, wherein said acquiring a second feature vector corresponding to said fourth contour based on said fourth structure line comprises:
    获取基于不同方向的第四结构线所做出的第二响应图像;Acquiring a second response image based on a fourth structure line in a different direction;
    使用HOG描述子对所述第二响应图进行特征描述,获得所述第四轮廓对应的第二特征向量。Use the HOG descriptor to perform feature description on the second response graph to obtain the second feature vector corresponding to the fourth contour.
  14. 如权利要求10所述的方法,其特征在于,所述预设融合条件为所述至少两条第三结构线中,其相邻的两个端点之间的距离小于第一数值,相邻的两条第三结构线之间的垂直距离小于第二数值,且斜率差小于第三数值。The method according to claim 10, wherein the preset fusion condition is that in the at least two third structural lines, the distance between two adjacent end points is less than a first value, and the adjacent The vertical distance between the two third structure lines is smaller than the second value, and the slope difference is smaller than the third value.
  15. 如权利要求10至14任一所述的方法,其特征在于,所述基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库包括:The method according to any one of claims 10 to 14, wherein the constructing a feature vector database based on the second feature vector and position information corresponding to each of the second images comprises:
    获取每一个所述第二图像对应的位置信息和第三方向角γ;Acquiring the position information and the third angle γ corresponding to each of the second images;
    建立每一个所述第二图像及其对应的第二特征向量、位置信息和第三方向角γ的映射关系,得到所述一组第二图像对应的映射关系;Establishing a mapping relationship between each second image and its corresponding second feature vector, position information, and third-direction angle γ, to obtain a mapping relationship corresponding to the set of second images;
    基于所述一组第二图像对应的映射关系构建特征向量数据库。A feature vector database is constructed based on the mapping relationship corresponding to the set of second images.
  16. 一种基于建筑物的室外定位装置,其特征在于,包括:A building-based outdoor positioning device, which is characterized in that it comprises:
    第一图像获取单元,用于获取包含第一建筑物的第一图像,所述第一建筑物为用户当前所在位置附近的任意建筑物;The first image acquisition unit is configured to acquire a first image containing a first building, where the first building is any building near the user's current location;
    第一轮廓提取单元,用于基于所述第一图像提取所述第一建筑物的第一轮廓,所述第一轮廓由至少两条第一结构线组成;A first contour extraction unit, configured to extract a first contour of the first building based on the first image, where the first contour is composed of at least two first structure lines;
    第一融合单元,用于对所述第一轮廓中满足预设融合条件的至少两条第一结构线进行融合处理,获得由至少两条第二结构线组成的第二轮廓;The first fusion unit is configured to perform fusion processing on at least two first structure lines meeting preset fusion conditions in the first contour, to obtain a second contour composed of at least two second structure lines;
    第一特征向量获取单元,用于基于所述第二结构线,获取所述第二轮廓对应的第一特征向量;A first feature vector obtaining unit, configured to obtain a first feature vector corresponding to the second contour based on the second structure line;
    定位单元,用于根据所述第一特征向量与第二特征向量的匹配结果,确定所述用户的当前位置。The positioning unit is configured to determine the current location of the user according to the matching result of the first feature vector and the second feature vector.
  17. 一种特征向量数据库的构建装置,其特征在于,包括:A device for constructing a feature vector database, which is characterized in that it comprises:
    三维模型获取单元,用于获取目标建筑物的三维模型;The 3D model acquisition unit is used to acquire the 3D model of the target building;
    第二图像获取单元,用于对所述三维模型进行渲染,获得一组包含第二建筑物的第二图像;The second image acquisition unit is configured to render the three-dimensional model to obtain a set of second images including the second building;
    第三轮廓提取单元,用于从每个所述第二图像中提取建筑物的第三轮廓,所述第三轮廓由第三结构线组成;A third contour extraction unit, configured to extract a third contour of a building from each of the second images, where the third contour is composed of a third structural line;
    第二融合单元,用于对所述第三轮廓中满足预设融合条件的至少两条第三结构线进行融合处理,获得由第四结构线组成的第四轮廓;The second fusion unit is configured to perform fusion processing on at least two third structure lines meeting preset fusion conditions in the third contour, to obtain a fourth contour composed of fourth structure lines;
    第二特征向量获取单元,用于基于所述第四结构线,获取所述第四轮廓对应的第二特征向量;A second feature vector obtaining unit, configured to obtain a second feature vector corresponding to the fourth contour based on the fourth structure line;
    特征向量数据库构建单元,用于基于每一个所述第二图像对应的第二特征向量和位置信息,构建特征向量数据库。The feature vector database construction unit is configured to construct a feature vector database based on the second feature vector and position information corresponding to each of the second images.
  18. 一种移动设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至9任一项所述的方法。A mobile device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program as claimed in claims 1 to 9. The method of any one of.
  19. 一种云服务器,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求10至15任一项所述的方法。A cloud server, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program as claimed in claims 10 to 15. The method of any one of.
  20. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至9,和/或10至15任一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program implements any one of claims 1 to 9 and/or 10 to 15 when the computer program is executed by a processor. The method described.
PCT/CN2020/125210 2019-12-24 2020-10-30 Building based outdoor positioning method, device and mobile equipment WO2021129142A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911348363.3 2019-12-24
CN201911348363.3A CN111194015A (en) 2019-12-24 2019-12-24 Outdoor positioning method and device based on building and mobile equipment

Publications (1)

Publication Number Publication Date
WO2021129142A1 true WO2021129142A1 (en) 2021-07-01

Family

ID=70709378

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/125210 WO2021129142A1 (en) 2019-12-24 2020-10-30 Building based outdoor positioning method, device and mobile equipment

Country Status (2)

Country Link
CN (1) CN111194015A (en)
WO (1) WO2021129142A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111194015A (en) * 2019-12-24 2020-05-22 华为技术有限公司 Outdoor positioning method and device based on building and mobile equipment
CN111858996B (en) * 2020-06-10 2023-06-23 北京百度网讯科技有限公司 Indoor positioning method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101604450A (en) * 2009-07-24 2009-12-16 武汉大学 The method of integrated images and LiDAR data extract contour of building
CN103728645A (en) * 2012-10-10 2014-04-16 航天数联信息技术(深圳)有限公司 Indoor and outdoor positioning system and positioning method thereof
US20150248579A1 (en) * 2013-12-24 2015-09-03 Huazhong University Of Science And Technology Method for identifying and positioning building using outline region restraint of mountain
CN109086745A (en) * 2018-08-31 2018-12-25 广东工业大学 A kind of localization method, device, equipment and computer readable storage medium
CN110209866A (en) * 2019-05-30 2019-09-06 苏州浪潮智能科技有限公司 A kind of image search method, device, equipment and computer readable storage medium
CN111194015A (en) * 2019-12-24 2020-05-22 华为技术有限公司 Outdoor positioning method and device based on building and mobile equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108507541A (en) * 2018-03-01 2018-09-07 广东欧珀移动通信有限公司 Building recognition method and system and mobile terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101604450A (en) * 2009-07-24 2009-12-16 武汉大学 The method of integrated images and LiDAR data extract contour of building
CN103728645A (en) * 2012-10-10 2014-04-16 航天数联信息技术(深圳)有限公司 Indoor and outdoor positioning system and positioning method thereof
US20150248579A1 (en) * 2013-12-24 2015-09-03 Huazhong University Of Science And Technology Method for identifying and positioning building using outline region restraint of mountain
CN109086745A (en) * 2018-08-31 2018-12-25 广东工业大学 A kind of localization method, device, equipment and computer readable storage medium
CN110209866A (en) * 2019-05-30 2019-09-06 苏州浪潮智能科技有限公司 A kind of image search method, device, equipment and computer readable storage medium
CN111194015A (en) * 2019-12-24 2020-05-22 华为技术有限公司 Outdoor positioning method and device based on building and mobile equipment

Also Published As

Publication number Publication date
CN111194015A (en) 2020-05-22

Similar Documents

Publication Publication Date Title
CN111815757B (en) Large member three-dimensional reconstruction method based on image sequence
WO2021115071A1 (en) Three-dimensional reconstruction method and apparatus for monocular endoscope image, and terminal device
US9324003B2 (en) Location of image capture device and object features in a captured image
WO2020052530A1 (en) Image processing method and device and related apparatus
US20120314935A1 (en) Method and apparatus for inferring the geographic location of captured scene depictions
KR102200299B1 (en) A system implementing management solution of road facility based on 3D-VR multi-sensor system and a method thereof
US8463024B1 (en) Combining narrow-baseline and wide-baseline stereo for three-dimensional modeling
WO2021136386A1 (en) Data processing method, terminal, and server
CN106355197A (en) Navigation image matching filtering method based on K-means clustering algorithm
WO2021129142A1 (en) Building based outdoor positioning method, device and mobile equipment
WO2021017211A1 (en) Vehicle positioning method and device employing visual sensing, and vehicle-mounted terminal
US20130135446A1 (en) Street view creating system and method thereof
CN114969221A (en) Method for updating map and related equipment
WO2024088445A1 (en) Vehicle guidance method and system based on visual semantic vector, and device and medium
CN114677435A (en) Point cloud panoramic fusion element extraction method and system
David et al. Orientation descriptors for localization in urban environments
WO2023284358A1 (en) Camera calibration method and apparatus, electronic device, and storage medium
WO2021170051A1 (en) Digital photogrammetry method, electronic device, and system
CN116858215B (en) AR navigation map generation method and device
Coorg Pose imagery and automated three-dimensional modeling of urban environments
CN113256811B (en) Building modeling method, building modeling apparatus, and computer-readable storage medium
CN110135474A (en) A kind of oblique aerial image matching method and system based on deep learning
Morago Multi-modality fusion: registering photographs, videos, and LIDAR range scans
David Detection of building facades in urban environments
KR102249380B1 (en) System for generating spatial information of CCTV device using reference image information

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: 20907382

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: 20907382

Country of ref document: EP

Kind code of ref document: A1