Positioning method, terminal device, and storage medium
By acquiring the target state position coordinates of the second camera device and using grid lookup data to determine the target image coordinates of the first camera device, the problem of inaccurate positioning in the prior art is solved, achieving efficient target tracking and positioning, and improving the positioning success rate and the accuracy of user interaction control.
Patent Information
- Application Number
- CN202310743065.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-21
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2043-06-21
AI Technical Summary
Existing monitoring equipment cannot accurately locate the position of the tracking camera in the panoramic camera's view when the tracking camera rotates, resulting in inaccurate positioning.
By obtaining the target state position coordinates of the second camera device, and using grid lookup data to determine the target screen coordinates of the first camera device corresponding to the target state position coordinates, a rapid mapping and positioning from the second camera device to the first camera device is achieved.
This improves the success rate of target tracking and positioning, ensures accurate positioning of the target location on the second camera within the first camera's view, and enhances the accuracy of user interaction control.
Smart Images

Figure CN116797653B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of monitoring, and particularly relates to a positioning method, a terminal device and a storage medium. BACKGROUND
[0002] At present, the security consciousness has been deeply rooted in people's minds, and various monitoring devices based on a linkage system (for example, a gun-ball linkage system) have also been developed unprecedentedly. The existing linkage system can only form a global picture of a monitored area through a panoramic camera with a wide field of view, and control a tracking and positioning camera with a small field of view through linkage based on the global picture of the panoramic camera as a reference, so as to finally position a target. Therefore, the monitoring devices on the market can only select a target to be tracked and positioned in the picture of the panoramic camera, and then rotate the tracking and positioning camera based on the corresponding relationship between the panoramic picture of the panoramic camera and the position of the tracking and positioning camera, so as to track and position the target, that is, to realize further tracking and positioning of the target. However, this method cannot accurately position the position of the picture of the tracking and positioning camera in the picture of the panoramic camera when the tracking and positioning camera is rotated. SUMMARY
[0003] Therefore, the present application provides a positioning method, a terminal device and a storage medium to solve the problem that the position of the picture of the tracking and positioning camera cannot be accurately positioned in the picture of the panoramic camera when the tracking and positioning camera is rotated in the prior art.
[0004] A first aspect of the present application provides a positioning method, which comprises:
[0005] obtaining a target state position coordinate of a second camera device;
[0006] determining a target picture coordinate of the first camera device corresponding to the target state position coordinate according to the target state position coordinate and grid search data, wherein the grid search data is generated based on a mapping relationship between the picture coordinate of the first camera device and the state position coordinate of the second camera device.
[0007] A second aspect of the present application provides a terminal device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the positioning method according to the first aspect of the present application when executing the computer program.
[0008] A third aspect of the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the positioning method according to the first aspect of the present application when executed by a processor.
[0009] The first aspect of the embodiment of the present application provides the positioning method, target state position coordinates of the second camera device are acquired first, then target picture coordinates of the first camera device corresponding to the target state position coordinates are determined according to the target state position coordinates and the grid search data, wherein the grid search data is generated based on the mapping relationship between the picture coordinates of the first camera device and the state position coordinates of the second camera device. The positioning method provided by the embodiment of the present application can acquire the target state position coordinates of the second camera device at the first time when the target with specific details is found by rotating the second camera device, then the target picture coordinates corresponding to the first camera device are acquired according to the target state position coordinates, so that the tracking and positioning of the target are realized, and the success rate of positioning is improved.
[0010] It can be understood that the beneficial effects of the second aspect to the third aspect can be referred to the related description in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0012] Figure 1 is the first flowchart of the positioning method provided by the embodiment of the present application;
[0013] Figure 2 is the second flowchart of the positioning method provided by the embodiment of the present application;
[0014] Figure 3 is the third flowchart of the positioning method provided by the embodiment of the present application;
[0015] Figure 4 is the fourth flowchart of the positioning method provided by the embodiment of the present application;
[0016] Figure 5 is the schematic diagram of the first grid coordinate system provided by the embodiment of the present application;
[0017] Figure 6 is the fifth flowchart of the positioning method provided by the embodiment of the present application;
[0018] Figure 7 is the sixth flowchart of the positioning method provided by the embodiment of the present application;
[0019] Figure 8 is the structural schematic diagram of the terminal device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0020] In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular architectures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known methods, devices, circuits, and
[0021] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items, and that the term "at least one of' as used herein means "one, two, three, four, or more" and the like.
[0022] In addition, in the description of the present application and the appended claims, the terms "first", "second", "third", etc. are used only for distinguishing between similar elements, and do not imply or suggest relative importance.
[0023] In the present description, the expressions "one embodiment" or "some embodiments" etc. mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, the expressions "in one embodiment", "in some embodiments", "in other some embodiments", "in yet some embodiments" etc. appearing in various places in the specification are not necessarily all referring to one and the same embodiment, but can refer to one or more but not all embodiments, unless otherwise specifically stated. The terms "including", "containing", "having" and their conjugates mean "including but not limited to", unless otherwise specifically stated. "Multiple" means "two or more".
[0024] For the realization of the tracking and positioning of the target object moving in a large range, the positioning method based on the linkage system generally adopted cannot accurately position the position of the tracking and positioning camera picture in the panoramic picture of the panoramic camera when the tracking and positioning camera rotates. Therefore, the embodiments of the present application provide a positioning method, which comprises the following steps: obtaining the target state position coordinates of the second camera device; and determining the target picture coordinates of the first camera device corresponding to the target state position coordinates according to the target state position coordinates and the grid search data, wherein the grid search data is generated based on the mapping relationship between the picture coordinates of the first camera device and the state position coordinates of the second camera device. The positioning method provided by the embodiments of the present application can obtain the target state position coordinates of the second camera device at the first time when the target with specific details is found, and then obtain the corresponding target picture coordinates in the first camera device according to the target state position coordinates, so as to realize the tracking and positioning of the target and improve the success rate of positioning.
[0025] As Figure 1 shown, the positioning method provided by the embodiments of the present application includes the following steps S101-S102:
[0026] In step S101, the target state position coordinates of the second camera device are acquired, and step S102 is entered.
[0027] In applications, the second camera device can be rotated manually or in other ways. When a target object with certain characteristics that needs to be tracked and positioned is found in the second camera device picture, the target state position coordinates of the target object in the second camera device picture are immediately acquired, or the second camera device actively tracks the target object to acquire the target state position coordinates of the target object in the second camera device.
[0028] In one embodiment, as Figure 2 shown, the following steps S1-S2 are included before step S101:
[0029] In step S1, based on the mapping relationship between the picture coordinates of the first camera device and the state position coordinates of the second camera device, a plurality of point pair data are acquired, and step S2 is entered.
[0030] In one embodiment, each set of point pair data includes a picture coordinate of the first camera device and a corresponding state position coordinate of the second camera device.
[0031] In applications, the first camera device is mostly a gun camera with a wider field of view, and the second camera device is mostly a ball camera with more detailed pictures.
[0032] In applications, before the plurality of point pair data are acquired, the mapping relationship between the picture coordinates of the first camera device and the state position coordinates of the second camera device is obtained. Each set of point pair data includes a picture coordinate of the first camera device and a corresponding state position coordinate of the second camera device.
[0033] In one embodiment, as Figure 3 shown, the following steps S11-S13 are included before step S1:
[0034] In step S11, the coordinates of a plurality of picture marker points in the picture of the first camera device are acquired, and step S12 is entered.
[0035] In step S12, a plurality of state position coordinates are determined when the center point of the picture of the second camera device respectively coincides with the plurality of picture marker points in the picture of the first camera device, and step S13 is entered.
[0036] In step S13, a mapping relationship between the coordinates of the plurality of picture markers and the coordinates of the plurality of state positions is obtained by a calibration algorithm based on the coordinates of the plurality of picture markers and the coordinates of the plurality of state positions.
[0037] In the application, when obtaining the mapping relationship between the picture coordinates of the first camera device and the state position coordinates of the second camera device, first, the coordinates of the plurality of picture markers in the picture of the first camera device are obtained, then the plurality of state position coordinates in the picture of the second camera device that respectively coincide with the coordinates of the plurality of picture markers in the first camera device are determined, and the mapping relationship between the picture coordinates of the first camera device and the state position coordinates of the second camera device is obtained based on the coordinates of the plurality of picture markers in the first camera device, the corresponding plurality of state position coordinates in the second camera device, and a calibration algorithm.
[0038] In one embodiment, as shown in FIG. 1, step S1 includes steps S111-S115 as follows: Figure 4
[0039] In step S111, the first coordinate system in which the picture of the first camera device is located is gridded to obtain a first gridded coordinate system, and step S112 is entered.
[0040] In step S112, the picture coordinates of each grid point in the first gridded coordinate system are obtained, and step S113 is entered.
[0041] In step S113, based on the mapping relationship between the picture coordinates of the first camera device and the state position coordinates of the second camera device and the picture coordinates of each grid point in the first gridded coordinate system, the state position coordinates of the second camera device corresponding to the picture coordinates of each grid point in the first gridded coordinate system are obtained, and step S114 is entered.
[0042] In step S114, all the state position coordinates of the second camera device are taken as grid points to obtain a second gridded coordinate system, and step S115 is entered.
[0043] In step S115, based on the picture coordinates of each grid point in the first gridded coordinate system and the state position coordinates in the second gridded coordinate system, a plurality of sets of point pair data are obtained.
[0044] In the application, when the first coordinate system in which the picture of the first camera device is located is gridded, the picture of the first camera device can be uniformly divided to obtain the first gridded coordinate system, as shown in FIG. 2. Figure 5 In the first gridded coordinate system, the coordinates of the grid points can be represented by (x n ,y n ).
[0045] According to the mapping relationship between the picture coordinates of the first camera device and the state position coordinates of the second camera device obtained in step S13, and the picture coordinates of each grid point in the first grid coordinate system, the state position coordinates of the second camera device corresponding to the picture coordinates of each grid point in the first grid coordinate system can be obtained.
[0046] The above all state position coordinates are taken as grid points to obtain a second grid coordinate system. The coordinates of the grid points can be represented by (p n ,t n ,z n ), where p n is a horizontal movement parameter of the second camera device, for example, a horizontal rotation angle, t n is a vertical movement parameter of the second camera device, for example, a vertical rotation angle, a high-low pitch angle, and the like, and z n is a focal length of the second camera device. In the present application, the first grid coordinate system corresponding to the first camera device only has x and y coordinates without depth information, and accordingly, the second camera device does not focus on the zoom information but only focuses on p n and t n , and thus the coordinates of the grid points in the second grid coordinate system can be represented by (p n ,t n ).
[0047] Finally, according to the picture coordinates of each grid point in the first grid coordinate system and the state position coordinates in the second grid coordinate system, a plurality of point pair data can be obtained.
[0048] In the application, the mapping relationship is M, and when the coordinates of a grid point in the first grid coordinate system are (x n ,y n ), the state position coordinates (p n ,t n ,z n ) in the second grid coordinate system corresponding to the grid point can be represented as (p n ,t n ,z n ) = M(x n ,y n ). Since z n is not considered in the present application, the state position coordinates (p n ,t n ) of the second camera device can be represented as (p n ,t n ) = M(x n ,y n ).
[0049] Step S2, generating grid lookup data according to the plurality of sets of point pair data.
[0050] In application, the grid lookup data can contain a plurality of picture coordinates of the first camera device and state position coordinates of the second camera device corresponding to the plurality of picture coordinates, can contain only picture coordinates of the first camera device and corresponding processing algorithm, and can contain only state position coordinates of the second camera device and corresponding processing algorithm. Any one of the above can satisfy the data form of the present application and does not constitute a limitation.
[0051] In application, the mapping relationship and the network lookup data can exist in the form of a data table, which can be a display lookup table (Look-Up-Table, LUT) or other input data that can be used to find and output corresponding lookup results.
[0052] In application, when generating the grid lookup data, smoothing filtering and other processing can be used to reduce errors caused by forward and reverse calibration, so that the finally generated grid lookup data has higher accuracy.
[0053] In one embodiment, after step S114, the method further comprises: performing smoothing processing on the state position coordinates in the second grid coordinate system.
[0054] In application, the first grid coordinate system is a linear coordinate system, and the second grid coordinate system obtained through the mapping relationship can be approximately a linear coordinate system, but is not a strict linear coordinate system, and may have errors. Therefore, the second grid coordinate system can be smoothed to obtain a coordinate system that is infinitely close to linear.
[0055] In one embodiment, the smoothing processing is mean filtering smoothing processing.
[0056] The smoothing processing includes separately smoothing the horizontal component and the vertical component of the state position coordinates to obtain a target horizontal component and a target vertical component.
[0057] The target horizontal component is a weighted average of the horizontal component and the horizontal components of two state position coordinates horizontally adjacent to the state position coordinates.
[0058] The target vertical component is a weighted average of the vertical component and the vertical components of two state position coordinates vertically adjacent to the state position coordinates.
[0059] In application, the specific smoothing processing is as follows:
[0060] p n =a1*p n-1 +a2*p n1 +a3*p n+1 ;
[0061] t n =b1*t n-1 +b2*t n1 +b3*t n+1 ;
[0062] Where p n For three horizontally adjacent points p in the second gridded coordinate system n-1 p n1 p n+1 The weighted average, where a1, a2, and a3 are the weighting coefficients; t n For three perpendicularly adjacent points t in the second gridded coordinate system n-1 , t n1 , t n+1 The weighted average is given by b1, b2, and b3, where b1, b2, and b3 are the weighting coefficients.
[0063] In applications, smoothing can also include Gaussian filtering smoothing.
[0064] In applications, mean filtering and Gaussian filtering are both commonly used linear filtering methods. Mean filtering can be implemented using a simple convolution scheme, making it highly efficient. Gaussian filtering, on the other hand, uses the distribution of a two-dimensional Gaussian function to smooth the image. Gaussian filtering provides the same smoothness in all directions, does not alter the edge characteristics of the original image, preserves the properties of feature points and edges, and is not contaminated by high-frequency signals during the filtering process.
[0065] In application, smoothing may include one or both of mean filtering smoothing and Gaussian filtering smoothing; it may also include any one or more of the following methods other than mean filtering smoothing and Gaussian filtering smoothing that can be used to perform linear smoothing on the second gridded coordinate system, without limitation here.
[0066] Step S102: Based on the target state position coordinates and grid search data, determine the target image coordinates of the first camera device corresponding to the target state position coordinates.
[0067] In one embodiment, the grid lookup data is generated based on the mapping relationship between the screen coordinates of the first camera device and the state position coordinates of the second camera device.
[0068] In application, the mapping relationship and the network lookup data can exist in the form of a data table, which can be a display lookup table (LUT) or other input data that can be looked up and output corresponding lookup results.
[0069] In application, when generating the grid lookup data, the error caused by forward and reverse calibration can be reduced through smoothing filtering and other processing, so that the finally generated grid lookup data has higher accuracy.
[0070] In application, when the second camera device is controlled to rotate, the position change displayed in the first camera device picture may appear jitter or drift due to the existence of error, so when obtaining the target picture coordinates corresponding to the target state position coordinates, the related processing steps described in Figure 6 or Figure 7 should also be included.
[0071] In one embodiment, as shown in Figure 6 , step S102 includes steps S1021 to S1023 as follows:
[0072] Step S1021, traverse the second grid coordinate system to obtain the first state position coordinates and the second state position coordinates most adjacent to the target state position coordinates in the second grid coordinate system, and enter step S1022.
[0073] Step S1022, according to the grid lookup data, obtain the first picture coordinates corresponding to the first state position coordinates and the second picture coordinates corresponding to the second state position coordinates, and enter step S1023.
[0074] Step S1023, according to the target state position coordinates, the first state position coordinates, the second state position coordinates, the first picture coordinates and the second picture coordinates, obtain the target picture coordinates corresponding to the target state position coordinates.
[0075] In application, after obtaining the target state position coordinates (p m ,t m ) of the target object in the second camera device, the first state position coordinates (p1, t1) most adjacent to the target state position coordinates and the second state position coordinates (p2, t2) should be obtained by traversing the current second grid coordinate system; then according to the grid lookup data, the first picture coordinates (x1, y1) corresponding to the first state position coordinates and the second picture coordinates (x2, y2) corresponding to the second state position coordinates are obtained respectively; then the target picture coordinates (x m ,y m), wherein
[0076] x m = (p m -p1)*(x1-x2) / (p1-p2)+x1;
[0077] y m = (t m -t1)*(y1-y2) / (t1-t2)+y1.
[0078] In the application, when the relative distance of (p1, t1) and (p2, t2) in the second grid coordinate system is close to or approximately equal to the relative distance of (x1, y1) and (x2, y2) in the first grid coordinate system, the target picture coordinates (x m ,y m ) obtained by the above interpolation method are relatively accurate; if the relative distance of (p1, t1) and (p2, t2) in the second grid coordinate system is greatly different from the relative distance of (x1, y1) and (x2, y2) in the first grid coordinate system, exceeding a preset threshold, the target picture coordinates (x m ,y m ) are not suitable to be obtained by the interpolation calculation method, and at this time, the target picture coordinates (x m ,y m ) are obtained according to the first state position coordinates (p1, t1) closest to the target state position coordinates, the first picture coordinates (x1, y1), and the rotation angle of the second camera device corresponding to the unit distance of the first camera device.
[0079] In one embodiment, as shown in Figure 7 , the step S1023 further includes steps S21 to S25 as follows:
[0080] Step S21, obtaining a first relative distance according to the first state position coordinates and the second state position coordinates, and entering step S22;
[0081] Step S22, obtaining a second relative distance according to the first picture coordinates and the second picture coordinates, and entering step S23;
[0082] Step S23, obtaining a ratio of the first relative distance and the second relative distance to obtain a proportion value, and entering step S24;
[0083] Step S24, if the proportion value is within a preset threshold range, obtaining the target picture coordinates corresponding to the target state position coordinates according to the target state position coordinates, the first state position coordinates, the second state position coordinates, the first picture coordinates and the second picture coordinates, and entering step S25;
[0084] If the ratio value is outside the preset threshold range, the target picture coordinate corresponding to the target state position coordinate is obtained according to the target state position coordinate, the first state position coordinate, the maximum rotation angle of the second camera device, the first picture coordinate, and the maximum coordinate range of the first camera device in the first coordinate system.
[0085] In applications, the preset threshold range can be (0.8, 1.25), or other ranges set by users according to actual needs, which are not limited here.
[0086] In applications, the first relative distance a is obtained by using the difference between the first state position coordinate (p1, t1) and the second state position coordinate (p2, t2) and dividing by the maximum range of the second grid coordinate system; the second relative distance b is obtained by using the difference between the first picture coordinate (x1, y1) and the second picture coordinate (x2, y2) and dividing by the maximum range of the first grid coordinate system; if the ratio c of the first relative distance and the second relative distance is outside the preset threshold range, the target picture coordinate (x m ,y m ) is calculated as follows:
[0087] x m =x1+(p m -p1)*range(x) / range(p);
[0088] y m =y1+(t m -t1)*range(y) / range(t);
[0089] wherein, range(x) and range(y) are the coordinate range in the first grid coordinate system, for example, range(x) = 1920 and range(y) = 1080; range(p) and range(t) are the state range in the second grid coordinate system, for example, range(p) = 150° and range(t) = 30°.
[0090] In one embodiment, after step S102, the method further comprises: displaying the position of the target picture coordinate corresponding to the target state position coordinate in the first camera device picture according to the target picture coordinate.
[0091] In applications, after obtaining the target picture coordinate corresponding to the target state position coordinate, the center position of the picture of the second camera device can be displayed in the first camera device picture by a cross pattern or other marking patterns, thereby helping users quickly find the target object appearing in the picture of the second camera device in the first camera device picture.
[0092] In application, based on the positioning method proposed in this application, when the user controls the rotation of the second camera device, the current center of the second camera device's image is highlighted in the first camera device. This helps the user focus on the position that the second camera device is currently focusing on, realizing an interactive control method between the user and the camera device. For example, if the user wants to see a certain detail in the second camera device's image, they can move the second camera device to that detail and zoom in to view it. The corresponding position of the second camera device's current image in the first camera device can be displayed in real time, facilitating positioning and control.
[0093] In application, the positioning method provided in this application embodiment, through rapid mapping from the second camera device screen to the first camera device screen, facilitates users to quickly locate target objects and effectively improves the success rate of tracking and positioning.
[0094] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0095] like Figure 8 As shown, this application embodiment also provides a terminal device 300, including: at least one processor 301 ( Figure 8 The diagram shows only one processor), memory 302, and a computer program 303 stored in memory 302 and executable on at least one processor 301. When processor 301 executes computer program 303, it implements the steps in the various method embodiments described above.
[0096] In applications, terminal devices may include, but are not limited to, processors and memory. Figure 8 This is merely an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, human-computer interaction devices, input / output devices, network access devices, etc. The network access device may include a communication module for communication between the terminal device and the user terminal.
[0097] In applications, the processor can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. For example, the processor can be a timing controller (TCON). The general-purpose processor can be a microprocessor or can also be any conventional processor.
[0098] In applications, the memory can be an internal storage unit of the terminal device in some embodiments, for example, a hard disk or a memory of the terminal device. The memory can also be an external storage device of the terminal device in other embodiments, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. The memory can also include both the internal storage unit and the external storage device of the terminal device. The memory is used to store an operating system, an application program, a boot loader, data, and other programs, for example, program codes of computer programs, etc. The memory can also be used to temporarily store data that has been output or will be output.
[0099] In applications, the communication module can be set to any device capable of direct or indirect long-distance wired or wireless communication with the user terminal according to actual needs. For example, the communication module can provide a communication solution including a wireless local area network (WLAN) (such as a Wi-Fi network), Bluetooth, Zigbee, a mobile communication network, a global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), and the like applied to network equipment. The communication module can include an antenna, which can have only one element or an antenna array including multiple elements. The communication module can receive electromagnetic waves through the antenna, frequency modulate and filter the electromagnetic wave signals, and send the processed signals to the processor. The communication module can also receive signals to be sent from the processor, frequency modulate and amplify them, and radiate them as electromagnetic waves through the antenna.
[0100] It should be noted that the information interaction, execution process, and the like between the above devices / modules are based on the same concept as the method embodiments of the present application, and the specific functions and technical effects brought about can be referred to the method embodiments part. Therefore, no further description is given here.
[0101] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration. In actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. Each functional module in the embodiments can be integrated into one processing module, or each module can exist physically independently, or two or more modules can be integrated into one module. The integrated module can be realized in the form of hardware or in the form of a software functional module. In addition, the specific names of the functional modules are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the modules in the system can refer to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0102] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in each of the above method embodiments can be implemented.
[0103] The embodiment of the present application provides a computer program product, when the computer program product runs on a terminal device, so that the terminal device can implement the steps in each method embodiment.
[0104] The integrated module, if implemented in the form of a software function module and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can implement the steps of each method embodiment when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunications signal and a software distribution medium. For example, a U disk, a mobile hard disk, a magnetic disk or an optical disk.
[0105] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.
[0106] Those skilled in the art can appreciate that the modules and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0107] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division, and actual implementation can have another division manner. For example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed elements can be indirect coupling or communication connection through some interface, device or module, and can be electrical, mechanical or other forms.
[0108] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed to multiple network modules. Part or all of the modules can be selected as needed to achieve the purpose of the embodiment.
[0109] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A positioning method, characterized by, The positioning method comprises: obtaining a target state position coordinate of the second camera device; determining a target picture coordinate of the first camera device corresponding to the target state position coordinate according to the target state position coordinate and grid lookup data, wherein the grid lookup data is generated based on a mapping relationship between the picture coordinate of the first camera device and the state position coordinate of the second camera device; before the target state position coordinate of the second camera device is obtained, comprising: obtaining a plurality of point pair data based on the mapping relationship between the picture coordinate of the first camera device and the state position coordinate of the second camera device, wherein each group of point pair data comprises a first camera device picture coordinate and a corresponding second camera device state position coordinate; generating grid lookup data according to the plurality of point pair data.
2. The positioning method of claim 1, wherein, Before the plurality of point pair data is obtained based on the mapping relationship between the picture coordinate of the first camera device and the state position coordinate of the second camera device, comprising: obtaining the coordinates of a plurality of picture marker points in the first camera device picture; determining a plurality of state position coordinates when the center point of the second camera device picture respectively coincides with the plurality of picture marker points in the first camera device picture; obtaining the mapping relationship between the coordinates of the plurality of picture marker points and the plurality of state position coordinates by a calibration algorithm based on the coordinates of the plurality of picture marker points and the plurality of state position coordinates.
3. The positioning method of claim 1, wherein, The plurality of point pair data is obtained based on the mapping relationship between the picture coordinate of the first camera device and the state position coordinate of the second camera device, comprising: griding the first coordinate system in which the first camera device picture is located to obtain a first grid coordinate system; obtaining the picture coordinate of each grid point in the first grid coordinate system; obtaining the state position coordinate of the second camera device corresponding to the picture coordinate of each grid point in the first grid coordinate system based on the mapping relationship between the picture coordinate of the first camera device and the state position coordinate of the second camera device and the picture coordinate of each grid point in the first grid coordinate system; obtaining a second grid coordinate system by taking all the state position coordinates of the second camera device as grid points; obtaining a plurality of point pair data based on the picture coordinate of each grid point in the first grid coordinate system and the state position coordinate in the second grid coordinate system.
4. The positioning method of claim 3, wherein, After the second grid coordinate is obtained by taking all the state position coordinates of the second camera device as grid points, comprising: performing smoothing processing on the state position coordinates in the second grid coordinate system.
5. The positioning method of claim 4, wherein, The smoothing processing is mean filtering smoothing processing; wherein the smoothing processing comprises performing smoothing processing on the horizontal component and the vertical component of the state position coordinate respectively to obtain a target horizontal component and a target vertical component; the target horizontal component is a weighted average of the horizontal component and the horizontal components corresponding to two state position coordinates horizontally adjacent to the state position coordinate; the target vertical component is a weighted average of the vertical component and the vertical components corresponding to two state position coordinates vertically adjacent to the state position coordinate.
6. A positioning method as claimed in any one of claims 3 to 5, characterized in that, The method comprises the following steps: The method comprises the following steps: According to the grid search data, a first picture coordinate corresponding to the first state position coordinate and a second picture coordinate corresponding to the second state position coordinate are obtained. According to the target state position coordinate, the first state position coordinate, the second state position coordinate, the first picture coordinate and the second picture coordinate, a target picture coordinate corresponding to the target state position coordinate is obtained.
7. The positioning method of claim 6, wherein, The method comprises the following steps: According to the first state position coordinate and the second state position coordinate, a first relative distance is obtained. According to the first picture coordinate and the second picture coordinate, a second relative distance is obtained. A ratio of the first relative distance and the second relative distance is obtained to obtain a proportion value. If the proportion value is within a preset threshold range, a target picture coordinate corresponding to the target state position coordinate is obtained according to the target state position coordinate, the first state position coordinate, the second state position coordinate, the first picture coordinate and the second picture coordinate. If the proportion value is outside the preset threshold range, a target picture coordinate corresponding to the target state position coordinate is obtained according to the target state position coordinate, the first state position coordinate, a maximum rotation angle of the second camera, the first picture coordinate and a maximum coordinate range of the first camera in the first coordinate system.
8. The positioning method of claim 1, wherein, The method comprises the following steps: According to the target picture coordinate, a position of the target picture coordinate corresponding to the target state position coordinate in the picture of the first camera is displayed.
9. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The computer program is executed by the processor to implement the steps of the positioning method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the steps of the positioning method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Positioning method, terminal device and storage medium
CN110082713A
Target positioning method and device and electronic device
CN111323006A