CN110044309B - Measuring method and device - Google Patents

Measuring method and device Download PDF

Info

Publication number
CN110044309B
CN110044309B CN201910277119.6A CN201910277119A CN110044309B CN 110044309 B CN110044309 B CN 110044309B CN 201910277119 A CN201910277119 A CN 201910277119A CN 110044309 B CN110044309 B CN 110044309B
Authority
CN
China
Prior art keywords
measurement
edge
measured
terminal
application
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910277119.6A
Other languages
Chinese (zh)
Other versions
CN110044309A (en
Inventor
俞亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin ByteDance Technology Co Ltd
Original Assignee
Tianjin ByteDance Technology Co Ltd
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 Tianjin ByteDance Technology Co Ltd filed Critical Tianjin ByteDance Technology Co Ltd
Priority to CN201910277119.6A priority Critical patent/CN110044309B/en
Publication of CN110044309A publication Critical patent/CN110044309A/en
Application granted granted Critical
Publication of CN110044309B publication Critical patent/CN110044309B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
    • G01B21/02Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring length, width, or thickness
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
    • G01B21/16Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring distance of clearance between spaced objects
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
    • G01B21/28Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring areas

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a measuring method and a measuring device, wherein the method comprises the following steps: when a measurement application is opened, calling a camera application and displaying a measurement indication interface in the measurement application, wherein the measurement indication interface comprises a measurement guide identifier and a measurement picture acquired by the camera application; prompting a user to control the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture, and acquiring an acceleration vector acquired by the terminal in the moving process; and after a stopping instruction is received, generating the measurement data of the object to be measured according to the acceleration vector. By the measuring method and the measuring device, the object measurement can be carried out by a user according to the application program on the terminal equipment, so that the measurement is simpler, the efficiency is high, the practicability is high, and the requirements of the user are better met.

Description

Measuring method and device
Technical Field
The invention relates to the technical field of terminal equipment, in particular to a measuring method and a measuring device.
Background
In a new era that smart phones are more and more generally promoted, application programs in terminals are gradually popularized, for example, mobile phone applets have the characteristics of no need of downloading, accessibility and walk-after, are increasingly applied by people, and gradually enter various industries.
In the related art, along with popularization of application programs, requirements of users on types and functions of the application programs are continuously improved, and the requirements of holding the users have important significance on market share of manufacturers.
Disclosure of Invention
The present application is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first objective of the present application is to provide a measurement method, which enables the distance and area of an object to be measured by directly opening an application program of a terminal device, thereby better meeting the requirements of users.
A second object of the present application is to propose a measuring device.
A third object of the present application is to propose a tangible computer readable storage medium.
A fourth object of the present application is to provide an electronic device.
To achieve the above object, an embodiment of a first aspect of the present application provides a measurement method, including: when a measurement application is opened, calling a camera application and displaying a measurement indication interface in the measurement application, wherein the measurement indication interface comprises a measurement guide identifier and a measurement picture acquired by the camera application; prompting a user to control the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture, and acquiring an acceleration vector acquired by the terminal in the moving process; and after a stopping instruction is received, generating the measurement data of the object to be measured according to the acceleration vector.
According to the measuring method, a user opens a measuring application, firstly, a camera application is called, a measuring indication interface is displayed in the measuring application, the measuring indication interface comprises a measuring guide identifier and a measuring picture acquired by the camera application, then the user is prompted to control the terminal to move along the outer edge of an object to be measured according to the measuring guide identifier and the measuring picture, and an acceleration vector acquired by the terminal in the moving process is acquired; and finally, after the application program receives a stop instruction, generating the measurement data of the object to be measured according to the acceleration vector. Therefore, the object measurement is completed according to the requirements of the user, and the method is efficient, convenient and easy to operate.
To achieve the above object, a second embodiment of the present application provides a measuring apparatus, including: the device comprises a calling module, a measurement module and a display module, wherein the calling module is used for calling a camera application and displaying a measurement indication interface in the measurement application when the measurement application is opened, and the measurement indication interface comprises a measurement guide identifier and a measurement picture acquired by the camera application; the prompting module is used for prompting a user to control the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture; the acquisition module is used for acquiring the acceleration vector acquired by the terminal in the moving process; and the generating module is used for generating the measurement data of the object to be measured according to the acceleration vector after receiving the stop instruction.
The measuring device of the embodiment of the application calls the camera application during measurement application through the calling module, and displays a measurement indication interface in the measurement application, wherein the measurement indication interface comprises a measurement guide identifier and a measurement picture acquired by the camera application; prompting a user to control the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture through a prompting module; acquiring an acceleration vector acquired by the terminal in the moving process through an acquisition module; and after receiving a stopping instruction, generating the measurement data of the object to be measured according to the acceleration vector through a generating module. Therefore, the object measurement is completed according to the requirements of the user, and the method is efficient, convenient and easy to operate.
To achieve the above object, a third aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing the measurement method as described in the above embodiments. .
In order to achieve the above object, a fourth aspect of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the electronic device implements the measurement method as described in the above embodiment.
Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flow chart of a measurement method according to an embodiment of the present disclosure;
FIG. 2 is a schematic view of a measurement indication interface of the present application;
FIG. 3 is a schematic diagram illustrating an embodiment of the present application for measuring the length of an object;
FIG. 4 is a flowchart illustrating an embodiment of the present disclosure for measuring an area of an object;
FIG. 5 is a schematic diagram of measuring an area of an object according to another embodiment of the present application;
FIG. 6 is a schematic diagram of measuring an area of an object according to another embodiment of the present application;
FIG. 7 is a flow chart of measuring the area of an object according to yet another embodiment of the present application;
FIG. 8 is a schematic structural diagram of a measurement device according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a computer-readable storage medium according to one embodiment of the invention;
FIG. 10 is a block diagram of an exemplary computer electronic device implementing embodiments of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The measurement method and apparatus of the embodiments of the present application are described below with reference to the drawings. The embodiment of the invention realizes an application program for measuring the distance and the area, thereby meeting the requirements of users on measurement and distance measurement, making up the blank that no measurement and distance measurement service program exists in the prior art, and having positive significance for improving the market share of manufacturers.
Fig. 1 is a schematic flow chart of a measurement method according to an embodiment of the present invention.
As shown in fig. 1, the measurement method includes:
step 101, when a user opens a measurement application, calling a camera application and displaying a measurement indication interface in the measurement application, wherein the measurement indication interface comprises a measurement guide identifier and a measurement picture acquired by the camera application.
Specifically, when a user opens a measurement application, the camera application is called to display a measurement indication interface in the measurement interface, wherein the measurement indication interface includes a measurement guide identifier and a measurement picture acquired by the camera application, the measurement picture is a picture actually acquired by the current camera application and is used for indicating whether the current position of the camera head can acquire the current object to be measured, and the measurement guide identifier is used for assisting the user in moving the terminal device, so that the operation difficulty can be reduced along the outer edge of the measurement object. As shown in fig. 2, the measurement guiding mark may be in any form such as a triangle, an animation, etc. besides the dot shown in fig. 2, which is not described herein again.
In addition, in the actual execution process, the calling modes of the camera application when the measurement application is opened are different, as a possible implementation mode, the camera application is automatically called once the measurement application is monitored to be opened, as another possible implementation mode, the camera application can be opened depending on the manual operation of a user after entering the measurement application, for example, a camera tag is set in a measurement interface, and when the tag is triggered by the user, the corresponding camera application is opened, so that the waste of resources caused by directly opening the camera application when the user just views the historical measurement record when the user opens the measurement application can be avoided.
And 102, prompting a user to control the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture, and acquiring an acceleration vector acquired by the terminal in the moving process.
And 103, after receiving the stop instruction, generating measurement data of the object to be measured according to the acceleration vector.
It is easily understood that in the embodiments of the present application, the measurement data of the object, such as the side length or the area of the object, this is because the acceleration vector of the outer edge of the object represents the coordinate information of the point on the outer edge of the object, etc., and therefore, the measurement data of the corresponding object can be calculated based on the coordinate information of the point, wherein, in order to ensure that the acceleration vector of the outer edge of the object is collected, the guide mark guides the terminal to collect along the outer edge of the object when collecting data based on the measurement in the measurement picture, at the moment, the displacement of the mobile terminal is calculated based on the acceleration vector collected by the acceleration sensor (gyroscope or special acceleration sensor) of the terminal in the collection process, so that the side length of the object can be calculated based on the displacement, and further, the area of the object and the like can be calculated based on the side length.
It is understood from the above description that the acquisition of the acceleration vector depends on the acquisition of the relevant sensor in the terminal, the terminal device is in a three-dimensional state during the moving process, and obviously depends on the acceleration vector in the horizontal direction of the object (for example, the data in the X-axis direction and the data in the Y-axis direction) when calculating the measurement data of the object to be measured, so that in order to ensure the accuracy of the acquisition and avoid the measurement error caused by the acceleration vector in the vertical direction, it is also required to ensure that the camera is positioned in the front alignment and parallel to the outer edge to be measured of the object to be measured during the moving process of the terminal by the user. In the actual implementation process, the camera in the user control terminal can be guided to be right opposite to and parallel to the outer edge in a voice or vibration mode and the like, and the object to be measured prompts a user that the mobile phone is not straightened and the like based on the voice or vibration mode. Of course, in an embodiment of the present application, the object to be measured may also compensate the data in the vertical direction based on a compensation algorithm of the acceleration data in the vertical direction, and in this embodiment, as long as an included angle between a plane where the camera of the terminal is located and the outer edge is within a certain error, the object to be measured may be compensated based on the compensation algorithm.
Further, after receiving a stop instruction, for example, a voice stop instruction, or after receiving a trigger operation of the user on the stop measurement control in the measurement reference, it indicates that the measurement of the object to be measured is finished, so as to generate the measurement data of the object to be measured according to the acceleration vector.
To sum up, according to the measurement method of the embodiment of the application, when a user opens a measurement application, a camera application is called and a measurement indication interface is displayed in the measurement application, wherein the measurement indication interface comprises a measurement guide identifier and a measurement picture acquired by the camera application; and prompting a user to control the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture, acquiring an acceleration vector acquired by the terminal in the moving process, and generating data of the object to be measured by the application program according to the acquired acceleration vector. Therefore, the object measuring device has the advantages that the object can be measured and applied, the requirement of a user for measuring the object at any time is met, the operation is simple, and the practicability is high.
Based on the above embodiment, in the actual measurement process, the measurement data of the object to be measured may include the measurement of the edge of the object, the measurement of the area of the object, and the like, and for more clearly explaining how to generate the measurement data in the above step 103, the area of the object to be measured and the length of the object are taken as examples respectively.
First, the measurement data is explained as an example of the object length, and the following is explained:
in this example, it can be understood that whether the measurement of one edge of the measurement object is finished is determined according to whether a relay instruction is received or not, where the relay instruction may be a relay voice instruction issued by a user, or may be issued by the user through triggering of a relay control preset in the measurement application.
Specifically, when a user controls the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture, the acceleration vector collected by the terminal in the moving process is collected, after a transfer instruction is received, the currently measured acceleration vector is packaged and stored as an edge data packet, the stored edge data packet corresponds to the measured acceleration vector of one edge, further, after one edge data packet is obtained, the measured acceleration vector is reset in a zero clearing mode, the next edge data packet is started to be collected, in order to enhance the use feeling, a measurement button can be preset so that the user can trigger the measurement entering the data packet by triggering the measurement button, the length of the corresponding edge of the object to be measured is calculated according to one or more edge data packets until a stop instruction is received, for example, coordinate points in each edge are constructed based on the acceleration vector data in the edge data packet, the corresponding changed side length is calculated based on the sum of the displacements of the coordinate points and the coordinate points, for example, the measurement duration of each side data packet can be obtained, and the length of the object to be measured is generated according to the measurement duration and the acceleration vector.
Assuming that the terminal using the above measurement is a mobile phone, first the camera is turned on by triggering the camera tag in the measurement application, a variable S is initialized for recording the measured edge data,meanwhile, a semi-transparent dot is displayed in the center of the measuring interface displayed in the screen as a measuring guide mark and a measuring button, and the dot is used for aiming at the outer edge of the measured object. As shown in fig. 3, the mobile phone is made parallel to the ground, so that the z-axis acceleration is a gravity acceleration of minus one unit, and the posture of the mobile phone during measurement is ensured to be that the back camera is vertically aligned with the ground. At the moment, if a user clicks a button for starting measurement, linear acceleration is obtained through a callback function, the displacement of the mobile phone can be calculated through calculation of an acceleration vector by a displacement formula, and the displacement is stored in a variable S as side data. For example: let x (t) be an edge data packet collected by the handset within time t, then time t0To t1The collected side data, namely the side length of the object, can be calculated through a displacement formula (1) and stored into a variable S.
Figure GDA0002981794630000041
Next, the measurement data is explained as an example of the object area, and the following is explained:
in this example, it can be understood that whether or not the measurement of one side of the measurement object is ended is still determined according to whether or not the relay instruction is received. And when a transfer instruction is received, packaging and storing the measured acceleration vector as an edge data packet, wherein the stored edge data packet corresponds to the measured acceleration vector of one edge, and the edge length of the corresponding edge of the object can be calculated based on the acceleration vector of the edge.
Considering that, when area calculation is performed, a calculable edge necessarily constitutes a complete object, for example, the number of edge lengths is greater than or equal to 3, or the sum of acceleration vectors corresponding to the edge lengths is O (the coordinates of the edge lengths of a closed object on the X axis and the Y axis can be balanced in positive and negative, and the sum is 0), in the embodiment, first, it is detected whether a plurality of edge packets satisfy a preset area calculation condition, if so, the acceleration vectors in each edge packet are calculated according to a preset algorithm, an edge vector of each edge corresponding to each edge packet is obtained, the edge vector corresponds to a two-dimensional coordinate corresponding to each edge, and the like, and further, the area of an object to be measured, which is composed of the plurality of edge vectors, is calculated according to the plurality of edge vectors corresponding to the plurality of edge packets and a preset calculation strategy.
It should be noted that, in different application scenarios, the preset calculation strategies are different, and examples are as follows:
example one:
as shown in fig. 4, calculating the area of the object to be measured, which is composed of a plurality of edge vectors according to a plurality of edge vectors corresponding to a plurality of edge packets and a preset calculation strategy, includes:
step 201, constructing a graph of the object to be measured according to the plurality of edge vectors, and determining a reference point in a plane where the graph is located, wherein the reference point is not a vertex in the graph. As described above, a plurality of edge vectors indicate the coordinates of each edge, and thus, a figure of the object to be measured can be constructed based on the edge vectors, wherein, for subsequent calculations, a reference point is determined in the plane in which the figure lies, wherein the reference point is not a vertex in the figure.
Step 202, constructing a triangle according to the vertex and the reference point of each edge of the plurality of edges in the graph to generate a plurality of triangles.
Step 203, determining the vector coordinates of the vertex of each triangle according to the edge vector of the side where the vertex of each triangle is located, and calculating the area vector of each triangle according to the vector coordinates.
And step 204, calculating the sum of the area vectors of the plurality of triangles to determine the area of the object to be measured.
Specifically, a plurality of triangles are constructed based on a combination of a reference point and two points in a graph, vector coordinates of vertexes of each triangle are determined according to side vectors of sides where the vertexes of each triangle are located, area vectors of each triangle are calculated according to the vector coordinates, and the area of an object to be measured is determined by calculating the sum of the area vectors of the plurality of triangles.
For example, as shown in fig. 5, when the graph of the object to be measured is a graph abcdc and the determined reference point is a point O in the plane of the graph, referring to fig. 5, triangles OAB, OBC, OCD, ODE, and OEA are generated based on the vertex and the reference point on each of the edges in the graph, and when the point O is used as the origin, the area of each triangle is calculated as follows according to the cross product calculation formula of the vector:
s _ OAB is 0.5 (a _ x _ B _ y-a _ y _ B _ x), [ (a _ x, a _ y) is coordinates of point a, (B _ x, B _ y) is coordinates of point B ];
s _ OBC is 0.5 (B _ x _ C _ y-B _ y _ C _ x), [ (B _ x, B _ y) is the coordinate of point B, (C _ x, C _ y) is the coordinate of point C ];
s _ OCD is 0.5 (C _ x _ D _ y-C _ y _ D _ x), [ (C _ x, C _ y) is the coordinate of point C, (D _ x, D _ y) is the coordinate of point D ];
s _ ODE ═ 0.5 (D _ x _ E _ y-D _ y _ E _ x), [ (D _ x, D _ y) are coordinates of D points, (E _ x, E _ y) are coordinates of E points ];
s _ OEA is 0.5 (E _ x a _ y-E _ y a _ x), [ (E _ x, E _ y) is the coordinate of point E, (a _ x, a _ y) is the coordinate of point a ];
and S is S _ OAB + S _ OBC + S _ OCD + S _ ODE + S _ OEA, the areas of the triangles are added through the cross product of the vectors to offset redundant repeated parts, and the sum is stored into a variable S. If the variable S is changed, the application program can perform area rendering again according to the variable S, so that a user can visually see the area enclosed by the movement of the terminal equipment, and the efficiency of measuring the area of an object by the user is improved.
Example two:
in this example, a graph of the object to be measured is constructed from a plurality of edge vectors, and a reference point is determined in a plane in which the graph lies, where the reference point is a vertex in the graph, for example, as shown in fig. 6, the graph abcd is divided into a plurality of triangles CAB, CED, CAE with C as the vertex, vector coordinates of each triangle vertex are determined based on the edge vector of the side where the vertex in each triangle is located, area vectors of each triangle are calculated from the vector coordinates, and the area of the object to be measured is determined by calculating the sum of the area vectors of the plurality of triangles.
In order to describe how the measurement application measures the area of the object more completely, the following description is made with reference to a specific example, where in the example, the side packet is recorded based on the variable List, the measurement area is recorded based on the variable S, the measurement application includes a relay button and a completion button for sending a relay command and a stop command, respectively, and the terminal device is a mobile phone.
In particular, as shown in figure 7,
firstly, opening a camera application through a camera tag of a measurement application, initializing a camera and variables List and S, wherein the List records an edge data packet, and the variable S records a measurement area. The user makes the camera on the back of the mobile phone parallel to the ground, so that the z-axis acceleration of the mobile phone is the gravity acceleration of minus one unit, and the posture of the mobile phone is that the camera on the back is vertically aligned with the ground.
At the moment, if a user clicks a button for starting measurement, a transfer button and a finish button are displayed, then the displacement of the mobile phone is calculated through a displacement formula, the displacement is set as length, the acceleration of the equipment on an X axis and an acceleration of the equipment on a Y axis are simultaneously obtained, the acceleration is set as X and Y, and when the user clicks the transfer button, the current length, X and Y are stored into an array List. While length is set to 0.
And when the user clicks the completion button, judging the length of the List, and if the length of the List is less than 3, prompting that the user cannot form a polygon and cannot calculate the area. If the number of the edges is larger than 3, the edges are defined to form a polygon, and the next step is carried out, otherwise, the user is prompted, the polygon cannot be formed, and the area cannot be calculated.
In summary, the measurement method of the embodiment of the application realizes the acquisition of the area and the side length of the object based on the acquisition of the acceleration vector of the outer edge of the object to be measured by the terminal, meets the requirement of a user on measuring the area or the length of the object at any time, and is simple to operate and strong in practicability.
In order to implement the above embodiments, the present application also provides a measurement apparatus.
Fig. 8 is a schematic structural diagram of a measurement apparatus according to an embodiment of the present application.
As shown in fig. 8, the measuring apparatus includes:
the calling module 11 is configured to call a camera application and display a measurement indication interface in the measurement application when the measurement application is opened, where the measurement indication interface includes a measurement guidance identifier and a measurement picture acquired by the camera application;
the prompting module 12 is used for prompting a user to control the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture;
the acquisition module 13 is used for acquiring an acceleration vector acquired by the terminal in the moving process;
and the generating module 14 is configured to generate measurement data of the object to be measured according to the acceleration vector after receiving the stop instruction.
Further, in an embodiment, the acquisition module 13 is specifically configured to:
in the moving process, if a transfer instruction is received, the measured acceleration vector is packaged and stored as an edge data packet, and the measured acceleration vector is reset in a zero clearing mode.
It should be noted that the foregoing explanation of the embodiment of the measurement method is also applicable to the measurement apparatus of the embodiment, and is not repeated herein.
According to the measuring device, when a user opens a measuring application, the user firstly calls the camera application and displays a measuring indication interface in the measuring application, then the user is prompted to control the terminal to move along the outer edge of an object to be measured according to the measuring guide identification and the measuring picture, the acceleration vector of the terminal in the moving process is collected, and after a stopping instruction is received, measuring data of the object to be measured are generated according to the acceleration vector. Therefore, the object measurement is completed according to the requirements of users, and the method is convenient and easy to operate.
In order to implement the above embodiments, the present invention also proposes a computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor, implement the measurement method as described in the foregoing embodiments. Fig. 9 is a schematic diagram illustrating a computer-readable storage medium according to an embodiment of the present invention. As shown in fig. 9, a computer-readable storage medium 300, in accordance with an embodiment of the present invention, has non-transitory computer-readable instructions 301 stored thereon. The non-transitory computer readable instructions 301, when executed by a processor, perform all or a portion of the steps of the measurement methods of the embodiments of the invention described above.
Referring now to FIG. 10, a block diagram of an electronic device 1000 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 10, the electronic device 1000 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 1001 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)1002 or a program loaded from a storage means 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the electronic apparatus 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
Generally, the following devices may be connected to the I/O interface 1005: input devices 1006 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 1007 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; a storage device 10010 including, for example, a magnetic tape, a hard disk, or the like; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. While fig. 10 illustrates an electronic device 1000 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 1009, or installed from the storage means 1008, or installed from the ROM 1002. The computer program, when executed by the processing device 1001, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (7)

1. A method of measurement, comprising the steps of:
when a measurement application is opened, calling a camera application and displaying a measurement indication interface in the measurement application, wherein the measurement indication interface comprises a measurement guide identifier and a measurement picture acquired by the camera application;
prompting a user to control the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture, and acquiring an acceleration vector acquired by the terminal in the moving process, wherein the prompting the user to control the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture, and the acquiring the acceleration vector acquired by the terminal in the moving process comprises: in the moving process, if a transfer instruction is received, packaging and storing the measured acceleration vector into an edge data packet, and resetting the measured acceleration vector;
when a plurality of side data packets are obtained, detecting whether the side data packets meet preset area calculation conditions, if so, calculating an acceleration vector in each side data packet according to a preset algorithm, and obtaining a side vector of each side corresponding to each side data packet;
and calculating the area of the object to be measured formed by the edge vectors according to the edge vectors corresponding to the edge data packets and a preset calculation strategy.
2. The method according to claim 1, wherein the calculating the area of the object to be measured, which is composed of the plurality of edge vectors, according to the plurality of edge vectors corresponding to the plurality of edge packets and a preset calculation strategy comprises:
constructing a graph of the object to be measured according to the edge vectors, and determining a reference point in a plane where the graph is located, wherein the reference point is not a vertex in the graph;
constructing a triangle according to the vertex of each edge of the plurality of edges in the graph and the reference point to generate a plurality of triangles;
determining the vector coordinates of the vertexes of each triangle according to the side vectors of the sides of the vertexes of each triangle, and calculating the area vector of each triangle according to the vector coordinates;
and calculating the sum of the area vectors of the plurality of triangles to determine the area of the object to be measured.
3. The method of claim 1, wherein when an edge packet is acquired, further comprising:
acquiring the measurement duration of the edge data packet;
and calculating and generating the length of the object to be measured according to the measuring time length and the acceleration vector.
4. The method according to claim 1, wherein when the prompting user controls the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture, and collects the acceleration vector collected by the terminal during the movement, the method further comprises:
and guiding a user to control a camera in the terminal to be opposite to and parallel to the outer edge.
5. A measuring device, comprising:
the device comprises a calling module, a measurement module and a display module, wherein the calling module is used for calling a camera application and displaying a measurement indication interface in the measurement application when the measurement application is opened, and the measurement indication interface comprises a measurement guide identifier and a measurement picture acquired by the camera application;
the prompting module is used for prompting a user to control the terminal to move along the outer edge of the object to be measured according to the measurement guide identifier and the measurement picture;
the acquisition module is used for acquiring the acceleration vector acquired by the terminal in the moving process, wherein the acquisition module is specifically used for: in the moving process, if a transfer instruction is received, packaging and storing the measured acceleration vector into an edge data packet, and resetting the measured acceleration vector;
the generating module is used for detecting whether the plurality of side data packets meet a preset area calculation condition or not when the plurality of side data packets are obtained, if so, calculating an acceleration vector in each side data packet according to a preset algorithm, and obtaining a side vector of each side corresponding to each side data packet; and calculating the area of the object to be measured formed by the edge vectors according to the edge vectors corresponding to the edge data packets and a preset calculation strategy.
6. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the measurement method according to any one of claims 1 to 4.
7. An electronic device, characterized in that it comprises a memory, a processor and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the measurement method according to any one of claims 1 to 4.
CN201910277119.6A 2019-04-08 2019-04-08 Measuring method and device Active CN110044309B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910277119.6A CN110044309B (en) 2019-04-08 2019-04-08 Measuring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910277119.6A CN110044309B (en) 2019-04-08 2019-04-08 Measuring method and device

