WO2019024007A1 - Photographing interface preview switching method and switching apparatus for smart device - Google Patents

Photographing interface preview switching method and switching apparatus for smart device Download PDF

Info

Publication number
WO2019024007A1
WO2019024007A1 PCT/CN2017/095664 CN2017095664W WO2019024007A1 WO 2019024007 A1 WO2019024007 A1 WO 2019024007A1 CN 2017095664 W CN2017095664 W CN 2017095664W WO 2019024007 A1 WO2019024007 A1 WO 2019024007A1
Authority
WO
WIPO (PCT)
Prior art keywords
preview
switching
camera
current picture
smart device
Prior art date
Application number
PCT/CN2017/095664
Other languages
French (fr)
Chinese (zh)
Inventor
陈飞飞
Original Assignee
深圳传音通讯有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳传音通讯有限公司 filed Critical 深圳传音通讯有限公司
Priority to PCT/CN2017/095664 priority Critical patent/WO2019024007A1/en
Publication of WO2019024007A1 publication Critical patent/WO2019024007A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules

Definitions

  • the conventional method of using a preview screen provides a method of switching the preview size and the scale of the preview screen by a switching button or a switching action while viewing the preview screen displayed via the display device.
  • the preview ratio since the size of the preview screen can be fixed, the preview ratio must be automatically adjusted by using different preview ratios.
  • the smart device adjusts the proportion of the preview of the display screen, the preview is usually reloaded with a new preview ratio. The screen will therefore cause a switching delay.
  • an object of the present invention is to provide a switching method and a switching device for a camera interface preview of a smart device.
  • Activating a camera of the smart device displaying a first current picture of the camera in a first preview ratio on a photographing interface of the smart device;
  • the first current picture is cut in a display frame corresponding to the second preview ratio, and the display picture in the display frame is retained as a second current picture, and the second picture is displayed in the picture interface.
  • Current picture including:
  • the display frame is adjusted within the camera interface of the smart device based on the size parameter.
  • the control module is configured to start a camera of the smart device, and display a first current picture of the camera in a first preview ratio on a photographing interface of the smart device;
  • the switching module is communicatively coupled to the control module, and configured to receive a switching instruction for switching the first preview ratio to a second preview switching ratio.
  • control module comprises:
  • a first picture unit configured to be in communication with the activation unit, configured to acquire a first current picture of the camera
  • a touch sensing unit configured to detect a touch operation input at the photographing interface, and acquire a parameter of the touch operation
  • the preview module includes:
  • the second display unit is communicatively coupled to the second preview unit for displaying the second current picture on the photographing interface of the smart device.
  • Different preview ratios must automatically adjust the display effect.
  • the smart device adjusts the proportion of the preview of the display screen, it usually reloads the preview screen with a new preview ratio, which is pre-stored in the operating system of the smart device.
  • the interface is viewed and stored in two preview ratios, so switching will not cause a switching delay.
  • FIG. 2 is a flow chart showing the steps of a handover method in accordance with a preferred embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a switching apparatus for previewing a photographing interface of a smart device according to a preferred embodiment of the present invention.
  • FIG. 7 is a block diagram showing the construction of a module in accordance with a preferred embodiment of the present invention.
  • FIG. 9 is a block diagram showing the construction of a module in accordance with a preferred embodiment of the present invention.
  • a flow diagram consistent with a preferred embodiment of the present invention includes:
  • Step 101 Start a camera of a smart device, display a current picture of the camera in a first preview ratio in a display area of the smart device, and store the data as first preview data;
  • Step 102 Receive a switching instruction that switches the first preview ratio to a second preview switching ratio.
  • the first preview ratio is greater than the second preview ratio.
  • the display area displayed in the first preview ratio is cut by the display frame of the second preview scale, and then adjusted according to the size of the display area.
  • the position of the display frame in the second preview ratio is adjusted to obtain a better visual experience. For example, the display frame of the second preview scale size is displayed centered in the display area, and the spare display area is filled with the color close to the background color of the preview screen.
  • mPreviewThread and mPreviewHeap are defined in CameraHardware to process the preview data related to the current picture of the camera.
  • the preview ratio setting in the embodiment of the present invention includes a first preview ratio and a second preview ratio, which are 4:3 and 1:1, respectively.
  • the captured information is separately stored in a predetermined buffer area corresponding to the camera, and at the same time,
  • the camera that is started at the same time obtains the preview picture data stream, and during the preview process of the camera, the current picture acquired by the camera is displayed in the display area of the smart device in the first preview ratio, and the display manner may include: split screen or full screen. Alternately displayed.
  • switching the view of the display area may cause the view to reload. At this time, you need to redefine the view using the surfaceChanged method.
  • the first preview ratio is greater than the second preview ratio.
  • the display area displayed by the first preview ratio is cut by the second preview unit in the second preview ratio display frame, according to the display.
  • the size of the area, the preview setting unit adjusts the position of the display frame in the second preview scale, and the second display unit is displayed on the photographing interface of the smart device to obtain a better visual experience.
  • the display frame of the second preview scale size is displayed centered in the display area, and the spare display area is filled with the color close to the background color of the preview screen.
  • an embodiment of the present invention further provides a computer readable storage medium having stored therein computer executable instructions, such as a non-volatile memory such as an optical disk, a hard disk, or a flash memory.
  • computer executable instructions such as a non-volatile memory such as an optical disk, a hard disk, or a flash memory.
  • the above computer executable instructions are used to cause a computer or the like to perform various operations in the above-described switching method of the photographing interface preview.

Landscapes

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

Abstract

A photographing interface preview switching method for a smart device, characterized in that the switching method comprises: activating a camera of the smart device, displaying, on a photographing interface of the smart device, a first current picture of the camera in a first preview scale (101); receiving a switching instruction for switching the first preview scale to a second preview switching scale (102); cutting the first current picture by a display frame corresponding to the second preview scale, keeping the display picture in the display frame as a second current picture, and displaying the second current picture in the photographing interface (103). The method supports various switching operations, and can realize delay-free switching during the switching operation.

Description

