Virtual space view angle positioning method and device, electronic equipment and storage medium

By taking the target object, the deployment and viewing angle parameters of the virtual camera are adjusted, and the airsickness problem caused by the user's fixed viewing angle in a large virtual space is solved, and the authenticity and comfort of the virtual experience are improved.

CN120580283APending Publication Date: 2025-09-02AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510709238.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-09-02

AI Technical Summary

Technical Problem

When users enter large virtual spaces, fixed viewing angles lead to airsickness, especially when they are not familiar with virtual spaces, they have poor experience.

Method used

By taking the image to be analyzed by shooting the target object, determining the target reference object, adjusting the deployment information and viewing angle parameters of the virtual camera based on the shooting association information, reference object size information and virtual camera viewing angle parameters, and fine-tuning using the structural similarity index to ensure the accurate positioning and viewing angle matching of the virtual camera in the virtual space.

Benefits of technology

It realizes the real-world perspective of the user more realistically in the virtual space, improves the user's virtual experience effect, and reduces the occurrence of airsickness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120580283A_ABST
    Figure CN120580283A_ABST
Patent Text Reader

Abstract

The invention discloses a virtual space visual angle positioning method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the photographing of a target object, obtaining a to-be-analyzed image, and determining a target reference object in the to-be-analyzed image; according to the shooting associated information of the target object, the size associated information of the target reference object and the visual angle parameter of the virtual camera, determining camera deployment information of the virtual camera in the virtual space; adjusting a virtual camera based on the camera deployment information, and shooting the target reference object based on the virtual camera to obtain a to-be-compared image; and determining a target visual angle parameter of the virtual camera based on the to-be-compared image and the to-be-analyzed image, and controlling the virtual camera to enter the virtual space based on the target visual angle parameter. The visual angle of the user in the real world is simulated more truly when the user enters the virtual space, and the virtual experience effect of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of virtual reality technology, and in particular to a method, device, electronic device and storage medium for positioning a virtual space perspective. Background Art

[0002] With the rapid development of virtual reality (VR) technology, users can have an immersive feeling through VR technology.

[0003] Currently, when users enter a virtual space through VR devices, the initial perspective is always fixed. If the virtual space is too large, the user may get lost. Since virtual reality is a 3D space, frequent use in unfamiliar virtual spaces may cause users to become motion sick.

[0004] In order to solve the above problems, it is necessary to improve the positioning method of virtual space perspective. Summary of the Invention

[0005] The present invention provides a method, device, electronic device and storage medium for positioning a virtual space perspective, so as to solve the problem in the prior art that the user's entry perspective is fixed when entering a virtual space, and the user may suffer from motion sickness when the virtual space is large or the user is unfamiliar with the virtual space.

[0006] In a first aspect, an embodiment of the present invention provides a method for positioning a virtual space perspective, comprising:

[0007] Photographing a target object to obtain an image to be analyzed, and determining a target reference object in the image to be analyzed;

[0008] Determining camera deployment information of a virtual camera in the virtual space based on the shooting-related information of the target object, the size-related information of the target reference object, and the viewing angle parameters of the virtual camera; wherein the shooting-related information includes positioning information and lens height when shooting the target object, and the camera deployment information includes a deployment position, lens orientation, lens deployment height, and lens deployment angle of the virtual camera;

[0009] adjusting the virtual camera based on the camera deployment information, and photographing the target reference object based on the virtual camera to obtain an image to be compared;

[0010] The target viewing angle parameters of the virtual camera are determined based on the image to be compared and the image to be analyzed, and the virtual camera is controlled to enter a virtual space based on the viewing angle parameters.

[0011] In a second aspect, an embodiment of the present invention further provides a virtual space perspective positioning device, including:

[0012] a target reference object determination module, configured to photograph a target object to obtain an image to be analyzed, and determine a target reference object in the image to be analyzed;

[0013] a camera deployment information determination module, configured to determine camera deployment information of a virtual camera in the virtual space based on the shooting-related information of the target object, the size-related information of the target reference object, and the viewing angle parameters of the virtual camera; wherein the shooting-related information includes positioning information and lens height when shooting the target object, and the camera deployment information includes the deployment position, lens orientation, lens deployment height, and lens deployment angle of the virtual camera;

[0014] a module for determining an image to be compared, configured to adjust the virtual camera based on the camera deployment information, and photograph the target reference object based on the virtual camera to obtain an image to be compared;

[0015] The viewing angle parameter determination module is used to determine the target viewing angle parameters of the virtual camera based on the image to be compared and the image to be analyzed, and control the virtual camera to enter the virtual space based on the viewing angle parameters.

[0016] In a third aspect, an embodiment of the present invention further provides an electronic device, including:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for positioning the virtual space perspective described in any embodiment of the present invention.