Publications (2)

Publication Number Publication Date
CN110044309A CN110044309A (en) 2019-07-23
CN110044309B true CN110044309B (en) 2021-07-16

Family

ID=67276460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910277119.6A Active CN110044309B (en) 2019-04-08 2019-04-08 Measuring method and device

Country Status (1)

Country Link
CN (1) CN110044309B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113759381A (en) * 2021-09-09 2021-12-07 四川酷赛科技有限公司 Distance measuring method based on infrared laser and mobile terminal thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389799A (en) * 2013-07-24 2013-11-13 清华大学深圳研究生院 Method for tracking motion trail of fingertip
CN104461009A (en) * 2014-12-22 2015-03-25 百度在线网络技术(北京)有限公司 Object measurement method and intelligent device
CN104731373A (en) * 2013-12-18 2015-06-24 原相科技股份有限公司 Handheld pointing device and cursor locating method thereof
CN104949673A (en) * 2015-06-12 2015-09-30 北京邮电大学 Target locating method and device based on non-visual perception information
CN107894588A (en) * 2017-11-13 2018-04-10 北京小米移动软件有限公司 Mobile terminal, distance measurement method, dimension measurement method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6697052B2 (en) * 2001-11-02 2004-02-24 Lite-On Semiconductor Corp. Optical mouse chip with silicon retina structure

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389799A (en) * 2013-07-24 2013-11-13 清华大学深圳研究生院 Method for tracking motion trail of fingertip
CN104731373A (en) * 2013-12-18 2015-06-24 原相科技股份有限公司 Handheld pointing device and cursor locating method thereof
CN104461009A (en) * 2014-12-22 2015-03-25 百度在线网络技术(北京)有限公司 Object measurement method and intelligent device
CN104949673A (en) * 2015-06-12 2015-09-30 北京邮电大学 Target locating method and device based on non-visual perception information
CN107894588A (en) * 2017-11-13 2018-04-10 北京小米移动软件有限公司 Mobile terminal, distance measurement method, dimension measurement method and device