一种用于智能设备的拍照界面预览的切换方法及切换装置Switching method and switching device for camera interface preview of smart device 技术领域Technical field
本发明涉及智能设备领域,尤其涉及一种用于智能设备的拍照界面预览的切换方法及切换装置。The present invention relates to the field of smart devices, and in particular, to a method and a switching device for a camera interface preview of a smart device.
背景技术Background technique
存在各种类型的智能设备(诸如,智能电话和平板PC),这些智能设备向用户提供各种有用的功能,这导致智能设备的广泛使用。如今,将相机模块安装到智能设备是普遍的,因此,使用智能设备捕捉图像(静止图像或运动图像)的功能己被广泛使用。There are various types of smart devices, such as smart phones and tablet PCs, that provide users with a variety of useful functions, which leads to widespread use of smart devices. Nowadays, it is common to mount a camera module to a smart device, and therefore, the function of capturing an image (still image or moving image) using a smart device has been widely used.
使用预览屏幕的传统方法提供一种这样的方法:在观看经由显示装置显示的预览屏幕的同时通过一切换按钮或者切换动作实现预览屏幕的预览大小、比例的切换。此外,由于可通过预览屏幕的大小都是固定的,采用不同的预览比例必须要自动调整显示的效果,同时,智能设备在调整显示屏幕预览的比例时,通常是以新的预览比例重新加载预览屏幕,因此会造成切换延时。The conventional method of using a preview screen provides a method of switching the preview size and the scale of the preview screen by a switching button or a switching action while viewing the preview screen displayed via the display device. In addition, since the size of the preview screen can be fixed, the preview ratio must be automatically adjusted by using different preview ratios. At the same time, when the smart device adjusts the proportion of the preview of the display screen, the preview is usually reloaded with a new preview ratio. The screen will therefore cause a switching delay.
发明内容Summary of the invention
为了克服上述技术缺陷,本发明的目的在于提供一种用于智能设备的拍照界面预览的切换方法及切换装置。In order to overcome the above technical deficiencies, an object of the present invention is to provide a switching method and a switching device for a camera interface preview of a smart device.
本发明公开了一种用于智能设备的拍照界面预览的切换方法,其特征在于,所述切换方法包括:The invention discloses a method for switching a preview of a photographing interface of a smart device, wherein the switching method comprises:
启动所述智能设备的摄像头,在所述智能设备的拍照界面以第一预览比例显示所述摄像头的第一当前画面;Activating a camera of the smart device, displaying a first current picture of the camera in a first preview ratio on a photographing interface of the smart device;
接收一将所述第一预览比例切换至一第二预览切换比例的切换指令;Receiving a switching instruction for switching the first preview ratio to a second preview switching ratio;
以所述第二预览比例对应的一显示框切割所述第一当前画面,保留所述显示框内的显示画面作为一第二当前画面,于所述拍照界面内显示所述第二当前画面。 The first current picture is cut in a display frame corresponding to the second preview ratio, and the display picture in the display frame is retained as a second current picture, and the second current picture is displayed in the picture interface.
优选地,启动所述智能设备的摄像头,在所述智能设备的拍照界面以第一预览比例显示所述摄像头的第一当前画面,包括:Preferably, the camera of the smart device is activated, and the first current picture of the camera is displayed in a first preview ratio on the camera interface of the smart device, including:
当接收一启动所述摄像头指令时,调用与所述摄像头相应的控制装置开启所述摄像头;When receiving the command to start the camera, calling a control device corresponding to the camera to turn on the camera;
获取所述摄像头的第一当前画面;Obtaining a first current picture of the camera;
以所述第一预览比例将所述第一当前画面存储为所述第一预览数据;The first current picture is stored as the first preview data in the first preview ratio;
在所述智能设备的拍照界面显示所述第一当前画面。Displaying the first current picture on a photographing interface of the smart device.
优选地,接收一将所述第一预览比例切换至一第二预览切换比例的切换指令,包括:Preferably, receiving a switching instruction for switching the first preview ratio to a second preview switching ratio comprises:
检测在所述拍照界面输入的触摸操作,并获取所述触摸操作的参数;Detecting a touch operation input at the photographing interface, and acquiring parameters of the touch operation;
所述触摸操作的参数包括至少一组触摸区域和按压力度之间的对应关系;The parameter of the touch operation includes a correspondence between at least one set of touch regions and a pressing force;
当所述触摸操作的参数与所述切换指令的参数匹配时,所述智能设备执行所述切换指令。The smart device executes the switching instruction when a parameter of the touch operation matches a parameter of the switching instruction.
优选地,以所述第二预览比例对应的一显示框切割所述第一当前画面,保留所述显示框内的显示画面作为一第二当前画面,于所述拍照界面内显示所述第二当前画面,包括:Preferably, the first current picture is cut in a display frame corresponding to the second preview ratio, and the display picture in the display frame is retained as a second current picture, and the second picture is displayed in the picture interface. Current picture, including:
生成基于所述第二预览比例的所述显示框;Generating the display frame based on the second preview ratio;
通过所述显示框切割所述第一当前画面作为所述第二当前画面,且存储为所述第二预览数据;Cutting the first current picture as the second current picture by using the display frame, and storing the second preview data;
在所述智能设备的拍照界面显示所述第二当前画面。Displaying the second current picture on a photographing interface of the smart device.
优选地,以所述第二预览比例对应的一显示框切割所述第一当前画面,保留所述显示框内的显示画面作为一第二当前画面,于所述拍照界面内显示所述第二当前画面,还包括:Preferably, the first current picture is cut in a display frame corresponding to the second preview ratio, and the display picture in the display frame is retained as a second current picture, and the second picture is displayed in the picture interface. The current picture also includes:
获取所述智能设备的拍照界面的尺寸参数;Obtaining a size parameter of the photographing interface of the smart device;
基于所述尺寸参数,在所述智能设备的拍照界面内调整所述显示框。The display frame is adjusted within the camera interface of the smart device based on the size parameter.
本发明还公开了一种用于智能设备的拍照界面预览的切换装置,其特征在于,所述切换装置包括:控制模块、切换模块、预览模块,其中,The invention also discloses a switching device for previewing a camera interface of a smart device, wherein the switching device comprises: a control module, a switching module, and a preview module, wherein
所述控制模块,用于启动所述智能设备的摄像头,在所述智能设备的拍照界面以第一预览比例显示所述摄像头的第一当前画面;The control module is configured to start a camera of the smart device, and display a first current picture of the camera in a first preview ratio on a photographing interface of the smart device;
所述切换模块与所述控制模块通讯连接,用于接收一将所述第一预览比例切换至一第二预览切换比例的切换指令 The switching module is communicatively coupled to the control module, and configured to receive a switching instruction for switching the first preview ratio to a second preview switching ratio.
所述预览模块与所述控制模块通讯连接,用于以所述第二预览比例对应的一显示框切割所述第一当前画面,保留所述显示框内的显示画面作为一第二当前画面,于所述拍照界面内显示所述第二当前画面。The preview module is in communication with the control module, and is configured to cut the first current picture by using a display frame corresponding to the second preview ratio, and retain the display image in the display frame as a second current picture. Displaying the second current picture in the photographing interface.
优选地,所述控制模块,包括:Preferably, the control module comprises:
启动单元,用于当接收一启动所述摄像头指令时,调用与所述摄像头相应的控制装置开启所述摄像头;a startup unit, configured to: when receiving the camera instruction, invoke a control device corresponding to the camera to turn on the camera;
第一画面单元,与所述启动单元通讯连接,用于获取所述摄像头的第一当前画面;a first picture unit, configured to be in communication with the activation unit, configured to acquire a first current picture of the camera;
第一预览单元,与所述第一画面单元通讯连接,用于以所述第一预览比例将所述第一当前画面存储为所述第一预览数据;a first preview unit, configured to be in communication with the first picture unit, configured to store the first current picture as the first preview data by using the first preview ratio;
第一显示单元,与所述第一预览单元通讯连接,用于在所述智能设备的拍照界面显示所述第一当前画面。The first display unit is in communication with the first preview unit, and is configured to display the first current picture on a photographing interface of the smart device.
优选地,所述切换模块,包括:Preferably, the switching module includes:
触摸感应单元,用于检测在所述拍照界面输入的触摸操作,并获取所述触摸操作的参数;a touch sensing unit, configured to detect a touch operation input at the photographing interface, and acquire a parameter of the touch operation;
所述触摸操作的参数包括至少一组触摸区域和按压力度之间的对应关系;The parameter of the touch operation includes a correspondence between at least one set of touch regions and a pressing force;
触摸匹配单元,与所述触摸感应单元通讯连接,用于当所述触摸操作的参数与所述切换指令的参数匹配时,所述智能设备执行所述切换指令。Touching the matching unit, and communicating with the touch sensing unit, when the parameter of the touch operation matches a parameter of the switching instruction, the smart device executes the switching instruction.
优选地,所述预览模块,包括:Preferably, the preview module includes:
第二画面单元,用于生成基于所述第二预览比例的所述显示框;a second picture unit, configured to generate the display frame based on the second preview ratio;
第二预览单元,与所述第二画面单元通讯连接,用于通过所述显示框切割所述第一当前画面作为所述第二当前画面,且存储为所述第二预览数据;a second preview unit, configured to be in communication with the second picture unit, configured to cut the first current picture as the second current picture by using the display frame, and store the second preview data;
第二显示单元,与所述第二预览单元通讯连接,用于在所述智能设备的拍照界面显示所述第二当前画面。The second display unit is communicatively coupled to the second preview unit for displaying the second current picture on the photographing interface of the smart device.
优选地,所述预览模块,还包括:Preferably, the preview module further includes:
参数配置单元,用于获取所述智能设备的拍照界面的尺寸参数;a parameter configuration unit, configured to acquire a size parameter of a photographing interface of the smart device;
预览设置单元,与所述参数配置单元通讯连接,用于基于所述尺寸参数,在所述智能设备的拍照界面内调整所述显示框。And a preview setting unit, configured to communicate with the parameter configuration unit, configured to adjust the display frame in a photographing interface of the smart device based on the size parameter.
采用了上述技术方案后,与现有技术相比,具有以下有益效果:After adopting the above technical solution, compared with the prior art, the following beneficial effects are obtained:
1.不同的预览比例必须要自动调整显示的效果,同时,智能设备在调整显示屏幕预览的比例时,通常是以新的预览比例重新加载预览屏幕,在智能设备的操作系统预存了阅 览界面,并且以两种预览比例存储,因此切换的时候不会造成切换延时。1. Different preview ratios must automatically adjust the display effect. At the same time, when the smart device adjusts the proportion of the preview of the display screen, it usually reloads the preview screen with a new preview ratio, which is pre-stored in the operating system of the smart device. The interface is viewed and stored in two preview ratios, so switching will not cause a switching delay.
附图说明DRAWINGS
图1为符合本发明一优选实施例中用于智能设备的拍照界面预览的切换方法的流程示意图;1 is a schematic flow chart of a method for switching a preview of a camera interface for a smart device according to a preferred embodiment of the present invention;
图2为符合本发明一优选实施例中,切换方法的步骤的流程示意图;2 is a flow chart showing the steps of a handover method in accordance with a preferred embodiment of the present invention;
图3为符合本发明一优选实施例中,切换方法的步骤的流程示意图;3 is a flow chart showing the steps of a handover method in accordance with a preferred embodiment of the present invention;
图4为符合本发明一优选实施例中,切换方法的步骤的流程示意图;4 is a flow chart showing the steps of a handover method in accordance with a preferred embodiment of the present invention;
图5为符合本发明一优选实施例中,切换方法的步骤的流程示意图;5 is a flow chart showing the steps of a handover method in accordance with a preferred embodiment of the present invention;
图6为符合本发明一优选实施例中用于智能设备的拍照界面预览的切换装置的结构示意图。FIG. 6 is a schematic structural diagram of a switching apparatus for previewing a photographing interface of a smart device according to a preferred embodiment of the present invention.
图7为符合本发明一优选实施例中切换装置的模块的结构示意图。Figure 7 is a block diagram showing the construction of a module in accordance with a preferred embodiment of the present invention.
图8为符合本发明一优选实施例中切换装置的模块的结构示意图。Figure 8 is a block diagram showing the construction of a module in accordance with a preferred embodiment of the present invention.
图9为符合本发明一优选实施例中切换装置的模块的结构示意图。Figure 9 is a block diagram showing the construction of a module in accordance with a preferred embodiment of the present invention.
附图标记:Reference mark:
10-切换装置、20-控制模块、30-切换模块、40-预览模块:10-switching device, 20-control module, 30-switching module, 40-preview module:
具体实施方式Detailed ways
以下结合附图与具体实施例进一步阐述本发明的优点。Advantages of the present invention are further explained below in conjunction with the accompanying drawings and specific embodiments.
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. The following description refers to the same or similar elements in the different figures unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with aspects of the present disclosure as detailed in the appended claims.
本技术领域技术人员可以理解,这里所使用的智能设备,既包括无线信号接收器的设备,其仅具备无发射能力的无线信号接收器的设备,又包括接收和发射硬件的设备,其具有能够在双向通信链路上,进行双向通信的接收和发射硬件的设备。这种设备可以包括:蜂窝或其他通信设备,其具有单线路显示器或多线路显示器或没有多线路显示器的蜂窝或其他通信设备;PCS(Personal Communications Service,个人通信系统),其可以组合语音、数据处理、传真和/或数据通信能力;PDA(Personal Digital Assistant,个人数字助理),其可以包括射频接收器、寻呼机、互联网/内联网访问、网络浏览器、记事本、 日历和/或GPS(Global Positioning System,全球定位系统)接收器;常规膝上型和/或掌上型计算机或其他设备,其具有和/或包括射频接收器的常规膝上型和/或掌上型计算机或其他设备。这里所使用的“设备”、“智能设备”可以是便携式、可运输、安装在交通工具(航空、海运和/或陆地)中的,或者适合于和/或配置为在本地运行,和/或以分布形式,运行在地球和/或空间的任何其他位置运行。这里所使用的“设备”、“智能设备”还可以是通信设备、上网设备、音乐/视频播放设备,例如可以是PDA,MID(Mobile Internet Device,移动互联网设备)和/或具有音乐/视频播放功能的移动电话,也可以是智能电视、机顶盒等设备。Those skilled in the art can understand that the smart device used herein includes a device of a wireless signal receiver, a device having only a wireless signal receiver without a transmitting capability, and a device for receiving and transmitting hardware, which has the capability to A device that performs bidirectional communication reception and transmission hardware on a two-way communication link. Such devices may include cellular or other communication devices having a single line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which may combine voice, data Processing, fax, and/or data communication capabilities; PDA (Personal Digital Assistant), which can include radio frequency receivers, pagers, Internet/Intranet access, web browsers, notepads, Calendar and/or GPS (Global Positioning System) receiver; conventional laptop and/or palmtop computer or other device with and/or conventional laptop and/or palm type including radio frequency receiver Computer or other device. As used herein, "device", "smart device" may be portable, transportable, installed in a vehicle (aviation, sea and/or land), or adapted and/or configured to operate locally, and/or Run in any other location on the Earth and/or space in a distributed form. The "device" and "smart device" used herein may also be a communication device, an internet device, a music/video playback device, such as a PDA, a MID (Mobile Internet Device), and/or have a music/video playback. Functional mobile phones can also be smart TVs, set-top boxes and other devices.
在本发明的描述中,需要理解的是,术语“纵向”、“横向”、“上”、“下”、“前”、“后”、“左”、“右”、“竖直”、“水平”、“顶”、“底”“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。In the description of the present invention, it is to be understood that the terms "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", The orientation or positional relationship of the indications of "horizontal", "top", "bottom", "inside", "outside", etc. is based on the orientation or positional relationship shown in the drawings, only for the convenience of describing the present invention and simplifying the description, rather than It is to be understood that the device or elements referred to have a particular orientation, are constructed and operated in a particular orientation and are therefore not to be construed as limiting.
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在......时”或“当......时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, the first information may also be referred to as second information without departing from the scope of the present disclosure. Similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to a determination."
在本发明的描述中,除非另有规定和限定,需要说明的是,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是机械连接或电连接,也可以是两个元件内部的连通,可以是直接相连,也可以通过中间媒介间接相连,对于本领域的普通技术人员而言,可以根据具体情况理解上述术语的具体含义。In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "mounted", "connected", and "connected" are to be understood broadly, and may be, for example, mechanical or electrical, or both. The internal communication of the components may be directly connected or indirectly connected through an intermediate medium. For those skilled in the art, the specific meanings of the above terms may be understood according to specific circumstances.
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在......时”或“当......时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, the first information may also be referred to as second information without departing from the scope of the present disclosure. Similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to a determination."
参阅图1-5,为符合本发明一优选实施例中的流程示意图,该方法包括:Referring to Figures 1-5, a flow diagram consistent with a preferred embodiment of the present invention includes:
系统的硬件抽象层(Hardware Abstract Layer,以下简称为HAL)运行在用户空间中,它向下屏蔽硬件驱动模块的实现细节,向上提供硬件访问服务。通过硬件抽象层,安卓 系统分两层来支持硬件设备,其中一层实现在用户空间中,另一层实现在内核空间中一传统的Linux系统把对硬件的支持完全实现在内核空间中,即把对硬件的支持完全实现在硬件驱动模块中。The hardware abstraction layer (HAL) of the system runs in the user space, which shields the implementation details of the hardware driver module downwards and provides hardware access services upwards. Through the hardware abstraction layer, Android The system is supported in two layers to support hardware devices. One layer is implemented in user space, and the other layer is implemented in kernel space. A traditional Linux system fully implements hardware support in kernel space, that is, complete support for hardware. Implemented in the hardware driver module.
安卓系统为什么要把对硬件的支持划分为两层来实现呢,我们知道,一方而,Linux内核源代码是遵循GPL协议的,即如果我们在安卓系统所使用的Linux内核中添加或者修改了代码,那么就必须将它们公开因此,如果安卓系统像其他的Linux系统一样,把对硬件的支持完全实现在硬件驱动模块中,那么就必须将这些硬件驱动模块源代码公开,这样就可能会损害移动设备厂商的利益,因为这相当于暴露了硬件的实现细节和参数另一方面。安卓系统源代码是遵循Apache License协议的,它允许移动设备厂商添加或者修改安卓系统源代码,而又不必公开这些代码因此,如果把对硬件的支持完全实现在安卓系统的用户空间中,那么就可以隐藏硬件的实现细节和参数然而,这是无法做到的,因为只有内核空间才有特权操作硬件设备个折中的解决方案便是将对硬件的支持分别实现在内核空间和用户空问中,其中,内核空间仍然是以硬件驱动模块的形式来支持,不过它只提供简单的硬件访问通道;而用户空间以硬件抽象层模块的形式来支持,它封装了硬件的实现细节和参数这样就可以保护移动设备厂商的利益了。Why does Android have to divide the hardware support into two layers? We know that one side, the Linux kernel source code is GPL-compliant, that is, if we add or modify the code in the Linux kernel used by Android. Therefore, they must be exposed. Therefore, if the Android system is fully implemented in the hardware driver module like other Linux systems, then the hardware driver module source code must be exposed, which may damage the mobile. The benefit of the device manufacturer, as this is equivalent to exposing the hardware implementation details and parameters on the other hand. The Android source code is compliant with the Apache License protocol, which allows mobile device vendors to add or modify Android source code without having to expose the code. Therefore, if the hardware support is fully implemented in the user space of the Android system, then It is possible to hide the implementation details and parameters of the hardware. However, this is not possible, because only the kernel space has the privilege to operate the hardware device. The solution to the hardware is to implement the hardware support in the kernel space and the user space. Kernel space is still supported in the form of hardware driver modules, but it only provides a simple hardware access channel; user space is supported in the form of a hardware abstraction layer module that encapsulates the hardware implementation details and parameters. It can protect the interests of mobile device manufacturers.
步骤101:启动一智能设备的摄像头,在所述智能设备的显示区域以第一预览比例显示所述摄像头的当前画面并存储为第一预览数据;Step 101: Start a camera of a smart device, display a current picture of the camera in a first preview ratio in a display area of the smart device, and store the data as first preview data;
步骤102:接收一将所述第一预览比例切换至一第二预览切换比例的切换指令;Step 102: Receive a switching instruction that switches the first preview ratio to a second preview switching ratio.
在所述智能设备的显示区域显示所述摄像头的当前画面的同时,以第一预览比例将所述摄像头的当前画面存储为第一预览数据;While displaying the current picture of the camera in the display area of the smart device, storing the current picture of the camera as the first preview data in a first preview ratio;
本发明的一个实施例中,触发调用摄像头的操作可以是用户通过一应用程序来实现,可以在该应用程序的操作界面设置一按键,通过该按键触发对摄像头的启动操作,也可以是该应用程序检测到调用摄像头的一外部事件后,触发该启动操作,实现自动调用摄像头的启动操作,对此本发明实施例不作限定。In an embodiment of the present invention, the operation of triggering the calling of the camera may be implemented by the user through an application program, and a button may be set on the operation interface of the application, and the startup operation of the camera may be triggered by the button, or may be the application. After the program detects an external event of the calling camera, the startup operation is triggered, and the startup operation of the camera is automatically invoked, which is not limited in this embodiment of the present invention.
摄像头根据预览比例的设置来捕捉图像,并包括用于将捕捉的图像压缩为适合由智能设备的控制器处理的格式的编解码器。例如,摄像头可包括可将图像压缩为静止图像格式(诸如联合图像专家组(JPEG)格式)或视频图像格式(诸如运动图像专家组(MPEG)格式)的代码。The camera captures the image according to the settings of the preview scale and includes a codec for compressing the captured image into a format suitable for processing by the controller of the smart device. For example, the camera can include code that can compress the image into a still image format, such as the Joint Photographic Experts Group (JPEG) format, or a video image format, such as the Moving Picture Experts Group (MPEG) format.
因此,摄像头控制器可执行控制使得将通过上述编解码器压缩为JPEG,MPEG格式等的图像输出到智能设备的显示区域。因此,在本发明的示例性实施例中捕捉的图像是 如下图像:通过输入捕捉键根据由用户选择的预览比例设置(其他设置在本发明中不作具体限制,例如拍摄的设置(例如,分辨率、光圈值和曝光值))捕捉的图像、压缩(或转换)为可由控制器处理的格式(例如,JPEG格式或MPEG格式)的图像。Therefore, the camera controller can perform control such that an image compressed to JPEG, MPEG format or the like by the above-described codec is output to the display area of the smart device. Therefore, the image captured in the exemplary embodiment of the present invention is The following image: The image captured by the user, according to the preview ratio setting selected by the user (other settings are not specifically limited in the present invention, such as the settings of the shooting (for example, resolution, aperture value, and exposure value)), compression (or Convert) an image in a format (eg, JPEG format or MPEG format) that can be processed by the controller.
同时,通过摄像头输入的图像被转换用于预览于智能设备的显示区域并被输出到智能设备的显示区域。例如,摄像头控制器执行控制使得将通过摄像头传感器等输入的图像信号转换为数字数据,将转换后的数字数据转换为适合显示在预览屏幕上的YUV格式,并将转换后的数字数据输出到摄像头控制器。摄像头控制器执行控制使得转换后的数字数据被接收并且转换后的数字数据通过被输出。可选地,通常情况下表达像素的亮度Y分量以及色度U(Cb)和V(Cr)分量来配置YUV格式。由于YUV格式能够以比普通RGB格式更窄的带宽进行传输,因此在智能设备的显示区域显示用于预览将被捕捉的对象的图像是合适的。At the same time, the image input through the camera is converted for previewing in the display area of the smart device and output to the display area of the smart device. For example, the camera controller performs control such that image signals input through a camera sensor or the like are converted into digital data, the converted digital data is converted into a YUV format suitable for display on a preview screen, and the converted digital data is output to the camera. Controller. The camera controller performs control so that the converted digital data is received and the converted digital data is outputted. Alternatively, the YUV format is typically configured by expressing the luminance Y component of the pixel and the chrominance U(Cb) and V(Cr) components. Since the YUV format can be transmitted with a narrower bandwidth than the normal RGB format, it is suitable to display an image for previewing an object to be captured in the display area of the smart device.
该预览比例设置通过操作系统的HAL层定义,该HAL层以模块的形式来管理各个硬件访问接口。每一个硬件模块都对应有一个动态链接库文件,这些动态链接库文件的命令需要符合一定的规范同时,在系统内部,每一个硬件抽象层模块都使用结构体hw_module_t来描述,而硬件设备则使用结构体hw_device_t来描述。接下来,我们就分别描述硬件抽象层模块文件的命名规范以及结构体hw_module_t和hw_device_t的定义。The preview scale setting is defined by the HAL layer of the operating system, and the HAL layer manages each hardware access interface in the form of a module. Each hardware module corresponds to a dynamic link library file. The commands of these dynamic link library files need to conform to certain specifications. At the same time, within the system, each hardware abstraction layer module is described by the structure hw_module_t, while the hardware device is used. The structure hw_device_t is described. Next, we describe the naming conventions of the hardware abstraction layer module files and the definitions of the structures hw_module_t and hw_device_t.
对具体的相机模块来说,通常通过CameraHardware来定义及设置所有对智能设备摄像头硬件的操作,其中:For a specific camera module, all operations on the smart device camera hardware are usually defined and set by CameraHardware, where:
CameraHardware中定义了mPreviewThread和mPreviewHeap,用于处理摄像头的当前画面相关的预览数据信息。本发明的实施例中预览比例设置包括第一预览比例和第二预览比例,分别为4∶3和1∶1。mPreviewThread and mPreviewHeap are defined in CameraHardware to process the preview data related to the current picture of the camera. The preview ratio setting in the embodiment of the present invention includes a first preview ratio and a second preview ratio, which are 4:3 and 1:1, respectively.
打开智能设备的摄像头第一件事情就是预览取景preview的动作,具体地,从智能设备的操作系统中摄像头的接口分析起。所有拥有拍照功能的应用,它在预览时候都要实现数据回传接口,并实现其表面缓存创建、改变、销毁三个函数,同时声明一个用于预览的窗口的绘图表面。还要设置摄像头预览的表面缓存区,系统自带的摄像头的接口是在通过表面缓存的改变方法里面设置摄像头的预览区,以供底层获取的预览preview数据不断投递到这个绘图表面缓存区内。The first thing to turn on the camera of a smart device is to preview the action of the view preview, specifically, from the interface analysis of the camera in the operating system of the smart device. All applications that have a camera function must implement a data return interface during preview, and implement three functions of surface cache creation, change, and destruction, and declare a drawing surface for the preview window. Also set the surface buffer of the camera preview. The interface of the camera that comes with the system is to set the preview area of the camera in the change method of the surface cache, so that the preview data obtained by the bottom layer is continuously delivered to the drawing surface buffer area.
设置好以上参数后,就可以调用获取预览方法进行取景预览,该获取预览方法获取预览preview数据是通过层叠调用的方式一层层往下调用,最后到摄像头的服务端。After setting the above parameters, you can call the get preview method to perform the framing preview. The get preview method obtains the preview preview data by calling the cascading call layer by layer, and finally to the server of the camera.
它的过程摄像头应用的框架,摄像头客户端与摄像头服务端硬件抽象层的接口端将 处理预览preview数据的请求并进入该硬件抽象层。The framework of its process camera application, the interface between the camera client and the camera server hardware abstraction layer will Process the request to preview the preview data and enter the hardware abstraction layer.
具体地,先是传递preview的消息到硬件抽象层,然后执行preview然后就近去硬件抽象层调用,并通过回调函数源源不断的将数据投递到表面缓存区的缓存去,因为预览preview数据的数据是比较大的,所以数据不会携带着传上上层,而是直接在两个缓存区之间复制,一个是底层采集数据的缓存区,另一个是用于显示的表面缓存区。Specifically, the message of the preview is first passed to the hardware abstraction layer, and then the preview is executed and then the hardware abstraction layer is called, and the data is continuously sent to the cache of the surface buffer through the callback function, because the data of the preview data is compared. Large, so the data does not carry the upper layer, but is copied directly between the two buffers, one is the buffer for the underlying data collection, and the other is the surface buffer for display.
预览preview数据的回调函数,具体地,首先在摄像头客户端与服务端连接成功的时候就会设置一个回调函数摄像头,摄像头客户端与摄像头服务端连接成功后就会生成一个摄像头客户端返回,在摄像头客户端的构造函数中,可以对摄像头设置一个或者多个回调函数,用于返回底层数据用于处理。Preview the callback function of the preview data. Specifically, first, when the camera client and the server are successfully connected, a callback function camera is set. After the camera client and the camera server are successfully connected, a camera client is generated to return. In the constructor of the camera client, one or more callback functions can be set for the camera to return the underlying data for processing.
将该拍摄的信息分别存储于与摄像头相应的预定的缓存区中,与此同时,还可以将同时启动的摄像头获得预览画面数据流存储,且在摄像头的预览过程中,将该摄像头获取的当前画面以第一预览比例在智能设备的显示区域显示,显示的方式可以采用包括:分屏或全屏交替显示。The captured information is separately stored in a predetermined buffer area corresponding to the camera, and at the same time, the simultaneously activated camera can obtain the preview picture data stream, and during the preview of the camera, the camera acquires the current The screen is displayed in the display area of the smart device in a first preview ratio, and the display manner may include: split screen or full screen alternate display.
步骤103:以所述第二预览比例对应的一显示框切割所述第一当前画面,保留所述显示框内的显示画面作为一第二当前画面,于所述拍照界面内显示所述第二当前画面;Step 103: cutting the first current picture by using a display frame corresponding to the second preview ratio, retaining the display image in the display frame as a second current picture, and displaying the second in the photo interface Current picture
当接收所述切换指令后,以所述第二预览比例设置所述智能设备的显示区域;After receiving the switching instruction, setting a display area of the smart device in the second preview ratio;
在本发明的一个实施例中,发出该切换指令的方式能够为在智能设备的显示区域中的,拍照预览界面上设置一个切换按钮,该按钮的名称可以是“切换预览比例”,当启动该智能设备的摄像头在该智能设备的显示区域预览该摄像头的当前画面时,用户可以点击该切换按钮触发该切换指令,同时,对触发该切换指令能够设置一触发条件,例如,以单击的方式按压所述切换按钮,或者是在一定的时间内(至少超过2秒)按压所述按钮。In an embodiment of the present invention, the manner of issuing the switching instruction may be: setting a switching button on the photo preview interface in the display area of the smart device, the name of the button may be “switching preview ratio”, when starting the When the camera of the smart device previews the current screen of the camera in the display area of the smart device, the user can click the switch button to trigger the switching instruction, and at the same time, a trigger condition can be set for triggering the switching instruction, for example, by clicking Pressing the toggle button or pressing the button for a certain amount of time (at least over 2 seconds).
可选地,本发明的实施例还能通过在智能设备上设置的其他按钮来触发该切换指令,还能包括采用手势动作等来触发。Optionally, the embodiment of the present invention can also trigger the switching instruction by using other buttons set on the smart device, and can also trigger by using a gesture action or the like.
具体地,通过设置主界面布局,定义该按钮,Specifically, by setting the main interface layout, the button is defined,
Figure PCTCN2017095664-appb-000001
Figure PCTCN2017095664-appb-000001
Figure PCTCN2017095664-appb-000002
Figure PCTCN2017095664-appb-000002
在智能设备的操作系统中,定义应用程序的Intent。Intent是不同组件之间相互通讯的纽带,封装了不同组件之间通讯的条件。Intent本身是定义为一个类别,一个Intent对象表达一个目的或期望,叙述其所期望的服务或动作、与动作有关的数据等。In the operating system of the smart device, define the Intent of the application. Intent is the link between different components to communicate with each other, and encapsulates the conditions for communication between different components. An intent itself is defined as a category. An Intent object expresses a purpose or expectation, describes the service or action it expects, data related to the action, and so on.
当接收到通信的请求后,内容提供者被激活。而其它三种组件Activity、服务和广播接收器被一种叫做Intent的异步消息所激活。Intent是一个保存着消息内容的Intent对象。对于Activity和服务来说,它指明了请求的操作名称以及作为操作对象的数据的URI和其它一些信息。比如说,它可以承载对一个Activity的请求,让它为用户显示一张图片,或者让用户编辑一些文本。而对于广播接收器而言,Intent对象指明了声明的行为。比如,它可以对所有感兴趣的对象声、明照相按钮被按下。The content provider is activated upon receiving a request for communication. The other three component activities, services, and broadcast receivers are activated by an asynchronous message called an Intent. An intent is an Intent object that holds the content of the message. For the Activity and the service, it indicates the name of the operation requested and the URI and other information of the data as the operation object. For example, it can host a request for an Activity, let it display a picture for the user, or let the user edit some text. For broadcast receivers, the Intent object indicates the behavior of the declaration. For example, it can be pressed for all objects of interest and the camera button is pressed.
操作系统则根据此Intent对象之叙述,负责配对,找出相配的组件,然后将Intent对象传递给所找到的组件。另外,Intent不仅可以用于应用程序之间的组件的调用,也可以用于应用程序内部的Activity和Service之间的交互。因此,可以将Intent作为不同组件之间通讯的媒介,以提供相互调用的组件的相关信息。由此可知,可以通过定义应用程序的Intent使得该应用程序可以与摄像头相关的组件进行通讯,并完成切换预览比例的操作。随后,通过与定义的Intent相应的IntentFilter实施相应的Action,以设置第二预览比例。最后,当检测到切换预览比例的指令时,从第一预览比例切换至第二预览比例,具体地,根据分辨率设置智能设备显示区域使用的视图(SurfaceView)的大小,能够通过The operating system is responsible for pairing according to the description of the Intent object, finding the matching component, and then passing the Intent object to the found component. In addition, Intent can be used not only for the calling of components between applications, but also for the interaction between Activity and Service inside the application. Therefore, the Intent can be used as a medium for communication between different components to provide information about the components that are called each other. It can be seen that the application can be communicated with the components related to the camera by defining the Intent of the application, and the operation of switching the preview ratio is completed. Subsequently, the corresponding Action is implemented by the IntentFilter corresponding to the defined Intent to set the second preview ratio. Finally, when the instruction to switch the preview ratio is detected, switching from the first preview ratio to the second preview ratio, specifically, setting the size of the view (SurfaceView) used by the smart device display area according to the resolution, can pass
从第一预览比例4∶3params.height=4*screenWidth/3;From the first preview ratio 4:3 params.height=4*screenWidth/3;
切换至第二预览比例1∶1params.height=screenWidthSwitch to the second preview ratio 1:1 params.height=screenWidth
surfaceView.setLayoutParams(params);surfaceView.setLayoutParams(params);
类似的代码来实现。Similar code to implement.
在有些情况下,切换显示区域的视图可能会导致视图的重新加载,在这个时候,需要使用surfaceChanged方法重新定义视图。In some cases, switching the view of the display area may cause the view to reload. At this time, you need to redefine the view using the surfaceChanged method.
具体地,第一预览比例大于第二预览比例,当用户触发该切换指令后,以第二预览比例大小的显示框切割以第一预览比例显示的显示区域后,依据该显示区域的大小,调 整该以第二预览比例大小的显示框的位置,以得到较好的视觉体验。例如,将以第二预览比例大小的显示框在显示区域内居中显示,空余的显示区域以接近预览画面底色的颜色填充。Specifically, the first preview ratio is greater than the second preview ratio. After the user triggers the switching instruction, the display area displayed in the first preview ratio is cut by the display frame of the second preview scale, and then adjusted according to the size of the display area. The position of the display frame in the second preview ratio is adjusted to obtain a better visual experience. For example, the display frame of the second preview scale size is displayed centered in the display area, and the spare display area is filled with the color close to the background color of the preview screen.
可选地,在切换之后该智能设备的显示区域将以第二预览比例显示该智能设备的摄像头的当前画面,同时,以第一预览比例继续存储智能设备的摄像头的当前画面,以等待下一次切换。Optionally, after the switching, the display area of the smart device displays the current picture of the camera of the smart device in a second preview ratio, and continues to store the current picture of the camera of the smart device at the first preview ratio, waiting for the next time. Switch.
将该拍摄的信息分别存储于与摄像头相应的预定的缓存区中,与此同时,还可以将同时启动的摄像头获得预览画面数据流存储,且在摄像头的预览过程中,将该摄像头获取的当前画面以第二预览比例在智能设备的显示区域显示,显示的方式可以采用包括:分屏或全屏交替显示。The captured information is separately stored in a predetermined buffer area corresponding to the camera, and at the same time, the simultaneously activated camera can obtain the preview picture data stream, and during the preview of the camera, the camera acquires the current The screen is displayed in the display area of the smart device in a second preview ratio, and the display manner may include: split screen or full screen alternate display.
现在将参考附图描述实现本发明各个实施例的智能设备。在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本发明的说明,其本身并没有特定的意义。因此,“模块”与“部件”可以混合地使用。A smart device embodying various embodiments of the present invention will now be described with reference to the accompanying drawings. In the following description, the use of suffixes such as "module", "component" or "unit" for indicating an element is merely an explanation for facilitating the present invention, and does not have a specific meaning per se. Therefore, "module" and "component" can be used in combination.
在本发明的描述中,除非另有规定和限定,需要说明的是,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是机械连接或电连接,也可以是两个元件内部的连通,可以是直接相连,也可以通过中间媒介间接相连,对于本领域的普通技术人员而言,可以根据具体情况理解上述术语的具体含义。In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "mounted", "connected", and "connected" are to be understood broadly, and may be, for example, mechanical or electrical, or both. The internal communication of the components may be directly connected or indirectly connected through an intermediate medium. For those skilled in the art, the specific meanings of the above terms may be understood according to specific circumstances.
参阅图6-9,为符合本发明的装置,可以通过一切换装置10实现,在该切换装置10内,包括:控制模块20、切换模块30、预览模块40。Referring to FIG. 6-9, the device according to the present invention can be implemented by a switching device 10, and includes: a control module 20, a switching module 30, and a preview module 40.
控制模块20:Control module 20:
系统的硬件抽象层(Hardware Abstract Layer,以下简称为HAL)运行在用户空间中,它向下屏蔽硬件驱动模块的实现细节,向上提供硬件访问服务。通过硬件抽象层,安卓系统分两层来支持硬件设备,其中一层实现在用户空间中,另一层实现在内核空间中一传统的Linux系统把对硬件的支持完全实现在内核空间中,即把对硬件的支持完全实现在硬件驱动模块中。The hardware abstraction layer (HAL) of the system runs in the user space, which shields the implementation details of the hardware driver module downwards and provides hardware access services upwards. Through the hardware abstraction layer, the Android system supports hardware devices in two layers, one of which is implemented in the user space, and the other layer is implemented in the kernel space. A traditional Linux system fully implements hardware support in the kernel space, that is, The hardware support is fully implemented in the hardware driver module.
安卓系统为什么要把对硬件的支持划分为两层来实现呢,我们知道,一方而,Linux内核源代码是遵循GPL协议的,即如果我们在安卓系统所使用的Linux内核中添加或者修改了代码,那么就必须将它们公开因此,如果安卓系统像其他的Linux系统一样,把对硬件的支持完全实现在硬件驱动模块中,那么就必须将这些硬件驱动模块源代码公开,这样就可能会损害移动设备厂商的利益,因为这相当于暴露了硬件的实现细节和参数另 一方面。安卓系统源代码是遵循Apache License协议的,它允许移动设备厂商添加或者修改安卓系统源代码,而又不必公开这些代码因此,如果把对硬件的支持完全实现在安卓系统的用户空间中,那么就可以隐藏硬件的实现细节和参数然而,这是无法做到的,因为只有内核空间才有特权操作硬件设备个折中的解决方案便是将对硬件的支持分别实现在内核空间和用户空问中,其中,内核空间仍然是以硬件驱动模块的形式来支持,不过它只提供简单的硬件访问通道;而用户空间以硬件抽象层模块的形式来支持,它封装了硬件的实现细节和参数这样就可以保护移动设备厂商的利益了。Why does Android have to divide the hardware support into two layers? We know that one side, the Linux kernel source code is GPL-compliant, that is, if we add or modify the code in the Linux kernel used by Android. Therefore, they must be exposed. Therefore, if the Android system is fully implemented in the hardware driver module like other Linux systems, then the hardware driver module source code must be exposed, which may damage the mobile. The benefit of the device manufacturer, because this is equivalent to exposing the hardware implementation details and parameters on the one hand. The Android source code is compliant with the Apache License protocol, which allows mobile device vendors to add or modify Android source code without having to expose the code. Therefore, if the hardware support is fully implemented in the user space of the Android system, then It is possible to hide the implementation details and parameters of the hardware. However, this is not possible, because only the kernel space has the privilege to operate the hardware device. The solution to the hardware is to implement the hardware support in the kernel space and the user space. Kernel space is still supported in the form of hardware driver modules, but it only provides a simple hardware access channel; user space is supported in the form of a hardware abstraction layer module that encapsulates the hardware implementation details and parameters. It can protect the interests of mobile device manufacturers.
本发明的一个实施例中,启动单元触发调用摄像头的操作,可以是用户通过一应用程序来实现,可以在该应用程序的操作界面(智能设备的拍照界面)设置一按键,通过该按键触发对摄像头的启动操作,也可以是该应用程序检测到调用摄像头的一外部事件后,触发该启动操作,实现自动调用摄像头的启动操作,第一画面单元获取摄像头的当前画面,对此本发明实施例不作限定。In an embodiment of the present invention, the activation unit triggers the operation of invoking the camera, which may be implemented by the user through an application program, and a button may be set on the operation interface of the application (the camera interface of the smart device), and the button is triggered by the button. The startup operation of the camera may also be triggered after the application detects an external event of calling the camera, and the startup operation of the camera is automatically invoked, and the first picture unit obtains the current picture of the camera, which is used in the embodiment of the present invention. Not limited.
第一预览单元控制摄像头根据预览比例(第一预览比例)的设置来捕捉图像,并包括用于将捕捉的图像压缩为适合由智能设备的控制器处理的格式的编解码器并存储,第一显示单元在拍照界面显示经过处理后的图像。例如,摄像头可包括可将图像压缩为静止图像格式(诸如联合图像专家组(JPEG)格式)或视频图像格式(诸如运动图像专家组(MPEG)格式)的代码。The first preview unit controls the camera to capture an image according to a setting of a preview ratio (first preview ratio), and includes a codec for compressing the captured image into a format suitable for processing by a controller of the smart device, and storing, first The display unit displays the processed image on the photographing interface. For example, the camera can include code that can compress the image into a still image format, such as the Joint Photographic Experts Group (JPEG) format, or a video image format, such as the Moving Picture Experts Group (MPEG) format.
因此,摄像头控制器可执行控制使得将通过上述编解码器压缩为JPEG,MPEG格式等的图像输出到智能设备的显示区域。因此,在本发明的示例性实施例中捕捉的图像是如下图像:通过输入捕捉键根据由用户选择的预览比例设置(其他设置在本发明中不作具体限制,例如拍摄的设置(例如,分辨率、光圈值和曝光值))捕捉的图像、压缩(或转换)为可由控制器处理的格式(例如,JPEG格式或MPEG格式)的图像。Therefore, the camera controller can perform control such that an image compressed to JPEG, MPEG format or the like by the above-described codec is output to the display area of the smart device. Therefore, the image captured in the exemplary embodiment of the present invention is an image that is set according to the preview ratio selected by the user by inputting the capture key (other settings are not specifically limited in the present invention, such as shooting settings (for example, resolution) , aperture value and exposure value)) The captured image is compressed (or converted) into an image that can be processed by the controller (for example, JPEG format or MPEG format).
同时,通过摄像头输入的图像被转换用于预览于智能设备的显示区域并被输出到智能设备的显示区域。例如,摄像头控制器执行控制使得将通过摄像头传感器等输入的图像信号转换为数字数据,将转换后的数字数据转换为适合显示在预览屏幕上的YUV格式,并将转换后的数字数据输出到摄像头控制器。摄像头控制器执行控制使得转换后的数字数据被接收并且转换后的数字数据通过被输出。可选地,通常情况下表达像素的亮度Y分量以及色度U(Cb)和V(Cr)分量来配置YUV格式。由于YUV格式能够以比普通RGB格式更窄的带宽进行传输,因此在智能设备的显示区域显示用于预览将被捕捉的对象的图像是合适的。 At the same time, the image input through the camera is converted for previewing in the display area of the smart device and output to the display area of the smart device. For example, the camera controller performs control such that image signals input through a camera sensor or the like are converted into digital data, the converted digital data is converted into a YUV format suitable for display on a preview screen, and the converted digital data is output to the camera. Controller. The camera controller performs control so that the converted digital data is received and the converted digital data is outputted. Alternatively, the YUV format is typically configured by expressing the luminance Y component of the pixel and the chrominance U(Cb) and V(Cr) components. Since the YUV format can be transmitted with a narrower bandwidth than the normal RGB format, it is suitable to display an image for previewing an object to be captured in the display area of the smart device.
该预览比例设置通过操作系统的HAL层定义,该HAL层以模块的形式来管理各个硬件访问接口。每一个硬件模块都对应有一个动态链接库文件,这些动态链接库文件的命令需要符合一定的规范同时,在系统内部,每一个硬件抽象层模块都使用结构体hw_module_t来描述,而硬件设备则使用结构体hw_device_t来描述。接下来,我们就分别描述硬件抽象层模块文件的命名规范以及结构体hw_module_t和hw_device_t的定义。The preview scale setting is defined by the HAL layer of the operating system, and the HAL layer manages each hardware access interface in the form of a module. Each hardware module corresponds to a dynamic link library file. The commands of these dynamic link library files need to conform to certain specifications. At the same time, within the system, each hardware abstraction layer module is described by the structure hw_module_t, while the hardware device is used. The structure hw_device_t is described. Next, we describe the naming conventions of the hardware abstraction layer module files and the definitions of the structures hw_module_t and hw_device_t.
对具体的相机模块来说,通常通过CameraHardware来定义及设置所有对智能设备摄像头硬件的操作,其中:For a specific camera module, all operations on the smart device camera hardware are usually defined and set by CameraHardware, where:
CameraHardware中定义了mPreviewThread和mPreviewHeap,用于处理摄像头的当前画面相关的预览数据信息。本发明的实施例中预览比例设置包括第一预览比例和第二预览比例,分别为4∶3和1∶1。mPreviewThread and mPreviewHeap are defined in CameraHardware to process the preview data related to the current picture of the camera. The preview ratio setting in the embodiment of the present invention includes a first preview ratio and a second preview ratio, which are 4:3 and 1:1, respectively.
切换模块:30Switching module: 30
打开智能设备的摄像头第一件事情就是预览取景preview的动作,具体地,从智能设备的操作系统中摄像头的接口分析起。所有拥有拍照功能的应用,它在预览时候都要实现数据回传接口,并实现其表面缓存创建、改变、销毁三个函数,同时声明一个用于预览的窗口的绘图表面。还要设置摄像头预览的表面缓存区,系统自带的摄像头的接口是在通过表面缓存的改变方法里面设置摄像头的预览区,以供底层获取的预览preview数据不断投递到这个绘图表面缓存区内。The first thing to turn on the camera of a smart device is to preview the action of the view preview, specifically, from the interface analysis of the camera in the operating system of the smart device. All applications that have a camera function must implement a data return interface during preview, and implement three functions of surface cache creation, change, and destruction, and declare a drawing surface for the preview window. Also set the surface buffer of the camera preview. The interface of the camera that comes with the system is to set the preview area of the camera in the change method of the surface cache, so that the preview data obtained by the bottom layer is continuously delivered to the drawing surface buffer area.
设置好以上参数后,就可以调用获取预览方法进行取景预览,该获取预览方法获取预览preview数据是通过层叠调用的方式一层层往下调用,最后到摄像头的服务端。After setting the above parameters, you can call the get preview method to perform the framing preview. The get preview method obtains the preview preview data by calling the cascading call layer by layer, and finally to the server of the camera.
它的过程摄像头应用的框架,摄像头客户端与摄像头服务端硬件抽象层的接口端将处理预览preview数据的请求并进入该硬件抽象层。The framework of its process camera application, the interface between the camera client and the camera server hardware abstraction layer will process the request to preview the preview data and enter the hardware abstraction layer.
具体地,先是传递preview的消息到硬件抽象层,然后执行preview然后就近去硬件抽象层调用,并通过回调函数源源不断的将数据投递到表面缓存区的缓存去,因为预览preview数据的数据是比较大的,所以数据不会携带着传上上层,而是直接在两个缓存区之间复制,一个是底层采集数据的缓存区,另一个是用于显示的表面缓存区。Specifically, the message of the preview is first passed to the hardware abstraction layer, and then the preview is executed and then the hardware abstraction layer is called, and the data is continuously sent to the cache of the surface buffer through the callback function, because the data of the preview data is compared. Large, so the data does not carry the upper layer, but is copied directly between the two buffers, one is the buffer for the underlying data collection, and the other is the surface buffer for display.
预览preview数据的回调函数,具体地,首先在摄像头客户端与服务端连接成功的时候就会设置一个回调函数摄像头,摄像头客户端与摄像头服务端连接成功后就会生成一个摄像头客户端返回,在摄像头客户端的构造函数中,可以对摄像头设置一个或者多个回调函数,用于返回底层数据用于处理。Preview the callback function of the preview data. Specifically, first, when the camera client and the server are successfully connected, a callback function camera is set. After the camera client and the camera server are successfully connected, a camera client is generated to return. In the constructor of the camera client, one or more callback functions can be set for the camera to return the underlying data for processing.
将该拍摄的信息分别存储于与摄像头相应的预定的缓存区中,与此同时,还可以将 同时启动的摄像头获得预览画面数据流存储,且在摄像头的预览过程中,将该摄像头获取的当前画面以第一预览比例在智能设备的显示区域显示,显示的方式可以采用包括:分屏或全屏交替显示。The captured information is separately stored in a predetermined buffer area corresponding to the camera, and at the same time, The camera that is started at the same time obtains the preview picture data stream, and during the preview process of the camera, the current picture acquired by the camera is displayed in the display area of the smart device in the first preview ratio, and the display manner may include: split screen or full screen. Alternately displayed.
当接收所述切换指令后,以所述第二预览比例设置所述智能设备的显示区域;After receiving the switching instruction, setting a display area of the smart device in the second preview ratio;
在本发明的一个实施例中,发出该切换指令的方式能够为在智能设备的显示区域中的,拍照预览界面上设置一个切换按钮,该按钮的名称可以是“切换预览比例”,当启动该智能设备的摄像头在该智能设备的显示区域预览该摄像头的当前画面时,触摸感应单元感应到用户点击该切换按钮触发该切换指令,同时,触摸匹配单元接收对触发该切换指令能够匹配一触发条件来匹配该操作,例如,以单击的方式按压所述切换按钮,或者是在一定的时间内(至少超过2秒)按压所述按钮。In an embodiment of the present invention, the manner of issuing the switching instruction may be: setting a switching button on the photo preview interface in the display area of the smart device, the name of the button may be “switching preview ratio”, when starting the When the camera of the smart device previews the current picture of the camera in the display area of the smart device, the touch sensing unit senses that the user clicks the switch button to trigger the switching instruction, and at the same time, the touch matching unit receives a trigger condition for triggering the switching instruction to match. To match the operation, for example, pressing the toggle button in a click manner, or pressing the button for a certain period of time (at least over 2 seconds).
可选地,本发明的实施例还能通过在智能设备上设置的其他按钮来触发该切换指令,还能包括采用手势动作等来触发。Optionally, the embodiment of the present invention can also trigger the switching instruction by using other buttons set on the smart device, and can also trigger by using a gesture action or the like.
预览模块40:Preview module 40:
具体地,通过设置主界面布局,定义该按钮。Specifically, the button is defined by setting the main interface layout.
在智能设备的操作系统中,定义应用程序的Intent。Intent是不同组件之间相互通讯的纽带,封装了不同组件之间通讯的条件。Intent本身是定义为一个类别,一个Intent对象表达一个目的或期望,叙述其所期望的服务或动作、与动作有关的数据等。In the operating system of the smart device, define the Intent of the application. Intent is the link between different components to communicate with each other, and encapsulates the conditions for communication between different components. An intent itself is defined as a category. An Intent object expresses a purpose or expectation, describes the service or action it expects, data related to the action, and so on.
当接收到通信的请求后,内容提供者被激活。而其它三种组件Activity、服务和广播接收器被一种叫做Intent的异步消息所激活。Intent是一个保存着消息内容的Intent对象。对于Activity和服务来说,它指明了请求的操作名称以及作为操作对象的数据的URI和其它一些信息。比如说,它可以承载对一个Activity的请求,让它为用户显示一张图片,或者让用户编辑一些文本。而对于广播接收器而言,Intent对象指明了声明的行为。比如,它可以对所有感兴趣的对象声、明照相按钮被按下。The content provider is activated upon receiving a request for communication. The other three component activities, services, and broadcast receivers are activated by an asynchronous message called an Intent. An intent is an Intent object that holds the content of the message. For the Activity and the service, it indicates the name of the operation requested and the URI and other information of the data as the operation object. For example, it can host a request for an Activity, let it display a picture for the user, or let the user edit some text. For broadcast receivers, the Intent object indicates the behavior of the declaration. For example, it can be pressed for all objects of interest and the camera button is pressed.
操作系统则根据此Intent对象之叙述,负责配对,找出相配的组件,然后将Intent对象传递给所找到的组件。另外,Intent不仅可以用于应用程序之间的组件的调用,也可以用于应用程序内部的Activity和Service之间的交互。因此,可以将Intent作为不同组件之间通讯的媒介,以提供相互调用的组件的相关信息。由此可知,可以通过定义应用程序的Intent使得该应用程序可以与摄像头相关的组件进行通讯,并完成切换预览比例的操作。随后,通过与定义的Intent相应的IntentFilter实施相应的Action,以设置第二预览比例。最后,当检测到切换预览比例的指令时,从第一预览比例切换至第二预览比 例,具体地,根据分辨率设置智能设备显示区域使用的视图(SurfaceView)的大小,能够通过The operating system is responsible for pairing according to the description of the Intent object, finding the matching component, and then passing the Intent object to the found component. In addition, Intent can be used not only for the calling of components between applications, but also for the interaction between Activity and Service inside the application. Therefore, the Intent can be used as a medium for communication between different components to provide information about the components that are called each other. It can be seen that the application can be communicated with the components related to the camera by defining the Intent of the application, and the operation of switching the preview ratio is completed. Subsequently, the corresponding Action is implemented by the IntentFilter corresponding to the defined Intent to set the second preview ratio. Finally, when the instruction to switch the preview ratio is detected, switching from the first preview ratio to the second preview ratio For example, the size of the view (SurfaceView) used by the smart device display area is set according to the resolution, and can pass
参数配置单元配置有从第一预览比例4∶3params.height=4*screenWidth/3;The parameter configuration unit is configured with a ratio from the first preview of 4:3 params.height=4*screenWidth/3;
切换至第二预览比例1∶1params.height=screenWidthSwitch to the second preview ratio 1:1 params.height=screenWidth
surfaceView.setLayoutParams(params);surfaceView.setLayoutParams(params);
类似的代码来实现,第二画面单元通过智能设备的摄像头获取该摄像头的当前画面。Similar to the code, the second picture unit obtains the current picture of the camera through the camera of the smart device.
在有些情况下,切换显示区域的视图可能会导致视图的重新加载,在这个时候,需要使用surfaceChanged方法重新定义视图。In some cases, switching the view of the display area may cause the view to reload. At this time, you need to redefine the view using the surfaceChanged method.
具体地,第一预览比例大于第二预览比例,当用户触发该切换指令后,通过第二预览单元以第二预览比例大小的显示框切割以第一预览比例显示的显示区域后,依据该显示区域的大小,预览设置单元调整该以第二预览比例大小的显示框的位置第二显示单元在智能设备的拍照界面显示,以得到较好的视觉体验。例如,将以第二预览比例大小的显示框在显示区域内居中显示,空余的显示区域以接近预览画面底色的颜色填充。Specifically, the first preview ratio is greater than the second preview ratio. After the user triggers the switching instruction, the display area displayed by the first preview ratio is cut by the second preview unit in the second preview ratio display frame, according to the display. The size of the area, the preview setting unit adjusts the position of the display frame in the second preview scale, and the second display unit is displayed on the photographing interface of the smart device to obtain a better visual experience. For example, the display frame of the second preview scale size is displayed centered in the display area, and the spare display area is filled with the color close to the background color of the preview screen.
可选地,在切换之后该智能设备的显示区域将以第二预览比例显示该智能设备的摄像头的当前画面,同时,以第一预览比例继续存储智能设备的摄像头的当前画面,以等待下一次切换。Optionally, after the switching, the display area of the smart device displays the current picture of the camera of the smart device in a second preview ratio, and continues to store the current picture of the camera of the smart device at the first preview ratio, waiting for the next time. Switch.
将该拍摄的信息分别存储于与摄像头相应的预定的缓存区中,与此同时,还可以将同时启动的摄像头获得预览画面数据流存储,且在摄像头的预览过程中,将该摄像头获取的当前画面以第二预览比例在智能设备的显示区域显示,显示的方式可以采用包括:分屏或全屏交替显示。The captured information is separately stored in a predetermined buffer area corresponding to the camera, and at the same time, the simultaneously activated camera can obtain the preview picture data stream, and during the preview of the camera, the camera acquires the current The screen is displayed in the display area of the smart device in a second preview ratio, and the display manner may include: split screen or full screen alternate display.
此外,本发明实施例还提供一种计算机可读存储介质,其内存储有计算机可执行指令,上述的计算机可读存储介质例如为非易失性存储器例如光盘、硬盘、或者闪存。上述的计算机可执行指令用于让计算机或者类似的运算装置完成上述的拍照界面预览的切换方法中的各种操作。In addition, an embodiment of the present invention further provides a computer readable storage medium having stored therein computer executable instructions, such as a non-volatile memory such as an optical disk, a hard disk, or a flash memory. The above computer executable instructions are used to cause a computer or the like to perform various operations in the above-described switching method of the photographing interface preview.
本技术领域技术人员可以理解,本发明包括涉及用于执行本申请中所述操作中的一项或多项的设备。这些设备可以为所需的目的而专门设计和制造,或者也可以包括通用计算机中的己知设备。这些设备具有存储在其内的计算机程序,这些计算机程序选择性地激活或重构。这样的计算机程序可以被存储在设备(例如,计算机)可读介质中或者存储在适于存储电子指令并分别藕联到总线的任何类型的介质中,所述计算机可读介质包括但不限于任何类型的盘(包括软盘、硬盘、光盘、CD-ROM、和磁光盘),ROM(Read-Only  Memory,只读存储器),RAM(Random Access Memory,随即存储器),EPROM(Erasable Programmable Read-Only Memory,可擦写可编程只读存储器),EEPROM(Electrically Erasable Programmable Read-Only Memory,电可擦可编程只读存储器)、闪存、磁性卡片或光线卡片。也就是,可读介质包括由设备(例如,计算机)以能够读的形式存储或传输信息的任何介质。Those skilled in the art will appreciate that the present invention includes apparatus related to performing one or more of the operations described herein. These devices may be specially designed and manufactured for the required purposes, or may also include known devices in a general purpose computer. These devices have computer programs stored therein that are selectively activated or reconfigured. Such computer programs may be stored in a device (eg, computer) readable medium or in any type of medium suitable for storing electronic instructions and separately coupled to a bus, including but not limited to any Type of disk (including floppy disk, hard disk, CD, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory, read only memory, RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory) Programming read-only memory), flash memory, magnetic cards, or light cards. That is, a readable medium includes any medium that is stored or transmitted by a device (eg, a computer) in a readable form.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of the present specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means a specific feature described in connection with the embodiment or example. A structure, material or feature is included in at least one embodiment or example of the invention. In the present specification, the schematic representation of the above terms does not necessarily mean the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples.
应当注意的是,本发明的实施例有较佳的实施性,且并非对本发明作任何形式的限制,任何熟悉该领域的技术人员可能利用上述揭示的技术内容变更或修饰为等同的有效实施例,但凡未脱离本发明技术方案的内容,依据本发明的技术实质对以上实施例所作的任何修改或等同变化及修饰,均仍属于本发明技术方案的范围内。 It should be noted that the embodiments of the present invention are preferred embodiments, and are not intended to limit the scope of the present invention. Any one skilled in the art may use the above-disclosed technical contents to change or modify the equivalent embodiments. Any modification or equivalent changes and modifications of the above embodiments in accordance with the technical spirit of the present invention are still within the scope of the technical solutions of the present invention.

