CN105827931B - It is a kind of based on the audio-frequency inputting method and device taken pictures - Google Patents
It is a kind of based on the audio-frequency inputting method and device taken pictures Download PDFInfo
- Publication number
- CN105827931B CN105827931B CN201510345291.2A CN201510345291A CN105827931B CN 105827931 B CN105827931 B CN 105827931B CN 201510345291 A CN201510345291 A CN 201510345291A CN 105827931 B CN105827931 B CN 105827931B
- Authority
- CN
- China
- Prior art keywords
- coordinate
- target
- target object
- target objects
- deflection angle
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R1/00—Details of transducers, loudspeakers or microphones
- H04R1/20—Arrangements for obtaining desired frequency or directional characteristics
- H04R1/32—Arrangements for obtaining desired frequency or directional characteristics for obtaining desired directional characteristic only
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- Otolaryngology (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Studio Devices (AREA)
Abstract
Description
技术领域technical field
本发明涉及音频处理技术领域,特别是涉及一种基于拍照的音频输出方法和一种基于拍照的音频输出装置。The present invention relates to the technical field of audio processing, and in particular, to a photography-based audio output method and a photography-based audio output device.
背景技术Background technique
随着科技的发展,各种电子设备,尤其是诸如手机、平板电脑等移动设备,在人们的工作、学习、日常交流等各方面的使用率也越来越高。With the development of science and technology, various electronic devices, especially mobile devices such as mobile phones and tablet computers, are increasingly used in people's work, study, daily communication and other aspects.
手机、平板电脑等电子设备中,大多数都配置有摄像头,使得拍照成为电子设备的一个重要应用。Most of electronic devices such as mobile phones and tablet computers are equipped with cameras, making photography an important application of electronic devices.
目前,在拍照的场景中,通常会通过扬声器发出提示声,提示用户及被拍照者拍照的时机。At present, in a photographing scene, a prompt sound is usually issued through a speaker to prompt the user and the person to be photographed when the photograph is taken.
但是,由于环境嘈杂等因素,有可能会出现被拍照者听不清楚提示声的情况。若被拍照者没听清提示声,稍微动一下,拍出的照片就模糊了,尤其是在拍摄小孩时,由于不能很好的吸引小孩子的注意力,所以很难对小孩子进行拍照。However, due to factors such as noise in the environment, there may be cases where the person being photographed cannot hear the prompt sound. If the person being photographed does not hear the prompt sound clearly and moves a little, the picture will be blurred, especially when taking pictures of children, it is difficult to take pictures of children because they cannot attract the attention of children very well.
若照片模糊,则需要进行重新拍照,浪费电子设备的资源,拍照的效率低,成本高。If the photo is blurred, it is necessary to take a photo again, which wastes the resources of the electronic device, and has low photo-taking efficiency and high cost.
而且,在人员众多等场景下,拍照的提示声可能会传给其他人(非被拍照者),对其他人造成影响。Moreover, in scenarios such as a large number of people, the prompt sound of taking pictures may be transmitted to other people (not the person to be photographed), affecting others.
发明内容SUMMARY OF THE INVENTION
鉴于上述问题,提出了本发明实施例以便提供一种克服上述问题或者至少部分地解决上述问题的一种基于拍照的音频输出方法和相应的一种基于拍照的音频输出装置。In view of the above problems, embodiments of the present invention are proposed to provide a photography-based audio output method and a corresponding photography-based audio output device that overcome the above problems or at least partially solve the above problems.
为了解决上述问题,本发明实施例公开了一种基于拍照的音频输出方法,包括:In order to solve the above problems, an embodiment of the present invention discloses a method for outputting audio based on photography, including:
当摄像头采集到预览图像数据时,确定所述预览图像数据中的一个或多个目标对象;When the camera captures the preview image data, determining one or more target objects in the preview image data;
对所述一个或多个目标对象计算相对于扬声器的声场角;calculating a sound field angle relative to the speaker for the one or more target objects;
对所述一个或多个目标对象计算相对于扬声器的偏向角;calculating a deflection angle relative to the speaker for the one or more target objects;
当接收到拍照指示时,驱动扬声器按照所述声场角和所述偏向角定向输出音频。When receiving a photographing instruction, the speaker is driven to output audio directionally according to the sound field angle and the deflection angle.
本发明实施例还公开了一种基于拍照的音频输出装置,包括:The embodiment of the present invention also discloses an audio output device based on photography, comprising:
目标对象确定模块,用于在摄像头采集到预览图像数据时,确定所述预览图像数据中的一个或多个目标对象;a target object determination module, configured to determine one or more target objects in the preview image data when the camera captures the preview image data;
声场角计算模块,用于对所述一个或多个目标对象计算相对于扬声器的声场角;a sound field angle calculation module, configured to calculate the sound field angle relative to the speaker for the one or more target objects;
偏向角计算模块,用于对所述一个或多个目标对象计算相对于扬声器的偏向角;a deflection angle calculation module, configured to calculate the deflection angle relative to the speaker for the one or more target objects;
音频定向输出模块,用于在接收到拍照指示时,驱动扬声器按照所述声场角和所述偏向角定向输出音频。The audio directional output module is configured to drive the speaker to output audio directionally according to the sound field angle and the deflection angle when receiving a photographing instruction.
本发明实施例包括以下优点:The embodiments of the present invention include the following advantages:
本发明实施例通过对预览图像数据中的一个或多个目标对象计算声场角和偏向角,在拍照时按照该声场角和偏向角定向输出音频,将拍照的提示声定向输出至该目标对象在实际所映射的被拍照者,使得被拍照者在环境嘈杂等因素下可以听清提示声,从而提高了拍照的成功率,避免重新拍照的几率,减少电子设备的资源浪费,提高拍照的效率,降低拍照的成本;此外,定向输出音频以外的区域一般听不清拍照的提示声,减少对其他人的影响。In the embodiment of the present invention, the sound field angle and deflection angle are calculated for one or more target objects in the preview image data, and the audio is directionally output according to the sound field angle and deflection angle when taking pictures, and the prompt sound of the photograph is directionally output to the target object at The actual mapping of the person to be photographed enables the person to be photographed to hear the prompt sound clearly in the noisy environment, thereby improving the success rate of taking pictures, avoiding the probability of re-taking pictures, reducing the waste of electronic equipment resources, and improving the efficiency of taking pictures. Reduce the cost of taking pictures; in addition, the area other than the directional output audio is generally inaudible to the prompt sound of taking pictures, reducing the impact on others.
附图说明Description of drawings
图1是本发明的一种基于拍照的音频输出方法实施例的步骤流程图;Fig. 1 is the step flow chart of a kind of audio output method embodiment based on photography of the present invention;
图2A和图2B是本发明的一种声场角和偏向角的场景示例图;Fig. 2A and Fig. 2B are a kind of scene example diagrams of sound field angle and deflection angle of the present invention;
图3A和图3B是本发明的一种声场角的计算示例图;Fig. 3A and Fig. 3B are a kind of calculation example diagram of sound field angle of the present invention;
图4A至图4C是本发明的一种偏向角的计算示例图;Fig. 4A to Fig. 4C are a kind of calculation example diagram of deflection angle of the present invention;
图5是本发明的一种基于拍照的音频输出装置实施例的结构框图。FIG. 5 is a structural block diagram of an embodiment of an audio output device based on photography according to the present invention.
具体实施方式Detailed ways
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.
参照图1,示出了本发明的一种基于拍照的音频输出方法实施例的步骤流程图,具体可以包括如下步骤:Referring to FIG. 1, a flowchart of steps of an embodiment of a method for outputting audio based on photography of the present invention is shown, which may specifically include the following steps:
步骤101,当摄像头采集到预览图像数据时,确定所述预览图像数据中的一个或多个目标对象;Step 101, when the camera captures the preview image data, determine one or more target objects in the preview image data;
需要说明的是,本发明实施例可以应用在各种电子设备中,例如,手机、平板电脑、个人数字助理、穿戴设备(如眼镜、手表等)等等,本发明实施例对此不加以限制。It should be noted that the embodiments of the present invention may be applied to various electronic devices, for example, mobile phones, tablet computers, personal digital assistants, wearable devices (such as glasses, watches, etc.), etc., which are not limited in the embodiments of the present invention .
该电子设备的操作系统可以包括Android(安卓)、IOS、Windows Phone、Windows等等,通常可以支持摄像头、扬声器的运行。The operating system of the electronic device may include Android (Android), IOS, Windows Phone, Windows, etc., and usually can support the operation of the camera and the speaker.
摄像头是电子设备上的一个硬件,可以用于拍照和拍摄,可以是前置的(与电子设备的屏幕同方向),也可以是后置(与电子设备的屏幕反方向)的,本发明实施例对此也不加以限制。A camera is a piece of hardware on an electronic device, which can be used for taking pictures and shooting. It can be front-facing (in the same direction as the screen of the electronic device) or rear-facing (in the opposite direction to the screen of the electronic device). The example does not limit this.
在实际应用中,景物(Scene)通过摄像头的镜头(Lens)生成的光学图像投射到图像感应处理器(Sensor)表面上,然后转为电信号,经过A/D(模数转换)转换后变为数字图像信号,由数字信号处理芯片(DSP)或编码库中对数字图像信号进行压缩并转化为特定的图像文件格式,通过数据总线传输到移动设备的处理器(Central Processing Unit,CPU)进行处理,则可以在电子设备的显示屏显示了。In practical applications, the optical image generated by the lens (Lens) of the camera is projected onto the surface of the image sensor processor (Sensor), and then converted into an electrical signal, which is converted into an electrical signal after A/D (analog-to-digital conversion) conversion. It is a digital image signal. The digital image signal is compressed and converted into a specific image file format by a digital signal processing chip (DSP) or an encoding library, and is transmitted to the processor (Central Processing Unit, CPU) of the mobile device through the data bus. processing, it can be displayed on the display screen of the electronic device.
需要说明的是,预览是相对于拍照而言的,该预览图像数据是在拍照存储之前提供给用户调整、选择用的图像数据,保存在缓存中。It should be noted that the preview is relative to photographing, and the preview image data is image data provided to the user for adjustment and selection before the photographing is stored, and is stored in the cache.
摄像头所采集的是一系列的预览图像数据,即多帧的预览图像数据,本发明实施例中,可以在摄像头不断采集预览图像数据的同时,不断进行声场角和偏向角的计算,直至用户拍照。What the camera collects is a series of preview image data, that is, multiple frames of preview image data. In the embodiment of the present invention, while the camera continuously collects the preview image data, the calculation of the sound field angle and the deflection angle can be continuously performed until the user takes a picture. .
当然,还可以提供一个选择控件,用户可以通过该选择控件选择是否在拍照时定向输出音频,本发明实施例在确定预览图像数据中的一个或多个目标对象之前,可以判断该选择控件的状态,若选择控件的状态为选择定向输出音频,则可以继续执行确定预览图像数据中的一个或多个目标对象的步骤,若选择控件的状态为不定向输出音频,则可以不执行确定预览图像数据中的一个或多个目标对象的步骤,以减少电子设备的资源消耗。Of course, a selection control can also be provided, through which the user can choose whether to output audio in a direction when taking pictures. In this embodiment of the present invention, before determining one or more target objects in the preview image data, the state of the selection control can be judged , if the state of the selection control is to select the directional output audio, you can continue to perform the step of determining one or more target objects in the preview image data; if the state of the selection control is to output the audio in an undirected manner, you may not perform the step of determining the preview image data One or more target objects in the steps to reduce the resource consumption of the electronic device.
在本发明的一种优选实施例中,步骤101可以包括如下子步骤:In a preferred embodiment of the present invention, step 101 may include the following sub-steps:
子步骤S11,检测所述预览图像数据中的人脸,,确定为一个或多个目标对象。Sub-step S11, detecting the human face in the preview image data, and determining it as one or more target objects.
一般而言,摄像头在采集预览图像数据时,可以通过人脸检测进行自动对焦,所谓人脸检测可以是指从一帧预览图像数据中标定出所有人脸的位置和尺寸。Generally speaking, when the camera collects preview image data, it can automatically focus through face detection. The so-called face detection may refer to calibrating the position and size of all faces from a frame of preview image data.
则在本发明实施例中,可以将检测成功的对象认定为目标对象,该目标对象实际所映射的被拍照者可以为人。In this embodiment of the present invention, the successfully detected object may be identified as the target object, and the person to be photographed actually mapped by the target object may be a person.
进一步而言,以Android(安卓)系统为例,在Android(安卓)系统中提供了两个抓哟的API(Application Program Interface,应用程序编程接口),android.media.FaceDetector和android.media.FaceDetector.Face,实现在位图上进行人脸检测。Further, taking the Android (Android) system as an example, the Android (Android) system provides two APIs (Application Program Interface, application programming interface), android.media.FaceDetector and android.media.FaceDetector .Face, which implements face detection on a bitmap.
在本发明的另一种优选实施例中,步骤101可以包括如下子步骤:In another preferred embodiment of the present invention, step 101 may include the following sub-steps:
子步骤S11,当接收到对焦操作指示时,确定所述对焦操作指示对应的、在所述预览图像数据中的一个或多个人脸为一个或多个目标对象;Sub-step S11, when receiving a focus operation instruction, determine that one or more faces in the preview image data corresponding to the focus operation instruction are one or more target objects;
在本发明实施例中,用户可以进行手动对焦,通过点击预览图像数据、选择对焦框等操作触发对焦操作指示,摄像头可以按照该对焦操作指示,对用户选定的对象进行对焦操作。In this embodiment of the present invention, the user can manually focus, and the focus operation instruction is triggered by clicking on the preview image data, selecting the focus frame, etc., and the camera can focus on the object selected by the user according to the focus operation instruction.
则在本发明实施例中,可以将对焦操作指示对应的对象认定为目标对象,该目标对象实际所映射的被拍照者可以为人、也可以为动物、还可以为静物。In this embodiment of the present invention, the object corresponding to the focus operation instruction may be identified as the target object, and the person to be photographed actually mapped by the target object may be a person, an animal, or a still life.
或,or,
子步骤S12,当接收到取消操作指示时,取消已确定的一个或多个目标对象。Sub-step S12, when a cancellation operation instruction is received, cancel one or more target objects that have been determined.
在摄像头自动对焦识别的人不是所需的被拍摄者等情况下,用户可以通过点击目标对象等方式触发取消操作指示,取消该目标对象。When the person recognized by the camera's automatic focus is not the desired person to be photographed, etc., the user can trigger the cancellation operation instruction by clicking on the target object, etc., to cancel the target object.
在具体实现中,在预览图像数据中确定的目标对象可以为一个,也可以是多个(即两个或两个以上),本发明实施例对此不加以限制。In a specific implementation, the target object determined in the preview image data may be one or multiple (ie, two or more), which is not limited in this embodiment of the present invention.
步骤102,对所述一个或多个目标对象计算相对于扬声器的声场角;Step 102, calculating the sound field angle relative to the speaker for the one or more target objects;
扬声器,可以为输出音频的硬件,如微型压电薄膜超声传感器。Speakers can be hardware that outputs audio, such as tiny piezoelectric thin-film ultrasonic sensors.
假设在扬声器定向输出音频时,在某个范围内被拍摄者能听到该音频,该范围外其他人一般不能听到该音频,则该范围相对于扬声器的角度可以称为声场角。Assuming that when the speaker outputs audio directionally, the subject can hear the audio within a certain range, and other people outside the range generally cannot hear the audio, then the angle of the range relative to the speaker can be called the sound field angle.
即如图2A和图2B所示,声场角R,可以为扬声器201在输出音频的情况下,所能听到音频的角度范围。That is, as shown in FIG. 2A and FIG. 2B , the sound field angle R may be the angle range within which the speaker 201 can hear audio when the speaker 201 outputs audio.
在本发明的一种优选实施例中,步骤102可以包括如下子步骤:In a preferred embodiment of the present invention, step 102 may include the following sub-steps:
子步骤S21,测量扬声器与所述一个或多个目标对象之间的目标距离;Sub-step S21, measuring the target distance between the speaker and the one or more target objects;
需要说明的是,目标距离是指扬声器与目标对象整体之间的直线距离,并非一定指扬声器与某个目标对象之间的直线距离。It should be noted that the target distance refers to the straight-line distance between the speaker and the entire target object, and does not necessarily refer to the straight-line distance between the speaker and a certain target object.
在本发明实施例的一种优选示例中,子步骤S21进一步可以包括如下子步骤:In a preferred example of the embodiment of the present invention, sub-step S21 may further include the following sub-steps:
子步骤S211,当所述目标对象为一个时,获取摄像头与所述目标对象之间的候选距离,作为目标距离;Sub-step S211, when the target object is one, obtain the candidate distance between the camera and the target object as the target distance;
或者,or,
子步骤S212,当所述目标对象为多个时,分别获取摄像头与所述多个目标对象之间的多个候选距离;Sub-step S212, when there are multiple target objects, obtain a plurality of candidate distances between the camera and the multiple target objects respectively;
子步骤S213,采用所述多个候选距离计算目标距离。Sub-step S213, calculating the target distance by using the plurality of candidate distances.
由于摄像头与扬声器都配置在同一个电子设备中,两者之间的差距一般很小,因此,摄像头与目标对象之间的候选距离(两者之间的直线距离),和,扬声器与目标对象之间的候选距离(两者之间的直线距离)的差异很小,一般在可接受的差异范围内。Since both the camera and the speaker are configured in the same electronic device, the gap between the two is generally small. Therefore, the candidate distance between the camera and the target object (the straight-line distance between the two), and the speaker and the target object The difference between the candidate distances (the straight-line distance between the two) is small, generally within the acceptable difference range.
并且,通过预览图像数据计算摄像头与目标对象之间的候选距离,因此,在本示例中,为了避免添加额外的硬件,可以将摄像头与目标对象之间的候选距离,替换为,扬声器与目标对象之间的候选距离。And, the candidate distance between the camera and the target object is calculated from the preview image data. Therefore, in this example, in order to avoid adding additional hardware, the candidate distance between the camera and the target object can be replaced by the speaker and the target object. candidate distance between.
当目标对象为单个时,可以将摄像头与目标对象之间的候选距离直接设置为扬声器与目标对象之间的目标距离。When the target object is single, the candidate distance between the camera and the target object can be directly set as the target distance between the speaker and the target object.
当目标对象为多个时,可以采用摄像头与多个目标对象之间的多个候选距离计算扬声器与目标对象之间的目标距离,如计算多个候选距离平均值、选取多个候选距离种的最大值、选取多个候选距离中的最小值等等,本发明实施例对此不加以限制。When there are multiple target objects, multiple candidate distances between the camera and multiple target objects can be used to calculate the target distance between the speaker and the target object, such as calculating the average value of multiple candidate distances, selecting multiple candidate distances The maximum value, selecting the minimum value among multiple candidate distances, etc., are not limited in this embodiment of the present invention.
进一步而言,可以通过以下的一种或多种方式计算摄像头与目标对象之间的候选距离:Further, the candidate distance between the camera and the target object can be calculated in one or more of the following ways:
1、立体视觉。1. Stereoscopic vision.
模仿人类的立体感知分析方法,将双目或多目摄像头在不同视点观察同一目标对象,获取在不同视角下的目标对象的二维图像,通过三角测量原理计算图像像素的位置偏差即视差,来获取目标对象的三维信息。It imitates the human stereo perception analysis method, observes the same target object with binocular or multi-eye cameras from different viewpoints, obtains two-dimensional images of the target object from different viewpoints, and calculates the positional deviation of the image pixels through the principle of triangulation. Obtain the 3D information of the target object.
2、运动测距法。2. Motion ranging method.
用弹幕摄像头在不同时间或不同的空间位置获取连续的目标对象的二维图像,通过目标对象在二维图像序列的时间或空间变化计算出目标对象的距离和其他参数。The bullet screen camera is used to obtain continuous two-dimensional images of the target object at different times or different spatial positions, and the distance and other parameters of the target object are calculated through the time or space changes of the target object in the two-dimensional image sequence.
3、单目测距。3. Monocular ranging.
单目测距中基于图像处理的测距方法有:对焦测距法(Depth from Focus,DFF)和散焦测距法(Depth from Defocus,DFD)。The ranging methods based on image processing in monocular ranging include: focus ranging (Depth from Focus, DFF) and defocus ranging (Depth from Defocus, DFD).
对焦测距法是通过调节光写参数拍摄一系列的图像数据,在这些图像数据中找出最清晰的图像数据,根据这种图像数据的拍摄参数,利用几何光学的成像原理,计算出距离。The focus ranging method is to shoot a series of image data by adjusting the optical writing parameters, find the clearest image data in these image data, and calculate the distance according to the shooting parameters of this image data and using the imaging principle of geometric optics.
散焦测距法是根据物体散焦程度越大、图像越模糊的原理,利用在不同光学参数下拍摄的两帧或三帧图像数据来确定散焦点扩散函数的扩散参数,根据散焦扩散参数与目标对象距离的关系来进行深度计算。The defocus ranging method is based on the principle that the greater the degree of defocusing of the object, the more blurred the image, and the use of two or three frames of image data captured under different optical parameters to determine the diffusion parameters of the defocusing point diffusion function, according to the defocusing diffusion parameters. The relationship with the distance to the target object is used for depth calculation.
当然,上述计算方式只是作为示例,在实施本发明实施例时,可以根据实际情况设置其他计算方式,本发明实施例对此不加以限制。另外,除了上述计算方式外,本领域技术人员还可以根据实际需要采用其它计算方式,本发明实施例对此也不加以限制。Of course, the above calculation methods are only examples. When implementing the embodiments of the present invention, other calculation methods may be set according to actual conditions, which are not limited in the embodiments of the present invention. In addition, in addition to the above calculation methods, those skilled in the art may also adopt other calculation methods according to actual needs, which are not limited in this embodiment of the present invention.
此外,除了复用摄像头与目标对象之间的候选距离,还可以直接通过主动测距法测量扬声器与目标对象之间的候选距离,即使用激光等波束或具有一定纹理结构的光找事目标对象,通过分析目标对象反射光的纹理形变或测量光速的传播时间来确定物体的距离,本发明实施例对此亦不加以限制。In addition, in addition to multiplexing the candidate distance between the camera and the target object, the candidate distance between the speaker and the target object can also be directly measured by the active ranging method, that is, using a beam such as a laser or a light with a certain texture structure to find the target object, The distance of the object is determined by analyzing the texture deformation of the reflected light of the target object or measuring the propagation time of the speed of light, which is not limited in this embodiment of the present invention.
子步骤S22,获取与所述一个或多个目标对象匹配的试听范围距离;Sub-step S22, obtaining the audition range distance matched with the one or more target objects;
假设在定向输出音频时,在某个范围内能听到该音频,该范围外一般不能听到该音频,则该范围的距离称为试听范围距离。Assuming that the audio can be heard within a certain range when the audio is directionally output, the audio can generally not be heard outside the range, then the distance of this range is called the audition range distance.
即试听范围距离,可以为能听到定向输出音频的范围的距离。That is, the distance of the audition range, which can be the distance of the range in which the directional output audio can be heard.
应用本发明实施例,可以预先按照目标对象设置匹配的试听范围距离,例如,一个目标对象的试听范围为35cm,两个目标对象的试听范围为45cm等等。Applying the embodiment of the present invention, the matching audition range distance can be set in advance according to the target object. For example, the audition range of one target object is 35cm, and the audition range of two target objects is 45cm.
当然,还可以根据焦距、目标对象在预览图像数据中的差距计算一个合适的试听范围距离,等等,本发明实施例对此不加以限制Of course, a suitable audition range distance can also be calculated according to the focal length, the distance between the target object and the preview image data, and so on, which is not limited in this embodiment of the present invention
子步骤S23,根据所述目标距离和所述试听范围距离计算声场角。Sub-step S23: Calculate the sound field angle according to the target distance and the audition range distance.
在具体实现中,可以采用目标距离和试听范围距离,按照三角函数关系计算声场角。In the specific implementation, the target distance and the audition range distance can be used to calculate the sound field angle according to the trigonometric function relationship.
在一个实施例中,以目标距离为高、以试听范围距离为底,构建等腰三角形,按照以下三角函数关系计算声场角:In one embodiment, an isosceles triangle is constructed with the target distance as the height and the audition range as the base, and the sound field angle is calculated according to the following trigonometric function relationship:
tanR/2=(K/2)/LtanR/2=(K/2)/L
其中,R为声场角,K为试听范围距离,L为目标距离。Among them, R is the sound field angle, K is the audition range distance, and L is the target distance.
当然,除了正切tan函数之外,还可以采用其他三角函数关系计算声场角,本发明实施例对此不加以限制。Of course, in addition to the tangent tan function, other trigonometric function relationships can also be used to calculate the sound field angle, which is not limited in this embodiment of the present invention.
例如,如图3A所示,在目标对象为一个时,测得摄像头与目标对象的候选距离为L0,即可以认为扬声器301与目标对象的目标距离为L0,一个目标对象的试听范围距离为K0,则以目标距离L0为高、以试听范围距离K0为底,构建等腰三角形,按照以下三角函数关系计算声场角R0:For example, as shown in FIG. 3A , when there is one target object, the measured candidate distance between the camera and the target object is L 0 , that is, it can be considered that the target distance between the speaker 301 and the target object is L 0 , and the audition range distance of one target object is L 0 . is K 0 , then take the target distance L 0 as the height and the audition range distance K 0 as the base to construct an isosceles triangle, and calculate the sound field angle R 0 according to the following trigonometric function relationship:
tanR0/2=(K0/2)/L0 tanR 0 /2=(K 0 /2)/L 0
又例如,如图3B所示,在目标对象为三个时,测得摄像头与目标对象的候选距离分布为L2、L3、L4,即扬声器301与目标对象的目标距离L1=(L2+L3+L4)/3,三个目标对象的试听范围距离为K1,则以目标距离L1为高、以试听范围距离K1为底,构建等腰三角形,按照以下三角函数关系计算声场角R1:For another example, as shown in FIG. 3B , when there are three target objects, the distribution of candidate distances between the camera and the target object is measured as L 2 , L 3 , and L 4 , that is, the target distance between the speaker 301 and the target object L 1 =( L 2 +L 3 +L 4 )/3, the audition range distance of the three target objects is K 1 , then take the target distance L 1 as the height and the audit range distance K 1 as the base to construct an isosceles triangle, according to the following triangle The functional relationship calculates the sound field angle R 1 :
tanR1/2=(K1/2)/L1 tanR 1 /2=(K 1 /2)/L 1
步骤103,对所述一个或多个目标对象计算相对于扬声器的偏向角;Step 103, calculating the deflection angle relative to the speaker for the one or more target objects;
如图2A和图2B所示,偏向角S,可以为目标对象实际所映射的被拍摄者偏离扬声器201正向方向的角度。As shown in FIG. 2A and FIG. 2B , the deflection angle S may be the angle at which the person being photographed deviates from the forward direction of the speaker 201 actually mapped by the target object.
在本发明的一种优选实施例中,步骤103可以包括如下子步骤:In a preferred embodiment of the present invention, step 103 may include the following sub-steps:
子步骤S31,将所述预览图像中的目标对象投影到预设的坐标系中,所述坐标系基于扬声器的位置构建;Sub-step S31, project the target object in the preview image into a preset coordinate system, and the coordinate system is constructed based on the position of the speaker;
由于摄像头采集的预览图像数据与实际的景物一般是等比例的,因此,在预览图像数据中目标对象偏离扬声器的角度与实际中目标对象所映射的被拍摄者相对于扬声器的偏向角的值一般是一样的。Since the preview image data collected by the camera is generally proportional to the actual scene, the angle of the target object deviating from the speaker in the preview image data is generally the same as the deviation angle of the subject relative to the speaker mapped by the target object in practice. it's the same.
应用本发明实施例,可以预先基于扬声器的位置构建坐标系。By applying the embodiment of the present invention, a coordinate system can be constructed based on the position of the speaker in advance.
需要说明的是,扬声器与出声孔(电子设备外壳上的孔,扬声器发出的音频可以通过该出声孔进行传播)的位置通常是相对的,扬声器在电子设备上的投影位置(即以电子设备的背面作为投影面,将扬声器投影至该投影面的位置)与出声孔经常是重合的,因此,也可以基于出声孔直接构建坐标系。It should be noted that the positions of the speaker and the sound outlet (a hole on the housing of the electronic device through which the audio from the speaker can be transmitted) are usually opposite, and the projection position of the speaker on the electronic device (that is, the position of the speaker on the electronic device The back of the device is used as a projection surface, and the position where the speaker is projected onto the projection surface) often coincides with the sound outlet. Therefore, a coordinate system can also be directly constructed based on the sound outlet.
其中,投影为投射线通过物体(如扬声器),向选定的投影面投射,并在该面上得到图形的方法。Among them, the projection is a method in which the projection line passes through an object (such as a speaker), and is projected onto a selected projection surface, and a figure is obtained on this surface.
本发明实施例中,可以以扬声器或出声孔为原点,构建坐标系,如直角坐标系。In this embodiment of the present invention, a coordinate system, such as a rectangular coordinate system, may be constructed with the speaker or the sound outlet as the origin.
以该坐标系的平面为投影平面,将预览图像中的目标对象投影到该坐标系中,进行偏向角的计算。Using the plane of the coordinate system as the projection plane, project the target object in the preview image into the coordinate system to calculate the deflection angle.
子步骤S32,在所述坐标系中,计算所述一个或多个目标对象的焦点坐标;Sub-step S32, in the coordinate system, calculate the focus coordinates of the one or more target objects;
焦点坐标,可以为在对目标对象进行对焦操作时焦点的坐标。The focus coordinates can be the coordinates of the focus when the focus operation is performed on the target object.
在本发明实施例的一种优选示例中,子步骤S32进一步可以包括如下子步骤:In a preferred example of the embodiment of the present invention, sub-step S32 may further include the following sub-steps:
子步骤S321,当所述目标对象为一个时,查找所述目标对象左上角的第一坐标、右下角的第二坐标;Sub-step S321, when the target object is one, search for the first coordinate of the upper left corner of the target object and the second coordinate of the lower right corner;
子步骤S322,计算所述第一坐标和所述第二坐标的平均值,作为焦点坐标;Sub-step S322, calculating the average value of the first coordinate and the second coordinate as the focus coordinate;
在本示例中,目标对象为一个区域,则可以以该区域的中点作为焦点坐标。In this example, the target object is an area, and the midpoint of the area can be used as the focus coordinate.
或者,or,
子步骤S323,当所述目标对象为多个时,查找最左侧的目标对象左上角的第三坐标、右下角的第四坐标,及,最右侧的目标对象左上角的第五坐标、右下角的第六坐标;Sub-step S323, when the target object is multiple, find the third coordinate of the upper left corner of the leftmost target object, the fourth coordinate of the lower right corner, and the fifth coordinate of the upper left corner of the rightmost target object, The sixth coordinate of the lower right corner;
子步骤S324,分别计算所述第三坐标和所述第四坐标的平均值,及,所述第五坐标和所述第六坐标的平均值,作为焦点坐标。Sub-step S324: Calculate the average value of the third coordinate and the fourth coordinate, and the average value of the fifth coordinate and the sixth coordinate, respectively, as focus coordinates.
在本示例中,目标对象为一个区域,则可以以该区域的中点作为焦点坐标。In this example, the target object is an area, and the midpoint of the area can be used as the focus coordinate.
若具有多个目标对象,则可以计算最左侧的目标对象的焦点坐标和最右侧的目标对象的焦点坐标,共两个焦点坐标。If there are multiple target objects, the focus coordinates of the leftmost target object and the focus coordinates of the rightmost target object can be calculated, and there are two focus coordinates in total.
子步骤S33,采用所述焦点坐标计算偏向角。In sub-step S33, the deflection angle is calculated using the focus coordinates.
在具体实现中,可以采用焦点坐标按照三角函数关系计算偏向角。In a specific implementation, the focal coordinates can be used to calculate the deflection angle according to the trigonometric function relationship.
在本发明实施例的一种优选示例中,当目标对象为一个时,可以以焦点坐标的X轴坐标的值和Y轴坐标的值为直角边,构建直角三角形,按照以下三角函数关系计算偏向角:In a preferred example of the embodiment of the present invention, when there is one target object, a right-angled triangle can be constructed with the value of the X-axis coordinate of the focus coordinate and the value of the Y-axis coordinate as a right-angled side, and the bias is calculated according to the following trigonometric function relationship horn:
tanS=X0/Y0 tanS=X 0 /Y 0
其中,S为偏向角,X0为焦点坐标的X轴坐标的值,Y0为焦点坐标的Y轴坐标的值。Among them, S is the deflection angle, X 0 is the value of the X-axis coordinate of the focus coordinate, and Y 0 is the value of the Y-axis coordinate of the focus coordinate.
当然,除了正切tan函数之外,还可以采用其他三角函数关系计算偏向角,本发明实施例对此不加以限制。Certainly, in addition to the tangent tan function, other trigonometric function relationships may also be used to calculate the deflection angle, which is not limited in this embodiment of the present invention.
在本发明实施例的另一种优选示例中,子步骤S33进一步可以包括如下子步骤:In another preferred example of the embodiment of the present invention, sub-step S33 may further include the following sub-steps:
子步骤S331,当所述目标对象为多个时,采用最左侧的目标对象的焦点坐标计算第一候选偏向角;Sub-step S331, when there are multiple target objects, use the focus coordinates of the leftmost target object to calculate the first candidate deflection angle;
子步骤S332,采用最右侧的目标对象的焦点坐标计算第二候选偏向角;Sub-step S332, using the focus coordinates of the rightmost target object to calculate the second candidate deflection angle;
子步骤S333,若最左侧的目标对象和最右侧的目标对象位于扬声器的两侧,则将第一特征角度设置为偏向角;Sub-step S333, if the leftmost target object and the rightmost target object are located on both sides of the speaker, set the first characteristic angle as the deflection angle;
其中,所述第一特征角度为所述第一候选偏向角与所述第二候选偏向角之差的一半;Wherein, the first characteristic angle is half of the difference between the first candidate deflection angle and the second candidate deflection angle;
子步骤S334,若最左侧的目标对象和最右侧的目标对象位于扬声器的同一侧,则将第二特征角度设置为偏向角;Sub-step S334, if the leftmost target object and the rightmost target object are located on the same side of the speaker, set the second characteristic angle as the deflection angle;
其中,所述第二特征角度为所述第一候选偏向角与所述第二候选偏向角之和的一半。Wherein, the second characteristic angle is half of the sum of the first candidate deflection angle and the second candidate deflection angle.
在本示例中,对于每个焦点坐标,可以以焦点坐标的X坐标的值和Y坐标的值为直角边,构建直角三角形,按照三角函数关系计算第一候选偏向角、第二候选偏向角,若最左侧的目标对象和最右侧的目标对象分别位于扬声器正向方向的两侧,则偏向角:In this example, for each focus coordinate, a right-angled triangle can be constructed with the value of the X coordinate and the value of the Y coordinate of the focus coordinate as a right-angled side, and the first candidate deflection angle and the second candidate deflection angle are calculated according to the trigonometric function relationship, If the leftmost target object and the rightmost target object are located on both sides of the forward direction of the speaker, the deflection angle is:
S=(S1-S2)/2S=(S 1 -S 2 )/2
若最左侧的目标对象和最右侧的目标对象分别位于扬声器正向方向的同一侧(如左侧或右侧),则偏向角:If the leftmost target object and the rightmost target object are located on the same side (such as left or right) in the forward direction of the speaker, the deflection angle is:
S=(S1+S2)/2S=(S 1 +S 2 )/2
其中,S为偏向角,S1为第一候选偏向角,S2为第二候选偏向角。Wherein, S is the deflection angle, S1 is the first candidate deflection angle, and S2 is the second candidate deflection angle.
需要说明的是,上述计算It should be noted that the above calculation
例如,如图4A所示,以扬声器的投影O为圆点,构建XY坐标系,当目标对象为一个时,该目标对象的左上角为点A(X1,Y1),右下角为点B(X2,Y2),则焦点坐标U((X1+X2)/2,(Y1+Y2)/2),则以焦点坐标U的X轴坐标(X1+X2)/2和Y轴坐标(Y1+Y2)/2为直角边,构建直角三角形,按照以下三角函数关系计算偏向角S3:For example, as shown in Fig. 4A, the XY coordinate system is constructed by taking the projection O of the speaker as a dot, and when there is one target object, the upper left corner of the target object is point A (X 1 , Y 1 ), and the lower right corner is the point B(X 2 , Y 2 ), then the focus coordinate U((X 1 +X 2 )/2, (Y 1 +Y 2 )/2), then the X-axis coordinate of the focus coordinate U (X 1 +X 2 )/2 and the Y-axis coordinates (Y 1 +Y 2 )/2 are right-angled sides, construct a right-angled triangle, and calculate the deflection angle S 3 according to the following trigonometric function:
tanS3=(X1+X2)/2/(Y1+Y2)/2;tanS 3 =(X 1 +X 2 )/2/(Y 1 +Y 2 )/2;
又例如,如图4B所示,以扬声器的投影O为圆点,构建XY坐标系,当目标对象为三个时,最左侧的目标对象的左上角为点C(X3,Y3),右下角为点D(X4,Y4),则焦点坐标V((X3+X4)/2,(Y3+Y4)/2),最右侧的目标对象的左上角为点E(X5,Y5),右下角为点F(X6,Y7),则焦点坐标W((X5+X6)/2,(Y5+Y6)/2);For another example, as shown in FIG. 4B , the XY coordinate system is constructed by taking the projection O of the speaker as a dot, and when there are three target objects, the upper left corner of the leftmost target object is point C (X 3 , Y 3 ) , the lower right corner is point D(X 4 , Y 4 ), then the focus coordinates V((X 3 +X 4 )/2, (Y 3 +Y 4 )/2), the upper left corner of the rightmost target object is Point E(X 5 , Y 5 ), the lower right corner is point F (X 6 , Y 7 ), then the focus coordinates W((X 5 +X 6 )/2, (Y 5 +Y 6 )/2);
则分别以焦点坐标V的X轴坐标(X3+X4)/2和Y轴坐标(Y3+Y4)/2为直角边,以及,焦点坐标W的X轴坐标(X5+X6)/2和Y轴坐标(Y5+Y6)/2为直角边,构建直角三角形,按照以下三角函数关系计算第一候选偏向角S5和第二候选偏向角S6:Then take the X-axis coordinates (X 3 +X 4 )/2 and Y-axis coordinates (Y 3 +Y 4 )/2 of the focus coordinate V as the right-angled sides, and the X-axis coordinates (X 5 +X of the focus coordinate W) 6 )/2 and the Y-axis coordinates (Y 5 +Y 6 )/2 are right-angled sides, construct a right-angled triangle, and calculate the first candidate deflection angle S 5 and the second candidate deflection angle S 6 according to the following trigonometric function relationship:
tanS5=(X3+X4)/2/(Y3+Y4)/2;tanS 5 =(X 3 +X 4 )/2/(Y 3 +Y 4 )/2;
tanS6=(X5+X6)/2/(Y5+Y6)/2;tanS 6 =(X 5 +X 6 )/2/(Y 5 +Y 6 )/2;
假设S5为30°,S6为50°,则偏向角S4=(S6-S5)/2=10°,表示对三个目标对象整体向扬声器的右侧偏离10°。Assuming that S 5 is 30° and S 6 is 50°, the deflection angle S 4 =(S 6 -S 5 )/2=10°, which means that the three target objects are deviated by 10° to the right of the speaker as a whole.
又例如,如图4C所示,以扬声器的投影O为圆点,构建XY坐标系,当目标对象为三个时,最左侧的目标对象的左上角为点G(X7,Y7),右下角为点H(X8,Y8),则焦点坐标为M((X7+X8)/2,(Y7+Y8)/2),最右侧的目标对象的左上角为点I(X9,Y9),右下角为点J(X10,Y10),则焦点坐标为N((X9+X10)/2,(Y9+Y10)/2);For another example, as shown in FIG. 4C , the XY coordinate system is constructed by taking the projection O of the speaker as a dot, and when there are three target objects, the upper left corner of the leftmost target object is point G (X 7 , Y 7 ) , the lower right corner is the point H(X 8 , Y 8 ), then the focus coordinates are M((X 7 +X 8 )/2, (Y 7 +Y 8 )/2), the upper left corner of the rightmost target object is point I(X 9 , Y 9 ), and the lower right corner is point J(X 10 , Y 10 ), then the focus coordinates are N((X 9 +X 10 )/2, (Y 9 +Y 10 )/2) ;
则分别以焦点坐标V的X轴坐标(X7+X8)/2和Y轴坐标(Y7+Y8)/2为直角边,以及,焦点坐标W的X轴坐标(X9+X10)/2和Y轴坐标(Y9+Y10)/2为直角边,构建直角三角形,按照以下三角函数关系计算第一候选偏向角S8和第二候选偏向角S9:Then take the X-axis coordinates (X 7 +X 8 )/2 and Y-axis coordinates (Y 7 +Y 8 )/2 of the focus coordinate V as the right-angled sides, and the X-axis coordinates (X 9 +X of the focus coordinate W) 10 )/2 and the Y-axis coordinates (Y 9 +Y 10 )/2 are right-angled sides, construct a right-angled triangle, and calculate the first candidate deflection angle S 8 and the second candidate deflection angle S 9 according to the following trigonometric function relationship:
tanS8=(X7+X8)/2/(Y7+Y8)/2;tanS 8 =(X 7 +X 8 )/2/(Y 7 +Y 8 )/2;
tanS9=(X9+X10)/2/(Y9+Y10)/2;tanS 9 =(X 9 +X 10 )/2/(Y 9 +Y 10 )/2;
假设S8为50°,S9为30°,则偏向角S7=(S8+S9)/2=40°,表示对三个目标对象整体向扬声器的右侧偏离40°。Assuming that S 8 is 50° and S 9 is 30°, the deflection angle S 7 =(S 8 +S 9 )/2=40°, which means that the three target objects are deviated by 40° to the right of the speaker as a whole.
步骤104,当接收到拍照指示时,驱动扬声器按照所述声场角和所述偏向角定向输出音频。Step 104, when receiving the photographing instruction, drive the speaker to output audio directionally according to the sound field angle and the deflection angle.
在具体实现中,用户可以通过点击拍照控件、在预览图像数据上点击等操作触发拍照指示,摄像头进行拍照处理,同时,驱动扬声器按照声场角和偏向角定向输出音频,即向目标对象所在的实际区域发出拍照提示声,以提示被拍照者正在进行拍照。In the specific implementation, the user can trigger the photographing instruction by clicking the photographing control, clicking on the preview image data, etc., and the camera performs the photographing process. The area emits a photo prompt sound to remind the person being photographed that the photo is being taken.
定向输出音频,可以通过利用超声波在空气中的非线性传播效应产生高指向性可听声的(即声频定向)。Directional output audio can generate highly directional audible sound (ie, audio directional) by utilizing the nonlinear propagation effect of ultrasonic waves in the air.
根据非线性声学理论,两平面波在不均匀介质中非线性传播,当向超声换能器(扬声器的组件之一)输入两列频率为f1、f2的电信号时,超声换能器通过机械振动向空气中发射两列频率为f1、f2的超声波。当这两列超声波在空气中传播的过程中将产生非线性交互作用,从而生成了包括基频f1、f2,其和频f1+f2、差频f1-f2及各阶谐波在内的复杂声波。由于声衰系数α与频率的平方成正比,频率较高的超声波信号f1、f2、f1+f2及各次谐波将很快被空气吸收掉,剩下处于声频范围内的差频信号f1-f2在空气中继续传播。According to the nonlinear acoustic theory, two plane waves propagate nonlinearly in an inhomogeneous medium. When two series of electrical signals with frequencies f 1 and f 2 are input to the ultrasonic transducer (one of the components of the loudspeaker), the ultrasonic transducer passes through The mechanical vibration emits two series of ultrasonic waves with frequencies f 1 and f 2 into the air. When the two series of ultrasonic waves propagate in the air, there will be nonlinear interaction, thus generating fundamental frequencies f 1 , f 2 , sum frequency f 1 +f 2 , difference frequency f 1 -f 2 and various orders Complex sound waves including harmonics. Since the sound attenuation coefficient α is proportional to the square of the frequency, the ultrasonic signals f 1 , f 2 , f 1 +f 2 and the harmonics with higher frequencies will be quickly absorbed by the air, leaving the difference in the audio frequency range. The frequency signals f 1 -f 2 continue to propagate in the air.
声波是否具有指向性,与声波波长和声源尺寸的比率密切相关。当声波波长远大于声源尺寸时,声波没有指向性;当声波波长接近直至远小于声源尺寸时,声波将逐渐呈现出越来越强的指向性。因此,当贺礼选择超声频率f1、f2时,可使差频信号f1-f2处于可听范围内,从而通过超声波产生声频波。Whether a sound wave has directivity is closely related to the ratio of the wavelength of the sound wave to the size of the sound source. When the wavelength of the sound wave is much larger than the size of the sound source, the sound wave has no directivity; when the wavelength of the sound wave is close to or much smaller than the size of the sound source, the sound wave will gradually show stronger and stronger directivity. Therefore, when the ultrasonic frequencies f 1 and f 2 are selected for the gift, the difference frequency signals f 1 -f 2 can be in the audible range, so as to generate sound waves through ultrasonic waves.
进一步而言,在参数声学阵理论中,超声换能器(扬声器的组件之一)向空气介质中发出强烈调制的超声波,超声波在沿其传播主轴方向(如声场角、偏向角指向的方向)行进的过程中不断通过非线性交互作用调制出声频信号,这些不断解调出来的声频波累积叠加起来,由此一个端射式虚拟声源阵列(end-fire vitual arrray)通过这种方式实现了。这个虚拟声源阵列即所谓的参量声学阵,参量声学阵使得声频波的能量在声波前进方向上不断得到加强。由于超声波具有很强的指向性,传播主轴方向(如声场角、偏向角指向的方向)以外这种叠加加强效应会很微弱,这最终使得声频波在主传播轴方向(如声场角、偏向角指向的方向)具有了很强的指向性。Further, in the parametric acoustic array theory, the ultrasonic transducer (one of the components of the loudspeaker) emits a strongly modulated ultrasonic wave into the air medium, and the ultrasonic wave propagates along its main axis direction (such as the sound field angle, the direction of the deflection angle) In the process of traveling, the audio signal is continuously modulated through nonlinear interaction, and these continuously demodulated audio waves are accumulated and superimposed, so that an end-fire virtual sound source array (end-fire vitual arrray) is realized in this way . This virtual sound source array is the so-called parametric acoustic array, and the parametric acoustic array makes the energy of the acoustic wave continuously strengthen in the direction of the sound wave. Due to the strong directivity of ultrasonic waves, this superposition enhancement effect will be very weak beyond the direction of the main propagation axis (such as the direction of the sound field angle and the deflection angle), which eventually makes the sound wave in the main propagation axis direction (such as the sound field angle, deflection angle). direction) has a strong directivity.
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。It should be noted that, for the method embodiment, for the sake of simple description, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiment of the present invention is not limited by the described action sequence, because According to the embodiment of the present invention, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
参照图5,示出了本发明的一种基于拍照的音频输出装置实施例的结构框图,具体可以包括如下模块:Referring to FIG. 5, a structural block diagram of an embodiment of an audio output device based on photography of the present invention is shown, which may specifically include the following modules:
目标对象确定模块501,用于在摄像头采集到预览图像数据时,确定所述预览图像数据中的一个或多个目标对象;A target object determination module 501, configured to determine one or more target objects in the preview image data when the camera captures the preview image data;
声场角计算模块502,用于对所述一个或多个目标对象计算相对于扬声器的声场角;a sound field angle calculation module 502, configured to calculate the sound field angle relative to the speaker for the one or more target objects;
偏向角计算模块503,用于对所述一个或多个目标对象计算相对于扬声器的偏向角;a deflection angle calculation module 503, configured to calculate the deflection angle relative to the speaker for the one or more target objects;
音频定向输出模块504,用于在接收到拍照指示时,驱动扬声器按照所述声场角和所述偏向角定向输出音频。The audio directional output module 504 is configured to drive the speaker to directional output audio according to the sound field angle and the deflection angle when receiving the photographing instruction.
在本发明的一种优选实施例中,所述目标对象确定模块501可以包括如下子模块:In a preferred embodiment of the present invention, the target object determination module 501 may include the following sub-modules:
第一确定子模块,用于检测所述预览图像数据中的人脸,确定为一个或多个目标对象。The first determination submodule is used to detect the human face in the preview image data, and determine it as one or more target objects.
在本发明的一种优选实施例中,所述目标对象确定模块501可以包括如下子模块:In a preferred embodiment of the present invention, the target object determination module 501 may include the following sub-modules:
第二确定子模块,用于在接收到对焦操作指示时,确定所述对焦操作指示对应的、在所述预览图像数据中的一个或多个人脸为一个或多个目标对象;a second determination submodule, configured to, when receiving a focus operation instruction, determine that one or more faces in the preview image data corresponding to the focus operation instruction are one or more target objects;
或,or,
取消子模块,用于在接收到取消操作指示时,取消已确定的一个或多个目标对象。The cancellation sub-module is used to cancel one or more target objects that have been determined when a cancellation operation instruction is received.
在本发明的一种优选实施例中,所述声场角计算模块502可以包括如下子模块:In a preferred embodiment of the present invention, the sound field angle calculation module 502 may include the following sub-modules:
目标距离测量子模块,用于测量扬声器与所述一个或多个目标对象之间的目标距离;a target distance measurement submodule for measuring the target distance between the speaker and the one or more target objects;
试听范围距离获取子模块,用于获取与所述一个或多个目标对象匹配的试听范围距离,所述试听范围距离为能听到音频的范围的距离;an audition range distance acquisition sub-module, used for acquiring the audition range distance matched with the one or more target objects, where the audition range distance is the distance of the range where the audio can be heard;
第一计算子模块,用于根据所述目标距离和所述试听范围距离计算声场角。The first calculation submodule is configured to calculate the sound field angle according to the target distance and the audition range distance.
在本发明实施例的一种优选示例中,所述目标距离测量子模块进一步可以包括如下子模块:In a preferred example of the embodiment of the present invention, the target distance measurement submodule may further include the following submodules:
第一获取子模块,用于在所述目标对象为一个时,获取摄像头与所述目标对象之间的候选距离,作为目标距离;The first acquisition submodule is used to acquire the candidate distance between the camera and the target object as the target distance when the target object is one;
或者,or,
第二获取子模块,用于在所述目标对象为多个时,分别获取摄像头与所述多个目标对象之间的多个候选距离;a second obtaining submodule, configured to obtain a plurality of candidate distances between the camera and the plurality of target objects when there are multiple target objects;
第二计算子模块,用于采用所述多个候选距离计算目标距离。The second calculation submodule is configured to calculate the target distance by using the plurality of candidate distances.
在本发明的一种优选实施例中,所述偏向角计算模块503可以包括如下子模块:In a preferred embodiment of the present invention, the deflection angle calculation module 503 may include the following sub-modules:
投影子模块,用于将所述预览图像数据中的目标对象投影到预设的坐标系中,所述坐标系基于扬声器的位置构建;a projection sub-module for projecting the target object in the preview image data into a preset coordinate system, the coordinate system being constructed based on the position of the speaker;
焦点坐标计算子模块,用于在所述坐标系中,计算所述一个或多个目标对象的焦点坐标;a focus coordinate calculation submodule, configured to calculate the focus coordinates of the one or more target objects in the coordinate system;
第三计算子模块,用于采用所述焦点坐标计算偏向角。The third calculation submodule is used for calculating the deflection angle by using the focus coordinates.
在本发明实施例的一种优选示例中,所述焦点坐标计算子模块进一步可以包括如下子模块:In a preferred example of the embodiment of the present invention, the focus coordinate calculation submodule may further include the following submodules:
第一查找子模块,用于在所述目标对象为一个时,查找所述目标对象左上角的第一坐标、右下角的第二坐标;The first search submodule is used to search for the first coordinate of the upper left corner of the target object and the second coordinate of the lower right corner of the target object when the target object is one;
第四计算子模块,用于计算所述第一坐标和所述第二坐标的平均值,作为焦点坐标;a fourth calculation submodule, used for calculating the average value of the first coordinate and the second coordinate as the focus coordinate;
或者,or,
第二查找子模块,用于在所述目标对象为多个时,查找最左侧的目标对象左上角的第三坐标、右下角的第四坐标,及,最右侧的目标对象左上角的第五坐标、右下角的第六坐标;The second search submodule is used to search for the third coordinate of the upper left corner of the leftmost target object, the fourth coordinate of the lower right corner of the leftmost target object, and the upper left corner of the rightmost target object when there are multiple target objects. The fifth coordinate, the sixth coordinate of the lower right corner;
第五计算子模块,用于分别计算所述第三坐标和所述第四坐标的平均值,及,所述第五坐标和所述第六坐标的平均值,作为焦点坐标。The fifth calculation sub-module is configured to calculate the average value of the third coordinate and the fourth coordinate, and the average value of the fifth coordinate and the sixth coordinate, respectively, as the focus coordinate.
在本发明实施例的一种优选示例中,所述第三计算子模块进一步可以包括如下子模块:In a preferred example of the embodiment of the present invention, the third calculation submodule may further include the following submodules:
第一候选偏向角计算子模块,用于在所述目标对象为多个时,采用最左侧的目标对象的焦点坐标计算第一候选偏向角;a first candidate deflection angle calculation submodule, configured to calculate the first candidate deflection angle by adopting the focus coordinates of the leftmost target object when there are multiple target objects;
第二候选偏向角计算子模块,用于采用最右侧的目标对象的焦点坐标计算第二候选偏向角;The second candidate deflection angle calculation submodule is used to calculate the second candidate deflection angle by adopting the focus coordinates of the rightmost target object;
第一设置子模块,用于在最左侧的目标对象和最右侧的目标对象位于扬声器的两侧时,则将第一特征角度设置为偏向角;The first setting submodule is used to set the first characteristic angle as the deflection angle when the leftmost target object and the rightmost target object are located on both sides of the speaker;
第二设置子模块,用于在最左侧的目标对象和最右侧的目标对象位于扬声器的同一侧时,则将第二特征角度设置为偏向角;The second setting submodule is used to set the second characteristic angle as the deflection angle when the leftmost target object and the rightmost target object are located on the same side of the speaker;
其中,所述第一特征角度为所述第一候选偏向角与所述第二候选偏向角之差的一半;所述第二特征角度为所述第一候选偏向角与所述第二候选偏向角之和的一半。Wherein, the first characteristic angle is half of the difference between the first candidate deflection angle and the second candidate deflection angle; the second characteristic angle is the first candidate deflection angle and the second candidate deflection angle half of the sum of the angles.
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for related parts.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments may be referred to each other.
本领域内的技术人员应明白,本发明实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that the embodiments of the embodiments of the present invention may be provided as a method, an apparatus, or a computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like.
本发明实施例是参照根据本发明实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present invention are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present invention. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal equipment to produce a machine that causes the instructions to be executed by the processor of the computer or other programmable data processing terminal equipment Means are created for implementing the functions specified in the flow or flows of the flowcharts and/or the blocks or blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal equipment to operate in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the The instruction means implement the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing terminal equipment, so that a series of operational steps are performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby executing on the computer or other programmable terminal equipment The instructions executed on the above provide steps for implementing the functions specified in the flowchart or blocks and/or the block or blocks of the block diagrams.
尽管已描述了本发明实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明实施例范围的所有变更和修改。Although preferred embodiments of the embodiments of the present invention have been described, additional changes and modifications to these embodiments may be made by those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications that fall within the scope of the embodiments of the present invention.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or terminal device comprising a list of elements includes not only those elements, but also a non-exclusive list of elements. other elements, or also include elements inherent to such a process, method, article or terminal equipment. Without further limitation, an element defined by the phrase "comprises a..." does not preclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.
以上对本发明所提供的一种基于拍照的音频输出方法和一种基于拍照的音频输出装置,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。A photography-based audio output method and a photography-based audio output device provided by the present invention have been described above in detail. In this paper, specific examples are used to illustrate the principles and implementations of the present invention. The above embodiments The description is only used to help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. However, the contents of this specification should not be construed as limiting the present invention.
Claims (12)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510345291.2A CN105827931B (en) | 2015-06-19 | 2015-06-19 | It is a kind of based on the audio-frequency inputting method and device taken pictures |
| PCT/CN2016/080941 WO2016202111A1 (en) | 2015-06-19 | 2016-05-04 | Audio output method and apparatus based on photographing |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510345291.2A CN105827931B (en) | 2015-06-19 | 2015-06-19 | It is a kind of based on the audio-frequency inputting method and device taken pictures |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN105827931A CN105827931A (en) | 2016-08-03 |
| CN105827931B true CN105827931B (en) | 2019-04-12 |
Family
ID=56514385
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510345291.2A Active CN105827931B (en) | 2015-06-19 | 2015-06-19 | It is a kind of based on the audio-frequency inputting method and device taken pictures |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN105827931B (en) |
| WO (1) | WO2016202111A1 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107024990B (en) * | 2017-03-31 | 2019-08-20 | 维沃移动通信有限公司 | A method and mobile terminal for attracting children to take selfies |
| CN112835021B (en) * | 2020-12-31 | 2023-11-14 | 杭州海康威视数字技术股份有限公司 | Positioning method, device, system and computer readable storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102595275A (en) * | 2012-02-29 | 2012-07-18 | 长城汽车股份有限公司 | Vehicle loudspeaker system with adjustable sound field |
| CN102860041A (en) * | 2010-04-26 | 2013-01-02 | 剑桥机电有限公司 | Loudspeakers with position tracking |
| CN102970484A (en) * | 2012-11-27 | 2013-03-13 | 惠州Tcl移动通信有限公司 | Sound prompt method in photographing and electronic equipment based on method |
| CN103337175A (en) * | 2013-06-22 | 2013-10-02 | 太仓博天网络科技有限公司 | Vehicle type recognition system based on real-time video steam |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005295502A (en) * | 2004-03-09 | 2005-10-20 | Yoshito Suzuki | Electronic device with recording and imaging function, device with recording and imaging function, method of using the same, and microphone set used therefor |
| GB0616293D0 (en) * | 2006-08-16 | 2006-09-27 | Imp Innovations Ltd | Method of image processing |
| JP5396769B2 (en) * | 2008-08-04 | 2014-01-22 | セイコーエプソン株式会社 | Audio output control device, audio output device, audio output control method, and program |
| JP2010206451A (en) * | 2009-03-03 | 2010-09-16 | Panasonic Corp | Speaker with camera, signal processing apparatus, and av system |
| JP5395716B2 (en) * | 2010-03-25 | 2014-01-22 | 株式会社デンソーアイティーラボラトリ | Outside sound providing device, outside sound providing method and program |
| JP2014061786A (en) * | 2012-09-21 | 2014-04-10 | Sony Corp | Movable body and program |
| CN103139480A (en) * | 2013-02-28 | 2013-06-05 | 华为终端有限公司 | Image acquisition method and image acquisition device |
| US20150078595A1 (en) * | 2013-09-13 | 2015-03-19 | Sony Corporation | Audio accessibility |
| CN104185116B (en) * | 2014-08-15 | 2018-01-09 | 南京琅声声学科技有限公司 | A kind of method for automatically determining acoustically radiating emission mode |
-
2015
- 2015-06-19 CN CN201510345291.2A patent/CN105827931B/en active Active
-
2016
- 2016-05-04 WO PCT/CN2016/080941 patent/WO2016202111A1/en active Application Filing
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102860041A (en) * | 2010-04-26 | 2013-01-02 | 剑桥机电有限公司 | Loudspeakers with position tracking |
| CN102595275A (en) * | 2012-02-29 | 2012-07-18 | 长城汽车股份有限公司 | Vehicle loudspeaker system with adjustable sound field |
| CN102970484A (en) * | 2012-11-27 | 2013-03-13 | 惠州Tcl移动通信有限公司 | Sound prompt method in photographing and electronic equipment based on method |
| CN103337175A (en) * | 2013-06-22 | 2013-10-02 | 太仓博天网络科技有限公司 | Vehicle type recognition system based on real-time video steam |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105827931A (en) | 2016-08-03 |
| WO2016202111A1 (en) | 2016-12-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12096200B2 (en) | Personalized HRTFs via optical capture | |
| US9516241B2 (en) | Beamforming method and apparatus for sound signal | |
| AU2014203801B2 (en) | Image capture device having tilt and/or perspective correction | |
| US10788317B2 (en) | Apparatuses and devices for camera depth mapping | |
| US20150022636A1 (en) | Method and system for voice capture using face detection in noisy environments | |
| CN105245811B (en) | A kind of kinescope method and device | |
| TW201120469A (en) | Method, computer readable storage medium and system for localizing acoustic source | |
| JP2014523679A (en) | Signal-enhanced beamforming in an augmented reality environment | |
| CN105208287A (en) | Photographing method and device | |
| Martel et al. | Real-time depth from focus on a programmable focal plane processor | |
| CN105827931B (en) | It is a kind of based on the audio-frequency inputting method and device taken pictures | |
| CN105338241A (en) | Shooting method and device | |
| WO2016197444A1 (en) | Method and terminal for achieving shooting | |
| WO2025103219A1 (en) | Camera module, electronic device, focusing method and apparatus, and readable storage medium | |
| CN110225247B (en) | Image processing method and electronic equipment | |
| CN113191976A (en) | Image shooting method, device, terminal and storage medium | |
| CN105389779A (en) | Image correction method, device and mobile terminal | |
| CN107560709B (en) | Method and device for measuring amplitude | |
| JP6882266B2 (en) | Devices and methods for generating data representing pixel beams | |
| CN112330793A (en) | Acquiring method of ear mold 3D model, earphone customization method and computing device | |
| WO2016198014A1 (en) | Focusing imaging device, method, and terminal | |
| WO2016194576A1 (en) | Information processing device and method | |
| CN109923585B (en) | Method and apparatus for depth detection using stereo images | |
| CN113840087B (en) | Sound processing method, sound processing device, electronic equipment and computer readable storage medium | |
| US20210368107A1 (en) | Method, apparatus and computer program product for generating audio signals according to visual content |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |