WO2018040174A1 - Method and apparatus for setting preview resolution, and terminal - Google Patents

Method and apparatus for setting preview resolution, and terminal Download PDF

Info

Publication number
WO2018040174A1
WO2018040174A1 PCT/CN2016/100682 CN2016100682W WO2018040174A1 WO 2018040174 A1 WO2018040174 A1 WO 2018040174A1 CN 2016100682 W CN2016100682 W CN 2016100682W WO 2018040174 A1 WO2018040174 A1 WO 2018040174A1
Authority
WO
WIPO (PCT)
Prior art keywords
resolution
preview
initial
ratio
pixels
Prior art date
Application number
PCT/CN2016/100682
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 宇龙计算机通信科技(深圳)有限公司
Publication of WO2018040174A1 publication Critical patent/WO2018040174A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1407General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1415Digital output to display device ; Cooperation and interconnection of the display device with other functional units with means for detecting differences between the image stored in the host and the images displayed on the displays

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, and a terminal for setting a preview resolution.
  • the camera function has become one of the basic functions of electronic products such as mobile phones. Users have become accustomed to taking photos of their mobile phones to record what is happening in their lives.
  • the preview interface can present the picture currently captured by the camera, so that the user can adjust the shooting position according to the content displayed on the preview interface.
  • the resolution of the preview interface is low, there may be a case where the preview effect is significantly different from the actual shooting effect.
  • the above implementation will result in a higher resolution of the preview interface.
  • the resolution of the preview interface reaches the maximum resolution that the display can support, the increase of the preview resolution does not improve the preview effect, and the higher preview resolution increases the real-time data generated during the user's shooting, thereby occupying A large amount of mobile phone memory and resources to increase mobile phone power consumption.
  • the invention provides a method, a device and a terminal for setting a preview resolution, which solves the problem that the terminal power consumption is large due to the high preview resolution.
  • the embodiment of the present invention adopts the following technical solutions:
  • the present invention provides a method for setting a preview resolution, the method comprising: acquiring a screen resolution of a terminal and an initial preview resolution during terminal shooting, the initial preview resolution and a camera resolution of the terminal The same; if the initial preview resolution is greater than the screen resolution, according to a ratio of the initial preview resolution to the number of vertical pixels of the screen resolution, and the initial preview resolution and the screen resolution The ratio of the number of horizontal pixels determines a preview ratio; according to the preview ratio, the preview resolution during the shooting of the terminal is adjusted from the initial resolution to the current preview resolution, and the current preview resolution is smaller than the initial Preview resolution.
  • the present invention provides an apparatus for setting a preview resolution, the apparatus comprising: an acquisition module configured to acquire a screen resolution of the terminal and an initial preview resolution during terminal shooting, the initial preview resolution and The camera has the same resolution; the determining module is configured to: when the initial preview resolution acquired by the acquiring module is greater than the screen resolution acquired by the acquiring module, according to the initial preview resolution and the screen resolution a ratio of the number of pixels, and a ratio of the initial preview resolution to the number of horizontal pixels of the screen resolution determines a preview ratio; the adjustment module is configured to follow the preview ratio determined by the determining module, and the terminal is in the process of shooting The preview resolution is adjusted by the acquisition module to an initial resolution, and the current preview resolution is smaller than the initial preview resolution.
  • the present invention provides a terminal, the terminal comprising at least the apparatus for setting a preview resolution according to the second aspect.
  • the method, device and terminal for setting preview resolution provided by the present invention, if the initial preview resolution obtained is greater than the screen resolution, the ratio of the vertical pixels according to the initial preview resolution and the screen resolution, and the horizontal pixels of the two The ratio of the number determines the preview ratio, and the preview resolution during the terminal shooting is adjusted from the initial preview resolution to the current preview resolution according to the preview ratio; otherwise, the initial preview resolution is still used as the preview resolution during the terminal shooting.
  • the preview resolution and the camera resolution are set to the same resolution.
  • the initial adjustment resolution can be adjusted according to the ratio of the initial preview resolution to the screen resolution. Preview the resolution to get the current preview resolution that is less than the initial preview resolution.
  • the present invention can solve the problem of large power consumption of the terminal due to excessive preview resolution.
  • FIG. 1 is a flowchart of a method for setting a preview resolution according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another method for setting a preview resolution according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of another method for setting a preview resolution according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of another method for setting a preview resolution according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an apparatus for setting a preview resolution according to an embodiment of the present invention.
  • FIG. 6 is a schematic block diagram of a structure of a terminal according to an embodiment of the present invention.
  • the embodiment of the invention provides a method for setting a preview resolution, which can be applied to terminals such as mobile phones and tablet computers. As shown in FIG. 1 , the method process specifically includes:
  • the initial preview resolution is the same as the camera resolution of the terminal.
  • the user's shooting process involves three resolution parameters, including: camera resolution, screen resolution and preview resolution.
  • camera resolution In order to obtain pictures of different quality, you can select cameras with different resolutions to complete the image acquisition process.
  • the resolution of the camera with the size of 8M corresponds to 3264*2448
  • the resolution of the camera with the size of 13M corresponds to 4208*. 3120.
  • the resolution of the screen is determined by the hardware structure of the screen, such as the screen resolution of the FHD (English: Full High Definition) screen with a screen resolution of 1920*1080 and HD (English: High Definition) screen.
  • the resolution is 1280*720.
  • the camera resolution is usually used as the preview resolution.
  • preview and “photographing” can be separately processed, that is, the preview uses a set of parameters, the camera uses another set of parameters, the parameters used in the preview process and the parameters used in the photographing process. Do not affect each other. Therefore, the change in preview resolution does not affect the quality of the image.
  • the user can select different camera resolutions according to his own needs, but when the camera of the terminal is fixed, the maximum resolution of the camera is the full-size resolution of the camera.
  • steps 103 and 104 are performed; otherwise, step 105 is performed.
  • the initial preview resolution When the initial preview resolution is greater than the screen resolution, the screen resolution becomes the main factor limiting the preview effect. At this time, the initial preview resolution is adjusted without affecting the preview effect. Therefore, the initial preview resolution can be reduced by the preview ratio.
  • the preview ratio can be determined by the ratio of the initial preview resolution to the number of vertical pixels of the screen resolution, and the ratio of the initial preview resolution to the number of horizontal pixels of the screen resolution.
  • the initial preview resolution is 3264*2448
  • the screen resolution is 1920*1080
  • the ratio of the initial preview resolution to the vertical resolution of the screen resolution is 3264/1920
  • the initial preview resolution and the screen resolution are the number of horizontal pixels.
  • the ratio is 2448/1080
  • the preview ratio can be determined according to the ratio of the number of vertical pixels to 3264/1920 and the ratio of the horizontal pixels to 2448/1080. The specific determination method will be proposed later, and will not be described here.
  • the preview resolution during the terminal shooting is adjusted from the initial resolution to the current preview resolution.
  • the current preview resolution is smaller than the initial preview resolution, which means that the initial preview resolution is reduced according to the preview ratio, and a current preview resolution smaller than the initial preview resolution can be obtained.
  • the initial preview resolution is the main factor determining the preview effect. Adjusting the initial preview resolution may affect the preview effect. Therefore, in order to avoid the influence on the preview effect, the initial preview resolution is set to the current preview resolution, that is, the preview resolution during the terminal shooting is not adjusted.
  • a method for setting a preview resolution provided by an embodiment of the present invention, if the obtained initial preview resolution is greater than the screen resolution, the ratio of the vertical pixels according to the initial preview resolution and the screen resolution, and the number of horizontal pixels of the two Compared with determining the preview ratio, the preview resolution during terminal shooting is adjusted from the initial preview resolution to the current preview resolution according to the preview ratio; otherwise, the initial preview resolution is still used as the preview resolution during the terminal shooting.
  • the preview resolution and the camera resolution are set to the same resolution.
  • the present invention can adjust the terminal according to the ratio of the initial preview resolution to the screen resolution. The preview ratio during shooting.
  • the present invention can solve the problem of large power consumption of the terminal due to excessive preview resolution.
  • the number of vertical pixels of the initial preview resolution is greater than the number of vertical pixels of the screen resolution, and the horizontal pixels of the initial preview resolution are used to reduce the influence of the preview resolution.
  • the preview resolution needs to be adjusted. Therefore, on the basis of the implementation shown in FIG. 1, an implementation as shown in FIG. 2 can also be implemented.
  • the step 102 determines whether the initial resolution is greater than the screen resolution, and may be specifically implemented as steps 1021 to 1024:
  • step 1022 is performed; otherwise, step 1024 is performed.
  • step 1023 If the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution, step 1023 is performed; otherwise, step 1024 is performed.
  • adjusting the initial preview resolution may affect the preview effect. If the number of vertical pixels of the initial preview resolution is less than or equal to the number of vertical pixels of the screen resolution, indicating that the initial preview resolution is the main factor affecting the preview effect in the vertical direction, adjusting the initial preview resolution may affect the preview effect. . If the number of horizontal pixels of the initial preview resolution is less than the number of horizontal pixels of the screen resolution, indicating that the initial preview resolution is the main factor affecting the preview effect in the horizontal direction, adjusting the initial preview resolution at this time may affect the preview effect.
  • the initial preview resolution in order to reduce the influence on the preview effect, when the number of vertical pixels of the initial preview resolution is less than or equal to the number of vertical pixels of the screen resolution or the number of horizontal pixels of the initial preview resolution is less than or the screen resolution
  • the number of horizontal pixels is the rate
  • the initial pixel number of the initial preview resolution is greater than the number of vertical pixels of the screen resolution
  • the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution
  • the initial preview resolution is 3264*2448 and the screen resolution is 1920*1080
  • the initial preview resolution is 1280*960 and the screen resolution is 1920*1080
  • the present invention is not limited to the order of comparison of the number of vertical pixels and the comparison process of the number of horizontal pixels.
  • the method for setting a preview resolution provided by the embodiment of the present invention, if the number of vertical pixels of the initial preview resolution is greater than the number of vertical pixels of the screen resolution, and the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution, then Determine that the initial preview resolution is greater than the screen resolution; otherwise determine that the initial preview resolution is less than or equal to the screen resolution.
  • the preview resolution and the camera resolution are set to the same resolution, and the present invention solves the problem of large power consumption of the terminal due to excessive preview resolution, only when the initial preview resolution is When the number of vertical pixels is greater than the number of vertical pixels of the screen resolution, and the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution, it is determined that the initial preview resolution is greater than the screen resolution, thereby avoiding the initial preview resolution adjustment.
  • Reasonable the impact on the preview effect.
  • the step 103 determines the preview ratio according to the ratio of the initial preview resolution to the vertical pixel number of the screen resolution and the ratio of the initial preview resolution to the horizontal pixel number of the screen resolution, which may be specifically implemented as steps 1031 to 1033:
  • step 1032 is performed; otherwise, step 1033 is performed.
  • the smaller of the ratio of the horizontal pixel number to the vertical pixel number is determined as the preview ratio.
  • the initial preview resolution is 3264*2448
  • the screen resolution is 1920*1080
  • the ratio of vertical pixels is 3264/1920 is less than the ratio of horizontal pixels to 2448/1080
  • the ratio of the number of vertical pixels is determined as the preview ratio
  • initial preview The resolution is 3264*2448
  • the screen resolution is 1280*1024
  • the ratio of vertical pixels is 3264/1280 is greater than the ratio of horizontal pixels to 2448/1024
  • the ratio of the number of horizontal pixels is determined as the preview ratio.
  • the method for setting the preview resolution provided by the embodiment of the present invention the ratio of the preview resolution to the vertical pixel number of the screen resolution, and the smaller one of the ratio of the preview resolution to the horizontal pixel number of the screen resolution is used as the preview ratio.
  • the preview resolution and the camera resolution are set to the same resolution, and the present invention solves the problem that the terminal power consumption is large due to the excessive preview resolution, by using the preview resolution and The ratio of the vertical pixel count of the screen resolution and the smaller of the ratio of the preview resolution to the horizontal pixel number of the screen resolution as the preview ratio ensures that the adjusted initial preview resolution is still greater than the screen resolution, thereby The initial preview resolution is adjusted without affecting the preview.
  • the number of vertical pixels and the number of vertical pixels of the initial resolution are respectively adjusted according to a certain ratio in order to ensure that the preview interface is not deformed after the preview resolution is adjusted. Therefore, on the basis of the implementation shown in FIG. 1, an implementation as shown in FIG. 4 can also be implemented.
  • the step 104 adjusts the preview resolution during the terminal shooting from the initial resolution to the current preview resolution according to the preview ratio, which may be specifically implemented as steps 1041 to 1043:
  • the initial preview resolution is 3264*2448
  • the screen resolution is 1920*1080
  • the number of horizontal pixels of the initial preview resolution is 2448, adjusted according to the preview ratio 3264/1920
  • the resolution is 1920*1440.
  • the preview resolution during terminal shooting can be adjusted from 3264*2448 to 1920*1440.
  • the preview ratio is determined to be 2448/1080
  • the number of vertical pixels of the current preview resolution is 1440
  • the number of horizontal pixels is 1080
  • the method for setting the preview resolution provided by the embodiment of the present invention adjusts the number of vertical pixels and the number of horizontal pixels of the initial preview resolution according to the preview ratio, and distinguishes the number of vertical pixels and the number of horizontal pixels of the current preview resolution, and shoots the terminal.
  • the preview resolution in the process is adjusted to the current preview resolution.
  • the preview resolution and the camera resolution are set to the same resolution, and the present invention solves the problem of large power consumption of the terminal due to excessive preview resolution, and the initial preview resolution.
  • the number of vertical pixels and the number of horizontal pixels are adjusted in the same proportion to ensure that the preview interface does not deform relative to the image captured by the camera.
  • the embodiment of the present invention further provides an apparatus 20 for setting a preview resolution.
  • the apparatus 20 is configured to perform any method flow as shown in FIG. 1 to FIG.
  • the obtaining module 21 is configured to acquire the screen resolution of the terminal and the initial preview resolution during the terminal shooting, and the initial preview resolution is the same as the camera resolution of the terminal.
  • the determining module 22 is configured to, when the initial preview resolution acquired by the obtaining module 21 is greater than the screen resolution acquired by the obtaining module 21, the ratio of the initial preview resolution to the vertical pixel number of the screen resolution, and the initial preview resolution and the screen The ratio of the number of horizontal pixels of the resolution determines the preview ratio.
  • the adjustment module 23 is configured to adjust the initial resolution acquired by the acquisition module 21 to the current preview resolution according to the preview ratio determined by the determination module 22, and the current preview resolution is smaller than the initial preview resolution.
  • the device 20 further includes:
  • the determining module 24 is configured to determine whether the number of vertical pixels of the initial preview resolution acquired by the obtaining module 21 is greater than the number of vertical pixels of the screen resolution acquired by the acquiring module 21; and when the number of vertical pixels of the initial preview resolution is greater than the screen resolution When the number of vertical pixels is used, it is judged whether the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution.
  • the determining module 22 is further configured to determine that the initial preview resolution is greater than the screen resolution when the determining module 24 determines that the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution.
  • the determining module 22 is specifically configured to determine, when the ratio of the number of vertical pixels is greater than the ratio of the number of horizontal pixels, the ratio of the number of horizontal pixels is determined as a preview ratio; when the ratio of the number of vertical pixels is less than Or equal to the ratio of the number of horizontal pixels, the ratio of the number of vertical pixels is determined as the preview ratio.
  • the adjusting module 23 is specifically configured to reduce the number of vertical pixels and the number of horizontal pixels of the initial preview resolution according to the preview ratio; the number of vertical pixels of the reduced initial preview resolution and The number of horizontal pixels, set to the number of vertical pixels and horizontal pixels of the current preview resolution; adjust the preview resolution during terminal shooting to the current preview resolution.
  • the determining module 22 is further configured to set the initial resolution to the current preview resolution when the initial resolution is less than or equal to the screen resolution.
  • the apparatus for setting a preview resolution provided by the embodiment of the present invention, if the obtained initial preview resolution is greater than the screen resolution, the ratio of the vertical pixels according to the initial preview resolution and the screen resolution, and the number of horizontal pixels of the two Compared with determining the preview ratio, the preview resolution during terminal shooting is adjusted from the initial preview resolution to the current preview resolution according to the preview ratio; otherwise, the initial preview resolution is still used as the preview resolution during the terminal shooting.
  • the preview resolution and the camera resolution are set to the same resolution.
  • the present invention can adjust the terminal according to the ratio of the initial preview resolution to the screen resolution. The preview ratio during shooting.
  • the present invention can solve the problem of large power consumption of the terminal due to excessive preview resolution.
  • the embodiment of the present invention further provides a terminal, where the terminal is configured to execute the method flow shown in FIG. 1 to FIG. 4, and the terminal at least includes the apparatus for setting a preview resolution as shown in FIG. 5.
  • the terminal provided by the embodiment of the present invention determines the preview ratio according to the ratio of the initial preview resolution to the vertical pixel number of the screen resolution and the ratio of the horizontal pixels of the two, if the obtained initial preview resolution is greater than the screen resolution.
  • the preview resolution during terminal shooting is adjusted from the initial preview resolution to the current preview resolution according to the preview ratio; otherwise, the initial preview resolution is still used as the preview resolution during the terminal shooting.
  • the preview resolution and the camera resolution are set to the same resolution.
  • the present invention can adjust the terminal according to the ratio of the initial preview resolution to the screen resolution.
  • the preview ratio during shooting Since the current preview resolution obtained after the adjustment is smaller than the initial preview resolution, the number of pixels of the current preview resolution is smaller than the number of pixels of the initial preview resolution. Therefore, in the process of previewing the terminal using the current preview resolution, the number of pixels that the terminal needs to update in real time is reduced, which reduces the power consumption of the terminal. Therefore, the present invention can solve the problem of large power consumption of the terminal due to excessive preview resolution.
  • the terminal 30 in the embodiment of the present invention may be different types of electronic devices, such as: smart phones, tablet computers, palmtop computers, and mobile internet devices, personal digital assistants, media players, smart televisions, smart watches, smart glasses, smart hands. Ring and so on.
  • the terminal 30 in the embodiment of the present invention includes at least one processor 31, such as a CPU, at least one receiver 33, at least one memory 34, at least one transmitter 35, and at least one communication bus 32.
  • the communication bus 32 is used to implement connection communication between these components.
  • the receiver 33 and the transmitter 35 may be wired transmission ports or wireless devices, for example, including antenna devices for data communication with other devices.
  • the memory 34 may be a high speed RAM memory or a non-volatile memory such as at least one disk memory.
  • the processor 31 can execute the operating system of the terminal 30 and various installed application programs, program codes, and the like.
  • each module described above includes the acquiring module 21, the determining module 22, and the like.
  • Program code is stored in the memory 34, and the processor 31 can call the program code stored in the memory 34 via the communication bus 32 to perform related functions.
  • the various modules e.g., the acquisition module 21, the determination module 22, etc.
  • FIG. 5 are program codes stored in the memory 34, and are executed by the processor 31, thereby implementing The functions of the various modules are implemented to implement a method of setting a preview resolution.
  • the memory 34 stores a plurality of instructions that are executed by the processor 31 to implement a method of setting a preview resolution.
  • the performing, by the processor 31, the execution of the multiple instructions includes: acquiring a screen resolution of the terminal and an initial preview resolution during the terminal shooting, where the initial preview resolution is the same as the camera resolution of the terminal; If the initial preview resolution is greater than the screen resolution, a ratio of the initial preview resolution to the number of vertical pixels of the screen resolution, and a level of the initial preview resolution and the screen resolution The ratio of the number of pixels determines a preview ratio; according to the preview ratio, the preview resolution during the shooting of the terminal is adjusted from the initial resolution to a current preview resolution, and the current preview resolution is smaller than the initial preview resolution. rate.
  • the processor 31 further: determining whether the vertical pixel number of the initial preview resolution is greater than the vertical of the screen resolution. a number of pixels; if the number of vertical pixels of the initial preview resolution is greater than the number of vertical pixels of the screen resolution, determining whether the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution; If the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution, it is determined that the initial preview resolution is greater than the screen resolution.
  • the ratio of the initial preview resolution to the number of vertical pixels of the screen resolution, and the ratio of the initial preview resolution to the horizontal pixel number of the screen resolution determine a preview The ratio includes: if a ratio of the number of vertical pixels is greater than a ratio of the number of horizontal pixels, determining a ratio of the number of horizontal pixels as the preview ratio; if a ratio of the number of vertical pixels is less than or equal to the ratio The ratio of the number of horizontal pixels determines the ratio of the number of vertical pixels as the preview ratio.
  • the adjusting the initial preview resolution of the terminal to the current preview resolution according to the preview ratio comprises: reducing a vertical pixel number of the initial preview resolution according to the preview ratio The number of horizontal pixels; the number of vertical pixels and horizontal pixels of the reduced initial preview resolution, the number of vertical pixels and the number of horizontal pixels of the current preview resolution; and the preview resolution during the shooting of the terminal Adjust to the current preview resolution.
  • the processor 31 sets the initial resolution if the initial resolution is less than or equal to the screen resolution.
  • the current preview resolution is set.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (English: Read-Only Memory, ROM for short) or a random access memory (English: Random Access Memory, RAM for short).