[0020] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for positioning the virtual space perspective described in any embodiment of the present invention when executed.

[0021] In a fifth aspect, an embodiment of the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method for positioning a virtual space perspective as described in any one of the embodiments of the present invention.

[0022] The technical solution of an embodiment of the present invention photographs a target object to obtain an image to be analyzed, and determines a target reference object in the image to be analyzed; determines camera deployment information for a virtual camera in a virtual space based on the target object's photographic information, the target reference object's size information, and the virtual camera's viewing angle parameters; adjusts the virtual camera based on the camera deployment information, and photographs the target reference object using the virtual camera to obtain an image to be compared; determines the target viewing angle parameters of the virtual camera based on the image to be compared and the image to be analyzed, and controls the virtual camera to enter the virtual space based on the target viewing angle parameters. This technical solution determines the user's center position information in the virtual space by obtaining positioning information when photographing the target object, thereby performing preliminary positioning of the virtual object in the virtual space. Furthermore, the lens deployment height of the virtual camera in the virtual space is calculated based on the lens height of the image capture device when the user photographs the target object, the size information of the target reference object, and the proportional relationship between the pixel size and the actual size of the target reference object. The virtual camera's lens deployment angle in virtual space is calculated based on the virtual camera's focal length, optical center position, and the intersection of the horizontal planes at the virtual camera's lens deployment height. The virtual camera is then initially positioned and adjusted based on the lens deployment height and angle. Furthermore, the virtual camera is fine-tuned based on the structural similarity index calculated between the image to be analyzed and the image to be compared. When the structural similarity index corresponding to the image to be compared, captured by the virtual camera, is less than a preset structural similarity index, the target viewing angle parameters corresponding to the virtual camera are determined, and the virtual camera is controlled to enter the virtual space using the target viewing angle parameters. This solves the problem of fixed viewing angles in existing technologies, which can cause motion sickness in large virtual spaces or when users are unfamiliar with them. This solution achieves a more realistic simulation of the user's real-world perspective when entering the virtual space, enhancing the user's virtual experience.

[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] Figure 1This is a flow chart of a method for positioning a virtual space perspective according to a first embodiment of the present invention;

[0026] Figure 2 This is a flow chart of a method for positioning a virtual space perspective according to a second embodiment of the present invention;

[0027] Figure 3 is a schematic diagram of a virtual camera photographing an object according to a second embodiment of the present invention;

[0028] Figure 4 This is a structural diagram of a virtual space perspective positioning device provided by Embodiment 3 of the present invention;

[0029] Figure 5 It is a structural diagram of an electronic device for implementing the positioning method of the virtual space perspective according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only embodiments of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention. The acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of this application, certain software, components, or models that already exist in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or must use the solution.

[0031] It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the present invention described herein can be practiced in an order other than that illustrated or described herein.

[0032] Example 1

[0033] Figure 1A flowchart of a method for positioning a virtual space perspective is provided for the first embodiment of the present invention. This embodiment can be applied to preliminarily positioning a virtual camera in a virtual space through positioning information of an image taken by a user, and preliminarily setting the camera parameters of the virtual camera by adjusting the lens deployment height and lens deployment angle of the virtual camera. Furthermore, the perspective parameters of the virtual camera are fine-tuned based on the structural similarity index between the image taken by the virtual camera and the image taken by the user, thereby more realistically simulating the user's perspective in the real world and improving the user experience when entering the virtual space. The method can be executed by a virtual space perspective positioning device, which can be implemented in the form of hardware and / or software, and can be configured in a computing device that can execute the virtual space perspective positioning method.

[0034] like Figure 1 As shown, the method includes:

[0035] S110 , photographing the target object to obtain an image to be analyzed, and determining a target reference object in the image to be analyzed.

[0036] The target object refers to the subject of a user's real-world image capture, which can be an object or a specific captured space. The image to be analyzed refers to an image captured by a user using a camera. The target reference object refers to the object in the image to be analyzed that corresponds to a landmark object in the captured space.

[0037] For example, taking the shooting space as an exhibition hall, the exhibition hall includes fixed basic equipment, electrical equipment, decorations, display cabinets, fixed lighting devices and signboards. When a user wants to enter the virtual space corresponding to the exhibition hall through a VR device, he can determine the user's perspective when entering the virtual space by shooting the objects in the exhibition hall.

[0038] For example, taking the interior of an exhibition hall as the target object, the user takes a photo of the interior of the exhibition hall to obtain an image to be analyzed. The image to be analyzed includes information such as fixed basic equipment, electrical equipment, decorations, and display cabinets. When determining the virtual space corresponding to the user entering the exhibition hall, spatial positioning can be performed through landmark objects in the exhibition hall, thereby determining the user's perspective when entering the virtual space.

