CN113747058B - Image content shielding method and device based on multi-camera - Google Patents
Image content shielding method and device based on multi-camera Download PDFInfo
- Publication number
- CN113747058B CN113747058B CN202110849366.6A CN202110849366A CN113747058B CN 113747058 B CN113747058 B CN 113747058B CN 202110849366 A CN202110849366 A CN 202110849366A CN 113747058 B CN113747058 B CN 113747058B
- Authority
- CN
- China
- Prior art keywords
- image
- electronic device
- shooting
- camera
- user
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/222—Studio circuitry; Studio devices; Studio equipment
- H04N5/262—Studio 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/2624—Studio 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 for obtaining an image which is composed of whole input images, e.g. splitscreen
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/222—Studio circuitry; Studio devices; Studio equipment
- H04N5/262—Studio 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/265—Mixing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/45—Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from two or more image sensors being of different type or operating in different modes, e.g. with a CMOS sensor for moving images in combination with a charge-coupled device [CCD] for still images
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/57—Mechanical or electrical details of cameras or camera modules specially adapted for being embedded in other devices
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
本申请实施例提供了一种基于多摄像头的图像内容屏蔽方法和装置。该方法可应用在手机、平板电脑等具备拍摄能力的电子设备上。实施本申请实施例提供的基于多摄像头的图像内容屏蔽方法,手机、平板电脑等电子设备可以通过两个或两个以上的摄像头采集具有视觉差的图像。然后,该电子设备可基于上述视觉差,对不同摄像头采集的图像进行剪切和替换,从而屏蔽图像中用户不期望出现的内容,以提升用户的拍摄体验。
Embodiments of the present application provide a method and device for masking image content based on multiple cameras. The method can be applied to electronic devices capable of shooting, such as mobile phones and tablet computers. By implementing the multi-camera-based image content masking method provided in the embodiment of the present application, electronic devices such as mobile phones and tablet computers can collect images with visual difference through two or more cameras. Then, the electronic device can cut and replace the images captured by different cameras based on the above-mentioned visual difference, so as to shield the content that the user does not expect to appear in the images, so as to improve the shooting experience of the user.
Description
技术领域technical field
本申请涉及终端领域,尤其涉及基于多摄像头的图像内容屏蔽方法和装置。The present application relates to the field of terminals, in particular to a method and device for masking image content based on multiple cameras.
背景技术Background technique
目前,用户使用手机等电子设备进行自拍的需求旺盛,因此还带来了自拍杆的出现。自拍杆有效地解决了自拍时构图受限的问题,尤其是在户外运动、多人自拍或者全身自拍的场景下。但是,使用自拍杆拍照也产生了新的问题:自拍杆出现在自拍照片中,影响用户体验。At present, users have a strong demand for taking selfies with electronic devices such as mobile phones, which has also brought about the emergence of selfie sticks. The selfie stick effectively solves the problem of limited composition when taking selfies, especially in outdoor sports, multi-person selfies or full-body selfies. However, using a selfie stick to take pictures also creates new problems: the selfie stick appears in selfie photos, which affects user experience.
发明内容Contents of the invention
本申请提供了基于多摄像头的图像内容屏蔽方法和装置。该方法可应用在手机、平板电脑等具备拍摄能力的电子设备上。实施上述方法,手机、平板电脑等电子设备可以对两个或两个以上的摄像头采集具有视觉差的一组图像进行拼接,从而得到屏蔽特定图像内容的图像,以提升用户的拍摄体验。The present application provides a method and device for masking image content based on multiple cameras. The method can be applied to electronic devices capable of shooting, such as mobile phones and tablet computers. By implementing the above method, electronic devices such as mobile phones and tablet computers can splice a group of images with visual difference collected by two or more cameras, so as to obtain images with specific image content shielded, so as to improve the user's shooting experience.
第一方面,本申请提供了一种图像内容屏蔽方法,该方法应用于具备摄像头的电子设备,该方法包括:获取一组图像帧,一组图像帧至少包括第一图像、第二图像,第一图像和第二图像分别是电子设备的第一摄像头和第二摄像头在同一时刻采集的,第一摄像头和第二摄像头同时为电子设备的前置摄像头或后置摄像头;利用第二图像中的图像内容替换第一图像中的第一物体得到第三图像;显示第三图像。In a first aspect, the present application provides a method for masking image content, the method is applied to an electronic device equipped with a camera, and the method includes: acquiring a group of image frames, a group of image frames at least including a first image, a second image , the first image and the second image are respectively collected by the first camera and the second camera of the electronic device at the same time, and the first camera and the second camera are both the front camera or the rear camera of the electronic device; using the second image Replace the first object in the first image with the content of the image in to obtain a third image; display the third image.
实施第一方面提供的方法,电子设备可以同时使用多个前置摄像头或后置摄像头采集具有视觉差的一组图像帧。多个前置摄像头或后置摄像头在同一时刻采集的图像天然的具有视觉差,使用由于视觉差产生的图像对待屏蔽内容进行填补可以尽可能保留被待屏蔽内容遮挡的图像特征,提升屏蔽效果。同时,利用视觉差图像进行拼接来屏蔽某些图像内容可以降低计算量,提升处理效率。By implementing the method provided in the first aspect, the electronic device can simultaneously use multiple front cameras or rear cameras to collect a group of image frames with visual difference. The images captured by multiple front cameras or rear cameras at the same time naturally have parallax. Using the images caused by parallax to fill in the content to be blocked can preserve the image features blocked by the content to be blocked as much as possible and improve the shielding effect. At the same time, using parallax image stitching to mask some image content can reduce the amount of calculation and improve processing efficiency.
结合第一方面的实施例,在一些实施例中,利用第二图像中的图像内容替换第一图像中的第一物体得到第三图像,具体包括:利用第二图像中第一区域的图像内容替换第一图像中第二区域的图像内容得到第三图像,第二区域为第一图像中显示第一物体的区域,第一区域与第二区域对应。With reference to the embodiment of the first aspect, in some embodiments, using the image content in the second image to replace the first object in the first image to obtain the third image specifically includes: using the image content in the first region in the second image The third image is obtained by replacing the image content of the second area in the first image, the second area is an area displaying the first object in the first image, and the first area corresponds to the second area.
结合第一方面的实施例,在一些实施例中,第一区域与第二区域对应,包括:第一区域与第二区域大小相同,且位置相同;或,第一区域大于第二区域,第一区域的中心位置与第二区域的中心位置相同,且第一区域覆盖第二区域。With reference to the embodiments of the first aspect, in some embodiments, the first area corresponds to the second area, including: the first area and the second area have the same size and the same position; or, the first area is larger than the second area, and the second area The central position of the first area is the same as the central position of the second area, and the first area covers the second area.
实施上述实施例提供的方法,第一区域可以刚好与第一物体对应的区域相同,即与第二区域相同,这样,电子设备可以使用第一区域的图像内容填补待屏蔽的第一物体。第一区域还可以比第二区域大,这样,第一区域不仅可以填补第二区域中的第一物体,还可避免屏蔽不完全引起的边缘锯齿现象,提升屏蔽效果。Implementing the method provided by the above embodiment, the first area may be exactly the same as the area corresponding to the first object, that is, the same as the second area, so that the electronic device may use the image content of the first area to fill the first object to be masked. The first area can also be larger than the second area. In this way, the first area can not only fill the first object in the second area, but also avoid edge jaggedness caused by incomplete shielding, and improve the shielding effect.
结合第一方面的实施例,在一些实施例中,在获取一组图像帧之前,该方法还包括:检测到第一用户操作。With reference to the embodiment of the first aspect, in some embodiments, before acquiring a group of image frames, the method further includes: detecting a first user operation.
实施上述实施例提供的方法,电子设备可以检测用户的操作,响应于该操作,电子设备可执行本申请提供的图像屏蔽算法。这样,电子设备可以根据用户需求执行该图像屏蔽算法,提升图像屏蔽功能应用的针对性,降低电子设备的无效计算。By implementing the methods provided in the foregoing embodiments, the electronic device can detect a user's operation, and in response to the operation, the electronic device can execute the image masking algorithm provided in this application. In this way, the electronic device can execute the image masking algorithm according to the needs of the user, thereby improving the application pertinence of the image masking function and reducing invalid calculations of the electronic device.
结合第一方面的实施例,在一些实施例中,第一用户操作为:图像拍摄操作。With reference to the embodiment of the first aspect, in some embodiments, the first user operation is: an image capture operation.
实施上述实施例提供的方法,电子设备可在检测到用户的拍摄操作后,再实施本申请提供的图像内容屏蔽方法。By implementing the methods provided in the foregoing embodiments, the electronic device may implement the image content shielding method provided in the present application after detecting the user's shooting operation.
结合第一方面的实施例,在一些实施例中,图像拍摄操作包括:电子设备检测到的图像拍摄操作,和/或,第二设备检测到的图像拍摄操作;电子设备检测到的图像拍摄操作包括:作用于拍摄控件的操作,和,作用在按键上的操作,拍摄控件显示在电子设备提供的用户界面上,第二设备与第一设备相连。With reference to the embodiment of the first aspect, in some embodiments, the image capturing operation includes: an image capturing operation detected by the electronic device, and/or, an image capturing operation detected by the second device; an image capturing operation detected by the electronic device Including: the operation acting on the shooting control, and, the operation acting on the button, the shooting control is displayed on the user interface provided by the electronic device, and the second device is connected to the first device.
结合第一方面的实施例,在一些实施例中,第二设备在第一图像中的成像为第一物体。With reference to the embodiments of the first aspect, in some embodiments, the imaging of the second device in the first image is the first object.
结合第一方面的实施例,在一些实施例中,显示第三图像,具体包括:响应于第一用户操作,保存第三图像;检测到第二用户操作,显示第三图像或第三图像的缩略图。With reference to the embodiment of the first aspect, in some embodiments, displaying the third image specifically includes: saving the third image in response to the first user operation; detecting the second user operation, displaying the third image or the third image thumbnail.
实施上述实施例提供的方法,响应于第一用户操作,电子设备可保存第三图像,然后,电子设备可以检测第二用户操作,响应于该操作,电子设备可显示该第三图像。Implementing the method provided by the above embodiment, in response to the first user operation, the electronic device can save the third image, then, the electronic device can detect the second user operation, and in response to the operation, the electronic device can display the third image.
结合第一方面的实施例,在一些实施例中,第二用户操作包括:在图库应用中显示第三图像的操作,或,第三方应用程序调用第三图像的操作。With reference to the embodiment of the first aspect, in some embodiments, the second user operation includes: an operation of displaying the third image in the gallery application, or an operation of invoking the third image by a third-party application program.
实施上述实施例提供的方法,在浏览图库应用程序的场景下,电子设备可显示该第三图像;在调用图库中存储的图像发送给其他电子设备的过程中,电子设备可显示该第三图像。Implementing the method provided by the above embodiment, in the scene of browsing the gallery application program, the electronic device can display the third image; in the process of calling the image stored in the gallery and sending it to other electronic devices, the electronic device can display the third image .
结合第一方面的实施例,在一些实施例中,第一用户操作为:打开拍摄预览界面的操作。With reference to the embodiment of the first aspect, in some embodiments, the first user operation is an operation of opening a shooting preview interface.
实施上述实施例提供的方法,电子设备可在检测到用户的调用摄像头进行拍摄的操作后,就实施本申请提供的图像内容屏蔽方法。By implementing the methods provided in the foregoing embodiments, the electronic device may implement the image content shielding method provided in the present application after detecting the user's operation of invoking the camera for shooting.
结合第一方面的实施例,在一些实施例中,打开拍摄预览界面的操作包括:从第一应用程序图标进入拍摄预览界面的操作,第一应用程序为电子设备提供的应用程序;或,从第三方应用程序提供的第一控件进入拍摄预览界面的操作。With reference to the embodiment of the first aspect, in some embodiments, the operation of opening the shooting preview interface includes: the operation of entering the shooting preview interface from the first application program icon, and the first application program is an application program provided by the electronic device; or, from The first control provided by the third-party application program enters the operation of the shooting preview interface.
实施上述实施例提供的方法,在检测到用户打开相机应用程序的场景下,电子设备可实施本申请提供的图像内容屏蔽方法。在运行其他应用程序的场景下,在检测到调用电子设备的摄像头后,电子设备可实施本申请提供的图像内容屏蔽方法。Implementing the methods provided in the foregoing embodiments, the electronic device may implement the image content shielding method provided in the present application in a scenario where it is detected that the user opens the camera application. In the scenario of running other application programs, after detecting that the camera of the electronic device is invoked, the electronic device can implement the image content shielding method provided by the present application.
结合第一方面的实施例,在一些实施例中,在检测到第一用户操作之后,该方法还包括:显示拍摄预览界面,拍摄预览界面包括预览窗,预览窗用于实时显示电子设备的摄像头采集的图像;显示第三图像,具体包括:在预览窗中显示第三图像。With reference to the embodiment of the first aspect, in some embodiments, after the first user operation is detected, the method further includes: displaying a shooting preview interface, the shooting preview interface includes a preview window, and the preview window is used to display the camera of the electronic device in real time The collected image; displaying the third image specifically includes: displaying the third image in a preview window.
实施上述实施例提供的方法,电子设备可以在显示拍摄预览界面时,就在预览窗显示屏蔽处理后的图像。这样,用户在拍摄之前就可以看到屏蔽处理后的拍摄效果。By implementing the method provided in the foregoing embodiments, the electronic device can display the masked image in the preview window when displaying the shooting preview interface. In this way, the user can see the shooting effect after masking processing before shooting.
结合第一方面的实施例,在一些实施例中,第二设备为自拍杆,第一物体为图像中的自拍杆。With reference to the embodiments of the first aspect, in some embodiments, the second device is a selfie stick, and the first object is the selfie stick in the image.
实施上述实施例提供的方法,电子设备可以在预览窗或拍摄的照片或录像中屏蔽图像中出现的自拍杆,从而提升用户的拍摄体验。By implementing the method provided in the foregoing embodiments, the electronic device can shield the selfie stick appearing in the image in the preview window or in the captured photo or video, thereby improving the user's shooting experience.
结合第一方面的实施例,在一些实施例中,自拍杆包括杆体和夹持部,第一物体为图像中的自拍杆,具体包括:第一物体为图像中的自拍杆的杆体。With reference to the embodiments of the first aspect, in some embodiments, the selfie stick includes a stick body and a clamping part, and the first object is the selfie stick in the image, specifically including: the first object is the stick body of the selfie stick in the image.
第二方面,本申请提供了一种电子设备,该电子设备包括一个或多个处理器和一个或多个存储器;其中,一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。In a second aspect, the present application provides an electronic device, which includes one or more processors and one or more memories; wherein, one or more memories are coupled with one or more processors, and one or more The memory is used to store computer program codes. The computer program codes include computer instructions. When one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation manner of the first aspect.
第三方面,本申请提供一种计算机可读存储介质,包括指令,当上述指令在电子设备上运行时,使得上述电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。In a third aspect, the present application provides a computer-readable storage medium, including instructions. When the above-mentioned instructions are run on an electronic device, the above-mentioned electronic device executes the method described in the first aspect and any possible implementation manner of the first aspect. method.
第四方面,本申请提供一种包含指令的计算机程序产品,当上述计算机程序产品在电子设备上运行时,使得上述电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。In a fourth aspect, the present application provides a computer program product containing instructions. When the above-mentioned computer program product is run on an electronic device, the above-mentioned electronic device is executed as described in the first aspect and any possible implementation manner of the first aspect. method.
可以理解地,上述第二方面提供的电子设备、第三方面提供的计算机存储介质、第四方面提供的计算机程序产品均用于执行本申请所提供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。It can be understood that the above-mentioned electronic device provided in the second aspect, the computer storage medium provided in the third aspect, and the computer program product provided in the fourth aspect are all used to execute the method provided in the present application. Therefore, the beneficial effects that it can achieve can refer to the beneficial effects in the corresponding method, and will not be repeated here.
附图说明Description of drawings
图1是本申请实施例提供的电子设备的示意图;FIG. 1 is a schematic diagram of an electronic device provided by an embodiment of the present application;
图2是本申请实施例提供的一组具有视觉差的图像;Fig. 2 is a group of images with visual difference provided by the embodiment of the present application;
图3A-图3C是本申请实施例提供的一组用户界面;3A-3C are a set of user interfaces provided by the embodiment of the present application;
图4是本申请实施例提供的一种屏蔽图像内容的流程图;FIG. 4 is a flow chart of masking image content provided by an embodiment of the present application;
图5是本申请实施例提供的电子设备获取一组具有视觉差的图像的示意图;Fig. 5 is a schematic diagram of an electronic device provided by an embodiment of the present application acquiring a set of images with visual difference;
图6A是本申请实施例提供的电子设备识别图像中自拍杆的示意图;FIG. 6A is a schematic diagram of a selfie stick in an electronic device recognition image provided by an embodiment of the present application;
图6B、图6C是本申请实施例提供的编码器和解码器的结构图;FIG. 6B and FIG. 6C are structural diagrams of encoders and decoders provided by the embodiments of the present application;
图7是本申请实施例提供的一种屏蔽图像内容的示意图;FIG. 7 is a schematic diagram of masking image content provided by an embodiment of the present application;
图8是本申请实施例提供的电子设备的硬件结构图。FIG. 8 is a hardware structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application.
随着手机、平板电脑等移动智能终端拍摄能力的提升,尤其是景深摄像头(depthof field,DOF)、TOF(Time of flight)摄像头等具备深感能力(Deep ability)的摄像头在移动智能终端上的应用,手机、平板电脑等移动智能终端已经可以拍摄包含深度信息的图像,例如RGBD类型的图像。上述具备深感能力的摄像头可称为深感摄像头(Deep sensecamera)。With the improvement of the shooting capabilities of mobile smart terminals such as mobile phones and tablet computers, especially the depth of field cameras (depth of field, DOF), TOF (Time of flight) cameras and other cameras with deep ability (Deep ability) on mobile smart terminals Applications, mobile smart terminals such as mobile phones and tablet computers can already capture images containing depth information, such as RGBD images. The aforementioned camera capable of deep sensing may be referred to as a deep sense camera.
深感摄像头拍摄的图像可包括图像中物体的深度信息。图像处理模块可根据上述深度信息生成自拍杆的3D模型,进而,确定自拍图像中的自拍杆区域。然后,图像处理模块可对自拍杆区域进行屏蔽处理,从而使得用户得到的图像中不出现自拍杆,提升用户的拍摄体验。Images captured by the depth-sensing camera may include depth information of objects in the image. The image processing module can generate a 3D model of the selfie stick according to the above depth information, and then determine the area of the selfie stick in the selfie image. Then, the image processing module can shield the area of the selfie stick, so that the selfie stick does not appear in the image obtained by the user, thereby improving the shooting experience of the user.
然而,使用深感摄像头屏蔽自拍杆的方法需要付出的计算成本较大。特别的,若将该方法应用在视频类型的图像处理中,电子设备的计算量增长显著。相应地,计算的时间成本也明显增加。对用户而言,较长的计算时间极其影响用户的使用体验。However, the method of shielding the selfie stick with a depth-sensing camera requires a large computational cost. In particular, if the method is applied to video-type image processing, the calculation amount of electronic equipment will increase significantly. Correspondingly, the time cost of calculation is also significantly increased. For users, long computing time greatly affects user experience.
因此,为了避免自拍杆等用户不期望出现在图中的内容出现在照片或视频中影响用户拍摄体验,同时,降低图像处理的计算量,降低计算的时间成本,本申请实施例提供了一种基于多摄像头的图像内容屏蔽方法。该方法可应用在手机、平板电脑等具备拍摄能力的电子设备上。Therefore, in order to prevent content that users do not expect to appear in pictures or videos, such as selfie sticks, from affecting the user's shooting experience, and at the same time reduce the amount of calculations for image processing and the time cost of calculations, the embodiment of the present application provides a Image content masking method based on multiple cameras. The method can be applied to electronic devices capable of shooting, such as mobile phones and tablet computers.
实施该方法,手机、平板电脑等电子设备(电子设备100)可以通过两个或两个以上的摄像头采集图像。由于不同摄像头的空间位置不同,因此,不同摄像头采集的同一时刻的图像具有视觉差。进而,电子设备100可基于上述视觉差,对不同摄像头采集的图像进行剪切和替换,从而屏蔽图像中用户不期望出现的部分内容,提升用户的拍摄体验。By implementing this method, electronic devices such as mobile phones and tablet computers (electronic device 100 ) can collect images through two or more cameras. Because the spatial positions of different cameras are different, the images collected by different cameras at the same moment have visual difference. Furthermore, the electronic device 100 can cut and replace the images collected by different cameras based on the above-mentioned visual difference, so as to shield some content in the images that the user does not expect to appear, and improve the user's shooting experience.
同时,由于被处理的图像为普通的不包括深度信息的图像,因此,电子设备100进行屏蔽处理的计算量显著减少,时间成本也相应地显著降低。因此,该方法在视频类型的图像处理中也适用。At the same time, since the image to be processed is an ordinary image that does not include depth information, the calculation amount of the electronic device 100 for masking processing is significantly reduced, and the time cost is correspondingly significantly reduced. Therefore, the method is also applicable in video-type image processing.
以手机A为电子设备100为例,图1示例性示出了手机A的示意图。Taking mobile phone A as the electronic device 100 as an example, FIG. 1 exemplarily shows a schematic diagram of mobile phone A. As shown in FIG.
如图1所示,手机A包括两个摄像头,分别为cam1和cam2。上述cam1和cam2可以为手机A的一组前置摄像头,或一组后置摄像头。As shown in Figure 1, mobile phone A includes two cameras, namely cam1 and cam2. The above cam1 and cam2 may be a group of front cameras of mobile phone A, or a group of rear cameras.
在本申请实施例中,cam1和cam2可以为标准镜头。在启用前置摄像头进行拍摄时,cam1和cam2均可采集图像,并产生时序的图像帧流。cam1生成的图像帧流可称为stream1;cam2生成的图像帧流可称为stream2。当cam1和cam2为标准镜头时,cam1和cam2采集的图像为RGB类型的图像。In this embodiment of the application, cam1 and cam2 may be standard lenses. When the front camera is enabled for shooting, both cam1 and cam2 can collect images and generate a time-series image frame stream. The image frame stream generated by cam1 can be called stream1; the image frame stream generated by cam2 can be called stream2. When cam1 and cam2 are standard lenses, the images captured by cam1 and cam2 are RGB images.
优选的,上述cam1和cam2为彩色摄像头。不限于彩色摄像头,cam1和cam2还可以是黑白摄像头。例如,cam1可以为彩色摄像头,cam2可以为黑白摄像头;或者cam1可以为黑白摄像头,cam2可以为彩色摄像头。此外,不限于cam1和cam2,手机A还可包括更多的摄像头。这里,更多的摄像头包括:更多的前置摄像头,和/或,更多的后置摄像头。进一步的,上述更多的摄像头可以为:标准镜头、广角镜头、长焦镜头、潜望式变焦镜头、景深镜头等。本申请实施例对此不做限制。Preferably, the above cam1 and cam2 are color cameras. Not limited to color cameras, cam1 and cam2 can also be black and white cameras. For example, cam1 may be a color camera, and cam2 may be a black and white camera; or cam1 may be a black and white camera, and cam2 may be a color camera. In addition, not limited to cam1 and cam2, cell phone A may include more cameras. Here, more cameras include: more front cameras, and/or, more rear cameras. Further, the above-mentioned more cameras may be: standard lens, wide-angle lens, telephoto lens, periscope zoom lens, depth-of-field lens, etc. This embodiment of the present application does not limit this.
相应地,对于不同类型的摄像头,该摄像头采集的图像包括的信息不同。例如,当手机A还包括景深镜头时,手机A通过景深镜头可获取到RGBD类型的图像。RGBD类型的图像可记录有图像中物体的深度信息。Correspondingly, for different types of cameras, the images collected by the cameras include different information. For example, when the mobile phone A also includes a depth-of-field lens, the mobile phone A can obtain RGBD images through the depth-of-field lens. An image of the RGBD type can record depth information of an object in the image.
cam1和cam2之间间距为D。基于间距D,cam1和cam2采集的图像存在视觉差,参考双目视觉原理。图2示例性示出了不同摄像头采集的图像存在视觉差的示意图。The distance between cam1 and cam2 is D. Based on the distance D, there is a visual difference between the images collected by cam1 and cam2, refer to the principle of binocular vision. FIG. 2 exemplarily shows a schematic diagram of visual differences in images collected by different cameras.
图2包括(左)图和(右)图。(左)图为cam1采集的一帧图像;(右)图为同一时刻cam2采集的一帧图像。(左)图和(右)图中的内容均包括自拍杆10、人物20。Figure 2 includes (left) and (right) graphs. (Left) is a frame of image collected by cam1; (right) is a frame of image collected by cam2 at the same time. The contents in the (left) and (right) figures both include the
在(左)图中,自拍杆10在图像中心偏左的位置,遮盖了用户的右腿。在(右)图中,自拍杆10在图像的中心位置,在用户的左右腿之间。上述自拍杆10在(左)图和(右)图中处于不同位置即体现了:不同摄像头在同一时刻采集的图像存在视觉差。In the image (left), the
基于上述视觉差,在获取多帧具有视觉差的图像后,手机A可以对上述多帧具有视觉差的图像进行拼接,将上述多帧具有视觉差的图像融合为一张屏蔽了自拍杆的图像。上述融合后的图像可称为输出图像。在得到输出图像后,手机A可以将该图像存储下来,供用户进一步操作。上述操作包括编辑、浏览等等。Based on the above parallax, after acquiring multiple frames of images with parallax, mobile phone A can stitch the above multiple frames of images with parallax, and fuse the above multiple frames of images with parallax into an image that shields the selfie stick . The above fused image may be referred to as an output image. After obtaining the output image, mobile phone A can store the image for further operation by the user. The above operations include editing, browsing, and so on.
可以理解的,当间距D较小时,即cam1和cam2靠近,cam1和cam2的取景范围相差很小。这时,cam1和cam2在同一时刻采集的图像的视觉差较小。当间距D较大时,cam1和cam2的取景范围相差较大。这时,cam1和cam2在同一时刻采集的图像的视觉差较大。It can be understood that when the distance D is small, that is, cam1 and cam2 are close to each other, the difference between the viewing ranges of cam1 and cam2 is very small. At this time, the visual difference between the images collected by cam1 and cam2 at the same time is relatively small. When the distance D is large, the viewing ranges of cam1 and cam2 differ greatly. At this time, the visual difference between the images collected by cam1 and cam2 at the same time is relatively large.
这也就是说,对于手机A来说,当手机A中安装的cam1和cam2具有较大的间距时,其采集的图像之间的视觉差更显著。因此,基于视觉差屏蔽自拍杆的效果更好。That is to say, for mobile phone A, when the distance between cam1 and cam2 installed in mobile phone A is relatively large, the visual difference between the captured images is more significant. Therefore, the effect of shielding selfie sticks based on parallax is better.
在其他实施例中,当手机A具备更多的摄像头时,手机A可以获取更多的图像帧(同一时刻的),且上述图像帧两两之间具有视觉差。这样,手机A可以对上述更多的图像进行融合,从而提升屏蔽效果。In other embodiments, when the mobile phone A has more cameras, the mobile phone A can acquire more image frames (at the same moment), and there is a visual difference between any two of the above image frames. In this way, mobile phone A can fuse more of the above images, thereby improving the shielding effect.
可以理解的,当上述cam1和cam2同为前置摄像头时,这里的更多的摄像头是指更多的前置摄像头;更多的图像帧是指上述更多的前置摄像头采集的图像。反之,当上述cam1和cam2同为后置摄像头时,这里的更多的摄像头是指更多的后置摄像头;更多的图像帧是指上述更多的后置摄像头采集的图像。It can be understood that when the aforementioned cam1 and cam2 are both front-facing cameras, more cameras here refer to more front-facing cameras; more image frames refer to images collected by the above-mentioned more front-facing cameras. Conversely, when the aforementioned cam1 and cam2 are both rear cameras, more cameras here refer to more rear cameras; more image frames refer to images collected by the above more rear cameras.
不限于手机,电子设备100还包括平板电脑、智能手表、智能手环、运动相机、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备等具备拍摄能力的便携式手持设备。电子设备100的示例性实施例包括但不限于搭载 Linux或者其它操作系统的便携式电子设备。Not limited to mobile phones, the electronic device 100 also includes tablet computers, smart watches, smart bracelets, sports cameras, augmented reality (augmented reality, AR) devices, virtual reality (virtual reality, VR) devices and other portable handheld devices capable of shooting. Exemplary embodiments of the electronic device 100 include, but are not limited to Portable electronic devices with Linux or other operating systems.
图3A-图3C示例性示出了一组拍照场景下的用户界面。下面,结合图3A-图3C所示的用户界面,介绍实施本申请实施例提供的基于多摄像头的图像内容屏蔽方法的场景。在图3A-图3C所述的实施例中,拍摄场景为自拍场景,用户期望屏蔽的图像内容为自拍杆。3A-3C exemplarily show user interfaces in a group of camera-taking scenarios. Next, with reference to the user interface shown in FIG. 3A-FIG. 3C , a scenario of implementing the method for masking image content based on multiple cameras provided by the embodiment of the present application is introduced. In the embodiment described in FIG. 3A-FIG. 3C, the shooting scene is a selfie scene, and the image content that the user desires to mask is a selfie stick.
电子设备100可检测到调用摄像头显示拍摄预览界面的用户操作,响应于该操作,电子设备100可显示图3A所示的拍摄预览界面。The electronic device 100 may detect a user operation of invoking the camera to display a shooting preview interface, and in response to the operation, the electronic device 100 may display the shooting preview interface shown in FIG. 3A .
上述调用摄像头显示拍摄预览界面的用户操作包括:作用于电子设备100自带的相机应用程序图标的操作,和作用于第三方应用提供的拍摄控件的操作。上述第三方应用提供的拍摄控件例如提供的拍照控件、视频通话控件等等。The above-mentioned user operation of invoking the camera to display the shooting preview interface includes: an operation acting on the camera application icon of the electronic device 100, and an operation acting on the shooting control provided by the third-party application. The shooting controls provided by the above-mentioned third-party applications are, for example, Provided photo control, video call control and so on.
图3A示出了使用电子设备100显示拍摄预览界面的用户界面31。如图3A所示,用户界面31包括预览窗311、模式栏312、拍摄按钮313、图像预览窗314。FIG. 3A shows a user interface 31 using the electronic device 100 to display a shooting preview interface. As shown in FIG. 3A , the user interface 31 includes a
预览窗311可用于实时显示摄像头采集的图像。这里,在预览窗311显示的图像可称为原始图像。可以理解的原始图像也经过了图像处理模块的一些基础处理,例如色温校准、线性纠正、噪声去除、坏点去除、内插、自动曝光控制等。但是,上述基础处理操作均为光信号转变为电信号并在手机等电子设备上成像所必须经过的处理。因此,在本申请实施例中,经过上述基础的图像处理并在预览窗311中显示的图像可称为原始图像。The
模式栏312可用于选择拍摄模式。上述拍摄模式包括:夜景模块、人像模式、拍照模式、录像模式、专业模式等等。在图3A-图3C示出的拍照场景下的用户界面中,电子设备100正处理拍照模式中。The
拍摄按钮313可用于接收用户拍摄照片的操作。当检测到控制电子设备100拍摄的用户操作时,响应于该操作,电子设备100可确定此时预览窗311中显示的图像帧为拍摄图像。The
在确定预览窗311中显示的图像帧为拍摄图像后,电子设备100可将该拍摄图像存储至指定的存储空间。然后,电子设备100可在图像预览窗314中显示上述拍摄图片的缩略图。同时,电子设备100可接收作用于图像预览窗314的用户操作,为用户提供浏览拍摄图片的用户操作。After determining that the image frame displayed in the
用户界面31还可包括其他控件,例如,区域315提供的多个用户调节拍摄画面的控件、切换按钮316等。切换按钮316可用于变更电子设备100的摄像头(前置摄像头,或后置摄像头)。可以理解的,图3A所示的用户界面31为一种可能的用户界面,不应构成对本申请实施例的限制。The user interface 31 may also include other controls, for example, a plurality of controls provided in the
当检测到控制电子设备100拍摄的用户操作时,响应于该操作,电子设备100可显示图3B所示的用户界面32。在本申请实施例中,在用户使用自拍杆自拍的场景下,上述控制电子设备100拍摄的用户操作包括:作用于图3A中拍摄按钮313的操作,和作用在自拍杆上的拍摄按钮上的操作。When a user operation to control the shooting of the electronic device 100 is detected, in response to the operation, the electronic device 100 may display the user interface 32 shown in FIG. 3B . In the embodiment of the present application, in the scene where the user uses a selfie stick to take a selfie, the user operations for controlling the shooting of the electronic device 100 include: the operation acting on the
在其他实施例中,上述控制电子设备100拍摄还包括作用于电子设备100的实体按键的拍摄操作等等。In other embodiments, the above-mentioned control of the electronic device 100 to shoot also includes a shooting operation on a physical button of the electronic device 100 and the like.
此时,图像预览窗314可显示前一时刻响应于用户拍摄操作生成的拍摄图片的缩略图。然后,电子设备100可检测到作用于图像预览窗314的用户操作。响应于该操作,电子设备100可显示图3C所示的用户界面33。At this time, the
如图3C所示,用户界面33为电子设备100上展示拍摄的照片的用户界面。用户界面33包括区域331。区域331可用于显示用户拍摄的图像,包括单帧图像和多帧图像。其中,单帧图像例如照片;多帧图像包括视频、GIF动图等。As shown in FIG. 3C , the user interface 33 is a user interface on the electronic device 100 for displaying captured photos. User interface 33 includes
此外,用户界面33还可包括其他控件,例如控件332、控件333等等。响应于作用在控件332的操作,手机A可显示相册中的更多图片。响应于作用在控件333的操作,手机A可显示区域331中的图像的详细信息。上述详细信息例如:拍摄时间、拍摄位置、图像大小(存储空间占用量)、分辨率以及存储路径等。本申请实施例对此不做限制。In addition, the user interface 33 may also include other controls, such as a
对比预览窗311中的显示的图像和区域331中显示的拍摄后的图像,前者的图像中包括自拍杆10和人物20;后者的图仅包括人物20。这也就是说,在检测到用户的拍摄操作后,手机A可识别原始图像(即预览窗311中的显示的图像)中的自拍杆10,并将其从原始图像中去除,使得用户得到的照片中不包括自拍杆,进而提升用户的拍摄体验。Comparing the image displayed in the
在其他实施例中,在检测到用户的拍摄操作并生成屏蔽处理后的图像后,电子设备100并不会立即显示上述屏蔽处理后的图像。此时,电子设备100可检测用户调用该图像的操作,例如在图库中显示上述图像的操作,将上述图像发送给其他电子设备的操作等等。在执行上述调用该图像的操作的过程中,电子设备100可显示该图像或该图像的缩略图。In other embodiments, after the user's shooting operation is detected and the masked image is generated, the electronic device 100 does not immediately display the masked image. At this point, the electronic device 100 may detect the user's operation of invoking the image, such as an operation of displaying the above image in a gallery, an operation of sending the above image to other electronic devices, and so on. During the execution of the above operation of invoking the image, the electronic device 100 may display the image or a thumbnail of the image.
不限于图3A-图3C所述的拍照场景,本申请实施例提供的基于多摄像头的图像内容屏蔽方法还可应用于拍摄视频的场景。It is not limited to the shooting scene described in FIG. 3A-FIG. 3C , the multi-camera-based image content masking method provided in the embodiment of the present application can also be applied to the scene of shooting video.
在拍摄视频的场景下,在检测到用户开始拍摄的操作后,预览窗311中的显示的图像将会被手机A记录并存储(视频)。在拍摄完成后,手机A可在图像预览窗314显示拍摄的视频的摘要。这里,视频摘要包括:视频的封面图片,和/或,指示视频类型图像文件的标志,例如时间条、播放图标。In the scene of shooting a video, after the user's operation to start shooting is detected, the image displayed in the
在检测到作用于图像预览窗314的用户操作后,手机A可在区域331中显示上述用户拍摄的视频。在拍摄视频的过程中,预览窗311中显示的图像可包括自拍杆10和人物20。但是,手机A在区域331中显示的视频中,视频的图像可不包括自拍杆10。即,在拍摄完成后,手机A可识别视频中是否包括自拍杆10。若识别到自拍杆10,手机A可去除视频中的自拍杆10,然后将生成新的视频。在该视频中,视频中的内容不包括自拍杆10。After detecting the user's operation on the
手机A在录制视频的过程中虽然拍摄到了自拍杆,但是生成的视频文件中并不包括自拍杆。这样,用户可以直接得到屏蔽了自拍的自拍视频。Although mobile phone A captures the selfie stick during video recording, the generated video file does not include the selfie stick. In this way, the user can directly obtain the selfie video with the selfie blocked.
进一步的,在拍照场景中,或者在拍摄视频的场景中,手机A还可在预览窗311显示处理后的图像。具体的,在摄像头采集图像后,手机A即可对摄像头采集的图像进行屏蔽处理。然后,将屏蔽后的图像显示在预览窗311中。这样,拍摄完成后生成的视频与拍摄的过程中预览窗311中显示的图像流在图像内容上完全一致,即用户在拍摄过程中便能从预览窗311中看到屏蔽自拍后的拍摄效果,从而提升用户的拍摄体验。Further, in the scene of taking pictures or in the scene of shooting video, mobile phone A can also display the processed image in the
下面,结合图4介绍本申请实施例提供的基于多摄像头的图像内容屏蔽方法的流程。In the following, the flow of the multi-camera-based image content masking method provided by the embodiment of the present application is introduced with reference to FIG. 4 .
S101:电子设备100检测到用户正在使用摄像头进行拍摄。S101: The electronic device 100 detects that the user is using a camera to take pictures.
这里,使用摄像头进行拍摄包括使用前置摄像头进行自拍和使用后置摄像进行一般的拍摄。通常情况下,自拍杆出现在拍摄画面中往往发生在自拍场景中。Here, shooting with a camera includes taking a selfie with a front camera and general shooting with a rear camera. Usually, the appearance of the selfie stick in the shooting screen often occurs in the selfie scene.
因此,下面主要以自拍场景为例,介绍电子设备100确定用户正在使用摄像头自拍的场景。在本申请实施例中,自拍场景包括具体包括拍照(图像帧)和拍视频(图像帧流)。Therefore, the following mainly takes a selfie scene as an example to introduce a scene in which the electronic device 100 determines that the user is taking a selfie with a camera. In the embodiment of the present application, the selfie scene specifically includes taking a picture (image frame) and taking a video (image frame stream).
在自拍场景下,电子设备100的工作状态包括:运行具备拍摄功能的应用程序,且该应用正在调用电子设备100的前置摄像头。因此,电子设备100可通过前置摄像头是否处于工作状态判断用户是否正在自拍。In the Selfie scenario, the working state of the electronic device 100 includes: running an application program with a shooting function, and the application is calling the front camera of the electronic device 100 . Therefore, the electronic device 100 can determine whether the user is taking a selfie according to whether the front camera is in a working state.
前置摄像头处于工作状态可以指示自拍场景,但不一定指示使用自拍杆自拍的场景。因此,进一步的,电子设备100还可检测是否有自拍杆接入。当检测到已连接自拍杆时,电子设备100可确认用户正在使用自拍杆自拍。A working front camera may indicate a selfie scene, but not necessarily a selfie stick selfie scene. Therefore, further, the electronic device 100 may also detect whether a selfie stick is connected. When detecting that the selfie stick is connected, the electronic device 100 may confirm that the user is taking a selfie with the selfie stick.
具体的,电子设备100上设置有外接接口;自拍杆包括控制拍照的按钮和连接线。上述外接接口包括3.5mm耳机接口、Type-C接口、Lighting接口等。本申请实施例对此不做限制。自拍杆的连接线可与上述外接接口连接。然后,用户可通过自拍杆上的拍摄按钮控制电子设备100的拍摄任务。Specifically, the electronic device 100 is provided with an external interface; the selfie stick includes a button and a connection line for controlling taking pictures. The above external interfaces include 3.5mm headphone jack, Type-C interface, Lighting interface and so on. This embodiment of the present application does not limit this. The connecting wire of the selfie stick can be connected with the above-mentioned external interface. Then, the user can control the shooting task of the electronic device 100 through the shooting button on the selfie stick.
因此,在开启前置摄像头的情况下,当检测外接接口连接有其他设备时,电子设备100可确定用户正在使用自拍杆自拍。参考图3A,当电子设备100显示图3A所示的用户界面31时,电子设备100可确定用户正在处于自拍的场景。Therefore, when the front camera is turned on, when it is detected that other devices are connected to the external interface, the electronic device 100 can determine that the user is using the selfie stick to take a selfie. Referring to FIG. 3A , when the electronic device 100 displays the user interface 31 shown in FIG. 3A , the electronic device 100 may determine that the user is taking a selfie.
在自拍场景之外的其他拍摄场景下,电子设备100也可实施本申请实施例提供的基于多摄像头的图像内容屏蔽方法。例如,在拍摄单人照的场景中,用户可选择去除偶然出现在取景范围内的其他人物。这也就是说,拍摄的场景不限于自拍场景,也可以是使用后置摄像头的拍摄普通拍摄场景。其次,被屏蔽的对象不限于自拍杆,也可以是其他的预设的电子设备100可以识别的图像内容。本申请实施例对此不作限制。In shooting scenes other than the selfie scene, the electronic device 100 may also implement the multi-camera-based image content masking method provided in the embodiment of the present application. For example, in the scene of taking a single-person photo, the user can choose to remove other people who happen to appear in the viewfinder. That is to say, the shooting scene is not limited to the selfie scene, but also can be a normal shooting scene using the rear camera. Secondly, the shielded object is not limited to the selfie stick, and may also be other preset image content that can be recognized by the electronic device 100 . The embodiment of the present application does not limit this.
S102:电子设备100获取具有视觉差的一组图像帧。S102: The electronic device 100 acquires a group of image frames with parallax.
在识别到使用自拍杆自拍的场景后,电子设备100可启用本申请实施例提供的自拍杆屏蔽方法。这也就是说,实施本申请实施例提供的多摄像头的自拍杆屏蔽方法是可选的。After recognizing a scene where a selfie stick is used to take a selfie, the electronic device 100 may enable the selfie stick shielding method provided in the embodiment of the present application. That is to say, it is optional to implement the multi-camera selfie stick shielding method provided in the embodiment of the present application.
在一些实施例中,电子设备100可以在任何拍摄的场景均实施上述方法,识别并屏蔽图像中的自拍杆。在其他实施例中,电子设备100也可以对拍摄场景进行进一步的细化。在识别到预设的细化场景后,电子设备100再实施上述方法,识别并屏蔽图像中的自拍杆。例如,S101中介绍的确定用户处于自拍场景,或进一步的,确定用户处于使用自拍杆进行自拍的场景等等。In some embodiments, the electronic device 100 can implement the above-mentioned method in any shooting scene to identify and shield the selfie stick in the image. In other embodiments, the electronic device 100 may further refine the shooting scene. After identifying the preset detailed scene, the electronic device 100 implements the above method to identify and block the selfie stick in the image. For example, it is determined in S101 that the user is in the scene of taking a selfie, or further, it is determined that the user is in the scene of taking a selfie with a selfie stick, and so on.
这样,电子设备100可以针对性的开启该功能,避免计算资源滥用。In this way, the electronic device 100 can specifically enable this function to avoid abuse of computing resources.
在启用本申请实施例提供的多摄像头的自拍杆屏蔽方法后,电子设备100可获取同一时刻的不同摄像头采集的具有视觉差的一组图像帧。具体的,以自拍场景中,处于工作状态的cam1和cam2为例,图5示例性示出了cam1和cam2采集图像生成图像帧流的示意图。After the multi-camera selfie stick shielding method provided in the embodiment of the present application is enabled, the electronic device 100 can acquire a group of image frames with visual difference captured by different cameras at the same moment. Specifically, taking cam1 and cam2 in a working state in a selfie scene as an example, FIG. 5 exemplarily shows a schematic diagram of capturing images by cam1 and cam2 to generate an image frame stream.
如图5所示,stream1可表示cam1采集并生成的图像帧流;stream2可表示cam2采集并生成的图像帧流。stream1和stream2分别包括多个连续的图像帧,且stream1和stream2中的多个图像帧是时序对齐的。这里,时序对齐是指:stream1中的任意一张图像帧与stream2中对应位置上的图像帧的时间戳相同。即,stream1和stream2中相同位置上的图像帧分别为同一时刻的cam1和cam2采集的。As shown in FIG. 5 , stream1 may represent the image frame stream collected and generated by cam1; stream2 may represent the image frame stream collected and generated by cam2. stream1 and stream2 respectively include a plurality of consecutive image frames, and the plurality of image frames in stream1 and stream2 are aligned in time sequence. Here, time sequence alignment means that any image frame in stream1 has the same time stamp as the image frame at the corresponding position in stream2. That is, the image frames at the same position in stream1 and stream2 are respectively collected by cam1 and cam2 at the same time.
具体的,stream1包括图像帧T1、T2、T3、T4和T5;stream2包括图像帧S1、S2、S3、S4和S5。其中,T1和S1分别为cam1和cam2在同一时刻采集的图像。T2、T3、T4、T5和S2、S3、S4、S5的关系可参考上述T1和S1的介绍,这里不再赘述。Specifically, stream1 includes image frames T1, T2, T3, T4, and T5; stream2 includes image frames S1, S2, S3, S4, and S5. Wherein, T1 and S1 are images collected by cam1 and cam2 at the same time respectively. The relationship between T2, T3, T4, T5 and S2, S3, S4, S5 can refer to the introduction of T1 and S1 above, and will not be repeated here.
上述T1和S1可称为具有视觉差的一组图像帧。同样的,T2和S2、T3和S3、T4和S4、T5和S5分别为具有视觉差的一组图像帧。可以理解的,在使用更多摄像头拍摄时,电子设备100获取的具有视觉差的图像帧更多。The above T1 and S1 can be referred to as a group of image frames with parallax. Similarly, T2 and S2, T3 and S3, T4 and S4, T5 and S5 are respectively a group of image frames with visual difference. It can be understood that when more cameras are used for shooting, the electronic device 100 acquires more image frames with parallax.
这样,电子设备100可以方便快捷的获取具有视觉差的图像,而不需要用户调整手机A的位置,或移动自身的位置。In this way, the electronic device 100 can conveniently and quickly acquire images with visual difference without requiring the user to adjust the position of the mobile phone A or move its own position.
由于在非运动的拍摄状态下,连续的两帧或多帧的图像内容一般不会出现较大的差距。因此,电子设备100获取的具有视觉差的图像还可包括不同时刻摄像头采集的图像。Because in a non-moving shooting state, there is generally no large gap between the image contents of two or more consecutive frames. Therefore, the images with visual difference acquired by the electronic device 100 may also include images acquired by cameras at different times.
在其他实施例中,电子设备100还可获取连续的多帧图像作为一组图像帧,然后对上述多帧图像进行融合,得到屏蔽自拍杆或其他图像内容的图像。In other embodiments, the electronic device 100 may also acquire multiple consecutive frames of images as a group of image frames, and then fuse the multiple frames of images to obtain an image shielding the selfie stick or other image content.
上述连续的多帧图像包括:stream1中连续的两帧或两帧以上的图像,和stream2中两帧或两帧以上的图像。具体的,参考图5,上述连续的多帧图像例如:T1、T2、S1、S2,或者包括:T1、T2、T3、S1、S2、S3。The above-mentioned continuous multi-frame images include: two or more consecutive frames of images in stream1, and two or more consecutive frames of images in stream2. Specifically, referring to FIG. 5 , the above-mentioned continuous multi-frame images are, for example: T1, T2, S1, S2, or include: T1, T2, T3, S1, S2, S3.
这样,电子设备100可以获取更多的具有视觉差的图像,从而进一步提升屏蔽自拍杆等其他图像内容的屏蔽效果。In this way, the electronic device 100 can acquire more images with visual difference, thereby further improving the shielding effect of shielding other image contents such as the selfie stick.
下面,以T1和S1这组图像帧为例,介绍电子设备100利用上述图像帧屏蔽图像中部分图像内容的方法。结合图2,T1的图像内容可以参考图2中的(左)图;S1的图像内容可以参考图2中的(右)图。Next, taking the group of image frames T1 and S1 as an example, a method for the electronic device 100 to mask part of the image content in the image by using the above image frames is introduced. Referring to Figure 2, the image content of T1 can refer to the (left) picture in Figure 2; the image content of S1 can refer to the (right) picture in Figure 2.
S103:电子设备100定位图像帧T1中的自拍杆。S103: The electronic device 100 locates the selfie stick in the image frame T1.
在获取到T1和S1之后,电子设备100首先定位图像帧T1中的自拍杆。具体的,电子设备100可利用图像分割算法分别对T1进行图像分割,得到边缘图像(mask)。上述边缘图像是指:以图像内不同物体的边缘轮廓为边界,对图像内容进行标记区分的图像。After acquiring T1 and S1, the electronic device 100 first locates the selfie stick in the image frame T1. Specifically, the electronic device 100 may use an image segmentation algorithm to perform image segmentation on T1 respectively to obtain an edge image (mask). The above-mentioned edge image refers to an image in which image content is marked and distinguished by using edge contours of different objects in the image as boundaries.
图6A示例性示出了电子设备100对图像帧T1进行分割的示意图。如图6A所示,左侧的图像帧为电子设备100从cam1采集的图像帧流中获取的图像帧T1(stream1中的图像帧T1);右侧的图像可表示电子设备100对T1进行图像分割后得到的边缘图像(T1-mask)。FIG. 6A exemplarily shows a schematic diagram of dividing an image frame T1 by the electronic device 100 . As shown in FIG. 6A, the image frame on the left is the image frame T1 (image frame T1 in stream1) acquired by the electronic device 100 from the image frame stream collected by cam1; The edge image (T1-mask) obtained after segmentation.
利用图像分割算法,电子设备100可确定T1中包括的内容物,并确定各个内容物的边缘。以T1为例,T1中的图像内容包括:人物10和自拍杆20。通过图像分割,电子设备100得到的关于T1的边缘图像T1-mask的内容物包括:自拍杆601、人像602和背景603。Using an image segmentation algorithm, the electronic device 100 may determine contents included in T1, and determine edges of each contents. Taking T1 as an example, the image content in T1 includes: a
在本申请实施例中,电子设备100使用的图像分割算法为图像语义分割算法。该算法包括自编码器(encoder)和自解码器(decoder)。上述自编码器和自解码器是基于深度神经网络建立的。其中,自编码器是一种数据压缩算法,可用于提取输入图像的特征。自解码器是自编码器的反向重构,是对深层特征空间的反向解码。In the embodiment of the present application, the image segmentation algorithm used by the electronic device 100 is an image semantic segmentation algorithm. The algorithm includes self-encoder (encoder) and self-decoder (decoder). The above autoencoders and autodecoders are built based on deep neural networks. Among them, the autoencoder is a data compression algorithm that can be used to extract the features of the input image. The autodecoder is the reverse reconstruction of the autoencoder, which is the reverse decoding of the deep feature space.
图6B示出了自编码器的结构。如图6B所示,自编码器包括前端60和后端61。前端60包括三层卷积网络(conv2)。后端由Block1和Block2联合组成。其中,Block1包括两层卷积网络(conv2),Block2包括三层卷积网络(conv2)。Figure 6B shows the structure of the autoencoder. As shown in FIG. 6B , the autoencoder includes a
在图像分割这一过程中,电子设备100首先可将T1输入图像分割算法的自编码器,提取T1的图像特征。cam1和cam2生成的图像帧为三通道RGB图像。在经过自编码器的拆分重构和特征提取后,上述三通道RGB图像可转化为196通道的高维特征。In the process of image segmentation, the electronic device 100 may first input T1 into an autoencoder of the image segmentation algorithm to extract image features of T1. The image frames generated by cam1 and cam2 are three-channel RGB images. After the split reconstruction and feature extraction of the autoencoder, the above three-channel RGB image can be converted into a 196-channel high-dimensional feature.
图6C示出了自解码器的结构。如图6C所示,自解码器包括前端62和后端63。前端62包括三层上采样模块(upsample)。上采样模块包括三层卷积网络(conv2)和一层线性插值(linear interpolation)。后端63为一层卷积网络(conv2)。Fig. 6C shows the structure of the self-decoder. As shown in FIG. 6C , the self-decoder includes a
在通过自编码对T1进行重构后,电子设备100可将重构后T1输入到自解码器,对特征化的T1进行反向重构,从而将上述196通道的高维特征恢复成3通道的RGB图像,并在该图像中标记分割结果。After reconstructing T1 through self-encoding, the electronic device 100 can input the reconstructed T1 to the self-decoder, and reversely reconstruct the characterized T1, thereby restoring the above-mentioned 196-channel high-dimensional features into 3-channel RGB image, and mark the segmentation results in this image.
参考图6A,在将图像帧T1经过图像分割算法处理后,电子设备100可得到T1-mask所示的边缘图像。T1-mask中显示的图像内容包括:自拍杆601、人像602和背景603。进一步的,电子设备100就可以定位图片中的自拍杆601。Referring to FIG. 6A , after the image frame T1 is processed by the image segmentation algorithm, the electronic device 100 can obtain the edge image shown by T1-mask. The image content displayed in the T1-mask includes: a
可以理解的,图6B所示的自编码器、图6C所示的自解码器均为一种可能的自编码器结构和一种可能的自解码器结构,不应构成本申请实施例的限制。这也就是说,在其他实施例,自编码器和自解码器可具有不同的层级结构。这里,不同的层级结构包括不同数量的卷积层和不同方式的卷积层联合方式。It can be understood that the self-encoder shown in Figure 6B and the self-decoder shown in Figure 6C are both a possible self-encoder structure and a possible self-decoder structure, and should not constitute a limitation of the embodiment of the present application . That is to say, in other embodiments, the autoencoder and the autodecoder may have different hierarchical structures. Here, different hierarchical structures include different numbers of convolutional layers and different ways of combining convolutional layers.
此外,不限于本申请实施例使用的图像语义分割算法,电子设备100定位图像帧中的自拍杆还可使用其他的图像分割算法,例如基于特征编码的VGGnet、ResNet、基于区域选择的卷积神经网络(Region-based Convolutional Neural Network,R-CNN)以及传统的区域生长算法、基于边缘检测的分割方法等等。本申请实施例对此不作限制。In addition, not limited to the image semantic segmentation algorithm used in the embodiment of the present application, the electronic device 100 can also use other image segmentation algorithms to locate the selfie stick in the image frame, such as VGGnet based on feature coding, ResNet, convolutional neural network based on region selection Network (Region-based Convolutional Neural Network, R-CNN) and traditional region growing algorithms, segmentation methods based on edge detection, etc. The embodiment of the present application does not limit this.
S104:电子设备100使用图像帧S1替换T1中的自拍杆,得到屏蔽后的图像。S104: The electronic device 100 uses the image frame S1 to replace the selfie stick in T1 to obtain a masked image.
上述T1中的自拍杆501可称为屏蔽对象,即电子设备100需要去除的图像内容。S1中标记的与T1中自拍杆像素点位置对应的像素点区域可称为替换物料,即用于替换T1中的自拍杆的像素点区域。The selfie stick 501 in the above T1 may be called a shielding object, that is, the image content that the electronic device 100 needs to remove. The pixel area marked in S1 corresponding to the pixel position of the selfie stick in T1 may be called a replacement material, that is, the pixel area used to replace the selfie stick in T1.
图7示例性示出了电子设备100使用替换物料替换屏蔽对象的示意图。下面,结合图7说明上述替换过程。FIG. 7 exemplarily shows a schematic diagram of electronic device 100 replacing a shielded object with a replacement material. Next, the above replacement process will be described with reference to FIG. 7 .
首先,在确定T1中的自拍杆后,电子设备100可根据T1中自拍杆的像素点位置对S1进行切割,确定替换物料的像素点区域。First, after determining the selfie stick in T1, the electronic device 100 can cut S1 according to the pixel position of the selfie stick in T1, and determine the pixel point area of the replacement material.
如图7所示,根据自拍杆601在T1中所在的位置,电子设备100可在S1中标记相同位置的像素点,参考图像中S1'。S1为cam2采集的与T1同一时刻的具有视觉差的图像帧。前述实施例已经详细介绍过S1了,这里不再赘述。于是,电子设备100可确定区域60。区域60可表示替换物料,且区域60包括的像素点与T1中标记为自拍杆601的像素点一一对应。As shown in FIG. 7 , according to the position of the
然后,电子设备100可使用S1中标记为替换物料的图像内容替换T1中标记为自拍杆601的像素点。例如,电子设备100可将T1中标记为自拍杆601的图像内容消除,然后,将S1中区域60中的图像内容移入到T1中,这样,电子设备100可得到去除了自拍杆601的图像帧,如T1'所示。Then, the electronic device 100 may replace the pixel marked as the
此时,图像帧T1'中的内容物包括:人物602、背景603,而不再包括自拍杆601,即去除了T1中的自拍杆601。At this time, the content in the image frame T1' includes: the
可以理解的,T1、S1为示例性的电子设备100的摄像头采集的图像。本申请实施例对于cam1、cam2具体为电子设备100的哪一个摄像头不做限制。因此,在其他实施例中,电子设备100也可使用T1中的图像内容替换S1中的待屏蔽内容。It can be understood that T1 and S1 are images collected by the camera of the exemplary electronic device 100 . In the embodiment of the present application, there is no limitation on which camera of the electronic device 100 cam1 and cam2 are. Therefore, in other embodiments, the electronic device 100 may also use the image content in T1 to replace the content to be blocked in S1.
优选的,为了避免边缘锯齿现象,替换物料的尺寸可比屏蔽对象的尺寸大。边缘锯齿现象是指:图像分割算法定位的屏蔽对象的区域与原始图像中实际物体的位置不完全重合引起的,屏蔽对象消除不完全的现象。Preferably, in order to avoid jagged edges, the size of the replacement material may be larger than the size of the masking object. The edge aliasing phenomenon refers to the phenomenon that the area of the masked object positioned by the image segmentation algorithm does not completely coincide with the position of the actual object in the original image, and the masked object is not completely eliminated.
在本申请实施例中,替换物料的尺寸可在屏蔽对象的尺寸的基础上,向外延展10-20个像素点,从而使得替换物料可以完全覆盖原始图像中的屏蔽对象,从而避免边缘锯齿现象,提升屏蔽效果。In the embodiment of this application, the size of the replacement material can be extended outward by 10-20 pixels based on the size of the masking object, so that the replacement material can completely cover the masking object in the original image, thereby avoiding edge aliasing , to enhance the shielding effect.
可以理解的,当cam1与cam2之间的距离D较小时,cam1采集的图像帧与cam2采集的图像帧之间的视觉差较小。这就可能导致替换物料中的图像内容包括屏蔽对象。这样,即便使用替换物料去填补屏蔽对象,也不能完全去除原始图像中的屏蔽对象。It can be understood that when the distance D between cam1 and cam2 is small, the visual difference between the image frames captured by cam1 and the image frames captured by cam2 is small. This may result in the image content in the replacement material including masked objects. In this way, even if the masking object is filled with a replacement material, the masking object in the original image cannot be completely removed.
因此,进一步的,电子设备100还可对替换后的图像进行自填补。这里,自填补是指使用脏像素点附近的像素点对脏像素点进行填补。上述脏像素点是指在替换后遗留的屏蔽对象,即未完全去除屏蔽对象的像素点。Therefore, further, the electronic device 100 may also perform self-filling on the replaced image. Here, self-filling refers to filling dirty pixels with pixels near the dirty pixels. The above-mentioned dirty pixels refer to the masking objects left after the replacement, that is, the pixels where the masking objects have not been completely removed.
S105:电子设备100显示屏蔽后的图像。S105: The electronic device 100 displays the masked image.
在拍摄照片的场景中,当检测到作用于拍摄按钮的用户操作后,电子设备100可实施S102~S104所示的方法,然后,电子设备100可显示屏蔽后的图像。In the scene of taking pictures, after detecting the user's operation on the shooting button, the electronic device 100 may implement the methods shown in S102-S104, and then, the electronic device 100 may display the masked image.
结合图3A-图3C所示的用户界面。当电子设备100检测到作用拍摄按钮313的用户操作后,响应于该操作,电子设备100实施S102~S104所示的方法,可生成屏蔽自拍杆10的图像。进一步的,响应于作用在图像预览窗314的用户操作,电子设备100可显示上述屏蔽自拍杆10的图像,如图3C所示的用户界面33。Combining with the user interface shown in Fig. 3A-Fig. 3C. When the electronic device 100 detects the user's operation on the
实施S101-S105所示的方法,电子设备100可在拍摄过程中,使用多个摄像头采集图像。然后,电子设备100可根据上述多个摄像头采集的图像的视觉差,对图像中的自拍杆进行屏蔽,从而得到不含自拍杆的图像,进而满足用户期望拍摄不含自拍杆的自拍图像的需求。By implementing the method shown in S101-S105, the electronic device 100 can use multiple cameras to collect images during the shooting process. Then, the electronic device 100 can shield the selfie stick in the image according to the visual difference of the images collected by the above-mentioned multiple cameras, so as to obtain an image without the selfie stick, thereby satisfying the user's desire to take selfie images without the selfie stick. .
为了提升图像内容替换的准确性,在使用S1中的图像内容替换T1中自拍杆10之前,电子设备100还可判断S1与T1的图像内容的相似性。In order to improve the accuracy of image content replacement, before using the image content in S1 to replace the
若S1与T1中的图像内容明显不同,且电子设备100仍然使用S1中的图像来填补T1中需要屏蔽的图像内容,这样不仅不能实现屏蔽目的,反而使得处理后的图像比出处理前的图像更降低用户拍摄体验。If the image contents in S1 and T1 are obviously different, and the electronic device 100 still uses the image in S1 to fill in the image content in T1 that needs to be masked, this will not only fail to achieve the purpose of masking, but will make the image after processing outperform the image before processing It further reduces the user shooting experience.
例如,当cam2被物体阻挡时,例如被手指遮挡,S1中大部分都是手指的时图像内容。此时若使用S1填补T1中的被屏蔽图像内容,则电子设备100从S1中获取的替换物料与被屏蔽图像内容很可能是不适配的,例如使用S1中手指的图像内容填补T1中自拍杆的图像内容,这样不仅不能实现屏蔽目的,反而使得处理后的图像比出处理前的图像更降低用户拍摄体验。For example, when cam2 is blocked by an object, such as a finger, most of S1 is the time image content of the finger. At this time, if S1 is used to fill the masked image content in T1, the replacement material obtained by the electronic device 100 from S1 may not match the masked image content, for example, use the finger image content in S1 to fill in the selfie in T1 In this way, not only the shielding purpose cannot be achieved, but the image after processing will reduce the user's shooting experience even more than the image before processing.
因此,若S1与T1中的图像内容明显不同,则电子设备100可视为S1不具备替换T1的能力,进一步的,电子设备100可使用被屏蔽图像内容附近的相似的图像内容填补该被屏蔽图像。Therefore, if the image contents in S1 and T1 are obviously different, the electronic device 100 may consider that S1 does not have the ability to replace T1, and further, the electronic device 100 may fill the masked image content with similar image content near the masked image content. image.
不限于使用自拍杆自拍的场景,本申请实施例提供的基于多摄像头的图像内容屏蔽方法还可用于其他拍摄场景中。例如,在拍摄单人照的场景中,用户可选择去除偶然出现在取景范围内的其他人物。本申请实施例对此不作限制。It is not limited to the scene of using a selfie stick to take a selfie, and the multi-camera-based image content masking method provided in the embodiment of the present application can also be used in other shooting scenes. For example, in the scene of taking a single-person photo, the user can choose to remove other people who happen to appear in the viewfinder. The embodiment of the present application does not limit this.
在本申请实施例中:In the embodiment of this application:
电子设备100的多个前置摄像头(或多个后置摄像头)在同一时刻采集的一组图像帧可称为一组图像帧。其中,cam1可称为第一摄像头,cam2可称为第二摄像头;cam1采集的图像帧,例如图5所示的T1,可称为第一图像,cam2采集的图像帧,例如图5所示的S1,可称为第二图像。利用第二图像填补第一图像中部分图像内容后的图像可称为第三图像,例如图7所示的T1'。A group of image frames collected at the same time by multiple front cameras (or multiple rear cameras) of the electronic device 100 may be referred to as a group of image frames. Wherein, cam1 can be called the first camera, and cam2 can be called the second camera; the image frame collected by cam1, such as T1 shown in Figure 5, can be called the first image, and the image frame collected by cam2, such as shown in Figure 5 S1, may be referred to as the second image. An image obtained by filling part of the image content in the first image with the second image may be referred to as a third image, such as T1 ′ shown in FIG. 7 .
自拍杆可称为第二设备,图像中的自拍杆可称为第一物体。The selfie stick may be referred to as a second device, and the selfie stick in the image may be referred to as a first object.
第二图像中用于填补第一图像的区域可称为第一区域,例如图7中S1'所示的区域60。第一图像中被屏蔽图像内容对应的区域可称为第二区域,例如图6A中图像帧T1中自拍杆10对应的区域。The area used to fill the first image in the second image may be referred to as a first area, such as the
参考图3A,作用于拍摄控件313的操作可称为电子设备检测到的作用于拍摄控件的操作。作用于电子设备100的电源键、音量键等实体按键的操作可称为电子设备检测到的作用在按键上的操作。用户作用于自拍杆上拍摄按钮的操作可称为第二设备检测到的图像拍摄操作。上述拍摄操作可称为第一用户操作。Referring to FIG. 3A , the operations acting on the
参考图3B,作用于控件314的操作可称为第二用户操作。图3C所示的用户界面可称为显示第三图像。在控件314中显示的第三图像可称为显示第三图像的缩略图。Referring to FIG. 3B , an operation acting on the
图8示出了电子设备100的结构示意图。FIG. 8 shows a schematic structural diagram of the electronic device 100 .
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device 100 may include a
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments,
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (derail clock line, SCL). In some embodiments,
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments,
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal. In some embodiments, the
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(displayserial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect the
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface conforming to the USB standard specification, specifically, it may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules shown in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , the
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be realized by the
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs sound signals through audio equipment (not limited to speaker 170A,
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (wireless fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(codedivision multiple access,CDMA),宽带码分多址(wideband code division multipleaccess,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light emitting diode). AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
在本申请实施例中,电子设备100显示用户界面(图3A-图3C)、摄像头采集的预览图像以及用户拍摄的照片或视频等可通过GPU,显示屏194,以及应用处理器等完成。In the embodiment of the present application, the electronic device 100 displays the user interface (FIG. 3A-FIG. 3C), the preview image captured by the camera, and the photo or video taken by the user, etc., can be completed through the GPU, the display screen 194, and the application processor.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used for processing the data fed back by the camera 193 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (complementary metal-oxide-semiconductor, CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
在本申请实施例中,电子设备100包括两个或两个以上的摄像头193。In the embodiment of the present application, the electronic device 100 includes two or more cameras 193 .
在电子设备100在预览窗中显示原始图像的实施方式中,摄像头193采集的,经ISP处理的图像可直接被送至GPU,显示屏194显示。然后,电子设备100再根据用户的具体拍摄内容,对原始图像进行屏蔽处理。In the embodiment where the electronic device 100 displays the original image in the preview window, the image captured by the camera 193 and processed by the ISP may be directly sent to the GPU for display on the display screen 194 . Then, the electronic device 100 performs masking processing on the original image according to the specific shooting content of the user.
在电子设备100在预览窗中显示屏蔽后的图像的实施方式中,电子设备100可在送显之前就对摄像头193采集的图像进行处理,从而使得GPU,显示屏194等显示的图像是不包括屏蔽对象的图像。In the embodiment in which the electronic device 100 displays the masked image in the preview window, the electronic device 100 can process the image collected by the camera 193 before sending it for display, so that the image displayed by the GPU, the display screen 194, etc. does not include Image of masked object.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By referring to the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process input information and continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
内部存储器121可以包括一个或多个随机存取存储器(random access memory,RAM)和一个或多个非易失性存储器(non-volatile memory,NVM)。The internal memory 121 may include one or more random access memories (random access memory, RAM) and one or more non-volatile memories (non-volatile memory, NVM).
随机存取存储器可以包括静态随机存储器(static random-access memory,SRAM)、动态随机存储器(dynamic random access memory,DRAM)、同步动态随机存储器(synchronous dynamic random access memory,SDRAM)、双倍资料率同步动态随机存取存储器(double data rate synchronous dynamic random access memory,DDR SDRAM,例如第五代DDR SDRAM一般称为DDR5 SDRAM)等。非易失性存储器可以包括磁盘存储器件、快闪存储器(flash memory)。Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous dynamic random access memory, SDRAM), double data rate synchronous Dynamic random access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, for example, the fifth generation DDR SDRAM is generally called DDR5 SDRAM), etc. Non-volatile memory may include magnetic disk storage devices, flash memory (flash memory).
快闪存储器按照运作原理划分可以包括NOR FLASH、NAND FLASH、3D NAND FLASH等,按照存储单元电位阶数划分可以包括单阶存储单元(single-level cell,SLC)、多阶存储单元(multi-level cell,MLC)、三阶储存单元(triple-level cell,TLC)、四阶储存单元(quad-level cell,QLC)等,按照存储规范划分可以包括通用闪存存储(英文:universalflash storage,UFS)、嵌入式多媒体存储卡(embedded multi media Card,eMMC)等。According to the operating principle, flash memory can include NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. According to the potential order of storage cells, it can include single-level storage cells (single-level cell, SLC), multi-level storage cells (multi-level cell, MLC), triple-level cell (TLC), quad-level cell (QLC), etc., can include universal flash storage (English: universal flash storage, UFS), An embedded multimedia memory card (embedded multi media Card, eMMC), etc.
随机存取存储器可以由处理器110直接进行读写,可以用于存储操作系统或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用程序的数据等。The random access memory can be directly read and written by the
非易失性存储器也可以存储可执行程序和存储用户及应用程序的数据等,可以提前加载到随机存取存储器中,用于处理器110直接进行读写。The non-volatile memory can also store executable programs and data of users and application programs, etc., and can be loaded into the random access memory in advance for the
外部存储器接口120可以用于连接外部的非易失性存储器,实现扩展电子设备100的存储能力。外部的非易失性存储器通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部的非易失性存储器中。The
在本申请实施例中,用户拍摄的照片、视频等图像数据可存储到外部存储器接口120连接的非易失性存储器中,从而供用户随时使用。In the embodiment of the present application, image data such as photos and videos taken by the user can be stored in the non-volatile memory connected to the
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。Speaker 170A, also referred to as a "horn", is used to convert audio electrical signals into sound signals. Electronic device 100 can listen to music through speaker 170A, or listen to hands-free calls.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used for connecting wired earphones. The earphone interface 170D may be the USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, pressure sensor 180A may be disposed on display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may be comprised of at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view short messages is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B can be used to determine the motion posture of the electronic device 100 . In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y and z axes) may be determined by the gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 180D includes a Hall sensor. The electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a clamshell machine, the electronic device 100 can detect opening and closing of the clamshell according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, features such as automatic unlocking of the flip cover are set.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。The distance sensor 180F is used to measure the distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F for distance measurement to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The electronic device 100 emits infrared light through the light emitting diode. Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 . The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to make a call, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, automatic unlock and lock screen in pocket mode.
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used for sensing ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket, so as to prevent accidental touch.
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access to application locks, take pictures with fingerprints, answer incoming calls with fingerprints, and the like.
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to implement a temperature treatment strategy. For example, when the temperature reported by the temperature sensor 180J exceeds the threshold, the electronic device 100 may reduce the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by the low temperature. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。The touch sensor 180K is also called "touch device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
在本申请实施例中,电子设备100通过触摸传感器180K检测是否用作用于显示屏194的用户操作(点击操作、双击操作、长按操作等等)。In the embodiment of the present application, the electronic device 100 detects whether the touch sensor 180K is used for a user operation on the display screen 194 (click operation, double-click operation, long-press operation, etc.).
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice. The bone conduction sensor 180M can also contact the human pulse and receive the blood pressure beating signal. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone, combined into a bone conduction earphone. The
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power key, a volume key and the like. The key 190 may be a mechanical key. It can also be a touch button. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。The motor 191 can generate a vibrating reminder. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations applied to different applications (such as taking pictures, playing audio, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects for touch operations acting on different areas of the display screen 194 . Different application scenarios (for example: time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The
实施本申请实施例提供的基于多摄像头的图像内容屏蔽方法,手机、平板电脑等电子设备可以通过两个或两个以上的摄像头采集具有视觉差的图像。然后,该电子设备可基于上述视觉差,对不同摄像头采集的图像进行剪切和替换,从而屏蔽图像中用户不期望出现的内容,以提升用户的拍摄体验。By implementing the multi-camera-based image content masking method provided in the embodiment of the present application, electronic devices such as mobile phones and tablet computers can collect images with visual difference through two or more cameras. Then, the electronic device can cut and replace the images captured by different cameras based on the above-mentioned visual difference, so as to shield the content that the user does not expect in the images, so as to improve the shooting experience of the user.
特别的,利用两个或两个以上的摄像头采集的一组图像帧天然的具备视觉差,进而用户无需调整电子设备或自身的位置,就能实现利用视觉差屏蔽图像内容。In particular, a group of image frames captured by two or more cameras naturally have parallax, so that users do not need to adjust the position of the electronic device or themselves, so that the image content can be shielded by parallax.
本申请的说明书和权利要求书及附图中的术语“用户界面(user interface,UI)”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。应用程序的用户界面是通过java、可扩展标记语言(extensible markup language,XML)等特定计算机语言编写的源代码,界面源代码在终端设备上经过解析,渲染,最终呈现为用户可以识别的内容,比如图片、文字、按钮等控件。控件(control)也称为部件(widget),是用户界面的基本元素,典型的控件有工具栏(toolbar)、菜单栏(menu bar)、文本框(text box)、按钮(button)、滚动条(scrollbar)、图片和文本。界面中的控件的属性和内容是通过标签或者节点来定义的,比如XML通过<Textview>、<ImgView>、<VideoView>等节点来规定界面所包含的控件。一个节点对应界面中一个控件或属性,节点经过解析和渲染之后呈现为用户可视的内容。此外,很多应用程序,比如混合应用(hybrid application)的界面中通常还包含有网页。网页,也称为页面,可以理解为内嵌在应用程序界面中的一个特殊的控件,网页是通过特定计算机语言编写的源代码,例如超文本标记语言(hyper text markup language,GTML),层叠样式表(cascading style sheets,CSS),java脚本(JavaScript,JS)等,网页源代码可以由浏览器或与浏览器功能类似的网页显示组件加载和显示为用户可识别的内容。网页所包含的具体内容也是通过网页源代码中的标签或者节点来定义的,比如GTML通过<p>、<img>、<video>、<canvas>来定义网页的元素和属性。The term "user interface (UI)" in the specification, claims and drawings of this application is a medium interface for interaction and information exchange between an application program or an operating system and a user, and it realizes the internal form of information Conversion to and from a form acceptable to the user. The user interface of the application program is the source code written in specific computer languages such as java and extensible markup language (XML). Such as pictures, text, buttons and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, and scroll bars. (scrollbar), images and text. The properties and contents of the controls in the interface are defined through labels or nodes. For example, XML specifies the controls contained in the interface through nodes such as <Textview>, <ImgView>, and <VideoView>. A node corresponds to a control or property in the interface, and after the node is parsed and rendered, it is presented as the content visible to the user. In addition, the interfaces of many applications, such as hybrid applications, usually include web pages. A web page, also called a page, can be understood as a special control embedded in an application program interface. A web page is a source code written in a specific computer language, such as hypertext markup language (GTML), cascading style Tables (cascading style sheets, CSS), java scripts (JavaScript, JS), etc., and the source code of the web page can be loaded and displayed as user-recognizable content by a browser or a web page display component similar in function to the browser. The specific content contained in the web page is also defined by the tags or nodes in the source code of the web page. For example, GTML defines the elements and attributes of the web page through <p>, <img>, <video>, and <canvas>.
用户界面常用的表现形式是图形用户界面(graphic user interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的一个图标、窗口、控件等界面元素,其中控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。A commonly used representation form of a user interface is a graphical user interface (graphic user interface, GUI), which refers to a user interface related to computer operations displayed in a graphical manner. It can be an icon, window, control and other interface elements displayed on the display screen of the electronic device, where the control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. Visual interface elements.
在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括复数表达形式,除非其上下文中明确地有相反指示。还应当理解,本申请中使用的术语“和/或”是指并包含一个或多个所列出项目的任何或所有可能组合。上述实施例中所用,根据上下文,术语“当…时”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。As used in the specification and appended claims of this application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include Plural expressions, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in this application refers to and includes any and all possible combinations of one or more of the listed items. As used in the above embodiments, depending on the context, the term "when" may be interpreted to mean "if" or "after" or "in response to determining..." or "in response to detecting...". Similarly, depending on the context, the phrase "in determining" or "if detected (a stated condition or event)" may be interpreted to mean "if determining..." or "in response to determining..." or "on detecting (a stated condition or event)" or "in response to detecting (a stated condition or event)".
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘)等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state hard disk), etc.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments are realized. The processes can be completed by computer programs to instruct related hardware. The programs can be stored in computer-readable storage media. When the programs are executed , may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk, and other various media that can store program codes.
Claims (15)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110849366.6A CN113747058B (en) | 2021-07-27 | 2021-07-27 | Image content shielding method and device based on multi-camera |
PCT/CN2022/089274 WO2023005298A1 (en) | 2021-07-27 | 2022-04-26 | Image content masking method and apparatus based on multiple cameras |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110849366.6A CN113747058B (en) | 2021-07-27 | 2021-07-27 | Image content shielding method and device based on multi-camera |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113747058A CN113747058A (en) | 2021-12-03 |
CN113747058B true CN113747058B (en) | 2023-06-23 |
Family
ID=78729260
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110849366.6A Active CN113747058B (en) | 2021-07-27 | 2021-07-27 | Image content shielding method and device based on multi-camera |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113747058B (en) |
WO (1) | WO2023005298A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113747058B (en) * | 2021-07-27 | 2023-06-23 | 荣耀终端有限公司 | Image content shielding method and device based on multi-camera |
CN118555480A (en) * | 2023-02-27 | 2024-08-27 | 荣耀终端有限公司 | A method of shooting |
CN117119284B (en) * | 2023-02-27 | 2024-08-16 | 荣耀终端有限公司 | A method of shooting |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111797836A (en) * | 2020-06-18 | 2020-10-20 | 中国空间技术研究院 | A deep learning-based obstacle segmentation method for extraterrestrial celestial rovers |
Family Cites Families (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8401336B2 (en) * | 2001-05-04 | 2013-03-19 | Legend3D, Inc. | System and method for rapid image sequence depth enhancement with augmented computer-generated elements |
JP2010041586A (en) * | 2008-08-07 | 2010-02-18 | Olympus Corp | Imaging device |
US8964025B2 (en) * | 2011-04-12 | 2015-02-24 | International Business Machines Corporation | Visual obstruction removal with image capture |
JP6104066B2 (en) * | 2013-06-18 | 2017-03-29 | キヤノン株式会社 | Image processing apparatus and image processing method |
CN104580882B (en) * | 2014-11-03 | 2018-03-16 | 宇龙计算机通信科技(深圳)有限公司 | The method and its device taken pictures |
JP2016220051A (en) * | 2015-05-21 | 2016-12-22 | カシオ計算機株式会社 | Image processing apparatus, image processing method, and program |
US10419666B1 (en) * | 2015-12-29 | 2019-09-17 | Amazon Technologies, Inc. | Multiple camera panoramic images |
CN106791393B (en) * | 2016-12-20 | 2019-05-17 | 维沃移动通信有限公司 | A kind of image pickup method and mobile terminal |
GB2560306B (en) * | 2017-03-01 | 2020-07-08 | Sony Interactive Entertainment Inc | Image processing |
US10586308B2 (en) * | 2017-05-09 | 2020-03-10 | Adobe Inc. | Digital media environment for removal of obstructions in a digital image scene |
CN107493429B (en) * | 2017-08-09 | 2020-01-10 | Oppo广东移动通信有限公司 | Selfie stick shielding method and device for taking selfie pictures |
CN112149458B (en) * | 2019-06-27 | 2025-02-25 | 商汤集团有限公司 | Obstacle detection method, intelligent driving control method, device, medium and equipment |
CN112584040B (en) * | 2020-12-02 | 2022-05-17 | 维沃移动通信有限公司 | Image display method, device and electronic device |
CN113747058B (en) * | 2021-07-27 | 2023-06-23 | 荣耀终端有限公司 | Image content shielding method and device based on multi-camera |
-
2021
- 2021-07-27 CN CN202110849366.6A patent/CN113747058B/en active Active
-
2022
- 2022-04-26 WO PCT/CN2022/089274 patent/WO2023005298A1/en active Application Filing
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111797836A (en) * | 2020-06-18 | 2020-10-20 | 中国空间技术研究院 | A deep learning-based obstacle segmentation method for extraterrestrial celestial rovers |
Also Published As
Publication number | Publication date |
---|---|
WO2023005298A1 (en) | 2023-02-02 |
CN113747058A (en) | 2021-12-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112130742B (en) | Full screen display method and device of mobile terminal | |
CN115484380B (en) | Shooting method, graphical user interface and electronic equipment | |
CN109559270B (en) | Image processing method and electronic equipment | |
CN109951633A (en) | A method and electronic device for photographing the moon | |
CN111190681A (en) | Display interface adaptation method, display interface adaptation design method and electronic equipment | |
WO2022258024A1 (en) | Image processing method and electronic device | |
WO2023005298A1 (en) | Image content masking method and apparatus based on multiple cameras | |
CN112532892B (en) | Image processing method and electronic device | |
CN113810603B (en) | Point light source image detection method and electronic device | |
US20240031675A1 (en) | Image processing method and related device | |
CN112541861B (en) | Image processing method, device, equipment and computer storage medium | |
CN114079725B (en) | Video anti-shake method, terminal device, and computer-readable storage medium | |
WO2022001258A1 (en) | Multi-screen display method and apparatus, terminal device, and storage medium | |
WO2023284715A1 (en) | Object reconstruction method and related device | |
CN113497888A (en) | Photo preview method, electronic device and storage medium | |
CN113542574A (en) | Shooting preview method, terminal, storage medium and electronic device under zoom | |
CN113572948B (en) | Video processing method and video processing device | |
CN114283195B (en) | Method, electronic device and readable storage medium for generating dynamic images | |
CN114257737B (en) | Shooting mode switching method and related equipment | |
CN115115679A (en) | An image registration method and related equipment | |
CN118552452A (en) | Method for removing moire and related device | |
CN116582743A (en) | A shooting method, electronic device and medium | |
WO2022062985A1 (en) | Method and apparatus for adding special effect in video, and terminal device | |
WO2022078116A1 (en) | Brush effect picture generation method, image editing method and device, and storage medium | |
CN115550714B (en) | Subtitle display method and related equipment |
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 | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |