Detailed description of the invention
Below in conjunction with the accompanying drawings and embodiment, the detailed description of the invention of the application is made the most in detailExplanation.Following example are used for illustrating the application, but are not limited to scope of the present application.
It will be appreciated by those skilled in the art that in embodiments herein, the sequence number of following each stepSize be not meant to the priority of execution sequence, the execution sequence of each step should with its function andInternal logic determine, and the implementation process of the embodiment of the present application should not constituted any restriction.
Fig. 1 is the flow chart that distance described in one embodiment of the application determines method, described methodCan determine in such as one distance and realize on equipment.As it is shown in figure 1, described method includes:
S120: obtain the primary importance information of imaging device place primary importance;
S140: determine a reference at described primary importance in become image at described imaging deviceObject and a destination object;
S160: according to described primary importance information and described destination object in described references object orA position of intersecting point is determined on the extension bitmap picture of described references object;
S180: determine the intersection height information of described position of intersecting point;
S200: the reference position information according to described primary importance information and described references object is trueFixed described references object is to the reference levels distance of described primary importance;
S220: according to described reference levels distance, described intersection height information and described firstConfidence breath determines the described destination object target level distance to described primary importance.
Method described in the embodiment of the present application, according to the primary importance of imaging device place primary importanceInformation and the relevant information of a references object in become image, ratios based on similar triangles are closedSystem obtains primary importance and the horizontal range of a destination object in become image, thus provides onePlant and determine the method for the degree of depth of destination object in image, be conducive to objects different in distant view imageSegmentation further.
Below with reference to detailed description of the invention, describe in detail described step S120, S140, S160,The function of S180, S200 and S220.
S120: obtain the primary importance information of imaging device place primary importance.
Wherein, described primary importance is the image space of described imaging device, i.e. shoots imagePosition.Described primary importance information may include that elevation information and the level of described primary importanceCoordinate information.Described elevation information can be the described primary importance height value to ground level, instituteStating horizontal coordinate information can be latitude and longitude information.Described primary importance information can such as be passed throughAccess GPS (global positioning system), dipper system etc. to obtain.
S140: determine a reference at described primary importance in become image at described imaging deviceObject and a destination object.
Wherein, described references object can be a significant object, such as one road sign building, changesSentence is talked about, and described references object should have obvious visual signature so that can be by such as schemingIt is determined as identifying, and, the relevant information of described references object can be relevant by retrievalData base obtains.Described relevant information can include the elevation information of described references object, longitude and latitudeDegree information etc..Such as, described image includes Central TV Tower, can be true by image recognitionDetermining Central TV Tower is described references object.
Described destination object object the most to be measured, typically can specify according to user and determine.
S160: according to described primary importance information and described destination object in described references object orA position of intersecting point is determined on the extension bitmap picture of described references object.
Seeing Fig. 2, in one embodiment, described method also includes:
S150: determine the bottom of described destination object.
The bottom of described destination object can be determined by such as image recognition mode.Wherein, existIn application scenes, the bottom of described destination object may be blocked completely, i.e. cannot be straightConnect the bottom picking out described destination object, such as blocked by some green planting, in this case,Owing to shelter is relatively near apart from described destination object, thus may determine that the bottom of described shelterBottom as described destination object.That is, described step S150 is further:
S150 ': the bottom in response to described destination object is blocked completely by one the 3rd object, determinesThe bottom of described 3rd object is as the bottom of described destination object.
In one embodiment, described step S160 farther includes:
S160 ': according to the bottom of described primary importance information and described destination object in described referenceA position of intersecting point, wherein, described first is determined on the extension bitmap picture of object or described references objectPosition, the bottom of described destination object and described position of intersecting point are on the same line.
Wherein, in one embodiment, described primary importance, described destination object and describedThe position relationship of references object can be as shown in Figure 3 a and Figure 3 b shows.
Fig. 3 a is the side view of image scene, and wherein, described destination object can be in Fig. 3 aBuilding B, described references object can be building L in Fig. 3 a, and described primary importance can beFig. 3 a builds the top A of A2.Due to described primary importance, the bottom of described destination objectWith described position of intersecting point on the same line, therefore, it can the top A at building A2With buildBuild and do line between the bottom of B, this line and the intersection point the most described position of intersecting point O building L.
Fig. 3 b is become image schematic diagram, it may also be said to be the front view of image scene.Wherein,S1 represents the horizon at the bottom of building B, and S2 represents the horizon at the bottom of building L,Line segment between O1 to O2 in intersection point O corresponding diagram 4 in Fig. 3 a.It will be seen that instituteStating in Fig. 3 a, S1 is above S2, for described primary importance,Building L is in the front of building B.In other words, building L and the level of described primary importanceThe distance horizontal range less than building B with described primary importance.If it should be noted that instituteBecoming image is to tilt, and first image can be carried out aligning process.
In another embodiment, described primary importance, described destination object and described referenceThe position relationship of object can be as shown in figures 4 a and 4b.
Fig. 4 a is the side view of image scene, and wherein, described destination object can be in Fig. 4 aBuilding B, described references object can be building L in Fig. 4 a, and described primary importance can beFig. 4 a builds the top A of A2.Due to described primary importance, the bottom of described destination objectWith described position of intersecting point on the same line, therefore, it can the top A at building A2With buildBuild and do line between the bottom of B.It will be seen that owing to the height of building L is relatively low, this is evenLine will not directly intersect with building L's, therefore can be extension bitmap picture (Fig. 4 a of building LMiddle dotted portion), then obtain the intersection point O of described line and described extension bitmap picture.
Fig. 4 b is become image schematic diagram, it may also be said to be the front view of image scene.Wherein,S1 represents the horizon at the bottom of building B, and S2 represents the horizon at the bottom of building L,Line segment between O1 to O2 in intersection point O corresponding diagram 4b in Fig. 4 a.It will be seen that byRelatively low in building L, in fig. 4b, the bottom less than building B, the top of building L, describedIntersection point O is substantially on the extension bitmap picture (vertical dotted portion in figure) of described building L.
It should be noted that the extension bitmap picture of described references object can be described references object edgeThe image in the enclosed region of extended line at the edge of vertical direction.
It addition, it will be appreciated by those skilled in the art that described destination object and described references object notCertain being only is built, it is also possible to be such as massif etc..
S180: determine the intersection height information of described position of intersecting point.
Wherein, described intersection height information can be the height of described position of intersecting point distance ground levelValue.
Seeing Fig. 5, in one embodiment, described method also includes:
S171: obtain the reference altitude information of described references object;
S172: determine bottom and the top of described references object.
Wherein, described reference altitude information i.e. the height value of described references object, it is permissibleRecognition result according to described references object is obtained by inquiry associated databases.Such as, it is assumed thatDescribed references object is Central TV Tower, then can obtain it by inquiring about such as Baidupedia etc.Height value is 405 meters.
The bottom of described references object and top can be determined by such as image recognition mode.ItsIn, in application scenes, the bottom of described references object may be blocked completely, i.e.Cannot directly pick out the bottom of described references object, such as be blocked by some green planting, this feelingsUnder condition, owing to shelter is relatively near apart from described references object, thus may determine that described shelterBottom as the bottom of described references object.That is, described step S172 is further:
S172 ': the bottom in response to described references object is blocked completely by one the 4th object, determinesThe bottom of described 4th object is as the bottom of described references object.
Accordingly, described step S180 farther includes:
S180 ': according to described reference altitude information, the bottom of described references object and top, reallyThe intersection height information of fixed described position of intersecting point.
In one embodiment, as shown in Figure 3 a, it is assumed that described references object, L is i.e. builtBottom be L1, top is L2, it is assumed that L1Distance to described position of intersecting point (i.e. intersection point O)For, it is assumed that L2Distance to described position of intersecting point is, by image procossing, can obtainTo intersection point O to L2Between pixel quantity and O to L1Between the pixel ratio of pixel quantity, shouldPixel ratio is i.e.WithBetween length ratio, it is assumed that described pixel ratio is k, then have:
Assume that obtaining the described total height with reference to building L according to described reference altitude information is hl,Then have:
Can obtain in conjunction with formula (1):
Such that it is able to be calculated, i.e. determine the intersection height information of described position of intersecting point.
In another embodiment, as shown in fig. 4 a, by image procossing, can obtainIntersection point O to L2Between pixel quantity and L2To L1Between the pixel ratio of pixel quantity, this pixelRatio i.e. hxAnd hlBetween length ratio, it is assumed that described pixel ratio is k ', then have:
Such that it is able to be calculated hx, and then and hlDo and can obtain the friendship of described position of intersecting pointPoint elevation information.
S200: the reference position information according to described primary importance information and described references object is trueFixed described references object is to the reference levels distance of described primary importance.
The positional information of described references object, the most described reference position information can be by inquiry phaseAnswer data base to obtain, in conjunction with the horizontal coordinate information in described primary importance information, then can countCalculate and obtain the described references object distance to described primary importance, the most described reference levels distance.Such as, it is assumed that described references object is Central TV Tower, after can be by inquiry Baidu mapPlatform data base obtains its latitude and longitude information.
S220: according to described reference levels distance, described intersection height information and described firstConfidence breath determines the described destination object target level distance to described primary importance.
In one embodiment, in conjunction with Fig. 3 a, described reference levels distance can corresponding be builtThe bottom A of A1Bottom L with building L1Between distance, it is assumed that for dL;Described intersection heightInformation can be intersection height value;Described can be obtained according to described primary importance informationThe height value of one position, it is assumed that for;Assume that described first position is A2, described firstThe height value of position is h;Assume that described target level distance is dB;Then triangle BOL1WithTriangle BA1A2For similar triangles, thus have:
Can be calculated described target level distance according to formula (5) is dB。
In another embodiment, in conjunction with Fig. 4 b, it is also possible to obtain dihedral BOL1And triangleShape BA1A2For similar triangles, thus have:
Can be calculated described target level distance according to formula (6) is dB。
In addition, it is necessary to explanation, if ground level corresponding to described first position, describedReferences object location plane and described destination object location plane the most at grade,Then need first to carry out corresponding height value correction, process according still further to described method, to reduceError.Such as references object on a hillside, then needs to carry out described intersection height informationRevise.
Further, since earth surface spherically shape, therefore in described primary importance and described referenceThe feelings that the horizontal range of building (or described target structures) (is such as more than 11 kms) farther outUnder condition, the bottom of described primary importance and the described end with reference to building (or described target structures)Portion can the most at grade, and two level differences may reach 10 meters.ThisIn the case of, it may be necessary to the height value of described primary importance (or described position of intersecting point) is carried outAfter correction, process according still further to herein described method, to reduce described target level distanceError.
Additionally, the embodiment of the present application also provides for a kind of computer-readable medium, it is included in and is performedThe computer-readable instruction of below Shi Jinhang operation: perform in above-mentioned Fig. 1 illustrated embodimentStep S120 of method, the operation of S140 and S160.
To sum up, method described in the embodiment of the present application, according to the of imaging device place primary importanceOne positional information and the relevant information of a references object in become image, based on similar trianglesProportionate relationship obtains primary importance and the horizontal range of a destination object in become image, thus carriesSupplied a kind of to determine the method for the degree of depth of destination object in image, be conducive to in distant view image notSegment further with object.
Fig. 6 is the modular structure schematic diagram that distance described in one embodiment of the invention determines equipment,Described distance determines that equipment can be arranged at smart mobile phone, slr camera as a functional moduleDeng in imaging device for user, naturally it is also possible to as an autonomous device for user.As shown in Figure 6, described equipment 600 can also include:
Primary importance acquisition module 610, for obtaining the first of imaging device place primary importancePositional information;
Object determines module 620, for being become at described primary importance at described imaging deviceImage determines a references object and a destination object;
Position of intersecting point determines module 630, for according to described primary importance information and described targetObject determines a position of intersecting point on the extension bitmap picture of described references object or described references object;
Intersection height determines module 640, for determining the intersection height information of described position of intersecting point;
Reference levels distance determines module 650, for according to described primary importance information and describedThe reference position information of references object determines the reference to described primary importance of the described references objectHorizontal range;
Target level distance determines module 660, for according to described reference levels distance, describedIntersection height information and described primary importance information determine described destination object to described firstThe target level distance put.
Equipment described in the embodiment of the present application, according to the primary importance of imaging device place primary importanceInformation and the relevant information of a references object in become image, ratios based on similar triangles are closedSystem obtains primary importance and the horizontal range of a destination object in become image, thus provides onePlant and determine the equipment of the degree of depth of destination object in image, be conducive to objects different in distant view imageSegmentation further.
Below with reference to detailed description of the invention, describe in detail described primary importance acquisition module 610,Described object determines that module 620, described position of intersecting point determine module 630, described intersection heightDetermine that module 640, described reference levels distance determine that module 650 and target level distance determineThe function of module 660.
Described primary importance acquisition module 610, for obtaining imaging device place primary importancePrimary importance information.
Wherein, described primary importance is the image space of described imaging device, i.e. shoots imagePosition.Described primary importance information may include that elevation information and the level of described primary importanceCoordinate information.Described elevation information can be the described primary importance height value to ground level, instituteStating horizontal coordinate information can be latitude and longitude information.Described primary importance acquisition module 610 is permissibleSuch as by accessing the described primary importances of acquisition such as GPS (global positioning system), dipper systemInformation.
Described object determines module 620, is used at described imaging device in described first positionBecome image determines a references object and a destination object.
Wherein, described references object can be a significant object, such as one road sign building, changesSentence is talked about, and described references object should have obvious visual signature so that described object determines mouldBlock 620 can be determined by such as image recognition, and, being correlated with of described references objectInformation can be obtained by retrieval Relational database.Described relevant information can include described referenceThe elevation information of object, latitude and longitude information etc..
Described destination object object the most to be measured, typically can specify according to user and determine.
Described position of intersecting point determines module 630, for according to described primary importance information and describedDestination object determines an intersection point on the extension bitmap picture of described references object or described references objectPosition.
Seeing Fig. 7, in one embodiment, described equipment 600 also includes:
One destination object local determines module 670, for determining the bottom of described destination object.
The bottom of described destination object can be determined by such as image recognition mode.Wherein, existIn application scenes, the bottom of described destination object may be blocked completely, i.e. cannot be straightConnect the bottom picking out described destination object, such as blocked by some green planting, in this case,Owing to shelter is relatively near apart from described destination object, thus may determine that the bottom of described shelterBottom as described destination object.
That is, in one embodiment, described destination object local determines module 670, usesBlocked completely by one the 3rd object in the bottom in response to described destination object, determine the described 3rdThe bottom of object is as the bottom of described destination object.
Accordingly, in one embodiment, described position of intersecting point determines module 630, is used forBottom according to described primary importance information and described destination object is in described references object or instituteState and on the extension bitmap picture of references object, determine a position of intersecting point, wherein, described primary importance, instituteState the bottom of destination object and described position of intersecting point on the same line.
As above described in an embodiment, described primary importance, described destination object and described with reference to rightThe position relationship of elephant can be as shown in Fig. 3 a, 3b or Fig. 4 a, 4b, and here is omitted.
Described intersection height determines module 640, for determining the intersection height of described position of intersecting pointInformation.
Wherein, described intersection height information can be the height of described position of intersecting point distance ground levelValue.
Seeing Fig. 8, in one embodiment, described equipment 600 also includes:
One reference altitude acquisition module 680, for obtaining the reference altitude letter of described references objectBreath;
One references object local determine module 690, for determine described references object bottom andTop.
Wherein, described reference altitude information i.e. the height value of described references object, it is permissibleRecognition result according to described references object is obtained by inquiry associated databases.Such as, it is assumed thatDescribed references object is Central TV Tower, then can obtain it by inquiring about such as Baidupedia etc.Height value is 405 meters.
The bottom of described references object and top can be determined by such as image recognition mode.ItsIn, in application scenes, the bottom of described references object may be blocked completely, i.e.Cannot directly pick out the bottom of described references object, such as be blocked by some green planting, this feelingsUnder condition, owing to shelter is relatively near apart from described references object, thus may determine that described shelterBottom as the bottom of described references object.That is, in one embodiment, described ginsengExamine object local and determine module 690, for the bottom in response to described references object by one the 4thObject blocks completely, determines the bottom as described references object, the bottom of described 4th object.
Accordingly, described intersection height determines module 640, for believing according to described reference altitudeBreath, the bottom of described references object and top, determine the intersection height information of described position of intersecting point.
In one embodiment, as shown in Figure 3 a, it is assumed that described references object, L is i.e. builtBottom be L1, top is L2, it is assumed that L1Distance to described position of intersecting point (i.e. intersection point O)For, it is assumed that L2Distance to described position of intersecting point is, by image procossing, can obtainTo intersection point O to L2Between pixel quantity and O to L1Between the pixel ratio of pixel quantity, shouldPixel ratio is i.e.WithBetween length ratio, according to this pixel ratio and described with reference to buildingTotal height h of Ll, described intersection height information can be obtained.
In another embodiment, as shown in fig. 4 a, by image procossing, can obtainIntersection point O to L2Between pixel quantity and L2To L1Between the pixel ratio of pixel quantity, this pixelRatio i.e. hxAnd hlBetween length ratio, according to this length than and described with reference to building L height overallDegree hl, described intersection height information can be obtained.
Described reference levels distance determines module 650, for according to described primary importance information andThe reference position information of described references object determines that described references object is to described primary importanceReference levels distance.
The positional information of described references object, the most described reference position information can be by inquiry phaseAnswer data base to obtain, in conjunction with the horizontal coordinate information in described primary importance information, then can countCalculate and obtain the described references object distance to described primary importance, the most described reference levels distance.Such as, it is assumed that described references object is Central TV Tower, after can be by inquiry Baidu mapPlatform data base obtains its latitude and longitude information.
Described target level distance determines module 660, for according to described reference levels distance,Described intersection height information and described primary importance information determine that described destination object is to describedThe target level distance of one position.
In one embodiment, in conjunction with Fig. 3 a, described reference levels distance can corresponding be builtThe bottom A of A1Bottom L with building L1Between distance, it is assumed that for dL;Described intersection heightInformation can be intersection height value;Described can be obtained according to described primary importance informationThe height value of one position, it is assumed that for;Assume that described first position is A2, described firstThe height value of position is h;Assume that described target level distance is dB;Then triangle BOL1WithTriangle BA1A2For similar triangles, according to the proportionate relationship of similar triangles, can obtainDescribed target level distance is dB。
In another embodiment, in conjunction with Fig. 4 b, it is also possible to obtain dihedral BOL1And triangleShape BA1A2For similar triangles, and then described target can be calculated according to formula (6)Horizontal range is dB。
In addition, it is necessary to explanation, if ground level corresponding to described first position, describedReferences object location plane and described destination object location plane the most at grade,Then need first to carry out corresponding height value correction, process according still further to described method, to reduceError.Such as references object on a hillside, then needs to carry out described intersection height informationRevise.
Further, since earth surface spherically shape, therefore in described primary importance and described referenceThe feelings that the horizontal range of building (or described target structures) (is such as more than 11 kms) farther outUnder condition, the bottom of described primary importance and the described end with reference to building (or described target structures)Portion can the most at grade, and two level differences may reach 10 meters.ThisIn the case of, it may be necessary to the height value of described primary importance (or described position of intersecting point) is carried outAfter correction, process according still further to herein described method, to reduce described target level distanceError.
Distance described in the embodiment of the present application determines that an application scenarios of method and apparatus can be asUnder: subscriber station hand-held slr camera in Xishan Mountain Beijing area is taken pictures, during camera screen occursWhen entreating the image of television tower, camera determines that it is Central TV Tower by image recognition, and inquires aboutData base obtains its relevant information, then marks out oneself level to this television tower on screenDistance;User clicks on a unknown building at television tower rear, same markers on screen on screenOutpour this unknown building distance to oneself.
Distance described in one embodiment of the application determines the hardware configuration of equipment as shown in Figure 9.ThisTo described distance, application specific embodiment does not determine that equipment implements and limits, see figure9, described equipment 900 may include that
Processor (processor) 910, communication interface (Communications Interface) 920,Memorizer (memory) 930, and communication bus 940.Wherein:
Processor 910, communication interface 920, and memorizer 930 is by communication bus 940Complete mutual communication.
Communication interface 920, is used for and other net element communications.
Processor 910, is used for the program that performs 932, specifically can perform shown in above-mentioned Fig. 1Correlation step in embodiment of the method.
Specifically, program 932 can include that program code, described program code include computerOperational order.
Processor 910 is probably a central processor CPU, or specific integrated circuitASIC (Application Specific Integrated Circuit), or be configured to implementOne or more integrated circuits of the embodiment of the present application.
Memorizer 930, is used for program of depositing 932.Memorizer 930 may comprise high-speed RAMMemorizer, it is also possible to also include nonvolatile memory (non-volatile memory), such asAt least one disk memory.Program 932 specifically can perform following steps:
Obtain the primary importance information of imaging device place primary importance;
At described imaging device, become image determines at described primary importance a references objectWith a destination object;
Determine in described references object according to described primary importance information and described destination objectOne position of intersecting point;
Determine the intersection height information of described position of intersecting point;
Reference position information according to described primary importance information and described references object determines instituteState the references object reference levels distance to described primary importance;
According to described reference levels distance, described intersection height information and described primary importance informationDetermine the described destination object target level distance to described primary importance.
In program 932, each step implements the corresponding step that may refer in above-described embodimentRapid or module, is not repeated herein.Those skilled in the art it can be understood that arrive, forThe convenience that describes and succinct, the equipment of foregoing description and the specific works process of module, Ke YicanState the corresponding process in embodiment of the method before examination to describe, do not repeat them here.
Those of ordinary skill in the art are it is to be appreciated that combine the embodiments described herein and retouchThe unit of each example stated and method step, it is possible to electronic hardware or computer software andBeing implemented in combination in of electronic hardware.These functions perform with hardware or software mode actually,Depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can be to oftenIndividual specifically should being used for uses different methods to realize described function, but this realization is notIt is considered as beyond scope of the present application.
If described function realizes and as independent product pin using the form of SFU software functional unitWhen selling or use, can be stored in a computer read/write memory medium.Based on suchUnderstand, part that prior art is contributed by the technical scheme of the application the most in other words orThe part of this technical scheme of person can embody with the form of software product, this computer softwareProduct is stored in a storage medium, including some instructions with so that a computer equipment(can be personal computer, controller, or the network equipment etc.) performs the application, and each is realExecute all or part of step of method described in example.And aforesaid storage medium includes: USB flash disk, shiftingDynamic hard disk, read only memory (ROM, Read-Only Memory), random access memory(RAM, Random Access Memory), magnetic disc or CD etc. are various can store journeyThe medium of sequence code.
Embodiment of above is merely to illustrate the application, and not restriction to the application, relevantThe those of ordinary skill of technical field, in the case of without departing from spirit and scope,Can also make a variety of changes and modification, the technical scheme of the most all equivalents falls within the applicationCategory, the scope of patent protection of the application should be defined by the claims.