Abstract

A method and apparatus for setting a preview resolution, and a terminal, wherein same relate to the technical field of communications and can solve the problem of the high power consumption of a mobile phone due to an extremely high preview resolution. The method comprises: acquiring a screen resolution of a terminal and an initial preview resolution during a photographing process of the terminal (101), wherein the initial preview resolution is the same as the resolution of a camera of the terminal; if the initial preview resolution is higher than the screen resolution (102), determining a preview proportion according to a perpendicular pixel number ratio of the initial preview resolution to the screen resolution and a horizontal pixel number ratio of the initial preview resolution to the screen resolution (103); and adjusting the preview resolution during the photographing process of the terminal from the initial resolution to a current preview resolution according to the preview proportion (104), wherein the current preview resolution is lower than the initial preview resolution. The method is applicable to the process of setting a preview resolution.

Description

一种设置预览分辨率的方法、装置及终端Method, device and terminal for setting preview resolution
本申请要求于2016年8月31日提交中国专利局,申请号为201610790518.9、发明名称为“一种设置预览分辨率的方法、装置及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 201610790518.9, entitled "A Method, Apparatus and Terminal for Setting Preview Resolution", filed on August 31, 2016, the entire contents of which are hereby incorporated by reference. Combined in this application.
技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种设置预览分辨率的方法、装置及终端。The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, and a terminal for setting a preview resolution.
背景技术Background technique
目前,拍照功能已经成为手机等电子产品的基本功能之一,用户已经习惯于随时随地通过手机拍照来记录生活中发生的事情。在实际使用过程中,预览界面能够呈现摄像头当前拍摄的画面,使用户可以根据预览界面所显示的内容来调整拍摄位置。At present, the camera function has become one of the basic functions of electronic products such as mobile phones. Users have become accustomed to taking photos of their mobile phones to record what is happening in their lives. In the actual use process, the preview interface can present the picture currently captured by the camera, so that the user can adjust the shooting position according to the content displayed on the preview interface.
如果预览界面的分辨率较低,则可能会出现预览效果与实际拍摄效果差别较大的情况。为了使预览效果贴近实际拍摄效果,可以将手机中预览界面的分辨率和摄像头的分辨率设置为相同的分辨率。对于分辨率较高的摄像头而言,采用上述实现方式会造成预览界面的分辨率也处于较高的状态。然而,当预览界面的分辨率达到显示屏能够支持的最大分辨率后,预览分辨率的增加并不能提高预览效果,且较高的预览分辨率会增加用户拍摄过程中产生的实时数据,从而占用大量手机内存和资源,增加手机功耗。If the resolution of the preview interface is low, there may be a case where the preview effect is significantly different from the actual shooting effect. In order to make the preview effect close to the actual shooting effect, you can set the resolution of the preview interface and the resolution of the camera in the phone to the same resolution. For a camera with a higher resolution, the above implementation will result in a higher resolution of the preview interface. However, when the resolution of the preview interface reaches the maximum resolution that the display can support, the increase of the preview resolution does not improve the preview effect, and the higher preview resolution increases the real-time data generated during the user's shooting, thereby occupying A large amount of mobile phone memory and resources to increase mobile phone power consumption.
发明内容Summary of the invention
本发明提供一种设置预览分辨率的方法、装置及终端,解决了因预览分辨率过高,而造成的终端功耗大的问题。The invention provides a method, a device and a terminal for setting a preview resolution, which solves the problem that the terminal power consumption is large due to the high preview resolution.
为达到上述目的,本发明实施例采用如下技术方案:To achieve the above objective, the embodiment of the present invention adopts the following technical solutions:
第一方面,本发明提供一种设置预览分辨率的方法,所述方法包括:获取终端的屏幕分辨率和终端拍摄过程中的初始预览分辨率,所述初始预览分辨率与终端的摄像头分辨率相同;如果所述初始预览分辨率大于所述屏幕分辨率,则根据所述初始预览分辨率与所述屏幕分辨率的垂直像素数之比,以及所述初始预览分辨率与所述屏幕分辨率的水平像素数之比确定预览比例;按照所述预览比例,将所述终端拍摄过程中的预览分辨率由所述初始分辨率调整为当前预览分辨率,所述当前预览分辨率小于所述初始预览分辨率。In a first aspect, the present invention provides a method for setting a preview resolution, the method comprising: acquiring a screen resolution of a terminal and an initial preview resolution during terminal shooting, the initial preview resolution and a camera resolution of the terminal The same; if the initial preview resolution is greater than the screen resolution, according to a ratio of the initial preview resolution to the number of vertical pixels of the screen resolution, and the initial preview resolution and the screen resolution The ratio of the number of horizontal pixels determines a preview ratio; according to the preview ratio, the preview resolution during the shooting of the terminal is adjusted from the initial resolution to the current preview resolution, and the current preview resolution is smaller than the initial Preview resolution.
第二方面,本发明提供一种设置预览分辨率的装置,所述装置包括:获取模块,设置为获取终端的屏幕分辨率和终端拍摄过程中的初始预览分辨率,所述初始预览分辨率与终端的摄像头分辨率相同;确定模块,设置为当所述获取模块获取的初始预览分辨率大于所述获取模块获取的屏幕分辨率时,根据所述初始预览分辨率与所述屏幕分辨率的垂直像素数之比,以及所述初始预览分辨率与所述屏幕分辨率的水平像素数之比确定预览比例;调整模块,设置为按照所述确定模块确定的预览比例,将所述终端拍摄过程中的预览分辨率由所述获取模块获取的初始分辨率调整为当前预览分辨率,所述当前预览分辨率小于所述初始预览分辨率。In a second aspect, the present invention provides an apparatus for setting a preview resolution, the apparatus comprising: an acquisition module configured to acquire a screen resolution of the terminal and an initial preview resolution during terminal shooting, the initial preview resolution and The camera has the same resolution; the determining module is configured to: when the initial preview resolution acquired by the acquiring module is greater than the screen resolution acquired by the acquiring module, according to the initial preview resolution and the screen resolution a ratio of the number of pixels, and a ratio of the initial preview resolution to the number of horizontal pixels of the screen resolution determines a preview ratio; the adjustment module is configured to follow the preview ratio determined by the determining module, and the terminal is in the process of shooting The preview resolution is adjusted by the acquisition module to an initial resolution, and the current preview resolution is smaller than the initial preview resolution.
第三方面,本发明提供一种终端,所述终端至少包括第二方面所述的设置预览分辨率的装置。In a third aspect, the present invention provides a terminal, the terminal comprising at least the apparatus for setting a preview resolution according to the second aspect.
本发明提供的设置预览分辨率的方法、装置及终端,如果获取的初始预览分辨率大于屏幕分辨率,则根据初始预览分辨率和屏幕分辨率的垂直像素数之比,以及二者的水平像素数之比确定预览比例,按照预览比例将终端拍摄过程中的预览分辨率由初始预览分辨率调整为当前预览分辨率;否则,仍然使用初始预览分辨率作为终端拍摄过程中的预览分辨率。相比较于现有技术中将预览分辨率和摄像头分辨率设置为相同的分辨率,本发明在初始预览分辨率大于屏幕分辨率时,可以根据初始预览分辨率与屏幕分辨率的比例关系调整初始预览分辨率,得到小于初始预览分辨率的当前预览分辨率。由于当前预览分辨率小于初始预览分辨率,当前预览分辨率的像素点数量也就少于初始预览分辨率的像素点数量。因此,在终端使用当前预览分辨率进行预览的过程中,终端需要实时更新的像素点数量变少,降低了终端的功耗。因此,本发明能解决因预览分辨率过高造成的终端功耗大的问题。The method, device and terminal for setting preview resolution provided by the present invention, if the initial preview resolution obtained is greater than the screen resolution, the ratio of the vertical pixels according to the initial preview resolution and the screen resolution, and the horizontal pixels of the two The ratio of the number determines the preview ratio, and the preview resolution during the terminal shooting is adjusted from the initial preview resolution to the current preview resolution according to the preview ratio; otherwise, the initial preview resolution is still used as the preview resolution during the terminal shooting. Compared with the prior art, the preview resolution and the camera resolution are set to the same resolution. When the initial preview resolution is greater than the screen resolution, the initial adjustment resolution can be adjusted according to the ratio of the initial preview resolution to the screen resolution. Preview the resolution to get the current preview resolution that is less than the initial preview resolution. Since the current preview resolution is smaller than the initial preview resolution, the number of pixels of the current preview resolution is less than the number of pixels of the initial preview resolution. Therefore, in the process of previewing the terminal using the current preview resolution, the number of pixels that the terminal needs to update in real time is reduced, which reduces the power consumption of the terminal. Therefore, the present invention can solve the problem of large power consumption of the terminal due to excessive preview resolution.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings to be used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without any creative work.
图1为本发明实施例提供的一种设置预览分辨率的方法流程图;FIG. 1 is a flowchart of a method for setting a preview resolution according to an embodiment of the present invention;
图2为本发明实施例提供的另一种设置预览分辨率的方法流程图;2 is a flowchart of another method for setting a preview resolution according to an embodiment of the present invention;
图3为本发明实施例提供的另一种设置预览分辨率的方法流程图;FIG. 3 is a flowchart of another method for setting a preview resolution according to an embodiment of the present invention;
图4为本发明实施例提供的另一种设置预览分辨率的方法流程图;4 is a flowchart of another method for setting a preview resolution according to an embodiment of the present invention;
图5为本发明实施例提供的一种设置预览分辨率的装置示意图;FIG. 5 is a schematic diagram of an apparatus for setting a preview resolution according to an embodiment of the present invention;
图6为本发明实施例提供的一种终端的结构示意框图。FIG. 6 is a schematic block diagram of a structure of a terminal according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例提供一种设置预览分辨率的方法,该方法可以应用于手机、平板电脑等终端。如图1所示,该方法流程具体包括:The embodiment of the invention provides a method for setting a preview resolution, which can be applied to terminals such as mobile phones and tablet computers. As shown in FIG. 1 , the method process specifically includes:
101、获取终端的屏幕分辨率和终端拍摄过程中的初始预览分辨率。101. Acquire a screen resolution of the terminal and an initial preview resolution during the terminal shooting.
其中,初始预览分辨率与终端的摄像头分辨率相同。Among them, the initial preview resolution is the same as the camera resolution of the terminal.
在实际应用中,用户的拍摄过程涉及三个分辨率参数,具体包括:摄像头分辨率、屏幕分辨率和预览分辨率。为了得到不同质量的图片,可以选择不同分辨率的摄像头来完成图像的采集过程,如大小为8M的图片对应的摄像头分辨率为3264*2448,大小为13M的图片对应的摄像头分辨率为4208*3120。屏幕分辨率的大小由屏幕的硬件结构决定,如FHD(英文:Full High Definition,中文:全高清)屏的屏幕分辨率为1920*1080,HD(英文:High Definition,中文:高清)屏的屏幕分辨率为1280*720。而为了保证预览效果,通常使用摄像头分辨率作为预览分辨率。In practical applications, the user's shooting process involves three resolution parameters, including: camera resolution, screen resolution and preview resolution. In order to obtain pictures of different quality, you can select cameras with different resolutions to complete the image acquisition process. For example, the resolution of the camera with the size of 8M corresponds to 3264*2448, and the resolution of the camera with the size of 13M corresponds to 4208*. 3120. The resolution of the screen is determined by the hardware structure of the screen, such as the screen resolution of the FHD (English: Full High Definition) screen with a screen resolution of 1920*1080 and HD (English: High Definition) screen. The resolution is 1280*720. In order to guarantee the preview effect, the camera resolution is usually used as the preview resolution.
目前,由于终端中实现照相功能的软件部分,可实现“预览”及“拍照”分开处理,即预览用一组参数,拍照用另一组参数,预览过程使用的参数与拍照过程使用的参数之间互不影响。因此,预览分辨率的改变并不会影响图片的质量。At present, due to the software part of the camera that implements the camera function, "preview" and "photographing" can be separately processed, that is, the preview uses a set of parameters, the camera uses another set of parameters, the parameters used in the preview process and the parameters used in the photographing process. Do not affect each other. Therefore, the change in preview resolution does not affect the quality of the image.
需要说明的是,用户可以根据自身需求选择不同的摄像头分辨率,但当终端的摄像头固定,则摄像头分辨率的最大值为摄像头的全尺寸分辨率。It should be noted that the user can select different camera resolutions according to his own needs, but when the camera of the terminal is fixed, the maximum resolution of the camera is the full-size resolution of the camera.
102、确定初始分辨率是否大于屏幕分辨率。102. Determine if the initial resolution is greater than the screen resolution.
如果初始预览分辨率大于屏幕分辨率,则执行步骤103和步骤104;否则,执行步骤105。If the initial preview resolution is greater than the screen resolution, then steps 103 and 104 are performed; otherwise, step 105 is performed.
103、根据初始预览分辨率与屏幕分辨率的垂直像素数之比,以及初始预览分辨率与屏幕分辨率的水平像素数之比确定预览比例。103. Determine a preview ratio according to a ratio of an initial preview resolution to a vertical pixel number of the screen resolution, and a ratio of an initial preview resolution to a horizontal pixel number of the screen resolution.
当初始预览分辨率大于屏幕分辨率时,屏幕分辨率成为限制预览效果的主要因素,此时对初始预览分辨率进行调整,不会影响预览效果。因此,可以按照预览比例缩小初始预览分辨率。When the initial preview resolution is greater than the screen resolution, the screen resolution becomes the main factor limiting the preview effect. At this time, the initial preview resolution is adjusted without affecting the preview effect. Therefore, the initial preview resolution can be reduced by the preview ratio.
预览比例可以根据初始预览分辨率与屏幕分辨率的垂直像素数之比,以及初始预览分辨率与屏幕分辨率的水平像素数之比确定。例如,初始预览分辨率为3264*2448,屏幕分辨率为1920*1080,初始预览分辨率与屏幕分辨率的垂直像素数之比为3264/1920,初始预览分辨率与屏幕分辨率的水平像素数之比为2448/1080,预览比例可以根据垂直像素数之比为3264/1920和水平像素数之比为2448/1080确定,具体确定方式会在后文提出,在此不做赘述。The preview ratio can be determined by the ratio of the initial preview resolution to the number of vertical pixels of the screen resolution, and the ratio of the initial preview resolution to the number of horizontal pixels of the screen resolution. For example, the initial preview resolution is 3264*2448, the screen resolution is 1920*1080, the ratio of the initial preview resolution to the vertical resolution of the screen resolution is 3264/1920, and the initial preview resolution and the screen resolution are the number of horizontal pixels. The ratio is 2448/1080, and the preview ratio can be determined according to the ratio of the number of vertical pixels to 3264/1920 and the ratio of the horizontal pixels to 2448/1080. The specific determination method will be proposed later, and will not be described here.
104、按照预览比例,将终端拍摄过程中的预览分辨率由初始分辨率调整为当前预览分辨率。104. According to the preview ratio, the preview resolution during the terminal shooting is adjusted from the initial resolution to the current preview resolution.
在本发明实施例中,当前预览分辨率小于初始预览分辨率,也就意味着,将初始预览分辨率按照预览比例减小,可以得到小于初始预览分辨率的当前预览分辨率。In the embodiment of the present invention, the current preview resolution is smaller than the initial preview resolution, which means that the initial preview resolution is reduced according to the preview ratio, and a current preview resolution smaller than the initial preview resolution can be obtained.
105、将初始分辨率设置为当前预览分辨率。105. Set the initial resolution to the current preview resolution.
当初始预览分辨率小于或等于屏幕分辨率时,初始预览分辨率是决定预览效果的主要因素,此时对初始预览分辨率进行调整,可能会影响预览效果。因此,为了避免对预览效果的影响,将初始预览分辨率设置为当前预览分辨率,即不对终端拍摄过程中的预览分辨率进行调整。When the initial preview resolution is less than or equal to the screen resolution, the initial preview resolution is the main factor determining the preview effect. Adjusting the initial preview resolution may affect the preview effect. Therefore, in order to avoid the influence on the preview effect, the initial preview resolution is set to the current preview resolution, that is, the preview resolution during the terminal shooting is not adjusted.
本发明实施例提供的设置预览分辨率的方法,如果获取的初始预览分辨率大于屏幕分辨率,则根据初始预览分辨率和屏幕分辨率的垂直像素数之比,以及二者的水平像素数之比确定预览比例,按照预览比例将终端拍摄过程中的预览分辨率由初始预览分辨率调整为当前预览分辨率;否则,仍然使用初始预览分辨率作为终端拍摄过程中的预览分辨率。相比较于现有技术中将预览分辨率和摄像头分辨率设置为相同的分辨率,本发明在初始预览分辨率大于屏幕分辨率时,可以根据初始预览分辨率与屏幕分辨率的比例关系调整终端拍摄过程中的预览比例。由于调整后得到的当前预览分辨率小于初始预览分辨率,当前预览分辨率的像素点数量也就少于初始预览分辨率的像素点数量。因此,在终端使用当前预览分辨率进行预览的过程中,终端需要实时更新的像素点数量变少,降低了终端的功耗。因此,本发明能解决因预览分辨率过高造成的终端功耗大的问题。A method for setting a preview resolution provided by an embodiment of the present invention, if the obtained initial preview resolution is greater than the screen resolution, the ratio of the vertical pixels according to the initial preview resolution and the screen resolution, and the number of horizontal pixels of the two Compared with determining the preview ratio, the preview resolution during terminal shooting is adjusted from the initial preview resolution to the current preview resolution according to the preview ratio; otherwise, the initial preview resolution is still used as the preview resolution during the terminal shooting. Compared with the prior art, the preview resolution and the camera resolution are set to the same resolution. When the initial preview resolution is greater than the screen resolution, the present invention can adjust the terminal according to the ratio of the initial preview resolution to the screen resolution. The preview ratio during shooting. Since the current preview resolution obtained after the adjustment is smaller than the initial preview resolution, the number of pixels of the current preview resolution is smaller than the number of pixels of the initial preview resolution. Therefore, in the process of previewing the terminal using the current preview resolution, the number of pixels that the terminal needs to update in real time is reduced, which reduces the power consumption of the terminal. Therefore, the present invention can solve the problem of large power consumption of the terminal due to excessive preview resolution.
为了减少预览分辨率的调整对预览效果的影响,在本发明实施例的一个实现方式中,当初始预览分辨率的垂直像素数大于屏幕分辨率的垂直像素数,且初始预览分辨率的水平像素数大于屏幕分辨率的水平像素数时,需要对预览分辨率进行调整。因此,在如图1所示的实现方式的基础上,还可以实现为如图2所示的实现方式。其中,步骤102确定初始分辨率是否大于屏幕分辨率,可以具体实现为步骤1021至步骤1024:In an implementation manner of the embodiment of the present invention, the number of vertical pixels of the initial preview resolution is greater than the number of vertical pixels of the screen resolution, and the horizontal pixels of the initial preview resolution are used to reduce the influence of the preview resolution. When the number of horizontal pixels is larger than the screen resolution, the preview resolution needs to be adjusted. Therefore, on the basis of the implementation shown in FIG. 1, an implementation as shown in FIG. 2 can also be implemented. The step 102 determines whether the initial resolution is greater than the screen resolution, and may be specifically implemented as steps 1021 to 1024:
1021、判断初始预览分辨率的垂直像素数是否大于屏幕分辨率的垂直像素数。1011: Determine whether the number of vertical pixels of the initial preview resolution is greater than the number of vertical pixels of the screen resolution.
如果初始预览分辨率的垂直像素数大于屏幕分辨率的垂直像素数,则执行步骤1022;否则,执行步骤1024。If the number of vertical pixels of the initial preview resolution is greater than the number of vertical pixels of the screen resolution, step 1022 is performed; otherwise, step 1024 is performed.
1022、判断初始预览分辨率的水平像素数是否大于屏幕分辨率的水平像素数。1022. Determine whether the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution.
如果初始预览分辨率的水平像素数大于屏幕分辨率的水平像素数,则执行步骤1023;否则,执行步骤1024。If the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution, step 1023 is performed; otherwise, step 1024 is performed.
如果初始预览分辨率的垂直像素数小于或等于屏幕分辨率的垂直像素数,表明垂直方向上,初始预览分辨率是影响预览效果的主要因素,此时调整初始预览分辨率易对预览效果造成影响。如果初始预览分辨率的水平像素数小于或屏幕分辨率的水平像素数,表明水平方向上,初始预览分辨率是影响预览效果的主要因素,此时调整初始预览分辨率易对预览效果造成影响。因此,在本发明实施例中,为了减小对预览效果的影响,当初始预览分辨率的垂直像素数小于或等于屏幕分辨率的垂直像素数或初始预览分辨率的水平像素数小于或屏幕分辨率的水平像素数时,确定初始预览分辨率小于或等于屏幕分辨率。当初始预览分辨率的垂直像素数大于屏幕分辨率的垂直像素数,且初始预览分辨率的水平像素数大于屏幕分辨率的水平像素数时,确定初始预览分辨率大于屏幕分辨率。例如,当初始预览分辨率为3264*2448,屏幕分辨率为1920*1080时,确定初始预览分辨率大于屏幕分辨率;当初始预览分辨率为1280*960,屏幕分辨率为1920*1080时,确定初始分辨率小于或等于屏幕分辨率。If the number of vertical pixels of the initial preview resolution is less than or equal to the number of vertical pixels of the screen resolution, indicating that the initial preview resolution is the main factor affecting the preview effect in the vertical direction, adjusting the initial preview resolution may affect the preview effect. . If the number of horizontal pixels of the initial preview resolution is less than the number of horizontal pixels of the screen resolution, indicating that the initial preview resolution is the main factor affecting the preview effect in the horizontal direction, adjusting the initial preview resolution at this time may affect the preview effect. Therefore, in the embodiment of the present invention, in order to reduce the influence on the preview effect, when the number of vertical pixels of the initial preview resolution is less than or equal to the number of vertical pixels of the screen resolution or the number of horizontal pixels of the initial preview resolution is less than or the screen resolution When the number of horizontal pixels is the rate, it is determined that the initial preview resolution is less than or equal to the screen resolution. When the initial pixel number of the initial preview resolution is greater than the number of vertical pixels of the screen resolution, and the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution, it is determined that the initial preview resolution is greater than the screen resolution. For example, when the initial preview resolution is 3264*2448 and the screen resolution is 1920*1080, it is determined that the initial preview resolution is greater than the screen resolution; when the initial preview resolution is 1280*960 and the screen resolution is 1920*1080, Make sure the initial resolution is less than or equal to the screen resolution.
1023、确定初始预览分辨率大于屏幕分辨率。1023. Determine that the initial preview resolution is greater than the screen resolution.
1024、确定初始预览分辨率小于或等于屏幕分辨率。1024. Determine that the initial preview resolution is less than or equal to the screen resolution.
需要说明的是,对于垂直像素数的比较和水平像素数的比较过程的先后顺序,本发明不做限定。It should be noted that the present invention is not limited to the order of comparison of the number of vertical pixels and the comparison process of the number of horizontal pixels.
本发明实施例提供的设置预览分辨率的方法,如果初始预览分辨率的垂直像素数大于屏幕分辨率的垂直像素数,且初始预览分辨率的水平像素数大于屏幕分辨率的水平像素数,则确定初始预览分辨率大于屏幕分辨率;否则确定初始预览分辨率小于或等于屏幕分辨率。相比较于现有技术中将预览分辨率和摄像头分辨率设置为相同的分辨率,本发明在解决因预览分辨率过高造成的终端功耗大的问题的基础上,仅当初始预览分辨率的垂直像素数大于屏幕分辨率的垂直像素数,且初始预览分辨率的水平像素数大于屏幕分辨率的水平像素数时,确定初始预览分辨率大于屏幕分辨率,从而避免初始预览分辨率调整不合理,对预览效果的影响。The method for setting a preview resolution provided by the embodiment of the present invention, if the number of vertical pixels of the initial preview resolution is greater than the number of vertical pixels of the screen resolution, and the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution, then Determine that the initial preview resolution is greater than the screen resolution; otherwise determine that the initial preview resolution is less than or equal to the screen resolution. Compared with the prior art, the preview resolution and the camera resolution are set to the same resolution, and the present invention solves the problem of large power consumption of the terminal due to excessive preview resolution, only when the initial preview resolution is When the number of vertical pixels is greater than the number of vertical pixels of the screen resolution, and the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution, it is determined that the initial preview resolution is greater than the screen resolution, thereby avoiding the initial preview resolution adjustment. Reasonable, the impact on the preview effect.
为了保证调整预览分辨率后的预览效果,在本发明实施例的一个实现方式中,将垂直像素数之比与水平像素数之比中较小的值作为预览比例。因此,在如图1所示的实现方式的基础上,还可以实现为如图3所示的实现方式。其中,步骤103根据初始预览分辨率与屏幕分辨率的垂直像素数之比,以及初始预览分辨率与屏幕分辨率的水平像素数之比确定预览比例,可以具体实现为步骤1031至1033:In an implementation manner of the embodiment of the present invention, a smaller value of the ratio of the number of vertical pixels to the number of horizontal pixels is used as the preview ratio. Therefore, on the basis of the implementation shown in FIG. 1, an implementation as shown in FIG. 3 can also be implemented. The step 103 determines the preview ratio according to the ratio of the initial preview resolution to the vertical pixel number of the screen resolution and the ratio of the initial preview resolution to the horizontal pixel number of the screen resolution, which may be specifically implemented as steps 1031 to 1033:
1031、确定垂直像素数之比是否大于水平像素数之比。1031. Determine whether the ratio of the number of vertical pixels is greater than the ratio of the number of horizontal pixels.
如果垂直像素数之比大于水平像素数之比,则执行步骤1032;否则,执行步骤1033。If the ratio of the number of vertical pixels is greater than the ratio of the number of horizontal pixels, step 1032 is performed; otherwise, step 1033 is performed.
为了避免调整后的初始预览分辨率小于屏幕分辨率,从而影响预览效果,将水平像素数之比和垂直像素数之比中较小的一个,确定为预览比例。例如,初始预览分辨率为3264*2448,屏幕分辨率为1920*1080,垂直像素数之比3264/1920小于水平像素数之比2448/1080,将垂直像素数之比确定为预览比例;初始预览分辨率为3264*2448,屏幕分辨率为1280*1024,垂直像素数之比3264/1280大于水平像素数之比2448/1024,将水平像素数之比确定为预览比例。In order to prevent the adjusted initial preview resolution from being smaller than the screen resolution, thereby affecting the preview effect, the smaller of the ratio of the horizontal pixel number to the vertical pixel number is determined as the preview ratio. For example, the initial preview resolution is 3264*2448, the screen resolution is 1920*1080, the ratio of vertical pixels is 3264/1920 is less than the ratio of horizontal pixels to 2448/1080, and the ratio of the number of vertical pixels is determined as the preview ratio; initial preview The resolution is 3264*2448, the screen resolution is 1280*1024, the ratio of vertical pixels is 3264/1280 is greater than the ratio of horizontal pixels to 2448/1024, and the ratio of the number of horizontal pixels is determined as the preview ratio.
1032、将水平像素数之比确定为预览比例。1032. Determine the ratio of the number of horizontal pixels as the preview ratio.
1033、将垂直像素数之比确定为预览比例。1033. Determine the ratio of the number of vertical pixels as the preview ratio.
本发明实施例提供的设置预览分辨率的方法,预览分辨率与屏幕分辨率的垂直像素数之比,以及预览分辨率与屏幕分辨率的水平像素数之比中较小的一个作为预览比例。相比较于现有技术中将预览分辨率和摄像头分辨率设置为相同的分辨率,本发明在解决因预览分辨率过高造成的终端功耗大的问题的基础上,通过将预览分辨率与屏幕分辨率的垂直像素数之比,以及预览分辨率与屏幕分辨率的水平像素数之比中较小的一个作为预览比例,保证了调整后的初始预览分辨率仍然大于屏幕分辨率,从而使初始预览分辨率的调整,不影响预览效果。The method for setting the preview resolution provided by the embodiment of the present invention, the ratio of the preview resolution to the vertical pixel number of the screen resolution, and the smaller one of the ratio of the preview resolution to the horizontal pixel number of the screen resolution is used as the preview ratio. Compared with the prior art, the preview resolution and the camera resolution are set to the same resolution, and the present invention solves the problem that the terminal power consumption is large due to the excessive preview resolution, by using the preview resolution and The ratio of the vertical pixel count of the screen resolution and the smaller of the ratio of the preview resolution to the horizontal pixel number of the screen resolution as the preview ratio ensures that the adjusted initial preview resolution is still greater than the screen resolution, thereby The initial preview resolution is adjusted without affecting the preview.
为了保证调整预览分辨率后的预览界面不会发生形变,在本发明实施例的一个实现方式中,按照一定比例分别调整初始分辨率的垂直像素数和垂直像素数。因此,在如图1所示的实现方式的基础上,还可以实现为如图4所示的实现方式。其中,步骤104按照预览比例,将终端拍摄过程中的预览分辨率由初始分辨率调整为当前预览分辨率,可以具体实现为步骤1041至步骤1043:In an implementation manner of the embodiment of the present invention, the number of vertical pixels and the number of vertical pixels of the initial resolution are respectively adjusted according to a certain ratio in order to ensure that the preview interface is not deformed after the preview resolution is adjusted. Therefore, on the basis of the implementation shown in FIG. 1, an implementation as shown in FIG. 4 can also be implemented. The step 104 adjusts the preview resolution during the terminal shooting from the initial resolution to the current preview resolution according to the preview ratio, which may be specifically implemented as steps 1041 to 1043:
1041、按照预览比例减小初始预览分辨率的垂直像素数和水平像素数。1041. Decrease the number of vertical pixels and horizontal pixels of the initial preview resolution according to the preview ratio.
1042、将减小后的初始预览分辨率的垂直像素数和水平像素数,设置为当前预览分辨率的垂直像素数和水平像素数。1042. Set the number of vertical pixels and horizontal pixels of the reduced initial preview resolution to the number of vertical pixels and horizontal pixels of the current preview resolution.
1043、将终端拍摄过程中的预览分辨率调整为当前预览分辨率。1043. Adjust the preview resolution during the terminal shooting to the current preview resolution.
例如,初始预览分辨率为3264*2448,屏幕分辨率为1920*1080,将初始预览分辨率的垂直像素数3264,根据预览比例3264/1920调整,得到当前预览分辨率的垂直像素数为3264/(3264/1920)=1920;将初始预览分辨率的水平像素数2448,根据预览比例3264/1920调整,得到当前预览分辨率的水平分辨率为2448/(3264/1920)=1440,即当前预览分辨率为1920*1440。此时,可以将终端拍摄过程中的预览分辨率由3264*2448调整为1920*1440。For example, the initial preview resolution is 3264*2448, the screen resolution is 1920*1080, and the initial pixel number of the initial preview resolution is 3264, which is adjusted according to the preview ratio 3264/1920, and the number of vertical pixels of the current preview resolution is 3264/ (3264/1920)=1920; the number of horizontal pixels of the initial preview resolution is 2448, adjusted according to the preview ratio 3264/1920, and the horizontal resolution of the current preview resolution is 2448/(3264/1920)=1440, which is the current preview. The resolution is 1920*1440. At this time, the preview resolution during terminal shooting can be adjusted from 3264*2448 to 1920*1440.
需要说明的是,初始预览分辨率为3264*2448,屏幕分辨率为1920*1080时,如果将预览比例确定为2448/1080,得到的当前预览分辨率的垂直像素数为1440,水平像素数为1080,可以看出,当前预览分辨率的垂直像素数1440小于屏幕分辨率的垂直像素数1920,会影响预览效果。It should be noted that when the initial preview resolution is 3264*2448 and the screen resolution is 1920*1080, if the preview ratio is determined to be 2448/1080, the number of vertical pixels of the current preview resolution is 1440, and the number of horizontal pixels is 1080, it can be seen that the current preview resolution of the number of vertical pixels 1440 is less than the vertical resolution of the screen resolution of 1920, which will affect the preview effect.
本发明实施例提供的设置预览分辨率的方法,将初始预览分辨率的垂直像素数和水平像素数均按照预览比例调整,分辨得到当前预览分辨率的垂直像素数和水平像素数,将终端拍摄过程中的预览分辨率调整为当前预览分辨率。相比较于现有技术中将预览分辨率和摄像头分辨率设置为相同的分辨率,本发明在解决因预览分辨率过高造成的终端功耗大的问题的基础上,对初始预览分辨率的垂直像素数和水平像素数按照相同比例进行调整,可以保证预览界面相对于摄像头捕捉的画面不会发生形变。The method for setting the preview resolution provided by the embodiment of the present invention adjusts the number of vertical pixels and the number of horizontal pixels of the initial preview resolution according to the preview ratio, and distinguishes the number of vertical pixels and the number of horizontal pixels of the current preview resolution, and shoots the terminal. The preview resolution in the process is adjusted to the current preview resolution. Compared with the prior art, the preview resolution and the camera resolution are set to the same resolution, and the present invention solves the problem of large power consumption of the terminal due to excessive preview resolution, and the initial preview resolution. The number of vertical pixels and the number of horizontal pixels are adjusted in the same proportion to ensure that the preview interface does not deform relative to the image captured by the camera.
本发明实施例还提供一种设置预览分辨率的装置20,如图5所示,该装置20用于执行如图1至图4所示的任意一种方法流程,该装置20包括:The embodiment of the present invention further provides an apparatus 20 for setting a preview resolution. As shown in FIG. 5, the apparatus 20 is configured to perform any method flow as shown in FIG. 1 to FIG.
获取模块21,设置为获取终端的屏幕分辨率和终端拍摄过程中的初始预览分辨率,初始预览分辨率与终端的摄像头分辨率相同。The obtaining module 21 is configured to acquire the screen resolution of the terminal and the initial preview resolution during the terminal shooting, and the initial preview resolution is the same as the camera resolution of the terminal.
确定模块22,设置为当获取模块21获取的初始预览分辨率大于获取模块21获取的屏幕分辨率时,根据初始预览分辨率与屏幕分辨率的垂直像素数之比,以及初始预览分辨率与屏幕分辨率的水平像素数之比确定预览比例。The determining module 22 is configured to, when the initial preview resolution acquired by the obtaining module 21 is greater than the screen resolution acquired by the obtaining module 21, the ratio of the initial preview resolution to the vertical pixel number of the screen resolution, and the initial preview resolution and the screen The ratio of the number of horizontal pixels of the resolution determines the preview ratio.
调整模块23,设置为按照确定模块22确定的预览比例,将终端拍摄过程中的预览分辨率由获取模块21获取的初始分辨率调整为当前预览分辨率,当前预览分辨率小于初始预览分辨率。The adjustment module 23 is configured to adjust the initial resolution acquired by the acquisition module 21 to the current preview resolution according to the preview ratio determined by the determination module 22, and the current preview resolution is smaller than the initial preview resolution.
在本发明实施例的一个实现方式中,装置20还包括:In an implementation manner of the embodiment of the present invention, the device 20 further includes:
判断模块24,设置为判断获取模块21获取的初始预览分辨率的垂直像素数是否大于获取模块21获取的屏幕分辨率的垂直像素数;以及当初始预览分辨率的垂直像素数大于屏幕分辨率的垂直像素数时,判断初始预览分辨率的水平像素数是否大于屏幕分辨率的水平像素数。The determining module 24 is configured to determine whether the number of vertical pixels of the initial preview resolution acquired by the obtaining module 21 is greater than the number of vertical pixels of the screen resolution acquired by the acquiring module 21; and when the number of vertical pixels of the initial preview resolution is greater than the screen resolution When the number of vertical pixels is used, it is judged whether the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution.
确定模块22,还设置为当判断模块24确定初始预览分辨率的水平像素数大于屏幕分辨率的水平像素数时,确定初始预览分辨率大于屏幕分辨率。The determining module 22 is further configured to determine that the initial preview resolution is greater than the screen resolution when the determining module 24 determines that the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution.
在本发明实施例的一个实现方式中,确定模块22,具体设置为当垂直像素数之比大于水平像素数之比时,将水平像素数之比确定为预览比例;当垂直像素数之比小于或等于水平像素数之比时,则将垂直像素数之比确定为预览比例。In an implementation manner of the embodiment of the present invention, the determining module 22 is specifically configured to determine, when the ratio of the number of vertical pixels is greater than the ratio of the number of horizontal pixels, the ratio of the number of horizontal pixels is determined as a preview ratio; when the ratio of the number of vertical pixels is less than Or equal to the ratio of the number of horizontal pixels, the ratio of the number of vertical pixels is determined as the preview ratio.
在本发明实施例的一个实现方式中,调整模块23,具体设置为按照预览比例减小初始预览分辨率的垂直像素数和水平像素数;将减小后的初始预览分辨率的垂直像素数和水平像素数,设置为当前预览分辨率的垂直像素数和水平像素数;将终端拍摄过程中的预览分辨率调整为当前预览分辨率。In an implementation manner of the embodiment of the present invention, the adjusting module 23 is specifically configured to reduce the number of vertical pixels and the number of horizontal pixels of the initial preview resolution according to the preview ratio; the number of vertical pixels of the reduced initial preview resolution and The number of horizontal pixels, set to the number of vertical pixels and horizontal pixels of the current preview resolution; adjust the preview resolution during terminal shooting to the current preview resolution.
确定模块22,还设置为当初始分辨率小于或等于屏幕分辨率时,将初始分辨率设置为当前预览分辨率。The determining module 22 is further configured to set the initial resolution to the current preview resolution when the initial resolution is less than or equal to the screen resolution.
本发明实施例提供的设置预览分辨率的装置,如果获取的初始预览分辨率大于屏幕分辨率,则根据初始预览分辨率和屏幕分辨率的垂直像素数之比,以及二者的水平像素数之比确定预览比例,按照预览比例将终端拍摄过程中的预览分辨率由初始预览分辨率调整为当前预览分辨率;否则,仍然使用初始预览分辨率作为终端拍摄过程中的预览分辨率。相比较于现有技术中将预览分辨率和摄像头分辨率设置为相同的分辨率,本发明在初始预览分辨率大于屏幕分辨率时,可以根据初始预览分辨率与屏幕分辨率的比例关系调整终端拍摄过程中的预览比例。由于调整后得到的当前预览分辨率小于初始预览分辨率,当前预览分辨率的像素点数量也就少于初始预览分辨率的像素点数量。因此,在终端使用当前预览分辨率进行预览的过程中,终端需要实时更新的像素点数量变少,降低了终端的功耗。因此,本发明能解决因预览分辨率过高造成的终端功耗大的问题。The apparatus for setting a preview resolution provided by the embodiment of the present invention, if the obtained initial preview resolution is greater than the screen resolution, the ratio of the vertical pixels according to the initial preview resolution and the screen resolution, and the number of horizontal pixels of the two Compared with determining the preview ratio, the preview resolution during terminal shooting is adjusted from the initial preview resolution to the current preview resolution according to the preview ratio; otherwise, the initial preview resolution is still used as the preview resolution during the terminal shooting. Compared with the prior art, the preview resolution and the camera resolution are set to the same resolution. When the initial preview resolution is greater than the screen resolution, the present invention can adjust the terminal according to the ratio of the initial preview resolution to the screen resolution. The preview ratio during shooting. Since the current preview resolution obtained after the adjustment is smaller than the initial preview resolution, the number of pixels of the current preview resolution is smaller than the number of pixels of the initial preview resolution. Therefore, in the process of previewing the terminal using the current preview resolution, the number of pixels that the terminal needs to update in real time is reduced, which reduces the power consumption of the terminal. Therefore, the present invention can solve the problem of large power consumption of the terminal due to excessive preview resolution.
本发明实施例还提供一种终端,该终端用于执行如图1至图4所示的方法流程,该终端至少包括如图5所示的设置预览分辨率的装置。本发明实施例提供的终端,如果获取的初始预览分辨率大于屏幕分辨率,则根据初始预览分辨率和屏幕分辨率的垂直像素数之比,以及二者的水平像素数之比确定预览比例,按照预览比例将终端拍摄过程中的预览分辨率由初始预览分辨率调整为当前预览分辨率;否则,仍然使用初始预览分辨率作为终端拍摄过程中的预览分辨率。相比较于现有技术中将预览分辨率和摄像头分辨率设置为相同的分辨率,本发明在初始预览分辨率大于屏幕分辨率时,可以根据初始预览分辨率与屏幕分辨率的比例关系调整终端拍摄过程中的预览比例。由于调整后得到的当前预览分辨率小于初始预览分辨率,当前预览分辨率的像素点数量也就少于初始预览分辨率的像素点数量。因此,在终端使用当前预览分辨率进行预览的过程中,终端需要实时更新的像素点数量变少,降低了终端的功耗。因此,本发明能解决因预览分辨率过高造成的终端功耗大的问题。The embodiment of the present invention further provides a terminal, where the terminal is configured to execute the method flow shown in FIG. 1 to FIG. 4, and the terminal at least includes the apparatus for setting a preview resolution as shown in FIG. 5. The terminal provided by the embodiment of the present invention determines the preview ratio according to the ratio of the initial preview resolution to the vertical pixel number of the screen resolution and the ratio of the horizontal pixels of the two, if the obtained initial preview resolution is greater than the screen resolution. The preview resolution during terminal shooting is adjusted from the initial preview resolution to the current preview resolution according to the preview ratio; otherwise, the initial preview resolution is still used as the preview resolution during the terminal shooting. Compared with the prior art, the preview resolution and the camera resolution are set to the same resolution. When the initial preview resolution is greater than the screen resolution, the present invention can adjust the terminal according to the ratio of the initial preview resolution to the screen resolution. The preview ratio during shooting. Since the current preview resolution obtained after the adjustment is smaller than the initial preview resolution, the number of pixels of the current preview resolution is smaller than the number of pixels of the initial preview resolution. Therefore, in the process of previewing the terminal using the current preview resolution, the number of pixels that the terminal needs to update in real time is reduced, which reduces the power consumption of the terminal. Therefore, the present invention can solve the problem of large power consumption of the terminal due to excessive preview resolution.
具体而言,参考图6所示,为本发明实施例提供的一种终端30的结构示意框图。本发明实施例中的终端30可以是不同类型的电子设备,例如:智能手机、平板电脑、掌上电脑以及移动互联网设备、个人数字助理、媒体播放器、智能电视、智能手表、智能眼镜、智能手环等。如图7所示,本发明实施例中的终端30包括:至少一个处理器31,例如CPU,至少一个接收器33,至少一个存储器34,至少一个发送器35,至少一个通信总线32。其中,所述通信总线32用于实现这些组件之间的连接通信。其中,所述接收器33和所述发送器35可以是有线发送端口,也可以为无线设备,例如包括天线装置,用于与其他设备进行数据通信。所述存储器34可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。Specifically, referring to FIG. 6, a schematic block diagram of a structure of a terminal 30 according to an embodiment of the present invention is shown. The terminal 30 in the embodiment of the present invention may be different types of electronic devices, such as: smart phones, tablet computers, palmtop computers, and mobile internet devices, personal digital assistants, media players, smart televisions, smart watches, smart glasses, smart hands. Ring and so on. As shown in FIG. 7, the terminal 30 in the embodiment of the present invention includes at least one processor 31, such as a CPU, at least one receiver 33, at least one memory 34, at least one transmitter 35, and at least one communication bus 32. The communication bus 32 is used to implement connection communication between these components. The receiver 33 and the transmitter 35 may be wired transmission ports or wireless devices, for example, including antenna devices for data communication with other devices. The memory 34 may be a high speed RAM memory or a non-volatile memory such as at least one disk memory.
所述处理器31可执行所述终端30的操作系统以及安装的各类应用程序、程序代码等,例如,上述的各个模块,包括所述获取模块21、所述确定模块22等。The processor 31 can execute the operating system of the terminal 30 and various installed application programs, program codes, and the like. For example, each module described above includes the acquiring module 21, the determining module 22, and the like.
所述存储器34中存储有程序代码,且所述处理器31可通过通信总线32,调用所述存储器34中存储的程序代码以执行相关的功能。例如,图5中所述的各个模块(例如,所述获取模块21、所述确定模块22等)是存储在所述存储器34中的程序代码,并由所述处理器31所执行,从而实现所述各个模块的功能以实现设置预览分辨率的方法。Program code is stored in the memory 34, and the processor 31 can call the program code stored in the memory 34 via the communication bus 32 to perform related functions. For example, the various modules (e.g., the acquisition module 21, the determination module 22, etc.) described in FIG. 5 are program codes stored in the memory 34, and are executed by the processor 31, thereby implementing The functions of the various modules are implemented to implement a method of setting a preview resolution.
在本发明的一个实施例中,所述存储器34存储多个指令,所述多个指令被所述处理器31所执行以实现设置预览分辨率的方法。具体而言,所述处理器31对所述多个指令的执行包括:获取终端的屏幕分辨率和终端拍摄过程中的初始预览分辨率,所述初始预览分辨率与终端的摄像头分辨率相同;如果所述初始预览分辨率大于所述屏幕分辨率,则根据所述初始预览分辨率与所述屏幕分辨率的垂直像素数之比,以及所述初始预览分辨率与所述屏幕分辨率的水平像素数之比确定预览比例;按照所述预览比例,将所述终端拍摄过程中的预览分辨率由所述初始分辨率调整为当前预览分辨率,所述当前预览分辨率小于所述初始预览分辨率。In one embodiment of the invention, the memory 34 stores a plurality of instructions that are executed by the processor 31 to implement a method of setting a preview resolution. Specifically, the performing, by the processor 31, the execution of the multiple instructions includes: acquiring a screen resolution of the terminal and an initial preview resolution during the terminal shooting, where the initial preview resolution is the same as the camera resolution of the terminal; If the initial preview resolution is greater than the screen resolution, a ratio of the initial preview resolution to the number of vertical pixels of the screen resolution, and a level of the initial preview resolution and the screen resolution The ratio of the number of pixels determines a preview ratio; according to the preview ratio, the preview resolution during the shooting of the terminal is adjusted from the initial resolution to a current preview resolution, and the current preview resolution is smaller than the initial preview resolution. rate.
在进一步的实施例中,在所述获取终端的初始预览分辨率和屏幕分辨率之后,所述处理器31进一步:判断所述初始预览分辨率的垂直像素数是否大于所述屏幕分辨率的垂直像素数;如果所述初始预览分辨率的垂直像素数大于所述屏幕分辨率的垂直像素数,则判断所述初始预览分辨率的水平像素数是否大于所述屏幕分辨率的水平像素数;如果所述初始预览分辨率的水平像素数大于所述屏幕分辨率的水平像素数,则确定所述初始预览分辨率大于所述屏幕分辨率。In a further embodiment, after the initial preview resolution and the screen resolution of the acquiring terminal, the processor 31 further: determining whether the vertical pixel number of the initial preview resolution is greater than the vertical of the screen resolution. a number of pixels; if the number of vertical pixels of the initial preview resolution is greater than the number of vertical pixels of the screen resolution, determining whether the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution; If the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution, it is determined that the initial preview resolution is greater than the screen resolution.
在进一步的实施例中,所述根据所述初始预览分辨率与所述屏幕分辨率的垂直像素数之比,以及所述初始预览分辨率与所述屏幕分辨率的水平像素数之比确定预览比例,包括:如果所述垂直像素数之比大于所述水平像素数之比,则将所述水平像素数之比确定为所述预览比例;如果所述垂直像素数之比小于或等于所述水平像素数之比,则将所述垂直像素数之比确定为所述预览比例。In a further embodiment, the ratio of the initial preview resolution to the number of vertical pixels of the screen resolution, and the ratio of the initial preview resolution to the horizontal pixel number of the screen resolution determine a preview The ratio includes: if a ratio of the number of vertical pixels is greater than a ratio of the number of horizontal pixels, determining a ratio of the number of horizontal pixels as the preview ratio; if a ratio of the number of vertical pixels is less than or equal to the ratio The ratio of the number of horizontal pixels determines the ratio of the number of vertical pixels as the preview ratio.
在进一步的实施例中,所述按照所述预览比例将所述终端的初始预览分辨率调整为当前预览分辨率,包括:按照所述预览比例减小所述初始预览分辨率的垂直像素数和水平像素数;将减小后的初始预览分辨率的垂直像素数和水平像素数,设置为所述当前预览分辨率的垂直像素数和水平像素数;将所述终端拍摄过程中的预览分辨率调整为当前预览分辨率。In a further embodiment, the adjusting the initial preview resolution of the terminal to the current preview resolution according to the preview ratio comprises: reducing a vertical pixel number of the initial preview resolution according to the preview ratio The number of horizontal pixels; the number of vertical pixels and horizontal pixels of the reduced initial preview resolution, the number of vertical pixels and the number of horizontal pixels of the current preview resolution; and the preview resolution during the shooting of the terminal Adjust to the current preview resolution.
在进一步的实施例中,在所述获取终端的初始预览分辨率和屏幕分辨率之后,如果所述初始分辨率小于或等于所述屏幕分辨率,所述处理器31将所述初始分辨率设置为当前预览分辨率。In a further embodiment, after the initial preview resolution and screen resolution of the acquisition terminal, the processor 31 sets the initial resolution if the initial resolution is less than or equal to the screen resolution. The current preview resolution.
具体地,所述处理器31对上述指令的具体实现方法可参考图1-4对应实施例中相关步骤的描述,在此不赘述。For details, refer to the description of the related steps in the corresponding embodiment in FIG. 1-4, and the details are not described here.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the specification are described in a progressive manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(英文:Read-Only Memory,简称:ROM)或随机存储记忆体(英文:Random Access Memory,简称:RAM)等。A person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. When executed, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (English: Read-Only Memory, ROM for short) or a random access memory (English: Random Access Memory, RAM for short).
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. All should be covered by the scope of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims (10)

  1. 一种设置预览分辨率的方法,其特征在于,所述方法包括:A method for setting a preview resolution, the method comprising:
    获取终端的屏幕分辨率和终端拍摄过程中的初始预览分辨率,所述初始预览分辨率与终端的摄像头分辨率相同;Obtaining a screen resolution of the terminal and an initial preview resolution during terminal shooting, the initial preview resolution being the same as the camera resolution of the terminal;
    如果所述初始预览分辨率大于所述屏幕分辨率,则根据所述初始预览分辨率与所述屏幕分辨率的垂直像素数之比,以及所述初始预览分辨率与所述屏幕分辨率的水平像素数之比确定预览比例;If the initial preview resolution is greater than the screen resolution, a ratio of the initial preview resolution to the number of vertical pixels of the screen resolution, and a level of the initial preview resolution and the screen resolution The ratio of the number of pixels determines the preview ratio;
    按照所述预览比例,将所述终端拍摄过程中的预览分辨率由所述初始分辨率调整为当前预览分辨率,所述当前预览分辨率小于所述初始预览分辨率。According to the preview ratio, the preview resolution during the shooting of the terminal is adjusted from the initial resolution to the current preview resolution, and the current preview resolution is smaller than the initial preview resolution.
  2. 根据权利要求1所述的方法,其特征在于,在所述获取终端的初始预览分辨率和屏幕分辨率之后,还包括:The method according to claim 1, wherein after the initial preview resolution and the screen resolution of the acquiring terminal, the method further comprises:
    判断所述初始预览分辨率的垂直像素数是否大于所述屏幕分辨率的垂直像素数;Determining whether the number of vertical pixels of the initial preview resolution is greater than the number of vertical pixels of the screen resolution;
    如果所述初始预览分辨率的垂直像素数大于所述屏幕分辨率的垂直像素数,则判断所述初始预览分辨率的水平像素数是否大于所述屏幕分辨率的水平像素数;If the number of vertical pixels of the initial preview resolution is greater than the number of vertical pixels of the screen resolution, determining whether the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution;
    如果所述初始预览分辨率的水平像素数大于所述屏幕分辨率的水平像素数,则确定所述初始预览分辨率大于所述屏幕分辨率。If the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution, it is determined that the initial preview resolution is greater than the screen resolution.
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述初始预览分辨率与所述屏幕分辨率的垂直像素数之比,以及所述初始预览分辨率与所述屏幕分辨率的水平像素数之比确定预览比例,包括:The method according to claim 1, wherein said ratio of said initial preview resolution to said vertical resolution of said screen resolution, and said initial preview resolution and said screen resolution level The ratio of the number of pixels determines the preview ratio, including:
    如果所述垂直像素数之比大于所述水平像素数之比,则将所述水平像素数之比确定为所述预览比例;If the ratio of the number of vertical pixels is greater than the ratio of the number of horizontal pixels, determining a ratio of the number of horizontal pixels as the preview ratio;
    如果所述垂直像素数之比小于或等于所述水平像素数之比,则将所述垂直像素数之比确定为所述预览比例。If the ratio of the number of vertical pixels is less than or equal to the ratio of the number of horizontal pixels, the ratio of the number of vertical pixels is determined as the preview ratio.
  4. 根据权利要求1所述的方法,其特征在于,所述按照所述预览比例将所述终端的初始预览分辨率调整为当前预览分辨率,包括:The method according to claim 1, wherein the adjusting the initial preview resolution of the terminal to the current preview resolution according to the preview ratio comprises:
    按照所述预览比例减小所述初始预览分辨率的垂直像素数和水平像素数;Decreasing the number of vertical pixels and horizontal pixels of the initial preview resolution according to the preview ratio;
    将减小后的初始预览分辨率的垂直像素数和水平像素数,设置为所述当前预览分辨率的垂直像素数和水平像素数;Setting the number of vertical pixels and horizontal pixels of the reduced initial preview resolution to the number of vertical pixels and horizontal pixels of the current preview resolution;
    将所述终端拍摄过程中的预览分辨率调整为当前预览分辨率。The preview resolution during the shooting of the terminal is adjusted to the current preview resolution.
  5. 根据权利要求1至4中任意一项所述的方法,其特征在于,在所述获取终端的初始预览分辨率和屏幕分辨率之后,还包括:The method according to any one of claims 1 to 4, further comprising: after the initial preview resolution and the screen resolution of the acquiring terminal,
    如果所述初始分辨率小于或等于所述屏幕分辨率,则将所述初始分辨率设置为当前预览分辨率。If the initial resolution is less than or equal to the screen resolution, the initial resolution is set to the current preview resolution.
  6. 一种设置预览分辨率的装置,其特征在于,所述装置包括:A device for setting a preview resolution, the device comprising:
    获取模块,设置为获取终端的屏幕分辨率和终端拍摄过程中的初始预览分辨率,所述初始预览分辨率与终端的摄像头分辨率相同;Obtaining a module, configured to obtain a screen resolution of the terminal and an initial preview resolution during terminal shooting, the initial preview resolution being the same as the camera resolution of the terminal;
    确定模块,设置为当所述获取模块获取的初始预览分辨率大于所述获取模块获取的屏幕分辨率时,根据所述初始预览分辨率与所述屏幕分辨率的垂直像素数之比,以及所述初始预览分辨率与所述屏幕分辨率的水平像素数之比确定预览比例;a determining module, configured to: when the initial preview resolution acquired by the acquiring module is greater than the screen resolution acquired by the acquiring module, according to a ratio of the initial preview resolution to the vertical pixel number of the screen resolution, and Determining a preview ratio by comparing a ratio of an initial preview resolution to a horizontal pixel number of the screen resolution;
    调整模块,设置为按照所述确定模块确定的预览比例,将所述终端拍摄过程中的预览分辨率由所述获取模块获取的初始分辨率调整为当前预览分辨率,所述当前预览分辨率小于所述初始预览分辨率。And an adjustment module, configured to adjust, according to the preview ratio determined by the determining module, an initial resolution obtained by the acquiring module in a preview resolution during the shooting of the terminal to a current preview resolution, where the current preview resolution is smaller than The initial preview resolution.
  7. 根据权利要求6所述的装置,其特征在于,所述装置还包括:The device according to claim 6, wherein the device further comprises:
    判断模块,设置为判断所述获取模块获取的初始预览分辨率的垂直像素数是否大于所述获取模块获取的屏幕分辨率的垂直像素数;以及当所述初始预览分辨率的垂直像素数大于所述屏幕分辨率的垂直像素数时,判断所述初始预览分辨率的水平像素数是否大于所述屏幕分辨率的水平像素数;a judging module, configured to determine whether the number of vertical pixels of the initial preview resolution acquired by the acquiring module is greater than the number of vertical pixels of the screen resolution acquired by the acquiring module; and when the number of vertical pixels of the initial preview resolution is greater than When the number of vertical pixels of the screen resolution is described, it is determined whether the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution;
    所述确定模块,还设置为当所述判断模块确定初始预览分辨率的水平像素数大于所述屏幕分辨率的水平像素数时,确定所述初始预览分辨率大于所述屏幕分辨率。The determining module is further configured to determine that the initial preview resolution is greater than the screen resolution when the determining module determines that the number of horizontal pixels of the initial preview resolution is greater than the number of horizontal pixels of the screen resolution.
  8. 根据权利要求6所述的装置,其特征在于,所述确定模块,具体设置为当所述垂直像素数之比大于所述水平像素数之比时,将所述水平像素数之比确定为所述预览比例;The apparatus according to claim 6, wherein the determining module is specifically configured to determine, when the ratio of the number of vertical pixels is greater than a ratio of the number of horizontal pixels, determine a ratio of the number of horizontal pixels as Preview ratio
    当所述垂直像素数之比小于或等于所述水平像素数之比时,则将所述垂直像素数之比确定为所述预览比例。When the ratio of the number of vertical pixels is less than or equal to the ratio of the number of horizontal pixels, the ratio of the number of vertical pixels is determined as the preview ratio.
  9. 根据权利要求6所述的装置,其特征在于,所述调整模块,具体设置为按照所述预览比例减小所述初始预览分辨率的垂直像素数和水平像素数;将减小后的初始预览分辨率的垂直像素数和水平像素数,设置为所述当前预览分辨率的垂直像素数和水平像素数;将所述终端拍摄过程中的预览分辨率调整为当前预览分辨率;The apparatus according to claim 6, wherein the adjustment module is specifically configured to reduce the number of vertical pixels and the number of horizontal pixels of the initial preview resolution according to the preview ratio; and to reduce the initial preview The number of vertical pixels and the number of horizontal pixels of the resolution are set to the number of vertical pixels and the number of horizontal pixels of the current preview resolution; and the preview resolution during the shooting of the terminal is adjusted to the current preview resolution;
    所述确定模块,还设置为当所述初始分辨率小于或等于所述屏幕分辨率时,将所述初始分辨率设置为当前预览分辨率。The determining module is further configured to set the initial resolution to a current preview resolution when the initial resolution is less than or equal to the screen resolution.
  10. 一种终端,其特征在于,所述终端至少包括如权利要求6至9中任意一项所述的设置预览分辨率的装置。A terminal, characterized in that the terminal comprises at least the apparatus for setting a preview resolution according to any one of claims 6 to 9.
PCT/CN2016/100682 2016-08-31 2016-09-28 Method and apparatus for setting preview resolution, and terminal WO2018040174A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610790518.9A CN106293589B (en) 2016-08-31 2016-08-31 A kind of method, apparatus and terminal that preview resolution is set
CN201610790518.9 2016-08-31

Publications (1)

Publication Number Publication Date
WO2018040174A1 true WO2018040174A1 (en) 2018-03-08

Family

ID=57674113

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/100682 WO2018040174A1 (en) 2016-08-31 2016-09-28 Method and apparatus for setting preview resolution, and terminal

Country Status (2)

Country Link
CN (1) CN106293589B (en)
WO (1) WO2018040174A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111050062B (en) * 2018-10-15 2022-01-14 华为技术有限公司 Shooting method and electronic equipment
CN110636354A (en) * 2019-06-10 2019-12-31 青岛海信电器股份有限公司 Display device
CN110765799B (en) * 2019-10-21 2023-05-02 高新兴科技集团股份有限公司 Client code scanning identification method, device, equipment and storage medium
CN112019738B (en) * 2020-07-31 2022-03-01 广东小天才科技有限公司 Photographing method and terminal equipment
CN112153293A (en) * 2020-09-28 2020-12-29 广东小天才科技有限公司 Image data display method, electronic equipment and storage medium
CN114422694B (en) * 2022-01-18 2024-03-26 杭州逗酷软件科技有限公司 Preview resolution adaptation method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100315543A1 (en) * 2009-06-12 2010-12-16 Samsung Electronics Co., Ltd. Method for converting a resolution and image sensor thereof
CN103139473A (en) * 2011-11-28 2013-06-05 三星电子株式会社 Method of eliminating a shutter-lag, camera module, and mobile device having the same
CN103546689A (en) * 2013-10-11 2014-01-29 Tcl集团股份有限公司 Resolution ratio acquiring method and device of external camera of android system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019537B (en) * 2012-11-19 2016-04-13 广东欧珀移动通信有限公司 A kind of image preview method and device
KR102182160B1 (en) * 2013-07-16 2020-11-24 엘지전자 주식회사 Mobile terminal and method for controlling the same

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100315543A1 (en) * 2009-06-12 2010-12-16 Samsung Electronics Co., Ltd. Method for converting a resolution and image sensor thereof
CN103139473A (en) * 2011-11-28 2013-06-05 三星电子株式会社 Method of eliminating a shutter-lag, camera module, and mobile device having the same
CN103546689A (en) * 2013-10-11 2014-01-29 Tcl集团股份有限公司 Resolution ratio acquiring method and device of external camera of android system

Also Published As

Publication number Publication date
CN106293589A (en) 2017-01-04
CN106293589B (en) 2019-04-12

Similar Documents

Publication Publication Date Title
WO2018040174A1 (en) Method and apparatus for setting preview resolution, and terminal
WO2010038970A2 (en) Method and system for managing an imaging device by an electronic device located remotely to the imaging device
WO2018040269A1 (en) Image processing method and terminal
WO2011059250A2 (en) Mobile terminal, display apparatus and control method thereof
WO2014157889A1 (en) Method and apparatus for improving quality of experience in sharing screen among devices, and recording medium thereof
WO2015026149A1 (en) System, apparatus, and method for sharing electronic device
WO2014032472A1 (en) Method for controlling mobile phone to be mute through flip, and mobile phone
WO2014104521A1 (en) Image transformation apparatus and method
WO2015120673A1 (en) Method, system and photographing equipment for controlling focusing in photographing by means of eyeball tracking technology
WO2018053909A1 (en) Photographic method, photographic device, and terminal
WO2016052845A1 (en) Cloud streaming service system, cloud streaming service method using optimal gpu, and apparatus for same
WO2017128853A1 (en) Processing method, apparatus and device for recording video
WO2014142557A1 (en) Electronic device and method for processing image
WO2013147448A1 (en) Adapter for connecting two mobile devices
WO2014021627A1 (en) Apparatus and method for providing n-screen service in broadcast system
WO2018090456A1 (en) Terminal data usage-based control method and device
WO2012165845A2 (en) Display apparatus and method
WO2015102232A1 (en) Method and electronic apparatus for sharing photographing setting values, and sharing system
WO2014035171A1 (en) Method and apparatus for transmitting file during video call in electronic device
WO2017138728A1 (en) Method and apparatus for creating, streaming, and rendering hdr images
EP3362993A1 (en) Method and apparatus for image enhancement of virtual reality images
WO2012144815A2 (en) Apparatus and method for adjusting resolution of application in wireless terminal
WO2016052908A1 (en) Transmitter, receiver, and control method thereof
WO2024022391A1 (en) Multimedia data transmission method and apparatus, and electronic device and storage medium
WO2011021906A2 (en) Method and apparatus for requesting data, and method and apparatus for obtaining data

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

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

Country of ref document: EP

Kind code of ref document: A1