The content of the invention
It is existing to solve it is an object of the invention to provide a kind of walking direction system and method applied to mobile terminal
When mobile terminal do not configure corresponding direction instrument leading to problems such as do not can indicate that in technology is correctly oriented.
The present invention provides a kind of direction determination process applied to mobile terminal on the one hand, including:
Obtain stub annual ring image;
The distribution of stub annual ring in the stub annual ring image is analyzed, obtains the density letter of the stub annual ring
Breath;And
According to the density information of the stub annual ring, corresponding directional information is inferred to.
Preferably, stub annual ring image is obtained, including:Stub annual ring image is selected from photo library;Shoot stub annual ring
Obtain the stub annual ring image of intake;Alternatively, as obtained from intercepting the stub annual ring to the preview under preview mode
Stub annual ring image.
Preferably, the distribution of stub annual ring is further included before analyzing to the tree in the stub annual ring image
Stake annual ring image carries out image procossing, and described image processing includes:Gray proces are carried out to the stub annual ring image;To gray scale
Treated, and the stub annual ring image is smoothed;And threshold is carried out to the stub annual ring image after smoothing processing
Value is handled.
Preferably, according to the density information of the stub annual ring, it is inferred to corresponding directional information, including:It obtains described
The density information of stub annual ring from the density information, finds out most fine and closely woven position in the stub annual ring, for described most thin
The direction that compact part position is drawn is i.e. as the first reference direction;Alternatively, the density information of the stub annual ring is obtained, from the density
In information, most sparse position in the stub annual ring is found out, the direction drawn for the most sparse position is marked as second
Quasi- direction.
Preferably, from the density information, most fine and closely woven position in the stub annual ring is found out, including:
The annual ring of most inner lane in the stub annual ring is oriented, using the center of the most inner lane annual ring as the stub year
The annual ring center of wheel;It is swept using centered on the annual ring center to the radial line of external radiation as scan line around the stub annual ring
It retouches, obtains the radial line set of the corresponding stub annual ring in all directions;And it chooses and corresponds to from the radial line set
That shortest radial line at most fine and closely woven position, the shortest radial line is i.e. as the first reference direction;
From the density information, most sparse position in the stub annual ring is found out, including:
The annual ring of most inner lane in the stub annual ring is oriented, using the center of the most inner lane annual ring as the stub year
The annual ring center of wheel;It is swept using centered on the annual ring center to the radial line of external radiation as scan line around the stub annual ring
It retouches, obtains the radial line set of the corresponding stub annual ring in all directions;And it chooses and corresponds to from the radial line set
That longest radial line at most sparse position, the longest radial line is i.e. as the second reference direction.
The present invention provides a kind of walking direction system applied to mobile terminal on the other hand, including:
Image acquisition unit, for obtaining stub annual ring image;
Analysis of annual rings unit is connected with described image acquiring unit, for the institute acquired in described image acquiring unit
State the density information for being analyzed to obtain the stub annual ring of stub annual ring in stub annual ring image;And
Unit is inferred in direction, is connected with the analysis of annual rings unit, for being analyzed according to the analysis of annual rings unit
The density information of the stub annual ring arrived, is inferred to corresponding directional information.
Preferably, stub annual ring image is obtained, including:Stub annual ring image is selected from photo library;Shoot stub annual ring
Obtain the stub annual ring image of intake;Alternatively, as obtained from intercepting the stub annual ring to the preview under preview mode
Stub annual ring image.
Preferably, the walking direction system is further included positioned at described image acquiring unit and the analysis of annual rings unit
Between image processing unit, including:
Gradation processing module, for carrying out gray proces to the stub annual ring image;
Smoothing module is connected with the gradation processing module, after to the gradation processing module gray proces
The stub annual ring image be smoothed;And
Thresholding processing module is connected with the smoothing module, for the smoothing module smoothing processing
The stub annual ring image afterwards carries out thresholding processing.
Preferably, according to the density information of the stub annual ring, it is inferred to corresponding directional information, including:It obtains described
The density information of stub annual ring from the density information, finds out most fine and closely woven position in the stub annual ring, for described most thin
The direction that compact part position is drawn is i.e. as the first reference direction;Alternatively, the density information of the stub annual ring is obtained, from the density
In information, most sparse position in the stub annual ring is found out, the direction drawn for the most sparse position is marked as second
Quasi- direction.
Preferably, the direction infers that unit further comprises:
Centralized positioning module, for orienting the annual ring of most inner lane in the stub annual ring, by the most inner lane annual ring
Annual ring center of the center as the stub annual ring;
Radial line scan module is connected with the centralized positioning module, for the outside spoke centered on the annual ring center
The radial line penetrated, around the stub year wheel scan, obtains the radial line of the corresponding stub annual ring in all directions as scan line
Set;And
Direction radial line determining module is connected with the radial line scan module, is corresponded to for being chosen from the radial line set
That shortest radial line in most fine and closely woven position or that longest radial line corresponding to most sparse position, this is most short
Radial line as the first reference direction or using the longest radial line as the second reference direction.
Walking direction system and method provided by the invention applied to mobile terminal, by stub annual ring image
Stub annual ring is analyzed and obtains the density information of the stub annual ring, and then is believed by the density of the stub annual ring
Breath, is inferred to corresponding directional information, can be indicated for user and be correctly oriented direction relatively, solved of the prior art because of movement
Terminal does not configure corresponding direction instrument and leads to problems such as not can indicate that and is correctly oriented, and improves the experience of user.
Specific embodiment
Illustrate embodiments of the present invention below by way of particular specific embodiment, those skilled in the art can be by this explanation
Content disclosed by book understands other advantages and effect of the present invention easily.The present invention can also be by addition different specific
Embodiment is embodied or practiced, and the various details in this specification can also be based on different viewpoints and application, not carry on the back
Various modifications or alterations are carried out under spirit from the present invention.
It should be noted that structure, ratio, size depicted in this specification institute accompanying drawings etc., only coordinating
The bright revealed content of book so that those skilled in the art understands and reads, is not limited to the enforceable limit of the present invention
Fixed condition, therefore do not have technical essential meaning, the modification of any structure, the change of proportionate relationship or the adjustment of size, not
It influences under the effect of present invention can be generated and the purpose that can reach, should all still fall and be obtained in disclosed technology contents
In the range of covering.It is meanwhile cited such as " on ", " under ", "left", "right", " centre " and " one " etc. in this specification
Term is merely convenient to understanding rather than to limit the enforceable scope of the present invention, the change of relativeness or tune for narration
It is whole, in the case where changing technology contents without essence, when being also considered as the enforceable scope of the present invention.
It please refers to Fig.1, it is shown that the present invention is applied to the structure of the walking direction system of mobile terminal in one embodiment
Block diagram.As shown in Figure 1, the walking direction system 1 that the present invention is applied to mobile terminal includes:At image acquisition unit 11, image
It manages unit 13, analysis of annual rings unit 15 and direction and infers unit 17.In the present embodiment, mobile terminal is preferably now most
Common smart mobile phone, but be not limited thereto, such as tablet computer, laptop etc. are also applicable.
Above-mentioned various components are described in detail below.
Image acquisition unit 11 is used to obtain stub annual ring image.In the present embodiment, the side of stub annual ring image is obtained
Formula can there are many, such as:One or more stub annual ring figure is selected in the stub annual ring image that can have been deposited from photo library
The stub annual ring of picture or the direct floor of camera carried using mobile terminal obtains the stub annual ring figure of intake
Picture, can also by preview stub annual ring under the preview mode to the camera in mobile terminal and by stub annual ring preview image into
Row interception obtains stub annual ring image.
Image processing unit 13 is used to carry out image procossing to the stub annual ring image that image acquisition unit 11 obtains.At this
In embodiment, as shown in Fig. 2, image processing unit 13 further comprises:Gradation processing module 131, smoothing module 133,
And thresholding processing module 135.Gradation processing module 131 is used to carry out gray proces to the stub annual ring image.Specifically
Stub annual ring image progress gray proces can be caused image to be more prone to processed and calculate, with OpenCV by ground
Exemplified by (Open Source Computer Vision Library), because by color image with 83 passages in OpenCV
Form be stored among matrix, i.e., each pixel saves as 3 integers between 0 to 255, corresponds to R, G, B tri- respectively
Kind color, after gray proces are carried out, each pixel can save as an integer between 0 to 255, and image then becomes 8
Single pass image.Smoothing module 133 is connected with gradation processing module 131, to 131 gray scale of gradation processing module
The stub annual ring image after reason is smoothed.Specifically, (also referred to as Fuzzy Processing) is smoothed to image,
Medium filtering or gaussian filtering may be employed in more commonly used smoothing processing method, in contrast, compared to gaussian filtering, intermediate value
Filter the speed of filtering relatively faster.Thresholding processing module 135 is connected with smoothing module 133, for smoothing processing
The stub annual ring image after 133 smoothing processing of module carries out thresholding processing, to identify in the stub annual ring image
Each circle annual ring.In order to distinguish the annual ring in the stub annual ring image, by the area that the color after smoothing processing is deeper
Domain, which distinguishes, carries out thresholding processing.A threshold value can be first preset, for example, the pixel placement that will be above the threshold value is 255, and
The pixel placement that will be less than the threshold value is 0, in this way, having reformed into " two-value " image by the processed image of thresholding.By
Above simple operations, we only need to be detected the annual ring that can be found out in image to the pixel of black in image
, this method has many advantages, such as easy to operate fast with the speed of service.
Analysis of annual rings unit 15 is connected with image processing unit 13, for 13 image procossing mistake of described image processing unit
The stub annual ring image in the distribution of stub annual ring analyzed, to obtain the density information of the stub annual ring.At this
In embodiment, since image processing unit 13 has carried out image procossing to the stub annual ring image so that the stub year
Respectively enclosing annual ring in wheel image can be easier to be identified, in this way, being advantageous for using analysis of annual rings unit 15 to the stub
Stub annual ring carries out distributional analysis in annual ring image.The density degree of stub annual ring can be by measuring arbitrary neighborhood two successively
The spacing of stub annual ring obtains.
Direction infers that unit 17 is connected with analysis of annual rings unit 15, for what is analyzed according to analysis of annual rings unit 15
The density information of the stub annual ring, is inferred to corresponding directional information.Specifically, believed according to the density of the stub annual ring
Breath, is inferred to corresponding directional information, including:The density information of the stub annual ring is obtained, from the density information, is found out
Most fine and closely woven position in the stub annual ring, the direction drawn for the most fine and closely woven position are used as the first reference direction;Alternatively,
The density information of the stub annual ring is obtained, from the density information, finds out most sparse position in the stub annual ring, for
The direction that the most sparse position is drawn is i.e. as the second reference direction.From the foregoing, it will be observed that believe for the density of the stub annual ring
No matter breath, find out the most fine and closely woven position of the density information or most sparse position, can be inferred to reference direction accordingly.It needs
It is bright, due to the difference in the Southern Hemisphere and the Northern Hemisphere, so, the reference direction corresponding to most fine and closely woven position and most sparse position is
Opposite.Such as:For the Northern Hemisphere, the positive north is oriented to by what the most fine and closely woven position of the density information was drawn, is dredged by described
What the most sparse position of confidential information was drawn is oriented to Due South;For the Southern Hemisphere, drawn by the most fine and closely woven position of the density information
What is gone out is oriented to Due South, and the positive north is oriented to by what the most sparse position of the density information was drawn.
In a preferred embodiment, as shown in figure 3, direction infers that unit 17 further comprises:Centralized positioning module 171,
Radial line scan module 173 and direction radial line determining module 175.Centralized positioning module 171 is used to orient the stub annual ring
In most inner lane annual ring, using the center of the most inner lane annual ring as the annual ring center of the stub annual ring.Radial line scan module
173 are connected with centralized positioning module 171, for using centered on the annual ring center and to the radial line of external radiation as scan line around
The stub year wheel scan, obtains the radial line set of the corresponding stub annual ring in all directions.Direction radial line determines mould
Block 175 is connected with radial line scan module, for from the radial line set choose corresponding to most fine and closely woven position it is shortest that
Radial line or that longest radial line corresponding to most sparse position, using the shortest radial line as the first reference direction or
Person is using the longest radial line as the second reference direction.
It should be noted that reduce the deviation that the particularity of indivedual stub annual ring images is inferred for direction, it is preferable that
In practical applications, (such as multiple stub annual rings of same seeds can be shot by choosing different multiple stub annual ring images
Multiple stub annual ring images of image or different tree species etc.) to obtain different directional informations respectively, to these directional informations
It carries out statistical analysis and reduces the error that final direction is inferred.
Referring to Fig. 4, show that the present invention is applied to the flow of the direction determination process of mobile terminal in one embodiment
Schematic diagram.As shown in figure 4, the present invention is applied to the direction determination process of mobile terminal, including:
Step S41 obtains stub annual ring image.
Step S43 carries out image procossing to the stub annual ring image.
Step S45 analyzes the distribution of stub annual ring in the stub annual ring image, obtains the stub annual ring
Density information.
Step S47 according to the density information of the stub annual ring, is inferred to corresponding directional information.
Above-mentioned each step is described in detail below.
Step S41 is performed, obtains stub annual ring image.In the present embodiment, the mode for obtaining stub annual ring image can be with
There are many, such as:One or more stub annual ring image is selected in the stub annual ring image that can have been deposited from photo library, also may be used
It, can be with to be that the stub annual ring of the direct floor of camera carried using mobile terminal obtains the stub annual ring image of intake
By preview stub annual ring under the preview mode to the camera in mobile terminal and by stub annual ring preview image intercept and
Obtain stub annual ring image.
Step S43 is performed, image procossing is carried out to the stub annual ring image.In step S43, by the tree
Stake annual ring image carries out image procossing, and the analysis of annual rings and direction that can be convenient for subsequent step are inferred.The image procossing operation can be into
One step is divided into the flow diagram of refinement step as shown in Figure 5.As shown in figure 5, the image procossing operation includes:Step
S431 carries out gray proces to the stub annual ring image.Stub annual ring image progress gray proces can to scheme
As being more prone to processed and calculating, by taking OpenCV (Open Source Computer Vision Library) as an example, because
Color image is stored in the form of 83 passages among matrix in OpenCV, i.e., each pixel saves as 0 to 255
Between 3 integers, correspond to R respectively, tri- kinds of colors of G, B, after gray proces are carried out, each pixel can save as 0 to 255
Between an integer, image then becomes 8 single pass images.Step S433, to the stub annual ring after gray proces
Image is smoothed.Specifically, (also referred to as Fuzzy Processing), more commonly used smoothing processing are smoothed to image
Medium filtering or gaussian filtering may be employed in method, and in contrast, compared to gaussian filtering, the speed of medium filtering filtering is opposite
Faster.Step S435 carries out thresholding processing to the stub annual ring image after smoothing processing.In order to distinguish the stub
The deeper region of color after smoothing processing is distinguished and carries out thresholding processing by the annual ring in annual ring image.It can be with
A threshold value is first preset, for example, the pixel placement that will be above the threshold value is 255, and the pixel placement that will be less than the threshold value is 0, this
Sample has reformed into " two-value " image by the processed image of thresholding.Simple operations more than, we are only needed to figure
The pixel of black is detected the annual ring that can be found out in image as in, and this method has easy to operate and operation speed
Spend the advantages that fast.
Step S45 analyzes the distribution of stub annual ring in the stub annual ring image, obtains the stub annual ring
Density information.In the present embodiment, in step S43, image procossing has been carried out to the stub annual ring image so that described
Annual ring is respectively enclosed in stub annual ring image can be easier to be identified, in this way, being advantageous for being set in the stub annual ring image
Stake annual ring carries out distributional analysis.In this step S45, the density degree of stub annual ring can be by measuring arbitrary neighborhood two successively
The spacing of a stub annual ring obtains.
Step S47 is performed, according to the density information of the stub annual ring, is inferred to corresponding directional information.In step S47
In, according to the density information of the stub annual ring, it is inferred to corresponding directional information, two kinds of forms can be used.The first form,
The density information of the stub annual ring is obtained, from the density information, finds out most fine and closely woven position in the stub annual ring, for
The direction that the most fine and closely woven position is drawn is i.e. as the first reference direction.Specifically, from the density information, the tree is found out
Most fine and closely woven position in stake annual ring, including:The annual ring of most inner lane in the stub annual ring is oriented, it will be in the most inner lane annual ring
Annual ring center of the heart as the stub annual ring;Using centered on the annual ring center and to the radial line of external radiation as scan line around
The stub year wheel scan, obtains the radial line set of the corresponding stub annual ring in all directions;And from the radial line
That shortest radial line corresponding to most fine and closely woven position is chosen in set, the shortest radial line is i.e. as the first reference direction.
Second of form obtains the density information of the stub annual ring, from the density information, finds out most dilute in the stub annual ring
Part of rarefaction position, the direction drawn for the most sparse position are used as the second reference direction.Specifically, from the density information
In, most sparse position in the stub annual ring is found out, including:The annual ring of most inner lane in the stub annual ring is oriented, by described in
Annual ring center of the most center of inner lane annual ring as the stub annual ring;Centered on the annual ring center and to the footpath of external radiation
Line, around the stub year wheel scan, obtains the radial line set of the corresponding stub annual ring in all directions as scan line;
And that the longest radial line for corresponding to most sparse position is chosen from the radial line set, which makees
For the second reference direction.
From the foregoing, it will be observed that for the density information of the stub annual ring, the most fine and closely woven position of the density information no matter is found out
Still most sparse position, can be inferred to reference direction accordingly.It should be noted that due to the difference in the Southern Hemisphere and the Northern Hemisphere, institute
With the reference direction corresponding to most fine and closely woven position and most sparse position is opposite.Such as:For the Northern Hemisphere, by the density
What the most fine and closely woven position of information was drawn is oriented to the positive north, and due south is oriented to by what the most sparse position of the density information was drawn
Side;For the Southern Hemisphere, Due South is oriented to by what the most fine and closely woven position of the density information was drawn, by the density information most
What sparse position was drawn is oriented to the positive north.
It should be noted that reduce the deviation that the particularity of indivedual stub annual ring images is inferred for direction, it is preferable that
In practical applications, (such as multiple stub annual rings of same seeds can be shot by choosing different multiple stub annual ring images
Multiple stub annual ring images of image or different tree species etc.) to obtain different directional informations respectively, to these directional informations
It carries out statistical analysis and reduces the error that final direction is inferred.
For the walking direction system and method applied to mobile terminal of the present invention, a certain reality now applied with it
It is illustrated exemplified by.In this example, it is assumed that user is in the wild, mobile phone is carried, which has camera.
In advance, mobile phone setting in, in advance on the Northern Hemisphere with select the Northern Hemisphere in the Southern Hemisphere;By user stub is shot using mobile phone camera
Annual ring and obtain stub annual ring image;Image procossing is carried out to the stub annual ring image, to identify the stub annual ring
Stub annual ring in image;Stub annual ring in the stub annual ring image is analyzed, obtains dredging for the stub annual ring
Confidential information;From the density information, most fine and closely woven position in the stub annual ring is found out, is inferred to for the most fine and closely woven position
The direction of extraction is i.e. as the positive north;The result combination stub annual ring image that direction is inferred is given on the display screen of mobile phone
It shows (as shown in Figure 6).In this way, user can just obtain being correctly oriented direction.
In conclusion the walking direction system and method provided by the invention applied to mobile terminal, by stub year
Being analyzed and obtaining the density information of the stub annual ring for the stub annual ring in image is taken turns, and then by the stub year
The density information of wheel, is inferred to corresponding directional information, can be indicated for user and be correctly oriented direction relatively, solve the prior art
In lead to problems such as not can indicate that due to mobile terminal does not configure corresponding direction instrument and be correctly oriented, improve user
Experience.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.It is any ripe
Know the personage of this technology all can carry out modifications and changes under the spirit and scope without prejudice to the present invention to above-described embodiment.Cause
This, those of ordinary skill in the art is complete without departing from disclosed spirit and institute under technological thought such as
Into all equivalent modifications or change, should by the present invention claim be covered.