Camera border crossing processing method and device, equipment and storage medium
By obtaining the current location and map extent of the camera from the geographic information system, determining and reverting the camera's position, the user experience and data accuracy issues caused by cameras going out of bounds are resolved, and effective management of camera out-of-bounds operations is achieved.
Patent Information
- Application Number
- CN202511045825.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-14
AI Technical Summary
The lack of effective management solutions for camera overstepping boundaries in existing technologies leads to the crude restriction of camera displacement, zoom, and rotation functions in geographic information systems, affecting user experience and potentially causing inaccuracies and incompleteness of geographic data.
By obtaining the current location and map extent of the camera in the geographic information system, it is determined whether the camera has crossed the boundary. Based on the current location and map extent, the retreat direction and distance are determined, and the camera is moved to the retreat position, thereby realizing the management of camera boundary crossing.
It enables camera boundary management within specific areas, improving user experience and ensuring the accuracy and integrity of geographic data.
Smart Images

Figure CN120953368A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of geographic data processing technology, and more specifically, to a method, apparatus, device, and storage medium for handling camera boundary crossings. Background Technology
[0002] In Geographic Information Systems (GIS), camera out-of-bounds generally refers to a camera's location coordinates extending beyond the map area of the GIS. If a camera goes out of bounds, some geographic data may not be fully displayed on the screen, affecting the user's understanding and analysis of the geographic data.
[0003] Currently, there is a lack of solutions to deal with cameras crossing boundaries. The only approach is to crudely restrict whether the camera's displacement, zoom, and rotation functions are enabled in the geographic information system. There is no way to manage camera crossing boundaries for a specific area. Summary of the Invention
[0004] The purpose of this application is to address the shortcomings of the prior art by providing a camera boundary crossing processing method, apparatus, device, and storage medium to solve the problem that the prior art cannot manage camera boundary crossings for a specific area.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0006] In a first aspect, one embodiment of this application provides a camera boundary crossing handling method, the method comprising:
[0007] Obtain the current location of the camera and the current map extent in the geographic information system;
[0008] Based on the current location and the current map range, determine whether the camera has crossed the boundary;
[0009] If so, then determine the rollback direction and rollback distance based on the current location and the current map range;
[0010] Based on the retraction direction and retraction distance, determine the retraction position and move the camera to the retraction position.
[0011] As one possible implementation, obtaining the current location of the camera and the current map extent in the geographic information system includes:
[0012] Get the rollback processing identifier;
[0013] If the rollback processing flag indicates that no rollback is currently being performed, then the current location of the camera in the geographic information system and the current map range are obtained.
[0014] As one possible implementation, determining whether the camera has crossed the boundary based on the current location and the current map range includes:
[0015] Based on the current map extent, determine the boundaries of the current map extent;
[0016] The current location is compared with the boundary of the current map area to determine whether the camera has crossed the boundary.
[0017] As one possible implementation, determining the rollback direction and rollback distance based on the current location and the current map range includes:
[0018] Determine the group of boundary line segments containing the current map area;
[0019] The retraction direction is determined based on the current position and the boundary line segment group;
[0020] Determine the centroid corresponding to the current map range;
[0021] The backtracking distance is determined based on the current position and the centroid.
[0022] As one possible implementation, determining the backtracking direction based on the current position and the boundary segment group includes:
[0023] Calculate the vertical distance between the current position and each boundary segment in the boundary segment group;
[0024] Determine the boundary segment containing the minimum vertical distance among the boundary segments in the boundary segment group, and calculate the intersection point between the boundary segment containing the minimum vertical distance and the current position;
[0025] The retraction direction is determined based on the current position and the intersection point.
[0026] As one possible implementation, determining the backtracking distance based on the current position and the centroid includes:
[0027] Calculate the straight-line distance between the current position and the centroid;
[0028] The product of the straight-line distance and the preset weighting coefficient is used as the back-off distance.
[0029] As one possible implementation, determining the rewind position based on the rewind direction and rewind distance includes:
[0030] If the geographic information system is a three-dimensional information system, the current position, the rollback direction, and the rollback distance are used as input parameters of a preset interface. The preset interface is called to obtain the rollback position, wherein the preset interface is the interface corresponding to the three-dimensional information system, and the camera is rolled back.
[0031] Secondly, another embodiment of this application provides a camera boundary crossing processing device, the device comprising:
[0032] The acquisition module is used to acquire the current location of the camera and the current map extent in the geographic information system;
[0033] The judgment module is used to determine whether the camera has crossed the boundary based on the current position and the current map range;
[0034] If so, the first determining module is used to determine the rollback direction and rollback distance based on the current location and the current map range;
[0035] The second determining module is used to determine the retraction position based on the retraction direction and retraction distance, and move the camera to the retraction position.
[0036] As one possible implementation, the acquisition module is specifically used for:
[0037] Get the rollback processing identifier;
[0038] If the rollback processing flag indicates that no rollback is currently being performed, then the current location of the camera in the geographic information system and the current map range are obtained.
[0039] As one possible implementation, the judgment module is specifically used for:
[0040] Based on the current map extent, determine the boundaries of the current map extent;
[0041] The current location is compared with the boundary of the current map area to determine whether the camera has crossed the boundary.
[0042] As one possible implementation, the first determining module is specifically used for:
[0043] Determine the group of boundary line segments containing the current map area;
[0044] The retraction direction is determined based on the current position and the boundary line segment group;
[0045] Determine the centroid corresponding to the current map range;
[0046] The backtracking distance is determined based on the current position and the centroid.
[0047] As one possible implementation, the first determining module is specifically used for:
[0048] Calculate the vertical distance between the current position and each boundary segment in the boundary segment group;
[0049] Determine the boundary segment containing the minimum vertical distance among the boundary segments in the boundary segment group, and calculate the intersection point between the boundary segment containing the minimum vertical distance and the current position;
[0050] The retraction direction is determined based on the current position and the intersection point.
[0051] As one possible implementation, the first determining module is specifically used for:
[0052] Calculate the straight-line distance between the current position and the centroid;
[0053] The product of the straight-line distance and the preset weighting coefficient is used as the back-off distance.
[0054] As one possible implementation, the second determining module is specifically used for:
[0055] If the geographic information system is a three-dimensional information system, the current position, the rollback direction, and the rollback distance are used as input parameters of a preset interface. The preset interface is called to obtain the rollback position, wherein the preset interface is the interface corresponding to the three-dimensional information system, and the camera is rolled back.
[0056] Thirdly, another embodiment of this application provides an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any of the methods described in the first aspect above.
[0057] Fourthly, another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, performs the steps of any of the methods described in the first aspect above.
[0058] The beneficial effects of this application are as follows: By acquiring the current location and map extent of the camera in the geographic information system and judging the current location and map extent, it can determine whether the camera has crossed the boundary. When the camera crosses the boundary, it can determine the retreat direction and retreat distance based on the current location and map extent, and then determine the retreat position based on the retreat direction and retreat distance, and move the camera to the retreat position. This realizes camera boundary management in a specific area, avoids geographic information system operation failures caused by camera boundary crossing, improves user experience, and ensures the accuracy and integrity of geographic data. Attached Figure Description
[0059] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 A schematic diagram of the scene involved in the camera boundary crossing handling method provided in the embodiments of this application;
[0061] Figure 2 A flowchart of a camera boundary crossing handling method provided in an embodiment of this application is shown;
[0062] Figure 3 A user interface diagram provided for an embodiment of this application;
[0063] Figure 4 Another user interface diagram provided for an embodiment of this application;
[0064] Figure 5 The flowchart illustrates the process of obtaining the current position of a camera in a geographic information system and the current map range in a camera boundary crossing processing method provided in an embodiment of this application.
[0065] Figure 6 This document illustrates a flowchart illustrating the process of determining whether a camera has crossed the boundary in a camera boundary crossing handling method provided in an embodiment of this application.
[0066] Figure 7 This document illustrates a flowchart illustrating the determination of the retraction direction and retraction distance in a camera boundary crossing handling method provided in an embodiment of this application.
[0067] Figure 8 This document illustrates a flowchart of the process for determining the back-off direction in a camera boundary crossing handling method provided in an embodiment of this application.
[0068] Figure 9This document illustrates a flowchart illustrating the determination of the back-up distance in a camera boundary crossing handling method provided in an embodiment of this application.
[0069] Figure 10 A schematic diagram of a camera boundary crossing processing device provided in an embodiment of this application;
[0070] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0071] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0072] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0073] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0074] Currently, there is a lack of solutions to address camera boundary violations. The only approach is to crudely restrict the camera's displacement, zoom, and rotation functions within the geographic information system (GIS), without managing camera boundary violations for specific areas. This reduces the usability of the GIS, making it difficult for users to operate the system normally and impacting user experience. Furthermore, it may lead to errors in geographic data association, affecting the accuracy and integrity of the geographic data.
[0075] This application provides a camera boundary crossing handling method to address the aforementioned problems. By acquiring the current location and map extent of the camera in a geographic information system and judging the current location and map extent, it determines whether the camera has crossed the boundary. When the camera crosses the boundary, it can determine the retreat direction and retreat distance based on the current location and map extent, thereby determining the retreat position and moving the camera to the retreat position. This achieves camera boundary crossing management in specific areas, improves user experience, and ensures the accuracy and integrity of geographic data.
[0076] First, the application scenarios involved in the camera boundary crossing handling method provided in the embodiments of this application will be described. Figure 1 This is a schematic diagram of the scene involved in the camera boundary crossing handling method provided in the embodiments of this application, with reference to... Figure 1 As shown, this scenario can involve any electronic device with processing capabilities. The electronic device includes a processor and a geographic information system (GIS). The processor interacts with the GIS to load and display a map, allowing the user to move, rotate, zoom, or pan the map based on the camera's position and viewpoint to obtain the required geographic information. Furthermore, when the user moves, rotates, zooms, or pans the map, the camera boundary crossing handling method provided in this application embodiment is executed to ensure normal interaction between the processor and the GIS.
[0077] For example, an electronic device can be equipped with a browser. The browser can interact with the geographic information system (GIS) by calling the GIS engine. Specifically, if the browser's underlying graphics interface is based on the Web Graphics Library (WebGL) standard, the browser can load the map by calling the GIS engine open-source library Cesium.js, thereby displaying the map so that the user can move, rotate, zoom, or pan the map according to the camera's position and viewpoint to obtain the required geographic information. Furthermore, when the user moves, rotates, zooms, or pans the map, the camera out-of-bounds handling method provided in this application embodiment is executed to ensure the browser's normal display, thereby enabling the user to obtain the required geographic information.
[0078] It is understandable that when users obtain the required geographic information, they can divide the map into areas according to actual construction and management goals, such as mining areas, forest areas, urban management zones, and air traffic control zones. Based on this, when the processor displays the map, it can obtain and display the current map range set by the user.
[0079] Optionally, when a user moves, rotates, zooms, or pans the map based on the camera's position and viewpoint, the camera boundary crossing handling method provided in this application embodiment can run as a plug-in in the aforementioned electronic device.
[0080] The following provides a detailed description of the camera boundary crossing handling method provided in the embodiments of this application.
[0081] Figure 2 A flowchart of a camera boundary crossing handling method provided in an embodiment of this application is shown, with reference to... Figure 2 As shown, the execution subject of this method can be a processor in the aforementioned electronic device, and the method includes:
[0082] S201. Obtain the current location of the camera and the current map extent in the geographic information system.
[0083] Optionally, the camera's current position can be the camera's coordinates in a ground coordinate system, where the ground coordinate system corresponds to the coordinate system of the current map, and the camera's current position is used to characterize the relative positional relationship between the image captured by the camera and the geographic data in the current map.
[0084] Optionally, the current map extent can consist of the boundaries of the currently displayed geographic data and closed polygons formed by these boundaries. The boundaries are defined by the coordinates of the top, bottom, left, and right sides, and are used to define the edges of the currently processed geographic data. The current map extent can be obtained through user input or preset rules.
[0085] Optionally, the processor obtains the current location of the camera and the current map extent in the geographic information system after the user's current operation. Specifically, the processor can obtain the current location of the camera and the current map extent in the geographic information system for each frame.
[0086] Optionally, for a three-dimensional geographic information system, the current position of the camera obtained by the processor may include: the camera's current position coordinates, the camera's heading angle, the camera's pitch angle, and the camera's roll angle. For a two-dimensional geographic information system, the current position of the camera obtained by the processor includes: the camera's current position coordinates.
[0087] For example, Figure 3 A user interface diagram provided for an embodiment of this application, with reference to... Figure 3 As shown, the user interface displays a map, the current map extent, and the current position of the camera after the user's current operation. The processor can obtain the coordinates of the camera's current position and the current map extent.
[0088] S202. Based on the current location and the current map range, determine whether the camera has crossed the boundary.
[0089] Optionally, the current position of the camera can be determined based on the current map range to determine whether the camera has crossed the boundary.
[0090] S203. If so, determine the rewind direction and rewind distance based on the current location and the current map range.
[0091] For example, continue to refer to Figure 3 The processor determines the current location and map range by analyzing the acquired data, and can then identify if the camera has crossed the boundary.
[0092] Optionally, after a camera crosses the boundary, the camera's retraction direction and retraction distance are calculated based on the current position and the current map range to bring the camera's position back to the current map range. The retraction direction indicates the direction and angle in which the camera should move, and the retraction distance indicates the distance the camera should move.
[0093] S204. Determine the retraction position based on the retraction direction and distance, and move the camera to the retraction position.
[0094] Optionally, after obtaining the rewind direction and rewind distance, the rewind position that the camera should move to can be determined, and the camera can be moved and the display updated by calling the interface for designing the camera position and taking the rewind position as the input parameter.
[0095] For example, Figure 4 Another user interface diagram provided for an embodiment of this application, see reference. Figure 4 As shown, after obtaining the retrace direction and retrace distance, the processor can determine the retrace position that the camera should move to and update the camera's position to the retrace position in the user interface.
[0096] In this embodiment, by acquiring the current location and map extent of the camera in the geographic information system and judging the current location and map extent, it is determined whether the camera has crossed the boundary. When the camera crosses the boundary, the retreat direction and retreat distance can be determined based on the current location and map extent. Based on the retreat direction and retreat distance, the retreat position can be determined, and the camera can be moved to the retreat position. This achieves camera boundary management in specific areas, avoids geographic information system operation failures caused by camera boundary crossings, improves user experience, and ensures the accuracy and integrity of geographic data.
[0097] Optionally, in order to obtain the current location of the camera and the current map extent in the geographic information system, a possible implementation method is provided below. Figure 5 This document illustrates a flowchart illustrating the process of obtaining the current location of a camera in a geographic information system and the current map extent in a camera boundary crossing handling method provided in an embodiment of this application. (Refer to...) Figure 5 As shown, step S201 above is illustrated by example and specifically includes:
[0098] S501, Obtain rollback processing identifier.
[0099] It is understandable that for geographic information systems, the camera position change process generally automatically realizes flight animation. Therefore, in order to avoid the back-back deadlock caused by continuous back-back, a back-back processing flag can be set to indicate whether the current back-back state is being performed, thereby ensuring the normal operation of the camera boundary crossing processing method provided in this application embodiment.
[0100] Optionally, the processor acquires the rollback processing flag, which can be set to no rollback by default, and can be updated when rollback begins.
[0101] S502. If the rollback processing flag indicates that no rollback is currently being performed, then obtain the current location of the camera and the current map range in the geographic information system.
[0102] Optionally, the processor determines the rollback processing flag. If no rollback has been performed, it can obtain the current location of the camera in the geographic information system and the current map range after the user's current operation.
[0103] By using a rollback flag to determine whether a rollback is currently in progress, the current position of the camera and the current map range can be obtained when no rollback is currently in progress. This avoids rollback freezes caused by continuous rollbacks, thereby ensuring the normal operation of the camera boundary crossing handling method provided in this application embodiment.
[0104] As one possible implementation method, Figure 6 This document illustrates a flowchart illustrating the process of determining whether a camera has crossed the boundary in a camera boundary crossing handling method provided in an embodiment of this application. (Refer to...) Figure 6 As shown, in step S202 above, when determining whether the camera has crossed the boundary based on the current location and the current map range, the following steps can be performed, specifically including:
[0105] S601. Determine the boundary of the current map range based on the current map range.
[0106] Optionally, the boundaries of the current map range can be determined based on the current map range, wherein the boundaries are composed of the coordinates of the top, bottom, left, and right sides.
[0107] S602. Compare the current location with the boundary of the current map area to determine whether the camera has crossed the boundary.
[0108] Optionally, the processor can compare the current location with the boundary of the current map area to determine whether the camera has crossed the boundary.
[0109] Optionally, the processor can update the rollback flag to "rollback in progress" after determining that the camera has crossed the boundary, in order to avoid repeatedly rolling back and getting stuck.
[0110] For example, after obtaining the current position of the camera (viewer.camera.position), the processor calls the turf.booleanPointInPolygon function to determine whether the camera has gone out of bounds.
[0111] As one possible implementation method, Figure 7 This document illustrates a flowchart illustrating the determination of the retraction direction and distance in a camera boundary crossing handling method provided in an embodiment of this application. (Refer to...) Figure 7 As shown, in step S203 above, when determining the retrace direction and retrace distance based on the current location and the current map range, the following steps can be followed:
[0112] S701. Determine the boundary segment group where the current map range is located.
[0113] Understandably, if the retracement direction is unreasonable, it will create a counterintuitive retracement experience for the user, making them feel as if the camera has been reset to an odd location that doesn't connect with its previous position. Therefore, the retracement direction can be determined based on the current map area to ensure a smooth user experience.
[0114] Optionally, when determining the rollback direction, the boundary segment group constituting the current map extent is determined based on the current map extent. The boundary segment group consists of multiple line segments, and connecting all the line segments in the boundary segment group constitutes the boundary of the current map extent.
[0115] S702. Determine the retreat direction based on the current position and the boundary segment group.
[0116] Optionally, the camera's retraction direction can be determined by calculating the current position and each boundary segment in the boundary segment group.
[0117] S703. Determine the centroid corresponding to the current map range.
[0118] It's understandable that if the retraction distance is unreasonable, it can create a counterintuitive retraction experience, making the operator feel that the camera has been pushed back too far and they can't find its original position. Therefore, the camera retraction distance can be determined based on the current map area to ensure a better user experience.
[0119] Optionally, when determining the rollback distance, the centroid corresponding to the current map range is determined using the current map range. Since the current map range is a closed polygon, the centroid corresponding to the current map range is the centroid of that closed polygon.
[0120] S704. Determine the retraction distance based on the current position and the center of mass.
[0121] Optionally, the camera's retraction distance can be determined by calculating the current position and the centroid separately.
[0122] By determining the retreat direction and retreat distance using boundary line segments and centroids, the camera can retreat smoothly and reasonably to a certain position within the current map area. This avoids GIS operation failures caused by camera overstepping boundaries, improves user experience, and ensures the accuracy and integrity of geographic data.
[0123] As one possible implementation method, Figure 8 This document illustrates a flowchart illustrating the determination of the back-off direction in a camera boundary crossing handling method provided in an embodiment of this application. (Refer to...) Figure 8 As shown, in step S702 above, when determining the retraction direction based on the current position and the boundary line segment group, the following steps can be performed, specifically including:
[0124] S801. Calculate the vertical distance between the current position and each boundary segment in the boundary segment group.
[0125] Optionally, the current position is perpendicular to each boundary segment in the boundary segment group, and the perpendicular distances corresponding to each boundary segment in the boundary segment group are calculated.
[0126] S802. Determine the boundary segment containing the minimum vertical distance among all boundary segments in the boundary segment group, and calculate the intersection point between the boundary segment containing the minimum vertical distance and the current position.
[0127] Optionally, a sorting algorithm is used to determine the boundary segment corresponding to the minimum vertical distance of each boundary segment in the boundary segment group, and to calculate the intersection point between the boundary segment containing the minimum vertical distance and the current position.
[0128] S803. Determine the retraction direction based on the current position and the intersection point.
[0129] Optionally, the direction angle between the two points can be calculated based on the current position and the intersection point, and used as the direction of retreat. The reference angles are: due north = 0 degrees, due east = 90 degrees, due south = 180 degrees, and due west = 270 degrees.
[0130] For example, the coordinates of the current position and the coordinates of the intersection point can be used as input parameters to call the turf.bearing function to obtain the heading direction.
[0131] As one possible implementation method, Figure 9 This document illustrates a flowchart illustrating the determination of the back-up distance in a camera boundary crossing handling method provided in an embodiment of this application. (Refer to...) Figure 9 As shown, in step S704 above, when determining the retraction distance based on the current position and the centroid, the following steps can be performed, specifically including:
[0132] S901. Calculate the straight-line distance between the current position and the centroid.
[0133] Optionally, the processor connects the current position to the centroid and calculates the straight-line distance between the current position and the centroid.
[0134] S902. The product of the straight-line distance and the preset weight coefficient is used as the back-off distance.
[0135] Optionally, the processor uses the product of the straight-line distance and a preset weighting coefficient as the backoff distance. The preset weighting coefficient can be a pre-defined distance percentage, for example, 0.2.
[0136] As one possible implementation, step S204 above, when determining the rewind position based on the rewind direction and rewind distance, specifically includes:
[0137] If the geographic information system is a three-dimensional information system, the current position, the rollback direction, and the rollback distance are used as input parameters of the preset interface. The preset interface is called to obtain the rollback position. The preset interface is the interface corresponding to the three-dimensional information system, which is used to roll back the camera.
[0138] For example, the current position (viewer.camera.position), the backward direction (heading), and the backward distance can be used as input parameters to call the turf.destination function to obtain the backward position coordinates.
[0139] Optionally, if the geographic information system is a two-dimensional information system, the rollback direction and rollback distance are used as input parameters of a preset interface. The preset interface is called to obtain the rollback position. The preset interface is the interface corresponding to the two-dimensional information system, which is used to roll back the camera.
[0140] Based on the same inventive concept, this application also provides a camera boundary crossing processing device corresponding to the camera boundary crossing processing method. Since the principle of the device in this application is similar to the above-mentioned camera boundary crossing processing method in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0141] Figure 10 This is a schematic diagram of a camera boundary crossing processing device provided in an embodiment of this application, with reference to... Figure 10 As shown, the device includes: an acquisition module 1001, a judgment module 1002, a first determination module 1003, and a second determination module 1004; wherein,
[0142] The acquisition module 1001 is used to acquire the current location of the camera and the current map extent in the geographic information system;
[0143] The judgment module 1002 is used to determine whether the camera has crossed the boundary based on the current position and the current map range;
[0144] If so, the first determining module 1003 is used to determine the rewind direction and rewind distance based on the current position and the current map range;
[0145] The second determining module 1004 is used to determine the retraction position based on the retraction direction and retraction distance, and move the camera to the retraction position.
[0146] As one possible implementation, the acquisition module 1001 is specifically used for:
[0147] Get the rollback processing identifier;
[0148] If the rollback processing flag indicates that no rollback is currently being performed, then the current location of the camera in the geographic information system and the current map range are obtained.
[0149] As one possible implementation, the judgment module 1002 is specifically used for:
[0150] Based on the current map extent, determine the boundaries of the current map extent;
[0151] The current location is compared with the boundary of the current map area to determine whether the camera has crossed the boundary.
[0152] As one possible implementation, the first determining module 1003 is specifically used for:
[0153] Determine the group of boundary line segments containing the current map area;
[0154] The retraction direction is determined based on the current position and the boundary line segment group;
[0155] Determine the centroid corresponding to the current map range;
[0156] The backtracking distance is determined based on the current position and the centroid.
[0157] As one possible implementation, the first determining module 1003 is specifically used for:
[0158] Calculate the vertical distance between the current position and each boundary segment in the boundary segment group;
[0159] Determine the boundary segment containing the minimum vertical distance among the boundary segments in the boundary segment group, and calculate the intersection point between the boundary segment containing the minimum vertical distance and the current position;
[0160] The retraction direction is determined based on the current position and the intersection point.
[0161] As one possible implementation, the first determining module 1003 is specifically used for:
[0162] Calculate the straight-line distance between the current position and the centroid;
[0163] The product of the straight-line distance and the preset weighting coefficient is used as the back-off distance.
[0164] As one possible implementation, the second determining module 1004 is specifically used for:
[0165] If the geographic information system is a three-dimensional information system, the current position, the rollback direction, and the rollback distance are used as input parameters of a preset interface. The preset interface is called to obtain the rollback position, wherein the preset interface is the interface corresponding to the three-dimensional information system, and the camera is rolled back.
[0166] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0167] This application also provides an electronic device 1100, such as... Figure 11 As shown, Figure 11 A schematic diagram of an electronic device provided in an embodiment of this application includes: a processor 1101, a memory 1102, and optionally, a bus 1103. The memory 1102 stores machine-readable instructions executable by the processor 1101 (e.g., ...). Figure 10The device in the device acquires the execution instructions corresponding to the module 1001, the judgment module 1002, the first determination module 1003 and the second determination module 1004, etc. When the electronic device 1100 is running, the processor 1101 and the memory 1102 communicate through the bus 1103. When the machine-readable instruction is executed by the processor 1101, the steps of the above-mentioned camera boundary crossing processing method are executed.
[0168] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the camera out-of-bounds processing method described above.
[0169] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.
[0170] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0171] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for handling camera boundary violations, characterized in that, The method includes: Obtain the current location of the camera and the current map extent in the geographic information system; Based on the current location and the current map range, determine whether the camera has crossed the boundary; If so, then determine the rollback direction and rollback distance based on the current location and the current map range; Based on the retraction direction and retraction distance, determine the retraction position and move the camera to the retraction position.
2. The camera boundary crossing handling method according to claim 1, characterized in that, The acquisition of the current location of the camera and the current map extent in the geographic information system includes: Get the rollback processing identifier; If the rollback processing flag indicates that no rollback is currently being performed, then the current location of the camera in the geographic information system and the current map range are obtained.
3. The camera boundary crossing handling method according to claim 1, characterized in that, The step of determining whether the camera has crossed the boundary based on the current location and the current map range includes: Based on the current map extent, determine the boundaries of the current map extent; The current location is compared with the boundary of the current map area to determine whether the camera has crossed the boundary.
4. The camera boundary crossing handling method according to claim 1, characterized in that, The step of determining the rollback direction and rollback distance based on the current location and the current map range includes: Determine the group of boundary line segments containing the current map area; The retraction direction is determined based on the current position and the boundary line segment group; Determine the centroid corresponding to the current map range; The backtracking distance is determined based on the current position and the centroid.
5. The camera boundary crossing handling method according to claim 4, characterized in that, Determining the retraction direction based on the current position and the boundary segment group includes: Calculate the vertical distance between the current position and each boundary segment in the boundary segment group; Determine the boundary segment containing the minimum vertical distance among the boundary segments in the boundary segment group, and calculate the intersection point between the boundary segment containing the minimum vertical distance and the current position; The retraction direction is determined based on the current position and the intersection point.
6. The camera boundary crossing handling method according to claim 4, characterized in that, Determining the retraction distance based on the current position and the centroid includes: Calculate the straight-line distance between the current position and the centroid; The product of the straight-line distance and the preset weighting coefficient is used as the back-off distance.
7. The camera boundary crossing handling method according to claim 1, characterized in that, Determining the retraction position based on the retraction direction and retraction distance includes: If the geographic information system is a three-dimensional information system, the current position, the rollback direction, and the rollback distance are used as input parameters of a preset interface. The preset interface is called to obtain the rollback position, wherein the preset interface is the interface corresponding to the three-dimensional information system, and the camera is rolled back.
8. A camera boundary crossing processing device, characterized in that, The device includes: The acquisition module is used to acquire the current location of the camera and the current map extent in the geographic information system; The judgment module is used to determine whether the camera has crossed the boundary based on the current position and the current map range; If so, the first determining module is used to determine the rollback direction and rollback distance based on the current location and the current map range; The second determining module is used to determine the retraction position based on the retraction direction and retraction distance, and move the camera to the retraction position.
9. An electronic device, characterized in that, include: The processor and memory, the memory storing machine-readable instructions executable by the processor, which, when the electronic device is running, are executed by the processor to perform the steps of the camera out-of-bounds handling method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the camera out-of-bounds handling method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Three-dimensional electronic map processing method and device and electronic equipment
CN113221044A
Dynamic effect generation method and device, medium and equipment
CN114911406A