Claims (10)

  1. 一种用于智能设备的拍照界面预览的切换方法,其特征在于,所述切换方法包括:A switching method for previewing a photographing interface of a smart device, wherein the switching method comprises:
    启动所述智能设备的摄像头,在所述智能设备的拍照界面以第一预览比例显示所述摄像头的第一当前画面;Activating a camera of the smart device, displaying a first current picture of the camera in a first preview ratio on a photographing interface of the smart device;
    接收一将所述第一预览比例切换至一第二预览切换比例的切换指令;Receiving a switching instruction for switching the first preview ratio to a second preview switching ratio;
    以所述第二预览比例对应的一显示框切割所述第一当前画面,保留所述显示框内的显示画面作为一第二当前画面,于所述拍照界面内显示所述第二当前画面。The first current picture is cut in a display frame corresponding to the second preview ratio, and the display picture in the display frame is retained as a second current picture, and the second current picture is displayed in the picture interface.
  2. 如权利要求1所述的切换方法,其特征在于,启动所述智能设备的摄像头,在所述智能设备的拍照界面以第一预览比例显示所述摄像头的第一当前画面,包括:The switching method of claim 1, wherein the camera of the smart device is activated, and the first current picture of the camera is displayed in a first preview ratio on the camera interface of the smart device, including:
    当接收一启动所述摄像头指令时,调用与所述摄像头相应的控制装置开启所述摄像头;When receiving the command to start the camera, calling a control device corresponding to the camera to turn on the camera;
    获取所述摄像头的第一当前画面;Obtaining a first current picture of the camera;
    以所述第一预览比例将所述第一当前画面存储为所述第一预览数据;The first current picture is stored as the first preview data in the first preview ratio;
    在所述智能设备的拍照界面显示所述第一当前画面。Displaying the first current picture on a photographing interface of the smart device.
  3. 如权利要求1所述的切换方法,其特征在于,接收一将所述第一预览比例切换至一第二预览切换比例的切换指令,包括:The switching method according to claim 1, wherein receiving a switching instruction for switching the first preview ratio to a second preview switching ratio comprises:
    接收在所述拍照界面输入的触摸操作,并获取所述触摸操作的参数;Receiving a touch operation input at the photographing interface, and acquiring parameters of the touch operation;
    所述触摸操作的参数包括至少一组触摸区域和按压力度之间的对应关系;The parameter of the touch operation includes a correspondence between at least one set of touch regions and a pressing force;
    当所述触摸操作的参数与所述切换指令的参数匹配时,所述智能设备执行所述切换指令。The smart device executes the switching instruction when a parameter of the touch operation matches a parameter of the switching instruction.
  4. 如权利要求1所述的切换方法,其特征在于,以所述第二预览比例对应的一显示框切割所述第一当前画面,保留所述显示框内的显示画面作为一第二当前画面,于所述拍照界面内显示所述第二当前画面,包括:The switching method according to claim 1, wherein the first current picture is cut by a display frame corresponding to the second preview ratio, and the display picture in the display frame is retained as a second current picture. Displaying the second current picture in the photographing interface, including:
    生成基于所述第二预览比例的所述显示框;Generating the display frame based on the second preview ratio;
    通过所述显示框切割所述第一当前画面作为所述第二当前画面,且存储为所述第二预览数据;Cutting the first current picture as the second current picture by using the display frame, and storing the second preview data;
    在所述智能设备的拍照界面显示所述第二当前画面。Displaying the second current picture on a photographing interface of the smart device.
  5. 如权利要求1所述的切换方法,其特征在于,以所述第二预览比例对应的一显示框切 割所述第一当前画面,保留所述显示框内的显示画面作为一第二当前画面,于所述拍照界面内显示所述第二当前画面,还包括:The switching method according to claim 1, wherein a display frame corresponding to the second preview ratio is cut The first current picture is cut, the display screen in the display frame is reserved as a second current picture, and the second current picture is displayed in the photo interface, and further includes:
    获取所述智能设备的拍照界面的尺寸参数;Obtaining a size parameter of the photographing interface of the smart device;
    基于所述尺寸参数,在所述智能设备的拍照界面内调整所述显示框。The display frame is adjusted within the camera interface of the smart device based on the size parameter.
  6. 一种用于智能设备的拍照界面预览的切换装置,其特征在于,所述切换装置包括:控制模块、切换模块、预览模块,其中,A switching device for previewing a photographing interface of a smart device, wherein the switching device comprises: a control module, a switching module, and a preview module, wherein
    所述控制模块,用于启动所述智能设备的摄像头,在所述智能设备的拍照界面以第一预览比例显示所述摄像头的第一当前画面;The control module is configured to start a camera of the smart device, and display a first current picture of the camera in a first preview ratio on a photographing interface of the smart device;
    所述切换模块与所述控制模块通讯连接,用于接收一将所述第一预览比例切换至一第二预览切换比例的切换指令The switching module is communicatively coupled to the control module, and configured to receive a switching instruction for switching the first preview ratio to a second preview switching ratio.
    所述预览模块与所述控制模块通讯连接,用于以所述第二预览比例对应的一显示框切割所述第一当前画面,保留所述显示框内的显示画面作为一第二当前画面,于所述拍照界面内显示所述第二当前画面。The preview module is in communication with the control module, and is configured to cut the first current picture by using a display frame corresponding to the second preview ratio, and retain the display image in the display frame as a second current picture. Displaying the second current picture in the photographing interface.
  7. 如权利要求6所述的切换装置,其特征在于,所述控制模块,包括:The switching device of claim 6, wherein the control module comprises:
    启动单元,用于当接收一启动所述摄像头指令时,调用与所述摄像头相应的控制装置开启所述摄像头;a startup unit, configured to: when receiving the camera instruction, invoke a control device corresponding to the camera to turn on the camera;
    第一画面单元,与所述启动单元通讯连接,用于获取所述摄像头的第一当前画面;a first picture unit, configured to be in communication with the activation unit, configured to acquire a first current picture of the camera;
    第一预览单元,与所述第一画面单元通讯连接,用于以所述第一预览比例将所述第一当前画面存储为所述第一预览数据;a first preview unit, configured to be in communication with the first picture unit, configured to store the first current picture as the first preview data by using the first preview ratio;
    第一显示单元,与所述第一预览单元通讯连接,用于在所述智能设备的拍照界面显示所述第一当前画面。The first display unit is in communication with the first preview unit, and is configured to display the first current picture on a photographing interface of the smart device.
  8. 如权利要求6所述的切换装置,其特征在于,所述切换模块,包括:The switching device of claim 6, wherein the switching module comprises:
    触摸感应单元,用于检测在所述拍照界面输入的触摸操作,并获取所述触摸操作的参数;a touch sensing unit, configured to detect a touch operation input at the photographing interface, and acquire a parameter of the touch operation;
    所述触摸操作的参数包括至少一组触摸区域和按压力度之间的对应关系;The parameter of the touch operation includes a correspondence between at least one set of touch regions and a pressing force;
    触摸匹配单元,与所述触摸感应单元通讯连接,用于当所述触摸操作的参数与所述切换指令的参数匹配时,所述智能设备执行所述切换指令。Touching the matching unit, and communicating with the touch sensing unit, when the parameter of the touch operation matches a parameter of the switching instruction, the smart device executes the switching instruction.
  9. 如权利要求6所述的切换装置,其特征在于,所述预览模块,包括:The switching device of claim 6, wherein the preview module comprises:
    第二画面单元,用于生成基于所述第二预览比例的所述显示框;a second picture unit, configured to generate the display frame based on the second preview ratio;
    第二预览单元,与所述第二画面单元通讯连接,用于通过所述显示框切割所述第一当 前画面作为所述第二当前画面,且存储为所述第二预览数据;a second preview unit, communicatively coupled to the second picture unit, for cutting the first time through the display frame The front picture is used as the second current picture, and is stored as the second preview data;
    第二显示单元,与所述第二预览单元通讯连接,用于在所述智能设备的拍照界面显示所述第二当前画面。The second display unit is communicatively coupled to the second preview unit for displaying the second current picture on the photographing interface of the smart device.
  10. 如权利要求6所述的切换装置,其特征在于,所述预览模块,还包括:The switching device of claim 6, wherein the preview module further comprises:
    参数配置单元,用于获取所述智能设备的拍照界面的尺寸参数;a parameter configuration unit, configured to acquire a size parameter of a photographing interface of the smart device;
    预览设置单元,与所述参数配置单元通讯连接,用于基于所述尺寸参数,在所述智能设备的拍照界面内调整所述显示框。 And a preview setting unit, configured to communicate with the parameter configuration unit, configured to adjust the display frame in a photographing interface of the smart device based on the size parameter.
