CN115442517B - Image processing method, electronic device, and computer-readable storage medium - Google Patents
Image processing method, electronic device, and computer-readable storage medium Download PDFInfo
- Publication number
- CN115442517B CN115442517B CN202210886243.4A CN202210886243A CN115442517B CN 115442517 B CN115442517 B CN 115442517B CN 202210886243 A CN202210886243 A CN 202210886243A CN 115442517 B CN115442517 B CN 115442517B
- Authority
- CN
- China
- Prior art keywords
- camera module
- algorithm
- information
- photographing
- image quality
- 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
Landscapes
- Studio Devices (AREA)
Abstract
本申请提供一种图像处理方法、电子设备及计算机可读存储介质。图像处理方法包括:确定拍照算法和相机模组的信息,相机模组的信息包括相机模组的标识以及相机模组的工艺信息;根据拍照算法和相机模组的信息,确定图像质量参数;根据图像质量参数运行自动曝光算法,得到处理参数;根据处理参数运行所述拍照算法,以对相机模组拍摄的图像进行处理,得到处理后的图像。本申请提供的图像处理方法可以使得到的处理参数与拍照算法以及相机模组的工艺相适配,提高处理后的图像的质量,且在需要增加新的处理参数时,不会对现有的框架造成影响,方便开发人员在现有基础上进行扩展。
The present application provides an image processing method, electronic equipment, and a computer-readable storage medium. The image processing method includes: determining the photographing algorithm and the information of the camera module, the information of the camera module including the identification of the camera module and the process information of the camera module; determining the image quality parameter according to the photographing algorithm and the information of the camera module; running the automatic exposure algorithm according to the image quality parameter to obtain the processing parameters; running the photographing algorithm according to the processing parameters to process the image taken by the camera module to obtain the processed image. The image processing method provided by this application can match the obtained processing parameters with the camera algorithm and the technology of the camera module, improve the quality of the processed image, and when new processing parameters need to be added, it will not affect the existing framework, which is convenient for developers to expand on the existing basis.
Description
技术领域technical field
本申请涉及图像处理领域,尤其涉及一种图像处理方法、电子设备及计算机可读存储介质。The present application relates to the field of image processing, and in particular to an image processing method, electronic equipment, and a computer-readable storage medium.
背景技术Background technique
为了提高相机拍摄所得的图像的质量,在相机拍摄图像后,可以将处理参数代入拍照算法,运行拍照算法对拍摄的图像进行后处理。例如,对拍摄得到的图像进行滤镜、虚化处理,或者对拍摄得到的多帧图像进行融合处理等,可以提高图像的质量。对于包括多个相机模组的电子设备,现有的用于拍照算法的处理参数一般与相机模组相对应,即一个相机模组对应一组处理参数,但是同一类别的相机模组的生产工艺多种多样,现有的处理参数不能适应不同工艺的相机模组,进而影响图像的拍摄质量,且在存在新的处理参数时,开发人员无法对现有产品进行扩展。In order to improve the quality of the image captured by the camera, after the camera captures the image, the processing parameters can be substituted into the camera algorithm, and the camera algorithm can be run to post-process the captured image. For example, performing filter and blur processing on the captured image, or performing fusion processing on multiple frames of captured images can improve the image quality. For electronic devices that include multiple camera modules, the existing processing parameters used in camera algorithms generally correspond to the camera modules, that is, one camera module corresponds to a set of processing parameters, but the production process of the same type of camera modules is varied, and the existing processing parameters cannot be adapted to camera modules of different processes, which in turn affects the quality of image shooting. In addition, when there are new processing parameters, developers cannot expand existing products.
发明内容Contents of the invention
本申请提供一种图像处理方法、电子设备及计算机可读存储介质,可以提高图像的拍摄质量,且方便开发人员对处理参数进行扩展。The present application provides an image processing method, electronic equipment, and a computer-readable storage medium, which can improve image shooting quality and facilitate developers to expand processing parameters.
为达到上述目的,本申请采用如下技术方案:In order to achieve the above object, the application adopts the following technical solutions:
第一方面,提供一种图像处理方法,包括:In a first aspect, an image processing method is provided, including:
确定拍照算法和相机模组的信息,所述相机模组的信息包括所述相机模组的标识以及所述相机模组的工艺信息;根据所述拍照算法和所述相机模组的信息确定图像质量参数;根据所述图像质量参数运行自动曝光算法,得到处理参数;根据所述处理参数运行所述拍照算法,以对所述相机模组拍摄的图像进行处理,得到处理后的图像。Determine the photographing algorithm and the information of the camera module, the information of the camera module includes the identification of the camera module and the process information of the camera module; determine the image quality parameters according to the photographing algorithm and the information of the camera module; run the automatic exposure algorithm according to the image quality parameters to obtain the processing parameters; run the photographing algorithm according to the processing parameters to process the images captured by the camera modules to obtain processed images.
上述实施例中,由于图像质量参数由拍照算法、相机模组的标识以及相机模组的工艺信息确定,因此,图像质量参数可以与相机模组的工艺以及拍照算法相适配,再根据图像质量参数运行自动曝光算法,根据自动曝光算法确定处理参数,可以使处理参数与拍照算法以及相机模组的工艺相适配,因此,根据处理参数运行拍照算法对图像进行处理,可以使图像的处理过程与图像相适配,提高处理后的图像的质量。同时,由于图像质量参数与拍照算法和相机模组的信息存在对应关系,在需要增加新的处理参数时,不会对现有的框架造成影响,从而方便开发人员在现有基础上进行扩展。In the above embodiment, since the image quality parameters are determined by the photographing algorithm, the identification of the camera module, and the process information of the camera module, the image quality parameters can be adapted to the process of the camera module and the photographing algorithm, and then the automatic exposure algorithm is run according to the image quality parameters, and the processing parameters are determined according to the automatic exposure algorithm, so that the processing parameters can be adapted to the photographing algorithm and the process of the camera module. At the same time, since there is a corresponding relationship between the image quality parameters and the camera algorithm and camera module information, when new processing parameters need to be added, the existing framework will not be affected, so that it is convenient for developers to expand on the existing basis.
在一实施例中,所述根据所述拍照算法和所述相机模组的信息得到图像质量参数,包括:根据所述拍照算法和所述相机模组的信息确定第一路径,从所述第一路径得到所述图像质量参数,从而可以快速获取与拍照算法和相机模组的信息相匹配的图像质量参数。In an embodiment, the obtaining the image quality parameter according to the photographing algorithm and the information of the camera module includes: determining a first path according to the photographing algorithm and the information of the camera module, and obtaining the image quality parameter from the first path, so that the image quality parameter matching the photographing algorithm and the information of the camera module can be quickly obtained.
在一实施例中,所述根据所述拍照算法和所述相机模组的信息确定第一路径,包括:In one embodiment, the determining the first path according to the photographing algorithm and the information of the camera module includes:
从第一参数表中确定与所述拍照算法和所述相机模组的信息对应的所述图像质量参数的标识;对所述相机模组的标识、所述相机模组的工艺信息对应的标识、所述图像质量参数的标识进行组合,得到所述第一路径,从而不用预先存储第一路径,在增加新的模组和算法时,不会对已有的路径确定逻辑造成影响,便于开发人员扩展。Determining from the first parameter table the identification of the image quality parameter corresponding to the photographing algorithm and the information of the camera module; combining the identification of the camera module, the identification corresponding to the process information of the camera module, and the identification of the image quality parameter to obtain the first path, so that the first path does not need to be stored in advance, and when adding new modules and algorithms, the existing path determination logic will not be affected, which is convenient for developers to expand.
在一实施例中,所述方法还包括:若所述第一参数表中不存在与所述拍照算法和所述相机模组的信息对应的所述图像质量参数的标识,根据预设标识确定所述第一路径,从而可以使图像处理方法的流程兼容多种系统和设备。In an embodiment, the method further includes: if there is no identification of the image quality parameter corresponding to the photographing algorithm and the information of the camera module in the first parameter table, determining the first path according to a preset identification, so that the flow of the image processing method can be compatible with various systems and devices.
在一实施例中,所述根据所述拍照算法和所述相机模组的信息确定第一路径,包括:确定与所述相机模组的标识对应的第一存储地址;从所述第一存储地址中确定与所述相机模组的工艺信息对应的第二存储地址;从所述第二存储地址中确定与所述拍照算法对应的第三存储地址;将所述第三存储地址作为所述第一路径,通过查询即可得到图像质量参数,在增加新的图像质量参数时,可以直接添加而不用对应修改已经存储的文件,便于开发人员进行扩展。In one embodiment, the determining the first path according to the photographing algorithm and the information of the camera module includes: determining a first storage address corresponding to the identity of the camera module; determining a second storage address corresponding to the process information of the camera module from the first storage address; determining a third storage address corresponding to the photographing algorithm from the second storage address; using the third storage address as the first path, the image quality parameter can be obtained by querying, and when adding a new image quality parameter, it can be directly added without correspondingly modifying the stored file, which is convenient for developers to expand.
在一实施例中,所述根据所述拍照算法和所述相机模组的信息得到图像质量参数,包括:In one embodiment, the image quality parameter obtained according to the photographing algorithm and the information of the camera module includes:
获取能力标识;若所述能力标识为第一预设值,根据所述拍照算法和所述相机模组的信息得到图像质量参数,所述第一预设值表示所述图像质量参数与所述相机模组的工艺信息存在关联关系。Obtaining a capability identifier; if the capability identifier is a first preset value, an image quality parameter is obtained according to the photographing algorithm and information of the camera module, and the first preset value indicates that there is a correlation between the image quality parameter and the process information of the camera module.
若所述能力标识为第二预设值,根据所述相机模组的标识从第二路径获取对应的图像质量参数,所述第二预设值表示所述图像质量参数与所述相机模组的工艺信息不存在关联关系,从而可以使图像处理方法兼容多种设备,且不会对设备已有的图像处理逻辑造成影响。If the capability identifier is a second preset value, the corresponding image quality parameter is obtained from the second path according to the identifier of the camera module, and the second preset value indicates that there is no correlation between the image quality parameter and the process information of the camera module, so that the image processing method can be compatible with various devices without affecting the existing image processing logic of the device.
在一实施例中,所述确定拍照算法包括:In one embodiment, the determination of the camera algorithm includes:
获取拍摄参数和拍摄场景;根据所述拍摄参数和所述拍摄场景,确定所述拍照算法,从而提高确定的拍照算法与图像的适配度,进而提高后续处理后的图像的图像质量。Acquiring shooting parameters and a shooting scene; determining the shooting algorithm according to the shooting parameters and the shooting scene, thereby improving the degree of adaptation between the determined shooting algorithm and the image, and further improving the image quality of the subsequent processed image.
第二方面,提供一种图像处理装置,包括:In a second aspect, an image processing device is provided, including:
通信模块,用于确定拍照算法和相机模组的信息,所述相机模组的信息包括所述相机模组的标识以及所述相机模组的工艺信息;The communication module is used to determine the photographing algorithm and the information of the camera module, the information of the camera module includes the identification of the camera module and the process information of the camera module;
处理模块,用于根据所述拍照算法和所述相机模组的信息,确定图像质量参数;根据所述图像质量参数运行自动曝光算法,得到处理参数;根据所述处理参数运行所述拍照算法,以对所述相机模组拍摄的图像进行处理,得到处理后的图像。A processing module, configured to determine image quality parameters according to the photographing algorithm and the information of the camera module; run an automatic exposure algorithm according to the image quality parameters to obtain processing parameters; run the photographing algorithm according to the processing parameters to process images captured by the camera module to obtain processed images.
在一实施例中,处理模块具体用于:根据所述拍照算法和所述相机模组的信息确定第一路径;从所述第一路径得到所述图像质量参数。In an embodiment, the processing module is specifically configured to: determine a first path according to the photographing algorithm and information of the camera module; obtain the image quality parameter from the first path.
在一实施例中,处理模块具体用于:In one embodiment, the processing module is specifically used for:
从第一参数表中确定与所述拍照算法和所述相机模组的信息对应的所述图像质量参数的标识;Determining the identity of the image quality parameter corresponding to the information of the photographing algorithm and the camera module from the first parameter table;
对所述相机模组的标识、所述相机模组的工艺信息对应的标识、所述图像质量参数的标识进行组合,得到所述第一路径。The first path is obtained by combining the identifier of the camera module, the identifier corresponding to the process information of the camera module, and the identifier of the image quality parameter.
在一实施例中,处理模块还用于:In one embodiment, the processing module is also used for:
若所述第一参数表中不存在与所述拍照算法和所述相机模组的信息对应的所述图像质量参数的标识,根据预设标识确定所述第一路径。If there is no identifier of the image quality parameter corresponding to the photographing algorithm and the information of the camera module in the first parameter table, the first path is determined according to a preset identifier.
在一实施例中,处理模块具体用于:In one embodiment, the processing module is specifically used for:
确定与所述相机模组的标识对应的第一存储地址;determining a first storage address corresponding to the identifier of the camera module;
从所述第一存储地址中确定与所述相机模组的工艺信息对应的第二存储地址;determining a second storage address corresponding to the process information of the camera module from the first storage address;
从所述第二存储地址中确定与所述拍照算法对应的第三存储地址;determining a third storage address corresponding to the photographing algorithm from the second storage address;
将所述第三存储地址作为所述第一路径。The third storage address is used as the first path.
在一实施例中,处理模块具体用于:In one embodiment, the processing module is specifically used for:
获取能力标识;Obtain a capability ID;
若所述能力标识为第一预设值,根据所述拍照算法和所述相机模组的信息得到图像质量参数,所述第一预设值表示所述图像质量参数与所述相机模组的工艺信息存在关联关系。If the capability flag is a first preset value, an image quality parameter is obtained according to the photographing algorithm and information of the camera module, and the first preset value indicates that there is a relationship between the image quality parameter and the process information of the camera module.
在一实施例中,处理模块具体还用于:In an embodiment, the processing module is specifically further used for:
若所述能力标识为第二预设值,根据所述相机模组的标识从第二路径获取对应的图像质量参数,所述第二预设值表示所述图像质量参数与所述相机模组的工艺信息不存在关联关系。If the capability identifier is a second preset value, the corresponding image quality parameter is obtained from a second path according to the identifier of the camera module, and the second preset value indicates that there is no correlation between the image quality parameter and the process information of the camera module.
在一实施例中,通信模块具体用于:In one embodiment, the communication module is specifically used for:
获取拍摄参数和拍摄场景;Obtain shooting parameters and shooting scenes;
根据所述拍摄参数和所述拍摄场景,确定所述拍照算法。The photographing algorithm is determined according to the photographing parameters and the photographing scene.
第三方面,提供一种电子设备,包括处理器,所述处理器用于执行存储在存储器中的计算机程序,以实现如上述第一方面所述的图像处理方法。In a third aspect, an electronic device is provided, including a processor, the processor is configured to execute a computer program stored in a memory, so as to implement the image processing method as described in the first aspect above.
第四方面,提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面所述的图像处理方法。In a fourth aspect, a computer-readable storage medium is provided, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image processing method as described in the above-mentioned first aspect is implemented.
第五方面,提供一种芯片,所述芯片包括处理器,所述处理器和存储器耦合,所述处理器执行所述存储器中存储的计算机程序或指令,以实现如上述第一方面所述的图像处理方法。According to a fifth aspect, a chip is provided, the chip includes a processor, the processor is coupled to a memory, and the processor executes computer programs or instructions stored in the memory to implement the image processing method as described in the first aspect above.
第六方面,提供一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面所述的图像处理方法。According to a sixth aspect, a computer program product is provided. When the computer program product is run on a terminal device, the terminal device is made to execute the image processing method described in the first aspect above.
可以理解的是,上述第二方面至第六方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the above-mentioned second aspect to the sixth aspect, reference can be made to the related description in the above-mentioned first aspect, which will not be repeated here.
附图说明Description of drawings
图1为本申请实施例提供的一种拍摄场景示意图;FIG. 1 is a schematic diagram of a shooting scene provided by an embodiment of the present application;
图2为本申请实施例提供的另一种拍摄场景示意图;FIG. 2 is a schematic diagram of another shooting scene provided by the embodiment of the present application;
图3为本申请实施例提供的一种输出拍摄图像的场景示意图;FIG. 3 is a schematic diagram of a scene for outputting captured images provided by an embodiment of the present application;
图4为本申请实施例提供的一种图像质量参数的存储结构示意图;FIG. 4 is a schematic diagram of a storage structure of an image quality parameter provided by an embodiment of the present application;
图5为本申请一实施例提供的图像处理方法的流程示意图;FIG. 5 is a schematic flowchart of an image processing method provided by an embodiment of the present application;
图6为本申请实施例提供的另一种图像质量参数的存储结构示意图;FIG. 6 is a schematic diagram of a storage structure of another image quality parameter provided by an embodiment of the present application;
图7是本申请一实施例提供的输出图像质量参数的示意图;Fig. 7 is a schematic diagram of output image quality parameters provided by an embodiment of the present application;
图8是本申请一实施例提供的电子设备的软件架构图;FIG. 8 is a software architecture diagram of an electronic device provided by an embodiment of the present application;
图9是本申请一实施例提供的电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this specification and the appended claims, the term "if" may be construed as "when" or "once" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be construed to mean "once determined" or "in response to determination" or "once detected [described condition or event]" or "in response to detection of [described condition or event]" depending on the context.
另外,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the present application, the terms "first", "second" and the like are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification do not necessarily all refer to the same embodiment, but mean "one or more, but not all," unless specifically emphasized otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.
示例性的,本申请实施例中所述的电子设备可以是手机、平板电脑、手持计算机、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备、媒体播放器、穿戴设备等可单手握持/操作的设备,本申请实施例对该电子设备的具体形态/类型不作特殊限制。上述电子设备包括但不限于搭载鸿蒙系统(Harmony OS)或者其他操作系统的设备。Exemplarily, the electronic devices described in the embodiments of the present application may be mobile phones, tablet computers, handheld computers, personal digital assistants (personal digital assistants, PDAs), augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR) devices, media players, wearable devices and other devices that can be held/operated with one hand, and the embodiments of the present application do not specifically limit the specific form/type of the electronic device. The above-mentioned electronic equipment includes but is not limited to carrying Devices with Harmony OS or other operating systems.
首先以电子设备是手机为例,对本申请实施例提供的图像处理方法的应用场景进行介绍。First, taking the electronic device as a mobile phone as an example, an application scenario of the image processing method provided in the embodiment of the present application is introduced.
如图1所示,手机响应于用户打开“相机”应用程序的操作打开相机,在显示界面显示拍摄页面。在拍摄页面,手机根据用户选择的第一拍摄参数确定用于拍摄图像的相机模组,并在显示界面上显示第二拍摄参数下相机模组的预览效果。其中,第一拍摄参数可以是前置、全景、焦距值等,第二拍摄参数可以是分辨率、曝光度、亮度等,相机模组可以是超广角、广角、长焦、前置中的任一个。As shown in FIG. 1 , the mobile phone opens the camera in response to the user's operation of opening the "camera" application program, and displays a shooting page on the display interface. On the shooting page, the mobile phone determines the camera module used for shooting images according to the first shooting parameter selected by the user, and displays the preview effect of the camera module under the second shooting parameter on the display interface. Among them, the first shooting parameter can be front, panorama, focal length, etc., the second shooting parameter can be resolution, exposure, brightness, etc., and the camera module can be any one of super wide angle, wide angle, telephoto, and front.
例如,在检测到用户选择“前置”控件11的操作时,在显示界面显示第二拍摄参数下前置相机模组的预览效果。在检测到用户将“焦距”选项12调节至长焦范围时,在显示界面显示第二拍摄参数下长焦相机模组的预览效果。如图2所示,在检测到用户打开全景模式的操作时开启全景模式,在显示界面显示第二拍摄参数下广角相机模组的预览效果。For example, when the operation of selecting the "front" control 11 by the user is detected, the preview effect of the front camera module under the second shooting parameter is displayed on the display interface. When it is detected that the user adjusts the "focus length" option 12 to the telephoto range, the preview effect of the telephoto camera module under the second shooting parameter is displayed on the display interface. As shown in FIG. 2 , the panorama mode is turned on when the user's operation of turning on the panorama mode is detected, and the preview effect of the wide-angle camera module under the second shooting parameter is displayed on the display interface.
如图1所示,手机在检测到点击“拍摄”控件13的操作时,根据第二拍摄参数对当前拍摄的图像进行前处理,之后,手机对前处理后的一张图像或前处理后的连续多帧图像进行后处理,输出后处理后的图像并保存。如图3所示,在检测到用户打开图像的操作时,在显示界面显示后处理后的图像。As shown in Figure 1, when the mobile phone detects the operation of clicking the "shooting" control 13, it performs pre-processing on the currently captured image according to the second shooting parameters. After that, the mobile phone performs post-processing on a pre-processed image or continuous multi-frame images after pre-processing, and outputs the post-processed image and saves it. As shown in FIG. 3 , when an operation of opening an image by the user is detected, the post-processed image is displayed on the display interface.
其中,手机对图像的后处理通过运行拍照算法实现。具体地,先根据图像质量(picture quality,PQ)参数运行自动曝光算法得到处理参数,再将处理参数作为拍照算法的输入,运行拍照算法,以对图像进行后处理。Wherein, the post-processing of the image by the mobile phone is realized by running a camera algorithm. Specifically, an automatic exposure algorithm is first run according to a picture quality (PQ) parameter to obtain processing parameters, and then the processing parameters are used as an input of the photographing algorithm to run the photographing algorithm to post-process the image.
在一实施例中,一个相机模组对应一组PQ参数。例如,如图4所示,超广角相机模组对应超广角PQ参数,广角相机模组对应广角PQ参数,长焦相机模组对应长焦PQ参数,前置相机模组对应前置PQ参数。手机在确定用于拍照的相机模组后,调用对应的PQ参数运行smartAE算法,得到处理参数,之后手机再调用处理参数运行拍照算法对相机模组拍摄的图像进行处理,得到处理后的图像。In one embodiment, one camera module corresponds to a set of PQ parameters. For example, as shown in Figure 4, the ultra-wide-angle camera module corresponds to the ultra-wide-angle PQ parameter, the wide-angle camera module corresponds to the wide-angle PQ parameter, the telephoto camera module corresponds to the telephoto PQ parameter, and the front camera module corresponds to the front PQ parameter. After the mobile phone determines the camera module for taking pictures, it calls the corresponding PQ parameters to run the smartAE algorithm to obtain the processing parameters, and then calls the processing parameters to run the camera algorithm to process the images taken by the camera module to obtain the processed images.
但是,不同的相机模组的工艺信息不同,例如,相机模组的传感器、镜头可能来自不同的生产商或者采用不同的工艺制作,若同一种相机模组仅对应一组PQ参数,则根据PQ参数得到的处理参数不能适应不同的相机模组,进而影响拍摄所得的图像质量。同时,随着相机模组的多样化以及拍照算法的不断更新,需要更新PQ参数以适应不同的相机模组或者拍照算法。若需要更新的PQ参数的格式发生变化,开发人员无法对相机模组对应的PQ参数进行扩展,而需要重新布局,进而影响开发效率。However, the process information of different camera modules is different. For example, the sensors and lenses of the camera modules may come from different manufacturers or be produced by different processes. If the same camera module only corresponds to one set of PQ parameters, the processing parameters obtained according to the PQ parameters cannot be adapted to different camera modules, thereby affecting the quality of the captured images. At the same time, with the diversification of camera modules and the continuous update of camera algorithms, it is necessary to update the PQ parameters to adapt to different camera modules or camera algorithms. If the format of the PQ parameter that needs to be updated changes, the developer cannot expand the PQ parameter corresponding to the camera module, but needs to re-layout, thereby affecting the development efficiency.
为此,本申请提供一种图像处理方法,电子设备首先确定拍照算法和相机模组的信息,相机模组的信息包括相机模组的标识以及相机模组的工艺信息,之后根据拍照算法和相机模组的信息得到图像质量参数,从而使得到的图像质量参数与相机模组的匹配度更高,最后电子设备再根据图像质量参数运行自动曝光算法,得到处理参数,可以使处理参数与相机模组和拍照算法的匹配度更好,之后根据处理参数运行拍照算法,以对相机模组拍摄的图像进行处理,得到处理后的图像,可以提高处理后的图像的质量。同时,在存在新的处理参数时,可以直接在现有基础上进行扩展,而不用修改现有的设计框架。例如,在现有的基础上增加新的拍照算法、新的自动曝光算法以及对应的PQ参数,并添加对应的路径即可实现PQ参数的调用,得到对应的处理参数。To this end, the present application provides an image processing method. The electronic device first determines the photographing algorithm and the information of the camera module. The information of the camera module includes the identification of the camera module and the process information of the camera module. Then, the image quality parameters are obtained according to the photographing algorithm and the information of the camera module, so that the obtained image quality parameters have a higher matching degree with the camera module. Finally, the electronic device runs the automatic exposure algorithm according to the image quality parameters to obtain the processing parameters, which can make the processing parameters better match the camera module and the photographing algorithm. The processing is performed to obtain a processed image, which can improve the quality of the processed image. At the same time, when there are new processing parameters, it can be directly extended on the existing basis without modifying the existing design framework. For example, adding a new camera algorithm, a new automatic exposure algorithm, and corresponding PQ parameters on the existing basis, and adding a corresponding path can realize the calling of PQ parameters and obtain corresponding processing parameters.
下面对本申请实施例提供的图像处理方法进行示例性说明。The image processing method provided by the embodiment of the present application will be described as an example below.
如图5所示,本申请一实施例提供的图像处理方法包括:As shown in Figure 5, the image processing method provided by an embodiment of the present application includes:
S501:确定拍照算法和相机模组的信息,所述相机模组的信息包括所述相机模组的标识以及所述相机模组的工艺信息。S501: Determine a photographing algorithm and camera module information, where the camera module information includes an identifier of the camera module and process information of the camera module.
其中,电子设备可以包括多个相机模组,电子设备根据用户需求调用不同的相机模组进行拍摄。相机模组的标识可以是相机模组的名称(例如超广角、广角、长焦、前置)或者相机模组的序号(例如1、2、3、4)。相机模组的工艺信息可以是相机模组的传感器、数字信号处理(Digital Signal Processing,DSP)、镜头等组件的标识信息。各组件的标识信息可以用各组件的生产商、型号等信息表示。拍照算法用于对相机模组拍摄的图像进行后处理。电子设备可以存储多个拍照算法,在不同场景下,电子设备可以调用不同的拍照算法对相机模组拍摄的图像进行后处理。Wherein, the electronic device may include multiple camera modules, and the electronic device invokes different camera modules to take pictures according to user requirements. The identification of the camera module may be the name of the camera module (such as super wide-angle, wide-angle, telephoto, front) or the serial number of the camera module (such as 1, 2, 3, 4). The process information of the camera module may be identification information of components such as a sensor, a digital signal processing (Digital Signal Processing, DSP), and a lens of the camera module. The identification information of each component may be represented by information such as the manufacturer and model of each component. The camera algorithm is used to post-process the images captured by the camera module. The electronic device can store multiple camera algorithms, and in different scenarios, the electronic device can invoke different camera algorithms to post-process the images captured by the camera module.
在一实施例中,电子设备首先获取拍摄参数和拍摄场景,根据拍摄参数和拍摄场景确定拍照算法。其中,拍摄参数包括上述的第一拍摄参数和第二拍摄参数,拍照场景包括环境亮度、电子设备距离拍摄目标的距离、感光度、是否高动态模式、拍摄目标(例如人像、月亮、太阳)等。电子设备可以根据拍摄参数、拍摄场景与拍照算法的对应关系确定拍照算法,也可以根据预先训练的用于确定拍照算法的模型确定拍照算法。例如,若环境亮度位于中高亮度的范围,高动态模式处于开启状态,则选择标识为hdrp的拍照算法。若环境亮度位于低亮度的范围,则选择标识为supernight的拍照算法。In an embodiment, the electronic device first acquires shooting parameters and shooting scenes, and determines a shooting algorithm according to the shooting parameters and shooting scenes. Wherein, the shooting parameters include the above-mentioned first shooting parameter and second shooting parameter, and the shooting scene includes ambient brightness, distance between the electronic device and the shooting target, sensitivity, whether to use high dynamic mode, shooting target (such as portrait, moon, sun) and so on. The electronic device may determine the photographing algorithm according to the corresponding relationship between the photographing parameters, the photographing scene and the photographing algorithm, or may determine the photographing algorithm according to a pre-trained model for determining the photographing algorithm. For example, if the ambient brightness is in the medium-to-high brightness range and the high dynamic mode is turned on, the camera algorithm identified as hdrp is selected. If the ambient brightness is in the low brightness range, select the camera algorithm identified as supernight.
S502:根据所述拍照算法和所述相机模组的信息确定图像质量参数。S502: Determine an image quality parameter according to the photographing algorithm and the information of the camera module.
在一实施例中,电子设备存储有与拍照算法、相机模组、PQ参数的第一路径的对应关系,在确定拍照算法和相机模组后,即可根据对应关系确定第一路径,从第一路径中获取PQ参数。其中,不同拍照算法对应的PQ参数的格式不同。In one embodiment, the electronic device stores a corresponding relationship with the first path of the photographing algorithm, the camera module, and the PQ parameter. After determining the photographing algorithm and the camera module, the first path can be determined according to the correspondence, and the PQ parameter can be obtained from the first path. Wherein, the formats of the PQ parameters corresponding to different camera algorithms are different.
在一实施例中,如图6所示,不同组的PQ参数依次按照相机模组的标识、相机模组的工艺信息、拍照算法的方式进行分组和存储。例如,首先创建四个文件夹,分别命名为超广角、广角、长焦、前置。在超广角文件夹下创建三个文件夹,分别命名为模组1、模组2、模组3,3个模组分别对应超广角相机模组的三种工艺信息。在模组1的文件夹下创建3个文件夹,分别为算法1、算法2、算法3,3个算法分别对应三个拍照算法。在每个算法的文件夹下存储对应的PQ参数表,其中PQ参数表中存储的PQ参数的格式与对应的拍照算法所需的PQ参数的格式一致,从而可以根据PQ参数运行自动曝光算法,得到处理参数,再根据处理参数运行拍照算法,避免拍照算法运行错误。同理,在模组2和模组3的文件夹下分别创建各模组的拍照算法的文件夹,在每个文件夹下存储对应的PQ参数表。同理,在广角、长焦、前置文件夹下分别创建各个模组(例如模组4、模组5、模组6...)的文件夹,再在各个模组的文件夹下分别创建对应的拍照算法的文件夹,在每个文件夹下存储对应的PQ参数表。In one embodiment, as shown in FIG. 6 , different groups of PQ parameters are grouped and stored sequentially according to the identification of the camera module, the process information of the camera module, and the photographing algorithm. For example, first create four folders and name them super wide-angle, wide-angle, telephoto, and front respectively. Create three folders under the ultra-wide-angle folder, named module 1, module 2, and module 3 respectively. The three modules correspond to the three types of process information of the ultra-wide-angle camera module. Create 3 folders under the module 1 folder, which are Algorithm 1, Algorithm 2, and Algorithm 3, and the three algorithms correspond to three camera algorithms. The corresponding PQ parameter table is stored under the folder of each algorithm, wherein the format of the PQ parameter stored in the PQ parameter table is consistent with the format of the PQ parameter required by the corresponding camera algorithm, so that the automatic exposure algorithm can be run according to the PQ parameter to obtain the processing parameters, and then the camera algorithm can be run according to the processing parameters to avoid operation errors of the camera algorithm. Similarly, under the folders of module 2 and module 3, create folders for the camera algorithm of each module, and store the corresponding PQ parameter table under each folder. Similarly, create folders for each module (such as module 4, module 5, module 6...) under the wide-angle, telephoto, and front folders, and then create folders for corresponding camera algorithms under the folders of each module, and store the corresponding PQ parameter table under each folder.
电子设备同时建立存储有相机模组的标识、相机模组的工艺信息对应的标识、拍照算法的标识、PQ参数的标识(即PQ参数表的文件名)对应关系的第一参数表,第一参数表可以为XML格式的文件,从而便于后续开发人员对其进行扩展。At the same time, the electronic device establishes a first parameter table that stores the corresponding relationship between the camera module ID, the camera module process information corresponding ID, the camera algorithm ID, and the PQ parameter ID (that is, the file name of the PQ parameter table). The first parameter table can be a file in XML format, so that it is convenient for subsequent developers to expand it.
电子设备在确定拍照算法、相机模组以及相机模组的工艺信息后,从第一参数表中确定与相机模组的标识、相机模组的工艺信息对应的标识、拍照算法的标识对应的PQ参数的标识,对相机模组的标识、相机模组的工艺信息对应的标识、PQ参数的标识进行组合,得到第一路径。例如,相机模组的标识是长焦,相机模组的工艺信息的标识是模组1,拍照算法的标识是AIRaw,PQ参数的标识是PQ1,则组合后得到的第一路径为长焦/模组1/AIRaw/PQ1,电子设备根据第一路径即可读取PQ参数,从而可以快速读取PQ参数。After determining the photographing algorithm, the camera module, and the process information of the camera module, the electronic device determines from the first parameter table the identity of the camera module, the identity corresponding to the process information of the camera module, and the identity of the PQ parameter corresponding to the identity of the photographing algorithm, and combines the identity of the camera module, the identity corresponding to the process information of the camera module, and the identity of the PQ parameter to obtain the first path. For example, the identification of the camera module is telephoto, the identification of the process information of the camera module is module 1, the identification of the camera algorithm is AIRaw, and the identification of the PQ parameter is PQ1, then the first path obtained after the combination is telephoto/module 1/AIRaw/PQ1, and the electronic device can read the PQ parameters according to the first path, so that the PQ parameters can be quickly read.
在一实施例中,若第一参数表中存在与拍照算法和相机模组的信息对应的PQ参数的标识,则可以直接读取PQ参数的标识。若第一参数表中不存在与拍照算法和相机模组的信息对应的PQ参数的标识,则获取预设标识,根据预设标识确定第一路径。其中,预设标识可以是默认路径,默认路径可以直接作为第一路径。例如,新开发的电子设备中增加了新的相机模组,当在新开发的电子设备上运行原有操作系统时,会出现第一参数表中不存在新的相机模组的标识或者不存在新的相机模组的工艺信息的标识的情况,则直接将默认路径作为第一路径来读取PQ参数,从而可以使当前存储的PQ参数兼容多种电子设备。其中,第一参数表中的默认路径的数量为多个,默认路径可以按照相机模组的标识或者拍照算法的标识进行分类存储。例如一个相机模组的标识对应一个默认路径或者一个拍照算法的标识对应一个默认路径。In an embodiment, if there is an identifier of the PQ parameter corresponding to the photographing algorithm and the information of the camera module in the first parameter table, the identifier of the PQ parameter can be directly read. If there is no identifier of the PQ parameter corresponding to the information of the photographing algorithm and the camera module in the first parameter table, a preset identifier is obtained, and the first path is determined according to the preset identifier. Wherein, the preset identifier may be a default path, and the default path may be directly used as the first path. For example, if a new camera module is added to a newly developed electronic device, when the original operating system is run on the newly developed electronic device, there will be no identification of the new camera module or the identification of the process information of the new camera module in the first parameter table, then the default path is directly used as the first path to read the PQ parameters, so that the currently stored PQ parameters can be compatible with various electronic devices. Wherein, there are multiple default paths in the first parameter table, and the default paths may be classified and stored according to the identifier of the camera module or the identifier of the photographing algorithm. For example, an identifier of a camera module corresponds to a default path or an identifier of a camera algorithm corresponds to a default path.
在一实施例中,由于PQ参数是按照相机模组的标识、相机模组的工艺信息、拍照算法的方式进行分组和存储,因此可以根据相机模组的标识、相机模组的工艺信息的标识、拍照算法的标识依次查询得到PQ参数。具体地,电子设备在确定相机模组的信息和拍照算法后,首先确定与相机模组的标识对应的第一存储地址,从第一存储地址中确定与相机模组的工艺信息对应的第二存储地址,从第二存储地址中确定与拍照算法对应的第三存储地址,将第三存储地址作为第一路径,读取第一路径下存储的PQ参数表,得到PQ参数。例如,相机模组的标识是超广角,相机模组的工艺信息的标识是模组1,拍照算法的标识是HDR,则电子设备首先查询名称为超广角的文件夹,该文件夹所在的地址即为第一存储地址,再从超广角文件夹中查询名称为模组1的文件夹,该文件夹所在的地址即为第二存储地址,再从模组1的文件夹中查询名称为HDR的文件夹,该文件夹所在的地址即为第三存储地址,从第三存储地址中即可读取PQ参数表,得到PQ参数。In one embodiment, since the PQ parameters are grouped and stored according to the identification of the camera module, the process information of the camera module, and the photographing algorithm, the PQ parameters can be obtained by querying in sequence according to the identification of the camera module, the identification of the process information of the camera module, and the identification of the photographing algorithm. Specifically, after determining the information of the camera module and the photographing algorithm, the electronic device first determines the first storage address corresponding to the identification of the camera module, determines the second storage address corresponding to the process information of the camera module from the first storage address, determines the third storage address corresponding to the photographing algorithm from the second storage address, uses the third storage address as the first path, reads the PQ parameter table stored under the first path, and obtains the PQ parameter. For example, the logo of the camera module is super wide-angle, the logo of the process information of the camera module is module 1, and the logo of the camera algorithm is HDR, then the electronic device first queries the folder named super wide-angle, and the address of the folder is the first storage address, and then queries the folder named module 1 from the ultra-wide-angle folder, and the address of the folder is the second storage address, and then queries the folder named HDR from the folder of module 1, and the address of the folder is the third storage address, and the PQ parameter table can be read from the third storage address , to get the PQ parameter.
在一实施例中,电子设备在读取PQ参数前,首先获取能力标识,能力标识用于表示相机模组是否按照相机模组的标识、相机模组的工艺信息的标识、拍照算法的标识的顺序依次查询得到PQ参数。若能力标识为第一预设值(例如“ON”或“1”),表示当前使用的相机模组需要按照相机模组的标识、相机模组的工艺信息的标识、拍照算法的标识的顺序依次查询得到PQ参数,即PQ参数与相机模组的工艺信息存在关联关系,则根据拍照算法和相机模组的信息得到PQ参数。若能力标识为第二预设值(例如“OFF”或“0”),表示当前使用的相机模组不需要按照相机模组的标识、相机模组的工艺信息的标识、拍照算法的标识的顺序依次查询得到PQ参数,即PQ参数与相机模组的工艺信息不存在关联关系,则根据相机模组的标识从第二路径获取对应的图像质量参数。例如,若电子设备原有的操作系统不支持按照相机模组的标识、相机模组的工艺信息的标识、拍照算法的标识的顺序依次查询得到PQ参数的流程,电子设备下载新的操作系统后,将能力标识设定为第二预设值,新的操作系统支持按照相机模组的标识、相机模组的工艺信息的标识、拍照算法的标识的顺序依次查询得到PQ参数。电子设备在获取拍照算法和相机模组的信息后,确定电子设备的能力标识为第二预设值,则根据相机模组的标识,直接从名称为对应相机模组的标识的文件夹中获取PQ参数。例如,名称为超广角、广角、长焦、前置的文件夹中分别存储PQ参数表,在确定相机模组的标识后,从对应的文件夹即可读取PQ参数表,从而可以使当前存储的PQ参数兼容旧设备,且不会对旧设备的算法逻辑造成影响。In one embodiment, before the electronic device reads the PQ parameters, it first obtains a capability identifier, and the capability identifier is used to indicate whether the camera module obtains the PQ parameters by sequentially querying the identifier of the camera module, the identifier of the process information of the camera module, and the identifier of the camera algorithm. If the capability flag is the first preset value (such as "ON" or "1"), it means that the currently used camera module needs to query the PQ parameters according to the order of the camera module logo, the camera module process information logo, and the photographing algorithm logo, that is, the PQ parameter is associated with the camera module process information, and the PQ parameter is obtained according to the photographing algorithm and the information of the camera module. If the capability flag is the second preset value (such as "OFF" or "0"), it means that the currently used camera module does not need to query the PQ parameters according to the sequence of the camera module logo, the camera module process information logo, and the camera algorithm logo. For example, if the original operating system of the electronic device does not support the process of sequentially querying the PQ parameters according to the order of the identification of the camera module, the identification of the process information of the camera module, and the identification of the photographing algorithm, after the electronic device downloads a new operating system, the capability identification is set as the second preset value, and the new operating system supports sequentially querying the PQ parameters according to the order of the identification of the camera module, the identification of the process information of the camera module, and the identification of the photographing algorithm. After the electronic device obtains the photographing algorithm and the information of the camera module, it determines that the capability identifier of the electronic device is the second preset value, and then according to the identifier of the camera module, directly obtains the PQ parameter from the folder whose name is the identifier of the corresponding camera module. For example, the PQ parameter tables are stored in the folders named super wide-angle, wide-angle, telephoto, and front respectively. After the identification of the camera module is determined, the PQ parameter table can be read from the corresponding folder, so that the currently stored PQ parameters can be compatible with old devices and will not affect the algorithm logic of the old devices.
可以理解,在其他实施例中也可以依次按照拍照算法、相机模组的标识、相机模组的工艺信息对PQ参数进行分组和存储,也可以依次按照相机模组的标识、拍照算法、相机模组的工艺信息对PQ参数进行分组和存储。It can be understood that in other embodiments, the PQ parameters can also be grouped and stored sequentially according to the photographing algorithm, the camera module identifier, and the process information of the camera module, or the PQ parameters can be grouped and stored sequentially according to the camera module identifier, photographing algorithm, and camera module process information.
S503:根据所述图像质量参数运行自动曝光算法,得到处理参数。S503: Run an automatic exposure algorithm according to the image quality parameters to obtain processing parameters.
具体地,PQ参数作为自动曝光算法的输入值,运行自动曝光算法,输出结果为处理参数。处理参数用于作为拍照算法的输入值,处理参数可以是用于进行图像融合的图像数量、每张图像对应的曝光度、用户进行图像融合的图像的曝光总量等。Specifically, the PQ parameter is used as the input value of the automatic exposure algorithm, the automatic exposure algorithm is run, and the output result is the processing parameter. The processing parameter is used as the input value of the camera algorithm, and the processing parameter may be the number of images used for image fusion, the exposure corresponding to each image, the total exposure of the images for image fusion performed by the user, and the like.
其中,电子设备中可以存储多种自动曝光算法,电子设备在确定拍照算法和相机模组的信息后,可以先根据拍照算法、相机模组的信息、拍摄参数、拍摄场景以及预先存储的对应关系确定自动曝光算法,在确定PQ参数后,将PQ参数作为自动曝光算法的输入值,运行自动曝光算法。对应的,电子设备可以先按照自动曝光算法对PQ参数分组,对于每种自动曝光算法,再按照相机模组的标识、相机模组的工艺信息、拍照算法的方式对PQ参数进行分组和存储。Among them, a variety of automatic exposure algorithms can be stored in the electronic device. After the electronic device determines the photographing algorithm and the information of the camera module, it can first determine the automatic exposure algorithm according to the photographing algorithm, the information of the camera module, the photographing parameters, the photographing scene and the corresponding relationship stored in advance. After determining the PQ parameter, the PQ parameter is used as the input value of the automatic exposure algorithm to run the automatic exposure algorithm. Correspondingly, the electronic device may first group the PQ parameters according to the automatic exposure algorithm, and then group and store the PQ parameters according to the identification of the camera module, the process information of the camera module, and the photographing algorithm for each automatic exposure algorithm.
S504:根据所述处理参数运行所述拍照算法,以对所述相机模组拍摄的图像进行处理,得到处理后的图像。S504: Run the photographing algorithm according to the processing parameters to process the images captured by the camera module to obtain processed images.
其中,拍照算法可以是用于融合多帧图像的算法、高动态处理算法、美颜处理算法、滤镜处理算法等。电子设备调用拍照算法,将处理参数作为拍照算法的输入参数,运行拍照算法,即可对相机模组拍摄的图像进行处理。Wherein, the photographing algorithm may be an algorithm for fusing multiple frames of images, a high dynamic processing algorithm, a beauty processing algorithm, a filter processing algorithm, and the like. The electronic device invokes the photographing algorithm, uses the processing parameters as the input parameters of the photographing algorithm, and runs the photographing algorithm to process the images captured by the camera module.
例如,若拍照算法是用于融合多帧图像的算法,则根据处理参数得到用于进行图像融合的图像数量、各图像的曝光度等信息,根据用于进行图像融合的图像数量、各图像的曝光度等信息运行拍照算法,即可对多张图像进行融合处理,得到处理后的图像。For example, if the photographing algorithm is an algorithm for fusing multiple frames of images, the number of images used for image fusion, the exposure of each image, and other information are obtained according to the processing parameters, and the photographing algorithm is run according to the number of images used for image fusion, the exposure of each image, and other information to perform fusion processing on multiple images to obtain a processed image.
上述实施例中,由于图像质量参数由拍照算法、相机模组的标识以及相机模组的工艺信息确定,因此,图像质量参数可以与相机模组的工艺以及拍照算法相适配,再根据图像质量参数确定自动曝光算法,最后根据自动曝光算法确定的处理参数运行拍照算法,可以使图像的处理过程与相机模组的工艺相匹配,提高图像的拍摄质量。同时,由于图像质量参数与拍照算法一一对应,在需要增加新的处理参数时,可以在不影响现有架构的基础上直接添加,方便开发人员在现有基础上进行扩展。In the above embodiment, since the image quality parameters are determined by the photographing algorithm, the identification of the camera module, and the process information of the camera module, the image quality parameters can be adapted to the process of the camera module and the photographing algorithm, and then the automatic exposure algorithm is determined according to the image quality parameters, and finally the photographing algorithm is run according to the processing parameters determined by the automatic exposure algorithm, so that the image processing process can be matched with the process of the camera module, and the image capture quality can be improved. At the same time, due to the one-to-one correspondence between image quality parameters and camera algorithms, when new processing parameters need to be added, they can be added directly without affecting the existing architecture, which is convenient for developers to expand on the existing basis.
下面结合电子设备的框架图对本申请实施例提供的图像处理方法进行详细说明。The image processing method provided by the embodiment of the present application will be described in detail below with reference to the frame diagram of the electronic device.
如图7所示,电子设备包括多摄模块、算法决策模块、感知模块、PQ参数分离模块以及smart AE算法模块。PQ参数分离模块包括PQ参数决策模块、PQ参数管理模块以及XML解析器。多摄模块用于根据用户选择的拍摄参数确定当前使用的相机模组的信息,相机模组的信息包括相机模组的标识以及相机模组的工艺信息。算法决策模块用于根据用户选择的拍摄参数以及当前的拍摄场景确定需要使用的拍照算法。感知模块从多摄模块获取相机模组的信息,从算法决策模块获取拍照算法的标识,将相机模组的信息以及拍照算法的标识发送至PQ参数决策模块。PQ参数决策模块根据相机模组的信息以及拍照算法,调用XML解析器执行解析流程。解析流程为XML解析器访问预先存储的第一参数表,从第一参数表中获取与相机模组的信息以及拍照算法对应的PQ参数的标识。例如,XML解析器的输入项为相机模组的信息IMX520以及拍照算法的标识Hdrp,解析后得到输出项PQ参数的标识为PQ_path。PQ参数管理模块用于根据PQ参数的标识确定PQ参数的第一路径,从第一路径读取PQ参数,将读取的PQ参数发送至smart AE算法模块。smart AE算法模块将PQ参数作为输入参数运行smart AE算法,得到处理参数。将处理参数作为拍照算法的输入参数,运行拍照算法,即可实现对相机模组拍摄的图像进行后处理,从而可以采用与相机模组适配的PQ参数处理相机模组拍摄的图像,提高了处理后的图像的质量。As shown in Figure 7, the electronic device includes a multi-camera module, an algorithm decision-making module, a perception module, a PQ parameter separation module, and a smart AE algorithm module. The PQ parameter separation module includes a PQ parameter decision module, a PQ parameter management module and an XML parser. The multi-camera module is used to determine the information of the currently used camera module according to the shooting parameters selected by the user. The information of the camera module includes the identification of the camera module and the process information of the camera module. The algorithm decision module is used to determine the camera algorithm to be used according to the shooting parameters selected by the user and the current shooting scene. The perception module obtains the information of the camera module from the multi-camera module, obtains the identification of the photographing algorithm from the algorithm decision-making module, and sends the information of the camera module and the identification of the photographing algorithm to the PQ parameter decision-making module. The PQ parameter decision-making module calls the XML parser to execute the parsing process according to the information of the camera module and the camera algorithm. The parsing process is that the XML parser accesses the pre-stored first parameter table, and obtains the identifier of the PQ parameter corresponding to the information of the camera module and the camera algorithm from the first parameter table. For example, the input item of the XML parser is the information IMX520 of the camera module and the identification Hdrp of the camera algorithm, and the identification of the output item PQ parameter is PQ_path after parsing. The PQ parameter management module is used to determine the first path of the PQ parameter according to the identification of the PQ parameter, read the PQ parameter from the first path, and send the read PQ parameter to the smart AE algorithm module. The smart AE algorithm module uses PQ parameters as input parameters to run the smart AE algorithm to obtain processing parameters. By using the processing parameters as the input parameters of the camera module and running the camera algorithm, the post-processing of the images captured by the camera module can be realized, so that the PQ parameters adapted to the camera module can be used to process the images captured by the camera module, and the quality of the processed images can be improved.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
电子设备的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the software structure of the electronic device 100 is exemplarily described by taking an Android system with a layered architecture as an example.
图8是本发明实施例的电子设备的软件结构框图。Fig. 8 is a block diagram of the software structure of the electronic device according to the embodiment of the present invention.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, the application program layer, the application program framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can consist of a series of application packages.
如图8所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in FIG. 8, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图8所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 8, the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make it accessible to applications. Said data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide communication functions of electronic devices. For example, the management of call status (including connected, hung up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the download completion, message reminder, etc. The notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core library and virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application program layer and the application program framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
下面结合捕获拍照场景,示例性说明电子设备软件以及硬件的工作流程。The workflow of the software and hardware of the electronic device will be exemplarily described below in conjunction with capturing a photographing scene.
当触摸传感器接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过摄像头捕获静态图像或视频。When the touch sensor receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes touch operations into original input events (including touch coordinates, time stamps of touch operations, and other information). Raw input events are stored at the kernel level. The application framework layer obtains the original input event from the kernel layer, and identifies the control corresponding to the input event. For example, the touch operation is a touch-click operation, and the control corresponding to the click operation is the control of the camera application icon. The camera application calls the interface of the application framework layer, starts the camera application, and then starts the camera driver by calling the kernel layer, and captures still images or videos through the camera.
图9示出了电子设备100的结构示意图。FIG. 9 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 processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, and a sensor module 1 80, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
可以理解的是,本发明实施例示意的结构并不构成对电子设备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 processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。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 processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
在一些实施例中,处理器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, processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver/transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a universal input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and/or universal serial bus (universal serial bus, USB) interface, etc.
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备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.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
电子设备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. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏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 can be a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (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), a flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (qu antum 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可以通过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.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。The internal memory 121 may be used to store computer-executable program codes including instructions. The internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
压力传感器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.
触摸传感器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 .
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction and execution process between the above-mentioned devices/units are based on the same concept as the method embodiment of the present application, and its specific functions and technical effects can be found in the method embodiment section, and will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may physically exist separately, or two or more units may be integrated into one unit, and the above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/电子设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,RandomAccess Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, all or part of the processes in the methods of the above-mentioned embodiments in the present application can be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments can be realized. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program codes to the photographing device/electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. Such as U disk, mobile hard disk, magnetic disk or optical disk, etc.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed device/network device and method may be implemented in other ways. For example, the device/network device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。Finally, it should be noted that: the above is only a specific implementation of the application, but the protection scope of the application is not limited thereto, and any changes or replacements within the technical scope disclosed in the application should be covered within the protection scope of the application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210886243.4A CN115442517B (en) | 2022-07-26 | 2022-07-26 | Image processing method, electronic device, and computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210886243.4A CN115442517B (en) | 2022-07-26 | 2022-07-26 | Image processing method, electronic device, and computer-readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115442517A CN115442517A (en) | 2022-12-06 |
CN115442517B true CN115442517B (en) | 2023-07-25 |
Family
ID=84241131
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210886243.4A Active CN115442517B (en) | 2022-07-26 | 2022-07-26 | Image processing method, electronic device, and computer-readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115442517B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116680001B (en) * | 2022-12-20 | 2024-12-10 | 荣耀终端有限公司 | Camera application startup method, readable storage medium and electronic device |
CN116703692B (en) * | 2022-12-30 | 2024-06-07 | 荣耀终端有限公司 | Shooting performance optimization method and device |
CN118447108B (en) * | 2023-12-28 | 2025-02-21 | 荣耀终端有限公司 | Data processing method and electronic equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101904166A (en) * | 2007-12-19 | 2010-12-01 | 伊斯曼柯达公司 | Camera using preview image to select exposure |
CN113132626A (en) * | 2021-03-26 | 2021-07-16 | 联想(北京)有限公司 | Image processing method and electronic equipment |
CN113645410A (en) * | 2018-04-09 | 2021-11-12 | 深圳市大疆创新科技有限公司 | Image acquisition method, device and machine-readable storage medium |
Family Cites Families (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE3518887C1 (en) * | 1985-05-25 | 1986-09-18 | Ernst Leitz Wetzlar Gmbh, 6330 Wetzlar | Method and arrangement for automatically determining and setting taking parameters in a photographic camera |
JP2001209785A (en) * | 1999-11-19 | 2001-08-03 | Fujitsu Ltd | Image processing apparatus, image processing method, and image processing program storage medium |
US7433089B2 (en) * | 2001-09-27 | 2008-10-07 | Fujifilm Corporation | Image processor |
JP3822486B2 (en) * | 2001-11-22 | 2006-09-20 | 富士写真フイルム株式会社 | Electronic camera and signal processing method |
US8964054B2 (en) * | 2006-08-18 | 2015-02-24 | The Invention Science Fund I, Llc | Capturing selected image objects |
US8194993B1 (en) * | 2008-08-29 | 2012-06-05 | Adobe Systems Incorporated | Method and apparatus for matching image metadata to a profile database to determine image processing parameters |
US20120033101A9 (en) * | 2008-11-12 | 2012-02-09 | Xiaoguang Yu | Apparatus and methods for controlling image sensors |
CN105357360A (en) * | 2014-08-19 | 2016-02-24 | 中兴通讯股份有限公司 | Mobile terminal, and method and device for automatically identifying external camera of mobile terminal |
JP6540155B2 (en) * | 2015-03-27 | 2019-07-10 | 沖電気工業株式会社 | Image processing apparatus, method and program, and image processing system |
CN106303248A (en) * | 2016-08-25 | 2017-01-04 | 北京小米移动软件有限公司 | Photographic method and device |
CN108270958B (en) * | 2016-12-30 | 2021-03-23 | 浙江舜宇智能光学技术有限公司 | Camera module self-adaptive system and self-adaptive method thereof |
KR102401659B1 (en) * | 2017-03-23 | 2022-05-25 | 삼성전자 주식회사 | Electronic device and method for processing video according to camera photography environment and scene using the same |
CN107809591B (en) * | 2017-11-13 | 2019-09-10 | Oppo广东移动通信有限公司 | Shoot method, apparatus, terminal and the storage medium of image |
CN108322651B (en) * | 2018-02-11 | 2020-07-31 | Oppo广东移动通信有限公司 | Photographing method and device, electronic equipment and computer readable storage medium |
CN109547701B (en) * | 2019-01-04 | 2021-07-09 | Oppo广东移动通信有限公司 | Image capturing method, device, storage medium and electronic device |
CN109951633B (en) * | 2019-02-18 | 2022-01-11 | 华为技术有限公司 | Method for shooting moon and electronic equipment |
CN110730287B (en) * | 2019-10-24 | 2021-07-30 | 深圳市道通智能航空技术股份有限公司 | Detachable gimbal camera, aircraft, system and gimbal dismantling method thereof |
CN110677557B (en) * | 2019-10-28 | 2022-04-22 | Oppo广东移动通信有限公司 | Image processing method, image processing device, storage medium and electronic equipment |
CN111327824B (en) * | 2020-03-02 | 2022-04-22 | Oppo广东移动通信有限公司 | Method, device, storage medium and electronic device for selecting shooting parameters |
CN111277779B (en) * | 2020-03-05 | 2022-05-06 | Oppo广东移动通信有限公司 | Video processing method and related device |
CN111818263B (en) * | 2020-07-09 | 2022-01-11 | Oppo广东移动通信有限公司 | Shooting parameter processing method and device, mobile terminal and storage medium |
CN114640783B (en) * | 2020-12-15 | 2024-03-05 | 华为技术有限公司 | Photographing method and related equipment |
CN113411510B (en) * | 2021-06-21 | 2022-08-12 | 北京清影机器视觉技术有限公司 | Camera automatic exposure algorithm based on image quality evaluation and red hot forging |
-
2022
- 2022-07-26 CN CN202210886243.4A patent/CN115442517B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101904166A (en) * | 2007-12-19 | 2010-12-01 | 伊斯曼柯达公司 | Camera using preview image to select exposure |
CN113645410A (en) * | 2018-04-09 | 2021-11-12 | 深圳市大疆创新科技有限公司 | Image acquisition method, device and machine-readable storage medium |
CN113132626A (en) * | 2021-03-26 | 2021-07-16 | 联想(北京)有限公司 | Image processing method and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN115442517A (en) | 2022-12-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114205522B (en) | A telephoto shooting method and electronic device | |
CN115442517B (en) | Image processing method, electronic device, and computer-readable storage medium | |
CN114327666B (en) | Application starting method and device and electronic equipment | |
CN113986070A (en) | A kind of quick view method and electronic device of application card | |
CN114816167B (en) | Application icon display method, electronic device and readable storage medium | |
WO2023056795A1 (en) | Quick photographing method, electronic device, and computer readable storage medium | |
CN115689963B (en) | An image processing method and electronic device | |
CN113709355B (en) | Sliding zoom shooting method and electronic equipment | |
CN117689974A (en) | Training method for image classification model, electronic equipment and readable storage medium | |
CN117077703A (en) | Image processing method and electronic equipment | |
CN115589539B (en) | Image adjustment method, device and storage medium | |
WO2023035868A1 (en) | Photographing method and electronic device | |
CN116009802A (en) | Page display method, electronic device, and computer-readable storage medium | |
WO2024152676A1 (en) | Window management method and electronic device | |
WO2024067551A1 (en) | Interface display method and electronic device | |
CN117519864A (en) | Interface display method, electronic device and storage medium | |
CN117135448A (en) | Shooting method and electronic equipment | |
CN118069262A (en) | Window adjusting method and related device | |
CN115543276A (en) | Method, system and electronic equipment for realizing software development | |
CN117152022B (en) | Image processing method and electronic equipment | |
CN114816311B (en) | Screen movement method and device | |
US20250251891A1 (en) | Display method for foldable screen and electronic device | |
CN118550621A (en) | Screen capturing method and electronic equipment | |
WO2023072113A1 (en) | Display method and electronic device | |
CN118550619A (en) | Image display method and electronic 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 |