A panoramic image loading method and apparatus
By pre-setting panoramic images with lower and higher resolutions, the lower-resolution image is loaded and displayed first, and then replaced with the high-resolution area when a trigger command is detected. This solves the problem of slow panoramic image loading speed and improves the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
- Filing Date
- 2021-02-07
- Publication Date
- 2026-05-26
AI Technical Summary
Panoramic images load slowly, impacting user experience.
Multiple lower-resolution first images and higher-resolution second images are pre-set. The first image is loaded first to display the panoramic view, and when a trigger command is detected, the second image area is replaced.
The loading speed of panoramic images has been improved, enhancing the user experience.
Smart Images

Figure CN114092362B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for loading panoramic images. Background Technology
[0002] With the development of computer technology, panoramic images have emerged. Panoramic images are essentially created by stitching together several high-definition images, allowing users to see a more complete scene from multiple angles. They have wide applications in fields such as gaming, real estate rentals, and VR.
[0003] However, during the image loading process, the panoramic image contains multiple high-resolution images, resulting in a slower loading speed and a reduced user experience. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a panoramic image loading method and apparatus. The method pre-sets that the panoramic image to be loaded corresponds to multiple lower-resolution first images and multiple higher-resolution second images, with the content of the first and second images being identical. Upon receiving an image loading request, the lower-resolution first images are loaded first to display the panoramic image. When a trigger command for the panoramic image is detected, the first image area indicated by the trigger command is replaced with the higher-resolution second image area. This not only improves the loading speed of the panoramic image but also enhances the user experience.
[0005] To achieve the above objectives, according to one aspect of the present invention, a panoramic image loading method is provided.
[0006] A panoramic image loading method according to an embodiment of the present invention includes:
[0007] Receive an image loading request. The image loading request indicates the panoramic image to be loaded. The panoramic image corresponds to multiple first images and multiple second images. The content of the second image is the same as the corresponding first image, and the resolution of the second image is greater than the resolution of the corresponding first image.
[0008] Based on the image loading request, load the first image corresponding to the second image to display the panoramic image;
[0009] When a trigger command for a panoramic image is detected, determine the target first image indicated by the trigger command, and the first image region within the target first image;
[0010] In the target second image corresponding to the target first image, determine the second image region corresponding to the region of the first image, and replace the first image region in the panoramic image with the second image region.
[0011] Optionally,
[0012] If no trigger command for the panoramic image is detected, the first image is replaced with the second image according to the first preset order.
[0013] Optionally,
[0014] Based on the image loading requests, load the first images corresponding to the second images, including:
[0015] According to the second preset order, the pixel values of multiple first images are saved into an array in sequence; where the second preset order is the order in which the panoramic image is obtained from multiple first images.
[0016] Optionally,
[0017] Replacing the first image region in the panoramic image with the second image region includes:
[0018] Replace the pixel values corresponding to the first image region stored in the array with the pixel values corresponding to the second image region, so as to replace the first image region with the second image region.
[0019] Optionally,
[0020] The second image consists of multiple second sub-images;
[0021] Replacing the first image region in the panoramic image with the second image region includes:
[0022] Identify the target second sub-image corresponding to the region in the first image from multiple second sub-images;
[0023] Load and display the second sub-image of the target to cover the area of the first image.
[0024] Optionally,
[0025] The first image is composed of multiple first sub-images, and the first sub-images correspond one-to-one with the second sub-images;
[0026] Replacing the first image region in the panoramic image with the second image region includes:
[0027] Identify the target first sub-image corresponding to the region of the first image from multiple first sub-images;
[0028] Replace the first sub-image of the target with the second sub-image of the target.
[0029] Optionally,
[0030] The method also includes:
[0031] Calculate the ratio of the size of the first image to the size of the second image;
[0032] When the ratio is less than 1, perform the following for each first image:
[0033] Based on the ratio, the first image is enlarged by the corresponding factor so that the size of the first image is equal to the size of the second image.
[0034] Optionally,
[0035] When the method is applied to a VR skybox, after loading the first images corresponding to multiple second images, it also includes:
[0036] The scene in the VR skybox is rendered based on the first image and the preset first rendering strategy.
[0037] Optionally,
[0038] After replacing the first image region in the panoramic image with the second image region, the process also includes:
[0039] The scene in the VR skybox is rendered based on the second image area and the preset second rendering strategy.
[0040] Optionally,
[0041] The change command can be any of the following: zoom in, focus, or crop.
[0042] To achieve the above objectives, according to another aspect of the present invention, a panoramic image loading device is provided.
[0043] A panoramic image loading device according to an embodiment of the present invention includes a request receiving module, an image loading module, an image determining module, and an image replacement module; wherein:
[0044] The request receiving module is used to receive image loading requests. The image loading request indicates the panoramic image to be loaded. The panoramic image corresponds to multiple first images and multiple second images. The content of the second image is the same as the corresponding first image, and the resolution of the second image is greater than the resolution of the corresponding first image.
[0045] The image loading module is used to load multiple first images corresponding to second images according to the image loading request, so as to display the panoramic image;
[0046] The image determination module is used to determine the target first image indicated by the triggering command and the first image region in the target first image when a triggering command for a panoramic image is detected.
[0047] The image replacement module is used to determine the second image region corresponding to the first image region in the target second image corresponding to the target first image, and to replace the first image region in the panoramic image with the second image region.
[0048] To achieve the above objectives, according to another aspect of the present invention, a panoramic image loading electronic device is provided.
[0049] An electronic device for loading panoramic images according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement a panoramic image loading method according to an embodiment of the present invention.
[0050] To achieve the above objectives, according to another aspect of the present invention, a computer-readable storage medium is provided.
[0051] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a panoramic image loading method according to an embodiment of the present invention.
[0052] One embodiment of the above invention has the following advantages or beneficial effects: The panoramic image to be loaded is pre-set to correspond to multiple lower-resolution first images and multiple higher-resolution second images, with the first and second images having the same content. Upon receiving an image loading request, the lower-resolution first images can be loaded first to display the panoramic image. When a trigger command for the panoramic image is detected, the first image area indicated by the trigger command is replaced with the higher-resolution second image area, thereby not only improving the loading speed of the panoramic image but also enhancing the user experience.
[0053] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0054] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0055] Figure 1 This is a schematic diagram of the main steps of a panoramic image loading method according to an embodiment of the present invention;
[0056] Figure 2 It is a first image;
[0057] Figure 3 This is a diagram illustrating the resize operation performed on the first image;
[0058] Figure 4 This is the first image obtained after the Resize operation;
[0059] Figure 5 This is a schematic diagram of the main steps of a method for rendering a scene in a VR skybox according to an embodiment of the present invention;
[0060] Figure 6 This is a schematic diagram of the main steps of a method for replacing a first image region in a panoramic image with a second image region according to an embodiment of the present invention;
[0061] Figure 7 It is the first image displayed;
[0062] Figure 8 This is a schematic diagram of the main steps of a method for covering a first image area with a target second sub-image according to an embodiment of the present invention;
[0063] Figure 9 It is another way of presenting the first image;
[0064] Figure 10 This is a schematic diagram of the main modules of a panoramic image loading device according to an embodiment of the present invention;
[0065] Figure 11 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0066] Figure 12 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0067] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0068] It should be noted that, unless otherwise specified, the embodiments of the present invention and the technical features thereof can be combined with each other.
[0069] Figure 1 This is a schematic diagram of the main steps of a panoramic image loading method according to an embodiment of the present invention.
[0070] like Figure 1 As shown, a panoramic image loading method according to an embodiment of the present invention mainly includes the following steps:
[0071] Step S101: Receive an image loading request. The image loading request indicates the panoramic image to be loaded. The panoramic image corresponds to multiple first images and multiple second images. The content of the second image is the same as the corresponding first image, and the resolution of the second image is greater than the resolution of the corresponding first image.
[0072] In this embodiment of the invention, the panoramic image corresponds to two sets of planar images: one set consists of multiple first images with lower resolution, and the other set consists of multiple second images with higher resolution. The first images and the second images correspond one-to-one, and the content of the first images and the second images is the same.
[0073] Step S102: Based on the image loading request, load the first images corresponding to the second images respectively to display the panoramic image.
[0074] In a preferred embodiment of the present invention, the panoramic image loading method proposed in this solution is applied to a VR skybox. In this case, before loading the first image, the method further includes: initializing the 3D scene and creating the skybox.
[0075] In this embodiment of the invention, when loading multiple first images, the pixel values of the multiple first images can be sequentially saved into an array according to a second preset order for obtaining the panoramic image from the multiple first images. In a preferred embodiment of the invention, the panoramic image in the VR skybox corresponds to six first images. Therefore, the pixel values of the six first images can be sequentially stored into the textureList array according to the second preset order, i.e., the order of positive x-axis direction, negative x-axis direction, positive y-axis direction, negative y-axis direction, positive z-axis direction, and negative z-axis direction.
[0076] In this embodiment of the invention, the ratio of the size of the first image to the size of the second image can be further calculated. When the ratio is less than 1, it means that the panoramic image obtained by stitching together the first image is smaller than the panoramic image obtained by stitching together the second image. When the second image is used to replace the first image, the panoramic image will be distorted, affecting the user experience. Therefore, for each first image, it is necessary to perform the following: according to the ratio, enlarge the first image by the corresponding factor so that the size of the first image is equal to the size of the second image, so that the user cannot perceive the image replacement process during the loading of the panoramic image and ensures the user experience.
[0077] In a preferred embodiment of the present invention, after storing the pixel values of six first images into a textureList array, an off-screen FBO (Frame Buffer Object) can be created in the VR skybox using a canvas. The viewport size of this off-screen FBO is the same as the size of the second images. Then, the pixel values stored in the textureList array are read sequentially, and each first image is drawn onto the off-screen FBO. When the ratio of the size of the first image to the size of the second image is less than 1, the first image drawn on the off-screen FBO is as follows: Figure 2 As shown, therefore, a resize operation needs to be performed on the first image drawn on the off-screen FBO, such as... Figure 3As shown, the first image is enlarged by a corresponding factor based on the ratio, so that the size of the first image is equal to the viewport size of the off-screen FBO. At this point, the size of the first image is also equal to the size of the second image. Figure 4 As shown, this allows users to remain unaware of the image replacement process during panoramic image loading, thus ensuring a positive user experience.
[0078] In a preferred embodiment of the present invention, after performing a Resize operation on the first image, the pixel values in the textureList array can be replaced with the pixel values of the enlarged first image.
[0079] In this embodiment of the invention, after loading the first images corresponding to multiple second images, the scene in the VR skybox can be rendered according to the first images and a preset first rendering strategy. In a preferred embodiment of the invention, the pixel values of the enlarged first images in the textureList array can be read, and the scene in the VR skybox can be rendered according to the first rendering strategy. The specific rendering method is as follows: Figure 5 As shown, the method mainly includes the following steps:
[0080] Step S501: Clear the buffer;
[0081] Step S502: Enable a_position;
[0082] Step S503: Bind the buffer;
[0083] Step S504: Set a_position;
[0084] Step S505: Enable a_textcoord;
[0085] Step S506: Bind the buffer;
[0086] Step S507: Set a_textcoord;
[0087] Step S508: Bind the frame buffer;
[0088] Step S509: Set the viewport size;
[0089] Step S510: Bind the first image;
[0090] Step S511: Enable texture channel 0;
[0091] Step S512: Draw keyframes.
[0092] Through the above steps S101 and S102, the panoramic image is initially loaded, and the user can then see the low-resolution scene.
[0093] Step S103: When a trigger command for a panoramic image is detected, determine the target first image indicated by the trigger command, and the first image region in the target first image.
[0094] In this embodiment of the invention, the change instruction is any one of the following: zoom-in instruction, focus instruction, or cropping instruction.
[0095] Step S104: In the target second image corresponding to the target first image, determine the second image region corresponding to the first image region, and replace the first image region in the panoramic image with the second image region.
[0096] In this embodiment of the invention, when no trigger command for the panoramic image is detected, multiple second images can be downloaded concurrently. Then, according to a first preset order, the first image is replaced with the second image, thereby gradually replacing the low-resolution first image with the high-resolution second image without the user's notice, further ensuring a better user experience. The first preset order can be the same as the second preset order, i.e., replacing the first image with the second image in the VR skybox in the order of positive x-axis, negative x-axis, positive y-axis, negative y-axis, positive z-axis, and negative z-axis, or it can be different from the second preset order; this solution does not specifically limit this.
[0097] In this embodiment of the invention, when a trigger command for a panoramic image is detected, it indicates that the user has performed zooming, focusing, or cropping operations on the first image. At this time, the lower-resolution first image may exhibit noise, affecting the user experience. Therefore, it is necessary to pause the process of replacing the first image with the second image according to the first preset order. Instead, the target first image indicated by the trigger command and the first image region within the target first image are determined first. This allows for the subsequent replacement of the low-resolution first image region with a high-resolution second image region, preventing the loaded low-resolution first image from negatively impacting the user experience. After replacing the low-resolution first image region with the high-resolution second image region, the process of replacing the first image with the second image can continue according to the first preset order.
[0098] In this embodiment of the invention, the second image may be composed of multiple second sub-images; in this case, the method of replacing the first image region in the panoramic image with the second image region is as follows: Figure 6 As shown, the method mainly includes the following steps:
[0099] Step S601: Determine the target second sub-image corresponding to the region of the first image from multiple second sub-images;
[0100] Step S602: Load and display the target second sub-image to cover the area of the first image.
[0101] For example, the second image consists of four second sub-images. The user zooms in on the bottom right corner of one of the first images, thus detecting the zoom command. This command instructs the user to use that first image as the target first image and its bottom right corner as the first image area. Based on the target first image, the corresponding second image is determined, and based on the first image area, the target second sub-image is selected from the four second sub-images. This target second sub-image is then loaded and displayed to cover the area of the first image. The first image displayed at this point would look like this: Figure 7 As shown, the area targeted by the user's zoom operation has been replaced with a high-resolution second image area, thus avoiding noise issues and ensuring a better user experience.
[0102] In this embodiment of the invention, the first image may also be composed of multiple first sub-images, with each first sub-image corresponding to a second sub-image; in this case, the method of covering the area of the first image with the target second sub-image is as follows: Figure 8 As shown, the method mainly includes the following steps:
[0103] Step S801: Determine the target first sub-image corresponding to the region of the first image from multiple first sub-images;
[0104] Step S802: Replace the first sub-image of the target with the second sub-image of the target.
[0105] In a preferred embodiment of the present invention, the names of a first sub-image and a second sub-image located at the same position in a panoramic image can contain the same suffix to establish a one-to-one correspondence between the first and second sub-images. At this time, the corresponding target first sub-image can be determined based on the first image region, and the target second sub-image can be quickly determined based on the suffix contained in the name of the target first sub-image, thereby triggering the updateSubImage function to replace the target first sub-image with the target second sub-image. The first image displayed at this time is as follows: Figure 9 As shown.
[0106] In a preferred embodiment of the present invention, the updateSubImage function can be used to directly replace the pixel values corresponding to the first image region of the enlarged first image stored in the textureList array with the pixel values of the corresponding second image region, so as to replace the first image region with the second image region.
[0107] In this embodiment of the invention, after replacing the first image region in the panoramic image with the second image region, the method further includes: rendering the scene in the VR skybox according to the second image region and a preset second rendering strategy. The second rendering strategy may be the same as or different from the first rendering strategy; this solution does not specifically limit this.
[0108] According to an embodiment of the present invention, a panoramic image loading method can be described by pre-setting multiple lower-resolution first images and multiple higher-resolution second images corresponding to the panoramic image to be loaded, wherein the content of the first and second images is the same. After receiving an image loading request, the lower-resolution first images can be loaded first to display the panoramic image. When a trigger command for the panoramic image is detected, the first image area indicated by the trigger command is replaced with the higher-resolution second image area, thereby not only improving the loading speed of the panoramic image, but also enhancing the user experience.
[0109] Figure 10 This is a schematic diagram of the main modules of a panoramic image loading device according to an embodiment of the present invention.
[0110] like Figure 10 As shown, a panoramic image loading device 1000 according to an embodiment of the present invention includes a request receiving module 1001, an image loading module 1002, an image determining module 1003, and an image replacement module 1004; wherein:
[0111] The request receiving module 1001 is used to receive an image loading request. The image loading request indicates a panoramic image to be loaded. The panoramic image corresponds to multiple first images and multiple second images. The content of the second image is the same as the corresponding first image, and the resolution of the second image is greater than the resolution of the corresponding first image.
[0112] Image loading module 1002 is used to load multiple first images corresponding to second images according to image loading requests, so as to display panoramic images;
[0113] The image determination module 1003 is used to determine the target first image indicated by the triggering command and the first image region in the target first image when a triggering command for a panoramic image is detected.
[0114] The image replacement module 1004 is used to determine the second image region corresponding to the first image region in the target second image corresponding to the target first image, and to replace the first image region in the panoramic image with the second image region.
[0115] In this embodiment of the invention, when no trigger command for the panoramic image is detected, the image replacement module 1004 is further configured to: replace the first image with the second image according to a first preset order.
[0116] In this embodiment of the invention, the image loading module 1002 is further configured to: sequentially save the pixel values of multiple first images into an array according to a second preset order; wherein the second preset order is the order in which the panoramic image is obtained from the multiple first images.
[0117] In this embodiment of the invention, the image replacement module 1004 is further configured to: replace the pixel value corresponding to the first image region stored in the array with the pixel value of the corresponding second image region, so as to replace the first image region with the second image region.
[0118] In this embodiment of the invention, the second image is composed of multiple second sub-images; the image replacement module 1004 is further configured to: determine a target second sub-image corresponding to the first image area from the multiple second sub-images; load and display the target second sub-image to cover the first image area using the target second sub-image.
[0119] In this embodiment of the invention, the first image is composed of multiple first sub-images, and the first sub-images correspond one-to-one with the second sub-images; the image replacement module 1004 is further configured to: determine the target first sub-image corresponding to the region of the first image from the multiple first sub-images; and replace the target first sub-image with the target second sub-image.
[0120] In this embodiment of the invention, the image loading module 1002 is further configured to: calculate the ratio of the size of the first image to the size of the second image; when the ratio is less than 1, for each first image, perform the following: according to the ratio, enlarge the first image by the corresponding factor so that the size of the first image is equal to the size of the second image.
[0121] In this embodiment of the invention, when the method is applied to a VR skybox, after loading the first images corresponding to multiple second images respectively, the image loading module 1002 is further used to: render the scene in the VR skybox according to the first images and the preset first rendering strategy.
[0122] In this embodiment of the invention, after replacing the first image region in the panoramic image with the second image region, the image replacement module 1004 is further used to: render the scene in the VR skybox according to the second image region and the preset second rendering strategy.
[0123] In this embodiment of the invention, the change instruction is any one of the following: zoom-in instruction, focus instruction, or cropping instruction.
[0124] According to an embodiment of the present invention, a panoramic image loading device can be described in that the panoramic image to be loaded is pre-set to correspond to multiple first images with lower resolution and multiple second images with higher resolution, and the content of the first images and the second images is the same. After receiving an image loading request, the lower resolution first images can be loaded first to display the panoramic image. When a trigger command for the panoramic image is detected, the first image area indicated by the trigger command is replaced with the second image area with higher resolution. This not only improves the loading speed of the panoramic image but also enhances the user experience.
[0125] Figure 11 An exemplary system architecture 1100 is shown, which can be applied to a panoramic image loading method or a panoramic image loading device according to embodiments of the present invention.
[0126] like Figure 11 As shown, system architecture 1100 may include terminal devices 1101, 1102, and 1103, network 1104, and electronic device 1105. Network 1104 is used as a medium to provide a communication link between terminal devices 1101, 1102, and 1103 and electronic device 1105. Network 1104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0127] Users can use terminal devices 1101, 1102, and 1103 to interact with electronic device 1105 via network 1104 to receive or send messages, etc. Various VR applications, such as VR game applications and VR house viewing software, can be installed on terminal devices 1101, 1102, and 1103.
[0128] Terminal devices 1101, 1102, and 1103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0129] Electronic device 1105 can be a server that provides various services, such as a backend management server that supports VR house viewing websites browsed by users using terminal devices 1101, 1102, and 1103. The backend management server can analyze and process data such as received house viewing requests, and feed back the processing results (such as house information) to the terminal devices.
[0130] It should be noted that the panoramic image loading method provided in this embodiment of the invention is generally executed by electronic device 1105, and correspondingly, a panoramic image loading device is generally disposed in electronic device 1105.
[0131] It should be understood that Figure 11The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and electronic devices can be included.
[0132] The following is for reference. Figure 12 It shows a schematic diagram of the structure of a computer system 1200 suitable for implementing a terminal device of the present invention. Figure 12 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0133] like Figure 12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1202 or programs loaded from storage section 1208 into random access memory (RAM) 1203. The RAM 1203 also stores various programs and data required for the operation of the system 1200. The CPU 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0134] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to I / O interface 1205 as needed. Removable media 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1210 as needed so that computer programs read from them can be installed into storage section 1208 as needed.
[0135] In particular, according to embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by central processing unit (CPU) 1201, it performs the functions defined above in the system of this invention.
[0136] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0137] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0138] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor may be described as including a request receiving module, an image loading module, an image determining module, and an image replacement module. The names of these modules do not necessarily limit the module itself; for example, the request receiving module may also be described as "a module for receiving image loading requests."
[0139] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: receiving an image loading request, the image loading request indicating a panoramic image to be loaded, the panoramic image corresponding to multiple first images and multiple second images, the second images having the same content as the corresponding first images and a resolution greater than that of the corresponding first images; loading the first images corresponding to the multiple second images according to the image loading request to display the panoramic image; when a trigger command for the panoramic image is detected, determining the target first image indicated by the trigger command, and a first image region within the target first image; and in the target second image corresponding to the target first image, determining a second image region corresponding to the first image region, and replacing the first image region in the panoramic image with the second image region.
[0140] According to the technical solution of the present invention, a panoramic image to be loaded is pre-set to correspond to multiple first images with lower resolution and multiple second images with higher resolution, and the content of the first images and the second images is the same. After receiving an image loading request, the lower resolution first images can be loaded first to display the panoramic image. When a trigger command for the panoramic image is detected, the first image area indicated by the trigger command is replaced with the second image area with higher resolution, thereby not only improving the loading speed of the panoramic image, but also enhancing the user experience.
[0141] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for loading panoramic images, characterized in that, include: A request to load an image is received. The request indicates a panoramic image to be loaded. The panoramic image corresponds to multiple first images and multiple second images. The first images and the second images correspond one-to-one. The content of the second images is the same as that of the corresponding first images, and the resolution of the second images is greater than that of the corresponding first images. According to the image loading request, the first image corresponding to the plurality of second images is loaded respectively to display the panoramic image; When a trigger command for the panoramic image is detected, the target first image indicated by the trigger command and the first image region in the target first image are determined. In the target second image corresponding to the target first image, a second image region corresponding to the first image region is determined, and the first image region in the panoramic image is replaced by the second image region; The step of loading the first images corresponding to the plurality of second images according to the image loading request includes: saving the pixel values of the plurality of first images into an array in a second preset order; wherein, the second preset order is the order in which the panoramic image is obtained from the plurality of first images; The step of replacing the first image region in the panoramic image with the second image region includes: replacing the pixel value corresponding to the first image region stored in the array with the pixel value of the corresponding second image region, so as to replace the first image region with the second image region.
2. The method according to claim 1, characterized in that, Also includes: When no trigger command for the panoramic image is detected, the first image is replaced with the second image according to a first preset order.
3. The method according to claim 1, characterized in that, The second image consists of multiple second sub-images; The step of replacing the first image region in the panoramic image with the second image region includes: Determine the target second sub-image corresponding to the region of the first image from the plurality of second sub-images; Load and display the target second sub-image to cover the area of the first image.
4. The method according to claim 3, characterized in that, The first image is composed of multiple first sub-images, and the first sub-image corresponds one-to-one with the second sub-image; The step of replacing the first image region in the panoramic image with the second image region includes: Determine the target first sub-image corresponding to the first image region from the plurality of first sub-images; Replace the first sub-image of the target with the second sub-image of the target.
5. The method according to claim 1, characterized in that, Also includes: Calculate the ratio of the size of the first image to the size of the second image; When the ratio is less than 1, for each of the first images, the following is performed: Based on the ratio, the first image is enlarged by a corresponding factor so that the size of the first image is equal to the size of the second image.
6. The method according to claim 1, characterized in that, When the method is applied in a VR skybox, after loading the first images corresponding to the plurality of second images respectively, the method further includes: The scene in the VR skybox is rendered based on the first image and the preset first rendering strategy.
7. The method according to claim 6, characterized in that, After replacing the first image region in the panoramic image with the second image region, the method further includes: The scene in the VR skybox is rendered based on the second image area and the preset second rendering strategy.
8. The method according to any one of claims 1-7, characterized in that, The triggering command is any one of the following: zoom in command, focus command, or crop command.
9. A panoramic image loading device, characterized in that, It includes a request receiving module, an image loading module, an image determining module, and an image replacement module; among which: The request receiving module is used to receive an image loading request. The image loading request indicates a panoramic image to be loaded. The panoramic image corresponds to multiple first images and multiple second images. The first images and the second images correspond one-to-one. The content of the second image is the same as the corresponding first image, and the resolution of the second image is greater than the resolution of the corresponding first image. The image loading module is used to load the first image corresponding to the plurality of second images according to the image loading request, so as to display the panoramic image; The image determination module is used to determine the target first image indicated by the triggering command and the first image region in the target first image when a triggering command for the panoramic image is detected. The image replacement module is used to determine a second image region corresponding to the first image region in a target second image corresponding to the target first image, and use the second image region to replace the first image region in the panoramic image; The image loading module is further configured to save the pixel values of the plurality of first images into an array in a second preset order; wherein, the second preset order is the order in which the panoramic image is obtained based on the plurality of first images; The image replacement module is further configured to replace the pixel values corresponding to the first image region stored in the array with the pixel values of the corresponding second image region, so as to replace the first image region with the second image region.
10. An electronic device for loading panoramic images, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-8.
11. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.