[0039] Optionally, determining the target reference object in the image to be analyzed includes: performing target detection on the image to be analyzed to obtain at least one candidate reference object; and determining the candidate reference object with the highest priority as the target reference object based on a preset priority of the reference objects.

[0040] The candidate reference object refers to an object in the image to be analyzed that corresponds to a landmark object in the shooting space.

[0041] Generally, landmark objects within the captured space can be pre-defined. For example, landmark objects within the captured space can be fixed infrastructure, display cabinets, fixed lighting fixtures, and signage. Based on the above example, if the image to be analyzed includes information such as fixed infrastructure, electrical equipment, decorative objects, and display cabinets, the fixed infrastructure and display cabinets in the image to be analyzed can be used as candidate reference objects.

[0042] To more accurately determine the user's perspective when entering the virtual space, a target reference object can be determined from the fixed infrastructure devices and showcases based on a pre-set priority. If the fixed infrastructure device has the highest priority, the fixed infrastructure device can be used as the target reference object.

[0043] It is understandable that the priority of each candidate reference object can be set based on the spatial significance of the object, the uniqueness of the object, and the placement of the object. For example, the candidate reference objects can be set according to the size of the objects in the space, and the priority can be sorted from large to small according to the size of each object; it can also be that objects with uniqueness are used as candidate objects, and the importance of each object is prioritized; it can also be based on the placement of the object and the order in which the objects appear from left to right. Of course, the specific priority sorting of each object can be set according to actual needs, and the sorting method proposed in this technical solution is only an example.

[0044] It should be noted that if the image to be analyzed does not contain any candidate reference object, an abnormal prompt message will be fed back to prompt the user to re-photograph the target object.

[0045] The advantage of this setup is that, after a user captures an image, if the image to be analyzed doesn't contain any candidate reference objects, the user's location cannot be accurately located, and consequently, the user's perspective when entering the virtual space cannot be accurately determined. Therefore, if the image to be analyzed doesn't contain any candidate reference objects, a warning can be issued to the user, prompting them to re-capture the target object, allowing further analysis of the user's perspective when entering the virtual space.

[0046] S120 : Determine camera deployment information of the virtual camera in the virtual space according to the shooting association information of the target object, the size association information of the target reference object, and the viewing angle parameter of the virtual camera.

[0047] Among them, the shooting-related information includes the positioning information and lens height when shooting the target object, and the camera deployment information includes the deployment position, lens direction, lens deployment height and lens deployment angle of the virtual camera.

[0048] In practical applications, in order to make the virtual space more realistic, the size of objects in the virtual space can generally be set to be the same as the size of corresponding objects in the real world based on prior knowledge, so as to subsequently calculate the user's viewing position when entering the virtual space.

[0049] In a specific example, a user customizes their perspective in a virtual space by taking a photo through a terminal device, obtaining an image to be analyzed. Simultaneously, the user acquires shooting-related information corresponding to the target object, such as the user's positioning information and lens height. This positioning information is used to determine the user's center point position in the virtual space, as well as the user's virtual orientation in the virtual space. The virtual orientation information includes east, south, west, north, up, or down, among other directions.

[0050] Furthermore, the size information of the target object can be used to determine the size information associated with the target reference object. This information can be used to initially determine the user's position in the virtual space. To optimize the virtual camera's viewing angle parameters, the virtual camera can be used to photograph the target reference object, further adjusting the virtual camera's current viewing angle parameters and obtaining the corresponding camera deployment information.

[0051] S130 : Adjusting the virtual camera based on the camera deployment information, and photographing the target reference object based on the virtual camera to obtain an image to be compared.

[0052] On this basis, the 3D cube annotation algorithm in computer vision is used to annotate objects with bounding boxes, determine at least one object in the image to be analyzed, and determine at least one candidate reference object corresponding to the target object by comparing it with the pre-modeled reference objects in the modeling library. The target reference object is determined from at least one candidate reference object according to the priority corresponding to each candidate reference.

[0053] Furthermore, the camera deployment information of the virtual camera in the virtual space is determined based on the shooting association information of the target object of the image to be analyzed, the size association information of the target reference object, and the viewing angle parameters of the virtual camera. The target reference object is photographed by the virtual camera to obtain the image to be compared.

[0054] S140 : Determine target viewing angle parameters of the virtual camera based on the image to be compared and the image to be analyzed, and control the virtual camera to enter the virtual space based on the target viewing angle parameters.

