[go: up one dir, main page]

CN113055592B - Image display method and device, electronic equipment and computer readable storage medium - Google Patents

Image display method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN113055592B
CN113055592B CN202110263924.0A CN202110263924A CN113055592B CN 113055592 B CN113055592 B CN 113055592B CN 202110263924 A CN202110263924 A CN 202110263924A CN 113055592 B CN113055592 B CN 113055592B
Authority
CN
China
Prior art keywords
image
relay
pixel
original
zoom ratio
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202110263924.0A
Other languages
Chinese (zh)
Other versions
CN113055592A (en
Inventor
戴朋飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110263924.0A priority Critical patent/CN113055592B/en
Publication of CN113055592A publication Critical patent/CN113055592A/en
Application granted granted Critical
Publication of CN113055592B publication Critical patent/CN113055592B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/951Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/69Control of means for changing angle of the field of view, e.g. optical zoom objectives or electronic zooming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)

Abstract

本申请涉及一种图像展示方法、装置、计算机设备和存储介质。所述方法包括:在控制图像的缩放倍率进入预设倍率区间的情况下,获取原始摄像头拍摄的原始图像,以及获取接力摄像头拍摄的接力图像;在时间域上,获取原始图像中各像素点的原始时间域权重,以及接力图像中各像素点的接力时间域权重;在空间域上,获取原始图像中各像素点的原始空间域权重,以及接力图像中各像素点的接力空间域权重;确定目标图像中各目标像素点的像素值;根据各目标像素点的像素值得到目标图像,并展示目标图像。采用本方法能够使得所展示的目标图像更加自然。

Figure 202110263924

The present application relates to an image display method, device, computer equipment and storage medium. The method includes: obtaining the original image taken by the original camera and the relay image taken by the relay camera under the condition that the zoom ratio of the control image enters the preset ratio range; The original time domain weight, and the relay time domain weight of each pixel point in the relay image; in the space domain, obtain the original space domain weight of each pixel point in the original image, and the relay space domain weight of each pixel point in the relay image; determine The pixel value of each target pixel in the target image; the target image is obtained according to the pixel value of each target pixel, and the target image is displayed. Adopting this method can make the displayed target image more natural.

Figure 202110263924

Description

图像展示方法、装置、电子设备和计算机可读存储介质Image display method, device, electronic device and computer-readable storage medium

技术领域technical field

本申请涉及计算机技术领域,特别是涉及一种图像展示方法、装置、电子设备和计算机可读存储介质。The present application relates to the field of computer technology, in particular to an image display method, device, electronic equipment and computer-readable storage medium.

背景技术Background technique

具有拍摄功能的设备为支持不同缩放倍率下的影像表现,往往会搭载多个摄像头。例如,在常见的三摄系统中,一般为搭载一颗超广角摄像头、一颗广角摄像头和一颗长焦摄像头。这三颗镜头分别工作在不同的焦段,具有不同的特性。超广角摄像头一般工作在近焦段,具有更大的视场,能捕获到更多的画面内容;广角摄像头焦距适中,一般具有更高的像素,能拍摄出清晰、高解析力的图像;而长焦摄像头工作在长焦段,主要用于拍摄远景。Devices with shooting functions are often equipped with multiple cameras in order to support image performance at different zoom ratios. For example, in a common three-camera system, it is generally equipped with an ultra-wide-angle camera, a wide-angle camera, and a telephoto camera. These three lenses work at different focal lengths and have different characteristics. Ultra-wide-angle cameras generally work in the near focal length, have a larger field of view, and can capture more picture content; wide-angle cameras have a moderate focal length, generally have higher pixels, and can capture clear, high-resolution images; The telephoto camera works in the telephoto segment and is mainly used for shooting distant scenes.

在多摄系统中,每个摄像头的光学特性、视场大小、排布位置、色彩表现等可能各不相同,每个摄像头拍摄出的图像也均不相同。在对屏幕中所展示的图像进行缩放的过程中,需要切换摄像头拍摄的图像进行展示。In a multi-camera system, the optical characteristics, field of view, arrangement, color performance, etc. of each camera may be different, and the images captured by each camera are also different. In the process of zooming the image displayed on the screen, it is necessary to switch the image captured by the camera for display.

而传统的图像展示方法,通常是直接将一个摄像头拍摄的图像切换至另一个摄像头拍摄的图像,存在图像展示不自然的问题。However, the traditional image display method usually directly switches the image captured by one camera to the image captured by another camera, which has the problem of unnatural image display.

发明内容Contents of the invention

本申请实施例提供了一种图像展示方法、装置、电子设备、计算机可读存储介质,可以使得所展示的图像更加自然。Embodiments of the present application provide an image display method, device, electronic device, and computer-readable storage medium, which can make displayed images more natural.

一种图像展示方法,包括:An image display method, comprising:

在控制图像的缩放倍率进入预设倍率区间的情况下,获取原始摄像头拍摄的原始图像,以及获取接力摄像头拍摄的接力图像;所述预设倍率区间包括有所述原始摄像头对应的缩放倍率以及所述接力摄像头对应的缩放倍率;Under the condition that the zoom ratio of the control image enters the preset ratio interval, the original image taken by the original camera is obtained, and the relay image taken by the relay camera is obtained; the preset ratio interval includes the corresponding zoom ratio of the original camera and the The zoom ratio corresponding to the above-mentioned relay camera;

在时间域上,获取所述原始图像中各像素点的原始时间域权重,以及所述接力图像中各像素点的接力时间域权重;In the time domain, the original time domain weight of each pixel in the original image and the relay time domain weight of each pixel in the relay image are acquired;

在空间域上,获取所述原始图像中各像素点的原始空间域权重,以及所述接力图像中各像素点的接力空间域权重;In the space domain, the original space domain weight of each pixel in the original image and the relay space domain weight of each pixel in the relay image are obtained;

基于所述原始图像中各像素点的像素值、所述原始时间域权重和所述原始空间域权重,以及所述接力图像中各像素点的像素值、所述接力时间域权重和所述接力空间域权重,确定目标图像中各目标像素点的像素值;Based on the pixel value of each pixel in the original image, the original time domain weight and the original space domain weight, and the pixel value of each pixel in the relay image, the relay time domain weight and the relay The spatial domain weight determines the pixel value of each target pixel in the target image;

根据各所述目标像素点的像素值得到所述目标图像,并展示所述目标图像。The target image is obtained according to the pixel value of each target pixel point, and the target image is displayed.

一种图像展示装置,包括:An image display device, comprising:

图像获取模块,用于在控制图像的缩放倍率进入预设倍率区间的情况下,获取原始摄像头拍摄的原始图像,以及获取接力摄像头拍摄的接力图像;所述预设倍率区间包括有所述原始摄像头对应的缩放倍率以及所述接力摄像头对应的缩放倍率;The image acquisition module is used to obtain the original image taken by the original camera and the relay image taken by the relay camera when the zoom magnification of the control image enters the preset magnification interval; the preset magnification interval includes the original camera The corresponding zoom ratio and the zoom ratio corresponding to the relay camera;

权重获取模块,用于在时间域上,获取所述原始图像中各像素点的原始时间域权重,以及所述接力图像中各像素点的接力时间域权重;A weight acquisition module, configured to acquire the original time domain weight of each pixel in the original image and the relay time domain weight of each pixel in the relay image in the time domain;

所述权重获取模块还用于在空间域上,获取所述原始图像中各像素点的原始空间域权重,以及所述接力图像中各像素点的接力空间域权重;The weight acquisition module is also used to acquire the original spatial domain weight of each pixel in the original image and the relay spatial domain weight of each pixel in the relay image in the spatial domain;

像素值确定模块,用于基于所述原始图像中各像素点的像素值、所述原始时间域权重和所述原始空间域权重,以及所述接力图像中各像素点的像素值、所述接力时间域权重和所述接力空间域权重,确定目标图像中各目标像素点的像素值;A pixel value determining module, configured to be based on the pixel value of each pixel in the original image, the original time domain weight and the original space domain weight, and the pixel value of each pixel in the relay image, the relay The time domain weight and the relay space domain weight determine the pixel value of each target pixel in the target image;

展示模块,用于根据各所述目标像素点的像素值得到所述目标图像,并展示所述目标图像。A display module, configured to obtain the target image according to the pixel value of each target pixel, and display the target image.

一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如上述的图像展示方法的步骤。An electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is made to execute the steps of the above-mentioned image display method.

一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述的方法的步骤。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 above-mentioned method are realized.

上述图像展示方法、装置、电子设备、计算机可读存储介质,在控制图像的缩放倍率进入预设倍率区间的情况下,获取原始摄像头拍摄的原始图像,以及获取接力摄像头拍摄的接力图像;分别从时间域和空间域上,获取原始图像中各像素点的权重,以及接力图像中各像素点的权重,那么,原始图像和目标图像可以从时间域和空间域上进行融合,得到原始图像和接力图像之间过渡的目标图像,并展示该目标图像,避免了在原始摄像头切换至接力摄像头的过程中直接将原始图像切换至接力图像,而导致的图像突变的问题,可以从原始摄像头拍摄的画面平滑过渡至接力摄像头拍摄的画面,使得所展示的图像更加自然。The above image display method, device, electronic equipment, and computer-readable storage medium obtain the original image captured by the original camera and the relay image captured by the relay camera when the zoom ratio of the control image enters the preset ratio range; In the time domain and the space domain, the weight of each pixel in the original image and the weight of each pixel in the relay image can be obtained, then the original image and the target image can be fused from the time domain and the space domain to obtain the original image and the relay image The target image for the transition between images, and display the target image, avoids the problem of image mutation caused by directly switching the original image to the relay image in the process of switching from the original camera to the relay camera, and can take pictures from the original camera Smooth transitions to images captured by the relay camera make the displayed images more natural.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为一个实施例中图像展示方法的流程图;Fig. 1 is a flowchart of an image display method in an embodiment;

图2为一个实施例中预设倍率区间的示意图;FIG. 2 is a schematic diagram of a preset magnification range in an embodiment;

图3为一个实施例中步骤在空间域上,获取原始图像中各像素点的原始空间域权重,以及接力图像中各像素点的接力空间域权重的流程图;Fig. 3 is a flow chart of obtaining the original spatial domain weight of each pixel point in the original image and the relay spatial domain weight of each pixel point in the relay image in the step of an embodiment in the spatial domain;

图4为一个实施例中对视场较小的图像进行区域划分的示意图;Fig. 4 is a schematic diagram of performing region division on an image with a smaller field of view in one embodiment;

图5为一个实施例中调节缩放倍率的示意图;Fig. 5 is a schematic diagram of adjusting zoom ratio in an embodiment;

图6为另一个实施例中图像展示方法的流程图;Fig. 6 is a flowchart of an image display method in another embodiment;

图7为一个实施例中图像展示装置的结构框图;Fig. 7 is a structural block diagram of an image display device in an embodiment;

图8为一个实施例中电子设备的内部结构示意图。Fig. 8 is a schematic diagram of the internal structure of an electronic device in one embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.

在一个实施例中,如图1所示,提供了一种图像展示方法,本实施例以该方法应用于电子设备进行举例说明,电子设备可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。本实施例中,该方法包括以下步骤:In one embodiment, as shown in FIG. 1 , an image display method is provided. This embodiment uses the application of this method to electronic equipment for illustration. Electronic equipment can be, but not limited to, various personal computers, notebook computers, smart Mobile phones, tablets and portable wearables. In this embodiment, the method includes the following steps:

步骤102,在控制图像的缩放倍率进入预设倍率区间的情况下,获取原始摄像头拍摄的原始图像,以及获取接力摄像头拍摄的接力图像;预设倍率区间包括有原始摄像头对应的缩放倍率以及接力摄像头对应的缩放倍率。Step 102, under the condition that the zoom ratio of the control image enters the preset ratio interval, the original image taken by the original camera and the relay image taken by the relay camera are acquired; the preset ratio interval includes the corresponding zoom ratio of the original camera and the relay camera corresponding magnification.

