WO2017076199A1 - 一种相机应用的图像预览方法、装置及相机应用系统 - Google Patents
一种相机应用的图像预览方法、装置及相机应用系统 Download PDFInfo
- Publication number
- WO2017076199A1 WO2017076199A1 PCT/CN2016/103325 CN2016103325W WO2017076199A1 WO 2017076199 A1 WO2017076199 A1 WO 2017076199A1 CN 2016103325 W CN2016103325 W CN 2016103325W WO 2017076199 A1 WO2017076199 A1 WO 2017076199A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- display module
- framework
- hal
- module
- Prior art date
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/60—Control of cameras or camera modules
- H04N23/698—Control of cameras or camera modules for achieving an enlarged field of view, e.g. panoramic image capture
-
- 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/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
-
- 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
Definitions
- the present application relates to computer technology, and in particular, to an image preview method, device, and camera application system for a camera application.
- the application can be an application such as a QQ, a universal camera, a super camera, etc.
- the mobile device can be a device such as a mobile phone or a tablet computer. It is a mode such as photographing, photographing, panoramic, etc.; in the present application, these applications capable of calling a camera of a mobile device to perform different modes of shooting are collectively referred to as a camera application.
- many camera applications provide image processing functions, such as beauty processing.
- image processing functions such as beauty processing.
- many camera applications provide a real-time preview function, for example, a beauty preview; that is, when the camera is facing the user's face, the user displayed on the screen The face is a preview image that has been beautifully processed.
- the method for implementing the image preview function of the camera application is as shown in FIG. 1: S101, adding an image processing function to the HAL (Hardware Adapter Layer) of the camera; S102, HAL acquiring a preview image, and then Image processing is performed; S103, the processed image is output to the display module of the HAL for display. Since HAL relies on various platforms such as MTK, Qualcomm, Spreadtrum, etc., the implementation methods of image preview functions of camera applications of different platforms in the prior art are quite different.
- the image preview scheme of the prior art camera application relies on the HAL of each platform, and the implementation of the code is highly different and the compatibility is poor.
- An image previewing method, a device, and a camera application system for a camera application are provided to solve the problem of poor compatibility of an image previewing scheme of a camera application in the prior art.
- an image preview method for a camera application including: triggering The frame framework receives the image acquired by the hardware adaptation layer HAL; processes the image to obtain the processed image; and outputs the processed image to the display module corresponding to the Framework layer for display.
- an image preview apparatus for a camera application including: a triggering module, configured to trigger a frame framework to receive an image acquired by a HAL; and an image processing module configured to process the image and obtain the image The image is output; the first output module is configured to output the processed image to a display module corresponding to the Framework layer for display.
- a camera application system comprising: the image preview device of the camera application described above.
- the image preview method of the camera application in the embodiment of the present application can implement image preview in combination with the Framework layer. Since the framework is a system-owned framework and does not depend on the platform, it can be used across platforms and mobile phones, thereby improving compatibility.
- FIG. 1 is a flow chart of a method for implementing an image preview function of a camera application in the prior art
- FIG. 2 is a flowchart of an image preview method of a camera application according to Embodiment 1 of the present application;
- FIG. 3 is a flowchart of an image preview method of a camera application according to Embodiment 2 of the present application;
- FIG. 4 is a flowchart of an image preview method of a camera application according to Embodiment 3 of the present application.
- FIG. 5 is a schematic structural diagram of an image preview apparatus applied to a camera according to Embodiment 4 of the present application;
- FIG. 6 is a schematic structural diagram of a camera application system according to Embodiment 5 of the present application.
- HAL depends on MTK, Qualcomm, Spreadtrum, and other platforms, so the implementation methods of the image preview function of camera applications of different platforms in the prior art are quite different.
- the solution in the prior art relies on the HAL of each platform, and the implementation of the code is large and the compatibility is poor.
- the solution in the prior art cannot be implemented.
- an image preview method for a camera application is provided in the embodiment of the present application.
- the image acquired by the HAL is processed correspondingly and displayed, thereby being able to combine the Framework layer.
- Image preview is implemented. Since the framework is a system-owned framework and does not depend on the platform, it can be used across platforms and mobile phones, improving compatibility.
- the solution in the embodiment of the present application may be implemented in a hardware underlayer of a camera application, such as a Framework layer, or in an operating system layer.
- the solution in the embodiment of the present application may be applied to a camera application, which may be a third-party camera application such as Camera360, a universal camera, a super camera, or the like, or may be a hardware manufacturer such as Huawei, Samsung, Lenovo, Coolpad, Huawei, etc.
- the built-in camera application can also be a camera application such as an operating system such as an OS (Operating System), a Huawei ROM (Android third-party operating system), a Baidu ROM, and the like.
- FIG. 2 is a flowchart of an image preview method of a camera application according to Embodiment 1 of the present application.
- the image preview method of the camera application according to the first embodiment of the present application includes the following steps:
- the trigger frame Framework receives an image acquired by the hardware adaptation layer HAL.
- the framework can receive the image acquired by the HAL through the image backhaul component of the HAL (which is a standard function supported by all platforms).
- a plurality of image processing methods commonly used by those skilled in the art may be used to process images in various modes, such as beauty, nostalgia, rinsing, black and white, candlelight, etc. No restrictions.
- the Framework may be an operating system self-contained framework such as an Android Android system, which may be used to apply an APK to the camera to control the interface of the camera hardware.
- the image preview method of the camera application in the embodiment of the present application is connected with the framework.
- the port can employ a variety of logic and names, as will be understood by those skilled in the art, as long as the image can be displayed to the display module.
- the image preview method of the camera application in the embodiment of the present application may be implemented in the form of source code, or may be called by the framework in the form of a static library or a dynamic library.
- the display module may be a software function module for display, created by a camera application.
- the display module may be set in advance for the framework, and the display module may be a SurfaceTexture in the Android system.
- the display module can be set to the Framework layer by setting the display module of the HAL as the display module of the Framework; more specifically, the handle user of the display module of the HAL can be modified into a Framework; for example, in the Android system In the middle, the handle of the SurfaceTexture is changed from the original HAL to the Framework.
- This single display module mode can also achieve the effect of the scheme on some platforms, that is, although the display logic of the HAL is modified (ie, the HAL is no longer displayed), but also on platforms such as MTK, Qualcomm, and Samsung Exynos. Can run.
- a display module for the Framework layer by creating a new display module and setting the created display module as the display module of the Framework.
- a new SurfaceTexture can be created by calling the UI (User Interface) interface in the application layer of the Android system.
- the method before the triggering framework receives the image acquired by the hardware adaptation layer HAL, the method further includes: acquiring an image preview mode of the camera application, where the image preview mode includes a processing mode and a non-processing mode.
- the image preview mode of the camera application may be set by the user, or may be set by default by the camera application, which is not limited in this application.
- the processing mode may be that the camera is required to provide the processed image for preview by the user
- the non-processing mode may be that the camera is required to provide the original HAL layer acquired image for preview by the user.
- the image preview mode setting can provide users with more kinds of preview modes to enhance the user experience.
- the image preview mode may be processed.
- the display module of the HAL is hidden; at the same time, the processed image is output to the display module of the Framework for display.
- the display module of the HAL can be hidden by setting the parameters of the display module of the HAL.
- the transparency of the display module of the HAL is set to 100%, or the size of the display module of the HAL may be set to a very small manner, for example, 1 ⁇ 1 pixels; and the display module of the HAL may be placed in the display screen.
- the display module of the HAL is placed at a fixed position outside the viewable area, for example, at the top right corner of the view area (0, -9999) in the upper right corner of the viewable area.
- the display module of the HAL can also be hidden by setting the parameters of the display module of the framework.
- the position of the display module of the framework is set on the display module of the HAL, and the transparency of the display module of the Framework is also Set to 0%. Since the code of the HAL display module is not modified, and the running logic of the HAL is not modified, that is, the running logic of the HAL is not affected by setting certain parameters; therefore, the HAL is not relied on, so the cross-platform capability is greatly enhanced.
- the image preview mode when the dual display module mode of the display module is added in the framework, in order to avoid the influence between the display module of the HAL and the framework display module, the image preview mode may be non- When the mode is processed, the display module of the Framework is hidden; and the image captured by the HAL is output to the display module of the HAL for display.
- the display module of the framework can be hidden in various ways, for example, the transparency of the display module of the framework is set to 100%, or the position of the display module of the HAL is set on the display module of the framework, and HAL's display module's transparency is set to 0%; you can also set the size of the Framework's display module to a very small way, such as 1x1 pixels; you can also use the user's visual area to place the Framework's display module into the display screen.
- the display module of the Framework is set at a fixed position outside the visible area, for example, at the top right corner of the visible area (0, -9999).
- the processed image when the image is included in the image captured by the HAL, the processed image may be a post-make image; and processing the image may specifically include: identifying the image captured by the HAL.
- the image preview method of the camera application in the embodiment of the present application can implement image preview in combination with the Framework layer. Since the framework is a system-owned framework and does not depend on the platform, it can be used across platforms and mobile phones, thereby improving compatibility.
- the image preview is implemented in the camera application APK layer, and the transfer of the preview image to the APK requires a cross-process transmission and at least one JNI (Java Native Interface) copy, which takes a long time and affects the user experience. .
- JNI Java Native Interface
- the image preview method of the camera application in the embodiment of the present application is not required to be combined with the Framework layer. Viewing the cross-process transfer and JNI copy of the image is better than the smoothness of the APK, and the use time is shorter, which improves the user experience.
- FIG. 3 is a flowchart of an image preview method of a camera application according to Embodiment 2 of the present application.
- a method of setting a display module of the HAL as a single display module of a display module of the framework is adopted.
- the image preview method of the camera application according to the second embodiment of the present application includes the following steps:
- S301 Receive an image preview mode selected by a user.
- steps S304-S305 are performed; if it is the "beauty" processing mode, then steps S306-S307 are performed;
- step S305 the user sees an unprocessed image displayed by the display module of the Framework layer.
- step S307. Output the image processed by the beauty to the display module of the Framework layer for display. At this point, the image preview of the processing mode ends. After performing step S307, the user sees the beautifully processed image displayed in the display module of the Framework layer.
- FIG. 4 is a flowchart of an image preview method of a camera application according to Embodiment 3 of the present application.
- the image preview method of the camera application according to Embodiment 3 of the present application includes the following steps:
- S401 Receive an image preview mode selected by a user.
- steps S404 and S405 are performed; If it is a "beauty" processing mode, then steps S406 and S407 are performed;
- step S405 the user sees an unprocessed image displayed in the display module of the HAL.
- steps S404 and S405 there is no strict time sequence between steps S404 and S405, and S404 may be performed first, and then S405 may be performed; or S405 may be performed first, and then S404 is performed.
- step S407 the user sees the beautifully processed image displayed in the display module of the Framework layer.
- steps S406 and S407 there is no strict time sequence between steps S406 and S407, and S406 may be performed first, and then S407 may be performed; or S406 may be performed first, and then S407 is performed.
- the display module such as the SurfaceTextue in the Android system
- the creation, hiding, display, and the like of the display module are not dependent on the platform, thereby improving the cross-platform capability of the embodiment of the present application.
- the image preview method of the camera application in the embodiment of the present application can implement image preview in combination with the Framework layer. Since the framework is a system-owned framework and does not depend on the platform, it can be used across platforms and mobile phones, thereby improving compatibility.
- an image preview device for a camera application is also provided in the embodiment of the present application. Since the principle of solving the problem is similar to the method provided by the embodiment of the present application, the implementation of the device can refer to the implementation of the method. , the repetition will not be repeated.
- FIG. 5 is a schematic structural diagram of an image preview apparatus applied to a camera according to Embodiment 4 of the present application.
- the image preview apparatus 500 of the camera application includes: a triggering module 501, configured to trigger a framework to receive an image acquired by the hardware adaptation layer HAL; and an image processing module 502.
- the image is processed to obtain a processed image;
- the first output module 503 is configured to output the processed image to a display module corresponding to the Framework layer for display.
- the image preview device of the camera application according to the second embodiment of the present application further includes: a setting module, Used to set the display module for the Framework.
- the creation module is specifically configured to set the HAL's SurfaceTexture to the SurfaceTexture of the Framework.
- the creating module is specifically configured to set the display module of the HAL as the display module of the framework.
- the setting module is specifically configured to modify the handle user of the display module of the HAL to the Framework.
- the setting module specifically includes: creating a sub-module for creating a display module; and setting a sub-module for setting the created display module as a display module of the framework.
- the image preview apparatus of the camera application further includes: a mode acquisition module, configured to acquire an image preview mode of the camera application, where the image preview mode includes a processing mode and a non-processing mode.
- a mode acquisition module configured to acquire an image preview mode of the camera application, where the image preview mode includes a processing mode and a non-processing mode.
- the image preview device of the camera application when the image preview mode is the processing mode, the image preview device of the camera application according to the second embodiment of the present application further includes: a first hidden module for hiding the display module of the HAL.
- the image preview device of the camera application when the image preview mode is the non-processing mode, further includes: a second hiding module, configured to hide the display module of the framework.
- a second hiding module configured to hide the display module of the framework.
- the device further includes: a second output module, configured to output the image acquired by the HAL to the display module corresponding to the HAL for display.
- a second output module configured to output the image acquired by the HAL to the display module corresponding to the HAL for display.
- the image acquired by the HAL includes a human face; the processed image is a post-make image; the image processing module specifically includes: an identification sub-module for recognizing a face in the image captured by the HAL; and a beauty sub-module, Used to make facial treatments for faces.
- the image preview device of the camera application in the embodiment of the present application can realize the beauty preview of the face in combination with the Framework layer. Since the framework is a system-equipped framework and does not depend on the platform, it can be used across platforms and mobile phones. compatibility.
- a camera application system is also provided in the embodiment of the present application. Since the principle of solving the problem is similar to the method provided by the embodiment of the present application, the implementation of the system can refer to the implementation of the method, and the method is repeated. I won't go into details here.
- FIG. 6 is a schematic structural diagram of a camera application system according to Embodiment 5 of the present application.
- the camera application system 600 includes an image preview device 500 for a camera application.
- the camera application system in the embodiment of the present application can realize the beauty preview of the face in the framework
- the Framework is a system-owned framework that does not depend on the platform, so it can be used across platforms and across mobile phones, improving compatibility.
- embodiments of the present application can be provided as a method, system, or computer program product.
- the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware.
- the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
- Telephone Function (AREA)
Abstract
本申请实施例中提供了一种相机应用的图像预览方法、装置及相机应用系统,该方法包括:触发框架Framework接收硬件适配层HAL采集的图像;对图像进行处理,得到处理后的图像;将处理后的图像输出至Framework层对应的显示模块以进行显示。采用本申请实施例中的方案,能够解决现有技术中的相机应用的图像预览方案兼容性较差的问题。
Description
本申请要求2015年11月04日递交的申请号为201510740764.9发明名称为“一种相机应用的图像预览方法、装置及相机应用系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机技术,具体涉及一种相机应用的图像预览方法、装置及相机应用系统。
目前已有多种应用能够调用移动设备相机以进行不同模式的拍摄,该应用可以是如QQ、全能相机、超级相机等应用,该移动设备可以是如手机、平板电脑等的设备,该模式可以是如拍照、摄像、全景等模式;本申请中将这些能够调用移动设备的相机进行不同模式的拍摄的应用统称为相机应用。
为了使用户拍摄的图像能够更好看,很多相机应用提供了图像处理功能,例如美颜处理。同时,为了使用户能够在拍摄之前了解经图像处理之后的效果,很多相机应用都提供了实时预览功能,例如,美颜预览;即,当摄像头对着用户脸部时,屏幕上显示的用户的脸是已经美颜处理的预览图像。
在现有技术中,相机应用的图像预览功能的实现方法流程如图1所示:S101,在相机的HAL(Hardware Adapter Layer硬件适配层)增加图像处理功能;S102,HAL采集预览图像,然后进行图像处理;S103,将处理后的图像输出至HAL的显示模块进行显示。由于HAL依赖于如MTK、高通、展讯等的各个平台,所以现有技术中的不同平台的相机应用的图像预览功能的实现方法差异较大。
现有技术相机应用的图像预览方案依赖于各平台的HAL,代码的实现差异性大,兼容性较差。
发明内容
本申请实施例中提供了一种相机应用的图像预览方法、装置及相机应用系统,用于解决现有技术中的相机应用的图像预览方案兼容性较差的问题。
根据本申请实施例的一个方面,提供了一种相机应用的图像预览方法,包括:触发
框架Framework接收硬件适配层HAL采集的图像;对图像进行处理,得到处理后的图像;将处理后的图像输出至Framework层对应的显示模块以进行显示。
根据本申请实施例的另一个方面,提供了一种相机应用的图像预览装置,包括:触发模块,用于触发框架Framework接收HAL采集的图像;图像处理模块,用于对图像进行处理,得到处理后的图像;第一输出模块,用于将处理后的图像输出至Framework层对应的显示模块以进行显示。
根据本申请实施例的再一个方面,提供了一种相机应用系统,包括:上述的相机应用的图像预览装置。
采用本申请实施例中的相机应用的图像预览方法,能够结合Framework层实现图像预览,由于Framework是系统自带框架,不依赖于平台,因此能够跨平台、跨手机使用,提升了兼容性。
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为现有技术中的相机应用的图像预览功能的实现方法流程图;
图2为本申请实施例一所示的相机应用的图像预览方法的流程图;
图3为本申请实施例二所示的相机应用的图像预览方法的流程图;
图4为本申请实施例三所示的相机应用的图像预览方法的流程图;
图5为本申请实施例四所示相机应用的图像预览装置的结构示意图;
图6为本申请实施例五所示相机应用系统的结构示意图。
为了使本申请实施例中的技术方案及优点更加清楚明白,以下结合附图对本申请的示例性实施例进行进一步详细的说明,显然,所描述的实施例仅是本申请的一部分实施例,而不是所有实施例的穷举。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
在实现本申请的过程中,申请人发现,在现有技术中,相机应用的图像预览功能的实现方法如图1所示:在相机的HAL增加图像处理功能;HAL采集预览图像,然后进行图像处理,将处理后的图像输出至HAL的显示模块进行显示。由于HAL依赖于如
MTK、高通、展讯等的各个平台,所以现有技术中的不同平台的相机应用的图像预览功能的实现方法差异较大。现有技术中的方案依赖于各平台的HAL,代码的实现差异性大,兼容性较差。另外,对于不开放源代码的三方手机,由于无法获得HAL源代码,所以现有技术中的方案无法实施。
针对上述问题,本申请实施例中提供了一种相机应用的图像预览方法,通过在Framework层增加图像处理功能和显示模块来对HAL采集的图像进行相应处理,并进行显示,从而能够结合Framework层实现图像预览,由于Framework是系统自带框架,不依赖于平台,因此能够跨平台、跨手机使用,提升了兼容性。
本申请实施例中的方案可以在相机应用的硬件底层如Framework层实现,也可以在操作系统层实现。
本申请实施例中的方案可以应用于相机应用中,该相机应用可以是如Camera360、全能相机、超级相机等的第三方相机应用,也可以是如小米、三星、联想、酷派、华为等硬件厂商的内置相机应用,还可以是如云OS(Operating System,操作系统)等操作系统、小米ROM(Android第三方操作系统)、百度ROM等第三方操作系统自带的相机应用。
实施例一
图2为本申请实施例一所示的相机应用的图像预览方法的流程图。
如图2所示,根据本申请实施例一所示的相机应用的图像预览方法包括以下步骤:
S201,触发框架Framework接收硬件适配层HAL采集的图像;
S202,对图像进行处理,得到处理后的图像;
S203,将处理后的图像输出至Framework层对应的显示模块SurfaceTexture以进行显示。
在S201的一种具体实施方式中,可以通过HAL的图像回传组件(该功能是标准功能,所有平台都支持)来触发Framework接收HAL采集的图像。
在S202的一种具体实施方式中,可以采用本领域技术人员常用的多种图像处理方式以对图像进行多种模式的处理,如美颜、怀旧、冲洗、黑白、烛光等,本申请对此不作限制。
在具体实施时,Framework可以是如安卓Android系统的操作系统自带框架,该框架可以用于向相机应用APK控制相机硬件的接口。
在具体实施时,本申请实施例中的相机应用的图像预览方法与Framework之间的接
口可以采用多种逻辑和名称,本领域技术人员应当理解,只要能够将图像显示到显示模块即可。
在具体实施时,本申请实施例中的相机应用的图像预览方法可以以源代码的形式实现,也可以以静态库、动态库的形式被Framework调用。
在具体实施时,显示模块可以是用于显示的软件功能模块,由相机应用创建。
在本申请实施例中,在步骤203之前,还可以预先为Framework设置显示模块,该显示模块可以是安卓系统中的SurfaceTexture。
在具体实施时,可以采用将HAL的显示模块设置为Framework的显示模块的方式为Framework层设置显示模块;更具体地,可以将HAL的显示模块的句柄使用者修改为Framework;例如,在安卓系统中,将SurfaceTexture的句柄使用者由原来的HAL改为Framework。这种单显示模块方式在某些平台上也能达到该方案的效果,即,虽然修改了HAL的显示逻辑(即HAL不再进行显示),但是在例如MTK、高通、三星Exynos的平台上也是可以运行的。
在具体实施时,还可以采用创建新的显示模块,并将创建的显示模块设置为Framework的显示模块的方式为Framework层设置显示模块。在具体实施时,可以通过在安卓系统的应用层调用UI(User Interface,用户界面)接口创建新的SurfaceTexture。采用在Framework新增显示模块的双显示模块方式,能够避免对HAL的显示逻辑进行修改,能够更好的跨平台。
在本申请实施例的另一具体实施方式中,在触发框架Framework接收硬件适配层HAL采集的图像之前,还可以包括:获取相机应用的图像预览模式,该图像预览模式包括处理模式和非处理模式。
在具体实施时,相机应用的图像预览模式可以是由用户设置的,也可以是由相机应用默认设置的,本申请对此不作限制。在具体实施时,处理模式可以是要求相机提供处理后的图像供用户预览,非处理模式可以是要求相机提供原始的HAL层采集的图像供用户预览。通过图像预览模式的设置可以向用户提供更多种的预览模式,提升用户体验。
在本申请实施例的另一具体实施方式中,在采用在Framework新增显示模块的双显示模块方式时,为了避免HAL的显示模块与Framework显示模块之间的影响,可以在图像预览模式为处理模式时,隐藏HAL的显示模块;同时,将处理后的图像输出至Framework的显示模块进行显示。
在具体实施时,可以通过设置HAL的显示模块的参数来实现隐藏HAL的显示模块,
例如,将HAL的显示模块的透明度设置为100%,或者,还可以采用将HAL的显示模块的尺寸设置为非常小的方式,例如1x1像素;还可以采用将HAL的显示模块放置到显示屏幕中的用户可视区域之外的方式,例如,将HAL的显示模块设置在可视区域之外的某一个固定位置上,例如,在可视区域右上角离页面顶端(0,-9999)。
在具体实施时,还可以通过对Framework的显示模块的参数进行设置来隐藏HAL的显示模块,例如,将Framework的显示模块的位置设置于HAL的显示模块之上,同时将Framework的显示模块的透明度设置为0%。由于未对HAL的显示模块的代码进行修改,并且未修改HAL的运行逻辑,即没有通过设置某些参数来影响HAL的运行逻辑;因此不依赖于HAL,所以跨平台能力大大增强。
在本申请实施例的另一具体实施方式中,在采用在Framework新增显示模块的双显示模块方式时,为了避免HAL的显示模块与Framework显示模块之间的影响,可以在图像预览模式为非处理模式时,隐藏Framework的显示模块;并将HAL采集的图像输出至HAL的显示模块进行显示。
在具体实施时,可以采用多种方式来隐藏Framework的显示模块,例如,将Framework的显示模块的透明度设置为100%,或者,将HAL的显示模块的位置设置于Framework的显示模块之上,且HAL的显示模块的透明度设置为0%;还可以采用将Framework的显示模块的尺寸设置为非常小的方式,例如1x1像素;还可以采用将Framework的显示模块放置到显示屏幕中的用户可视区域之外的方式,例如,将Framework的显示模块的设置在可视区域之外的某一个固定位置上,例如,在可视区域右上角离页面顶端(0,-9999)。
在本申请实施例的一种具体实施方式中,在HAL采集的图像中包括人脸时;处理后的图像可以为美颜后的图像;对图像进行处理可以具体包括:识别HAL采集的图像中的人脸;对人脸进行美颜处理。
采用本申请实施例中的相机应用的图像预览方法,能够结合Framework层实现图像预览,由于Framework是系统自带框架,不依赖于平台,因此能够跨平台、跨手机使用,提升了兼容性。
另外,与相关技术中在相机应用APK层实现图像预览相比,将预览图像传输到APK需要进行一次跨进程传输和至少一次JNI(JavaNativeInterface,JAVA本地调用)拷贝,耗时较长,影响用户体验。
而采用本申请实施例中的相机应用的图像预览方法,结合Framework层不需要待预
览图像的跨进程传输和JNI拷贝,比在APK实现的流畅性要好,用时也较短,提升了用户体验。
下面将以具体的应用实例为例,对本申请实施例中的图像预览方法的流程进行说明。
实施例二
图3为本申请实施例二所示的相机应用的图像预览方法的流程图。
在本申请实施例二中,采用将HAL的显示模块设置为Framework的显示模块的单显示模块的方式。
如图3所示,根据本申请实施例二所示的相机应用的图像预览方法包括以下步骤:
S301,接收用户选择的图像预览模式;
S302,HAL采集图像后,将图像输出至Framework层;
S303,如果用户选择的图像预览模式为非处理模式,则执行步骤S304-S305;如果为“美颜”处理模式,则执行步骤S306-S307;
S304,在Framework层对图像做透传处理,即,不对图像进行处理,直接输出输入的图像;
S305,将透传处理的图像输出至Framework层的显示模块进行显示。至此,非处理模式的图像预览结束。
在执行步骤S305之后,用户看到的是Framework层的显示模块显示的未处理图像。
S306,结合Framework层对图像做美颜处理;
S307,将美颜处理后的图像输出至Framework层的显示模块进行显示。至此,处理模式的图像预览结束。在执行步骤S307之后,用户看到的是Framework层的显示模块中显示的经美颜处理后的图像。
实施例三
图4为本申请实施例三所示的相机应用的图像预览方法的流程图。
在本申请实施例三中,采用为Framework创建新的显示模块的双显示模块的方式。
如图4所示,根据本申请实施例三所示的相机应用的图像预览方法包括以下步骤:
S401,接收用户选择的图像预览模式;
S402,HAL采集图像后,将图像输出至HAL的显示模块和Framework层;
S403,如果用户选择的图像预览模式为非处理模式,则执行步骤S404和S405;如
果为“美颜”处理模式,则执行步骤S406和S407;
S404,在Framework层对图像进行透传处理,即,不对图像进行处理,直接输出输入的图像,并将透传后的图像输出至Framework层的显示模块;
S405,触发隐藏Framework的显示模块。至此,非处理模式的图像预览结束。
在执行步骤S405之后,用户看到的是HAL的显示模块中显示的未处理图像。
在具体实施时,步骤S404和S405之间并没有严格的时间顺序,可以先执行S404,再执行S405;也可以先执行S405,再执行S404。
S406,结合Framework层对图像进行美颜处理,并将美颜后的图像输出至Framework层的显示模块;
S407,触发隐藏HAL的显示模块。至此,处理模式的图像预览结束。
在执行步骤S407之后,用户看到的是Framework层的显示模块中显示的经美颜处理后的图像。
在具体实施时,步骤S406和S407之间并没有严格的时间顺序,可以先执行S406,再执行S407;也可以先执行S406,再执行S407。
由于显示模块,如安卓系统中的SurfaceTextue,是操作系统提供的标准组件,所以对显示模块的创建、隐藏、显示等均不依赖于平台,因此提高了本申请实施例的跨平台能力。
采用本申请实施例中的相机应用的图像预览方法,能够结合Framework层实现图像预览,由于Framework是系统自带框架,不依赖于平台,因此能够跨平台、跨手机使用,提升了兼容性。
基于同一发明构思,本申请实施例中还提供了一种相机应用的图像预览装置,由于该装置解决问题的原理与本申请实施例所提供的方法相似,因此该装置的实施可以参见方法的实施,重复之处不再赘述。
实施例四
图5为本申请实施例四所示相机应用的图像预览装置的结构示意图。
如图5所示,根据本申请实施例四所示的相机应用的图像预览装置500,包括:触发模块501,用于触发框架Framework接收硬件适配层HAL采集的图像;图像处理模块502,用于对图像进行处理,得到处理后的图像;第一输出模块503,用于将处理后的图像输出至Framework层对应的显示模块以进行显示。
优选地,根据本申请实施例二所示的相机应用的图像预览装置还包括:设置模块,
用于为Framework设置显示模块。
可选地,创建模块具体用于将HAL的SurfaceTexture设置为Framework的SurfaceTexture。
优选地,创建模块具体用于将HAL的显示模块设置为Framework的显示模块。
优选地,设置模块具体用于将HAL的显示模块的句柄使用者修改为Framework。
优选地,设置模块具体包括:创建子模块,用于创建显示模块;设置子模块,用于将创建的显示模块设置为Framework的显示模块。
优选地,根据本申请实施例二所示的相机应用的图像预览装置还包括:模式获取模块,用于获取相机应用的图像预览模式,图像预览模式包括处理模式和非处理模式。
优选地,图像预览模式为处理模式时,根据本申请实施例二所示的相机应用的图像预览装置还包括:第一隐藏模块,用于隐藏HAL的显示模块。
优选地,图像预览模式为非处理模式时,根据本申请实施例二所示的相机应用的图像预览装置还包括:第二隐藏模块,用于隐藏Framework的显示模块。
优选地,所述装置还包括:第二输出模块,用于将HAL采集的图像输出至HAL对应的显示模块以进行显示。
优选地,HAL采集的图像中包括人脸;处理后的图像为美颜后的图像;图像处理模块具体包括:识别子模块,用于识别HAL采集的图像中的人脸;美颜子模块,用于对人脸进行美颜处理。
采用本申请实施例中的相机应用的图像预览装置,能够结合Framework层实现人脸的美颜预览,由于Framework是系统自带框架,不依赖于平台,因此能够跨平台、跨手机使用,提升了兼容性。
基于同一发明构思,本申请实施例中还提供了一种相机应用系统,由于该系统解决问题的原理与本申请实施例所提供的方法相似,因此该系统的实施可以参见方法的实施,重复之处不再赘述。
实施例五
图6为本申请实施例五所示相机应用系统的结构示意图。
如图6所示,根据本申请实施例五所示的相机应用系统600,包括:相机应用的图像预览装置500。
采用本申请实施例中的相机应用系统,能够在Framework实现人脸的美颜预览,由
于Framework是系统自带框架,不依赖于平台,因此能够跨平台、跨手机使用,提升了兼容性。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
Claims (21)
- 一种相机应用的图像预览方法,其特征在于,包括:触发框架Framework接收硬件适配层HAL采集的图像;对所述图像进行处理,得到处理后的图像;将处理后的图像输出至所述Framework层对应的显示模块以进行显示。
- 根据权利要求1所述的方法,其特征在于,在将处理后的图像输出至所述Framework层的显示模块以进行显示之前,还包括:为所述Framework设置显示模块。
- 根据权利要求2所述的方法,其特征在于,为所述Framework设置显示模块,具体包括:将所述HAL的显示模块设置为所述Framework的显示模块。
- 根据权利要求3所述的方法,其特征在于,将所述HAL的显示模块设置为所述Framework的显示模块,具体包括:将所述HAL的显示模块的句柄使用者修改为Framework。
- 根据权利要求2所述的方法,其特征在于,为所述Framework设置显示模块具体包括:创建显示模块;将创建的所述显示模块设置为所述Framework的显示模块。
- 根据权利要求1所述的方法,其特征在于,在触发框架Framework接收硬件适配层HAL采集的图像之前,还包括:获取所述相机应用的图像预览模式,所述图像预览模式包括处理模式和非处理模式。
- 根据权利要求6所述的方法,其特征在于,所述图像预览模式为处理模式时,所述方法还包括:隐藏所述HAL的显示模块。
- 根据权利要求6所述的方法,其特征在于,所述图像预览模式为非处理模式时,所述方法还包括:隐藏所述Framework的显示模块。
- 根据权利要求8所述的方法,其特征在于,所述方法还包括:将所述HAL采集的图像输出至所述HAL对应的显示模块以进行显示。
- 根据权利要求1所述的方法,其特征在于,所述HAL采集的图像中包括人脸;所述处理后的图像为美颜后的图像;对所述图像进行处理具体包括:识别所述HAL采集的图像中的人脸;对所述人脸进行美颜处理。
- 一种相机应用的图像预览装置,其特征在于,包括:触发模块,用于触发框架Framework接收HAL采集的图像;图像处理模块,用于对所述图像进行处理,得到处理后的图像;第一输出模块,用于将处理后的图像输出至所述Framework层对应的显示模块以进行显示。
- 根据权利要求11所述的装置,其特征在于,还包括:设置模块,用于为所述Framework设置显示模块。
- 根据权利要求12所述的装置,其特征在于,所述设置模块具体用于将所述HAL的显示模块设置为所述Framework的显示模块。
- 根据权利要求13所述的装置,其特征在于,所述设置模块具体用于将所述HAL的显示模块的句柄使用者修改为Framework。
- 根据权利要求12所述的装置,其特征在于,所述设置模块具体包括:创建子模块,用于创建显示模块;设置子模块,用于将创建的所述显示模块设置为所述Framework的显示模块。
- 根据权利要求11所述的装置,其特征在于,还包括:模式获取模块,用于获取所述相机应用的图像预览模式,所述图像预览模式包括处理模式和非处理模式。
- 根据权利要求16所述的装置,其特征在于,所述图像预览模式为处理模式时,所述装置还包括:第一隐藏模块,用于隐藏所述HAL的显示模块。
- 根据权利要求16所述的装置,其特征在于,所述图像预览模式为非处理模式时,所述装置还包括:第二隐藏模块,用于隐藏所述Framework的显示模块。
- 根据权利要求18所述的装置,其特征在于,所述装置还包括:第二输出模块,用于将所述HAL采集的图像输出至所述HAL对应的显示模块以进行显示。
- 根据权利要求11所述的装置,其特征在于,所述HAL采集的图像中包括人脸;所述处理后的图像为美颜后的图像;所述图像处理模块具体包括:识别子模块,用于识别所述HAL采集的图像中的人脸;美颜子模块,用于对所述人脸进行美颜处理。
- 一种相机应用系统,其特征在于,包括:如权利要求11-20中任一项所述的相机应用的图像预览装置。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510740764.9A CN106657757B (zh) | 2015-11-04 | 2015-11-04 | 一种相机应用的图像预览方法、装置及相机应用系统 |
CN201510740764.9 | 2015-11-04 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017076199A1 true WO2017076199A1 (zh) | 2017-05-11 |
Family
ID=58661669
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/103325 WO2017076199A1 (zh) | 2015-11-04 | 2016-10-26 | 一种相机应用的图像预览方法、装置及相机应用系统 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106657757B (zh) |
WO (1) | WO2017076199A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112770040A (zh) * | 2019-11-01 | 2021-05-07 | Oppo广东移动通信有限公司 | 一种拍摄方法、装置及计算机可读存储介质 |
CN113179369A (zh) * | 2021-04-08 | 2021-07-27 | 重庆传音通讯技术有限公司 | 拍摄画面的显示方法、移动终端及存储介质 |
CN115484386A (zh) * | 2021-06-16 | 2022-12-16 | 荣耀终端有限公司 | 一种视频拍摄方法及电子设备 |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109672884B (zh) * | 2017-10-13 | 2022-05-10 | 斑马智行网络(香港)有限公司 | 图像硬件编码处理方法和装置 |
CN108073399B (zh) * | 2017-12-28 | 2021-08-27 | 奇酷互联网络科技(深圳)有限公司 | 相机预览方法、装置、移动终端和计算机可读存储介质 |
CN111565282A (zh) * | 2020-05-11 | 2020-08-21 | Oppo(重庆)智能科技有限公司 | 一种拍摄控制处理方法、装置、设备及存储介质 |
CN114520868B (zh) * | 2020-11-20 | 2023-05-12 | 华为技术有限公司 | 视频处理方法、装置及存储介质 |
CN113194211B (zh) * | 2021-03-25 | 2022-11-15 | 深圳市优博讯科技股份有限公司 | 一种扫描头的控制方法及系统 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103442172A (zh) * | 2013-08-15 | 2013-12-11 | Tcl集团股份有限公司 | 一种基于android平台的相机画质调节方法、系统及移动终端 |
US20140092270A1 (en) * | 2012-09-28 | 2014-04-03 | Samsung Electronics Co., Ltd. | Method of reproducing multiple shutter sound and electric device thereof |
CN103905901A (zh) * | 2014-03-24 | 2014-07-02 | 珠海全志科技股份有限公司 | 基于android系统的视频开机方法、装置及播放设备 |
CN104657956A (zh) * | 2015-03-16 | 2015-05-27 | 龙旗电子(惠州)有限公司 | 一种实现智能手机图片美化功能的方法 |
CN104902177A (zh) * | 2015-05-26 | 2015-09-09 | 广东欧珀移动通信有限公司 | 一种智能拍照方法及终端 |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100525392C (zh) * | 2007-12-12 | 2009-08-05 | 北京中星微电子有限公司 | 摄像头视频图像处理的系统及其方法 |
CN201312356Y (zh) * | 2008-12-22 | 2009-09-16 | 沈逸林 | 数字电视网络媒体话机终端 |
KR101090981B1 (ko) * | 2011-05-09 | 2011-12-08 | 주식회사 쓰리디누리 | 3차원 영상신호 처리방법 및 이를 구현하는 휴대형 3차원 디스플레이 장치 |
EP2767952A3 (en) * | 2013-02-15 | 2017-11-01 | Samsung Electronics Co., Ltd. | Method and electronic device for processing object |
CN103279224A (zh) * | 2013-05-28 | 2013-09-04 | Tcl集团股份有限公司 | 触摸板操作的处理方法及系统 |
CN103593155B (zh) * | 2013-11-06 | 2016-09-07 | 华为终端有限公司 | 显示帧生成方法和终端设备 |
KR20150106719A (ko) * | 2014-03-12 | 2015-09-22 | 삼성전자주식회사 | 전자 장치의 촬영 위치 안내 방법 및 이를 이용한 전자 장치 |
CN104702909B (zh) * | 2014-04-17 | 2018-11-06 | 杭州海康威视数字技术股份有限公司 | 视频数据的处理方法及装置 |
CN104574260B (zh) * | 2015-01-09 | 2018-10-16 | 青岛海信移动通信技术股份有限公司 | 一种图像信息的生成方法和装置 |
-
2015
- 2015-11-04 CN CN201510740764.9A patent/CN106657757B/zh active Active
-
2016
- 2016-10-26 WO PCT/CN2016/103325 patent/WO2017076199A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140092270A1 (en) * | 2012-09-28 | 2014-04-03 | Samsung Electronics Co., Ltd. | Method of reproducing multiple shutter sound and electric device thereof |
CN103442172A (zh) * | 2013-08-15 | 2013-12-11 | Tcl集团股份有限公司 | 一种基于android平台的相机画质调节方法、系统及移动终端 |
CN103905901A (zh) * | 2014-03-24 | 2014-07-02 | 珠海全志科技股份有限公司 | 基于android系统的视频开机方法、装置及播放设备 |
CN104657956A (zh) * | 2015-03-16 | 2015-05-27 | 龙旗电子(惠州)有限公司 | 一种实现智能手机图片美化功能的方法 |
CN104902177A (zh) * | 2015-05-26 | 2015-09-09 | 广东欧珀移动通信有限公司 | 一种智能拍照方法及终端 |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112770040A (zh) * | 2019-11-01 | 2021-05-07 | Oppo广东移动通信有限公司 | 一种拍摄方法、装置及计算机可读存储介质 |
CN112770040B (zh) * | 2019-11-01 | 2022-05-13 | Oppo广东移动通信有限公司 | 一种拍摄方法、装置及计算机可读存储介质 |
CN113179369A (zh) * | 2021-04-08 | 2021-07-27 | 重庆传音通讯技术有限公司 | 拍摄画面的显示方法、移动终端及存储介质 |
CN115484386A (zh) * | 2021-06-16 | 2022-12-16 | 荣耀终端有限公司 | 一种视频拍摄方法及电子设备 |
CN115484386B (zh) * | 2021-06-16 | 2023-10-31 | 荣耀终端有限公司 | 一种视频拍摄方法及电子设备 |
Also Published As
Publication number | Publication date |
---|---|
CN106657757A (zh) | 2017-05-10 |
CN106657757B (zh) | 2020-06-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017076199A1 (zh) | 一种相机应用的图像预览方法、装置及相机应用系统 | |
KR101992306B1 (ko) | 카메라를 실행하기 위한 방법 및 그 전자 장치 | |
KR102327779B1 (ko) | 이미지 처리 방법 및 장치 | |
WO2017092335A1 (zh) | 一种显示立体图像的处理方法和装置 | |
WO2016180126A1 (zh) | 一种图像处理方法和装置 | |
AU2014402162B2 (en) | Method and apparatus for setting background of UI control, and terminal | |
WO2015192713A1 (zh) | 图片处理的方法、装置及移动终端、计算机存储介质 | |
TWI545508B (zh) | 用於執行臉部追蹤功能的方法及其電子裝置 | |
WO2017032233A1 (zh) | 一种图像生成方法及装置 | |
US20190095075A1 (en) | Method and apparatus for setting background picture of unlocking interface of application, and electronic device | |
WO2016107229A1 (zh) | 图标显示方法、装置和计算机存储介质 | |
TW201607325A (zh) | 用於執行視訊通話增強功能的方法及其電子裝置 | |
US11477426B2 (en) | Selective image broadcasting in a video conference | |
WO2023045941A1 (zh) | 图像处理方法及装置、电子设备和存储介质 | |
KR102082365B1 (ko) | 이미지 처리 방법 및 그 전자 장치 | |
CN107564085B (zh) | 图像扭曲处理方法、装置、计算设备及计算机存储介质 | |
CN111179299A (zh) | 一种图像处理方法及装置 | |
CN107748644A (zh) | 一种截图显示方法和设备、终端及可读存储介质 | |
TWI723119B (zh) | 相機應用的圖像預覽方法、裝置及相機應用系統 | |
WO2023151214A1 (zh) | 图像生成方法、系统、电子设备、存储介质和产品 | |
CN108604367A (zh) | 一种显示方法以及手持电子设备 | |
CN115967854A (zh) | 拍照方法、装置及电子设备 | |
JP2016092435A5 (zh) | ||
WO2019023969A1 (zh) | 一种基于智能终端的滤镜切换方法及滤镜切换系统 | |
US10186237B2 (en) | Glyph-mask render buffer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16861467 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16861467 Country of ref document: EP Kind code of ref document: A1 |