[0055] Based on the above example, the viewing angle parameters of the virtual camera are fine-tuned by calculating the structural similarity index (SSIM) between the image to be compared and the image to be analyzed. When the structural similarity index is less than the preset structural similarity index, the target viewing angle parameters of the virtual camera are determined, and the virtual camera is controlled to enter the virtual space based on the target viewing angle parameters.

[0056] In this technical solution, when the image error between the image to be compared and the image to be analyzed is less than a preset error, it can be assumed that the user's perspective when entering the virtual space is closest to the user's perspective in the real world. Therefore, the camera parameters of the virtual camera used when the image error between the image to be compared and the image to be analyzed is less than the preset image error are used as the target perspective parameters. Based on this, adjusting the virtual camera parameters based on the target perspective parameters and controlling the virtual camera to enter the virtual space based on the target perspective parameters can more realistically simulate the user's perspective in the real environment, thereby improving the user's virtual experience.

[0057] The technical solution of an embodiment of the present invention photographs a target object to obtain an image to be analyzed, and determines a target reference object in the image to be analyzed; determines camera deployment information for a virtual camera in a virtual space based on the target object's photographic information, the target reference object's size information, and the virtual camera's viewing angle parameters; adjusts the virtual camera based on the camera deployment information, and photographs the target reference object using the virtual camera to obtain an image to be compared; determines the target viewing angle parameters of the virtual camera based on the image to be compared and the image to be analyzed, and controls the virtual camera to enter the virtual space based on the target viewing angle parameters. This technical solution determines the user's center position information in the virtual space by obtaining positioning information when photographing the target object, thereby performing preliminary positioning of the virtual object in the virtual space. Furthermore, the lens deployment height of the virtual camera in the virtual space is calculated based on the lens height of the image capture device when the user photographs the target object, the size information of the target reference object, and the proportional relationship between the pixel size and the actual size of the target reference object. The virtual camera's lens deployment angle in virtual space is calculated based on the virtual camera's focal length, optical center position, and the intersection of the horizontal planes at the virtual camera's lens deployment height. The virtual camera is then initially positioned and adjusted based on the lens deployment height and angle. Furthermore, the virtual camera is fine-tuned based on the structural similarity index calculated between the image to be analyzed and the image to be compared. When the structural similarity index corresponding to the image to be compared, captured by the virtual camera, is less than a preset structural similarity index, the target viewing angle parameters corresponding to the virtual camera are determined, and the virtual camera is controlled to enter the virtual space using the target viewing angle parameters. This solves the problem of fixed viewing angles in existing technologies, which can cause motion sickness in large virtual spaces or when users are unfamiliar with them. This solution achieves a more realistic simulation of the user's real-world perspective when entering the virtual space, enhancing the user's virtual experience.

[0058] Example 2

[0059] Figure 2A flowchart of a method for positioning a virtual space perspective is provided in Example 2 of the present invention. Optionally, the camera deployment information of the virtual camera in the virtual space is determined based on the shooting association information of the target object, the size association information of the target reference object and the perspective parameters of the virtual camera.

[0060] like Figure 2 As shown, the method includes:

[0061] S210: Photograph the target object to obtain an image to be analyzed, and determine a target reference object in the image to be analyzed.

[0062] S220 , obtaining actual positioning information and actual orientation information of the image capturing device when capturing the target object, and mapping the actual positioning information and actual orientation information to the virtual space to obtain the deployment position and lens orientation of the virtual camera in the virtual space.

[0063] S230: Based on the preset target model, the lens height when shooting the target object, the viewing angle parameters of the virtual camera, and the size association information of the target reference object are processed to obtain the lens deployment height and lens deployment angle of the virtual camera in the virtual space.

[0064] In this technical solution, the target model includes a lens height determination function and an angle determination function. Based on the lens height determination function, the lens height of the image capture device and the pixel height of the target reference object are calculated to obtain the lens deployment height corresponding to the virtual camera; based on the angle determination function, the focal length, optical center position and intersection position of the horizontal plane where the lens deployment height is located of the virtual camera are calculated and processed to obtain the lens deployment angle determined by the virtual camera.

[0065] The lens deployment angle is the angle between the lens of the virtual camera and the horizontal plane.

[0066] In this technical solution, the target reference object in the image to be analyzed is scanned for pixels to obtain the pixel height corresponding to the target reference object. Figure 3 As shown, the pixel size of the target reference object in the image to be analyzed is measured, for example, the width or height of the target reference object in the image to be analyzed is calculated. Since the size of the object in the virtual space is consistent with the size of the corresponding object in the real world, the proportional relationship between the target reference object in the real world and the virtual space can be calculated by calculating the pixel height of the target reference object. Furthermore, if the lens height corresponding to the image capture device when the user shoots the target object is known, the lens deployment height corresponding to the virtual camera can be obtained based on the lens height of the image capture device and the pixel height of the target reference object, as well as the proportional relationship.