缩放倍率(zoom)指的是展示界面中图像缩放的比率。缩放倍率增大,表示对图像进行放大,则展示界面中图像的视场(FOV)变小,摄像头的焦距增大;缩放倍率减小,表示对图像进行缩小,则展示界面中图像的视场变大,摄像头的焦距减小。例如,对展示界面中的图像内容XX进行放大,即增大图像的缩放倍率,则展示界面中图像的视场变小,图像内容XX在展示界面中展示的尺度也随之变大。展示界面是电子设备的屏幕上用于展示的界面。The zoom ratio (zoom) refers to the zoom ratio of the image in the display interface. When the zoom ratio increases, it means that the image is enlarged, and the field of view (FOV) of the image in the display interface becomes smaller, and the focal length of the camera increases; when the zoom ratio decreases, it means that the image is zoomed out, and the field of view of the image in the display interface is displayed. Larger, the focal length of the camera decreases. For example, if the image content XX in the display interface is enlarged, that is, the zoom ratio of the image is increased, the field of view of the image in the display interface becomes smaller, and the scale of the image content XX displayed in the display interface also becomes larger. The display interface is an interface for display on the screen of the electronic device.

在电子设备中包括有至少两个摄像头,至少两个摄像头包括原始摄像头和接力摄像头。原始摄像头和接力摄像头均设置在电子设备的同一侧,拍摄同一场景。原始摄像头是缩放倍率进入预设倍率区间之前,拍摄的图像用于展示界面中进行展示的摄像头。接力摄像头是缩放倍率通过预设倍率区间之后,拍摄的图像用于展示界面中进行展示的摄像头。也就是说,在缩放倍率进入预设倍率区间之前,展示界面展示原始摄像头拍摄的图像,在缩放倍率通过预设倍率区间之后,展示界面展示接力摄像头拍摄的图像。而缩放倍率处于预设倍率区间内所展示的目标图像,即是原始摄像头拍摄的图像渐变至接力摄像头拍摄的图像之间的过渡图像。The electronic device includes at least two cameras, and the at least two cameras include an original camera and a relay camera. Both the original camera and the relay camera are set up on the same side of the electronic device and capture the same scene. The original camera is the camera that captures images before the zoom ratio enters the preset ratio range and is used for display in the display interface. The relay camera is a camera that takes images for display in the display interface after the zoom ratio passes the preset ratio range. That is to say, before the zoom ratio enters the preset ratio range, the display interface displays images captured by the original camera, and after the zoom ratio passes the preset ratio range, the display interface displays images captured by the relay camera. The target image displayed with the magnification within the preset magnification range is the transition image between the image captured by the original camera and the image captured by the relay camera.

原始图像是缩放倍率进入预设倍率区间的情况下,原始摄像头拍摄的图像。接力图像是缩放倍率进入预设倍率区间的情况下,接力摄像头拍摄的图像。原始图像可以是原始摄像头变焦之前拍摄的图像,也可以原始摄像头变焦之后拍摄的图像。同样的,接力图像可以是接力摄像头变焦之前拍摄的图像,也可以接力摄像头变焦之后拍摄的图像。The original image is the image captured by the original camera when the zoom ratio enters the preset ratio range. The relay image is the image captured by the relay camera when the zoom ratio enters the preset ratio range. The original image may be an image taken before the original camera is zoomed, or an image taken after the original camera is zoomed. Similarly, the relay image may be an image captured before the relay camera zooms, or an image captured after the relay camera zooms.

在原始摄像头的倍率范围或者接力摄像头的倍率范围不存在图像的缩放倍率的情况下,可以对原始摄像头拍摄的图像或者接力摄像头拍摄的图像进行数码变焦,得到缩放倍率对应的原始图像或者接力图像。In the case that the magnification range of the original camera or the magnification range of the relay camera does not have the zoom magnification of the image, the image captured by the original camera or the image captured by the relay camera can be digitally zoomed to obtain the original image or relay image corresponding to the zoom magnification.

预设倍率区间是预先设置的用于生成目标图像所处的倍率区间。预设倍率区间可以根据需要进行设置,并且预设倍率区间包括有原始摄像头对应的缩放倍率以及接力摄像头对应的缩放倍率。The preset magnification range is a preset magnification range for generating the target image. The preset magnification interval can be set as required, and the preset magnification interval includes the zoom ratio corresponding to the original camera and the zoom ratio corresponding to the relay camera.

可以理解的是,每个摄像头都有对应的缩放倍率。例如,超广角摄像头对应的缩放倍率是0.6X-1X,广角摄像头对应的缩放倍率是1X-5X,长焦摄像头对应的缩放倍率是5X-60X,则超广角摄像头和广角摄像头之间的预设倍率区间可以是0.8X-1.2X,广角摄像头和长焦摄像头之间的预设倍率区间可以是4.8X-5.2X。又如,摄像头A对应的缩放倍率是0.6X-2X,摄像头B对应的缩放倍率是1X-5X,则预设倍率区间可以是1X-2X。其中,0.6X表示实际拍摄对象的尺寸与图像中的尺寸之比是1:0.6,1X表示实际拍摄对象的尺寸与图像中的尺寸之比是1:1。Understandably, each camera has a corresponding zoom ratio. For example, the zoom ratio corresponding to the super wide-angle camera is 0.6X-1X, the zoom ratio corresponding to the wide-angle camera is 1X-5X, and the zoom ratio corresponding to the telephoto camera is 5X-60X, then the preset between the super wide-angle camera and the wide-angle camera The magnification range can be 0.8X-1.2X, and the preset magnification range between the wide-angle camera and the telephoto camera can be 4.8X-5.2X. For another example, if the zoom ratio corresponding to camera A is 0.6X-2X, and the zoom ratio corresponding to camera B is 1X-5X, then the preset ratio range may be 1X-2X. Among them, 0.6X means that the ratio of the size of the actual subject to the size in the image is 1:0.6, and 1X means that the ratio of the size of the actual subject to the size in the image is 1:1.

在一种实施方式中,电子设备可以根据原始摄像头的原始倍率范围和接力摄像头的接力倍率范围,确定原始倍率范围和接力倍率范围的重合倍率范围,基于该重合倍率范围确定预设倍率区间。In one embodiment, the electronic device may determine the overlapping magnification range of the original magnification range and the relay magnification range according to the original magnification range of the original camera and the relay magnification range of the relay camera, and determine the preset magnification interval based on the overlapping magnification range.

原始倍率范围是原始摄像头所处的焦段对应的倍率范围。接力倍率范围是接力摄像头所处的焦段对应的倍率范围。焦段指的是摄像头焦距的范围。The original magnification range is the magnification range corresponding to the focal length of the original camera. The relay magnification range is the magnification range corresponding to the focal length of the relay camera. The focal length refers to the range of the focal length of the camera.

可选地,电子设备可以直接将该重合倍率范围作为预设倍率区间,也可以确定包含该重合倍率范围的预设倍率区间,还可以确定重合倍率范围的一部分作为预设倍率区间,不限于此。Optionally, the electronic device may directly use the overlapping magnification range as the preset magnification interval, or may determine a preset magnification interval including the overlapping magnification range, or may determine a part of the overlapping magnification range as the preset magnification interval, and is not limited thereto. .

例如,原始摄像头的缩放倍率是0.6X-2X,接力摄像头对应的缩放倍率是1X-5X。那么,原始摄像头和接力摄像头之间的重合倍率范围是1X-2X,则预设倍率区间可以是1X-2X,也可以是1.2X-1.8X,还可以是0.8X-2.2X。For example, the zoom ratio of the original camera is 0.6X-2X, and the corresponding zoom ratio of the relay camera is 1X-5X. Then, the overlapping magnification range between the original camera and the relay camera is 1X-2X, and the preset magnification range can be 1X-2X, 1.2X-1.8X, or 0.8X-2.2X.

在另一种实施方式中,电子设备对特定倍率区间设置特定数量的采样点,获取采样点与倍率之间的对应关系,每相邻两个采样点之间有相同的缩放关系;获取指定倍率,以及该指定倍率对应的指定数量的采样点;基于指定倍率对应的指定数量的采样点,从采样点与倍率之间的对应关系中确定预设倍率区间的上限值和下限值,生成预设倍率区间。In another embodiment, the electronic device sets a specific number of sampling points for a specific magnification interval, obtains the corresponding relationship between the sampling points and the magnification, and has the same scaling relationship between every two adjacent sampling points; obtains the specified magnification , and the specified number of sampling points corresponding to the specified magnification; based on the specified number of sampling points corresponding to the specified magnification, determine the upper limit and lower limit of the preset magnification interval from the correspondence between the sampling points and the magnification, and generate Preset magnification range.

通过以下公式可以保证每相邻两个采样点之间有相同的缩放关系:The following formula can ensure the same scaling relationship between every two adjacent sampling points:

zoommax=zoommin*(x)N 公式(1)zoom max = zoom min *(x) N formula (1)

其中,zoommax是特定倍率区间的上限值,zoommin特定倍率区间的下限值,x是相邻采样点之间缩放比例,N特定倍率区间设置的特定数量。Among them, zoom max is the upper limit value of a specific magnification interval, zoom min is the lower limit value of a specific magnification interval, x is the zoom ratio between adjacent sampling points, and N is a specific number set for a specific magnification interval.

采样点与倍率之间的对应关系如下:The corresponding relationship between sampling points and magnification is as follows:

Figure BDA0002971257340000071
Figure BDA0002971257340000071

其中,n是zoom对应的第n个采样点,zoommax是特定倍率区间的上限值,zoommin特定倍率区间的下限值,x是相邻采样点之间缩放比例,N特定倍率区间设置的特定数量。从这一公式可知,对于给定的zoom,均可以映射至对应的采样点。Among them, n is the nth sampling point corresponding to zoom, zoom max is the upper limit value of a specific magnification range, zoom min is the lower limit value of a specific magnification range, x is the scaling ratio between adjacent sampling points, and N is set for a specific magnification range a specific amount. From this formula, it can be known that for a given zoom, it can be mapped to the corresponding sampling point.

例如,指定倍率是1X,指定倍率对应的指定数量的采样点是M个采样点,则预设倍率区间的上限值是大于指定倍率的第M个采样点所处的倍率,预设倍率区间的下限值是小于指定倍率的第M个采样点所处的倍率。For example, the specified magnification is 1X, and the specified number of sampling points corresponding to the specified magnification is M sampling points, then the upper limit of the preset magnification range is the magnification of the Mth sampling point that is greater than the specified magnification, and the preset magnification range The lower limit of is the magnification at which the Mth sampling point is smaller than the specified magnification.

预设倍率区间包括原始摄像头对应的缩放倍率以及接力摄像头对应的缩放倍率,则在缩放倍率进入预设倍率区间的情况下,可以获取到原始摄像头的原始图像,以及接力摄像头的接力图像。The preset magnification range includes the zoom magnification corresponding to the original camera and the zoom magnification corresponding to the relay camera, and when the zoom magnification enters the preset magnification range, the original image of the original camera and the relay image of the relay camera can be obtained.

图2为一个实施例中预设倍率区间的示意图。超广角摄像头对应的缩放倍率是0.6X-1X,广角摄像头对应的缩放倍率是1X-5X,长焦摄像头对应的缩放倍率是5X-60X,则超广角摄像头和广角摄像头之间的预设倍率区间是0.8X-1.2X,广角摄像头和长焦摄像头之间的预设倍率区间是4.8X-5.2X。Fig. 2 is a schematic diagram of a preset magnification interval in an embodiment. The zoom ratio corresponding to the super wide-angle camera is 0.6X-1X, the zoom ratio corresponding to the wide-angle camera is 1X-5X, and the zoom ratio corresponding to the telephoto camera is 5X-60X, then the preset ratio range between the super wide-angle camera and the wide-angle camera It is 0.8X-1.2X, and the preset magnification range between the wide-angle camera and the telephoto camera is 4.8X-5.2X.

步骤104,在时间域上,获取原始图像中各像素点的原始时间域权重,以及接力图像中各像素点的接力时间域权重。Step 104, in the time domain, the original time domain weight of each pixel point in the original image and the relay time domain weight of each pixel point in the relay image are obtained.

原始时间域权重是原始图像中像素点在时间维度上的权重因子。接力时间域权重是接力图像中像素点在时间维度上的权重因子。The original time domain weight is the weight factor of the pixels in the original image in the time dimension. The relay time domain weight is the weight factor of the pixels in the relay image in the time dimension.

在一种实施方式中,电子设备获取原始图像中各像素点的原始时间域权重,基于原始时间域权重确定接力图像中各像素点的接力时间域权重;其中,原始时间域权重和接力时间域权重的和为1。In one embodiment, the electronic device obtains the original time domain weight of each pixel in the original image, and determines the relay time domain weight of each pixel in the relay image based on the original time domain weight; wherein, the original time domain weight and the relay time domain The sum of the weights is 1.