PCT/CN2017/095664 2017-08-02 2017-08-02 Photographing interface preview switching method and switching apparatus for smart device WO2019024007A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/095664 WO2019024007A1 (en) 2017-08-02 2017-08-02 Photographing interface preview switching method and switching apparatus for smart device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/095664 WO2019024007A1 (en) 2017-08-02 2017-08-02 Photographing interface preview switching method and switching apparatus for smart device

Publications (1)

Publication Number Publication Date
WO2019024007A1 true WO2019024007A1 (en) 2019-02-07

Family

ID=65232094

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/095664 WO2019024007A1 (en) 2017-08-02 2017-08-02 Photographing interface preview switching method and switching apparatus for smart device

Country Status (1)

Country Link
WO (1) WO2019024007A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752699A (en) * 2019-03-27 2020-10-09 北京沃东天骏信息技术有限公司 Page switching method and device and computer readable storage medium
CN112114906A (en) * 2020-09-30 2020-12-22 上海商米科技集团股份有限公司 Multi-camera application mode method based on android platform

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150062175A1 (en) * 2013-09-03 2015-03-05 Lg Electronics Inc. Display device and method of controlling the same
CN105657272A (en) * 2016-02-04 2016-06-08 上海卓易科技股份有限公司 Terminal equipment and photographing method thereof
CN106303051A (en) * 2016-08-22 2017-01-04 华蓥市高科龙电子科技有限公司 A kind of method for previewing of smart mobile phone
CN106454132A (en) * 2016-11-29 2017-02-22 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN106506988A (en) * 2016-11-14 2017-03-15 广州视睿电子科技有限公司 The collocation method and device of frame parameter

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150062175A1 (en) * 2013-09-03 2015-03-05 Lg Electronics Inc. Display device and method of controlling the same
CN105657272A (en) * 2016-02-04 2016-06-08 上海卓易科技股份有限公司 Terminal equipment and photographing method thereof
CN106303051A (en) * 2016-08-22 2017-01-04 华蓥市高科龙电子科技有限公司 A kind of method for previewing of smart mobile phone
CN106506988A (en) * 2016-11-14 2017-03-15 广州视睿电子科技有限公司 The collocation method and device of frame parameter
CN106454132A (en) * 2016-11-29 2017-02-22 广东欧珀移动通信有限公司 Control method, control device and electronic device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752699A (en) * 2019-03-27 2020-10-09 北京沃东天骏信息技术有限公司 Page switching method and device and computer readable storage medium
CN111752699B (en) * 2019-03-27 2024-04-09 北京沃东天骏信息技术有限公司 Page switching method, device and computer readable storage medium
CN112114906A (en) * 2020-09-30 2020-12-22 上海商米科技集团股份有限公司 Multi-camera application mode method based on android platform
CN112114906B (en) * 2020-09-30 2024-01-30 上海商米科技集团股份有限公司 Multi-camera application mode method based on android platform