[0067] Specifically, the lens height determination function can be expressed by the following formula:

[0068]

[0069] Where H represents the lens deployment height of the virtual camera, h represents the actual height of the target object, (vo-vb) represents the pixel height of the target reference object, and vt-vb represents the lens height of the image capture device.

[0070] In this technical solution, the angle determination function can be expressed by the following formula:

[0071]

[0072] Among them, θ represents the angle between the lens of the virtual camera and the horizontal plane, f represents the focal length of the virtual camera, vo represents the position of the optical center, and vc represents the intersection position of the horizontal plane where the lens deployment height is located.

[0073] S240 : Adjust the virtual camera based on the camera deployment information, and shoot the target reference object based on the virtual camera to obtain an image to be compared.

[0074] S250 : Determine target viewing angle parameters of the virtual camera based on the image to be compared and the image to be analyzed, and control the virtual camera to enter the virtual space based on the target viewing angle parameters.

[0075] In practical applications, target viewing angle parameters of a virtual camera are determined based on the image to be compared and the image to be analyzed, and the virtual camera is controlled to enter a virtual space based on the target viewing angle parameters, including: determining a structural similarity index of the image to be compared and the image to be analyzed; if the structural similarity index is greater than a preset structural similarity index, the current viewing angle parameters of the virtual camera are used as target viewing angle parameters, and the virtual camera is controlled to enter a virtual space based on the target viewing angle parameters.

[0076] Among them, the Structural Similarity Index (SSIM) is an indicator that measures the similarity between two images and is often used in image quality assessment. SSIM evaluates image similarity by comparing image brightness, contrast, and structure.

[0077] Specifically, after the virtual camera is initially positioned, in order to more realistically simulate the user's perspective in the real world, the perspective parameters of the virtual camera need to be further adjusted so that the virtual camera is closer to the camera deployment information of the image capture device.

[0078] For example, after initially positioning the virtual camera, the virtual camera is moved to the corresponding position, and the virtual camera's perspective is fine-tuned within a certain range to adjust the virtual camera's perspective parameters based on the perspective parameters corresponding to the optimal perspective. On this basis, to save time and reduce the workload when comparing images, a structural similarity index can be introduced to calculate the image similarity between the image to be analyzed and the image to be compared, while simultaneously adjusting the virtual camera's perspective parameters. If the structural similarity index is greater than a preset structural similarity index, it indicates that the image similarity between the image to be compared and the image to be analyzed is high. When the user enters the virtual space with the virtual camera's current perspective, the virtual environment upon entering the virtual space closely matches the user's current real environment and is more consistent with the user's observation perspective in the real world. At this point, the virtual camera's current perspective parameters are used as target perspective parameters, and the virtual camera is controlled to enter the virtual space based on the target perspective parameters.

[0079] Optionally, if the structural similarity index is less than a preset structural similarity index, at least one set of candidate viewing angle parameters is determined, and the virtual camera is controlled to shoot the target reference object based on each candidate viewing angle parameter to obtain a corresponding candidate image; from each candidate image, the candidate viewing angle parameters corresponding to the candidate image whose structural similarity index with the image to be analyzed is greater than the preset structural similarity index are used as the viewing angle parameters of the virtual camera.

[0080] The candidate viewing angle parameters refer to the camera parameters used to adjust the lens deployment height and lens deployment angle of the virtual camera when fine-tuning the virtual camera. The candidate image is the image obtained by photographing the target reference object with the virtual camera after adjusting the virtual camera parameters based on the candidate viewing angle parameters.

[0081] Specifically, if the structural similarity index is less than the preset structural similarity index, it means that the image similarity between the image to be compared and the image to be analyzed is low. When the user enters the virtual space with the current perspective of the virtual camera, the virtual environment when the user enters the virtual space has a low match with the user's current real environment, which does not conform to the user's observation perspective in the real world. Therefore, the perspective parameters of the virtual camera need to be adjusted.

[0082] For example, since the virtual camera has already been preliminarily positioned, only minor adjustments need to be made to the virtual camera when adjusting it. For example, the virtual camera's viewing angle adjustment range can be predefined, and multiple shooting points can be set within the viewing angle adjustment range. When adjusting the virtual camera, the virtual camera is adjusted based on the viewing angle parameters corresponding to each shooting point, obtaining candidate images captured by the virtual camera at each shooting point. Furthermore, the structural similarity index of each candidate image is compared with the image to be analyzed, and the candidate viewing angle parameters corresponding to the candidate image whose structural similarity index with the image to be analyzed is greater than the preset structural similarity index are used as the viewing angle parameters of the virtual camera.

[0083] It should be noted that when shooting candidate images based on a virtual camera, the structural similarity index of the candidate image and the image to be analyzed can be compared one by one, that is, the structural similarity index of the candidate image and the image to be analyzed is calculated every time a candidate image is shot, until a candidate image with a structural similarity index greater than a preset structural similarity index appears, and the viewing angle parameters of the virtual camera when shooting the candidate image are used as the target viewing angle parameters.

[0084] The advantage of this setting is that candidate images that meet the structural similarity index can be quickly found, thereby improving the speed of determining the viewing angle parameters of the virtual camera.

[0085] Alternatively, it is also possible to capture images at each shooting point based on a virtual camera, and after obtaining a group of candidate images, compare the structural similarity index between each candidate image and the image to be analyzed, and use the viewing angle parameters corresponding to the candidate image corresponding to the largest structural similarity index as the target viewing angle parameters of the virtual camera.

[0086] The advantage of this setting is that by traversing the candidate images corresponding to each shooting point and selecting the candidate image closest to the image to be analyzed, the virtual camera is adjusted based on the viewing angle parameters of the candidate image as the target viewing angle parameters of the virtual camera, so that the user's viewing angle when entering the virtual space can be closer to the user's viewing angle in the real world.

[0087] The technical solution of an embodiment of the present invention photographs a target object to obtain an image to be analyzed, and determines a target reference object in the image to be analyzed; determines camera deployment information for a virtual camera in a virtual space based on the target object's photographic information, the target reference object's size information, and the virtual camera's viewing angle parameters; adjusts the virtual camera based on the camera deployment information, and photographs the target reference object using the virtual camera to obtain an image to be compared; determines the target viewing angle parameters of the virtual camera based on the image to be compared and the image to be analyzed, and controls the virtual camera to enter the virtual space based on the target viewing angle parameters. This technical solution determines the user's center position information in the virtual space by obtaining positioning information when photographing the target object, thereby performing preliminary positioning of the virtual object in the virtual space. Furthermore, the lens deployment height of the virtual camera in the virtual space is calculated based on the lens height of the image capture device when the user photographs the target object, the size information of the target reference object, and the proportional relationship between the pixel size and the actual size of the target reference object. The virtual camera's lens deployment angle in virtual space is calculated based on the virtual camera's focal length, optical center position, and the intersection of the horizontal planes at the virtual camera's lens deployment height. The virtual camera is then initially positioned and adjusted based on the lens deployment height and angle. Furthermore, the virtual camera is fine-tuned based on the structural similarity index calculated between the image to be analyzed and the image to be compared. When the structural similarity index corresponding to the image to be compared, captured by the virtual camera, is less than a preset structural similarity index, the target viewing angle parameters corresponding to the virtual camera are determined, and the virtual camera is controlled to enter the virtual space using the target viewing angle parameters. This solves the problem of fixed viewing angles in existing technologies, which can cause motion sickness in large virtual spaces or when users are unfamiliar with them. This solution achieves a more realistic simulation of the user's real-world perspective when entering the virtual space, enhancing the user's virtual experience.

[0088] Example 3

[0089] Figure 4 This is a structural diagram of a virtual space perspective positioning device provided by the third embodiment of the present invention. Figure 4 As shown, the apparatus includes: a target reference object determination module 310 , a camera deployment information determination module 320 , a to-be-compared image determination module 330 and a viewing angle parameter determination module 340 .

[0090] The target reference object determination module 310 is configured to photograph the target object to obtain an image to be analyzed, and determine the target reference object in the image to be analyzed;

[0091] A camera deployment information determination module 320 is configured to determine camera deployment information of a virtual camera in a virtual space based on the shooting-related information of the target object, the size-related information of the target reference object, and the viewing angle parameters of the virtual camera; wherein the shooting-related information includes positioning information and lens height when shooting the target object, and the camera deployment information includes the deployment position, lens orientation, lens deployment height, and lens deployment angle of the virtual camera;

[0092] The image to be compared determination module 330 is used to adjust the virtual camera based on the camera deployment information, and shoot the target reference object based on the virtual camera to obtain the image to be compared;

[0093] The viewing angle parameter determination module 340 is configured to determine target viewing angle parameters of the virtual camera based on the image to be compared and the image to be analyzed, and control the virtual camera to enter the virtual space based on the target viewing angle parameters.

[0094] The technical solution of an embodiment of the present invention photographs a target object to obtain an image to be analyzed, and determines a target reference object in the image to be analyzed; determines camera deployment information for a virtual camera in a virtual space based on the target object's photographic information, the target reference object's size information, and the virtual camera's viewing angle parameters; adjusts the virtual camera based on the camera deployment information, and photographs the target reference object using the virtual camera to obtain an image to be compared; determines the target viewing angle parameters of the virtual camera based on the image to be compared and the image to be analyzed, and controls the virtual camera to enter the virtual space based on the target viewing angle parameters. This technical solution determines the user's center position information in the virtual space by obtaining positioning information when photographing the target object, thereby performing preliminary positioning of the virtual object in the virtual space. Furthermore, the lens deployment height of the virtual camera in the virtual space is calculated based on the lens height of the image capture device when the user photographs the target object, the size information of the target reference object, and the proportional relationship between the pixel size and the actual size of the target reference object. The virtual camera's lens deployment angle in virtual space is calculated based on the virtual camera's focal length, optical center position, and the intersection of the horizontal planes at the virtual camera's lens deployment height. The virtual camera is then initially positioned and adjusted based on the lens deployment height and angle. Furthermore, the virtual camera is fine-tuned based on the structural similarity index calculated between the image to be analyzed and the image to be compared. When the structural similarity index corresponding to the image to be compared, captured by the virtual camera, is less than a preset structural similarity index, the target viewing angle parameters corresponding to the virtual camera are determined, and the virtual camera is controlled to enter the virtual space using the target viewing angle parameters. This solves the problem of fixed viewing angles in existing technologies, which can cause motion sickness in large virtual spaces or when users are unfamiliar with them. This solution achieves a more realistic simulation of the user's real-world perspective when entering the virtual space, enhancing the user's virtual experience.

[0095] Optionally, the target reference object determination module includes: a candidate reference object determination unit, configured to perform target detection on the image to be analyzed to obtain at least one candidate reference object;

[0096] The target reference object determining unit is configured to determine the candidate reference object with the highest priority as the target reference object according to a preset reference object priority.

[0097] Optionally, the target reference object determination module is further configured to feed back abnormal prompt information if the target reference object is not included in the image to be analyzed, so as to prompt the user to re-photograph the target object.

[0098] Optionally, the camera deployment information determination module includes: a mapping determination unit, configured to obtain actual positioning information and actual orientation information of the image capture device when capturing the target object, and map the actual positioning information and actual orientation information to the virtual space to obtain a deployment position and lens orientation of the virtual camera in the virtual space;

[0099] The angle and height determination unit is used to process the lens height, the viewing angle parameters of the virtual camera and the size association information of the target reference object when shooting the target object based on a preset target model, and obtain the lens deployment height and lens deployment angle of the virtual camera in the virtual space.

[0100] Optionally, the angle and height determination unit includes: a height determination subunit, configured to calculate the lens height of the image capture device and the pixel height of the target reference object based on a lens height determination function to obtain a lens deployment height corresponding to the virtual camera;

[0101] The angle determination subunit is used to calculate and process the focal length, optical center position and intersection position of the horizontal plane where the lens deployment height of the virtual camera is located based on the angle determination function to obtain the lens deployment angle determined by the virtual camera; wherein the lens deployment angle is the angle between the lens of the virtual camera and the horizontal plane.

[0102] Optionally, the viewing angle parameter determination module includes: an index determination unit, configured to determine a structural similarity index between the image to be compared and the image to be analyzed;

[0103] The first viewing angle parameter determining unit is configured to use the current viewing angle parameter of the virtual camera as the target viewing angle parameter if the structural similarity index is greater than a preset structural similarity index, and control the virtual camera to enter the virtual space based on the target viewing angle parameter.

[0104] Optionally, the viewing angle parameter determination module further includes: a candidate image determination unit, configured to determine at least one set of candidate viewing angle parameters if the structural similarity index is less than a preset structural similarity index, and control the virtual camera to shoot the target reference object based on each candidate viewing angle parameter to obtain a corresponding candidate image;

[0105] The second viewing angle parameter determination unit is configured to select, from among the candidate images, candidate viewing angle parameters corresponding to candidate images having a structural similarity index with the image to be analyzed greater than a preset structural similarity index as target viewing angle parameters of the virtual camera.

[0106] The virtual space perspective positioning device provided by the embodiment of the present invention can execute the virtual space perspective positioning method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0107] Example 4

[0108] Figure 5 A schematic diagram of the structure of an electronic device 10 of an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0109] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0110] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0111] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the method for positioning the virtual space perspective.

[0112] In some embodiments, the method for locating a virtual space perspective can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for locating a virtual space perspective described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the method for locating a virtual space perspective in any other appropriate manner (e.g., via firmware).

[0113] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0114] The computer programs for implementing the virtual space perspective positioning method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0115] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0116] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0117] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0118] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0119] Example 5

[0120] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the method for positioning the virtual space perspective provided in any embodiment of the present application.

[0121] The computer program product may be implemented by writing computer program code for performing the operations of the present invention in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0122] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0123] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A method for positioning a virtual space perspective, characterized in that: include: Photographing a target object to obtain an image to be analyzed, and determining a target reference object in the image to be analyzed; Determining camera deployment information of a virtual camera in the virtual space based on the shooting-related information of the target object, the size-related information of the target reference object, and the viewing angle parameters of the virtual camera; wherein the shooting-related information includes positioning information and lens height when shooting the target object, and the camera deployment information includes a deployment position, lens orientation, lens deployment height, and lens deployment angle of the virtual camera; adjusting the virtual camera based on the camera deployment information, and photographing the target reference object based on the virtual camera to obtain an image to be compared; The target viewing angle parameters of the virtual camera are determined based on the image to be compared and the image to be analyzed, and the virtual camera is controlled to enter the virtual space based on the target viewing angle parameters.

2. The method according to claim 1, characterized in that The determining of the target reference object in the image to be analyzed includes: Performing target detection on the image to be analyzed to obtain at least one candidate reference object; According to the preset priorities of the reference objects, the candidate reference object with the highest priority is determined as the target reference object.

3. The method according to claim 2, characterized in that Also includes: If the target reference object is not included in the image to be analyzed, an abnormal prompt message is fed back to prompt the user to re-photograph the target object.

4. The method according to claim 1, wherein The determining, according to the shooting association information of the target object, the size association information of the target reference object, and the viewing angle parameter of the virtual camera, camera deployment information of the virtual camera in the virtual space includes: Acquiring actual positioning information and actual orientation information of an image capturing device when capturing the target object, and mapping the actual positioning information and the actual orientation information to a virtual space to obtain a deployment position and lens orientation of a virtual camera in the virtual space; Based on a preset target model, the lens height when shooting the target object, the viewing angle parameters of the virtual camera and the size association information of the target reference object are processed to obtain the lens deployment height and lens deployment angle of the virtual camera in the virtual space.

5. The method according to claim 4, characterized in that The target model includes a lens height determination function and an angle determination function. The lens height when photographing the target object, the viewing angle parameters of the virtual camera, and the size association information of the target reference object are processed based on the preset target model to obtain the lens deployment height and lens deployment angle of the virtual camera in the virtual space, including: Calculating the lens height of the image capture device and the pixel height of the target reference object based on the lens height determination function to obtain a lens deployment height corresponding to the virtual camera; Based on the angle determination function, the focal length, optical center position of the virtual camera and the intersection position of the horizontal plane at the lens deployment height are calculated and processed to obtain the lens deployment angle determined by the virtual camera; wherein, the lens deployment angle is the angle between the lens of the virtual camera and the horizontal plane.

6. The method according to claim 1, wherein The determining the target viewing angle parameter of the virtual camera based on the image to be compared and the image to be analyzed, and controlling the virtual camera to enter the virtual space based on the target viewing angle parameter, includes: Determining a structural similarity index between the image to be compared and the image to be analyzed; If the structural similarity index is greater than a preset structural similarity index, the current viewing angle parameter of the virtual camera is used as a target viewing angle parameter, and the virtual camera is controlled to enter the virtual space based on the target viewing angle parameter.

7. The method according to claim 6, characterized in that Also includes: If the structural similarity index is less than a preset structural similarity index, determining at least one set of candidate viewing angle parameters, and controlling the virtual camera to shoot the target reference object based on each candidate viewing angle parameter to obtain a corresponding candidate image; From each candidate image, a candidate viewing angle parameter corresponding to a candidate image having a structural similarity index greater than the preset structural similarity index with the image to be analyzed is used as a target viewing angle parameter of the virtual camera.

8. A virtual space perspective positioning device, characterized in that: include: a target reference object determination module, configured to photograph a target object to obtain an image to be analyzed, and determine a target reference object in the image to be analyzed; a camera deployment information determination module, configured to determine camera deployment information of a virtual camera in the virtual space based on the shooting-related information of the target object, the size-related information of the target reference object, and the viewing angle parameters of the virtual camera; wherein the shooting-related information includes positioning information and lens height when shooting the target object, and the camera deployment information includes the deployment position, lens orientation, lens deployment height, and lens deployment angle of the virtual camera; a module for determining an image to be compared, configured to adjust the virtual camera based on the camera deployment information, and photograph the target reference object based on the virtual camera to obtain an image to be compared; The viewing angle parameter determination module is used to determine the target viewing angle parameters of the virtual camera based on the image to be compared and the image to be analyzed, and control the virtual camera to enter the virtual space based on the viewing angle parameters.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the method for positioning the virtual space perspective according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for positioning the virtual space perspective according to any one of claims 1 to 7 when executed.