WO2024093763A1 - Panoramic image processing method and apparatus, computer device, medium and program product - Google Patents

Panoramic image processing method and apparatus, computer device, medium and program product Download PDF

Info

Publication number
WO2024093763A1
WO2024093763A1 PCT/CN2023/126583 CN2023126583W WO2024093763A1 WO 2024093763 A1 WO2024093763 A1 WO 2024093763A1 CN 2023126583 W CN2023126583 W CN 2023126583W WO 2024093763 A1 WO2024093763 A1 WO 2024093763A1
Authority
WO
WIPO (PCT)
Prior art keywords
observation
viewing angle
sampling
moment
range
Prior art date
Application number
PCT/CN2023/126583
Other languages
French (fr)
Chinese (zh)
Inventor
张君培
Original Assignee
影石创新科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 影石创新科技股份有限公司 filed Critical 影石创新科技股份有限公司
Publication of WO2024093763A1 publication Critical patent/WO2024093763A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image

Definitions

  • the present application relates to the field of image processing technology, and in particular to a panoramic image processing method, device, computer equipment, medium and program product.
  • the electrochemical phenomenon of the retina will cause the vision to have a certain reaction time. This means that when the human eye sees a picture at a certain moment, the picture will not disappear from the brain's vision for a short period of time; therefore, in the process of rapid changes in the human eye's perspective, the scenery seen by the human eye is often blurred and has afterimages.
  • the viewing angle is constantly changing during the camera movement, which causes the observed plane image to constantly change as well.
  • Each change in the plane image is equivalent to a momentary scene seen by the human eye.
  • the present application provides a panoramic image processing method.
  • the method comprises:
  • N observation viewing angles are sequentially extracted, and N observation images corresponding to the N observation viewing angles in the panoramic image are obtained; wherein N is a positive integer;
  • a target blurred image is obtained by calculation based on the N observed images.
  • the first viewing angle change range is a viewing angle change range between a first moment and a target moment and/or a viewing angle change range between the target moment and a second moment; wherein the first moment, the target moment and the second moment are moments observed sequentially in the preset moments, and the time interval between the first moment and the target moment is equal to the time interval between the target moment and the second moment;
  • the step of determining the actual viewing angle sampling range of the panoramic image according to the blur intensity parameter and the first viewing angle variation range includes:
  • the perspective change range from the first sampling perspective to the second sampling perspective and/or the perspective change range from the second sampling perspective to the third sampling perspective is marked as the actual perspective sampling range.
  • the actual viewing angle sampling range is a viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle and a viewing angle variation range from the second sampling viewing angle to the third sampling viewing angle;
  • the step of sequentially extracting the N observation viewing angles in the actual viewing angle sampling range and obtaining N observation images corresponding to the N observation viewing angles in the panoramic image comprises:
  • the step of calculating the blurred target image based on the N observed images includes:
  • a weighted summation process is performed according to the pixel values of each observed image and the corresponding weights to obtain the target blurred image.
  • setting a corresponding weight for each of the observed images includes:
  • the initial value of each observation image is set; wherein the initial value of each observation image is increased in sequence according to the extraction order;
  • Each of the initial values is normalized to obtain a weight corresponding to each of the observed images.
  • performing weighted summation processing according to the pixel values of each observed image and the corresponding weights to obtain the target blurred image includes:
  • the initial pixel value of each pixel point in each observation image and the corresponding weight are weighted summed to obtain the target pixel value of each pixel point in the target blurred image.
  • the present application also provides a panoramic image processing device.
  • the device comprises:
  • An observation angle acquisition module is used to acquire observation angles for observing the panoramic image at multiple preset moments
  • a first viewing angle variation range determining module configured to determine a first viewing angle variation range according to the plurality of viewing angles
  • An actual viewing angle sampling range determining module used to determine an actual viewing angle sampling range of the panoramic image according to a blur intensity parameter and the first viewing angle variation range;
  • An observation image acquisition module used to sequentially extract N observation viewing angles in the actual viewing angle sampling range, and obtain N observation images corresponding to the N observation viewing angles in the panoramic image; wherein N is a positive integer;
  • the target blurred image calculation module is used to calculate the target blurred image according to the N observation images.
  • the present application also provides a computer device.
  • the computer device includes a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the embodiment of the first aspect when executing the computer program.
  • the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the embodiment of the first aspect are implemented.
  • the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the embodiment of the first aspect are implemented.
  • the above-mentioned panoramic image processing method, device, computer equipment, medium and program product obtain the observation angles of the panoramic image at multiple preset moments, and then determine the first angle variation range according to the observation angle, and then determine the actual angle sampling range of the panoramic image according to the blur intensity parameter and the first angle variation range, and then sequentially extract N observation angles in the actual angle sampling range, and obtain N observation images corresponding to the N observation angles in the panoramic image, and finally calculate the target blurred image according to the N observation images.
  • the technical solution of the present application determines the first angle variation range according to the observation angle to simulate the change of the human eye's observation angle, and then sequentially extracts N observation angles in the actual angle sampling range, and obtains N observation images corresponding to the N observation angles in the panoramic image, so as to facilitate the calculation of the target blurred image according to the N observation images, so as to generate a blurred image observed by simulating the human eye's observation angle during the change process, thereby achieving the blur effect of adding afterimages to the clipped image, and adding the visual effect of bionic human eyes.
  • FIG1 is a diagram showing an application environment of a panoramic image processing method according to an embodiment
  • FIG2 is a schematic diagram of a flow chart of a panoramic image processing method in one embodiment
  • FIG3 is a schematic diagram of a flow chart of calculating a first viewing angle variation range and a second viewing angle variation range in one embodiment
  • FIG4 is a schematic diagram of a flow chart of calculating an actual viewing angle sampling range in one embodiment
  • FIG5 is a schematic diagram of a process for calculating a blurred target image in one embodiment
  • FIG6 is a schematic flow chart of a panoramic image processing method in another embodiment
  • FIG7 is a structural block diagram of a panoramic image processing device in one embodiment
  • FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment.
  • the panoramic image processing method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1.
  • the terminal 102 communicates with the server 104 through a network.
  • the data storage system can store the data that the server 104 needs to process.
  • the data storage system can be integrated on the server 104, or it can be placed on a cloud or other network server.
  • the terminal 102 obtains the observation angles of the panoramic image at multiple preset moments, and then determines the first angle variation range according to the multiple observation angles; then determines the actual angle sampling range of the panoramic image according to the blur intensity parameter and the first angle variation range, and then sequentially extracts N observation angles in the actual angle sampling range, and obtains N observation images corresponding to the N observation angles in the panoramic image, and finally calculates the target blurred image according to the N observation images.
  • the terminal 102 can be various electronic devices with shooting and image processing functions such as personal computers, laptops, smart phones, tablet computers, cameras, etc.
  • the server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
  • a panoramic image processing method is provided, which is described by taking the method applied to the terminal 102 in FIG. 1 as an example, including the following steps:
  • Step 202 Obtain observation angles of the panoramic image at a plurality of preset moments.
  • the panoramic image may be a directly input image or a video frame in a panoramic video. It should be noted that if the panoramic image is a video frame in a panoramic video, each video frame in the panoramic video is processed using the panoramic image processing method involved in this embodiment.
  • the panoramic image can be an image stitched together from multiple sub-plane images, or can be taken by an electronic device with shooting capabilities, and this application does not impose specific restrictions on this.
  • a panoramic image can be taken by a shooting device with front and rear dual fisheye lenses.
  • the preset time may refer to a pre-set time.
  • the observation angle can refer to the panoramic image that the observer can observe when observing the panoramic image.
  • the pixel information in the panoramic image can be first converted to a spherical surface of a three-dimensional coordinate system, and the observer is at the center of the sphere. At any time, the observer can only observe a part of the content on the sphere, so the angle formed by the light rays from both ends of the part at the center of the observer's eyes is the observation angle.
  • the observation angle of the image at each moment in the time sequence is known. That is, in this embodiment, the observation angle of the panoramic image at each moment is known, that is, the observation angle of the panoramic image at multiple preset moments is known.
  • the panoramic image may be an image pre-stored in a server or other storage device.
  • the panoramic image is an image pre-stored in a server, and the panoramic image stored in the server may be obtained through a network or other communication methods, and the observation angles of the panoramic image at multiple preset moments may be obtained.
  • the panoramic image may be an image captured in real time by an electronic device with a shooting capability.
  • a camera is used to perform panoramic shooting of a target object to form a panoramic image, and the captured panoramic image is transmitted to a terminal (the terminal may be a personal computer, a laptop, etc.) through a network or other communication methods.
  • the terminal receives the captured panoramic image and obtains the shooting angle of the camera shooting the target object at each time, thereby obtaining the observation angles for observing the panoramic image at multiple preset times.
  • Step 204 determine a first viewing angle variation range according to multiple viewing angles.
  • the first viewing angle variation range may refer to a viewing angle variation range of an observer observing the panoramic image at a plurality of preset moments.
  • the sequential change of multiple viewing angles in time sequence may be taken as the first viewing angle change range.
  • the observation angle corresponding to moment a to the observation angle corresponding to moment e can be constructed as The range of the first perspective.
  • each preset moment corresponds to an observation angle for observing the panoramic image
  • the first angle variation range may be the angle variation range between moment a and moment b and the angle variation range between moment b and moment c.
  • the technical solution of the embodiment of the present application can sense the movement state and direction of the lens by determining the range of change of the first perspective according to the sequential changes of the observation perspective, thereby simulating the observation of the human eye, so that the subsequently generated blurred image is more in line with the actual observation effect of the human eye, thereby improving the accuracy of the generated bionic human eye visual effect.
  • the first viewing angle change range can be the viewing angle change range between the first moment and the target moment and/or the viewing angle change range between the target moment and the second moment; wherein the first moment, the target moment, and the second moment are moments observed sequentially in the preset moments, and the time interval between the first moment and the target moment is equal to the time interval between the target moment and the second moment.
  • the time intervals between the moments are equal, there are two moments a1 and a2 in sequence before the target moment, and there are two moments b1 and b2 in sequence after the target moment.
  • the first viewing angle range can be the viewing angle change range between moment a1 and the target moment and the viewing angle change range between the target moment and moment b1.
  • the first viewing angle range can be the viewing angle change range between moment a2 and the target moment and the viewing angle change range between the target moment and moment b2, wherein the time interval between moment a2 and the target moment is greater than the time interval between moment a1 and the target moment.
  • the technical solution of the embodiment of the present application sets the time interval between the first moment and the target moment to be equal to the time interval between the target moment and the second moment, so that the first viewing angle can be changed within a certain range. It can change with the selection of the first moment and the second moment, so as to facilitate changing the value of the first viewing angle variation range, and then facilitate changing the accuracy of the subsequent actual viewing angle sampling range, thereby improving the adaptability of the panoramic image processing method.
  • step 204 includes but is not limited to the following steps:
  • Step 302 Determine, from among multiple observation angles, a first observation angle corresponding to a first moment, a target observation angle corresponding to a target moment, and a second observation angle corresponding to a second moment.
  • the target observation angle corresponding to the target moment is represented by At
  • the first observation angle corresponding to the first moment can be represented by At -1
  • the second observation angle corresponding to the second moment can be represented by At +1 .
  • the first observation angle corresponding to the first moment is obtained according to the first moment and the known observation angle.
  • the target observation angle corresponding to the target moment and the second observation angle corresponding to the second moment can be obtained.
  • Step 304 Determine a second viewing angle variation range according to the first viewing angle and the target viewing angle.
  • the second viewing angle variation range can be represented by the first observation viewing angle and the target observation viewing angle.
  • the second viewing angle variation range can be represented by: At -1 ⁇ At , that is, the viewing angle variation range from the first moment to the target moment can be represented by: At -1 ⁇ At .
  • the observer's angle of view change range can be used as the second angle of view change range during the process of converting the first observation angle of view to the target observation angle of view.
  • Step 306 Determine a third viewing angle variation range according to the target viewing angle and the second viewing angle.
  • the third viewing angle variation range can be represented by the target viewing angle and the second viewing angle.
  • the third viewing angle variation range can be represented by: At ⁇ At +1 , that is, the viewing angle variation range between the target moment and the second moment can be represented by: At ⁇ At +1 .
  • the observer's perspective change range in the process of switching from the target observation perspective to the second observation perspective can be used as the third perspective change range
  • the first perspective change range can be the perspective change range after the second perspective change range and the third perspective change range are combined.
  • the corresponding first viewing angle change range is the viewing angle change range from the target moment to the second moment.
  • the target moment is the end moment (ie, the target moment is the last moment in the time sequence)
  • the corresponding first viewing angle change range is the viewing angle change range from the first moment to the target moment.
  • the first viewing angle variation range can be obtained as follows:
  • the first angle of view change range can be: obtain the first time difference between the target moment and the first moment, when the first time difference is large, multiply the first time difference by the angular velocity of rotation to obtain the angle of rotation, and add the rotation angle to the observation angle corresponding to the first moment to obtain the second angle of view change range; then obtain the second time difference between the target moment and the second moment, when the second time difference is large, multiply the second time difference by the angular velocity of rotation to obtain the angle of rotation, and add the rotation angle to the observation angle corresponding to the target moment to obtain the third angle of view change range; after determining the second angle of view change range and the third angle of view change range, the first angle of view change range can be determined.
  • Step 206 Determine the actual viewing angle sampling range of the panoramic image according to the blur intensity parameter and the first viewing angle variation range.
  • the blur intensity parameter may refer to a sampling intensity parameter for sampling a panoramic image.
  • the blur intensity parameter is a pre-set adjustable parameter.
  • the blur intensity parameter may be pre-set by a user or automatically set by a processor.
  • the specific value of the blur intensity parameter may be set according to the specific situation. This application does not impose any specific restrictions on this.
  • the blur intensity parameter may be represented by K, where K ⁇ [0,1]. When the blur intensity parameter K is closer to 0, the corresponding actual viewing angle sampling range is smaller; when the blur intensity parameter is closer to 1, the corresponding actual viewing angle sampling range is larger.
  • the actual viewing angle sampling range may refer to a range of viewing angle sampling for a panoramic image.
  • the actual viewing angle sampling range can be controlled by controlling the value of the blur strength parameter.
  • the second viewing angle variation range and the third viewing angle variation range are combined, and then the blur intensity parameter value is taken as 0.5, then the actual viewing angle sampling range is half of the sum of the second viewing angle variation range and the third viewing angle variation range, that is, the actual viewing angle sampling range is half of the first viewing angle variation range.
  • the actual viewing angle sampling range is equal in value to the second viewing angle variation range, and the actual viewing angle sampling range can be obtained by taking half of the second viewing angle variation range and half of the third viewing angle variation range. It should be understood that other methods can also be used to obtain the actual viewing angle sampling range, and this application does not make specific restrictions on this.
  • Step 208 sequentially extracting N observation viewing angles in the actual viewing angle sampling range, and obtaining N observation images corresponding to the N observation viewing angles in the panoramic image; wherein N is a positive integer.
  • the observed image may refer to an image obtained by observing the panoramic image from an observation perspective by an observer.
  • N observation viewing angles are sequentially extracted from the panoramic image, and the observation image corresponding to each observation viewing angle in the panoramic image is obtained to obtain N observation images.
  • an unequal sampling method may be adopted to sequentially and unequally extract N observation viewing angles from the panoramic image within the actual viewing angle sampling range to obtain N observation images. For example, a first viewing angle is randomly extracted from the panoramic image, and then a second viewing angle is extracted from the panoramic image after the first viewing angle at a randomly obtained sampling interval.
  • an equal sampling method may be adopted to equally extract N observation viewing angles for the panoramic image within the actual viewing angle sampling range, and then obtain N observation images corresponding to each observation viewing angle in the panoramic image.
  • Step 210 calculating and obtaining a blurred target image based on the N observed images.
  • the target blurred image may refer to an image obtained by processing the panoramic image and adding an afterimage blur effect and a bionic human eye perspective effect.
  • the target blurred image can be obtained by performing weighted summation on N observed images.
  • the first perspective change range is determined according to the observation perspective to simulate the change of the human eye's observation perspective, and then N observation perspectives are sequentially extracted in the actual perspective sampling range, and N observation images corresponding to the N observation perspectives in the panoramic image are obtained, so as to facilitate the calculation of the target blurred image based on the N observation images to generate a blurred image observed by simulating the human eye's observation perspective during the change process, thereby achieving the blur effect of adding afterimages to the clipped image and adding the visual effect of the bionic human eye.
  • step 206 includes but is not limited to the following steps:
  • Step 402 Among multiple observation perspectives, mark the target observation perspective corresponding to the target moment as a second sampling perspective.
  • Step 404 calculating a first sampling viewing angle according to the target observation viewing angle, the first observation viewing angle corresponding to the first moment and the blur intensity parameter.
  • K in formula (1) represents the blur intensity parameter
  • At represents the target observation angle corresponding to the target moment
  • At -1 represents the first observation angle corresponding to the first moment.
  • the first sampling angle can be calculated.
  • Step 406 calculating a third sampling angle of view according to the target observation angle of view, the second observation angle of view corresponding to the second moment and the blur intensity parameter.
  • the third sampling angle of view may be represented by B 2
  • K represents the blur intensity parameter
  • At represents the target observation angle corresponding to the target moment
  • At +1 represents the second observation angle corresponding to the second moment.
  • the third sampling angle can be calculated.
  • Step 408 Mark the viewing angle change range from the first sampling viewing angle to the second sampling viewing angle and/or the viewing angle change range from the second sampling viewing angle to the third sampling viewing angle as the actual viewing angle sampling range.
  • the actual perspective sampling range can be the perspective change range from the first sampling perspective to the second sampling perspective, or the perspective change range from the second sampling perspective to the third sampling perspective, or the perspective change range from the first sampling perspective to the second sampling perspective and the perspective change range from the second sampling perspective to the third sampling perspective.
  • the actual viewing angle sampling range is the viewing angle change range from the first sampling viewing angle to the second sampling viewing angle and the viewing angle change range from the second sampling viewing angle to the third sampling viewing angle
  • the actual viewing angle sampling range can be expressed as B 0 ⁇ B 1 ⁇ B 2.
  • B 0 ⁇ B 1 represents the change from the first sampling viewing angle to the second sampling viewing angle
  • B 1 ⁇ B 2 represents the change from the second sampling viewing angle to the third sampling viewing angle.
  • the actual viewing angle sampling range can be controlled by controlling the first viewing angle variation range and the blur intensity parameter.
  • the corresponding first perspective change range is the perspective change range from the target moment to the second moment
  • the actual perspective sampling range is the perspective change range from the second sampling perspective to the third sampling perspective.
  • the target moment is the end moment (i.e., the target moment is the last moment in the sequence)
  • the corresponding first perspective change range is the perspective change range from the first moment to the target moment
  • the actual perspective sampling range is the perspective change range from the first sampling perspective to the third sampling perspective.
  • the actual viewing angle sampling range is the viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle and the viewing angle variation range from the second sampling viewing angle to the third sampling viewing angle.
  • an even sampling method may be adopted to perform even sampling within the viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle to obtain n1 observation viewing angles.
  • B0 can be used to represent the first sampling perspective
  • B1 can be used to represent the second sampling perspective
  • B2 can be used to represent the third sampling perspective.
  • N observation viewing angles that are coherent in time sequence are extracted, and then, the panoramic image is sampled according to the extracted N observation viewing angles to obtain an observation image corresponding to each observation viewing angle.
  • N observation viewing angles can be directly extracted from the actual viewing angle sampling range.
  • step 210 includes but is not limited to the following steps:
  • Step 502 Set corresponding weights for each observed image.
  • Step 504 performing weighted sum processing according to the pixel values of each observed image and the corresponding weights to obtain a target blurred image.
  • a weight is set for each of the N observation images.
  • W 1 represents the weight corresponding to the first observation image in the time sequence
  • W 2 represents the weight corresponding to the second observation image in the time sequence
  • W N represents the weight corresponding to the Nth observation image in the time sequence.
  • a weighted summation process is performed according to the pixel value of each observation image and the corresponding weight to obtain the target blurred image.
  • step 502 includes but is not limited to the following steps: setting the initial value of each observation image according to the extraction order of the observation images; wherein the initial value of each observation image increases in the extraction order; and normalizing each initial value to obtain the weight corresponding to each observation image.
  • the proportion of observation images corresponding to observation angles that are earlier in the time sequence is smaller, and the proportion of observation images corresponding to observation angles that are later in the time sequence is larger, so that the camera blur effect has a strong sense of direction, allowing the user to feel the specific movement method, thereby improving the user experience.
  • Wi i
  • step 504 includes but is not limited to the following steps: obtaining the initial pixel value corresponding to each pixel point in each observed image; performing weighted summation processing on the initial pixel value of each pixel point in each observed image and the corresponding weight to obtain the target pixel value of each pixel point in the target blurred image.
  • the target blurred image may be composed of a number of pixels. After the pixel value of each pixel is determined, the target blurred image is determined.
  • the initial pixel value corresponding to each pixel point in each observation image is obtained, and then the initial pixel value corresponding to each observation image is weighted using the weight to obtain the weighted pixel value, and then the sum of the weighted pixel values of the pixel points at the same position in each observation image is obtained to obtain the target pixel value.
  • the target blurred image is obtained.
  • the final target blurred image is represented by I
  • the target pixel value of the first row and first column pixel in the target blurred image I is represented by I 11
  • I 11 can be calculated by the following formula (5), which is specifically:
  • a i represents the initial pixel value in the first row and first column of the i-th observed image among N observed images.
  • the target pixel values of other pixels in the target blurred image are calculated in the same manner as in formula (5) to obtain the final target blurred image.
  • the panoramic image processing method includes but is not limited to the following steps:
  • Step 602 Obtain observation angles of the panoramic image at a plurality of preset moments.
  • Step 604 determining a first perspective change range based on multiple observation perspectives; the first perspective change range is a perspective change range between a first moment and a target moment and/or a perspective change range between a target moment and a second moment; wherein the first moment, the target moment and the second moment are moments that are observed sequentially in preset moments, and the time interval between the first moment and the target moment is equal to the time interval between the target moment and the second moment.
  • Step 606 Among the multiple observation perspectives, mark the target observation perspective corresponding to the target moment as the second sampling perspective.
  • Step 608 calculating a first sampling viewing angle according to the target observation viewing angle, the first observation viewing angle corresponding to the first moment and the blur intensity parameter.
  • Step 610 calculating a third sampling angle of view according to the target observation angle of view, the second observation angle of view corresponding to the second moment and the blur intensity parameter.
  • Step 612 Mark the viewing angle change range from the first sampling viewing angle to the second sampling viewing angle and/or the viewing angle change range from the second sampling viewing angle to the third sampling viewing angle as the actual viewing angle sampling range.
  • Step 618 n1 observation angles and n2 observation angles are combined to form N observation angles, and the panoramic image is sampled according to the extracted N observation angles to obtain N observation images.
  • Step 620 setting the initial value of each observation image according to the extraction order of the observation images; wherein the initial value of each observation image increases in sequence according to the extraction order.
  • Step 622 normalize each initial value to obtain the weight corresponding to each observed image.
  • Step 624 performing weighted summation processing according to the pixel values of each observed image and the corresponding weights to obtain a target blurred image.
  • steps 602 to 624 may refer to the aforementioned specific steps.
  • an embodiment of the present application also provides a panoramic image processing device for implementing the panoramic image processing method involved above.
  • a panoramic image processing device including: an observation viewing angle acquisition module 702, a first viewing angle variation range determination module 704, an actual viewing angle sampling range determination module 706, an observation image acquisition module 708, and a target blurred image calculation module 710, wherein:
  • the observation angle acquisition module 702 is used to acquire the observation angles for observing the panoramic image at multiple preset moments.
  • the first viewing angle variation range determining module 704 is configured to determine the first viewing angle variation range according to multiple viewing angles.
  • the actual viewing angle sampling range determining module 706 is used to determine the actual viewing angle sampling range of the panoramic image according to the blur intensity parameter and the first viewing angle variation range.
  • the observation image acquisition module 708 is used to sequentially extract N observation viewing angles in the actual viewing angle sampling range, and obtain N observation images corresponding to the N observation viewing angles in the panoramic image; wherein N is a positive integer.
  • the target blurred image calculation module 710 is used to calculate the target blurred image according to the N observation images.
  • the first viewing angle change range is the viewing angle change range between the first moment and the target moment and/or the viewing angle change range between the target moment and the second moment; wherein the first moment, the target moment and the second moment are moments observed sequentially in the preset moments, and the time interval between the first moment and the target moment is equal to the time interval between the target moment and the second moment.
  • the actual viewing angle sampling range determination module 706 includes:
  • the second sampling viewing angle determining unit is used to mark the target observation viewing angle corresponding to the target moment as the second sampling viewing angle among multiple observation viewing angles.
  • the first sampling viewing angle calculation unit is used to calculate the first sampling viewing angle according to the target observation viewing angle, the first observation viewing angle corresponding to the first moment and the blur intensity parameter.
  • the third sampling viewing angle calculation unit is used to calculate the third sampling viewing angle according to the target observation viewing angle, the second observation viewing angle corresponding to the second moment and the blur intensity parameter.
  • the first marking unit is used to mark the viewing angle change range from the first sampling viewing angle to the second sampling viewing angle and/or the viewing angle change range from the second sampling viewing angle to the third sampling viewing angle as the actual viewing angle sampling range.
  • the actual viewing angle sampling range is the viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle and the viewing angle variation range from the second sampling viewing angle to the third sampling viewing angle.
  • the observation image acquisition module 708 includes:
  • the image sampling unit is used to combine n1 observation viewing angles and n2 observation viewing angles to form N observation viewing angles, and to sample the panoramic image according to the extracted N observation viewing angles to obtain N observation images.
  • the target blurred image calculation module 710 includes:
  • the weight setting unit is used to set a corresponding weight for each observation image.
  • the weighted summation unit is used to perform weighted summation processing according to the pixel values of each observation image and the corresponding weights to obtain a target blurred image.
  • the weight setting unit includes:
  • the initial value setting subunit is used to set the initial value of each observation image according to the extraction order of the observation images; wherein the initial value of each observation image increases in sequence according to the extraction order.
  • the normalization processing subunit is used to normalize each initial value to obtain the weight corresponding to each observed image.
  • the weighted summation unit comprises:
  • the initial pixel value acquisition subunit is used to obtain the initial pixel value corresponding to each pixel point in each observed image.
  • the weighted processing subunit is used to calculate the initial pixel value and the corresponding weight of each pixel in each observation image.
  • the target pixel value of each pixel in the target blurred image is obtained by performing weighted summation processing.
  • Each module in the panoramic image processing device can be implemented in whole or in part by software, hardware, or a combination thereof.
  • Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
  • a computer device which may be a terminal, and its internal structure diagram may be shown in FIG8.
  • the computer device includes a processor, a memory, a communication interface, a display unit, and an input device connected via a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium.
  • the communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies.
  • WIFI wireless fidelity
  • NFC near field communication
  • the display unit of the computer device may be a liquid crystal display or an electronic ink display
  • the input device of the computer device may be a touch layer covered on the display unit, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
  • FIG. 8 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
  • a computer device including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned panoramic image processing method when executing the computer program.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the panoramic image processing method are implemented.
  • a computer program product including a computer program, which implements the steps of the above-mentioned panoramic image processing method when executed by a processor.
  • any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory.
  • Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc.
  • Volatile memory can include random access memory (RAM) or external cache memory, etc.
  • RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • the database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database.
  • Non-relational databases may include distributed databases based on blockchain, etc., but are not limited to this.
  • the processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The present application relates to a panoramic image processing method and apparatus, a computer device, a medium and a program product. The method comprises: acquiring observation viewing angles at which a panoramic image is observed at a plurality of preset moments, respectively; determining a first viewing angle change range according to a plurality of observation viewing angles; determining an actual viewing angle sampling range of the panoramic image according to a blur intensity parameter and the first viewing angle change range; in the actual viewing angle sampling range, sequentially extracting N observation viewing angles, and obtaining from the panoramic image N observed images corresponding to the N observation viewing angles, wherein N is a positive integer; and performing calculation on the basis of the N observed images, so as to obtain a target blurred image. By using the method, the blurring effect of adding an afterimage to an image, and the bionic human vision effect can be realized.