Similar Documents

Publication Publication Date Title
CN106060406B (en) Photographing method and mobile terminal
JP5365885B2 (en) Handheld electronic device, double image acquisition method applied thereto, and program loaded thereon
WO2018059352A1 (en) Remote control method and apparatus for live video stream
US20190011997A1 (en) Command relay device, system and method for providing remote assistance/remote control
WO2017088580A1 (en) Image display method and apparatus
WO2023040636A1 (en) Collaboration window processing method and system, and electronic device
CN107360400B (en) Video recording method and video recording device for intelligent equipment camera
WO2021037227A1 (en) Image processing method, electronic device and cloud server
EP3432588B1 (en) Method and system for processing image information
WO2019127333A1 (en) Image processing method, mobile platform, control device and system
JP5982079B2 (en) Image transmission method, apparatus, program, and recording medium
WO2021013147A1 (en) Video processing method, device, terminal, and storage medium
US20240007583A1 (en) Video processing method and apparatus, and storage media
CN111597370B (en) Shooting method and electronic equipment
WO2018076309A1 (en) Photographing method and terminal
US10477265B2 (en) Method and apparatus for requesting data, and method and apparatus for obtaining data
CN111970549B (en) Menu display method and display device
WO2022042769A2 (en) Multi-screen interaction system and method, apparatus, and medium
CN113746718B (en) Content sharing method, device and system
WO2019024007A1 (en) Photographing interface preview switching method and switching apparatus for smart device
CN113225838A (en) Microphone control method, audio receiving equipment and audio collecting equipment
WO2022166521A1 (en) Cross-device collaborative photographing method, related apparatus, and system
CN111787364B (en) Media data acquisition method, smart television and mobile terminal
US20140111678A1 (en) Method and system for capturing, storing and displaying animated photographs
JP6441385B2 (en) Information input method, apparatus, program, and recording medium

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: 17919770

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: 17919770

Country of ref document: EP

Kind code of ref document: A1