Camera unit based assisted positioning method
By acquiring images of the positioning device from the mobile device and establishing a rectangular frame to calculate the center point, and combining the focal length of the camera unit and the image ratio, the problem of mobile devices having difficulty obtaining vertical angles and reduced accuracy in acoustic positioning is solved, thus improving positioning accuracy.
Patent Information
- Application Number
- CN202111458089.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2041-12-02
AI Technical Summary
Existing mobile devices have difficulty obtaining the relative angle between the positioning device and the perpendicular direction of the line connecting the two receivers/transmitters in acoustic positioning, and the positioning accuracy decreases when the device deviates from the direction of the positioning device.
By acquiring images of the positioning device and building a model, the camera unit captures images of the positioning device, a rectangular frame is built and the center point is calculated. Combining the focal length of the camera unit and the image scale, the relative angle and distance between the mobile device and the positioning device are calculated.
It makes up for the problems of insufficient positioning information and decreased accuracy caused by environmental and usage conditions in acoustic positioning. In particular, it solves the problem of difficulty in obtaining the relative angle of the positioning device in the left and right directions when holding the mobile phone, and improves the accuracy of ranging and angle measurement.
Smart Images

Figure CN116224211B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to an auxiliary positioning method based on a camera unit and belongs to the technical field of positioning. BACKGROUND
[0002] The Internet of Things (IOT) refers to real-time collection of sound, light, heat, electricity, mechanics, chemistry, biology, position and other information of objects or processes that need to be monitored, connected and interacted through various devices and technologies such as information sensors, radio frequency identification technology, global positioning systems, infrared sensors and laser scanners, and the information is accessed through various networks to realize the ubiquitous connection of objects and people and intelligent perception, identification and management of objects and processes. The Internet of Things is an information carrier based on the Internet and a traditional telecommunication network, which enables all normal physical objects that can be independently addressed to form an interconnected network.
[0003] In the current mobile device acoustic positioning method, for a mobile phone with a large size, the microphones / speakers of the mobile phone as the receiving end / transmitting end are usually configured as two, and when the sum of the number of the receiving end / transmitting end and the transmitting end / receiving end on another device is three, the angle of the positioning device relative to the mobile phone is affected by the state of the line connecting the two receiving end / transmitting end, and the relative angle is described based on the line, for example: when the mobile phone is placed horizontally and the microphones are arranged at both ends, the angle of the positioning device relative to the mobile phone is the left-right position angle, and the angle position in the vertical direction is difficult to judge. Similarly, when the mobile phone is in a vertical state, the relative angle is judged based on the angle up and down in the vertical direction of the mobile phone, and the left-right position of the positioning device relative to the mobile phone is difficult to identify. In particular, since acoustic positioning has a certain directivity, when the microphone of the mobile phone deviates greatly from the transmitting end of the positioning device, the ranging accuracy is also affected. SUMMARY
[0004] The purpose of the present application is to provide an auxiliary positioning method based on a camera unit, which not only solves the problem that the mobile device is difficult to obtain the relative angle of the positioning device relative to the vertical direction of the line connecting the two receiving end / transmitting end in the prior art, but also solves the problem of decline in positioning accuracy after the receiving end / transmitting end of the mobile device deviates from the direction of the positioning device.
[0005] To achieve the above purpose, the technical scheme adopted by the present application is: an auxiliary positioning method based on a camera unit, characterized in that the method comprises the following steps:
[0006] Collecting pictures and sizes of the positioning device and inputting them into a mobile device processor to establish a positioning device model;
[0007] When the angle between the line connecting the two receiving ends and the horizontal plane is not greater than θ, the positioning device is activated to send the sound wave positioning signal.
[0008] The mobile device is activated, the two receiving ends configured receive the direct positioning signal, the time difference between sending and receiving the positioning signal is obtained, the distance L and the relative angle α between the positioning device and the mobile device are obtained and outputted.
[0009] Alternatively, when the angle between the line connecting the two transmitting ends and the horizontal plane is not greater than θ, the mobile device is activated to send the sound wave positioning signal.
[0010] The positioning device is activated to receive the direct positioning signal, the time difference between sending and receiving the positioning signal is obtained, the distance L and the relative angle α between the positioning device and the mobile device are obtained and outputted.
[0011] When it is detected that the angle between the line connecting the two receiving / transmitting ends and the horizontal plane is greater than θ, the sound wave positioning is continued, L' and α' are outputted, and the camera unit configured in the mobile device is activated to take a picture to obtain an image with the positioning device.
[0012] A coordinate system with an image corner as the origin and an image unit pixel as the unit value is established, the image center coordinates are (x, y), the positioning device in the image is found according to the model of the positioning device, four vertices of a complete face of the positioning device in the image are taken, a rectangle parallel to the four edges of the image is made with the four vertices, the pixel length of any side of the rectangle is w, and the center point coordinates of the rectangle are (a, b).
[0013] The relative angle β is outputted.
[0014] The actual edge length W of the rectangle long side corresponding to the positioning device stored in the mobile device is called, the display interface width is known as M, the image pixel width is known as N, the actual length w' in the positioning device image is outputted as Mw / N, the distance d between the mobile device and the positioning device is outputted as d=Mw / NfW, wherein f is the focal length of the camera unit.
[0015] The further improved scheme in the above technical solution is as follows:
[0016] 1. In the above scheme, θ=0-90°.
[0017] 2. In the above scheme, the angle sensor configured in the mobile device is called to read θ.
[0018] 3. In the above scheme, the long side of the rectangle is selected as the pixel length w.
[0019] 4. In the above scheme, the f value is obtained by calling the camera unit parameters in the mobile device.
[0020] 5. In the above scheme, a known size reference object is photographed by the camera unit in multiple positions, and the distance between the two is measured each time the photograph is taken, the size of the reference object in the output image is output, and multiple sets of focal length data are obtained, and the average value is imported into the mobile device as the focal length f of the camera unit.
[0021] 6. In the above scheme, the acoustic positioning signal is an ultrasonic positioning signal.
[0022] 7. In the above scheme, the distance L / L' between the positioning device and the mobile device is the distance from any receiving end / transmitting end to the positioning device.
[0023] 8. In the above scheme, the distance L / L' between the positioning device and the mobile device is the distance from the midpoint of the line connecting the two receiving ends / transmitting ends to the positioning device.
[0024] 9. In the above scheme, |L'-d|=delta, when delta is greater than the length of the mobile device, the mobile device is rotated until the value of delta is not greater than the length of the mobile device.
[0025] Due to the use of the above technical scheme, the present application has the following advantages compared with the prior art:
[0026] 1. The auxiliary positioning method based on a camera unit, by calling the camera unit configured in the mobile device, an image with a positioning device is obtained, a positioning device model is found by pre-inputting the positioning device model, four vertices of any complete face are used to establish a rectangular frame, and the center point of the rectangle is found as the virtual center of the positioning device, the angle formed by connecting the image center and the virtual center with the horizontal direction of the image is considered as the relative angle between the mobile device and the positioning device, similarly, the pixel width of the long side of the rectangle is converted to the actual width using the ratio of the image width to the display interface width, and the distance between the mobile device and the positioning device is calculated using the focal length of the camera unit, which compensates for the problem of insufficient positioning information and reduced positioning accuracy caused by environmental factors, use state and other factors in acoustic positioning interaction, and especially compensates for the defect that it is difficult to obtain the relative angle in the left and right directions of the positioning device when the mobile phone is held.
[0027] 2. The auxiliary positioning method based on a camera unit, the focal length of the camera unit can be directly called from the mobile device, and when it cannot be called, the distance between the mobile device and the reference object can be obtained in advance using distance measurement, multiple sets of focal length values are calculated, and the average value is taken as the focal length f of the camera unit for subsequent positioning calculation, which is very convenient.
[0028] 3. The auxiliary positioning method based on the camera unit directly identifies the complete face of the positioning device, and the following problems may exist: since the angle at which the positioning device is photographed is random, when the completely facing camera cannot be identified, the side length of the positioning device will be compressed and distorted, cannot be used as a reference length, and cannot be calculated and used. Similarly, the center point will also deviate from the center of the positioning device, resulting in serious deviation of distance measurement and angle measurement. According to the four vertices, the four edges parallel to the image can be established to correct the deviation caused by the viewing angle, and the distance measurement and angle measurement accuracy can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0029] FIG. 1 is a schematic diagram of an image positioning model in an auxiliary positioning method based on a camera unit according to the present application; Fig. 1 FIG. 1 is a schematic diagram of an image positioning model in an auxiliary positioning method based on a camera unit according to the present application;
[0030] FIG. 2 is an image positioning scene diagram in an auxiliary positioning method based on a camera unit according to the present application; Fig. 2 FIG. 2 is an image positioning scene diagram in an auxiliary positioning method based on a camera unit according to the present application; DETAILED DESCRIPTION
[0031] Embodiment 1: An auxiliary positioning method based on a camera unit, referring to FIGS. 1 and 2, the method comprises the following steps: Figs. 1-2
[0032] S1: Collect the pictures and sizes of a plurality of positioning devices that will interact with the mobile device in the Internet of Things application scene, input into the mobile device, use a neural network model for training, establish a model of each positioning device and store it;
[0033] Here, the mobile device is a smart phone, and a microphone unit is arranged at the top and the bottom as a receiving end, respectively, and a loudspeaker unit is installed on the positioning device as a transmitting end.
[0034] S2: Use the angle sensor (gyroscope) in the smart phone to detect the tilt angle of the mobile phone in real time, output the tilt angle as the included angle between the line connecting the two receiving ends and the horizontal plane, when the included angle is not greater than θ, activate the positioning device, the transmitting end sends out the sound wave positioning signal, activate the mobile device, the receiving end receives the direct positioning signal, output the distance L between the positioning device and the mobile device and the relative angle α;
[0035] Here, the sound wave positioning signal is an ultrasonic positioning signal, which carries the device identifier and the sending time, after being received by the receiving end, L 1 / 2 = (receiving time - sending time) * ultrasonic wave propagation speed in medium, here, the two receiving ends are L1 and L2, respectively, L is the midpoint of the line connecting the two receiving ends, the shortest distance D between the two receiving ends is known, and any receiving end and the line connecting the transmitting end and the two receiving ends can be solved as the relative angle α by using the trigonometric function formula.
[0036] S3: When the angle sensor detects that the angle between the two receiving end connections and the horizontal plane is greater than θ, maintain the sound wave positioning, output L', a', and at the same time, activate the camera unit configured in the mobile device to take a picture with the positioning device. Here, θ is 0°, that is, as soon as the mobile phone is out of the horizontal state, the camera unit is enabled to assist in positioning.
[0037] S4: Establish a coordinate system with the upper left corner of the image as the origin. In the image, the unit pixel of the image is the unit value, and the coordinates of the image center are (x, y). According to the positioning device model, find the positioning device in the image, take the four vertices of a complete face of the positioning device in the image, and make a rectangle parallel to the four edges of the image. The pixel length of the long side of the rectangle is w, and the center point coordinates of the rectangle are (a, b);
[0038] Output the relative angle β,
[0039] S5: Call the actual edge length W of the positioning device corresponding rectangle stored in the mobile device, and known display interface width M and image pixel width N. Output the actual length w' of the long side of the rectangle in the positioning device image, w' = Mw / N. Output the distance d between the mobile device and the positioning device, d = Mw / NfW, where f is the focal length of the camera unit, which is obtained by directly calling the camera unit data of the mobile device;
[0040] Here, L', a', β and d are finally output to the display interface for the user to view.
[0041] Embodiment 2: A camera unit-based auxiliary positioning method, referring to the accompanying Figs. 1-2 , the method comprises the following steps:
[0042] S1: Collect the pictures and sizes of multiple positioning devices that will interact with the mobile device in the Internet of Things application scenario, input into the mobile device, and use a neural network model for training to establish a model of each positioning device and store it;
[0043] Here, the mobile device is a smart phone, and a speaker unit is configured at the top and the bottom as the transmitting end, respectively. The positioning device is installed with a microphone unit as the receiving end.
[0044] S2: Use the angle sensor (gyroscope) in the smart phone to detect the tilt angle of the mobile phone in real time, output the tilt angle as the angle between the two transmitting end connections and the horizontal plane. When the angle is not greater than θ, activate the mobile device, and the transmitting end respectively sends a sound wave positioning signal. Activate the positioning device, and the receiving end receives two direct positioning signals, and output the distance L between the positioning device and the mobile device and the relative angle a;
[0045] Here, the acoustic positioning signal is an ultrasonic positioning signal, which carries the device identifier and the sending time respectively, and the receiving end receives the signal. 1 / 2 =(receiving time-sending time)*ultrasonic wave propagation speed in medium, here, the two transmitting ends are L1 and L2 respectively, L takes L1 or L2, and the shortest distance D between the two transmitting ends is known, so the angle between the line connecting any receiving end and the transmitting end and the line connecting the two transmitting ends can be solved as the relative angle α by using the trigonometric function formula.
[0046] S3: When the angle sensor detects that the angle between the line connecting the two transmitting ends and the horizontal plane is greater than θ, the acoustic positioning is maintained, L' and α' are output, and at the same time, the camera unit configured in the mobile device is activated to take an image with the positioning device, here, θ takes 0°, that is, the camera unit is used to assist positioning as soon as the mobile device is out of the horizontal state.
[0047] S4: A coordinate system with the top left corner of the image as the origin is established, and in the image, the unit pixel of the image is the unit value, the coordinates of the image center are (x, y), the positioning device in the image is found according to the model of the positioning device, and the four vertices of a complete face of the positioning device in the image are taken, and a rectangle parallel to the four edges of the image is made with the four vertices, the pixel length of the long side of the rectangle is w, and the center point coordinates of the rectangle are (a, b);
[0048] The relative angle β is output,
[0049] S5: The actual edge length W of the rectangular long side corresponding to the positioning device stored in the mobile device is called, the display interface width M is known, the image pixel width N is known, the actual length w' of the rectangular long side in the positioning device image is output, w'=Mw / N, the distance d between the mobile device and the positioning device is output, d=Mw / NfW, where f is the focal length of the camera unit, the focal length f is obtained by using the camera unit to take a reference object of a known size at multiple positions, measuring the distance between the two at each time of taking, outputting the size of the reference object in the image, obtaining multiple sets of focal length data, and importing the average value into the mobile device as the focal length f of the camera unit;
[0050] Here, L', α', β and d are finally output to the display interface for the user to view;
[0051] Import |L'-d|=δ, when δ is greater than the length of the mobile device, rotate the mobile device until the value of δ is not greater than the length of the mobile device.
[0052] Adopting the above scheme, the image with the positioning device is obtained by calling the camera unit configured in the mobile device, the position of the positioning device in the image is found through the pre-input positioning device model, the center point of the rectangle is found as the virtual center of the positioning device by using four vertices of any complete face to establish a rectangular frame, the angle formed between the image center and the virtual center and the horizontal direction of the image is regarded as the relative angle between the mobile device and the positioning device, similarly, the pixel width of the long side of the rectangle is converted into the actual width by using the ratio of the image width and the display interface width, the distance between the mobile device and the positioning device is obtained by using the focal length of the camera unit, the problem of insufficient positioning information and decreased positioning accuracy of the acoustic positioning interaction due to factors such as environment and use state is solved, and in particular, the defect that it is difficult to obtain the relative angle in the left-right direction of the positioning device when the mobile phone is held and used is solved.
[0053] In addition, the focal length of the camera unit can be directly called from the motion device, and when the focal length cannot be called, the distance between the mobile device and the reference object is obtained by using ranging in advance, a plurality of focal length values are calculated, and the average value is taken as the focal length f of the camera unit to facilitate subsequent positioning calculation, which is very convenient.
[0054] In addition, the following problems exist in directly identifying the complete face of the positioning device: since the angle at which the positioning device is shot is random, when the face directly facing the camera cannot be identified, the side length of the positioning device will be compressed and distorted, and cannot be used as a reference length for calculation and use, similarly, the center point will also deviate from the center of the positioning device, resulting in serious deviation in ranging and angle measurement, and the deviation caused by the viewing angle can be corrected by establishing four edges parallel to the four edges of the image according to the vertices, and the ranging and angle measurement accuracy is improved.
[0055] The above embodiments are only for illustrating the technical concept and characteristics of the present application, the purpose is to enable those skilled in the art to understand the content of the present application and implement it, and cannot limit the protection scope of the present application. Any equivalent changes or modifications made according to the spirit and essence of the present application shall be covered within the protection scope of the present application.
Claims
1. A camera unit based assisted positioning method, characterized in that, The method comprises the following steps: Collecting the picture and size of the positioning device and inputting them into the processor of the mobile device to establish a model of the positioning device; When the angle between the line connecting the two receiving ends and the horizontal plane is not greater than θ, the positioning device is activated to send the sound wave positioning signal; The mobile device is activated, the two receiving ends configured receive the direct positioning signal, the time difference between sending and receiving the positioning signal is obtained, the distance L and the relative angle α between the positioning device and the mobile device are obtained and outputted; Or, when the angle between the line connecting the two transmitting ends and the horizontal plane is not greater than θ, the mobile device is activated to send the sound wave positioning signal; The positioning device is activated to receive the direct positioning signal, the time difference between sending and receiving the positioning signal is obtained, the distance L and the relative angle α between the positioning device and the mobile device are obtained and outputted; When it is detected that the angle between the line connecting the two receiving / transmitting ends and the horizontal plane is greater than θ, the sound wave positioning is continued, L' and α' are outputted, and the camera unit configured in the mobile device is activated to take a picture of the image with the positioning device; A coordinate system with an angle of the image as the origin and the unit pixel of the image as the unit value is established, the center coordinate of the image is (x, y), the positioning device in the image is found according to the model of the positioning device, four vertices of a complete face of the positioning device in the image are taken, and a rectangle parallel to the four edges of the image is made with the four vertices, the pixel length of any edge of the rectangle is w, and the center coordinate of the rectangle is (a, b); output relative angle β, The actual length w' of the positioning device in the image is outputted by calling the actual length W of the long side of the rectangle corresponding to the positioning device stored in the mobile device, the width of the display interface is M, the pixel width of the image is N, d is the distance between the mobile device and the positioning device, and d=Mw / NfW, wherein f is the focal length of the camera unit.
2. The camera unit based assisted positioning method according to claim 1, wherein, The θ is 0-90°.
3. The camera unit based assisted positioning method of claim 2, wherein, The angle sensor configured in the mobile device is called to read θ.
4. The camera unit based assisted positioning method of claim 1, wherein, The long side of the rectangle is selected as the pixel length w.
5. The camera unit based assisted positioning method of claim 1, wherein, The f value is obtained by calling the parameters of the camera unit in the mobile device.
6. The camera unit based assisted positioning method of claim 1, wherein, A reference object with a known size is taken by the camera unit at multiple positions, the distance between the camera unit and the reference object is measured each time, the size of the reference object in the image is outputted, multiple sets of focal length data are obtained, the average value is taken and is imported into the mobile device as the focal length f of the camera unit.
7. The camera unit based assisted positioning method of claim 1, wherein, The sound wave positioning signal is an ultrasonic positioning signal.
8. The camera unit based assisted positioning method of claim 1, wherein, The distance L / L' between the positioning device and the mobile device is the distance from any receiving / transmitting end to the positioning device.
9. The camera unit based assisted positioning method of claim 1, wherein, The distance L / L' between the positioning device and the mobile device is the distance from the midpoint of the line connecting the two receiving / transmitting ends to the positioning device.
10. The camera unit based assisted positioning method of claim 1, wherein, When |L'-d|=δ, if δ is greater than the length of the mobile device, the mobile device is rotated until the value of δ is not greater than the length of the mobile device.
Citation Information
Patent Citations
Multi-modal indoor ranging and positioning method based on mobile phone camera and sensor
CN109059895A
Image acquisition control method and device and acquisition terminal
CN110505399A