Description

全景图像处理方法、装置、计算机设备、介质和程序产品Panoramic image processing method, device, computer equipment, medium and program product 技术领域Technical Field
本申请涉及图像处理技术领域,特别是涉及一种全景图像处理方法、装置、计算机设备、介质和程序产品。The present application relates to the field of image processing technology, and in particular to a panoramic image processing method, device, computer equipment, medium and program product.
背景技术Background technique
用人眼观测景观时,根据视觉暂留现象,视网膜的电化学现象会造成视觉有一段反应时间,这使得当人的眼睛看到某一个时刻的画面后,该画面在一小段时间内不会在大脑视觉中消失;因此,在人眼视角快速变化的过程中,人眼所看到的景物往往是模糊的、带有残影的。When observing the landscape with the human eye, due to the phenomenon of persistence of vision, the electrochemical phenomenon of the retina will cause the vision to have a certain reaction time. This means that when the human eye sees a picture at a certain moment, the picture will not disappear from the brain's vision for a short period of time; therefore, in the process of rapid changes in the human eye's perspective, the scenery seen by the human eye is often blurred and has afterimages.
对于任意一张全景图像来说,运镜过程中,观测视角在不停地发生改变,这使得观测到的平面图像也在不停地发生改变,而每发生一次改变的平面图像也就等同于人眼所看到的一个瞬间的景象。For any panoramic image, the viewing angle is constantly changing during the camera movement, which causes the observed plane image to constantly change as well. Each change in the plane image is equivalent to a momentary scene seen by the human eye.
然而,当对全景素材进行一般的运镜剪辑时,运镜过程中的每一帧都是非常清晰的,得到的剪辑图像也是非常清晰的,这与真实的人眼视觉不相符。因此,如何让得到的剪辑图像能有附加残影的模糊效果,及仿生人眼的视角效果,成为本领域技术人员亟需解决的技术问题。However, when general camera movement editing is performed on panoramic materials, each frame in the camera movement process is very clear, and the resulting edited image is also very clear, which is inconsistent with the real human eye vision. Therefore, how to make the resulting edited image have a blur effect with an additional afterimage and a visual effect that mimics the human eye has become a technical problem that technicians in this field need to solve urgently.
发明内容Summary of the invention
基于此,有必要针对上述技术问题,提供一种能够对图像附加残影的模糊效果及仿生人眼的视觉效果的全景图像处理方法、装置、计算机设备、介质和程序产品。Based on this, it is necessary to provide a panoramic image processing method, device, computer equipment, medium and program product that can add a blur effect of residual image and a visual effect of bionic human eye to the image to address the above technical problems.
第一方面,本申请提供了一种全景图像处理方法。所述方法包括:In a first aspect, the present application provides a panoramic image processing method. The method comprises:
获取对全景图像在多个预设时刻分别进行观测的观测视角;Obtaining observation angles of the panoramic image at multiple preset moments;
根据多个所述观测视角确定第一视角变化范围;Determining a first viewing angle variation range according to the plurality of viewing angles;
根据模糊强度参数和所述第一视角变化范围,确定所述全景图像的实际视角抽样范围; Determining an actual viewing angle sampling range of the panoramic image according to a blur intensity parameter and the first viewing angle variation range;
在所述实际视角抽样范围中,依次抽取N个观测视角,并得到所述N个观测视角在所述全景图像中对应的N个观测图像;其中,N为正整数;In the actual viewing angle sampling range, N observation viewing angles are sequentially extracted, and N observation images corresponding to the N observation viewing angles in the panoramic image are obtained; wherein N is a positive integer;
根据N个所述观测图像计算得到目标模糊图像。A target blurred image is obtained by calculation based on the N observed images.
在其中一个实施例中,所述第一视角变化范围为第一时刻到目标时刻之间的视角变化范围和/或所述目标时刻到第二时刻之间的视角变化范围;其中,所述第一时刻、所述目标时刻和所述第二时刻为所述预设时刻中的依序观测的时刻,且所述第一时刻到所述目标时刻之间的时间间隔与所述目标时刻到所述第二时刻之间的时间间隔相等;In one embodiment, the first viewing angle change range is a viewing angle change range between a first moment and a target moment and/or a viewing angle change range between the target moment and a second moment; wherein the first moment, the target moment and the second moment are moments observed sequentially in the preset moments, and the time interval between the first moment and the target moment is equal to the time interval between the target moment and the second moment;
所述根据模糊强度参数和所述第一视角变化范围,确定所述全景图像的实际视角抽样范围,包括:The step of determining the actual viewing angle sampling range of the panoramic image according to the blur intensity parameter and the first viewing angle variation range includes:
在多个所述观测视角中,将所述目标时刻对应的目标观测视角标记为第二抽样视角;Among the multiple observation angles, marking the target observation angle corresponding to the target moment as a second sampling angle;
根据所述目标观测视角、所述第一时刻对应的第一观测视角和所述模糊强度参数,计算得到第一抽样视角;Calculate a first sampling angle of view according to the target observation angle of view, the first observation angle of view corresponding to the first moment, and the blur intensity parameter;
根据所述目标观测视角、所述第二时刻对应的第二观测视角和所述模糊强度参数,计算得到第三抽样视角;Calculate a third sampling angle of view according to the target observation angle of view, the second observation angle of view corresponding to the second moment, and the blur intensity parameter;
将所述第一抽样视角到所述第二抽样视角的视角变化范围和/或所述第二抽样视角到所述第三抽样视角的视角变化范围,标记为所述实际视角抽样范围。The perspective change range from the first sampling perspective to the second sampling perspective and/or the perspective change range from the second sampling perspective to the third sampling perspective is marked as the actual perspective sampling range.
在其中一个实施例中,所述实际视角抽样范围为所述第一抽样视角到所述第二抽样视角的视角变化范围和所述第二抽样视角到所述第三抽样视角的视角变化范围;In one embodiment, the actual viewing angle sampling range is a viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle and a viewing angle variation range from the second sampling viewing angle to the third sampling viewing angle;
所述在所述实际视角抽样范围中,依次抽取所述N个观测视角,并得到所述N个观测视角在所述全景图像中对应的N个观测图像,包括:The step of sequentially extracting the N observation viewing angles in the actual viewing angle sampling range and obtaining N observation images corresponding to the N observation viewing angles in the panoramic image comprises:
在所述第一抽样视角到所述第二抽样视角的视角变化范围内,依次均等抽取n1个观测视角;其中,n1=N/2,n1为正整数;In the range of the viewing angle change from the first sampling viewing angle to the second sampling viewing angle, n1 observation viewing angles are uniformly selected in sequence; wherein n1=N/2, and n1 is a positive integer;
在所述第二抽样视角到所述第三抽样视角的视角变化范围内,依次均等抽取n2个观测视角;其中,n2=N/2,n2为正整数;In the range of the viewing angle variation from the second sampling viewing angle to the third sampling viewing angle, n2 observation viewing angles are uniformly extracted in sequence; wherein n2=N/2, and n2 is a positive integer;
将n1个观测视角和n2个观测视角组合形成N个观测视角,根据抽取的N 个观测视角对所述全景图像进行采样,得到N个所述观测图像。Combine n1 observation perspectives and n2 observation perspectives to form N observation perspectives. The panoramic image is sampled from observation perspectives to obtain N observation images.
在其中一个实施例中,所述根据N个所述观测图像计算得到目标模糊图像,包括:In one embodiment, the step of calculating the blurred target image based on the N observed images includes:
对各所述观测图像设定对应的权重;Setting a corresponding weight for each of the observed images;
根据所述各观测图像的像素值及对应的所述权重进行加权求和处理,得到所述目标模糊图像。A weighted summation process is performed according to the pixel values of each observed image and the corresponding weights to obtain the target blurred image.
在其中一个实施例中,所述对各所述观测图像设定对应的权重,包括:In one embodiment, setting a corresponding weight for each of the observed images includes:
按照所述观测图像的抽取顺序,设置各所述观测图像的初始值;其中,各所述观测图像的所述初始值按照所述抽取顺序递增;According to the extraction order of the observation images, the initial value of each observation image is set; wherein the initial value of each observation image is increased in sequence according to the extraction order;
将各所述初始值进行归一化处理,得到各所述观测图像对应的权重。Each of the initial values is normalized to obtain a weight corresponding to each of the observed images.
在其中一个实施例中,所述根据所述各观测图像的像素值及对应的所述权重进行加权求和处理,得到所述目标模糊图像,包括:In one embodiment, performing weighted summation processing according to the pixel values of each observed image and the corresponding weights to obtain the target blurred image includes:
获取各所述观测图像中各像素点的初始像素值;Obtaining an initial pixel value of each pixel in each of the observed images;
对所述各观测图像中各像素点的初始像素值及对应的所述权重进行加权求和处理,得到所述目标模糊图像中各像素点的目标像素值。The initial pixel value of each pixel point in each observation image and the corresponding weight are weighted summed to obtain the target pixel value of each pixel point in the target blurred image.
第二方面,本申请还提供了一种全景图像处理装置。所述装置包括:In a second aspect, the present application also provides a panoramic image processing device. The device comprises:
观测视角获取模块,用于获取对全景图像在多个预设时刻分别进行观测的观测视角;An observation angle acquisition module is used to acquire observation angles for observing the panoramic image at multiple preset moments;
第一视角变化范围确定模块,用于根据多个所述观测视角确定第一视角变化范围;A first viewing angle variation range determining module, configured to determine a first viewing angle variation range according to the plurality of viewing angles;
实际视角抽样范围确定模块,用于根据模糊强度参数和所述第一视角变化范围,确定所述全景图像的实际视角抽样范围;An actual viewing angle sampling range determining module, used to determine an actual viewing angle sampling range of the panoramic image according to a blur intensity parameter and the first viewing angle variation range;
观测图像获取模块,用于在所述实际视角抽样范围中,依次抽取N个观测视角,并得到所述N个观测视角在所述全景图像中对应的N个观测图像;其中,N为正整数;An observation image acquisition module, used to sequentially extract N observation viewing angles in the actual viewing angle sampling range, and obtain N observation images corresponding to the N observation viewing angles in the panoramic image; wherein N is a positive integer;
目标模糊图像计算模块,用于根据N个所述观测图像计算得到目标模糊图像。The target blurred image calculation module is used to calculate the target blurred image according to the N observation images.
第三方面,本申请还提供了一种计算机设备。所述计算机设备包括存储器 和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现第一方面实施例的步骤。In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the embodiment of the first aspect when executing the computer program.
第四方面,本申请还提供了一种计算机可读存储介质。所述计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现第一方面实施例的步骤。In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the embodiment of the first aspect are implemented.
第五方面,本申请还提供了一种计算机程序产品。所述计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现第一方面实施例的步骤。In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the embodiment of the first aspect are implemented.
上述全景图像处理方法、装置、计算机设备、介质和程序产品,通过获取对全景图像在多个预设时刻分别进行观测的观测视角,然后根据观测视角确定第一视角变化范围,再根据模糊强度参数和第一视角变化范围,确定全景图像的实际视角抽样范围,再在实际视角抽样范围中,依次抽取N个观测视角,并得到N个观测视角在全景图像中对应的N个观测图像,最后再根据N个观测图像计算得到目标模糊图像。本申请的技术方案,根据观测视角确定第一视角变化范围,以模拟人眼观测视角的变化,然后再在实际视角抽样范围中,依次抽取N个观测视角,并得到N个观测视角在全景图像中对应的N个观测图像,从而便于根据N个观测图像计算得到目标模糊图像,以生成模拟人眼观测视角在变化过程中所观测到的模糊图像,从而实现了给剪辑图像附加残影的模糊效果,以及附加了仿生人眼的视觉效果。The above-mentioned panoramic image processing method, device, computer equipment, medium and program product obtain the observation angles of the panoramic image at multiple preset moments, and then determine the first angle variation range according to the observation angle, and then determine the actual angle sampling range of the panoramic image according to the blur intensity parameter and the first angle variation range, and then sequentially extract N observation angles in the actual angle sampling range, and obtain N observation images corresponding to the N observation angles in the panoramic image, and finally calculate the target blurred image according to the N observation images. The technical solution of the present application determines the first angle variation range according to the observation angle to simulate the change of the human eye's observation angle, and then sequentially extracts N observation angles in the actual angle sampling range, and obtains N observation images corresponding to the N observation angles in the panoramic image, so as to facilitate the calculation of the target blurred image according to the N observation images, so as to generate a blurred image observed by simulating the human eye's observation angle during the change process, thereby achieving the blur effect of adding afterimages to the clipped image, and adding the visual effect of bionic human eyes.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为一个实施例中全景图像处理方法的应用环境图;FIG1 is a diagram showing an application environment of a panoramic image processing method according to an embodiment;
图2为一个实施例中全景图像处理方法的流程示意图;FIG2 is a schematic diagram of a flow chart of a panoramic image processing method in one embodiment;
图3为一个实施例中计算第一视角变化范围和第二视角变化范围的流程示意图;FIG3 is a schematic diagram of a flow chart of calculating a first viewing angle variation range and a second viewing angle variation range in one embodiment;
图4为一个实施例中计算实际视角抽样范围的流程示意图;FIG4 is a schematic diagram of a flow chart of calculating an actual viewing angle sampling range in one embodiment;
图5为一个实施例中计算目标模糊图像的流程示意图;FIG5 is a schematic diagram of a process for calculating a blurred target image in one embodiment;
图6为另一个实施例中全景图像处理方法的流程示意图;FIG6 is a schematic flow chart of a panoramic image processing method in another embodiment;
图7为一个实施例中全景图像处理装置的结构框图; FIG7 is a structural block diagram of a panoramic image processing device in one embodiment;
图8为一个实施例中计算机设备的内部结构图。FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
本申请实施例提供的全景图像处理方法,可以应用于如图1所示的应用环境中。其中,终端102通过网络与服务器104进行通信。数据存储系统可以存储服务器104需要处理的数据。数据存储系统可以集成在服务器104上,也可以放在云上或其他网络服务器上。终端102获取对全景图像在多个预设时刻分别进行观测的观测视角,然后根据多个观测视角确定第一视角变化范围;再根据模糊强度参数和第一视角变化范围,确定全景图像的实际视角抽样范围,然后再在实际视角抽样范围中,依次抽取N个观测视角,并得到N个观测视角在全景图像中对应的N个观测图像,最后再根据N个观测图像计算得到目标模糊图像。其中,终端102可以是各种个人计算机、笔记本电脑、智能手机、平板电脑、相机等具有拍摄和图像处理功能的电子设备。服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The panoramic image processing method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1. The terminal 102 communicates with the server 104 through a network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on a cloud or other network server. The terminal 102 obtains the observation angles of the panoramic image at multiple preset moments, and then determines the first angle variation range according to the multiple observation angles; then determines the actual angle sampling range of the panoramic image according to the blur intensity parameter and the first angle variation range, and then sequentially extracts N observation angles in the actual angle sampling range, and obtains N observation images corresponding to the N observation angles in the panoramic image, and finally calculates the target blurred image according to the N observation images. The terminal 102 can be various electronic devices with shooting and image processing functions such as personal computers, laptops, smart phones, tablet computers, cameras, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
在一些实施例中,如图2所示,提供了一种全景图像处理方法,以该方法应用于图1中的终端102为例进行说明,包括以下步骤:In some embodiments, as shown in FIG. 2 , a panoramic image processing method is provided, which is described by taking the method applied to the terminal 102 in FIG. 1 as an example, including the following steps:
步骤202,获取对全景图像在多个预设时刻分别进行观测的观测视角。Step 202: Obtain observation angles of the panoramic image at a plurality of preset moments.
其中,全景图像可以是直接输入的图像,也可以是全景视频中的一个视频帧。需要说明的是,如果全景图像是全景视频中的一个视频帧时,则对于该全景视频中的每一个视频帧都使用本实施例中涉及的全景图像处理方法进行处理。The panoramic image may be a directly input image or a video frame in a panoramic video. It should be noted that if the panoramic image is a video frame in a panoramic video, each video frame in the panoramic video is processed using the panoramic image processing method involved in this embodiment.
需要说明的是,全景图像可以是由多个子平面图像拼接而成的图像,也可以是通过具有拍摄能力的电子设备拍摄得到的,对于此,本申请不作具体限制。例如,可以通过具有前后双鱼眼镜头的拍摄设备进行拍摄得到的全景图像。It should be noted that the panoramic image can be an image stitched together from multiple sub-plane images, or can be taken by an electronic device with shooting capabilities, and this application does not impose specific restrictions on this. For example, a panoramic image can be taken by a shooting device with front and rear dual fisheye lenses.
预设时刻可以指预先设定的时刻。The preset time may refer to a pre-set time.
观测视角可以指对全景图像进行观测时,从观测者所能观测到的全景图像 的两端引出的光线,在观测者的人眼光心处形成的夹角。当全景图像的尺寸越小、与观察者的距离越远时,观测视角越小。需要理解的是,在不同时刻,观测者对全景图像的观测视角在数值上相等,但是观测者所观测到的具体图像可以不同。The observation angle can refer to the panoramic image that the observer can observe when observing the panoramic image. The angle formed by the light rays drawn from the two ends of the panorama at the optical center of the observer's eyes. The smaller the size of the panorama image and the farther the distance from the observer, the smaller the viewing angle. It should be understood that at different times, the viewing angle of the panorama image of the observer is equal in value, but the specific images observed by the observer may be different.
例如,可以通过特定的映射关系,先将全景图像中的像素信息转化至三维立体坐标系的球面上,观测者处于该球面的球心位置。在任意时刻,观测者只能观测到该球面上的一部分内容,那么该部分内容的两端引出的光线,在观测者的人眼光心处所形成的夹角,即为观测视角。For example, through a specific mapping relationship, the pixel information in the panoramic image can be first converted to a spherical surface of a three-dimensional coordinate system, and the observer is at the center of the sphere. At any time, the observer can only observe a part of the content on the sphere, so the angle formed by the light rays from both ends of the part at the center of the observer's eyes is the observation angle.
当需要对在一个时序内完成的运镜过程已知的图像进行处理时,那么该图像在时序上的每一个时刻的观测视角都为已知的。即在本实施例中,全景图像在每一个时刻的观测视角都为已知的,即全景图像在多个预设时刻的观测视角均为已知的。When an image whose camera movement process is known and completed within a time sequence needs to be processed, the observation angle of the image at each moment in the time sequence is known. That is, in this embodiment, the observation angle of the panoramic image at each moment is known, that is, the observation angle of the panoramic image at multiple preset moments is known.
在一些实施例中,全景图像可以是预先存储在服务器或者其他存储设备中的图像。例如,全景图像为预先存储在服务器中的图像,可以通过网络或者其他的通信方式获取服务器中存储的全景图像,并获取对全景图像在多个预设时刻分别进行观测的观测视角。In some embodiments, the panoramic image may be an image pre-stored in a server or other storage device. For example, the panoramic image is an image pre-stored in a server, and the panoramic image stored in the server may be obtained through a network or other communication methods, and the observation angles of the panoramic image at multiple preset moments may be obtained.
在一些实施例中,全景图像可以为具有拍摄能力的电子设备实时拍摄的图像。例如,使用相机对目标对象进行全景拍摄,形成全景图像,并将拍摄得到的全景图像通过网络或者其他通信方式传输到终端(该终端可以是个人电脑、笔记本电脑等)中,终端接收拍摄得到的全景图像,并获取相机在各时刻对该目标对象进行拍摄的拍摄视角,从而得到对全景图像在多个预设时刻分别进行观测的观测视角。In some embodiments, the panoramic image may be an image captured in real time by an electronic device with a shooting capability. For example, a camera is used to perform panoramic shooting of a target object to form a panoramic image, and the captured panoramic image is transmitted to a terminal (the terminal may be a personal computer, a laptop, etc.) through a network or other communication methods. The terminal receives the captured panoramic image and obtains the shooting angle of the camera shooting the target object at each time, thereby obtaining the observation angles for observing the panoramic image at multiple preset times.
步骤204,根据多个观测视角确定第一视角变化范围。Step 204: determine a first viewing angle variation range according to multiple viewing angles.
其中,第一视角变化范围可以指观测者在多个预设时刻对全景图像进行观测的观测视角变化范围。The first viewing angle variation range may refer to a viewing angle variation range of an observer observing the panoramic image at a plurality of preset moments.
示例性地,可以将多个视角在时序上的依序变化作为第一视角变化范围。Exemplarily, the sequential change of multiple viewing angles in time sequence may be taken as the first viewing angle change range.
例如,假设存在五个预设时刻,这五个预设时刻在时序依次发生,分别命名为a、b、c、d、e。可以将a时刻对应的观测视角到e时刻对应的观测视角作 为第一视角变化范围。For example, suppose there are five preset moments, which occur in sequence and are named a, b, c, d, and e. The observation angle corresponding to moment a to the observation angle corresponding to moment e can be constructed as The range of the first perspective.
在一个实施例中,假设存在三个预设时刻,该三个预设时刻在时序上依次发生,分别命名为a时刻、b时刻和c时刻,其中a时刻在时序上发生于b、c时刻之前,b时刻在时序上发生在a、c时刻之间,c时刻在时序上发生在a、b时刻之后。每一个预设时刻都对应一个对全景图像进行观测的观测视角,则第一视角变化范围可以是a时刻到b时刻之间的视角变化范围以及b时刻到c时刻之间的视角变化范围。In one embodiment, it is assumed that there are three preset moments, which occur sequentially in time sequence and are named as moment a, moment b and moment c, respectively, wherein moment a occurs before moments b and c in time sequence, moment b occurs between moments a and c in time sequence, and moment c occurs after moments a and b in time sequence. Each preset moment corresponds to an observation angle for observing the panoramic image, and the first angle variation range may be the angle variation range between moment a and moment b and the angle variation range between moment b and moment c.
本申请实施例的技术方案,通过按照观测视角的依序变化确定第一视角变化范围,能够感受到镜头的运动状态和运动的方向感,从而实现模拟人眼的观测,以使后续生成的模糊图像更加符合人眼的实际观测效果,提高了生成的仿生人眼视觉效果的准确性。The technical solution of the embodiment of the present application can sense the movement state and direction of the lens by determining the range of change of the first perspective according to the sequential changes of the observation perspective, thereby simulating the observation of the human eye, so that the subsequently generated blurred image is more in line with the actual observation effect of the human eye, thereby improving the accuracy of the generated bionic human eye visual effect.
在一个实施例中,第一视角变化范围可以为第一时刻到目标时刻之间的视角变化范围和/或目标时刻到第二时刻之间的视角变化范围;其中,第一时刻、目标时刻、第二时刻为预设时刻中依序进行观测的时刻,且第一时刻到目标时刻之间的时间间隔与目标时刻到第二时刻之间的时间间隔相等。In one embodiment, the first viewing angle change range can be the viewing angle change range between the first moment and the target moment and/or the viewing angle change range between the target moment and the second moment; wherein the first moment, the target moment, and the second moment are moments observed sequentially in the preset moments, and the time interval between the first moment and the target moment is equal to the time interval between the target moment and the second moment.
例如,假设在多个预设时刻中,各时刻之间的时间间隔相等,在目标时刻之前依次存在a1、a2两个时刻,在目标时刻之后依次存在b1、b2两个时刻。For example, it is assumed that among multiple preset moments, the time intervals between the moments are equal, there are two moments a1 and a2 in sequence before the target moment, and there are two moments b1 and b2 in sequence after the target moment.
当第一时刻为a1时刻时,则第二时刻为b1时刻,a1时刻到目标时刻之间的时间间隔与目标时刻到b1时刻之间的时间间隔相等,则第一视角范围可以是a1时刻到目标时刻之间的视角变化范围以及目标时刻到b1时刻之间的视角变化范围。When the first moment is moment a1, the second moment is moment b1, and the time interval between moment a1 and the target moment is equal to the time interval between the target moment and moment b1. Then the first viewing angle range can be the viewing angle change range between moment a1 and the target moment and the viewing angle change range between the target moment and moment b1.
当第一时刻为a2时刻时,则第二时刻为b2时刻,a2时刻到目标时刻之间的时间间隔与目标时刻到b2时刻之间的时间间隔相等,则第一视角范围可以是a2时刻到目标时刻之间的视角变化范围以及目标时刻到b2时刻之间的视角变化范围,其中,a2时刻到目标时刻之间的时间间隔大于a1时刻到目标时刻之间的时间间隔。When the first moment is moment a2, the second moment is moment b2, and the time interval between moment a2 and the target moment is equal to the time interval between the target moment and moment b2. Then the first viewing angle range can be the viewing angle change range between moment a2 and the target moment and the viewing angle change range between the target moment and moment b2, wherein the time interval between moment a2 and the target moment is greater than the time interval between moment a1 and the target moment.
本申请实施例的技术方案,通过将第一时刻到目标时刻之间的时间间隔设置为与目标时刻到第二时刻之间的时间间隔相等,以便于第一视角变化范围能 够随着第一时刻和第二时刻的选择而发生改变,从而便于改变第一视角变化范围的取值,进而便于改变后续实际视角抽样范围的精度,提高了全景图像处理方法的适应性。The technical solution of the embodiment of the present application sets the time interval between the first moment and the target moment to be equal to the time interval between the target moment and the second moment, so that the first viewing angle can be changed within a certain range. It can change with the selection of the first moment and the second moment, so as to facilitate changing the value of the first viewing angle variation range, and then facilitate changing the accuracy of the subsequent actual viewing angle sampling range, thereby improving the adaptability of the panoramic image processing method.
在一个实施例中,请参照图3,步骤204包括但不限于以下步骤:In one embodiment, referring to FIG. 3 , step 204 includes but is not limited to the following steps:
步骤302,在多个观测视角中,确定第一时刻对应的第一观测视角、目标时刻对应的目标观测视角以及第二时刻对应的第二观测视角。Step 302: Determine, from among multiple observation angles, a first observation angle corresponding to a first moment, a target observation angle corresponding to a target moment, and a second observation angle corresponding to a second moment.
在一些实施例中,以At表示目标时刻对应的目标观测视角,则第一时刻对应的第一观测视角可以用At-1表示,第二时刻对应的第二观测视角可以用At+1表示。In some embodiments, the target observation angle corresponding to the target moment is represented by At , the first observation angle corresponding to the first moment can be represented by At -1 , and the second observation angle corresponding to the second moment can be represented by At +1 .
在时序上每一个时刻的观测视角为已知的情况下,根据第一时刻和已知的观测视角,获取第一时刻对应的第一观测视角。类似地,可以获取目标时刻对应的目标观测视角以及第二时刻对应的第二观测视角。When the observation angle at each moment in the time sequence is known, the first observation angle corresponding to the first moment is obtained according to the first moment and the known observation angle. Similarly, the target observation angle corresponding to the target moment and the second observation angle corresponding to the second moment can be obtained.
步骤304,根据第一观测视角和目标观测视角,确定第二视角变化范围。Step 304: Determine a second viewing angle variation range according to the first viewing angle and the target viewing angle.
其中,第二视角变化范围可以用第一观测视角和目标观测视角来表示。例如,第二视角变化范围可以用:At-1→At表示,即第一时刻到目标时刻之间的视角变化范围可以用:At-1→At表示。The second viewing angle variation range can be represented by the first observation viewing angle and the target observation viewing angle. For example, the second viewing angle variation range can be represented by: At -1At , that is, the viewing angle variation range from the first moment to the target moment can be represented by: At -1At .
在一些实施例中,当确定第一观测视角和目标观测视角后,可以将第一观测视角转到目标观测视角的过程中,观测者的视角变化范围作为第二视角变化范围。In some embodiments, after the first observation angle of view and the target observation angle of view are determined, the observer's angle of view change range can be used as the second angle of view change range during the process of converting the first observation angle of view to the target observation angle of view.
步骤306,根据目标观测视角和第二观测视角,确定第三视角变化范围。Step 306: Determine a third viewing angle variation range according to the target viewing angle and the second viewing angle.
其中,第三视角变化范围可以用目标观测视角和第二观测视角来表示。例如,第三视角变化范围可以用:At→At+1表示,即目标时刻到第二时刻的之间的视角变化范围可以用:At→At+1表示。The third viewing angle variation range can be represented by the target viewing angle and the second viewing angle. For example, the third viewing angle variation range can be represented by: At → At +1 , that is, the viewing angle variation range between the target moment and the second moment can be represented by: At → At +1 .
在一些实施例中,当确定目标观测视角和第二观测视角后,可以将从目标观测视角转到第二观测视角的过程中,观测者的视角变化范围作为第三视角变化范围,第一视角变化范围可以是第二视角变化范围和第三视角变化范围合并后的视角变化范围。In some embodiments, after the target observation perspective and the second observation perspective are determined, the observer's perspective change range in the process of switching from the target observation perspective to the second observation perspective can be used as the third perspective change range, and the first perspective change range can be the perspective change range after the second perspective change range and the third perspective change range are combined.
特别地,当目标时刻为初始时刻时(即目标时刻为第0个时刻时),则对 应的第一视角变化范围为目标时刻到第二时刻的视角变化范围。当目标时刻为结束时刻时(即目标时刻为时序上的最后时刻时),对应的第一视角变化范围为第一时刻到目标时刻的视角变化范围。In particular, when the target time is the initial time (that is, the target time is the 0th time), The corresponding first viewing angle change range is the viewing angle change range from the target moment to the second moment. When the target moment is the end moment (ie, the target moment is the last moment in the time sequence), the corresponding first viewing angle change range is the viewing angle change range from the first moment to the target moment.
例如,如果观测者以均匀的角速度进行平行转动,则第一视角变化范围可以通过以下方式获得:For example, if the observer rotates parallel to the object at a uniform angular velocity, the first viewing angle variation range can be obtained as follows:
获取观测者在第一时刻对应的观测视角、目标时刻对应的观测视角、第二时刻的观测视角,那么第一视角变化范围可以为:获取目标时刻与第一时刻之间的第一时长差值,在该第一时长差值较大的情况下,将该第一时长差值乘以转动的角速度,得到转动的角度,在将该转动的角度加上第一时刻对应的观测视角,即可得到第二视角变化范围;然后获取目标时刻与第二时刻之间的第二时长差值,在该第二时长差值较大的情况下,将该第二时长差值乘以转动的角速度,得到转动的角度,在将该转动的角度加上目标时刻对应的观测视角,即可得到第三视角变化范围;在确定第二视角变化范围和第三视角变化范围后,可以确定第一视角变换范围。Obtain the observation angle of view corresponding to the observer at the first moment, the observation angle corresponding to the target moment, and the observation angle at the second moment, then the first angle of view change range can be: obtain the first time difference between the target moment and the first moment, when the first time difference is large, multiply the first time difference by the angular velocity of rotation to obtain the angle of rotation, and add the rotation angle to the observation angle corresponding to the first moment to obtain the second angle of view change range; then obtain the second time difference between the target moment and the second moment, when the second time difference is large, multiply the second time difference by the angular velocity of rotation to obtain the angle of rotation, and add the rotation angle to the observation angle corresponding to the target moment to obtain the third angle of view change range; after determining the second angle of view change range and the third angle of view change range, the first angle of view change range can be determined.
步骤206,根据模糊强度参数和第一视角变化范围,确定全景图像的实际视角抽样范围。Step 206: Determine the actual viewing angle sampling range of the panoramic image according to the blur intensity parameter and the first viewing angle variation range.
其中,模糊强度参数可以指对全景图像进行取样的取样强度参数。该模糊强度参数是一个预先设置的可调参数,该模糊强度参数可以是用户预先设置的,也可以是处理器自动设置的,模糊强度参数具体的数值可以根据具体情况进行设置,对于此,本申请不作具体限制。该模糊强度参数可以用K表示,其中,K∈[0,1]。当模糊强度参数K越接近于0时,对应的实际视角抽样范围越小;当模糊强度参数越接近1时,对应的实际视角抽样范围越大。Among them, the blur intensity parameter may refer to a sampling intensity parameter for sampling a panoramic image. The blur intensity parameter is a pre-set adjustable parameter. The blur intensity parameter may be pre-set by a user or automatically set by a processor. The specific value of the blur intensity parameter may be set according to the specific situation. This application does not impose any specific restrictions on this. The blur intensity parameter may be represented by K, where K∈[0,1]. When the blur intensity parameter K is closer to 0, the corresponding actual viewing angle sampling range is smaller; when the blur intensity parameter is closer to 1, the corresponding actual viewing angle sampling range is larger.
实际视角抽样范围可以指对全景图像进行视角采样的范围。The actual viewing angle sampling range may refer to a range of viewing angle sampling for a panoramic image.
在一些实施例中,可以通过控制模糊强度参数的值能够控制实际视角抽样范围。In some embodiments, the actual viewing angle sampling range can be controlled by controlling the value of the blur strength parameter.
例如,将第二视角变化范围和第三视角变化范围进行合并,然后,取模糊强度参数的值为0.5,则实际视角抽样范围为第二视角变化范围和第三视角变化范围之和的一半,即实际视角抽样范围是第一视角变化范围的一半。特别地, 当第二视角变化范围和第三视角变化范围在数值上相等时,则实际视角抽样范围在数值上和第二视角变化范围相等,可以取第二视角变化范围的一半、第三视角变化范围的一半,即可得到实际视角抽样范围。需要理解的是,也可以采取其他方式获取实际视角抽样范围,对于此,本申请不作具体限制。For example, the second viewing angle variation range and the third viewing angle variation range are combined, and then the blur intensity parameter value is taken as 0.5, then the actual viewing angle sampling range is half of the sum of the second viewing angle variation range and the third viewing angle variation range, that is, the actual viewing angle sampling range is half of the first viewing angle variation range. In particular, When the second viewing angle variation range and the third viewing angle variation range are equal in value, the actual viewing angle sampling range is equal in value to the second viewing angle variation range, and the actual viewing angle sampling range can be obtained by taking half of the second viewing angle variation range and half of the third viewing angle variation range. It should be understood that other methods can also be used to obtain the actual viewing angle sampling range, and this application does not make specific restrictions on this.
步骤208,在实际视角抽样范围中,依次抽取N个观测视角,并得到N个观测视角在全景图像中对应的N个观测图像;其中,N为正整数。Step 208, sequentially extracting N observation viewing angles in the actual viewing angle sampling range, and obtaining N observation images corresponding to the N observation viewing angles in the panoramic image; wherein N is a positive integer.
其中,观测图像可以指观测者从观测视角对全景图像进行观测的图像。The observed image may refer to an image obtained by observing the panoramic image from an observation perspective by an observer.
在前述得到的实际视角抽样范围中,对全景图像依次抽取N个观测视角,并获取各观测视角在全景图像中对应的观测图像,得到N个观测图像。In the actual viewing angle sampling range obtained above, N observation viewing angles are sequentially extracted from the panoramic image, and the observation image corresponding to each observation viewing angle in the panoramic image is obtained to obtain N observation images.
示例性地,可以采取不均等抽样的方式,在实际视角抽样范围中对全景图像依次不均等抽取N个观测视角,得到N个观测图像。例如在全景图像中随机抽取第一个视角,然后,再在以随机获得的抽样间距在第一个视角之后从全景图像中抽取第二个视角。For example, an unequal sampling method may be adopted to sequentially and unequally extract N observation viewing angles from the panoramic image within the actual viewing angle sampling range to obtain N observation images. For example, a first viewing angle is randomly extracted from the panoramic image, and then a second viewing angle is extracted from the panoramic image after the first viewing angle at a randomly obtained sampling interval.
示例性地,也可以采取均等抽样的方式,在实际视角抽样范围中对全景图像均等抽取N个观测视角,再得到各观测视角在全景图像中对应的N个观测图像。Exemplarily, an equal sampling method may be adopted to equally extract N observation viewing angles for the panoramic image within the actual viewing angle sampling range, and then obtain N observation images corresponding to each observation viewing angle in the panoramic image.
步骤210,根据N个观测图像计算得到目标模糊图像。Step 210, calculating and obtaining a blurred target image based on the N observed images.
其中,目标模糊图像可以指对全景图像进行处理后的,附加有残影模糊效果和仿生人眼视角效果的图像。The target blurred image may refer to an image obtained by processing the panoramic image and adding an afterimage blur effect and a bionic human eye perspective effect.
在一些实施例中,可以通过将N个观测图像进行加权求和,得到目标模糊图像。In some embodiments, the target blurred image can be obtained by performing weighted summation on N observed images.
上述全景图像处理方法中,通过根据观测视角确定第一视角变化范围,以模拟人眼观测视角的变化,然后再在实际视角抽样范围中,依次抽取N个观测视角,并得到N个观测视角在全景图像中对应的N个观测图像,从而便于根据N个观测图像计算得到目标模糊图像,以生成模拟人眼观测视角在变化过程中所观测到的模糊图像,从而实现了给剪辑图像附加残影的模糊效果,以及附加了仿生人眼的视觉效果。In the above-mentioned panoramic image processing method, the first perspective change range is determined according to the observation perspective to simulate the change of the human eye's observation perspective, and then N observation perspectives are sequentially extracted in the actual perspective sampling range, and N observation images corresponding to the N observation perspectives in the panoramic image are obtained, so as to facilitate the calculation of the target blurred image based on the N observation images to generate a blurred image observed by simulating the human eye's observation perspective during the change process, thereby achieving the blur effect of adding afterimages to the clipped image and adding the visual effect of the bionic human eye.
在一些实施例中,如图4所示,步骤206包括但不限于以下步骤: In some embodiments, as shown in FIG. 4 , step 206 includes but is not limited to the following steps:
步骤402,在多个观测视角中,将目标时刻对应的目标观测视角标记为第二抽样视角。Step 402: Among multiple observation perspectives, mark the target observation perspective corresponding to the target moment as a second sampling perspective.
其中,可以用B1来表示第二抽样视角,则B1=At。即将目标时刻对应的观测视角作为目标时刻对应的第二抽样视角。Wherein, B 1 can be used to represent the second sampling angle of view, then B 1 =A t , that is, the observation angle of view corresponding to the target moment is taken as the second sampling angle of view corresponding to the target moment.
步骤404,根据目标观测视角、第一时刻对应的第一观测视角和模糊强度参数,计算得到第一抽样视角。Step 404, calculating a first sampling viewing angle according to the target observation viewing angle, the first observation viewing angle corresponding to the first moment and the blur intensity parameter.
其中,可以用B0来表示第一抽样视角,那么第一抽样视角B0可以用以下公式(1)进行表示,公式(1)具体为:
B0=At-(At-At-1)*K         (1)
Among them, B 0 can be used to represent the first sampling angle of view, so the first sampling angle of view B 0 can be represented by the following formula (1), and the formula (1) is specifically:
B 0 = At -( At -At -1 )*K (1)
其中,公式(1)中的K表示模糊强度参数,At表示目标时刻对应的目标观测视角,At-1表示第一时刻对应的第一观测视角。Wherein, K in formula (1) represents the blur intensity parameter, At represents the target observation angle corresponding to the target moment, and At -1 represents the first observation angle corresponding to the first moment.
将预先设置的模糊强度参数、目标观测视角和第一观测视角代入到公式(1)中,即可计算得到第一抽样视角。Substituting the preset blur intensity parameter, target observation angle and first observation angle into formula (1), the first sampling angle can be calculated.
步骤406,根据目标观测视角、第二时刻对应的第二观测视角和模糊强度参数,计算得到第三抽样视角。Step 406, calculating a third sampling angle of view according to the target observation angle of view, the second observation angle of view corresponding to the second moment and the blur intensity parameter.
在一些实施例中,可以用B2来表示第三抽样视角,那么第三抽样视角B2可以用以下公式(2)来表示,公式(2)具体为:
B2=At+(At+1-At)*K      (2)
In some embodiments, the third sampling angle of view may be represented by B 2 , and the third sampling angle of view B 2 may be represented by the following formula (2), where formula (2) is specifically:
B2 = At + ( At + 1 - At ) * K (2)
其中,在公式(2)中,K表示模糊强度参数,At表示目标时刻对应的目标观测视角,At+1表示第二时刻对应的第二观测视角。In formula (2), K represents the blur intensity parameter, At represents the target observation angle corresponding to the target moment, and At +1 represents the second observation angle corresponding to the second moment.
将预先设置的模糊强度参数、目标观测视角和第二观测视角代入到公式(2)中,即可计算得到第三抽样视角。Substituting the preset blur intensity parameter, target observation angle and second observation angle into formula (2), the third sampling angle can be calculated.
步骤408,将第一抽样视角到第二抽样视角的视角变化范围和/或第二抽样视角到第三抽样视角的视角变化范围,标记为实际视角抽样范围。Step 408: Mark the viewing angle change range from the first sampling viewing angle to the second sampling viewing angle and/or the viewing angle change range from the second sampling viewing angle to the third sampling viewing angle as the actual viewing angle sampling range.
在一些实施例中,实际视角抽样范围可以是第一抽样视角到第二抽样视角的视角变化范围,也可以是第二抽样视角到第三抽样视角的视角变化范围,还可以是第一抽样视角到第二抽样视角的视角变化范围和第二抽样视角到第三抽样视角的视角变化范围。 In some embodiments, the actual perspective sampling range can be the perspective change range from the first sampling perspective to the second sampling perspective, or the perspective change range from the second sampling perspective to the third sampling perspective, or the perspective change range from the first sampling perspective to the second sampling perspective and the perspective change range from the second sampling perspective to the third sampling perspective.
例如,当实际视角抽样范围是第一抽样视角到第二抽样视角的视角变化范围和第二抽样视角到第三抽样视角的视角变化范围时,实际视角抽样范围可以用B0→B1→B2来表示。其中,B0→B1表示第一抽样视角到第二抽样视角的变化;B1→B2表示第二抽样视角到第三抽样视角的变化。For example, when the actual viewing angle sampling range is the viewing angle change range from the first sampling viewing angle to the second sampling viewing angle and the viewing angle change range from the second sampling viewing angle to the third sampling viewing angle, the actual viewing angle sampling range can be expressed as B 0 →B 1 →B 2. Among them, B 0 →B 1 represents the change from the first sampling viewing angle to the second sampling viewing angle; B 1 →B 2 represents the change from the second sampling viewing angle to the third sampling viewing angle.
在本实施例中,可以通过控制第一视角变化范围和模糊强度参数来控制实际视角抽样范围。In this embodiment, the actual viewing angle sampling range can be controlled by controlling the first viewing angle variation range and the blur intensity parameter.
在一个实施例中,当目标时刻为初始时刻时(即目标时刻为第0个时刻时),则对应的第一视角变化范围为目标时刻到第二时刻的视角变化范围,此时实际视角抽样范围为第二抽样视角到第三抽样视角的视角变化范围。当目标时刻为结束时刻时(即目标时刻为时序上的最后时刻时),对应的第一视角变化范围为第一时刻到目标时刻的视角变化范围,此时实际视角抽样范围为第一抽样视角到第三抽样视角的视角变化范围。In one embodiment, when the target moment is the initial moment (i.e., the target moment is the 0th moment), the corresponding first perspective change range is the perspective change range from the target moment to the second moment, and the actual perspective sampling range is the perspective change range from the second sampling perspective to the third sampling perspective. When the target moment is the end moment (i.e., the target moment is the last moment in the sequence), the corresponding first perspective change range is the perspective change range from the first moment to the target moment, and the actual perspective sampling range is the perspective change range from the first sampling perspective to the third sampling perspective.
在一些实施例中,实际视角抽样范围为第一抽样视角到第二抽样视角的视角变化范围和第二抽样视角到第三抽样视角的视角变化范围。步骤208包括但不限于以下步骤:在第一抽样视角到第二抽样视角的视角变化范围内,依次均等抽取n1个观测视角;其中,n1=N/2,n1为正整数;在第二抽样视角到第三抽样视角的视角变化范围内,依次均等抽取n2个观测视角;其中,n2=N/2,n2为正整数;将n1个观测视角和n2个观测视角组合形成N个观测视角,根据抽取的N个观测视角对全景图像进行采样,得到N个观测图像。In some embodiments, the actual viewing angle sampling range is the viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle and the viewing angle variation range from the second sampling viewing angle to the third sampling viewing angle. Step 208 includes but is not limited to the following steps: within the viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle, n1 observation viewing angles are uniformly extracted in sequence; wherein n1=N/2, n1 is a positive integer; within the viewing angle variation range from the second sampling viewing angle to the third sampling viewing angle, n2 observation viewing angles are uniformly extracted in sequence; wherein n2=N/2, n2 is a positive integer; n1 observation viewing angles and n2 observation viewing angles are combined to form N observation viewing angles, and the panoramic image is sampled according to the extracted N observation viewing angles to obtain N observation images.
示例性地,可以采取均等抽取的方式在第一抽样视角到第二抽样视角的视角变化范围内进行均等抽取,得到n1个观测视角。Exemplarily, an even sampling method may be adopted to perform even sampling within the viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle to obtain n1 observation viewing angles.
例如,可以用前述的B0来表示第一抽样视角,用B1来表示第二抽样视角,用B2来表示第三抽样视角,那么在B0→B1的视角变化范围内,均等地抽取n1个视角,可以用以下公式(3)来表示:
For example, the aforementioned B0 can be used to represent the first sampling perspective, B1 can be used to represent the second sampling perspective, and B2 can be used to represent the third sampling perspective. Then, within the perspective variation range of B0B1 , n1 perspectives are equally sampled, which can be represented by the following formula (3):
其中,在公式(3)中,n1表示抽取视角的个数,n1=N/2,n1为整数,Ci表示在B0→B1的视角变化范围内抽取的视角,i=1,2,…,n1。 In formula (3), n1 represents the number of extracted viewing angles, n1=N/2, n1 is an integer, Ci represents the viewing angle extracted within the viewing angle variation range of B0B1 , i=1,2,…,n1.
类似地,在B1→B2的视角变化范围内,均等抽取n2个视角,可以用以下公式(4)来表示,公式(4)具体为:
Similarly, within the viewing angle variation range of B 1 →B 2 , n2 viewing angles are equally extracted, which can be expressed by the following formula (4). Formula (4) is specifically:
其中,在公式(4)中,n2表示抽取视角的个数,n2=N/2,n2为整数,Dj表示在B1→B2的视角变化范围内抽取的视角,j=1,2,…,n2。In formula (4), n2 represents the number of extracted viewing angles, n2=N/2, n2 is an integer, Dj represents the viewing angle extracted within the viewing angle variation range of B1B2 , j=1,2,…,n2.
例如,当N=30时,则在B0→B1的视角变化范围内,依次抽取得到在时序上连贯的15个观测视角,在B1→B2的视角变化范围内中,依次抽取得到在时序上连贯的15个观测视角。For example, when N=30, 15 temporally coherent observation viewing angles are sequentially extracted within the viewing angle variation range of B 0 →B 1 , and 15 temporally coherent observation viewing angles are sequentially extracted within the viewing angle variation range of B 1 →B 2 .
综上,在实际视角抽样范围B0→B1→B2中,抽取得到了在时序上连贯的N个观测视角,然后,在根据抽取得到的N个观测视角对全景图像进行采样,得到每一观测视角对应的观测图像。In summary, in the actual viewing angle sampling range B 0 →B 1 →B 2 , N observation viewing angles that are coherent in time sequence are extracted, and then, the panoramic image is sampled according to the extracted N observation viewing angles to obtain an observation image corresponding to each observation viewing angle.
在一个实施例中,当实际视角抽样范围为第一抽样视角到第二抽样视角的视角变化范围或第二抽样视角到第三抽样视角的视角变化范围,可以直接在实际视角抽样范围中抽取N个观测视角。In one embodiment, when the actual viewing angle sampling range is the viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle or the viewing angle variation range from the second sampling viewing angle to the third sampling viewing angle, N observation viewing angles can be directly extracted from the actual viewing angle sampling range.
如图5所示,在一些实施例中,步骤210包括但不限于以下步骤:As shown in FIG. 5 , in some embodiments, step 210 includes but is not limited to the following steps:
步骤502,对各观测图像设定对应的权重。Step 502: Set corresponding weights for each observed image.
步骤504,根据各观测图像的像素值及对应的权重进行加权求和处理,得到目标模糊图像。Step 504, performing weighted sum processing according to the pixel values of each observed image and the corresponding weights to obtain a target blurred image.
示例性地,对于N张观测图像中的每一个观测图像都设定一个权重。例如,以W1表示时序上第一张观测图像对应的权重,以W2表示时序上第二张观测图像对应的权重,以此类推,以WN表示时序上第N张观测图像对应的权重。Exemplarily, a weight is set for each of the N observation images. For example, W 1 represents the weight corresponding to the first observation image in the time sequence, W 2 represents the weight corresponding to the second observation image in the time sequence, and so on, W N represents the weight corresponding to the Nth observation image in the time sequence.
需要说明的是,设定的权重之和为1,即其中,i=1,2…,N。It should be noted that the sum of the weights is set to 1, that is Where i=1,2…,N.
在确定每一个观测图像对应的权重后,根据每一观测图像的像素值和对应的权重进行加权求和处理,得到目标模糊图像。After determining the weight corresponding to each observation image, a weighted summation process is performed according to the pixel value of each observation image and the corresponding weight to obtain the target blurred image.
在一些实施例中,步骤502包括但不限于以下步骤:按照观测图像的抽取顺序,设置各观测图像的初始值;其中,各观测图像的初始值按照抽取顺序递增;将各初始值进行归一化处理,得到各观测图像对应的权重。 In some embodiments, step 502 includes but is not limited to the following steps: setting the initial value of each observation image according to the extraction order of the observation images; wherein the initial value of each observation image increases in the extraction order; and normalizing each initial value to obtain the weight corresponding to each observation image.
在本实施例中,通过设定递增的权重,使得时序越靠前的观测视角对应的观测图像占比越小,时序越靠后的观测视角对应的观测图像占比越大,从而使得运镜模糊效果具有强烈的方向感,能够让用户感受到具体的运动方式,进而提高用户的体验感。In this embodiment, by setting increasing weights, the proportion of observation images corresponding to observation angles that are earlier in the time sequence is smaller, and the proportion of observation images corresponding to observation angles that are later in the time sequence is larger, so that the camera blur effect has a strong sense of direction, allowing the user to feel the specific movement method, thereby improving the user experience.
例如,令初始值Wi=i,再对Wi进行归一化处理,得到一个在时序上单调递增的权重。即令W1=1、W2=2、…、WN=N,然后再对每一个初始值进行归一化处理,即可得到一个在时序上单调递增的权重,然后再根据各观测图像的像素值和该归一化后的权重进行加权求和处理,即可得到目标模糊图像。For example, let the initial value Wi = i, and then normalize Wi to obtain a weight that increases monotonically in time series. That is, let W1 = 1, W2 = 2, ..., WN = N, and then normalize each initial value to obtain a weight that increases monotonically in time series, and then perform weighted summation based on the pixel values of each observed image and the normalized weight to obtain the target blurred image.
在一些实施例中,步骤504包括但不限于以下步骤:获取各观测图像中各像素点对应的初始像素值;对各观测图像中各像素点的初始像素值及对应的权重进行加权求和处理,得到目标模糊图像中各像素点的目标像素值。In some embodiments, step 504 includes but is not limited to the following steps: obtaining the initial pixel value corresponding to each pixel point in each observed image; performing weighted summation processing on the initial pixel value of each pixel point in each observed image and the corresponding weight to obtain the target pixel value of each pixel point in the target blurred image.
目标模糊图像可以由若干个像素点组成,在确定每个像素点的像素值以后,即确定了目标模糊图像。The target blurred image may be composed of a number of pixels. After the pixel value of each pixel is determined, the target blurred image is determined.
首先获取各观测图像中每一个像素点对应的初始像素值,然后使用权重对对应各观测图像的初始像素值进行加权处理,得到加权后的像素值,再获取各观测图像中相同位置像素点的加权后的像素值的和值,得到目标像素值,在确定观测图像各像素点对应的目标像素值后,即得到了目标模糊图像。First, the initial pixel value corresponding to each pixel point in each observation image is obtained, and then the initial pixel value corresponding to each observation image is weighted using the weight to obtain the weighted pixel value, and then the sum of the weighted pixel values of the pixel points at the same position in each observation image is obtained to obtain the target pixel value. After determining the target pixel value corresponding to each pixel point of the observation image, the target blurred image is obtained.
例如,以I表示最终的目标模糊图像,处于目标模糊图像I中的第一行第一列像素点的目标像素值用I11表示,那么I11可以用以下公式(5)计算得到,公式(5)具体为:
For example, the final target blurred image is represented by I, and the target pixel value of the first row and first column pixel in the target blurred image I is represented by I 11 , then I 11 can be calculated by the following formula (5), which is specifically:
在公式(5)中,ai表示在N张观测图像中,第i个观测图像中在第一行第一列的初始像素值。In formula (5), a i represents the initial pixel value in the first row and first column of the i-th observed image among N observed images.
类似地,对于目标模糊图像中其他像素点的目标像素值也采取如公式(5)的计算方式,即可得到最终目标模糊图像。Similarly, the target pixel values of other pixels in the target blurred image are calculated in the same manner as in formula (5) to obtain the final target blurred image.
在一些实施例中,如图6所示,全景图像处理方法包括但不限于以下步骤:In some embodiments, as shown in FIG6 , the panoramic image processing method includes but is not limited to the following steps:
步骤602,获取对全景图像在多个预设时刻分别进行观测的观测视角。 Step 602: Obtain observation angles of the panoramic image at a plurality of preset moments.
步骤604,根据多个观测视角确定第一视角变化范围;第一视角变化范围为第一时刻到目标时刻之间的视角变化范围和/或目标时刻到第二时刻之间的视角变化范围;其中,第一时刻、目标时刻和第二时刻为预设时刻中依序进行观测的时刻,且第一时刻到目标时刻之间的时间间隔与目标时刻到第二时刻之间的时间间隔相等。Step 604, determining a first perspective change range based on multiple observation perspectives; the first perspective change range is a perspective change range between a first moment and a target moment and/or a perspective change range between a target moment and a second moment; wherein the first moment, the target moment and the second moment are moments that are observed sequentially in preset moments, and the time interval between the first moment and the target moment is equal to the time interval between the target moment and the second moment.
步骤606,在多个观测视角中,将目标时刻对应的目标观测视角标记为第二抽样视角。Step 606: Among the multiple observation perspectives, mark the target observation perspective corresponding to the target moment as the second sampling perspective.
步骤608,根据目标观测视角、第一时刻对应的第一观测视角和模糊强度参数,计算得到第一抽样视角。Step 608, calculating a first sampling viewing angle according to the target observation viewing angle, the first observation viewing angle corresponding to the first moment and the blur intensity parameter.
步骤610,根据目标观测视角、第二时刻对应的第二观测视角和模糊强度参数,计算得到第三抽样视角。Step 610, calculating a third sampling angle of view according to the target observation angle of view, the second observation angle of view corresponding to the second moment and the blur intensity parameter.
步骤612,将第一抽样视角到第二抽样视角的视角变化范围和/或第二抽样视角到第三抽样视角的视角变化范围,标记为实际视角抽样范围。Step 612: Mark the viewing angle change range from the first sampling viewing angle to the second sampling viewing angle and/or the viewing angle change range from the second sampling viewing angle to the third sampling viewing angle as the actual viewing angle sampling range.
步骤614,在第一抽样视角到第二抽样视角的视角变化范围内,依次均等抽取n1个观测视角;其中,n1=N/2,n1为正整数。Step 614, within the range of the viewing angle change from the first sampling viewing angle to the second sampling viewing angle, n1 observation viewing angles are uniformly sampled in sequence; wherein n1=N/2, and n1 is a positive integer.
步骤616,在第二抽样视角到第三抽样视角的视角变化范围内,依次均等抽取n2个观测视角;其中,n2=N/2,n2为正整数。Step 616, within the range of the viewing angle variation from the second sampling viewing angle to the third sampling viewing angle, n2 observation viewing angles are equally selected in sequence; wherein n2=N/2, and n2 is a positive integer.
步骤618,n1个观测视角和n2个观测视角组合形成N个观测视角,根据抽取的N个观测视角对全景图像进行采样,得到N个观测图像。Step 618: n1 observation angles and n2 observation angles are combined to form N observation angles, and the panoramic image is sampled according to the extracted N observation angles to obtain N observation images.
步骤620,按照观测图像的抽取顺序,设置各观测图像的初始值;其中,各观测图像的初始值按照抽取顺序递增。Step 620, setting the initial value of each observation image according to the extraction order of the observation images; wherein the initial value of each observation image increases in sequence according to the extraction order.
步骤622,将各初始值进行归一化处理,得到各观测图像对应的权重。Step 622, normalize each initial value to obtain the weight corresponding to each observed image.
步骤624,根据各观测图像的像素值及对应的权重进行加权求和处理,得到目标模糊图像。Step 624, performing weighted summation processing according to the pixel values of each observed image and the corresponding weights to obtain a target blurred image.
需要说明的是,步骤602~步骤624的实施例请参照前述的具体步骤。It should be noted that the embodiments of steps 602 to 624 may refer to the aforementioned specific steps.
应该理解的是,虽然如上的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤 可以以其它的顺序执行。而且,如上的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps. Furthermore, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but may be performed at different times, and the execution order of these steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的全景图像处理方法的全景图像处理装置。Based on the same inventive concept, an embodiment of the present application also provides a panoramic image processing device for implementing the panoramic image processing method involved above.
在一些实施例中,如图7所示,提供了一种全景图像处理装置,包括:观测视角获取模块702、第一视角变化范围确定模块704、实际视角抽样范围确定模块706、观测图像获取模块708和目标模糊图像计算模块710,其中:In some embodiments, as shown in FIG. 7 , a panoramic image processing device is provided, including: an observation viewing angle acquisition module 702, a first viewing angle variation range determination module 704, an actual viewing angle sampling range determination module 706, an observation image acquisition module 708, and a target blurred image calculation module 710, wherein:
观测视角获取模块702,用于获取对全景图像在多个预设时刻分别进行观测的观测视角。The observation angle acquisition module 702 is used to acquire the observation angles for observing the panoramic image at multiple preset moments.
第一视角变化范围确定模块704,用于根据多个观测视角确定第一视角变化范围。The first viewing angle variation range determining module 704 is configured to determine the first viewing angle variation range according to multiple viewing angles.
实际视角抽样范围确定模块706,用于根据模糊强度参数和第一视角变化范围,确定全景图像的实际视角抽样范围。The actual viewing angle sampling range determining module 706 is used to determine the actual viewing angle sampling range of the panoramic image according to the blur intensity parameter and the first viewing angle variation range.
观测图像获取模块708,用于在实际视角抽样范围中,依次抽取N个观测视角,并得到N个观测视角在全景图像中对应的N个观测图像;其中,N为正整数。The observation image acquisition module 708 is used to sequentially extract N observation viewing angles in the actual viewing angle sampling range, and obtain N observation images corresponding to the N observation viewing angles in the panoramic image; wherein N is a positive integer.
目标模糊图像计算模块710,用于根据N个观测图像计算得到目标模糊图像。The target blurred image calculation module 710 is used to calculate the target blurred image according to the N observation images.
在一些实施例中,第一视角变化范围为第一时刻到目标时刻之间的视角变化范围和/或目标时刻到第二时刻之间的视角变化范围;其中,第一时刻、目标时刻和第二时刻为预设时刻中依序进行观测的时刻,且第一时刻到目标时刻之间的时间间隔与目标时刻到第二时刻之间的时间间隔相等。In some embodiments, the first viewing angle change range is the viewing angle change range between the first moment and the target moment and/or the viewing angle change range between the target moment and the second moment; wherein the first moment, the target moment and the second moment are moments observed sequentially in the preset moments, and the time interval between the first moment and the target moment is equal to the time interval between the target moment and the second moment.
实际视角抽样范围确定模块706包括:The actual viewing angle sampling range determination module 706 includes:
第二抽样视角确定单元,用于在多个观测视角中,将目标时刻对应的目标观测视角标记为第二抽样视角。 The second sampling viewing angle determining unit is used to mark the target observation viewing angle corresponding to the target moment as the second sampling viewing angle among multiple observation viewing angles.
第一抽样视角计算单元,用于根据目标观测视角、第一时刻对应的第一观测视角和模糊强度参数,计算得到第一抽样视角。The first sampling viewing angle calculation unit is used to calculate the first sampling viewing angle according to the target observation viewing angle, the first observation viewing angle corresponding to the first moment and the blur intensity parameter.
第三抽样视角计算单元,用于根据目标观测视角、第二时刻对应的第二观测视角和模糊强度参数,计算得到第三抽样视角。The third sampling viewing angle calculation unit is used to calculate the third sampling viewing angle according to the target observation viewing angle, the second observation viewing angle corresponding to the second moment and the blur intensity parameter.
第一标记单元,用于将第一抽样视角到第二抽样视角的视角变化范围和/或第二抽样视角到第三抽样视角的视角变化范围,标记为实际视角抽样范围。The first marking unit is used to mark the viewing angle change range from the first sampling viewing angle to the second sampling viewing angle and/or the viewing angle change range from the second sampling viewing angle to the third sampling viewing angle as the actual viewing angle sampling range.
在一些实施例中,实际视角抽样范围为第一抽样视角到第二抽样视角的视角变化范围和第二抽样视角到第三抽样视角的视角变化范围。观测图像获取模块708包括:In some embodiments, the actual viewing angle sampling range is the viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle and the viewing angle variation range from the second sampling viewing angle to the third sampling viewing angle. The observation image acquisition module 708 includes:
第一视角抽取单元,用于在第一抽样视角到第二抽样视角的视角变化范围内,依次均等抽取n1个观测视角;其中,n1=N/2,n1为正整数。The first viewing angle extraction unit is used to equally extract n1 observation viewing angles in sequence within the viewing angle variation range from the first sampling viewing angle to the second sampling viewing angle; wherein n1=N/2, and n1 is a positive integer.
第二视角抽取单元,用于在第二抽样视角到第三抽样视角的视角变化范围内,依次均等抽取n2个观测视角;其中,n2=N/2,n2为正整数。The second viewing angle extraction unit is used to equally extract n2 observation viewing angles in sequence within the viewing angle variation range from the second sampling viewing angle to the third sampling viewing angle; wherein n2=N/2, and n2 is a positive integer.
图像采样单元,用于将n1个观测视角和n2个观测视角组合形成N个观测视角,根据抽取的N个观测视角对全景图像进行采样,得到N个观测图像。The image sampling unit is used to combine n1 observation viewing angles and n2 observation viewing angles to form N observation viewing angles, and to sample the panoramic image according to the extracted N observation viewing angles to obtain N observation images.
在一些实施例中,目标模糊图像计算模块710包括:In some embodiments, the target blurred image calculation module 710 includes:
权重设定单元,用于对各观测图像设定对应的权重。The weight setting unit is used to set a corresponding weight for each observation image.
加权求和单元,用于根据各观测图像的像素值及对应的权重进行加权求和处理,得到目标模糊图像。The weighted summation unit is used to perform weighted summation processing according to the pixel values of each observation image and the corresponding weights to obtain a target blurred image.
在一些实施例中,权重设定单元包括:In some embodiments, the weight setting unit includes:
初始值设定子单元,用于按照观测图像的抽取顺序,设置各观测图像的初始值;其中,各观测图像的初始值按照抽取顺序递增。The initial value setting subunit is used to set the initial value of each observation image according to the extraction order of the observation images; wherein the initial value of each observation image increases in sequence according to the extraction order.
归一化处理子单元,用于将各初始值进行归一化处理,得到各观测图像对应的权重。The normalization processing subunit is used to normalize each initial value to obtain the weight corresponding to each observed image.
在一些实施例中,加权求和单元包括:In some embodiments, the weighted summation unit comprises:
初始像素值获取子单元,用于获取各观测图像中各像素点对应的初始像素值。The initial pixel value acquisition subunit is used to obtain the initial pixel value corresponding to each pixel point in each observed image.
加权处理子单元,用于对各观测图像中各像素点的初始像素值及对应的权 重进行加权求和处理,得到目标模糊图像中各像素点的目标像素值。The weighted processing subunit is used to calculate the initial pixel value and the corresponding weight of each pixel in each observation image. The target pixel value of each pixel in the target blurred image is obtained by performing weighted summation processing.
上述全景图像处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the panoramic image processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
在一些实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图8所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示单元和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、移动蜂窝网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种全景图像处理方法。该计算机设备的显示单元可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示单元上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, a communication interface, a display unit, and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a panoramic image processing method is implemented. The display unit of the computer device may be a liquid crystal display or an electronic ink display, and the input device of the computer device may be a touch layer covered on the display unit, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
在一些实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现上述的全景图像处理方法的步骤。In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned panoramic image processing method when executing the computer program.
在一些实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现全景图像处理方法的步骤。In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the panoramic image processing method are implemented.
在一些实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述的全景图像处理方法的步骤。 In some embodiments, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned panoramic image processing method when executed by a processor.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchain, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。 The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims (10)

  1. 一种全景图像处理方法,其特征在于,所述方法包括:A panoramic image processing method, characterized in that the method comprises:
    获取对全景图像在多个预设时刻分别进行观测的观测视角;Obtaining observation angles of the panoramic image at multiple preset moments;
    根据多个所述观测视角确定第一视角变化范围;Determining a first viewing angle variation range according to the plurality of viewing angles;
    根据模糊强度参数和所述第一视角变化范围,确定所述全景图像的实际视角抽样范围;Determining an actual viewing angle sampling range of the panoramic image according to a blur intensity parameter and the first viewing angle variation range;
    在所述实际视角抽样范围中,依次抽取N个观测视角,并得到所述N个观测视角在所述全景图像中对应的N个观测图像;其中,N为正整数;In the actual viewing angle sampling range, N observation viewing angles are sequentially extracted, and N observation images corresponding to the N observation viewing angles in the panoramic image are obtained; wherein N is a positive integer;
    根据N个所述观测图像计算得到目标模糊图像。A target blurred image is obtained by calculation based on the N observed images.
  2. 根据权利要求1所述的方法,其特征在于,所述第一视角变化范围为第一时刻到目标时刻之间的视角变化范围和/或所述目标时刻到第二时刻之间的视角变化范围;其中,所述第一时刻、所述目标时刻和所述第二时刻为所述预设时刻中依序进行观测的时刻,且所述第一时刻到所述目标时刻之间的时间间隔与所述目标时刻到所述第二时刻之间的时间间隔相等;The method according to claim 1 is characterized in that the first viewing angle change range is the viewing angle change range between a first moment and a target moment and/or the viewing angle change range between the target moment and a second moment; wherein the first moment, the target moment and the second moment are moments observed sequentially in the preset moments, and the time interval between the first moment and the target moment is equal to the time interval between the target moment and the second moment;
    所述根据模糊强度参数和所述第一视角变化范围,确定所述全景图像的实际视角抽样范围,包括:The step of determining the actual viewing angle sampling range of the panoramic image according to the blur intensity parameter and the first viewing angle variation range includes:
    在多个所述观测视角中,将所述目标时刻对应的目标观测视角标记为第二抽样视角;Among the multiple observation angles, marking the target observation angle corresponding to the target moment as a second sampling angle;
    根据所述目标观测视角、所述第一时刻对应的第一观测视角和所述模糊强度参数,计算得到第一抽样视角;Calculate a first sampling angle of view according to the target observation angle of view, the first observation angle of view corresponding to the first moment, and the blur intensity parameter;
    根据所述目标观测视角、所述第二时刻对应的第二观测视角和所述模糊强度参数,计算得到第三抽样视角;Calculate a third sampling angle of view according to the target observation angle of view, the second observation angle of view corresponding to the second moment, and the blur intensity parameter;
    将所述第一抽样视角到所述第二抽样视角的视角变化范围和/或所述第二抽样视角到所述第三抽样视角的视角变化范围,标记为所述实际视角抽样范围。The perspective change range from the first sampling perspective to the second sampling perspective and/or the perspective change range from the second sampling perspective to the third sampling perspective is marked as the actual perspective sampling range.
  3. 根据权利要求2所述的方法,其特征在于,所述实际视角抽样范围为所述第一抽样视角到所述第二抽样视角的视角变化范围和所述第二抽样视角到所述第三抽样视角的视角变化范围;The method according to claim 2, characterized in that the actual viewing angle sampling range is a viewing angle change range from the first sampling viewing angle to the second sampling viewing angle and a viewing angle change range from the second sampling viewing angle to the third sampling viewing angle;
    所述在所述实际视角抽样范围中,依次抽取所述N个观测视角,并得到所述N个观测视角在所述全景图像中对应的N个观测图像,包括: The step of sequentially extracting the N observation viewing angles in the actual viewing angle sampling range and obtaining N observation images corresponding to the N observation viewing angles in the panoramic image comprises:
    在所述第一抽样视角到所述第二抽样视角的视角变化范围内,依次均等抽取n1个观测视角;其中,n1=N/2,n1为正整数;In the range of the viewing angle change from the first sampling viewing angle to the second sampling viewing angle, n1 observation viewing angles are uniformly selected in sequence; wherein n1=N/2, and n1 is a positive integer;
    在所述第二抽样视角到所述第三抽样视角的视角变化范围内,依次均等抽取n2个观测视角,其中,n2=N/2,n2为正整数;In the range of the viewing angle variation from the second sampling viewing angle to the third sampling viewing angle, n2 observation viewing angles are uniformly extracted in sequence, where n2=N/2, and n2 is a positive integer;
    将n1个观测视角和n2个观测视角组合形成N个观测视角,根据抽取的N个观测视角对所述全景图像进行采样,得到N个所述观测图像。The n1 observation viewing angles and the n2 observation viewing angles are combined to form N observation viewing angles, and the panoramic image is sampled according to the extracted N observation viewing angles to obtain N observation images.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述根据N个所述观测图像计算得到目标模糊图像,包括:The method according to any one of claims 1 to 3, characterized in that the step of calculating the target blurred image based on the N observed images comprises:
    对各所述观测图像设定对应的权重;Setting a corresponding weight for each of the observed images;
    根据所述各观测图像的像素值及对应的所述权重进行加权求和处理,得到所述目标模糊图像。A weighted summation process is performed according to the pixel values of each observed image and the corresponding weights to obtain the target blurred image.
  5. 根据权利要求4所述的方法,其特征在于,所述对各所述观测图像设定对应的权重,包括:The method according to claim 4, characterized in that the step of setting a corresponding weight for each of the observed images comprises:
    按照所述观测图像的抽取顺序,设置各所述观测图像的初始值;其中,各所述观测图像的所述初始值按照所述抽取顺序递增;According to the extraction order of the observation images, the initial value of each observation image is set; wherein the initial value of each observation image is increased in sequence according to the extraction order;
    将各所述初始值进行归一化处理,得到各所述观测图像对应的权重。Each of the initial values is normalized to obtain a weight corresponding to each of the observed images.
  6. 根据权利要求4所述的方法,其特征在于,所述根据所述各观测图像的像素值及对应的所述权重进行加权求和处理,得到所述目标模糊图像,包括:The method according to claim 4 is characterized in that the step of performing weighted summation processing according to the pixel values of each observed image and the corresponding weights to obtain the target blurred image comprises:
    获取各所述观测图像中各像素点的初始像素值;Obtaining an initial pixel value of each pixel in each of the observed images;
    对所述各观测图像中各像素点的初始像素值及对应的所述权重进行加权求和处理,得到所述目标模糊图像中各像素点的目标像素值。The initial pixel value of each pixel point in each observation image and the corresponding weight are weighted summed to obtain the target pixel value of each pixel point in the target blurred image.
  7. 一种全景图像处理装置,其特征在于,所述装置包括:A panoramic image processing device, characterized in that the device comprises:
    观测视角获取模块,用于获取对全景图像在多个预设时刻分别进行观测的观测视角;An observation angle acquisition module is used to acquire observation angles for observing the panoramic image at multiple preset moments;
    第一视角变化范围确定模块,用于根据多个所述观测视角确定第一视角变化范围;A first viewing angle variation range determining module, configured to determine a first viewing angle variation range according to the plurality of viewing angles;
    实际视角抽样范围确定模块,用于根据模糊强度参数和所述第一视角变化范围,确定所述全景图像的实际视角抽样范围; An actual viewing angle sampling range determining module, used to determine an actual viewing angle sampling range of the panoramic image according to a blur intensity parameter and the first viewing angle variation range;
    观测图像获取模块,用于在所述实际视角抽样范围中,依次抽取N个观测视角,并得到所述N个观测视角在所述全景图像中对应的N个观测图像;其中,N为正整数;An observation image acquisition module, used to sequentially extract N observation viewing angles in the actual viewing angle sampling range, and obtain N observation images corresponding to the N observation viewing angles in the panoramic image; wherein N is a positive integer;
    目标模糊图像计算模块,用于根据N个所述观测图像计算得到目标模糊图像。The target blurred image calculation module is used to calculate the target blurred image according to the N observation images.
  8. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至6中任一项所述的方法的步骤。A computer device comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of any one of the methods of claims 1 to 6 when executing the computer program.
  9. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至6中任一项所述的方法的步骤。A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
  10. 一种计算机程序产品,包括计算机程序,其特征在于,该计算机程序被处理器执行时实现权利要求1至6中任一项所述的方法的步骤。 A computer program product, comprising a computer program, characterized in that when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
PCT/CN2023/126583 2022-11-01 2023-10-25 Panoramic image processing method and apparatus, computer device, medium and program product WO2024093763A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211353984.2A CN115760551A (en) 2022-11-01 2022-11-01 Panoramic image processing method, panoramic image processing apparatus, computer device, panoramic image processing medium, and program product
CN202211353984.2 2022-11-01

Publications (1)

Publication Number Publication Date
WO2024093763A1 true WO2024093763A1 (en) 2024-05-10

Family

ID=85354852

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/126583 WO2024093763A1 (en) 2022-11-01 2023-10-25 Panoramic image processing method and apparatus, computer device, medium and program product

Country Status (2)

Country Link
CN (1) CN115760551A (en)
WO (1) WO2024093763A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115760551A (en) * 2022-11-01 2023-03-07 影石创新科技股份有限公司 Panoramic image processing method, panoramic image processing apparatus, computer device, panoramic image processing medium, and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019084719A1 (en) * 2017-10-30 2019-05-09 深圳市大疆创新科技有限公司 Image processing method and unmanned aerial vehicle
CN111970503A (en) * 2020-08-24 2020-11-20 腾讯科技(深圳)有限公司 Method, device and equipment for three-dimensionalizing two-dimensional image and computer readable storage medium
CN113538318A (en) * 2021-08-24 2021-10-22 北京奇艺世纪科技有限公司 Image processing method, image processing device, terminal device and readable storage medium
CN114866837A (en) * 2022-05-26 2022-08-05 影石创新科技股份有限公司 Video processing method, video processing apparatus, computer device, storage medium, and program product
CN114972023A (en) * 2022-04-21 2022-08-30 合众新能源汽车有限公司 Image splicing processing method, device and equipment and computer storage medium
CN115760551A (en) * 2022-11-01 2023-03-07 影石创新科技股份有限公司 Panoramic image processing method, panoramic image processing apparatus, computer device, panoramic image processing medium, and program product

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019084719A1 (en) * 2017-10-30 2019-05-09 深圳市大疆创新科技有限公司 Image processing method and unmanned aerial vehicle
CN111970503A (en) * 2020-08-24 2020-11-20 腾讯科技(深圳)有限公司 Method, device and equipment for three-dimensionalizing two-dimensional image and computer readable storage medium
CN113538318A (en) * 2021-08-24 2021-10-22 北京奇艺世纪科技有限公司 Image processing method, image processing device, terminal device and readable storage medium
CN114972023A (en) * 2022-04-21 2022-08-30 合众新能源汽车有限公司 Image splicing processing method, device and equipment and computer storage medium
CN114866837A (en) * 2022-05-26 2022-08-05 影石创新科技股份有限公司 Video processing method, video processing apparatus, computer device, storage medium, and program product
CN115760551A (en) * 2022-11-01 2023-03-07 影石创新科技股份有限公司 Panoramic image processing method, panoramic image processing apparatus, computer device, panoramic image processing medium, and program product

Also Published As

Publication number Publication date
CN115760551A (en) 2023-03-07

Similar Documents

Publication Publication Date Title
CN105635588B (en) A kind of digital image stabilization method and device
US10609280B2 (en) Method and system for recommending optimum position of photography
WO2018210318A1 (en) Blurring method and apparatus for image, storage medium, and electronic device
WO2024093763A1 (en) Panoramic image processing method and apparatus, computer device, medium and program product
JP2018537748A (en) Light field rendering of images with variable computational complexity
CN111340077B (en) Attention mechanism-based disparity map acquisition method and device
WO2022052782A1 (en) Image processing method and related device
WO2023169283A1 (en) Method and apparatus for generating binocular stereoscopic panoramic image, device, storage medium, and product
CN112288664A (en) High dynamic range image fusion method and device and electronic equipment
US20190164323A1 (en) Method and program for generating virtual reality contents
WO2024055967A1 (en) Video processing method and apparatus, computer device, and storage medium
See et al. Virtual reality 360 interactive panorama reproduction obstacles and issues
CN111818265B (en) Interaction method and device based on augmented reality model, electronic equipment and medium
CN115564639A (en) Background blurring method and device, computer equipment and storage medium
CN114785957A (en) Shooting method and device thereof
CN115049572A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN117252914A (en) Training method and device of depth estimation network, electronic equipment and storage medium
JP2023550047A (en) Using interpolation to generate video from still images
Lumentut et al. 6-DOF motion blur synthesis and performance evaluation of light field deblurring
CN115514895B (en) Image anti-shake method, apparatus, electronic device, and computer-readable storage medium
CN116681818B (en) New view angle reconstruction method, training method and device of new view angle reconstruction network
CN115375566A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN117541507A (en) Image data pair establishing method and device, electronic equipment and readable storage medium
CN117745528A (en) Image processing method and device
CN115861041A (en) Image style migration method and device, computer equipment, storage medium and product