例如,原始图像中各像素点的原始时间域权重为A,则接力图像中像素点的接力时间域权重为(1-A)。For example, the original time-domain weight of each pixel in the original image is A, and the relay time-domain weight of the pixel in the relay image is (1-A).

电子设备获取原始图像中各像素点的原始时间域权重,包括:获取图像的当前缩放倍率,确定当前缩放倍率与预设倍率区间的下限值之间的差值,将该差值除以预设倍率区间的范围值,得到原始图像中各像素点的原始时间域权重。The electronic device obtains the original time-domain weight of each pixel in the original image, including: obtaining the current zoom ratio of the image, determining the difference between the current zoom ratio and the lower limit value of the preset ratio range, and dividing the difference by the preset ratio. Set the range value of the magnification interval to obtain the original time domain weight of each pixel in the original image.

预设倍率区间的下限值是预设倍率区间中的最小值,预设倍率区间的上限值是预设倍率区间中的最大值。例如,预设倍率区间是(zoom_min,zoom_max),则预设倍率区间的下限值是zoom_min,预设倍率区间的上限值是zoom_max。又如,预设倍率区间是1X-5X,则预设倍率区间的下限值是1X,预设倍率区间的上限值是5X。The lower limit value of the preset magnification range is the minimum value in the preset magnification range, and the upper limit value of the preset magnification range is the maximum value in the preset magnification range. For example, if the preset magnification range is (zoom_min, zoom_max), the lower limit of the preset magnification range is zoom_min, and the upper limit of the preset magnification range is zoom_max. For another example, if the preset magnification range is 1X-5X, then the lower limit of the preset magnification range is 1X, and the upper limit of the preset magnification range is 5X.

原始图像中各像素点的原始时间域权重可以通过以下公式计算得到:The original time domain weight of each pixel in the original image can be calculated by the following formula:

Figure BDA0002971257340000081
Figure BDA0002971257340000081

其中,α是原始图像中各像素点的原始时间域权重,zoom是当前缩放倍率,zoommin是预设倍率区间的下限值,zoommax是预设倍率区间的上限值。则接力图像中各像素点的原始时间域权重为(1-α)。Among them, α is the original time-domain weight of each pixel in the original image, zoom is the current zoom ratio, zoom min is the lower limit value of the preset ratio range, and zoom max is the upper limit value of the preset ratio range. Then the original time domain weight of each pixel in the relay image is (1-α).

在另一种实施方式中,电子设备获取接力图像中各像素点的接力时间域权重,基于接力时间域权重确定原始图像中各像素点的原始时间域权重;其中,原始时间域权重和接力时间域权重的和为1。In another embodiment, the electronic device obtains the relay time domain weight of each pixel in the relay image, and determines the original time domain weight of each pixel in the original image based on the relay time domain weight; wherein, the original time domain weight and the relay time The domain weights sum to 1.

在另一种实施方式中,电子设备获取输入的原始图像中各像素点的原始时间域权重,以及接力图像中各像素点的接力时间域权重。In another embodiment, the electronic device acquires the original time-domain weight of each pixel in the input original image, and the relay time-domain weight of each pixel in the relay image.

需要说明的是,在时间域上,需要对时间系数或者缩放倍率系数可导,保证缩放倍率不会随时间发生突变,也不会随缩放发生突变。例如,原始时间域权重和接力时间域权重与时间相关,可以认为原始时间域权重α和接力时间域权重(1-α)均是时间系数,则原始时间域权重α和接力时间域权重(1-α)均可导。It should be noted that in the time domain, the time coefficient or the zoom factor coefficient needs to be derived to ensure that the zoom factor will not change suddenly with time or zoom. For example, the original time-domain weight and the relay time-domain weight are related to time. It can be considered that the original time-domain weight α and the relay time-domain weight (1-α) are both time coefficients, then the original time-domain weight α and the relay time-domain weight (1 -α) can be derived.

步骤106,在空间域上,获取原始图像中各像素点的原始空间域权重,以及接力图像中各像素点的接力空间域权重。Step 106, in the space domain, the original space domain weight of each pixel point in the original image and the relay space domain weight of each pixel point in the relay image are obtained.

原始空间域权重是原始图像中像素点在空间维度上的权重因子。接力空间权重是接力图像中像素点在空间维度上的权重因子。The original spatial domain weight is the weight factor of the pixel in the original image in the spatial dimension. The relay spatial weight is the weight factor of the pixels in the relay image in the spatial dimension.

在一种实施方式中,电子设备获取输入的原始图像中各像素点的原始空间域权重,以及接力图像中各像素点的接力空间域权重。In one embodiment, the electronic device acquires the original spatial domain weight of each pixel in the input original image, and the relay spatial domain weight of each pixel in the relay image.

可以理解的是,原始图像是由原始摄像头拍摄的,接力图像是由接力摄像头拍摄的,不同的摄像头拍摄的视场可能存在不同。在原始图像和接力图像的视场不一致的情况下,仅获取原始图像和接力图像在时间域上的权重因子,那么在后续基于权重因子将原始图像和接力图像进行融合得到的图像中,容易出现非常明显的矩形轮廓,使得在缩放倍率进入预设倍率区间过程中所展示的图像不自然。It can be understood that the original image is taken by the original camera, and the relay image is taken by the relay camera, and different cameras may have different fields of view. When the fields of view of the original image and the relay image are inconsistent, only the weight factors of the original image and the relay image in the time domain are obtained, then in the subsequent image obtained by fusing the original image and the relay image based on the weight factor, it is easy to appear The very obvious rectangular outline makes the displayed image unnatural when the zoom ratio enters the preset ratio range.

因此,本实施例不仅获取原始图像和接力图像在时间域上的权重,还获取原始图像和接力图像在空间域上的权重,则后续将视场不一致的图像进行融合得到目标图像,所展示的目标图像可以从空间维度上消除矩形轮廓,使得在缩放倍率进入预设倍率区间过程中所展示的目标图像更加自然。Therefore, this embodiment not only obtains the weights of the original image and the relay image in the time domain, but also obtains the weights of the original image and the relay image in the space domain, and subsequently fuses the images with inconsistent fields of view to obtain the target image, as shown The target image can eliminate the rectangular outline from the spatial dimension, making the displayed target image more natural when the magnification enters the preset magnification range.

步骤108,基于原始图像中各像素点的像素值、原始时间域权重和原始空间域权重,以及接力图像中各像素点的像素值、接力时间域权重和接力空间域权重,确定目标图像中各目标像素点的像素值。Step 108, based on the pixel value, original time domain weight and original space domain weight of each pixel point in the original image, and the pixel value, relay time domain weight and relay space domain weight of each pixel point in the relay image, determine each pixel in the target image The pixel value of the target pixel.

目标图像是原始图像和接力图像进行融合得到的图像。目标像素点是目标图像中的像素点。The target image is the image obtained by fusing the original image and the relay image. The target pixel is the pixel in the target image.

目标图像中各像素点的像素值可以根据以下公式计算得到:The pixel value of each pixel in the target image can be calculated according to the following formula:

I(x,y)=(αts(x,y)-αtαs(x,y))IA(x,y)+(1-αts(x,y)+αtαs(x,y))IB(x,y) 公式(4)I(x,y)=(α ts (x,y)-α t α s (x,y))I A (x,y)+(1-α ts (x,y) +α t α s (x,y))I B (x,y) Formula (4)

其中,I(x,y)是目标图像中坐标为(x,y)的像素点的像素值,IA(x,y)是原始图像中坐标为(x,y)的像素点的像素值,IB(x,y)是接力图像中坐标为(x,y)的像素点的像素值,αt是原始图像中各像素点的原始时间域权重,(1-αt)是接力图像中各像素点的接力时间域权重,原始图像中坐标为(x,y)的像素点的原始空间域权重为αs(x,y),接力图像中坐标为(x,y)的像素点的接力空间域权重为αs(x,y)。Among them, I(x, y) is the pixel value of the pixel point whose coordinates are (x, y) in the target image, and I A (x, y) is the pixel value of the pixel point whose coordinates are (x, y) in the original image , I B (x, y) is the pixel value of the pixel with coordinates (x, y) in the relay image, α t is the original time domain weight of each pixel in the original image, (1-α t ) is the relay image The relay time-domain weight of each pixel in the original image, the original space-domain weight of the pixel with coordinates (x, y) in the original image is α s (x, y), and the pixel with coordinates (x, y) in the relay image The relay space domain weight of is α s (x,y).

需要说明的是,当原始图像或者接力图像的尺寸不一致的情况下,原始图像和接力图像一部分区域重叠,另一部分区域不重叠,则将尺寸较大的图像中不重叠的区域作为尺寸较小的图像中不重叠的区域,再采用公式(4)计算得到目标图像中各像素点的像素值。It should be noted that when the size of the original image or the relay image is inconsistent, and some areas of the original image and the relay image overlap, and the other part does not overlap, then the non-overlapping area in the larger image will be taken as the smaller size. For non-overlapping areas in the image, the pixel value of each pixel in the target image is calculated by formula (4).

电子设备可以采用透明度(alpha)融合过程将原始图像和接力图像进行融合得到目标图像的。可以理解的是,在缩放倍率处于预设倍率区间,展示界面所展示的图像从原始摄像头拍摄的图像渐变至接力摄像头拍摄的图像,即原始摄像头拍摄的图像的透明度由不透明变成透明,接力摄像头拍摄的图像的透明度由透明变成不透明。The electronic device may use a transparency (alpha) fusion process to fuse the original image and the relay image to obtain the target image. It can be understood that when the magnification is in the preset magnification range, the image displayed on the display interface gradually changes from the image taken by the original camera to the image taken by the relay camera, that is, the transparency of the image taken by the original camera changes from opaque to transparent, and the image taken by the relay camera changes from opaque to transparent. The transparency of the captured image changes from transparent to opaque.

需要说明的是,电子设备在将原始图像和接力图像进行融合得到目标图像的过程中,原始图像是连续的,即相邻的原始图像中同一位置的像素点的变化是连续的,同样地,接力图像也是连续的,即相邻的接力图像中同一位置的像素点的变化是连续的,这样可以保证融合得到的多帧目标图像,在展示时具有连贯性。It should be noted that, in the process of the electronic device fusing the original image and the relay image to obtain the target image, the original image is continuous, that is, the changes of the pixels at the same position in adjacent original images are continuous. Similarly, The relay images are also continuous, that is, the changes of the pixels at the same position in adjacent relay images are continuous, which can ensure that the multi-frame target images obtained by fusion are coherent in display.

步骤110,根据各目标像素点的像素值得到目标图像,并展示目标图像。Step 110, obtain the target image according to the pixel value of each target pixel point, and display the target image.

在一种实施方式中,电子设备可以将各目标像素点的像素值直接生成目标图像。In an implementation manner, the electronic device may directly generate the target image from the pixel values of each target pixel.

在另一种实施方式中,电子设备可以对各目标像素点的像素值进行滤波处理,滤除各目标像素点的像素值中的噪声,将滤波处理后的各像素点的像素值生成目标图像。In another embodiment, the electronic device may filter the pixel values of each target pixel, filter out the noise in the pixel values of each target pixel, and generate the target image from the filtered pixel values .

电子设备实时获取原始摄像头拍摄的原始图像,以及实时获取接力摄像头拍摄的接力图像,在同一时刻拍摄得到的原始图像和接力图像可以融合得到目标图像,则在缩放倍率处于预设倍率区间内,可以融合得到多帧目标图像,并展示多帧目标图像。可以理解的是,在缩放倍率处于预设倍率区间内,展示界面所展示的多帧目标图像构成了过渡动画,可以更加自然地展示从原始摄像头拍摄的画面渐变至接力摄像头拍摄的画面,即将展示界面展示的图像从原始摄像头拍摄的图像切换至接力摄像头拍摄的图像。The electronic device obtains the original image taken by the original camera in real time, and the relay image taken by the relay camera in real time. The original image and the relay image taken at the same time can be fused to obtain the target image, and the zoom ratio is within the preset ratio range. The multi-frame target image is fused, and the multi-frame target image is displayed. It is understandable that when the magnification is within the preset magnification range, the multi-frame target images displayed on the display interface constitute a transition animation, which can more naturally show the gradual transition from the picture taken by the original camera to the picture taken by the relay camera, which will be shown soon The image displayed on the interface switches from the image captured by the original camera to the image captured by the relay camera.

在展示目标图像的过程中,还可以结合自动白平衡(Automatic white balance,AWB)技术进行色彩管理,使得所展示的目标图像的色彩更加自然,更好地实现融合效果。In the process of displaying the target image, an automatic white balance (AWB) technology may also be combined for color management, so that the color of the displayed target image is more natural and a better fusion effect is achieved.

上述图像展示方法,在控制图像的缩放倍率进入预设倍率区间的情况下,获取原始摄像头拍摄的原始图像,以及获取接力摄像头拍摄的接力图像;分别从时间域和空间域上,获取原始图像中各像素点的权重,以及接力图像中各像素点的权重,那么,原始图像和目标图像可以从时间域和空间域上进行融合,得到原始图像和接力图像之间过渡的目标图像,并展示该目标图像,避免了在原始摄像头切换至接力摄像头的过程中直接将原始图像切换至接力图像,而导致的图像(内容、色彩)突变的问题,可以从原始摄像头拍摄的画面平滑过渡至接力摄像头拍摄的画面,使得所展示的图像更加自然。The above image display method obtains the original image taken by the original camera and the relay image taken by the relay camera under the condition that the zoom ratio of the image is controlled to enter the preset ratio range; The weight of each pixel, and the weight of each pixel in the relay image, then the original image and the target image can be fused from the time domain and the space domain to obtain the transition target image between the original image and the relay image, and display the The target image avoids the problem of sudden changes in the image (content, color) caused by directly switching the original image to the relay image during the process of switching from the original camera to the relay camera, and can smoothly transition from the image captured by the original camera to the relay camera , making the displayed images more natural.

在一个实施例中,在原始图像的尺寸和接力图像的尺寸不一致时,可以通过调整(resize)图像的尺寸,或者对尺寸较小的图像进行插值处理,得到尺寸一致的原始图像和接力图像,再执行基于原始图像中各像素点的像素值、原始时间域权重和原始空间域权重,以及接力图像中各像素点的像素值、接力时间域权重和接力空间域权重,确定目标图像中各目标像素点的像素值的步骤。In one embodiment, when the size of the original image is inconsistent with the size of the relay image, the original image and the relay image with the same size can be obtained by adjusting (resize) the size of the image, or performing interpolation processing on an image with a smaller size, Then, based on the pixel value of each pixel in the original image, the original time domain weight and the original space domain weight, and the pixel value of each pixel in the relay image, the relay time domain weight and the relay space domain weight, determine each target in the target image The step of the pixel value of the pixel point.

在一个实施例中,如图3所示,在空间域上,获取原始图像中各像素点的原始空间域权重,以及接力图像中各像素点的接力空间域权重,包括:In one embodiment, as shown in FIG. 3 , in the spatial domain, the original spatial domain weights of each pixel in the original image and the relay spatial domain weights of each pixel in the relay image are acquired, including:

步骤302,将原始图像和接力图像进行内容对齐,确定视场较小的图像和视场较大的图像。Step 302, content alignment is performed on the original image and the relay image, and an image with a smaller field of view and an image with a larger field of view are determined.

视场指的是摄像头观测的范围。可以理解的是,原始图像是由原始摄像头拍摄得到,接力图像是由接力摄像头拍摄得到,而原始摄像头和接力摄像头的观测范围通常是不同的,因此原始图像的视场和接力图像的视场也通常不同。The field of view refers to the range observed by the camera. It can be understood that the original image is taken by the original camera, and the relay image is taken by the relay camera, and the observation ranges of the original camera and the relay camera are usually different, so the field of view of the original image and the field of view of the relay image are also different. Usually different.

具体地,电子设备可以采用平移、旋转、变形、中心定位、内容匹配等方式将原始图像和接力图像进行内容对齐,在原始图像和接力图像内容对齐的情况下,将图像内容全部被覆盖的图像作为视场较小的图像,将另外的图像作为视场较大的图像。Specifically, the electronic device can align the content of the original image and the relay image by means of translation, rotation, deformation, center positioning, and content matching. As an image with a smaller field of view, another image is used as an image with a larger field of view.

原始图像可以是视场较小的图像,也可以是视场较大的图像。同样的,接力图像可以是视场较小的图像,也可以是视场较大的图像。The original image can be an image with a small field of view or an image with a large field of view. Similarly, the relay image may be an image with a smaller field of view, or an image with a larger field of view.

在原始图像是视场较小的图像,接力图像是视场较大的图像的情况下,展示界面所展示的画面由视场较小的图像渐变至视场较大的图像,即对所展示的画面进行缩小操作。在原始图像是视场较大的图像,接力图像是视场较小的图像的情况下,展示界面所展示的画面由视场较大的图像渐变至视场较小的图像,即对所展示的画面进行放大操作。In the case that the original image is an image with a smaller field of view and the relay image is an image with a larger field of view, the image displayed on the display interface will gradually change from the image with a smaller field of view to the image with a larger field of view, that is, the displayed zoom out on the screen. In the case that the original image is an image with a larger field of view and the relay image is an image with a smaller field of view, the image displayed on the display interface gradually changes from the image with a larger field of view to the image with a smaller field of view, that is, the displayed to zoom in on the screen.

步骤304,对视场较小的图像进行区域划分。Step 304, perform region division on the image with a smaller field of view.

可以理解的是,视场较大的图像覆盖视场较小的图像,而视场较大的图像中存在一部分额外区域,是视场较小的图像中不存在。因此,在原始摄像头拍摄的画面渐变至接力摄像头拍摄的画面的过程中,即缩放倍率进入预设倍率区间的过程中,视场较小的图像在空间维度上可以完全渐变至视场较大的图像中所覆盖的区域,故对视场较小的图像进行区域划分,再根据区域划分后的视场较小的图像确定图像中各像素点的空间域权重。It can be understood that the image with a larger field of view covers the image with a smaller field of view, and there is a part of extra area in the image with a larger field of view, which does not exist in the image with a smaller field of view. Therefore, in the process of changing the picture taken by the original camera to the picture taken by the relay camera, that is, when the zoom ratio enters the preset magnification range, the image with a smaller field of view can be completely faded to one with a larger field of view in the spatial dimension. Therefore, the image with a smaller field of view is divided into regions, and then the spatial domain weight of each pixel in the image is determined according to the image with a smaller field of view after region division.

可选地,电子设备可以将视场较小的划分为九宫格区域,也可以划分为十六宫格区域,还可以划分为10个区域。具体的区域划分方式可以根据需要进行设置,在此不做限定。Optionally, the electronic device may divide the field of view with a smaller field of view into nine grid areas, sixteen grid areas, or 10 areas. The specific area division method can be set as required, and is not limited here.

步骤306,在空间域上,获取视场较小的图像中各区域的像素点的空间域权重,以及视场较大的图像中各像素点的空间域权重。Step 306 , in the spatial domain, the spatial domain weights of the pixels in each region in the image with a smaller field of view and the spatial domain weights of each pixel in the image with a larger field of view are obtained.

视场较小的图像是原始图像或者接力图像,相应地,视场较大的图像是接力图像或者原始图像,则在空间域上,获取视场较小的图像中各区域的像素点的空间域权重,以及视场较大的图像中各像素点的空间域权重,也就获取到原始图像中各像素点的原始空间域权重,以及接力图像中各像素点的接力空间域权重。The image with a smaller field of view is the original image or the relay image. Correspondingly, the image with a larger field of view is the relay image or the original image. In the spatial domain, the space of the pixels in each area of the image with the smaller field of view is obtained. domain weight, and the spatial domain weight of each pixel in the image with a larger field of view, that is, the original spatial domain weight of each pixel in the original image, and the relay spatial domain weight of each pixel in the relay image.

在本实施例中,将原始图像和接力图像进行内容对齐,确定视场较小的图像,对视场较小的图像进行区域划分,可以准确地确定原始图像中各像素点的原始空间域权重,以及接力图像中各像素点的接力空间域权重。In this embodiment, the content of the original image and the relay image is aligned, the image with a smaller field of view is determined, and the image with a smaller field of view is divided into regions, so that the original spatial domain weight of each pixel in the original image can be accurately determined , and the relay spatial domain weights of each pixel in the relay image.

在一个实施例中,在空间域上,获取视场较小的图像中各区域的像素点的空间域权重,以及视场较大的图像中各像素点的空间域权重,包括:确定视场较小的图像中各区域的渐变方向;基于各区域的渐变方向,确定视场较小的图像中各区域的像素点的空间域权重;获取视场较大的图像中对应的各区域中各像素点的空间域权重,以及除对应的各区域之外的区域中各像素点的空间域权重。In one embodiment, in the spatial domain, obtaining the spatial domain weights of pixels in each region in an image with a smaller field of view and the spatial domain weights of each pixel in an image with a larger field of view includes: determining the field of view The gradient direction of each area in the smaller image; based on the gradient direction of each area, determine the spatial domain weight of the pixels in each area in the image with a smaller field of view; The spatial domain weight of the pixel point, and the spatial domain weight of each pixel point in the regions other than the corresponding regions.

渐变方向是原始图像中的区域渐变至接力图像中对应区域的方向。例如,原始图像中左上角区域的渐变方向可以包括横向方向和纵向方向,即该左上角区域从横向方向和纵向方向渐变至接力图像中对应区域。又如,原始图像中左上角区域和右上角区域之间的边缘中间区域的渐变方向可以包括纵向方向,即该边缘中间区域从纵向方向渐变至接力图像中对应区域。The gradient direction is the direction in which a region in the original image fades to a corresponding region in the relay image. For example, the gradient direction of the upper left corner area in the original image may include a horizontal direction and a vertical direction, that is, the upper left corner area gradually changes from the horizontal direction and the vertical direction to the corresponding area in the relay image. As another example, the gradient direction of the edge middle area between the upper left corner area and the upper right corner area in the original image may include the longitudinal direction, that is, the edge middle area gradually changes from the longitudinal direction to the corresponding area in the relay image.

视场较大的图像中包括有与视场较小的图像重叠的各区域,还包括有除重叠的各区域之外的区域,即除对应的各区域之外的区域。The image with a larger field of view includes regions overlapping with the image with a smaller field of view, and also includes regions other than the overlapping regions, that is, regions other than the corresponding regions.

对应于视场较小的图像中各区域,视场较大的图像中对应的各区域中各像素点的空间域权重也可以基于相同的渐变方向,确定空间域权重。除对应的各区域之外的区域中各像素点的空间域权重,可以设置为1。Corresponding to each area in the image with a smaller field of view, the spatial domain weight of each pixel in each area corresponding to the image with a larger field of view may also be determined based on the same gradient direction. The spatial domain weight of each pixel in the area other than the corresponding area may be set to 1.

在本实施例中,确定视场较小的图像中各区域的渐变方向;基于各区域的渐变方向,可以准确地确定视场较小的图像中各区域的像素点的空间域权重,以及获取视场较大的图像中对应的各区域中各像素点的空间域权重,以及除对应的各区域之外的区域中各像素点的空间域权重。In this embodiment, the gradient direction of each region in the image with a smaller field of view is determined; based on the gradient direction of each region, the spatial domain weights of pixels in each region in the image with a smaller field of view can be accurately determined, and the obtained The spatial domain weights of each pixel point in each corresponding region in the image with a larger field of view, and the spatial domain weights of each pixel point in regions other than the corresponding regions.

在一个实施例中,确定视场较小的图像中各区域的渐变方向,包括:在视场较小的图像中,处于四个边角的边角区域的渐变方向均包括有横向方向和纵向方向,处于相邻两个边角区域之间的边缘中间区域的渐变方向包括有横向方向或者纵向方向;基于各区域的渐变方向,确定视场较小的图像中各区域的像素点的空间域权重,包括:针对边角区域,获取横向方向上的区域尺寸数据、纵向方向上的区域尺寸数据,确定边角区域中各像素点的空间域权重;针对边缘中间区域,获取横向方向上的区域尺寸数据或者纵向方向上的区域尺寸数据,确定边缘中间区域中各像素点的空间域权重。In one embodiment, determining the gradient direction of each region in the image with a small field of view includes: in the image with a small field of view, the gradient directions of the corner regions at the four corners all include the horizontal direction and the vertical direction Direction, the gradient direction of the edge middle area between two adjacent corner areas includes the horizontal direction or the vertical direction; based on the gradient direction of each area, determine the spatial domain of the pixels in each area of the image with a smaller field of view Weight, including: for the corner area, obtain the area size data in the horizontal direction and the area size data in the vertical direction, and determine the spatial domain weight of each pixel in the corner area; for the middle area of the edge, obtain the area in the horizontal direction The size data or the area size data in the longitudinal direction determine the spatial domain weight of each pixel in the middle area of the edge.

边角区域指的是处于边角的区域,如左上角的边角区域、右上角的边角区域、左下角的边角区域、右下角的边角区域。边缘中间区域指的是相邻两个边角区域之间的区域,如左上角的边角区域和右上角的边角区域之间的区域是边缘中间区域,左上角的边角区域和左下角的边角区域之间的区域是边缘中间区域。相邻两个边角区域之间的边缘中间区域的数量可以是一个,也可以是至少两个。The corner area refers to the area at the corner, such as the corner area of the upper left corner, the corner area of the upper right corner, the corner area of the lower left corner, and the corner area of the lower right corner. The middle area of the edge refers to the area between two adjacent corner areas, such as the area between the upper left corner area and the upper right corner area is the edge middle area, the upper left corner area and the lower left corner The area between the corner areas is the edge-middle area. The number of edge middle regions between two adjacent corner regions may be one or at least two.

区域尺度数据包括所在区域的宽度和高度。Area-scale data includes the width and height of the area in which it is located.

图4为一个实施例中对视场较小的图像进行区域划分的示意图。402是视场较大的图像,404是视场较小的图像,对视场较小的图像进行区域划分,将视场较小的图像划分为九宫格区域。Fig. 4 is a schematic diagram of performing region division on an image with a smaller field of view in an embodiment. 402 is an image with a larger field of view, and 404 is an image with a smaller field of view. The image with a smaller field of view is divided into regions, and the image with a smaller field of view is divided into nine square grid regions.

视场较小的图像的边角区域中各像素点的空间域权重可以根据以下公式计算得到:The spatial domain weight of each pixel in the corner area of an image with a small field of view can be calculated according to the following formula:

Figure BDA0002971257340000151
Figure BDA0002971257340000151

其中,α(x,y)是边角区域中坐标为(x,y)的像素点的空间域权重,x是坐标为(x,y)的像素点的横坐标,y是坐标为(x,y)的像素点的纵坐标,bandh是边角区域的高度,bandw是边角区域的宽度。Among them, α(x, y) is the spatial domain weight of the pixel with coordinates (x, y) in the corner area, x is the abscissa of the pixel with coordinates (x, y), and y is the coordinates of (x ,y), the ordinate of the pixel point, band h is the height of the corner area, and band w is the width of the corner area.

视场较大的图像中对应区域的像素点的空间域权重可以根据以上公式计算得到。The spatial domain weights of the pixels in the corresponding area in the image with a larger field of view can be calculated according to the above formula.

原始图像中边缘中间区域中各像素点的空间域权重可以根据以下公式计算得到:The spatial domain weight of each pixel in the middle area of the edge in the original image can be calculated according to the following formula:

Figure BDA0002971257340000161
Figure BDA0002971257340000161

其中,α(x,y)是边缘中间区域中坐标为(x,y)的像素点的空间域权重,y是坐标为(x,y)的像素点的纵坐标,bandh是边缘中间区域的高度。Among them, α(x, y) is the spatial domain weight of the pixel with coordinates (x, y) in the middle area of the edge, y is the ordinate of the pixel with coordinates (x, y), and band h is the middle area of the edge the height of.

视场较大的图像中对应区域的像素点的空间域权重可以根据以上公式计算得到。The spatial domain weights of the pixels in the corresponding area in the image with a larger field of view can be calculated according to the above formula.

视场较大的图像中除对应的各区域之外的区域中各像素点的空间域权重可以根据需要设置,例如设置为1。The spatial domain weights of the pixels in the regions other than the corresponding regions in the image with a larger field of view may be set as required, for example, set to 1.

在本实施例中,在视场较小的图像中,处于四个边角的边角区域的渐变方向均包括有横向方向和纵向方向,处于相邻两个边角区域之间的边缘中间区域的渐变方向包括有横向方向或者纵向方向;针对边角区域,获取横向方向上的区域尺寸数据、纵向方向上的区域尺寸数据,可以更准确地确定边角区域中各像素点的空间域权重;针对边缘中间区域,获取横向方向上的区域尺寸数据或者纵向方向上的区域尺寸数据,可以更准确地确定边缘中间区域中各像素点的空间域权重。In this embodiment, in an image with a small field of view, the gradient directions of the corner areas at the four corners all include the horizontal direction and the vertical direction, and the edge middle area between two adjacent corner areas The gradient direction includes horizontal or vertical direction; for the corner area, the area size data in the horizontal direction and the area size data in the vertical direction can be obtained to more accurately determine the spatial domain weight of each pixel in the corner area; For the middle edge region, the region size data in the horizontal direction or the region size data in the longitudinal direction can be obtained to more accurately determine the spatial domain weight of each pixel in the middle edge region.

在一个实施例中,上述方法还包括:在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数小于预设数量的情况下,依次展示目标图像;在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数大于或等于预设数量的情况下,调节缩放倍率,直到缩放倍率超出预设倍率区间。In one embodiment, the above method further includes: when the zoom ratio is within the preset ratio range, and the number of image frames acquired continuously under the same zoom ratio is less than the preset number, sequentially displaying the target image; In the preset magnification range, and when the number of image frames acquired continuously at the same zoom magnification is greater than or equal to the preset number, adjust the zoom magnification until the zoom magnification exceeds the preset magnification range.

在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数小于预设数量的情况下,表示当前缩放倍率持续调节,即持续增大或者持续减小,展示界面所展示的图像持续进行放大或者缩小,那么依次展示原始图像和接力图像融合得到的目标图像,以使展示界面所展示的画面从原始摄像头拍摄的画面渐变至接力摄像头拍摄的画面。其中,依次展示的目标图像也就是由多帧目标图像构成的过渡动画,展示的过渡动画可以自然地从原始摄像头拍摄的画面渐变至接力摄像头拍摄的画面。When the zoom ratio is within the preset ratio range, and the number of image frames acquired continuously at the same zoom ratio is less than the preset number, it means that the current zoom ratio is continuously adjusted, that is, continuously increased or continuously decreased, and the display interface shows The image is continuously zoomed in or out, and then the target image obtained by fusion of the original image and the relay image is displayed in sequence, so that the picture displayed on the display interface gradually changes from the picture taken by the original camera to the picture taken by the relay camera. Among them, the sequentially displayed target images are transition animations composed of multiple frames of target images, and the displayed transition animations can naturally gradually change from the pictures taken by the original camera to the pictures taken by the relay camera.

在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数大于或等于预设数量的情况下,表示当前缩放倍率停留在某一个缩放倍率上。可以理解的是,在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数小于预设数量的情况下,此时正处于原始摄像头拍摄的画面过渡至接力摄像头拍摄的画面,若一直停留在当前缩放倍率,则展示界面所展示的目标图像一直是相同的融合图像,并且该融合图像包含了原始图像和接力图像的重影,存在图像展示不准确的问题。When the zoom ratio is within the preset ratio range, and the number of image frames acquired continuously at the same zoom ratio is greater than or equal to the preset number, it means that the current zoom ratio stays at a certain zoom ratio. It can be understood that, when the magnification is within the preset magnification range, and the number of image frames acquired continuously at the same magnification is less than the preset number, at this time the picture taken by the original camera is transitioning to the picture taken by the relay camera , if it stays at the current magnification, the target image displayed on the display interface is always the same fused image, and the fused image contains the ghost image of the original image and the relay image, and there is a problem of inaccurate image display.

因此,在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数大于或等于预设数量的情况下,则调节缩放倍率,直到缩放倍率超出预设倍率区间。也就是说,在当前的缩放倍率停留在某一个缩放倍率上的情况下,则调节缩放倍率,继续控制缩放倍率增大或者减小,使得展示界面所展示的目标图像更加自然,直到该缩放倍率超出预设倍率区间。Therefore, when the zoom ratio is within the preset ratio range, and the number of image frames acquired continuously under the same zoom ratio is greater than or equal to the preset number, the zoom ratio is adjusted until the zoom ratio exceeds the preset ratio range. That is to say, when the current zoom ratio stays at a certain zoom ratio, adjust the zoom ratio and continue to control the zoom ratio to increase or decrease, so that the target image displayed on the display interface is more natural until the zoom ratio Exceeded the preset magnification range.

调节的缩放倍率可以根据以下公式计算得到:The adjusted zoom ratio can be calculated according to the following formula:

Figure BDA0002971257340000171
Figure BDA0002971257340000171

其中,Zoomctrl是自动缩放倍率,zoommax是预设倍率区间的上限值,zoommin是预设倍率区间的下限值,n是停留缩放倍率之后获取的图像帧数量,N是预先设置的预设倍率区间获取的图像帧总数。其中,停留缩放倍率为连续获取的图像帧数大于或等于预设数量的同一缩放倍率。Among them, Zoom ctrl is the automatic zoom magnification, zoom max is the upper limit value of the preset magnification range, zoom min is the lower limit value of the preset magnification range, n is the number of image frames acquired after staying at the zoom magnification, and N is preset The total number of image frames acquired in the preset magnification range. Wherein, the dwell zoom ratio is the same zoom ratio at which the number of continuously acquired image frames is greater than or equal to a preset number.

在本实施例中,在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数小于预设数量的情况下,依次展示目标图像,可以使得展示界面展示的目标图像更加自然;在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数大于或等于预设数量的情况下,调节缩放倍率,控制缩放倍率继续进行增大或者减小,可以避免展示界面中长时间展示同一目标图像而导致重影的问题,也可以使得展示的目标图像更加自然。In this embodiment, when the magnification is within the preset magnification interval, and the number of image frames acquired continuously at the same zoom magnification is less than the preset number, the target images are displayed sequentially, which can make the target images displayed on the display interface more natural ; When the zoom ratio is within the preset ratio range, and the number of image frames acquired continuously under the same zoom ratio is greater than or equal to the preset number, adjust the zoom ratio and control the zoom ratio to continue to increase or decrease, which can avoid displaying The problem of ghosting caused by displaying the same target image for a long time in the interface can also make the displayed target image more natural.

图5为一个实施例中调节缩放倍率的示意图。预设倍率区间是0.8X-1.2X,在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数大于或等于预设数量的情况下,调节缩放倍率,直到缩放倍率超出预设倍率区间。Fig. 5 is a schematic diagram of adjusting zoom ratio in an embodiment. The preset magnification range is 0.8X-1.2X. When the zoom magnification is within the preset magnification range, and the number of image frames acquired continuously at the same zoom magnification is greater than or equal to the preset number, adjust the zoom magnification until the zoom magnification exceeds Preset magnification range.

在一个实施例中,调节缩放倍率,包括:获取缩放倍率的缩放方向,以及缩放倍率的缩放速度;按照缩放方向和缩放速度,调节缩放倍率。In an embodiment, adjusting the zoom ratio includes: acquiring a zoom direction of the zoom ratio and a zoom speed of the zoom ratio; and adjusting the zoom ratio according to the zoom direction and the zoom speed.

缩放方向是缩放倍率在缩放过程中的方向。缩放方向可为从大到小的方向,或者从小到大的方向。在图像的缩放倍率从大到小的方向进行缩放的情况下,即对该图像进行缩小,该图像的视场变大。在图像的缩放倍率从小到大的方向进行缩放的情况下,即对该图像进行放大,该图像的视场变小。The zoom direction is the direction of the zoom ratio during zooming. The zooming direction may be from large to small, or from small to large. When the zoom ratio of the image is zoomed in the direction from large to small, that is, the image is reduced, and the field of view of the image becomes larger. When the zoom ratio of the image is zoomed in a direction from small to large, that is, the image is enlarged, and the field of view of the image becomes smaller.

电子设备获取在确定停留缩放倍率的时刻之前的历史缩放方向,将该历史缩放方向作为缩放倍率的缩放方向;其中,停留缩放倍率为连续获取的图像帧数大于或等于预设数量的同一缩放倍率。The electronic device obtains the historical zooming direction before the moment of determining the dwell zoom ratio, and takes the historical zoom direction as the zoom ratio zoom ratio; wherein, the dwell zoom ratio is the same zoom ratio at which the number of continuously acquired image frames is greater than or equal to a preset number .