Also Published As

Publication number Publication date
CN110044309A (en) 2019-07-23

Similar Documents

Publication Publication Date Title
JP5851485B2 (en) Calibrating sensor readings on mobile devices
KR102410879B1 (en) Method and device for obtaining positioning information and medium
CN110967011A (en) Positioning method, device, equipment and storage medium
CN112797897A (en) Method and device for measuring geometric parameters of object and terminal
CN109445425B (en) Performance detection method and device of automatic driving system and storage medium
US10612918B2 (en) Mobile computing device and method for calculating a bending angle
CN111256676B (en) Mobile robot positioning method, device and computer readable storage medium
CN107656666A (en) Mobile terminal and rolling speed determine method
CN107608855B (en) Reminding method and mobile terminal
CN110044309B (en) Measuring method and device
CN109615360A (en) A kind of encoding of graphs methods of exhibiting and device
CN106092058B (en) Processing method, device and the terminal of information data
CN110850882A (en) Charging pile positioning method and device of sweeping robot
CN113610136A (en) Sensor data synchronization method and device, computer equipment and storage medium
CN113344999A (en) Depth detection method and device, electronic equipment and storage medium
CN110775056B (en) Vehicle driving method, device, terminal and medium based on radar detection
CN103454659A (en) Method and device for assisting in adjusting moving direction in navigation
CN116449396A (en) GNSS deception signal detection method, device, equipment and product
CN114740854A (en) Robot obstacle avoidance control method and device
CN111580920B (en) Application program interface display method and device and electronic equipment
CN114720932A (en) Battery management system signal sampling precision testing method and device, upper computer and storage medium
CN110769162B (en) Electronic equipment and focusing method
CN109375232B (en) Distance measuring method and device
EP3851874A1 (en) Method and device for acquiring augmented reality or virtual reality information
CN116883496A (en) Coordinate reconstruction method and device for traffic element, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant