WO2019041230A1 - Square cropping photography method, photography system and photography apparatus - Google Patents

Square cropping photography method, photography system and photography apparatus Download PDF

Info

Publication number
WO2019041230A1
WO2019041230A1 PCT/CN2017/099919 CN2017099919W WO2019041230A1 WO 2019041230 A1 WO2019041230 A1 WO 2019041230A1 CN 2017099919 W CN2017099919 W CN 2017099919W WO 2019041230 A1 WO2019041230 A1 WO 2019041230A1
Authority
WO
WIPO (PCT)
Prior art keywords
photographing
camera
image data
square
size
Prior art date
Application number
PCT/CN2017/099919
Other languages
French (fr)
Chinese (zh)
Inventor
张学熙
Original Assignee
深圳传音通讯有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳传音通讯有限公司 filed Critical 深圳传音通讯有限公司
Priority to PCT/CN2017/099919 priority Critical patent/WO2019041230A1/en
Publication of WO2019041230A1 publication Critical patent/WO2019041230A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers; Analogous equipment at exchanges
    • H04M1/72Substation extension arrangements; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selecting
    • H04M1/725Cordless telephones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, TV cameras, video cameras, camcorders, webcams, camera modules for embedding in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/225Television cameras ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, camcorders, webcams, camera modules specially adapted for being embedded in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/232Devices for controlling television cameras, e.g. remote control ; Control of cameras comprising an electronic image sensor

Abstract

Disclosed are a square cropping photography method, photography system and photography apparatus based on photography with echo and with no need for an echoing function. The method comprises the following process: switching a photography mode of a client in a photography system to a square photography mode; setting a photography size resolution to a ratio of 1:1, and blocking a preview size resolution to be a ratio of 1:1; issuing a photography instruction by means of a camera application layer, and setting a postview size to a ratio of 1:1; a camera hardware abstraction layer invoking an image sensor for photography; saving image data, collected by the image sensor, by means of a driver layer; the camera hardware abstraction layer cropping, according to a pre-set image size ratio of 1:1, the image data acquired from the driver layer; and the camera hardware abstraction layer transmitting square image data to the camera application layer, and the camera application layer generating and displaying the corresponding picture. The present invention realises taking a picture of a square size, without stopping previewing, thus improving the performance of switching between preview modes.

Description

一种方形裁剪拍照方法、拍照系统及拍照装置Square cutting photographing method, photographing system and photographing device 技术领域Technical field

本发明涉及电子应用技术领域,特别涉及一种基于拍照有回显不要回显功能的方形裁剪拍照方法、拍照系统及拍照装置。 The present invention relates to the field of electronic application technologies, and in particular, to a square cropping photographing method, a photographing system, and a photographing apparatus based on photographing, having a function of echoing and not returning.

背景技术Background technique

随着科技的发展,近年来,带拍摄功能的手机、平板电脑(PAD)等移动终端得到了广泛应用,而数码相机、智能手机、平板电脑等电子移动终端一般都具有拍照功能,满足了人们可以随时随地进行拍摄的需求。With the development of technology, in recent years, mobile terminals such as mobile phones and tablet computers (PADs) with shooting functions have been widely used, and electronic mobile terminals such as digital cameras, smart phones, and tablet computers generally have camera functions, satisfying people. The need to shoot anytime, anywhere.

相机是智能手机中的基础应用之一,使用智能手机相机拍照不仅方便快捷,而且智能手机相机的成像质量也较好。The camera is one of the basic applications in the smart phone. It is not only convenient and quick to take pictures with the smart phone camera, but also the image quality of the smart phone camera is better.

与此同时,人们对于移动终端所拍出来的图片的质量要求也越来越高,期望通过移动终端拍出高清图片。为了提高移动终端所拍图片的质量,目前通常是提高移动终端摄像头的分辨率,而这会导致移动终端成本增加;但是如果要控制移动终端的成本,图片的质量就要有所牺牲;因此,移动终端的成本和其所拍图片的质量这两方面无法兼顾。At the same time, people have higher and higher requirements for the quality of pictures taken by mobile terminals, and it is expected to take high-definition pictures through mobile terminals. In order to improve the quality of pictures taken by mobile terminals, it is usually to improve the resolution of the camera of the mobile terminal, which leads to an increase in the cost of the mobile terminal; however, if the cost of the mobile terminal is to be controlled, the quality of the picture is sacrificed; therefore, The cost of the mobile terminal and the quality of the pictures it takes cannot be balanced.

在智能终端市场日新月异的环境下,市场上智能终端的拍照功能越来越丰富,如眼纹识别、夜拍提亮、全景、美颜等第三方相机功能。目前,这些第三方相机功能的实现都是以智能终端本身自带相机应用的预览、拍照、录像三种模式为基础来实现的。此类的共用模式容易使智能终端系统自身正常的预览、拍照和录像效果与第三方相机应用的功能产生冲突,对第三方相机应用的功能效果调试产生影响。因此,为了避免智能终端系统自带相机应用的正常预览、拍照、录像功能与第三方相机应用的功能产生冲突,需要一种可以将二者分开处理的调式处理方式。然而,用户需要经过多次尝试对移动终端的拍摄模式以及拍摄参数进行配置,拍摄过程复杂,构图不够精美。In the ever-changing environment of the smart terminal market, the camera functions of intelligent terminals in the market are becoming more and more abundant, such as eye mark recognition, night shot lighting, panorama, beauty and other third-party camera functions. At present, the implementation of these third-party camera functions is based on the three modes of preview, photographing and recording of the camera application itself. This type of sharing mode easily causes the normal preview, photographing and recording effects of the smart terminal system to collide with the functions of the third-party camera application, and affects the debugging of the function effects of the third-party camera application. Therefore, in order to avoid the conflict between the normal preview, photographing, and recording functions of the smart terminal system's own camera application and the functions of the third-party camera application, a mode of processing that can separate the two is required. However, the user needs to make multiple attempts to configure the shooting mode and shooting parameters of the mobile terminal, the shooting process is complicated, and the composition is not beautiful enough.

随着人们的生活水平不断提高,记录童年,记录人生每一个瞬间已成为人们生活的重要组成部分,也是生活中不可或缺的一部分,摄影拍照亦是文 明的手印。摄影是自然科学与社会科学自然交汇的结晶,是了解、认识、反映社会现实的形象化手段,是具有审美价值的艺术形式,是科学与艺术的完美结合。摄影者通过画面的构思、色调的均衡、场景的剪裁给观赏者带来美的享受,使观赏者真正得到心灵的满足。与此同时,通过对摄影器材的了解,我们可以接触到现代科学各个领域,拓宽知识范围,提高艺术修养。因此,摄影不仅仅是会摆弄照相机,而是一种包括应用科学、想象与设计、专业技巧和组织能力的综合过程。As people's living standards continue to improve, record childhood, record every moment of life has become an important part of people's lives, but also an indispensable part of life, photography is also a text Ming's handprint. Photography is the crystallization of the natural convergence between natural science and social science. It is a visual means of understanding, understanding and reflecting social reality. It is an art form with aesthetic value and a perfect combination of science and art. Through the conception of the picture, the balance of the tones, and the tailoring of the scene, the photographer brings beautiful enjoyment to the viewer, so that the viewer truly gets the satisfaction of the soul. At the same time, through the understanding of photographic equipment, we can reach out to all areas of modern science, broaden the scope of knowledge, and improve artistic accomplishment. Therefore, photography is not just about playing with the camera, but a comprehensive process that includes applied science, imagination and design, professional skills and organizational skills.

为了更好的智能的拍出让人满意的作品,我们对相机的拍摄模式都需要进行进一步优化;摄影构图通常是摄影里被形容得最深奥的一个概念。平行式、垂直式、对角线式、曲线式框架式等等一大堆分类,会让人在拍摄的时候,一想到构图便不知所措。不同的构图会拍摄出不同的作品,例如3:2是绝大多数相机默认的比例模式,而16:9是准确来说并不是宽荧幕电影比例模式,它只是更适用于在目前使用这个比例的显示器上放映。In order to make a satisfactory and intelligent work, we need to further optimize the camera's shooting mode; photography composition is usually the most profound concept in photography. A large number of classifications such as parallel, vertical, diagonal, curved frame, etc., will make people feel overwhelmed when they think about composition. Different compositions will shoot different works, for example 3:2 is the default scale mode of most cameras, while 16:9 is not exactly the widescreen movie scale mode, it is more suitable for using this at the moment. The scale is shown on the display.

相关技术中,用户通过智能手机相机进行拍照时,智能手机在竖屏状态下的拍照界面的宽高比通常为3:4或者9:16,在横屏状态下的拍照界面的宽高比通常为4:3或者16:9,用户可以通过旋转手机以获取不同宽高比的拍照界面,进而获取到不同比例的照片。In the related art, when a user takes a photo through a smartphone camera, the aspect ratio of the camera interface in the portrait state of the smartphone is usually 3:4 or 9:16, and the aspect ratio of the camera interface in the horizontal screen state is usually For 4:3 or 16:9, users can get different ratios of photos by rotating the phone to get different camera ratios of different aspect ratios.

正方形由于长宽都相等,本身给人的感觉就是稳固和对称。正方形比例拍摄模式包含正方形构图,却不至于正方形构图。在正方形拍摄比例的基础上,你依然可以再次把垂线、平行线、斜线、曲线等等的构图方法运用在其中。而正方形比例拍摄模式,最有视觉冲击力的应该当属本身的对称性摄影。Squares are equal in length and width, and they give a feeling of stability and symmetry. The square scale shooting mode consists of a square composition, but not a square composition. Based on the square shooting ratio, you can still apply the composition method of vertical lines, parallel lines, diagonal lines, curves, etc. again. The square-scale shooting mode, the most visual impact should be its own symmetrical photography.

目前无论是安卓(android)手机还是火热的ios手机,其相机功能在手机里是十分举足轻重的,也是最能吸引客户眼球的地方,一款产品相机功能的丰富性,以及相应的性能体验则很大程度上影响到产品的销量及客户对产品的选择,最终会决定客户是否使用或继续使用其该产品,因此增加相机功能和提升性能就显得非常重要。在常见的第三方应用软(APK)里其方形拍照功能的使用也是相当广泛,鉴于此,开发出1:1比例尺寸的方形模式拍照功能,而有别于常见的4:3和16:9模式的拍照功能,且有非常好的体验,则在产品中占有非常重要的角色。At present, whether it is Android (android) mobile phone or hot ios mobile phone, its camera function is very important in the mobile phone, and it is also the most attractive place for customers. The richness of a product camera function and the corresponding performance experience are very To a large extent, it affects the sales volume of the product and the choice of the customer, and ultimately determines whether the customer uses or continues to use the product. Therefore, it is very important to increase the camera function and improve the performance. In the common third-party application software (APK), the use of the square camera function is also quite extensive. In view of this, the square mode camera function of 1:1 scale size is developed, which is different from the common 4:3 and 16:9. The mode of photography, and has a very good experience, it plays a very important role in the product.

现有技术中,如图1与图2所示,方形拍照功能,首先将相机或相机App 拍照模式转换至方形拍照模式,将预览和拍照的分辨率尺寸均设置为1:1的比例,则相机停止预览,之后相机开始预览,预览时,从相机设有的图像传感器获取数据,并对预览图像进行裁剪,之后发送拍照命令,相机根据拍照命令并执行,同时,对从上述图像传感器得到的图像数据进行裁剪;当需要将图像数据转化成jpeg格式的图像数据时,通过第三方算法对yuv格式的图像数据进行计算解压,将jpeg格式的图像数据反馈给相机或相机App,则拍照结束。In the prior art, as shown in FIG. 1 and FIG. 2, a square camera function, firstly a camera or a camera App The camera mode is switched to the square camera mode, and the resolution sizes of the preview and the photo are set to a ratio of 1:1, then the camera stops previewing, then the camera starts previewing, and when previewing, data is acquired from the image sensor provided by the camera, and The preview image is cropped, and then the photographing command is sent, the camera executes and executes according to the photographing command, and at the same time, the image data obtained from the image sensor is cropped; when the image data needs to be converted into the image data of the jpeg format, the third party algorithm The image data of the yuv format is calculated and decompressed, and the image data of the jpeg format is fed back to the camera or the camera App, and the photographing ends.

现有技术中,是把预览和拍照的分辨率尺寸均设置为1:1的比例,在由其他比例尺寸的模式下切换到1:1比例模式下,由于预览尺寸有改变这样就必然导致要先停止预览再打开预览,给客户一种停顿的现象,从而影响客户的体验。 In the prior art, the resolution size of the preview and the photographing are set to a ratio of 1:1, and in the mode of switching from the other proportional size to the 1:1 ratio mode, the preview size is changed, which inevitably leads to Stop the preview and then open the preview to give the customer a pause, which affects the customer's experience.

发明的公开Disclosure of invention

本发明的目的是提供一种基于拍照有回显不要回显功能的方形裁剪拍照方法、拍照系统及拍照装置,通过在保持图像预览尺寸分辨率不变的情况下,采用遮挡的方式在显示模块中显示出正方形的预览画面,改变拍照尺寸分辨率为1:1,实现不停止预览,拍出正方形尺寸的图片,保持拍照性能几乎不受影响的情况下,大大提升预览模式间的切换性能的目的。The object of the present invention is to provide a square cropping photographing method, a photographing system and a photographing device based on photographing and having a function of echoing and not echoing, by using an occlusion method in the display module while maintaining the image preview size resolution unchanged. The square preview screen is displayed, and the resolution of the photograph size is changed to 1:1, so that the preview is not stopped, the square size image is taken, and the photographing performance is hardly affected, and the switching performance between the preview modes is greatly improved. purpose.

为了实现以上目的,本发明通过以下技术方案实现:In order to achieve the above object, the present invention is achieved by the following technical solutions:

一种方形裁剪拍照方法,包含以下过程:将拍照模式切换至方形拍照模式。将拍照尺寸分辨率设为1:1比例,此时,相机不停止预览,在预览尺寸分辨率不变的情况下,将预览画面尺寸遮挡至1:1比例;下发拍照指令,根据所述拍照指令将postview size设置为1:1比例;将图像数据按照预设的1:1比例的图像尺寸进行裁剪,得到方形图像数据;将所述方形图像数据传输至相机;所述相机显示相应的图片并存储,拍照结束。A square cropping photographing method includes the following process: switching a photographing mode to a square photographing mode. Set the camera size resolution to 1:1 ratio. At this time, the camera does not stop previewing. If the preview size resolution is unchanged, the preview screen size is blocked to 1:1 ratio; the camera command is issued, according to the The photographing instruction sets the postview size to a 1:1 ratio; the image data is cropped according to a preset image size of 1:1 ratio to obtain square image data; the square image data is transmitted to the camera; the camera displays corresponding The picture is stored and the photo is taken over.

优选地,在将所述图像数据传输至相机的过程中,将与所述预览画面尺寸不一致的图像数据舍弃,不回送给相机进行预览显示。Preferably, in the process of transmitting the image data to the camera, the image data that is inconsistent with the preview screen size is discarded, and is not sent back to the camera for preview display.

优选地,所述方形裁剪拍照还包含以下过程:所述图像数据为yuv格式数据,其中,y表示亮度,u和v表示色度;所述yuv数据根据第三方算法对其进行编码压缩成jpeg数据。 Preferably, the square cropping photographing further comprises the following process: the image data is yuv format data, wherein y represents brightness, u and v represent chromaticity; and the yuv data is encoded and compressed into jpeg according to a third-party algorithm. data.

优选地,将所述yuv数据转换成jpeg数据还包含以下过程,将所述yuv数据转换为rgb数据,其中,所述r表示红色,所述g表示绿色,所述b表示蓝色。对所述rgb数据对应的各个像素点进行拷贝,根据拷贝像素点对所述rgb数据进行列和/或行插值,将所述rgb数据对应的分辨率扩充至所述预设分辨率;将插值后的所述rgb数据编码成图像格式jpeg数据,以根据所述jpeg数据显示所述图像。Preferably, converting the yuv data into jpeg data further comprises the step of converting the yuv data into rgb data, wherein the r represents red, the g represents green, and b represents blue. Copying each pixel corresponding to the rgb data, performing column and/or row interpolation on the rgb data according to the copied pixel, expanding the resolution corresponding to the rgb data to the preset resolution; interpolating The subsequent rgb data is encoded into image format jpeg data to display the image based on the jpeg data.

本发明的第二个技术方案为一种拍照系统,包含:适用于执行上述方形裁剪拍照方法的客户端与服务端;所述客户端用于切换拍照模式,并根据选定的拍照模式进行设置拍照尺寸分辨率以及显示预览画面并下发拍照指令;所述服务端接收所述拍照指令并根据指令对postview size进行设置,调用客户端设有的摄像头进行拍照,并将得到的图像数据存储,以及将所述图像数据按照预设图像尺寸比例进行裁剪,得到与选定的拍照模式相匹配的图像数据;将方形图像数据传输至所述客户端;所述客户端显示相应的图片。A second technical solution of the present invention is a photographing system, comprising: a client and a server suitable for executing the square cropping photographing method; the client is configured to switch a photographing mode, and set according to the selected photographing mode. Taking a photo size resolution and displaying a preview image and issuing a photographing instruction; the server receives the photographing instruction and sets a postview size according to the instruction, calls a camera provided by the client to take a photo, and stores the obtained image data, And cutting the image data according to a preset image size ratio to obtain image data matching the selected photographing mode; transmitting the square image data to the client; and displaying the corresponding image by the client.

优选地,所述服务端设有的拍照模式包含:标准拍照模式,方形拍照模式与全屏拍照模式。Preferably, the camera mode provided by the server includes: a standard camera mode, a square camera mode and a full-screen camera mode.

优选地,所述服务端设有通过各自发出的回调命令进行数据交互的相机应用层、相机应用框架层、相机硬件抽象层;所述客户端将拍照模式切换至方形拍照模式拍照时;将拍照尺寸分辨率设为1:1比例,此时,相机不停止预览,在预览尺寸分辨率不变的情况下,将预览画面尺寸遮挡至1:1比例;所述相机应用层用于根据选定的拍照模式下发拍照指令;Preferably, the server is provided with a camera application layer, a camera application framework layer, and a camera hardware abstraction layer for data interaction through respective issued callback commands; the client switches the photographing mode to the square photographing mode to take a photo; The size resolution is set to 1:1 ratio. At this time, the camera does not stop previewing, and the preview screen size is blocked to 1:1 ratio when the preview size resolution is unchanged; the camera application layer is used for selection according to the selection. Photographing mode to send a photo instruction;

所述相机硬件抽象层用于接收上述拍照命令并执行以下操作,若拍照指令为以方形拍照模式进行拍照时,将postview size设置为1:1比例;并调用摄像头的图像传感器进行拍照;The camera hardware abstraction layer is configured to receive the photo command and perform the following operations: if the photographing instruction is to take a photo in the square photographing mode, set the postview size to a 1:1 ratio; and call the image sensor of the camera to take a photograph;

将图像数据按照预设的1:1比例的图像尺寸进行裁剪得到方形图像数据,并将所述方形图像数据经过所述相机框架层传输至所述相机应用层;所述相机应用层用于根据所述方形图像数据,生成相应的图片,并驱动客户端进行显示。The image data is cropped according to a preset image size of 1:1 ratio to obtain square image data, and the square image data is transmitted to the camera application layer through the camera frame layer; the camera application layer is used according to The square image data generates a corresponding picture and drives the client to display.

优选地,所述服务端还设有驱动层,所述驱动层用于存储所述图像传感器所采集的图像数据。Preferably, the server is further provided with a driving layer for storing image data collected by the image sensor.

优选地,在所述相机硬件抽象层将方形图像数据向相机应用层反馈时, 所述相机硬件抽象层用于将图像数据的尺寸与所述预览尺寸比例不一致的部分图像数据舍弃,不回送给所述客户端预览显示;将保留的方形图像数据压缩生成jpeg格式的图像数据并反馈至所述相机应用层,所述客户端显示。Preferably, when the camera hardware abstraction layer feeds the square image data back to the camera application layer, The camera hardware abstraction layer is configured to discard part of the image data whose image data size is inconsistent with the preview size ratio, and does not send back to the client preview display; compress the retained square image data to generate image data in jpeg format and Feedback to the camera application layer, the client displays.

本发明的第三个技术方案为一种拍照装置,包含:处理器,分别通过处理器进行数据交互的拍照模式模块、预览模块、拍照命令发送模块、裁剪模块、显示模块以及拍照模块。 A third technical solution of the present invention is a photographing apparatus, comprising: a processor, a photographing mode module, a preview module, a photographing command sending module, a cropping module, a display module, and a photographing module for respectively performing data interaction by the processor.

所述拍照模式模块用于切换拍照模式。 The photographing mode module is configured to switch the photographing mode.

所述预览模块用于随着拍照模式的切换,对拍照区域进行预览;以方形拍照模式拍照时,将拍照尺寸分辨率设为1:1比例,此时,预览画面不停止,在预览尺寸分辨率不变的情况下,将预览画面尺寸遮挡至1:1比例。拍照命令发送模块,用于下发拍照指令;所述拍照模块接收所述拍照指令,根据所述拍照指令将postview size设置为1:1比例,并采集图像数据。裁剪模块,用于将所述拍照模块采集的图像数据按照预设的1:1比例的图像尺寸进行裁剪,得到方形图像数据,并将所述方形图像数据反馈至所述显示模块进行显示。The preview module is configured to preview the photographing area according to the switching of the photographing mode; when photographing in the square photographing mode, the photographing size resolution is set to 1:1 ratio, and at this time, the preview screen does not stop, and the preview size is resolved. When the rate is constant, the preview screen size is masked to a 1:1 ratio. The photographing command sending module is configured to send a photographing instruction; the photographing module receives the photographing instruction, sets a postview size to a 1:1 ratio according to the photographing instruction, and collects image data. And a cropping module, configured to cut image data collected by the camera module according to a preset image size of 1:1, obtain square image data, and feed the square image data to the display module for display.

本发明与现有技术相比具有以下优点:The present invention has the following advantages over the prior art:

本发明通过在保持图像预览尺寸分辨率不变的情况下,采用遮挡的方式在显示模块中显示出正方形的预览画面,改变拍照尺寸分辨率为1:1,实现不停止预览,拍出正方形尺寸的图片,保持拍照性能几乎不受影响的情况下,大大提升预览模式间的切换性能的优点。为客户提供更好的功能性能体验。另外若有对yuv格式的图像数据进行处理,,采用原来分辨率尺寸4:3或16:9比例下的位置偏移量敏感的第三方算法进行处理,不需要再另外单独考虑1:1比例的情景模式下的第三方算法处理,即可不做任何的修改改动,就能正常使用,方便图像数据转换。此外此方案在一个项目中若既有回显功能的拍照模式,又有无回显功能的拍照模式下使用,除了1:1比例下的预览功能有一不必要的处理,可大大降低控制系统程序的逻辑复杂性。The invention displays a square preview screen in the display module by using occlusion while keeping the image preview size resolution unchanged, and changes the photo size resolution to 1:1, so as not to stop the preview and shoot the square size. The picture, while keeping the camera performance almost unaffected, greatly improves the switching performance between preview modes. Provide customers with a better functional performance experience. In addition, if the image data of the yuv format is processed, a third-party algorithm sensitive to the positional offset of the original resolution size of 4:3 or 16:9 is used for processing, and there is no need to separately consider the 1:1 ratio. The third-party algorithm processing in the scene mode can be used normally without any modification and modification, and is convenient for image data conversion. In addition, in this project, if there is a photo mode with echo function and a photo mode with no echo function, the preview function in 1:1 ratio has unnecessary processing, which can greatly reduce the control system program. The logical complexity.

附图的简要说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为现有技术中的方形裁剪拍照方法的流程图; 1 is a flow chart of a square cutting photographing method in the prior art;

图2为现有技术中的方形裁剪拍照方法的拍照流程图; 2 is a photographing flowchart of a square cutting photographing method in the prior art;

图3为本发明一种基于拍照有回显不要回显功能的方形裁剪拍照方法的 生成拍照命令的流程图; FIG. 3 is a schematic diagram of a square cropping photographing method based on photographing and having a function of echoing and not returning a flowchart for generating a photographing command;

图4为本发明一种基于拍照有回显不要回显功能的方形裁剪拍照方法的拍照过程的一个实施例的流程图; 4 is a flow chart of an embodiment of a photographing process of a square cropping photographing method based on photographing and having an echo-returning function;

图5为本发明一种基于拍照有回显不要回显功能的方形裁剪拍照方法的拍照过程的另一个实施例的流程图; FIG. 5 is a flowchart of another embodiment of a photographing process of a square cropping photographing method based on photographing and having an echo-returning function;

图6为本发明一种基于拍照有回显不要回显功能的方形裁剪拍照方法的移动终端的选择拍照模式的示意图; FIG. 6 is a schematic diagram of a selective photographing mode of a mobile terminal based on a square cropping photographing method with a photographing back echoing function;

图7为本发明一种基于拍照有回显不要回显功能的方形裁剪拍照方法的移动终端的选择一般全屏拍照模式的示意图; FIG. 7 is a schematic diagram of a general full-screen photographing mode of a mobile terminal based on a square cropping photographing method with a photo-returning and non-returning function;

图8为本发明一种基于拍照有回显不要回显功能的方形裁剪拍照方法的移动终端的选择方形拍照模式的预览示意图; FIG. 8 is a schematic diagram of previewing a square photographing mode of a mobile terminal based on a square cropping photographing method with a photo-returning and non-returning function;

图9为本发明一种基于拍照有回显不要回显功能的方形裁剪拍照方法的拍照装置的结构示意图。 FIG. 9 is a schematic structural diagram of a photographing apparatus for a square cropping photographing method based on a photo-returning and non-returning function according to the present invention.

实现本发明的最佳方式The best way to implement the invention

以下结合附图,通过详细说明一个较佳的具体实施例,对本发明做进一步阐述。 The present invention will be further described below in detail with reference to the accompanying drawings.

以下以Android系统为例阐述相机拍照流程;在Android系统中,运行摄像头应用时,一般需要相机应用层、相机应用框架层、相机硬件抽象层、驱动层之间的交互。启动器在相机应用层查找摄像头应用的资源,获取启动入口,把Java代码依次在交虚拟机解析执行,在执行过程中会依次调用到相机框架层的接口,相机硬件抽象层的接口和驱动层的驱动接口。其中,相机应用层是用Java语言编写的运行在摄像虚拟机上的程序。启用摄像头应用需要启动摄像虚拟机。The following takes the Android system as an example to illustrate the camera photographing process; in the Android system, when running the camera application, the interaction between the camera application layer, the camera application framework layer, the camera hardware abstraction layer, and the driver layer is generally required. The initiator finds the resources of the camera application in the camera application layer, obtains the startup entry, and sequentially executes the Java code in the virtual machine for parsing and execution, and sequentially calls the interface of the camera frame layer, the interface and the driver layer of the camera hardware abstraction layer in the execution process. Drive interface. Among them, the camera application layer is a program written in the Java language and running on the camera virtual machine. Enabling the camera app requires launching the camera virtual machine.

硬件抽象层即底层系统,可以是对系统的硬件设备摄像头操作接口的封装,向上提供接口,屏蔽底层的实现细节。The hardware abstraction layer, that is, the underlying system, may be a package for the hardware device camera operation interface of the system, providing an interface upward, and shielding the underlying implementation details.

相机框架层包含有Camera API(Application Programming Interface,应用程序编程接口)和CameraService(相机服务端)。相机系统设有客户端与服务端,所述相机框架层的代码是运行在客户端的,而相机服务的代码和HAL的接口包括实现代码都是运行在服务端的。相机服务端是一个后台服务,寄 宿在服务端进程中,他提供用于客户端操作相机的接口。由于摄像头的特性是属于独占性的硬件设备,因此摄像头的真正拥有者应该是服务端而非客户端,客户端仅能够通过服务端操作相机设备而已,参数等信息都应该保存在服务端。由于服务端的特性是允许同时连接多个客户端,因此具体服务端能否支持需要依靠具体的实现,还有能否同时使用多个摄像头等这些详细的特性也是需要依靠具体的实现。The camera framework layer includes the Camera API (Application Programming Interface) and the CameraService (Camera Server). The camera system is provided with a client and a server. The code of the camera framework layer is running on the client, and the code of the camera service and the interface of the HAL include the implementation code running on the server. The camera server is a background service In the server process, he provides an interface for the client to operate the camera. Since the characteristics of the camera are exclusive hardware devices, the real owner of the camera should be the server rather than the client. The client can only operate the camera device through the server. Parameters and other information should be saved on the server. Since the characteristics of the server are to allow multiple clients to be connected at the same time, whether the specific server can support the specific implementation, and whether the detailed features of multiple cameras can be used at the same time depends on the specific implementation.

当用户通过移动终端进行拍照时,相机应用层发出相应的拍照指令(take picture指令),该拍照指令经由相机框架层的Camera API和CameraService传输至相机硬件抽象层。当相机硬件抽象层接收到该拍照指令时,调用摄像头进行拍照,驱动层保存摄像头所采集的图像数据。When the user takes a photo through the mobile terminal, the camera application layer issues a corresponding photographing instruction (take picture instruction), which is transmitted to the camera hardware abstraction layer via the Camera API and CameraService of the camera frame layer. When the camera hardware abstraction layer receives the photographing instruction, the camera is called to take a photo, and the driving layer saves the image data collected by the camera.

移动终端的相机硬件抽象层从驱动层获取到摄像头采集的图像数据,并将该图像数据经由相机框架层的Camera API和CameraService传输至相机应用层,由相机应用层根据该图像数据,生成并显示相应的图片。 The camera hardware abstraction layer of the mobile terminal acquires image data collected by the camera from the driver layer, and transmits the image data to the camera application layer via the Camera API and the CameraService of the camera frame layer, and the camera application layer generates and displays the image data according to the image data. The corresponding picture.

实施例一Embodiment 1

结合图3~图5所示,本发明一种基于拍照有回显不要回显功能的方形裁剪拍照方法,进一步包含以下过程:As shown in FIG. 3 to FIG. 5, the present invention is a square cropping photographing method based on photographing and having echo-returning function, and further includes the following process:

一种方形裁剪拍照方法,包含以下过程:将拍照模式切换至方形拍照模式;将拍照尺寸分辨率设为1:1比例,此时,相机不停止预览,在预览尺寸分辨率不变的情况下,将预览画面尺寸遮挡至1:1比例;下发拍照指令,根据所述拍照指令将postview size设置为1:1比例;将图像数据按照预设的1:1比例的图像尺寸进行裁剪,得到方形图像数据;将所述方形图像数据传输至相机;所述相机显示相应的图片并存储,拍照结束。A square cropping photographing method, comprising the following process: switching the photographing mode to the square photographing mode; setting the photographing size resolution to a 1:1 ratio, at this time, the camera does not stop the preview, and the preview size resolution is unchanged. , the preview screen size is blocked to a 1:1 ratio; a photographing instruction is issued, and the postview size is set to a 1:1 ratio according to the photographing instruction; the image data is cropped according to a preset image size of 1:1 ratio, and obtained Square image data; the square image data is transmitted to the camera; the camera displays the corresponding picture and stores it, and the photographing ends.

在本实施例中,相机不需经过一段延迟时间的关闭预览再重新预览的过程,而是在屏幕上采用上下遮挡的方式使标准的预览画面变成方形的预览画面,即相机预览模式从标准等其他预览模式切换至方形预览模式或者从方形预览模式切换至标准等其他预览模式的过程中,相机预览模式一直不停止。In this embodiment, the camera does not need to go through the process of closing the preview and then re-previewing for a delay time, but the upper and lower occlusion modes are used on the screen to make the standard preview image into a square preview image, that is, the camera preview mode is from the standard. The camera preview mode does not stop while other preview modes switch to square preview mode or switch from square preview mode to other preview modes such as standard.

在本实施例中,在将所述图像数据传输至相机的过程中,将与所述预览画面尺寸不一致的图像数据舍弃,不回送给相机进行预览显示。In the embodiment, in the process of transmitting the image data to the camera, the image data that is inconsistent with the preview screen size is discarded, and is not sent back to the camera for preview display.

所述方形裁剪拍照还包含以下过程:所述图像数据为yuv格式数据,其中,y表示亮度,u和v表示色度;所述yuv数据根据第三方算法对其进行编 码压缩成jpeg数据。The square cropping photograph also includes the following process: the image data is yuv format data, wherein y represents brightness, u and v represent chromaticity; and the yuv data is edited according to a third-party algorithm The code is compressed into jpeg data.

在本实施例中,将所述yuv数据转换成jpeg数据还包含以下过程,将所述yuv数据转换为rgb数据,其中,所述r表示红色,所述g表示绿色,所述b表示蓝色。对所述rgb数据对应的各个像素点进行拷贝,根据拷贝像素点对所述rgb数据进行列和/或行插值,将所述rgb数据对应的分辨率扩充至所述预设分辨率;将插值后的所述rgb数据编码成图像格式jpeg数据,以根据所述jpeg数据显示所述图像。In this embodiment, converting the yuv data into jpeg data further includes the following process of converting the yuv data into rgb data, wherein the r represents red, the g represents green, and b represents blue . Copying each pixel corresponding to the rgb data, performing column and/or row interpolation on the rgb data according to the copied pixel, expanding the resolution corresponding to the rgb data to the preset resolution; interpolating The subsequent rgb data is encoded into image format jpeg data to display the image based on the jpeg data.

实施例二Embodiment 2

基于实施例一所述的方形拍照方法,本发明还公开了一种拍照系统,包含:适用于执行实施例一所述的方形裁剪拍照方法的客户端与服务端;所述客户端用于切换拍照模式,并根据选定的拍照模式进行设置拍照尺寸分辨率以及显示预览画面并下发拍照指令;所述服务端接收所述拍照指令并根据指令对postview size进行设置,调用客户端设有的摄像头进行拍照,并将得到的图像数据存储,以及将所述图像数据按照预设图像尺寸比例进行裁剪,得到与选定的拍照模式相匹配的图像数据;将方形图像数据传输至所述客户端;所述客户端显示相应的图片。Based on the square photographing method of the first embodiment, the present invention further discloses a photographing system, comprising: a client and a server for performing the square cropping photographing method according to the first embodiment; the client is used for switching a photographing mode, and setting a photographing size resolution according to the selected photographing mode and displaying a preview screen and issuing a photographing instruction; the server receiving the photographing instruction and setting a postview size according to the instruction, calling the client to set The camera performs photographing, and stores the obtained image data, and trims the image data according to a preset image size ratio to obtain image data matching the selected photographing mode; and transmits the square image data to the client The client displays the corresponding picture.

在本实施例中,上述拍照模式或预览模式设置好之后,通过相机应用层下发拍照指令,则所述拍照指令经由相机框架层的Camera API和CameraService传输至相机硬件抽象层;所述相机硬件抽象层接收上述拍照命令,并强制将其中设有的回显大小尺寸(postview size)设置为1:1比例的大小。In this embodiment, after the photographing mode or the preview mode is set, the photographing instruction is sent by the camera application layer, and the photographing instruction is transmitted to the camera hardware abstraction layer via the Camera API and the CameraService of the camera frame layer; the camera hardware The abstraction layer receives the above-mentioned photographing command and forces the postview size set therein to be set to a size of 1:1.

之后,相机硬件抽象层调用摄像头的图像传感器(sensor端)进行拍照,通过驱动层保存图像传感器所采集的Buffer图像数据。 After that, the camera hardware abstraction layer calls the image sensor (sensor end) of the camera to take a photo, and saves the Buffer image data collected by the image sensor through the driving layer.

相机硬件抽象层将从驱动层获取到图像传感器采集的Buffer图像数据根据与其相匹配裁剪算法,直接按照预设的1:1比例的图像尺寸进行裁剪,得到方形图像数据。 The camera hardware abstraction layer captures the Buffer image data acquired by the image sensor from the driver layer according to the matching cropping algorithm, and directly cuts the image size according to the preset 1:1 ratio to obtain square image data.

相机硬件抽象层根据应用层下发的回调命令,将方形图像数据经由相机框架Camera API和CameraService传输至相机应用层,由相机应用层根据该图像数据,生成并显示相应的图片,则拍照结束。The camera hardware abstraction layer transmits the square image data to the camera application layer via the camera framework Camera API and CameraService according to the callback command issued by the application layer, and the camera application layer generates and displays the corresponding image according to the image data, and the photographing ends.

在本实施例中,在方形图像数据向相机应用层反馈时,由于相机硬件抽 象层中的图像显示数据(postview buffer)的尺寸与上述预览尺寸比例不一致,则将其不一致部分的图像数据在向所述相机应用层反馈时直接舍弃,不回送给预览显示;保留的主要图像数据(main buffer)反馈至所述相机应用层。In this embodiment, when the square image data is fed back to the camera application layer, the camera hardware is drawn. If the size of the image display data (postview buffer) does not match the preview size ratio, the image data of the inconsistent portion is directly discarded when feeding back to the camera application layer, and is not returned to the preview display; the retained main image The main buffer is fed back to the camera application layer.

在本实施例中,如图6所示,相机或相机App的拍照模式包含但不限于:标准拍照模式,方形拍照模式与全屏拍照模式。In this embodiment, as shown in FIG. 6, the photographing mode of the camera or the camera App includes, but is not limited to, a standard photographing mode, a square photographing mode, and a full-screen photographing mode.

在本实施例中,如图7所示,图7为设置在移动终端产品上的相机或相机App选择一般全屏拍照模式的预览显示示意图;从图中可以看出,全屏拍照模式中预览所需拍照的区域的预览图像占用整个移动终端设有的屏幕的大小。In this embodiment, as shown in FIG. 7, FIG. 7 is a schematic diagram of preview display of a camera or camera App set on a mobile terminal product to select a general full-screen camera mode; as can be seen from the figure, a preview in a full-screen camera mode is required. The preview image of the photographed area occupies the size of the screen provided by the entire mobile terminal.

在本实施例中,如图8所示,图8为基于拍照有回显不要回显功能的方形裁剪拍照方法的移动终端的选择方形拍照模式的预览图像显示示意图;从图中可以看出,以屏幕宽度与方形图像的宽度相对应,其以屏幕宽度的数值为基准,其宽度与图像高度相等将预览画面中其他部分进行遮挡,如图8所示的斜条纹部分为所需遮挡的部分,从而使预览画面在表面看起来与所需要方形图像的尺寸一致。In this embodiment, as shown in FIG. 8 , FIG. 8 is a schematic diagram showing a preview image display of a selection of a square photographing mode of a mobile terminal based on a square cropping photographing method with a photo-returning non-return function; The width of the screen corresponds to the width of the square image, which is based on the value of the screen width, and the width is equal to the height of the image to occlude the rest of the preview image. The diagonal stripe portion shown in FIG. 8 is the portion that needs to be occluded. So that the preview image looks the same on the surface as the size of the square image you need.

如图5所示,由于相机中最终呈现的数据格式为jpeg的数据格式,则基于上述实施例一中所述的拍照方法,对于实施例一中所得到的以yuv格式存储的图像数据中的主要图像数据(main buffer)需要通过第三方算法进行处理,即通过第三方算法对方形图像数据进行图像数据存储格式转换。As shown in FIG. 5, since the data format finally presented in the camera is the data format of jpeg, the photographing method described in the first embodiment is used in the image data stored in the yuv format obtained in the first embodiment. The main image data (main buffer) needs to be processed by a third-party algorithm, that is, the image data storage format conversion is performed on the square image data by a third-party algorithm.

若图像传感器采集的图像数据为yuv数据,其中,y表示亮度,u和v表示色度,因此,当相机硬件抽象层从驱动层获取到yuv数据后,相机硬件抽象层对该yuv数据根据第三方算法进行编码压缩成jpeg数据,并将jpeg数据经由相机框架层的Camera API和CameraService传输至相机应用层,由相机应用层根据该jpeg数据生成并显示相应的图片。则拍照结束。If the image data collected by the image sensor is yuv data, where y represents brightness, and u and v represent chromaticity, therefore, when the camera hardware abstraction layer acquires yuv data from the driver layer, the camera hardware abstraction layer according to the yuv data The three-party algorithm encodes and compresses into jpeg data, and transmits the jpeg data to the camera application layer via the Camera API and CameraService of the camera frame layer, and the camera application layer generates and displays the corresponding image according to the jpeg data. Then the photo ends.

对于yuv数据,yuv数据主要用于优化彩色视频信号的传输,使其向后相容老式黑白电视。与RGB视频信号传输相比,它最大的优点在于只需占用极少的频宽(RGB要求三个独立的视频信号同时传输)。其中“y”表示明亮度(Luminance或Luma),也就是灰阶值;而“u”和“v”表示的则是色度(Chrominance或Chroma),作用是描述影像色彩及饱和度,用于指定像素 的颜色。“亮度”是透过RGB输入信号来建立的,方法是将RGB信号的特定部分叠加到一起。“色度”则定义了颜色的两个方面─色调与饱和度,分别用Cr和Cb来表示。其中,Cr反映了RGB输入信号红色部分与RGB信号亮度值之间的差异。而Cb反映的是RGB输入信号蓝色部分与RGB信号亮度值之间的差异。For yuv data, yuv data is primarily used to optimize the transmission of color video signals, making them backward compatible with older black and white televisions. Compared with RGB video signal transmission, its biggest advantage is that it requires only a small amount of bandwidth (RGB requires three independent video signals to be transmitted simultaneously). Where "y" means brightness (Luminance or Luma), which is the grayscale value; and "u" and "v" represent chromaticity (Chrominance or Chroma), which is used to describe the color and saturation of the image. Specified pixel s color. "Brightness" is established by RGB input signals by superimposing specific parts of the RGB signal together. "Chroma" defines two aspects of color - hue and saturation, represented by Cr and Cb, respectively. Among them, Cr reflects the difference between the red part of the RGB input signal and the brightness value of the RGB signal. Cb reflects the difference between the blue portion of the RGB input signal and the luminance value of the RGB signal.

采用yuv色彩空间的重要性是它的亮度信号y和色度信号u、v是分离的。如果只有y信号分量而没有u、v分量,那么这样表示的图像就是黑白灰度图像。例如,彩色电视采用yuv空间正是为了用亮度信号y解决彩色电视机与黑白电视机的兼容问题,使黑白电视机也能接收彩色电视信号。The importance of using the yuv color space is that its luminance signal y and chrominance signals u, v are separated. If there are only y signal components and no u, v components, then the image thus represented is a black and white grayscale image. For example, the color TV adopts the yuv space in order to solve the compatibility problem between the color television and the black and white television with the luminance signal y, so that the black and white television can also receive the color television signal.

实施例三Embodiment 3

如图9所示,基于上述方形拍照的拍照方法一示例性实施例,本发明还公开了一种拍照装置,包含:处理器100,分别与处理器100作信息交互的拍照模式模块107,预览模块108,拍照命令发送模块109,裁剪模块110,拍照模块111,存储器102,传输接口103,音频组件104,传感器组件105以及操控界面106。As shown in FIG. 9 , an exemplary embodiment of the photographing method based on the above-mentioned square photographing, the present invention further discloses a photographing apparatus, comprising: a processor 100, a photographing mode module 107 for interacting with the processor 100 respectively, previewing The module 108, the photographing command sending module 109, the cropping module 110, the photographing module 111, the memory 102, the transmission interface 103, the audio component 104, the sensor component 105 and the manipulation interface 106.

处理器100,用于控制上述拍照装置的整体操作,例如显示,存储,数据传输,拍照操作等。 The processor 100 is configured to control overall operations of the camera device, such as display, storage, data transmission, camera operation, and the like.

拍照模式模块107,其包含标准,方形,全屏等拍照模式;通过操控界面106可以对拍照模式进行选择。 The photographing mode module 107 includes standard, square, full-screen and the like photographing modes; the photographing mode can be selected through the manipulation interface 106.

拍照模块111,用于当接收到拍照指令时,采用配置后的所述拍照模式以及拍照参数进行拍摄照片。 The photographing module 111 is configured to take a photo by using the configured photographing mode and the photographing parameter when receiving the photographing instruction.

存储器102,用于将拍摄得到的照片与其对应的拍摄参数关联保存。 The memory 102 is configured to save the captured photo in association with the corresponding shooting parameter.

传感器组件105,其包含但不限于光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。所述图像传感器为摄像头核心组成部件。Sensor assembly 105, which includes, but is not limited to, a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. The image sensor is a core component of the camera.

音频组件104被配置为输出和/或输入音频信号。例如,音频组件104包括一个麦克风,当拍照装置处于操作模式,如声控拍照模式、呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器102中或通过处理器100控制拍照模块进行拍照。在另外一些实施例中,音频组件104还包括一个扬声器,用于输出音频信号。 The audio component 104 is configured to output and/or input an audio signal. For example, the audio component 104 includes a microphone that is configured to receive an external audio signal when the camera device is in an operational mode, such as a voice-activated camera mode, a call mode, a recording mode, and a voice recognition mode. The received audio signal may be further stored in the memory 102 or controlled by the processor 100 to take a picture. In still other embodiments, the audio component 104 also includes a speaker for outputting an audio signal.

传输接口103,其用于通过有线和/或无线的方式与外部设备进行连接,传输图像数据。 The transmission interface 103 is configured to transmit image data by connecting to an external device by wire and/or wirelessly.

上述拍照装置还设有一电源模块101,其为拍照装置的各种组件或模块提供电力。 The camera device described above is further provided with a power module 101 that provides power to various components or modules of the camera device.

操控界面106,其用于方便人机交互,进行拍照设置参数等操作,其内部还包含一显示模块,其用于接收图像数据并在上述操控界面106中显示。 The control interface 106 is configured to facilitate human-computer interaction, perform photographing setting parameters, and the like, and further includes a display module for receiving image data and displaying the same in the manipulation interface 106.

预览模块108,用于随着拍照模式的变化,对拍照区域进行预览,还可以设置预览尺寸分辨率。 The preview module 108 is configured to preview the photographed area as the photographing mode changes, and also set the preview size resolution.

拍照命令发送模块109,用于当拍摄模式以及预览分辨率,以及拍摄参数均设置好之后,向拍照模块111发送拍照命令。The photographing command sending module 109 is configured to send a photographing command to the photographing module 111 after the shooting mode and the preview resolution are set, and the shooting parameters are all set.

裁剪模块110,用于对拍照模块111调用传感器组件105拍摄照片后,得出的图像数据进行裁剪,并将其裁剪好的图像数据反馈至存储器102进行存储,或者反馈至显示模块,通过操控界面进行显示。The cropping module 110 is configured to: after the camera module 111 calls the sensor component 105 to take a photo, the obtained image data is cropped, and the cropped image data is fed back to the memory 102 for storage, or fed back to the display module, through the control interface. Display.

以方形拍照模式拍照时,将拍照尺寸分辨率设为1:1比例,此时,预览画面不停止,在预览尺寸分辨率不变的情况下,将预览画面尺寸遮挡至1:1比例。所述拍照命令发送模块下发拍照指令;所述拍照模块接收所述拍照指令,根据所述拍照指令将postview size设置为1:1比例,并采集图像数据。所述裁剪模块将所述拍照模块采集的图像数据按照预设的1:1比例的图像尺寸进行裁剪,得到方形图像数据,并将所述方形图像数据反馈至所述显示模块通过操控界面进行显示。When taking a photo in the square photo mode, set the photo size resolution to 1:1. At this time, the preview screen does not stop, and the preview screen size is blocked to 1:1 ratio when the preview size resolution is unchanged. The photographing command sending module sends a photographing instruction; the photographing module receives the photographing instruction, sets a postview size to a 1:1 ratio according to the photographing instruction, and collects image data. The cropping module cuts the image data collected by the camera module according to a preset image size of 1:1 ratio, obtains square image data, and feeds back the square image data to the display module to display through the control interface. .

综上所述,本发明在预览尺寸分辨率不变的情况下,采用遮挡的方式使看上去为方形的预览画面,而仅仅改变拍照尺寸分辨率为1:1,这样就可不用停止预览,也能拍出方形尺寸的照片,拍照性能稍微有点降低或几乎不受影响的情况下,预览模式间的切换性能可大大提升。在底层上的实现上也即是若有1:1比例的方形拍照,在底层强制把postview size修改为1:1比例的大小,然后从sensor端出来的buffer数据直接根据新的裁剪算法裁剪成1:1的比例,对于postview buffer由于与预览尺寸比例不一致,在把相应数据返回上层时直接舍弃;而对于main buffer若需要对裁剪后的数据buffer做第三方算法处理,则进行第三方算法处理,否则不做处理,最后压缩生成jpeg数据返回给相机应用层。 In summary, the present invention uses the occlusion method to make the preview image look square when the preview size resolution is unchanged, and only changes the photo size resolution to 1:1, so that the preview does not need to be stopped. It is also possible to take a square-sized photograph, and the switching performance between the preview modes can be greatly improved in the case where the photographing performance is slightly reduced or hardly affected. In the implementation on the bottom layer, if there is a 1:1 ratio square photograph, the postview size is forced to be changed to a 1:1 ratio at the bottom layer, and then the buffer data from the sensor end is directly cut according to the new cropping algorithm. The ratio of 1:1, for the postview buffer is inconsistent with the preview size ratio, it is directly discarded when the corresponding data is returned to the upper layer; and for the main buffer to perform third-party algorithm processing on the clipped data buffer, third-party algorithm processing is performed. Otherwise, no processing is done, and finally the compressed jpeg data is returned to the camera application layer.

在本实施例中,若摄像头业务设有回显功能的拍照模式,除了通过本发明对1:1比例下的预览功能进行设置外,则不必要对回显功能的拍照模式进行多余处理,可大大降低控制系统程序的逻辑复杂性。若摄像头业务没有回显功能的拍照模式,则也可通过本发明对拍照模式进行选择,对预览参数进行设置。本发明适用性比较好。In this embodiment, if the camera service is provided with the camera mode of the echo function, in addition to setting the preview function under the 1:1 ratio by the present invention, it is unnecessary to perform unnecessary processing on the camera mode of the echo function. Significantly reduce the logic complexity of the control system program. If the camera service does not have the photographing mode of the echo function, the photographing mode can also be selected by the present invention, and the preview parameters are set. The applicability of the invention is relatively good.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, can be embodied in the form of a software product that can be stored in a storage medium (such as ROM/RAM, disk). The optical disc includes a plurality of instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in various embodiments of the present invention.

尽管已描述了本发明实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明实施例范围的所有变更和修改。While a preferred embodiment of the present invention has been described, it will be apparent that those skilled in the art can make further changes and modifications to the embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and

最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should also be noted that in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities. There is any such actual relationship or order between operations. Furthermore, the terms "comprises" or "comprising" or "comprising" or any other variations are intended to encompass a non-exclusive inclusion, such that a process, method, article, or terminal device that includes a plurality of elements includes not only those elements but also Other elements that are included, or include elements inherent to such a process, method, article, or terminal device. An element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that comprises the element, without further limitation.

以上对本发明所提供的一种基于拍照有回显不要回显功能的方形裁剪拍照方法和一种基于上述拍张方法的拍照的装置,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术 人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,尽管本发明的内容已经通过上述优选实施例作了详细介绍,但应当认识到上述的描述不应被认为是对本发明的限制。在本领域技术人员阅读了上述内容后,对于本发明的多种修改和替代都将是显而易见的。因此,本发明的保护范围应由所附的权利要求来限定。 The above is a detailed description of a square cropping photographing method based on photographing with echo-returning function and a photographing device based on the above-mentioned photographing method, and a specific example is applied to the present invention. The principles and implementations are set forth, and the description of the above embodiments is only to aid in understanding the method of the present invention and its core idea; at the same time, the general technique in the art Personnel, according to the idea of the present invention, there will be changes in the specific embodiments and application scope. In the above, the description of the present invention has been described in detail by the above-described preferred embodiments, and it should be understood that the above description should not be construed as limiting. Various modifications and alterations of the present invention will be apparent to those skilled in the art. Therefore, the scope of the invention should be defined by the appended claims.

Claims (10)

  1. 一种方形裁剪拍照方法,其特征在于,包含以下过程: A square cropping photographing method, characterized in that the method comprises the following steps:
    将拍照模式切换至方形拍照模式; Switch the camera mode to the square camera mode;
    将拍照尺寸分辨率设为1:1比例,此时,相机不停止预览,在预览尺寸分辨率不变的情况下,将预览画面尺寸遮挡至1:1比例; Set the camera size resolution to 1:1 ratio. At this time, the camera does not stop previewing, and the preview screen size is blocked to 1:1 ratio when the preview size resolution is unchanged.
    下发拍照指令,根据所述拍照指令将postview size设置为1:1比例; Sending a photographing instruction, and setting the postview size to a 1:1 ratio according to the photographing instruction;
    将图像数据按照预设的1:1比例的图像尺寸进行裁剪,得到方形图像数据; The image data is cropped according to a preset image size of 1:1 ratio to obtain square image data;
    将所述方形图像数据传输至相机;所述相机显示相应的图片并存储,拍照结束。 The square image data is transmitted to the camera; the camera displays the corresponding picture and stores it, and the photographing ends.
  2. 如权利要求1所述的方形裁剪拍照方法,其特征在于,在将所述图像数据传输至相机的过程中,将与所述预览画面尺寸不一致的图像数据舍弃,不回送给相机进行预览显示。The square cropping photographing method according to claim 1, wherein in the process of transmitting the image data to the camera, the image data that does not match the size of the preview screen is discarded, and is not sent back to the camera for preview display.
  3. 如权利要求1所述的方形裁剪拍照方法,其特征在于,还包含以下过程:所述图像数据为yuv格式数据,其中,y表示亮度,u和v表示色度;所述yuv数据根据第三方算法对其进行编码压缩成jpeg数据。 The square cropping photographing method according to claim 1, further comprising the following process: said image data is yuv format data, wherein y represents brightness, u and v represent chromaticity; said yuv data is based on a third party The algorithm encodes and compresses it into jpeg data.
  4. 如权利要求3所述的方形裁剪拍照方法,其特征在于, A square cropping photographing method according to claim 3, wherein
    将所述yuv数据转换成jpeg数据还包含以下过程,将所述yuv数据转换为rgb数据,其中,所述r表示红色,所述g表示绿色,所述b表示蓝色; Converting the yuv data into jpeg data further includes the following process of converting the yuv data into rgb data, wherein the r represents red, the g represents green, and b represents blue;
    对所述rgb数据对应的各个像素点进行拷贝,根据拷贝像素点对所述rgb数据进行列和/或行插值,将所述rgb数据对应的分辨率扩充至所述预设分辨率; Copying respective pixel points corresponding to the rgb data, performing column and/or row interpolation on the rgb data according to the copied pixel points, and expanding a resolution corresponding to the rgb data to the preset resolution;
    将插值后的所述rgb数据编码成图像格式jpeg数据,以根据所述jpeg数据显示所述图像。The interpolated rgb data is encoded into image format jpeg data to display the image based on the jpeg data.
  5. 一种拍照系统,其特征在于,包含:适用于执行权利要求1~4所述的方形裁剪拍照方法的客户端与服务端;所述客户端用于切换拍照模式,并根据选定的拍照模式进行设置拍照尺寸分辨率以及显示预览画面并下发拍照指令;所述服务端接收所述拍照指令并根据指令对postview size进行设置,调用客户端设有的摄像头进行拍照,并将得到的图像数据存储,以及将所述图像数据按照预设图像尺寸比例进行裁剪,得到与选定的拍照模式相匹配的图 像数据;将方形图像数据传输至所述客户端;所述客户端显示相应的图片。A photographing system, comprising: a client and a server for performing the square cropping photographing method according to claims 1 to 4; the client is configured to switch the photographing mode according to the selected photographing mode Performing to set the photo size resolution and displaying the preview screen and issuing a photographing instruction; the server receives the photographing instruction and sets the postview size according to the instruction, calls the camera provided by the client to take a photo, and obtains the image data. Storing, and cropping the image data according to a preset image size ratio to obtain a map matching the selected photographing mode Image data; transmits square image data to the client; the client displays a corresponding picture.
  6. 如权利要求5所述的拍照系统,其特征在于, A photographing system according to claim 5, wherein
    所述服务端设有的拍照模式包含:标准拍照模式,方形拍照模式与全屏拍照模式。 The camera mode provided by the server includes: a standard camera mode, a square camera mode and a full-screen camera mode.
  7. 如权利要求6所述的拍照系统,其特征在于, A photographing system according to claim 6 wherein:
    所述服务端设有通过各自发出的回调命令进行数据交互的相机应用层、相机应用框架层、相机硬件抽象层;所述客户端将拍照模式切换至方形拍照模式拍照时;将拍照尺寸分辨率设为1:1比例,此时,相机不停止预览,在预览尺寸分辨率不变的情况下,将预览画面尺寸遮挡至1:1比例;The server is provided with a camera application layer, a camera application framework layer, and a camera hardware abstraction layer for data interaction through respective issued callback commands; the client switches the photographing mode to the square photographing mode to take a photo; Set to 1:1 ratio, at this time, the camera does not stop previewing, and the preview screen size is blocked to 1:1 ratio when the preview size resolution is unchanged;
    所述相机应用层用于根据选定的拍照模式下发拍照指令; The camera application layer is configured to send a photographing instruction according to the selected photographing mode;
    所述相机硬件抽象层用于接收上述拍照命令并执行以下操作,若拍照指令为以方形拍照模式进行拍照时,将postview size设置为1:1比例;并调用摄像头的图像传感器进行拍照; The camera hardware abstraction layer is configured to receive the photo command and perform the following operations: if the photographing instruction is to take a photo in the square photographing mode, set the postview size to a 1:1 ratio; and call the image sensor of the camera to take a photograph;
    将图像数据按照预设的1:1比例的图像尺寸进行裁剪得到方形图像数据,并将所述方形图像数据经过所述相机框架层传输至所述相机应用层; The image data is cropped according to a preset image size of 1:1 ratio to obtain square image data, and the square image data is transmitted to the camera application layer through the camera frame layer;
    所述相机应用层用于根据所述方形图像数据,生成相应的图片,并驱动客户端进行显示。 The camera application layer is configured to generate a corresponding picture according to the square image data, and drive the client to display.
  8. 如权利要求7所述的拍照系统,其特征在于, The photographing system of claim 7 wherein:
    所述服务端还设有驱动层,所述驱动层用于存储所述图像传感器所采集的图像数据。 The server is further provided with a driving layer for storing image data collected by the image sensor.
  9. 如权利要求7所述的拍照系统,其特征在于, The photographing system of claim 7 wherein:
    在所述相机硬件抽象层将方形图像数据向相机应用层反馈时,所述相机硬件抽象层用于将图像数据的尺寸与所述预览尺寸比例不一致的部分图像数据舍弃,不回送给所述客户端预览显示;将保留的方形图像数据压缩生成jpeg格式的图像数据并反馈至所述相机应用层,所述客户端显示。When the camera hardware abstraction layer feeds the square image data to the camera application layer, the camera hardware abstraction layer is used to discard part of the image data whose image data size is inconsistent with the preview size ratio, and does not send back to the client End preview display; compressing the retained square image data to generate image data in jpeg format and feeding back to the camera application layer, the client displays.
  10. 一种拍照装置,其特征在于,包含:处理器,分别通过处理器进行数据交互的拍照模式模块、预览模块、拍照命令发送模块、裁剪模块、显示模块以及拍照模块; A photographing apparatus, comprising: a processor, a photographing mode module, a preview module, a photographing command sending module, a cropping module, a display module, and a photographing module for respectively performing data interaction by the processor;
    所述拍照模式模块用于切换拍照模式; The photographing mode module is configured to switch a photographing mode;
    预览模块,用于随着拍照模式的切换,对拍照区域进行预览;以方形拍照模 式拍照时,将拍照尺寸分辨率设为1:1比例,此时,预览画面不停止,在预览尺寸分辨率不变的情况下,将预览画面尺寸遮挡至1:1比例; a preview module for previewing a photographed area as the photographing mode is switched; When taking a picture, set the photo size resolution to 1:1 ratio. At this time, the preview picture does not stop. If the preview size resolution is unchanged, the preview picture size is blocked to 1:1 ratio;
    拍照命令发送模块,用于下发拍照指令, A photo command sending module is used to send a photographing instruction.
    所述拍照模块接收所述拍照指令,根据所述拍照指令将postview size设置为1:1比例,并采集图像数据; The photographing module receives the photographing instruction, sets a postview size to a 1:1 ratio according to the photographing instruction, and collects image data;
    裁剪模块用于将所述拍照模块采集的图像数据按照预设的1:1比例的图像尺寸进行裁剪,得到方形图像数据,并将所述方形图像数据反馈至所述显示模块进行显示。 The cropping module is configured to crop the image data collected by the camera module according to a preset image size of 1:1, obtain square image data, and feed the square image data to the display module for display.
PCT/CN2017/099919 2017-08-31 2017-08-31 Square cropping photography method, photography system and photography apparatus WO2019041230A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/099919 WO2019041230A1 (en) 2017-08-31 2017-08-31 Square cropping photography method, photography system and photography apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
PCT/CN2017/099919 WO2019041230A1 (en) 2017-08-31 2017-08-31 Square cropping photography method, photography system and photography apparatus
CN201780096317.1A CN111279679A (en) 2017-08-31 2017-08-31 Square cutting photographing method, photographing system and photographing device

Publications (1)

Publication Number Publication Date
WO2019041230A1 true WO2019041230A1 (en) 2019-03-07

Family

ID=65524676

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/099919 WO2019041230A1 (en) 2017-08-31 2017-08-31 Square cropping photography method, photography system and photography apparatus

Country Status (2)

Country Link
CN (1) CN111279679A (en)
WO (1) WO2019041230A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030025803A1 (en) * 1996-11-15 2003-02-06 Shuichi Nakamura Image processing apparatus and method, storage medium, and communication system
US20050146631A1 (en) * 2004-01-07 2005-07-07 Shelton Michael J. In-camera cropping to standard photo sizes
CN101000623A (en) * 2007-01-08 2007-07-18 深圳市宜搜科技发展有限公司 Method for image identification search by mobile phone photographing and device using the method
CN105657265A (en) * 2016-01-06 2016-06-08 卢锦霞 Full-automatic shooting imaging system and method
CN303805768S (en) * 2016-03-31 2016-08-17
CN106657761A (en) * 2016-09-29 2017-05-10 乐视控股(北京)有限公司 Picture shooting method and device for intelligent terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030025803A1 (en) * 1996-11-15 2003-02-06 Shuichi Nakamura Image processing apparatus and method, storage medium, and communication system
US20050146631A1 (en) * 2004-01-07 2005-07-07 Shelton Michael J. In-camera cropping to standard photo sizes
CN101000623A (en) * 2007-01-08 2007-07-18 深圳市宜搜科技发展有限公司 Method for image identification search by mobile phone photographing and device using the method
CN105657265A (en) * 2016-01-06 2016-06-08 卢锦霞 Full-automatic shooting imaging system and method
CN303805768S (en) * 2016-03-31 2016-08-17
CN106657761A (en) * 2016-09-29 2017-05-10 乐视控股(北京)有限公司 Picture shooting method and device for intelligent terminal

Also Published As

Publication number Publication date
CN111279679A (en) 2020-06-12

Similar Documents

Publication Publication Date Title
US20200221096A1 (en) Data output apparatus, data output method, and data generation method
CN105744342B (en) The data transmission method and device of mobile terminal
JP6367272B2 (en) Establishing a video conference during a call
US8581959B2 (en) Video conferencing system which allows endpoints to perform continuous presence layout selection
CN105190511B (en) Image processing method, image processing apparatus and image processing program
CN102761702B (en) For method and the imaging system of the image overlap in mobile communication equipment
JP4372558B2 (en) Telecommunications system
US7546343B2 (en) System and method for supporting virtual conferences
US9143725B2 (en) System and method for providing enhanced graphics in a video environment
US8902244B2 (en) System and method for providing enhanced graphics in a video environment
AU2013200730B2 (en) Data processing apparatus and method using a camera
JP4499117B2 (en) Mobile communication terminal, mobile communication terminal control method, and videophone method using mobile communication terminal
US8681200B2 (en) Video telephony apparatus and method for mobile terminal
US10242714B2 (en) Interface for application-specified playback of panoramic video
US6380972B1 (en) Video system including a camera controlled by a control apparatus through communication means
ES2274943T3 (en) System and procedure for chamber control numerica.
DE69530991T2 (en) Peripheral video conference system
JP5190117B2 (en) System and method for generating photos with variable image quality
KR100656589B1 (en) Portable terminal capable of displaying and deleting division photograph pictures and method therof
KR100605935B1 (en) Method for taking moving picture
KR101421587B1 (en) Method and Apparatus for determining preferred image format in IP-based mobile video telephony
KR100617702B1 (en) Portable terminal capable of editing image and image edition method using that
WO2016208939A1 (en) Method and apparatus for generating and transmitting metadata for virtual reality
US6269217B1 (en) Multi-stage electronic motion image capture and processing system
US8144182B2 (en) Real time video communications system

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

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

Country of ref document: EP

Kind code of ref document: A1