电子设备将历史缩放方向作为继续调节缩放倍率时的缩放方向,可以使得缩放倍率按照历史缩放方向的趋势进行调节,则展示的目标图像更加自然。The electronic device uses the historical zooming direction as the zooming direction when continuing to adjust the zooming ratio, so that the zooming ratio can be adjusted according to the trend of the historical zooming direction, and the displayed target image is more natural.

缩放速度是缩放倍率在缩放过程中的速度。缩放速度越大,则图像在单位时间内进行放大或缩小的速度越快。缩放速度可以根据需要进行设置。缩放速度衡量缩放倍率处于预设倍率区间内时,各目标图像所构成的过渡动画消失的快慢情况。The zoom speed is the speed of the zoom factor during zooming. The larger the zoom speed, the faster the image will be zoomed in or zoomed out per unit time. Zoom speed can be set as needed. The zoom speed measures how quickly the transition animation formed by each target image disappears when the zoom ratio is within the preset ratio range.

获取预先设置的处于预设倍率区间内获取的图像帧数量,通过图像帧数量和缩放速度之间的对应关系,确定缩放速度。The preset number of image frames acquired within the preset magnification range is obtained, and the zooming speed is determined through the corresponding relationship between the number of image frames and the zooming speed.

在本实施例中,电子设备获取缩放倍率的缩放方向,以及缩放倍率的缩放速度;按照缩放方向和缩放速度,可以更准确地调节缩放倍率。In this embodiment, the electronic device acquires the zooming direction of the zooming ratio and the zooming speed of the zooming ratio; according to the zooming direction and the zooming speed, the zooming ratio can be adjusted more accurately.

在一个实施例中,如图6所示,上述方法还包括:In one embodiment, as shown in Figure 6, the above method also includes:

步骤602,在控制缩放倍率继续进行调整的过程中,实时检测当前所处的自动缩放倍率。Step 602, during the process of controlling the zoom ratio to continue adjusting, detect the current automatic zoom ratio in real time.

自动缩放倍率是在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数大于或等于预设数量的情况下,电子设备自动进行调节的缩放倍率。The automatic zoom ratio is a zoom ratio automatically adjusted by the electronic device when the zoom ratio is within a preset ratio range and the number of image frames acquired continuously at the same zoom ratio is greater than or equal to the preset number.

步骤604,在检测到用户控制图像的缩放倍率的情况下,确定用户当前控制的用户缩放倍率。Step 604, if it is detected that the user controls the zoom ratio of the image, determine the user zoom ratio currently controlled by the user.

用户缩放倍率是用户控制的缩放倍率。User magnification is a user-controlled magnification.

电子设备在控制缩放倍率继续进行调整的过程中,用户可能会控制缩放倍率,对图像进行缩放。电子设备在检测到用户控制图像的缩放倍率的情况下,确定用户当前控制的用户缩放倍率。When the electronic device controls the zoom ratio and continues to adjust, the user may control the zoom ratio to zoom the image. In the event that the electronic device detects that the user controls the zoom ratio of the image, the electronic device determines the user zoom ratio currently controlled by the user.

步骤606,在自动缩放倍率和用户缩放倍率均大于停留缩放倍率,或者均小于停留缩放倍率的情况下,从用户缩放倍率和自动缩放倍率中,确定与停留缩放倍率之差更大的作为目标缩放倍率;停留缩放倍率为连续获取的图像帧数大于或等于预设数量的同一缩放倍率。Step 606, in the case that both the automatic zoom ratio and the user zoom ratio are greater than the stop zoom ratio, or both are smaller than the stop zoom ratio, determine the target zoom ratio with the larger difference from the user zoom ratio and the automatic zoom ratio as the target zoom ratio Magnification; the dwell zoom ratio is the same zoom ratio at which the number of image frames acquired continuously is greater than or equal to the preset number.

在自动缩放倍率和用户缩放倍率均大于停留缩放倍率,或者均小于停留缩放倍率的情况下,表示电子设备调节缩放倍率的方向与用户控制缩放倍率的方向是一致的,则确定与停留缩放倍率之差更大的作为目标缩放倍率。In the case that both the automatic zoom ratio and the user zoom ratio are greater than the stop zoom ratio, or both are smaller than the stay zoom ratio, it means that the direction of the electronic device to adjust the zoom ratio is consistent with the direction in which the user controls the zoom ratio. The larger difference is used as the target zoom ratio.

可以理解的是,电子设备确定与停留缩放倍率之差更大的作为目标缩放倍率,是为了避免确定与停留缩放倍率之差更小的作为目标缩放倍率时,会导致展示界面中展示重复画面的情况。It can be understood that the purpose of the electronic device to determine the target zoom ratio with a larger difference from the dwell zoom ratio is to avoid the display of repeated images in the display interface when the target zoom ratio is determined to be smaller than the stay zoom ratio. Condition.

举例说明如下,电子设备的停留缩放倍率为1X,电子设备在调节缩放倍率的过程中,实时检测当前所处的自动缩放倍率为1.5X,用户当前控制的用户缩放倍率为1.2X,自动缩放倍率和用户缩放倍率均大于停留缩放倍率,若将与停留缩放倍率之差更小的作为目标缩放倍率,即将用户缩放倍率1.2X作为目标缩放倍率,则展示界面展示的画面的缩放过程是从1X缩放至1.5X,再返回至1.2X,展示了重复的画面。若将与停留缩放倍率之差更大的作为目标缩放倍率,即将自动缩放倍率1.5X作为目标缩放倍率,则展示界面展示的画面的缩放过程是从1X缩放至1.5X,并以1.5X作为目标缩放倍率继续进行缩放,使得图像展示更加自然。For example, the dwell zoom ratio of the electronic device is 1X. During the process of adjusting the zoom ratio, the electronic device detects in real time that the current automatic zoom ratio is 1.5X, and the user zoom ratio currently controlled by the user is 1.2X. Both the zoom ratio and the user zoom ratio are greater than the stop zoom ratio. If the difference between the zoom ratio and the stop zoom ratio is smaller, that is, the user zoom ratio of 1.2X is used as the target zoom ratio, then the zooming process of the screen displayed on the display interface is zoomed from 1X Going to 1.5X and back to 1.2X shows a repeating picture. If the larger difference from the stop zoom ratio is used as the target zoom ratio, that is, the automatic zoom ratio of 1.5X is used as the target zoom ratio, then the zoom process of the screen displayed on the display interface is zoomed from 1X to 1.5X, and 1.5X is used as the target The magnification continues to scale for a more natural image display.

目标缩放倍率可以根据以下公式计算得到:The target zoom ratio can be calculated according to the following formula:

Figure BDA0002971257340000201
Figure BDA0002971257340000201

其中,Zoomresilt是目标缩放倍率,Zoomctrl是自动缩放倍率,Zoomusr,是用户缩放倍率,Zoom是停留缩放倍率,A=(Zoomctrl-Zoom)(Zoomusr-Zoom),在A>0的情况下,表示自动缩放倍率和用户缩放倍率均大于停留缩放倍率,或者均小于所述停留缩放倍率,(Zoomctrl-Zoom)(Zoomusr-Zoom)<0表示自动缩放倍率和用户缩放倍率中,其中一个大于停留缩放倍率,并且另外一个小于停留缩放倍率。Wherein, Zoom resilt is the target zoom ratio, Zoom ctrl is the automatic zoom ratio, Zoom usr is the user zoom ratio, Zoom is the dwell zoom ratio, A=(Zoom ctrl -Zoom)(Zoom usr -Zoom), at A>0 In this case, it means that both the automatic zoom ratio and the user zoom ratio are greater than the stop zoom ratio, or both are smaller than the stop zoom ratio, (Zoom ctrl -Zoom)(Zoom usr -Zoom)<0 means that the automatic zoom ratio and the user zoom ratio are in between, One of them is greater than the dwell magnification, and the other is smaller than the dwell magnification.

步骤608,基于目标缩放倍率进行图像展示。Step 608, performing image display based on the target zoom ratio.

在本实施例中,在调节缩放倍率的过程中,实时检测当前所处的自动缩放倍率;在检测到用户控制图像的缩放倍率的情况下,确定用户当前控制的用户缩放倍率;在自动缩放倍率和用户缩放倍率均大于停留缩放倍率,或者均小于停留缩放倍率的情况下,从用户缩放倍率和自动缩放倍率中,确定与停留缩放倍率之差更大的作为目标缩放倍率,可以使得图像展示更加自然。In this embodiment, in the process of adjusting the zoom ratio, the current automatic zoom ratio is detected in real time; when the zoom ratio of the image controlled by the user is detected, the user zoom ratio currently controlled by the user is determined; When both the user zoom ratio and the user zoom ratio are greater than the stay zoom ratio, or both are smaller than the stay zoom ratio, from the user zoom ratio and the automatic zoom ratio, determine the larger difference from the stay zoom ratio as the target zoom ratio, which can make the image display more accurate. nature.

在一个实施例中,上述方法还包括:在自动缩放倍率和用户缩放倍率中,其中一个大于停留缩放倍率,并且另外一个小于停留缩放倍率的情况下,基于用户缩放倍率进行图像展示。In one embodiment, the above method further includes: under the condition that one of the automatic zoom ratio and the user zoom ratio is larger than the dwell zoom ratio, and the other is smaller than the dock zoom ratio, performing image display based on the user zoom ratio.

在自动缩放倍率和用户缩放倍率中,其中一个大于停留缩放倍率,并且另外一个小于停留缩放倍率的情况下,表示自动缩放倍率的缩放方向和用户缩放倍率的缩放方向相反,则直接基于用户缩放倍率进行图像展示。In the case of the automatic zoom ratio and the user zoom ratio, one of which is greater than the stop zoom ratio and the other is smaller than the stop zoom ratio, it means that the zoom direction of the automatic zoom ratio is opposite to that of the user zoom ratio, and it is directly based on the user zoom ratio for image display.

例如,电子设备的停留缩放倍率为1X,电子设备在调节缩放倍率的过程中,实时检测当前所处的自动缩放倍率为1.5X,用户当前控制的用户缩放倍率为0.8X,表示用户想要缩小图像,则基于用户缩放倍率进行图像展示,展示的图像更符合用户需求。For example, the dwell zoom ratio of the electronic device is 1X. During the process of adjusting the zoom ratio, the electronic device detects in real time that the current automatic zoom ratio is 1.5X, and the user zoom ratio currently controlled by the user is 0.8X, indicating that the user wants to zoom out. The image is displayed based on the user's zoom ratio, and the displayed image is more in line with the user's needs.

应该理解的是,虽然图1、图3和图6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1、图3和图6中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flow charts of FIG. 1 , FIG. 3 and FIG. 6 are shown sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in FIG. 1, FIG. 3 and FIG. 6 may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of the sub-steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

图7为一个实施例的图像展示装置的结构框图。如图7所示,提供了一种图像展示装置,包括:图像获取模块702、权重获取模块704、像素值确定模块706和展示模块708,其中:Fig. 7 is a structural block diagram of an image display device of an embodiment. As shown in Figure 7, an image display device is provided, including: an image acquisition module 702, a weight acquisition module 704, a pixel value determination module 706 and a display module 708, wherein:

图像获取模块702,用于在控制图像的缩放倍率进入预设倍率区间的情况下,获取原始摄像头拍摄的原始图像,以及获取接力摄像头拍摄的接力图像;预设倍率区间包括有原始摄像头对应的缩放倍率以及接力摄像头对应的缩放倍率。The image acquisition module 702 is used to obtain the original image taken by the original camera and the relay image taken by the relay camera when the zoom ratio of the control image enters the preset ratio range; the preset ratio range includes the zoom ratio corresponding to the original camera The magnification and the zoom magnification corresponding to the relay camera.

权重获取模块704,用于在时间域上,获取原始图像中各像素点的原始时间域权重,以及接力图像中各像素点的接力时间域权重。The weight obtaining module 704 is configured to obtain the original time domain weight of each pixel in the original image and the relay time domain weight of each pixel in the relay image in the time domain.

权重获取模块704还用于在空间域上,获取原始图像中各像素点的原始空间域权重,以及接力图像中各像素点的接力空间域权重。The weight acquisition module 704 is further configured to acquire the original spatial domain weight of each pixel in the original image and the relay spatial domain weight of each pixel in the relay image in the spatial domain.

像素值确定模块706,用于基于原始图像中各像素点的像素值、原始时间域权重和原始空间域权重,以及接力图像中各像素点的像素值、接力时间域权重和接力空间域权重,确定目标图像中各目标像素点的像素值。The pixel value determination module 706 is configured to be based on the pixel value of each pixel point in the original image, the original time domain weight and the original space domain weight, and the pixel value of each pixel point in the relay image, the relay time domain weight and the relay space domain weight, Determine the pixel value of each target pixel in the target image.

展示模块708,用于根据各目标像素点的像素值得到目标图像,并展示目标图像。A display module 708, configured to obtain the target image according to the pixel value of each target pixel, and display the target image.

上述图像展示装置,在控制图像的缩放倍率进入预设倍率区间的情况下,获取原始摄像头拍摄的原始图像,以及获取接力摄像头拍摄的接力图像;分别从时间域和空间域上,获取原始图像中各像素点的权重,以及接力图像中各像素点的权重,那么,原始图像和目标图像可以从时间域和空间域上进行融合,得到原始图像和接力图像之间过渡的目标图像,并展示该目标图像,避免了在原始摄像头切换至接力摄像头的过程中直接将原始图像切换至接力图像,而导致的图像突变的问题,使得所展示的图像更加自然。The above image display device obtains the original image taken by the original camera and the relay image taken by the relay camera under the condition that the zoom ratio of the image is controlled to enter the preset ratio range; The weight of each pixel, and the weight of each pixel in the relay image, then the original image and the target image can be fused from the time domain and the space domain to obtain the transition target image between the original image and the relay image, and display the The target image avoids the problem of image mutation caused by directly switching the original image to the relay image during the process of switching from the original camera to the relay camera, making the displayed image more natural.

在一个实施例中,上述权重获取模块还用于将原始图像和接力图像进行内容对齐,确定视场较小的图像和视场较大的图像;对视场较小的图像进行区域划分;在空间域上,获取视场较小的图像中各区域的像素点的空间域权重,以及视场较大的图像中各像素点的空间域权重。In one embodiment, the above-mentioned weight acquisition module is also used to align the content of the original image and the relay image, determine the image with a smaller field of view and the image with a larger field of view; divide the image with a smaller field of view into regions; In the spatial domain, the spatial domain weights of the pixels in each region in the image with a smaller field of view and the spatial domain weights of each pixel in the image with a larger field of view are obtained.

在一个实施例中,上述权重获取模块还用于确定视场较小的图像中各区域的渐变方向;基于各区域的渐变方向,确定视场较小的图像中各区域的像素点的空间域权重;获取视场较大的图像中对应的各区域中各像素点的空间域权重,以及除对应的各区域之外的区域中各像素点的空间域权重。In one embodiment, the above-mentioned weight acquisition module is also used to determine the gradient direction of each region in the image with a smaller field of view; based on the gradient direction of each region, determine the spatial domain of the pixels in each region in the image with a smaller field of view weights; acquiring the spatial domain weights of each pixel point in each corresponding region in the image with a larger field of view, and the spatial domain weights of each pixel point in regions other than the corresponding regions.

在一个实施例中,上述权重获取模块还用于在视场较小的图像中,处于四个边角的边角区域的渐变方向均包括有横向方向和纵向方向,处于相邻两个边角区域之间的边缘中间区域的渐变方向包括有横向方向或者纵向方向;针对边角区域,获取横向方向上的区域尺寸数据、纵向方向上的区域尺寸数据,确定边角区域中各像素点的空间域权重;针对边缘中间区域,获取横向方向上的区域尺寸数据或者纵向方向上的区域尺寸数据,确定边缘中间区域中各像素点的空间域权重。In one embodiment, the above-mentioned weight acquisition module is also used in an image with a small field of view, the gradient directions of the corner areas at the four corners all include the horizontal direction and the vertical direction, and the gradient directions at two adjacent corners The gradient direction of the middle area of the edge between the areas includes the horizontal direction or the vertical direction; for the corner area, obtain the area size data in the horizontal direction and the area size data in the vertical direction, and determine the space of each pixel in the corner area Domain weight: for the middle area of the edge, obtain the area size data in the horizontal direction or the area size data in the vertical direction, and determine the spatial domain weight of each pixel in the middle area of the edge.

在一个实施例中,上述展示模块还用于在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数小于预设数量的情况下,依次展示目标图像;上述装置还包括调节模块,用于在缩放倍率处于预设倍率区间内,并且同一缩放倍率下连续获取的图像帧数大于或等于预设数量的情况下,调节缩放倍率,直到缩放倍率超出预设倍率区间。In one embodiment, the display module is further used to sequentially display target images when the zoom ratio is within a preset ratio range and the number of image frames acquired continuously at the same zoom ratio is less than a preset number; the above-mentioned device also includes The adjustment module is used to adjust the zoom ratio until the zoom ratio exceeds the preset ratio range when the zoom ratio is within the preset ratio range and the number of image frames acquired continuously at the same zoom ratio is greater than or equal to the preset number.

在一个实施例中,上述调节模块还用于获取缩放倍率的缩放方向,以及缩放倍率的缩放速度;按照缩放方向和缩放速度,调节缩放倍率。In one embodiment, the adjustment module is further configured to obtain the zooming direction of the zooming ratio and the zooming speed of the zooming ratio; and adjust the zooming ratio according to the zooming direction and the zooming speed.

在一个实施例中,上述装置还包括目标缩放倍率确定模块,用于在调节缩放倍率的过程中,实时检测当前所处的自动缩放倍率;在检测到用户控制图像的缩放倍率的情况下,确定用户当前控制的用户缩放倍率;在自动缩放倍率和用户缩放倍率均大于停留缩放倍率,或者均小于停留缩放倍率的情况下,从用户缩放倍率和自动缩放倍率中,确定与停留缩放倍率之差更大的作为目标缩放倍率;停留缩放倍率为连续获取的图像帧数大于或等于预设数量的同一缩放倍率;通过展示模块基于目标缩放倍率进行图像展示。In one embodiment, the above device further includes a target zoom ratio determination module, which is used to detect the current automatic zoom ratio in real time during the process of adjusting the zoom ratio; when it is detected that the user controls the zoom ratio of the image, determine The user zoom ratio currently controlled by the user; when both the automatic zoom ratio and the user zoom ratio are greater than the stop zoom ratio, or both are smaller than the stop zoom ratio, determine the difference between the user zoom ratio and the automatic zoom ratio and the stop zoom ratio. The larger one is the target magnification; the stop magnification is the same zoom magnification at which the number of image frames acquired continuously is greater than or equal to the preset number; the display module performs image display based on the target magnification.

在一个实施例中,上述展示模块还用于在自动缩放倍率和用户缩放倍率中,其中一个大于停留缩放倍率,并且另外一个小于停留缩放倍率的情况下,基于用户缩放倍率进行图像展示。In one embodiment, the display module is further configured to perform image display based on the user zoom ratio when one of the automatic zoom ratio and the user zoom ratio is larger than the stop zoom ratio and the other is smaller than the stop zoom ratio.

上述图像展示装置中各个模块的划分仅仅用于举例说明,在其他实施例中,可将图像展示装置按照需要划分为不同的模块,以完成上述图像展示装置的全部或部分功能。The division of each module in the above-mentioned image display device is only for illustration. In other embodiments, the image display device can be divided into different modules according to needs, so as to complete all or part of the functions of the above-mentioned image display device.

关于图像展示装置的具体限定可以参见上文中对于图像展示方法的限定,在此不再赘述。上述图像展示装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific limitations on the image display device, please refer to the above-mentioned limitations on the image display method, which will not be repeated here. Each module in the above-mentioned image display device can be fully or partially realized by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.

图8为一个实施例中电子设备的内部结构示意图。如图8所示,该电子设备包括通过系统总线连接的处理器和存储器。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器可包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统和计算机程序。该计算机程序可被处理器所执行,以用于实现以下各个实施例所提供的一种图像展示方法。内存储器为非易失性存储介质中的操作系统计算机程序提供高速缓存的运行环境。该电子设备可以是手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等任意终端设备。Fig. 8 is a schematic diagram of the internal structure of an electronic device in one embodiment. As shown in FIG. 8, the electronic device includes a processor and a memory connected through a system bus. Among them, the processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory may include non-volatile storage media and internal memory. Nonvolatile storage media store operating systems and computer programs. The computer program can be executed by a processor, so as to implement an image display method provided in each of the following embodiments. The internal memory provides a high-speed running environment for the operating system computer program in the non-volatile storage medium. The electronic device may be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant, personal digital assistant), a POS (Point of Sales, sales terminal), a vehicle-mounted computer, or a wearable device.

本申请实施例中提供的图像展示装置中的各个模块的实现可为计算机程序的形式。该计算机程序可在终端或服务器上运行。该计算机程序构成的程序模块可存储在电子设备的存储器上。该计算机程序被处理器执行时,实现本申请实施例中所描述方法的步骤。The implementation of each module in the image display device provided in the embodiment of the present application may be in the form of a computer program. The computer program can run on a terminal or a server. The program modules constituted by the computer program can be stored in the memory of the electronic device. When the computer program is executed by the processor, the steps of the methods described in the embodiments of the present application are realized.

本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行图像展示方法的步骤。The embodiment of the present application also provides a computer-readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of the image presentation method.

一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行图像展示方法。A computer program product comprising instructions, when run on a computer, causes the computer to execute the image presentation method.

本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Synchlink DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present application, and the description thereof is relatively specific and detailed, but should not be construed as limiting the patent scope of the present application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.

Claims (11)

1.一种图像展示方法,其特征在于,包括:1. An image display method, characterized in that, comprising: 在控制图像的缩放倍率进入预设倍率区间的情况下,获取原始摄像头拍摄的原始图像,以及获取接力摄像头拍摄的接力图像;所述预设倍率区间包括有所述原始摄像头对应的缩放倍率以及所述接力摄像头对应的缩放倍率;在控制的缩放倍率进入所述预设倍率区间之前,所述原始摄像头拍摄的原始图像展示在展示界面中;在控制的缩放倍率通过所述预设倍率区间之后,所述接力摄像头拍摄的接力图像展示在展示界面中;Under the condition that the zoom ratio of the control image enters the preset ratio interval, the original image taken by the original camera is obtained, and the relay image taken by the relay camera is obtained; the preset ratio interval includes the corresponding zoom ratio of the original camera and the The zoom ratio corresponding to the relay camera; before the controlled zoom ratio enters the preset ratio range, the original image captured by the original camera is displayed in the display interface; after the controlled zoom ratio passes through the preset ratio range, The relay image captured by the relay camera is displayed in the display interface; 在时间域上,获取所述原始图像中各像素点的原始时间域权重,以及所述接力图像中各像素点的接力时间域权重;In the time domain, the original time domain weight of each pixel in the original image and the relay time domain weight of each pixel in the relay image are acquired; 在空间域上,获取所述原始图像中各像素点的原始空间域权重,以及所述接力图像中各像素点的接力空间域权重;In the space domain, the original space domain weight of each pixel in the original image and the relay space domain weight of each pixel in the relay image are acquired; 基于所述原始图像中各像素点的像素值、所述原始时间域权重和所述原始空间域权重,以及所述接力图像中各像素点的像素值、所述接力时间域权重和所述接力空间域权重,确定目标图像中各目标像素点的像素值;Based on the pixel value of each pixel in the original image, the original time domain weight and the original space domain weight, and the pixel value of each pixel in the relay image, the relay time domain weight and the relay The spatial domain weight determines the pixel value of each target pixel in the target image; 根据各所述目标像素点的像素值得到所述目标图像,并展示所述目标图像。The target image is obtained according to the pixel value of each target pixel point, and the target image is displayed. 2.根据权利要求1所述的方法,其特征在于,所述在空间域上,获取所述原始图像中各像素点的原始空间域权重,以及所述接力图像中各像素点的接力空间域权重,包括:2. The method according to claim 1, wherein, in the spatial domain, the original spatial domain weight of each pixel in the original image and the relay spatial domain weight of each pixel in the relay image are obtained. weights, including: 将所述原始图像和所述接力图像进行内容对齐,确定视场较小的图像和视场较大的图像;Aligning the original image and the relay image to determine an image with a smaller field of view and an image with a larger field of view; 对所述视场较小的图像进行区域划分;performing region division on the image with a smaller field of view; 在空间域上,获取所述视场较小的图像中各区域的像素点的空间域权重,以及视场较大的图像中各像素点的空间域权重。In the spatial domain, the spatial domain weights of the pixels in each region in the image with a smaller field of view and the spatial domain weights of each pixel in the image with a larger field of view are acquired. 3.根据权利要求2所述的方法,其特征在于,所述在空间域上,获取所述视场较小的图像中各区域的像素点的空间域权重,以及视场较大的图像中各像素点的空间域权重,包括:3. The method according to claim 2, wherein in the spatial domain, the spatial domain weights of pixels in each region in the image with a smaller field of view are obtained, and the weights in the image with a larger field of view are obtained. The spatial domain weight of each pixel, including: 确定所述视场较小的图像中各区域的渐变方向;determining the gradient direction of each region in the image with a smaller field of view; 基于各区域的渐变方向,确定所述视场较小的图像中各区域的像素点的空间域权重;Based on the gradient direction of each area, determine the spatial domain weight of the pixels in each area in the image with a smaller field of view; 获取视场较大的图像中对应的各区域中各像素点的空间域权重,以及除对应的各区域之外的区域中各像素点的空间域权重。The spatial domain weights of each pixel in each corresponding area in the image with a larger field of view and the spatial domain weights of each pixel in areas other than the corresponding areas are acquired. 4.根据权利要求3所述的方法,其特征在于,所述确定所述视场较小的图像中各区域的渐变方向,包括:4. The method according to claim 3, wherein the determining the gradient direction of each region in the image with a smaller field of view comprises: 在所述视场较小的图像中,处于四个边角的边角区域的渐变方向均包括有横向方向和纵向方向,处于相邻两个边角区域之间的边缘中间区域的渐变方向包括有横向方向或者纵向方向;In the image with a small field of view, the gradation directions of the corner regions at the four corners include the horizontal direction and the longitudinal direction, and the gradation directions of the edge middle region between two adjacent corner regions include have a landscape orientation or a portrait orientation; 所述基于各区域的渐变方向,确定所述视场较小的图像中各区域的像素点的空间域权重,包括:The determining the spatial domain weights of pixels in each region in the image with a smaller field of view based on the gradient direction of each region includes: 针对所述边角区域,获取所述横向方向上的区域尺寸数据、所述纵向方向上的区域尺寸数据,确定所述边角区域中各像素点的空间域权重;For the corner area, acquiring area size data in the lateral direction and area size data in the longitudinal direction, and determining the spatial domain weight of each pixel in the corner area; 针对所述边缘中间区域,获取所述横向方向上的区域尺寸数据或者所述纵向方向上的区域尺寸数据,确定所述边缘中间区域中各像素点的空间域权重。For the edge middle area, acquire the area size data in the horizontal direction or the area size data in the longitudinal direction, and determine the spatial domain weight of each pixel in the edge middle area. 5.根据权利要求1所述的方法,其特征在于,所述方法还包括:5. The method according to claim 1, wherein the method further comprises: 在所述缩放倍率处于所述预设倍率区间内,并且同一所述缩放倍率下连续获取的图像帧数小于预设数量的情况下,依次展示目标图像;When the magnification is within the preset magnification interval, and the number of image frames acquired continuously at the same magnification is less than a preset number, displaying target images in sequence; 在所述缩放倍率处于所述预设倍率区间内,并且同一所述缩放倍率下连续获取的图像帧数大于或等于预设数量的情况下,调节所述缩放倍率,直到所述缩放倍率超出所述预设倍率区间。When the zoom ratio is within the preset ratio range, and the number of image frames acquired continuously at the same zoom ratio is greater than or equal to a preset number, adjust the zoom ratio until the zoom ratio exceeds the preset ratio. The preset magnification range is described above. 6.根据权利要求5所述的方法,其特征在于,所述调节所述缩放倍率,包括:6. The method according to claim 5, wherein the adjusting the scaling factor comprises: 获取所述缩放倍率的缩放方向,以及所述缩放倍率的缩放速度;Acquiring the zoom direction of the zoom ratio and the zoom speed of the zoom ratio; 按照所述缩放方向和所述缩放速度,调节所述缩放倍率。The zoom ratio is adjusted according to the zoom direction and the zoom speed. 7.根据权利要求5所述的方法,其特征在于,所述方法还包括:7. The method according to claim 5, wherein the method further comprises: 在调节所述缩放倍率的过程中,实时检测当前所处的自动缩放倍率;During the process of adjusting the zoom ratio, detect the current automatic zoom ratio in real time; 在检测到用户控制图像的缩放倍率的情况下,确定用户当前控制的用户缩放倍率;In the event that the user controls the zoom ratio of the image is detected, determining the user zoom ratio currently controlled by the user; 在所述自动缩放倍率和所述用户缩放倍率均大于停留缩放倍率,或者均小于所述停留缩放倍率的情况下,从所述用户缩放倍率和所述自动缩放倍率中,确定与所述停留缩放倍率之差更大的作为目标缩放倍率;所述停留缩放倍率为连续获取的图像帧数大于或等于预设数量的同一缩放倍率;In the case that both the automatic zoom ratio and the user zoom ratio are larger than the stop zoom ratio, or both are smaller than the stay zoom ratio, from the user zoom ratio and the automatic zoom ratio, determine the The larger difference in magnification is used as the target zoom magnification; the dwell zoom magnification is the same zoom magnification at which the number of image frames acquired continuously is greater than or equal to the preset number; 基于所述目标缩放倍率进行图像展示。Image presentation is performed based on the target magnification. 8.根据权利要求7所述的方法,其特征在于,所述方法还包括:8. The method according to claim 7, further comprising: 在所述自动缩放倍率和所述用户缩放倍率中,其中一个大于所述停留缩放倍率,并且另外一个小于所述停留缩放倍率的情况下,基于所述用户缩放倍率进行图像展示。In a case where one of the automatic zoom magnification and the user zoom magnification is greater than the dwell zoom magnification and the other is smaller than the dwell zoom magnification, image presentation is performed based on the user zoom magnification. 9.一种图像展示装置,其特征在于,包括:9. An image display device, characterized in that it comprises: 图像获取模块,用于在控制图像的缩放倍率进入预设倍率区间的情况下,获取原始摄像头拍摄的原始图像,以及获取接力摄像头拍摄的接力图像;所述预设倍率区间包括有所述原始摄像头对应的缩放倍率以及所述接力摄像头对应的缩放倍率;在控制的缩放倍率进入所述预设倍率区间之前,所述原始摄像头拍摄的原始图像展示在展示界面中;在控制的缩放倍率通过所述预设倍率区间之后,所述接力摄像头拍摄的接力图像展示在展示界面中;The image acquisition module is used to obtain the original image taken by the original camera and the relay image taken by the relay camera when the zoom magnification of the control image enters the preset magnification interval; the preset magnification interval includes the original camera The corresponding zoom ratio and the zoom ratio corresponding to the relay camera; before the controlled zoom ratio enters the preset ratio range, the original image captured by the original camera is displayed in the display interface; when the controlled zoom ratio passes through the After the preset magnification interval, the relay image captured by the relay camera is displayed in the display interface; 权重获取模块,用于在时间域上,获取所述原始图像中各像素点的原始时间域权重,以及所述接力图像中各像素点的接力时间域权重;A weight acquisition module, configured to acquire the original time domain weight of each pixel in the original image and the relay time domain weight of each pixel in the relay image in the time domain; 所述权重获取模块还用于在空间域上,获取所述原始图像中各像素点的原始空间域权重,以及所述接力图像中各像素点的接力空间域权重;The weight acquisition module is also used to acquire the original spatial domain weight of each pixel in the original image and the relay spatial domain weight of each pixel in the relay image in the spatial domain; 像素值确定模块,用于基于所述原始图像中各像素点的像素值、所述原始时间域权重和所述原始空间域权重,以及所述接力图像中各像素点的像素值、所述接力时间域权重和所述接力空间域权重,确定目标图像中各目标像素点的像素值;A pixel value determining module, configured to be based on the pixel value of each pixel in the original image, the original time domain weight and the original space domain weight, and the pixel value of each pixel in the relay image, the relay The time domain weight and the relay space domain weight determine the pixel value of each target pixel in the target image; 展示模块,用于根据各所述目标像素点的像素值得到所述目标图像,并展示所述目标图像。A display module, configured to obtain the target image according to the pixel value of each target pixel, and display the target image. 10.一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如权利要求1至8中任一项所述的图像展示方法的步骤。10. An electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, wherein when the computer program is executed by the processor, the processor is executed as claimed in claims 1 to 8. The steps of any one of the image display methods. 11.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至8中任一项所述的方法的步骤。11. A computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are realized.
CN202110263924.0A 2021-03-11 2021-03-11 Image display method and device, electronic equipment and computer readable storage medium Active CN113055592B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110263924.0A CN113055592B (en) 2021-03-11 2021-03-11 Image display method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110263924.0A CN113055592B (en) 2021-03-11 2021-03-11 Image display method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113055592A CN113055592A (en) 2021-06-29
CN113055592B true CN113055592B (en) 2023-03-21

Family

ID=76511523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110263924.0A Active CN113055592B (en) 2021-03-11 2021-03-11 Image display method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113055592B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116709016B (en) * 2022-02-24 2024-06-18 荣耀终端有限公司 Ratio switching method and ratio switching device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103986867B (en) * 2014-04-24 2017-04-05 宇龙计算机通信科技(深圳)有限公司 A kind of image taking terminal and image capturing method
TWI554103B (en) * 2014-11-13 2016-10-11 聚晶半導體股份有限公司 Image capturing device and digital zoom method thereof
CN106254767B (en) * 2016-07-29 2017-09-19 广东欧珀移动通信有限公司 Image zooming processing method and device and terminal equipment
CN106791400B (en) * 2016-12-23 2019-08-20 维沃移动通信有限公司 Image display method and mobile terminal
CN110099213A (en) * 2019-04-26 2019-08-06 维沃移动通信(杭州)有限公司 A kind of image display control method and terminal
CN110769156A (en) * 2019-10-31 2020-02-07 维沃移动通信有限公司 Image display method and electronic device
CN110868541B (en) * 2019-11-19 2021-04-20 展讯通信(上海)有限公司 Visual field fusion method and device, storage medium and terminal
CN111641775B (en) * 2020-04-14 2021-10-01 北京迈格威科技有限公司 Multi-camera zoom control method, device and electronic system

Also Published As

Publication number Publication date
CN113055592A (en) 2021-06-29

Similar Documents

Publication Publication Date Title
US10430075B2 (en) Image processing for introducing blurring effects to an image
RU2629436C2 (en) Method and scale management device and digital photographic device
WO2022083229A1 (en) Image processing method, electronic device, and nonvolatile computer readable storage medium
US20130265311A1 (en) Apparatus and method for improving quality of enlarged image
CN112684966B (en) Picture zooming method and device and electronic equipment
CN105933601A (en) Method, apparatus, and computer program product for presenting burst images
WO2013024446A2 (en) Apparatus and method for generating image data
US11233935B2 (en) Multi-camera post-capture image processing
CN103702032B (en) Image processing method, device and terminal equipment
WO2021218016A1 (en) Picture cropping method and apparatus, computer device, and storage medium
CN111641777A (en) Image processing method, image processing apparatus, image processor, electronic device, and storage medium
CN112995511A (en) Camera switching method and device, electronic equipment and storage medium
CN107870703B (en) Method, system and terminal equipment for full-screen display of picture
CN104320590A (en) Split-screen image processing method and device and client terminal
CN107864335A (en) Image preview method, apparatus, computer-readable recording medium and electronic equipment
CN112367481A (en) Video clip processing method and device
US20250097568A1 (en) Shooting method and apparatus
US12368949B2 (en) Photographing method and apparatus, electronic device and readable storage medium
KR20080104546A (en) Actual size preview system and control method in terminal with digital camera function
CN114745502A (en) Shooting method and device, electronic equipment and storage medium
CN113055592B (en) Image display method and device, electronic equipment and computer readable storage medium
TWI676113B (en) Preview method and device in iris recognition process
CN116095249B (en) Video processing method and electronic equipment
RU2509377C2 (en) Method and system for image viewing on display device
RU2792413C1 (en) Image processing method and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant