技术领域technical field
本发明涉及终端技术领域,特别涉及一种拍照方法、装置、存储介质及终端。The present invention relates to the technical field of terminals, in particular to a photographing method, device, storage medium and terminal.
背景技术Background technique
当前,诸如智能手机等移动终端的拍照功能越来越完善。移动终端能够被随身携带,并且随时随地都可以使用移动终端拍照,从而给用户的生活带来很大的便利。Currently, the photographing function of mobile terminals such as smart phones is becoming more and more perfect. The mobile terminal can be carried around, and the mobile terminal can be used to take pictures anytime and anywhere, thereby bringing great convenience to the life of the user.
然而,在使用移动终端进行拍照时,在某些亮度比较低的场景下,需要使用较高的感光度来拍照才能满足拍摄时的曝光需求。但是,使用较高的感光度拍照会使得照片中存在大量的噪点(照片中不期望出现的像素点)。这些噪点的存在,严重影响照片的质量。However, when using a mobile terminal to take pictures, in some scenes with relatively low brightness, it is necessary to use a higher sensitivity to take pictures to meet the exposure requirements during shooting. However, taking a photo with a higher sensitivity will result in a lot of noise (unexpected pixels in the photo) in the photo. The presence of these noises seriously affects the quality of the photo.
发明内容Contents of the invention
本发明实施例提供一种拍照方法、装置、存储介质及终端,可以提高照片的质量。Embodiments of the present invention provide a photographing method, device, storage medium, and terminal, which can improve the quality of photographs.
本发明实施例提供一种拍照方法,包括:An embodiment of the present invention provides a method for taking pictures, including:
当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度;When the ambient brightness value is less than the preset threshold, determine the sensitivity of the camera according to the ambient brightness value;
获取该摄像头在该感光度条件下拍摄的多帧图像;Obtain multiple frames of images captured by the camera under the sensitivity condition;
从该多帧图像中选取至少两帧图像进行合成,以得到第一图像;Selecting at least two frames of images from the multiple frames of images and synthesizing them to obtain a first image;
根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,该第二图像的亮度大于该第一图像的亮度。The brightness of the first image is adjusted according to a preset adjustment parameter to obtain a second image, and the brightness of the second image is greater than the brightness of the first image.
本发明实施例还提供一种拍照装置,包括:An embodiment of the present invention also provides a photographing device, including:
确定模块,用于当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度;A determining module, configured to determine the sensitivity of the camera according to the ambient brightness value when the ambient brightness value is less than a preset threshold;
获取模块,用于获取该摄像头在该感光度条件下拍摄的多帧图像;An acquisition module, configured to acquire multiple frames of images taken by the camera under the sensitivity condition;
合成模块,用于从该多帧图像中选取至少两帧图像进行合成,以得到第一图像;A synthesis module, configured to select at least two frames of images from the multi-frame images for synthesis to obtain a first image;
调节模块,用于根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,该第二图像的亮度大于该第一图像的亮度。An adjustment module, configured to adjust the brightness of the first image according to a preset adjustment parameter to obtain a second image whose brightness is greater than that of the first image.
本发明实施例还提供一种存储介质,该存储介质中存储有多条指令,该指令适于由处理器加载以执行上述拍照方法。An embodiment of the present invention also provides a storage medium, in which a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to execute the above-mentioned photographing method.
本发明实施例还提供一种终端,包括处理器以及存储介质,该存储介质中存储有多条指令,该处理器加载该指令以执行上述拍照方法。An embodiment of the present invention also provides a terminal, including a processor and a storage medium, where a plurality of instructions are stored in the storage medium, and the processor loads the instructions to execute the above-mentioned photographing method.
本发明实施例还提供另一种终端,包括:处理器、存储器、摄像头以及控制电路,该处理器与该存储器、摄像头、控制电路电性连接,该存储器用于存储指令,该控制电路用于控制该摄像头拍摄照片;An embodiment of the present invention also provides another terminal, including: a processor, a memory, a camera, and a control circuit, the processor is electrically connected to the memory, the camera, and the control circuit, the memory is used to store instructions, and the control circuit is used to Control the camera to take photos;
该处理器,用于当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度;The processor is configured to determine the sensitivity of the camera according to the ambient brightness value when the ambient brightness value is less than a preset threshold;
该摄像头,用于在该感光度条件下拍摄多帧图像;The camera is used to capture multiple frames of images under the light sensitivity condition;
该处理器,还用于从该多帧图像中选取至少两帧图像进行合成,以得到第一图像;The processor is also used to select at least two frames of images from the multi-frame images and synthesize them to obtain a first image;
该处理器,还用于根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,该第二图像的亮度大于该第一图像的亮度。The processor is further configured to adjust the brightness of the first image according to preset adjustment parameters to obtain a second image, and the brightness of the second image is greater than the brightness of the first image.
本发明实施例提供的拍照方法,当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度;获取该摄像头在该感光度条件下拍摄的多帧图像;从该多帧图像中选取至少两帧图像进行合成,以得到第一图像;根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,该第二图像的亮度大于该第一图像的亮度。该方案在终端处于较暗的环境时,根据环境亮度值来确定感光度,在拍摄图像时可以减少图像中的噪点,将拍摄的图像进行合成后,对得到的第一图像的亮度进行调节,以提高第一图像的亮度,从而既能够保证图像的亮度,又能够减少图像中的噪点,由此可以提高照片的质量。In the photographing method provided by the embodiment of the present invention, when the ambient brightness value is less than a preset threshold value, the sensitivity of the camera is determined according to the ambient brightness value; multiple frames of images taken by the camera under the sensitivity condition are obtained; from the multiple frames of images At least two frames of images are selected for synthesis to obtain a first image; the brightness of the first image is adjusted according to preset adjustment parameters to obtain a second image, and the brightness of the second image is greater than the brightness of the first image. In this solution, when the terminal is in a dark environment, the sensitivity is determined according to the ambient brightness value, and the noise in the image can be reduced when the image is captured. After the captured images are synthesized, the brightness of the obtained first image is adjusted. In order to improve the brightness of the first image, the brightness of the image can be ensured, and the noise in the image can be reduced, thereby improving the quality of the photo.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to these drawings without creative work.
图1是本发明实施例提供的拍照方法的流程示意图。FIG. 1 is a schematic flowchart of a photographing method provided by an embodiment of the present invention.
图2是本发明实施例提供的拍照方法的另一流程示意图。Fig. 2 is another schematic flowchart of the photographing method provided by the embodiment of the present invention.
图3是本发明实施例提供的拍照方法的又一流程示意图。Fig. 3 is another schematic flowchart of the photographing method provided by the embodiment of the present invention.
图4是本发明实施例提供的拍照方法的应用场景示意图。Fig. 4 is a schematic diagram of an application scenario of a photographing method provided by an embodiment of the present invention.
图5是本发明实施例提供的拍照方法的另一应用场景示意图。Fig. 5 is a schematic diagram of another application scenario of the photographing method provided by the embodiment of the present invention.
图6是本发明实施例提供的拍照装置的结构示意图。FIG. 6 is a schematic structural diagram of a photographing device provided by an embodiment of the present invention.
图7是本发明实施例提供的拍照装置的另一结构示意图。Fig. 7 is another structural schematic diagram of the photographing device provided by the embodiment of the present invention.
图8是本发明实施例提供的拍照装置的又一结构示意图。Fig. 8 is another schematic structural diagram of the photographing device provided by the embodiment of the present invention.
图9是本发明实施例提供的终端的结构示意图。FIG. 9 is a schematic structural diagram of a terminal provided by an embodiment of the present invention.
图10是本发明实施例提供的终端的另一结构示意图。FIG. 10 is another schematic structural diagram of a terminal provided by an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Apparently, the described embodiments are only some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.
本发明的说明书和权利要求书以及上述附图中的术语“第一”、“第二”、“第三”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应当理解,这样描述的对象在适当情况下可以互换。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含。例如,包含了一系列步骤的过程、方法或包含了一系列模块或单元的装置、终端、系统不必限于清楚地列出的那些步骤或模块或单元,还可以包括没有清楚地列出的步骤或模块或单元,也可以包括对于这些过程、方法、装置、终端或系统固有的其它步骤或模块或单元。The terms "first", "second", "third", etc. (if any) in the description and claims of the present invention and the above drawings are used to distinguish similar objects and not necessarily to describe a specific order or sequentially. It should be understood that the items so described are interchangeable under appropriate circumstances. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, a method comprising a series of steps, or a device, a terminal, a system comprising a series of modules or units are not necessarily limited to those steps or modules or units clearly listed, and may also include steps or units not clearly listed. A module or unit may also include other steps or modules or units inherent to these processes, methods, apparatuses, terminals or systems.
本发明实施例提供一种拍照方法,该方法可以应用于终端中。该终端可以是智能手机、平板电脑等设备。如图1所示,该拍照方法,可以包括以下步骤:An embodiment of the present invention provides a photographing method, which can be applied to a terminal. The terminal may be a device such as a smart phone or a tablet computer. As shown in Figure 1, the photographing method may include the following steps:
S110,当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度。S110, when the ambient brightness value is less than a preset threshold, determine the sensitivity of the camera according to the ambient brightness value.
其中,环境亮度值用于表示终端所处环境的环境亮度强弱。终端中可以设置环境亮度传感器。通过该环境亮度传感器来采集环境亮度值。预设阈值可以是预先设置并存储在终端中的一个环境亮度数值。例如,该预设阈值可以为500lx(勒克斯)。当终端通过传感器检测到环境亮度值小于预设阈值时,此时可认为终端处于较暗的环境中。此时,终端可以控制终端中的摄像头开启暗光拍摄模式,从而根据环境亮度值确定摄像头的感光度。Wherein, the ambient brightness value is used to indicate the intensity of the ambient brightness of the environment where the terminal is located. An ambient brightness sensor may be set in the terminal. The ambient brightness value is collected by the ambient brightness sensor. The preset threshold may be an ambient brightness value that is preset and stored in the terminal. For example, the preset threshold may be 500 lx (lux). When the terminal detects through the sensor that the ambient brightness value is lower than the preset threshold, it may be considered that the terminal is in a relatively dark environment at this time. At this time, the terminal can control the camera in the terminal to turn on the low-light shooting mode, so as to determine the sensitivity of the camera according to the ambient brightness value.
感光度用于表示摄像头对环境光线的灵敏程度。通常,对于数码相机、智能手机等电子设备而言,摄像头的感光度范围在50至6400之间。终端可以对摄像头的感光度进行调节。Sensitivity is used to indicate the sensitivity of the camera to ambient light. Generally, for electronic devices such as digital cameras and smart phones, the sensitivity range of the camera is between 50 and 6400. The terminal can adjust the sensitivity of the camera.
在一些实施例中,终端中的摄像头可以对环境亮度进行自动感应,从而自动调节感光度。环境亮度值越小,摄像头的感光度越大。当摄像头自动调节的感光度大于预设的感光度阈值时,也可以判断为终端所处环境的环境亮度值小于上述预设阈值,也即终端处于较暗的环境中。此时,终端也可以控制终端中的摄像头开启暗光拍摄模式,从而根据环境亮度值确定摄像头的感光度。In some embodiments, the camera in the terminal can automatically sense the ambient brightness, so as to automatically adjust the sensitivity. The smaller the ambient brightness value, the greater the sensitivity of the camera. When the sensitivity automatically adjusted by the camera is greater than the preset sensitivity threshold, it can also be determined that the ambient brightness value of the environment where the terminal is located is smaller than the preset threshold, that is, the terminal is in a relatively dark environment. At this time, the terminal may also control the camera in the terminal to turn on the low-light shooting mode, so as to determine the sensitivity of the camera according to the ambient brightness value.
在一些实施例中,如图2所示,当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度可以包括以下步骤:In some embodiments, as shown in FIG. 2, when the ambient brightness value is less than a preset threshold, determining the sensitivity of the camera according to the ambient brightness value may include the following steps:
S111,当环境亮度值小于预设阈值时,获取摄像头的第一感光度;S111, when the ambient brightness value is less than a preset threshold, acquire the first sensitivity of the camera;
S112,根据该环境亮度值获取感光度调节量;S112. Obtain a sensitivity adjustment amount according to the ambient brightness value;
S113,根据该感光度调节量下调该摄像头的该第一感光度,以确定该摄像头的该感光度。S113. Decrease the first sensitivity of the camera according to the sensitivity adjustment amount, so as to determine the sensitivity of the camera.
其中,终端中的摄像头设置有第一感光度。例如,摄像头的第一感光度为1000。当每次开启摄像头时,摄像头进行初始化的过程中将自身感光度设置为该第一感光度。当终端检测出环境亮度值小于预设阈值时,获取该摄像头的第一感光度。Wherein, the camera in the terminal is set with a first sensitivity. For example, the first sensitivity of the camera is 1000. When the camera is turned on each time, the camera sets its own sensitivity to the first sensitivity during initialization. When the terminal detects that the ambient brightness value is less than the preset threshold, the first light sensitivity of the camera is acquired.
终端中可以预先设置环境亮度值与感光度调节量之间的对应关系。其中,感光度调节量表示感光度的调节幅度。感光度调节量可以为一个感光度数值,例如200。感光度调节量也可以是一个百分比,例如20%。终端可以根据检测到的环境亮度值以及该对应关系获取感光度调节量。随后,终端根据该感光度调节量下调该摄像头的该第一感光度,以确定该摄像头的该感光度。例如,获取到的摄像头的第一感光度为1000,感光度调节量为200,则下调后的摄像头的感光度为800。The corresponding relationship between the ambient brightness value and the photosensitivity adjustment amount can be preset in the terminal. Wherein, the sensitivity adjustment amount represents the adjustment range of the sensitivity. The sensitivity adjustment amount may be a sensitivity value, such as 200. The photosensitivity adjustment amount can also be a percentage, such as 20%. The terminal may acquire the sensitivity adjustment amount according to the detected ambient brightness value and the corresponding relationship. Subsequently, the terminal lowers the first sensitivity of the camera according to the sensitivity adjustment amount, so as to determine the sensitivity of the camera. For example, if the obtained first sensitivity of the camera is 1000, and the sensitivity adjustment amount is 200, then the adjusted sensitivity of the camera is 800.
在一些实施例中,终端可以将该第一感光度下调该感光度调节量的倍数,以确定该摄像头的该感光度。例如,获取到的摄像头的第一感光度为1000,感光度调节量为200,下调幅度为感光度调节量的两倍,则下调后的摄像头的感光度为600。In some embodiments, the terminal may lower the first sensitivity by a multiple of the sensitivity adjustment amount, so as to determine the sensitivity of the camera. For example, the obtained first sensitivity of the camera is 1000, the adjustment amount of the sensitivity is 200, and the downward adjustment range is twice the adjustment amount of the sensitivity, then the adjusted sensitivity of the camera is 600.
在一些实施例中,环境亮度值与感光度调节量之间的对应关系可以是如表1所示的对应关系:In some embodiments, the corresponding relationship between the ambient brightness value and the sensitivity adjustment amount may be the corresponding relationship shown in Table 1:
表1Table 1
在一些实施例中,如图3所示,当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度可以包括以下步骤:In some embodiments, as shown in FIG. 3, when the ambient brightness value is less than a preset threshold, determining the sensitivity of the camera according to the ambient brightness value may include the following steps:
S114,当环境亮度值小于预设阈值时,根据该环境亮度值获取第二感光度;S114, when the ambient brightness value is less than a preset threshold, acquire a second sensitivity according to the ambient brightness value;
S115,将摄像头的感光度调节为该第二感光度。S115. Adjust the sensitivity of the camera to the second sensitivity.
其中,终端中可以预先设置环境亮度值与第二感光度之间的对应关系。当终端检测到环境亮度值小于预设阈值时,根据检测到的环境亮度值以及该对应关系获取第二感光度。随后,将摄像头的感光度调节为该第二感光度。例如,终端获取到的第二感光度为800,则将摄像头的感光度调节为800。Wherein, the corresponding relationship between the ambient brightness value and the second sensitivity can be preset in the terminal. When the terminal detects that the ambient brightness value is less than the preset threshold, the terminal acquires the second sensitivity according to the detected ambient brightness value and the corresponding relationship. Subsequently, the sensitivity of the camera is adjusted to the second sensitivity. For example, if the second sensitivity acquired by the terminal is 800, the sensitivity of the camera is adjusted to 800.
在一些实施例中,环境亮度值与第二感光度之间的对应关系可以是如表2所示的对应关系:In some embodiments, the corresponding relationship between the ambient brightness value and the second sensitivity may be the corresponding relationship shown in Table 2:
表2Table 2
S120,获取该摄像头在该感光度条件下拍摄的多帧图像。S120. Acquire multiple frames of images captured by the camera under the sensitivity condition.
其中,终端确定摄像头的感光度后,控制该摄像头在该感光度条件下拍摄多帧图像,并获取摄像头拍摄的多帧图像。该多帧图像为至少两帧。例如,终端控制摄像头以该感光度拍摄4帧图像。Wherein, after determining the sensitivity of the camera, the terminal controls the camera to capture multiple frames of images under the condition of the sensitivity, and acquires the multiple frames of images captured by the camera. The multi-frame images are at least two frames. For example, the terminal controls the camera to capture 4 frames of images at this sensitivity.
S130,从该多帧图像中选取至少两帧图像进行合成,以得到第一图像。S130. Select at least two frames of images from the multiple frames of images and combine them to obtain a first image.
其中,终端中可以预先设置一个选取数量,该选取数量小于或等于上述多帧图像的图像数量。例如,拍摄的多帧图像为4帧图像时,该选取数量可以是两帧。终端控制摄像头拍摄多帧图像后,可以从拍摄的多帧图像中根据该选取数量来选取至少两帧图像进行合成,以得到第一图像。终端进行图像合成后,合成的第一图像的图像质量优于选取的至少两帧图像中每一帧图像的图像质量。Wherein, a selected number may be preset in the terminal, and the selected number is less than or equal to the image number of the above-mentioned multi-frame images. For example, when the captured multiple frames of images are 4 frames of images, the selected number may be two frames. After the terminal controls the camera to capture multiple frames of images, at least two frames of images may be selected from the captured multiple frames of images according to the selected number for synthesis to obtain the first image. After the terminal performs image synthesis, the image quality of the synthesized first image is better than the image quality of each frame of the selected at least two frames of images.
其中,终端可以将获取的多帧图像逐一进行对比,根据该预设的选取数量选取其中亮度最高的至少两帧图像进行合成,以得到第一图像。Wherein, the terminal may compare the acquired multiple frames of images one by one, select at least two frames of images with the highest brightness according to the preset selection number, and synthesize them to obtain the first image.
在一些实施例中,如图2所示,从该多帧图像中选取至少两帧图像进行合成,以得到第一图像,包括以下步骤:In some embodiments, as shown in FIG. 2 , selecting at least two frames of images from the multi-frame images for synthesis to obtain the first image includes the following steps:
S131,将该多帧图像进行合成,以得到第一图像。S131. Synthesize the multiple frames of images to obtain a first image.
其中,终端控制摄像头拍摄多帧图像后,将该多帧图像进行合成,也即选取该多帧图像中的所有图像进行合成,以得到第一图像。Wherein, after the terminal controls the camera to capture multiple frames of images, the multiple frames of images are synthesized, that is, all images in the multiple frames of images are selected and synthesized to obtain the first image.
S140,根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,该第二图像的亮度大于该第一图像的亮度。S140. Adjust the brightness of the first image according to a preset adjustment parameter to obtain a second image, where the brightness of the second image is greater than the brightness of the first image.
其中,终端合成第一图像后,根据预设调节参数对该第一图像的亮度进行调节。预设调节参数为预先设置并存储在终端中的一个数值。预设调节参数大于1。调节后得到的第二图像的亮度大于该第一图像的亮度。Wherein, after synthesizing the first image, the terminal adjusts the brightness of the first image according to a preset adjustment parameter. The preset adjustment parameter is a value preset and stored in the terminal. The preset adjustment parameter is greater than 1. The adjusted brightness of the second image is greater than the brightness of the first image.
相对于正常环境中的拍摄而言,由于摄像头在终端处于较暗的环境时采用较低的感光度进行拍摄,此时拍摄的图像曝光度不足,从而第一图像的亮度较暗。根据该预设调节参数对第一图像的亮度进行调节后可以提高第一图像的亮度,从而弥补曝光不足造成的图像亮度较暗。另一方面,终端处于较暗的环境时,摄像头采用较低的感光度拍摄,能够减少图像中的噪点,从而提高图像的质量。对第一图像进行调节后得到的第二图像即为拍照过程最终得到的照片。Compared with shooting in a normal environment, since the camera uses a lower sensitivity to shoot when the terminal is in a darker environment, the exposure of the captured image at this time is insufficient, so the brightness of the first image is relatively dark. After the brightness of the first image is adjusted according to the preset adjustment parameter, the brightness of the first image can be increased, so as to compensate for the darker image brightness caused by underexposure. On the other hand, when the terminal is in a darker environment, the camera adopts a lower sensitivity to shoot, which can reduce noise in the image, thereby improving image quality. The second image obtained after adjusting the first image is the final photo obtained during the photographing process.
参考图4和图5,其中图4所示为第一图像,图5所示为第二图像。终端处于较暗的环境时,采用较低的感光度拍摄获取的第一图像亮度较暗,对第一图像的亮度进行调节后,得到的第二图像亮度被提升。Referring to FIG. 4 and FIG. 5 , wherein FIG. 4 shows the first image, and FIG. 5 shows the second image. When the terminal is in a relatively dark environment, the brightness of the first image captured by shooting with a low sensitivity is relatively dark, and after the brightness of the first image is adjusted, the brightness of the obtained second image is increased.
在一些实施例中,如图2所示,根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,包括以下步骤:In some embodiments, as shown in FIG. 2 , adjusting the brightness of the first image according to preset adjustment parameters to obtain the second image includes the following steps:
S141,根据预设调节参数以预设算法对该第一图像的每一像素点的亮度进行调节,以得到第二图像。S141. Adjust the brightness of each pixel of the first image with a preset algorithm according to a preset adjustment parameter to obtain a second image.
其中,第一图像中具有大量的像素点。例如,第一图像中可以具有500万个像素点。终端可以根据上述预设调节参数以预设算法依次对该第一图像中的每一个像素点的亮度进行调节。例如,可以根据预设调节参数将每一个像素点的亮度值进行放大。对每一个像素点的亮度均进行调节后,得到的图像即为第二图像。Wherein, the first image has a large number of pixels. For example, there may be 5 million pixels in the first image. The terminal may sequentially adjust the brightness of each pixel in the first image with a preset algorithm according to the above preset adjustment parameters. For example, the brightness value of each pixel can be amplified according to preset adjustment parameters. After the brightness of each pixel is adjusted, the obtained image is the second image.
在一些实施例中,如图3所示,根据预设调节参数以预设算法对该第一图像的每一像素点的亮度进行调节,包括以下步骤:In some embodiments, as shown in FIG. 3 , adjusting the brightness of each pixel of the first image with a preset algorithm according to preset adjustment parameters includes the following steps:
S1411,对该第一图像的每一像素点的初始亮度值进行归一化,以得到每一像素点的归一化亮度值;S1411. Normalize the initial luminance value of each pixel of the first image to obtain a normalized luminance value of each pixel;
S1412,根据预设调节参数以预设算法依次对每一像素点的归一化亮度值进行调节,以得到每一像素点调节后的归一化亮度值;S1412, sequentially adjust the normalized brightness value of each pixel according to the preset adjustment parameter with a preset algorithm, so as to obtain the adjusted normalized brightness value of each pixel;
S1413,依次对每一像素点调节后的归一化亮度值进行还原,以得到每一像素点调节后的亮度值。S1413. Restore the adjusted normalized luminance value of each pixel in sequence to obtain the adjusted luminance value of each pixel.
其中,归一化指的是将像素点的亮度值除以255,从而将像素点的亮度数值调整到0至1之间,即得到归一化亮度值。Wherein, the normalization refers to dividing the brightness value of the pixel point by 255, so as to adjust the brightness value of the pixel point between 0 and 1, that is, to obtain the normalized brightness value.
终端可以对第一图像的每一像素点的初始亮度值进行归一化,以得到每一像素点的归一化亮度值。The terminal may perform normalization on the initial brightness value of each pixel of the first image to obtain a normalized brightness value of each pixel.
然后根据预设调节参数以预设算法依次对每一像素点的归一化亮度值进行调节,以得到每一像素点调节后的归一化亮度值。例如,可以根据预设调节参数将每一像素点的归一化亮度值进行放大。Then, the normalized luminance value of each pixel is adjusted sequentially with a preset algorithm according to the preset adjustment parameters, so as to obtain the adjusted normalized luminance value of each pixel. For example, the normalized brightness value of each pixel can be amplified according to preset adjustment parameters.
最后,依次对每一像素点的调节后的归一化亮度值进行还原,以得到每一像素点调节后的亮度值。其中,还原指的是将调节后的归一化亮度值乘以255,从而将像素点的亮度数值调整到0至255之间。Finally, the adjusted normalized luminance value of each pixel is sequentially restored to obtain the adjusted luminance value of each pixel. Wherein, restoration refers to multiplying the adjusted normalized brightness value by 255, so as to adjust the brightness value of the pixel to be between 0 and 255.
在一些实施例中,根据预设调节参数以预设算法依次对每一像素点的归一化亮度值进行调节时,根据以下公式进行调节:In some embodiments, when the normalized luminance value of each pixel is adjusted sequentially with a preset algorithm according to preset adjustment parameters, the adjustment is performed according to the following formula:
其中,v(x,y)为(x,y)坐标处的像素点调节后的归一化亮度值,w(x,y)为(x,y)坐标处的像素点调节前的归一化亮度值,β为上述预设调节参数。其中,β大于1。Among them, v(x, y) is the normalized brightness value of the pixel at the (x, y) coordinate after adjustment, and w(x, y) is the normalized brightness value of the pixel at the (x, y) coordinate before adjustment Brightness value, β is the preset adjustment parameter mentioned above. Among them, β is greater than 1.
终端得到每一像素点调节后的归一化亮度值v(x,y)后,将该归一化亮度值v(x,y)乘以255即可得到(x,y)坐标处的像素点调节后的亮度值。终端依次调节并得到每一像素点调节后的亮度值后,即得到第二图像。After the terminal obtains the adjusted normalized brightness value v(x, y) of each pixel, multiply the normalized brightness value v(x, y) by 255 to obtain the pixel at the (x, y) coordinates Click the adjusted brightness value. After the terminal adjusts sequentially and obtains the adjusted brightness value of each pixel, the second image is obtained.
具体实施时,本发明不受所描述的各个步骤的执行顺序的限制,在不产生冲突的情况下,某些步骤还可以采用其它顺序进行或者同时进行。During specific implementation, the present invention is not limited by the execution order of the described steps, and some steps may be performed in other orders or simultaneously if no conflict arises.
由上可知,本发明实施例提供的拍照方法,当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度;获取该摄像头在该感光度条件下拍摄的多帧图像;从该多帧图像中选取至少两帧图像进行合成,以得到第一图像;根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,该第二图像的亮度大于该第一图像的亮度。该方案在终端处于较暗的环境时,根据环境亮度值来确定感光度,在拍摄图像时可以减少图像中的噪点,将拍摄的图像进行合成后,对得到的第一图像的亮度进行调节,以提高第一图像的亮度,从而既能够保证图像的亮度,又能够减少图像中的噪点,由此可以提高照片的质量。As can be seen from the above, in the photographing method provided by the embodiments of the present invention, when the ambient brightness value is less than the preset threshold value, the sensitivity of the camera is determined according to the ambient brightness value; multiple frames of images taken by the camera under the sensitivity condition are obtained; Select at least two frames of images from the multi-frame images to synthesize to obtain a first image; adjust the brightness of the first image according to a preset adjustment parameter to obtain a second image, the brightness of the second image is greater than that of the first image The brightness of the image. In this solution, when the terminal is in a relatively dark environment, the sensitivity is determined according to the ambient brightness value, and the noise in the image can be reduced when the image is captured. After the captured images are synthesized, the brightness of the obtained first image is adjusted. In order to improve the brightness of the first image, the brightness of the image can be ensured, and the noise in the image can be reduced, thereby improving the quality of the photo.
本发明实施例还提供一种拍照装置,该装置可以集成在终端中,该终端可以是智能手机、平板电脑等设备。The embodiment of the present invention also provides a photographing device, which can be integrated into a terminal, and the terminal can be a smart phone, a tablet computer or other equipment.
如图6所示,拍照装置200可以包括:确定模块201、获取模块202、合成模块203以及调节模块204。As shown in FIG. 6 , the photographing device 200 may include: a determination module 201 , an acquisition module 202 , a combination module 203 and an adjustment module 204 .
确定模块201,用于当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度。The determination module 201 is configured to determine the sensitivity of the camera according to the ambient brightness value when the ambient brightness value is less than a preset threshold.
其中,环境亮度值用于表示终端所处环境的环境亮度强弱。终端中可以设置环境亮度传感器。通过该环境亮度传感器来采集环境亮度值。预设阈值可以是预先设置并存储在终端中的一个环境亮度数值。例如,该预设阈值可以为500lx(勒克斯)。当终端通过传感器检测到环境亮度值小于预设阈值时,此时可认为终端处于较暗的环境中。此时,确定模块201可以控制终端中的摄像头开启暗光拍摄模式,从而根据环境亮度值确定摄像头的感光度。Wherein, the ambient brightness value is used to indicate the intensity of the ambient brightness of the environment where the terminal is located. An ambient brightness sensor may be set in the terminal. The ambient brightness value is collected by the ambient brightness sensor. The preset threshold may be an ambient brightness value that is preset and stored in the terminal. For example, the preset threshold may be 500 lx (lux). When the terminal detects through the sensor that the ambient brightness value is lower than the preset threshold, it may be considered that the terminal is in a relatively dark environment at this time. At this time, the determination module 201 may control the camera in the terminal to turn on the low-light shooting mode, so as to determine the sensitivity of the camera according to the ambient brightness value.
感光度用于表示摄像头对环境光线的灵敏程度。通常,对于数码相机、智能手机等电子设备而言,摄像头的感光度范围在50至6400之间。确定模块201可以对摄像头的感光度进行调节。Sensitivity is used to indicate the sensitivity of the camera to ambient light. Generally, for electronic devices such as digital cameras and smart phones, the sensitivity range of the camera is between 50 and 6400. The determination module 201 can adjust the sensitivity of the camera.
在一些实施例中,终端中的摄像头可以对环境亮度进行自动感应,从而自动调节感光度。环境亮度值越小,摄像头的感光度越大。当摄像头自动调节的感光度大于预设的感光度阈值时,也可以判断为终端所处环境的环境亮度值小于上述预设阈值,也即终端处于较暗的环境中。此时,确定模块201也可以控制终端中的摄像头开启暗光拍摄模式,从而根据环境亮度值确定摄像头的感光度。In some embodiments, the camera in the terminal can automatically sense the ambient brightness, so as to automatically adjust the sensitivity. The smaller the ambient brightness value, the greater the sensitivity of the camera. When the sensitivity automatically adjusted by the camera is greater than the preset sensitivity threshold, it can also be determined that the ambient brightness value of the environment where the terminal is located is smaller than the preset threshold, that is, the terminal is in a relatively dark environment. At this time, the determination module 201 may also control the camera in the terminal to turn on the low-light shooting mode, so as to determine the sensitivity of the camera according to the ambient brightness value.
在一些实施例中,如图7所示,确定模块201包括:第一获取子模块2011、第二获取子模块2012、第二调节子模块2013。In some embodiments, as shown in FIG. 7 , the determination module 201 includes: a first acquisition submodule 2011 , a second acquisition submodule 2012 , and a second adjustment submodule 2013 .
第一获取子模块2011,用于当环境亮度值小于预设阈值时,获取摄像头的第一感光度;The first acquisition sub-module 2011 is used to acquire the first sensitivity of the camera when the ambient brightness value is less than a preset threshold;
第二获取子模块2012,用于根据该环境亮度值获取感光度调节量;The second acquisition sub-module 2012 is used to acquire the sensitivity adjustment amount according to the ambient brightness value;
第一调节子模块2013,用于根据该感光度调节量下调该摄像头的该第一感光度,以确定该摄像头的该感光度。The first adjustment sub-module 2013 is configured to lower the first sensitivity of the camera according to the sensitivity adjustment amount, so as to determine the sensitivity of the camera.
其中,终端中的摄像头设置有第一感光度。例如,摄像头的第一感光度为1000。当每次开启摄像头时,摄像头进行初始化的过程中将自身感光度设置为该第一感光度。当终端检测出环境亮度值小于预设阈值时,第一获取子模块2011获取该摄像头的第一感光度。Wherein, the camera in the terminal is set with a first sensitivity. For example, the first sensitivity of the camera is 1000. When the camera is turned on each time, the camera sets its own sensitivity to the first sensitivity during initialization. When the terminal detects that the ambient brightness value is less than the preset threshold, the first acquiring submodule 2011 acquires the first sensitivity of the camera.
终端中可以预先设置环境亮度值与感光度调节量之间的对应关系。其中,感光度调节量表示感光度的调节幅度。感光度调节量可以为一个感光度数值,例如200。感光度调节量也可以是一个百分比,例如20%。第二获取子模块2012可以根据检测到的环境亮度值以及该对应关系获取感光度调节量。随后,第一调节子模块2013根据该感光度调节量下调该摄像头的该第一感光度,以确定该摄像头的该感光度。例如,获取到的摄像头的第一感光度为1000,感光度调节量为200,则下调后的摄像头的感光度为800。The corresponding relationship between the ambient brightness value and the photosensitivity adjustment amount can be preset in the terminal. Wherein, the sensitivity adjustment amount represents the adjustment range of the sensitivity. The sensitivity adjustment amount may be a sensitivity value, such as 200. The photosensitivity adjustment amount can also be a percentage, such as 20%. The second acquiring sub-module 2012 can acquire the photosensitivity adjustment amount according to the detected ambient brightness value and the corresponding relationship. Subsequently, the first adjustment sub-module 2013 lowers the first sensitivity of the camera according to the sensitivity adjustment amount, so as to determine the sensitivity of the camera. For example, if the obtained first sensitivity of the camera is 1000, and the sensitivity adjustment amount is 200, then the adjusted sensitivity of the camera is 800.
在一些实施例中,第一调节子模块2013可以将该第一感光度下调该感光度调节量的倍数,以确定该摄像头的该感光度。例如,获取到的摄像头的第一感光度为1000,感光度调节量为200,下调幅度为感光度调节量的两倍,则下调后的摄像头的感光度为600。In some embodiments, the first adjustment sub-module 2013 may lower the first sensitivity by a multiple of the sensitivity adjustment amount, so as to determine the sensitivity of the camera. For example, the obtained first sensitivity of the camera is 1000, the adjustment amount of the sensitivity is 200, and the downward adjustment range is twice the adjustment amount of the sensitivity, then the adjusted sensitivity of the camera is 600.
在一些实施例中,如图8所示,确定模块201包括:第三获取子模块2014、第二调节子模块2015。In some embodiments, as shown in FIG. 8 , the determining module 201 includes: a third acquiring submodule 2014 and a second adjusting submodule 2015 .
第三获取子模块2014,用于当环境亮度值小于预设阈值时,根据该环境亮度值获取第二感光度;The third acquiring sub-module 2014 is used to acquire the second sensitivity according to the ambient brightness value when the ambient brightness value is less than the preset threshold;
第二调节子模块2015,用于将摄像头的感光度调节为该第二感光度。The second adjustment sub-module 2015 is configured to adjust the sensitivity of the camera to the second sensitivity.
其中,终端中可以预先设置环境亮度值与第二感光度之间的对应关系。当终端检测到环境亮度值小于预设阈值时,第三获取子模块2014根据检测到的环境亮度值以及该对应关系获取第二感光度。随后,第二调节子模块2015将摄像头的感光度调节为该第二感光度。例如,第三获取子模块2014获取到的第二感光度为800,则第二调节子模块2015将摄像头的感光度调节为800。Wherein, the corresponding relationship between the ambient brightness value and the second sensitivity can be preset in the terminal. When the terminal detects that the ambient brightness value is less than the preset threshold, the third acquiring submodule 2014 acquires the second sensitivity according to the detected ambient brightness value and the corresponding relationship. Subsequently, the second adjusting sub-module 2015 adjusts the sensitivity of the camera to the second sensitivity. For example, if the second sensitivity acquired by the third acquisition sub-module 2014 is 800, then the second adjustment sub-module 2015 adjusts the sensitivity of the camera to 800.
获取模块202,用于获取该摄像头在该感光度条件下拍摄的多帧图像。The acquiring module 202 is configured to acquire multiple frames of images captured by the camera under the sensitivity condition.
其中,确定模块201确定摄像头的感光度后,获取模块202控制该摄像头在该感光度条件下拍摄多帧图像,并获取该摄像头拍摄的多帧图像。该多帧图像为至少两帧。例如,获取模块202控制摄像头以该感光度拍摄4帧图像。Wherein, after the determination module 201 determines the sensitivity of the camera, the acquisition module 202 controls the camera to capture multiple frames of images under the condition of the sensitivity, and acquires the multiple frames of images captured by the camera. The multi-frame images are at least two frames. For example, the acquisition module 202 controls the camera to capture 4 frames of images at the sensitivity.
合成模块203,用于从该多帧图像中选取至少两帧图像进行合成,以得到第一图像。The synthesizing module 203 is configured to select at least two frames of images from the multiple frames of images and synthesize them to obtain a first image.
其中,终端中可以预先设置一个选取数量,该选取数量小于或等于上述多帧图像的图像数量。例如,拍摄的多帧图像为4帧图像时,该选取数量可以是两帧。获取模块202控制摄像头拍摄多帧图像后,合成模块203可以从拍摄的多帧图像中根据该选取数量来选取至少两帧图像进行合成,以得到第一图像。进行图像合成后,合成的第一图像的图像质量优于选取的至少两帧图像中每一帧图像的图像质量。Wherein, a selected number may be preset in the terminal, and the selected number is less than or equal to the image number of the above-mentioned multi-frame images. For example, when the captured multiple frames of images are 4 frames of images, the selected number may be two frames. After the acquisition module 202 controls the camera to capture multiple frames of images, the synthesis module 203 may select at least two frames of images from the captured multiple frames of images according to the selected number for synthesis to obtain the first image. After the image synthesis is performed, the image quality of the synthesized first image is better than the image quality of each frame of the selected at least two frames of images.
其中,合成模块203可以将获取的多帧图像逐一进行对比,根据该预设的选取数量选取其中亮度最高的至少两帧图像进行合成,以得到第一图像。Wherein, the synthesizing module 203 can compare the acquired multiple frames of images one by one, select at least two frames of images with the highest brightness according to the preset selected number, and synthesize them to obtain the first image.
在一些实施例中,合成模块203用于执行以下步骤:In some embodiments, the synthesis module 203 is used to perform the following steps:
将该多帧图像进行合成,以得到第一图像。The multiple frames of images are synthesized to obtain a first image.
其中,获取模块202控制摄像头拍摄多帧图像后,合成模块203将该多帧图像进行合成,也即选取该多帧图像中的所有图像进行合成,以得到第一图像。Wherein, after the acquisition module 202 controls the camera to capture multiple frames of images, the synthesis module 203 synthesizes the multiple frames of images, that is, selects all images in the multiple frames of images to synthesize to obtain the first image.
调节模块204,用于根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,该第二图像的亮度大于该第一图像的亮度。The adjustment module 204 is configured to adjust the brightness of the first image according to preset adjustment parameters to obtain a second image, the brightness of the second image is greater than the brightness of the first image.
其中,合成模块203合成第一图像后,调节模块204根据预设调节参数对该第一图像的亮度进行调节。预设调节参数为预先设置并存储在终端中的一个数值。预设调节参数大于1。调节后得到的第二图像的亮度大于该第一图像的亮度。Wherein, after the synthesis module 203 synthesizes the first image, the adjustment module 204 adjusts the brightness of the first image according to preset adjustment parameters. The preset adjustment parameter is a value preset and stored in the terminal. The preset adjustment parameter is greater than 1. The adjusted brightness of the second image is greater than the brightness of the first image.
相对于正常环境中的拍摄而言,由于摄像头在终端处于较暗的环境时采用较低的感光度进行拍摄,此时拍摄的图像曝光度不足,从而第一图像的亮度较暗。根据该预设调节参数对第一图像的亮度进行调节后可以提高第一图像的亮度,从而弥补曝光不足造成的图像亮度较暗。另一方面,终端处于较暗的环境时,摄像头采用较低的感光度拍摄,能够减少图像中的噪点,从而提高图像的质量。对第一图像进行调节后得到的第二图像即为拍照过程最终得到的照片。Compared with shooting in a normal environment, since the camera uses a lower sensitivity to shoot when the terminal is in a darker environment, the exposure of the captured image at this time is insufficient, so the brightness of the first image is relatively dark. After the brightness of the first image is adjusted according to the preset adjustment parameter, the brightness of the first image can be increased, so as to compensate for the darker image brightness caused by underexposure. On the other hand, when the terminal is in a darker environment, the camera adopts a lower sensitivity to shoot, which can reduce noise in the image, thereby improving image quality. The second image obtained after adjusting the first image is the final photo obtained during the photographing process.
在一些实施例中,调节模块204根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像时,执行以下步骤:In some embodiments, when the adjustment module 204 adjusts the brightness of the first image according to preset adjustment parameters to obtain the second image, the following steps are performed:
根据预设调节参数以预设算法对该第一图像的每一像素点的亮度进行调节,以得到第二图像。The brightness of each pixel of the first image is adjusted with a preset algorithm according to preset adjustment parameters to obtain a second image.
其中,第一图像中具有大量的像素点。例如,第一图像中可以具有500万个像素点。调节模块204可以根据上述预设调节参数以预设算法依次对该第一图像中的每一个像素点的亮度进行调节。例如,可以根据预设调节参数将每一个像素点的亮度值进行放大。对每一个像素点的亮度均进行调节后,得到的图像即为第二图像。Wherein, the first image has a large number of pixels. For example, there may be 5 million pixels in the first image. The adjustment module 204 may sequentially adjust the brightness of each pixel in the first image according to the preset adjustment parameters and a preset algorithm. For example, the brightness value of each pixel can be amplified according to preset adjustment parameters. After the brightness of each pixel is adjusted, the obtained image is the second image.
在一些实施例中,调节模块204根据预设调节参数以预设算法对该第一图像的每一像素点的亮度进行调节时,执行以下步骤:In some embodiments, when the adjustment module 204 adjusts the brightness of each pixel of the first image with a preset algorithm according to preset adjustment parameters, the following steps are performed:
对该第一图像的每一像素点的初始亮度值进行归一化,以得到每一像素点的归一化亮度值;normalizing the initial luminance value of each pixel of the first image to obtain a normalized luminance value of each pixel;
根据预设调节参数以预设算法依次对每一像素点的归一化亮度值进行调节,以得到每一像素点调节后的归一化亮度值;adjusting the normalized luminance value of each pixel in sequence according to the preset adjustment parameters with a preset algorithm to obtain the adjusted normalized luminance value of each pixel;
依次对每一像素点调节后的归一化亮度值进行还原,以得到每一像素点调节后的亮度值。The adjusted normalized luminance value of each pixel is sequentially restored to obtain the adjusted luminance value of each pixel.
其中,归一化指的是将像素点的亮度值除以255,从而将像素点的亮度数值调整到0至1之间,即得到归一化亮度值。Wherein, the normalization refers to dividing the brightness value of the pixel point by 255, so as to adjust the brightness value of the pixel point between 0 and 1, that is, to obtain the normalized brightness value.
调节模块204可以对第一图像的每一像素点的初始亮度值进行归一化,以得到每一像素点的归一化亮度值。The adjustment module 204 can normalize the initial brightness value of each pixel of the first image to obtain a normalized brightness value of each pixel.
然后根据预设调节参数以预设算法依次对每一像素点的归一化亮度值进行调节,以得到每一像素点调节后的归一化亮度值。例如,可以根据预设调节参数将每一像素点的归一化亮度值进行放大。Then, the normalized luminance value of each pixel is adjusted sequentially with a preset algorithm according to the preset adjustment parameters, so as to obtain the adjusted normalized luminance value of each pixel. For example, the normalized brightness value of each pixel can be amplified according to preset adjustment parameters.
最后,依次对每一像素点的调节后的归一化亮度值进行还原,以得到每一像素点调节后的亮度值。其中,还原指的是将调节后的归一化亮度值乘以255,从而将像素点的亮度数值调整到0至255之间。Finally, the adjusted normalized luminance value of each pixel is sequentially restored to obtain the adjusted luminance value of each pixel. Wherein, restoration refers to multiplying the adjusted normalized brightness value by 255, so as to adjust the brightness value of the pixel to be between 0 and 255.
在一些实施例中,调节模块204根据预设调节参数以预设算法依次对每一像素点的归一化亮度值进行调节时,根据以下公式进行调节:In some embodiments, when the adjustment module 204 sequentially adjusts the normalized brightness value of each pixel according to the preset adjustment parameters and the preset algorithm, the adjustment is performed according to the following formula:
其中,v(x,y)为(x,y)坐标处的像素点调节后的归一化亮度值,w(x,y)为(x,y)坐标处的像素点调节前的归一化亮度值,β为上述预设调节参数。其中,β大于1。Among them, v(x, y) is the normalized brightness value of the pixel at the (x, y) coordinate after adjustment, and w(x, y) is the normalized brightness value of the pixel at the (x, y) coordinate before adjustment Brightness value, β is the preset adjustment parameter mentioned above. Among them, β is greater than 1.
调节模块204得到每一像素点调节后的归一化亮度值v(x,y)后,将该归一化亮度值v(x,y)乘以255即可得到(x,y)坐标处的像素点调节后的亮度值。调节模块204依次调节并得到每一像素点调节后的亮度值后,即得到第二图像。After the adjustment module 204 obtains the adjusted normalized luminance value v(x, y) of each pixel, multiply the normalized luminance value v(x, y) by 255 to obtain the (x, y) coordinate The adjusted brightness value of the pixel. The adjustment module 204 sequentially adjusts and obtains the adjusted brightness value of each pixel, and then obtains the second image.
具体实施时,以上各个模块可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现。During specific implementation, each of the above modules may be implemented as an independent entity, or may be combined arbitrarily to be implemented as the same or several entities.
由上可知,本发明实施例提供的拍照装置200,当环境亮度值小于预设阈值时,确定模块201根据该环境亮度值确定摄像头的感光度;获取模块202获取该摄像头在该感光度条件下拍摄的多帧图像;合成模块203从该多帧图像中选取至少两帧图像进行合成,以得到第一图像;调节模块204根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,该第二图像的亮度大于该第一图像的亮度。该方案在终端处于较暗的环境时,根据环境亮度值来确定感光度,在拍摄图像时可以减少图像中的噪点,将拍摄的图像进行合成后,对得到的第一图像的亮度进行调节,以提高第一图像的亮度,从而既能够保证图像的亮度,又能够减少图像中的噪点,由此可以提高照片的质量。As can be seen from the above, in the photographing device 200 provided by the embodiment of the present invention, when the ambient brightness value is less than the preset threshold value, the determining module 201 determines the sensitivity of the camera according to the ambient brightness value; The multi-frame images taken; the synthesis module 203 selects at least two frames of images from the multi-frame images to synthesize to obtain the first image; the adjustment module 204 adjusts the brightness of the first image according to preset adjustment parameters to obtain the first image Two images, the brightness of the second image is greater than the brightness of the first image. In this solution, when the terminal is in a relatively dark environment, the sensitivity is determined according to the ambient brightness value, and the noise in the image can be reduced when the image is captured. After the captured images are synthesized, the brightness of the obtained first image is adjusted. In order to improve the brightness of the first image, the brightness of the image can be ensured, and the noise in the image can be reduced, thereby improving the quality of the photo.
本发明实施例还提供一种终端。该终端可以是智能手机、平板电脑等设备。如图9所示,终端300包括处理器301、存储器302、摄像头303以及控制电路304。其中,处理器301分别与存储器302、摄像头303以及控制电路304电性连接。The embodiment of the present invention also provides a terminal. The terminal may be a device such as a smart phone or a tablet computer. As shown in FIG. 9 , the terminal 300 includes a processor 301 , a memory 302 , a camera 303 and a control circuit 304 . Wherein, the processor 301 is electrically connected to the memory 302 , the camera 303 and the control circuit 304 respectively.
处理器301是终端300的控制中心,利用各种接口和线路连接整个终端的各个部分,通过运行或加载存储在存储器302内的应用程序,以及调用存储在存储器302内的数据,执行终端的各种功能和处理数据,从而对终端进行整体监控。The processor 301 is the control center of the terminal 300. It uses various interfaces and lines to connect various parts of the entire terminal. By running or loading the application programs stored in the memory 302 and calling the data stored in the memory 302, various functions of the terminal are executed. Various functions and processing data, so as to monitor the terminal as a whole.
在本实施例中,终端300中的处理器301会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行程序代码加载到存储器302中,并由处理器301来运行存储在存储器302中的应用程序,从而实现各种功能:In this embodiment, the processor 301 in the terminal 300 loads the executable program code corresponding to the process of one or more application programs into the memory 302 according to the following instructions, and the processor 301 executes the executable program code stored in the The application program in memory 302, thereby realizes various functions:
当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度;When the ambient brightness value is less than the preset threshold, determine the sensitivity of the camera according to the ambient brightness value;
获取该摄像头在该感光度条件下拍摄的多帧图像;Obtain multiple frames of images captured by the camera under the sensitivity condition;
从该多帧图像中选取至少两帧图像进行合成,以得到第一图像;Selecting at least two frames of images from the multiple frames of images and synthesizing them to obtain a first image;
根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,该第二图像的亮度大于该第一图像的亮度。The brightness of the first image is adjusted according to a preset adjustment parameter to obtain a second image, and the brightness of the second image is greater than the brightness of the first image.
在一些实施例中,当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度时,处理器301执行以下步骤:当环境亮度值小于预设阈值时,获取摄像头的第一感光度;根据该环境亮度值获取感光度调节量;根据该感光度调节量下调该摄像头的该第一感光度,以确定该摄像头的该感光度。In some embodiments, when the ambient brightness value is less than the preset threshold, when determining the sensitivity of the camera according to the ambient brightness value, the processor 301 performs the following steps: when the ambient brightness value is smaller than the preset threshold, obtain the first Sensitivity: Acquiring a sensitivity adjustment amount according to the ambient brightness value; down-regulating the first sensitivity of the camera according to the adjustment amount of sensitivity, so as to determine the sensitivity of the camera.
在一些实施例中,当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度时,处理器301执行以下步骤:当环境亮度值小于预设阈值时,根据该环境亮度值获取第二感光度;将摄像头的感光度调节为该第二感光度。In some embodiments, when the ambient brightness value is less than a preset threshold, when determining the sensitivity of the camera according to the ambient brightness value, the processor 301 performs the following steps: when the ambient brightness value is smaller than the preset threshold, according to the ambient brightness value Obtain the second sensitivity; adjust the sensitivity of the camera to the second sensitivity.
在一些实施例中,从该多帧图像中选取至少两帧图像进行合成,以得到第一图像时,处理器301执行以下步骤:将该多帧图像进行合成,以得到第一图像。In some embodiments, when at least two frames of images are selected from the multiple frames of images to be synthesized to obtain the first image, the processor 301 performs the following steps: the multiple frames of images are synthesized to obtain the first image.
在一些实施例中,根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像时,处理器301执行以下步骤:根据预设调节参数以预设算法对该第一图像的每一像素点的亮度进行调节,以得到第二图像。In some embodiments, when the brightness of the first image is adjusted according to preset adjustment parameters to obtain the second image, the processor 301 performs the following steps: The brightness of each pixel is adjusted to obtain the second image.
在一些实施例中,根据预设调节参数以预设算法对该第一图像的每一像素点的亮度进行调节时,处理器301执行以下步骤:对该第一图像的每一像素点的初始亮度值进行归一化,以得到每一像素点的归一化亮度值;根据预设调节参数以预设算法依次对每一像素点的归一化亮度值进行调节,以得到每一像素点调节后的归一化亮度值;依次对每一像素点调节后的归一化亮度值进行还原,以得到每一像素点调节后的亮度值。In some embodiments, when the brightness of each pixel of the first image is adjusted with a preset algorithm according to preset adjustment parameters, the processor 301 performs the following steps: initializing each pixel of the first image The luminance value is normalized to obtain the normalized luminance value of each pixel; the normalized luminance value of each pixel is sequentially adjusted according to the preset adjustment parameters with the preset algorithm to obtain the normalized luminance value of each pixel The adjusted normalized luminance value; sequentially restore the adjusted normalized luminance value of each pixel to obtain the adjusted luminance value of each pixel.
在一些实施例中,根据预设调节参数以预设算法依次对每一像素点的归一化亮度值进行调节,以得到每一像素点调节后的归一化亮度值时,处理器301根据以下公式进行调节:In some embodiments, the normalized luminance value of each pixel is sequentially adjusted with a preset algorithm according to a preset adjustment parameter, so that when the adjusted normalized luminance value of each pixel is obtained, the processor 301 according to The following formula is adjusted:
其中,v(x,y)为(x,y)坐标处的像素点调节后的归一化亮度值,w(x,y)为(x,y)坐标处的像素点调节前的归一化亮度值,β为上述预设调节参数;其中,β大于1。Among them, v(x, y) is the normalized brightness value of the pixel at the (x, y) coordinate after adjustment, and w(x, y) is the normalized brightness value of the pixel at the (x, y) coordinate before adjustment luminance value, β is the above-mentioned preset adjustment parameter; wherein, β is greater than 1.
存储器302可用于存储应用程序和数据。存储器302存储的应用程序中包含有可执行程序代码。应用程序可以组成各种功能模块。处理器301通过运行存储在存储器302的应用程序,从而执行各种功能应用以及数据处理。Memory 302 may be used to store applications and data. The application programs stored in the memory 302 include executable program codes. Applications can be composed of various functional modules. The processor 301 executes various functional applications and data processing by running the application programs stored in the memory 302 .
摄像头303用于采集外部图像信息,从而拍摄图像。The camera 303 is used to collect external image information, so as to take images.
控制电路304可以与摄像头303逻辑连接,从而控制摄像头303拍摄图像。The control circuit 304 can be logically connected with the camera 303, so as to control the camera 303 to capture images.
在一些实施例中,如图10所示,终端300还包括:输入单元305、显示单元306、射频电路307、传感器308以及电源309。其中,处理器301分别与输入单元305、显示单元306、射频电路307、传感器308以及电源309电性连接。In some embodiments, as shown in FIG. 10 , the terminal 300 further includes: an input unit 305 , a display unit 306 , a radio frequency circuit 307 , a sensor 308 and a power supply 309 . Wherein, the processor 301 is electrically connected to the input unit 305 , the display unit 306 , the radio frequency circuit 307 , the sensor 308 and the power supply 309 .
输入单元305可用于接收用户输入的字符信息或用户特征信息(例如指纹)。其中,输入单元305可以包括指纹识别模组和触摸屏。指纹识别模组用于采集用户的指纹信息。触摸屏用于接收用户的触摸操作。The input unit 305 can be used to receive character information or user feature information (such as fingerprint) input by the user. Wherein, the input unit 305 may include a fingerprint identification module and a touch screen. The fingerprint identification module is used to collect the user's fingerprint information. The touch screen is used for receiving user's touch operation.
显示单元306可用于显示由用户输入的信息或提供给用户的信息以及终端的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。The display unit 306 can be used to display information input by the user or provided to the user, as well as various graphical user interfaces of the terminal. These graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof.
射频电路307可以通过无线网络与网络设备或其他电子设备通信,完成与网络设备或其他电子设备之间的信息收发。The radio frequency circuit 307 can communicate with network equipment or other electronic equipment through a wireless network, and complete information sending and receiving between the network equipment or other electronic equipment.
传感器308用于采集外部环境信息。传感器308可以包括环境亮度传感器、加速度传感器、陀螺仪等传感器中的一种或多种。The sensor 308 is used to collect external environment information. The sensor 308 may include one or more of sensors such as an ambient brightness sensor, an acceleration sensor, and a gyroscope.
电源309用于给终端300的各个部件供电。在一些实施例中,电源309可以通过电源管理系统与处理器301逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The power supply 309 is used to supply power to various components of the terminal 300 . In some embodiments, the power supply 309 may be logically connected to the processor 301 through a power management system, so as to implement functions such as managing charging, discharging, and power consumption through the power management system.
尽管图10中未示出,终端300还可以包括无线保真(WiFi)模块、蓝牙模块等,在此不再赘述。Although not shown in FIG. 10 , the terminal 300 may also include a wireless fidelity (WiFi) module, a Bluetooth module, etc., which will not be repeated here.
上述实施例中,对各个实施例的描述都各有侧重,某些实施例中没有详细描述的部分,可以参见前面对拍照方法的详细描述,在此不再赘述。In the above-mentioned embodiments, the description of each embodiment has its own emphases. For some parts that are not described in detail in some embodiments, please refer to the detailed description of the photographing method above, and will not be repeated here.
由上可知,本发明实施例提供了一种终端,当环境亮度值小于预设阈值时,根据该环境亮度值确定摄像头的感光度;获取该摄像头在该感光度条件下拍摄的多帧图像;从该多帧图像中选取至少两帧图像进行合成,以得到第一图像;根据预设调节参数对该第一图像的亮度进行调节,以得到第二图像,该第二图像的亮度大于该第一图像的亮度。该方案在终端处于较暗的环境时,根据环境亮度值来确定感光度,在拍摄图像时可以减少图像中的噪点,将拍摄的图像进行合成后,对得到的第一图像的亮度进行调节,以提高第一图像的亮度,从而既能够保证图像的亮度,又能够减少图像中的噪点,由此可以提高照片的质量。It can be seen from the above that the embodiment of the present invention provides a terminal, when the ambient brightness value is less than a preset threshold, determine the sensitivity of the camera according to the ambient brightness value; acquire multiple frames of images captured by the camera under the sensitivity condition; Selecting at least two frames of images from the multi-frame images to synthesize to obtain a first image; adjusting the brightness of the first image according to a preset adjustment parameter to obtain a second image, the brightness of the second image is greater than that of the first image The brightness of an image. In this solution, when the terminal is in a relatively dark environment, the sensitivity is determined according to the ambient brightness value, and the noise in the image can be reduced when the image is captured. After the captured images are synthesized, the brightness of the obtained first image is adjusted. In order to improve the brightness of the first image, the brightness of the image can be ensured, and the noise in the image can be reduced, thereby improving the quality of the photo.
需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,存储介质可以包括但不限于:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。It should be noted that those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. The medium may include but not limited to: a read only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and the like.
以上对本发明实施例所提供的拍照方法、装置及终端进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The photographing method, device, and terminal provided by the embodiments of the present invention have been described in detail above. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The descriptions of the above embodiments are only used to help understand the present invention. method and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. limits.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710401746.7ACN107087118B (en) | 2017-05-31 | 2017-05-31 | Photographing method, device, storage medium and terminal |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710401746.7ACN107087118B (en) | 2017-05-31 | 2017-05-31 | Photographing method, device, storage medium and terminal |
| Publication Number | Publication Date |
|---|---|
| CN107087118Atrue CN107087118A (en) | 2017-08-22 |
| CN107087118B CN107087118B (en) | 2019-10-25 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710401746.7AExpired - Fee RelatedCN107087118B (en) | 2017-05-31 | 2017-05-31 | Photographing method, device, storage medium and terminal |
| Country | Link |
|---|---|
| CN (1) | CN107087118B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107509044A (en)* | 2017-08-31 | 2017-12-22 | 广东欧珀移动通信有限公司 | Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment |
| CN107566746A (en)* | 2017-09-12 | 2018-01-09 | 广东小天才科技有限公司 | Photographing method and user terminal |
| CN107820025A (en)* | 2017-12-13 | 2018-03-20 | 北京小米移动软件有限公司 | Take pictures the method and apparatus of processing |
| CN108111755A (en)* | 2017-12-20 | 2018-06-01 | 广东技术师范学院 | A kind of recognition methods of picked angle of human body and device |
| CN110086993A (en)* | 2019-04-30 | 2019-08-02 | 努比亚技术有限公司 | Image processing method, device, mobile terminal and computer readable storage medium |
| CN110992284A (en)* | 2019-11-29 | 2020-04-10 | Oppo广东移动通信有限公司 | Image processing method, image processing apparatus, electronic device, and computer-readable storage medium |
| CN112396574A (en)* | 2019-08-02 | 2021-02-23 | 浙江宇视科技有限公司 | License plate image quality processing method and device, storage medium and electronic equipment |
| US11228720B2 (en) | 2018-08-13 | 2022-01-18 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Method for imaging controlling, electronic device, and non-transitory computer-readable storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20130201390A1 (en)* | 2012-02-08 | 2013-08-08 | Pentax Ricoh Imaging Company, Ltd. | Dark exposure control device |
| CN103379281A (en)* | 2012-04-20 | 2013-10-30 | 佳能株式会社 | Image processing apparatus and image processing method for performing image synthesis |
| CN103581566A (en)* | 2012-07-30 | 2014-02-12 | 三星电子株式会社 | Image capturing method and image capturing device |
| CN103685971A (en)* | 2012-09-13 | 2014-03-26 | 佳能株式会社 | Camera device and control method thereof |
| CN106060249A (en)* | 2016-05-19 | 2016-10-26 | 维沃移动通信有限公司 | Shooting anti-shaking method and mobile terminal |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20130201390A1 (en)* | 2012-02-08 | 2013-08-08 | Pentax Ricoh Imaging Company, Ltd. | Dark exposure control device |
| CN103379281A (en)* | 2012-04-20 | 2013-10-30 | 佳能株式会社 | Image processing apparatus and image processing method for performing image synthesis |
| CN103581566A (en)* | 2012-07-30 | 2014-02-12 | 三星电子株式会社 | Image capturing method and image capturing device |
| CN103685971A (en)* | 2012-09-13 | 2014-03-26 | 佳能株式会社 | Camera device and control method thereof |
| CN106060249A (en)* | 2016-05-19 | 2016-10-26 | 维沃移动通信有限公司 | Shooting anti-shaking method and mobile terminal |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107509044A (en)* | 2017-08-31 | 2017-12-22 | 广东欧珀移动通信有限公司 | Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment |
| CN107509044B (en)* | 2017-08-31 | 2020-08-18 | Oppo广东移动通信有限公司 | Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment |
| CN107566746A (en)* | 2017-09-12 | 2018-01-09 | 广东小天才科技有限公司 | Photographing method and user terminal |
| CN107566746B (en)* | 2017-09-12 | 2020-09-04 | 广东小天才科技有限公司 | Photographing method and user terminal |
| CN107820025A (en)* | 2017-12-13 | 2018-03-20 | 北京小米移动软件有限公司 | Take pictures the method and apparatus of processing |
| CN108111755A (en)* | 2017-12-20 | 2018-06-01 | 广东技术师范学院 | A kind of recognition methods of picked angle of human body and device |
| US11228720B2 (en) | 2018-08-13 | 2022-01-18 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Method for imaging controlling, electronic device, and non-transitory computer-readable storage medium |
| CN110086993A (en)* | 2019-04-30 | 2019-08-02 | 努比亚技术有限公司 | Image processing method, device, mobile terminal and computer readable storage medium |
| CN110086993B (en)* | 2019-04-30 | 2021-09-07 | 努比亚技术有限公司 | Image processing method, image processing device, mobile terminal and computer readable storage medium |
| CN112396574A (en)* | 2019-08-02 | 2021-02-23 | 浙江宇视科技有限公司 | License plate image quality processing method and device, storage medium and electronic equipment |
| CN112396574B (en)* | 2019-08-02 | 2024-02-02 | 浙江宇视科技有限公司 | License plate image quality processing method and device, storage medium and electronic equipment |
| CN110992284A (en)* | 2019-11-29 | 2020-04-10 | Oppo广东移动通信有限公司 | Image processing method, image processing apparatus, electronic device, and computer-readable storage medium |
| Publication number | Publication date |
|---|---|
| CN107087118B (en) | 2019-10-25 |
| Publication | Publication Date | Title |
|---|---|---|
| CN107087118B (en) | Photographing method, device, storage medium and terminal | |
| KR102149453B1 (en) | Electronic device and method for acquiring image | |
| US11563889B2 (en) | Electronic device and method for controlling camera using external electronic device | |
| KR102149187B1 (en) | Electronic device and control method of the same | |
| CN111418201B (en) | Shooting method and equipment | |
| CN108668093B (en) | HDR image generation method and device | |
| CN110033418B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
| US11457160B2 (en) | Electronic device and method for adjusting color of image data by using infrared sensor | |
| CN105450932B (en) | Backlight photographic method and device | |
| CN107147851B (en) | Photo processing method, apparatus, computer-readable storage medium, and electronic device | |
| KR20160038460A (en) | Electronic device and control method of the same | |
| CN113411498B (en) | Image shooting method, mobile terminal and storage medium | |
| TWI505233B (en) | Image processing method and image processing device | |
| US10972676B2 (en) | Image processing method and electronic device capable of optimizing hdr image by using depth information | |
| US10009545B2 (en) | Image processing apparatus and method of operating the same | |
| US20170118407A1 (en) | Method and device for generating images | |
| CN116055712B (en) | Method, device, chip, electronic device and medium for determining film formation rate | |
| US10122937B2 (en) | Method and apparatus for processing image obtained by camera | |
| CN114424520A (en) | Image processing method and electronic device supporting the same | |
| CN107454340B (en) | Image synthesis method and device based on high dynamic range principle and mobile terminal | |
| KR20210101941A (en) | Electronic device and method for generating high dynamic range images | |
| TWI604413B (en) | Image processing method and image processing device | |
| CN108401119B (en) | An image processing method, mobile terminal and related media products | |
| CN113422893B (en) | Image acquisition method and device, storage medium and mobile terminal | |
| US20160292825A1 (en) | System and method to refine image data |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information | Address after:Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after:GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before:Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before:GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. | |
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee | ||
| CF01 | Termination of patent right due to non-payment of annual fee | Granted publication date:20191025 |